Revert incorrect RCL_3 drop: RCL_3 PDK_3.0.2
authorPat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:30:02 +0100
branchRCL_3
changeset 25 4f0867e42d62
parent 24 8e7494275d3a
child 26 3e6957da2ff8
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
connectivitymodules/SeCon/apple/S60_RnD_32.phoneplugin/Contents/Info.plist
connectivitymodules/SeCon/apple/S60_RnD_32.phoneplugin/Contents/Resources/MetaClasses.plist
connectivitymodules/SeCon/apple/S60_RnD_32.phoneplugin/Contents/Resources/PhoneConduit.plist
connectivitymodules/SeCon/apple/S60_RnD_32.phoneplugin/Contents/Resources/SyncEngine.plist
connectivitymodules/SeCon/apple/S60_RnD_32.phoneplugin/Contents/Resources/com.nokia.S6032.tiff
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Archive.bom
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Archive.pax.gz
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Info.plist
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/PkgInfo
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/Description.plist
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/English.lproj/ReadMe.rtf
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/IFRequirement.strings
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/PhonePlugin.info
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/TokenDefinitions.plist
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/Welcome.rtf
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/en.lproj/Description.plist
connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/package_version
connectivitymodules/SeCon/apple/S60_RnD_32.ppdoc/Icon.tiff
connectivitymodules/SeCon/apple/S60_RnD_32.ppdoc/InstallerReadMe-en.rtf
connectivitymodules/SeCon/apple/S60_RnD_32.ppdoc/Properties.plist
connectivitymodules/SeCon/catalogspcconnectivityplugin/bwins/catalogspcconnectivitypluginu.def
connectivitymodules/SeCon/catalogspcconnectivityplugin/eabi/catalogspcconnectivitypluginu.def
connectivitymodules/SeCon/catalogspcconnectivityplugin/group/bld.inf
connectivitymodules/SeCon/catalogspcconnectivityplugin/group/catalogspcconnectivityplugin.mmp
connectivitymodules/SeCon/catalogspcconnectivityplugin/inc/catalogspcconnectivityclient.h
connectivitymodules/SeCon/catalogspcconnectivityplugin/inc/catalogspcconnectivitydefines.h
connectivitymodules/SeCon/catalogspcconnectivityplugin/inc/catalogspcconnectivityplugin.h
connectivitymodules/SeCon/catalogspcconnectivityplugin/src/catalogspcconnectivityclient.cpp
connectivitymodules/SeCon/catalogspcconnectivityplugin/src/catalogspcconnectivityplugin.cpp
connectivitymodules/SeCon/clients/pcconn/bld/bld.inf
connectivitymodules/SeCon/clients/pcconn/bld/def/bwinscwu.def
connectivitymodules/SeCon/clients/pcconn/bld/def/eabiuu.def
connectivitymodules/SeCon/clients/pcconn/bld/sconpcconnclient.mmp
connectivitymodules/SeCon/clients/pcconn/inc/sconpcconnclient.h
connectivitymodules/SeCon/clients/pcconn/src/sconpcconnclient.cpp
connectivitymodules/SeCon/clients/syncclient/bwins/sconsyncclientu.def
connectivitymodules/SeCon/clients/syncclient/eabi/sconsyncclientu.def
connectivitymodules/SeCon/clients/syncclient/group/bld.inf
connectivitymodules/SeCon/clients/syncclient/group/sconsyncclient.mmp
connectivitymodules/SeCon/clients/syncclient/inc/scondataproviderinfo.h
connectivitymodules/SeCon/clients/syncclient/inc/sconsyncclient.h
connectivitymodules/SeCon/clients/syncclient/rom/sconsyncclient.iby
connectivitymodules/SeCon/clients/syncclient/src/scondataproviderinfo.cpp
connectivitymodules/SeCon/clients/syncclient/src/sconsyncclient.cpp
connectivitymodules/SeCon/cntparser/bld/bld.inf
connectivitymodules/SeCon/cntparser/bld/cntparsersrv.mmp
connectivitymodules/SeCon/cntparser/bld/cntparsersrvexe.mmp
connectivitymodules/SeCon/cntparser/bld/def/bwinscwu.def
connectivitymodules/SeCon/cntparser/bld/def/eabiuu.def
connectivitymodules/SeCon/cntparser/inc/clientserver.h
connectivitymodules/SeCon/cntparser/inc/cntparserclient.h
connectivitymodules/SeCon/cntparser/inc/cntparsercollector.h
connectivitymodules/SeCon/cntparser/inc/cntparserinfolog.h
connectivitymodules/SeCon/cntparser/inc/cntparserserver.h
connectivitymodules/SeCon/cntparser/inc/cntparserserversession.h
connectivitymodules/SeCon/cntparser/inc/irmcconsts.h
connectivitymodules/SeCon/cntparser/rom/cntparser.iby
connectivitymodules/SeCon/cntparser/src/cntparserclient.cpp
connectivitymodules/SeCon/cntparser/src/cntparsercollector.cpp
connectivitymodules/SeCon/cntparser/src/cntparserinfolog.cpp
connectivitymodules/SeCon/cntparser/src/cntparserserverexe.cpp
connectivitymodules/SeCon/cntparser/src/cntparserserversession.cpp
connectivitymodules/SeCon/common/conmltask/inc/sconconmltask.h
connectivitymodules/SeCon/common/conmltask/src/sconconmltask.cpp
connectivitymodules/SeCon/group/bld.inf
connectivitymodules/SeCon/group/stubs/createstubs.bat
connectivitymodules/SeCon/group/stubs/sconftpplugin_stub.pkg
connectivitymodules/SeCon/group/stubs/sconftpplugin_stub.sis
connectivitymodules/SeCon/group/stubs/sconpcconnplugin_stub.pkg
connectivitymodules/SeCon/group/stubs/sconpcconnplugin_stub.sis
connectivitymodules/SeCon/group/stubs/secon_stub.pkg
connectivitymodules/SeCon/group/stubs/secon_stub.sis
connectivitymodules/SeCon/inc/debug.h
connectivitymodules/SeCon/plugins/ftp/bld/bld.inf
connectivitymodules/SeCon/plugins/ftp/bld/def/bwinscwU.DEF
connectivitymodules/SeCon/plugins/ftp/bld/def/eabiU.DEF
connectivitymodules/SeCon/plugins/ftp/bld/sconftpplugin.mmp
connectivitymodules/SeCon/plugins/ftp/inc/sconftpplugin.h
connectivitymodules/SeCon/plugins/ftp/inc/sconftppluginutils.h
connectivitymodules/SeCon/plugins/ftp/inc/sconservicetimer.h
connectivitymodules/SeCon/plugins/ftp/inc/sconshutdownwatcher.h
connectivitymodules/SeCon/plugins/ftp/rom/sconftpplugin.iby
connectivitymodules/SeCon/plugins/ftp/src/101f9686.rss
connectivitymodules/SeCon/plugins/ftp/src/proxy.cpp
connectivitymodules/SeCon/plugins/ftp/src/sconftpplugin.cpp
connectivitymodules/SeCon/plugins/ftp/src/sconftppluginutils.cpp
connectivitymodules/SeCon/plugins/ftp/src/sconservicetimer.cpp
connectivitymodules/SeCon/plugins/ftp/src/sconshutdownwatcher.cpp
connectivitymodules/SeCon/plugins/hapticsconnplugin/data/2001FE54.rss
connectivitymodules/SeCon/plugins/hapticsconnplugin/group/bld.inf
connectivitymodules/SeCon/plugins/hapticsconnplugin/group/hapticsconnplugin.mmp
connectivitymodules/SeCon/plugins/hapticsconnplugin/inc/hapticsbridgeclient.h
connectivitymodules/SeCon/plugins/hapticsconnplugin/inc/hapticsconnplugin.h
connectivitymodules/SeCon/plugins/hapticsconnplugin/inc/hapticsconntimer.h
connectivitymodules/SeCon/plugins/hapticsconnplugin/inc/hapticsconntrace.h
connectivitymodules/SeCon/plugins/hapticsconnplugin/inc/hapticsmsghandler.h
connectivitymodules/SeCon/plugins/hapticsconnplugin/rom/hapticsconnplugin.iby
connectivitymodules/SeCon/plugins/hapticsconnplugin/src/hapticsbridgeclient.cpp
connectivitymodules/SeCon/plugins/hapticsconnplugin/src/hapticsconnplugin.cpp
connectivitymodules/SeCon/plugins/hapticsconnplugin/src/hapticsconntimer.cpp
connectivitymodules/SeCon/plugins/hapticsconnplugin/src/hapticsmsghandler.cpp
connectivitymodules/SeCon/plugins/hapticsconnplugin/src/proxy.cpp
connectivitymodules/SeCon/plugins/pcconn/bld/bld.inf
connectivitymodules/SeCon/plugins/pcconn/bld/def/bwinscwu.def
connectivitymodules/SeCon/plugins/pcconn/bld/def/eabiu.def
connectivitymodules/SeCon/plugins/pcconn/bld/sconpcconnplugin.mmp
connectivitymodules/SeCon/plugins/pcconn/inc/sconpcconnplugin.h
connectivitymodules/SeCon/plugins/pcconn/inc/sconpcconnpluginutils.h
connectivitymodules/SeCon/plugins/pcconn/inc/sconservicetimer.h
connectivitymodules/SeCon/plugins/pcconn/inc/sconshutdownwatcher.h
connectivitymodules/SeCon/plugins/pcconn/rom/sconpcconnplugin.iby
connectivitymodules/SeCon/plugins/pcconn/src/101f9688.rss
connectivitymodules/SeCon/plugins/pcconn/src/proxy.cpp
connectivitymodules/SeCon/plugins/pcconn/src/sconpcconnplugin.cpp
connectivitymodules/SeCon/plugins/pcconn/src/sconpcconnpluginutils.cpp
connectivitymodules/SeCon/plugins/pcconn/src/sconservicetimer.cpp
connectivitymodules/SeCon/plugins/pcconn/src/sconshutdownwatcher.cpp
connectivitymodules/SeCon/rom/sconpcconnclientserver.iby
connectivitymodules/SeCon/servers/pcconn/bld/bld.inf
connectivitymodules/SeCon/servers/pcconn/bld/sconpcconnserver.mmp
connectivitymodules/SeCon/servers/pcconn/inc/sconbtengine.h
connectivitymodules/SeCon/servers/pcconn/inc/sconfolderlister.h
connectivitymodules/SeCon/servers/pcconn/inc/sconimsireader.h
connectivitymodules/SeCon/servers/pcconn/inc/sconpcconnclientserver.h
connectivitymodules/SeCon/servers/pcconn/inc/sconpcconnserver.h
connectivitymodules/SeCon/servers/pcconn/src/sconbtengine.cpp
connectivitymodules/SeCon/servers/pcconn/src/sconfolderlister.cpp
connectivitymodules/SeCon/servers/pcconn/src/sconimsireader.cpp
connectivitymodules/SeCon/servers/pcconn/src/sconpcconnserver.cpp
connectivitymodules/SeCon/servers/syncserver/group/bld.inf
connectivitymodules/SeCon/servers/syncserver/group/sconsyncserver.mmp
connectivitymodules/SeCon/servers/syncserver/inc/cscontimeout.h
connectivitymodules/SeCon/servers/syncserver/inc/debug.h
connectivitymodules/SeCon/servers/syncserver/inc/logdatastoreformat.h
connectivitymodules/SeCon/servers/syncserver/inc/sconasynchandler.h
connectivitymodules/SeCon/servers/syncserver/inc/sconsyncclientserver.h
connectivitymodules/SeCon/servers/syncserver/inc/sconsyncrelationship.h
connectivitymodules/SeCon/servers/syncserver/inc/sconsyncserver.h
connectivitymodules/SeCon/servers/syncserver/inc/sconsyncsession.h
connectivitymodules/SeCon/servers/syncserver/rom/sconsyncserver.iby
connectivitymodules/SeCon/servers/syncserver/src/cscontimeout.cpp
connectivitymodules/SeCon/servers/syncserver/src/sconasynchandler.cpp
connectivitymodules/SeCon/servers/syncserver/src/sconsyncrelationship.cpp
connectivitymodules/SeCon/servers/syncserver/src/sconsyncserver.cpp
connectivitymodules/SeCon/servers/syncserver/src/sconsyncsession.cpp
connectivitymodules/SeCon/services/csc/bld/101f9698.xml
connectivitymodules/SeCon/services/csc/bld/101f99f6.xml
connectivitymodules/SeCon/services/csc/bld/bld.inf
connectivitymodules/SeCon/services/csc/bld/def/bwinscwu.def
connectivitymodules/SeCon/services/csc/bld/def/eabiuu.def
connectivitymodules/SeCon/services/csc/bld/fwdcomp.xml
connectivitymodules/SeCon/services/csc/bld/sconcsc.mmp
connectivitymodules/SeCon/services/csc/inc/capability.h
connectivitymodules/SeCon/services/csc/inc/capinfo.h
connectivitymodules/SeCon/services/csc/inc/caplist.h
connectivitymodules/SeCon/services/csc/inc/capparser.h
connectivitymodules/SeCon/services/csc/inc/caputils.h
connectivitymodules/SeCon/services/csc/inc/sconcsc.h
connectivitymodules/SeCon/services/csc/inc/sconsyncservice.h
connectivitymodules/SeCon/services/csc/inc/sconversioninfo.h
connectivitymodules/SeCon/services/csc/inc/stringlist.h
connectivitymodules/SeCon/services/csc/rom/sconcsc.iby
connectivitymodules/SeCon/services/csc/src/capinfo.cpp
connectivitymodules/SeCon/services/csc/src/caplist.cpp
connectivitymodules/SeCon/services/csc/src/capparser.cpp
connectivitymodules/SeCon/services/csc/src/caputils.cpp
connectivitymodules/SeCon/services/csc/src/sconcsc.cpp
connectivitymodules/SeCon/services/csc/src/sconsyncservice.cpp
connectivitymodules/SeCon/services/csc/src/sconversioninfo.cpp
connectivitymodules/SeCon/services/csc/src/stringlist.cpp
connectivitymodules/SeCon/services/ftp/bld/bld.inf
connectivitymodules/SeCon/services/ftp/bld/def/bwinscwu.def
connectivitymodules/SeCon/services/ftp/bld/def/eabiuu.def
connectivitymodules/SeCon/services/ftp/bld/sconftp.mmp
connectivitymodules/SeCon/services/ftp/inc/sconconstants.h
connectivitymodules/SeCon/services/ftp/inc/sconconsts.h
connectivitymodules/SeCon/services/ftp/inc/sconfshandler.h
connectivitymodules/SeCon/services/ftp/inc/sconftp.h
connectivitymodules/SeCon/services/ftp/inc/sconinboxhandler.h
connectivitymodules/SeCon/services/ftp/loc/sconftp.loc
connectivitymodules/SeCon/services/ftp/rom/sconftp.iby
connectivitymodules/SeCon/services/ftp/rom/sconftpresources.iby
connectivitymodules/SeCon/services/ftp/src/sconfshandler.cpp
connectivitymodules/SeCon/services/ftp/src/sconftp.cpp
connectivitymodules/SeCon/services/ftp/src/sconftp.rss
connectivitymodules/SeCon/services/ftp/src/sconinboxhandler.cpp
connectivitymodules/SeCon/services/oviaccounthandler/bwins/sconoviaccounthandleru.def
connectivitymodules/SeCon/services/oviaccounthandler/eabi/sconoviaccounthandleru.def
connectivitymodules/SeCon/services/oviaccounthandler/group/bld.inf
connectivitymodules/SeCon/services/oviaccounthandler/group/sconoviaccounthandler.mmp
connectivitymodules/SeCon/services/oviaccounthandler/inc/sconoviaccounthandler.h
connectivitymodules/SeCon/services/oviaccounthandler/rom/sconoviaccounthandler.iby
connectivitymodules/SeCon/services/oviaccounthandler/src/sconoviaccounthandler.cpp
connectivitymodules/SeCon/services/pcd/bld/bld.inf
connectivitymodules/SeCon/services/pcd/bld/def/bwinscwu.def
connectivitymodules/SeCon/services/pcd/bld/def/eabiuu.def
connectivitymodules/SeCon/services/pcd/bld/sbeconfig.xml
connectivitymodules/SeCon/services/pcd/bld/sconpcd.mmp
connectivitymodules/SeCon/services/pcd/inc/cscontimeout.h
connectivitymodules/SeCon/services/pcd/inc/sconbackuprestore.h
connectivitymodules/SeCon/services/pcd/inc/sconbrqueue.h
connectivitymodules/SeCon/services/pcd/inc/sconinstaller.h
connectivitymodules/SeCon/services/pcd/inc/sconinstqueue.h
connectivitymodules/SeCon/services/pcd/inc/sconmetadata.h
connectivitymodules/SeCon/services/pcd/inc/sconmetadatafielddefs.h
connectivitymodules/SeCon/services/pcd/inc/sconpcd.h
connectivitymodules/SeCon/services/pcd/inc/sconpcdconsts.h
connectivitymodules/SeCon/services/pcd/inc/sconpcdutility.h
connectivitymodules/SeCon/services/pcd/inc/sconqueue.h
connectivitymodules/SeCon/services/pcd/inc/sconsbeclient.h
connectivitymodules/SeCon/services/pcd/inc/sconsynchandler.h
connectivitymodules/SeCon/services/pcd/inc/sconvideoparser.h
connectivitymodules/SeCon/services/pcd/rom/sconpcd.iby
connectivitymodules/SeCon/services/pcd/src/cscontimeout.cpp
connectivitymodules/SeCon/services/pcd/src/sconbackuprestore.cpp
connectivitymodules/SeCon/services/pcd/src/sconbrqueue.cpp
connectivitymodules/SeCon/services/pcd/src/sconinstaller.cpp
connectivitymodules/SeCon/services/pcd/src/sconinstqueue.cpp
connectivitymodules/SeCon/services/pcd/src/sconmetadata.cpp
connectivitymodules/SeCon/services/pcd/src/sconpcd.cpp
connectivitymodules/SeCon/services/pcd/src/sconpcdutility.cpp
connectivitymodules/SeCon/services/pcd/src/sconqueue.cpp
connectivitymodules/SeCon/services/pcd/src/sconsbeclient.cpp
connectivitymodules/SeCon/services/pcd/src/sconsynchandler.cpp
connectivitymodules/SeCon/services/pcd/src/sconvideoparser.cpp
connectivitymodules/SeCon/wbxml/conmlhandler/bld/bld.inf
connectivitymodules/SeCon/wbxml/conmlhandler/bld/def/bwinscwu.def
connectivitymodules/SeCon/wbxml/conmlhandler/bld/def/eabiu.def
connectivitymodules/SeCon/wbxml/conmlhandler/bld/sconconmlhandler.mmp
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmldtd.h
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmlgenerator.h
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmlhandler.h
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmlhandlererror.h
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmltags.h
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconwbxmldefs.h
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconwbxmlparser.inl
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlelement.h
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlelement.inl
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.h
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.inl
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlworkspace.h
connectivitymodules/SeCon/wbxml/conmlhandler/src/sconconmldtd.cpp
connectivitymodules/SeCon/wbxml/conmlhandler/src/sconconmlgenerator.cpp
connectivitymodules/SeCon/wbxml/conmlhandler/src/sconconmlhandler.cpp
connectivitymodules/SeCon/wbxml/conmlhandler/src/sconxmlelement.cpp
connectivitymodules/SeCon/wbxml/conmlhandler/src/sconxmlworkspace.cpp
connectivitymodules/group/bld.inf
contentcontrol.pro
contentctrl_plat/adapter_customization_api/adapter_customization_api.metaxml
contentctrl_plat/adapter_customization_api/group/bld.inf
contentctrl_plat/adapter_customization_api/inc/MContactsModsFetcher.h
contentctrl_plat/adapter_customization_api/inc/NSmlContactsDataProvider.h
contentctrl_plat/adapter_customization_api/inc/NSmlContactsDataStore.h
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/bld.inf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmladaptertestutilities.cpp
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmladaptertestutilities.h
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydataprovider_test.cpp
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydataprovider_test.h
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastore_test.cpp
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastore_test.h
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastorewaiter.cpp
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastorewaiter.h
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummymodsfetcher_test.cpp
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummymodsfetcher_test.h
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/dllmain.cpp
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/basic.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/basicInvalid.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/basic_partial.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/email_type_issue.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/issue1_standard.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multioccurence.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multioccurence_partial.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multioccurence_partial2.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multipleVCards.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multipleVCards_Standard.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/photo_issue.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/standard.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/tel_type_issue.vcf
contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/ut_nsmldsdummyadapter.mmp
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydataprovider.loc
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydataprovider.rss
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydatastoreformat_1_1_2.rss
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydatastoreformat_1_2.rss
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/bld.inf
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/def/bwinscwdummydataprovideru.def
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/def/eabidummydataprovideru.def
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/nsmldummydataprovider.mmp
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummydataprovider.h
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummydatastore.h
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummymodsfetcher.h
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummyutility.h
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/readme.txt
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydataprovider.cpp
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydatastore.cpp
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydllmain.cpp
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummymodsfetcher.cpp
contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummyutility.cpp
contentctrl_plat/ds_agenda_handler_plugin_api/ds_agenda_handler_plugin_api.metaxml
contentctrl_plat/ds_agenda_handler_plugin_api/group/bld.inf
contentctrl_plat/ds_agenda_handler_plugin_api/inc/nsmlagendaadapterhandler.h
contentctrl_plat/ds_agenda_handler_plugin_api/inc/nsmlagendaadapterhandler.inl
contentctrl_plat/ds_contact_adapter_customization_api/ds_contact_adapter_customization_api.metaxml
contentctrl_plat/ds_contact_adapter_customization_api/group/bld.inf
contentctrl_plat/ds_contact_adapter_customization_api/inc/nsmlcontactsdataprovider.h
contentctrl_plat/ds_contact_adapter_customization_api/inc/nsmlcontactsdatastore.h
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/UT_nsmldummydataprovider.mmp
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/bld.inf
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmladaptertestutilities.cpp
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmladaptertestutilities.h
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydataprovider_test.cpp
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydataprovider_test.h
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydatastore_test.cpp
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydatastore_test.h
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydatastorewaiter.cpp
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydatastorewaiter.h
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/def/bwinscwcontactsdataprovider_testu.def
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/def/eabicontactsdataprovider_testu.def
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/dllmain.cpp
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/testdata/basic.vcf
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/testdata/standard.vcf
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydataprovider.loc
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydataprovider.rss
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydatastoreformat_1_1_2.rss
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydatastoreformat_1_2.rss
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/group/bld.inf
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/group/def/bwinscwdummydataprovideru.def
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/group/def/eabidummydataprovideru.def
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/group/nsmldummydataprovider.mmp
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummydataprovider.h
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummydatastore.h
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/readme.txt
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydataprovider.cpp
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydatastore.cpp
contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydllmain.cpp
contentctrl_plat/ds_contactsdatastoreextension_api/ds_contactsdatastoreextension_api.metaxml
contentctrl_plat/ds_contactsdatastoreextension_api/group/bld.inf
contentctrl_plat/ds_contactsdatastoreextension_api/inc/nsmlcontactsdatastoreextension.h
contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/bwins/TestCntDataStoreExtnu.def
contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/conf/TestCntDataStoreExtn.cfg
contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/eabi/TestCntDataStoreExtnu.def
contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/group/TestCntDataStoreExtn.mmp
contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/group/bld.inf
contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/inc/TestCntDataStoreExtn.h
contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/init/TestFramework.ini
contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/sis/TestCntDataStoreExtn.pkg
contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/src/TestCntDataStoreExtn.cpp
contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/src/TestCntDataStoreExtnBlocks.cpp
contentctrl_plat/ds_folder_util_api/ds_folder_util_api.metaxml
contentctrl_plat/ds_folder_util_api/group/bld.inf
contentctrl_plat/ds_folder_util_api/inc/nsmlfolderparser.h
contentctrl_plat/group/bld.inf
contentctrl_plat/oma_ds_presync_plugin_api/group/bld.inf
contentctrl_plat/oma_ds_presync_plugin_api/inc/CPreSyncPlugin.h
contentctrl_plat/oma_ds_presync_plugin_api/inc/CPreSyncPlugin.inl
contentctrl_plat/oma_ds_presync_plugin_api/oma_ds_presync_plugin_api.metaxml
dsdcmoadapter/group/nsmldsctrldcmoadapter.mmp
dsdcmoadapter/src/nsmldsctrldcmoadapter.cpp
group/bld.inf
layers.sysdef.xml
omads/group/bld.inf
omads/group/omads_stub.pkg
omads/group/omads_stub.sis
omads/omads.pro
omads/omadsappui/AiwSyncProvider/group/AiwSyncProvider.mmp
omads/omadsappui/AiwSyncProvider/group/bld.inf
omads/omadsappui/AiwSyncProvider/inc/AiwSyncProvider.h
omads/omadsappui/AiwSyncProvider/inc/AiwSyncProvider.rh
omads/omadsappui/AiwSyncProvider/inc/AiwSyncProviderDebug.h
omads/omadsappui/AiwSyncProvider/inc/AiwSyncProviderUids.hrh
omads/omadsappui/AiwSyncProvider/inc/AiwSyncProviderUtil.h
omads/omadsappui/AiwSyncProvider/src/101F871F.rss
omads/omadsappui/AiwSyncProvider/src/AiwSyncProvider.cpp
omads/omadsappui/AiwSyncProvider/src/AiwSyncProvider.rss
omads/omadsappui/AspPreSyncPlugin/data/AspPreSyncDefault.rss
omads/omadsappui/AspPreSyncPlugin/group/AspPreSyncDefault.mmp
omads/omadsappui/AspPreSyncPlugin/group/bld.inf
omads/omadsappui/AspPreSyncPlugin/inc/AspPreSyncDefaultPlugin.h
omads/omadsappui/AspPreSyncPlugin/src/AspPreSyncDefaultPlugin.cpp
omads/omadsappui/AspPreSyncPlugin/src/proxy.cpp
omads/omadsappui/AspScheduleHandler/group/aspschedulehandler.mmp
omads/omadsappui/AspScheduleHandler/group/bld.inf
omads/omadsappui/AspScheduleHandler/inc/AspDebug.h
omads/omadsappui/AspScheduleHandler/src/aspschedulehandler.cpp
omads/omadsappui/AspSyncUtil/BWINS/AspSyncUtilu.def
omads/omadsappui/AspSyncUtil/eabi/AspSyncUtilu.def
omads/omadsappui/AspSyncUtil/group/AspSyncUtil.mmp
omads/omadsappui/AspSyncUtil/group/aspsyncutil_icons.mk
omads/omadsappui/AspSyncUtil/group/aspsyncutil_icons_dc.mk
omads/omadsappui/AspSyncUtil/group/bld.inf
omads/omadsappui/AspSyncUtil/inc/AspAdvanceSettingsDialog.h
omads/omadsappui/AspSyncUtil/inc/AspAutoSyncHandler.h
omads/omadsappui/AspSyncUtil/inc/AspContentDialog.h
omads/omadsappui/AspSyncUtil/inc/AspContentListDialog.h
omads/omadsappui/AspSyncUtil/inc/AspDbNotifier.h
omads/omadsappui/AspSyncUtil/inc/AspDebug.h
omads/omadsappui/AspSyncUtil/inc/AspDefines.h
omads/omadsappui/AspSyncUtil/inc/AspDialogUtil.h
omads/omadsappui/AspSyncUtil/inc/AspFilter.h
omads/omadsappui/AspSyncUtil/inc/AspFilterDialog.h
omads/omadsappui/AspSyncUtil/inc/AspLogDialog.h
omads/omadsappui/AspSyncUtil/inc/AspPreSyncPluginInterface.h
omads/omadsappui/AspSyncUtil/inc/AspProfile.h
omads/omadsappui/AspSyncUtil/inc/AspProfileDialog.h
omads/omadsappui/AspSyncUtil/inc/AspProfileSelectionDialog.h
omads/omadsappui/AspSyncUtil/inc/AspProfileWizard.h
omads/omadsappui/AspSyncUtil/inc/AspProfileWizardDialog.h
omads/omadsappui/AspSyncUtil/inc/AspProgressDialog.h
omads/omadsappui/AspSyncUtil/inc/AspResHandler.h
omads/omadsappui/AspSyncUtil/inc/AspSchedule.h
omads/omadsappui/AspSyncUtil/inc/AspScheduleDialog.h
omads/omadsappui/AspSyncUtil/inc/AspSettingDialog.h
omads/omadsappui/AspSyncUtil/inc/AspSettingViewDialog.h
omads/omadsappui/AspSyncUtil/inc/AspState.h
omads/omadsappui/AspSyncUtil/inc/AspSyncHandler.h
omads/omadsappui/AspSyncUtil/inc/AspSyncUtil.h
omads/omadsappui/AspSyncUtil/inc/AspSyncUtil.rh
omads/omadsappui/AspSyncUtil/inc/AspSyncUtilApi.h
omads/omadsappui/AspSyncUtil/inc/AspUtil.h
omads/omadsappui/AspSyncUtil/inc/xxxxAspDebug.h
omads/omadsappui/AspSyncUtil/loc/NSmlDSSync.loc
omads/omadsappui/AspSyncUtil/loc/NSmlSyncProfiles.loc
omads/omadsappui/AspSyncUtil/src/AspAdvanceSettingsDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspAutoSyncHandler.cpp
omads/omadsappui/AspSyncUtil/src/AspContentDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspContentListDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspDbNotifier.cpp
omads/omadsappui/AspSyncUtil/src/AspDialogUtil.cpp
omads/omadsappui/AspSyncUtil/src/AspFilter.cpp
omads/omadsappui/AspSyncUtil/src/AspFilterDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspLogDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspPreSyncPluginInterface.cpp
omads/omadsappui/AspSyncUtil/src/AspProfile.cpp
omads/omadsappui/AspSyncUtil/src/AspProfileDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspProfileSelectionDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspProfileWizard.cpp
omads/omadsappui/AspSyncUtil/src/AspProfileWizardDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspProgressDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspResHandler.cpp
omads/omadsappui/AspSyncUtil/src/AspSchedule.cpp
omads/omadsappui/AspSyncUtil/src/AspScheduleDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspSettingDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspSettingViewDialog.cpp
omads/omadsappui/AspSyncUtil/src/AspState.cpp
omads/omadsappui/AspSyncUtil/src/AspSyncHandler.cpp
omads/omadsappui/AspSyncUtil/src/AspSyncUtil.cpp
omads/omadsappui/AspSyncUtil/src/AspSyncUtil.rss
omads/omadsappui/AspSyncUtil/src/AspSyncUtilApi.cpp
omads/omadsappui/AspSyncUtil/src/AspUtil.cpp
omads/omadsappui/OmaDsAppUiPlugin/BWinscw/OmaDsAppUiPluginu.def
omads/omadsappui/OmaDsAppUiPlugin/data/102833A1.rss
omads/omadsappui/OmaDsAppUiPlugin/data/NsmlDSGSPluginResource.rss
omads/omadsappui/OmaDsAppUiPlugin/eabi/OmaDsAppUiPluginu.def
omads/omadsappui/OmaDsAppUiPlugin/group/OmaDsAppUiPlugin.mmp
omads/omadsappui/OmaDsAppUiPlugin/group/OmaDsAppUiPlugin_icons_dc.mk
omads/omadsappui/OmaDsAppUiPlugin/group/bld.inf
omads/omadsappui/OmaDsAppUiPlugin/inc/OmaDsAppUiPluginInterface.h
omads/omadsappui/OmaDsAppUiPlugin/src/OmaDsAppUiPluginInterface.cpp
omads/omadsappui/OmaDsAppUiPlugin/src/OmaDsAppUiPluginProxy.cpp
omads/omadsappui/cenrep/keys_omadsui.xls
omads/omadsappui/conf/omadsui.confml
omads/omadsappui/conf/omadsui_101F9A1D.crml
omads/omadsappui/group/bld.inf
omads/omadsappui/help/data/xhtml.zip
omads/omadsappui/help/group/bld.inf
omads/omadsappui/help/inc/ds.hlp.hrh
omads/omadsappui/help/rom/omadsappuihelps_variant.iby
omads/omadsappui/rom/AspSyncProvider.iby
omads/omadsappui/rom/AspSyncProvider_Resources.iby
omads/omadsappui/rom/AspSyncUtil.iby
omads/omadsappui/rom/AspSyncUtil_Resources.iby
omads/omadsappui/rom/OmaDsAppUi.iby
omads/omadsappui/rom/OmaDsAppUiResources.iby
omads/omadsappui/ui/aif/NSmlDSSyncaif.rss
omads/omadsappui/ui/aif/context_pane_icon.bmp
omads/omadsappui/ui/aif/context_pane_icon_mask.bmp
omads/omadsappui/ui/aif/list_icon.bmp
omads/omadsappui/ui/aif/list_icon_mask.bmp
omads/omadsappui/ui/group/NSmlDSSync.mmp
omads/omadsappui/ui/group/aiwtestapp.SIS
omads/omadsappui/ui/group/bld.inf
omads/omadsappui/ui/group/omadsappui_icons.mk
omads/omadsappui/ui/group/omadsappui_icons_aif_bitmaps.mk
omads/omadsappui/ui/group/omadsappui_icons_aif_bitmaps_dc.mk
omads/omadsappui/ui/group/omadsappui_icons_aif_scalable.mk
omads/omadsappui/ui/group/omadsappui_icons_aif_scalable_dc.mk
omads/omadsappui/ui/group/omadsappui_icons_dc.mk
omads/omadsappui/ui/inc/NSmlDSSync.hrh
omads/omadsappui/ui/inc/NSmlDSSyncApp.h
omads/omadsappui/ui/inc/NSmlDSSyncAppServer.h
omads/omadsappui/ui/inc/NSmlDSSyncAppUi.h
omads/omadsappui/ui/inc/NSmlDSSyncContainer.h
omads/omadsappui/ui/inc/NSmlDSSyncDocument.h
omads/omadsappui/ui/src/NSmlDSSync.rss
omads/omadsappui/ui/src/NSmlDSSyncApp.cpp
omads/omadsappui/ui/src/NSmlDSSyncAppServer.cpp
omads/omadsappui/ui/src/NSmlDSSyncAppUi.cpp
omads/omadsappui/ui/src/NSmlDSSyncContainer.cpp
omads/omadsappui/ui/src/NSmlDSSyncDocument.cpp
omads/omadsappui/ui/src/NSmlDSSync_caption.rss
omads/omadsappui/ui/src/NSmlDSSync_reg.rss
omads/omadsappui/ui/src/NSmlDSSyncaif.rss
omads/omadsextensions/adapters/agenda/bld/nsmlagendadataprovider.mmp
omads/omadsextensions/adapters/agenda/inc/nsmlagendadataprovider.h
omads/omadsextensions/adapters/agenda/inc/nsmlagendadatastore.h
omads/omadsextensions/adapters/agenda/inc/nsmlagendadebug.h
omads/omadsextensions/adapters/agenda/src/101F6DD7.rss
omads/omadsextensions/adapters/agenda/src/NSmlAgendaDataStore_1_2.rss
omads/omadsextensions/adapters/agenda/src/nsmlagendadataprovider.cpp
omads/omadsextensions/adapters/agenda/src/nsmlagendadatastore.cpp
omads/omadsextensions/adapters/agenda/src/nsmlagendaprogressview.cpp
omads/omadsextensions/adapters/bld/bld.inf
omads/omadsextensions/adapters/bookmark/group/102751BA.XML
omads/omadsextensions/adapters/bookmark/group/bld.inf
omads/omadsextensions/adapters/bookmark/group/bookmarkdsa_stub.pkg
omads/omadsextensions/adapters/bookmark/group/bookmarkdsa_stub.sis
omads/omadsextensions/adapters/bookmark/group/createstub.bat
omads/omadsextensions/adapters/bookmark/inc/logger.h
omads/omadsextensions/adapters/bookmark/sis/backup_registration.xml
omads/omadsextensions/adapters/bookmark/sis/bookmarkdsa.pkg
omads/omadsextensions/adapters/bookmark/sis/bookmarkdsa_debug.pkg
omads/omadsextensions/adapters/contacts/bld/bld.inf
omads/omadsextensions/adapters/contacts/bld/def/bwinscwcontactsdataprovideru.def
omads/omadsextensions/adapters/contacts/bld/def/eabicontactsdataprovideru.def
omads/omadsextensions/adapters/contacts/bld/nsmldscontactsdataprovider.mmp
omads/omadsextensions/adapters/contacts/inc/NSmlContactsModsFetcher.h
omads/omadsextensions/adapters/contacts/inc/nsmlcontactsdefs.h
omads/omadsextensions/adapters/contacts/sis/cnt_adapter.pkg
omads/omadsextensions/adapters/contacts/src/101F6DD6.rss
omads/omadsextensions/adapters/contacts/src/NSmlContactsDataProvider.cpp
omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStore.cpp
omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStoreFormat_1_1_2.rss
omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStoreFormat_1_2.rss
omads/omadsextensions/adapters/contacts/src/NSmlContactsModsFetcher.cpp
omads/omadsextensions/adapters/contactsgroup/group/101ff972.xml
omads/omadsextensions/adapters/contactsgroup/group/bld.inf
omads/omadsextensions/adapters/contactsgroup/group/contactsgrpdataprovider.mmp
omads/omadsextensions/adapters/contactsgroup/group/contactsgrpdsa_stub.pkg
omads/omadsextensions/adapters/contactsgroup/group/contactsgrpdsa_stub.sis
omads/omadsextensions/adapters/contactsgroup/group/createstub.bat
omads/omadsextensions/adapters/contactsgroup/inc/changefinder.h
omads/omadsextensions/adapters/contactsgroup/inc/contactsgrpconverter.h
omads/omadsextensions/adapters/contactsgroup/inc/contactsgrpdataprovider.h
omads/omadsextensions/adapters/contactsgroup/inc/contactsgrpdataproviderdefs.h
omads/omadsextensions/adapters/contactsgroup/inc/contactsgrpdatastore.h
omads/omadsextensions/adapters/contactsgroup/inc/logger.h
omads/omadsextensions/adapters/contactsgroup/inc/snapshotitem.h
omads/omadsextensions/adapters/contactsgroup/rom/contactsgrpdsa.iby
omads/omadsextensions/adapters/contactsgroup/sis/backup_registration.xml
omads/omadsextensions/adapters/contactsgroup/sis/contactsgrp.pkg
omads/omadsextensions/adapters/contactsgroup/sis/contactsgrp_debug.pkg
omads/omadsextensions/adapters/contactsgroup/src/changefinder.cpp
omads/omadsextensions/adapters/contactsgroup/src/contactsgrpconverter.cpp
omads/omadsextensions/adapters/contactsgroup/src/contactsgrpdataprovider.cpp
omads/omadsextensions/adapters/contactsgroup/src/contactsgrpdataprovider.rss
omads/omadsextensions/adapters/contactsgroup/src/contactsgrpdatastore.cpp
omads/omadsextensions/adapters/contactsgroup/src/contactsgrpdatastore.rss
omads/omadsextensions/adapters/contactsgroup/src/snapshotitem.cpp
omads/omadsextensions/adapters/mediads/group/2001a9a1.xml
omads/omadsextensions/adapters/mediads/group/bld.inf
omads/omadsextensions/adapters/mediads/group/createstub.bat
omads/omadsextensions/adapters/mediads/group/mediads.mmp
omads/omadsextensions/adapters/mediads/group/mediads_stub.pkg
omads/omadsextensions/adapters/mediads/group/mediads_stub.sis
omads/omadsextensions/adapters/mediads/inc/changefinder.h
omads/omadsextensions/adapters/mediads/inc/cmdemanager.h
omads/omadsextensions/adapters/mediads/inc/logger.h
omads/omadsextensions/adapters/mediads/inc/mediadsprovider.h
omads/omadsextensions/adapters/mediads/inc/mediadsproviderdefs.h
omads/omadsextensions/adapters/mediads/inc/mediadsstore.h
omads/omadsextensions/adapters/mediads/inc/mediamanager.h
omads/omadsextensions/adapters/mediads/inc/omadsfolderobject.h
omads/omadsextensions/adapters/mediads/inc/playlistitem.h
omads/omadsextensions/adapters/mediads/inc/sconmetadatafielddefs.h
omads/omadsextensions/adapters/mediads/inc/snapshotitem.h
omads/omadsextensions/adapters/mediads/inc/songitem.h
omads/omadsextensions/adapters/mediads/rom/mediads.iby
omads/omadsextensions/adapters/mediads/sis/backup_registration.xml
omads/omadsextensions/adapters/mediads/sis/mediads.pkg
omads/omadsextensions/adapters/mediads/sis/mediads_debug.pkg
omads/omadsextensions/adapters/mediads/src/changefinder.cpp
omads/omadsextensions/adapters/mediads/src/cmdemanager.cpp
omads/omadsextensions/adapters/mediads/src/mediadsprovider.cpp
omads/omadsextensions/adapters/mediads/src/mediadsprovider.rss
omads/omadsextensions/adapters/mediads/src/mediadsstore.cpp
omads/omadsextensions/adapters/mediads/src/mediadsstore.rss
omads/omadsextensions/adapters/mediads/src/mediamanager.cpp
omads/omadsextensions/adapters/mediads/src/omadsfolderobject.cpp
omads/omadsextensions/adapters/mediads/src/playlistitem.cpp
omads/omadsextensions/adapters/mediads/src/snapshotitem.cpp
omads/omadsextensions/adapters/mediads/src/songitem.cpp
omads/omadsextensions/adapters/mms/group/101FB0E9.XML
omads/omadsextensions/adapters/mms/group/bld.inf
omads/omadsextensions/adapters/mms/group/createstub.bat
omads/omadsextensions/adapters/mms/group/mmsdataprovider.mmp
omads/omadsextensions/adapters/mms/group/mmsdsa_stub.pkg
omads/omadsextensions/adapters/mms/group/mmsdsa_stub.sis
omads/omadsextensions/adapters/mms/inc/logger.h
omads/omadsextensions/adapters/mms/inc/mmsdataprovider.h
omads/omadsextensions/adapters/mms/inc/mmsdatastore.h
omads/omadsextensions/adapters/mms/inc/omadsfolderobject.h
omads/omadsextensions/adapters/mms/rom/mmsdsa.iby
omads/omadsextensions/adapters/mms/sis/backup_registration.xml
omads/omadsextensions/adapters/mms/sis/mms.pkg
omads/omadsextensions/adapters/mms/sis/mms_debug.pkg
omads/omadsextensions/adapters/mms/src/mmsadaptermsvapi.cpp
omads/omadsextensions/adapters/mms/src/mmsdataprovider.cpp
omads/omadsextensions/adapters/mms/src/mmsdatastore.cpp
omads/omadsextensions/adapters/mms/src/omadsfolderobject.cpp
omads/omadsextensions/adapters/notes/group/bld.inf
omads/omadsextensions/adapters/notes/group/def/bwinscwnotepaddataprovideru.def
omads/omadsextensions/adapters/notes/group/def/eabinotepaddataprovideru.def
omads/omadsextensions/adapters/notes/group/nsmldsnotepaddataprovider.mmp
omads/omadsextensions/adapters/notes/inc/NSmlNotepadDataProvider.h
omads/omadsextensions/adapters/notes/inc/NSmlNotepadDatastore.h
omads/omadsextensions/adapters/notes/inc/nsmlnotepadDatabase.h
omads/omadsextensions/adapters/notes/inc/nsmlnotepaddefs.h
omads/omadsextensions/adapters/notes/inc/nsmlnotepadlogging.h
omads/omadsextensions/adapters/notes/loc/101F85F8.loc
omads/omadsextensions/adapters/notes/src/NSmlNotepadDataProvider.cpp
omads/omadsextensions/adapters/notes/src/NSmlNotepadDataStore.cpp
omads/omadsextensions/adapters/notes/src/NSmlNotepadDataStoreFormat.rss
omads/omadsextensions/adapters/notes/src/nsmlnotepadDatabase.cpp
omads/omadsextensions/adapters/notes/src/nsmlnotepaddataprovider.rss
omads/omadsextensions/adapters/sms/group/10206B5C.XML
omads/omadsextensions/adapters/sms/group/SmsDataProvider.mmp
omads/omadsextensions/adapters/sms/group/bld.inf
omads/omadsextensions/adapters/sms/group/createstub.bat
omads/omadsextensions/adapters/sms/group/smsdsa_stub.pkg
omads/omadsextensions/adapters/sms/group/smsdsa_stub.sis
omads/omadsextensions/adapters/sms/inc/ChangeFinder.h
omads/omadsextensions/adapters/sms/inc/Logger.h
omads/omadsextensions/adapters/sms/inc/OMADSFolderObject.h
omads/omadsextensions/adapters/sms/inc/SmsDataStore.h
omads/omadsextensions/adapters/sms/inc/SnapshotItem.h
omads/omadsextensions/adapters/sms/inc/VMessageParser.h
omads/omadsextensions/adapters/sms/rom/smsdsa.iby
omads/omadsextensions/adapters/sms/sis/backup_registration.xml
omads/omadsextensions/adapters/sms/sis/sms.pkg
omads/omadsextensions/adapters/sms/sis/sms_debug.pkg
omads/omadsextensions/adapters/sms/src/ChangeFinder.cpp
omads/omadsextensions/adapters/sms/src/OMADSFolderObject.cpp
omads/omadsextensions/adapters/sms/src/SMSAdapterMsvApi.cpp
omads/omadsextensions/adapters/sms/src/SmsDataProvider.cpp
omads/omadsextensions/adapters/sms/src/SmsDataStore.cpp
omads/omadsextensions/adapters/sms/src/SnapshotItem.cpp
omads/omadsextensions/adapters/sms/src/VMessageParser.cpp
omads/omadsextensions/datamod/bld/nsmldatamod.mmp
omads/omadsextensions/dsutils/cgiscriptutils/bld/nsmlCGIScriptParser.mmp
omads/omadsextensions/dsutils/contactsdatastoreextension/contactsdatastoreextension.pro
omads/omadsextensions/dsutils/contactsdatastoreextension/def/bwinscwcontactsdatastoreextensionu.def
omads/omadsextensions/dsutils/contactsdatastoreextension/def/eabicontactsdatastoreextensionu.def
omads/omadsextensions/dsutils/contactsdatastoreextension/inc/nsmlcontactsdatastoreextension_p.h
omads/omadsextensions/dsutils/contactsdatastoreextension/sis/contactsdatastoreextension.pkg
omads/omadsextensions/dsutils/contactsdatastoreextension/src/nsmlcontactsdatastoreextension.cpp
omads/omadsextensions/dsutils/contactsdatastoreextension/src/nsmlcontactsdatastoreextension_p.cpp
omads/omadsextensions/dsutils/dsutils.pro
omads/omadsextensions/dsutils/nsmldefaultagendahandler/bld/bld.inf
omads/omadsextensions/dsutils/nsmldefaultagendahandler/bld/def/bwinscwnsmldefaultagendahandleru.DEF
omads/omadsextensions/dsutils/nsmldefaultagendahandler/bld/def/eabinsmldefaultagendahandleru.DEF
omads/omadsextensions/dsutils/nsmldefaultagendahandler/bld/nsmldefaultagendahandler.mmp
omads/omadsextensions/dsutils/nsmldefaultagendahandler/data/nsmldefaultagendahandler.rss
omads/omadsextensions/dsutils/nsmldefaultagendahandler/data/nsmldefaultagendahandler_1_2.rss
omads/omadsextensions/dsutils/nsmldefaultagendahandler/inc/nsmldefaultagendahandlerdebug.h
omads/omadsextensions/dsutils/nsmldefaultagendahandler/inc/nsmldefaultagendahandlerplugin.h
omads/omadsextensions/dsutils/nsmldefaultagendahandler/inc/nsmldefaultagendahandlerutil.h
omads/omadsextensions/dsutils/nsmldefaultagendahandler/loc/nsmldefaultagendahandler.loc
omads/omadsextensions/dsutils/nsmldefaultagendahandler/src/nsmldefaultagendahandlerplugin.cpp
omads/omadsextensions/dsutils/nsmldefaultagendahandler/src/nsmldefaultagendahandlerutil.cpp
omads/omadsextensions/dsutils/nsmlfolderutils/bld/bld.inf
omads/omadsextensions/dsutils/nsmlfolderutils/bld/def/bwinscwfolderparseru.def
omads/omadsextensions/dsutils/nsmlfolderutils/bld/def/eabifolderparseru.def
omads/omadsextensions/dsutils/nsmlfolderutils/bld/nsmlfolderparser.mmp
omads/omadsextensions/dsutils/nsmlfolderutils/inc/nsmlparserconstants.h
omads/omadsextensions/dsutils/nsmlfolderutils/src/NSmlExtData.cpp
omads/omadsextensions/dsutils/nsmlfolderutils/src/NSmlFolderAttributeData.cpp
omads/omadsextensions/dsutils/nsmlfolderutils/src/NSmlFolderParser.cpp
omads/omadsextensions/dsutils/nsmlfolderutils/src/nsmlxmlparser.cpp
omads/omadsextensions/group/bld.inf
omads/omadsextensions/omadsextensions.pro
omads/rom/omads.iby
sysdef_1_4_0.dtd
sysdef_1_5_1.dtd
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.phoneplugin/Contents/Info.plist	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>English</string>
-	<key>CFBundleGetInfoString</key>
-	<string>Nokia S60-32 v1.0, © Nokia</string>
-	<key>CFBundleIdentifier</key>
-	<string>nokia.com.phoneplugin.com.nokia.S6032</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>Nokia S60-32</string>
-	<key>CFBundlePackageType</key>
-	<string>BNDL</string>
-	<key>CFBundleShortVersionString</key>
-	<string>1.0</string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleVersion</key>
-	<string>556</string>
-	<key>IPHPhoneConduitVersion</key>
-	<string>597.0</string>
-	<key>IPHPhonePluginUID</key>
-	<string>367C0F5C-1E53-44A3-AEA5-54D1EEE12F29</string>
-	<key>IPHPluginProviderName</key>
-	<string>Nokia</string>
-	<key>IPHPluginSupportURL</key>
-	<string>http://www.nokia.com/support</string>
-	<key>IPHPublicPluginVersion</key>
-	<string>2.0</string>
-</dict>
-</plist>
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.phoneplugin/Contents/Resources/MetaClasses.plist	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,329 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<dict>
-    <key>family.com.nokia.S6032</key>
-    <dict>
-        <key>InheritsFrom</key>
-        <array>
-            <string>family.com.apple.external.all-phones.usb-bt</string>
-        </array>
-        <key>Services</key>
-        <array>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.apple.synchro</string>
-                <key>ServiceClass</key>
-                <string>IPHSyncMLSyncTransportServiceObexClient</string>
-                <key>ServiceProperties</key>
-                <dict>
-                    <key>IPHEnginePlist</key>
-                    <string>SyncEngine.plist</string>
-                    <key>SyncProperties2</key>
-                    <string>PhoneConduit.plist</string>
-                    <key>SyncMLVersion</key>
-                    <string>SyncML11</string>
-                    <key>SyncMLLargeObjectSupport</key>
-                    <true/>
-                    <key>SyncMLNumberOfChangesSupport</key>
-                    <true/>
-                    <key>SyncMLRefreshFromServerSupport</key>
-                    <true/>
-                    <key>SyncMLRemoteNeedsRelativePaths</key>
-                    <false/>
-                    <key>SyncMLBusySignalingSupport</key>
-                    <true/>
-                    <key>SyncMLOnlyOneBusySignaling</key>
-                    <false/>
-                    <key>SyncMLBusySignalingInterval</key>
-                    <integer>60</integer>
-                    <key>SyncMLSimulateBusySignalingWithEmptySync</key>
-                    <false/>
-                    <key>SyncDataClasses</key>
-                    <plist>
-                        <array>
-                            <string>com.apple.pimsync.contacts</string>
-                            <string>com.apple.pimsync.calendars</string>
-                        </array>
-                    </plist>
-                    <key>DontSyncEventsAfterDateValue.visible</key>
-                    <true/>
-                    <key>DontSyncEventsAfterDateValue.default-value</key>
-                    <string>1month</string>
-                    <key>OnlySyncContactsWithPhoneNumber.visible</key>
-                    <true/>
-                    <key>OnlySyncContactsWithPhoneNumber.default-value</key>
-                    <false/>
-                    <key>SyncAllDayEventsKey.visible</key>
-                    <false/>
-                    <key>SyncAllDayEventsKey.default-value</key>
-                    <true/>
-                    <key>DontSyncEventsPriorToDateValue.visible</key>
-                    <true/>
-                    <key>DontSyncEventsPriorToDateValue.default-value</key>
-                    <string>1week</string>
-                    <key>DontSyncEventsPriorToDateIsEnabled.visible</key>
-                    <false/>
-                    <key>DontSyncEventsPriorToDateIsEnabled.default-value</key>
-                    <true/>
-                    <key>DontSyncEventsAfterDateIsEnabled.visible</key>
-                    <true/>
-                    <key>DontSyncEventsAfterDateIsEnabled.default-value</key>
-                    <true/>
-                    <key>SyncMLLocalSource</key>
-                    <string>iSync</string>
-                    <key>SyncMLCodec</key>
-                    <string>SyncMLCodecLibWBXML</string>
-                    <key>SyncMLMsgTemporization</key>
-                    <integer>500000</integer>
-                    <key>SyncMLMaxObjSize</key>
-                    <integer>786432</integer>
-                    <key>SyncMLMaxMsgSize</key>
-                    <integer>65535</integer>
-                    <key>BTProtocolService</key>
-                    <string>com.nokia.S6032.protocol.bt.obex.syncml</string>
-                    <key>USBProtocolService</key>
-                    <string>com.nokia.S6032.protocol.usb.obex.syncml</string>
-                </dict>
-            </dict>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.nokia.S6032.protocol.usb.obex.syncml</string>
-                <key>ServiceClass</key>
-                <string>IPHObexService</string>
-                <key>ServiceProperties</key>
-                <dict>
-                    <key>ObexTargetUUID</key>
-                    <string>53 59 4e 43 4d 4c 2d 53 59 4e 43</string>
-                    <key>ObexTimeOut</key>
-                    <integer>60</integer>
-                    <key>TransportService</key>
-                    <string>com.nokia.S6032.transport.usb.syncml</string>
-                </dict>
-            </dict>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.nokia.S6032.protocol.bt.obex.syncml</string>
-                <key>ServiceClass</key>
-                <string>IPHObexService</string>
-                <key>ServiceProperties</key>
-                <dict>
-                    <key>ObexTargetUUID</key>
-                    <string>53 59 4e 43 4d 4c 2d 53 59 4e 43</string>
-                    <key>ObexTimeOut</key>
-                    <integer>60</integer>
-                    <key>TransportService</key>
-                    <string>com.nokia.S6032.transport.rfcomm.syncml</string>
-                </dict>
-            </dict>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.apple.protocol.usb.AT</string>
-                <key>ServiceClass</key>
-                <string>IPHSerialATService</string>
-                <key>ServiceProperties</key>
-                <dict/>
-            </dict>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.nokia.S6032.transport.rfcomm.syncml</string>
-                <key>ServiceClass</key>
-                <string>IPHRFCOMMChannelService</string>
-                <key>ServiceProperties</key>
-                <dict>
-                    <key>RFCOMMChannelUUID</key>
-                    <string>000000020000100080000002ee000002</string>
-                </dict>
-            </dict>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.apple.transport.usb.modem</string>
-                <key>ServiceClass</key>
-                <string>IPHUSBCDCChannelService</string>
-                <key>ServiceProperties</key>
-                <dict/>
-            </dict>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.nokia.S6032.transport.usb.syncml</string>
-                <key>ServiceClass</key>
-                <string>IPHUSBObexChannelService</string>
-                <key>ServiceProperties</key>
-                <dict/>
-            </dict>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.apple.pimsync.parser.vCal</string>
-                <key>ServiceClass</key>
-                <string>IPHSyncParserService</string>
-                <key>ServiceProperties</key>
-                <dict>
-                    <key>ParserType</key>
-                    <string>vCal</string>
-                    <key>Encoding</key>
-                    <string>QUOTED-PRINTABLE</string>
-                    <key>FoldingStyle</key>
-                    <string>FoldingNG</string>
-                    <key>Charset</key>
-                    <string>UTF-8</string>
-                    <key>AllDayEventFormat</key>
-                    <string>AllDayEventFromMidnightTo235900</string>
-                    <key>vCalRecDropIfUseless</key>
-                    <true/>
-                    <key>EscapeSemicolonInNotComponedValues</key>
-                    <true/>
-                    <key>EscapeBackslash</key>
-                    <true/>
-                    <key>IgnoreProperties</key>
-                    <array>
-                        <string>X-IRMC-LUID</string>
-                    </array>
-                    <key>UntilDateInLocal</key>
-                    <true/>
-                    <key>SetUntilTimeWithStartTime</key>
-                    <true/>
-                </dict>
-            </dict>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.apple.pimsync.parser.vCard</string>
-                <key>ServiceClass</key>
-                <string>IPHSyncParserService</string>
-                <key>ServiceProperties</key>
-                <dict>
-                    <key>ParserType</key>
-                    <string>vCard</string>
-                    <key>Encoding</key>
-                    <string>QUOTED-PRINTABLE</string>
-                    <key>FoldingStyle</key>
-                    <string>FoldingNG</string>
-                    <key>Charset</key>
-                    <string>UTF-8</string>
-                    <key>EscapeSemicolonInNotComponedValues</key>
-                    <true/>
-                    <key>EscapeBackslash</key>
-                    <true/>
-                    <key>IgnoreProperties</key>
-                    <array>
-                        <string>X-IRMC-LUID</string>
-                    </array>
-                    <key>PropertyNameMapping</key>
-                    <dict>
-                        <key>X-NICKNAME</key>
-                        <string>X-EPOCSECONDNAME</string>
-                    </dict>
-                    <key>AddCRLFAfterBase64Folding</key>
-                    <true/>
-                    <key>IgnoreSubTypesForThisMainTypes</key>
-                    <array>
-                        <string>CELL</string>
-                    </array>
-                </dict>
-            </dict>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.apple.pimsync.contacts</string>
-                <key>ServiceClass</key>
-                <string>IPHSyncDataClassService</string>
-                <key>ServiceProperties</key>
-                <dict>
-                    <key>MimeType</key>
-                    <string>text/x-vcard</string>
-                    <key>ParserService</key>
-                    <string>com.apple.pimsync.parser.vCard</string>
-                    <key>RemoteName</key>
-                    <string></string>
-                    <key>needsCompanyNameInFirstName</key>
-                    <false/>
-                    <key>needsFullAddressInStreetField</key>
-                    <false/>
-                    <key>DataClassName</key>
-                    <string>Contacts</string>
-                    <key>needsDeleteAddOnModify</key>
-                    <true/>
-                    <key>MaxSyncCmd</key>
-                    <integer>1</integer>
-                </dict>
-            </dict>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.apple.pimsync.calendars</string>
-                <key>ServiceClass</key>
-                <string>IPHSyncDataClassService</string>
-                <key>ServiceProperties</key>
-                <dict>
-                    <key>MimeType</key>
-                    <string>text/x-vcalendar</string>
-                    <key>ParserService</key>
-                    <string>com.apple.pimsync.parser.vCal</string>
-                    <key>hasEvent</key>
-                    <true/>
-                    <key>RemoteName</key>
-                    <string></string>
-                    <key>hasAllDayEvents</key>
-                    <false/>
-                    <key>hasAllDayFromMidnightTo235900</key>
-                    <true/>
-                    <key>hasVCalRecurrence</key>
-                    <true/>
-                    <key>needsToFormatCountToUntilDate</key>
-                    <true/>
-                    <key>needsToFormatUntilDateToCount</key>
-                    <false/>
-                    <key>hasOneAlarmType</key>
-                    <true/>
-                    <key>alarmTypeIsDisplay</key>
-                    <false/>
-                    <key>hasTimeZone</key>
-                    <true/>
-                    <key>hasTask</key>
-                    <true/>
-                    <key>handleAllDayRecurrent</key>
-                    <true/>
-                    <key>doNotSyncAlarmIfAfterStartDateTime</key>
-                    <true/>
-                    <key>DataClassName</key>
-                    <string>Calendar</string>
-                    <key>allDayInLocalDateTime</key>
-                    <true/>
-                    <key>untilDateIsDateOnly</key>
-                    <true/>
-                    <key>exDatesAreDateOnly</key>
-                    <false/>
-                    <key>doNotSyncAlarmIfCompleted</key>
-                    <true/>
-                    <key>dueDateIsDateOnly</key>
-                    <false/>
-                </dict>
-            </dict>
-        </array>
-    </dict>
-    <key>com.nokia.S6032</key>
-    <dict>
-        <key>Identification</key>
-        <dict>
-            <key>com.apple.usb.vendorid-modelid</key>
-            <string>0x0421/0x0500</string>
-            <key>com.apple.gmi+gmm</key>
-            <string>Nokia+Nokia 6290</string>
-        </dict>
-        <key>InheritsFrom</key>
-        <array>
-            <string>family.com.nokia.S6032</string>
-        </array>
-        <key>Services</key>
-        <array>
-            <dict>
-                <key>ServiceName</key>
-                <string>com.apple.model</string>
-                <key>ServiceProperties</key>
-                <dict>
-                    <key>ModelName</key>
-                    <string>S60-32</string>
-                    <key>CompanyName</key>
-                    <string>Nokia</string>
-                    <key>ModelIcon</key>
-                    <string>com.nokia.S6032.tiff</string>
-                </dict>
-            </dict>
-        </array>
-    </dict>
-</dict>
\ No newline at end of file
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.phoneplugin/Contents/Resources/PhoneConduit.plist	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,534 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>Formatting</key>
-	<dict>
-		<key>com.apple.calendars.Event</key>
-		<dict>
-			<key>classification</key>
-			<dict>
-				<key>mappings</key>
-				<array>
-					<dict>
-						<key>mappedValue</key>
-						<string>PUBLIC</string>
-						<key>originalValue</key>
-						<string>public</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>PRIVATE</string>
-						<key>originalValue</key>
-						<string>private</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>PRIVATE</string>
-						<key>originalValue</key>
-						<string>confidential</string>
-					</dict>
-				</array>
-			</dict>
-			<key>description</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>500</integer>
-			</dict>
-			<key>end date</key>
-			<dict/>
-			<key>location</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>start date</key>
-			<dict/>
-			<key>summary</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>500</integer>
-			</dict>
-		</dict>
-		<key>com.apple.calendars.Task</key>
-		<dict>
-			<key>classification</key>
-			<dict>
-				<key>mappings</key>
-				<array>
-					<dict>
-						<key>mappedValue</key>
-						<string>PUBLIC</string>
-						<key>originalValue</key>
-						<string>public</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>PRIVATE</string>
-						<key>originalValue</key>
-						<string>private</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>PRIVATE</string>
-						<key>originalValue</key>
-						<string>confidential</string>
-					</dict>
-				</array>
-			</dict>
-			<key>completion date</key>
-			<dict/>
-			<key>description</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>due date</key>
-			<dict/>
-			<key>priority</key>
-			<dict>
-				<key>mappings</key>
-				<array>
-					<dict>
-						<key>mappedValue</key>
-						<string></string>
-						<key>originalValue</key>
-						<integer>0</integer>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>1</string>
-						<key>originalValue</key>
-						<integer>1</integer>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>2</string>
-						<key>originalValue</key>
-						<integer>2</integer>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>3</string>
-						<key>originalValue</key>
-						<integer>3</integer>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>4</string>
-						<key>originalValue</key>
-						<integer>4</integer>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>5</string>
-						<key>originalValue</key>
-						<integer>5</integer>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>6</string>
-						<key>originalValue</key>
-						<integer>6</integer>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>7</string>
-						<key>originalValue</key>
-						<integer>7</integer>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>8</string>
-						<key>originalValue</key>
-						<integer>8</integer>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>9</string>
-						<key>originalValue</key>
-						<integer>9</integer>
-					</dict>
-				</array>
-			</dict>
-			<key>status</key>
-			<dict>
-				<key>mappings</key>
-				<array>
-					<dict>
-						<key>mappedValue</key>
-						<string>DECLINED</string>
-						<key>originalValue</key>
-						<string>cancelled</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>NEEDS ACTION</string>
-						<key>originalValue</key>
-						<string>needsaction</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>COMPLETED</string>
-						<key>originalValue</key>
-						<string>completed</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>ACCEPTED</string>
-						<key>originalValue</key>
-						<string>inprocess</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string></string>
-						<key>originalValue</key>
-						<string>none</string>
-					</dict>
-				</array>
-			</dict>
-			<key>summary</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-		</dict>
-		<key>com.apple.contacts.Contact</key>
-		<dict>
-			<key>birthday</key>
-			<dict/>
-			<key>company name</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>department</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>first name</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>image</key>
-			<dict>
-				<key>maxLength</key>
-				<integer>0</integer>
-			</dict>
-			<key>job title</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>last name</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>middle name</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>nickname</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>notes</key>
-			<dict>
-				<key>maxLength</key>
-				<integer>1000</integer>
-			</dict>
-			<key>suffix</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>title</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-		</dict>
-		<key>com.apple.contacts.Date</key>
-		<dict>
-			<key>type</key>
-			<dict>
-				<key>mappings</key>
-				<array/>
-			</dict>
-			<key>value</key>
-			<dict/>
-		</dict>
-		<key>com.apple.contacts.Email Address</key>
-		<dict>
-			<key>type</key>
-			<dict>
-				<key>mappings</key>
-				<array>
-					<dict>
-						<key>mappedValue</key>
-						<string>WORK</string>
-						<key>originalValue</key>
-						<string>work</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>HOME</string>
-						<key>originalValue</key>
-						<string>home</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>INTERNET</string>
-						<key>originalValue</key>
-						<string>other</string>
-					</dict>
-				</array>
-			</dict>
-			<key>value</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-		</dict>
-		<key>com.apple.contacts.Phone Number</key>
-		<dict>
-			<key>type</key>
-			<dict>
-				<key>mappings</key>
-				<array>
-					<dict>
-						<key>mappedValue</key>
-						<string>WORK</string>
-						<key>originalValue</key>
-						<string>work</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>HOME</string>
-						<key>originalValue</key>
-						<string>home</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>CELL</string>
-						<key>originalValue</key>
-						<string>mobile</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>FAX</string>
-						<key>originalValue</key>
-						<string>work fax</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>FAX</string>
-						<key>originalValue</key>
-						<string>home fax</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string></string>
-						<key>originalValue</key>
-						<string>other</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string></string>
-						<key>originalValue</key>
-						<string>main</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>PAGER</string>
-						<key>originalValue</key>
-						<string>pager</string>
-					</dict>
-				</array>
-			</dict>
-			<key>value</key>
-			<dict>
-				<key>charsToKeep</key>
-				<string>0123456789+#*pw</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-		</dict>
-		<key>com.apple.contacts.Related Name</key>
-		<dict>
-			<key>type</key>
-			<dict>
-				<key>mappings</key>
-				<array>
-					<dict>
-						<key>mappedValue</key>
-						<string>X-CHILDREN</string>
-						<key>originalValue</key>
-						<string>child</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>X-SPOUSE</string>
-						<key>originalValue</key>
-						<string>spouse</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>X-ASSISTANT</string>
-						<key>originalValue</key>
-						<string>assistant</string>
-					</dict>
-				</array>
-			</dict>
-			<key>value</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-		</dict>
-		<key>com.apple.contacts.Street Address</key>
-		<dict>
-			<key>city</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>country</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>postal code</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>state</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>street</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>255</integer>
-			</dict>
-			<key>type</key>
-			<dict>
-				<key>mappings</key>
-				<array>
-					<dict>
-						<key>mappedValue</key>
-						<string>WORK</string>
-						<key>originalValue</key>
-						<string>work</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>HOME</string>
-						<key>originalValue</key>
-						<string>home</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string></string>
-						<key>originalValue</key>
-						<string>other</string>
-					</dict>
-				</array>
-				<key>relationshipConstraint</key>
-				<string>perSubType</string>
-				<key>relationshipSize</key>
-				<integer>1</integer>
-			</dict>
-		</dict>
-		<key>com.apple.contacts.URL</key>
-		<dict>
-			<key>type</key>
-			<dict>
-				<key>mappings</key>
-				<array>
-					<dict>
-						<key>mappedValue</key>
-						<string>WORK</string>
-						<key>originalValue</key>
-						<string>work</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>HOME</string>
-						<key>originalValue</key>
-						<string>home page</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string>HOME</string>
-						<key>originalValue</key>
-						<string>home</string>
-					</dict>
-					<dict>
-						<key>mappedValue</key>
-						<string></string>
-						<key>originalValue</key>
-						<string>other</string>
-					</dict>
-				</array>
-			</dict>
-			<key>value</key>
-			<dict>
-				<key>charsToStrip</key>
-				<string>\r,\n</string>
-				<key>maxLength</key>
-				<integer>500</integer>
-			</dict>
-		</dict>
-	</dict>
-</dict>
-</plist>
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.phoneplugin/Contents/Resources/SyncEngine.plist	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>Entities</key>
-	<dict>
-		<key>com.apple.calendars.AudioAlarm</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>triggerdate</string>
-			<string>triggerduration</string>
-			<string>owner</string>
-		</array>
-		<key>com.apple.calendars.Calendar</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>title</string>
-			<string>read only</string>
-			<string>com.apple.PhoneConduitExtension.uid</string>
-		</array>
-		<key>com.apple.calendars.DisplayAlarm</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>triggerdate</string>
-			<string>triggerduration</string>
-			<string>owner</string>
-		</array>
-		<key>com.apple.calendars.Event</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>original date</string>
-			<string>all day</string>
-			<string>exception dates</string>
-			<string>calendar</string>
-			<string>recurrences</string>
-			<string>main event</string>
-			<string>detached events</string>
-			<string>audio alarms</string>
-			<string>display alarms</string>
-			<string>start date</string>
-			<string>location</string>
-			<string>summary</string>
-			<string>end date</string>
-			<string>description</string>
-			<string>classification</string>
-		</array>
-		<key>com.apple.calendars.Recurrence</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>frequency</string>
-			<string>count</string>
-			<string>until</string>
-			<string>interval</string>
-			<string>bymonth</string>
-			<string>byweeknumber</string>
-			<string>byyearday</string>
-			<string>bymonthday</string>
-			<string>bydayfreq</string>
-			<string>bydaydays</string>
-			<string>bysetpos</string>
-			<string>weekstartday</string>
-			<string>owner</string>
-		</array>
-		<key>com.apple.calendars.Task</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>due date is date only</string>
-			<string>calendar</string>
-			<string>audio alarms</string>
-			<string>display alarms</string>
-			<string>status</string>
-			<string>summary</string>
-			<string>completion date</string>
-			<string>description</string>
-			<string>due date</string>
-			<string>classification</string>
-			<string>priority</string>
-		</array>
-		<key>com.apple.contacts.Contact</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>title</string>
-			<string>suffix</string>
-			<string>image</string>
-			<string>last name</string>
-			<string>company name</string>
-			<string>first name</string>
-			<string>middle name</string>
-			<string>job title</string>
-			<string>nickname</string>
-			<string>notes</string>
-			<string>department</string>
-			<string>birthday</string>
-			<string>email addresses</string>
-			<string>phone numbers</string>
-			<string>URLs</string>
-			<string>street addresses</string>
-			<string>related names</string>
-			<string>dates</string>
-		</array>
-		<key>com.apple.contacts.Date</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>contact</string>
-			<string>value</string>
-			<string>type</string>
-		</array>
-		<key>com.apple.contacts.Email Address</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>contact</string>
-			<string>value</string>
-			<string>type</string>
-		</array>
-		<key>com.apple.contacts.Phone Number</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>contact</string>
-			<string>value</string>
-			<string>type</string>
-		</array>
-		<key>com.apple.contacts.Related Name</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>contact</string>
-			<string>value</string>
-			<string>type</string>
-		</array>
-		<key>com.apple.contacts.Street Address</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>contact</string>
-			<string>city</string>
-			<string>state</string>
-			<string>street</string>
-			<string>country</string>
-			<string>type</string>
-			<string>postal code</string>
-		</array>
-		<key>com.apple.contacts.URL</key>
-		<array>
-			<string>com.apple.syncservices.RecordEntityName</string>
-			<string>contact</string>
-			<string>value</string>
-			<string>type</string>
-		</array>
-	</dict>
-	<key>Type</key>
-	<string>device</string>
-</dict>
-</plist>
Binary file connectivitymodules/SeCon/apple/S60_RnD_32.phoneplugin/Contents/Resources/com.nokia.S6032.tiff has changed
Binary file connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Archive.bom has changed
Binary file connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Archive.pax.gz has changed
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Info.plist	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleGetInfoString</key>
-	<string>0.0, Copyright 2006 Apple Computer, Inc.</string>
-	<key>CFBundleIdentifier</key>
-	<string>com.apple.isyncpluginmaker.phoneplugin</string>
-	<key>CFBundleShortVersionString</key>
-	<string>0.0</string>
-	<key>IFMajorVersion</key>
-	<integer>1</integer>
-	<key>IFMinorVersion</key>
-	<integer>0</integer>
-	<key>IFPkgFlagAllowBackRev</key>
-	<false/>
-	<key>IFPkgFlagAuthorizationAction</key>
-	<string>AdminAuthorization</string>
-	<key>IFPkgFlagBackgroundAlignment</key>
-	<string>topleft</string>
-	<key>IFPkgFlagBackgroundScaling</key>
-	<string>none</string>
-	<key>IFPkgFlagDefaultLocation</key>
-	<string>/</string>
-	<key>IFPkgFlagFollowLinks</key>
-	<true/>
-	<key>IFPkgFlagInstallFat</key>
-	<false/>
-	<key>IFPkgFlagInstalledSize</key>
-	<integer>156</integer>
-	<key>IFPkgFlagIsRequired</key>
-	<false/>
-	<key>IFPkgFlagOverwritePermissions</key>
-	<false/>
-	<key>IFPkgFlagRelocatable</key>
-	<false/>
-	<key>IFPkgFlagRestartAction</key>
-	<string>NoRestart</string>
-	<key>IFPkgFlagRootVolumeOnly</key>
-	<true/>
-	<key>IFPkgFlagUpdateInstalledLanguages</key>
-	<false/>
-	<key>IFPkgFormatVersion</key>
-	<real>0.10000000149011612</real>
-	<key>IFRequirementDicts</key>
-	<array>
-		<dict>
-			<key>LabelKey</key>
-			<string>iSync24Label</string>
-			<key>MessageKey</key>
-			<string>iSync2XMessage</string>
-			<key>SpecArgument</key>
-			<string>/Applications/iSync.app/Contents/Info.plist</string>
-			<key>SpecProperty</key>
-			<string>CFBundleVersion</string>
-			<key>SpecType</key>
-			<string>plist</string>
-			<key>TestObject</key>
-			<string>500.134</string>
-			<key>TestOperator</key>
-			<string>ge</string>
-			<key>TitleKey</key>
-			<string>iSync24Title</string>
-		</dict>
-	</array>
-</dict>
-</plist>
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/PkgInfo	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-pkmkrpkg1
\ No newline at end of file
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/Description.plist	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>IFPkgDescriptionDescription</key>
-	<string>Description of a Phone Plug-in</string>
-	<key>IFPkgDescriptionTitle</key>
-	<string>the phone plug-in</string>
-</dict>
-</plist>
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/English.lproj/ReadMe.rtf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\fs24 \cf0 This package has been built by Nokia Corporation. It will install a phone plugin to enable iSync support for your phone E60}
\ No newline at end of file
Binary file connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/IFRequirement.strings has changed
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/PhonePlugin.info	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-Title Phone Plug-in
-Version 
-Description 
-DefaultLocation /Library/PhonePlugins
-DeleteWarning 
-
-### Package Flags
-
-NeedsAuthorization NO
-Required YES
-Relocatable YES
-RequiresReboot NO
-UseUserMask NO
-OverwritePermissions NO
-InstallFat NO
-RootVolumeOnly YES
-OnlyUpdateInstalledLanguages NO
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/TokenDefinitions.plist	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-    <key>iSyncToken</key>
-    <array>
-        <dict>
-            <key>searchPlugin</key>
-            <string>CommonAppSearch</string>
-            <key>path</key>
-            <string>/Applications/iSync.app</string>
-            <key>identifier</key>
-            <string>com.apple.isync</string>
-        </dict>
-    </array>
-</dict>
-</plist>
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/Welcome.rtf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf380
-{\fonttbl\f0\fnil\fcharset77 LucidaGrande-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fnil\fcharset77 LucidaGrande;
-}
-{\colortbl;\red255\green255\blue255;\red1\green1\blue1;}
-\vieww9000\viewh8400\viewkind0
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\b\fs24 \cf0 Welcome to the iSync Phone Plug-in for Mac OS X Installer
-\f1\b0 \
-\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f2\fs22 \cf0 iSync for Mac OS X is synchronization software that keeps your Address Book contacts and iCal calendar and to-do information in sync between your Mac OS computers and iSync-compatible mobile phones.\
-\
-This installer guides you through the steps necessary to install an iSync Phone Plug-in for Mac OS X. To get started, click Continue.
-\f1\fs24 \cf2 \
-}
\ No newline at end of file
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/en.lproj/Description.plist	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>IFPkgDescriptionDescription</key>
-	<string></string>
-	<key>IFPkgDescriptionTitle</key>
-	<string>367C0F5C-1E53-44A3-AEA5-54D1EEE12F29-installerRoot</string>
-</dict>
-</plist>
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.pkg/Contents/Resources/package_version	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-major: 1
-minor: 0
\ No newline at end of file
Binary file connectivitymodules/SeCon/apple/S60_RnD_32.ppdoc/Icon.tiff has changed
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.ppdoc/InstallerReadMe-en.rtf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\fs24 \cf0 This package has been built by Nokia Corporation. It will install a phone plugin to enable iSync support for your phone E60}
\ No newline at end of file
--- a/connectivitymodules/SeCon/apple/S60_RnD_32.ppdoc/Properties.plist	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1358 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>TramontaneVersion</key>
-	<string>597.0</string>
-	<key>UUID</key>
-	<string>367C0F5C-1E53-44A3-AEA5-54D1EEE12F29</string>
-	<key>properties</key>
-	<dict>
-		<key>BTOptionsDict</key>
-		<dict>
-			<key>OBEXTimeout</key>
-			<string>60</string>
-			<key>TransportType</key>
-			<integer>0</integer>
-			<key>synchroScriptConnect</key>
-			<false/>
-			<key>synchroScriptDisconnect</key>
-			<false/>
-		</dict>
-		<key>UISettingsOptionsDict</key>
-		<dict>
-			<key>DontSyncEventsAfterDateIsEnabled</key>
-			<dict>
-				<key>default</key>
-				<integer>0</integer>
-				<key>visible</key>
-				<true/>
-			</dict>
-			<key>DontSyncEventsAfterDateValue</key>
-			<dict>
-				<key>default</key>
-				<string>1month</string>
-				<key>visible</key>
-				<true/>
-			</dict>
-			<key>DontSyncEventsPriorToDateIsEnabled</key>
-			<dict>
-				<key>default</key>
-				<integer>0</integer>
-				<key>visible</key>
-				<false/>
-			</dict>
-			<key>DontSyncEventsPriorToDateValue</key>
-			<dict>
-				<key>default</key>
-				<string>1week</string>
-				<key>visible</key>
-				<true/>
-			</dict>
-			<key>OnlySyncContactsWithPhoneNumber</key>
-			<dict>
-				<key>default</key>
-				<integer>1</integer>
-				<key>visible</key>
-				<true/>
-			</dict>
-			<key>SyncAllDayEventsKey</key>
-			<dict>
-				<key>default</key>
-				<integer>0</integer>
-				<key>visible</key>
-				<false/>
-			</dict>
-		</dict>
-		<key>USBOptionsDict</key>
-		<dict>
-			<key>OBEXTimeout</key>
-			<string>60</string>
-			<key>identificationCDCChannel</key>
-			<integer>0</integer>
-			<key>identificationScriptConnect</key>
-			<false/>
-			<key>identificationScriptDisconnect</key>
-			<false/>
-			<key>synchroCDCChannel</key>
-			<integer>1</integer>
-			<key>synchroOBEXChannel</key>
-			<integer>0</integer>
-			<key>synchroScriptConnect</key>
-			<false/>
-			<key>synchroScriptDisconnect</key>
-			<false/>
-			<key>useOBEX</key>
-			<true/>
-			<key>useOtherCDC</key>
-			<false/>
-			<key>useSameCDC</key>
-			<false/>
-		</dict>
-		<key>advancedOptionsSettings</key>
-		<dict>
-			<key>com_apple_pimsync_contacts</key>
-			<dict>
-				<key>DataClassName</key>
-				<string>Contacts</string>
-				<key>MaxAddAndReplaceCmd</key>
-				<integer>0</integer>
-				<key>MaxDeleteCmd</key>
-				<integer>0</integer>
-				<key>MaxSyncCmd</key>
-				<real>1</real>
-				<key>needsDeleteAddOnModify</key>
-				<integer>1</integer>
-			</dict>
-			<key>com_apple_pimsync_events</key>
-			<dict>
-				<key>DataClassName</key>
-				<string>Calendar</string>
-				<key>MaxAddAndReplaceCmd</key>
-				<integer>0</integer>
-				<key>MaxDeleteCmd</key>
-				<integer>0</integer>
-				<key>MaxSyncCmd</key>
-				<integer>0</integer>
-				<key>allDayInLocalDateTime</key>
-				<integer>1</integer>
-				<key>allowedAlarmRelativeValues</key>
-				<string></string>
-				<key>countValueWhenMissing</key>
-				<integer>0</integer>
-				<key>defaultUntilDateWhenMissing</key>
-				<string></string>
-				<key>doNotSyncAlarmForADE</key>
-				<false/>
-				<key>doNotSyncAlarmIfAfterStartDateTime</key>
-				<integer>1</integer>
-				<key>dontSyncEventBeforeDate</key>
-				<string></string>
-				<key>exDatesAreDateOnly</key>
-				<false/>
-				<key>handleMultiDayRecurrent</key>
-				<true/>
-				<key>hasAllDayMultiDay</key>
-				<true/>
-				<key>maxMinutesNbDeltaForAlarm</key>
-				<integer>0</integer>
-				<key>needsDeleteAddOnModify</key>
-				<integer>0</integer>
-				<key>noNewLines</key>
-				<integer>0</integer>
-				<key>onlyAsciiCharacters</key>
-				<false/>
-				<key>syncAlarmOnlyIfSameDayAsADEStartDate</key>
-				<false/>
-				<key>untilDateIsDateOnly</key>
-				<integer>1</integer>
-			</dict>
-			<key>com_apple_pimsync_parser_vCal</key>
-			<dict>
-				<key>AllDayCategories</key>
-				<string>REMINDER</string>
-				<key>EscapeBackslash</key>
-				<integer>1</integer>
-				<key>EscapeSemicolonInNotComponedValues</key>
-				<integer>1</integer>
-				<key>EscapeStrings</key>
-				<string></string>
-				<key>ExDatesInLocal</key>
-				<false/>
-				<key>IgnoreProperties</key>
-				<string>X-IRMC-LUID</string>
-				<key>PropertyNameMapping</key>
-				<array/>
-				<key>SetExDateTimeWithEndTime</key>
-				<false/>
-				<key>SetExDateTimeWithStartTime</key>
-				<false/>
-				<key>SetUntilTimeWithEndTime</key>
-				<integer>0</integer>
-				<key>SetUntilTimeWithStartTime</key>
-				<integer>1</integer>
-				<key>TimedCategories</key>
-				<string>MEETING</string>
-				<key>UntilDateInLocal</key>
-				<integer>1</integer>
-			</dict>
-			<key>com_apple_pimsync_parser_vCard</key>
-			<dict>
-				<key>AddCRLFAfterBase64Folding</key>
-				<integer>1</integer>
-				<key>IgnoreSubTypesForThisMainTypes</key>
-				<string>CELL</string>
-				<key>PropertyNameMapping</key>
-				<array>
-					<dict>
-						<key>key</key>
-						<string>X-NICKNAME</string>
-						<key>value</key>
-						<string>X-EPOCSECONDNAME</string>
-					</dict>
-				</array>
-			</dict>
-			<key>com_apple_pimsync_tasks</key>
-			<dict>
-				<key>DataClassName</key>
-				<string>Tasks</string>
-				<key>MaxAddAndReplaceCmd</key>
-				<integer>0</integer>
-				<key>MaxDeleteCmd</key>
-				<integer>0</integer>
-				<key>MaxSyncCmd</key>
-				<integer>0</integer>
-				<key>completionDateIsDateOnly</key>
-				<false/>
-				<key>defaultDueDateValueWhenMissing</key>
-				<string></string>
-				<key>defaultDueDateWhenMissing</key>
-				<string></string>
-				<key>doNotSyncAlarmForTask</key>
-				<false/>
-				<key>doNotSyncAlarmIfCompleted</key>
-				<integer>1</integer>
-				<key>dueDateIsDateOnly</key>
-				<false/>
-				<key>needsDeleteAddOnModify</key>
-				<false/>
-				<key>setDueDateToCompletionDateIfCompleted</key>
-				<false/>
-			</dict>
-			<key>com_apple_synchro</key>
-			<dict>
-				<key>SyncMLCodec</key>
-				<integer>0</integer>
-				<key>SyncMLDoNotTryToDetectPhoneDBReset</key>
-				<false/>
-				<key>SyncMLLocalSource</key>
-				<string>iSync</string>
-				<key>SyncMLMaxMsgSize</key>
-				<real>65535</real>
-				<key>SyncMLMaxObjSize</key>
-				<real>786432</real>
-				<key>SyncMLMsgTemporization</key>
-				<real>500000</real>
-				<key>SyncMLNoPropertiesCapabilitiesInDevInf</key>
-				<false/>
-				<key>SyncMLSendDevInfIntoPutIfNoGetReceived</key>
-				<integer>0</integer>
-				<key>SyncMLUseBinaryWBXMLPublicID</key>
-				<false/>
-			</dict>
-		</dict>
-		<key>calendarsOptionsDict</key>
-		<dict>
-			<key>Charset</key>
-			<string>UTF-8</string>
-			<key>FoldingStyle</key>
-			<string>FoldingNG</string>
-			<key>RemoteName</key>
-			<string>/</string>
-			<key>allDayFormat</key>
-			<integer>3</integer>
-			<key>eventRecurrenceEndType</key>
-			<integer>1</integer>
-			<key>hasAudioAlarm</key>
-			<true/>
-			<key>hasDisplayAlarm</key>
-			<false/>
-			<key>hasEvent</key>
-			<true/>
-			<key>hasTimeZone</key>
-			<integer>1</integer>
-			<key>hasVCalRecurrence</key>
-			<true/>
-		</dict>
-		<key>contactsOptionsDict</key>
-		<dict>
-			<key>RemoteName</key>
-			<string>/</string>
-			<key>firstAndLastNameInSameField</key>
-			<false/>
-			<key>needsCompanyNameInFirstName</key>
-			<integer>0</integer>
-			<key>needsFullAddressInStreetField</key>
-			<false/>
-		</dict>
-		<key>documentVersion</key>
-		<integer>556</integer>
-		<key>extraOptionsSettings</key>
-		<dict/>
-		<key>familyOptionsDict</key>
-		<dict>
-			<key>BTAvailable</key>
-			<true/>
-			<key>BluetoothAvailable</key>
-			<true/>
-			<key>CGMI</key>
-			<string>Nokia</string>
-			<key>CGMM</key>
-			<string>Nokia 6290</string>
-			<key>GMI</key>
-			<string>Nokia</string>
-			<key>GMM</key>
-			<string>Nokia 6290</string>
-			<key>ModelID</key>
-			<string>com.nokia.S6032</string>
-			<key>Name</key>
-			<string>S60-32</string>
-			<key>PluginProviderName</key>
-			<string>Nokia</string>
-			<key>ProductID</key>
-			<string>0x0500</string>
-			<key>USBAvailable</key>
-			<true/>
-			<key>VendorID</key>
-			<string>0x0421</string>
-			<key>connection</key>
-			<integer>2</integer>
-			<key>constructorName</key>
-			<string>Nokia</string>
-			<key>domainName</key>
-			<string>nokia.com</string>
-			<key>fixedDatabasesNames</key>
-			<integer>0</integer>
-			<key>pluginVersion</key>
-			<string>1.0</string>
-			<key>supportURL</key>
-			<string>http://www.nokia.com/support</string>
-			<key>useCGMICGMM</key>
-			<false/>
-		</dict>
-		<key>javaScriptDict</key>
-		<dict>
-			<key>btObexConnection</key>
-			<dict>
-				<key>Value</key>
-				<string>function prepareChannelForProtocol()
-{
-    // You can customize this function but do NOT change the signature
-}</string>
-			</dict>
-			<key>btObexDisconnection</key>
-			<dict>
-				<key>Value</key>
-				<string>function unprepareChannelForProtocol()
-{
-    // You can customize this function but do NOT change the signature
-}</string>
-			</dict>
-			<key>usbCdcConnection</key>
-			<dict>
-				<key>Value</key>
-				<string>function prepareChannelForProtocol()
-{
-    // You can customize this function but do NOT change the signature
-}</string>
-			</dict>
-			<key>usbCdcDisconnection</key>
-			<dict>
-				<key>Value</key>
-				<string>function unprepareChannelForProtocol()
-{
-    // You can customize this function but do NOT change the signature
-}</string>
-			</dict>
-			<key>usbObexConnection</key>
-			<dict>
-				<key>Value</key>
-				<string>function prepareChannelForProtocol()
-{
-    // You can customize this function but do NOT change the signature
-}</string>
-			</dict>
-			<key>usbObexDisconnection</key>
-			<dict>
-				<key>Value</key>
-				<string>function unprepareChannelForProtocol()
-{
-    // You can customize this function but do NOT change the signature
-}</string>
-			</dict>
-		</dict>
-		<key>notes</key>
-		<data>
-		WW91IGNhbiBzYXZlIGFueSBraW5kIG9mIGluZm9ybWF0aW9uIG9uIHRoZSBw
-		bHVnaW4gaGVyZS4KVGhleSB3b24ndCBiZSBleHBvcnRlZCBpbiB0aGUgcGx1
-		Z2luLg==
-		</data>
-		<key>syncFieldsSettings</key>
-		<dict>
-			<key>com_apple_calendars_Event</key>
-			<dict>
-				<key>classification</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>mappings</key>
-					<array>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>PUBLIC</string>
-							<key>originalValue</key>
-							<string>public</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>PRIVATE</string>
-							<key>originalValue</key>
-							<string>private</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>PRIVATE</string>
-							<key>originalValue</key>
-							<string>confidential</string>
-						</dict>
-					</array>
-				</dict>
-				<key>description</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>500</real>
-				</dict>
-				<key>end date</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-				<key>location</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>start date</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-				<key>summary</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>DontNeedCheckBox</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>500</real>
-				</dict>
-			</dict>
-			<key>com_apple_calendars_Task</key>
-			<dict>
-				<key>classification</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>mappings</key>
-					<array>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>PUBLIC</string>
-							<key>originalValue</key>
-							<string>public</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>PRIVATE</string>
-							<key>originalValue</key>
-							<string>private</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>PRIVATE</string>
-							<key>originalValue</key>
-							<string>confidential</string>
-						</dict>
-					</array>
-				</dict>
-				<key>completion date</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-				<key>description</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>due date</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-				<key>priority</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>mappings</key>
-					<array>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>originalValue</key>
-							<integer>0</integer>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>1</string>
-							<key>originalValue</key>
-							<integer>1</integer>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>2</string>
-							<key>originalValue</key>
-							<integer>2</integer>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>3</string>
-							<key>originalValue</key>
-							<integer>3</integer>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>4</string>
-							<key>originalValue</key>
-							<integer>4</integer>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>5</string>
-							<key>originalValue</key>
-							<integer>5</integer>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>6</string>
-							<key>originalValue</key>
-							<integer>6</integer>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>7</string>
-							<key>originalValue</key>
-							<integer>7</integer>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>8</string>
-							<key>originalValue</key>
-							<integer>8</integer>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>9</string>
-							<key>originalValue</key>
-							<integer>9</integer>
-						</dict>
-					</array>
-				</dict>
-				<key>status</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>mappings</key>
-					<array>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>DECLINED</string>
-							<key>originalValue</key>
-							<string>cancelled</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>NEEDS ACTION</string>
-							<key>originalValue</key>
-							<string>needsaction</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>COMPLETED</string>
-							<key>originalValue</key>
-							<string>completed</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>ACCEPTED</string>
-							<key>originalValue</key>
-							<string>inprocess</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string></string>
-							<key>originalValue</key>
-							<string>none</string>
-						</dict>
-					</array>
-				</dict>
-				<key>summary</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>DontNeedCheckBox</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-			</dict>
-			<key>com_apple_contacts_Contact</key>
-			<dict>
-				<key>birthday</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-				<key>company name</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>DontNeedCheckBox</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>department</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>first name</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>DontNeedCheckBox</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>image</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>maxLength</key>
-					<integer>0</integer>
-				</dict>
-				<key>job title</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>last name</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>DontNeedCheckBox</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>middle name</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>nickname</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>notes</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>maxLength</key>
-					<real>1000</real>
-				</dict>
-				<key>suffix</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>title</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-			</dict>
-			<key>com_apple_contacts_Date</key>
-			<dict>
-				<key>IPSGlobalEntity</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-				<key>type</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>mappings</key>
-					<array>
-						<dict>
-							<key>activated</key>
-							<false/>
-							<key>mappedValue</key>
-							<string>X-ANNIVERSARY</string>
-							<key>originalValue</key>
-							<string>anniversary</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<false/>
-							<key>mappedValue</key>
-							<string>X-DATE</string>
-							<key>originalValue</key>
-							<string>other</string>
-						</dict>
-					</array>
-				</dict>
-				<key>value</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-			</dict>
-			<key>com_apple_contacts_Email Address</key>
-			<dict>
-				<key>IPSGlobalEntity</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-				<key>type</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>mappings</key>
-					<array>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>WORK</string>
-							<key>originalValue</key>
-							<string>work</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>HOME</string>
-							<key>originalValue</key>
-							<string>home</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>INTERNET</string>
-							<key>originalValue</key>
-							<string>other</string>
-						</dict>
-					</array>
-				</dict>
-				<key>value</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>DontNeedCheckBox</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-			</dict>
-			<key>com_apple_contacts_Phone Number</key>
-			<dict>
-				<key>IPSGlobalEntity</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-				<key>type</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>mappings</key>
-					<array>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>WORK</string>
-							<key>originalValue</key>
-							<string>work</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>HOME</string>
-							<key>originalValue</key>
-							<string>home</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>CELL</string>
-							<key>originalValue</key>
-							<string>mobile</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>FAX</string>
-							<key>originalValue</key>
-							<string>work fax</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>FAX</string>
-							<key>originalValue</key>
-							<string>home fax</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string></string>
-							<key>originalValue</key>
-							<string>other</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string></string>
-							<key>originalValue</key>
-							<string>main</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>PAGER</string>
-							<key>originalValue</key>
-							<string>pager</string>
-						</dict>
-					</array>
-				</dict>
-				<key>value</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>DontNeedCheckBox</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>2</integer>
-					<key>charsToKeep</key>
-					<string>0123456789+#*pw</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-			</dict>
-			<key>com_apple_contacts_Related Name</key>
-			<dict>
-				<key>IPSGlobalEntity</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-				<key>type</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>mappings</key>
-					<array>
-						<dict>
-							<key>activated</key>
-							<false/>
-							<key>mappedValue</key>
-							<string>X-FATHER</string>
-							<key>originalValue</key>
-							<string>father</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<false/>
-							<key>mappedValue</key>
-							<string>X-MOTHER</string>
-							<key>originalValue</key>
-							<string>mother</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<false/>
-							<key>mappedValue</key>
-							<string>X-PARENT</string>
-							<key>originalValue</key>
-							<string>parent</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>X-CHILDREN</string>
-							<key>originalValue</key>
-							<string>child</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<false/>
-							<key>mappedValue</key>
-							<string>X-BROTHER</string>
-							<key>originalValue</key>
-							<string>brother</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<false/>
-							<key>mappedValue</key>
-							<string>X-SISTER</string>
-							<key>originalValue</key>
-							<string>sister</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<false/>
-							<key>mappedValue</key>
-							<string>X-FRIEND</string>
-							<key>originalValue</key>
-							<string>friend</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>X-SPOUSE</string>
-							<key>originalValue</key>
-							<string>spouse</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<false/>
-							<key>mappedValue</key>
-							<string>X-PARTNER</string>
-							<key>originalValue</key>
-							<string>partner</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>X-ASSISTANT</string>
-							<key>originalValue</key>
-							<string>assistant</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<false/>
-							<key>mappedValue</key>
-							<string>X-MANAGER</string>
-							<key>originalValue</key>
-							<string>manager</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<false/>
-							<key>mappedValue</key>
-							<string>X-NAME</string>
-							<key>originalValue</key>
-							<string>other</string>
-						</dict>
-					</array>
-				</dict>
-				<key>value</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>DontNeedCheckBox</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-			</dict>
-			<key>com_apple_contacts_Street Address</key>
-			<dict>
-				<key>IPSGlobalEntity</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-				<key>city</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>country</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>postal code</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>state</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>street</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>DontNeedCheckBox</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>255</real>
-				</dict>
-				<key>type</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>mappings</key>
-					<array>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>WORK</string>
-							<key>originalValue</key>
-							<string>work</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>HOME</string>
-							<key>originalValue</key>
-							<string>home</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string></string>
-							<key>originalValue</key>
-							<string>other</string>
-						</dict>
-					</array>
-					<key>relationshipLimitKind</key>
-					<integer>2</integer>
-				</dict>
-			</dict>
-			<key>com_apple_contacts_URL</key>
-			<dict>
-				<key>IPSGlobalEntity</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-				</dict>
-				<key>type</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>mappings</key>
-					<array>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>WORK</string>
-							<key>originalValue</key>
-							<string>work</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>HOME</string>
-							<key>originalValue</key>
-							<string>home page</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string>HOME</string>
-							<key>originalValue</key>
-							<string>home</string>
-						</dict>
-						<dict>
-							<key>activated</key>
-							<true/>
-							<key>mappedValue</key>
-							<string></string>
-							<key>originalValue</key>
-							<string>other</string>
-						</dict>
-					</array>
-				</dict>
-				<key>value</key>
-				<dict>
-					<key>Activated</key>
-					<true/>
-					<key>DontNeedCheckBox</key>
-					<true/>
-					<key>charsFiltering</key>
-					<integer>1</integer>
-					<key>charsToStrip</key>
-					<string>\r,\n</string>
-					<key>maxLength</key>
-					<real>500</real>
-				</dict>
-			</dict>
-		</dict>
-		<key>syncMLOptionsDict</key>
-		<dict>
-			<key>SyncMLBusySignalingInterval</key>
-			<real>60</real>
-			<key>SyncMLBusySignalingSupport</key>
-			<true/>
-			<key>SyncMLLargeObjectSupport</key>
-			<true/>
-			<key>SyncMLMaxSyncCmdNbInEncodedMsg</key>
-			<real>30</real>
-			<key>SyncMLNumberOfChangesSupport</key>
-			<true/>
-			<key>SyncMLOnlyOneBusySignaling</key>
-			<false/>
-			<key>SyncMLRefreshFromServerSupport</key>
-			<true/>
-			<key>SyncMLRemoteNeedsRelativePaths</key>
-			<false/>
-			<key>SyncMLSimulateBusySignalingWithEmptySync</key>
-			<false/>
-			<key>SyncMLVersion</key>
-			<string>SyncML11</string>
-			<key>limitSyncCmd</key>
-			<false/>
-		</dict>
-		<key>tasksOptionsDict</key>
-		<dict>
-			<key>RemoteName</key>
-			<string>Tasks</string>
-			<key>hasDifferentDataclassesForTasksAndEvents</key>
-			<false/>
-			<key>hasTasks</key>
-			<true/>
-		</dict>
-		<key>vCalRecSettings</key>
-		<dict>
-			<key>com_apple_pimsync_events</key>
-			<dict>
-				<key>handleAllDayRecurrent</key>
-				<true/>
-			</dict>
-			<key>com_apple_pimsync_parser_vCal</key>
-			<dict>
-				<key>vCalExDatesSupport</key>
-				<true/>
-				<key>vCalRecDaily</key>
-				<true/>
-				<key>vCalRecDailyInterval</key>
-				<string></string>
-				<key>vCalRecDropIfUseless</key>
-				<integer>1</integer>
-				<key>vCalRecMaxExDatesNb</key>
-				<integer>0</integer>
-				<key>vCalRecMonthlyByDay</key>
-				<true/>
-				<key>vCalRecMonthlyByDayOnlyOnStartDateMonthDay</key>
-				<false/>
-				<key>vCalRecMonthlyByDayOnlyOneMonthDay</key>
-				<false/>
-				<key>vCalRecMonthlyByDayWithMonthDay</key>
-				<true/>
-				<key>vCalRecMonthlyByPos</key>
-				<true/>
-				<key>vCalRecMonthlyByPosOnlyOnStartDateWeekDay</key>
-				<false/>
-				<key>vCalRecMonthlyByPosOnlyOneWeekDay</key>
-				<false/>
-				<key>vCalRecMonthlyInterval</key>
-				<string></string>
-				<key>vCalRecOnlyForever</key>
-				<false/>
-				<key>vCalRecWeekly</key>
-				<true/>
-				<key>vCalRecWeeklyInterval</key>
-				<string></string>
-				<key>vCalRecWeeklyOnlyOnStartDateWeekDay</key>
-				<false/>
-				<key>vCalRecWeeklyOnlyOneWeekDay</key>
-				<false/>
-				<key>vCalRecWeeklyWithWeekDay</key>
-				<true/>
-				<key>vCalRecYearlyByMonth</key>
-				<true/>
-				<key>vCalRecYearlyByMonthInterval</key>
-				<string></string>
-				<key>vCalRecYearlyByMonthOnlyOnStartDateMonthNumber</key>
-				<false/>
-				<key>vCalRecYearlyByMonthOnlyOneMonthNumber</key>
-				<false/>
-				<key>vCalRecYearlyByMonthWithMonthNumber</key>
-				<true/>
-			</dict>
-		</dict>
-	</dict>
-	<key>version</key>
-	<integer>0</integer>
-</dict>
-</plist>
--- a/connectivitymodules/SeCon/catalogspcconnectivityplugin/bwins/catalogspcconnectivitypluginu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-EXPORTS
-	??1CCatalogsPCConnectivityPlugin@@UAE@XZ @ 1 NONAME ; CCatalogsPCConnectivityPlugin::~CCatalogsPCConnectivityPlugin(void)
-	?Close@CCatalogsPCConnectivityPlugin@@QAEXXZ @ 2 NONAME ; void CCatalogsPCConnectivityPlugin::Close(void)
-	?Connect@CCatalogsPCConnectivityPlugin@@QAEHXZ @ 3 NONAME ; int CCatalogsPCConnectivityPlugin::Connect(void)
-	?GetDataL@CCatalogsPCConnectivityPlugin@@QAEXAAVTDataType@@AAVCBufFlat@@@Z @ 4 NONAME ; void CCatalogsPCConnectivityPlugin::GetDataL(class TDataType &, class CBufFlat &)
-	?NewL@CCatalogsPCConnectivityPlugin@@SAPAV1@XZ @ 5 NONAME ; class CCatalogsPCConnectivityPlugin * CCatalogsPCConnectivityPlugin::NewL(void)
-	?NewLC@CCatalogsPCConnectivityPlugin@@SAPAV1@XZ @ 6 NONAME ; class CCatalogsPCConnectivityPlugin * CCatalogsPCConnectivityPlugin::NewLC(void)
-	?PutDataL@CCatalogsPCConnectivityPlugin@@QAEXABVTDataType@@ABVCBufFlat@@@Z @ 7 NONAME ; void CCatalogsPCConnectivityPlugin::PutDataL(class TDataType const &, class CBufFlat const &)
-	?SupportedMimeTypesL@CCatalogsPCConnectivityPlugin@@QAE?AV?$RPointerArray@VTDataType@@@@XZ @ 8 NONAME ; class RPointerArray<class TDataType> CCatalogsPCConnectivityPlugin::SupportedMimeTypesL(void)
-
--- a/connectivitymodules/SeCon/catalogspcconnectivityplugin/eabi/catalogspcconnectivitypluginu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-EXPORTS
-	_ZN29CCatalogsPCConnectivityPlugin19SupportedMimeTypesLEv @ 1 NONAME
-	_ZN29CCatalogsPCConnectivityPlugin4NewLEv @ 2 NONAME
-	_ZN29CCatalogsPCConnectivityPlugin5CloseEv @ 3 NONAME
-	_ZN29CCatalogsPCConnectivityPlugin5NewLCEv @ 4 NONAME
-	_ZN29CCatalogsPCConnectivityPlugin7ConnectEv @ 5 NONAME
-	_ZN29CCatalogsPCConnectivityPlugin8GetDataLER9TDataTypeR8CBufFlat @ 6 NONAME
-	_ZN29CCatalogsPCConnectivityPlugin8PutDataLERK9TDataTypeRK8CBufFlat @ 7 NONAME
-	_ZN29CCatalogsPCConnectivityPluginD0Ev @ 8 NONAME
-	_ZN29CCatalogsPCConnectivityPluginD1Ev @ 9 NONAME
-	_ZN29CCatalogsPCConnectivityPluginD2Ev @ 10 NONAME
-	_ZTI29CCatalogsPCConnectivityPlugin @ 11 NONAME ; #<TI>#
-	_ZTV29CCatalogsPCConnectivityPlugin @ 12 NONAME ; #<VT>#
-
--- a/connectivitymodules/SeCon/catalogspcconnectivityplugin/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/*
-* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Build info file for Catalogs PC Connectivity Plugin
-*
-*/
-
-
-PRJ_MMPFILES
-
-catalogspcconnectivityplugin.mmp
-
-
--- a/connectivitymodules/SeCon/catalogspcconnectivityplugin/group/catalogspcconnectivityplugin.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Project definition file for project Catalogs PC Connectivity
-*                Plugin
-*
-*/
-
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-TARGET                  catalogspcconnectivityplugin.dll
-TARGETTYPE              dll
-UID                     0x1000008D 0x10207E73
-
-CAPABILITY              CAP_ECOM_PLUGIN
-VENDORID                VID_DEFAULT
-
-SOURCEPATH              ../src
-SOURCE                  catalogspcconnectivityplugin.cpp
-SOURCE                  catalogspcconnectivityclient.cpp
-
-USERINCLUDE             ../inc
-
-// Default system include paths.
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY                 euser.lib
-LIBRARY                 apmime.lib
--- a/connectivitymodules/SeCon/catalogspcconnectivityplugin/inc/catalogspcconnectivityclient.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* Copyright (c) 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 a client which communicate with the server 
-*                CatalogsEnginePCClientFrontEnd 
-*
-*/
-
-
-#ifndef R_CATALOGSPCCONNECTIVITYCLIENT_H
-#define R_CATALOGSPCCONNECTIVITYCLIENT_H
-
-#include <e32base.h>
-#include <apmstd.h>
-
-/**
- *  This client communicate with the server CatalogsEnginePCClientFrontEnd
- *
- *  This class get requests from CatalogsPCConnectivityPlugin. 
- *  Class itself is client in client-server solution. When request 
- *  is received it will start the server (CatalogsEnginePCClientFrontEnd). 
- *  This client class is dummy, the server have all the functionality.
- *
- *  @lib catalogspcconnectivityplugin
- *  @since S60 v3.1
- */
-class RCatalogsPCConnectivityClient : public RSessionBase
-    {
-public:
-
-    /**
-     * Constructor
-     *
-     * @since S60 v3.1
-     */
-    RCatalogsPCConnectivityClient();
-
-    /**
-     * Destructor
-     *
-     * @since S60 v3.1
-     */
-    ~RCatalogsPCConnectivityClient();
-
-    /**
-     * A connection is formed to the Catalogs engine pc client front-end.
-     * This will start up the front-end server and connect to it 
-     *
-     * @since S60 v3.1
-     * @return TInt Standard error code, KErrNone if connection is formed
-     *         or the connection was formed already     
-     */
-    TInt Connect();
-
-    /**
-     * The connection to the Catalogs engine front-end is closed
-     *
-     * @since S60 v3.1
-     */
-    void Close();
-
-    /**
-     * All MIME types supported by this component can be asked using this method
-     *
-     * @since S60 v3.1
-     * @return RPointerArray< TDataType > contain all supported MIME types
-     *         RPointerArray TDataTypes have allocated using new, caller
-     *         have to remember to delete them properly
-     * @exeption Leaves with standard error codes
-     */
-    RPointerArray<TDataType> SupportedMimeTypesL();
-
-    /**
-     * A data packet of max length 65535 (0xFFFF) bytes is synchronously
-     * sent to the Catalogs engine front-end
-     * Usage: After PutDataL have been called, you have to call GetDataL
-     *        before you can call PutDataL again
-     *
-     * @since S60 v3.1
-     * @param aMimeType data packet MIME type
-     * @param aData data buffer to read from
-     * @exeption Leaves with standard error codes
-     */
-    void PutDataL( const TDataType& aMimeType, 
-        const CBufFlat& aData );
-
-    /**
-     * A data packet is synchronously transfered from the Catalogs front-end
-     * and returned to caller 
-     * Usage: Everytime before calling GetDataL, you have to call PutDataL.
-     *        So you can't call GetData in sequentially.
-     *
-     * @since S60 v3.1
-     * @param aMimeType data packet MIME type
-     * @param aData data buffer to write to. Will call ExpandL function
-     *        for aData, but never more than max length 65535 (OxFFFF)
-     * @return nothing, but parameter aData work as return buffer
-     * @exeption Leaves with standard error codes
-     */                                                          
-    void GetDataL( TDataType& aMimeType, CBufFlat& aData );
-
-    
-private:
-
-// private functions
-
-    /**
-     * Returns the earliest version number of the server that we can talk to
-     *
-     * @since S60 v3.1
-     * @return TVersion Earliest version number we can talk to
-     */
-    TVersion Version() const;
-
-    /**
-     * Start server if it isn't running already
-     *
-     * @since S60 v3.1
-     * @return TInt Standard error code, KErrNone if server was running
-     *         already or start was succesfull     
-     */
-    TInt StartServer();
-
-    /**
-     * Create server process
-     *
-     * @since S60 v3.1
-     * @return TInt standard error code, KErrNone when creation was success
-     */
-    TInt CreateServerProcess();
-
-    };
-
-#endif // R_CATALOGSPCCONNECTIVITYCLIENT_H
-
--- a/connectivitymodules/SeCon/catalogspcconnectivityplugin/inc/catalogspcconnectivitydefines.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 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:  Server information that the client needs
-*
-*/
-
-
-#include <e32base.h>
-
-/**  Server name */
-_LIT( KCatalogsPCConnectivityServerName, 
-    "CatalogsPCConnectivityServer" );
-
-/** Semaphore that is used when creating a new server */
-_LIT( KCatalogsPCConnectivityServerSemaphoreName, 
-    "CATALOGSPCCONNECTIVITYSemaphore" );
-
-/** File that is passed to the new server-process for execution */
-_LIT( KCatalogsPCConnectivityServerFilename, 
-    "catalogsenginepcclientfrontend" );
-
-// Default message slot amount in a session
-const TUint KCatalogsPCConnectivityDefaultMessageSlots = 255;
-
-/**  Version numbers */
-const TUint KCatalogsPCConnectivityMajorVersionNumber=1;
-const TUint KCatalogsPCConnectivityMinorVersionNumber=0;
-const TUint KCatalogsPCConnectivityBuildVersionNumber=0;
-
-/**  Function opcodes used in message passing between client and server */
-enum TCatalogsPCConnectivityServRqst
-    {
-    ECatalogsPCConnectivitySupportedMimeTypes = 1,
-    ECatalogsPCConnectivityPutData,
-    ECatalogsPCConnectivityGetData,
-    ECatalogsPCConnectivityGetSize
-    };
-
--- a/connectivitymodules/SeCon/catalogspcconnectivityplugin/inc/catalogspcconnectivityplugin.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
-* Copyright (c) 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 plugin enables the Catalogs PC client to communicate 
-*                with the Catalogs engine
-*
-*/
-
-
-#ifndef C_CATALOGSPCCONNECTIVITYPLUGIN_H
-#define C_CATALOGSPCCONNECTIVITYPLUGIN_H
-
-#include "catalogspcconnectivityclient.h"
-
-/**
- *  Plugin enables Catalogs PC client to communicate with the Catalogs engine
- *
- *  This class get requests from Catalogs PC client. It passes the requests
- *  to client CatalogsPCConnectivityClient
- *
- *  @lib catalogspcconnectivityplugin
- *  @since S60 v3.1
- */
-class CCatalogsPCConnectivityPlugin : public CBase
-    {
-public:
-
-    /**
-     * Standard symbian object construction first phase
-     *
-     * @since S60 v3.1
-     * @return CCatalogsPCConnectivityPlugin pointer
-     */
-    IMPORT_C static  CCatalogsPCConnectivityPlugin* NewL();
-
-    /**
-     * Standard symbian object constructing first phase
-     *
-     * @since S60 v3.1
-     * @return CCatalogsPCConnectivityPlugin pointer
-     */
-    IMPORT_C static  CCatalogsPCConnectivityPlugin* NewLC();
-
-    /**
-     * Destructor
-     *
-     * @since S60 v3.1
-     */
-    IMPORT_C virtual ~CCatalogsPCConnectivityPlugin();
-
-    /**
-     * A connection is formed to the Catalogs engine pc client front-end.
-     * This will start up the front-end server and connect to it 
-     *
-     * @return TInt Standard error code, KErrNone if connection is formed
-     * @since S60 v3.1
-     */
-    IMPORT_C TInt Connect();
-
-    /**
-     * The connection to the Catalogs engine front-end is closed
-     *
-     * @since S60 v3.1
-     */
-    IMPORT_C void Close();
-
-    /**
-     * All MIME types supported by this component can be asked using this method
-     *
-     * @return RPointerArray<TDataType> contains all supported MIME types. 
-     *         The ownership is transferred to the caller.
-     *         Use ResetAndDestroy method to free all allocated memory
-     * @exeption Leaves with standard error codes
-     * @since S60 v3.1
-     */
-    IMPORT_C RPointerArray<TDataType> SupportedMimeTypesL();
-
-    /**
-     * A Data packet of max length 65535 (0xFFFF) bytes is synchronously
-     * sent to the Catalogs engine front-end.
-     * Usage: After PutDataL has been called, you must call GetDataL
-     *        before you can call PutDataL again
-     *
-     * @param aMimeType Data packet MIME type
-     * @param aData Data buffer to read from
-     * @exeption Leaves with standard error codes
-     *           KErrNotSupported if not supported MIME type
-     * @since S60 v3.1
-     */
-    IMPORT_C void PutDataL( const TDataType& aMimeType, 
-                            const CBufFlat& aData );
-
-    /**
-     * A data packet is synchronously transfered from the Catalogs front-end
-     * and returned to caller
-     * Usage: Everytime before calling GetDataL, you have to call PutDataL.
-     *        You may not call GetData in sequentially.
-     *
-     * @since S60 v3.1
-     * @param aMimeType MIME type of the received data packet
-     * @param aData Data buffer to write to. ExpandL function will be called
-     *        with the correct size for aData, but not more than max length
-     *        65535 (OxFFFF)
-     * @return The reference parameters contain the return data
-     * @exeption Leaves with standard error codes
-     */                                                          
-    IMPORT_C void GetDataL( TDataType& aMimeType, CBufFlat& aData );
-    
-    
-private:
-
-// private functions
-
-
-    /**
-     * Constructor
-     *
-     * @since S60 v3.1
-     */
-    CCatalogsPCConnectivityPlugin();
-
-    /**
-     * Standard symbian object construction second phase
-     */
-    void ConstructL();
-
-
-private: // data
-
-    /**
-     * Client that communicate with the CatalogsEnginePCClientFrontEnd
-     */
-    RCatalogsPCConnectivityClient iClient;
-    
-    };
-
-#endif // C_CATALOGSPCCONNECTIVITYPLUGIN_H
--- a/connectivitymodules/SeCon/catalogspcconnectivityplugin/src/catalogspcconnectivityclient.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,229 +0,0 @@
-/*
-* Copyright (c) 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:  Client that communicate with CatalogsEnginePCClientFrontEnd
-*
-*/
-
-
-#include "catalogspcconnectivityclient.h"
-#include "catalogspcconnectivitydefines.h"
-
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// Constructor
-// ---------------------------------------------------------------------------
-//
-RCatalogsPCConnectivityClient::RCatalogsPCConnectivityClient()
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-RCatalogsPCConnectivityClient::~RCatalogsPCConnectivityClient()
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Start server and create session with server
-// ---------------------------------------------------------------------------
-//
-TInt RCatalogsPCConnectivityClient::Connect()
-    {
-    TInt err = StartServer();
-        
-    if ( err == KErrNone )
-        {
-        err = CreateSession( 
-            KCatalogsPCConnectivityServerName,
-            Version(), 
-            KCatalogsPCConnectivityDefaultMessageSlots );
-        }
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Close session (After session is closed will server be closed too)
-// ---------------------------------------------------------------------------
-//
-void RCatalogsPCConnectivityClient::Close()
-    {
-    RHandleBase::Close();
-    }
-
-// ---------------------------------------------------------------------------
-// Give MIME types supported by this Module
-// ---------------------------------------------------------------------------
-//
-RPointerArray<TDataType> RCatalogsPCConnectivityClient::
-SupportedMimeTypesL()
-    {
-    RPointerArray<TDataType> supportedMIMEs;
-    TBool isThereMore = ETrue;
-    TPckgBuf<TBool> pckgIsThereMore;
-    TDataType* tempMIME = 0;
-    TPckgBuf<TDataType> pckgMIME;
-    
-    while( isThereMore )
-        {
-        User::LeaveIfError( SendReceive( 
-                ECatalogsPCConnectivitySupportedMimeTypes, 
-                TIpcArgs( &pckgMIME, &pckgIsThereMore ) ) );
-        isThereMore = pckgIsThereMore();
-        tempMIME = new( ELeave ) TDataType( pckgMIME() );
-        User::LeaveIfError( supportedMIMEs.Append( tempMIME ) );
-        }
-
-    return supportedMIMEs;
-    }
-
-// ---------------------------------------------------------------------------
-// Data package from CatalogsPCConnectivityPlugin
-// ---------------------------------------------------------------------------
-//
-void RCatalogsPCConnectivityClient::PutDataL( 
-    const TDataType& aMimeType, const CBufFlat& aData )
-    {
-    TInt size = aData.Size();
-    
-    RBuf8 desData;
-    desData.CreateL( size );
-    desData.CleanupClosePushL();
-    aData.Read( 0, desData, size );
-    TPckgBuf<TDataType> pckgMIME( aMimeType );
-
-    User::LeaveIfError( SendReceive( 
-            ECatalogsPCConnectivityPutData, 
-            TIpcArgs( &pckgMIME, &desData, size ) ) );
-
-    CleanupStack::Pop(); //desData
-    desData.Close();
-    }
-
-// ---------------------------------------------------------------------------
-// Data request from CatalogsPCConnectivityPlugin
-// First ask the size from server, then give correct size CBufFlat
-// ---------------------------------------------------------------------------
-//
-void RCatalogsPCConnectivityClient::GetDataL( 
-    TDataType& aMimeType, CBufFlat& aData )
-    {
-    TPckgBuf<TInt> pckgSize;
-    TPckgBuf<TDataType> pckgMIME;
-    
-    User::LeaveIfError( SendReceive( 
-            ECatalogsPCConnectivityGetSize, 
-            TIpcArgs( &pckgMIME, &pckgSize ) ) );
-    
-    TInt size = pckgSize();
-    aMimeType = pckgMIME();
-    
-    RBuf8 desData;
-    desData.CreateL( size );
-    desData.CleanupClosePushL();
-    
-    User::LeaveIfError( SendReceive( 
-            ECatalogsPCConnectivityGetData, 
-            TIpcArgs( &desData ) ) );
-    
-    aData.Reset();
-    aData.ExpandL( 0, size );
-    aData.Write( 0, desData, size );        
-            
-    CleanupStack::Pop(); //desData
-    desData.Close();
-    }
-
-// ---------------------------------------------------------------------------
-// Return version number
-// ---------------------------------------------------------------------------
-//
-TVersion RCatalogsPCConnectivityClient::Version() const
-    {
-    return( TVersion( KCatalogsPCConnectivityMajorVersionNumber,
-            KCatalogsPCConnectivityMinorVersionNumber,
-            KCatalogsPCConnectivityBuildVersionNumber ) );
-    }
-
-// ---------------------------------------------------------------------------
-// Start server if it isn't running already
-// ---------------------------------------------------------------------------
-//
-TInt RCatalogsPCConnectivityClient::StartServer()
-    {
-    // Check if the server is already running
-    TFindServer findServer( KCatalogsPCConnectivityServerName );
-    TFullName name;
-
-    TInt result = findServer.Next( name );
-    if ( result == KErrNone )
-        {
-        // Server is running
-        return KErrNone;
-        }
-
-    // Create a semaphore so we can wait while the server starts
-    RSemaphore semaphore;
-    result = semaphore.CreateGlobal( 
-    	KCatalogsPCConnectivityServerSemaphoreName, 0 );
-    if ( result != KErrNone )
-        {
-        return result;
-        }
-
-    // Create new Engine service process 
-    result = CreateServerProcess();
-    if ( result != KErrNone )
-        {
-        semaphore.Close();
-        return result;
-        }
-
-    // Wait while the server starts
-    semaphore.Wait();
-
-    // Semaphore has been signaled, close and return
-    semaphore.Close();
-
-    return KErrNone;
-    }
-
-// ---------------------------------------------------------------------------
-// Create server process
-// ---------------------------------------------------------------------------
-//
-TInt RCatalogsPCConnectivityClient::CreateServerProcess()
-    {
-
-    RProcess server;
-
-    TInt result = server.Create( 
-        KCatalogsPCConnectivityServerFilename, KNullDesC );
-    if ( result != KErrNone )
-        {
-        return result;
-        }
-    
-    // Resume server thread and close handle
-    server.Resume();
-    server.Close();  
-
-    return KErrNone;
-    }
-
-
-//end
--- a/connectivitymodules/SeCon/catalogspcconnectivityplugin/src/catalogspcconnectivityplugin.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
-* Copyright (c) 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 plugin enables the Catalogs PC client to communicate 
-*                with the Catalogs engine
-*
-*/
-
-
-
-#include "catalogspcconnectivityplugin.h"
-
-
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// Constructor
-// ---------------------------------------------------------------------------
-//
-CCatalogsPCConnectivityPlugin::CCatalogsPCConnectivityPlugin()
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Empty
-// ---------------------------------------------------------------------------
-//
-void CCatalogsPCConnectivityPlugin::ConstructL()
-    {
-    }
-
-
-// ---------------------------------------------------------------------------
-// Standard symbian object constructing first phase
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CCatalogsPCConnectivityPlugin* CCatalogsPCConnectivityPlugin::NewL()
-    {
-    CCatalogsPCConnectivityPlugin* self = 
-        CCatalogsPCConnectivityPlugin::NewLC();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-
-// ---------------------------------------------------------------------------
-// Standard symbian object constructing first phase
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CCatalogsPCConnectivityPlugin* CCatalogsPCConnectivityPlugin::NewLC()
-    {
-    CCatalogsPCConnectivityPlugin* self = 
-        new( ELeave ) CCatalogsPCConnectivityPlugin;
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CCatalogsPCConnectivityPlugin::~CCatalogsPCConnectivityPlugin()
-    {
-    iClient.Close();
-    }
-
-
-// ---------------------------------------------------------------------------
-// Connect to Catalogs engine pc client front-end
-// ---------------------------------------------------------------------------
-//
-EXPORT_C TInt CCatalogsPCConnectivityPlugin::Connect()
-    {
-    return iClient.Connect();
-    }
-
-// ---------------------------------------------------------------------------
-// Close the connection to Catalogs engine pc client front-end
-// ---------------------------------------------------------------------------
-//
-EXPORT_C void CCatalogsPCConnectivityPlugin::Close()
-    {
-    iClient.Close();
-    }
-
-// ---------------------------------------------------------------------------
-// Give all MIME types supported by this component
-// ---------------------------------------------------------------------------
-//
-EXPORT_C RPointerArray<TDataType> CCatalogsPCConnectivityPlugin::
-    SupportedMimeTypesL()
-    {
-    return iClient.SupportedMimeTypesL();
-    }
-
-// ---------------------------------------------------------------------------
-// Data package from PC Client
-// ---------------------------------------------------------------------------
-//
-EXPORT_C void CCatalogsPCConnectivityPlugin::PutDataL( 
-    const TDataType& aMimeType, const CBufFlat& aData )
-    {
-    iClient.PutDataL( aMimeType, aData );
-    }
-
-// ---------------------------------------------------------------------------
-// Data request from PC Client
-// ---------------------------------------------------------------------------
-//
-EXPORT_C void CCatalogsPCConnectivityPlugin::GetDataL( 
-    TDataType& aMimeType, CBufFlat& aData )
-    {
-    iClient.GetDataL( aMimeType, aData );
-    }
-
-
-// ======== GLOBAL FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// Dll entry point
-// ---------------------------------------------------------------------------
-//
-GLDEF_C TInt E32Dll()
-    {
-    return( KErrNone );
-    }
-
--- a/connectivitymodules/SeCon/clients/pcconn/bld/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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 provides the information required for building the
-*    whole of SConPCConnClient
-*
-*/
-
-
-PRJ_PLATFORMS  
-DEFAULT
-
-PRJ_MMPFILES
-../bld/sconpcconnclient.mmp
--- a/connectivitymodules/SeCon/clients/pcconn/bld/def/bwinscwu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-EXPORTS
-	??0RSConPCConnSession@@QAE@XZ @ 1 NONAME ; RSConPCConnSession::RSConPCConnSession(void)
-	??1RSConPCConnSession@@QAE@XZ @ 2 NONAME ; RSConPCConnSession::~RSConPCConnSession(void)
-	?Close@RSConPCConnSession@@QAEXXZ @ 3 NONAME ; void RSConPCConnSession::Close(void)
-	?Connect@RSConPCConnSession@@QAEHXZ @ 4 NONAME ; int RSConPCConnSession::Connect(void)
-	?GetPacketL@RSConPCConnSession@@QAEHABVTDesC16@@ABVTDesC8@@AAPAVCBufFlat@@@Z @ 5 NONAME ; int RSConPCConnSession::GetPacketL(class TDesC16 const &, class TDesC8 const &, class CBufFlat * &)
-	?PutPacketL@RSConPCConnSession@@QAEHABVTDesC16@@ABVTDesC8@@AAPAVCBufFlat@@@Z @ 6 NONAME ; int RSConPCConnSession::PutPacketL(class TDesC16 const &, class TDesC8 const &, class CBufFlat * &)
-	?ResetServer@RSConPCConnSession@@QAEHXZ @ 7 NONAME ; int RSConPCConnSession::ResetServer(void)
-
--- a/connectivitymodules/SeCon/clients/pcconn/bld/def/eabiuu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-EXPORTS
-	_ZN18RSConPCConnSession10GetPacketLERK7TDesC16RK6TDesC8RP8CBufFlat @ 1 NONAME
-	_ZN18RSConPCConnSession10PutPacketLERK7TDesC16RK6TDesC8RP8CBufFlat @ 2 NONAME
-	_ZN18RSConPCConnSession11ResetServerEv @ 3 NONAME
-	_ZN18RSConPCConnSession5CloseEv @ 4 NONAME
-	_ZN18RSConPCConnSession7ConnectEv @ 5 NONAME
-	_ZN18RSConPCConnSessionC1Ev @ 6 NONAME
-	_ZN18RSConPCConnSessionC2Ev @ 7 NONAME
-	_ZN18RSConPCConnSessionD1Ev @ 8 NONAME
-	_ZN18RSConPCConnSessionD2Ev @ 9 NONAME
-
--- a/connectivitymodules/SeCon/clients/pcconn/bld/sconpcconnclient.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* Copyright (c) 2005-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:  Client side of PC Connectivity Server-Client
-*
-*/
-
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-VENDORID        VID_DEFAULT
-
-CAPABILITY      CAP_CLIENT_DLL
-
-TARGET          sconpcconnclient.dll
-TARGETTYPE      dll
-
-UID             0x10009D8D 0x101F99F7
-
-TARGETPATH      sys/bin
-
-#if defined(ARMCC)
-DEFFILE	./def/eabiu
-#elif defined(WINSCW) 
-DEFFILE	./def/bwinscw
-#elif defined(WINS)
-DEFFILE	./def/bwins
-#elif defined(ARM)
-DEFFILE	./def/bmarm
-#endif
-
-
-SOURCEPATH      ../src
-
-SOURCE          sconpcconnclient.cpp
-
-// Client
-USERINCLUDE     ../inc
-USERINCLUDE     ../../../inc
-
-// Server
-USERINCLUDE     ../../../servers/pcconn/inc
-
-// Default system include paths.
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY         euser.lib
-LIBRARY         estor.lib   // RMemWriteStream
-LIBRARY         efsrv.lib   // Rfs, RFile
-DEBUGLIBRARY    flogger.lib
--- a/connectivitymodules/SeCon/clients/pcconn/inc/sconpcconnclient.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity client
-*
-*/
-
-
-#ifndef __SCONPCCONNCLIENT_H__
-#define __SCONPCCONNCLIENT_H__
-
-// -----------------------------------------------------------------------------
-// class RSConPCConnSession - the client session
-// -----------------------------------------------------------------------------
-class RSConPCConnSession : public RSessionBase
-	{
-public:
-	IMPORT_C RSConPCConnSession();
-	IMPORT_C ~RSConPCConnSession();
-
-        /**
-        * Starts the server and connects to it
-        * @param none
-        * @return KerrNone or an error code
-        */
-	IMPORT_C TInt Connect();
-	
-	/**
-        *  Disconnects from the server and terminates the server
-        * @param none
-        * @return none
-        */
-	IMPORT_C void Close();
-	
-	/**
-        *  Passes an OBEX Put -message to the server
-        * @param none
-        * @return none
-        */
-	IMPORT_C TInt PutPacketL( const TDesC& aNameHeader, 
-	                          const TDesC8& aTypeHeader, 
-	                          CBufFlat*& aBuffer );
-	
-	/**
-        *  Passes an OBEX Get -message to the server
-        * @param none
-        * @return none
-        */
-	IMPORT_C TInt GetPacketL( const TDesC& aNameHeader, 
-	                          const TDesC8& aTypeHeader, 
-	                          CBufFlat*& aBuffer );
-	
-	/**
-        *  Passes an reset -message to the server
-        * @param none
-        * @return none
-        */
-	IMPORT_C TInt ResetServer();	
-
-private:
-	TVersion Version() const;
-	TInt LaunchServer();
-	TInt CreateAndSendChunkHandle();
-
-private:
-	RChunk iChunk;
-	};
-	
-#endif
\ No newline at end of file
--- a/connectivitymodules/SeCon/clients/pcconn/src/sconpcconnclient.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,304 +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:  PC Connectivity client
-*
-*/
-
-
-
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-#include <e32base.h>
-#include <s32mem.h>
-
-// Client - server 
-#include "sconpcconnclient.h"
-#include "sconpcconnclientserver.h"
-#include "debug.h"
-
-// -----------------------------------------------------------------------------
-// RSConPCConnSession::RSConPCConnSession()
-// Default constructor
-// -----------------------------------------------------------------------------
-//
-EXPORT_C RSConPCConnSession::RSConPCConnSession()
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// RSConPCConnSession::~RSConPCConnSession()
-// Default destructor
-// -----------------------------------------------------------------------------
-//
-EXPORT_C RSConPCConnSession::~RSConPCConnSession()
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// RSConPCConnSession::Connect()
-// Creates a chunk and server, starts the server connection
-// -----------------------------------------------------------------------------
-//
-EXPORT_C TInt RSConPCConnSession::Connect()
-    {
-    TRACE_FUNC_ENTRY;
- 	
-    TInt ret ( KErrNone );
-
-    ret = CreateSession(KSConPCConnServerName,Version());
-    
-    if ( ret == KErrNotFound || ret == KErrServerTerminated )
-    	{
-    	ret = LaunchServer();
-    	
-    	if ( ret == KErrNone || ret == KErrAlreadyExists )
-    		{
-    		ret = CreateSession( KSConPCConnServerName, Version() );
-    		}
-    	}
-    	
-    if ( ret == KErrNone )
-    	{
-    	ret = CreateAndSendChunkHandle();
-    	if ( ret != KErrNone )
-    	    {
-    	    LOGGER_WRITE("CreateAndSendChunkHandle failed, close session");
-    	    Close();
-    	    }
-    	}
-    
-    LOGGER_WRITE_1( "RSConPCConnSession::Connect() : returned %d", ret );
-    return ret; 
-    }
-
-// -----------------------------------------------------------------------------
-// RSConPCConnSession::Close()
-// Closes the server connection
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void RSConPCConnSession::Close()
-    {
-    TRACE_FUNC_ENTRY;
-    iChunk.Close();
-    RSessionBase::Close();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// RSConPCConnSession::Version()
-// Returns the version of the client
-// -----------------------------------------------------------------------------
-//	
-TVersion RSConPCConnSession::Version(void) const
-    {
-    return (TVersion(KSConPCConnServerVersionMajor, 
-                               KSConPCConnServerVersionMinor, 
-                               KSConPCConnServerVersionBuild));
-    }
-
-// -----------------------------------------------------------------------------
-// RSConPCConnSession::Version()
-// Forwards a PUT -message to the server
-// -----------------------------------------------------------------------------
-//	
-EXPORT_C TInt RSConPCConnSession::PutPacketL( 
-    const TDesC& aNameHeader, const TDesC8& aTypeHeader, CBufFlat*& aBuffer )
-    {
-    TRACE_FUNC_ENTRY;
-
-    if ( !aBuffer )
-        {
-        return KErrArgument;
-        }
-
-    if ((aBuffer->Size() + aTypeHeader.Size() + 
-         aNameHeader.Size()) > KSConPCConnChunkMaxSize)
-        {
-        LOGGER_WRITE( "RSConPCConnSession::PutPacketL() :\
-         WBXML document too big" );
-        return KErrTooBig;
-        }
-	
-    TInt ret (KErrNone);
-    iChunk.Adjust( KSConPCConnChunkMaxSize );
-    RMemWriteStream buf( iChunk.Base(), iChunk.Size() );
-	
-    buf.WriteInt32L( aNameHeader.Size() );
-    buf.WriteL( aNameHeader );
-
-    buf.WriteInt32L( aTypeHeader.Size() );
-    buf.WriteL( aTypeHeader );
-	
-    // WBXML document	
-    buf.WriteInt32L( aBuffer->Size() );
-    buf.WriteL( aBuffer->Ptr(0) );
-    buf.CommitL();
-    buf.Close();
-    
-    TIpcArgs args;
-    ret = SendReceive ( EPutMessage, args );
-
-    LOGGER_WRITE_1( "RSConPCConnSession::PutPacketL() : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// RSConPCConnSession::Version()
-// Forwards a GET -message to the server
-// -----------------------------------------------------------------------------
-//	
-EXPORT_C TInt RSConPCConnSession::GetPacketL( 
-    const TDesC& aNameHeader, const TDesC8& aTypeHeader, CBufFlat*& aBuffer )
-    {
-    TRACE_FUNC_ENTRY;
-
-    if ( !aBuffer )
-        {
-        return KErrArgument;
-        }
-
-    TInt ret (KErrNone);
-	
-    iChunk.Adjust( KSConPCConnChunkMaxSize);
-    RMemWriteStream writeBuf( iChunk.Base(), iChunk.Size() );
-    writeBuf.WriteInt32L( aNameHeader.Size() );
-    writeBuf.WriteL( aNameHeader );
-    
-    writeBuf.WriteInt32L( aTypeHeader.Size() );
-    writeBuf.WriteL( aTypeHeader );
-
-    writeBuf.CommitL();
-    writeBuf.Close();
-    
-    TIpcArgs args;
-    ret = SendReceive ( EGetMessage, args );
-
-    if ( ret != KErrNone) 
-        {
-        LOGGER_WRITE_1( "RSConPCConnSession::GetPacketL() :\
-         Send Receive failed with code %d", ret );
-        return ret;
-        };
-	
-    // copy data from the chunk
-    RMemReadStream readBuf( iChunk.Base(), iChunk.Size() );
-    TInt32 length ( 0 );
-
-    aBuffer->Reset();
-    length = readBuf.ReadInt32L();
-	
-    HBufC8* data = HBufC8::NewLC( length );
-    TPtr8 dataPtr = data->Des();
-	
-    readBuf.ReadL( dataPtr, length );
-    aBuffer->ExpandL( 0, length );
-    aBuffer->Write ( 0, dataPtr );
-	
-    readBuf.Close();
-	
-    CleanupStack::PopAndDestroy(); // data;
-
-    LOGGER_WRITE_1( "RSConPCConnSession::GetPacketL()\
-     : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// RSConPCConnSession::Version()
-// Forwards a Reset -message to the server
-// -----------------------------------------------------------------------------
-//	
-EXPORT_C TInt RSConPCConnSession::ResetServer()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TIpcArgs args;
-    ret = SendReceive ( EResetMessage, args );
-    LOGGER_WRITE_1( "RSConPCConnSession::ResetServerL(): ret %d", ret );
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// RSConPCConnSession::LaunchServer()
-// Launches the server
-// -----------------------------------------------------------------------------
-//	
-TInt RSConPCConnSession::LaunchServer()
-	{
-	TRACE_FUNC_ENTRY;
-	TInt ret( KErrNone );
-    
-    // Create server
-    RProcess p;
-    ret = p.Create(KSConPCConnServerExe, KNullDesC);
-    
-    if ( ret != KErrNone )
-        {
-        // Loading failed.
-        LOGGER_WRITE_1( "RProcess::Create failed, err: %d", ret );
-        return ret;
-        }
-    
-    
-    TRequestStatus status;
-    p.Rendezvous( status );
-    
-    if ( status != KRequestPending )
-        {
-        p.Kill(0);		// abort startup
-        p.Close();
-        LOGGER_WRITE("Abort startup, return KErrGeneral");
-        return KErrGeneral;   
-        }
-    else
-        {
-        p.Resume();	// logon OK - start the server
-        }
-    
-    User::WaitForRequest(status);
-    
-    p.Close();
-    
-	LOGGER_WRITE_1( "RSConPCConnSession::LaunchServerL(): returned %d", status.Int() );
-    return status.Int();
-	}
-	
-// -----------------------------------------------------------------------------
-// RSConPCConnSession::CreateAndSendChunkHandle()
-// Creates a chunk and sends a handle to server
-// -----------------------------------------------------------------------------
-//	
-TInt RSConPCConnSession::CreateAndSendChunkHandle()
-	{
-	TRACE_FUNC_ENTRY;
-	TInt err = iChunk.CreateGlobal( KNullDesC, 
-                                    KSConPCConnChunkSize, 
-                                    KSConPCConnChunkMaxSize );
-    if ( err != KErrNone )
-        {
-        LOGGER_WRITE_1("iChunk.CreateGlobal failed, err: %d", err);
-        return err;
-        }                           
-    TIpcArgs args;
- 	args.Set( 0, iChunk );
- 	err = SendReceive( EChunkMessage, args );
-    
-    LOGGER_WRITE_1("RSConPCConnSession::CreateAndSendChunkHandle : returned: %d", err);
-    return err;
-	}
-	
-// End of file
--- a/connectivitymodules/SeCon/clients/syncclient/bwins/sconsyncclientu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-EXPORTS
-	??0RSconSyncSession@@QAE@XZ @ 1 NONAME ; RSconSyncSession::RSconSyncSession(void)
-	??1CSconDataproviderInfo@@UAE@XZ @ 2 NONAME ; CSconDataproviderInfo::~CSconDataproviderInfo(void)
-	??1RSconSyncSession@@QAE@XZ @ 3 NONAME ; RSconSyncSession::~RSconSyncSession(void)
-	?AddedItemsL@RSconSyncSession@@QBEXAAV?$RArray@H@@@Z @ 4 NONAME ; void RSconSyncSession::AddedItemsL(class RArray<int> &) const
-	?CancelRequest@RSconSyncSession@@QAEXXZ @ 5 NONAME ; void RSconSyncSession::CancelRequest(void)
-	?Close@RSconSyncSession@@QAEXXZ @ 6 NONAME ; void RSconSyncSession::Close(void)
-	?CloseDataStore@RSconSyncSession@@QBEXXZ @ 7 NONAME ; void RSconSyncSession::CloseDataStore(void) const
-	?CommitChangeInfoL@RSconSyncSession@@QAEXABV?$RArray@H@@@Z @ 8 NONAME ; void RSconSyncSession::CommitChangeInfoL(class RArray<int> const &)
-	?Connect@RSconSyncSession@@QAEHXZ @ 9 NONAME ; int RSconSyncSession::Connect(void)
-	?CreateItemL@RSconSyncSession@@QAEXAAHHABVTDesC8@@11@Z @ 10 NONAME ; void RSconSyncSession::CreateItemL(int &, int, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &)
-	?CreateItemL@RSconSyncSession@@QAEXAAV?$TPckg@H@@HABVTDesC8@@11AAVTRequestStatus@@@Z @ 11 NONAME ; void RSconSyncSession::CreateItemL(class TPckg<int> &, int, class TDesC8 const &, class TDesC8 const &, class TDesC8 const &, class TRequestStatus &)
-	?DefaultStoreL@CSconDataproviderInfo@@QAEAAVTDesC16@@XZ @ 12 NONAME ; class TDesC16 & CSconDataproviderInfo::DefaultStoreL(void)
-	?DeleteAllItems@RSconSyncSession@@QAEXAAVTRequestStatus@@@Z @ 13 NONAME ; void RSconSyncSession::DeleteAllItems(class TRequestStatus &)
-	?DeleteItemL@RSconSyncSession@@QAEXH@Z @ 14 NONAME ; void RSconSyncSession::DeleteItemL(int)
-	?DeletedItemsL@RSconSyncSession@@QBEXAAV?$RArray@H@@@Z @ 15 NONAME ; void RSconSyncSession::DeletedItemsL(class RArray<int> &) const
-	?DisplayNameL@CSconDataproviderInfo@@QAEAAVTDesC16@@XZ @ 16 NONAME ; class TDesC16 & CSconDataproviderInfo::DisplayNameL(void)
-	?ExternalizeL@CSconDataproviderInfo@@QBEXAAVRWriteStream@@@Z @ 17 NONAME ; void CSconDataproviderInfo::ExternalizeL(class RWriteStream &) const
-	?GetParent@RSconSyncSession@@QAEHHAAH@Z @ 18 NONAME ; int RSconSyncSession::GetParent(int, int &)
-	?GetSyncTimeStampL@RSconSyncSession@@QBEXHHAAVTDateTime@@@Z @ 19 NONAME ; void RSconSyncSession::GetSyncTimeStampL(int, int, class TDateTime &) const
-	?HasSyncHistoryL@RSconSyncSession@@QBEHXZ @ 20 NONAME ; int RSconSyncSession::HasSyncHistoryL(void) const
-	?ImplementationUid@CSconDataproviderInfo@@QBE?AVTUid@@XZ @ 21 NONAME ; class TUid CSconDataproviderInfo::ImplementationUid(void) const
-	?InternalizeL@CSconDataproviderInfo@@QAEXAAVRReadStream@@@Z @ 22 NONAME ; void CSconDataproviderInfo::InternalizeL(class RReadStream &)
-	?ListAllImplementationsL@RSconSyncSession@@QAEXAAV?$RPointerArray@VCSconDataproviderInfo@@@@@Z @ 23 NONAME ; void RSconSyncSession::ListAllImplementationsL(class RPointerArray<class CSconDataproviderInfo> &)
-	?ListStoresL@CSconDataproviderInfo@@QBEPAVCDesC16Array@@XZ @ 24 NONAME ; class CDesC16Array * CSconDataproviderInfo::ListStoresL(void) const
-	?ModifiedItemsL@RSconSyncSession@@QBEXAAV?$RArray@H@@@Z @ 25 NONAME ; void RSconSyncSession::ModifiedItemsL(class RArray<int> &) const
-	?MoveItemL@RSconSyncSession@@QAEXHH@Z @ 26 NONAME ; void RSconSyncSession::MoveItemL(int, int)
-	?MovedItemsL@RSconSyncSession@@QBEXAAV?$RArray@H@@@Z @ 27 NONAME ; void RSconSyncSession::MovedItemsL(class RArray<int> &) const
-	?NewL@CSconDataproviderInfo@@SAPAV1@XZ @ 28 NONAME ; class CSconDataproviderInfo * CSconDataproviderInfo::NewL(void)
-	?OpenDataStoreL@RSconSyncSession@@QAEXHABVTDesC16@@H@Z @ 29 NONAME ; void RSconSyncSession::OpenDataStoreL(int, class TDesC16 const &, int)
-	?OpenItemL@RSconSyncSession@@QAEXHAAH0AAVTDes8@@1AAVCBufFlat@@@Z @ 30 NONAME ; void RSconSyncSession::OpenItemL(int, int &, int &, class TDes8 &, class TDes8 &, class CBufFlat &)
-	?ReplaceItemL@RSconSyncSession@@QAEXHHHABVTDesC8@@@Z @ 31 NONAME ; void RSconSyncSession::ReplaceItemL(int, int, int, class TDesC8 const &)
-	?ReplaceItemL@RSconSyncSession@@QAEXHHHABVTDesC8@@AAVTRequestStatus@@@Z @ 32 NONAME ; void RSconSyncSession::ReplaceItemL(int, int, int, class TDesC8 const &, class TRequestStatus &)
-	?ResetChangeInfoL@RSconSyncSession@@QAEXXZ @ 33 NONAME ; void RSconSyncSession::ResetChangeInfoL(void)
-	?SetDefaultStoreL@CSconDataproviderInfo@@QAEXABVTDesC16@@@Z @ 34 NONAME ; void CSconDataproviderInfo::SetDefaultStoreL(class TDesC16 const &)
-	?SetDisplayNameL@CSconDataproviderInfo@@QAEXABVTDesC16@@@Z @ 35 NONAME ; void CSconDataproviderInfo::SetDisplayNameL(class TDesC16 const &)
-	?SetImplementationUid@CSconDataproviderInfo@@QAEXVTUid@@@Z @ 36 NONAME ; void CSconDataproviderInfo::SetImplementationUid(class TUid)
-	?SetRemoteStoreFormatL@RSconSyncSession@@QAEXABVCSmlDataStoreFormat@@@Z @ 37 NONAME ; void RSconSyncSession::SetRemoteStoreFormatL(class CSmlDataStoreFormat const &)
-	?SetStoresL@CSconDataproviderInfo@@QAEXABVCDesC16Array@@@Z @ 38 NONAME ; void CSconDataproviderInfo::SetStoresL(class CDesC16Array const &)
-	?SoftDeleteItemL@RSconSyncSession@@QAEXH@Z @ 39 NONAME ; void RSconSyncSession::SoftDeleteItemL(int)
-	?SoftDeletedItemsL@RSconSyncSession@@QBEXAAV?$RArray@H@@@Z @ 40 NONAME ; void RSconSyncSession::SoftDeletedItemsL(class RArray<int> &) const
-	?StoreFormatL@RSconSyncSession@@QAEPAVCSmlDataStoreFormat@@ABVRStringPool@@@Z @ 41 NONAME ; class CSmlDataStoreFormat * RSconSyncSession::StoreFormatL(class RStringPool const &)
-
--- a/connectivitymodules/SeCon/clients/syncclient/eabi/sconsyncclientu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-EXPORTS
-	_ZN16RSconSyncSession11CreateItemLER5TPckgIiEiRK6TDesC8S5_S5_R14TRequestStatus @ 1 NONAME
-	_ZN16RSconSyncSession11CreateItemLERiiRK6TDesC8S3_S3_ @ 2 NONAME
-	_ZN16RSconSyncSession11DeleteItemLEi @ 3 NONAME
-	_ZN16RSconSyncSession12ReplaceItemLEiiiRK6TDesC8 @ 4 NONAME
-	_ZN16RSconSyncSession12ReplaceItemLEiiiRK6TDesC8R14TRequestStatus @ 5 NONAME
-	_ZN16RSconSyncSession12StoreFormatLERK11RStringPool @ 6 NONAME
-	_ZN16RSconSyncSession13CancelRequestEv @ 7 NONAME
-	_ZN16RSconSyncSession14DeleteAllItemsER14TRequestStatus @ 8 NONAME
-	_ZN16RSconSyncSession14OpenDataStoreLEiRK7TDesC16i @ 9 NONAME
-	_ZN16RSconSyncSession15SoftDeleteItemLEi @ 10 NONAME
-	_ZN16RSconSyncSession16ResetChangeInfoLEv @ 11 NONAME
-	_ZN16RSconSyncSession17CommitChangeInfoLERK6RArrayIiE @ 12 NONAME
-	_ZN16RSconSyncSession21SetRemoteStoreFormatLERK19CSmlDataStoreFormat @ 13 NONAME
-	_ZN16RSconSyncSession23ListAllImplementationsLER13RPointerArrayI21CSconDataproviderInfoE @ 14 NONAME
-	_ZN16RSconSyncSession5CloseEv @ 15 NONAME
-	_ZN16RSconSyncSession7ConnectEv @ 16 NONAME
-	_ZN16RSconSyncSession9GetParentEiRi @ 17 NONAME
-	_ZN16RSconSyncSession9MoveItemLEii @ 18 NONAME
-	_ZN16RSconSyncSession9OpenItemLEiRiS0_R5TDes8S2_R8CBufFlat @ 19 NONAME
-	_ZN16RSconSyncSessionC1Ev @ 20 NONAME
-	_ZN16RSconSyncSessionC2Ev @ 21 NONAME
-	_ZN16RSconSyncSessionD1Ev @ 22 NONAME
-	_ZN16RSconSyncSessionD2Ev @ 23 NONAME
-	_ZN21CSconDataproviderInfo10SetStoresLERK12CDesC16Array @ 24 NONAME
-	_ZN21CSconDataproviderInfo12DisplayNameLEv @ 25 NONAME
-	_ZN21CSconDataproviderInfo12InternalizeLER11RReadStream @ 26 NONAME
-	_ZN21CSconDataproviderInfo13DefaultStoreLEv @ 27 NONAME
-	_ZN21CSconDataproviderInfo15SetDisplayNameLERK7TDesC16 @ 28 NONAME
-	_ZN21CSconDataproviderInfo16SetDefaultStoreLERK7TDesC16 @ 29 NONAME
-	_ZN21CSconDataproviderInfo20SetImplementationUidE4TUid @ 30 NONAME
-	_ZN21CSconDataproviderInfo4NewLEv @ 31 NONAME
-	_ZN21CSconDataproviderInfoD0Ev @ 32 NONAME
-	_ZN21CSconDataproviderInfoD1Ev @ 33 NONAME
-	_ZN21CSconDataproviderInfoD2Ev @ 34 NONAME
-	_ZNK16RSconSyncSession11AddedItemsLER6RArrayIiE @ 35 NONAME
-	_ZNK16RSconSyncSession11MovedItemsLER6RArrayIiE @ 36 NONAME
-	_ZNK16RSconSyncSession13DeletedItemsLER6RArrayIiE @ 37 NONAME
-	_ZNK16RSconSyncSession14CloseDataStoreEv @ 38 NONAME
-	_ZNK16RSconSyncSession14ModifiedItemsLER6RArrayIiE @ 39 NONAME
-	_ZNK16RSconSyncSession15HasSyncHistoryLEv @ 40 NONAME
-	_ZNK16RSconSyncSession17GetSyncTimeStampLEiiR9TDateTime @ 41 NONAME
-	_ZNK16RSconSyncSession17SoftDeletedItemsLER6RArrayIiE @ 42 NONAME
-	_ZNK21CSconDataproviderInfo11ListStoresLEv @ 43 NONAME
-	_ZNK21CSconDataproviderInfo12ExternalizeLER12RWriteStream @ 44 NONAME
-	_ZNK21CSconDataproviderInfo17ImplementationUidEv @ 45 NONAME
-	_ZTI21CSconDataproviderInfo @ 46 NONAME ; #<TI>#
-	_ZTV21CSconDataproviderInfo @ 47 NONAME ; #<VT>#
-
--- a/connectivitymodules/SeCon/clients/syncclient/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Build information file for project SyncClient
-*
-*/
-
-
-PRJ_EXPORTS
-../rom/sconsyncclient.iby      CORE_APP_LAYER_IBY_EXPORT_PATH(sconsyncclient.iby)
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-sconsyncclient.mmp
-
-PRJ_TESTMMPFILES
--- a/connectivitymodules/SeCon/clients/syncclient/group/sconsyncclient.mmp	Tue Aug 31 15:05:37 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:  Client side of sconsyncserver
-*
-*/
-
-
-// To get the APP_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-TARGET          sconsyncclient.dll
-TARGETTYPE      dll
-
-CAPABILITY      CAP_CLIENT_DLL
-
-UID             0x1000008d 0x2001A963
-VENDORID        VID_DEFAULT
-
-SOURCEPATH      ../src
-SOURCE          sconsyncclient.cpp
-SOURCE          scondataproviderinfo.cpp
-
-USERINCLUDE     ../inc
-USERINCLUDE     ../../../inc
-
-// Server
-USERINCLUDE     ../../../servers/syncserver/inc
-
-
-// Default system include paths for middleware layer modules.
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY         euser.lib
-LIBRARY         estor.lib
-LIBRARY         bafl.lib
-LIBRARY         charconv.lib
-LIBRARY         smlstoreformat.lib
-DEBUGLIBRARY    flogger.lib
--- a/connectivitymodules/SeCon/clients/syncclient/inc/scondataproviderinfo.h	Tue Aug 31 15:05:37 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:  CSconDataproviderInfo header
-*
-*/
-
-
-#ifndef SCONDATAPROVIDERINFO_H_
-#define SCONDATAPROVIDERINFO_H_
-
-#include <e32base.h>
-#include <badesca.h>
-
-class RWriteStream;
-class RReadStream;
-
-/**
- * Contains information about DataSync dataprovider.
- */
-class CSconDataproviderInfo : public CBase
-{
-public:
-    IMPORT_C static CSconDataproviderInfo* NewL();
-    IMPORT_C ~CSconDataproviderInfo();
-    
-    IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
-    IMPORT_C void InternalizeL( RReadStream& aStream );
-    
-    IMPORT_C TUid        ImplementationUid() const;
-    IMPORT_C void        SetImplementationUid( const TUid aUid );
-    IMPORT_C TDesC&      DisplayNameL();
-    IMPORT_C void        SetDisplayNameL( const TDesC& aName );
-    IMPORT_C TDesC&      DefaultStoreL();
-    IMPORT_C void        SetDefaultStoreL( const TDesC& aStore );
-    IMPORT_C CDesCArray* ListStoresL() const;
-    IMPORT_C void        SetStoresL( const CDesCArray& aStores );
-private:
-	CSconDataproviderInfo();
-	void ConstructL();
-	
-private:
-    TInt        iUid;
-    HBufC*      iName;
-    HBufC*      iDefaultStore;
-    CDesCArrayFlat* iStores;
-};
-
-typedef RPointerArray<CSconDataproviderInfo> RSconDataProviderInfoArray;
-
-#endif /*SCONDATAPROVIDERINFO_H_*/
--- a/connectivitymodules/SeCon/clients/syncclient/inc/sconsyncclient.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +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:  RSconSyncSession header
-*
-*/
-
-
-#ifndef _SCONSYNCCLIENT_H_
-#define _SCONSYNCCLIENT_H_
-
-#include <e32base.h>
-#include <e32std.h>
-#include <ecom/ImplementationInformation.h>
-#include <SmlDataProvider.h>
-
-#include "scondataproviderinfo.h"
-
-
-
-class CNSmlDataItemUidSet;
-
-class RSconSyncSession : public RSessionBase
-{
-public:
-    IMPORT_C RSconSyncSession();
-    IMPORT_C ~RSconSyncSession();
-        
-    IMPORT_C TInt Connect();
-    IMPORT_C void Close();
-    
-    IMPORT_C void ListAllImplementationsL( RSconDataProviderInfoArray& aInfoArray );
-    
-    IMPORT_C void OpenDataStoreL( const TSmlDataProviderId aProviderId, const TDesC& aStoreName, const TInt aContextId );
-
-    IMPORT_C void OpenItemL(TSmlDbItemUid aUid, TBool& aFieldChange,
-            TSmlDbItemUid& aParent, TDes8& aMimeType, TDes8& aMimeVer,
-            CBufFlat& aItemData );
-    
-    IMPORT_C void CreateItemL(TSmlDbItemUid& aUid, TSmlDbItemUid aParent,
-            const TDesC8& aMimeType, const TDesC8& aMimeVer, const TDesC8& aData);
-    IMPORT_C void CreateItemL(TPckg<TSmlDbItemUid>& aUidPckg, TSmlDbItemUid aParent,
-            const TDesC8& aMimeType, const TDesC8& aMimeVer, const TDesC8& aData,
-            TRequestStatus& aStatus );
-      
-    IMPORT_C void ReplaceItemL(TSmlDbItemUid aUid, TSmlDbItemUid aParent,
-            TBool aFieldChange, const TDesC8& aData);
-    IMPORT_C void ReplaceItemL(TSmlDbItemUid aUid, TSmlDbItemUid aParent,
-            TBool aFieldChange, const TDesC8& aData,
-            TRequestStatus& aStatus );
-    
-    IMPORT_C void MoveItemL(TSmlDbItemUid aUid, TSmlDbItemUid aNewParent);
-    IMPORT_C void DeleteItemL(TSmlDbItemUid aUid);
-    IMPORT_C void SoftDeleteItemL(TSmlDbItemUid aUid);
-    IMPORT_C void DeleteAllItems( TRequestStatus& aStatus );
-    
-    IMPORT_C TBool HasSyncHistoryL() const;
-    IMPORT_C void AddedItemsL( RArray<TSmlDbItemUid>& aItems ) const;
-    IMPORT_C void DeletedItemsL( RArray<TSmlDbItemUid>& aItems ) const;
-    IMPORT_C void SoftDeletedItemsL( RArray<TSmlDbItemUid>& aItems ) const;
-    IMPORT_C void ModifiedItemsL( RArray<TSmlDbItemUid>& aItems ) const;
-    IMPORT_C void MovedItemsL( RArray<TSmlDbItemUid>& aItems ) const;
-    
-    IMPORT_C void CloseDataStore() const;
-    
-    IMPORT_C void ResetChangeInfoL();
-    IMPORT_C void CommitChangeInfoL(const RArray<TSmlDbItemUid>& aItems );
-    
-    IMPORT_C void GetSyncTimeStampL( const TSmlDataProviderId aProviderId, const TInt aContextId, TDateTime& aTimeStamp ) const;
-    
-    IMPORT_C CSmlDataStoreFormat* StoreFormatL( const RStringPool& aStringPool );
-    IMPORT_C void SetRemoteStoreFormatL( const CSmlDataStoreFormat& aServerDataStoreFormat );
-    
-    
-    IMPORT_C void CancelRequest();
-    
-    IMPORT_C TInt GetParent( TSmlDbItemUid aUid, TSmlDbItemUid& aParent );
-private:
-    TInt StartServer();
-    TInt CreateAndSendChunkHandle();
-private:
-    RChunk iChunk;
-    TIpcArgs iArgs;
-    
-};
-
-#endif  // _SCONSYNCCLIENT_H_   
-            
-// End of File
--- a/connectivitymodules/SeCon/clients/syncclient/rom/sconsyncclient.iby	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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:  IBY file for SconSyncClient
-*
-*/
-
-#ifndef _SCONSYNCCLIENT_IBY_
-#define _SCONSYNCCLIENT_IBY_
-
-#include <data_caging_paths_for_iby.hrh>
-
-file=ABI_DIR\BUILD_DIR\sconsyncclient.dll   SHARED_LIB_DIR\sconsyncclient.dll
-
-#endif
\ No newline at end of file
--- a/connectivitymodules/SeCon/clients/syncclient/src/scondataproviderinfo.cpp	Tue Aug 31 15:05:37 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:  CSconDataproviderInfo implementation
-*
-*/
-
-
-#include "scondataproviderinfo.h"
-#include <s32strm.h>
-#include <badesca.h>
-#include <utf.h>  // for CnvUtfConverter
-#include "debug.h"
-
-CSconDataproviderInfo::CSconDataproviderInfo()
-    {
-    }
-
-EXPORT_C CSconDataproviderInfo::~CSconDataproviderInfo()
-    {
-    delete iName;
-    delete iDefaultStore;
-    delete iStores;
-    }
-
-EXPORT_C CSconDataproviderInfo* CSconDataproviderInfo::NewL()
-    {
-    return new (ELeave) CSconDataproviderInfo();
-    }
-
-EXPORT_C void CSconDataproviderInfo::ExternalizeL( RWriteStream& aStream ) const
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("iUid: 0x%x", iUid);
-    aStream.WriteInt32L( iUid );
-    if ( iName )
-        {
-        HBufC8* temp = CnvUtfConverter::ConvertFromUnicodeToUtf8L( iName->Des() );
-        CleanupStack::PushL( temp );
-        TPtrC8 tempPtr = temp->Des();
-        aStream.WriteUint16L( tempPtr.Length() );
-        aStream.WriteL( tempPtr );
-        CleanupStack::PopAndDestroy( temp );
-        }
-    else
-        {
-        aStream.WriteUint16L( 0 );
-        }
-    
-    if ( iDefaultStore )
-        {
-        HBufC8* temp = CnvUtfConverter::ConvertFromUnicodeToUtf8L( iDefaultStore->Des() );
-        CleanupStack::PushL( temp );
-        TPtrC8 tempPtr = temp->Des();
-        aStream.WriteUint16L( tempPtr.Length() );
-        aStream.WriteL( tempPtr );
-        CleanupStack::PopAndDestroy( temp );
-        }
-    else
-        {
-        aStream.WriteUint16L( 0 );
-        }
-    if ( iStores )
-        {
-        aStream.WriteUint16L( iStores->Count() );
-        for ( TInt i=0; i<iStores->Count(); i++ )
-            {
-            TPtrC storePtr = (*iStores)[i];
-            HBufC8* temp = CnvUtfConverter::ConvertFromUnicodeToUtf8L( storePtr );
-            CleanupStack::PushL( temp );
-            TPtrC8 tempPtr = temp->Des();
-            aStream.WriteUint16L( tempPtr.Length() );
-            if ( tempPtr.Length() > 0 )
-                {
-                aStream.WriteL( tempPtr );
-                }
-            CleanupStack::PopAndDestroy( temp );
-            }
-        }
-    else
-        {
-        aStream.WriteUint16L( 0 );
-        }
-    aStream.CommitL();
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void CSconDataproviderInfo::InternalizeL( RReadStream& aStream )
-    {
-    TRACE_FUNC_ENTRY;
-    delete iName;
-    iName = NULL;
-    delete iDefaultStore;
-    iDefaultStore = NULL;
-    delete iStores;
-    iStores = NULL;
-    iStores = new ( ELeave ) CDesCArrayFlat( 1 );
-    iUid = aStream.ReadInt32L();
-    TInt len = aStream.ReadUint16L();
-    if ( len > 0 )
-        {
-        HBufC8* tempBuf = HBufC8::NewLC( len );
-        TPtr8 tempPtr = tempBuf->Des();
-        aStream.ReadL( tempPtr, len );
-        
-        iName = CnvUtfConverter::ConvertToUnicodeFromUtf8L( tempPtr );
-        CleanupStack::PopAndDestroy( tempBuf );
-        }
-    
-    len = aStream.ReadUint16L();
-    if ( len > 0 )
-        {
-        HBufC8* tempBuf = HBufC8::NewLC( len );
-        TPtr8 tempPtr = tempBuf->Des();
-        aStream.ReadL( tempPtr, len );
-        
-        iDefaultStore = CnvUtfConverter::ConvertToUnicodeFromUtf8L( tempPtr );
-        CleanupStack::PopAndDestroy( tempBuf );
-        }
-    
-    TInt storeCount = aStream.ReadUint16L();
-    for (TInt i=0; i<storeCount; i++ )
-        {
-        len = aStream.ReadUint16L();
-        if ( len > 0 )
-            {
-            HBufC8* tempBuf8 = HBufC8::NewLC( len );
-            TPtr8 tempPtr8 = tempBuf8->Des();
-            aStream.ReadL( tempPtr8, len );
-            
-            HBufC* temp = CnvUtfConverter::ConvertToUnicodeFromUtf8L( tempPtr8 );
-            CleanupStack::PushL( temp );
-            TPtr tempPtr = temp->Des();
-            iStores->AppendL( tempPtr );
-            CleanupStack::PopAndDestroy( temp );
-            CleanupStack::PopAndDestroy( tempBuf8 );
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C TUid CSconDataproviderInfo::ImplementationUid() const
-    {
-    return TUid::Uid( iUid );
-    }
-
-EXPORT_C void CSconDataproviderInfo::SetImplementationUid( const TUid aUid )
-    {
-    iUid = aUid.iUid;
-    }
-
-EXPORT_C TDesC& CSconDataproviderInfo::DisplayNameL()
-    {
-    if ( iName )
-        {
-        return *iName;
-        }
-    else
-        {
-        iName = KNullDesC().AllocL();
-        return *iName;
-        }
-    }
-
-EXPORT_C void CSconDataproviderInfo::SetDisplayNameL( const TDesC& aName )
-    {
-    delete iName;
-    iName = NULL;
-    iName = aName.AllocL();
-    }
-
-EXPORT_C TDesC& CSconDataproviderInfo::DefaultStoreL()
-    {
-    if ( iDefaultStore )
-        {
-        return *iDefaultStore;
-        }
-    else
-        {
-        iDefaultStore = KNullDesC().AllocL();
-        return *iDefaultStore;
-        }
-    }
-
-EXPORT_C void CSconDataproviderInfo::SetDefaultStoreL( const TDesC& aStore )
-    {
-    delete iDefaultStore;
-    iDefaultStore = NULL;
-    iDefaultStore = aStore.AllocL();
-    }
-
-EXPORT_C CDesCArray* CSconDataproviderInfo::ListStoresL() const
-    {
-    if ( !iStores )
-        {
-        User::Leave( KErrNotFound );
-        }
-    return iStores;
-    }
-
-EXPORT_C void CSconDataproviderInfo::SetStoresL( const CDesCArray& aStores )
-    {
-    delete iStores;
-    iStores = NULL;
-    iStores = new ( ELeave ) CDesCArrayFlat( 1 );
-    for ( TInt i=0; i<aStores.Count(); i++ )
-        {
-        iStores->AppendL( aStores[i] );
-        }
-    }
--- a/connectivitymodules/SeCon/clients/syncclient/src/sconsyncclient.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,668 +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:  RSconSyncSession implementation
-*
-*/
-
-
-#include "sconsyncclient.h"
-
-#include <SmlDataProvider.h>
-#include <s32mem.h>
-
-#include "sconsyncclientserver.h"
-#include "debug.h"
-
-const TInt KSConSyncChunkSize = 0xFFFF; // 65535 bytes;
-const TInt KSConSyncChunkMaxSize = 0x400000; // 4194304 bytes
-
-EXPORT_C RSconSyncSession::RSconSyncSession()
-    {
-    TRACE_FUNC;
-    }
-
-EXPORT_C RSconSyncSession::~RSconSyncSession()
-    {
-    TRACE_FUNC;
-    }
-
-EXPORT_C TInt RSconSyncSession::Connect()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt retryCount = 2;
-    TInt error = KErrNone;
-    while(retryCount)
-        {
-        error = CreateSession(KSconSyncServerName, TVersion(1,0,0));
-        if ( error != KErrNotFound && error != KErrServerTerminated )
-            {
-            break;
-            }
-        error = StartServer();
-        if( error != KErrNone && error != KErrAlreadyExists )
-            {
-            break;
-            }
-        --retryCount;
-        }
-    
-    if ( error == KErrNone )
-        {
-        error = CreateAndSendChunkHandle();
-        if ( error != KErrNone )
-            {
-            LOGGER_WRITE("CreateAndSendChunkHandle failed, close session");
-            Close();
-            }
-        }
-    TRACE_FUNC_EXIT;
-    return error;
-    }
-
-// -----------------------------------------------------------------------------
-// RSconSyncSession::Close()
-// Closes the server connection
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void RSconSyncSession::Close()
-    {
-    TRACE_FUNC_ENTRY;
-    iChunk.Close();
-    RSessionBase::Close();
-    TRACE_FUNC_EXIT
-    }
-
-EXPORT_C void RSconSyncSession::ListAllImplementationsL( RSconDataProviderInfoArray& aInfoArray )
-    {
-    TRACE_FUNC_ENTRY;
-    TIpcArgs args;
-    TInt ret = SendReceive ( EListImplementations, args );
-    
-    if ( ret != KErrNone) 
-        {
-        LOGGER_WRITE_1( "RSconSyncSession::ListAllImplementationsL() :\
-         Send Receive failed with code %d", ret );
-        User::Leave( ret );
-        };
-    
-    // copy data from the chunk
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    
-    TInt count( readStream.ReadUint16L() );
-    LOGGER_WRITE_1("count: %d", count);
-    for ( TInt i=0; i<count; i++ )
-        {
-        LOGGER_WRITE_1("Import[%d]", i);
-        CSconDataproviderInfo *dpInfo = CSconDataproviderInfo::NewL();
-        CleanupStack::PushL( dpInfo );
-        
-        dpInfo->InternalizeL( readStream );
-        aInfoArray.AppendL( dpInfo );
-        CleanupStack::Pop( dpInfo );
-        }
-    
-    CleanupStack::PopAndDestroy( &readStream );
-
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::OpenDataStoreL( const TSmlDataProviderId aProviderId, const TDesC& aStoreName, TInt aContextId )
-    {
-    TRACE_FUNC_ENTRY;
-    User::LeaveIfError( iChunk.Adjust( 
-            sizeof(TInt32)
-            + sizeof(TInt32)
-            + aStoreName.Size()
-            + sizeof(TInt) ));
-    
-    RMemWriteStream writeBuf( iChunk.Base(), iChunk.Size() );
-    writeBuf.WriteInt32L( aProviderId );
-    
-    writeBuf.WriteInt32L( aStoreName.Length() );
-    writeBuf.WriteL( aStoreName );
-    
-    writeBuf.WriteInt32L( aContextId );
-
-    writeBuf.CommitL();
-    writeBuf.Close();
-    
-    TIpcArgs args;
-    TInt ret = SendReceive ( EOpenStore, args );
-    
-    if ( ret != KErrNone) 
-        {
-        LOGGER_WRITE_1( "RSconSyncSession::OpenDataStoreL() :\
-         Send Receive failed with code %d", ret );
-        User::Leave( ret );
-        };
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::OpenItemL( TSmlDbItemUid aUid, TBool& aFieldChange,
-        TSmlDbItemUid& aParent, TDes8& aMimeType, TDes8& aMimeVer, CBufFlat& aItemData )
-    {
-    TRACE_FUNC_ENTRY;
-    TIpcArgs args( aUid );
-    TInt ret = SendReceive ( EOpenItem, args );
-    if ( ret != KErrNone) 
-        {
-        LOGGER_WRITE_1( "RSconSyncSession::OpenItemL() :\
-         Send Receive failed with code %d", ret );
-        User::Leave( ret );
-        };
-    
-    // copy data from the chunk
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    TInt32 length ( 0 );
-
-    aItemData.Reset();
-    length = readStream.ReadInt32L();
-    
-    HBufC8* data = HBufC8::NewLC( length );
-    TPtr8 dataPtr = data->Des();
-    
-    readStream.ReadL( dataPtr, length );
-    aItemData.ExpandL( 0, length );
-    aItemData.Write ( 0, dataPtr );
-    
-    CleanupStack::PopAndDestroy( data );
-
-    aFieldChange = readStream.ReadInt8L();
-    
-    aParent = readStream.ReadInt32L();
-    length = readStream.ReadInt32L();
-    readStream.ReadL( aMimeType, length );
-    
-    length = readStream.ReadInt32L();
-    readStream.ReadL( aMimeVer, length );
-    
-    CleanupStack::PopAndDestroy( &readStream );
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::CreateItemL(TSmlDbItemUid& aUid/*, TInt aSize*/,
-        TSmlDbItemUid aParent, const TDesC8& aMimeType, const TDesC8& aMimeVer,
-        const TDesC8& aData)
-    {
-    TRACE_FUNC_ENTRY;
-    User::LeaveIfError( iChunk.Adjust( 
-        sizeof(TInt32)
-        + sizeof(TInt32)
-        + aMimeType.Length()
-        + sizeof(TInt32)
-        + aMimeVer.Length()
-        + sizeof(TInt32)
-        + aData.Length() ));
-    RMemWriteStream writeBuf( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( writeBuf );
-    writeBuf.WriteInt32L( aParent );
-    writeBuf.WriteInt32L( aMimeType.Length() );
-    writeBuf.WriteL( aMimeType );
-    writeBuf.WriteInt32L( aMimeVer.Length() );
-    writeBuf.WriteL( aMimeVer );
-    writeBuf.WriteInt32L( aData.Length() );
-    writeBuf.WriteL( aData );
-        
-    writeBuf.CommitL();
-    CleanupStack::PopAndDestroy( &writeBuf );
-    
-
-    
-    TPckg<TSmlDbItemUid> pckg(aUid);
-    iArgs = TIpcArgs( &pckg );
-    
-    TInt ret = SendReceive ( ECreateItem, iArgs );
-    if ( ret != KErrNone) 
-        {
-        LOGGER_WRITE_1( "RSconSyncSession::CreateItemL() :\
-         Send Receive failed with code %d", ret );
-        User::Leave( ret );
-        };
-    LOGGER_WRITE_1("aUid: %d", aUid);
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::CreateItemL(TPckg<TSmlDbItemUid>& aUidPckg,
-        TSmlDbItemUid aParent, const TDesC8& aMimeType, const TDesC8& aMimeVer,
-        const TDesC8& aData, TRequestStatus& aStatus)
-    {
-    TRACE_FUNC_ENTRY;
-    User::LeaveIfError( iChunk.Adjust( 
-        sizeof(TInt32)
-        + sizeof(TInt32)
-        + aMimeType.Length()
-        + sizeof(TInt32)
-        + aMimeVer.Length()
-        + sizeof(TInt32)
-        + aData.Length() ));
-    RMemWriteStream writeBuf( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( writeBuf );
-    writeBuf.WriteInt32L( aParent );
-    writeBuf.WriteInt32L( aMimeType.Length() );
-    writeBuf.WriteL( aMimeType );
-    writeBuf.WriteInt32L( aMimeVer.Length() );
-    writeBuf.WriteL( aMimeVer );
-    writeBuf.WriteInt32L( aData.Length() );
-    writeBuf.WriteL( aData );
-        
-    writeBuf.CommitL();
-    CleanupStack::PopAndDestroy( &writeBuf );
-    
-    iArgs = TIpcArgs( &aUidPckg );
-    SendReceive( ECreateItem, iArgs, aStatus );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::ReplaceItemL(TSmlDbItemUid aUid,
-        TSmlDbItemUid aParent, TBool aFieldChange, const TDesC8& aData)
-    {
-    TRACE_FUNC_ENTRY;
-    User::LeaveIfError( iChunk.Adjust( 
-        sizeof(TInt32)
-        + sizeof(TInt32)
-        + sizeof(TInt8)
-        + sizeof(TInt32)
-        + aData.Length() ));
-    RMemWriteStream writeBuf( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( writeBuf );
-    writeBuf.WriteInt32L( aUid );
-    writeBuf.WriteInt32L( aParent );
-    writeBuf.WriteInt8L( aFieldChange );
-    writeBuf.WriteInt32L( aData.Length() );
-    writeBuf.WriteL( aData );
-    writeBuf.CommitL();
-    CleanupStack::PopAndDestroy( &writeBuf );
-    
-    TIpcArgs args;
-    TInt ret = SendReceive( EReplaceItem, args );
-    if ( ret != KErrNone) 
-        {
-        LOGGER_WRITE_1( "RSconSyncSession::ReplaceItemL() :\
-         Send Receive failed with code %d", ret );
-        User::Leave( ret );
-        };
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::ReplaceItemL(TSmlDbItemUid aUid,
-        TSmlDbItemUid aParent, TBool aFieldChange, const TDesC8& aData,
-        TRequestStatus& aStatus)
-    {
-    TRACE_FUNC_ENTRY;
-    User::LeaveIfError( iChunk.Adjust( 
-        sizeof(TInt32)
-        + sizeof(TInt32)
-        + sizeof(TInt8)
-        + sizeof(TInt32)
-        + aData.Length() ));
-    RMemWriteStream writeBuf( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( writeBuf );
-    writeBuf.WriteInt32L( aUid );
-    writeBuf.WriteInt32L( aParent );
-    writeBuf.WriteInt8L( aFieldChange );
-    writeBuf.WriteInt32L( aData.Length() );
-    writeBuf.WriteL( aData );
-    writeBuf.CommitL();
-    CleanupStack::PopAndDestroy( &writeBuf );
-    
-    TIpcArgs args;
-    SendReceive( EReplaceItem, args, aStatus );
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::MoveItemL( TSmlDbItemUid aUid, TSmlDbItemUid aNewParent )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TIpcArgs args(aUid, aNewParent);
-    TInt ret = SendReceive ( EMoveItem, args );
-    if ( ret != KErrNone) 
-        {
-        LOGGER_WRITE_1( "RSconSyncSession::MoveItemL() :\
-         Send Receive failed with code %d", ret );
-        User::Leave( ret );
-        };
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::DeleteItemL( TSmlDbItemUid aUid )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TIpcArgs args( aUid );
-    TInt ret = SendReceive ( EDeleteItem, args );
-    if ( ret != KErrNone) 
-        {
-        LOGGER_WRITE_1( "RSconSyncSession::DeleteItemL() :\
-         Send Receive failed with code %d", ret );
-        User::Leave( ret );
-        };
-    TRACE_FUNC_EXIT;
-    }
-
-
-EXPORT_C void RSconSyncSession::SoftDeleteItemL( TSmlDbItemUid aUid )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TIpcArgs args( aUid );
-    TInt ret = SendReceive ( ESoftDeleteItem, args );
-    if ( ret != KErrNone) 
-        {
-        LOGGER_WRITE_1( "RSconSyncSession::SoftDeleteItemL() :\
-         Send Receive failed with code %d", ret );
-        User::Leave( ret );
-        };
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::DeleteAllItems( TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    TIpcArgs args;
-    SendReceive( EDeleteAllItems, args, aStatus );
-    TRACE_FUNC_EXIT;
-    }
-
-    
-EXPORT_C TBool RSconSyncSession::HasSyncHistoryL() const
-    {
-    TRACE_FUNC;
-    TBool history(EFalse);
-    TPckg<TBool> pck(history);
-    TIpcArgs args(&pck);
-    TInt ret = SendReceive ( EHasHistory, args );
-    User::LeaveIfError( ret );
-    TRACE_FUNC_EXIT;
-    return history;
-    }
-
-EXPORT_C void RSconSyncSession::AddedItemsL( RArray<TSmlDbItemUid>& aItems) const
-    {
-    TRACE_FUNC_ENTRY;
-    TIpcArgs args;
-    TInt ret = SendReceive ( EAddedItems, args );
-    User::LeaveIfError( ret );
-    
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    
-    aItems.Reset();
-    TInt itemCount = readStream.ReadInt32L();
-    for (TInt i=0; i<itemCount; i++)
-        {
-        aItems.AppendL( readStream.ReadInt32L() );
-        }
-    
-    CleanupStack::PopAndDestroy( &readStream );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::DeletedItemsL( RArray<TSmlDbItemUid>& aItems) const
-    {
-    TRACE_FUNC_ENTRY;
-    TIpcArgs args;
-    TInt ret = SendReceive ( EDeletedItems, args );
-    User::LeaveIfError( ret );
-    
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    
-    aItems.Reset();
-    TInt itemCount = readStream.ReadInt32L();
-    for (TInt i=0; i<itemCount; i++)
-        {
-        aItems.AppendL( readStream.ReadInt32L() );
-        }
-    
-    CleanupStack::PopAndDestroy( &readStream );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::SoftDeletedItemsL( RArray<TSmlDbItemUid>& aItems) const
-    {
-    TRACE_FUNC_ENTRY;
-    TIpcArgs args;
-    TInt ret = SendReceive ( ESoftDeletedItems, args );
-    User::LeaveIfError( ret );
-    
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    
-    aItems.Reset();
-    TInt itemCount = readStream.ReadInt32L();
-    for (TInt i=0; i<itemCount; i++)
-        {
-        aItems.AppendL( readStream.ReadInt32L() );
-        }
-    
-    CleanupStack::PopAndDestroy( &readStream );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::ModifiedItemsL( RArray<TSmlDbItemUid>& aItems) const
-    {
-    TRACE_FUNC_ENTRY;
-    TIpcArgs args;
-    TInt ret = SendReceive ( EModifiedItems, args );
-    User::LeaveIfError( ret );
-    
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    
-    aItems.Reset();
-    TInt itemCount = readStream.ReadInt32L();
-    for (TInt i=0; i<itemCount; i++)
-        {
-        aItems.AppendL( readStream.ReadInt32L() );
-        }
-    
-    CleanupStack::PopAndDestroy( &readStream );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::MovedItemsL( RArray<TSmlDbItemUid>& aItems) const
-    {
-    TRACE_FUNC_ENTRY;
-    TIpcArgs args;
-    TInt ret = SendReceive ( EMovedItems, args );
-    User::LeaveIfError( ret );
-    
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    
-    aItems.Reset();
-    TInt itemCount = readStream.ReadInt32L();
-    for (TInt i=0; i<itemCount; i++)
-        {
-        aItems.AppendL( readStream.ReadInt32L() );
-        }
-    
-    CleanupStack::PopAndDestroy( &readStream );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::CloseDataStore() const
-    {
-    TRACE_FUNC_ENTRY;
-    TIpcArgs args;
-    SendReceive ( ECloseStore, args );
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::ResetChangeInfoL()
-    {
-    TRACE_FUNC_ENTRY;
-    TIpcArgs args;
-    TInt ret = SendReceive ( EResetChangeInfo, args );
-    User::LeaveIfError( ret );
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::CommitChangeInfoL(const RArray<TSmlDbItemUid>& aItems )
-    {
-    TRACE_FUNC_ENTRY;
-    RMemWriteStream stream ( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( stream );
-    LOGGER_WRITE_1("items count: %d", aItems.Count());
-    stream.WriteInt32L( aItems.Count() );
-    for (TInt i=0; i < aItems.Count(); i++ )
-        {
-        LOGGER_WRITE("Write item");
-        stream.WriteInt32L( aItems[i] );
-        }
-    stream.CommitL();
-    CleanupStack::PopAndDestroy( &stream );
-        
-    TIpcArgs args;
-    TInt ret = SendReceive ( ECommitChangeInfo, args );
-    User::LeaveIfError( ret );
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::GetSyncTimeStampL( const TSmlDataProviderId aProviderId, const TInt aContextId, TDateTime& aTimeStamp ) const
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TPckg<TDateTime> timeBuf( aTimeStamp );
-    TIpcArgs args( aProviderId, aContextId, &timeBuf );
-    TInt ret = SendReceive ( EGetSyncTimeStamp, args );
-    User::LeaveIfError( ret );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C CSmlDataStoreFormat* RSconSyncSession::StoreFormatL( const RStringPool& aStringPool )
-    {
-    TRACE_FUNC_ENTRY;
-    TIpcArgs args;
-    TInt ret = SendReceive ( EExportStoreFormat, args );
-    User::LeaveIfError( ret );
-    
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    TInt len = readStream.ReadInt32L();
-    LOGGER_WRITE_1("data size from server: %d", len);
-    LOGGER_WRITE("CSmlDataStoreFormat::NewLC");
-    CSmlDataStoreFormat* tempStoreFormat = CSmlDataStoreFormat::NewLC( aStringPool, readStream );
-    LOGGER_WRITE("CSmlDataStoreFormat::NewLC -ok");
-    CleanupStack::Pop( tempStoreFormat );
-    
-    LOGGER_WRITE("PopAndDestroy( &readStream )");
-    CleanupStack::PopAndDestroy( &readStream );
-    LOGGER_WRITE("return");
-    TRACE_FUNC_EXIT;
-    return tempStoreFormat;
-    }
-
-EXPORT_C void RSconSyncSession::SetRemoteStoreFormatL( const CSmlDataStoreFormat& aServerDataStoreFormat )
-    {
-    TRACE_FUNC_ENTRY;
-    const TInt KMaximumDataStoreFormatSize = 100000; // 100kb should be enought
-    User::LeaveIfError( iChunk.Adjust( KMaximumDataStoreFormatSize ));
-    
-    RMemWriteStream stream ( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( stream );
-    
-    aServerDataStoreFormat.ExternalizeL( stream );
-    
-    stream.CommitL();
-    CleanupStack::PopAndDestroy( &stream );
-    
-    TIpcArgs args;
-    TInt ret = SendReceive ( ESetRemoteStoreFormat, args );
-    User::LeaveIfError( ret );
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C void RSconSyncSession::CancelRequest()
-    {
-    TRACE_FUNC_ENTRY;
-    SendReceive( ECancelRequest, TIpcArgs() );
-    TRACE_FUNC_EXIT;
-    }
-
-EXPORT_C TInt RSconSyncSession::GetParent( TSmlDbItemUid aUid, TSmlDbItemUid& aParent )
-    {
-    TRACE_FUNC_ENTRY;
-    TPckg<TSmlDbItemUid> pckg(aParent);
-    TIpcArgs args( aUid, &pckg );
-    TInt ret = SendReceive( EReadParent, args );
-    TRACE_FUNC_EXIT;
-    return ret;
-    }
-
-TInt RSconSyncSession::StartServer()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    RProcess server;
-    TInt error = server.Create(KSconSyncServerExe, KNullDesC);
-    if ( error != KErrNone )
-        {
-        return error;
-        }
-    // start server and wait for signal before proceeding    
-    TRequestStatus status;
-    server.Rendezvous(status);
-    if ( status.Int() != KRequestPending )
-        {
-        server.Kill(0);
-        }
-    else
-        {
-        server.Resume();
-        }
-    
-    User::WaitForRequest( status );
-    error = server.ExitType() == EExitPanic ? KErrGeneral : status.Int();
-    server.Close();
-    TRACE_FUNC_EXIT;
-    return error;
-    }
-
-// -----------------------------------------------------------------------------
-// RSconSyncSession::CreateAndSendChunkHandle()
-// Creates a chunk and sends a handle to server
-// -----------------------------------------------------------------------------
-//  
-TInt RSconSyncSession::CreateAndSendChunkHandle()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TInt err = iChunk.CreateGlobal( KNullDesC, 
-                                    KSConSyncChunkSize, 
-                                    KSConSyncChunkMaxSize );
-    if ( err != KErrNone )
-        {
-        LOGGER_WRITE_1("iChunk.CreateGlobal failed, err: %d", err);
-        return err;
-        }                           
-    TIpcArgs args;
-    args.Set( 0, iChunk );
-    err = SendReceive( ESendChunkHandle, args );
-    
-    LOGGER_WRITE_1("RSconSyncSession::CreateAndSendChunkHandle : returned: %d", err);
-    return err;
-    }
-
-// End of File
--- a/connectivitymodules/SeCon/cntparser/bld/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2002-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:  Contact Parser Client-Server build information file.
-*
-*/
-
-
-PRJ_EXPORTS
-../rom/cntparser.iby         CORE_APP_LAYER_IBY_EXPORT_PATH(cntparser.iby)
-
-PRJ_PLATFORMS
-DEFAULT
-
-
-PRJ_MMPFILES
-cntparsersrv.mmp
-cntparsersrvexe.mmp
-
-
--- a/connectivitymodules/SeCon/cntparser/bld/cntparsersrv.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
-* Copyright (c) 2002-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:  Contact Parser Client
-*
-*/
-
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-VENDORID        VID_DEFAULT
-
-CAPABILITY      CAP_CLIENT_DLL
-
-TARGET          cntparserserver.dll
-TARGETTYPE      dll
-
-UID             0x10009d8d 0x101F99F8
-
-#if defined(ARMCC)
-DEFFILE	./def/eabiu
-#elif defined(WINSCW) 
-DEFFILE	./def/bwinscw
-#elif defined(WINS)
-DEFFILE	./def/bwins
-#elif defined(ARM)
-DEFFILE	./def/bmarm
-#endif
-
-SOURCEPATH      ../src
-SOURCE          cntparserclient.cpp
-SOURCE          cntparserinfolog.cpp
-
-USERINCLUDE     ../inc
-USERINCLUDE     ../../inc
-
-// Default system include paths.
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY         euser.lib
-LIBRARY	        cntmodel.lib
-LIBRARY	        efsrv.lib
-LIBRARY	        estor.lib
-LIBRARY	        versit.lib
-LIBRARY	        vcard.lib
-LIBRARY         bafl.lib
-DEBUGLIBRARY    flogger.lib
-
--- a/connectivitymodules/SeCon/cntparser/bld/cntparsersrvexe.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* Copyright (c) 2002-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:  Contact Parser Server
-*
-*/
-
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-VENDORID        VID_DEFAULT
-
-CAPABILITY      CAP_SERVER
-
-TARGET          cntparserserverexe.exe
-TARGETTYPE      exe
-
-UID             0 0x101F99F9
-
-SOURCEPATH      ../src
-SOURCE          cntparserserverexe.cpp
-SOURCE          cntparserserversession.cpp
-SOURCE          cntparsercollector.cpp
-
-USERINCLUDE     ../inc
-USERINCLUDE     ../../inc
-
-// Default system include paths
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY         euser.lib
-LIBRARY	        cntmodel.lib
-LIBRARY	        efsrv.lib
-LIBRARY	        estor.lib
-LIBRARY	        versit.lib
-LIBRARY	        vcard.lib
-LIBRARY         bafl.lib
-DEBUGLIBRARY    flogger.lib
--- a/connectivitymodules/SeCon/cntparser/bld/def/bwinscwu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-EXPORTS
-	??0RCntParserServer@@QAE@XZ @ 1 NONAME ; RCntParserServer::RCntParserServer(void)
-	?Cancel@RCntParserServer@@QAEHXZ @ 2 NONAME ; int RCntParserServer::Cancel(void)
-	?CancelAll@RCntParserServer@@QAEHXZ @ 3 NONAME ; int RCntParserServer::CancelAll(void)
-	?Connect@RCntParserServer@@QAEHXZ @ 4 NONAME ; int RCntParserServer::Connect(void)
-	?ContactsParsed@RCntParserServer@@QAEHXZ @ 5 NONAME ; int RCntParserServer::ContactsParsed(void)
-	?ContactsSaved@RCntParserServer@@QAEHXZ @ 6 NONAME ; int RCntParserServer::ContactsSaved(void)
-	?CreateIrMCL2PhoneBook@RCntParserServer@@QAEHHH@Z @ 7 NONAME ; int RCntParserServer::CreateIrMCL2PhoneBook(int, int)
-	?Disconnect@RCntParserServer@@QAEHXZ @ 8 NONAME ; int RCntParserServer::Disconnect(void)
-	?MaximumRecords@CCntParserInfoLog@@QBEHXZ @ 9 NONAME ; int CCntParserInfoLog::MaximumRecords(void) const
-	?NewL@CCntParserInfoLog@@SAPAV1@XZ @ 10 NONAME ; class CCntParserInfoLog * CCntParserInfoLog::NewL(void)
-	?SaveToFileL@CCntParserInfoLog@@QBEXABVTDesC16@@@Z @ 11 NONAME ; void CCntParserInfoLog::SaveToFileL(class TDesC16 const &) const
-	?SetMaximumRecords@CCntParserInfoLog@@QAEXH@Z @ 12 NONAME ; void CCntParserInfoLog::SetMaximumRecords(int)
-	?SetTotalRecords@CCntParserInfoLog@@QAEXH@Z @ 13 NONAME ; void CCntParserInfoLog::SetTotalRecords(int)
-	?TotalNumberOfContacts@RCntParserServer@@QAEHXZ @ 14 NONAME ; int RCntParserServer::TotalNumberOfContacts(void)
-	?TotalRecords@CCntParserInfoLog@@QBEHXZ @ 15 NONAME ; int CCntParserInfoLog::TotalRecords(void) const
-	?Version@RCntParserServer@@QBE?AVTVersion@@XZ @ 16 NONAME ; class TVersion RCntParserServer::Version(void) const
-
--- a/connectivitymodules/SeCon/cntparser/bld/def/eabiuu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-EXPORTS
-	_ZN16RCntParserServer10DisconnectEv @ 1 NONAME
-	_ZN16RCntParserServer13ContactsSavedEv @ 2 NONAME
-	_ZN16RCntParserServer14ContactsParsedEv @ 3 NONAME
-	_ZN16RCntParserServer21CreateIrMCL2PhoneBookEii @ 4 NONAME
-	_ZN16RCntParserServer21TotalNumberOfContactsEv @ 5 NONAME
-	_ZN16RCntParserServer6CancelEv @ 6 NONAME
-	_ZN16RCntParserServer7ConnectEv @ 7 NONAME
-	_ZN16RCntParserServer9CancelAllEv @ 8 NONAME
-	_ZN16RCntParserServerC1Ev @ 9 NONAME
-	_ZN16RCntParserServerC2Ev @ 10 NONAME
-	_ZN17CCntParserInfoLog15SetTotalRecordsEi @ 11 NONAME
-	_ZN17CCntParserInfoLog17SetMaximumRecordsEi @ 12 NONAME
-	_ZN17CCntParserInfoLog4NewLEv @ 13 NONAME
-	_ZNK16RCntParserServer7VersionEv @ 14 NONAME
-	_ZNK17CCntParserInfoLog11SaveToFileLERK7TDesC16 @ 15 NONAME
-	_ZNK17CCntParserInfoLog12TotalRecordsEv @ 16 NONAME
-	_ZNK17CCntParserInfoLog14MaximumRecordsEv @ 17 NONAME
-	_ZTI17CCntParserInfoLog @ 18 NONAME ; #<TI>#
-	_ZTV17CCntParserInfoLog @ 19 NONAME ; #<VT>#
-
--- a/connectivitymodules/SeCon/cntparser/inc/clientserver.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +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:  Contact Parser Server definitions
-*
-*/
-
-
-#ifndef __CLIENTSERVER_H__
-#define __CLIENTSERVER_H__
-#include <e32base.h>
-
-// server name
-_LIT(KCntParserName,"Contacts Parser");
-
-// A version must be specified when creating a session with the server
-
-const TUint KCntParserMajorVersionNumber=0;
-const TUint KCntParserMinorVersionNumber=1;
-const TUint KCntParserBuildVersionNumber=1;
-
-// opcodes used in message passing between client and server
-enum TCntParserRqst
-	{
-	ECntParserServerCancel,
-	ECntParserServerClose,
-	ECntParserServerCreateIrMCL2,
-	ECntParserServerTotalNumOfContacts,
-	ECntParserServerDisconnect,
-	ECntParserServerCntParsed,
-	ECntParserServerCntSaved,
-	ECntParserServerCancelAll
-	};
-
-#endif
\ No newline at end of file
--- a/connectivitymodules/SeCon/cntparser/inc/cntparserclient.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-* Copyright (c) 2002-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:  Contact Parser Client
-*
-*/
-
-
-
-#if !defined(__CNTPARSERCLIENT_H__)
-#define __CNTPARSERCLIENT_H__
-
-#include <e32base.h>
-#include <e32std.h>
-
-enum TCntParserConnection
-{
-	ECntParserNotConnected,
-	ECntParserConnected
-};
-
-//**********************************
-//RCntParserServer
-//**********************************
-
-class RCntParserServer : public RSessionBase
-{
-	public:
-	IMPORT_C	RCntParserServer();
-	IMPORT_C	TInt Connect();
-	IMPORT_C	TInt Disconnect();
-	IMPORT_C	TVersion Version() const;
-	IMPORT_C	TInt CreateIrMCL2PhoneBook(TInt aMaxNumberOfContacts, TBool aForced);
-	IMPORT_C	TInt ContactsParsed();
-	IMPORT_C	TInt ContactsSaved();
-	IMPORT_C	TInt TotalNumberOfContacts();
-	IMPORT_C	TInt Cancel(); 		//cancels phonebook request
-	IMPORT_C	TInt CancelAll(); 	//cancels all request
-
-	private:
-	TCntParserConnection	iConnected;
-};
-
-
-#endif
-
--- a/connectivitymodules/SeCon/cntparser/inc/cntparsercollector.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
-* 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:  CCntParserCollector header
-*
-*/
-
-
-
-#ifndef __CNTPARSERCOLLECTOR_H__
-#define __CNTPARSERCOLLECTOR_H__
-
-#include <f32file.h>
-#include <s32file.h>
-
-class CCntParserServer;
-class CContactDatabase;
-class CContactIdArray;
-class CCntFilter;
-class CVersitTlsData;
-
-class CCntParserCollector : public CActive
-{
-	public:
-
-	CCntParserCollector();
-	static CCntParserCollector* NewL(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase);
-	static CCntParserCollector* NewLC(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase);
-	virtual ~CCntParserCollector();
-	void ConstructL(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase);
-	TInt CreateIrMCL2FileL(const TDesC& aFileName,TInt aMaxNumberOfContacts,TBool aForced);
-	void PrepareParserL();
-	void ParseCntDatabaseL();
-	void DoCancel();
-
-	TInt CurrentItem();
-	TInt Count();
-	TInt ContactsSaved();
-
-	protected:
-	void RunL();
-	TInt RunError(TInt aError);
-	void ExternalizeCurrentContactL(CContactDatabase* aContactsDb,TInt aCurrentItem,TBool ExternalizeEmpty);
-	void CloseResources();
-	void SaveTotalCountL();
-	TInt ReadTotalCountL() const;
-	TBool ContactCountChanged();
-
-	private:
-	CContactDatabase*	iContactsDb;	//Caller has the ownership
-	TInt iCurrentItem;
-	TInt iCount;						//Contacts in CDB
-	TInt iMaxNumberOfContacts;			//Max contacts to be parsed (MAXIMUM RECORDS in info.log)
-	RFileWriteStream iWriter;
-	CContactIdArray* iIds;				//List of ID numbers of contacts
-	CCntParserServer* iServer;			//Caller has the ownership
-	CCntFilter* iFilter;
-	CVersitTlsData* iVersitTLS;			//For speed optimization
-	TBool iCancel;
-	TInt iContactsSaved;
-	TInt iTotalCount;
-	
-	RFs iFsSession;
-};
-
-#endif
\ No newline at end of file
--- a/connectivitymodules/SeCon/cntparser/inc/cntparserinfolog.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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:  CCntParserInfoLog header.
-*    This class is intended to create the INFO.LOG file for RANSI car phone when
-*    downloading contacts using IrMC L2. The implementation contains only mandatory
-*    needs and some extension possibilities. This class is RANSI specific and
-*    should _NOT_ be used by anyone else without a deeper knowledge.
-*
-*/
-
-
-#ifndef _CNTPARSERINFOLOG_H_
-#define _CNTPARSERINFOLOG_H_
-
-
-class CCntParserInfoLog : public CBase
-{
-	public:
-	CCntParserInfoLog();
-	virtual ~CCntParserInfoLog();
-	IMPORT_C static CCntParserInfoLog* NewL();
-	void ConstructL();
-
-	IMPORT_C void SaveToFileL(const TDesC& aFileName) const;
-
-	IMPORT_C void SetTotalRecords(TInt aTotalRecords);
-	IMPORT_C void SetMaximumRecords(TInt aMaximumRecords);
-
-	IMPORT_C TInt TotalRecords() const;
-	IMPORT_C TInt MaximumRecords() const;
-
-	private:
-
-	TInt	iTotalRecords;
-	TInt	iLastUsedIndex;
-	TInt	iMaximumRecords;
-};
-
-#endif // _CNTPARSERINFOLOG_H_
--- a/connectivitymodules/SeCon/cntparser/inc/cntparserserver.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +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:  CCntParserServer header
-*
-*/
-
-
-#ifndef __CNTPARSERSERVER_H__
-#define __CNTPARSERSERVER_H__
-
-#include <e32base.h>
-#include <e32svr.h>
-
-class CCntParserCollector;
-class CContactDatabase;
-
-_LIT(KTxtServer,"CntParserServerExe.exe");
-
-// needed for creating server thread.
-const TUint KDefaultHeapSize=0x10000;
-
-// reasons for server panic
-enum TCntParserServerPanic
-{
-	EBadRequest,
-	EBadDescriptor,
-	EMainSchedulerError,
-	ESvrCreateServer,
-	ESvrStartServer,
-	ECreateTrapCleanup,
-	ENotImplementedYet,
-};
-
-
-//**********************************
-//CCntParserServer
-//**********************************
-class CCntParserServer : public CServer2
-{
-	public:
-	IMPORT_C static CCntParserServer* NewL();
-	IMPORT_C virtual ~CCntParserServer();
-	static TInt RunServer();
-	static void RunServerL();
-	void IncreaseSessionCountL();
-	void DecreaseSessionCount();
-	void Stop();
-	
-	TInt CreateIrMCL2PhoneBookL(const TDesC& path, TInt aMaxNumberOfContacts,TBool aForced);
-	void PrepareCollectorL();
-	TInt ContactsParsed();
-	void CancelPhoneBookRequest();
-	void CancelAllPhoneBookRequests();
-	TInt TotalNumOfContacts();
-	TInt ContactsSaved();
-	void Disconnect();
-	void CompletePhoneBookRequests(TInt aErr);
-	void SetRequests(TInt aRequests);
-
-	protected:
-	virtual CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMsg) const;
-
-
-	protected:
-	CCntParserServer();
-
-
-	private:
-	TInt	iSessionCount;
-	TInt	iRequests;	//How many PB.VCF requests are ongoing, if 0 collector is canceled
-
-	CCntParserCollector* iCollector;
-	CContactDatabase* iCurrentDatabase;
-};
-
-//**********************************
-//global functions
-//**********************************
-
-// function to panic the server
-GLREF_C void PanicServer(TCntParserServerPanic aPanic);
-
-
-#endif
\ No newline at end of file
--- a/connectivitymodules/SeCon/cntparser/inc/cntparserserversession.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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:  CCntParserServerSession header
-*
-*/
-
-
-#ifndef __CNTPARSERSERVERSESSION_H__
-#define __CNTPARSERSERVERSESSION_H__
-
-#include "clientserver.h"
-#include "cntparserclient.h"
-#include "cntparserserver.h"
-#include "cntparsercollector.h"
-
-class CCntParserServer;
-
-//**********************************
-//CCntParserServerSession
-//**********************************
-class CCntParserServerSession : public CSession2
-{
-	public:
-	static CCntParserServerSession* NewL(CCntParserServer* aServer);
-	virtual ~CCntParserServerSession();
-	void ConstructL(CCntParserServer* aServer);
-
-	private:
-	CCntParserServerSession();
-
-	public:
-	virtual void ServiceL(const RMessage2& aMessage);
-	TInt DispatchMessageL(const RMessage2& aMessage);
-	void CompletePhoneBookRequest(TInt aErr);
-
-	protected:
-	// panic the client
-	void PanicClient(TInt aPanic) const;
-
-	private:
-	CCntParserServer* iContactsParserSrv;
-	TBool iPhoneBookRequest;
-	RMessage2 iPhoneBookRequestMessage;
-};
-
-#endif
\ No newline at end of file
--- a/connectivitymodules/SeCon/cntparser/inc/irmcconsts.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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:  Contact Parser constants
-*
-*/
-
-
-#ifndef _IRMCCONSTS_H_
-#define _IRMCCONSTS_H_
-
-_LIT(KPhoneBookFilename,"c:\\IrMC\\pb.vcf");
-const TInt KMaximumNumberOfContacts=-1; //-1 == all contacts are transferred
-const TInt KPBNotUpdated=1;	//Must be grater than 0
-const TInt KPerformComplete=2; //Must be grater than 0 and different than KPBNotUpdated
-
-#endif
--- a/connectivitymodules/SeCon/cntparser/rom/cntparser.iby	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image description file for Contact Parser Client and Server.
-*
-*/
-
-
-#ifndef _CNTPARSER_IBY_
-#define _CNTPARSER_IBY_
-
-file=ABI_DIR\BUILD_DIR\cntparserserverexe.exe   PROGRAMS_DIR\cntparserserverexe.exe
-file=ABI_DIR\BUILD_DIR\cntparserserver.dll      SHARED_LIB_DIR\cntparserserver.dll
-
-#endif
\ No newline at end of file
--- a/connectivitymodules/SeCon/cntparser/src/cntparserclient.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,252 +0,0 @@
-/*
-* Copyright (c) 2002-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:  RCntParserServer implementation.
-*
-*/
-
-
-// needed for client interface
-#include "clientserver.h"
-#include "cntparserserver.h"
-#include "cntparserclient.h"
-
-#include "debug.h"
-
-const TUint KDefaultMessageSlots=4;
-
-
-//------------------------------------------------------------
-// RCntParserServer::RCntParserServer()
-//------------------------------------------------------------
-EXPORT_C RCntParserServer::RCntParserServer():iConnected(ECntParserNotConnected)
-	{
-	}
-//------------------------------------------------------------
-// RCntParserServer::Connect()
-//------------------------------------------------------------
-EXPORT_C TInt RCntParserServer::Connect()
-	{
-	LOGGER_ENTERFN( "RCntParserServer::Connect()" );
-
-	TInt r = KErrNone;
-
-	if( iConnected == ECntParserNotConnected )
-		{
-		r = CreateSession( KCntParserName, Version(), KDefaultMessageSlots );
-		if(r==KErrNone) 
-			{
-			iConnected=ECntParserConnected;	
-			}
-		else
-			{
-			RProcess p;
-			TInt err = p.Create(KTxtServer, KNullDesC);
-	   		if ( err != KErrNone )
-           		{
-           		// Loading failed.
-           		return err;
-           		}
-			TRequestStatus status;
-			p.Rendezvous( status );
-			if( status != KRequestPending )
-				{
-				p.Kill(0);		// abort startup
-				p.Close();
-				return KErrGeneral;   // status can be KErrNone: don't return status.Int()
-				}
-			else
-				{
-				p.Resume();	// logon OK - start the server
-				}
-			
-			User::WaitForRequest( status );
-
-			if( status != KErrNone )
-				{
-				p.Close();
-				return status.Int();
-				}
-
-			r = CreateSession( KCntParserName, Version() );
-			if( r == KErrNone )
-				{
-				iConnected = ECntParserConnected;	
-				}
-			p.Close();
-			}
-		}
-	else
-		{
-		r = KErrCouldNotConnect;
-		}
-	LOGGER_WRITE_1( "RCntParserServer::Connect() : return %d", r );
-	return r; 
-	}
-//------------------------------------------------------------
-// RCntParserServer::Disconnect()
-//------------------------------------------------------------
-EXPORT_C TInt RCntParserServer::Disconnect()
-	{
-	LOGGER_ENTERFN( "RCntParserServer::Disconnect()" );
-
-	TInt res = KErrNone;
-	if(iConnected==ECntParserConnected)
-		{
-		res = SendReceive( ECntParserServerDisconnect, TIpcArgs(NULL) );
-		if( res == KErrNone )
-			{
-			iConnected = ECntParserNotConnected;
-			RSessionBase::Close();
-			}
-		}
-	else
-		{
-		res = KErrCouldNotDisconnect;
-		}
-	LOGGER_WRITE_1( "RCntParserServer::CreateIrMCL2PhoneBook() : return %d", res );
-	return res;
-	}
-//------------------------------------------------------------
-// RCntParserServer::Version(void) const
-//------------------------------------------------------------
-EXPORT_C TVersion RCntParserServer::Version(void) const
-	{
-	return(TVersion(KCntParserMajorVersionNumber,KCntParserMinorVersionNumber,KCntParserBuildVersionNumber));
-	}
-//------------------------------------------------------------
-// RCntParserServer::CreateIrMCL2PhoneBook(TInt aMaxNumberOfContacts, TBool aForced)
-//------------------------------------------------------------
-EXPORT_C int RCntParserServer::CreateIrMCL2PhoneBook(TInt aMaxNumberOfContacts, TBool aForced)
-	{
-	LOGGER_ENTERFN( "RCntParserServer::CreateIrMCL2PhoneBook()" );
-    TInt res(KErrNone);
-	if( iConnected == ECntParserConnected )
-		{
-		res = SendReceive(ECntParserServerCreateIrMCL2,TIpcArgs(aMaxNumberOfContacts,aForced));
-		}
-	else
-		{
-		res = KErrNotReady;
-		}
-	LOGGER_WRITE_1( "RCntParserServer::CreateIrMCL2PhoneBook() : return %d", res );
-	return res;
-	}
-//------------------------------------------------------------
-// RCntParserServer::ContactsParsed()
-//------------------------------------------------------------
-EXPORT_C TInt RCntParserServer::ContactsParsed()
-	{
-	LOGGER_ENTERFN( "RCntParserServer::ContactsParsed()" );
-
-	TInt res=KErrNone;
-	if( iConnected == ECntParserConnected )
-		{
-		TPckgBuf<TInt> pckg;
-		res = SendReceive(ECntParserServerCntParsed,TIpcArgs(&pckg));
-		if( res == KErrNone )
-            {
-            res = pckg();
-            }
-		}
-	else
-		{
-		res = KErrNotReady;
-		}
-	LOGGER_WRITE_1( "RCntParserServer::ContactsParsed() : return %d", res );
-	return res;
-	}
-//------------------------------------------------------------
-// RCntParserServer::TotalNumberOfContacts()
-//------------------------------------------------------------
-EXPORT_C TInt RCntParserServer::TotalNumberOfContacts()
-	{
-	LOGGER_ENTERFN( "RCntParserServer::TotalNumberOfContacts()" );
-
-	TInt res = KErrNone;
-	if( iConnected == ECntParserConnected )
-		{
-		TPckgBuf<TInt> pckg;
-		res = SendReceive(ECntParserServerTotalNumOfContacts,TIpcArgs(&pckg));
-		if( res == KErrNone)
-            {
-            res = pckg();
-            }
-		}
-	else
-		{
-		res = KErrNotReady;
-		}
-	LOGGER_WRITE_1( "RCntParserServer::TotalNumberOfContacts() : return %d", res );
-	return res;
-	}
-//------------------------------------------------------------
-// RCntParserServer::Cancel()
-//------------------------------------------------------------
-EXPORT_C TInt RCntParserServer::Cancel()
-	{
-	LOGGER_ENTERFN( "RCntParserServer::Cancel()" );
-
-	TInt res = KErrNone;
-	if( iConnected == ECntParserConnected )
-		{
-		res = SendReceive(ECntParserServerCancel,TIpcArgs(NULL));
-		}
-	else
-		{
-		res = KErrCancel;
-		}
-	LOGGER_WRITE_1( "RCntParserServer::Cancel() : return %d", res );
-	return res;
-	}
-//------------------------------------------------------------
-// RCntParserServer::CancelAll()
-//------------------------------------------------------------
-EXPORT_C TInt RCntParserServer::CancelAll()
-	{
-	LOGGER_ENTERFN( "RCntParserServer::CancelAll()" );
-
-	TInt res = KErrNone;
-	if(iConnected==ECntParserConnected)
-		{
-		res = SendReceive(ECntParserServerCancelAll,TIpcArgs(NULL));
-		}
-	else
-		{
-		res = KErrCancel;
-		}
-    LOGGER_WRITE_1( "RCntParserServer::CancelAll() : return %d", res );
-	return res;
-	}
-//------------------------------------------------------------
-// RCntParserServer::ContactsSaved()
-//------------------------------------------------------------
-EXPORT_C TInt RCntParserServer::ContactsSaved()
-	{
-	LOGGER_ENTERFN( "RCntParserServer::ContactsSaved()" );
-
-	TInt res = KErrNone;
-	if( iConnected == ECntParserConnected )
-		{
-		TPckgBuf<TInt> pckg;
-		SendReceive(ECntParserServerCntSaved,TIpcArgs(&pckg));
-		res = pckg();
-		}
-	else
-		{
-		res = KErrNotReady;
-		}
-    LOGGER_WRITE_1( "RCntParserServer::ContactsSaved() : return %d", res );
-	return res;
-	}
-
--- a/connectivitymodules/SeCon/cntparser/src/cntparsercollector.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,620 +0,0 @@
-/*
-* Copyright (c) 2002-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:  CCntParserCollector implementation.
-*
-*/
-
-
-
-#include <cntfilt.h>
-#include <cntitem.h>
-#include <cntfldst.h>
-
-#include <vcard.h>
-#include <versit.h>
-#include <s32mem.h>
-
-#include "cntparsercollector.h"
-#include "cntparserserver.h"
-#include "irmcconsts.h"
-#include "debug.h"
-
-//Next values are defined in cntdef.h
-const TUid typesToBeSearched[]={{KUidContactFieldPhoneNumberValue},{KUidContactFieldFaxValue}};
-
-_LIT( KTotalCountFilePath, "count.txt" );
-
-_LIT8( KNameProperty, "N" );
-_LIT8( KTelProperty, "TEL" );
-
-
-//------------------------------------------------------------
-// CCntParserCollector::CCntParserCollector():CActive( 0 )
-//------------------------------------------------------------
-CCntParserCollector::CCntParserCollector():CActive( 0 )
-    {
-    }
-//------------------------------------------------------------
-// CCntParserCollector::~CCntParserCollector()
-//------------------------------------------------------------
-CCntParserCollector::~CCntParserCollector()
-    {
-    LOGGER_ENTERFN( "CntParserCollector::~CCntParserCollector()" );
-
-    if( iVersitTLS )
-        {
-        iVersitTLS->VersitTlsDataClose(); //Close reference 
-        }
-    LOGGER_WRITE( "CntParserCollector: Versit OK!" );
-
-    iFsSession.Close();
-    LOGGER_WRITE( "CntParserCollector: FsSession OK!" );
-    iWriter.Close(); 
-    LOGGER_WRITE( "CntParserCollector: iWriter OK!" );
-    delete iFilter;
-    LOGGER_LEAVEFN( "CntParserCollector::~CCntParserCollector()" );
-    }
-//------------------------------------------------------------
-// CCntParserCollector::NewL(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase)
-//------------------------------------------------------------
-CCntParserCollector* CCntParserCollector::NewL(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase)
-    {
-    CCntParserCollector* self=NewLC(aServer, aCurrentDatabase);
-    CleanupStack::Pop();
-    return self;
-    }
-//------------------------------------------------------------
-// CCntParserCollector::NewLC(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase)
-//------------------------------------------------------------
-CCntParserCollector* CCntParserCollector::NewLC(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase)
-    {
-    CCntParserCollector* self=new (ELeave) CCntParserCollector();
-    CleanupStack::PushL( self );
-    self->ConstructL( aServer, aCurrentDatabase );
-    return self;
-    }
-//------------------------------------------------------------
-// CCntParserCollector::ConstructL(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase)
-//------------------------------------------------------------
-void CCntParserCollector::ConstructL(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase)
-    {
-    LOGGER_WRITE( "CntParserCollector: ConstructL" );
-
-    CVersitTlsData& VersitTLS = CVersitTlsData::VersitTlsDataL();   //For speed optimization take a reference to TLS, SEE DESTRUCTOR!!
-    iVersitTLS = &VersitTLS;
-
-    iServer = aServer;
-    iContactsDb = aCurrentDatabase;
-    PrepareParserL();
-
-    CActiveScheduler::Add(this);
-    }
-//------------------------------------------------------------
-// CCntParserCollector::CreateIrMCL2FileL(const TDesC& aFileName, TInt aMaxNumberOfContacts,TBool aForced)
-//------------------------------------------------------------
-TInt CCntParserCollector::CreateIrMCL2FileL(const TDesC& aFileName, TInt aMaxNumberOfContacts,TBool aForced)
-    {
-    LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL" );
-    LOGGER_WRITE_1( "CCntParserCollector::CreateIrMCL2FileL aFileName %S", &aFileName );
-
-    iMaxNumberOfContacts = aMaxNumberOfContacts;
-
-    CContactIdArray* changedItems;
-    TTime tTime;
-
-    LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL: Does the PB.VCF already exist" );
-
-    //Is there a previously created pb.vcf file?
-    RFile file;
-    TInt err = file.Open( iFsSession, aFileName, EFileShareExclusive ); //Open file
-    if( err == KErrNone )
-        {
-        LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL: Yes, when created" );
-        file.Modified(tTime);   //When modified
-        }
-    file.Close();
-
-    err = iWriter.Open( iFsSession, aFileName, EFileShareExclusive ); //Open stream
-    CleanupClosePushL( iWriter );   //Yes, this is a member variable, but it's considered
-
-    if( err == KErrPathNotFound )
-        {
-        LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL: dir did not exist, creating..." );
-        err = iFsSession.MkDir( aFileName );
-        LOGGER_WRITE_1( "CCntParserCollector MkDir returned %d", err );
-        if ( err == KErrNone )
-            {
-            LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL: New file after MkDir" );
-            //This is the situation that the file is created for the first time
-            User::LeaveIfError( iWriter.Create( iFsSession, aFileName, EFileShareExclusive ) );
-            LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL: New file created after MkDir" );
-            CleanupStack::Pop();    //iWriter
-            ParseCntDatabaseL(); //create IrMC L2 stuff
-            SaveTotalCountL();
-            return KErrNone;    //File created normally
-            }
-        }
-    if( err == KErrNotFound ) // file does not exist - create it
-        {
-        LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL: New file" );
-
-        //This is the situation that the file is created for the first time
-        User::LeaveIfError( iWriter.Create( iFsSession, aFileName, EFileShareExclusive ) );
-        LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL: New file created" );
-        CleanupStack::Pop();    //iWriter
-        ParseCntDatabaseL(); //create IrMC L2 stuff
-        SaveTotalCountL();
-        return KErrNone;    //File created normally
-        }
-    else
-        {
-        if( err != KErrNone )
-            {
-            LOGGER_WRITE_1( "CreateIrMCL2FileL errror leaving %d", err );
-            User::Leave(err);   
-            }
-        iWriter.Close();
-
-        LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL: File exists, any changes in CDB?" );
-        //The file exists, but are there any changes?
-
-        changedItems = iContactsDb->ContactsChangedSinceL( tTime ); //Create a contactidarray, user takes the ownership
-        CleanupStack::PushL(changedItems);
-
-        LOGGER_WRITE_1( "CreateIrMCL2FileL changedItems %d", changedItems->Count() );
-        LOGGER_WRITE_1( "CreateIrMCL2FileL aForced %d", aForced );
-        //Are there changes in any contact
-        if( changedItems->Count()!=0 || aForced || ContactCountChanged() )
-            {
-            LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL: Changes in CDB, replace existing PB.VCF" );
-
-            CleanupStack::PopAndDestroy(changedItems);
-
-            //Create pb.vcf
-            User::LeaveIfError( iWriter.Replace( iFsSession, aFileName, EFileShareExclusive) );
-            LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL: file replaced" );
-            CleanupStack::Pop();    //iWriter
-            ParseCntDatabaseL(); //create IrMC L2 stuff
-            SaveTotalCountL();
-            return KErrNone;    //File created normally
-            }
-
-        //No changes
-        CleanupStack::PopAndDestroy(changedItems);
-        CleanupStack::PopAndDestroy();
-
-        LOGGER_WRITE( "CntParserCollector: CreateIrMCL2FileL: No Changes in CDB, keep old PB.VCF" );
-        }   
-    return KPBNotUpdated;   //No error occured, KPBNotUpdated used as return value to tell that the file was not created..
-    }
-//------------------------------------------------------------
-// CCntParserCollector::ParseCntDatabaseL()
-//------------------------------------------------------------
-void CCntParserCollector::ParseCntDatabaseL()
-    {
-    LOGGER_WRITE( "CntParserCollector: ParseCntDatabaseL" );
-
-    iCurrentItem = 0;
-    iCancel = EFalse;
-    iContactsSaved = 0;
-
-    //Create owncard (it's always included, even if it's empty)
-
-    TFileName defaultDb;
-    CContactDatabase::GetDefaultNameL( defaultDb );
-    TFileName currentDb;
-    iContactsDb->GetCurrentDatabase( currentDb );
-
-    if( defaultDb.CompareF(currentDb) == 0 || currentDb == KNullDesC16 /*|| currentDb.CompareF(KSimDummyDatabase)==0*/) //Is current database also default?
-        {
-        LOGGER_WRITE( "CntParserCollector: ParseCntDatabaseL: Using default database" );
-        TContactItemId ownCardId = iContactsDb->OwnCardId();
-        ExternalizeCurrentContactL( iContactsDb, ownCardId, ETrue);
-        }
-    else
-        {
-        LOGGER_WRITE( "CntParserCollector: ParseCntDatabaseL: Not using default database" );
-        CContactDatabase* db=CContactDatabase::OpenL(); //My contact card is only in default db, so open it
-        CleanupStack::PushL(db);
-
-        TContactItemId ownCardId = db->OwnCardId();
-        ExternalizeCurrentContactL( db, ownCardId, ETrue );
-
-        CleanupStack::PopAndDestroy( db );
-        }
-
-    //Start running RunL method and create everything else..
-    TRequestStatus* s = &iStatus;
-    User::RequestComplete( s, KErrNone );
-    SetActive();
-    }
-//------------------------------------------------------------
-// CCntParserCollector::CloseResources()
-//------------------------------------------------------------
-void CCntParserCollector::CloseResources()
-    {
-    LOGGER_WRITE( "CntParserCollector: CloseResources: Closing resources (iWriter)" );
-    iWriter.Close();
-    }
-//------------------------------------------------------------
-// CCntParserCollector::PrepareParserL()
-//------------------------------------------------------------
-void CCntParserCollector::PrepareParserL()
-    {
-    LOGGER_WRITE( "CntParserCollector: PrepareParserL" );
-    iFilter = CCntFilter::NewL();   //Filter all contact cards out of others
-
-    iFilter->SetContactFilterTypeALL( EFalse );
-    iFilter->SetContactFilterTypeCard( ETrue );
-    iContactsDb->FilterDatabaseL( *iFilter );
-
-    iIds=iFilter->iIds; //Get IDs to filtered contacts
-    iCount=iIds->Count(); //Get number of contacts to be collected
-
-    User::LeaveIfError( iFsSession.Connect() ); //Connect to the file server
-    
-    LOGGER_WRITE_1( "CntParserCollector: PrepareParserL: iCount == %d", iCount);
-    }
-//------------------------------------------------------------
-// CCntParserCollector::RunL()
-//------------------------------------------------------------
-void CCntParserCollector::RunL()
-    {
-    //MaxNumberOfContacts-1 for OwnCard
-    if( iCurrentItem < iCount && (iCurrentItem < ( iMaxNumberOfContacts - 1 ) || iMaxNumberOfContacts == -1 ) ) //If no more contacts left or maximum number of contacts already parsed
-        {
-        ExternalizeCurrentContactL( iContactsDb, (*iIds)[iCurrentItem], EFalse );
-        iCurrentItem++;
-        TRequestStatus* s = &iStatus;       //Let's rerun this RunL method as soon as possible
-        User::RequestComplete( s, KErrNone );
-        SetActive();
-        return;
-        }
-    iCurrentItem++; //for OwnCard that is created separately
-    LOGGER_WRITE( "CntParserCollector: RunL: No more items" );
-    CloseResources();
-    iServer->CompletePhoneBookRequests( KErrNone );
-    }
-//------------------------------------------------------------
-// CCntParserCollector::ExternalizeCurrentContactL(CContactDatabase* aContactsDb,TInt aCurrentItem,TBool ExternalizeEmpty)
-//------------------------------------------------------------
-void CCntParserCollector::ExternalizeCurrentContactL(CContactDatabase* aContactsDb,TInt aCurrentItem,TBool ExternalizeEmpty)
-    {
-    CContactItem* ownCard;
-
-    if( aCurrentItem < 0 )
-        {
-        ownCard = CContactCard::NewLC();
-        }
-    else
-        {
-        ownCard = aContactsDb->ReadContactLC( aCurrentItem );   //Take a new contact item
-        }
-
-    CParserVCard* VCard=CParserVCard::NewL();   //Create new VCard
-    CleanupStack::PushL( VCard );
-
-    TInt nField = ownCard->CardFields().Find( KUidContactFieldGivenName );
-    TInt fField = ownCard->CardFields().Find( KUidContactFieldFamilyName );
-    TInt cField = ownCard->CardFields().Find( KUidContactFieldCompanyName );
-
-    //FOR NAMES
-    //N: -field always included even if it's empty
-    CDesC16Array* ValueArray=new (ELeave) CDesCArrayFlat(4);
-    CleanupStack::PushL( ValueArray );
-    CParserPropertyValueCDesCArray* NameValues=new (ELeave) CParserPropertyValueCDesCArray( ValueArray );
-    CleanupStack::PushL( NameValues );
-    CArrayPtr<CParserParam>* parameters=new (ELeave) CArrayPtrFlat<CParserParam>(1);
-    CleanupStack::PushL( parameters );
-
-    TPtrC fName;
-    TPtrC nName;
-    TPtrC cName;
-
-    if( fField != KErrNotFound )
-        {
-        fName.Set( ownCard->CardFields()[fField].TextStorage()->Text() );
-        }
-    if( nField != KErrNotFound )
-        {
-        nName.Set( ownCard->CardFields()[nField].TextStorage()->Text() );
-        }
-    if( cField != KErrNotFound )
-        {
-        cName.Set( ownCard->CardFields()[cField].TextStorage()->Text() );
-        }
-
-    if( fName.Length() == 0)
-        {
-        fField = KErrNotFound;  
-        }
-    if(nName.Length()==0)
-        {
-        nField = KErrNotFound;
-        if( fField==KErrNotFound )
-            {
-            ValueArray->AppendL( cName );   
-            }
-        else
-            {
-            ValueArray->AppendL( fName );   
-            }
-        }
-    else
-        {
-        ValueArray->AppendL( fName );
-        ValueArray->AppendL( nName );
-        }
-
-    VCard->AddPropertyL( CParserProperty::NewL((*NameValues),KNameProperty,parameters) );   //Add name property to VCard (VCard takes the ownership of the property)
-    CleanupStack::Pop(3); //parameters namevalues valuearray
-
-    TBool isNumber = EFalse;
-
-    TInt typeIndex = 0;
-    TInt index = -1;    //NOTE: +1 added before used first time
-
-    for(;;) //Go through all fields (Number of fields is unknown)
-        {
-        index = ownCard->CardFields().FindNext(typesToBeSearched[typeIndex],index+1);//Find next field (of current type)
-        if( index == KErrNotFound ) //No more phone numbers, move to the next group -> (See TypesToBeSearched)
-            {
-            typeIndex++;
-            if( typeIndex >= (signed) (sizeof(typesToBeSearched) / sizeof(TUid)) )
-                {
-                break;  //if no more types to search -> exit FOR-loop
-                }
-
-            index=ownCard->CardFields().FindNext(typesToBeSearched[typeIndex],0); //Find next field
-            if( index==KErrNotFound )
-                {
-                break;  //No fields -> exit
-                }
-            }
-
-        TPtrC number = ownCard->CardFields()[index].TextStorage()->Text();
-        if( number.Length() != 0)
-            {
-            CDesC16Array* ValueArray2=new (ELeave) CDesCArrayFlat(4);
-            CleanupStack::PushL( ValueArray2 );
-            CParserPropertyValueCDesCArray* NumberValues=new (ELeave) CParserPropertyValueCDesCArray(ValueArray2);
-            CleanupStack::PushL( NumberValues );
-            CArrayPtr<CParserParam>* parameters2=new (ELeave) CArrayPtrFlat<CParserParam>(1);
-            CleanupStack::PushL( parameters2 );
-
-            //Take label name to parameter
-
-            for( TInt i=0;i<ownCard->CardFields()[index].ContentType().FieldTypeCount();i++ )
-                {
-                TFieldType fieldType=ownCard->CardFields()[index].ContentType().FieldType(i);
-
-                if(fieldType==KUidContactFieldVCardMapWORK) parameters2->AppendL(CParserParam::NewL(KVersitParam8Work,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapHOME) parameters2->AppendL(CParserParam::NewL(KVersitParam8Home,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapMSG)  parameters2->AppendL(CParserParam::NewL(KVersitParam8Msg,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapVOICE)parameters2->AppendL(CParserParam::NewL(KVersitParam8Voice,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapFAX)  parameters2->AppendL(CParserParam::NewL(KVersitParam8Fax,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapPREF) parameters2->AppendL(CParserParam::NewL(KVersitParam8Pref,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapCELL) parameters2->AppendL(CParserParam::NewL(KVersitParam8Cell,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapPAGER)parameters2->AppendL(CParserParam::NewL(KVersitParam8Pager,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapBBS)  parameters2->AppendL(CParserParam::NewL(KVersitParam8Bbs,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapMODEM)parameters2->AppendL(CParserParam::NewL(KVersitParam8Modem,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapCAR)  parameters2->AppendL(CParserParam::NewL(KVersitParam8Car,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapISDN) parameters2->AppendL(CParserParam::NewL(KVersitParam8Isdn,KNullDesC8));
-                if(fieldType==KUidContactFieldVCardMapVIDEO)parameters2->AppendL(CParserParam::NewL(KVersitParam8Video,KNullDesC8));
-                }
-
-            ValueArray2->AppendL( number );
-            VCard->AddPropertyL(CParserProperty::NewL((*NumberValues),KTelProperty,parameters2)); //VCard takes the ownership of the property
-            isNumber=ETrue;
-
-            CleanupStack::Pop(3); //parameters2 numbervalues valuearray2
-            }
-        }
-
-    if( (nField!=KErrNotFound) || (fField!=KErrNotFound) || (cField!=KErrNotFound) || isNumber || ExternalizeEmpty )
-        {
-        if( !isNumber )
-            {
-            //Create empty TEL field (required by the specs)
-
-            CDesC16Array* ValueArray3=new (ELeave) CDesCArrayFlat(4);
-            CleanupStack::PushL(ValueArray3);
-            CParserPropertyValueCDesCArray* NumberValues2=new (ELeave) CParserPropertyValueCDesCArray(ValueArray3);
-            CleanupStack::PushL(NumberValues2);
-            CArrayPtr<CParserParam>* parameters3=new (ELeave) CArrayPtrFlat<CParserParam>(1);
-            CleanupStack::PushL(parameters3);
-
-            VCard->AddPropertyL(CParserProperty::NewL((*NumberValues2),KTelProperty,parameters3)); //VCard takes the ownership of the property
-
-            CleanupStack::Pop(3); //parameters3 numbervalues valuearray3
-            }
-
-        TRAPD( err, VCard->ExternalizeL( iWriter );) //If there are no name or numbers, then no externalizing..
-        //if error then only current contact card is discarded, but others will be still collected..
-        if( err == KErrNone )
-            {
-            iContactsSaved++;
-            }
-        else
-            {
-            LOGGER_WRITE( "CntParserCollector: RunL: Error,VCARD _NOT_ saved" );
-            }
-        }
-
-    aContactsDb->CloseContactL( aCurrentItem ); //Close current contact item
-
-    CleanupStack::PopAndDestroy( VCard ); // VCard and all arrays (parameters2, numvervalues, valuearray2) related to this VCard are deleted through the ownership relations
-    CleanupStack::PopAndDestroy( ownCard );
-    }
-//------------------------------------------------------------
-// CCntParserCollector::DoCancel()
-//------------------------------------------------------------
-void CCntParserCollector::DoCancel()
-    {
-    LOGGER_WRITE( "CntParserCollector: DoCancel" );
-    CloseResources();
-    }
-//------------------------------------------------------------
-// CCntParserCollector::RunError(TInt aError)
-//------------------------------------------------------------
-TInt CCntParserCollector::RunError( TInt aError )
-    {
-    LOGGER_WRITE( "CntParserCollector: RunError!" );
-    CloseResources(); //JIC
-
-    iServer->CompletePhoneBookRequests( aError );   //complete all requests with an error
-    return KErrNone;
-    }
-//------------------------------------------------------------
-// CCntParserCollector::CurrentItem()
-//------------------------------------------------------------
-TInt CCntParserCollector::CurrentItem()
-    {
-    return iCurrentItem;
-    }
-//------------------------------------------------------------
-// CCntParserCollector::Count()
-//------------------------------------------------------------
-TInt CCntParserCollector::Count()
-    {
-    return iCount;
-    }
-//------------------------------------------------------------
-// CCntParserCollector::ContactsSaved()
-//------------------------------------------------------------
-TInt CCntParserCollector::ContactsSaved()
-    {
-    return iContactsSaved;
-    }
-//------------------------------------------------------------
-// CCntParserCollector::SaveTotalCountL() const
-//------------------------------------------------------------
-void CCntParserCollector::SaveTotalCountL()
-    {
-    LOGGER_WRITE( "CntParserCollector: SaveTotalCount begin" );
-        
-    if( iContactsDb )
-        {
-        iTotalCount = iContactsDb->CountL();
-        LOGGER_WRITE_1( "CntParserCollector: SaveTotalCount iTotalCount %d", iTotalCount );
-        }
-        
-    RFs Fs;
-    RFile writer;
-    User::LeaveIfError(Fs.Connect());   //Connect to the file server
-    CleanupClosePushL(Fs);
-    
-    User::LeaveIfError(Fs.CreatePrivatePath( EDriveC ));
-    User::LeaveIfError(Fs.SetSessionToPrivate( EDriveC ));
-    
-    User::LeaveIfError(writer.Replace(Fs,KTotalCountFilePath,EFileWrite)); //Open file
-    CleanupClosePushL(writer);
-    LOGGER_WRITE( "CntParserCollector: SaveTotalCount file replaced" );
-    
-    // Prepare externalized representation of iTotalCount
-    TBuf8< 256 > countData;
-    RDesWriteStream writeStream( countData );
-    CleanupClosePushL( writeStream );
-    writeStream.WriteInt32L( iTotalCount );
-    writeStream.CommitL();
-    CleanupStack::PopAndDestroy( &writeStream );
-    
-    // Then write them to the file itself
-    User::LeaveIfError(writer.Write( countData ));
-
-    CleanupStack::PopAndDestroy();  //writer
-    CleanupStack::PopAndDestroy();  //Fs
-    
-    LOGGER_WRITE( "CntParserCollector: SaveTotalCount end" );
-    }
-//------------------------------------------------------------
-// CCntParserCollector::ReadTotalCountL() const
-//------------------------------------------------------------
-TInt CCntParserCollector::ReadTotalCountL() const
-    {
-    LOGGER_WRITE( "CntParserCollector: ReadTotalCount begin" );
-    TInt total;
-    RFs Fs;
-    RFile reader;
-    User::LeaveIfError(Fs.Connect());   //Connect to the file server
-    CleanupClosePushL(Fs);
-    
-    User::LeaveIfError(Fs.CreatePrivatePath( EDriveC ));
-    User::LeaveIfError(Fs.SetSessionToPrivate( EDriveC ));
-        
-    User::LeaveIfError(reader.Open(Fs,KTotalCountFilePath,EFileRead)); //Open file
-    CleanupClosePushL(reader);
-    LOGGER_WRITE( "CntParserCollector: ReadTotalCount file opened" );
-        
-    RFileReadStream readStream(reader);
-    readStream.PushL();
-
-    total = readStream.ReadInt32L();
-    
-    LOGGER_WRITE_1( "CntParserCollector: ReadTotalCount total %d", total );
-    
-    CleanupStack::PopAndDestroy();  //readStream
-    CleanupStack::PopAndDestroy();  //writer
-    CleanupStack::PopAndDestroy();  //Fs
-    LOGGER_WRITE( "CntParserCollector: ReadTotalCount end" );
-    return total;
-    }
-//------------------------------------------------------------
-// CCntParserCollector::ContactCountChanged() const
-//------------------------------------------------------------
-TBool CCntParserCollector::ContactCountChanged()
-    {
-    LOGGER_WRITE( "CntParserCollector: ContactCountChanged begin" );
-    TInt oldCount = 0;
-    TInt err( KErrNone );
-    
-    if( iContactsDb )
-        {
-        TRAP( err, iTotalCount = iContactsDb->CountL() );
-        if ( err != KErrNone )
-            {
-            LOGGER_WRITE_1( "iContactsDb->CountL leaved: %d", err );
-            LOGGER_WRITE( "CntParserCollector: ContactCountChanged ETrue" );
-            return ETrue;
-            }
-        LOGGER_WRITE_1( "CntParserCollector: ContactCountChanged iTotalCount %d", iTotalCount );
-        }
-    
-    TRAP( err, oldCount = ReadTotalCountL() );
-
-    LOGGER_WRITE_1( "CntParserCollector: ContactCountChanged err %d", err );
-    LOGGER_WRITE_1( "CntParserCollector: ContactCountChanged oldCount %d", oldCount );
-    LOGGER_WRITE_1( "CntParserCollector: ContactCountChanged iTotalCount %d", iTotalCount );
-    
-    if( err == KErrNone )
-        {
-        if( iTotalCount != oldCount )
-            {
-            LOGGER_WRITE( "CntParserCollector: ContactCountChanged ETrue" );
-            return ETrue;
-            }
-        else
-            {
-            LOGGER_WRITE( "CntParserCollector: ContactCountChanged EFalse" );
-            return EFalse;
-            }
-        }
-    else
-        {
-        LOGGER_WRITE( "CntParserCollector: ContactCountChanged ETrue" );
-        return ETrue;               
-        }
-    }
-    
-// end of file
--- a/connectivitymodules/SeCon/cntparser/src/cntparserinfolog.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* Copyright (c) 2002-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:  CCntParserInfoLog implementation.
-*
-*/
-
-
-#include <s32strm.h>
-#include <f32file.h>
-#include <s32file.h>
-
-#include "cntparserinfolog.h"
-
-_LIT8(KNewLine,"\r\n");
-
-_LIT8(KMaxRecords,"Maximum-Records:");
-_LIT8(KTotalRecords,"Total-Records:");
-
-//------------------------------------------------------------
-// CCntParserInfoLog::CCntParserInfoLog()
-//------------------------------------------------------------
-CCntParserInfoLog::CCntParserInfoLog()
-    {
-    }
-
-//------------------------------------------------------------
-// CCntParserInfoLog::~CCntParserInfoLog()
-//------------------------------------------------------------
-CCntParserInfoLog::~CCntParserInfoLog()
-    {
-    }
-
-//------------------------------------------------------------
-// CCntParserInfoLog::CCntParserInfoLog::NewL()
-//------------------------------------------------------------
-EXPORT_C CCntParserInfoLog* CCntParserInfoLog::NewL()
-    {
-    CCntParserInfoLog* self=new (ELeave) CCntParserInfoLog();
-    return self;
-    }
-
-//------------------------------------------------------------
-// CCntParserInfoLog::SaveToFileL(const TDesC& aFileName) const
-//------------------------------------------------------------
-EXPORT_C void CCntParserInfoLog::SaveToFileL( const TDesC& aFileName ) const
-    {
-    TInt err = KErrNone;
-    RFs Fs;
-    RFile writer;
-    User::LeaveIfError( Fs.Connect() ); //Connect to the file server
-    CleanupClosePushL( Fs );
-    err = writer.Replace( Fs, aFileName, EFileWrite ); //Open file
-    CleanupClosePushL( writer );
-    
-    if( err == KErrNone )
-        {
-        writer.Write( KMaxRecords );
-        
-        TBuf8<16> numVal;
-        numVal.Num( iMaximumRecords );
-        writer.Write( numVal );
-        
-        writer.Write( KNewLine );
-        
-        writer.Write( KTotalRecords );
-        
-        TBuf8<16> numVal2;
-        numVal2.Num( iTotalRecords );
-        writer.Write( numVal2 );
-        }
-    
-    CleanupStack::PopAndDestroy();  //writer
-    CleanupStack::PopAndDestroy();  //Fs
-    }
-
-//------------------------------------------------------------
-// CCntParserInfoLog::SetTotalRecords(TInt aTotalRecords)
-//------------------------------------------------------------
-EXPORT_C void CCntParserInfoLog::SetTotalRecords(TInt aTotalRecords)
-    {
-    iTotalRecords = aTotalRecords;
-    }
-
-//------------------------------------------------------------
-// CCntParserInfoLog::SetMaximumRecords(TInt aMaximumRecords)
-//------------------------------------------------------------
-EXPORT_C void CCntParserInfoLog::SetMaximumRecords(TInt aMaximumRecords)
-    {
-    iMaximumRecords = aMaximumRecords;
-    }
-
-//------------------------------------------------------------
-// CCntParserInfoLog::TotalRecords() const
-//------------------------------------------------------------
-EXPORT_C TInt CCntParserInfoLog::TotalRecords() const
-    {
-    return iTotalRecords;
-    }
-
-//------------------------------------------------------------
-// CCntParserInfoLog::MaximumRecords() const
-//------------------------------------------------------------
-EXPORT_C TInt CCntParserInfoLog::MaximumRecords() const
-    {
-    return iMaximumRecords;
-    }
-    
-// end of file
--- a/connectivitymodules/SeCon/cntparser/src/cntparserserverexe.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,322 +0,0 @@
-/*
-* Copyright (c) 2002-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:  CCntParserServer implementation.
-*
-*/
-
-
-#include "clientserver.h"
-#include "cntparserserver.h"
-#include "cntparserserversession.h"
-#include "irmcconsts.h"
-
-#include "debug.h"
-
-#include <cntdb.h>
-
-//------------------------------------------------------------
-// RunServer
-//------------------------------------------------------------
-TInt CCntParserServer::RunServer()
-	{
-	LOGGER_ENTERFN( "CCntParserServer::RunServer" );
-	
-	CTrapCleanup* cleanup = CTrapCleanup::New();
-	TInt ret( KErrNoMemory );
-	if( cleanup )
-		{
-		TRAP( ret, CCntParserServer::RunServerL() );
-		delete cleanup;
-		}
-	if( ret != KErrNone )
-		{
-		// Signal the client that server creation failed
-		RProcess::Rendezvous( ret );
-		}
-	LOGGER_LEAVEFN( "CCntParserServer::RunServer" );
-	return ret;
-	}
-//------------------------------------------------------------
-// RunServerL
-//------------------------------------------------------------
-void CCntParserServer::RunServerL()
-	{
-	// Create and install the active scheduler we need
-	LOGGER_ENTERFN( "CCntParserServer::RunServerL" );
-	CActiveScheduler *as=new (ELeave)CActiveScheduler;
-	CleanupStack::PushL( as );
-	CActiveScheduler::Install( as );
-
-	// Create server
-	CCntParserServer::NewL();
-
-	// Initialisation complete, now signal the client
-	User::LeaveIfError( RThread().RenameMe( KTxtServer ) );
-	RProcess::Rendezvous( KErrNone );
-
-	// Ready to run
-	CActiveScheduler::Start();
-
-	// Cleanup the scheduler
-	CleanupStack::PopAndDestroy( as );
-	LOGGER_LEAVEFN( "CCntParserServer::RunServerL" );
-	}
-//------------------------------------------------------------
-// E32Main()
-//------------------------------------------------------------
-TInt E32Main()
-	{
-	return CCntParserServer::RunServer();
-	}
-//------------------------------------------------------------
-// PanicServer(TCntParserServerPanic aPanic)
-//------------------------------------------------------------
-GLDEF_C void PanicServer(TCntParserServerPanic aPanic)
-	{
-	LOGGER_WRITE( "PANIC SERVER!" );
-	_LIT(KTxtServerPanic,"Parser server panic");
-	User::Panic( KTxtServerPanic, aPanic );
-	}
-
-
-//**********************************
-//CCntParserServer
-//**********************************
-
-//------------------------------------------------------------
-// CCntParserServer::CCntParserServer()
-//------------------------------------------------------------
-CCntParserServer::CCntParserServer() : CServer2( EPriorityStandard )
-	{
-	}
-//------------------------------------------------------------
-// CCntParserServer::~CCntParserServer()
-//------------------------------------------------------------
-EXPORT_C CCntParserServer::~CCntParserServer()
-	{
-	if( iCollector )
-	    {
-	    iCollector->Cancel();
-	    }
-	delete iCollector;
-	delete iCurrentDatabase;
-	LOGGER_WRITE( "CntParserServer: DELETED!" );
-	}
-//------------------------------------------------------------
-// CCntParserServer* CCntParserServer::NewL()
-//------------------------------------------------------------
-EXPORT_C CCntParserServer* CCntParserServer::NewL()
-	{
-	LOGGER_WRITE( "CntParserServer: NEW" );
-	CCntParserServer* pS=new (ELeave) CCntParserServer();
-	CleanupStack::PushL(pS);
-	pS->StartL( KCntParserName );
-	CleanupStack::Pop( pS );
-	LOGGER_WRITE( "CntParserServer: Created" );
-	return pS;
-	}
-//------------------------------------------------------------
-// CCntParserServer::NewSessionL(const TVersion &aVersion, const RMessage2& /*aMsg*/) const
-//------------------------------------------------------------
-CSession2* CCntParserServer::NewSessionL(const TVersion &aVersion, const RMessage2& /*aMsg*/) const
-	{
-	LOGGER_WRITE( "CntParserServer: NEW SessionL" );
-	// check we're the right version
-	TVersion v( KCntParserMajorVersionNumber,KCntParserMinorVersionNumber,KCntParserBuildVersionNumber );
-	if ( !User::QueryVersionSupported( v,aVersion ) )
-		User::Leave( KErrNotSupported );
-	CCntParserServerSession* self=CCntParserServerSession::NewL( (CCntParserServer*)this );
-	return self;
-	}
-//------------------------------------------------------------
-// CCntParserServer::IncreaseSessionCountL()
-//------------------------------------------------------------
-void CCntParserServer::IncreaseSessionCountL()
-	{
-	LOGGER_WRITE( "CntParserServer: Increase Session Count" );
-	iSessionCount++;
-	if( iSessionCount == 1 )	//If first session, prepare collector
-		{
-		PrepareCollectorL();
-		}
-	}
-//------------------------------------------------------------
-// CCntParserServer::DecreaseSessionCount()
-//------------------------------------------------------------
-void CCntParserServer::DecreaseSessionCount()
-	{
-	LOGGER_WRITE( "CntParserServer: Decrease Session Count" );
-	iSessionCount--;
-	if( iSessionCount==0 )	//if last session is disconnected, delete server
-		{
-		Stop();
-		}
-	}
-//------------------------------------------------------------
-// CCntParserServer::ContactsParsed()
-//------------------------------------------------------------
-TInt CCntParserServer::ContactsParsed()
-	{
-	return iCollector->CurrentItem();
-	}
-//------------------------------------------------------------
-// CCntParserServer::TotalNumOfContacts()
-//------------------------------------------------------------
-TInt CCntParserServer::TotalNumOfContacts()	
-	{
-	//After the PrepareCollector is called, the number of contacts can be returned
-	return iCollector->Count();
-	}
-//------------------------------------------------------------
-// CCntParserServer::ContactsSaved()
-//------------------------------------------------------------
-TInt CCntParserServer::ContactsSaved()
-	{
-	return iCollector->ContactsSaved();
-	}
-//------------------------------------------------------------
-// CCntParserServer::PrepareCollectorL()
-//------------------------------------------------------------
-void CCntParserServer::PrepareCollectorL()
-	{
-	LOGGER_WRITE( "CntParserServer: Prepare collectorL: Open Contact Database" );
-
-	TFileName dbFile;
-	TFileName defaultDb;
-  
-	CContactDatabase::GetDefaultNameL( defaultDb );
-	
-	LOGGER_WRITE( "CntParserServer: Prepare collectorL: GetDefault" );
-
-	iCurrentDatabase=CContactDatabase::OpenL();
-	
-	LOGGER_WRITE( "CntParserServer: Prepare collectorL: OpenDefault" );
-
-	iCurrentDatabase->GetCurrentDatabase( dbFile );	//Get selected database
-
-	LOGGER_WRITE( "CntParserServer: Prepare collectorL: CompareDefault" );
-
-	if( dbFile.CompareF(defaultDb)!=0 && dbFile!=KNullDesC16 /*&& dbFile.CompareF(KSimDummyDatabase)!=0*/)	//If the selected database is not the default and something is selected
-		{
-		LOGGER_WRITE( "CntParserServer: Prepare collectorL: Close Default" );
-		delete iCurrentDatabase;
-		iCurrentDatabase = NULL;
-
-		LOGGER_WRITE( "CntParserServer: Prepare collectorL: OpenSelected" );
-		iCurrentDatabase=CContactDatabase::OpenL( dbFile );	//open the selected one
-		}
-
-	LOGGER_WRITE( "CntParserServer: Prepare collectorL: Is everything ok?" );
-	if( !iCurrentDatabase )
-		{
-		User::Leave( KErrNotFound );	
-		}
-
-	LOGGER_WRITE( "CntParserServer: Prepare collectorL: Create Collector" );
-	iCollector = CCntParserCollector::NewL( this,iCurrentDatabase );
-
-	iRequests = 0;
-	}
-//------------------------------------------------------------
-// CCntParserServer::CreateIrMCL2PhoneBookL()
-//------------------------------------------------------------
-TInt CCntParserServer::CreateIrMCL2PhoneBookL(const TDesC& path, TInt aMaxNumberOfContacts,TBool aForced)
-	{
-	LOGGER_WRITE( "CntParserServer: CreateIrMCL2PhoneBookL" );
-
-	TInt err( KErrNone );
-
-	iRequests++;
-	if( iRequests == 1 )
-		{
-		LOGGER_WRITE( "CntParserServer: CreateIrMCL2PhoneBookL: Ready to call collector" );
-
-		err = iCollector->CreateIrMCL2FileL( path,aMaxNumberOfContacts,aForced );
-		if( err==KPBNotUpdated ) 
-			{
-			iRequests = 0;	//If the file exists (no parsing), then more requests can be made	
-			}
-		}
-	else
-		{
-		return KErrNotReady;	
-		}
-	return err;
-	}
-//------------------------------------------------------------
-// CCntParserServer::CompletePhoneBookRequests()
-//------------------------------------------------------------
-void CCntParserServer::CompletePhoneBookRequests(TInt aErr)	//Goes through all the sessions and completes the request
-	{
-	LOGGER_WRITE( "CntParserServer: Complete phonebook request" );
-	iSessionIter.SetToFirst();
-	while( iSessionIter )	//Go through all sessions
-		{
-		( (CCntParserServerSession*) (iSessionIter++) )->CompletePhoneBookRequest( aErr );
-		}
-	iRequests = 0;	//Collector is ready to start again..
-	}
-//------------------------------------------------------------
-// CCntParserServer::CancelPhoneBookRequest()
-//------------------------------------------------------------
-void CCntParserServer::CancelPhoneBookRequest()
-	{
-	if( iRequests == 1 )
-		{
-		iCollector->Cancel();
-		}
-	iRequests--;
-	}
-//------------------------------------------------------------
-// CCntParserServer::CancelAllPhoneBookRequests()
-//------------------------------------------------------------
-void CCntParserServer::CancelAllPhoneBookRequests()
-	{
-	iCollector->Cancel();
-	iRequests = 0;
-	}
-//------------------------------------------------------------
-// CCntParserServer::Disconnect()
-//------------------------------------------------------------
-void CCntParserServer::Disconnect()
-	{
-	LOGGER_WRITE( "CntParserServer: Disconnect" );
-	}
-//------------------------------------------------------------
-// CCntParserServer::Stop()
-//------------------------------------------------------------
-void CCntParserServer::Stop()
-	{
-	LOGGER_ENTERFN( "CntParserServer::Stop()" );
-	if( iCollector )
-	    {
-	    iCollector->Cancel();
-	    }
-	delete iCollector;
-	iCollector = NULL;
-	delete iCurrentDatabase;
-	iCurrentDatabase = NULL;
-	CActiveScheduler::Stop();
-	LOGGER_LEAVEFN( "CntParserServer::Stop()" );
-	}
-//------------------------------------------------------------
-// CCntParserServer::SetRequests()
-//------------------------------------------------------------
-void CCntParserServer::SetRequests(TInt aRequests)
-	{
-	iRequests=aRequests;
-	}
-
-
-
--- a/connectivitymodules/SeCon/cntparser/src/cntparserserversession.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-/*
-* Copyright (c) 2002-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:  CCntParserServerSession implementation.
-*
-*/
-
-
-#include "cntparserserversession.h"
-#include <cntdb.h>
-#include "cntparsercollector.h"
-#include "cntparserinfolog.h"
-#include "irmcconsts.h"
-
-#include "debug.h"
-
-//------------------------------------------------------------
-// CCntParserServerSession::CCntParserServerSession()
-//------------------------------------------------------------
-CCntParserServerSession::CCntParserServerSession()
-    {
-    }
-//------------------------------------------------------------
-// CCntParserServerSession::NewL(CCntParserServer* aServer)
-//------------------------------------------------------------
-CCntParserServerSession* CCntParserServerSession::NewL( CCntParserServer* aServer )
-    {
-    LOGGER_ENTERFN( "CntParserServerSession::NewL()" );
-
-    CCntParserServerSession* self = new( ELeave ) CCntParserServerSession();
-    CleanupStack::PushL( self );
-    self->ConstructL( aServer );
-    CleanupStack::Pop( self );
-    LOGGER_LEAVEFN( "CntParserServerSession::NewL()" );
-    return self;
-    }
-//------------------------------------------------------------
-// CCntParserServerSession::ConstructL( CCntParserServer* aServer )
-//------------------------------------------------------------
-void CCntParserServerSession::ConstructL( CCntParserServer* aServer )
-    {
-    iContactsParserSrv = aServer;
-    iContactsParserSrv->IncreaseSessionCountL();
-    }
-//------------------------------------------------------------
-// CCntParserServerSession::~CCntParserServerSession()
-//------------------------------------------------------------
-CCntParserServerSession::~CCntParserServerSession()
-    {
-    LOGGER_ENTERFN( "CntParserServerSession::~CCntParserServerSession()" );
-    if ( iContactsParserSrv )
-        {
-        iContactsParserSrv->DecreaseSessionCount();
-        }
-    LOGGER_LEAVEFN( "CntParserServerSession::~CCntParserServerSession()" );
-    }
-//------------------------------------------------------------
-// CCntParserServerSession::ServiceL( const RMessage2& aMessage )
-//------------------------------------------------------------
-void CCntParserServerSession::ServiceL( const RMessage2& aMessage )
-    {
-    LOGGER_WRITE( "CntParserServerSession: ServiceL" );
-
-    TInt err( KErrNone );
-    TInt ret( KErrNone );
-
-    TRAP( err, ret = DispatchMessageL( aMessage ) );
-
-    if ( err != KErrNone )
-        {
-        LOGGER_WRITE_1( "CntParserServerSession: ServiceL: Error trapped, complete with ERR code %d", err );
-
-        iPhoneBookRequest = EFalse; //If requested, then clear request flag
-        iContactsParserSrv->SetRequests( 0 );   //Reset requests count in server to allow new requests to start..
-        aMessage.Complete( err ); //If trap error, complete with it
-        return;
-        }   
-
-    if ( ret == KErrNone )
-        {
-        LOGGER_WRITE( "CntParserServerSession: ServiceL: No complete" );
-        return;
-        }
-
-    if ( ret == KPerformComplete )
-        {
-        LOGGER_WRITE( "CntParserServerSession: ServiceL: Normal complete" );
-
-        aMessage.Complete( KErrNone );
-        return;
-        }
-
-    if ( ret == KPBNotUpdated )
-        {
-        LOGGER_WRITE( "CntParserServerSession: ServiceL: Complete (PB not updated)" );
-
-        iPhoneBookRequest = EFalse;
-        aMessage.Complete( KPBNotUpdated );
-        return;
-        }
-    LOGGER_WRITE( "CntParserServerSession: ServiceL: Error, should never come here" );
-    aMessage.Complete( KErrGeneral );
-    }
-//------------------------------------------------------------
-// CCntParserServerSession::CompletePhoneBookRequest( TInt aErr )
-//------------------------------------------------------------
-void CCntParserServerSession::CompletePhoneBookRequest( TInt aErr )
-    {
-    LOGGER_WRITE( "CntParserServerSession: CompletePhoneBookRequest" );
-
-    if ( iPhoneBookRequest ) //If this session has requested phonebook, then the completion should be done here, as it was not done in ServiceL
-        {
-        LOGGER_WRITE( "CntParserServerSession: CompletePhoneBookRequest: collector or cancel" );
-        iPhoneBookRequest = EFalse;
-        iPhoneBookRequestMessage.Complete( aErr );
-        }
-    else
-        {
-        LOGGER_WRITE( "CntParserServerSession: CompletePhoneBookRequest: No complete for this session" );
-        }
-    }
-//------------------------------------------------------------
-// CCntParserServerSession::DispatchMessageL( const RMessage2 &aMessage )
-//------------------------------------------------------------
-TInt CCntParserServerSession::DispatchMessageL( const RMessage2 &aMessage )
-    {
-    LOGGER_WRITE( "CntParserServerSession: DispatchMessageL" );
-
-    TInt res( KPerformComplete );
-
-    switch( aMessage.Function() )
-        {
-        case ECntParserServerCreateIrMCL2:  //Create pb.vcf file
-            {
-            res = ETrue;
-
-            if ( iPhoneBookRequest == EFalse )
-                {
-                iPhoneBookRequestMessage = aMessage;
-                iPhoneBookRequest = ETrue;
-
-                TInt sid=aMessage.SecureId();
-                TInt MaxNumOfContacts = aMessage.Int0();
-                TBool Forced = aMessage.Int1();
-                TBuf<8> sidLit;
-                sidLit.AppendNumFixedWidth( sid, EHex, 8);
-                TBuf<255> path;
-                path.Insert( 0, KPhoneBookFilename );
-
-                res = iContactsParserSrv->CreateIrMCL2PhoneBookL( path, (TInt) MaxNumOfContacts, Forced );
-                }
-            break;
-            }
-        case ECntParserServerCntParsed: //How many contacts already parsed
-            {
-            TPckgBuf<TInt> p((TInt) iContactsParserSrv->ContactsParsed());
-            aMessage.WriteL( 0, p, 0 );
-            break;
-            }
-        case ECntParserServerTotalNumOfContacts: //How many contacts total?
-            {
-            TPckgBuf<TInt> p((TInt) iContactsParserSrv->TotalNumOfContacts());
-            aMessage.WriteL( 0, p, 0 );
-            break;
-            }
-        case ECntParserServerDisconnect:    //Disconnect session from server
-            {
-            iContactsParserSrv->Disconnect();
-            break;
-            }
-        case ECntParserServerCancel:    //Cancel phone book request
-            {
-            if (iPhoneBookRequest)
-                {
-                iContactsParserSrv->CancelPhoneBookRequest();
-                CompletePhoneBookRequest( KErrCancel );
-                }
-            break;
-            }
-        case ECntParserServerCntSaved: //How many contacts total?
-            {
-            TPckgBuf<TInt> p((TInt) iContactsParserSrv->ContactsSaved());
-            aMessage.WriteL( 0, p, 0 );
-            break;
-            }
-        case ECntParserServerCancelAll: //Cancel all requests, not just current?
-            {
-            iContactsParserSrv->CancelAllPhoneBookRequests();
-            break;
-            }
-        // requests we don't understand
-        // so panic the client here, this function also completes the message
-        default:
-            {
-            PanicClient( EBadRequest );
-            break;
-            }
-        }
-    return res;
-    }
-//------------------------------------------------------------
-// CCntParserServerSession::PanicClient(TInt aPanic) const
-//------------------------------------------------------------
-void CCntParserServerSession::PanicClient(TInt aPanic) const
-    {
-    User::Panic( KTxtServer,aPanic );
-    }
-    
-// end of file
--- a/connectivitymodules/SeCon/common/conmltask/inc/sconconmltask.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,600 +0,0 @@
-/*
-* Copyright (c) 2005-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:  Header file for ConML tasks
-*
-*/
-
-
-#ifndef _SCONCONMLTASK_H_
-#define _SCONCONMLTASK_H_
-
-#include <e32base.h>
-#include <f32file.h>
-
-const TInt KSConTaskPartiallyCompleted( 206 );
-const TInt KMaxPackageNameLength = 128;
-
-enum TSConMethodName
-    {
-    ECancel = 0,
-    EGetDataOwnerStatus,
-    EGetDataSize,
-    EGetStatus,
-    EInstall,
-    EListDataOwners,
-    EListInstalledApps,
-    EListPublicFiles,
-    ERequestData,
-    ESetBURMode,
-    ESetInstParams,
-    ESupplyData,
-    EUninstall,
-    EUpdateDeviceInfo,
-    EReboot,
-    EGetMetadata
-    };
-
-enum TSConInstallMode
-    {
-    ESilentInstall = 0,
-    EUnsilentInstall,
-    EUnknown
-    };
-    
-enum TSConUserPerm
-    {
-    EPermReadOnly = 0,
-    EPermNormal
-    };
-    
-enum TSConDOType
-    {
-    EActiveDataOwner = 1,
-    EPassiveDataOwner,
-    EHybridDataOwner
-    };
-    
-enum TSConHasFiles
-    {
-    ENoFiles = 0,
-    EPublicFiles,
-    ESystemFiles,
-    EPublicSystemFiles
-    };
-    
-enum TSConAppType
-    {
-    ESisApplication = 0,
-    ESisAugmentation,
-    EJavaApplication,
-    EWidgetApplication
-    };
-
-enum TSConBurMode
-    {
-    ESConBurNormal = 1,     // 1 BUR mode - normal
-    ESConBurBackupFull,     // 2 BUR mode – backup full
-    ESConBurBackupPartial,  // 3 BUR mode – backup partial
-    ESConBurRestoreFull,    // 4 BUR mode – restore full
-    ESConBurRestorePartial  // 5 BUR mode – restore partial
-    };
-
-enum TSConIncType
-    {
-    ESConNoBackup = 0,          // 0   No backup
-    ESConBackupBase = 100,      // 100 Backup – base
-    ESConBackupIncrement = 200  // 200 Backup - increment
-    };
-
-enum TSConTransferDataType
-    {
-    ESConRegistrationData = 1,  // 1 RegistrationData
-    ESConPassiveSnapshotData,   // 2 Passive snapshot data
-    ESConPassiveBaseData,       // 3 Passive base data
-    ESConPassiveIncrementalData,// 4 Passive incremental data 
-    ESConActiveSnapshotData,    // 5 Active snapshot data
-    ESConActiveBaseData,        // 6 Active base data
-    ESConActiveIncrementalData, // 7 Active incremental data
-    ESConSystemData,            // 8 System data
-    ESConSystemSnapshotData     // 9 System snapshot data
-    };
-
-enum TSConDataOwnerStatus
-    {
-    ESConUnset = 0,         // 0 Unset
-    ESConNotFound,          // 1 Not found
-    ESConReady,             // 2 Ready
-    ESConNotReady,          // 3 Not ready
-    ESConFailed,            // 4 Failed
-    ESConNotConnected,      // 5 Not connected
-    ESConNotImplemented     // 6 Not implemented
-    };
-
-
-
-
-//============================================================
-// class CSConReboot declaration
-//============================================================  
-NONSHARABLE_CLASS( CSConReboot ) : public CBase
-    {
-    public:
-        CSConReboot();      
-        ~CSConReboot();
-        CSConReboot* CopyL();
-                    
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress     
-    };
-
-//============================================================
-// class CSConDataOwner declaration
-//============================================================  
-NONSHARABLE_CLASS( CSConDataOwner ) : public CBase
-    {
-    public:
-        CSConDataOwner();
-        ~CSConDataOwner();
-        CSConDataOwner* CopyL();
-    
-    public:
-        //dataowner type
-        TSConDOType                     iType;
-        //unique identifier
-        TUid                            iUid;
-        //drive list
-        TDriveList                      iDriveList;
-        //package name
-        TBuf<KMaxPackageNameLength>     iPackageName;
-        //requires reboot
-        TBool                           iReqReboot;
-        //has files 
-        TSConHasFiles                   iHasFiles;
-        //supports incremental backup
-        TBool                           iSupportsInc;
-        //supports selective backup
-        TBool                           iSupportsSel;
-        //delay to prepare data
-        TBool                           iDelayToPrep;
-        //size
-        TUint                           iSize;
-        //data owner status
-        TSConDataOwnerStatus            iDataOwnStatus;
-        //transfer data type
-        TSConTransferDataType           iTransDataType;
-        //Java hash
-        HBufC*                          iJavaHash;
-    };
-        
-//============================================================
-// class CSConUpdateDeviceInfo declaration
-//============================================================      
-NONSHARABLE_CLASS( CSConUpdateDeviceInfo ) : public CBase
-    {
-    public:
-        CSConUpdateDeviceInfo();
-        ~CSConUpdateDeviceInfo();
-        CSConUpdateDeviceInfo* CopyL();
-
-        TBuf8<3>            iVersion;       //version number
-        TBool               iInstallSupp;
-        TBool               iUninstallSupp;
-        TBool               iInstParamsSupp;
-        TBool               iInstAppsSupp;
-        TBool               iDataOwnersSupp;
-        TBool               iSetBURModeSupp;
-        TBool               iGetSizeSupp;
-        TBool               iReqDataSupp;
-        TBool               iSupplyDataSupp;
-        TBool               iRebootSupp;
-        TInt                iMaxObjectSize; //kBytes
-        
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress     
-    };
-//============================================================
-// class CSConInstApp declaration
-//============================================================      
-NONSHARABLE_CLASS( CSConInstApp ) : public CBase 
-    {
-    public:
-        CSConInstApp() {};
-        ~CSConInstApp();
-        CSConInstApp* CopyL();
-        
-        TFileName       iName;
-        TFileName       iParentName;
-        TFileName       iVendor;
-        TFileName       iVersion;
-        TInt64          iSize;
-        TSConAppType    iType;
-        TUid            iUid;
-        HBufC*          iWidgetBundleId; // Widget bundle identifier like "com.nokia.widget.HelloWorld"
-    };
-    
-//============================================================
-// class CSConListInstApps declaration
-//============================================================      
-NONSHARABLE_CLASS( CSConListInstApps ) : public CBase
-    {
-    public:
-        CSConListInstApps();
-        ~CSConListInstApps();
-        CSConListInstApps* CopyL();
-            
-        TBool                   iAllApps;       //list all apps
-        TDriveList              iDriveList;     //drive list
-
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress 
-                
-        RPointerArray<CSConInstApp>     iApps; //installed apps
-    };
-    
-//============================================================
-// class CSConGetStatus declaration
-//============================================================      
-NONSHARABLE_CLASS( CSConGetStatus ) : public CBase
-    {
-    public:
-        TBool               iAll;           //list all statuses
-        TInt                iTaskId;        //task id
-    };  
-    
-//============================================================
-// class CSConFile declaration
-//============================================================      
-NONSHARABLE_CLASS( CSConFile ) : public CBase
-    {
-    public:
-        CSConFile();
-        ~CSConFile();
-        CSConFile* CopyL();     
-            
-        TFileName                   iPath;      //file path + name
-        TBuf<KMaxTimeFormatSpec>    iModified;  //modified date
-        TUint                       iSize;      //file size
-        TSConUserPerm               iUserPerm;  //user permission
-    };  
-    
-//============================================================
-// class CSConInstall declaration
-//============================================================      
-NONSHARABLE_CLASS( CSConInstall ) : public CBase
-    {
-    public:
-        CSConInstall();
-        ~CSConInstall();
-            
-        CSConInstall* CopyL();
-            
-        TFileName           iPath;          //path to file
-        TSConInstallMode    iMode;          //install mode
-        
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress 
-        HBufC8*             iData;
-    };  
-    
-//============================================================
-// class CSConUninstall declaration
-//============================================================      
-NONSHARABLE_CLASS( CSConUninstall ) : public CBase
-    {
-    public:
-        CSConUninstall();
-        ~CSConUninstall();
-            
-        CSConUninstall* CopyL();
-            
-        TFileName           iName;          // application name
-        TFileName           iVendor;        // application vendor
-        TUid                iUid;           // application uid
-        TSConAppType    	iType;			// application type
-        TSConInstallMode    iMode;          // install mode
-        
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress 
-        HBufC8*             iData;
-    };  
-    
-//============================================================
-// class CSConListDataOwners declaration
-//============================================================      
-NONSHARABLE_CLASS( CSConListDataOwners ) : public CBase
-    {
-    public:
-        CSConListDataOwners();
-        ~CSConListDataOwners();         
-        CSConListDataOwners* CopyL();           
-        void DeleteDataOwners();
-            
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress 
-        
-        RPointerArray<CSConDataOwner>   iDataOwners;    //data owners
-    };
-    
-//============================================================
-// class CSConSetBURMode declaration
-//============================================================      
-NONSHARABLE_CLASS( CSConSetBURMode ) : public CBase
-    {
-    public:
-        TDriveList          iDriveList;     //drive list
-        TSConBurMode        iPartialType;   //partial backup type
-        TSConIncType        iIncType;       //incremental backup type
-        
-        CSConSetBURMode();
-        ~CSConSetBURMode();     
-        CSConSetBURMode* CopyL();
-        
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress 
-    };
-
-//============================================================
-// class CSConGetDataSize declaration
-//============================================================  
-NONSHARABLE_CLASS( CSConGetDataSize ) : public CBase
-    {
-    public:
-        CSConGetDataSize();
-        ~CSConGetDataSize();
-        
-        CSConGetDataSize* CopyL();          
-        void DeleteDataOwners();
-            
-    public:
-        RPointerArray<CSConDataOwner> iDataOwners;  //data owners
-        
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress 
-    };
-    
-//============================================================
-// class CSConListPublicFiles declaration
-//============================================================  
-NONSHARABLE_CLASS( CSConListPublicFiles ) : public CBase
-    {
-    public:
-        CSConListPublicFiles();
-        ~CSConListPublicFiles();            
-        CSConListPublicFiles* CopyL();
-        
-    public:
-        RPointerArray<CSConFile>        iFiles;         //data owners
-        RPointerArray<CSConDataOwner>   iDataOwners;    //data owners
-        
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress 
-    };
-    
-//============================================================
-// class CSConRequestData declaration
-//============================================================  
-NONSHARABLE_CLASS( CSConRequestData ) : public CBase
-    {
-    public:
-        CSConRequestData();         
-        ~CSConRequestData();            
-        CSConRequestData* CopyL();          
-        void DeleteDataAndDataOwner();
-            
-        CSConDataOwner*     iDataOwner;     //data owner
-        HBufC8*             iBackupData;    //backup data
-        TBool               iMoreData;      //more data
-        
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress 
-    };
-    
-//============================================================
-// class CSConGetDataOwnerStatus declaration
-//============================================================  
-NONSHARABLE_CLASS( CSConGetDataOwnerStatus ) : public CBase
-    {
-    public:
-        CSConGetDataOwnerStatus();
-        ~CSConGetDataOwnerStatus();         
-        CSConGetDataOwnerStatus* CopyL();
-        void DeleteDataOwners();
-            
-    public:
-        RPointerArray<CSConDataOwner> iDataOwners;  //data owners
-        
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress 
-    };
-
-//============================================================
-// class CSConSupplyData declaration
-//============================================================  
-NONSHARABLE_CLASS( CSConSupplyData ) : public CBase
-    {
-    public:
-        CSConSupplyData();
-        ~CSConSupplyData();         
-        CSConSupplyData* CopyL();
-    public:
-        CSConDataOwner*     iDataOwner;
-        HBufC8*             iRestoreData;   //restore data
-        TBool               iMoreData;      //more data     
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress 
-    };
-
-//============================================================
-// class CSConGetMetadata declaration
-//============================================================
-NONSHARABLE_CLASS( CSConGetMetadata ) : public CBase
-    {
-    public:
-        CSConGetMetadata();
-        ~CSConGetMetadata();            
-        CSConGetMetadata* CopyL();
-    public:
-        TFileName           iFilename;
-        HBufC8*             iData;          //metadata
-        TBool               iMoreData;      //more data     
-        //used only with reply
-        TBool               iComplete;      //task complete
-        TInt                iProgress;      //task progress 
-    };
-
-//============================================================
-// class CSConTask declaration
-//============================================================  
-NONSHARABLE_CLASS( CSConTask ): public CBase
-    {
-    public:
-        /**
-        * Two-phase constructor
-        * @return CSConTask instance
-        */
-        static CSConTask* NewL( TSConMethodName aMethod );
-        static CSConTask* NewLC( TSConMethodName aMethod );
-
-        CSConTask();
-        ~CSConTask();
-        TSConMethodName GetServiceId() const;
-        CSConTask* CopyL() const;
-        TBool GetComplete();
-        void SetCompleteValue( TBool aValue );
-        TBool GetCompleteValue();
-        void SetProgressValue( TInt aValue );
-    private:
-        
-        void ConstructL( TSConMethodName aMethod );                
-    public:
-        //Task
-        //service id
-        TSConMethodName             iMethod;
-        //task number
-        TInt                        iTaskId;            
-        
-        //DeviceInfo -params
-        CSConUpdateDeviceInfo*      iDevInfoParams;
-        //ListInstalledTasks -params
-        CSConListInstApps*          iListAppsParams;
-        //GetStatus -params
-        CSConGetStatus*             iGetStatusParams;
-        //Install -params
-        CSConInstall*               iInstallParams; 
-        //Uninstall -params 
-        CSConUninstall*             iUninstallParams;
-        //SetBURMode -params
-        CSConSetBURMode*            iBURModeParams;
-        //GetDataSize -params
-        CSConGetDataSize*           iGetDataSizeParams;
-        //RequestData -params
-        CSConRequestData*           iRequestDataParams; 
-        //GetDataOwnerStatus -params
-        CSConGetDataOwnerStatus*    iGetDataOwnerParams;
-        //SupplyData -params
-        CSConSupplyData*            iSupplyDataParams;
-        //ListPublicFiles -params
-        CSConListPublicFiles*       iPubFilesParams;
-        //ListDataOwners -params
-        CSConListDataOwners*        iListDataOwnersParams;
-        //Reboot -params
-        CSConReboot*                iRebootParams;
-        //GetMetadata -params
-        CSConGetMetadata*           iGetMetadataParams;
-        
-        TInt                        iCancelTaskId;
-        TBool                       iCancelTaskAll;
-    };
-    
-//============================================================
-// class CSConTaskReply declaration
-//============================================================
-NONSHARABLE_CLASS( CSConTaskReply ) : public CBase
-    {
-    public:
-        CSConTaskReply();
-        CSConTaskReply( TSConMethodName aMethod );
-        ~CSConTaskReply();
-        void InitializeL( const CSConTask& aTask );   
-        void InitializeL( TSConMethodName aMethod, 
-            TInt aProgress, TBool aComplete );           
-        CSConTaskReply* CopyAndFreeL();
-        void CleanTaskData();
-            
-    public:
-        //task id number
-        TInt                        iTaskId;
-        //method type
-        TSConMethodName             iMethod;
-        
-        //DeviceInfo -params
-        CSConUpdateDeviceInfo*      iDevInfoParams;
-        //ListInstalledTasks -params
-        CSConListInstApps*          iListAppsParams;
-        //GetStatus -params
-        CSConGetStatus*             iGetStatusParams;
-        //Install -params
-        CSConInstall*               iInstallParams;
-        //Uninstall -params
-        CSConUninstall*             iUninstallParams;
-        //SetBURMode -params
-        CSConSetBURMode*            iBURModeParams;
-        //GetDataSize -params
-        CSConGetDataSize*           iGetDataSizeParams;
-        //RequestData -params
-        CSConRequestData*           iRequestDataParams;
-        //GetDataOwnerStatus -params
-        CSConGetDataOwnerStatus*    iGetDataOwnerParams;
-        //SupplyData -params
-        CSConSupplyData*            iSupplyDataParams;
-        //ListPublicFiles -params
-        CSConListPublicFiles*       iPubFilesParams;
-        //ListDataOwners -params
-        CSConListDataOwners*        iListDataOwnersParams;
-        //Reboot -params
-        CSConReboot*                iRebootParams;
-        //GetMetadata -params
-        CSConGetMetadata*           iGetMetadataParams;
-    };      
-    
-//============================================================
-// class CSConStatusReply declaration
-//============================================================
-NONSHARABLE_CLASS( CSConStatusReply ): public CBase
-    {
-    public:
-        CSConStatusReply();
-        ~CSConStatusReply();
-            
-    public:
-        TBool                           iNoTasks;       //no active tasks
-        RPointerArray<CSConTaskReply>   iTasks;
-    };
-
-#endif
-
-// End of file
-
--- a/connectivitymodules/SeCon/common/conmltask/src/sconconmltask.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1716 +0,0 @@
-/*
-* Copyright (c) 2005-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:  ConML Task implementations
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "sconconmltask.h"
-
-// -----------------------------------------------------------------------------
-// CSConReboot::CSConReboot()
-// 
-// -----------------------------------------------------------------------------
-//
-CSConReboot::CSConReboot()
-    {
-    }
-        
-// -----------------------------------------------------------------------------
-// CSConReboot::~CSConReboot()
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConReboot::~CSConReboot()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConReboot::Copy()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConReboot* CSConReboot::CopyL()
-    {
-    CSConReboot* copy = new (ELeave) CSConReboot();
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;
-    return copy;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConDataOwner::CSConDataOwner()
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConDataOwner::CSConDataOwner()
-    {
-    iHasFiles = ENoFiles;
-    iJavaHash = NULL;
-    iUid.iUid = 0;
-    
-    //Initialize iDriveList with zeros
-    iDriveList.Fill( '\x0' );
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConDataOwner::~CSConDataOwner()
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConDataOwner::~CSConDataOwner()
-    {
-    delete iJavaHash;
-    iJavaHash = NULL;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConDataOwner::Copy()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConDataOwner* CSConDataOwner::CopyL()
-    {
-    CSConDataOwner* copy = new (ELeave) CSConDataOwner();
-    CleanupStack::PushL( copy );
-    copy->iType = iType;
-    copy->iUid = iUid;
-    copy->iDriveList.Copy( iDriveList );
-    copy->iPackageName = iPackageName;
-    copy->iReqReboot = iReqReboot;
-    copy->iHasFiles = iHasFiles;
-    copy->iSupportsInc = iSupportsInc;
-    copy->iSupportsSel = iSupportsSel;
-    copy->iDelayToPrep = iDelayToPrep;
-    copy->iSize = iSize;
-    copy->iDataOwnStatus = iDataOwnStatus;
-    copy->iTransDataType = iTransDataType;
-    
-    if ( iJavaHash )
-        {
-        if ( copy->iJavaHash )
-            {
-            delete copy->iJavaHash;
-            copy->iJavaHash = NULL;
-            }
-        copy->iJavaHash = iJavaHash->AllocL();
-        }
-    CleanupStack::Pop( copy );
-    return copy;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConUpdateDeviceInfo::CSConUpdateDeviceInfo()
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConUpdateDeviceInfo::CSConUpdateDeviceInfo()
-    {
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConUpdateDeviceInfo::~CSConUpdateDeviceInfo()
-// 
-// -----------------------------------------------------------------------------
-//           
-CSConUpdateDeviceInfo::~CSConUpdateDeviceInfo()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConUpdateDeviceInfo::Copy()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConUpdateDeviceInfo* CSConUpdateDeviceInfo::CopyL()
-    {
-    CSConUpdateDeviceInfo* copy = new (ELeave) CSConUpdateDeviceInfo();
-    copy->iVersion.Copy( iVersion );
-    copy->iInstallSupp = iInstallSupp;
-    copy->iUninstallSupp = iUninstallSupp;
-    copy->iInstParamsSupp = iInstParamsSupp;
-    copy->iInstAppsSupp = iInstAppsSupp;
-    copy->iDataOwnersSupp = iDataOwnersSupp;
-    copy->iSetBURModeSupp = iSetBURModeSupp;
-    copy->iGetSizeSupp = iGetSizeSupp;
-    copy->iReqDataSupp = iReqDataSupp;
-    copy->iSupplyDataSupp = iSupplyDataSupp;
-    copy->iMaxObjectSize = iMaxObjectSize;
-    copy->iRebootSupp = iRebootSupp;
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;        
-                
-    return copy;
-    }
-
-CSConInstApp::~CSConInstApp()
-    {
-    delete iWidgetBundleId;
-    }
-// -----------------------------------------------------------------------------
-// CSConInstApp::Copy()
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConInstApp* CSConInstApp::CopyL()
-    {
-    CSConInstApp* copy = new (ELeave) CSConInstApp();
-            
-    copy->iName.Copy( iName ); 
-    copy->iParentName.Copy( iParentName );
-    copy->iVendor.Copy( iVendor );
-    copy->iVersion.Copy( iVersion );
-    copy->iSize = iSize;
-    copy->iType = iType;
-    copy->iUid = iUid;
-    if ( iWidgetBundleId )
-        {
-        copy->iWidgetBundleId = iWidgetBundleId->AllocL();
-        }
-    else
-        {
-        copy->iWidgetBundleId = NULL;
-        }
-
-    return copy;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConListInstApps::CSConListInstApps()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConListInstApps::CSConListInstApps()
-    {
-    //Initialize iDriveList with zeros
-    iDriveList.Fill( '\x0' );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConListInstApps::~CSConListInstApps()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConListInstApps::~CSConListInstApps()
-    {
-    iApps.ResetAndDestroy();
-    iApps.Close();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConListInstApps::CopyL()
-// 
-// -----------------------------------------------------------------------------
-//              
-CSConListInstApps* CSConListInstApps::CopyL()
-    {
-    CSConListInstApps* copy = new (ELeave) CSConListInstApps();
-    CleanupStack::PushL( copy );
-    copy->iAllApps = iAllApps;
-    copy->iDriveList = iDriveList;
-            
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;            
-        
-    for( TInt i = 0; i < iApps.Count(); i++ )
-        {
-        CSConInstApp* temp = iApps[i]->CopyL();
-        CleanupStack::PushL( temp );
-        copy->iApps.AppendL( temp );
-        CleanupStack::Pop( temp );
-        }
-    CleanupStack::Pop( copy );
-    return copy;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFile::CSConFile
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConFile::CSConFile()
-    {
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFile::~CSConFile
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConFile::~CSConFile()
-    {
-    
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFile::Copy()
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConFile* CSConFile::CopyL()
-    {
-    CSConFile* copy = new (ELeave) CSConFile();
-            
-    copy->iPath.Copy( iPath ); 
-    copy->iModified.Copy( iModified );
-    copy->iSize = iSize;
-    copy->iUserPerm = iUserPerm;
-
-    return copy;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConInstall::CSConInstall()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConInstall::CSConInstall() : iMode( EUnknown ) 
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConInstall::~CSConInstall()
-// 
-// -----------------------------------------------------------------------------
-//              
-CSConInstall::~CSConInstall()
-    {
-    delete iData;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConInstall::CopyL()
-// 
-// -----------------------------------------------------------------------------
-//              
-CSConInstall* CSConInstall::CopyL()
-    {
-    CSConInstall* copy = new (ELeave) CSConInstall();
-    copy->iPath = iPath;
-    copy->iMode = iMode;
-            
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;
-    
-    if ( iData )
-        {
-        copy->iData = iData->Alloc();
-        }
-            
-    return copy;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConUninstall::CSConUninstall()
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConUninstall::CSConUninstall() : iMode( EUnknown )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConUninstall::~CSConUninstall()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConUninstall::~CSConUninstall()
-    {
-    delete iData;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConUninstall::Copy()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConUninstall* CSConUninstall::CopyL()
-    {
-    CSConUninstall* copy = new (ELeave) CSConUninstall();
-    copy->iName = iName;
-    copy->iVendor = iVendor;
-    copy->iUid = iUid;
-    copy->iMode = iMode;
-            
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;
-    
-    if ( iData )
-        {
-        copy->iData = iData->Alloc();
-        }
-            
-    return copy;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConListDataOwners::CSConListDataOwners()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConListDataOwners::CSConListDataOwners()
-    {
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConListDataOwners::~CSConListDataOwners()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConListDataOwners::~CSConListDataOwners()
-    {
-    iDataOwners.ResetAndDestroy();
-    iDataOwners.Close();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConListDataOwners::CopyL()
-// 
-// -----------------------------------------------------------------------------
-//              
-CSConListDataOwners* CSConListDataOwners::CopyL()
-    {
-    CSConListDataOwners* copy = new (ELeave) CSConListDataOwners();
-    CleanupStack::PushL( copy );
-    for( TInt i = 0; i < iDataOwners.Count(); i++ )
-        {
-        CSConDataOwner* temp = iDataOwners[i]->CopyL();
-        CleanupStack::PushL( temp );
-        copy->iDataOwners.AppendL( temp );
-        CleanupStack::Pop( temp );
-        }
-    CleanupStack::Pop( copy );
-    
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;
-        
-    return copy;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConListDataOwners::DeleteDataOwners()
-// 
-// -----------------------------------------------------------------------------
-//          
-void CSConListDataOwners::DeleteDataOwners()
-    {
-    iDataOwners.ResetAndDestroy();
-    iDataOwners.Close();
-    }
-    
-// -----------------------------------------------------------------------------
-// CCSConSetBURMode::CSConSetBURMode()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConSetBURMode::CSConSetBURMode()
-    {
-    //Initialize iDriveList with zeros
-    iDriveList.Fill( '\x0' );
-    }
-        
-// -----------------------------------------------------------------------------
-// CSConSetBURMode::~CSConSetBURMode()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConSetBURMode::~CSConSetBURMode()
-    {
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSetBURMode::Copy()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConSetBURMode* CSConSetBURMode::CopyL()
-    {
-    CSConSetBURMode* copy = new (ELeave) CSConSetBURMode();
-    copy->iDriveList.Copy( iDriveList );
-    copy->iPartialType = iPartialType;
-    copy->iIncType = iIncType;
-            
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;
-
-    return copy;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConGetDataSize::CSConGetDataSize()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConGetDataSize::CSConGetDataSize()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConGetDataSize::~CSConGetDataSize()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConGetDataSize::~CSConGetDataSize()
-    {
-    iDataOwners.ResetAndDestroy();
-    iDataOwners.Close();
-    }
-        
-// -----------------------------------------------------------------------------
-// CSConGetDataSize::Copy()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConGetDataSize* CSConGetDataSize::CopyL()
-    {
-    CSConGetDataSize* copy = new (ELeave) CSConGetDataSize();
-    CleanupStack::PushL( copy );
-    for( TInt i = 0; i < iDataOwners.Count(); i++ )
-        {
-        CSConDataOwner* temp = iDataOwners[i]->CopyL();
-        CleanupStack::PushL( temp );
-        copy->iDataOwners.AppendL( temp );
-        CleanupStack::Pop( temp );
-        }
-    CleanupStack::Pop( copy );
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;
-        
-    return copy;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConGetDataSize::DeleteDataOwners()
-// 
-// -----------------------------------------------------------------------------
-//              
-void CSConGetDataSize::DeleteDataOwners()
-    {
-    iDataOwners.ResetAndDestroy();
-    iDataOwners.Close();
-    }   
-    
-// -----------------------------------------------------------------------------
-// CSConListPublicFiles::CSConListPublicFiles()
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConListPublicFiles::CSConListPublicFiles()
-    {
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConListPublicFiles::~CSConListPublicFiles()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConListPublicFiles::~CSConListPublicFiles()
-    {
-    iFiles.ResetAndDestroy();
-    iFiles.Close();
-    
-    iDataOwners.ResetAndDestroy();
-    iDataOwners.Close();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConListPublicFiles::CopyL()
-// 
-// -----------------------------------------------------------------------------
-//              
-CSConListPublicFiles* CSConListPublicFiles::CopyL()
-    {
-    CSConListPublicFiles* copy = new (ELeave) CSConListPublicFiles();
-    CleanupStack::PushL( copy );
-    for( TInt i = 0; i < iFiles.Count(); i++ )
-        {
-        CSConFile* temp = iFiles[i]->CopyL();
-        CleanupStack::PushL( temp );
-        copy->iFiles.AppendL( temp );
-        CleanupStack::Pop( temp );
-        }
-        
-    for( TInt j = 0; j < iDataOwners.Count(); j++ )
-        {
-        CSConDataOwner* temp = iDataOwners[j]->CopyL();
-        CleanupStack::PushL( temp );
-        copy->iDataOwners.AppendL( temp );
-        CleanupStack::Pop( temp );
-        }
-    CleanupStack::Pop( copy );
-    
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;
-        
-    return copy;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConRequestData::CSConRequestData()
-// 
-// -----------------------------------------------------------------------------
-//
-CSConRequestData::CSConRequestData()
-    {
-    iDataOwner = new CSConDataOwner();
-    }
-            
-// -----------------------------------------------------------------------------
-// CSConRequestData::~CSConRequestData()
-// 
-// -----------------------------------------------------------------------------
-//
-CSConRequestData::~CSConRequestData()
-    {
-    if ( iDataOwner )
-        {
-        delete iDataOwner;
-        iDataOwner = NULL;
-        }
-        
-    if ( iBackupData )
-        {
-        delete iBackupData;
-        iBackupData = NULL;
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConRequestData::Copy()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConRequestData* CSConRequestData::CopyL()
-    {
-    CSConRequestData* copy = new (ELeave) CSConRequestData();
-    
-    if ( iDataOwner )
-        {
-        if ( copy->iDataOwner )
-            {
-            delete copy->iDataOwner;
-            copy->iDataOwner = NULL;
-            }
-        copy->iDataOwner = iDataOwner->CopyL();
-        }
-    
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;
-        
-    if ( iBackupData )
-        {
-        if ( copy->iBackupData )
-            {
-            delete copy->iBackupData;
-            copy->iBackupData = NULL;
-            }
-        copy->iBackupData = iBackupData->Alloc();
-        }
-        
-    copy->iMoreData = iMoreData;
-    
-    return copy;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConRequestData::DeleteDataAndDataOwner()
-// 
-// -----------------------------------------------------------------------------
-//          
-void CSConRequestData::DeleteDataAndDataOwner()
-    {
-    if ( iDataOwner )
-        {
-        delete iDataOwner;
-        iDataOwner = NULL;
-        }
-    
-    if ( iBackupData )
-        {
-        delete iBackupData;
-        iBackupData = NULL;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CSConGetDataOwnerStatus::CSConGetDataOwnerStatus()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConGetDataOwnerStatus::CSConGetDataOwnerStatus()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConGetDataOwnerStatus::~CSConGetDataOwnerStatus()
-// 
-// -----------------------------------------------------------------------------
-//              
-CSConGetDataOwnerStatus::~CSConGetDataOwnerStatus()
-    {
-    iDataOwners.ResetAndDestroy();
-    iDataOwners.Close();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConGetDataOwnerStatus::Copy()
-// 
-// -----------------------------------------------------------------------------
-//              
-CSConGetDataOwnerStatus* CSConGetDataOwnerStatus::CopyL()
-    {
-    CSConGetDataOwnerStatus* copy = new (ELeave) CSConGetDataOwnerStatus();
-    CleanupStack::PushL( copy );
-    for( TInt i = 0; i < iDataOwners.Count(); i++ )
-        {
-        CSConDataOwner* temp = iDataOwners[i]->CopyL();
-        CleanupStack::PushL( temp );
-        copy->iDataOwners.AppendL( temp );
-        CleanupStack::Pop( temp );
-        }           
-    CleanupStack::Pop( copy );
-    
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;
-        
-    return copy;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConGetDataOwnerStatus::DeleteDataOwners()
-// 
-// -----------------------------------------------------------------------------
-//              
-void CSConGetDataOwnerStatus::DeleteDataOwners()
-    {
-    iDataOwners.ResetAndDestroy();
-    iDataOwners.Close();
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSupplyData::CSConSupplyData()
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConSupplyData::CSConSupplyData()
-    {
-    iDataOwner = new CSConDataOwner();
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSupplyData::~CSConSupplyData()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConSupplyData::~CSConSupplyData()
-    {
-    if ( iDataOwner )
-        {
-        delete iDataOwner;
-        iDataOwner = NULL;
-        }
-    
-    if ( iRestoreData )
-        {
-        delete iRestoreData;
-        iRestoreData = NULL;
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSupplyData::Copy()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConSupplyData* CSConSupplyData::CopyL()
-    {
-    CSConSupplyData* copy = new (ELeave) CSConSupplyData();
-    CleanupStack::PushL( copy );
-    
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;
-        
-    if ( iDataOwner )
-        {
-        if ( copy->iDataOwner )
-            {
-            delete copy->iDataOwner;
-            copy->iDataOwner = NULL;
-            }
-            
-        copy->iDataOwner = iDataOwner->CopyL();
-        }
-    CleanupStack::Pop( copy ); 
-        
-    if ( iRestoreData )
-        {
-        if ( copy->iRestoreData )
-            {
-            delete copy->iRestoreData;
-            copy->iRestoreData = NULL;
-            }
-            
-        copy->iRestoreData = iRestoreData->Alloc();
-        }
-    
-    copy->iMoreData = iMoreData;    
-    
-    return copy;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConGetMetadata::CSConGetMetadata()
-// 
-// -----------------------------------------------------------------------------
-//  
-CSConGetMetadata::CSConGetMetadata()
-    {
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConGetMetadata::~CSConGetMetadata()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConGetMetadata::~CSConGetMetadata()
-    {
-    delete iData;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConGetMetadata::Copy()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConGetMetadata* CSConGetMetadata::CopyL()
-    {
-    CSConGetMetadata* copy = new (ELeave) CSConGetMetadata();
-    
-    copy->iFilename = iFilename;
-    
-    if ( iData )
-        {
-        if ( copy->iData )
-            {
-            delete copy->iData;
-            copy->iData = NULL;
-            }
-        
-        copy->iData = iData->Alloc();
-        }
-    
-    copy->iMoreData = iMoreData;
-    copy->iComplete = iComplete;
-    copy->iProgress = iProgress;
-    
-    return copy;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CSConTask::NewL( TSConMethodName aMethod )
-// 
-// -----------------------------------------------------------------------------
-//
-CSConTask* CSConTask::NewL( TSConMethodName aMethod )
-    {
-    CSConTask* self = NewLC( aMethod );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConTask::NewLC( TSConMethodName aMethod )
-// 
-// -----------------------------------------------------------------------------
-//
-CSConTask* CSConTask::NewLC( TSConMethodName aMethod )
-    {
-    CSConTask* self = new (ELeave) CSConTask();
-    CleanupStack::PushL( self );
-    self->ConstructL( aMethod );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConTask::ConstructL( TSConMethodName aMethod )
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CSConTask::ConstructL( TSConMethodName aMethod )
-    {
-    iMethod = aMethod;
-    
-    switch( aMethod )
-        {
-        case ECancel :
-            break;
-        case EGetDataOwnerStatus :
-            iGetDataOwnerParams = new (ELeave) CSConGetDataOwnerStatus();
-            break;
-        case EGetDataSize :
-            iGetDataSizeParams = new (ELeave) CSConGetDataSize();
-            break;
-        case EGetStatus :
-            iGetStatusParams = new (ELeave) CSConGetStatus();
-            break;
-        case EInstall :
-            iInstallParams = new (ELeave) CSConInstall();
-            break;
-        case EListDataOwners :
-            iListDataOwnersParams = new (ELeave) CSConListDataOwners();
-            break;
-        case EListInstalledApps :
-            iListAppsParams = new (ELeave) CSConListInstApps();
-            break;
-        case EListPublicFiles :
-            iPubFilesParams = new (ELeave) CSConListPublicFiles();
-            break;
-        case ERequestData :
-            iRequestDataParams = new (ELeave) CSConRequestData();
-            break;
-        case ESetBURMode :
-            iBURModeParams = new (ELeave) CSConSetBURMode();
-            break;
-        case ESetInstParams :
-            break;
-        case ESupplyData :
-            iSupplyDataParams = new (ELeave) CSConSupplyData();
-            break;
-        case EUninstall :
-            iUninstallParams = new (ELeave) CSConUninstall();
-            break;
-        case EUpdateDeviceInfo :
-            iDevInfoParams = new (ELeave) CSConUpdateDeviceInfo();
-            break;
-        case EReboot :
-            iRebootParams = new (ELeave) CSConReboot();
-            break;
-        case EGetMetadata :
-            iGetMetadataParams = new (ELeave) CSConGetMetadata();
-            break;
-        default :
-            break;
-        }
-    }
-// -----------------------------------------------------------------------------
-// CSConTask::CSConTask()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConTask::CSConTask()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConTask::~CSConTask()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConTask::~CSConTask()
-    {
-    delete iDevInfoParams;
-    delete iListAppsParams;
-    delete iGetStatusParams;
-    delete iInstallParams;
-    delete iUninstallParams;
-    delete iBURModeParams;
-    delete iGetDataSizeParams;
-    delete iRequestDataParams;
-    delete iGetDataOwnerParams;
-    delete iSupplyDataParams;
-    delete iPubFilesParams;
-    delete iListDataOwnersParams;
-    delete iRebootParams;
-    delete iGetMetadataParams;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConTask::GetServiceId() const
-// 
-// -----------------------------------------------------------------------------
-//          
-TSConMethodName CSConTask::GetServiceId() const
-    { 
-    return iMethod; 
-    }
-
-// -----------------------------------------------------------------------------
-// CSConTask::Copy() const
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConTask* CSConTask::CopyL() const
-    {
-    CSConTask* copy = new (ELeave) CSConTask();
-    copy->iMethod = iMethod;
-    
-    if ( iDevInfoParams )
-        {
-        copy->iDevInfoParams = iDevInfoParams->CopyL();
-        }
-    if ( iListAppsParams )
-        {
-        copy->iListAppsParams = iListAppsParams->CopyL();
-        }
-    if ( iGetStatusParams ) 
-        {
-        
-        }
-    if ( iInstallParams )
-        {
-        copy->iInstallParams = iInstallParams->CopyL();
-        }
-    if ( iUninstallParams )
-        {
-        copy->iUninstallParams = iUninstallParams->CopyL();
-        }
-    if ( iBURModeParams )
-        {
-        copy->iBURModeParams = iBURModeParams->CopyL();
-        }
-    if ( iGetDataSizeParams )
-        {
-        copy->iGetDataSizeParams = iGetDataSizeParams->CopyL();
-        }
-    if ( iRequestDataParams )
-        {
-        copy->iRequestDataParams = iRequestDataParams->CopyL();
-        }
-    if ( iGetDataOwnerParams )
-        {
-        copy->iGetDataOwnerParams = iGetDataOwnerParams->CopyL();
-        }
-    if ( iSupplyDataParams )
-        {
-        copy->iSupplyDataParams = iSupplyDataParams->CopyL();
-        }
-    if ( iPubFilesParams )
-        {
-        copy->iPubFilesParams = iPubFilesParams->CopyL();
-        }
-    if ( iListDataOwnersParams )
-        {
-        copy->iListDataOwnersParams = iListDataOwnersParams->CopyL();
-        }
-    if ( iRebootParams )
-        {
-        copy->iRebootParams = iRebootParams->CopyL();
-        }
-    if ( iGetMetadataParams )
-        {
-        copy->iGetMetadataParams = iGetMetadataParams->CopyL();
-        }
-    
-    return copy;
-    }
-            
-// -----------------------------------------------------------------------------
-// CSConTask::GetComplete()
-// 
-// -----------------------------------------------------------------------------
-//  
-TBool CSConTask::GetComplete()
-    {
-    TBool complete( EFalse );
-    
-    switch( iMethod )
-        {
-        case EInstall :
-            complete = this->iInstallParams->iComplete;
-            break;
-        case EUninstall :
-            complete =  this->iUninstallParams->iComplete;
-            break;
-        case EListInstalledApps :
-            complete =  this->iListAppsParams->iComplete;
-            break;
-        case ESetInstParams :
-            break;
-        case ESetBURMode :
-            complete = this->iBURModeParams->iComplete;
-            break;
-        case EListPublicFiles :
-            complete = this->iPubFilesParams->iComplete;
-            break;
-        case EListDataOwners :
-            complete = this->iListDataOwnersParams->iComplete;
-            break;
-        case EGetDataSize :
-            complete = this->iGetDataSizeParams->iComplete;
-            break;
-        case EReboot :
-            complete = this->iRebootParams->iComplete;
-            break;
-        case ERequestData :
-            //If task is partially completed, 
-            //it can be removed from the queue
-            if ( this->iRequestDataParams->iProgress == KSConTaskPartiallyCompleted )
-                {
-                complete = ETrue;
-                }
-            else
-                {
-                complete = this->iRequestDataParams->iComplete;
-                }
-            
-            break;
-        case EGetDataOwnerStatus :
-            complete = this->iGetDataOwnerParams->iComplete;
-            break;
-        case ESupplyData :
-            //If task is partially completed, 
-            //it can be removed from the queue
-            if ( this->iSupplyDataParams->iProgress == KSConTaskPartiallyCompleted )
-                {
-                complete = ETrue;
-                }
-            else
-                {
-                complete = this->iSupplyDataParams->iComplete;
-                }
-            
-            break;
-        case EGetMetadata :
-            complete = this->iGetMetadataParams->iComplete;
-            break;
-        default :
-            break;                      
-        }
-    
-    return complete;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConTask::SetCompleteValue( TBool aValue )
-// 
-// -----------------------------------------------------------------------------
-//          
-void CSConTask::SetCompleteValue( TBool aValue )   
-    {
-    switch( iMethod )
-        {
-        case EInstall :
-            this->iInstallParams->iComplete = aValue;
-            break;
-        case EUninstall :
-            this->iUninstallParams->iComplete = aValue;         
-            break;
-        case EListInstalledApps :
-            this->iListAppsParams->iComplete = aValue;
-            break;
-        case ESetInstParams :
-            this->iInstallParams->iComplete = aValue;
-            break;
-        case ESetBURMode :
-            this->iBURModeParams->iComplete = aValue;
-            break;
-        case EListPublicFiles :
-            this->iPubFilesParams->iComplete = aValue;
-            break;
-        case EListDataOwners :
-            this->iListDataOwnersParams->iComplete = aValue;
-            break;
-        case EGetDataSize :
-            this->iGetDataSizeParams->iComplete = aValue;
-            break;
-        case EReboot :
-            this->iRebootParams->iComplete = aValue;
-            break;
-        case ERequestData :
-            this->iRequestDataParams->iComplete = aValue;
-            break;
-        case EGetDataOwnerStatus :
-            this->iGetDataOwnerParams->iComplete = aValue;
-            break;
-        case ESupplyData :
-            this->iSupplyDataParams->iComplete = aValue;
-            break;
-        case EGetMetadata :
-            this->iGetMetadataParams->iComplete = aValue;
-            break;
-        default:
-            break;      
-        }
-    }
-        
-// -----------------------------------------------------------------------------
-// CSConTask::GetCompleteValue()
-// 
-// -----------------------------------------------------------------------------
-//  
-TBool CSConTask::GetCompleteValue()
-    {
-    TBool complete( EFalse );
-    
-    switch( iMethod )
-        {
-        case EInstall :
-            complete = this->iInstallParams->iComplete;
-            break;
-        case EUninstall :
-            complete = this->iUninstallParams->iComplete;           
-            break;
-        case EListInstalledApps :
-            complete = this->iListAppsParams->iComplete;
-            break;
-        case ESetInstParams :
-            complete = this->iInstallParams->iComplete;
-            break;
-        case ESetBURMode :
-            complete = this->iBURModeParams->iComplete;
-            break;
-        case EListPublicFiles :
-            complete = this->iPubFilesParams->iComplete;
-            break;
-        case EListDataOwners :
-            complete = this->iListDataOwnersParams->iComplete;
-            break;
-        case EGetDataSize :
-            complete = this->iGetDataSizeParams->iComplete;
-            break;
-        case EReboot :
-            complete = this->iRebootParams->iComplete;
-            break;
-        case ERequestData :
-            if ( this->iRequestDataParams->iProgress != KSConTaskPartiallyCompleted )
-                {
-                complete = this->iRequestDataParams->iComplete;
-                }
-            else
-                {
-                complete = ETrue;
-                }
-            
-            break;
-        case EGetDataOwnerStatus :
-            complete = this->iGetDataOwnerParams->iComplete;
-            break;
-        case ESupplyData :
-            if ( this->iSupplyDataParams->iProgress != KSConTaskPartiallyCompleted )
-                {
-                complete = this->iSupplyDataParams->iComplete;
-                }
-            else
-                {
-                complete = ETrue;
-                }
-            break;
-        case EGetMetadata :
-            complete = this->iGetMetadataParams->iComplete;
-            break;
-        default:
-            break;      
-        }
-    return complete;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConTask::SetProgressValue( TInt aValue )
-// 
-// -----------------------------------------------------------------------------
-//              
-void CSConTask::SetProgressValue( TInt aValue )
-    {
-    switch( iMethod )
-        {
-        case EInstall :
-            this->iInstallParams->iProgress = aValue;
-            break;
-        case EUninstall :
-            this->iUninstallParams->iProgress = aValue;
-            break;
-        case EListInstalledApps :
-            this->iListAppsParams->iProgress = aValue;
-            break;
-        case ESetInstParams :
-            this->iInstallParams->iProgress = aValue;
-            break;
-        case ESetBURMode :
-            this->iBURModeParams->iProgress = aValue;
-            break;
-        case EListPublicFiles :
-            this->iPubFilesParams->iProgress = aValue;
-            break;
-        case EListDataOwners :
-            this->iListDataOwnersParams->iProgress = aValue;
-            break;
-        case EGetDataSize :
-            this->iGetDataSizeParams->iProgress = aValue;
-            break;
-        case EReboot :
-            this->iRebootParams->iProgress = aValue;
-            break;
-        case ERequestData :
-            this->iRequestDataParams->iProgress = aValue;
-            break;
-        case EGetDataOwnerStatus :
-            this->iGetDataOwnerParams->iProgress = aValue;
-            break;
-        case ESupplyData :
-            this->iSupplyDataParams->iProgress = aValue;
-            break;
-        case EGetMetadata :
-            this->iGetMetadataParams->iProgress = aValue;
-            break;
-        default:
-            break;      
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CSConTaskReply::CSConTaskReply()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConTaskReply::CSConTaskReply()
-    {
-    }
-   
-// -----------------------------------------------------------------------------
-// CSConTaskReply::CSConTaskReply( TSConMethodName aMethod )
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConTaskReply::CSConTaskReply( TSConMethodName aMethod )
-    {
-    iMethod = aMethod;
-    switch( aMethod )
-        {
-        case ECancel :
-            break;
-        case EGetDataOwnerStatus :
-            iGetDataOwnerParams = new CSConGetDataOwnerStatus();
-            break;
-        case EGetDataSize :
-            iGetDataSizeParams = new CSConGetDataSize();
-            break;
-        case EGetStatus :
-            iGetStatusParams = new CSConGetStatus();
-            break;
-        case EInstall :
-            iInstallParams = new CSConInstall();
-            break;
-        case EListDataOwners :
-            iListDataOwnersParams = new CSConListDataOwners();
-            break;
-        case EListInstalledApps :
-            iListAppsParams = new CSConListInstApps();
-            break;
-        case EListPublicFiles :
-            iPubFilesParams = new CSConListPublicFiles();
-            break;
-        case ERequestData :
-            iRequestDataParams = new CSConRequestData();
-            break;
-        case ESetBURMode :
-            iBURModeParams = new CSConSetBURMode();
-            break;
-        case ESetInstParams :
-            break;
-        case ESupplyData :
-            iSupplyDataParams = new CSConSupplyData();
-            break;
-        case EUninstall :
-            iUninstallParams = new CSConUninstall();
-            break;
-        case EUpdateDeviceInfo :
-            iDevInfoParams = new CSConUpdateDeviceInfo();
-            break;
-        case EReboot :
-            iRebootParams = new CSConReboot();
-            break;
-        case EGetMetadata :
-            iGetMetadataParams = new CSConGetMetadata();
-            break;
-        default :
-            break;
-        }
-    }
-      
-// -----------------------------------------------------------------------------
-// CSConTaskReply::~CSConTaskReply()
-// 
-// -----------------------------------------------------------------------------
-//          
-CSConTaskReply::~CSConTaskReply()
-    {
-    delete iDevInfoParams;
-    delete iListAppsParams;
-    delete iGetStatusParams;
-    delete iInstallParams;
-    delete iUninstallParams;
-    delete iBURModeParams;
-    delete iGetDataSizeParams;
-    delete iRequestDataParams;
-    delete iGetDataOwnerParams;
-    delete iSupplyDataParams;
-    delete iPubFilesParams;
-    delete iListDataOwnersParams;
-    delete iRebootParams;
-    delete iGetMetadataParams;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConTaskReply::Initialize( const CSConTask& aTask )
-// 
-// -----------------------------------------------------------------------------
-// 
-void CSConTaskReply::InitializeL( const CSConTask& aTask )
-    {
-    iTaskId = aTask.iTaskId;
-    iMethod = aTask.iMethod;
-    
-    if ( iMethod == EInstall )
-        {
-        if ( iInstallParams )
-            {
-            delete iInstallParams;
-            iInstallParams = NULL;
-            }
-        iInstallParams = aTask.iInstallParams->CopyL();
-        }
-    else if ( iMethod == EListInstalledApps )
-        {
-        if ( iListAppsParams )
-            {
-            delete iListAppsParams;
-            iListAppsParams = NULL;
-            }
-            
-        iListAppsParams = aTask.iListAppsParams->CopyL();
-        }
-    else if ( iMethod == EUninstall )
-        {
-        if ( iUninstallParams )
-            {
-            delete iUninstallParams;
-            iUninstallParams = NULL;
-            }
-            
-        iUninstallParams = aTask.iUninstallParams->CopyL();
-        }
-    else if ( iMethod == ESetBURMode )
-        {
-        if ( iBURModeParams )
-            {
-            delete iBURModeParams;
-            iBURModeParams = NULL;
-            }
-            
-        iBURModeParams = aTask.iBURModeParams->CopyL();
-        }
-    else if ( iMethod == EListPublicFiles )
-        {
-        if ( iPubFilesParams )
-            {
-            delete iPubFilesParams;
-            iPubFilesParams = NULL;
-            }
-        
-        iPubFilesParams = aTask.iPubFilesParams->CopyL();
-        }
-    else if ( iMethod == EListDataOwners )
-        {
-        if ( iListDataOwnersParams )
-            {
-            delete iListDataOwnersParams;
-            iListDataOwnersParams = NULL;
-            }
-        
-        iListDataOwnersParams = aTask.iListDataOwnersParams->CopyL();
-        }
-    else if ( iMethod == EGetDataSize )
-        {
-        if ( iGetDataSizeParams )
-            {
-            delete iGetDataSizeParams;
-            iGetDataSizeParams = NULL;
-            }
-        
-        iGetDataSizeParams = aTask.iGetDataSizeParams->CopyL();
-        }
-    else if ( iMethod == EReboot )
-        {
-        if ( iRebootParams )
-            {
-            delete iRebootParams;
-            iRebootParams = NULL;
-            }
-        }
-    else if ( iMethod == ERequestData )
-        {
-        if ( iRequestDataParams )
-            {
-            delete iRequestDataParams;
-            iRequestDataParams = NULL;
-            }
-        
-        iRequestDataParams = aTask.iRequestDataParams->CopyL();
-        }
-    else if ( iMethod == EGetDataOwnerStatus )
-        {
-        if ( iGetDataOwnerParams )
-            {
-            delete iGetDataOwnerParams;
-            iGetDataOwnerParams = NULL;
-            }
-            
-        iGetDataOwnerParams = aTask.iGetDataOwnerParams->CopyL();
-        }
-    else if ( iMethod == ESupplyData )
-        {
-        if ( iSupplyDataParams )
-            {
-            delete iSupplyDataParams;
-            iSupplyDataParams = NULL;
-            }
-        
-        iSupplyDataParams = aTask.iSupplyDataParams->CopyL();
-        }
-    else if ( iMethod == EGetMetadata )
-        {
-        if ( iGetMetadataParams )
-            {
-            delete iGetMetadataParams;
-            iGetMetadataParams = NULL;
-            }
-        
-        iGetMetadataParams = aTask.iGetMetadataParams->CopyL();
-        }
-    }
- 
-// -----------------------------------------------------------------------------
-// CSConTaskReply::Initialize( TSConMethodName aMethod, 
-//              TInt aProgress, TBool aComplete )
-// 
-// -----------------------------------------------------------------------------
-//              
-void CSConTaskReply::InitializeL( TSConMethodName aMethod, 
-                TInt aProgress, TBool aComplete )
-    {
-    iMethod = aMethod;
-    if ( aMethod == EUpdateDeviceInfo )
-        {
-        if ( !iDevInfoParams )
-            {
-            iDevInfoParams = new (ELeave) CSConUpdateDeviceInfo();
-            }
-            
-        iDevInfoParams->iComplete = aComplete;
-        iDevInfoParams->iProgress = aProgress;
-        }
-    else if ( aMethod == EReboot )
-        {
-        if ( !iRebootParams )
-            {
-            iRebootParams = new (ELeave) CSConReboot();
-            }
-            
-        iRebootParams->iComplete = aComplete;
-        iRebootParams->iProgress = aProgress;
-        }
-    else if ( aMethod == EGetMetadata )
-        {
-        if ( !iGetMetadataParams )
-            {
-            iGetMetadataParams = new (ELeave) CSConGetMetadata();
-            }
-            
-        iGetMetadataParams->iComplete = aComplete;
-        iGetMetadataParams->iProgress = aProgress;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CSConTaskReply::CopyAndFree()
-// 
-// -----------------------------------------------------------------------------
-// 
-CSConTaskReply* CSConTaskReply::CopyAndFreeL()  
-    {
-    CSConTaskReply* copy = new (ELeave) CSConTaskReply();
-    CleanupStack::PushL( copy );
-    copy->iTaskId = iTaskId;
-    copy->iMethod = iMethod;
-    
-    if ( iDevInfoParams )
-        {
-        copy->iDevInfoParams = iDevInfoParams->CopyL();
-        
-        //free allocated memory
-        delete iDevInfoParams;
-        iDevInfoParams = NULL;
-        }
-    if ( iListAppsParams )
-        {
-        copy->iListAppsParams = iListAppsParams->CopyL();
-        
-        //free allocated memory
-        delete iListAppsParams;
-        iListAppsParams = NULL;
-        }
-    if ( iInstallParams )
-        {
-        copy->iInstallParams = iInstallParams->CopyL();
-        
-        //free allocated memory
-        delete iInstallParams;
-        iInstallParams = NULL;
-        }
-    if ( iUninstallParams )
-        {
-        copy->iUninstallParams = iUninstallParams->CopyL();
-        
-        //free allocated memory
-        delete iUninstallParams;
-        iUninstallParams = NULL;
-        }
-    if ( iBURModeParams )
-        {
-        copy->iBURModeParams = iBURModeParams->CopyL();
-        
-        //free allocated memory
-        delete iBURModeParams;
-        iBURModeParams = NULL;
-        }
-    if ( iGetDataSizeParams )
-        {
-        copy->iGetDataSizeParams = iGetDataSizeParams->CopyL();
-        
-        //free allocated memory
-        delete iGetDataSizeParams;
-        iGetDataSizeParams = NULL;
-        }
-    if ( iRequestDataParams )
-        {
-        copy->iRequestDataParams = iRequestDataParams->CopyL();
-        
-        //free allocated memory
-        delete iRequestDataParams;
-        iRequestDataParams = NULL;
-        }
-    if ( iGetDataOwnerParams )
-        {
-        copy->iGetDataOwnerParams = iGetDataOwnerParams->CopyL();
-        
-        //free allocated memory
-        delete iGetDataOwnerParams;
-        iGetDataOwnerParams = NULL;
-        }
-    if ( iSupplyDataParams )
-        {
-        copy->iSupplyDataParams = iSupplyDataParams->CopyL();
-        
-        //free allocated memory
-        delete iSupplyDataParams;
-        iSupplyDataParams = NULL;
-        }
-    if ( iPubFilesParams )
-        {
-        copy->iPubFilesParams = iPubFilesParams->CopyL();
-        
-        //free allocated memory
-        delete iPubFilesParams;
-        iPubFilesParams = NULL;
-        }
-    if ( iListDataOwnersParams )
-        {
-        copy->iListDataOwnersParams = iListDataOwnersParams->CopyL();
-        
-        //free allocated memory
-        delete iListDataOwnersParams;
-        iListDataOwnersParams = NULL;
-        }
-    if ( iRebootParams )
-        {
-        copy->iRebootParams = iRebootParams->CopyL();
-        
-        //free allocated memory
-        delete iRebootParams;
-        iRebootParams = NULL;
-        }
-    if ( iGetMetadataParams )
-        {
-        copy->iGetMetadataParams = iGetMetadataParams->CopyL();
-        
-        //free allocated memory
-        delete iGetMetadataParams;
-        iGetMetadataParams = NULL;
-        }
-    CleanupStack::Pop( copy );
-    return copy;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConTaskReply::CleanTaskData()
-// 
-// -----------------------------------------------------------------------------
-// 
-void CSConTaskReply::CleanTaskData()
-    {
-    switch( iMethod )   
-        {
-        case EGetDataSize :
-            if ( iGetDataSizeParams )
-                {
-                this->iGetDataSizeParams->DeleteDataOwners();
-                }
-            break;
-        case EGetDataOwnerStatus :
-            if ( iGetDataOwnerParams )
-                {
-                this->iGetDataOwnerParams->DeleteDataOwners();
-                }
-            break;
-        case EListDataOwners :
-            if ( iListDataOwnersParams )
-                {
-                this->iListDataOwnersParams->DeleteDataOwners();
-                }
-            break;
-        case ERequestData :
-            if ( iRequestDataParams )
-                {
-                this->iRequestDataParams->DeleteDataAndDataOwner();
-                }
-            break;
-        default :
-            break;
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConStatusReply::CSConStatusReply()
-// 
-// -----------------------------------------------------------------------------
-// 
-CSConStatusReply::CSConStatusReply()
-    {
-    }
-   
-// -----------------------------------------------------------------------------
-// CSConStatusReply::~CSConStatusReply()
-// 
-// -----------------------------------------------------------------------------
-//      
-CSConStatusReply::~CSConStatusReply() 
-    {
-    iTasks.ResetAndDestroy();
-    iTasks.Close();
-    };
-
-// End of file
--- a/connectivitymodules/SeCon/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* 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:  Build info file for SeCon
-*
-*/
-
-#include <platform_paths.hrh>
-
-#include "../catalogspcconnectivityplugin/group/bld.inf"
-#include "../cntparser/bld/bld.inf"
-#include "../services/csc/bld/bld.inf"
-#include "../services/ftp/bld/bld.inf"
-#include "../services/pcd/bld/bld.inf"
-// #include "../services/oviaccounthandler/group/bld.inf"
-
-#include "../wbxml/conmlhandler/bld/bld.inf"
-#include "../servers/pcconn/bld/bld.inf"
-#include "../servers/syncserver/group/bld.inf"
-
-#include "../clients/pcconn/bld/bld.inf"
-#include "../clients/syncclient/group/bld.inf"
-
-#include "../plugins/pcconn/bld/bld.inf"
-#include "../plugins/ftp/bld/bld.inf"
-#include "../plugins/hapticsconnplugin/group/bld.inf"
-
-PRJ_EXPORTS
-
-// Export stub files
-stubs/secon_stub.sis                /epoc32/data/z/system/install/secon_stub.sis
-stubs/sconpcconnplugin_stub.sis     /epoc32/data/z/system/install/sconpcconnplugin_stub.sis
-stubs/sconftpplugin_stub.sis        /epoc32/data/z/system/install/sconftpplugin_stub.sis
-
-../rom/sconpcconnclientserver.iby   CORE_APP_LAYER_IBY_EXPORT_PATH(sconpcconnclientserver.iby)
-
-
--- a/connectivitymodules/SeCon/group/stubs/createstubs.bat	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +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: Batch file for creating needed stub files.
-rem
-
-makesis -s sconftpplugin_stub.pkg
-makesis -s sconpcconnplugin_stub.pkg
-makesis -s secon_stub.pkg
--- a/connectivitymodules/SeCon/group/stubs/sconftpplugin_stub.pkg	Tue Aug 31 15:05:37 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: Sis-stub file for FTP Plugin
-;
-; Languages
-&EN
-
-; Header
-#{"FTP Plugin"},(0x101F9686),1,0,0, TYPE=SA
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Files to install
-""-"z:\resource\plugins\sconftpplugin.rsc"
-""-"z:\sys\bin\sconftpplugin.dll"
Binary file connectivitymodules/SeCon/group/stubs/sconftpplugin_stub.sis has changed
--- a/connectivitymodules/SeCon/group/stubs/sconpcconnplugin_stub.pkg	Tue Aug 31 15:05:37 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: Sis-stub file for PCConn Plugin
-;
-; Languages
-&EN
-
-; Header
-#{"PCConn Plugin"},(0x101F9688),1,0,0, TYPE=SA
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Files to install
-""-"z:\resource\plugins\sconpcconnplugin.rsc"
-""-"z:\sys\bin\sconpcconnplugin.dll"
Binary file connectivitymodules/SeCon/group/stubs/sconpcconnplugin_stub.sis has changed
--- a/connectivitymodules/SeCon/group/stubs/secon_stub.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +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: Sis-stub file for Service Controllers
-;
-; Languages
-&EN
-
-; Header
-#{"Service Controllers"},(0x101F99F6),1,73,0, TYPE=SA
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Files to install
-""-"z:\sys\bin\sconpcconnserver.exe"
-""-"z:\sys\bin\sconpcconnclient.dll"
-""-"z:\sys\bin\sconpcd.dll"
-""-"z:\resource\sconftp.r??"
-""-"z:\sys\bin\sconftp.dll"
-""-"z:\sys\bin\sconcsc.dll"
-""-"z:\sys\bin\sconconmlhandler.dll"
-""-"z:\sys\bin\catalogspcconnectivityplugin.dll"
-""-"z:\sys\bin\cntparserserver.dll"
-""-"z:\sys\bin\cntparserserverexe.exe"
Binary file connectivitymodules/SeCon/group/stubs/secon_stub.sis has changed
--- a/connectivitymodules/SeCon/inc/debug.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +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:  Debug utility for SeCon components.
-*
-*/
-
-
-#ifndef _SECON_DEBUG_H
-#define _SECON_DEBUG_H
-
-#ifdef _DEBUG
-    
-    // Enable file logging
-    #define __FLOGGING__
-    
-    #include <e32svr.h>
-    #ifdef __FLOGGING__
-        #include <f32file.h>
-        #include <flogger.h>
-    #endif
-    
-    NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow
-        {
-    public:
-        void Overflow(TDes16& /*aDes*/) {}
-        };
-    
-    NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow
-        {
-    public:
-        void Overflow(TDes8& /*aDes*/) {}
-        };
-    
-    _LIT( KLogDir, "SECON" );
-    _LIT( KLogFile, "SeconDebug.txt" );
-    
-    _LIT(KTracePrefix16, "[SeCon] ");
-    _LIT8(KTracePrefix8, "[SeCon] ");
-    _LIT8(KFuncEntryFormat8, "%S : Begin");
-    _LIT8(KFuncExitFormat8, "%S : End");
-    _LIT8(KFuncReturnFormat8, "%S : End, return: %d");
-    _LIT8(KFuncFormat8, "><%S");
-    
-    const TInt KMaxLogLineLength = 512;
-    
-    // old function loggin macros
-    #define LOGGER_ENTERFN( name )      {TRACE_FUNC_ENTRY;}
-    #define LOGGER_LEAVEFN( name )      {TRACE_FUNC_EXIT;}
-    
-    #define LOGGER_WRITE( text )                    {_LIT( KTemp, text ); FPrint( KTemp );}
-    #define LOGGER_WRITE_1( text,par1 )             {_LIT( KTemp, text ); FPrint( KTemp, par1 );}
-    #define LOGGER_WRITE8_1( text,par1 )            {_LIT8( KTemp, text ); FPrint( KTemp, par1 );}
-    #define LOGGER_WRITE_2( text,par1,par2 )        {_LIT( KTemp, text ); FPrint( KTemp, par1, par2 );}
-    #define LOGGER_WRITE_3( text,par1,par2,par3 )   {_LIT( KTemp, text ); FPrint( KTemp, par1, par2, par3 );}
-    
-    // New function logging macros
-    #define TRACE_FUNC_ENTRY {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncEntryFormat8, &ptr8);}
-    #define TRACE_FUNC_EXIT {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncExitFormat8, &ptr8);}
-    #define TRACE_FUNC {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncFormat8, &ptr8);}
-    
-    #define TRACE_FUNC_RET( number )  {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncReturnFormat8, &ptr8, number);}
-    // Declare the FPrint function
-    inline void FPrint( TRefByValue<const TDesC16> aFmt, ...)
-        {
-        VA_LIST list;
-        VA_START(list,aFmt);
-    #ifdef __FLOGGING__
-        RFileLogger::WriteFormat( KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list );
-    #endif
-        TBuf16<KMaxLogLineLength> theFinalString;
-        theFinalString.Append(KTracePrefix16);
-        TOverflowTruncate16 overflow;
-        theFinalString.AppendFormatList(aFmt,list,&overflow);
-        RDebug::Print(theFinalString);
-        }
-    
-    // Declare the FPrint function
-    inline void FPrint(TRefByValue<const TDesC8> aFmt, ...)
-        {
-        VA_LIST list;
-        VA_START(list, aFmt);
-    #ifdef __FLOGGING__
-        RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
-    #endif
-        TOverflowTruncate8 overflow;
-        TBuf8<KMaxLogLineLength> buf8;
-        buf8.Append(KTracePrefix8);
-        buf8.AppendFormatList(aFmt, list, &overflow);
-        TBuf16<KMaxLogLineLength> buf16(buf8.Length());
-        buf16.Copy(buf8);
-        TRefByValue<const TDesC> tmpFmt(_L("%S"));
-        RDebug::Print(tmpFmt, &buf16);
-        }
-#else
-    
-    // No loggings --> reduced code size
-
-    #define LOGGER_ENTERFN( name )
-    #define LOGGER_LEAVEFN( name )
-    #define LOGGER_WRITE( text )
-    #define LOGGER_WRITE_1( text, par1 )
-    #define LOGGER_WRITE8_1( text, par1 )
-    #define LOGGER_WRITE_2( text, par1, par2 )
-    #define LOGGER_WRITE_3( text, par1, par2, par3 )
-    #define TRACE_FUNC_ENTRY
-    #define TRACE_FUNC_EXIT
-    #define TRACE_FUNC
-    #define TRACE_FUNC_RET( number )
-
-#endif //_DEBUG
-
-#endif // SECON_DEBUG_H
-
-// End of file
-
--- a/connectivitymodules/SeCon/plugins/ftp/bld/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-/*
-* Copyright (c) 2002-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:  File Transfer Profile Plug-in build information file.
-*
-*/
-PRJ_EXPORTS
-../rom/sconftpplugin.iby         CORE_APP_LAYER_IBY_EXPORT_PATH(sconftpplugin.iby)
-
-PRJ_PLATFORMS  
-DEFAULT
-
-PRJ_MMPFILES
-sconftpplugin.mmp
--- a/connectivitymodules/SeCon/plugins/ftp/bld/def/bwinscwU.DEF	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
-
--- a/connectivitymodules/SeCon/plugins/ftp/bld/def/eabiU.DEF	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	_Z24ImplementationGroupProxyRi @ 1 NONAME
-	_ZTI14CSConFTPplugin @ 2 NONAME ; #<TI>#
-	_ZTV14CSConFTPplugin @ 3 NONAME ; #<VT>#
-
--- a/connectivitymodules/SeCon/plugins/ftp/bld/sconftpplugin.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* 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:  File Transfer Profile Plug-in
-*
-*/
-
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-VENDORID        VID_DEFAULT
-
-CAPABILITY      CAP_ECOM_PLUGIN
-
-TARGET          sconftpplugin.dll
-TARGETTYPE      PLUGIN
-
-UID             0x10009D8D 0x101F9686
-
-SOURCEPATH     	../src
-
-SOURCE          sconftpplugin.cpp
-SOURCE          proxy.cpp
-SOURCE          sconftppluginutils.cpp
-SOURCE          sconservicetimer.cpp
-SOURCE          sconshutdownwatcher.cpp
-
-START RESOURCE 101f9686.rss
-  TARGET        sconftpplugin.rsc
-END
-
-// Default system include paths.
-APP_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE     ../inc 
-USERINCLUDE     ../../../inc 
-USERINCLUDE     ../../../services/ftp/inc 
-
-DEBUGLIBRARY    flogger.lib
-LIBRARY	        euser.lib
-LIBRARY	        irobex.lib 
-LIBRARY         ecom.lib			
-LIBRARY	        efsrv.lib 
-LIBRARY         bluetooth.lib
-LIBRARY         esock.lib 
--- a/connectivitymodules/SeCon/plugins/ftp/inc/sconftpplugin.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +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:  File Transfer Profile Plug-in header file
-*
-*/
-
-
-#ifndef _SCONFTPPLUGIN_H
-#define _SCONFTPPLUGIN_H
-
-#include <obexserver.h>
-#include <SrcsInterface.h>
-
-#include "sconshutdownwatcher.h"
-
-// forward declaration
-class CSConFTP;
-class CSConServiceTimer;
-// CLASS DECLARATION
-
-/*
-* File Transfer Profile Plugin class
-*
-*/
-
-class CSConFTPplugin : public CSrcsInterface, public MObexServerNotify,
-                          public MShutdownObserver
-    {
-    public:
-        static CSConFTPplugin* NewL();
-        ~CSConFTPplugin();
-
-        /**
-         * Returns active status of OBEX session
-         * @return ETrue if session is active, else EFalse
-         */
-        TBool IsOBEXActive();
-        
-        /**
-         * Device is shutting down, abort connection.
-         */
-        void NotifyShutdown();
-
-    private:
-        /**
-         * Loads sconftp.dll module
-         * @return none
-         */
-        void LoadFTPDllL();
-        /**
-         * Closes initialized services
-         * @return none
-         */
-        void Disconnect();
-        /**
-         * Removes spaces and nulls from the end of the string
-         * @param aDes String to be formatted
-         * @return none
-         */
-        void TrimRightSpaceAndNull( TDes8& aDes ) const;
-        /**
-         * Current used transfer media (IR,USB,BT)
-         * @param aMediaType Enumeration indicating the media type
-         * @return none
-         */
-        void SetMediaType( TSrcsMediaType aMediaType );
-        /**
-         * MObexServerNotify implementation
-         * @param aError Error code
-         * @return none
-         */
-        void ErrorIndication( TInt aError );
-        /**
-         * MObexServerNotify implementation
-         * @return none
-         */
-        void TransportUpIndication();
-        /**
-         * MObexServerNotify implementation
-         * @return none
-         */
-        void TransportDownIndication();
-        /**
-         * MObexServerNotify implementation
-         * @param aRemoteInfo Structure containing information used during OBEX
-         * connection
-         * @param aInfo Further information about the requested connection
-         * @return System wide error code that indicates the success of the connection
-         */
-        TInt ObexConnectIndication( const TObexConnectInfo& aRemoteInfo,
-                                    const TDesC8& aInfo );
-        /**
-         * MObexServerNotify implementation
-         * @param aInfo Contains information about the disconnection
-         * @return none
-         */
-        void ObexDisconnectIndication( const TDesC8& aInfo );
-        /**
-         * MObexServerNotify implementation
-         * @return CObexBaseObject-derived object, which the object being put
-         * will be parsed into.
-         */
-        CObexBufObject* PutRequestIndication();
-        /**
-         * MObexServerNotify implementation
-         * @return System wide error code that indicates the success of the
-         * PUT packet operation.
-         */
-        TInt PutPacketIndication();
-        /**
-         * MObexServerNotify implementation
-         * @return System wide error code that indicates the success of the
-         * PUT packet operation.
-         */
-        TInt PutCompleteIndication();
-        /**
-         * MObexServerNotify implementation
-         * @param aRequiredObject Details about the object the remote client
-         * has requested
-         * @returnObject to return to the client
-         */
-        CObexBufObject* GetRequestIndication( CObexBaseObject
-                                                *aRequiredObject );
-        /**
-         * MObexServerNotify implementation
-         * @return System wide error code that indicates the success of the
-         * GET packet operation.
-         */
-        TInt GetPacketIndication();
-        /**
-         * MObexServerNotify implementation
-         * @return System wide error code that indicates the success of the
-         * GET packet operation.
-         */
-        TInt GetCompleteIndication();
-        /**
-         * MObexServerNotify implementation
-         * @param aPathInfo SETPATH command parameters
-         * @param aInfo Not currently used
-         * @return System wide error code indicating the success of the
-         * setpath command.
-         */
-        TInt SetPathIndication( const CObex::TSetPathInfo& aPathInfo,
-                                const TDesC8& aInfo );
-        /**
-         * SetObexServer
-         * @param aObexServer pass obex server pointer to sevice controller
-         * @return System wide error code.
-         */
-        TInt SetObexServer( CObexServer* aObexServer );
-        /**
-         * MObexServerNotify implementation
-         * @return none
-         */
-        void AbortIndication();
-
-        void ConstructL();
-    CSConFTPplugin();
-
-    private:
-        RLibrary                    iFTPlib;
-        CObexBufObject*             iObject;
-        CBufFlat*                   iBuffer;
-        CSConFTP*                   iFTPHandler;
-        TInt                        iPutError;
-        TBool                       iSessionActive;
-        CSConServiceTimer*          iServiceTimer;
-        TBool                       iStartTimer;
-        TSrcsMediaType              iMediaType;
-        CObexFileObject*            iFileObject;
-        TBool                       iPutPacketIndicationCalled;
-        CShutdownWatcher*           iShutdownWatcher;
-        TBool                       iShutdownInProgress;
-        CObexServer*                iObexServer;
-        RSocketServ                 iSocketServer;
-        RBTPhysicalLinkAdapter      iLinkAdapter;
-    private:
-        // Friend class is used,because existing impelentation has been working
-        // properly. Avoiding re-design.
-        friend class CSConServiceTimer;
-    };
-
-#endif // SCONPCCONNPLUGIN_H
--- a/connectivitymodules/SeCon/plugins/ftp/inc/sconftppluginutils.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* Copyright (c) 2005-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:  File Transfer Profile Plug-in Utils header
-*
-*/
-
-
-#ifndef _SCONFTPPLUGINUTILS_H
-#define _SCONFTPPLUGINUTILS_H
-
-#include <e32base.h>
-//============================================================
-// Class TFTPpluginUtils declaration
-//============================================================
-class TFTPpluginUtils
-	{
-	public:
-		/**
-		 * Converts Symbian error code to OBEX error code
-		 * @param aError The error code
-		 * @return The converted error code
-		 */
-		static TInt ConvertFTPResponseCode( TInt aError );
-	};
-
-#endif // _SCONFTPPLUGINUTILS_H
\ No newline at end of file
--- a/connectivitymodules/SeCon/plugins/ftp/inc/sconservicetimer.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* Copyright (c) 2005-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:  File Transfer Profile Plug-in Service Timer Header file
-*
-*/
-
-
-#ifndef _SCONSERVICETIMER_H
-#define _SCONSERVICETIMER_H
-
-#include <e32base.h>
-
-class CSConFTPplugin;
-
-
-//============================================================
-// Class CSConServiceTimer declaration
-//============================================================
-
-NONSHARABLE_CLASS ( CSConServiceTimer ) : public CActive
-	{
-	public:
-		CSConServiceTimer( CSConFTPplugin* aEngine, TInt aValue );
-		void ConstructL();
-		~CSConServiceTimer();
-		
-		/**
-	 	* Starts the timer
-		* @return none
-	 	*/
-		void StartTimer();
-		/**
-		 * Stops the timer
-		 * @return none
-		 */
-		void StopTimer();
-	
-	private:
-		void DoCancel();
-		void RunL();
-		
-	private:
-		RTimer 				iTimer;
-		CSConFTPplugin* 	iEngine;
-		TInt 				iValue;
-	};
-	
-#endif //_SCONSERVICETIMER_H
-
-// End of file
--- a/connectivitymodules/SeCon/plugins/ftp/inc/sconshutdownwatcher.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* 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:  Power shutdown -watcher header file
-*
-*/
-
-
-#ifndef _SCONSHUTDOWNWATCHER_H
-#define _SCONSHUTDOWNWATCHER_H
-
-
-#include <e32base.h>
-#include <e32property.h>
-
-//============================================================
-// Class MShutdownObserver declaration
-//============================================================
-class MShutdownObserver
-    {
-public:
-    virtual void NotifyShutdown()=0;
-    };
-
-//============================================================
-// Class CShutdownWatcher declaration
-//============================================================
-NONSHARABLE_CLASS (  CShutdownWatcher ) : public CActive
-    {
-    public:
-        static CShutdownWatcher* NewL( MShutdownObserver* aObserver );
-        ~CShutdownWatcher();
-
-        /**
-         * Starts to watch shutdown status
-         * @return none
-         */
-        void StartShutdownWatcher();
-
-    private:
-        //construct/destruct
-        CShutdownWatcher( MShutdownObserver* aObserver );
-        void ConstructL();
-
-        // from CActive
-        void DoCancel();
-        void RunL();
-
-    private:
-        MShutdownObserver*   iObserver; 
-        RProperty            iProperty;
-    };
-
-#endif //_SCONSHUTDOWNWATCHER_H
-
-// End of file
\ No newline at end of file
--- a/connectivitymodules/SeCon/plugins/ftp/rom/sconftpplugin.iby	Tue Aug 31 15:05:37 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: Image description file for FTPplugin
-*
-*/
-
-
-#ifndef __SCONFTP_PLUGIN_IBY__
-#define __SCONFTP_PLUGIN_IBY__
-//file content
-
-ECOM_PLUGIN(sconftpplugin.dll,101F9686.RSC)
-
-#endif
--- a/connectivitymodules/SeCon/plugins/ftp/src/101f9686.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* Copyright (c) 2005-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:  File Transfer Profile Plug-in resource file
-*
-*/
-
-
-#include "ecom/registryinfo.rh"
-
-// Declares info for two implementations
-RESOURCE REGISTRY_INFO theInfo
-	{
-	// UID for the DLL
-	dll_uid = 0x101F9686;
-	// Declare array of interface info
-	interfaces = 
-		{
-		INTERFACE_INFO
-			{
-			// UID of interface that is implemented
-			interface_uid = 0x101F7C8C;
-			implementations = 
-				{
-				// Info for CSConFTPplugin
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x101F9687;
-					version_no = 1;
-					display_name = "OBEX File Transfer";
-					default_data = "OBEX/BT";
-					
-					// 
-					// opaque_data contains parameters used by following API calls in SRCS:
-					// 1. Setup USB interface string descriptor in Unicode;
-					// 2. TInt CObex::SetLocalWho(const TDesC8& aInfo);
-					// 3. TInt CBTConnection::RegisterSecuritySettingsL( TUint aService,
-					//						 TInt  aProtocol,
-					//						 TInt  aChannel,
-					//						 TBool aAuthenticate,
-					//						 TBool aAuthorise,
-					//						 TBool aEncrypt );
-					// opaque_data = "@0||@1||@2||@3||@4||@5||@6"
-					// @0 aStrDesc		e.g. "OBEX File Transfer"
-					// @1 aInfo			e.g. KFolderBrowsingID, "\xF9\xEC\x7B\xC4\x95\x3C\x11\xd2\x98\x4E\x52\x54\x00\xDC\x9E\x09"
-					// @2 aService		e.g. KBTSecurityUidFileTransfer, 0x1106
-					// @3 aProtocol		e.g. KSolBtRFCOMM, 0x1013
-					// @4 aAuthenticate	e.g. EFalse, 0
-					// @5 aAuthorise	e.g. EFalse, 0
-					// @6 aEncrypt		e.g. EFalse, 0
-					//
-					opaque_data = "OBEX File Transfer||\xF9\xEC\x7B\xC4\x95\x3C\x11\xd2\x98\x4E\x52\x54\x00\xDC\x9E\x09||0x1106||0x1013||1||1||1";
-					}
-				};
-			}
-		};
-	}
-
--- a/connectivitymodules/SeCon/plugins/ftp/src/proxy.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* Copyright (c) 2005-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:  File Transfer Profile Plug-in proxy implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <e32std.h>
-#include <ecom/implementationproxy.h>
-
-#include "sconftpplugin.h"
-
-const TImplementationProxy ImplementationTable[] = 
-	{
-	IMPLEMENTATION_PROXY_ENTRY(0x101F9687,	CSConFTPplugin::NewL)
-	};
-
-// -----------------------------------------------------------------------------
-// TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-// Exported proxy for instantiation method resolution
-// -----------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
-														TInt& aTableCount)
-	{
-	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
-
-	return ImplementationTable;
-	}
--- a/connectivitymodules/SeCon/plugins/ftp/src/sconftpplugin.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,880 +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:  File Transfer Profile Plug-in implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include <obexconstantsinternal.h>
-#endif
-#include "sconftpplugin.h"
-#include "sconftp.h"
-#include "sconftppluginutils.h"
-#include "sconservicetimer.h"
-#include "debug.h"
-
-
-// CONSTANTS
-_LIT(KSConFTPLibName, "sconftp.dll");
-const TInt KSConFTPUidValue = 0x10009D8D;
-const TUid KSConFTPUid = {KSConFTPUidValue};
-
-// Folder listing type from IrObex specification
-_LIT8( KSConFolderListType, "x-obex/folder-listing" );
-
-_LIT( K_C_ROOT, "C:\\" );
-const TInt KSConBufSize = 262144; // 256KB
-// Time (in milliseconds) for the timer
-const TInt KSConTimeOutValue =  60000000;
-// Flags used to indicate SetPath commands
-const TInt KSConNULLSetPath =   0x00;
-
-const TInt KSConHeaderMaxLength = 256;
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::NewL()
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CSConFTPplugin* CSConFTPplugin::NewL()
-    {
-    TRACE_FUNC_ENTRY;
-    CSConFTPplugin* self = new ( ELeave ) CSConFTPplugin();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return( self );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::~CSConFTPplugin()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConFTPplugin::~CSConFTPplugin()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Disconnect from services.
-    Disconnect();
-    
-    if ( iFTPHandler )
-        {
-        delete iFTPHandler;
-        iFTPHandler = NULL;
-        iFTPlib.Close();
-        }
-    
-    delete iBuffer;
-    iBuffer = NULL;
-    delete iObject;
-    iObject = NULL;
-
-    if ( iServiceTimer )
-        {
-        iServiceTimer->Cancel();
-        }
-
-    delete iServiceTimer;
-    iServiceTimer = NULL;
-
-    if ( iFileObject )
-        {
-        delete iFileObject;
-        iFileObject = NULL;
-        }
-
-
-    delete iShutdownWatcher;
-    iShutdownWatcher = NULL;
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::IsOBEXActive()
-// Returns active status of OBEX session
-// -----------------------------------------------------------------------------
-//
-TBool CSConFTPplugin::IsOBEXActive()
-    {
-    TRACE_FUNC;
-    return iSessionActive;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::NotifyShutdown()
-// System is shutting down
-// -----------------------------------------------------------------------------
-//
-void CSConFTPplugin::NotifyShutdown()
-    {
-    TRACE_FUNC;
-    iShutdownInProgress = ETrue;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::LoadFTPDllL()
-// Loads sconftp.dll module
-// -----------------------------------------------------------------------------
-//
-void CSConFTPplugin::LoadFTPDllL()
-    {
-    TRACE_FUNC_ENTRY;
-    // Dynamically load DLL
-    User::LeaveIfError( iFTPlib.Load( KSConFTPLibName ) );
-    if ( iFTPlib.Type()[1] != KSConFTPUid )
-        {
-        LOGGER_WRITE( "KSConFTPUidValue incorrect" );
-        iFTPlib.Close();
-        User::Leave( KErrNotFound );
-        }
-    TSConCreateCSConFTPFunc CreateCSConFTPL =
-    (TSConCreateCSConFTPFunc)iFTPlib.Lookup(1);
-    iFTPHandler = (CSConFTP*)CreateCSConFTPL();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::Disconnect()
-// Closes initialized services
-// -----------------------------------------------------------------------------
-//
-void CSConFTPplugin::Disconnect()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iLinkAdapter.Close();
-    iSocketServer.Close();
-    
-    if ( iStartTimer != EFalse )
-        {
-        iServiceTimer->Cancel();
-        iServiceTimer->StartTimer();
-        }
-    
-    delete iObject;
-    iObject = NULL;
-    
-    if ( iFileObject )
-        {
-        delete iFileObject;
-        iFileObject = NULL;
-        }
-    if ( iFTPHandler )
-        {
-        delete iFTPHandler;
-        iFTPHandler = NULL;
-        iFTPlib.Close();
-        }
-
-    TRACE_FUNC_EXIT
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::ErrorIndication( TInt aError )
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-void CSConFTPplugin::ErrorIndication( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aError : %d", aError );
-    
-    if ( iFTPHandler )
-        {
-        iFTPHandler->AbortFileTransfer( iObject );
-        }
-
-    if ( iObject )
-        {
-        delete iObject;
-        iObject = NULL;
-        }
-    
-    if ( iFileObject )
-        {
-        iFileObject->Reset();
-        delete iFileObject;
-        iFileObject = NULL;
-        }
-
-    // Keep compiler happy
-    (void)aError;
-    
-    delete iShutdownWatcher;
-    iShutdownWatcher = NULL;
-    
-	if ( iLinkAdapter.IsOpen() )
-        {
-        // Cancel ActivateActiveRequester & allow going to low power mode
-        TInt err2 = iLinkAdapter.CancelLowPowerModeRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.CancelLowPowerModeRequester() err: %d", err2 );
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::AbortIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-void CSConFTPplugin::AbortIndication()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iFTPHandler )
-        {
-        iFTPHandler->AbortFileTransfer( iObject );
-        }
-
-    if ( iObject )
-        {
-        delete iObject;
-        iObject = NULL;
-        }
-    
-    if ( iFileObject )
-        {
-        iFileObject->Reset();
-        delete iFileObject;
-        iFileObject = NULL;
-        }
-    
-    delete iShutdownWatcher;
-    iShutdownWatcher = NULL;
-    
-    if ( iLinkAdapter.IsOpen() )
-        {
-        // Cancel ActivateActiveRequester & allow going to low power mode
-        TInt err = iLinkAdapter.CancelLowPowerModeRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.CancelLowPowerModeRequester() err: %d", err );
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::TransportUpIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-void CSConFTPplugin::TransportUpIndication()
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::ObexConnectIndication( const TObexConnectInfo& aRemoteInfo,
-// const TDesC8& aInfo )
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTPplugin::ObexConnectIndication(
-                        const TObexConnectInfo& /*aRemoteInfo*/,
-                        const TDesC8& /*aInfo*/ )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err( KErrNone );
-    iStartTimer = ETrue;
-    
-    if ( iMediaType == ESrcsMediaBT && iObexServer )
-        {
-        TSockAddr remoteAddr;
-        iObexServer->RemoteAddr( remoteAddr );
-        
-        TBTSockAddr btSockAddr( remoteAddr );
-        TBTDevAddr devAddr = btSockAddr.BTAddr();
-        
-        err = iSocketServer.Connect();
-        LOGGER_WRITE_1("iSocketServer.Connect err: %d", err );
-        if ( !err )
-            {
-            err = iLinkAdapter.Open( iSocketServer, devAddr );
-            LOGGER_WRITE_1("iLinkAdapter.Open err: %d", err );
-            }
-        // Ignore all BT link errors
-        err = KErrNone;
-        }
-    
-    if ( err == KErrNone && !iFTPHandler )
-        {
-        TRAP( err, LoadFTPDllL() );
-        LOGGER_WRITE_1( "LoadFTPDllL returned : %d", err );
-        }
-    
-    if ( err == KErrNone )
-        {
-        iFTPHandler->SetProfile( EStandard );
-        LOGGER_WRITE( "CSConFTPplugin::ObexConnectIndication() : iServiceTimer->StopTimer()" );
-        iServiceTimer->Cancel();
-        iServiceTimer->StopTimer();
-        }
-
-    TRACE_FUNC_EXIT;
-    LOGGER_WRITE_1( "CSConFTPplugin::ObexConnectIndication returned %d", err );
-    return TFTPpluginUtils::ConvertFTPResponseCode( err );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::ObexDisconnectIndication( const TDesC8& )
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-void CSConFTPplugin::ObexDisconnectIndication( const TDesC8& )
-    {
-    TRACE_FUNC_ENTRY;
-    Disconnect();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::TransportDownIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-void CSConFTPplugin::TransportDownIndication()
-    {
-    TRACE_FUNC_ENTRY;
-    Disconnect();
-    if ( iBuffer )
-        {
-        iBuffer->Reset();
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::PutRequestIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-CObexBufObject* CSConFTPplugin::PutRequestIndication()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    TInt err( KErrNone );
-    iPutError = KErrNone;
-
-    if ( iBuffer )
-        {
-        iBuffer->Reset();
-        }
-
-    if ( iObject )
-        {
-        delete iObject;
-        iObject = NULL;
-        }
-
-    TRAP( err, iObject = CObexBufObject::NewL ( iBuffer ) );
-
-    if ( err != KErrNone )
-        {
-        return NULL;
-        }
-
-    if ( !iFTPHandler )
-        {
-        LOGGER_WRITE( "Creating iFTPHandler has failed" );
-        return NULL;
-        }
-
-    TRAP( err, ret = iFTPHandler->PutFileObjectInitL( iObject, iBuffer ) );
-
-    if ( err != KErrNone )
-        {
-        LOGGER_WRITE_1( "iFTPHandler->PutFileObjectInitL() leaves: %d", err );
-        return NULL;
-        }
-    if ( ret != KErrNone )
-        {
-        LOGGER_WRITE_1( "PutFileObjectInitL failed - returning error in next PutPacketIndication : %d", ret );
-        iPutError = ret;
-        }
-    iPutPacketIndicationCalled = EFalse;
-    
-    if ( !iShutdownWatcher )
-        {
-        TRAP( err, iShutdownWatcher = CShutdownWatcher::NewL( this ) );
-        if ( err == KErrNone )
-            {
-            iShutdownWatcher->StartShutdownWatcher();
-            }
-        else
-            {
-            LOGGER_WRITE_1( "CShutdownWatcher::NewL leaves: %d", err );
-            }
-        }
-    
-    if ( iLinkAdapter.IsOpen() )
-        {
-        // request active BT mode (high power mode)
-        err = iLinkAdapter.ActivateActiveRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.ActivateActiveRequester() err: %d", err );
-        }
-    
-    TRACE_FUNC_EXIT;
-    return( iObject );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::PutPacketIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTPplugin::PutPacketIndication()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    
-    // always normal file transfer
-    if ( (TInt)iObject->Length() > 0 )
-        {
-        if ( !iPutPacketIndicationCalled )
-            {
-            // This is first check, need to check only once
-            TFileName path;
-            iFTPHandler->GetPath( path );
-            if ( path.CompareF( K_C_ROOT ) == 0 )
-                {
-                // path forbidden
-                ret = KErrAccessDenied;
-                }
-            else
-                {
-                if ( iPutError != KErrNone )
-                    {
-                    ret = iPutError;
-                    LOGGER_WRITE_1( "CSConFTPplugin::PutPacketIndication() : PutError : %d", iPutError );
-                    }
-                else
-                    {
-                    // check required free space
-                    // if filesize is small ( <65k ) it fits into one package and its already saved to filesystem.
-                    // if file is larger, need to check is there enought free space in device.
-                    
-                    const TUint32  filesize = iObject->Length();
-                    LOGGER_WRITE_1( "CSConFTPplugin::PutPacketIndication() filesize %d", filesize );
-                    LOGGER_WRITE_1( "CSConFTPplugin::PutPacketIndication() iObject->BytesReceived() %d", iObject->BytesReceived() );
-                    if ( filesize > iObject->BytesReceived() )
-                        {
-                        LOGGER_WRITE( "CSConFTPplugin::PutPacketIndication() : check freespace" );
-                        // file does not fit into one obex packet, check is there enought free space in current drive
-                        if ( iFTPHandler->IsCurrentDiskSpaceBelowCritical( filesize ) )
-                            {
-    	                    LOGGER_WRITE( "CSConFTPplugin::PutPacketIndication() : returning KErrNoMemory" );
-                            ret = KErrNoMemory;
-                            }
-                        }
-                    }
-                }
-            }
-        
-        if ( iShutdownInProgress )
-            {
-            LOGGER_WRITE( "ShutdownInProgress, abort" );
-            ret = KErrDisconnected;
-            }
-        }
-    
-    if ( !iPutPacketIndicationCalled )
-        {
-        // Need to check only once
-        iPutPacketIndicationCalled = ETrue;
-        
-        //Check if filename is too long.
-        TFileName path;
-        iFTPHandler->GetPath( path );
-        if ( ret == KErrNone && path.Length() + iObject->Name().Length() > KMaxFileName )
-            {
-            LOGGER_WRITE_1( "Name length overflow! : %d", path.Length() + iObject->Name().Length() );
-            ret = KErrBadName;
-            }
-        }
-    
-    if ( ret != KErrNone )
-        {
-        if ( iFTPHandler )
-            {
-            iFTPHandler->AbortFileTransfer( iObject );
-            }
-        
-        delete iObject;
-        iObject = NULL;
-        
-        if ( iLinkAdapter.IsOpen() )
-            {
-            // Cancel ActivateActiveRequester & allow going to low power mode
-            TInt err = iLinkAdapter.CancelLowPowerModeRequester();
-            LOGGER_WRITE_1( "iLinkAdapter.CancelLowPowerModeRequester() err: %d", err );
-            }
-        }
-    
-    LOGGER_WRITE_1( "CSConFTPplugin::PutPacketIndication returned: %d", ret );
-    return TFTPpluginUtils::ConvertFTPResponseCode( ret );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::PutCompleteIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTPplugin::PutCompleteIndication()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    TInt err( KErrNone );
-    
-    if ( iLinkAdapter.IsOpen() )
-        {
-        // Cancel ActivateActiveRequester & allow going to low power mode
-        TInt err2 = iLinkAdapter.CancelLowPowerModeRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.CancelLowPowerModeRequester() err: %d", err2 );
-        }
-    
-    TObexHeaderMask validHdrs = iObject->ValidHeaders();
-    TTime time = iObject->Time();
-    
-    // shutdownWatcher is not needed anymore
-    delete iShutdownWatcher;
-    iShutdownWatcher = NULL;
-
-    TInt size = iObject->BytesReceived();
-
-    if (!(validHdrs & KObexHdrTime))
-        {
-        LOGGER_WRITE( "CSConFTPplugin::PutCompleteIndication() no valid time header received - using hometime" );
-        time.HomeTime();
-        TRAP( ret, iObject->SetTimeL(time) );
-        LOGGER_WRITE_1( "CSConFTPplugin::PutCompleteIndication SetTimeL  %d", ret );
-        }
-
-    if ( ( validHdrs & KObexHdrBody ) || ( validHdrs & KObexHdrEndOfBody ) )
-        {
-        LOGGER_WRITE_1( "CSConFTPplugin::PutCompleteIndication : number of received bytes  %d", size );
-        TSConUsedMedia media( ESConNoMedia );
-
-        switch ( iMediaType )
-            {
-            case ESrcsMediaBT:
-                media = ESConBTMedia;
-                break;
-            case ESrcsMediaIrDA:
-                media = ESConIRMedia;
-                break;
-            case ESrcsMediaUSB:
-                media = ESConUSBMedia;
-                break;
-            default:
-                media = ESConNoMedia;
-                break;
-            }
-        iFTPHandler->SetUsedMedia( media );
-        
-        TRAP( ret, err =
-        this->iFTPHandler->PutFileObjectFinalizeL( iObject ) );
-        LOGGER_WRITE_1( "CSConFTPplugin::PutCompleteIndication :PutFileObjectL  %d", ret );
-        }
-    else
-        {
-        LOGGER_WRITE( "CSConFTPplugin::PutCompleteIndication() : Delete  starts" );
-        TRAP( ret, err = this->iFTPHandler->DeleteObjectL( iObject->Name() ) );
-        LOGGER_WRITE_1( "CSConFTPplugin::PutCompleteIndication : DeleteObjectL  %d", ret );
-        }
-
-    if ( iObject )
-        {
-        delete iObject;
-        iObject = NULL;
-        }
-
-    iFTPHandler->DeleteTempFile();
-
-    if ( ret != KErrNone )
-        {
-        LOGGER_WRITE_1( "CSConFTPplugin::PutCompleteIndication : returned  %d", ret );
-        return TFTPpluginUtils::ConvertFTPResponseCode( ret );
-        }
-
-    LOGGER_WRITE_1( "CSConFTPplugin::PutCompleteIndication : returned  %d", err );
-    return TFTPpluginUtils::ConvertFTPResponseCode( err );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::GetRequestIndication( CObexBaseObject* aRequiredObject )
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-CObexBufObject* CSConFTPplugin::GetRequestIndication(
-                                            CObexBaseObject* aRequiredObject )
-    {
-    TRACE_FUNC_ENTRY;
-    CObexBufObject* bufObject(NULL);
-    if ( aRequiredObject->Type().Length() > KSConHeaderMaxLength )
-        {
-        LOGGER_WRITE("TypeHeader too big");
-        return NULL;
-        }
-    if ( aRequiredObject->Name().Length() > KMaxFileName )
-        {
-        LOGGER_WRITE("NameHeader is too long");
-        return NULL;
-        }
-    TInt ret( KErrNone );
-    TInt err( KErrNone );
-    TBuf8<KSConHeaderMaxLength> typeHeader( aRequiredObject->Type() );
-    TrimRightSpaceAndNull( typeHeader );
-    LOGGER_WRITE8_1("type: %S", &typeHeader);
-    LOGGER_WRITE_1("name: %S", &aRequiredObject->Name());
-
-    iBuffer->Reset();
-    
-    delete iObject;
-    iObject = NULL;
-    
-    TRAP( err, iObject = CObexBufObject::NewL ( iBuffer ) );
-    if ( err != KErrNone )
-        {
-        return NULL;
-        }
-    
-    // Client requests folder listing
-    if ( typeHeader == KSConFolderListType )
-        {
-        LOGGER_WRITE( "Client requests folder listning" );
-        if ( !iFTPHandler )
-            {
-            LOGGER_WRITE( "Creating iFTPHandler has failed" );
-            return NULL;
-            }
-
-        TRAP( err, ret = iFTPHandler->GetFolderObjectL( iObject ) );
-        LOGGER_WRITE_1( "iFTPHandler->GetFolderObjectL() returned: %d", ret );
-        if ( err == KErrNone && ret == KErrNone )
-            {
-            bufObject = iObject;
-            }
-        else
-            {
-            LOGGER_WRITE_1( "CSConFTPplugin::GetRequestIndication : Leavecode returned  %d", err );
-            return NULL;
-            }
-        }
-
-    // Client requests a file
-    else
-        {
-        if ( iFileObject )
-            {
-            delete iFileObject;
-            iFileObject = NULL;
-            }
-        
-        TRAP( err, iFileObject = CObexFileObject::NewL() );
-        if ( err != KErrNone )
-            {
-            LOGGER_WRITE( "Creating iFileObject has failed" );
-            return NULL;
-            }
-        iFileObject->Reset();
-        TRAP( err, iFileObject->SetNameL( aRequiredObject->Name() ) );
-
-        if ( err == KErrNone )
-            {
-            if ( !iFTPHandler )
-                {
-                LOGGER_WRITE( "CSConFTPplugin::GetRequestIndication() Creating iFTPHandler has failed" );
-                return NULL;
-                }
-
-            TRAP( err, ret =
-            this->iFTPHandler->GetFileObjectL( iFileObject ) );
-            LOGGER_WRITE_1( "CSConFTPplugin::GetRequestIndication :  GetFileObjectL returned  %d", ret );
-            }
-        if ( err == KErrNone && ret == KErrNone )
-            {
-            bufObject = (CObexBufObject*)iFileObject;
-            }
-        else
-            {
-            LOGGER_WRITE_1( "CSConFTPplugin::GetRequestIndication : Leavecode   %d", err );
-            return NULL;
-            }
-        }
-    if ( bufObject && iLinkAdapter.IsOpen() )
-        {
-        // request active BT mode (high power mode)
-        err = iLinkAdapter.ActivateActiveRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.ActivateActiveRequester() err: %d", err );
-        }
-    return bufObject;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::GetPacketIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTPplugin::GetPacketIndication()
-    {
-    TRACE_FUNC;
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::GetCompleteIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTPplugin::GetCompleteIndication()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iLinkAdapter.IsOpen() )
-        {
-        // Cancel ActivateActiveRequester & allow going to low power mode
-        TInt err = iLinkAdapter.CancelLowPowerModeRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.CancelLowPowerModeRequester() err: %d", err );
-        }
-    
-    TInt ret( KErrNone );
-    if ( iFileObject )
-        {
-        iFileObject->Reset();
-        delete iFileObject;
-        iFileObject = NULL;
-        }
-
-    LOGGER_WRITE_1( "CSConFTPplugin::GetCompleteIndication() : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::SetPathIndication( const CObex::TSetPathInfo& aPathInfo,
-// const TDesC8& aInfo )
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTPplugin::SetPathIndication( const CObex::TSetPathInfo& aPathInfo,
-                                        const TDesC8& /*aInfo*/ )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    TInt err( KErrNone );
-
-    if ( !iFTPHandler )
-        {
-        LOGGER_WRITE( "Creating iFTPHandler has failed" );
-        return TFTPpluginUtils::ConvertFTPResponseCode( KErrNoMemory );
-        }
-
-    if ( aPathInfo.iFlags == KSConNULLSetPath )
-        {
-        TRAP( err, ret = this->iFTPHandler->CreateFolderL( aPathInfo.iName ) );
-        }
-    else
-        {
-        TRAP( err, ret = this->iFTPHandler->SetPathL( aPathInfo.iName,
-        aPathInfo.iFlags ) );
-        }
-    
-    if ( err != KErrNone )
-        {
-        LOGGER_WRITE_1( "CSConFTPplugin::SetPathIndication : returned   %d", err );
-        return TFTPpluginUtils::ConvertFTPResponseCode( err );
-        }
-    LOGGER_WRITE_1( "CSConFTPplugin::SetPathIndication : returned %d", ret );
-    return TFTPpluginUtils::ConvertFTPResponseCode( ret );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::TrimRightSpaceAndNull( TDes8& aDes ) const
-// Removes spaces and nulls from the end of the string
-// -----------------------------------------------------------------------------
-//
-void CSConFTPplugin::TrimRightSpaceAndNull( TDes8& aDes ) const
-    {
-    TRACE_FUNC;
-    aDes.TrimRight();
-    if ( aDes.Length() > 0 )
-        {
-        if ( !aDes[aDes.Length() - 1] )
-            {
-            aDes.SetLength( aDes.Length() - 1 );
-            }
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::SetMediaType ( TSrcsMediaType aMediaType )
-// Current used transfer media (IR,USB,BT)
-// -----------------------------------------------------------------------------
-//
-void CSConFTPplugin::SetMediaType ( TSrcsMediaType aMediaType )
-    {
-    TRACE_FUNC;
-    iMediaType = aMediaType;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::CSConFTPplugin()
-// Constructor
-// -----------------------------------------------------------------------------
-//
-CSConFTPplugin::CSConFTPplugin()
-    {
-    TRACE_FUNC;
-    iBuffer = NULL;
-    iObject = NULL;
-    iFileObject = NULL;
-    iSessionActive = EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CSConFTPplugin::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    iBuffer = CBufFlat::NewL( KSConBufSize );
-    iObject = CObexBufObject::NewL ( iBuffer );
-    iServiceTimer = new (ELeave) CSConServiceTimer( this, KSConTimeOutValue );
-    iServiceTimer->ConstructL();
-    CActiveScheduler::Add( iServiceTimer );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTPplugin::SetObexServer( CObexServer* aObexServer )
-// SetObexServer
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTPplugin::SetObexServer( CObexServer* aObexServer )
-    {
-    iObexServer = aObexServer;
-    TInt ret = iObexServer->Start(this);
-    LOGGER_WRITE_1( "CSConFTPplugin::SetObexServer() ret: %d", ret );
-    return ret;
-    }
-
-// End of file
-
--- a/connectivitymodules/SeCon/plugins/ftp/src/sconftppluginutils.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
-* Copyright (c) 2005-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:  File Transfer Profile Plug-in utilities
-*
-*/
-
-
-// INCLUDE FILES
-#include <obexconstants.h>
-#include "sconftppluginutils.h"
-#include "debug.h"
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// TFTPpluginUtils::ConvertFTPResponseCode( TInt aError )
-// Converts Symbian error code to OBEX error code
-// -----------------------------------------------------------------------------
-//
-TInt TFTPpluginUtils::ConvertFTPResponseCode( TInt aError )
-	{
-	LOGGER_WRITE_1( "TFTPpluginUtils::ConvertFTPResponseCode : begin Code  %d", aError );
-	TInt obexErr ( KErrIrObexRespBadRequest );
-	switch( aError )
-		{
-		case KErrNone:
-			obexErr = KErrNone;
-			break;
-		case KErrNotFound:
-			obexErr = KErrIrObexRespNotFound;
-			break;
-		case KErrGeneral:
-		case KErrCancel:
-			obexErr = KErrIrObexRespBadRequest;
-			break;
-		case KErrNoMemory:
-			obexErr = KErrIrObexRespDatabaseFull;
-			break;
-		case KErrNotSupported:
-			obexErr = KErrIrObexRespNotImplemented;
-			break;
-		case KErrArgument:
-		case KErrTotalLossOfPrecision:
-		case KErrBadHandle:
-		case KErrOverflow:
-		case KErrUnderflow:
-		case KErrAlreadyExists:
-			obexErr = KErrIrObexRespConflict;
-			break;
-		case KErrPathNotFound:
-		case KErrDied:
-			obexErr = KErrIrObexRespNotFound;
-			break;
-		case KErrInUse:
-			obexErr = KErrIrObexRespTimedOut;
-			break;
-		case KErrServerTerminated:
-			obexErr = KErrIrObexRespNotFound;
-			break;
-		case KErrServerBusy:
-		case KErrCompletion:
-		case KErrNotReady:
-		case KErrUnknown:
-		case KErrCorrupt:
-			obexErr = KErrIrObexRespForbidden;
-			break;
-		case KErrAccessDenied:
-		case KErrLocked:
-			obexErr = KErrIrObexRespUnauthorized;
-			break;
-		case KErrWrite:
-		case KErrDisMounted:
-		case KErrEof:
-			obexErr = KErrIrObexRespForbidden;
-			break;
-		case KErrDiskFull:
-			obexErr = KErrIrObexRespDatabaseFull;
-			break;
-		case KErrBadDriver:
-		case KErrBadName:
-			obexErr = KErrIrObexRespPreCondFailed;
-			break;
-		case KErrCommsLineFail:
-		case KErrCommsFrame:
-		case KErrCommsOverrun:
-		case KErrCommsParity:
-		case KErrTimedOut:
-		case KErrCouldNotConnect:
-		case KErrCouldNotDisconnect:
-		case KErrBadLibraryEntryPoint:
-		case KErrBadDescriptor:
-		case KErrAbort:
-			obexErr = KErrIrObexRespForbidden;
-			break;
-		case KErrTooBig:
-			obexErr = KErrIrObexRespReqEntityTooLarge;
-			break;
-		case KErrDivideByZero:
-		case KErrBadPower:
-		case KErrDirFull:
-		case KErrHardwareNotAvailable:
-			obexErr = KErrIrObexRespForbidden;
-			break;
-		case KErrDisconnected: // System is shutting down
-		    obexErr = KErrIrObexRespMethodNotAllowed;
-		    break;
-		default:
-			obexErr = KErrIrObexRespBadRequest;
-			break;
-		};
-	LOGGER_WRITE_1( "TFTPpluginUtils::ConvertFTPResponseCode : returned %d", obexErr );
-	return obexErr;
-};
-
-//End of file
-
-
-
--- a/connectivitymodules/SeCon/plugins/ftp/src/sconservicetimer.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* Copyright (c) 2005-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:  File Transfer Profile Plug-in Service Timer implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "sconservicetimer.h"
-#include "sconftpplugin.h"
-#include "debug.h"
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::CSConServiceTimer( CSConFTPplugin* aEngine, TInt aValue )
-// Constuctor
-// -----------------------------------------------------------------------------
-//
-CSConServiceTimer::CSConServiceTimer( CSConFTPplugin* aEngine, TInt aValue )
-	: CActive( EPriorityStandard ), iEngine( aEngine ), iValue( aValue ) {}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CSConServiceTimer::ConstructL()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::ConstructL()" );
-	// create a thread-relative timer
-	User::LeaveIfError( iTimer.CreateLocal() );
-	LOGGER_LEAVEFN( "CSConServiceTimer::ConstructL()" );
-	}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::~CSConServiceTimer()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConServiceTimer::~CSConServiceTimer()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::~CSConServiceTimer()" );
-	iTimer.Close();
-	LOGGER_LEAVEFN( "CSConServiceTimer::~CSConServiceTimer()" );	
-	}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::~CSConServiceTimer()
-// Starts the timer
-// -----------------------------------------------------------------------------
-//
-void CSConServiceTimer::StartTimer()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::StartTimer()" );
-	if( !IsActive() )
-		{
-		LOGGER_WRITE( "CSConServiceTimer::StartTimer() : !IsActive()" );
-		iTimer.After( iStatus, TTimeIntervalMicroSeconds32( iValue ) );
-		iEngine->iSessionActive = ETrue;
-		SetActive();
-		LOGGER_WRITE( "CSConServiceTimer::StartTimer() : SetActive()" );
-		}
-	LOGGER_LEAVEFN( "CSConServiceTimer::StartTimer()" );
-	}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::StopTimer()
-// StopTimer()
-// -----------------------------------------------------------------------------
-//
-void CSConServiceTimer::StopTimer()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::StopTimer()" );
-	iEngine->iSessionActive = ETrue;	
-	LOGGER_WRITE( "CSConServiceTimer::StopTimer() : iSessionActive = ETrue" );
-	LOGGER_LEAVEFN( "CSConServiceTimer::StopTimer()" );	
-	}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::DoCancel()
-// Cancels the timer
-// -----------------------------------------------------------------------------
-//
-void CSConServiceTimer::DoCancel()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::DoCancel()" );
-	iTimer.Cancel();
-	LOGGER_LEAVEFN( "CSConServiceTimer::DoCancel()" );
-	}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::RunL()
-// Executed when timer is triggered
-// -----------------------------------------------------------------------------
-//
-void CSConServiceTimer::RunL()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::RunL()" );
-	iEngine->iSessionActive = EFalse;
-	LOGGER_WRITE( "CSConServiceTimer::RunL() : iSessionActive = EFalse" );
-	iEngine->iStartTimer = EFalse;
-	LOGGER_WRITE( "CSConServiceTimer::RunL() : iStartTimer = EFalse " );
-	LOGGER_LEAVEFN( "CSConServiceTimer::RunL()" );
-	}
-	
-// End of file
--- a/connectivitymodules/SeCon/plugins/ftp/src/sconshutdownwatcher.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/*
-* 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:  Power shutdown -watcher implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "sconshutdownwatcher.h"
-#include "debug.h"
-
-#include <startupdomainpskeys.h>
-
-
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::NewL( MShutdownObserver* aObserver )
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CShutdownWatcher* CShutdownWatcher::NewL( MShutdownObserver* aObserver )
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::NewL()" );
-    CShutdownWatcher* self = new (ELeave) CShutdownWatcher( aObserver );
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    LOGGER_LEAVEFN( "CShutdownWatcher::NewL()" );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::~CShutdownWatcher()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CShutdownWatcher::~CShutdownWatcher()
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::~CShutdownWatcher()" );
-    Cancel();
-    iProperty.Close();
-    LOGGER_LEAVEFN( "CShutdownWatcher::~CShutdownWatcher()" );
-    }
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::StartShutdownWatcher()
-// Starts to watch shutdown status
-// -----------------------------------------------------------------------------
-//
-void CShutdownWatcher::StartShutdownWatcher()
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::StartShutdownWatcher()" );
-    TInt status;
-    TInt err = iProperty.Get( KPSUidStartup, KPSGlobalSystemState, status );
-    LOGGER_WRITE_2( "CShutdownWatcher::StartShutdownWatcher() :\
-     err %d, KPSGlobalSystemState status %d", err, status);
-    if ( err == KErrNone )
-        {
-        if ( status == ESwStateShuttingDown )
-            {
-            LOGGER_WRITE( "Call NotifyShutdown" );
-            iObserver->NotifyShutdown();
-            return;
-            }
-        }
-    
-    err = iProperty.Attach( KPSUidStartup, KPSGlobalSystemState );
-    LOGGER_WRITE_1( "CShutdownWatcher::StartShutdownWatcher() :\
-     iProperty.Attach( KPSUidStartup, KPSGlobalSystemState ) : err %d", err );
-    iProperty.Subscribe( iStatus );
-    LOGGER_WRITE( "CShutdownWatcher::StartShutdownWatcher() :\
-     iProperty.Subscribe( iStatus ) : ok" );
-    SetActive();
-
-    LOGGER_LEAVEFN( "CShutdownWatcher::StartShutdownWatcher()" );
-    }
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::DoCancel()
-// Executed when CActive is canceled.
-// -----------------------------------------------------------------------------
-//
-void CShutdownWatcher::DoCancel()
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::DoCancel()" );
-    iProperty.Cancel();
-    LOGGER_LEAVEFN( "CShutdownWatcher::DoCancel()" );
-    }
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::RunL()
-// Executed when disk watcher is triggered
-// -----------------------------------------------------------------------------
-//
-void CShutdownWatcher::RunL()
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::RunL()" );
-    TInt status;
-    iProperty.Get( status );
-    LOGGER_WRITE_1( "CShutdownWatcher::RunL() : status %d", status );
-    
-    if ( status == ESwStateShuttingDown )
-        {
-        LOGGER_WRITE( "Call NotifyShutdown" );
-        iObserver->NotifyShutdown();
-        return;
-        }
-    
-    iProperty.Cancel();
-    iProperty.Close();
-    
-    LOGGER_LEAVEFN( "CShutdownWatcher::RunL()" );
-    }
-
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::CShutdownWatcher( MShutdownObserver* aObserver )
-// Default constructor
-// -----------------------------------------------------------------------------
-//
-CShutdownWatcher::CShutdownWatcher( MShutdownObserver* aObserver )
-: CActive(EPriorityStandard),
-    iObserver(aObserver)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CShutdownWatcher::ConstructL()
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::ConstructL()" );
-    CActiveScheduler::Add(this);
-    LOGGER_LEAVEFN( "CShutdownWatcher::ConstructL()" );
-    }
-
-// End of file
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/data/2001FE54.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* Copyright (c) 2001 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 info file.
-*
-*/
-
-
-#include "ecom/registryinfo.rh"
-
-// Declares info for two implementations
-RESOURCE REGISTRY_INFO theInfo
-    {
-    // UID for the DLL
-    dll_uid = 0x2001FE54;
-    // Declare array of interface info
-    interfaces = 
-        {
-        INTERFACE_INFO
-            {
-            // UID of interface that is implemented
-            interface_uid = 0x101F7C8C;
-            implementations = 
-                {
-                IMPLEMENTATION_INFO
-                    {
-                    implementation_uid = 0x2001FE53;
-                    version_no = 1;
-                    display_name = "Haptics Bridge";
-                    default_data = "OBEX/USB||OBEX/BT";
-                    // 
-                    // opaque_data contains parameters used by following API calls in SRCS:
-                    // 1. Setup USB interface string descriptor in Unicode;
-                    // 2. TInt CObex::SetLocalWho(const TDesC8& aInfo);
-                    // 3. TInt CBTConnection::RegisterSecuritySettingsL( TUint aService,
-                    //                       TInt  aProtocol,
-                    //                       TInt  aChannel,
-                    //                       TBool aAuthenticate,
-                    //                       TBool aAuthorise,
-                    //                       TBool aEncrypt );
-                    // opaque_data = "@0||@1||@2||@3||@4||@5||@6"
-                    // @0 aStrDesc      e.g. "PC Connectivity"
-                    // @1 aInfo         e.g. KFolderBrowsingID, "\xF9\xEC\x7B\xC4\x95\x3C\x11\xd2\x98\x4E\x52\x54\x00\xDC\x9E\x09"
-                    // @2 aService      e.g. KBTSecurityUidFileTransfer, 0x1106
-                    // @3 aProtocol     e.g. KSolBtRFCOMM, 0x1013
-                    // @4 aAuthenticate e.g. EFalse, 0
-                    // @5 aAuthorise    e.g. EFalse, 0
-                    // @6 aEncrypt      e.g. EFalse, 0
-                    //
-                    opaque_data = "Haptics Bridge|"\
-                              "|\xF9\xEC\x7B\xC4\x95\x3C\x11\xd2\x98\x4E\x52\x54\x00\xDC\x9E\x09|"\
-                              "|0x2001E2B5|"\
-                              "|0x1013|"\
-                              "|0|"\
-                              "|1|"\
-                              "|0|"\
-                              "|0xffff|"\
-                              "|0xffff";
-                    }
-                };
-            }
-        };
-    }
-
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +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:  Haptics connection plugin build file. 
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS  
-DEFAULT
-
-PRJ_EXPORTS
-../rom/hapticsconnplugin.iby CORE_IBY_EXPORT_PATH(mw, hapticsconnplugin.iby)
-
-PRJ_MMPFILES
-hapticsconnplugin.mmp
-
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/group/hapticsconnplugin.mmp	Tue Aug 31 15:05:37 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:  Haptics connection plugin project definition file.
-*
-*/
-
-
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-VENDORID        VID_DEFAULT
-
-CAPABILITY      CAP_ECOM_PLUGIN
-
-TARGET          hapticsconnplugin.dll
-TARGETTYPE      PLUGIN
-
-UID             0x10009D8D 0x2001FE54
-
-SOURCEPATH     	../src
-
-SOURCE          hapticsconnplugin.cpp
-SOURCE          hapticsconntimer.cpp
-SOURCE          hapticsmsghandler.cpp
-SOURCE          hapticsbridgeclient.cpp
-SOURCE          proxy.cpp
-
-SOURCEPATH     	../data
-
-START RESOURCE 2001FE54.rss
-  TARGET        hapticsconnplugin.rsc
-END 
-
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE /epoc32/include/stdapis
-
-USERINCLUDE     ../inc
-
-LIBRARY         flogger.lib
-LIBRARY         euser.lib
-LIBRARY         ecom.lib			
-LIBRARY         efsrv.lib
-LIBRARY         avkon.lib
-LIBRARY         bafl.lib
-LIBRARY         platformenv.lib
-LIBRARY         irobex.lib
-LIBRARY         hwrmhapticspacketizer.lib
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/inc/hapticsbridgeclient.h	Tue Aug 31 15:05:37 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:  Client interface to haptics server for haptics bridge 
-*                commands.
-*
-*/
-
-
-#ifndef C_HAPTICSBRIDGECLIENT_H
-#define C_HAPTICSBRIDGECLIENT_H
-
-#include <e32base.h>
-
-class CHWRMHapticsPacketizer;
-
-class RHapticsBridgeClient : public RSessionBase
-{
-public:
-    /**
-     * Constructor
-     */
-     RHapticsBridgeClient();
-     
-     /**
-      * Destructor
-      */
-     virtual ~RHapticsBridgeClient();
-
-public:
-    /**
-     * Create a connection to haptics server.
-     */
-	TInt Connect();
-
-    /**
-     * Close the connection to haptics server.
-     */
-	void Close();
-
-    /**
-     * Send message to haptics server.
-     * @param aReqData     Data request to be sent to haptics server.
-     * @param aRetDataPckg Returned data from haptics server.
-     * @return KErrNone if sent succesfully, otherwise system wide error code.
-     */
-	TInt SendBridgeBuffer( const TDesC8& aReqData, TDes8& aRetDataPckg );
-
-    /**
-     * Sends a message clean-up commend to haptics server.
-     */
-	void CleanUp();
-    
-
-private:
-
-    /**
-     * Returns the version of the haptics server.
-     * @return Version.
-     */
-	TVersion ServerVersion() const;
-
-    /**
-     * Starts the server process if it is not already running.
-     * @return KErrNone on success, otherwise a system error code.
-     */
-	TInt StartServer() const;
-
-    /**
-     * Handles the device opening request.
-     * @param aResponse Reference to a descriptor containing the response
-     *                  received from haptics server.
-     */
-	void HandleOpenDeviceResponseL( const TDesC8& aResponse );
-	
-	/**
-	 * Opens the haptic effect ("vibra") device.
-	 * @return KErrNone on success, otherwise a system error code.
-	 */
-    TInt OpenHapticsDevice();
-
-private:
-
-    /**
-     * Haptic packetizer.
-     * Owned.
-     */
-    CHWRMHapticsPacketizer* iPacketizer;     
-};
-
-#endif // C_HAPTICSBRIDGECLIENT_H
\ No newline at end of file
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/inc/hapticsconnplugin.h	Tue Aug 31 15:05:37 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:  Haptics OBEX connection plugin.
-*
-*/
-
-
-#ifndef C_HAPTICSCONNPLUGIN_H
-#define C_HAPTICSCONNPLUGIN_H
-
-#include <obexserver.h>
-#include <SrcsInterface.h>
-
-class CHapticsMsgHandler;
-
-class CHapticsConnPlugin : public CSrcsInterface
-    {
-    public:
-        /**
-         * 2-phased constructor.
-         */
-        static CHapticsConnPlugin* NewL();
-
-        /**
-         * Destructor.
-         */
-        virtual ~CHapticsConnPlugin();
-        
-        /**
-         * From CSrcsInterface.
-         * @see CSrcsInterface.
-         */
-        TBool IsOBEXActive();
-        
-    private:
-        /**
-         * 2nd phase constructor.
-         */    
-        void ConstructL();
-        
-        /**
-         * Constructor.
-         */
-        CHapticsConnPlugin();
-        
-    private:
-        /**
-         * Component to handle messages between file systen and 
-         * haptics server.
-         * Own.
-         */
-        CHapticsMsgHandler* iMsgHandler;
-    };
-
-#endif // C_HAPTICSCONNPLUGIN_H
\ No newline at end of file
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/inc/hapticsconntimer.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +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:  Connection shutdown timer for haptics server connection.
-*
-*/
-
-
-#ifndef C_HAPTICSCONNTIMER_H
-#define C_HAPTICSCONNTIMER_H
-
-#include <e32base.h>
-
-#include "hapticsmsghandler.h"
-
-NONSHARABLE_CLASS ( CHapticsConnTimer ) : public CTimer
-	{
-	public:
-        /**
-         * 2-phased constructor.
-         */
-        static CHapticsConnTimer* NewL( MHapticsConnectionShutdown* aCallback );
-
-        /**
-         * Destructor.
-         */
-        virtual ~CHapticsConnTimer();
-
-		/**
-	 	* Starts the timer
-	 	*/
-        void Start();
-        
-    private: // From CActive.
-        /**
-         * Notifies client on timeout.
-         */
-        void RunL();
-        			
-    private:
-        /**
-         * Constructor.
-         */
-        CHapticsConnTimer( MHapticsConnectionShutdown* aCallback );
-
-        /**
-         * 2nd phase constructor.
-         */    
-	    void ConstructL();
-
-    private:
-        /**
-         * Callback interface to notify about timeout.
-         * Not own.
-         */        
-        MHapticsConnectionShutdown* iCallback;
-	};
-	
-#endif // C_HAPTICSCONNTIMER_H
-
-// End of file
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/inc/hapticsconntrace.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Haptics conn plugin debug trace macro definition header file.
-*
-*/
-#ifndef HAPTICSCONNTRACE_H
-#define HAPTICSCONNTRACE_H
-
-#include <bldvariant.hrh>
-#include <e32svr.h>
-#include <e32std.h>
-#include <e32svr.h>
-#include <flogger.h>
-
-/**
- * Writes formatted string data to a file using RFileLogger.
- *
- * @param aFmt Value-referenced descriptor containing the formatted string. 
- */
-inline void HwrmWriteFormat( TRefByValue<const TDesC> aFmt, ... )
-    {
-    _LIT( KDir, "Hwrm" );
-    _LIT( KName, "Hwres.log" );
-
-    // take the ellipsis parameters
-    VA_LIST args;
-    VA_START( args, aFmt );
-    RFileLogger::WriteFormat( KDir, KName, EFileLoggingModeAppend, aFmt, args );
-    VA_END( args );
-    }
-
-/**
- * Writes data dump in hex format in "[ 00 01 FF ]" style.
- * 
- * @param aPrefix Descriptor containing the string to be appended in 
- *                front of the actual data dump.
- * @param aData   An 8-bit descriptor containing the data buffer for which 
- *                the data dump is written.
- */
-inline void DataDumpTrace( const TDesC& aPrefix, const TDesC8& aData )
-    {
-    _LIT( KSATraceDataDumpStart, " [ " );
-    _LIT( KSATraceDataDumpLineAlign, "   " );
-    _LIT( KSATraceDataDumpStop, " ] " );
-    _LIT( KSATraceDataDumpValue, "%02x " );
-    const TInt KSASDataDumpTraceBytesPerLine = 10;
-    
-    HBufC* buffer = HBufC::New( 255 );
-
-    if ( buffer != NULL )
-        {
-        buffer->Des().Copy( aPrefix );
-        buffer->Des().Append( KSATraceDataDumpStart );
-        for ( TInt i = 0; i < aData.Length(); i++)
-            {
-            buffer->Des().AppendFormat( KSATraceDataDumpValue,  aData[i] );
-            
-            if( ( i % KSASDataDumpTraceBytesPerLine == ( KSASDataDumpTraceBytesPerLine - 1 ) ) && 
-                ( i + 1 < aData.Length() ) )
-                {
-                RDebug::Print( buffer->Des() );
-
-                buffer->Des().Copy( aPrefix);
-                buffer->Des().Append( KSATraceDataDumpLineAlign );
-                }
-            }
-        buffer->Des().Append( KSATraceDataDumpStop );
-            
-        RDebug::Print( buffer->Des() );
-                
-        }
-
-    delete buffer;
-    }
-
-#ifdef _DEBUG
-
-    #ifdef USE_FILE_LOGGING
-    
-        #define COMPONENT_TRACE( a ) HwrmWriteFormat a
-        #define API_TRACE( a ) HwrmWriteFormat a
-        #define DATADUMP_TRACE( a, b )
-    
-    #else
-
-        #define COMPONENT_TRACE( a ) RDebug::Print a
-        #define API_TRACE( a ) RDebug::Print a
-        #define DATADUMP_TRACE( a, b ) DataDumpTrace( a, b )
-        
-    #endif // #ifdef USE_FILE_LOGGING
-
-#else // #ifdef _DEBUG
-
-    #define COMPONENT_TRACE( a )
-    #define API_TRACE( a )
-    #define DATADUMP_TRACE( a, b ) 
-
-#endif //#ifdef _DEBUG
-#endif //#ifndef HAPTICSCONNTRACE_H
-
-
-//  End of File
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/inc/hapticsmsghandler.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +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:  Handles messaging between file system and haptics 
-*                client interface.
-*
-*/
-
-
-#ifndef C_HAPTICSMSGHANDLER_H
-#define C_HAPTICSMSGHANDLER_H
-
-#include <e32base.h>
-#include <e32debug.h>
-#include <f32file.h>
-
-#include "hapticsbridgeclient.h"
-
-class CHapticsConnTimer;
-
-/**
- * Interface to notify about connection timeout.
- */
-class MHapticsConnectionShutdown
-    {
-    public:
-        /**
-         * Called to notify about connection timeout.
-         */
-        virtual void NotifyShutdown() = 0;
-    
-    };
-
-/**
- * Helper class for Bridge functionality for handling RFs (File Session)
- * change notifications for VibeTonz request file.
- *
- * @since S60 5.1
- */
-class CHapticsMsgHandler : public CActive,
-                           public MHapticsConnectionShutdown
-    {        
-public:    
-    /**
-     * 2-phased constructor.
-     */
-    static CHapticsMsgHandler* NewL();
-    
-    /**
-     * Destructor
-     */
-    virtual ~CHapticsMsgHandler();
-
-    /**
-     * Method for starting the listening for change notifications    
-     */
-    void StartNotifier();
-        
-    /**
-     * From MHapticsConnectionShutdown.
-     * Called to notify about connection timeout.
-     */        
-    void NotifyShutdown();   
-    
-protected: // From CActive.    
-    /**
-     * @see CActive
-     */
-    void RunL();
-    /**
-     * @see CActive
-     */    
-    TInt RunError(TInt aError);
-    /**
-     * @see CActive
-     */    
-    void DoCancel();
-        
-private:
-
-    /**
-     * Constructor
-     */
-    CHapticsMsgHandler();
-
-    /**
-     * Two-phase construction ConstructL
-     */
-    void ConstructL();
-    
-    /**
-     * Method for connecting to file system. Also sets the paths and
-     * creates directories (if not already exists).
-     */
-    void ConnectToFilesystemL();            	
- 
-    /**
-     * Helper for clearing the possible left-over request file from
-     * previous runs.
-     */
-    void ClearRequestFile();
-
-private: // data
-    
-    /**
-     * File server session through which all file server related 
-     * services are requested.
-     */
-    RFs iFs;
-    
-    /**
-     * Buffer for the request file data
-     */
-    HBufC8* iReqBuf;    
-
-    /**
-     * The RHapticsBridgeClient object that is responsible for further
-     * handling of received Bridge commands
-     */
-    RHapticsBridgeClient iClient;
-    
-    CHapticsConnTimer* iConnectionTimeout;
-        
-  };
-
-#endif // C_HAPTICSMSGHANDLER_H
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/rom/hapticsconnplugin.iby	Tue Aug 31 15:05:37 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:  IBY file for Haptics conn plugin.
-*
-*/
-
-
-#ifndef HAPTICSCONNPLUGIN_IBY
-#define HAPTICSCONNPLUGIN_IBY
-
-#include <data_caging_paths_for_iby.hrh>
-
-ECOM_PLUGIN(hapticsconnplugin.dll,hapticsconnplugin.rsc)
-
-#endif // HAPTICSCONNPLUGIN_IBY
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/src/hapticsbridgeclient.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +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:  Client interface to haptics server for haptics bridge 
-*                commands.
-*
-*/
-
-
-#include <e32svr.h>
-#include <f32file.h>
-#include <data_caging_path_literals.hrh> // KDC_PROGRAMS_DIR
-#include <hwrmhaptics.h>
-#include <hwrmlogicalactuators.h>
-#include <hwrmhapticspacketizer.h>
-
-#include "hapticsbridgeclient.h"
-#include "hapticsconntrace.h"
-
-const TInt KServerVersionMajor       = 1;
-const TInt KServerVersionMinor       = 1;
-const TInt KServerVersionBuild       = 1;
-_LIT( KServerProcessName, "!hwrmhapticsserver" );
-_LIT( KServerExeName, "hwrmhapticsserver.exe" );
-const TInt KAsyncMsgSlots = 10;
-
-const TInt KHWRMHapticsServiceCommand      = 2001;
-const TInt KHWRMHapticsOpenActuatorCommand = 2004;
-const TInt KHWRMHapticsCleanupCommand      = 2008;
-const TInt KHWRMHapticsBridgeCommand       = 2011;
-
-// --------------------------------------------------------------------------
-// Simple constructor
-// 
-// --------------------------------------------------------------------------
-// 
-RHapticsBridgeClient::RHapticsBridgeClient()
-    {
-    TRAP_IGNORE( iPacketizer = 
-                 CHWRMHapticsPacketizer::NewL( EHWRMLogicalActuatorAny ) );
-    }
-
-// --------------------------------------------------------------------------
-// Simple destructor
-// 
-// --------------------------------------------------------------------------
-// 
-RHapticsBridgeClient::~RHapticsBridgeClient()
-    {
-    delete iPacketizer;
-    }
-
-// --------------------------------------------------------------------------
-// Method for connecting (creating a new session) with Haptics Server
-// 
-// --------------------------------------------------------------------------
-// 
-TInt RHapticsBridgeClient::Connect()
-    {
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::Connect()" ) ) );
-    TInt ret = CreateSession( KServerProcessName, 
-                              ServerVersion(), 
-                              KAsyncMsgSlots );
-    if ( ret != KErrNone )
-        {
-        ret = StartServer();
-        if ( ret == KErrNone )
-            {
-            ret = CreateSession( KServerProcessName, 
-                                 ServerVersion(),
-                                 KAsyncMsgSlots );    
-            COMPONENT_TRACE(_L("RHapticsBridgeClient::Connect(), Session created"));
-            }       
-        }
-
-    // Initialize server components.
-    if ( ret == KErrNone )
-        {
-        ret = SendReceive( KHWRMHapticsServiceCommand );
-        }
-
-    // Open the haptic effect ("vibra") device.
-    if ( ret == KErrNone )
-        {
-        ret = OpenHapticsDevice();
-        }
-    
-        
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::Connect - return(%d)" ), ret ) );        
-    return ret;
-    }
-
-// --------------------------------------------------------------------------
-// Method for starting Haptics Server (if not already running)
-// 
-// --------------------------------------------------------------------------
-//
-TInt RHapticsBridgeClient::StartServer() const
-    {
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::StartServer()" ) ) );
-
-    TParse parser;
-    parser.Set( KServerExeName, &KDC_PROGRAMS_DIR, NULL );
-        
-    RProcess server;
-    TInt ret = server.Create( parser.FullName(), KNullDesC );
-
-    if ( ret != KErrNone ) // Loading failed.
-        {
-        return ret;
-        }
-
-    TRequestStatus status;
-    server.Rendezvous( status );
-
-    if ( status != KRequestPending )
-        {
-        server.Kill( 0 ); // Abort startup.
-        server.Close();
-        return KErrGeneral;
-        }
-    else
-        {
-        server.Resume(); // Logon OK - start the server.
-        }
-        
-    User::WaitForRequest( status );
-    server.Close();
-
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::StartServer() - return %d" ), status.Int() ) );
-    return status.Int();    
-    }
-
-// --------------------------------------------------------------------------
-// Method for closing session to haptics server.
-// 
-// --------------------------------------------------------------------------
-//    
-void RHapticsBridgeClient::Close()    
-    {
-    RSessionBase::Close();
-    }
-
-// --------------------------------------------------------------------------
-// Getter method for server version.
-// 
-// --------------------------------------------------------------------------
-//
-TVersion RHapticsBridgeClient::ServerVersion() const 
-    {
-    return TVersion( KServerVersionMajor, 
-                     KServerVersionMinor,
-                     KServerVersionBuild );
-    }
-
-// --------------------------------------------------------------------------
-// Method for sending commands to Haptics Server.
-// 
-// --------------------------------------------------------------------------
-//    
-TInt RHapticsBridgeClient::SendBridgeBuffer( const TDesC8& aReqData, TDes8& aRetDataPckg )
-    {
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::SendBridgeBufferL() - Begin" ) ) );
-
-    TInt retVal( KErrDisconnected );
-    if ( iHandle )
-        {
-        TInt vibeStatus(0);
-        TPckg<TInt> vibeStatusPckg( vibeStatus );
-        retVal = SendReceive( KHWRMHapticsBridgeCommand, 
-                              TIpcArgs( &aReqData, 
-                                        &vibeStatusPckg, 
-                                        &aRetDataPckg ) );
-
-        if ( retVal == KErrNone ) 
-            {
-            TRAP( retVal, HandleOpenDeviceResponseL( aRetDataPckg ) );
-            }
-        }
-    
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::SendBridgeBufferL() - End (%d)" ), retVal ) );    
-    return retVal;
-    }
-
-// --------------------------------------------------------------------------
-// Method for cleaning up session to Haptics Server.
-// 
-// --------------------------------------------------------------------------
-//
-void RHapticsBridgeClient::CleanUp()
-    {
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::CleanUp() - Begin" ) ) );
-    if ( iHandle )
-        {
-        SendReceive ( KHWRMHapticsCleanupCommand );
-        }
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::CleanUp() - End" ) ) );
-    }
-
-// --------------------------------------------------------------------------
-// Method for handling Open Device responses (basically for requesting the 
-// setting of the license key).
-// 
-// --------------------------------------------------------------------------
-//
-void RHapticsBridgeClient::HandleOpenDeviceResponseL( const TDesC8& aResponse )
-    {
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::HandleOpenDeviceResponse() - Begin" ) ) );
-    TInt err( KErrNone );
-    if ( !iPacketizer )
-        {
-        COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::HandleOpenDeviceResponse() - No Packetizer!" ) ) );
-        User::Leave( KErrGeneral );
-        }
-    else    
-        {
-        const TUint8* pRsp ( aResponse.Ptr() );
-        if ( 0x12 == pRsp[0] && 0x00 == pRsp[1] && 0x00 == pRsp[2] )
-            {
-            COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::HandleOpenDeviceResponse() - OPEN DEVICE RESPONSE handling" ) ) );
-            iPacketizer->DecodeMessageL( aResponse, err );
-            if ( !err )
-                {
-                RBuf8 reqBuf;
-                err = iPacketizer->EncSetPlatformLicenseKeyReq( 
-                    iPacketizer->DeviceHandle(), reqBuf );
-                if ( !err )
-                    {
-                    TBuf8<50> dummyRetBuf;
-                    TInt dummyStatus;
-                    TPckg<TInt> dummyStatusPckg( dummyStatus );
-                    err = SendReceive( KHWRMHapticsBridgeCommand, 
-                                       TIpcArgs ( &reqBuf,
-                                                  &dummyStatusPckg, 
-                                                  &dummyRetBuf ) );
-                    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::HandleOpenDeviceResponse() - Sent set license command (%d)"), err ) );
-                    }
-                reqBuf.Close();
-                }
-            User::LeaveIfError( err );
-            }
-        }
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::HandleOpenDeviceResponse() - End" ) ) );
-    }
-
-
-// --------------------------------------------------------------------------
-// Method for opening haptics device. This is needed since there's possibility
-// that no other haptics client has opened the device prior to this bridge
-// connectivity. This method also call set license key, i.e., completes the
-// device opening. 
-//
-// --------------------------------------------------------------------------
-//
-TInt RHapticsBridgeClient::OpenHapticsDevice()
-    {
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::OpenHapticsDevice - Begin" ) ) );
-    TInt err( KErrGeneral );
-    if ( iPacketizer )
-        {
-        RBuf8 openDevReqBuf;
-        RBuf8 setLicenseReqBuf;
-        TBuf8<50> setLicenseRspBuf;
-        TInt dummyStatus;
-        TPckg<TInt> dummyStatusPckg( dummyStatus );
-        
-        err = iPacketizer->EncOpenDeviceReq( EHWRMLogicalActuatorAny,
-                                             openDevReqBuf );
-
-        COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::OpenHapticsDevice - EncOpenDevice (%d)" ), err ) );
-        if ( !err )
-            {
-            TInt deviceHandle;
-            TPckg<TInt> deviceHandlePckg( deviceHandle );
-            err = SendReceive( KHWRMHapticsOpenActuatorCommand,
-                               TIpcArgs ( &openDevReqBuf, 
-                                          &deviceHandlePckg,
-                                          EHWRMLogicalActuatorAny ) );
-            COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::OpenHapticsDevice - Send OpenDevice (%d)" ), err ) );
-            COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::OpenHapticsDevice - Device handle = %d" ), deviceHandle ) );
-            if ( !err )
-                {
-                err = iPacketizer->EncSetPlatformLicenseKeyReq( 
-                    deviceHandle, setLicenseReqBuf );
-                COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::OpenHapticsDevice - EncSetEmptyLicenseKey (%d)" ), err ) );    
-                if ( !err )
-                    {
-                    TBuf8<50> dummyRspBuf;
-                    TInt dummyStatus;
-                    TPckg<TInt> dummyStatusPckg( dummyStatus );
-                    err = SendReceive( KHWRMHapticsBridgeCommand, 
-                                       TIpcArgs ( &setLicenseReqBuf,
-                                                  &dummyStatusPckg, 
-                                                  &dummyRspBuf ) );
-                    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::OpenHapticsDevice - Send SetLicense (%d)" ), err ) );
-                    }
-                }
-            }
-
-        openDevReqBuf.Close();
-        setLicenseReqBuf.Close();
-        }
-    COMPONENT_TRACE( ( _L( "RHapticsBridgeClient::OpenHapticsDevice - End (err=%d)" ),err ) );    
-    return err;
-    }
-
-// eof
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/src/hapticsconnplugin.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +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:  Haptics OBEX connection plugin.
-*
-*/
-
-
-#include "hapticsconnplugin.h"
-#include "hapticsmsghandler.h"
-#include "hapticsconntrace.h"
-
-// -----------------------------------------------------------------------------
-// CHapticsConnPlugin::NewL()
-// Two-phase constructing
-// -----------------------------------------------------------------------------
-//
-CHapticsConnPlugin* CHapticsConnPlugin::NewL()
-    {
-    COMPONENT_TRACE( ( _L( "CHapticsConnPlugin::NewL - Begin" ) ) );
-    CHapticsConnPlugin* self = new ( ELeave ) CHapticsConnPlugin();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    COMPONENT_TRACE( ( _L( "CHapticsConnPlugin::NewL - End" ) ) );
-    return( self );
-    }
-
-// -----------------------------------------------------------------------------
-// CHapticsConnPlugin::ConstructL()
-// 
-// -----------------------------------------------------------------------------
-//
-void CHapticsConnPlugin::ConstructL()
-    {
-    COMPONENT_TRACE( ( _L( "CHapticsConnPlugin::ConstructL() - Begin" ) ) );
-    iMsgHandler = CHapticsMsgHandler::NewL();
-    iMsgHandler->StartNotifier();
-    COMPONENT_TRACE( ( _L( "CHapticsConnPlugin::ConstructL() - End" )));
-    }
-
-// -----------------------------------------------------------------------------
-// CHapticsConnPlugin::~CHapticsConnPlugin()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CHapticsConnPlugin::~CHapticsConnPlugin()
-    {
-    COMPONENT_TRACE( ( _L( "CHapticsConnPlugin::~CHapticsConnPlugin() - Begin" ) ) );
-    delete iMsgHandler;
-    COMPONENT_TRACE( ( _L( "CHapticsConnPlugin::~CHapticsConnPlugin() - End" ) ) );
-    }
-
-// -----------------------------------------------------------------------------
-// CHapticsConnPlugin::CHapticsConnPlugin()
-// Constructor
-// -----------------------------------------------------------------------------
-//
-CHapticsConnPlugin::CHapticsConnPlugin()
-    {    
-    }
-
-// -----------------------------------------------------------------------------
-// CHapticsConnPlugin::IsOBEXActive()
-//
-// -----------------------------------------------------------------------------
-//    
-TBool CHapticsConnPlugin::IsOBEXActive()   
-    {
-    COMPONENT_TRACE( ( _L( "CHapticsConnPlugin::IsOBEXActive" ) ));
-    return ETrue;
-    }
-
-// End of file
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/src/hapticsconntimer.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +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:  Connection shutdown timer for haptics server connection.
-*
-*/
-
-
-#include "hapticsconntimer.h"
-
-const TInt KHapticsConnectionTimeout = 30000000; // 30 sec.
-
-// ---------------------------------------------------------------------------
-// Two phased constructor.
-// ---------------------------------------------------------------------------
-//
-CHapticsConnTimer* CHapticsConnTimer::NewL( MHapticsConnectionShutdown* aCallback )
-    {
-    CHapticsConnTimer* self = new ( ELeave ) CHapticsConnTimer(aCallback);
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor.
-// ---------------------------------------------------------------------------
-//
-CHapticsConnTimer::~CHapticsConnTimer()
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Activates this timer.
-// ---------------------------------------------------------------------------
-//
-void CHapticsConnTimer::Start()
-    {
-    After( KHapticsConnectionTimeout );
-    }
-
-// ---------------------------------------------------------------------------
-// Constructor of the shutdown timer.
-// ---------------------------------------------------------------------------
-//
-CHapticsConnTimer::CHapticsConnTimer( MHapticsConnectionShutdown* aCallback )
-    : CTimer( EPriorityStandard ), iCallback(aCallback)
-    {
-    CActiveScheduler::Add( this );
-    }
-
-// ---------------------------------------------------------------------------
-// Second phase construction.
-// ---------------------------------------------------------------------------
-//
-void CHapticsConnTimer::ConstructL()
-    {
-    CTimer::ConstructL();
-    }
-
-// ---------------------------------------------------------------------------
-// 
-// ---------------------------------------------------------------------------
-//
-void CHapticsConnTimer::RunL()
-    {
-    iCallback->NotifyShutdown();
-    }
-
-//  End of File  
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/src/hapticsmsghandler.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +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:  Handles messaging between file system and haptics 
-*                client interface.
-*
-*/
-
-
-#include <f32file.h> 
-#include <bautils.h> 
-#include <pathinfo.h>
-#include <hwrmhaptics.h>
-
-#include "hapticsmsghandler.h"
-#include "hapticsconntimer.h"
-#include "hapticsconntrace.h"
-
-_LIT( KVibeTonzFolder,"VibeTonz\\" );
-_LIT( KSourceFileName,"VibeTonzDataReq" );
-_LIT( KTargetFileName,"VibeTonzDataRsp" );
-
-// ---------------------------------------------------------------------------
-// CHapticsMsgHandler* CHapticsMsgHandler::NewL()
-// ---------------------------------------------------------------------------
-//
-CHapticsMsgHandler* CHapticsMsgHandler::NewL()
-    {
-    CHapticsMsgHandler* self = new (ELeave) CHapticsMsgHandler();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Default C++ constructor
-// ---------------------------------------------------------------------------
-//
-CHapticsMsgHandler::CHapticsMsgHandler () : CActive( EPriorityStandard )
-    {
-    }    
-
-// ---------------------------------------------------------------------------
-// void CHapticsMsgHandler::ConstructL()
-// ---------------------------------------------------------------------------
-//
-void CHapticsMsgHandler::ConstructL()
-    {
-    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::ConstructL - Begin") ) );    
-    CActiveScheduler::Add( this );
-    ConnectToFilesystemL();
-    iConnectionTimeout = CHapticsConnTimer::NewL(this);
-    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::ConstructL - End") ) );
-    }
-
-// ---------------------------------------------------------------------------
-// CHapticsMsgHandler::~CHapticsMsgHandler()
-// ---------------------------------------------------------------------------
-//
-CHapticsMsgHandler::~CHapticsMsgHandler()
-    {    
-    Cancel();
-
-    if ( iConnectionTimeout )
-        {
-        iConnectionTimeout->Cancel();
-        delete iConnectionTimeout;
-        }
-
-    delete iReqBuf;
-        
-    iClient.Close();
-    iFs.Close();
-    }
-
-// ---------------------------------------------------------------------------
-// void ClearRequestFile()
-// ---------------------------------------------------------------------------
-//   
-void CHapticsMsgHandler::ClearRequestFile()
-	{
-	COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::ClearRequestFile - Begin") ) );
-	
-    TFindFile findDataFile( iFs );
-    
-    TFileName sourcefile = PathInfo::PhoneMemoryRootPath();
-    sourcefile.Append( PathInfo::OthersPath() );
-    sourcefile.Append( KVibeTonzFolder );
-    sourcefile.Append( KSourceFileName );
-    
-    if( findDataFile.FindByDir( sourcefile, KNullDesC ) == KErrNone )
-    	{
-    	COMPONENT_TRACE( _L("CHapticsMsgHandler::ClearRequestFile - Deleting REQ file") );
-    	iFs.Delete( KSourceFileName ); 
-    	}
-    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::ClearRequestFile - End") ) );    	
-	}
-// ---------------------------------------------------------------------------
-// void ConnectToFilesystem()
-// ---------------------------------------------------------------------------
-//    
-void CHapticsMsgHandler::ConnectToFilesystemL()
-    {
-    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::ConnectToFilesystemL - Begin") ) );
-    User::LeaveIfError( iFs.Connect() );
-    
-    TFileName sessionPath = PathInfo::PhoneMemoryRootPath();
-    sessionPath.Append( PathInfo::OthersPath() );
-    sessionPath.Append( KVibeTonzFolder );
-    TBool folderExists = BaflUtils::FolderExists( iFs, sessionPath );
-    
-    if( folderExists )
-        {
-        User::LeaveIfError( iFs.SetSessionPath( sessionPath ) );
-        ClearRequestFile();
-        }
-    else
-        {
-        User::LeaveIfError( iFs.MkDir( sessionPath ) );
-        User::LeaveIfError( iFs.SetSessionPath( sessionPath ) );
-        }
-    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::ConnectToFilesystemL - End") ) );
-    }    
-
-// ---------------------------------------------------------------------------
-// CHapticsMsgHandler::StartNotifier()
-// ---------------------------------------------------------------------------
-//
-void CHapticsMsgHandler::StartNotifier()
-	{
-	COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::StartNotifier - Begin" ) ) );
-    if ( !IsActive() )
-        {
-        TFileName sessionPath = PathInfo::PhoneMemoryRootPath();
-        sessionPath.Append( PathInfo::OthersPath() );
-        sessionPath.Append( KVibeTonzFolder );        
-        iFs.NotifyChange( ENotifyAll, iStatus, sessionPath );
-        SetActive();
-	    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::StartNotifier - Started" ) ) );        
-        }
-    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::StartNotifier - End" ) ) );
-    }
-
-// ---------------------------------------------------------------------------
-// CHapticsMsgHandler::RunL()
-// ---------------------------------------------------------------------------
-//
-void CHapticsMsgHandler::RunL()
-    {
-    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::RunL - Begin" ) ) );
-
-    StartNotifier(); // re-subscribe for change notifications.
-
-    TFindFile findDataFile(iFs); 
-    TFileName sourcefileName = PathInfo::PhoneMemoryRootPath();
-    sourcefileName.Append( PathInfo::OthersPath() );
-    sourcefileName.Append( KVibeTonzFolder );
-    sourcefileName.Append( KSourceFileName ); 
-          
-    if( findDataFile.FindByDir( sourcefileName, KNullDesC ) == KErrNone )
-        {
-        COMPONENT_TRACE( ( _L("CHapticsMsgHandler::RunL - found request file") ) );
-        
-        RFile sourceFile;
-		TInt sourceFileSize;
-
-		User::LeaveIfError( sourceFile.Open( iFs, sourcefileName, EFileShareAny )  );
-		CleanupClosePushL( sourceFile );
-		sourceFile.Size( sourceFileSize );
-		
-		iReqBuf = HBufC8::NewL( sourceFileSize );
-		TPtr8 reqBufPtr = iReqBuf->Des();		
-		sourceFile.Read( reqBufPtr );
-		CleanupStack::PopAndDestroy( &sourceFile );
-			
-		ClearRequestFile();
-
-        DATADUMP_TRACE( _L("CHapticsMsgHandler::RunL - request data dump:"), reqBufPtr );
-
-        if ( !iClient.Handle() )
-            {
-            User::LeaveIfError( iClient.Connect() );
-            }
-
-		TBuf8<256> retData;	
-		TInt bridgeErr = iClient.SendBridgeBuffer( reqBufPtr, retData );
-					
-	    delete iReqBuf;
-	    iReqBuf = NULL;
-	    
-		if ( bridgeErr == KErrNone )
-			{		
-            iConnectionTimeout->Cancel();
-            iConnectionTimeout->Start();
-            			
-			DATADUMP_TRACE( _L("CHapticsMsgHandler::RunL - response data dump:"), retData );
-            RFile targetFile;
-			targetFile.Replace( iFs, KTargetFileName, EFileWrite );
-			targetFile.Write( retData );
-        	targetFile.Close();
-        	}
-        }      
-    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::RunL - End" ) ) );
-    }
-
-// -----------------------------------------------------------------------------
-//
-//
-// -----------------------------------------------------------------------------
-//
-TInt CHapticsMsgHandler::RunError( TInt aError )
-    {
-    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::RunError: %d" ), aError ) );
-    return aError;
-    }
-
-// -----------------------------------------------------------------------------
-//
-//
-// -----------------------------------------------------------------------------
-//
-void CHapticsMsgHandler::DoCancel()
-    {
-    COMPONENT_TRACE( ( _L( "Inside CHapticsMsgHandler::DoCancel" ) ) );
-    if ( IsActive() )
-        {
-        iFs.NotifyChangeCancel( iStatus );
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CHapticsConnPlugin::CHapticsConnPlugin()
-// Constructor
-// -----------------------------------------------------------------------------
-//
-void CHapticsMsgHandler::NotifyShutdown()
-    {
-    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::NotifyShutdown - Begin" ) ) );
-    iClient.CleanUp();
-    iClient.Close(); 
-    COMPONENT_TRACE( ( _L( "CHapticsMsgHandler::NotifyShutdown - End" ) ) );    
-    } 
-	
-// end of file
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/src/proxy.cpp	Tue Aug 31 15:05:37 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:  Implementation proxy for haptics connection plugin.
-*
-*/
-
-
-#include <e32std.h>
-#include <ecom/implementationproxy.h>
-
-#include "hapticsconnplugin.h"
-
-// Map the interface UIDs to implementation factory functions
-const TImplementationProxy ImplementationTable[] = 
-	{
-		IMPLEMENTATION_PROXY_ENTRY( 0x2001FE53,	CHapticsConnPlugin::NewL )
-	};
-
-// Exported proxy for instantiation method resolution
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{
-	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
-
-	return ImplementationTable;
-	}
-	
-// End of file
-
-
--- a/connectivitymodules/SeCon/plugins/pcconn/bld/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity Plug-in build information file.
-*
-*/
-
-PRJ_EXPORTS
-../rom/sconpcconnplugin.iby         CORE_APP_LAYER_IBY_EXPORT_PATH(sconpcconnplugin.iby)
-
-PRJ_PLATFORMS  
-DEFAULT
-
-PRJ_MMPFILES
-sconpcconnplugin.mmp
--- a/connectivitymodules/SeCon/plugins/pcconn/bld/def/bwinscwu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
-
--- a/connectivitymodules/SeCon/plugins/pcconn/bld/def/eabiu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	_Z24ImplementationGroupProxyRi @ 1 NONAME
-	_ZTI17CSConPCConnplugin @ 2 NONAME ; #<TI>#
-	_ZTV17CSConPCConnplugin @ 3 NONAME ; #<VT>#
-
--- a/connectivitymodules/SeCon/plugins/pcconn/bld/sconpcconnplugin.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +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:  PC Connectivity Plug-in MMP file
-*
-*/
-
-
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-VENDORID        VID_DEFAULT
-
-CAPABILITY      CAP_ECOM_PLUGIN
-
-TARGET          sconpcconnplugin.dll
-TARGETTYPE      PLUGIN
-
-UID             0x10009D8D 0x101F9688
-
-SOURCEPATH     	../src
-
-SOURCE          sconpcconnplugin.cpp
-SOURCE          proxy.cpp
-SOURCE          sconpcconnpluginutils.cpp
-SOURCE          sconservicetimer.cpp
-SOURCE          sconshutdownwatcher.cpp
-
-START RESOURCE 101f9688.rss
-  TARGET        sconpcconnplugin.rsc
-END
-
-// Default system include paths.
-APP_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE     ../inc
-USERINCLUDE     ../../../inc 
-USERINCLUDE     ../../../clients/pcconn/inc
-USERINCLUDE     ../../../servers/pcconn/inc
-USERINCLUDE     ../../../services/ftp/inc 
-USERINCLUDE     ../../../catalogspcconnectivityplugin/inc 
-
-DEBUGLIBRARY    flogger.lib
-LIBRARY         sconpcconnclient.lib
-LIBRARY         euser.lib
-LIBRARY         irobex.lib 
-LIBRARY         ecom.lib			
-LIBRARY         efsrv.lib 
-LIBRARY         bafl.lib
-LIBRARY         catalogspcconnectivityplugin.lib
-LIBRARY         apmime.lib 
-LIBRARY         bluetooth.lib
-LIBRARY         esock.lib 
--- a/connectivitymodules/SeCon/plugins/pcconn/inc/sconpcconnplugin.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,234 +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:  PC Connectivity plugin header file
-*
-*/
-
-#ifndef _SCONPCCONNPLUGIN_H
-#define _SCONPCCONNPLUGIN_H
-
-#include <obexserver.h>
-#include <SrcsInterface.h>
-#include <apmstd.h>
-
-#include "sconpcconnclient.h"
-#include "sconshutdownwatcher.h"
-
-// forward declaration
-class CSConFTP;
-class CSConServiceTimer;
-class CCatalogsPCConnectivityPlugin;
-
-
-
-class CSConPCConnplugin : public CSrcsInterface, public MObexServerNotify,
-                          public MShutdownObserver
-    {
-    public:
-        static CSConPCConnplugin* NewL();
-        virtual ~CSConPCConnplugin();
-
-        /**
-         * Returns active status of OBEX session
-         * @return ETrue if session is active, else EFalse
-         */
-        TBool IsOBEXActive();
-        
-        /**
-         * Device is shutting down, abort connection.
-         */
-        void NotifyShutdown();
-
-    private:
-        /**
-         * Loads sconftp.dll module
-         * @return none
-         */
-        void LoadFTPDllL();
-        /**
-         * Closes initialized services
-         * @return none
-         */
-        void Disconnect();
-        /**
-         * Removes spaces and nulls from the end of the string
-         * @param aDes String to be formatted
-         * @return none
-         */
-        void TrimRightSpaceAndNull( TDes8& aDes ) const;
-        /**
-         * Current used transfer media (IR,USB,BT)
-         * @param aMediaType Enumeration indicating the media type
-         * @return none
-         */
-        void SetMediaType( TSrcsMediaType aMediaType );
-        /**
-         * MObexServerNotify implementation
-         * @param aError Error code
-         * @return none
-         */
-        void ErrorIndication( TInt aError );
-        /**
-         * MObexServerNotify implementation
-         * @return none
-         */
-        void TransportUpIndication();
-        /**
-         * MObexServerNotify implementation
-         * @return none
-         */
-        void TransportDownIndication();
-        /**
-         * MObexServerNotify implementation
-         * @param aRemoteInfo Structure containing information used during OBEX
-         * connection
-         * @param aInfo Further information about the requested connection
-         * @return System wide error code that indicates the success of the connection
-         */
-        TInt ObexConnectIndication( const TObexConnectInfo& aRemoteInfo,
-                                    const TDesC8& aInfo );
-        /**
-         * MObexServerNotify implementation
-         * @param aInfo Contains information about the disconnection
-         * @return none
-         */
-        void ObexDisconnectIndication( const TDesC8& aInfo );
-        /**
-         * MObexServerNotify implementation
-         * @return CObexBaseObject-derived object, which the object being put
-         * will be parsed into.
-         */
-        CObexBufObject* PutRequestIndication();
-        /**
-         * MObexServerNotify implementation
-         * @return System wide error code that indicates the success of the
-         * PUT packet operation.
-         */
-        TInt PutPacketIndication();
-        /**
-         * MObexServerNotify implementation
-         * @return System wide error code that indicates the success of the
-         * PUT packet operation.
-         */
-        TInt PutCompleteIndication();
-        /**
-         * MObexServerNotify implementation
-         * @param aRequiredObject Details about the object the remote client
-         * has requested
-         * @returnObject to return to the client
-         */
-        CObexBufObject* GetRequestIndication( CObexBaseObject
-                                                *aRequiredObject );
-        /**
-         * MObexServerNotify implementation
-         * @return System wide error code that indicates the success of the
-         * GET packet operation.
-         */
-        TInt GetPacketIndication();
-        /**
-         * MObexServerNotify implementation
-         * @return System wide error code that indicates the success of the
-         * GET packet operation.
-         */
-        TInt GetCompleteIndication();
-        /**
-         * MObexServerNotify implementation
-         * @param aPathInfo SETPATH command parameters
-         * @param aInfo Not currently used
-         * @return System wide error code indicating the success of the
-         * setpath command.
-         */
-        TInt SetPathIndication( const CObex::TSetPathInfo& aPathInfo,
-                                const TDesC8& aInfo );
-        /**
-         * SetObexServer
-         * @param aObexServer pass obex server pointer to sevice controller
-         * @return System wide error code.
-         */
-        TInt SetObexServer( CObexServer* aObexServer );
-        /**
-         * MObexServerNotify implementation
-         * @return none
-         */
-        void AbortIndication();
-        /**
-         * Checks if mime type belongs to Catalogs
-         * @return TBool
-         */
-        TBool IsCatalogsMimeType( TDataType aMime );
-
-        void ConstructL();
-        CSConPCConnplugin();
-        
-        /**
-         * Handles PCD object. Used for advanced file handling.
-         * @param aDescriptionHeader Contains command code and destination filename
-         * @param aNameHeader Source filename
-         * @return System wide error code.
-         */
-        TInt HandlePCDObjectPut( const TDesC& aDescriptionHeader, const TDesC& aNameHeader );
-        
-        /**
-         * Get Capbility object or ConML message from PCConnServer
-         * @param aNameHeader Name information.
-         * @param aTypeHeader Object type header. ConML or Capability object type
-         * @return none
-         */
-        void HandleGetPCConnObjectL( const TDesC& aNameHeader, const TDesC8& aTypeHeader );
-        
-        /**
-         * Get Catalogs object
-         * @param aTypeHeader Object type header.
-         * @return none
-         */
-        void HandleGetCatalogsObjectL( const TDesC8& aTypeHeader );
-        
-        /**
-         * Get file object
-         * @param aNameHeader requested filename.
-         * @return none
-         */
-        void HandleGetFileObjectL( const TDesC& aNameHeader );
-        
-    private:
-        RLibrary                    iFTPlib;
-        CObexBufObject*             iObject;
-        CBufFlat*                   iBuffer;
-        CSConFTP*                   iFTPHandler;
-        TInt                        iPutError;
-        TBool                       iSessionActive;
-        CSConServiceTimer*          iServiceTimer;
-        TBool                       iStartTimer;
-        TSrcsMediaType              iMediaType;
-        CObexFileObject*            iFileObject;
-        RSConPCConnSession          iPCConnSession;
-        TBool                       iPCConnSessionConnected;
-        CCatalogsPCConnectivityPlugin*  iCatalogs;
-        TBool                           iCatalogsConnected;
-        HBufC8*                         iCatalogsMimeType;
-        RPointerArray<TDataType>        iMimeArray;
-        TBool                           iCatalogsMimeTypesExist;
-        TBool                       iPutPacketIndicationCalled;
-        CShutdownWatcher*           iShutdownWatcher;
-        TBool                       iShutdownInProgress;
-        CObexServer*                iObexServer;
-        RSocketServ                 iSocketServer;
-        RBTPhysicalLinkAdapter      iLinkAdapter;
-    private:
-        // Friend class is used,because existing impelentation has been working
-        // properly. Avoiding re-design.
-        friend class CSConServiceTimer;
-    };
-
-#endif // SCONPCCONNPLUGIN_H
\ No newline at end of file
--- a/connectivitymodules/SeCon/plugins/pcconn/inc/sconpcconnpluginutils.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity Plug-in Utils header
-*
-*/
-
-
-#ifndef _SCONPCCONNPLUGINUTILS_H
-#define _SCONPCCONNPLUGINUTILS_H
-
-#include <e32base.h>
-//============================================================
-// Class TPCConnpluginUtils declaration
-//============================================================
-class TPCConnpluginUtils
-	{
-	public:
-		/**
-		 * Converts Symbian error code to OBEX error code
-		 * @param aError The error code
-		 * @return The converted error code
-		 */
-		static TInt ConvertPCDResponseCode( TInt aError );
-		/**
-		 * Converts Symbian error code to OBEX error code
-		 * @param aError The error code
-		 * @return The converted error code
-		 */
-		static TInt ConvertFTPResponseCode( TInt aError );
-		
-		/**
-		 * Converts Symbian error code to OBEX error code
-		 * @param aError The error code
-		 * @return The converted error code
-		 */
-		static TInt ConvertObexMoveResponseCode( TInt aError );
-	};
-	
-#endif //_SCONPCCONNPLUGINUTILS_H
-
-// End of file
-
--- a/connectivitymodules/SeCon/plugins/pcconn/inc/sconservicetimer.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity Plug-in Service Timer Header file
-*
-*/
-
-
-#ifndef _SCONSERVICETIMER_H
-#define _SCONSERVICETIMER_H
-
-#include <e32base.h>
-
-class CSConPCConnplugin;
-
-
-//============================================================
-// Class CSConServiceTimer declaration
-//============================================================
-
-NONSHARABLE_CLASS ( CSConServiceTimer ) : public CActive
-	{
-	public:
-		CSConServiceTimer( CSConPCConnplugin* aEngine, TInt aValue );
-		void ConstructL();
-		~CSConServiceTimer();
-		
-		/**
-	 	* Starts the timer
-		* @return none
-	 	*/
-		void StartTimer();
-		/**
-		 * Stops the timer
-		 * @return none
-		 */
-		void StopTimer();
-	
-	private:
-		void DoCancel();
-		void RunL();
-		
-	private:
-		RTimer 				iTimer;
-		CSConPCConnplugin* 	iEngine;
-		TInt 				iValue;
-	};
-	
-#endif //_SCONSERVICETIMER_H
-
-// End of file
--- a/connectivitymodules/SeCon/plugins/pcconn/inc/sconshutdownwatcher.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* 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:  Power shutdown -watcher header file
-*
-*/
-
-
-#ifndef _SCONSHUTDOWNWATCHER_H
-#define _SCONSHUTDOWNWATCHER_H
-
-
-#include <e32base.h>
-#include <e32property.h>
-
-//============================================================
-// Class MShutdownObserver declaration
-//============================================================
-class MShutdownObserver
-    {
-public:
-    virtual void NotifyShutdown()=0;
-    };
-
-//============================================================
-// Class CShutdownWatcher declaration
-//============================================================
-NONSHARABLE_CLASS (  CShutdownWatcher ) : public CActive
-    {
-    public:
-        static CShutdownWatcher* NewL( MShutdownObserver* aObserver );
-        ~CShutdownWatcher();
-
-        /**
-         * Starts to watch shutdown status
-         * @return none
-         */
-        void StartShutdownWatcher();
-
-    private:
-        //construct/destruct
-        CShutdownWatcher( MShutdownObserver* aObserver );
-        void ConstructL();
-
-        // from CActive
-        void DoCancel();
-        void RunL();
-
-    private:
-        MShutdownObserver*   iObserver; 
-        RProperty            iProperty;
-    };
-
-#endif //_SCONSHUTDOWNWATCHER_H
-
-// End of file
\ No newline at end of file
--- a/connectivitymodules/SeCon/plugins/pcconn/rom/sconpcconnplugin.iby	Tue Aug 31 15:05:37 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: Image description file for PC Connectivity Plug-in.
-*
-*/
-#ifndef __SCONPCCONN_PLUGIN_IBY__
-#define __SCONPCCONN_PLUGIN_IBY__
-//file content
-
-ECOM_PLUGIN(sconpcconnplugin.dll,101F9688.RSC)
-
-file=ABI_DIR\BUILD_DIR\catalogspcconnectivityplugin.dll              SHARED_LIB_DIR\catalogspcconnectivityplugin.dll
-
-#endif
--- a/connectivitymodules/SeCon/plugins/pcconn/src/101f9688.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity Plug-in resource file
-*
-*/
-
-
-#include "ecom/registryinfo.rh"
-
-// Declares info for two implementations
-RESOURCE REGISTRY_INFO theInfo
-	{
-	// UID for the DLL
-	dll_uid = 0x101F9688;
-	// Declare array of interface info
-	interfaces = 
-		{
-		INTERFACE_INFO
-			{
-			// UID of interface that is implemented
-			interface_uid = 0x101F7C8C;
-			implementations = 
-				{
-				// Info for CSConPCConnplugin
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x101F9689;
-					version_no = 1;
-					display_name = "PC Suite Services";
-					default_data = "OBEX/USB||OBEX/BT||OBEX/IrDA";
-					
-					// 
-					// opaque_data contains parameters used by following API calls in SRCS:
-					// 1. Setup USB interface string descriptor in Unicode;
-					// 2. TInt CObex::SetLocalWho(const TDesC8& aInfo);
-					// 3. TInt CBTConnection::RegisterSecuritySettingsL( TUint aService,
-					//						 TInt  aProtocol,
-					//						 TInt  aChannel,
-					//						 TBool aAuthenticate,
-					//						 TBool aAuthorise,
-					//						 TBool aEncrypt );
-					// opaque_data = "@0||@1||@2||@3||@4||@5||@6"
-					// @0 aStrDesc		e.g. "PC Connectivity"
-					// @1 aInfo			e.g. KFolderBrowsingID, "\xF9\xEC\x7B\xC4\x95\x3C\x11\xd2\x98\x4E\x52\x54\x00\xDC\x9E\x09"
-					// @2 aService		e.g. KBTSecurityUidFileTransfer, 0x1106
-					// @3 aProtocol		e.g. KSolBtRFCOMM, 0x1013
-					// @4 aAuthenticate	e.g. EFalse, 0
-					// @5 aAuthorise	e.g. EFalse, 0
-					// @6 aEncrypt		e.g. EFalse, 0
-					//
-					opaque_data = "PC Suite Services||\xF9\xEC\x7B\xC4\x95\x3C\x11\xd2\x98\x4E\x52\x54\x00\xDC\x9E\x09||0x000050050000100080000002EE000001||0x1013||1||1||1||0xffff||0xffff";
-					}
-				};
-			}
-		};
-	}
-
--- a/connectivitymodules/SeCon/plugins/pcconn/src/proxy.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity Plug-in proxy implementation
-*
-*/
-
-
-
-#include <e32std.h>
-#include <ecom/implementationproxy.h>
-
-#include "sconpcconnplugin.h"
-
-// Map the interface UIDs to implementation factory functions
-const TImplementationProxy ImplementationTable[] = 
-	{
-		IMPLEMENTATION_PROXY_ENTRY(0x101F9689,	CSConPCConnplugin::NewL)
-	};
-
-// Exported proxy for instantiation method resolution
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{
-	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
-
-	return ImplementationTable;
-	}
-	
-// End of file
-
-
--- a/connectivitymodules/SeCon/plugins/pcconn/src/sconpcconnplugin.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1254 +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:  PC Connectivity Plug-in implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include <obexconstantsinternal.h>
-#endif
-#include "sconpcconnplugin.h"
-#include "sconftp.h"
-#include "sconpcconnpluginutils.h"
-#include "sconservicetimer.h"
-#include "catalogspcconnectivityplugin.h"
-#include "debug.h"
-
-
-// CONSTANTS
-_LIT(KSConFTPLibName, "sconftp.dll");
-const TInt KSConFTPUidValue = 0x10009D8D;
-const TUid KSConFTPUid = {KSConFTPUidValue};
-
-// Folder listing type from IrObex specification
-_LIT8( KSConFolderListType, "x-obex/folder-listing" );
-// Folder listing type from IrObex specification
-_LIT8( KSConCapabilityObjectType, "x-obex/capability" );
-// PCD types
-_LIT8( KSConPCDObjectType, "application/vnd.nokia.pcd" );
-_LIT8( KSConPCDXMLObjectType, "application/vnd.nokia.conml+xml" );
-_LIT8( KSConPCDWBXMLObjectType, "application/vnd.nokia.conml+wbxml" );
-_LIT8( KSConPCDXMLObjectType2, "application/vnd.nokia.pcd+xml" );
-_LIT8( KSConPCDWBXMLObjectType2, "application/vnd.nokia.pcd+wbxml" );
-_LIT( K_C_ROOT, "C:\\" );
-
-// PCD header commands
-const TInt KSCon_PCD_TAG = 0x003A;
-const TInt KSCon_PCD_CMD_COPY = 0x0037;
-const TInt KSCon_PCD_CMD_MOVE_OR_RENAME = 0x0038;
-const TInt KSCon_PCD_CMD_SET_PERMISSION = 0x0039;
-// PCD header parameters
-const TInt KSCon_PCD_PAR_FULL_PERMISSION = 0x0040;
-const TInt KSCon_PCD_PAR_READ_ONLY_PERMISSION = 0x0041;
-
-
-const TInt KSConBufSize = 262144; // 256KB
-// Time (in milliseconds) for the timer
-const TInt KSConTimeOutValue =  180000000;
-// Flags used to indicate SetPath commands
-const TInt KSConNULLSetPath =   0x00;
-
-const TInt KSConHeaderMaxLength = 256;
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::NewL()
-// Two-phase constructing
-// -----------------------------------------------------------------------------
-//
-CSConPCConnplugin* CSConPCConnplugin::NewL()
-    {
-    TRACE_FUNC_ENTRY;
-    CSConPCConnplugin* self = new ( ELeave ) CSConPCConnplugin();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return( self );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::~CSConPCConnplugin()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConPCConnplugin::~CSConPCConnplugin()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Disconnect from services.
-    Disconnect();
-    
-    delete iBuffer;
-    iBuffer = NULL;
-    
-    if ( iServiceTimer )
-        {
-        iServiceTimer->Cancel();
-        }
-    
-    delete iServiceTimer;
-    iServiceTimer = NULL;
-    
-    delete iCatalogs;
-    iCatalogs = NULL;
-    delete iCatalogsMimeType;
-    iCatalogsMimeType = NULL;
-    
-    iMimeArray.Reset();
-    iMimeArray.Close();
-    
-    delete iShutdownWatcher;
-    iShutdownWatcher = NULL;
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::IsOBEXActive()
-// Returns active status of OBEX session
-// -----------------------------------------------------------------------------
-//
-TBool CSConPCConnplugin::IsOBEXActive()
-    {
-    TRACE_FUNC;
-    return iSessionActive;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::NotifyShutdown()
-// System is shutting down
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::NotifyShutdown()
-    {
-    TRACE_FUNC;
-    iShutdownInProgress = ETrue;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::LoadFTPDllL()
-// Loads sconftp.dll module
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::LoadFTPDllL()
-    {
-    TRACE_FUNC_ENTRY;
-    // Dynamically load DLL
-    User::LeaveIfError( iFTPlib.Load( KSConFTPLibName ) );
-    if ( iFTPlib.Type()[1] != KSConFTPUid )
-        {
-        LOGGER_WRITE( "KSConFTPUidValue incorrect" );
-        iFTPlib.Close();
-        User::Leave( KErrNotFound );
-        }
-    TSConCreateCSConFTPFunc CreateCSConFTPL =
-    (TSConCreateCSConFTPFunc)iFTPlib.Lookup(1);
-    iFTPHandler = (CSConFTP*)CreateCSConFTPL();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::Disconnect()
-// Closes initialized services
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::Disconnect()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iLinkAdapter.Close();
-    iSocketServer.Close();
-    
-    //Disconnect from server
-    iPCConnSession.Close();
-    iPCConnSessionConnected = EFalse;
-    
-    if ( iStartTimer != EFalse )
-        {
-        iServiceTimer->Cancel();
-        iServiceTimer->StartTimer();
-        }
-    
-    delete iObject;
-    iObject = NULL;
-    
-    if ( iFTPHandler )
-        {
-        delete iFTPHandler;
-        iFTPHandler = NULL;
-        iFTPlib.Close();
-        }
-    if ( iFileObject )
-        {
-        delete iFileObject;
-        iFileObject = NULL;
-        }
-    if ( iCatalogsConnected )
-        {
-        iCatalogs->Close();
-        iCatalogsConnected = EFalse;
-        iCatalogsMimeTypesExist = EFalse;
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::ErrorIndication( TInt aError )
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::ErrorIndication( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aError : %d", aError );
-
-    if ( iFTPHandler )
-        {
-        iFTPHandler->AbortFileTransfer( iObject );
-        }
-
-    if ( iObject )
-        {
-        delete iObject;
-        iObject = NULL;
-        }
-    
-    if ( iFileObject )
-        {
-        iFileObject->Reset();
-        delete iFileObject;
-        iFileObject = NULL;
-        }
-    
-    if ( iPCConnSessionConnected )
-        {
-        iPCConnSession.ResetServer();
-        }
-    
-    // Keep compiler happy
-    (void)aError;
-    
-    delete iShutdownWatcher;
-    iShutdownWatcher = NULL;
-    
-    if ( iLinkAdapter.IsOpen() )
-        {
-        // Cancel ActivateActiveRequester & allow going to low power mode
-        TInt err = iLinkAdapter.CancelLowPowerModeRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.CancelLowPowerModeRequester() err: %d", err );
-        }
-
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::AbortIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::AbortIndication()
-    {
-    TRACE_FUNC_ENTRY;
-
-    if ( iFTPHandler )
-        {
-        iFTPHandler->AbortFileTransfer( iObject );
-        }
-
-    if ( iObject )
-        {
-        delete iObject;
-        iObject = NULL;
-        }
-    
-    if ( iFileObject )
-        {
-        iFileObject->Reset();
-        delete iFileObject;
-        iFileObject = NULL;
-        }
-    
-    if ( iPCConnSessionConnected )
-        {
-        iPCConnSession.ResetServer();
-        }
-    
-    delete iShutdownWatcher;
-    iShutdownWatcher = NULL;
-    
-    if ( iLinkAdapter.IsOpen() )
-        {
-        // Cancel ActivateActiveRequester & allow going to low power mode
-        TInt err = iLinkAdapter.CancelLowPowerModeRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.CancelLowPowerModeRequester() err: %d", err );
-        }
-
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::TransportUpIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::TransportUpIndication()
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::ObexConnectIndication( const TObexConnectInfo&
-// aRemoteInfo, const TDesC8& aInfo )
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnplugin::ObexConnectIndication( const TObexConnectInfo&
-                                    /*aRemoteInfo*/, const TDesC8& /*aInfo*/ )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err( KErrNone );
-    TInt catalogsErr( KErrNone );
-    iStartTimer = ETrue;
-    
-    if ( iMediaType == ESrcsMediaBT && iObexServer )
-        {
-        TSockAddr remoteAddr;
-        iObexServer->RemoteAddr( remoteAddr );
-        
-        TBTSockAddr btSockAddr( remoteAddr );
-        TBTDevAddr devAddr = btSockAddr.BTAddr();
-        
-        err = iSocketServer.Connect();
-        LOGGER_WRITE_1("iSocketServer.Connect err: %d", err );
-        if ( !err )
-            {
-            err = iLinkAdapter.Open( iSocketServer, devAddr );
-            LOGGER_WRITE_1("iLinkAdapter.Open err: %d", err );
-            }
-        // Ignore all BT link errors
-        err = KErrNone;
-        }
-    
-    //Connect to server
-    if ( !iPCConnSessionConnected )
-        {
-        LOGGER_WRITE("Try to connect to iPCConnSession");
-        err = iPCConnSession.Connect();
-        LOGGER_WRITE_1( "iPCConnSession.Connect returned : %d", err );
-        if ( err == KErrNone )
-            {
-            iPCConnSessionConnected = ETrue;
-            }
-        }
-    
-    if ( err == KErrNone && !iFTPHandler )
-        {
-        TRAP( err, LoadFTPDllL() );
-        LOGGER_WRITE_1( "LoadFTPDllL returned : %d", err );
-        }
-    
-    if ( err == KErrNone )
-        {
-        iFTPHandler->SetProfile( EProprietary );
-        LOGGER_WRITE( "iServiceTimer->StopTimer()" );
-        iServiceTimer->Cancel();
-        iServiceTimer->StopTimer();
-        }
-
-    if ( !iCatalogsConnected )
-        {
-        LOGGER_WRITE( "CSConPCConnplugin::ObexConnectIndication() before iCatalogs->Connect()" );
-        catalogsErr = iCatalogs->Connect();
-        LOGGER_WRITE_1( "CSConPCConnplugin::ObexConnectIndication() iCatalogs->Connect() err: %d", catalogsErr );
-        if ( catalogsErr == KErrNone )
-            {
-            LOGGER_WRITE( "CSConPCConnplugin::ObexConnectIndication() iCatalogs->Connect() success" );
-            iCatalogsConnected = ETrue;
-            TRAPD( ret, iMimeArray = iCatalogs->SupportedMimeTypesL() );
-            if ( ret == KErrNone )
-                {
-                LOGGER_WRITE_1( "iCatalogs->SupportedMimeTypesL count: %d", iMimeArray.Count() );
-                iCatalogsMimeTypesExist = ETrue;
-                }
-            }
-        }
-    TRACE_FUNC_EXIT;
-    return TPCConnpluginUtils::ConvertFTPResponseCode( err );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::ObexDisconnectIndication( const TDesC8& )
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::ObexDisconnectIndication( const TDesC8& )
-    {
-    TRACE_FUNC_ENTRY;
-    Disconnect();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::TransportDownIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::TransportDownIndication()
-    {
-    TRACE_FUNC_ENTRY;
-    Disconnect();
-    if ( iBuffer )
-        {
-        iBuffer->Reset();
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::PutRequestIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-CObexBufObject* CSConPCConnplugin::PutRequestIndication()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    TInt err( KErrNone );
-    iPutError = KErrNone;
-
-    if ( iBuffer )
-        {
-        iBuffer->Reset();
-        }
-
-    if ( iObject )
-        {
-        delete iObject;
-        iObject = NULL;
-        }
-
-    TRAP( err, iObject = CObexBufObject::NewL ( iBuffer ) );
-
-    if ( err != KErrNone )
-        {
-        return NULL;
-        }
-
-    if ( !iFTPHandler )
-        {
-        LOGGER_WRITE( "Creating iFTPHandler has failed" );
-        return NULL;
-        }
-
-    TRAP( err, ret = iFTPHandler->PutFileObjectInitL( iObject, iBuffer ) );
-
-    if ( err != KErrNone )
-        {
-        LOGGER_WRITE_1( "iFTPHandler->PutFileObjectInitL() leaves: %d", err );
-        return NULL;
-        }
-    if ( ret != KErrNone )
-        {
-        LOGGER_WRITE_1( "PutFileObjectInitL failed - returning error in next PutPacketIndication : %d", ret );
-        iPutError = ret;
-        }
-    iPutPacketIndicationCalled = EFalse;
-    
-    if ( !iShutdownWatcher )
-        {
-        TRAP( err, iShutdownWatcher = CShutdownWatcher::NewL( this ) );
-        if ( err == KErrNone )
-            {
-            iShutdownWatcher->StartShutdownWatcher();
-            }
-        else
-            {
-            LOGGER_WRITE_1( "CShutdownWatcher::NewL leaves: %d", err );
-            }
-        }
-    
-    if ( iLinkAdapter.IsOpen() )
-        {
-        // request active BT mode (high power mode)
-        err = iLinkAdapter.ActivateActiveRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.ActivateActiveRequester() err: %d", err );
-        }
-    
-    TRACE_FUNC_EXIT;
-    return( iObject );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::PutPacketIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnplugin::PutPacketIndication()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-
-    TBool catalogsMime( EFalse );
-    if ( iObject->Type().Length() > KSConHeaderMaxLength )
-        {
-        LOGGER_WRITE("TypeHeader too big, return KErrNotSupported");
-        return TPCConnpluginUtils::ConvertFTPResponseCode( KErrNotSupported );
-        }
-    TBuf8<KSConHeaderMaxLength> typeHeader( iObject->Type() );
-    TrimRightSpaceAndNull( typeHeader );
-    
-    if ( iCatalogsConnected && IsCatalogsMimeType( TDataType( typeHeader ) ) )
-        {
-        catalogsMime = ETrue;
-        }
-
-    if ( (TInt)iObject->Length() > 0 
-        && typeHeader != KSConPCDWBXMLObjectType
-        && typeHeader != KSConPCDWBXMLObjectType2
-        && !catalogsMime
-        && typeHeader != KSConPCDObjectType )
-        {
-        // normal file transfer
-        if ( !iPutPacketIndicationCalled )
-            {
-            // This is first check, need to check only once
-                   
-            TFileName path;
-            iFTPHandler->GetPath( path );
-            if ( path.CompareF( K_C_ROOT ) == 0 )
-                {
-                // path forbidden
-                ret = KErrAccessDenied;
-                }
-            else
-                {
-                if ( iPutError != KErrNone )
-                    {
-                    ret = iPutError;
-                    LOGGER_WRITE_1( "CSConPCConnplugin::PutPacketIndication() : PutError : %d", iPutError );
-                    }
-                else
-                    {
-                    // check required free space
-                    // if filesize is small ( <65k ) it fits into one package and its already saved to filesystem.
-                    // if file is larger, need to check is there enought free space in device.
-                    
-                    const TUint32  filesize = iObject->Length();
-                    LOGGER_WRITE_1( "CSConPCConnplugin::PutPacketIndication() filesize %d", filesize );
-                    LOGGER_WRITE_1( "CSConPCConnplugin::PutPacketIndication() iObject->BytesReceived() %d", iObject->BytesReceived() );
-                    if ( filesize > iObject->BytesReceived() )
-                        {
-                        LOGGER_WRITE( "CSConPCConnplugin::PutPacketIndication() : check freespace" );
-                        // file does not fit into one obex packet, check is there enought free space in current drive
-                        if ( iFTPHandler->IsCurrentDiskSpaceBelowCritical( filesize ) )
-                            {
-                            LOGGER_WRITE( "CSConPCConnplugin::PutPacketIndication() : returning KErrNoMemory" );
-                            ret = KErrNoMemory;
-                            }
-                        }
-                    }
-                }
-            }
-        
-        if ( iShutdownInProgress )
-            {
-            LOGGER_WRITE( "ShutdownInProgress, abort" );
-            ret = KErrDisconnected;
-            }
-        }
-    
-    if ( !iPutPacketIndicationCalled )
-        {
-        // Need to check only once
-        iPutPacketIndicationCalled = ETrue;
-        
-        //Check if filename is too long.
-        TFileName path;
-        iFTPHandler->GetPath( path );
-        if ( ret == KErrNone && path.Length() + iObject->Name().Length() > KMaxFileName )
-            {
-            LOGGER_WRITE_1( "Name length overflow! : %d", path.Length() + iObject->Name().Length() );
-            ret = KErrBadName;
-            }
-        }
-    
-    if ( ret != KErrNone )
-        {
-        if ( iFTPHandler )
-            {
-            iFTPHandler->AbortFileTransfer( iObject );
-            }
-        
-        delete iObject;
-        iObject = NULL;
-        
-        if ( iLinkAdapter.IsOpen() )
-            {
-            // Cancel ActivateActiveRequester & allow going to low power mode
-            TInt err = iLinkAdapter.CancelLowPowerModeRequester();
-            LOGGER_WRITE_1( "iLinkAdapter.CancelLowPowerModeRequester() err: %d", err );
-            }
-        }
-    
-    LOGGER_WRITE_1( "CSConPCConnplugin::PutPacketIndication(): ret %d", ret );
-    return TPCConnpluginUtils::ConvertFTPResponseCode( ret );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::PutCompleteIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnplugin::PutCompleteIndication()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    TInt err( KErrNone );
-    
-    if ( iLinkAdapter.IsOpen() )
-        {
-        // Cancel ActivateActiveRequester & allow going to low power mode
-        TInt err2 = iLinkAdapter.CancelLowPowerModeRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.CancelLowPowerModeRequester() err: %d", err2 );
-        }
-    
-    if ( iObject->Type().Length() > KSConHeaderMaxLength )
-        {
-        LOGGER_WRITE("TypeHeader too big, return KErrNotSupported");
-        delete iObject;
-        iObject = NULL;
-                
-        iFTPHandler->DeleteTempFile();
-        return TPCConnpluginUtils::ConvertPCDResponseCode( KErrNotSupported );
-        }
-    if ( iObject->Name().Length() > KSConHeaderMaxLength )
-        {
-        LOGGER_WRITE("NameHeader too big, return KErrNotSupported");
-        delete iObject;
-        iObject = NULL;
-                
-        iFTPHandler->DeleteTempFile();
-        return TPCConnpluginUtils::ConvertPCDResponseCode( KErrNotSupported );
-        }
-    
-    // check if ConML signal is received
-    TBuf8<KSConHeaderMaxLength> typeHeader( iObject->Type() );
-    TBuf<KSConHeaderMaxLength> nameHeader( iObject->Name() );
-    TrimRightSpaceAndNull( typeHeader );
-    LOGGER_WRITE8_1("type: %S", &typeHeader);
-    LOGGER_WRITE_1("name: %S", &nameHeader);
-    LOGGER_WRITE_1("description: %S", &iObject->Description());
-    TInt size = iObject->BytesReceived();
-    TTime time = iObject->Time();
-    
-    // shutdownWatcher is not needed anymore
-    delete iShutdownWatcher;
-    iShutdownWatcher = NULL;
-    
-    if ( IsCatalogsMimeType( TDataType( typeHeader ) ) )
-        {
-        if ( iCatalogsConnected )
-            {
-            LOGGER_WRITE( "iCatalogs->PutDataL" );
-            TRAP( err, iCatalogs->PutDataL( typeHeader, *iBuffer ) );
-            LOGGER_WRITE_1( "iCatalogs->PutDataL : %d", err );
-            if ( err == KErrServerTerminated )
-                {
-                err = iCatalogs->Connect();
-                LOGGER_WRITE_1( "CSConPCConnplugin::PutCompleteIndication() iCatalogs->Connect() err: %d", err );
-                if ( err == KErrNone )
-                    {
-                    LOGGER_WRITE( "iCatalogs->PutDataL" );
-                    TRAP( err, iCatalogs->PutDataL( typeHeader, *iBuffer ) );
-                    LOGGER_WRITE_1( "iCatalogs->PutDataL : %d", err );
-                    }
-                }
-            }
-        else
-            {
-            LOGGER_WRITE( "Catalogs mime type recognised - failing due no connection" );
-            err = KErrNotSupported;
-            }
-        
-        delete iObject;
-        iObject = NULL;
-        
-        iFTPHandler->DeleteTempFile();
-        return TPCConnpluginUtils::ConvertPCDResponseCode( err );
-        }
-
-    if ( typeHeader == KSConPCDObjectType )
-        {
-        LOGGER_WRITE( "CSConPCConnplugin::PutCompleteIndication KSConPCDObjectType" );
-        err = HandlePCDObjectPut( iObject->Description(), iObject->Name() );
-        delete iObject;
-        iObject = NULL;
-        
-        iFTPHandler->DeleteTempFile();
-        LOGGER_WRITE_1( "CSConPCConnplugin::PutCompleteIndication() end, err: %d", err );
-        return TPCConnpluginUtils::ConvertObexMoveResponseCode( err );
-        }
-
-    if ( typeHeader != KSConPCDWBXMLObjectType &&
-        typeHeader != KSConPCDWBXMLObjectType2 )
-        {
-        TObexHeaderMask validHdrs = iObject->ValidHeaders();
-        if ( ( validHdrs & KObexHdrBody ) || ( validHdrs & KObexHdrEndOfBody ) )
-            {
-            LOGGER_WRITE( "CSConPCConnplugin::PutCompleteIndication() normal filetransfer" );
-            LOGGER_WRITE_1( "Number of received bytes : %d", size );
-            TSConUsedMedia media( ESConNoMedia );
-            
-            switch( iMediaType )
-                {
-                case ESrcsMediaBT :
-                    media = ESConBTMedia;
-                    break;
-                case ESrcsMediaIrDA :
-                    media = ESConIRMedia;
-                    break;
-                case ESrcsMediaUSB :
-                    media = ESConUSBMedia;
-                    break;
-                default :
-                    media = ESConNoMedia;
-                    break;
-                }
-            
-            iFTPHandler->SetUsedMedia( media );
-            
-            TRAP( ret, err = iFTPHandler->PutFileObjectFinalizeL( iObject ) );
-            LOGGER_WRITE_1( "PutFileObjectL() returned : %d", ret );
-            }
-        else
-            {
-            LOGGER_WRITE( "Delete starts" );
-            TRAP( ret, err = iFTPHandler->DeleteObjectL( iObject->Name() ) );
-            LOGGER_WRITE_1( "DeleteObjectL() returned : %d", ret );
-            }
-        }
-    
-    delete iObject;
-    iObject = NULL;
-    
-    if ( typeHeader == KSConPCDWBXMLObjectType ||
-        typeHeader == KSConPCDWBXMLObjectType2 )
-        {
-        LOGGER_WRITE( "CSConPCConnplugin::PutCompleteIndication() ReadWBXMLDataL" );
-        TRAP( ret, err = iFTPHandler->ReadWBXMLDataL( iBuffer ) );
-        
-        if ( err == KErrNone && ret == KErrNone )
-            {
-            TRAP( ret, err = iPCConnSession.PutPacketL( nameHeader,
-            typeHeader, iBuffer ) );
-            LOGGER_WRITE_1( "iPCConnSession.PutPacketL() leaveCode : %d", ret );
-            LOGGER_WRITE_1( "iPCConnSession.PutPacketL() returned : %d", err );
-            }
-        
-        iFTPHandler->DeleteTempFile();
-        
-        return TPCConnpluginUtils::ConvertPCDResponseCode( err );
-        }
-    
-    iFTPHandler->DeleteTempFile();
-    
-    TRACE_FUNC_EXIT;
-    if ( ret != KErrNone )
-        {
-        return TPCConnpluginUtils::ConvertFTPResponseCode( ret );
-        }
-    return TPCConnpluginUtils::ConvertFTPResponseCode( err );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::GetRequestIndication( CObexBaseObject* aRequiredObject )
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-CObexBufObject* CSConPCConnplugin::GetRequestIndication( CObexBaseObject*
-                                                        aRequiredObject )
-    {
-    TRACE_FUNC_ENTRY;
-    CObexBufObject* bufObject(NULL);
-    if ( aRequiredObject->Type().Length() > KSConHeaderMaxLength )
-        {
-        LOGGER_WRITE("TypeHeader too big");
-        return NULL;
-        }
-    if ( aRequiredObject->Name().Length() > KMaxFileName )
-        {
-        LOGGER_WRITE("NameHeader is too long");
-        return NULL;
-        }
-    TInt ret( KErrNone );
-    TInt err( KErrNone );
-    TBuf8<KSConHeaderMaxLength> typeHeader( aRequiredObject->Type() );
-    TrimRightSpaceAndNull( typeHeader );
-    LOGGER_WRITE8_1("type: %S", &typeHeader);
-    LOGGER_WRITE_1("name: %S", &aRequiredObject->Name());
-
-    iBuffer->Reset();
-    
-    delete iObject;
-    iObject = NULL;
-    
-    TRAP( err, iObject = CObexBufObject::NewL ( iBuffer ) );
-    if ( err != KErrNone )
-        {
-        return NULL;
-        }
-    
-    // Client requests folder listing
-    if ( typeHeader == KSConFolderListType )
-        {
-        LOGGER_WRITE( "Client requests folder listning" );
-        if ( !iFTPHandler )
-            {
-            LOGGER_WRITE( "Creating iFTPHandler has failed" );
-            return NULL;
-            }
-
-        TRAP( err, ret = iFTPHandler->GetFolderObjectL( iObject ) );
-        LOGGER_WRITE_1( "iFTPHandler->GetFolderObjectL() returned: %d", ret );
-        if ( err == KErrNone && ret == KErrNone )
-            {
-            bufObject = iObject;
-            }
-        else
-            {
-            return NULL;
-            }
-        }
-    // Client requests capability object or ConML packet
-    else if ( typeHeader == KSConCapabilityObjectType
-            || typeHeader == KSConPCDWBXMLObjectType
-            || typeHeader == KSConPCDWBXMLObjectType2)
-        {
-        LOGGER_WRITE( "Client requests capability object or ConML packet" );
-        // HandleGetPCConnObjectL will set some data to iObject, or leaves if error occurs
-        TRAP( err, HandleGetPCConnObjectL( aRequiredObject->Name(), typeHeader ) );
-        
-        if ( err == KErrNone )
-            {
-            bufObject = iObject;
-            }
-        else
-            {
-            LOGGER_WRITE_1("Get PCConn object failed, err: %d", err);
-            return NULL;
-            }
-        }
-    // Client requests file conversion
-    else if ( typeHeader == KSConPCDObjectType )
-        {
-        LOGGER_WRITE("request of KSConPCDObjectType is not supported.")
-        return NULL;
-        }
-    // catalogs
-    else if ( IsCatalogsMimeType( TDataType( typeHeader ) ) )
-        {
-        TRAP( err, HandleGetCatalogsObjectL( typeHeader ) );
-        if ( err == KErrNone )
-            {
-            bufObject = iObject;
-            }
-        else
-            {
-            LOGGER_WRITE_1("Get catalogs object failed, err: %d", err);
-            return NULL;
-            }
-        }
-    // Client requests file
-    else
-        {
-        LOGGER_WRITE( "Client requests file" );
-        TRAP( err, HandleGetFileObjectL( aRequiredObject->Name() ) );
-        if ( err == KErrNone )
-            {
-            bufObject = (CObexBufObject*)iFileObject;
-            }
-        else
-            {
-            LOGGER_WRITE_1("Get file object failed, err: %d", err);
-            return NULL;
-            }
-        }
-    if ( bufObject && iLinkAdapter.IsOpen() )
-        {
-        // request active BT mode (high power mode)
-        err = iLinkAdapter.ActivateActiveRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.ActivateActiveRequester() err: %d", err );
-        }
-    return bufObject;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::GetPacketIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnplugin::GetPacketIndication()
-    {
-    TRACE_FUNC;
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::GetCompleteIndication()
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnplugin::GetCompleteIndication()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iLinkAdapter.IsOpen() )
-        {
-        // Cancel ActivateActiveRequester & allow going to low power mode
-        TInt err = iLinkAdapter.CancelLowPowerModeRequester();
-        LOGGER_WRITE_1( "iLinkAdapter.CancelLowPowerModeRequester() err: %d", err );
-        }
-    
-    TInt ret( KErrNone );
-    if ( iFileObject )
-        {
-        iFileObject->Reset();
-        delete iFileObject;
-        iFileObject = NULL;
-        }
-
-    LOGGER_WRITE_1( "CSConPCConnplugin::GetCompleteIndication() : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::SetPathIndication( const CObex::TSetPathInfo& aPathInfo,
-// const TDesC8& aInfo )
-// MObexServerNotify implementation
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnplugin::SetPathIndication( const CObex::TSetPathInfo& aPathInfo,
-                                            const TDesC8& /*aInfo*/ )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    TInt err( KErrNone );
-    
-    if ( !iFTPHandler )
-        {
-        LOGGER_WRITE( "Creating iFTPHandler has failed" );
-        return TPCConnpluginUtils::ConvertFTPResponseCode( KErrNoMemory );
-        }
-    
-    if ( aPathInfo.iFlags == KSConNULLSetPath )
-        {
-        TRAP( err, ret = this->iFTPHandler->CreateFolderL( aPathInfo.iName ) );
-        }
-    else
-        {
-        TRAP( err, ret = this->iFTPHandler->SetPathL( aPathInfo.iName,
-        aPathInfo.iFlags ) );
-        }
-    
-    if ( err != KErrNone )
-        {
-        LOGGER_WRITE_1( "CSConPCConnplugin::SetPathIndication : returned   %d", err );
-        return TPCConnpluginUtils::ConvertFTPResponseCode( err );
-        }
-    LOGGER_WRITE_1( "CSConPCConnplugin::SetPathIndication : returned %d", ret );
-    return TPCConnpluginUtils::ConvertFTPResponseCode( ret );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::TrimRightSpaceAndNull( TDes8& aDes ) const
-// Removes spaces and nulls from the end of the string
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::TrimRightSpaceAndNull( TDes8& aDes ) const
-    {
-    TRACE_FUNC;
-    aDes.TrimRight();
-    if ( aDes.Length() > 0 )
-        {
-        if ( !aDes[aDes.Length() - 1] )
-            {
-            aDes.SetLength( aDes.Length() - 1 );
-            }
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::SetMediaType( TSrcsMediaType aMediaType )
-// Current used transfer media (IR,USB,BT)
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::SetMediaType( TSrcsMediaType aMediaType )
-    {
-    TRACE_FUNC;
-    iMediaType = aMediaType;
-    }
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::TBool IsCatalogsMimeType( TDataType aMime )
-// Checks if mime type belogs to Catalogs
-// -----------------------------------------------------------------------------
-//
-TBool CSConPCConnplugin::IsCatalogsMimeType( TDataType aMime )
-    {
-    TRACE_FUNC_ENTRY;
-    TBool result = EFalse;
-
-    if ( !iCatalogsConnected
-        && aMime.Des8() != KSConPCDObjectType
-        && aMime.Des8() != KSConPCDXMLObjectType
-        && aMime.Des8() != KSConPCDWBXMLObjectType
-        && aMime.Des8() != KSConPCDXMLObjectType2
-        && aMime.Des8() != KSConPCDWBXMLObjectType2
-        )
-        {
-        // Catalogs never connected and not secon mime type
-        // Try to connect to catalogs to get catalogstypes
-        TInt catalogsErr = iCatalogs->Connect();
-        LOGGER_WRITE_1( "CSConPCConnplugin::IsCatalogsMimeType() iCatalogs->Connect() err: %d", catalogsErr );
-        if ( catalogsErr == KErrNone )
-            {
-            LOGGER_WRITE( "CSConPCConnplugin::IsCatalogsMimeType() iCatalogs->Connect() success" );
-            iCatalogsConnected = ETrue;
-            TRAPD( ret, iMimeArray = iCatalogs->SupportedMimeTypesL() );
-            if ( ret == KErrNone )
-                {
-                LOGGER_WRITE_1( "iCatalogs->SupportedMimeTypesL count: %d", iMimeArray.Count() );
-                iCatalogsMimeTypesExist = ETrue;
-                }
-            }
-        }
-
-    if ( iCatalogsMimeTypesExist )
-        {
-        // Compare to supported values
-        for ( TInt j = 0; j < iMimeArray.Count(); j++ )
-            {
-            if ( (*iMimeArray[j]) == aMime )
-                {
-                LOGGER_WRITE( "CSConPCConnplugin::IsCatalogsMimeTypeL returns TRUE" );
-                result = ETrue;
-                break;
-                }
-            }
-        }
-    TRACE_FUNC_EXIT;
-    return result;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::CSConPCConnplugin()
-// Default constructor
-// -----------------------------------------------------------------------------
-//
-CSConPCConnplugin::CSConPCConnplugin()
-    {
-    TRACE_FUNC;
-    iBuffer = NULL;
-    iObject = NULL;
-    iFileObject = NULL;
-    iSessionActive = EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    iBuffer = CBufFlat::NewL( KSConBufSize );
-    iObject = CObexBufObject::NewL ( iBuffer );
-    iServiceTimer = new (ELeave) CSConServiceTimer( this, KSConTimeOutValue );
-    iServiceTimer->ConstructL();
-    CActiveScheduler::Add( iServiceTimer );
-    
-    // catalogs
-    iCatalogs = CCatalogsPCConnectivityPlugin::NewL();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::SetObexServer( CObexServer* aObexServer )
-// SetObexServer
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnplugin::SetObexServer( CObexServer* aObexServer )
-    {
-    iObexServer = aObexServer;
-    TInt ret = iObexServer->Start(this);
-    LOGGER_WRITE_1( "CSConPCConnplugin::SetObexServer() ret: %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::HandlePCDObjectPut
-// Handles PCD object. Used for advanced file handling.
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnplugin::HandlePCDObjectPut( const TDesC& aDescriptionHeader,
-        const TDesC& aNameHeader )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err( KErrNotSupported);
-    if ( aDescriptionHeader.Length() >= 3 )
-        {
-        TInt commandTag = aDescriptionHeader[0];
-        TInt commandID = aDescriptionHeader[1];
-        TInt commandParam1 = aDescriptionHeader[2];
-
-        TPtrC destination;
-        if ( aDescriptionHeader.Length() >= 3 )
-            {
-            destination.Set( aDescriptionHeader.Mid(3) );
-            }
-        TPtrC source;
-        if ( aNameHeader.Length() >= 1 )
-            {
-            // remove ":" character from beginning
-            source.Set( aNameHeader.Mid(1) );
-            }
-
-        if ( commandTag == KSCon_PCD_TAG )
-            {
-            LOGGER_WRITE( "CSConPCConnplugin::HandlePCDObjectPut KSCon_PCD_TAG found" );
-            switch (commandID)
-                {
-                case KSCon_PCD_CMD_COPY:
-                    err = iFTPHandler->CopyFile( source, destination );
-                    break;
-
-                case KSCon_PCD_CMD_MOVE_OR_RENAME:
-                    err = iFTPHandler->MoveFile( source, destination );
-                    break;
-
-                case KSCon_PCD_CMD_SET_PERMISSION:
-                    if ( commandParam1 == KSCon_PCD_PAR_FULL_PERMISSION )
-                        {
-                        err = iFTPHandler->SetReadOnly( source, EFalse );
-                        }
-                    else if ( commandParam1 == KSCon_PCD_PAR_READ_ONLY_PERMISSION )
-                        {
-                        err = iFTPHandler->SetReadOnly( source, ETrue );
-                        }
-                    else
-                        {
-                        err = KErrNotSupported;
-                        }
-                    break;
-
-                default:
-                    LOGGER_WRITE( "CSConPCConnplugin::HandlePCDObjectPut unknown commandID" );
-                    err = KErrNotSupported;
-                    break;
-                }
-
-            }
-
-        }
-    TRACE_FUNC_EXIT;
-    return err;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::HandleGetPCConnObjectL
-// Get Capbility object or ConML message from PCConnServer
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::HandleGetPCConnObjectL( const TDesC& aNameHeader,
-        const TDesC8& aTypeHeader )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !iPCConnSessionConnected )
-        {
-        LOGGER_WRITE( "ERROR, iPCConnSession was not connected" );
-        User::Leave( KErrNotReady );
-        }
-    TInt err = iPCConnSession.GetPacketL( aNameHeader, aTypeHeader, iBuffer );
-    LOGGER_WRITE_1( "iPCConnSession.GetPacketL() returned: %d", err );
-    User::LeaveIfError( err );
-    iObject->SetDataBufL( iBuffer );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::HandleGetCatalogsObjectL
-// Get Catalogs object
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::HandleGetCatalogsObjectL( const TDesC8& aTypeHeader )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err(KErrNone);
-    if ( !iCatalogsConnected )
-        {
-        LOGGER_WRITE( "catalogs mime type recognised - failing due to no connection" );
-        User::Leave( KErrNotReady );
-        }
-    else
-        {
-        LOGGER_WRITE( "iCatalogs->GetDataL" );
-        TDataType mime( aTypeHeader );
-        TRAP( err, iCatalogs->GetDataL( mime, *iBuffer ) );
-        LOGGER_WRITE_1( "iCatalogs->GetDataL : %d", err );
-        if ( err == KErrServerTerminated )
-            {
-            // server was terminated, try to reconnect
-            err = iCatalogs->Connect();
-            LOGGER_WRITE_1( "iCatalogs->Connect() err: %d", err );
-            User::LeaveIfError( err );
-            LOGGER_WRITE( "iCatalogs->GetDataL" );
-            iCatalogs->GetDataL( mime, *iBuffer );
-            }
-        }
-    User::LeaveIfError( err );
-    iObject->SetDataBufL( iBuffer );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnplugin::HandleGetFileObjectL
-// Get file object
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnplugin::HandleGetFileObjectL( const TDesC& aNameHeader )
-    {
-    TRACE_FUNC_ENTRY;
-    delete iFileObject;
-    iFileObject = NULL;
-    iFileObject = CObexFileObject::NewL();
-    
-    iFileObject->Reset();
-    iFileObject->SetNameL( aNameHeader );
-
-    if ( !iFTPHandler )
-        {
-        LOGGER_WRITE( "Creating iFTPHandler has failed" );
-        User::Leave( KErrNotReady );
-        }
-
-    TInt err = iFTPHandler->GetFileObjectL( iFileObject );
-    User::LeaveIfError( err );
-    TRACE_FUNC_EXIT;
-    }
-
-// End of file
--- a/connectivitymodules/SeCon/plugins/pcconn/src/sconpcconnpluginutils.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,274 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity Plug-in Utils implementation
-*
-*/
-
-
-// INCLUDE FILES
-#include <obexconstants.h>
-#include "sconpcconnpluginutils.h"
-#include "debug.h"
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// TPCConnpluginUtils::ConvertFTPResponseCode( TInt aError )
-// Converts Symbian error code to OBEX error code
-// -----------------------------------------------------------------------------
-//
-TInt TPCConnpluginUtils::ConvertFTPResponseCode( TInt aError )
-	{
-	LOGGER_WRITE_1( "TPCConnpluginUtils::ConvertFTPResponseCode( TInt aError )\
-	 : begin, aError: %d", aError );
-	TInt obexErr ( KErrIrObexRespBadRequest );
-	switch( aError )
-		{
-		case KErrNone:
-			obexErr = KErrNone;
-			break;
-		case KErrNotFound:
-			obexErr = KErrIrObexRespNotFound;
-			break;
-		case KErrGeneral:
-		case KErrCancel:
-			obexErr = KErrIrObexRespBadRequest;
-			break;
-		case KErrNoMemory:
-			obexErr = KErrIrObexRespDatabaseFull;
-			break;
-		case KErrNotSupported:
-			obexErr = KErrIrObexRespNotImplemented;
-			break;
-		case KErrArgument:
-		case KErrTotalLossOfPrecision:
-		case KErrBadHandle:
-		case KErrOverflow:
-		case KErrUnderflow:
-		case KErrAlreadyExists:
-			obexErr = KErrIrObexRespConflict;
-			break;
-		case KErrPathNotFound:
-		case KErrDied:
-			obexErr = KErrIrObexRespNotFound;
-			break;
-		case KErrInUse:
-			obexErr = KErrIrObexRespTimedOut;
-			break;
-		case KErrServerTerminated:
-			obexErr = KErrIrObexRespNotFound;
-			break;
-		case KErrServerBusy:
-		case KErrCompletion:
-		case KErrNotReady:
-		case KErrUnknown:
-		case KErrCorrupt:
-			obexErr = KErrIrObexRespForbidden;
-			break;
-		case KErrAccessDenied:
-		case KErrLocked:
-			obexErr = KErrIrObexRespUnauthorized;
-			break;
-		case KErrWrite:
-		case KErrDisMounted:
-		case KErrEof:
-			obexErr = KErrIrObexRespForbidden;
-			break;
-		case KErrDiskFull:
-			obexErr = KErrIrObexRespDatabaseFull;
-			break;
-		case KErrBadDriver:
-		case KErrBadName:
-			obexErr = KErrIrObexRespPreCondFailed;
-			break;
-		case KErrCommsLineFail:
-		case KErrCommsFrame:
-		case KErrCommsOverrun:
-		case KErrCommsParity:
-		case KErrTimedOut:
-		case KErrCouldNotConnect:
-		case KErrCouldNotDisconnect:
-		case KErrBadLibraryEntryPoint:
-		case KErrBadDescriptor:
-		case KErrAbort:
-			obexErr = KErrIrObexRespForbidden;
-			break;
-		case KErrTooBig:
-			obexErr = KErrIrObexRespReqEntityTooLarge;
-			break;
-		case KErrDivideByZero:
-		case KErrBadPower:
-		case KErrDirFull:
-		case KErrHardwareNotAvailable:
-			obexErr = KErrIrObexRespForbidden;
-			break;
-		case KErrDisconnected: // System is shutting down
-		    obexErr = KErrIrObexRespMethodNotAllowed;
-		    break;
-		default:
-			obexErr = KErrIrObexRespBadRequest;
-			break;
-		};
-	LOGGER_WRITE_1( "TPCConnpluginUtils::ConvertFTPResponseCode( \
-	TInt aError ) returned : %d", obexErr );
-	return obexErr;
-};
-
-// -----------------------------------------------------------------------------
-// TPCConnpluginUtils::ConvertPCDResponseCode( TInt aError )
-// Converts Symbian error code to OBEX error code
-// -----------------------------------------------------------------------------
-//
-TInt TPCConnpluginUtils::ConvertPCDResponseCode( TInt aError )
-	{
-	LOGGER_WRITE_1( "TPCConnpluginUtils::ConvertPCDResponseCode( TInt \
-	aError ) : begin, aError: %d", aError );
-	
-	TInt obexErr ( KErrIrObexRespInternalError );
-	switch( aError )
-		{
-		case KErrNone:
-			obexErr = KErrNone;
-			break;
-		case KErrNotFound:
-			obexErr = KErrIrObexRespNotFound;
-			break;
-		case KErrGeneral:
-		case KErrCancel:
-			obexErr = KErrIrObexRespInternalError;
-			break;
-		case KErrNoMemory:
-			obexErr = KErrIrObexRespDatabaseFull;
-			break;
-		case KErrNotSupported:
-			obexErr = KErrIrObexRespUnsupMediaType;
-			break;
-		case KErrArgument:
-		case KErrTotalLossOfPrecision:
-		case KErrBadHandle:
-		case KErrOverflow:
-		case KErrUnderflow:
-			obexErr = KErrIrObexRespPreCondFailed;
-			break;
-		case KErrAlreadyExists:
-			obexErr = KErrIrObexRespConflict;
-			break;
-		case KErrPathNotFound:
-		case KErrDied:
-		case KErrInUse:
-			obexErr = KErrIrObexRespTimedOut;
-			break;
-		case KErrServerTerminated:
-			obexErr = KErrIrObexRespPreCondFailed;
-			break;
-		case KErrServerBusy:
-			obexErr = KErrIrObexRespConflict;
-			break;
-		case KErrCompletion:
-		case KErrNotReady:
-		case KErrUnknown:
-		case KErrCorrupt:
-			obexErr = KErrIrObexRespInternalError;
-			break;
-		case KErrAccessDenied:
-		case KErrLocked:
-			obexErr = KErrIrObexRespUnauthorized;
-			break;
-		case KErrWrite:
-		case KErrDisMounted:
-		case KErrEof:
-			obexErr = KErrIrObexRespInternalError;
-			break;
-		case KErrDiskFull:
-			obexErr = KErrIrObexRespDatabaseFull;
-			break;
-		case KErrBadDriver:
-		case KErrBadName:
-			obexErr = KErrIrObexRespNotFound;
-			break;
-		case KErrCommsLineFail:
-		case KErrCommsFrame:
-		case KErrCommsOverrun:
-		case KErrCommsParity:
-		case KErrTimedOut:
-		case KErrCouldNotConnect:
-		case KErrCouldNotDisconnect:
-		case KErrBadLibraryEntryPoint:
-		case KErrBadDescriptor:
-		case KErrAbort:
-		case KErrTooBig:
-		case KErrDivideByZero:
-		case KErrBadPower:
-		case KErrDirFull:
-		case KErrHardwareNotAvailable:
-			obexErr = KErrIrObexRespInternalError;
-			break;
-		default:
-			obexErr = KErrIrObexRespInternalError;
-			break;
-		};
-	LOGGER_WRITE_1( "TPCConnpluginUtils::ConvertPCDResponseCode(\
-	 TInt aError ) returned : %d", obexErr );
-	return obexErr;
-};
-
-// -----------------------------------------------------------------------------
-// TPCConnpluginUtils::ConvertObexMoveResponseCode( TInt aError )
-// Converts Symbian error code to OBEX error code
-// -----------------------------------------------------------------------------
-//
-TInt TPCConnpluginUtils::ConvertObexMoveResponseCode( TInt aError )
-	{
-	LOGGER_WRITE_1( "TPCConnpluginUtils::ConvertObexMoveResponseCode( TInt \
-	aError ) : begin, aError: %d", aError );
-	
-	TInt obexErr ( KErrIrObexRespInternalError );
-	switch( aError )
-		{
-		case KErrNone:
-			obexErr = KErrIrObexRespSuccess;
-			break;
-		case KErrNotFound:
-		case KErrPathNotFound:
-			obexErr = KErrIrObexRespNotFound;
-			break;
-        case KErrAccessDenied:
-            obexErr = KErrIrObexRespForbidden;
-            break;
-        case KErrNoMemory:
-        case KErrDiskFull:
-            obexErr = KErrIrObexRespDatabaseFull;
-            break;
-        case KErrInUse:
-        case KErrLocked:
-            obexErr = KErrIrObexRespConflict;
-            break;
-        case KErrNotSupported:
-            obexErr = KErrIrObexRespNotImplemented;
-            break;
-        case KErrAlreadyExists:
-            obexErr = KErrIrObexRespNotModified;
-            break;
-		
-		default:
-			obexErr = KErrIrObexRespInternalError;
-			break;
-		};
-	LOGGER_WRITE_1( "TPCConnpluginUtils::ConvertObexMoveResponseCode(\
-	 TInt aError ) returned : %d", obexErr  );
-	return obexErr;
-};
-
-//End of file
-
--- a/connectivitymodules/SeCon/plugins/pcconn/src/sconservicetimer.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity Plug-in Service Timer implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "sconservicetimer.h"
-#include "sconpcconnplugin.h"
-#include "debug.h"
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::CSConServiceTimer( CSConPCConnplugin* aEngine, TInt aValue )
-// Constuctor
-// -----------------------------------------------------------------------------
-//
-CSConServiceTimer::CSConServiceTimer( CSConPCConnplugin* aEngine, TInt aValue )
-	: CActive( EPriorityStandard ), iEngine( aEngine ), iValue( aValue ) {}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CSConServiceTimer::ConstructL()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::ConstructL()" );
-	// create a thread-relative timer
-	User::LeaveIfError( iTimer.CreateLocal() );
-	LOGGER_LEAVEFN( "CSConServiceTimer::ConstructL()" );
-	}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::~CSConServiceTimer()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConServiceTimer::~CSConServiceTimer()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::~CSConServiceTimer()" );
-	iTimer.Close();
-	LOGGER_LEAVEFN( "CSConServiceTimer::~CSConServiceTimer()" );	
-	}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::~CSConServiceTimer()
-// Starts the timer
-// -----------------------------------------------------------------------------
-//
-void CSConServiceTimer::StartTimer()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::StartTimer()" );
-	if( !IsActive() )
-		{
-		LOGGER_WRITE( "CSConServiceTimer::StartTimer() : !IsActive()" );
-		iTimer.After( iStatus, TTimeIntervalMicroSeconds32( iValue ) );
-		iEngine->iSessionActive = ETrue;
-		SetActive();
-		LOGGER_WRITE( "CSConServiceTimer::StartTimer() : SetActive()" );
-		}
-	LOGGER_LEAVEFN( "CSConServiceTimer::StartTimer()" );
-	}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::StopTimer()
-// StopTimer()
-// -----------------------------------------------------------------------------
-//
-void CSConServiceTimer::StopTimer()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::StopTimer()" );
-	iEngine->iSessionActive = ETrue;	
-	LOGGER_WRITE( "CSConServiceTimer::StopTimer() : iSessionActive = ETrue" );
-	LOGGER_LEAVEFN( "CSConServiceTimer::StopTimer()" );	
-	}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::DoCancel()
-// Cancels the timer
-// -----------------------------------------------------------------------------
-//
-void CSConServiceTimer::DoCancel()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::DoCancel()" );
-	iTimer.Cancel();
-	LOGGER_LEAVEFN( "CSConServiceTimer::DoCancel()" );
-	}
-
-// -----------------------------------------------------------------------------
-// CSConServiceTimer::RunL()
-// Executed when timer is triggered
-// -----------------------------------------------------------------------------
-//
-void CSConServiceTimer::RunL()
-	{
-	LOGGER_ENTERFN( "CSConServiceTimer::RunL()" );
-	iEngine->iSessionActive = EFalse;
-	LOGGER_WRITE( "CSConServiceTimer::RunL() : iSessionActive = EFalse" );
-	iEngine->iStartTimer = EFalse;
-	LOGGER_WRITE( "CSConServiceTimer::RunL() : iStartTimer = EFalse " );
-	LOGGER_LEAVEFN( "CSConServiceTimer::RunL()" );
-	}
-	
-// End of file
--- a/connectivitymodules/SeCon/plugins/pcconn/src/sconshutdownwatcher.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/*
-* 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:  Power shutdown -watcher implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "sconshutdownwatcher.h"
-#include "debug.h"
-
-#include <startupdomainpskeys.h>
-
-
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::NewL( MShutdownObserver* aObserver )
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CShutdownWatcher* CShutdownWatcher::NewL( MShutdownObserver* aObserver )
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::NewL()" );
-    CShutdownWatcher* self = new (ELeave) CShutdownWatcher( aObserver );
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    LOGGER_LEAVEFN( "CShutdownWatcher::NewL()" );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::~CShutdownWatcher()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CShutdownWatcher::~CShutdownWatcher()
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::~CShutdownWatcher()" );
-    Cancel();
-    iProperty.Close();
-    LOGGER_LEAVEFN( "CShutdownWatcher::~CShutdownWatcher()" );
-    }
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::StartShutdownWatcher()
-// Starts to watch shutdown status
-// -----------------------------------------------------------------------------
-//
-void CShutdownWatcher::StartShutdownWatcher()
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::StartShutdownWatcher()" );
-    TInt status;
-    TInt err = iProperty.Get( KPSUidStartup, KPSGlobalSystemState, status );
-    LOGGER_WRITE_2( "CShutdownWatcher::StartShutdownWatcher() :\
-     err %d, KPSGlobalSystemState status %d",err, status);
-    if ( err == KErrNone )
-        {
-        if ( status == ESwStateShuttingDown )
-            {
-            LOGGER_WRITE( "Call NotifyShutdown" );
-            iObserver->NotifyShutdown();
-            return;
-            }
-        }
-    
-    err = iProperty.Attach( KPSUidStartup, KPSGlobalSystemState );
-    LOGGER_WRITE_1( "CShutdownWatcher::StartShutdownWatcher() :\
-     iProperty.Attach( KPSUidStartup, KPSGlobalSystemState ) : err %d", err );
-    iProperty.Subscribe( iStatus );
-    LOGGER_WRITE( "CShutdownWatcher::StartShutdownWatcher() :\
-     iProperty.Subscribe( iStatus ) : ok" );
-    SetActive();
-
-    LOGGER_LEAVEFN( "CShutdownWatcher::StartShutdownWatcher()" );
-    }
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::DoCancel()
-// Executed when CActive is canceled.
-// -----------------------------------------------------------------------------
-//
-void CShutdownWatcher::DoCancel()
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::DoCancel()" );
-    iProperty.Cancel();
-    LOGGER_LEAVEFN( "CShutdownWatcher::DoCancel()" );
-    }
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::RunL()
-// Executed when disk watcher is triggered
-// -----------------------------------------------------------------------------
-//
-void CShutdownWatcher::RunL()
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::RunL()" );
-    TInt status;
-    iProperty.Get( status );
-    LOGGER_WRITE_1( "CShutdownWatcher::RunL() : status %d", status );
-    
-    if ( status == ESwStateShuttingDown )
-        {
-        LOGGER_WRITE( "Call NotifyShutdown" );
-        iObserver->NotifyShutdown();
-        return;
-        }
-    
-    iProperty.Cancel();
-    iProperty.Close();
-    
-    LOGGER_LEAVEFN( "CShutdownWatcher::RunL()" );
-    }
-
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::CShutdownWatcher( MShutdownObserver* aObserver )
-// Default constructor
-// -----------------------------------------------------------------------------
-//
-CShutdownWatcher::CShutdownWatcher( MShutdownObserver* aObserver )
-: CActive(EPriorityStandard),
-    iObserver(aObserver)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CShutdownWatcher::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CShutdownWatcher::ConstructL()
-    {
-    LOGGER_ENTERFN( "CShutdownWatcher::ConstructL()" );
-    CActiveScheduler::Add(this);
-    LOGGER_LEAVEFN( "CShutdownWatcher::ConstructL()" );
-    }
-
-// End of file
--- a/connectivitymodules/SeCon/rom/sconpcconnclientserver.iby	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
-* Copyright (c) 2005-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:  Image description file for project PCCONNClientServer
-*
-*/
-
-
-#ifndef __SCONPCCONNCLIENTSERVER_IBY__
-#define __SCONPCCONNCLIENTSERVER_IBY__
-//file content
-
-file=ABI_DIR\BUILD_DIR\sconconmlhandler.dll		SHARED_LIB_DIR\sconconmlhandler.dll
-
-file=ABI_DIR\BUILD_DIR\sconpcconnserver.exe		PROGRAMS_DIR\sconpcconnserver.exe
-file=ABI_DIR\BUILD_DIR\sconpcconnclient.dll		SHARED_LIB_DIR\sconpcconnclient.dll
-
-// stub files
-data=ZSYSTEM\install\secon_stub.sis             system\install\secon_stub.sis
-data=ZSYSTEM\install\sconpcconnplugin_stub.sis  system\install\sconpcconnplugin_stub.sis
-data=ZSYSTEM\install\sconftpplugin_stub.sis     system\install\sconftpplugin_stub.sis
-
-#endif
--- a/connectivitymodules/SeCon/servers/pcconn/bld/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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:  Build information file for project PCConnServer
-*
-*/
-
-
-PRJ_EXPORTS
-
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-sconpcconnserver.mmp
--- a/connectivitymodules/SeCon/servers/pcconn/bld/sconpcconnserver.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity Server
-*
-*/
-
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-VENDORID        VID_DEFAULT
-
-CAPABILITY      CAP_SERVER TrustedUI
-
-TARGET          sconpcconnserver.exe
-TARGETTYPE      exe
-
-EPOCSTACKSIZE   0x10000
-EPOCHEAPSIZE    0x10000 0x1000000 // heap memory 16MB
-
-UID             0 0x101F99F6
-
-// Server
-SOURCEPATH      ../src
-SOURCE          sconpcconnserver.cpp
-SOURCE          sconimsireader.cpp
-SOURCE          sconfolderlister.cpp
-SOURCE          sconbtengine.cpp
-
-// ConML
-SOURCEPATH      ../../../wbxml/conmlhandler/src
-SOURCE          sconconmldtd.cpp
-SOURCE          sconxmlelement.cpp
-
-SOURCEPATH      ../../../common/conmltask/src
-SOURCE          sconconmltask.cpp
-
-USERINCLUDE     ../inc
-USERINCLUDE     ../../../inc
-USERINCLUDE     ../../../common/conmltask/inc
-USERINCLUDE     ../../../services/pcd/inc 
-USERINCLUDE     ../../../services/csc/inc
-USERINCLUDE     ../../../services/oviaccounthandler/inc
-USERINCLUDE     ../../../wbxml/conmlhandler/inc
-
-// Default system include paths.
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY         euser.lib
-LIBRARY         estor.lib       // RMemWriteStream, RMemReadStream
-LIBRARY         efsrv.lib       // Rfs, RFile
-LIBRARY         charconv.lib    // For Unicode conversion
-
-LIBRARY         etel3rdparty.lib
-LIBRARY         platformenv.lib         // For pathinfo
-LIBRARY         directorylocalizer.lib  // For localizing directories
-LIBRARY	        centralrepository.lib
-LIBRARY         commonengine.lib        // For resource reader
-LIBRARY         bafl.lib                // Basic Application Framework Library
-LIBRARY         btengdevman.lib
-LIBRARY         btmanclient.lib
-LIBRARY         btdevice.lib
-LIBRARY         bluetooth.lib
-LIBRARY         btengsettings.lib
-DEBUGLIBRARY    flogger.lib
-
--- a/connectivitymodules/SeCon/servers/pcconn/inc/sconbtengine.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +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:  CSconBtEngine declaration
-*
-*/
-
-
-
-#ifndef SCONBTENGINE_H_
-#define SCONBTENGINE_H_
-
-#include <e32std.h>
-#include <e32base.h>
-#include <s32mem.h>
-#include <BTEngDevMan.h>
-#include <btengsettings.h>
-
-const TInt KCenRepAddrBufSize = 2 * KBTDevAddrSize;
-
-class CSconBtEngine : public CBase,
-                      public MBTEngDevManObserver,
-                      public MBTEngSettingsObserver
-    {
-public:
-    static CSconBtEngine* NewL();
-    ~CSconBtEngine();
-    
-    void ReadBTInfoL( RBufWriteStream& aStream );
-    
-    void SetBtAuthorizedL( const TDesC& aBtDevAddress, TBool aAuthorized );
-    
-    TInt SetBtPowerState( TBool aPower );
-    
-    TInt SetBtName( const TDesC& aBtName );
-    
-protected:
-    // From MBTEngDevManObserver
-    void HandleDevManComplete( TInt aErr );
-    void HandleGetDevicesComplete( TInt aErr, 
-           CBTDeviceArray* aDeviceArray );
-    
-    // From MBTEngSettingsObserver
-    void PowerStateChanged( TBTPowerStateValue aState );
-    void VisibilityModeChanged( TBTVisibilityMode aState );
-    
-private:
-    CSconBtEngine();
-    void ConstructL();
-    
-    void PrintDevicesL();
-    
-private:
-    enum TState
-        {
-        EIdle,
-        ERequestBtInfo,
-        EChangeBtState,
-        EChangeAuthorized
-        };
-    TState iState;
-    TInt   iOperationError;
-    CActiveSchedulerWait    iWait;
-    RBufWriteStream*        iStream;
-    CBTEngDevMan*           iBtEng;
-    CBTDeviceArray*         iBtDevArray;
-    CBTEngSettings*         iBtSettings;
-    TBool                   iAuthorizedValue;
-    TBuf<KCenRepAddrBufSize> iBtAddress;
-    };
-
-#endif /* SCONBTENGINE_H_ */
--- a/connectivitymodules/SeCon/servers/pcconn/inc/sconfolderlister.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +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:  CSconFolderLister declaration
-*
-*/
-
-
-#ifndef CSCONFOLDERLISTER_H
-#define CSCONFOLDERLISTER_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <s32mem.h> // For RMemReadStream
-#include <f32file.h>
-// CLASS DECLARATION
-
-class TSconDriveInfoEntry
-    {
-public:
-    TUint8 iDriveType;
-    TUint8 iDriveTypeCount;
-    TInt64 iSize;
-    TInt64 iFree;
-    };
-
-class TSconDriveInfo : public TSconDriveInfoEntry
-    {
-public:
-    TUint iDriveStatus;
-    TBuf16<2> iDriveLetter;
-    TUint iDriveAttr;
-    TBufC<KMaxFileName> iVolumeName;
-    };
-
-
-class CSconFolderEntry : public CBase
-    {
-public:
-    static CSconFolderEntry* NewLC();
-    static CSconFolderEntry* NewLC( const TEntry& aEntry );
-    ~CSconFolderEntry();
-private:
-    CSconFolderEntry();
-    void ConstructL( const TEntry& aEntry );
-    
-public:
-    TUint iAtt;
-    TTime iModified;
-    HBufC *iName;
-    HBufC *iLabel;
-    TBool iDriveInfoEntryExists;
-    TSconDriveInfoEntry iDriveInfoEntry;
-    };
-
-
-class CDirectoryLocalizer;
-
-/**
- *  CSconFolderLister
- * 
- */
-class CSconFolderLister : public CBase
-    {
-public:
-    // Constructors and destructor
-
-    /**
-     * Destructor.
-     */
-    ~CSconFolderLister();
-    
-    /**
-     * Two-phased constructor.
-     */
-    static CSconFolderLister* NewL( RFs& aFs );
-    
-    /**
-     * 
-     * @param aStream
-     * @param aStartPath
-     * @param aLevelsToSearch -1 = Search all levels, 0 = Search only current level, 1..N Search N levels
-     */
-    void GenerateFolderListL( RBufWriteStream& aStream, const TDesC& aStartPath, const TInt aLevelsToSearch );
-    
-private:  
-    
-    void ListAllDrivesL( RBufWriteStream& aStream, const TInt aLevelsToSearch );
-    void ListDriveAndPathL( RBufWriteStream& aStream, TInt aDrive, const TDesC& aStartPath, const TInt aLevelsToSearch );
-    
-    void ExportDriveL( RBufWriteStream& aStream, const TSconDriveInfo& aDriveInfo,
-            const TDesC& aPathName, const TInt aLevelsToSearch );
-    
-    /**
-     * 
-     * @param aStream
-     * @param aPathName
-     */
-    void ExportPathL( RBufWriteStream& aStream, const TDesC& aPathName, 
-            const CSconFolderEntry& aEntry, const TBool aLocalize, const TInt aLevelsToSearch );
-    
-    void GetDriveTypeNumberL( TInt aDrive , TUint driveStatus, TInt& aTypeNumber);
-    
-    /**
-     * Constructor for performing 1st stage construction
-     */
-    CSconFolderLister( RFs& aFs );
-
-    /**
-     * EPOC default constructor for performing 2nd stage construction
-     */
-    void ConstructL();
-    
-    TBool IsDirectoryPrintable( const TDesC& aParentPath, const TEntry& aFolderEntry );
-    
-    void GetLocalizedVolumeNameL( CSconFolderEntry& aDriveEntry );
-private:
-    RFs&    iFs;
-    TInt    iFolders;
-    TInt    iFiles;
-    TInt    iCriticalLevel;
-    CDirectoryLocalizer* iLocalizer;
-    };
-
-#endif // CSCONFOLDERLISTER_H
--- a/connectivitymodules/SeCon/servers/pcconn/inc/sconimsireader.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Imsi reader
-*
-*/
-
-
-#ifndef __SCONIMSIREADER_H__
-#define __SCONIMSIREADER_H__
-
-#include <e32base.h>
-#include <Etel3rdParty.h>
-
-enum TImsiReaderStatus
-    {
-    EIdle,
-    ERequestingImsi,
-    ERequestingNetworkStatus
-    };
- 
-class CSconImsiReader : public CActive
-    {
-    public:
-        
-        static TInt GetImsiL( TDes& aImsi );
-        
-        static TInt GetNetworkStatusL( CTelephony::TRegistrationStatus& aRegistrationStatus );
- 
-    private:
-        CSconImsiReader( TDes& aImsi, CTelephony::TRegistrationStatus& aRegistrationStatus );
-        void ConstructL();
-        ~CSconImsiReader();
-        
-        void RequestImsi();
-        void RequestNetworkStatus();
-        
-    private: // From CActive
-        
-        void RunL();
-        void DoCancel();
-        
-    private: // data
-        TDes& iImsi;
-        CTelephony::TRegistrationStatus& iNetworkStatus;
-        CTelephony* iTelephony;
-        CTelephony::TSubscriberIdV1 iSubscriberIdV1;
-        CTelephony::TSubscriberIdV1Pckg iSubscriberIdV1Pckg;
-        
-        CTelephony::TNetworkRegistrationV1     iNetworkRegistrationV1;
-        CTelephony::TNetworkRegistrationV1Pckg iNetworkRegistrationV1Pckg;
-        TImsiReaderStatus iImsiReaderStatus;
-    };
-
-#endif // __SCONIMSIREADER_H__
--- a/connectivitymodules/SeCon/servers/pcconn/inc/sconpcconnclientserver.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity server client
-*
-*/
-
-
-
-
-#ifndef __SCONPCCONNCLIENTSERVER_H__
-#define __SCONPCCONNCLIENTSERVER_H__
-
-#include <e32base.h>
-
-// for debugging ConML messages and capability objects 
-//#define DEBUG_XML
-
-
-// reasons for server panic
-enum TPCConnServPanic
-	{
-	E_BadRequest = 1,
-	E_DispatchRequest,
-	E_InvalidClient,
-	E_CleanupCreate,
-	E_MainSchedulerError
-	};
-	
-	
-// server related constants
-_LIT( KSConPCConnServerName,"SConPCConnServer" );
-_LIT( KSConPCConnServerExe, "SConPCConnServer.exe" );
-
-// client 
-_LIT( KSConPCConnClientDll, "SConPCConnClient.dll" );
-
-
-// Chunk
-const TUint KSConPCConnChunkSize = 128;
-const TUint KSConPCConnChunkMaxSize = 65536;
-const TUint KSConPCConnBufferMaxSize = 65000; 
-
-// Version number
-const TUint KSConPCConnServerVersionMajor = 1;
-const TUint KSConPCConnServerVersionMinor = 0;
-const TUint KSConPCConnServerVersionBuild = 1;
-
-
-// Function codes
-
-enum TRequest 
-{
-	EPutMessage,
-	EGetMessage,
-	EResetMessage,
-	EChunkMessage
-};
-
-#endif // __SCONPCCONNCLIENTSERVER_H__
--- a/connectivitymodules/SeCon/servers/pcconn/inc/sconpcconnserver.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,247 +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:  PC Connectivity server
-*
-*/
-
-
-#ifndef __SCONPCCONNSERVER_H__
-#define __SCONPCCONNSERVER_H__
-
-#include "sconconmlhandler.h"
-#include "sconconmltask.h"
-
-
-class CSConPCD;
-class CSConCSC;
-class CSConConMLParser;
-
-const TUint KSConDefaultHeapSize=0x10000;
-const TInt KSConFirstDrive = 65;
-
-_LIT8 ( KParamNameSilent, "Silent" );
-
-
-// PCD Handler Dll
-_LIT(KSConPCDLibName, "sconpcd.dll");
-const TInt KSConPCDUidValue = 0x10009D8D;
-const TUid KSConPCDUid = {KSConPCDUidValue};
-
-// CSC Handler Dll
-_LIT(KSConCSCLibName, "sconcsc.dll");
-const TInt KSConCSCUidValue = 0x10009D8D;
-const TUid KSConCSCUid = {KSConCSCUidValue};
-
-// ConML Handler Dll
-_LIT (KSConConMLHandlerLibName, "sconconmlhandler.dll");
-const TInt KSConConMLHandlerUidValue = 0x10009D8D;
-const TUid KSConConMLHandlerUid = {KSConConMLHandlerUidValue};
-
-// debug file for put and get messages
-_LIT ( KSConConMLDebugFile, "c:\\data\\handler_result.txt");
-
-// Secure ids
-_LIT_SECURE_ID(KSConPCConnClientSecureId,0x101F7C87);
-
-// PCD types
-_LIT8( KSConPCDXMLObjectType, "application/vnd.nokia.conml+xml" );
-_LIT8( KSConPCDXMLObjectType2, "application/vnd.nokia.pcd+xml" );
-_LIT8( KSConPCDWBXMLObjectType, "application/vnd.nokia.conml+wbxml" );
-_LIT8( KSConPCDWBXMLObjectType2, "application/vnd.nokia.pcd+wbxml" );
-
-// CSC types
-_LIT8( KSConCapabilityObjectType, "x-obex/capability" );
-
-// Drives
-_LIT( KSConNoDrive, "\x0" );
-_LIT( KSConDriveExists, "\x1" );
-
-// user permissions
-_LIT8( KSConPermReadOnly, "R" );
-_LIT8( KSConPermNormal, "RW" );
-// Java hash id for ConML
-_LIT8( KSConJavaHashId, "JAVA_");
-
-_LIT8( KSConAppInfoSeparator, "#" );
-
-//**********************************
-//CSConPCConnServer - PC Connectivity Server 
-//**********************************
-
-class CSConPCConnServer : public CServer2
-    {
-public:
-        // From CServer2
-    IMPORT_C static CSConPCConnServer* NewLC();
-    IMPORT_C ~CSConPCConnServer();
-    
-    /**
-     * Function to start the server
-     * @param none
-     * @return Error code
-     */
-    static TInt RunServer();
-    
-    /**
-     * Function to start the server
-     * @param none
-     * @return none
-     */
-    static void RunServerL();
-    
-    /**
-     * Increments session count.
-     * @param none
-     * @return none
-     */
-    void IncSessionCount();
-    
-    /**
-     * Decrements session count. 
-     * When count reaches zero, stops active scheduler
-     * @param none
-     * @return none
-     */ 
-    void DecSessionCount();
-    
-
-protected:
-    virtual CSession2* NewSessionL( const TVersion &aVersion, 
-                                    const RMessage2& aMessage) const;
-
-private:
-    CSConPCConnServer();
-    
-    TInt iSessionCount;
-
-    };
-
-
-class CSconFolderLister;
-class CSconBtEngine;
-
-//**********************************
-//CSConPCConnSession - Server session class, handles the requested operations
-//**********************************
-class CSConPCConnSession : public CSession2, public MWBXMLConMLCallback
-    {
-
-public:
-    static CSConPCConnSession* NewL(CSConPCConnServer& aServer);
-    
-    /**
-    * From CSession2
-    */
-    void ServiceL( const RMessage2 &aMessage);
-
-private:
-    void DispatchRequestL( const RMessage2 &aMessage);
-    void LoadPCDDllL();
-    void LoadCSCDllL();
-    void LoadConMLHandlerDllL();
-
-protected:
-    // Callback funktion for WBXML parsing
-    void ConMLL ( ConML_ConMLPtr_t aContent );
-
-private:
-    void ConstructL();
-    CSConPCConnSession ( CSConPCConnServer& aServer);
-    ~CSConPCConnSession();
-
-    TInt HandlePutMessageL();
-    TInt HandleGetMessageL();
-    TInt HandleWBXMLGetRequestL( const TDesC& aFileName );
-    TInt HandleResetMessage();
-    TInt HandleChunkMessage( const RMessage2& aMessage );
-    TInt OptionsFromExecuteL ( ConML_ExecutePtr_t aContent );
-    TInt TaskCancelL(ConML_CancelPtr_t aContent);
-    TInt TaskGetStatusL(ConML_GetStatusPtr_t aContent );
-    TInt TaskInstallL( ConML_InstallPtr_t aContent );
-    TInt TaskUnInstallL( ConML_UnInstallPtr_t aContent );
-    void SplitL( const TDesC8& aText, const TChar aSeparator, RArray<TPtrC8>& aArray );
-    TInt TaskListInstalledAppsL( ConML_ListInstalledAppsPtr_t aContent );
-    TInt TaskListDataOwnersL();
-    TInt TaskSetBURModeL( ConML_SetBURModePtr_t aContent );
-    TInt TaskGetDataSizeL( ConML_GetDataSizePtr_t aContent );
-    TInt TaskRequestDataL( ConML_RequestDataPtr_t aContent );
-    TInt TaskUpdateDeviceInfoL( ConML_UpdateDeviceInfoPtr_t aContent );
-    TInt TaskListPublicFilesL( ConML_ListPublicFilesPtr_t aContent );
-    TInt TaskGetDataOwnerStatusL( ConML_GetDataOwnerStatusPtr_t aContent );
-    TInt TaskSupplyDataL ( ConML_SupplyDataPtr_t aContent );
-    TInt TaskRebootL();
-    TInt TaskGetMetadataL( ConML_GetMetadataPtr_t aContent );
-    void AppendStatusL( ConML_ConMLPtr_t aContent, CSConStatusReply* reply );
-    void AppendUpdateDeviceInfoResultsL( ConML_ResultsPtr_t aContent, 
-                                         CSConUpdateDeviceInfo* aResult );
-    void AppendSetBURModeResultsL ( ConML_ResultsPtr_t aContent, 
-                                    CSConSetBURMode* aResult );
-    void AppendListInstalledAppsResultsL ( ConML_ResultsPtr_t aContent, 
-                                           CSConListInstApps* aResult );
-    void AppendListPublicFilesResultsL ( ConML_ResultsPtr_t aContent, 
-                                         CSConListPublicFiles* aResult );
-    void AppendRequestDataResultsL( ConML_ResultsPtr_t aContent, 
-                                    CSConRequestData* aResult );
-    void AppendSupplyDataResultsL( ConML_ResultsPtr_t aContent, 
-                                   CSConSupplyData* aResult );
-    void AppendInstallResultsL( ConML_ResultsPtr_t aContent, 
-                                CSConInstall* aResult );
-    void AppendUninstallResultsL( ConML_ResultsPtr_t aContent, 
-                                CSConUninstall* aResult );                          
-    void AppendListDataOwnersResultsL ( ConML_ResultsPtr_t aContent, 
-                                        CSConListDataOwners* aResult  );
-    void AppendGetDataOwnerStatusResultsL ( ConML_ResultsPtr_t aContent, 
-                                            CSConGetDataOwnerStatus* aResult );
-    void AppendGetDataSizeResultsL ( ConML_ResultsPtr_t aContent, 
-                                     CSConGetDataSize* aResult );
-    void AppendGetMetadataResultsL ( ConML_ResultsPtr_t aContent, 
-                                     CSConGetMetadata* aResult );
-    void AppendProgressL ( ConML_ResultsPtr_t aContent, TInt progress );
-    void AppendDrivesL( ConML_DrivesPtr_t aContent, TDriveList aDrives );
-    TDriveList DriveList( ConML_DriveListPtr_t aContent );
-    TDesC8& IntToDesLC( const TInt& anInt);
-    TDesC8& DriveNumToDesLC( const TInt& anInt );
-    TDesC8& BufToDesLC( const TDesC& aBuf );
-    TDesC8& UidToDesLC( const TUid& aUid );
-    TUid DesToUid ( const TDesC8& aDes );
-    TInt DesToInt( const TDesC8& aDes);
-    TBool HasDrives( TDriveList& aDrive );
-    TDesC8& HashToDesLC( const TDesC& aBuf );
-    TPtr DesToHashLC( const TDesC8& aDes );
-    TBool IsJavaHash( const TDesC8& aDes );
-    
-    TInt ReadOviAccountInfoL( RWriteStream& aAccountInfoStream );
-    
-// data
-private:
-    CSConPCConnServer& iServer;
-    
-    RLibrary iPCDlib;
-    RLibrary iCSClib;
-    RLibrary iConMLHandlerLib;
-    
-    CSConPCD* iPCDHandler;
-    CSConCSC* iCSCHandler;
-    CSConConMLHandler* iConMLHandler;
-    
-    RChunk iChunk;
-    CBufFlat* iBuffer;  
-    TInt iResult;
-    
-    CSconFolderLister* iFolderLister;
-    RFs iFs;
-    CSconBtEngine*  iBtEngine;
-    };
-
-#endif // __SCONPCCONNSERVER_H__
--- a/connectivitymodules/SeCon/servers/pcconn/src/sconbtengine.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,415 +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:  CSconBtEngine implementation
-*
-*/
-
-
-
-#include <centralrepository.h>
-#include <btengdomaincrkeys.h>
-
-#include <e32property.h>
-#include <bttypes.h> 
-#include <bt_subscribe.h>
-
-#include "sconbtengine.h"
-#include "debug.h"
-
-CSconBtEngine* CSconBtEngine::NewL()
-    {
-    TRACE_FUNC;
-    CSconBtEngine* self = new (ELeave) CSconBtEngine();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-CSconBtEngine::~CSconBtEngine()
-    {
-    TRACE_FUNC;
-    if ( iBtEng )
-        {
-        iBtEng->Cancel();
-        delete iBtEng;
-        }
-    
-    delete iBtSettings;
-    }
-
-CSconBtEngine::CSconBtEngine()
-    {
-    }
-
-void CSconBtEngine::ConstructL()
-    {
-    iBtEng = CBTEngDevMan::NewL( this );
-    iBtSettings = CBTEngSettings::NewL( this );
-    iState = EIdle;
-    }
-
-void CSconBtEngine::ReadBTInfoL( RBufWriteStream& aStream )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iState != EIdle )
-        {
-        User::Leave( KErrInUse );
-        }
-    iStream = &aStream;
-    iOperationError = KErrNone;
-    
-    // Write local name (8 bit name length + unicode name)
-    TBuf<100> localName;
-    TInt err = iBtSettings->GetLocalName( localName );
-    User::LeaveIfError( err );
-    LOGGER_WRITE_1("localName: %S", &localName);
-    iStream->WriteUint8L( localName.Length() );
-    iStream->WriteL( localName, localName.Length() );
-    
-    if ( iBtAddress.Length() == 0 )
-        {
-        LOGGER_WRITE("Try to read bt address");
-        
-        CRepository* cenRep = NULL;
-        // Use TRAP to catch a leave if the CenRep key does not exist.
-        TRAP( err, cenRep = CRepository::NewL( KCRUidBluetoothLocalDeviceAddress ) );
-        CleanupStack::PushL( cenRep );
-        if( !err )
-            {
-            err = cenRep->Get( KBTLocalDeviceAddress, iBtAddress );
-            LOGGER_WRITE_1("cenRep->Get err: %d", err);
-            }
-        CleanupStack::PopAndDestroy( cenRep );
-        
-        if ( err )
-            {
-            iBtAddress.Zero();
-            }
-        }
-    
-    // Write bt address (8 bit addr length + unicode address)
-    if ( iBtAddress.Length() > 0 )
-        {
-        LOGGER_WRITE_1("btAddr: %S", &iBtAddress);
-        iStream->WriteUint8L( iBtAddress.Length() );
-        iStream->WriteL( iBtAddress, iBtAddress.Length() );
-        }
-    else
-        {
-        iStream->WriteUint8L( 0 );
-        }
-    
-    // Write BT Power State (8-bit, 0=Off, 1=On)
-    TBTPowerStateValue state;
-    err = iBtSettings->GetPowerState( state );
-    User::LeaveIfError( err );
-    LOGGER_WRITE_1("PowerState: %d", state);
-    iStream->WriteUint8L( state );
-    
-    // Get device info
-    TBTRegistrySearch crit;
-    crit.FindAll();
-    if ( !iBtDevArray )
-        {
-        LOGGER_WRITE("create arr");
-        iBtDevArray = new (ELeave) CBTDeviceArray(5);
-        LOGGER_WRITE("create arr -ok");
-        }
-    else
-        {
-        iBtDevArray->ResetAndDestroy();
-        }
-    err = iBtEng->GetDevices( crit, iBtDevArray );
-    LOGGER_WRITE_1("GetDevices err: %d", err);
-    User::LeaveIfError( err );
-    iState = ERequestBtInfo;
-    
-    // Wait until completed
-    iWait.Start();
-    iState = EIdle;
-    if ( iOperationError )
-        {
-        LOGGER_WRITE_1("Operation failed, leave %d", iOperationError);
-        User::Leave( iOperationError );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconBtEngine::SetBtAuthorizedL( const TDesC& aBtDevAddress, TBool aAuthorized )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iState != EIdle )
-        {
-        User::Leave( KErrInUse );
-        }
-    
-    TBTRegistrySearch crit;
-    TBTDevAddr addr;
-    addr.SetReadable( aBtDevAddress );
-    crit.FindAddress( addr );
-    
-    if ( !iBtDevArray )
-        {
-        LOGGER_WRITE("create arr");
-        iBtDevArray = new (ELeave) CBTDeviceArray(5);
-        LOGGER_WRITE("create arr -ok");
-        }
-    else
-        {
-        iBtDevArray->ResetAndDestroy();
-        }
-    TInt err = iBtEng->GetDevices( crit, iBtDevArray );
-    LOGGER_WRITE_1("GetDevices err: %d", err);
-    User::LeaveIfError( err );
-    iState = EChangeAuthorized;
-    iOperationError = KErrNone;
-    iAuthorizedValue = aAuthorized;
-    
-    // Wait until completed
-    iWait.Start();
-    iState = EIdle;
-    if ( iOperationError )
-        {
-        LOGGER_WRITE_1("Operation failed, leave %d", iOperationError);
-        User::Leave( iOperationError );
-        
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-TInt CSconBtEngine::SetBtPowerState( TBool aPower )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iState != EIdle )
-        {
-        return KErrInUse;
-        }
-    
-    TBTPowerStateValue state;
-    iOperationError = iBtSettings->GetPowerState( state );
-    if ( iOperationError )
-        {
-        return iOperationError;
-        }
-    else if ( ( aPower && state == EBTPowerOn )
-            || ( !aPower && state == EBTPowerOff ) )
-        {
-        // No need to change state
-        return KErrNone;
-        }
-    
-    state = EBTPowerOff;
-    if ( aPower )
-        {
-        state = EBTPowerOn;
-        }
-    iOperationError = iBtSettings->SetPowerState( state );
-    if ( iOperationError )
-        {
-        return iOperationError;
-        }
-    iState = EChangeBtState;
-    
-    // Wait until completed
-    iWait.Start();
-    
-    iState = EIdle;
-    TRACE_FUNC_RET( iOperationError );
-    return iOperationError;
-    }
-
-TInt CSconBtEngine::SetBtName( const TDesC& aBtName )
-    {
-    LOGGER_WRITE_1("SetBtName aBtName: %S", &aBtName);
-    TInt err = iBtSettings->SetLocalName( static_cast<const TDes&>( aBtName ) );
-    TRACE_FUNC_RET( err );
-    return err;
-    }
-
-// From MBTEngDevManObserver
-void CSconBtEngine::HandleDevManComplete( TInt aErr )
-    {
-    TRACE_FUNC;
-    LOGGER_WRITE_1("aErr: %d", aErr );
-    if ( iState == EChangeAuthorized )
-        {
-        if ( iWait.IsStarted() )
-            {
-            iOperationError = aErr;
-            iWait.AsyncStop();
-            }
-        }
-    
-    }
-
-void CSconBtEngine::HandleGetDevicesComplete( TInt aErr, 
-       CBTDeviceArray* aDeviceArray )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aErr: %d", aErr);
-    //iBtReqOngoing = EFalse;
-    if ( iState == ERequestBtInfo )
-        {
-        // Continue to write devices info
-        TRAP( iOperationError, PrintDevicesL() );
-        LOGGER_WRITE_1("PrintDevicesL err: %d", iOperationError);
-        
-        if ( iWait.IsStarted() )
-            {
-            iWait.AsyncStop();
-            }
-        }
-    else if ( iState == EChangeAuthorized )
-        {
-        iOperationError = aErr;
-        if ( !aErr && aDeviceArray->Count() == 1 )
-            {
-            CBTDevice* btRef = aDeviceArray->At(0);
-            TBTDeviceSecurity devSec = btRef->GlobalSecurity();
-            if ( btRef->IsPaired() && !devSec.Banned() )
-                {
-                LOGGER_WRITE8_1("btAdrr: %S", &btRef->BDAddr().Des() );
-                CBTDevice* btDevice = CBTDevice::NewLC( btRef->BDAddr() );
-                
-                btDevice->SetPaired( ETrue );
-                
-                btDevice->SetDeviceNameL( btRef->DeviceName() );
-                btDevice->SetFriendlyNameL( btRef->FriendlyName() );
-                LOGGER_WRITE8_1("name: %S", &btRef->DeviceName());
-                LOGGER_WRITE8_1("FriendlyName: %S", &btRef->FriendlyName());
-                
-                LOGGER_WRITE_1("iAuthorizedValue: %d", iAuthorizedValue);
-                // Set as authorized and store the device
-                TBTDeviceSecurity security;
-                security.SetNoAuthenticate( EFalse );
-                security.SetNoAuthorise( iAuthorizedValue );
-                security.SetBanned( EFalse );
-                
-                btDevice->SetGlobalSecurity (security );
-                
-                //iOperationError = iBtEng->ModifyDevice(*aDeviceArray->At(0));
-                iOperationError = iBtEng->ModifyDevice( *btDevice );
-                LOGGER_WRITE_1( "ModifyDevice err: %d", iOperationError );
-                CleanupStack::PopAndDestroy( btDevice );
-                }
-            else
-                {
-                LOGGER_WRITE("Device was not paired or it's banned")
-                iOperationError = KErrAccessDenied;
-                }
-            }
-        
-        // If error occured stop waiting, otherwise continue waiting until
-        // HandleDevManComplete has been called
-        if ( iOperationError && iWait.IsStarted() )
-            {
-            iWait.AsyncStop();
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconBtEngine::PrintDevicesL()
-    {
-    TRACE_FUNC_ENTRY;
-    // calculate devices count
-    TInt devCount(0);
-    
-    for ( TInt i=0 ; i<iBtDevArray->Count(); i++ )
-        {
-        CBTDevice* device = iBtDevArray->At(i);
-        // show only paired and banned devices
-        if ( device->IsPaired() || device->GlobalSecurity().Banned() )
-            {
-            devCount++;
-            }
-        }
-    
-    // Print info
-    iStream->WriteUint8L( devCount );
-    
-    for ( TInt i=0 ; i<iBtDevArray->Count(); i++ )
-        {
-        CBTDevice* device = iBtDevArray->At(i);
-        
-        const TBTDeviceSecurity btSec = device->GlobalSecurity();
-        
-        // show only paired and banned devices
-        if ( device->IsPaired() || btSec.Banned() )
-            {
-            LOGGER_WRITE_1("IsValidDeviceName: %d", device->IsValidDeviceName());
-            const TDesC8& deviceName = device->DeviceName();
-            LOGGER_WRITE8_1("DeviceName: %S", &deviceName );
-            iStream->WriteUint8L( deviceName.Length() );
-            iStream->WriteL( deviceName, deviceName.Length() );
-            
-            LOGGER_WRITE_1("IsValidFriendlyName: %d", device->IsValidFriendlyName());
-            LOGGER_WRITE_1("FriendlyName: %S", &device->FriendlyName() );
-            
-            const TBTDevAddr& addr = device->BDAddr();
-            
-            TBuf<100> readable;
-            addr.GetReadable( readable );
-            LOGGER_WRITE_1("readable addr: %S", &readable);
-            iStream->WriteUint8L( readable.Length() );
-            iStream->WriteL( readable, readable.Length() );
-            
-            LOGGER_WRITE_1("paired: %d", device->IsPaired() );
-            LOGGER_WRITE_1("IsValidPaired: %d", device->IsValidPaired() );
-            TUint8 paired(0);
-            if ( device->IsPaired() && device->IsValidPaired() )
-                {
-                paired = 1;
-                }
-            iStream->WriteUint8L( paired );
-            
-            TUint8 noAuthorise(0);
-            if ( btSec.NoAuthorise() )
-                {
-                noAuthorise = 1;
-                }
-            iStream->WriteUint8L( noAuthorise );
-            
-            TUint8 banned(0);
-            if ( btSec.Banned() )
-                {
-                banned = 1;
-                }
-            iStream->WriteUint8L( banned );
-            
-            LOGGER_WRITE("");
-            }
-        }
-    iStream->CommitL();
-    iStream = NULL; //delete reference only
-    TRACE_FUNC_EXIT;
-    }
-
-// From MBTEngSettingsObserver
-void CSconBtEngine::PowerStateChanged( TBTPowerStateValue /*aState*/ )
-    {
-    TRACE_FUNC;
-    if ( iState == EChangeBtState && iWait.IsStarted() )
-        {
-        iWait.AsyncStop();
-        }
-    
-    }
-
-void CSconBtEngine::VisibilityModeChanged( TBTVisibilityMode /*aState*/ )
-    {
-    TRACE_FUNC;
-    }
--- a/connectivitymodules/SeCon/servers/pcconn/src/sconfolderlister.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,717 +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:  CSconFolderLister implementation
-*
-*/
-
-
-#include "sconfolderlister.h"
-
-#include <driveinfo.h>
-#include <centralrepository.h>
-#include <sysutildomaincrkeys.h>
-#include <CDirectoryLocalizer.h>
-#include <stringresourcereader.h>
-#include <sconftp.rsg>
-#include <bautils.h>
-
-#include "debug.h"
-
-const TUint16 KFormatVersion( 1 );
-
-// Obex package size
-const TInt KPackageSize = 65536;
-
-const TInt KMaxLevelsToSearch = 80;
-
-_LIT( KSConResourceName, "z:\\Resource\\sconftp.rsc" );
-
-CSconFolderEntry* CSconFolderEntry::NewLC()
-    {
-    CSconFolderEntry* self = new (ELeave) CSconFolderEntry();
-    CleanupStack::PushL( self );
-    return self;
-    }
-CSconFolderEntry* CSconFolderEntry::NewLC( const TEntry& aEntry )
-    {
-    CSconFolderEntry* self = new (ELeave) CSconFolderEntry();
-    CleanupStack::PushL( self );
-    self->ConstructL( aEntry );
-    return self;
-    }
-CSconFolderEntry::CSconFolderEntry()
-    {
-    }
-CSconFolderEntry::~CSconFolderEntry()
-    {
-    delete iName;
-    delete iLabel;
-    }
-
-
-void CSconFolderEntry::ConstructL( const TEntry& aEntry )
-    {
-    iAtt = aEntry.iAtt;
-    iModified = aEntry.iModified.Int64();
-    iName = aEntry.iName.AllocL();
-    }
-
-CSconFolderLister::CSconFolderLister( RFs& aFs ) : iFs(aFs)
-    {
-    // No implementation required
-    }
-
-CSconFolderLister::~CSconFolderLister()
-    {
-    TRACE_FUNC;
-    delete iLocalizer;
-    }
-
-CSconFolderLister* CSconFolderLister::NewL( RFs& aFs )
-    {
-    TRACE_FUNC_ENTRY;
-    CSconFolderLister* self = new (ELeave) CSconFolderLister( aFs );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-void CSconFolderLister::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iLocalizer = CDirectoryLocalizer::NewL();
-    
-    // set free memory up to critical level for all drives
-    CRepository* repository = CRepository::NewLC( KCRUidDiskLevel );
-    TInt iCriticalLevel(0);
-    User::LeaveIfError( repository->Get( KDiskCriticalThreshold, iCriticalLevel ) );
-    CleanupStack::PopAndDestroy( repository );
-    iCriticalLevel += KPackageSize; // add obex package size to critical level
-    TRACE_FUNC_EXIT;
-    }
-
-
-void CSconFolderLister::GenerateFolderListL( RBufWriteStream& aStream, const TDesC& aStartPath, 
-        const TInt aLevelsToSearch )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aStartPath: %S", &aStartPath );
-    LOGGER_WRITE_1("aLevelsToSearch: %d", aLevelsToSearch );
-    TInt levelsToSearch = aLevelsToSearch;
-    if ( levelsToSearch > KMaxLevelsToSearch || levelsToSearch == KErrNotFound )
-        levelsToSearch = KMaxLevelsToSearch;
-    iFolders = 0;
-    iFiles = 0;
-    const TInt KDriveNameLength( 3 );
-    
-    if ( aStartPath.CompareF( _L("\\") ) == 0 )
-        {
-        LOGGER_WRITE("List all drives");
-        aStream.WriteUint16L( KFormatVersion );
-        ListAllDrivesL( aStream, levelsToSearch );
-        }
-    else if ( aStartPath.Length() >= KDriveNameLength )
-        {
-        if ( aStartPath.Length() > KDriveNameLength )
-            {
-            // check root path permissions, is listing allowed
-            TPtrC path = aStartPath.Mid(KDriveNameLength);
-            LOGGER_WRITE_1("pathFromRoot: %S", &path);
-            TInt pathEndMark = path.Locate(TChar('\\'));
-            if ( pathEndMark == KErrNotFound )
-                {
-                User::Leave( KErrArgument );
-                }
-            //"private\" locate = 7"
-            TPtrC pathName = aStartPath.Left( KDriveNameLength+pathEndMark );
-            LOGGER_WRITE_1("pathName: %S", &path);
-            TEntry pathEntry;
-            User::LeaveIfError( iFs.Entry(pathName, pathEntry) );
-            
-            TBool printable = IsDirectoryPrintable( aStartPath.Left(3), pathEntry );
-            if ( !printable )
-                {
-                // access denied
-                LOGGER_WRITE("Access denied!");
-                User::Leave( KErrAccessDenied );
-                }
-            User::LeaveIfError( iFs.Entry(aStartPath, pathEntry) );
-            if ( pathEntry.IsSystem() )
-                {
-                // access denied
-                LOGGER_WRITE("System folder, Access denied!");
-                User::Leave( KErrAccessDenied );
-                }
-            }
-        
-        
-        aStream.WriteUint16L( KFormatVersion );
-        
-        TInt drive;
-        User::LeaveIfError( iFs.CharToDrive( aStartPath[0], drive) );
-        ListDriveAndPathL( aStream, drive, aStartPath, levelsToSearch);
-
-        }
-    else
-        {
-        LOGGER_WRITE("aStartPath KErrArgument");
-        User::Leave( KErrArgument );
-        }
-    
-    
-    LOGGER_WRITE_1("iFolders: %d", iFolders);
-    LOGGER_WRITE_1("iFiles: %d", iFiles);
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconFolderLister::ListAllDrivesL( RBufWriteStream& aStream, const TInt aLevelsToSearch )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt devDriveCount = 0;
-    TInt mmcDriveCount = 0;
-    TChar driveLetter;
-    TBuf8<1> driveBuf;
-    RArray<TSconDriveInfo>  sconDriveInfo(5);
-    
-    // Write all drives to folderlisting object
-    TDriveList driveList;
-    // Get all drives that are visible to the user.
-    TInt driveCount;
-    User::LeaveIfError( DriveInfo::GetUserVisibleDrives( iFs, driveList, driveCount ) );
-    
-    for( TInt i = EDriveA; i < KMaxDrives; i++ )
-        {
-        if( driveList[i] )
-            {
-            TUint driveStatus;
-            User::LeaveIfError( DriveInfo::GetDriveStatus( iFs, i, driveStatus ) );
-            //LOGGER_WRITE_1( "DriveInfo for drive: %d", i);
-
-            if( !(driveStatus & DriveInfo::EDrivePresent )
-                || driveStatus & DriveInfo::EDriveCorrupt
-                || (driveStatus & DriveInfo::EDriveRemote) )
-                {
-                //LOGGER_WRITE_1( "skip drive %d", i);
-                continue;
-                }
-            
-            User::LeaveIfError( iFs.DriveToChar( i, driveLetter ) );
-            //Letter to uppercase form.
-            driveLetter.UpperCase();
-            
-            TSconDriveInfo info;
-            info.iDriveStatus = driveStatus;
-            info.iDriveLetter.Zero();
-            info.iDriveLetter.Append( driveLetter );
-            info.iDriveLetter.Append( _L(":") );
-            
-            
-            info.iDriveAttr = KEntryAttNormal; // ReadWrite
-            
-            if( driveStatus & DriveInfo::EDriveInternal && devDriveCount==0 )
-                {
-                //permission always R for first internal drive
-                info.iDriveAttr = KEntryAttReadOnly;
-                }
-            
-            //memory type
-            if( driveStatus & DriveInfo::EDriveInternal )
-                {
-                LOGGER_WRITE( "DriveInfo::EDriveInternal" );
-                devDriveCount++;
-                info.iDriveType = DriveInfo::EDriveInternal; // =1
-                info.iDriveTypeCount = devDriveCount;
-                
-                }
-            else if( driveStatus & DriveInfo::EDriveRemovable )
-                {
-                LOGGER_WRITE( "DriveInfo::EDriveRemovable" );
-                mmcDriveCount++;
-                info.iDriveType = DriveInfo::EDriveRemovable;; // =2
-                info.iDriveTypeCount = mmcDriveCount;
-                }
-            
-            TVolumeInfo volumeInfo;
-            User::LeaveIfError( iFs.Volume( volumeInfo, i) );
-            
-            info.iVolumeName = volumeInfo.iName;
-            if ( volumeInfo.iFree > iCriticalLevel )
-                {
-                volumeInfo.iFree = volumeInfo.iFree - iCriticalLevel;
-                }       
-            else
-                {
-                volumeInfo.iFree = 0;
-                }
-            
-            info.iFree = volumeInfo.iFree;
-            info.iSize = volumeInfo.iSize;
-            
-            
-            sconDriveInfo.AppendL( info );
-            
-            }
-        }
-    
-    LOGGER_WRITE_1("Drives: %d", sconDriveInfo.Count());
-    aStream.WriteUint8L( sconDriveInfo.Count() );
-    for ( TInt i=0; i < sconDriveInfo.Count(); i++ )
-        {
-        
-        TBuf<3> path(KNullDesC);
-        path.Copy(sconDriveInfo[i].iDriveLetter);
-        path.Append(_L("\\"));
-        
-        ExportDriveL( aStream, sconDriveInfo[i], path, aLevelsToSearch);
-        }
-    sconDriveInfo.Close();
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconFolderLister::ListDriveAndPathL( RBufWriteStream& aStream, TInt aDrive, const TDesC& aStartPath, const TInt aLevelsToSearch )
-    {
-    TRACE_FUNC_ENTRY;
-    TVolumeInfo volumeInfo;
-    User::LeaveIfError( iFs.Volume(volumeInfo, aDrive) );
-    TInt driveCount(0);
-    TUint driveStatus;
-    User::LeaveIfError( DriveInfo::GetDriveStatus( iFs, aDrive, driveStatus ) );
-    GetDriveTypeNumberL( aDrive, driveStatus, driveCount );
-    
-    
-    TSconDriveInfo info;
-    info.iDriveLetter.Copy( aStartPath.Left(2) );
-    info.iVolumeName = volumeInfo.iName;
-    
-    info.iDriveAttr = KEntryAttNormal; // ReadWrite   
-    if( driveStatus & DriveInfo::EDriveInternal && driveCount==0 )
-        {
-        //permission always R for first internal drive
-        info.iDriveAttr = KEntryAttReadOnly;
-        }
-    info.iDriveType = 0;
-    if( driveStatus & DriveInfo::EDriveInternal )
-        {
-        info.iDriveType = DriveInfo::EDriveInternal; // =1
-        }
-    else if( driveStatus & DriveInfo::EDriveRemovable )
-        {
-        info.iDriveType = DriveInfo::EDriveRemovable;; // =2
-        }
-    
-    if ( volumeInfo.iFree > iCriticalLevel )
-        {
-        volumeInfo.iFree = volumeInfo.iFree - iCriticalLevel;
-        }       
-    else
-        {
-        volumeInfo.iFree = 0;
-        }
-    
-    info.iFree = volumeInfo.iFree;
-    info.iSize = volumeInfo.iSize;
-    
-    aStream.WriteUint8L( 1 );
-    ExportDriveL( aStream, info, aStartPath, aLevelsToSearch);
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconFolderLister::ExportDriveL( RBufWriteStream& aStream, const TSconDriveInfo& aDriveInfo,
-        const TDesC& aPathName, const TInt aLevelsToSearch )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("Drive: %S", &aDriveInfo.iDriveLetter);
-    LOGGER_WRITE_1("aLevelsToSearch: %d", aLevelsToSearch );
-    
-    CSconFolderEntry* driveEntry = CSconFolderEntry::NewLC();
-    driveEntry->iName = aDriveInfo.iDriveLetter.AllocL();
-    
-    if ( driveEntry->iLabel )
-        {
-        LOGGER_WRITE_1("Label: %S", &driveEntry->iLabel->Des());
-        }
-    driveEntry->iAtt = aDriveInfo.iDriveAttr;
-
-    driveEntry->iDriveInfoEntryExists = ETrue;
-    driveEntry->iDriveInfoEntry.iDriveType = aDriveInfo.iDriveType;
-    driveEntry->iDriveInfoEntry.iDriveTypeCount = aDriveInfo.iDriveTypeCount;
-             
-    driveEntry->iDriveInfoEntry.iFree = aDriveInfo.iFree;
-    driveEntry->iDriveInfoEntry.iSize = aDriveInfo.iSize;
-    
-    driveEntry->iLabel = aDriveInfo.iVolumeName.AllocL();
-    GetLocalizedVolumeNameL( *driveEntry );
-    
-    ExportPathL( aStream, aPathName, *driveEntry, ETrue, aLevelsToSearch );
-    CleanupStack::PopAndDestroy( driveEntry );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconFolderLister::GetLocalizedVolumeNameL( CSconFolderEntry& aDriveEntry )
-    {
-    TRACE_FUNC_ENTRY;
-    // Get localized names
-    if ( aDriveEntry.iDriveInfoEntry.iDriveType == DriveInfo::EDriveInternal 
-            && aDriveEntry.iDriveInfoEntry.iDriveTypeCount > 1 )
-        {
-        LOGGER_WRITE("Internal mass memory");
-        // internal second memory (Mass memory)
-        TFileName file( KSConResourceName );
-        BaflUtils::NearestLanguageFile( iFs, file );
-        
-        CStringResourceReader* reader = CStringResourceReader::NewL( file );
-        if ( aDriveEntry.iLabel )
-            {
-            delete aDriveEntry.iLabel;
-            aDriveEntry.iLabel = NULL;
-            }
-        aDriveEntry.iLabel = reader->ReadResourceString( R_SECON_VALUE_MASS_STORAGE ).AllocL();
-        delete reader;
-        }
-    else if ( aDriveEntry.iLabel && aDriveEntry.iLabel->Length()>0 )
-        {
-        LOGGER_WRITE("Use normal volume label");
-        
-        }
-    else
-        {
-        TFileName file( KSConResourceName );
-        BaflUtils::NearestLanguageFile( iFs, file );
-        CStringResourceReader* reader = CStringResourceReader::NewL( file );
-        if (aDriveEntry.iLabel)
-            {
-            delete aDriveEntry.iLabel;
-            aDriveEntry.iLabel = NULL;
-            }
-        if ( aDriveEntry.iDriveInfoEntry.iDriveType == DriveInfo::EDriveRemovable )
-            {
-            LOGGER_WRITE("EDriveRemovable");
-            // read default MMC name
-            aDriveEntry.iLabel = reader->ReadResourceString( R_SECON_VALUE_MMC ).AllocL();
-            }
-        else
-            {
-            LOGGER_WRITE("EDriveInternal");
-            // read default DEV name
-            aDriveEntry.iLabel = reader->ReadResourceString( R_SECON_VALUE_DEVICE ).AllocL();
-            }
-        delete reader;
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSconFolderLister::GetDriveTypeNumberL()
-// 
-// -----------------------------------------------------------------------------
-//  
-void CSconFolderLister::GetDriveTypeNumberL( TInt aDrive, TUint aDriveStatus , TInt& aTypeNumber)
-    {
-    TRACE_FUNC_ENTRY;
-    aTypeNumber = 0;
-    
-    //TUint driveStatus;
-    //
-    // if true, search internal drives, else search removable drives
-    TBool searchInternalDrives = (aDriveStatus & DriveInfo::EDriveInternal);
-    
-    TInt driveCount;
-    TDriveList driveList;
-    
-    User::LeaveIfError( DriveInfo::GetUserVisibleDrives( iFs, driveList, driveCount ) );
-    
-    for( TInt i = EDriveA; i <= aDrive; i++ )
-        {
-        if( driveList[i] )
-            {
-            TUint driveStatus;
-            User::LeaveIfError( DriveInfo::GetDriveStatus( iFs, i, driveStatus ) );
-
-            if( !(driveStatus & DriveInfo::EDrivePresent )
-                || driveStatus & DriveInfo::EDriveCorrupt )
-                {
-                LOGGER_WRITE( "not present or corrupted" );
-                continue;
-                }
-            
-            if( driveStatus & DriveInfo::EDriveInternal )
-                {
-                if( searchInternalDrives )
-                    {
-                    aTypeNumber++;
-                    }
-                }
-            else if( driveStatus & DriveInfo::EDriveRemovable )
-                {
-                if( !searchInternalDrives )
-                    {
-                    aTypeNumber++;
-                    }
-                }
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-
-void CSconFolderLister::ExportPathL( RBufWriteStream& aStream, const TDesC& aPathName,
-        const CSconFolderEntry& aEntry, const TBool aLocalize, const TInt aLevelsToSearch )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aPathName: %S", &aPathName );
-    LOGGER_WRITE_1("aLevelsToSearch: %d", aLevelsToSearch );
-    
-    LOGGER_WRITE_1("aEntry.iName: %S", &aEntry.iName->Des() );
-    
-    TBool localized(EFalse); 
-    
-    // foldername length + name
-    aStream.WriteUint8L( aEntry.iName->Length() );
-    aStream.WriteL( aEntry.iName->Des() );
-    
-    TUint att = aEntry.iAtt;
-    
-    if ( aEntry.iLabel && aEntry.iLabel->Length() > 0 )
-        {
-        aStream.WriteUint8L( aEntry.iLabel->Length() );
-        aStream.WriteL( aEntry.iLabel->Des() );
-        }
-    else
-        {
-        if ( aLocalize )
-            {
-            // initialize Localizer
-            iLocalizer->SetFullPath( aPathName );
-            localized = iLocalizer->IsLocalized();
-            }
-        
-        if( localized )
-            {
-            const TDesC& localizedName = iLocalizer->LocalizedName();
-            aStream.WriteUint8L( localizedName.Length() );
-            aStream.WriteL( localizedName );
-            LOGGER_WRITE_1("LocalizedName: %S", &localizedName );
-            }
-        else if ( aPathName.CompareF(_L("C:\\Data\\")) == 0 )
-            {
-            TFileName file( KSConResourceName );
-            
-            BaflUtils::NearestLanguageFile( iFs, file );
-               
-            CStringResourceReader* reader = CStringResourceReader::NewL( file );
-            CleanupStack::PushL( reader );
-            
-            const TDesC& localizedName = reader->ReadResourceString( R_SECON_DATA_FOLDER );
-            aStream.WriteUint8L( localizedName.Length() );
-            aStream.WriteL( localizedName );
-            LOGGER_WRITE_1("LocalizedName: %S", &localizedName );
-            
-            CleanupStack::PopAndDestroy( reader );
-            localized = ETrue;
-            }
-        else
-            {
-            aStream.WriteUint8L( 0 );
-            }
-        // attributes
-        if ( localized )
-            {
-            // localized folder, set readonly flag
-            att = att | KEntryAttReadOnly;
-            }
-        }
-    
-    if ( aPathName.Length() == 3 && aLocalize )
-        {
-        // enable subfolder localization, even when root cannot be localized
-        localized = ETrue;
-        }
-    
-    // DriveInfoEntry
-    if ( aEntry.iDriveInfoEntryExists )
-        {
-        aStream.WriteUint8L( 1 );
-        aStream.WriteUint8L( aEntry.iDriveInfoEntry.iDriveType );
-        aStream.WriteUint8L( aEntry.iDriveInfoEntry.iDriveTypeCount );
-        aStream << aEntry.iDriveInfoEntry.iFree;
-        aStream << aEntry.iDriveInfoEntry.iSize;
-        }
-    else
-        {
-        aStream.WriteUint8L( 0 );
-        }
-    
-    
-    // modified time
-    TDateTime time = aEntry.iModified.DateTime();
-    aStream.WriteInt16L( time.Year() );
-    aStream.WriteInt8L( time.Month()+1 ); // range 1...12
-    aStream.WriteInt8L( time.Day()+1 );
-    aStream.WriteInt8L( time.Hour() );
-    aStream.WriteInt8L( time.Minute() );
-    aStream.WriteInt8L( time.Second() );
-    
-    // write attribute
-    aStream.WriteUint32L( att );
-    
-    
-    if ( aLevelsToSearch == 0 )
-        {
-        // don't list directory content
-        LOGGER_WRITE("Not listing directory content");
-        aStream.WriteInt16L( 0 ); // files count
-        aStream.WriteInt16L( 0 ); // directory count
-        return;
-        }
-    
-    CDir *fileList = 0;
-    CDir *dirList = 0;
-    
-    // show normal and hidden files and folders
-    TUint entryAttMask = KEntryAttNormal | KEntryAttHidden;
-    
-    // get folders and files
-    TInt err = iFs.GetDir( aPathName, entryAttMask, ESortByName, 
-            fileList, dirList );
-    
-    if ( err )
-        {
-        LOGGER_WRITE_1( "ParseFolderListL GetDir returned: %d", err );
-        User::Leave( err );
-        }
-    
-    CleanupStack::PushL( dirList );
-    CleanupStack::PushL( fileList );
-    
-    
-    LOGGER_WRITE_1("files: %d", fileList->Count());
-    aStream.WriteUint16L( fileList->Count() );
-    
-    // Print files to folder listing object
-    for( TInt i = 0; i < fileList->Count(); i++ )
-        {
-        const TEntry& fileEntry = ( *fileList )[i];
-        iFiles++;
-        LOGGER_WRITE_1("fileEntry.iName: %S", &fileEntry.iName);
-        // filename length + name
-        aStream.WriteUint8L( fileEntry.iName.Length() );
-        aStream.WriteL( fileEntry.iName );
-        
-        // modified time
-        TDateTime time = fileEntry.iModified.DateTime();
-        aStream.WriteInt16L( time.Year() );
-        aStream.WriteInt8L( time.Month()+1 ); // range 1...12
-        aStream.WriteInt8L( time.Day()+1 );
-        aStream.WriteInt8L( time.Hour() );
-        aStream.WriteInt8L( time.Minute() );
-        aStream.WriteInt8L( time.Second() );
-        
-        // attributes
-        aStream.WriteUint32L( fileEntry.iAtt );
-        
-        // file size
-        aStream.WriteUint32L( fileEntry.iSize );
-        }
-    CleanupStack::PopAndDestroy( fileList );
-    
-    
-    // calculate ow many directories we are going to list
-    TInt directoryCount(0);
-    for( TInt i = 0; i < dirList->Count(); i++ )
-        {
-        if ( IsDirectoryPrintable(aPathName, ( *dirList )[i] ) )
-            {
-            directoryCount++;
-            }
-        }
-    LOGGER_WRITE_1("directories: %d", directoryCount);
-    aStream.WriteUint16L( directoryCount );
-    
-    HBufC* fullpath = HBufC::NewL( KMaxPath );
-    TPtr fullpathPtr = fullpath->Des();
-    CleanupStack::PushL( fullpath );
-    
-    // Print folders to folder listing object
-    for( TInt i = 0; i < dirList->Count(); i++ )
-        {
-        const TEntry& folderEntry = ( *dirList )[i];
-        if ( !IsDirectoryPrintable(aPathName, folderEntry) )
-            {
-            continue;
-            }
-        iFolders++;
-        
-        fullpathPtr.Copy( aPathName );
-        fullpathPtr.Append( folderEntry.iName );
-        fullpathPtr.Append( _L("\\") );
-        CSconFolderEntry* subFolderEntry = CSconFolderEntry::NewLC( folderEntry );
-        if ( aLevelsToSearch == KErrNotFound )
-            {
-            ExportPathL( aStream, fullpathPtr, *subFolderEntry, localized, aLevelsToSearch);
-            }
-        else
-            {
-            ExportPathL( aStream, fullpathPtr, *subFolderEntry, localized, aLevelsToSearch-1);
-            }
-        CleanupStack::PopAndDestroy( subFolderEntry );
-        }
-    CleanupStack::PopAndDestroy( fullpath );
-    CleanupStack::PopAndDestroy( dirList );
-    
-    TRACE_FUNC_EXIT;
-    }
-TBool CSconFolderLister::IsDirectoryPrintable( const TDesC& aParentPath, const TEntry& aFolderEntry )
-    {
-    if ( aFolderEntry.IsSystem() )
-        {
-        LOGGER_WRITE_1("folder '%S' was system folder", &aFolderEntry.iName);
-        return EFalse;
-        }
-    if ( aParentPath.Length() == 3 )
-        {
-        if ( aParentPath.FindF(_L("C:\\")) == 0 && aFolderEntry.iName.CompareF(_L("data")) != 0 )
-            {
-            // C root not visible, exept Data folder
-            LOGGER_WRITE_1("folder '%S' not visible to user in c-root", &aFolderEntry.iName);
-            return EFalse;
-            }
-        
-        if ( aFolderEntry.iName.CompareF(_L("private")) == 0 )
-            {
-            LOGGER_WRITE_1("folder '%S' not visible to user", &aFolderEntry.iName);
-            return EFalse;
-            }
-        else if ( aFolderEntry.iName.CompareF(_L("sys")) == 0 )
-            {
-            LOGGER_WRITE_1("folder '%S' not visible to user", &aFolderEntry.iName);
-            return EFalse;
-            }
-        else if ( aFolderEntry.iName.CompareF(_L("system")) == 0 )
-            {
-            LOGGER_WRITE_1("folder '%S' not visible to user", &aFolderEntry.iName);
-            return EFalse;
-            }
-        else if ( aFolderEntry.iName.CompareF(_L("resource")) == 0 )
-            {
-            LOGGER_WRITE_1("folder '%S' not visible to user", &aFolderEntry.iName);
-            return EFalse;
-            }
-        }
-    return ETrue;
-    }
-
--- a/connectivitymodules/SeCon/servers/pcconn/src/sconimsireader.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  CSconImsiReader implementation
-*
-*/
-
-
-#include "sconimsireader.h"
-#include "debug.h"
-
-TInt CSconImsiReader::GetImsiL( TDes& aImsi )
-    {
-    TRACE_FUNC_ENTRY;
-    CTelephony::TRegistrationStatus temp;
-    CSconImsiReader* self = new (ELeave) CSconImsiReader(aImsi, temp);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    
-    self->RequestImsi();
-    
-    TInt err = self->iStatus.Int();
-    CleanupStack::PopAndDestroy(self);
-    TRACE_FUNC_RET(err);
-    return err;
-    }
-
-TInt CSconImsiReader::GetNetworkStatusL( CTelephony::TRegistrationStatus& aRegistrationStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    TBuf<CTelephony::KIMSISize> temp;
-    CSconImsiReader* self = new (ELeave) CSconImsiReader(temp, aRegistrationStatus);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    
-    self->RequestNetworkStatus();
-    
-    TInt err = self->iStatus.Int();
-    CleanupStack::PopAndDestroy(self);
-    TRACE_FUNC_RET(err);
-    return err;
-    }
- 
-void CSconImsiReader::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    iTelephony = CTelephony::NewL();
-    CActiveScheduler::Add(this);
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconImsiReader::RequestImsi()
-    {
-    iImsiReaderStatus = ERequestingImsi;
-    iTelephony->GetSubscriberId(iStatus,iSubscriberIdV1Pckg);
-    SetActive();
-    CActiveScheduler::Start();
-    }
-
-void CSconImsiReader::RequestNetworkStatus()
-    {
-    iImsiReaderStatus = ERequestingNetworkStatus;
-    iTelephony->GetNetworkRegistrationStatus(iStatus, iNetworkRegistrationV1Pckg);
-    SetActive();
-    CActiveScheduler::Start();
-    }
-
-CSconImsiReader::~CSconImsiReader()
-    {
-    TRACE_FUNC_ENTRY;
-    delete iTelephony;
-    TRACE_FUNC_EXIT;
-    }
- 
-CSconImsiReader::CSconImsiReader(TDes& aImsi, CTelephony::TRegistrationStatus& aRegistrationStatus): CActive(EPriorityStandard),
-    iImsi(aImsi), iNetworkStatus(aRegistrationStatus), iSubscriberIdV1Pckg(iSubscriberIdV1), iNetworkRegistrationV1Pckg(iNetworkRegistrationV1)
-    {
-    }
- 
-void CSconImsiReader::RunL()
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("iStatus: %d", iStatus.Int() );
-    if ( iStatus == KErrNone )
-        {
-        if ( iImsiReaderStatus == ERequestingImsi )
-            {
-            iImsi = iSubscriberIdV1.iSubscriberId;
-            LOGGER_WRITE_1("iImsi: %S", &iImsi);
-            }
-        else if ( iImsiReaderStatus == ERequestingNetworkStatus )
-            {
-            iNetworkStatus = iNetworkRegistrationV1.iRegStatus;
-            LOGGER_WRITE_1( "iNetworkStatus: %d", (TInt)iNetworkStatus);
-            }
-        }
-    CActiveScheduler::Stop();
-    TRACE_FUNC_EXIT;
-    }
- 
-void CSconImsiReader::DoCancel()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iImsiReaderStatus == ERequestingImsi )
-        {
-        iTelephony->CancelAsync( CTelephony::EGetSubscriberIdCancel );
-        }
-    else if ( iImsiReaderStatus == ERequestingNetworkStatus )
-        {
-        iTelephony->CancelAsync( CTelephony::EGetNetworkRegistrationStatusCancel );
-        }
-    TRACE_FUNC_EXIT;
-    }
--- a/connectivitymodules/SeCon/servers/pcconn/src/sconpcconnserver.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3034 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity server
-*
-*/
-
-
-#include <s32mem.h> // For RMemReadStream
-#include <utf.h>
-#include <Etel3rdParty.h>
-#include <f32file.h>
-
-#include "sconpcconnclientserver.h"
-#include "sconpcconnserver.h"
-#include "sconpcd.h"
-#include "sconcsc.h"
-#include "sconconmlhandler.h"
-#include "sconimsireader.h"
-#include "sconoviaccounthandler.h"
-#include "sconfolderlister.h"
-#include "sconbtengine.h"
-#include "debug.h"
-
-#ifdef DEBUG_XML
-#include <s32file.h>
-_LIT8( KTimeFormat, "%02d:%02d:%02d.%03d" );
-_LIT8( KXmlBegin, "\nXML:\n" );
-#endif
-
-_LIT( KSCONGetMetadataRequest, "METADATA:" );
-_LIT8( KSCONSyncRequest, "SYNC:" );
-_LIT( KSCONReadImsi, "READIMSI");
-_LIT( KSCONReadNetworkInfo, "READNETWORKINFO");
-_LIT( KSCONReadOviAccount, "READOVIACCOUNT");
-_LIT( KSCONListPath, "LISTP:");
-_LIT( KSCONReadBtInfo, "READBTINFO" );
-_LIT( KSCONSetBtPower, "SETBTPOWER:" );
-_LIT( KSCONSetBtName, "SETBTNAME:" );
-_LIT( KSCONSetBtAuthorized, "SETBTAUTHORIZED:" );
-
-//------------------------------------------------------------
-// Global functions 
-//------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// E32Main()
-// Entry point 
-// -----------------------------------------------------------------------------
-//
-TInt E32Main()
-    {
-    TRACE_FUNC_ENTRY;
-    __UHEAP_MARK;
-    TInt error( KErrNone );
-    error = CSConPCConnServer::RunServer();
-    __UHEAP_MARKEND;
-    TRACE_FUNC_EXIT;
-    return error;
-    }
-
-// -----------------------------------------------------------------------------
-// PanicServer()
-// Panics the server with panic reason aPanic 
-// -----------------------------------------------------------------------------
-//
-GLDEF_C void PanicServer(TPCConnServPanic aPanic)
-    {
-    LOGGER_WRITE_1( "CSConPCConnSession::PanicServer() : Panic code  %d", aPanic );  
-    _LIT(KTxtServerPanic,"PCConn server panic");
-    User::Panic(KTxtServerPanic,aPanic);
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnServer::CSConPCConnServer ()
-// Default constructor - can not leave
-// -----------------------------------------------------------------------------
-//
-CSConPCConnServer::CSConPCConnServer () : CServer2( EPriorityStandard)
-    {
-    LOGGER_WRITE( "* * * *  CSConPCConnServer  * * * *" );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnServer::~CSConPCConnServer()
-// Default destructor
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CSConPCConnServer::~CSConPCConnServer()
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnServer::NewLC()
-// Creates a new instance of CSConPCConnServer
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CSConPCConnServer*  CSConPCConnServer::NewLC()
-    {
-    TRACE_FUNC_ENTRY;
-    CSConPCConnServer* self  = new (ELeave) CSConPCConnServer();
-    CleanupStack::PushL( self );
-    self->StartL( KSConPCConnServerName );
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnServer::NewSessionL()
-// Creates a new session to the client
-// -----------------------------------------------------------------------------
-//
-CSession2* CSConPCConnServer::NewSessionL( 
-    const TVersion &aVersion, const RMessage2& /*aMessage*/ ) const
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // check version
-    TVersion version( KSConPCConnServerVersionMajor, 
-                                  KSConPCConnServerVersionMinor, 
-                                  KSConPCConnServerVersionBuild);
-    
-    if (!User::QueryVersionSupported(version, aVersion))
-        {
-        User::Leave(KErrNotSupported);
-        }
-    
-    // check client identity
-    RThread client;
-    Message().Client( client );
-    TSecureId clientId = client.SecureId();
-    
-    if ( clientId != KSConPCConnClientSecureId )
-        {
-        LOGGER_WRITE( "CSConPCConnServer::NewSessionL() : Secure ID does not match" );
-        User::Leave( KErrAccessDenied );
-        }
-    
-    TRACE_FUNC_EXIT;
-    return CSConPCConnSession::NewL( *CONST_CAST( CSConPCConnServer*, this));
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnServer::RunServer()
-// Starts the server
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnServer::RunServer()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    CTrapCleanup* cleanup = CTrapCleanup::New();
-    TInt ret = KErrNoMemory;
-    if( cleanup )
-        {
-        TRAP( ret, CSConPCConnServer::RunServerL(  ) );
-        delete cleanup;
-        }
-    if( ret != KErrNone )
-        {
-        // Signal the client that server creation failed
-        RProcess::Rendezvous( ret );
-        }
-    TRACE_FUNC_EXIT;
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnServer::RunServerL()
-// Starts the server
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnServer::RunServerL()
-    {
-    // Create and install the active scheduler we need
-    TRACE_FUNC_ENTRY;
-    CActiveScheduler *as=new (ELeave)CActiveScheduler;
-    CleanupStack::PushL( as );
-    CActiveScheduler::Install( as );
-
-    // Create server
-    CSConPCConnServer* server = CSConPCConnServer::NewLC();
-
-    // Initialisation complete, now signal the client
-    User::LeaveIfError( RThread().RenameMe( KSConPCConnServerName ) );
-    RProcess::Rendezvous( KErrNone );
-
-    // Ready to run
-    CActiveScheduler::Start();
-    
-    // Cleanup the scheduler
-    CleanupStack::PopAndDestroy( 2, as );
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnServer::IncSessionCount()
-// Increments session count
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnServer::IncSessionCount()
-    {
-    TRACE_FUNC_ENTRY;
-    iSessionCount++;
-    LOGGER_WRITE_1( "There are now %d sessions", iSessionCount );
-    TRACE_FUNC_EXIT;
-    }    
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnServer::DecSessionCount()
-// Decrements session count
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnServer::DecSessionCount()
-    {
-    TRACE_FUNC_ENTRY;
-    iSessionCount--;
-    LOGGER_WRITE_1( "There are still %d sessions", iSessionCount );
-    if ( iSessionCount < 1 )
-        {
-        Cancel();
-        CActiveScheduler::Stop();   
-        }
-    TRACE_FUNC_EXIT;
-    } 
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::CSConPCConnSession()
-// Default constructor 
-// -----------------------------------------------------------------------------
-//
-CSConPCConnSession::CSConPCConnSession (
-     CSConPCConnServer& aServer ) : iServer (aServer)
-    {
-    TRACE_FUNC_ENTRY;
-    iServer.IncSessionCount();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::CSConPCConnSession()
-// Default destructor - frees resources
-// -----------------------------------------------------------------------------
-//
-CSConPCConnSession::~CSConPCConnSession()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iServer.DecSessionCount();
-
-    if ( iConMLHandler )
-        {
-        delete iConMLHandler;
-        iConMLHandler = NULL;
-        iConMLHandlerLib.Close();
-        }
-
-    if ( iPCDHandler )
-        {
-        delete iPCDHandler;
-        iPCDHandler = NULL;
-        iPCDlib.Close();
-        }
-
-    if ( iCSCHandler )
-        {
-        delete iCSCHandler;
-        iCSCHandler = NULL;
-        iCSClib.Close();
-        }
-    
-    if ( iBuffer )
-        {
-        delete iBuffer;
-        iBuffer = NULL;
-        }
-        
-    iChunk.Close();
-    delete iFolderLister;
-    
-    iFs.Close();
-    
-    delete iBtEngine;
-     
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::NewL()
-// Creates a new instance of CSConPCConnSession
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CSConPCConnSession *CSConPCConnSession::NewL(
-    CSConPCConnServer& aServer)
-    {
-    TRACE_FUNC_ENTRY;
-    CSConPCConnSession* self = new ( ELeave ) CSConPCConnSession(aServer);
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::ConstructL()
-// 2nd phase constructor
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    iResult = KErrNone;
-    
-    User::LeaveIfError( iFs.Connect() );
-    
-#ifdef DEBUG_XML
-    // create log file 
-    
-    RFile file;
-    TInt err = file.Create ( iFs, KSConConMLDebugFile, EFileWrite );
-    if( err == KErrNone )
-        {
-        // file created, close it
-        file.Close();
-        }              
-#endif
-    
-    // initialize buffer
-    iBuffer = CBufFlat::NewL ( KSConPCConnBufferMaxSize );
-    
-    // load handlers
-    if ( !iPCDHandler )
-        {
-        TRAP( ret, LoadPCDDllL() );
-        if ( ret != KErrNone) 
-            {
-            LOGGER_WRITE_1( "CSConPCConnSession::ConstructL() : PCD load failed with error code %d", ret );
-            User::Leave( ret );
-            }
-        }   
-    
-    if ( !iCSCHandler )
-        {
-        TRAP( ret, LoadCSCDllL() );
-        if ( ret != KErrNone) 
-            {
-            LOGGER_WRITE_1( "CSConPCConnSession::ConstructL() : CSC dll load failed with error code %d", ret ); 
-            User::Leave ( ret );
-            }
-        }
-
-    // Load parser
-    if ( !iConMLHandler )
-        {
-        TRAPD( ret, LoadConMLHandlerDllL() );
-        if ( ret != KErrNone)
-            {
-            LOGGER_WRITE_1( "CSConPCConnSession::ConstructL() : Parser dll load failed with error code %d", ret );
-            User::Leave ( ret );
-            }
-        }
-    
-    iFolderLister = CSconFolderLister::NewL( iFs );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::ServiceL()
-// Gets the client's request
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::ServiceL( const RMessage2 &aMessage)
-    {
-    TRACE_FUNC_ENTRY;
-    TRAPD(err,DispatchRequestL(aMessage) );
-    if ( err != KErrNone )
-        {
-        LOGGER_WRITE_1( "CSConPCConnSession::ServiceL() : leave code %d", err );
-        PanicServer( E_DispatchRequest );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::DispatchRequestL()
-// Identifies an IPC command from the client 
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::DispatchRequestL(const RMessage2 &aMessage)
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TInt ret (KErrNone);
-        
-    switch (aMessage.Function())
-        {
-        case EPutMessage:
-            LOGGER_WRITE( "CSConPCConnSession::DispatchRequestL() : EPutMessage" );
-            ret = HandlePutMessageL();
-            break;
-        
-        case EGetMessage:
-            LOGGER_WRITE( "CSConPCConnSession::DispatchRequestL() : EGetMessage" );
-            ret = HandleGetMessageL();
-            break;
-        
-        case EResetMessage:
-            LOGGER_WRITE( "CSConPCConnSession::DispatchRequestL() : EResetMessage" );
-            ret = HandleResetMessage();
-            break;
-            
-        case EChunkMessage:
-            LOGGER_WRITE( "CSConPCConnSession::DispatchRequestL() : EChunkMessage" );
-            ret = HandleChunkMessage( aMessage );
-            break;
-                        
-        default:
-            PanicServer (E_BadRequest);
-            break;
-        }
-
-    aMessage.Complete( ret );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::HandlePutMessageL()
-// Handles a PUT -type message from the client
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::HandlePutMessageL()
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "CSConPCConnSession::HandlePutMessageL() : begin : Heap count : %d", User::Heap().Count() );
-    TInt ret ( KErrNone );
-        
-    if ( !iPCDHandler )
-        {
-        TRAP( ret, LoadPCDDllL() );
-        if ( ret != KErrNone) 
-            {
-            LOGGER_WRITE_1( "CSConPCConnSession::HandlePutMessageL (): PCD dll load failed with error code %d", ret );    
-            return ( ret );
-            }
-        }   
-        
-    if ( ! iConMLHandler )
-        {
-        TRAP ( ret, LoadConMLHandlerDllL() );
-        if ( ret != KErrNone )
-            {
-            LOGGER_WRITE_1( "CSConPCConnSession::HandlePutMessageL (): ConML Handler dll load failed with error code %d", ret );  
-            return ( ret );
-            }
-        }
-        
-    TInt length ( 0 );
-    
-    RMemReadStream buf( iChunk.Base(), iChunk.Size() );
-
-
-    iBuffer->Reset();
-
-    length = buf.ReadInt32L();
-    HBufC8* name8 = HBufC8::NewLC( length );
-    TPtr8 namePtr8 = name8->Des();
-    buf.ReadL( namePtr8, length);
-    
-    const TUint8* ptr8 = namePtr8.Ptr();
-    const TUint16* ptr16 = reinterpret_cast<const TUint16*>( ptr8 );
-    TPtrC namePtr;
-    namePtr.Set( ptr16, length/2 );
-        
-    length = buf.ReadInt32L();
-    HBufC8* type = HBufC8::NewLC( length );
-    TPtr8 typePtr = type->Des();
-    buf.ReadL( typePtr, length);
-   
-    // WBXML Document
-    length = buf.ReadInt32L();
-    HBufC8* data = HBufC8::NewLC( length );
-    TPtr8 dataPtr = data->Des();
-    
-    buf.ReadL( dataPtr, length );
-    iBuffer->ResizeL( length );
-    iBuffer->Write( 0, dataPtr );
-            
-    buf.Close();
-    
-#ifdef DEBUG_XML
-
-    RFile file;
-    if ( file.Open( iFs, KSConConMLDebugFile, EFileWrite ) == KErrNone )
-        {
-        RFileWriteStream fws;
-        TInt fileSize;
-        file.Size( fileSize );
-        
-        TTime now;
-        now.HomeTime();
-        TDateTime time = now.DateTime();
-        TBuf8<16> timeLine;
-        timeLine.Format (KTimeFormat, time.Hour(), time.Minute(), 
-                                    time.Second(), time.MicroSecond() );
-        
-        fws.Attach( file, fileSize );
-        fws.PushL();
-        fws.WriteL( timeLine );
-        _LIT8( KPutMessage, "__________PUT-MESSAGE \nWBXML:\n" );
-        fws.WriteL( KPutMessage );
-        fws.WriteL( iBuffer->Ptr(0), iBuffer->Size() );
-        TRAP_IGNORE( fws.CommitL() );
-        fws.Close();
- 
-        CleanupStack::PopAndDestroy( &fws );
-        }
-    file.Close();
-#endif
-    if ( ( ( typePtr.CompareC( KSConPCDWBXMLObjectType)== KErrNone ) || 
-                 ( typePtr.CompareC( KSConPCDWBXMLObjectType2 )== KErrNone ) )
-                 && namePtr8.Find(KSCONSyncRequest) == 0 )
-        {
-        LOGGER_WRITE_1("Sync request: %S", &namePtr);
-        RBufReadStream stream( *iBuffer );
-        
-        CleanupClosePushL( stream );
-        TRAP( ret, iPCDHandler->HandlePutSyncRequestL( namePtr8, stream ));
-        if ( ret )
-            {
-            LOGGER_WRITE_1("HandlePutSyncRequestL() Leaved with %d", ret);
-            }
-        
-        CleanupStack::PopAndDestroy( &stream );
-        }
-    else if ( ( typePtr.Compare( KSConPCDWBXMLObjectType ) == KErrNone) || 
-         ( typePtr.Compare( KSConPCDWBXMLObjectType2 )== KErrNone) )
-        {
-        LOGGER_WRITE( "CSConPCConnSession::HandlePutMessageL() : Object type PCD " );
-        TRAPD( err, ret = iConMLHandler->ParseDocumentL( *iBuffer, this ) );    
-        if ( err != KErrNone )
-            {
-            ret = err;
-            }
-        if ( ret == KErrNone )
-            {
-            // Possible error code returned from PCCS 
-            ret = iResult;
-            }
-        }
-    else 
-        {
-        LOGGER_WRITE( "Object type not regognized " );
-        ret = KErrNotSupported;
-        }
-    CleanupStack::PopAndDestroy( data );
-    CleanupStack::PopAndDestroy( type );
-    CleanupStack::PopAndDestroy( name8 );
-    LOGGER_WRITE_1( "CSConPCConnSession::HandlePutMessageL() end : Heap count : %d", User::Heap().Count() );
-    LOGGER_WRITE_1( "CSConPCConnSession::HandlePutMessageL() : returned %d", ret );    
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::HandleGetMessageL()
-// Handles a GET -type message from the client
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::HandleGetMessageL()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    
-    if ( !iCSCHandler )
-        {
-        TRAP( ret, LoadCSCDllL() );
-        if ( ret != KErrNone) 
-            {
-            LOGGER_WRITE_1( "CSConPCConnSession::HandleGetMessageL() : CSC dll load failed with error code %d", ret ); 
-            return ret;
-            }
-        }
-
-    TInt32 length ( 0 );
-    RMemReadStream readBuf( iChunk.Base(), iChunk.Size() );
-    iBuffer->Reset();
-    
-    length = readBuf.ReadInt32L();
-    HBufC8* name = HBufC8::NewLC( length );
-    TPtr8 namePtr8 = name->Des();
-    readBuf.ReadL( namePtr8, length);
-    namePtr8.SetLength( length );
-    LOGGER_WRITE8_1("namePtr: %S", &namePtr8);
-    
-    const TUint8* ptr8 = namePtr8.Ptr();
-    const TUint16* ptr16 = reinterpret_cast<const TUint16*>( ptr8 );
-    TPtrC namePtr;
-    namePtr.Set( ptr16, length/2 );
-    
-    length = readBuf.ReadInt32L();
-    HBufC8* type = HBufC8::NewLC( length );
-    TPtr8 typePtr = type->Des();
-    readBuf.ReadL( typePtr, length);
-    
-    readBuf.Close();
-        
-    if ( typePtr.Compare( KSConCapabilityObjectType ) == KErrNone )
-        {
-        ret = iCSCHandler->CapabilityObject( *iBuffer );
-        
-#ifdef DEBUG_XML
-        
-        RFile file;
-        if ( file.Open(iFs, KSConConMLDebugFile, EFileWrite ) == KErrNone )
-            {
-            RFileWriteStream fws;
-            TInt fileSize;
-            file.Size ( fileSize );
-            TTime now;
-            now.HomeTime();
-            TDateTime time = now.DateTime();
-            TBuf8<16> timeLine;
-            timeLine.Format( KTimeFormat, time.Hour(), time.Minute(), 
-                                        time.Second(), time.MicroSecond() );
-
-            fws.Attach ( file, fileSize);
-            fws.PushL();
-            fws.WriteL( timeLine );
-            _LIT8( KGetMessage, "__________GET -MESSAGE - Capability Object \n " );
-            fws.WriteL( KGetMessage );
-            fws.WriteL( iBuffer->Ptr(0), iBuffer->Size() );
-            TRAP_IGNORE( fws.CommitL() );
-            fws.Close();
-
-            CleanupStack::PopAndDestroy( &fws );
-            }
-        file.Close();
-#endif
-
-        }
-    else if (  typePtr.CompareC( KSConPCDWBXMLObjectType) == KErrNone )
-        {
-        if ( namePtr8.Find(KSCONSyncRequest) == 0 ) // 8-bit search
-            {
-            LOGGER_WRITE("Sync request");
-            
-            RBufWriteStream stream( *iBuffer );
-                
-            CleanupClosePushL( stream );
-            
-            TRAP( ret, iPCDHandler->HandleGetSyncRequestL( namePtr8, stream, iChunk.MaxSize() - sizeof(TInt32) ));
-            if ( ret )
-                {
-                LOGGER_WRITE_1("HandleGetSyncRequestL() Leaved with %d", ret);
-                }
-            stream.CommitL();
-            CleanupStack::PopAndDestroy( &stream );
-            
-            LOGGER_WRITE_1("iBuffer size: %d", iBuffer->Size());
-            
-            }
-        else if ( namePtr.Find(KSCONReadImsi) == 0 ) // 16-bit search
-            {
-            LOGGER_WRITE("Read IMSI");
-            TBuf<CTelephony::KIMSISize> imsi;
-            ret = CSconImsiReader::GetImsiL( imsi );
-            
-            if ( ret == KErrNone )
-                {
-                TBuf8<CTelephony::KIMSISize> imsi8;
-                User::LeaveIfError( CnvUtfConverter::ConvertFromUnicodeToUtf8(imsi8,imsi) );
-                
-                iBuffer->ResizeL( imsi8.Length() );
-                iBuffer->Write( 0, imsi8 );
-                }
-            else
-                {
-                // Change error code more generic
-                ret = KErrNotFound;
-                }
-            }
-        else if ( namePtr.Find(KSCONReadNetworkInfo) == 0 ) // 16-bit search
-            {
-            LOGGER_WRITE("Read NetworkInfo");
-            CTelephony::TRegistrationStatus regStatus;
-            ret = CSconImsiReader::GetNetworkStatusL( regStatus );
-            
-            if ( ret == KErrNone )
-                {
-                RBufWriteStream stream( *iBuffer );
-                CleanupClosePushL( stream );
-                stream.WriteInt8L( regStatus );
-                stream.CommitL();
-                CleanupStack::PopAndDestroy( &stream );
-                }
-            else
-                {
-                // Change error code more generic
-                ret = KErrNotFound;
-                }
-            }
-        else if ( namePtr.Find(KSCONReadOviAccount) == 0 )
-            {
-            LOGGER_WRITE("Read Ovi account");
-            RBufWriteStream stream( *iBuffer );
-            CleanupClosePushL( stream );
-            
-            ret = ReadOviAccountInfoL( stream );
-            stream.CommitL();
-            CleanupStack::PopAndDestroy( &stream );
-            
-            }
-        else if ( namePtr.Find(KSCONListPath) == 0 )
-            {
-            LOGGER_WRITE("List path");
-            // LISTP:0:pathname
-            if ( namePtr.Length() > KSCONListPath().Length()+2)
-                {
-                TPtrC pathname = namePtr.Mid( KSCONListPath().Length()+2 );
-            
-                const TUint16 levelsChar = namePtr[ KSCONListPath().Length() ];
-                TInt level(KErrNotFound);
-                if ( levelsChar >= TChar('0') )
-                    {
-                    level = levelsChar - TChar('0');
-                    }
-                
-                RBufWriteStream stream( *iBuffer );
-                CleanupClosePushL( stream );
-                TRAP( ret, iFolderLister->GenerateFolderListL( stream, pathname, level ));
-                LOGGER_WRITE_1("GenerateFolderListL leaved with err: %d", ret);
-                stream.CommitL();
-                CleanupStack::PopAndDestroy( &stream );
-                }
-            else
-                {
-                ret = KErrArgument;
-                }
-            
-            }
-        else if ( namePtr.Find(KSCONReadBtInfo) == 0 )
-            {
-            LOGGER_WRITE( "Read BT info");
-            if ( !iBtEngine )
-                {
-                iBtEngine = CSconBtEngine::NewL();
-                }
-            RBufWriteStream stream( *iBuffer );
-            CleanupClosePushL( stream );
-            TRAP( ret, iBtEngine->ReadBTInfoL( stream ) );
-            LOGGER_WRITE_1("ReadBTInfoL leaved with err: %d", ret);
-            stream.CommitL();
-            CleanupStack::PopAndDestroy( &stream );
-            }
-        else if ( namePtr.Find(KSCONSetBtPower) == 0 )
-            {
-            LOGGER_WRITE( "Change BT Power state");
-            if ( namePtr.Length() == KSCONSetBtPower().Length()+1 )
-                {
-                const TUint16 lastChar = namePtr[ KSCONSetBtPower().Length() ];
-                TBool changeBtOn;
-                if ( lastChar == TChar('0') )
-                    {
-                    changeBtOn = EFalse;
-                    }
-                else if ( lastChar == TChar('1') )
-                    {
-                    changeBtOn = ETrue;
-                    }
-                else
-                    {
-                    ret = KErrArgument;
-                    }
-                
-                if ( !ret )
-                    {
-                    if ( !iBtEngine )
-                       {
-                       iBtEngine = CSconBtEngine::NewL();
-                       }
-                    TInt err = iBtEngine->SetBtPowerState( changeBtOn );
-                    
-                    RBufWriteStream stream( *iBuffer );
-                    CleanupClosePushL( stream );
-                    stream.WriteInt32L( err );
-                    stream.CommitL();
-                    CleanupStack::PopAndDestroy( &stream );
-                    }
-                }
-            else
-                {
-                ret = KErrArgument;
-                }
-            }
-        else if ( namePtr.Find(KSCONSetBtName) == 0 )
-            {
-            LOGGER_WRITE( "Set BT Name");
-            TPtrC btName = namePtr.Mid( KSCONSetBtName().Length() );
-            TInt err = iBtEngine->SetBtName( btName  );
-            
-            RBufWriteStream stream( *iBuffer );
-            CleanupClosePushL( stream );
-            stream.WriteInt32L( err );
-            stream.CommitL();
-            CleanupStack::PopAndDestroy( &stream );
-            }
-        else if ( namePtr.Find(KSCONSetBtAuthorized) == 0 )
-            {
-            LOGGER_WRITE( "Set BT Authorized");
-            ret = KErrArgument;
-            // SETBTAUTHORIZED:0:00245f8d6a26
-            // 1. param = auth. state ("0"=off, "1"=true)
-            // 2. param = bt address (hex string)
-            
-            if ( namePtr.Length() > KSCONSetBtAuthorized().Length()+2)
-                {
-                TPtrC btAddr = namePtr.Mid( KSCONSetBtAuthorized().Length()+2 );
-                
-                const TUint16 authStateChar = namePtr[ KSCONSetBtAuthorized().Length() ];
-                TBool authorize(EFalse);
-                if ( authStateChar == TChar('0') )
-                    {
-                    authorize = EFalse;
-                    ret = KErrNone;
-                    }
-                else if ( authStateChar == TChar('1') )
-                    {
-                    authorize = ETrue;
-                    ret = KErrNone;
-                    }
-                
-                if ( !iBtEngine )
-                   {
-                   iBtEngine = CSconBtEngine::NewL();
-                   }
-                TRAPD(err, iBtEngine->SetBtAuthorizedL( btAddr, authorize ) );
-                
-                RBufWriteStream stream( *iBuffer );
-                CleanupClosePushL( stream );
-                stream.WriteInt32L( err );
-                stream.CommitL();
-                CleanupStack::PopAndDestroy( &stream );
-                }
-            
-            }
-        else 
-            {
-            ret = HandleWBXMLGetRequestL( namePtr );
-            }
-        }
-    else
-        {
-        LOGGER_WRITE( "CSConPCConnSession::HandleGetMessageL() : Header type not regognized " );
-        ret = KErrNotSupported;
-        }
-    
-    CleanupStack::PopAndDestroy( 2 ); // name, type
-    
-    if ( ret != KErrNone )
-        {
-        return ret;
-        }
-    
-    length = iBuffer->Size();
-    
-    if ( sizeof(TInt32) + length > iChunk.Size() )
-        {
-        // need to resize chunk
-        TInt err = iChunk.Adjust( sizeof(TInt32) + length );
-        LOGGER_WRITE_2("iChunk.Adjust( %d ) err: %d", sizeof(TInt32) + length, err);
-        if ( err )
-            {
-            iBuffer->Reset();
-            LOGGER_WRITE_1( "CSConPCConnSession::HandleGetMessageL() : returned %d", ret );
-            return err;
-            }
-        }
-    
-    // copy data to chunk
-    RMemWriteStream writeBuf ( iChunk.Base(), iChunk.Size() );
-    
-    if ( length > 0 )
-        {
-        writeBuf.WriteInt32L( length );
-        writeBuf.WriteL( iBuffer->Ptr(0), length );
-        writeBuf.CommitL();
-        }
-    else 
-        {
-        writeBuf.WriteInt32L( 0 );
-        }
-    writeBuf.CommitL();
-    writeBuf.Close();
-    iBuffer->Reset();
-    LOGGER_WRITE_1( "CSConPCConnSession::HandleGetMessageL() : returned %d", ret );
-    return ( ret );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::HandleWBXMLGetRequestL()
-// Handles a ConML(wbxml) Get request from the client
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::HandleWBXMLGetRequestL( const TDesC& aFileName )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret(KErrNone);
-    if ( aFileName.Find(KSCONGetMetadataRequest) == 0 )
-        {
-        // ConML get metadata request --> Create metadata task
-        LOGGER_WRITE( "ConML GetMetadataRequest" );
-        TPtrC filename = aFileName.Mid( KSCONGetMetadataRequest().Length() );
-        
-        TSConMethodName method ( EGetMetadata );
-        CSConTask* task = CSConTask::NewLC( method );
-        
-        if ( filename.Length() > task->iGetMetadataParams->iFilename.MaxLength() )
-            {
-            User::Leave( KErrTooBig );
-            }
-        task->iGetMetadataParams->iFilename = filename;
-        
-        ret = iPCDHandler->PutTaskL( task );
-        CleanupStack::Pop( task );
-        LOGGER_WRITE_1("iPCDHandler->PutTaskL ret: %d", ret);
-        }
-    else if ( aFileName.Length() > 0 )
-        {
-        LOGGER_WRITE("Error: aFilename does not match to any definitions");
-        TRACE_FUNC_RET( KErrArgument );
-        return KErrArgument;
-        }
-    
-	// Get reply
-    LOGGER_WRITE( "CSConPCConnSession::HandleGetMessageL() before ConML GetReplyL" );
-    CSConStatusReply* reply = iPCDHandler->GetReply();
-    CleanupStack::PushL( reply );
-    
-    ConML_ConMLPtr_t content = new ( ELeave ) ConML_ConML_t();
-    CleanupStack::PushL( content );
-    
-    AppendStatusL( content, reply );
-    ret = iConMLHandler->GenerateDocument( content );
-    
-    CleanupStack::PopAndDestroy( content );
-    CleanupStack::PopAndDestroy( reply );
-     
-    TPtrC8 ptr( iConMLHandler->WBXMLDocument() );
-    LOGGER_WRITE_1("ptr.Size(): %d", ptr.Size());
-    iBuffer->ResizeL( ptr.Size() );
-    iBuffer->Write( 0, ptr );
-
-#ifdef DEBUG_XML
-    RFile file;
-    if ( file.Open( iFs, KSConConMLDebugFile, EFileWrite) == KErrNone )
-        {
-        RFileWriteStream fws;   
-        TInt fileSize;
-        file.Size ( fileSize );
-        fws.Attach ( file, fileSize);
-        fws.PushL();
-        TTime now;
-        now.HomeTime();
-        TDateTime time = now.DateTime();
-        TBuf8<16> timeLine;
-        timeLine.Format( KTimeFormat, time.Hour(), time.Minute(), 
-                         time.Second(), time.MicroSecond() );
-
-        fws.WriteL( timeLine );
-        _LIT8( KGetMessage, "__________GET -MESSAGE" );
-        fws.WriteL( KGetMessage );
-        fws.WriteL(KXmlBegin);
-        fws.WriteL(iConMLHandler->XMLDocument().Ptr(), 
-                          iConMLHandler->XMLDocument().Length());
-        fws.WriteL(_L("\n\n"));
-        TRAP_IGNORE( fws.CommitL() );
-        fws.Close();
-        CleanupStack::PopAndDestroy( &fws );
-        }
-        
-    file.Close();
-#endif
-    TRACE_FUNC_RET(ret);
-    return ret;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::ReadOviAccountInfoL()
-// Reads ovi account information to stream
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::ReadOviAccountInfoL( RWriteStream& aAccountInfoStream )
-    {
-	TRACE_FUNC_ENTRY;
-    RLibrary oviaccounthandlerLib;
-    CleanupClosePushL( oviaccounthandlerLib );
-    // Dynamically load DLL
-    TInt err = oviaccounthandlerLib.Load( KSconOviAccountHandlerDllName );
-    if ( err )
-        {
-        LOGGER_WRITE_1("oviaccounthandlerLib.Load err: %d", err);
-        err = KErrNotSupported;
-        }
-    else if( oviaccounthandlerLib.Type()[1] != KSconOviAccountHandlerDllUid )
-        {
-        LOGGER_WRITE_1( "KSconOviAccountHandlerDllUid incorrect... (0x%08X)",oviaccounthandlerLib.Type()[1].iUid  );
-        err = KErrNotSupported;
-        }
-    
-    if ( err == KErrNone )
-        {
-        TSConCreateCSconOviAccountHandlerFunc CreateCSconOviAccountHandlerL =
-        (TSConCreateCSconOviAccountHandlerFunc)oviaccounthandlerLib.Lookup(1);
-        
-        CSconOviAccountHandler* oviAccountHandler = (CSconOviAccountHandler*)CreateCSconOviAccountHandlerL();
-        
-        TRAP(err, oviAccountHandler->GetOviAccountDetailsL( aAccountInfoStream ) );
-        LOGGER_WRITE_1("GetOviAccountDetailsL err: %d", err);
-        
-        delete oviAccountHandler;
-        oviAccountHandler = NULL;
-        
-        if ( err )
-            {
-            // change error code
-            err = KErrNotFound;
-            }
-        }
-    else
-        {
-        err = KErrNotSupported;
-        }
-	
-    CleanupStack::PopAndDestroy( &oviaccounthandlerLib );
-	TRACE_FUNC_EXIT;
-    return err;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::HandleResetMessage()
-// Resets the PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::HandleResetMessage()   
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    
-    // reset PCD
-    if ( iPCDHandler )
-        {
-        iPCDHandler->ResetPCD();
-        }
-        
-    LOGGER_WRITE_1( "CSConPCConnSession::HandleResetMessage() : ret %d", ret );
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::HandleChunkMessage( const RMessage2& aMessage )
-// Receives the chunk handle from the client
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::HandleChunkMessage( const RMessage2& aMessage )    
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    
-    ret = iChunk.Open( aMessage, 0, EFalse );
-        
-    LOGGER_WRITE_1( "CSConPCConnSession::HandleChunkMessageL() : ret %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::LoadPCDDllL()
-// Loads the PCCS service
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::LoadPCDDllL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Dynamically load DLL
-    User::LeaveIfError( iPCDlib.Load( KSConPCDLibName ) );
-    if( iPCDlib.Type()[1] != KSConPCDUid )
-        {
-        LOGGER_WRITE( "CSConPCConnSession::LoadPCDDllL() : KSConPCDUidValue incorrect..." );
-        iPCDlib.Close();
-        User::Leave( KErrNotFound );
-        }   
-    TSConCreateCSConPCDFunc CreateCSConPCDL =
-    (TSConCreateCSConPCDFunc)iPCDlib.Lookup(1);
-    
-    iPCDHandler = (CSConPCD*)CreateCSConPCDL();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::LoadCSCDllL()
-// Loads the CSC service
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::LoadCSCDllL()
-    {
-    TRACE_FUNC_ENTRY;
-    // Dynamically load DLL
-    User::LeaveIfError( iCSClib.Load( KSConCSCLibName ) );
-    if( iCSClib.Type()[1] != KSConCSCUid )
-        {
-        LOGGER_WRITE( "CSConPCConnSession::LoadCSCDllL() : KSConCSCUidValue incorrect" );
-        iCSClib.Close();
-        User::Leave( KErrNotFound );
-        }   
-    TSConCreateCSConCSCFunc CreateCSConCSCL = 
-    (TSConCreateCSConCSCFunc)iCSClib.Lookup(1);
-    
-    iCSCHandler = (CSConCSC*)CreateCSConCSCL();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::LoadConMLHandlerDllL()
-// Loads the ConML handler
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::LoadConMLHandlerDllL()
-    {
-    TRACE_FUNC_ENTRY;
-    // Dynamically load DLL
-    User::LeaveIfError( iConMLHandlerLib.Load( KSConConMLHandlerLibName ) );
-    if ( iConMLHandlerLib.Type()[1] != KSConConMLHandlerUid )
-        {
-        LOGGER_WRITE( "CSConPCConnSession::LoadConMLHandlerDllL() : KSConConMLHandlerUidValue incorrect" );
-        iConMLHandlerLib.Close();
-        User::Leave( KErrNotFound );
-        }
-    TSConCreateCSConConMLHandlerFunc CreateCSConConMLHandlerL = 
-    (TSConCreateCSConConMLHandlerFunc)iConMLHandlerLib.Lookup(1);
-    
-    iConMLHandler = (CSConConMLHandler*)CreateCSConConMLHandlerL();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::ConMLL()
-// Callback function for ConML handler - parsed data processing starts
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::ConMLL( ConML_ConMLPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    
-#ifdef DEBUG_XML
-    iConMLHandler->GenerateDocument( aContent );
-    RFile file;
-    if ( file.Open(iFs, KSConConMLDebugFile, EFileWrite) == KErrNone )
-        {
-        RFileWriteStream fws;
-        TInt fileSize;
-        file.Size( fileSize );
-        fws.Attach ( file, fileSize );
-        fws.PushL();
-        
-        TTime now;
-        now.HomeTime();
-        TDateTime time = now.DateTime();
-        TBuf8<16> timeLine;
-        timeLine.Format (KTimeFormat, time.Hour(), time.Minute(), 
-                                    time.Second(), time.MicroSecond() );
-        
-        fws.WriteL( timeLine );
-        _LIT8( KPutMessage, "__________PUT-MESSAGE" );
-        fws.WriteL( KPutMessage );
-        fws.WriteL( KXmlBegin );
-        fws.WriteL( iConMLHandler->XMLDocument().Ptr(), 
-                    iConMLHandler->XMLDocument().Length());
-        fws.WriteL(_L("\n\n"));
-        TRAP_IGNORE( fws.CommitL() );
-        fws.Close();
-        CleanupStack::PopAndDestroy( &fws );
-        }
-    file.Close();
-    
-#endif
-
-
-    if ( aContent )
-        {
-        if ( aContent->execute )
-            {
-            ret = OptionsFromExecuteL( aContent->execute );
-            }
-        else if ( aContent->cancel )
-            {
-            ret = TaskCancelL( aContent->cancel );
-            }
-        else if ( aContent->getStatus )
-            {
-            ret = TaskGetStatusL ( aContent->getStatus );
-            }
-        else 
-            {
-            LOGGER_WRITE( "CSConPCConnSession::ConML() : No appropriate content in ConML -element " );
-            ret = KErrArgument;
-            }
-        }
-    else 
-        {
-        ret  = KErrArgument;
-        }
-    
-    // store result for later use
-    iResult = ret;
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::OptionsFromExecuteL()
-// Handles data of an execute -element
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::OptionsFromExecuteL(ConML_ExecutePtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TInt ret ( KErrNone );
-    if ( aContent->updateDeviceInfo )
-        {
-        ret = TaskUpdateDeviceInfoL( aContent->updateDeviceInfo);
-        }
-    else if ( aContent->listInstalledApps )
-        {
-        ret = TaskListInstalledAppsL( aContent->listInstalledApps);
-        }
-    else if ( aContent->install )
-        {
-        ret = TaskInstallL( aContent->install );
-        }       
-    else if ( aContent->unInstall )
-        {
-        ret = TaskUnInstallL( aContent->unInstall );
-        }
-    else if ( aContent->listDataOwners )
-        {
-        ret = TaskListDataOwnersL();
-        }
-    else if ( aContent->setBurMode )    
-        {
-        ret = TaskSetBURModeL( aContent->setBurMode );
-        }
-    else if ( aContent->getDataSize )
-        {
-        ret = TaskGetDataSizeL( aContent->getDataSize );
-        }
-    else if ( aContent->requestData )
-        {
-        ret = TaskRequestDataL( aContent->requestData );
-        }
-    else if ( aContent->listPublicFiles )
-        {
-        ret = TaskListPublicFilesL( aContent->listPublicFiles );
-        }
-    else if ( aContent->reboot )
-        {
-        ret = TaskRebootL();
-        }
-    else if ( aContent->getDataOwnerStatus )
-        {
-        ret = TaskGetDataOwnerStatusL( aContent->getDataOwnerStatus );      
-        }
-    else if ( aContent->supplyData )
-        {
-        ret = TaskSupplyDataL( aContent->supplyData );
-        }
-    else if ( aContent->getMetadata )
-        {
-        ret = TaskGetMetadataL( aContent->getMetadata );
-        }
-    else 
-        {
-        LOGGER_WRITE( "CSConPCConnSession::OptionsFromExecute() : No content " );
-        ret = KErrNotSupported;
-        }
-    LOGGER_WRITE_1( "CSConPCConnSession::OptionsFromExecute() : returned %d", ret );    
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskCancelL(ConML_CancelPtr_t aContent)
-// Sends a Cancel -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskCancelL( ConML_CancelPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( ECancel );
-    CSConTask* task = CSConTask::NewLC( method );
-    if ( aContent->all )
-        {
-        task->iCancelTaskAll = ETrue;
-        }
-    if ( aContent->id )
-        {
-        task->iCancelTaskId = ( DesToInt( aContent->id->Data() ));
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskCancelL() : returned %d", ret );    
-    return ret;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskGetStatusL()
-// Sends a Get Status -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskGetStatusL( ConML_GetStatusPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( EGetStatus );
-    CSConTask* task = CSConTask::NewLC( method );
-    if ( aContent->all )
-        {
-        task->iGetStatusParams->iAll = ETrue;
-        }
-    if ( aContent->id)
-        {
-        task->iGetStatusParams->iTaskId = ( DesToInt( aContent->id->Data() ));
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskGetStatusL() : returned %d", ret );    
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskInstallL()
-// Sends an Install -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskInstallL( ConML_InstallPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( EInstall );
-    CSConTask* task = CSConTask::NewLC( method);
-    task->iInstallParams->iMode = EUnknown;
-    if ( aContent->name )
-        {
-        // Unicode conversion from 8-bit to 16-bit
-        CnvUtfConverter::ConvertToUnicodeFromUtf8(task->iInstallParams->iPath, 
-                                                    aContent->name->Data());    
-        }
-    if ( aContent->instParams )
-        {
-        if ( aContent->instParams->param )
-            {
-            for ( ConML_ParamListPtr_t p = aContent->instParams->param; 
-                  p && p->data; p = p->next)
-                {
-                LOGGER_WRITE( "CSConPCConnSession::TaskInstallL() : Parameters found " );
-                if ( p->data->name )
-                    {
-                    LOGGER_WRITE( "CSConPCConnSession::TaskInstallL() : name param found " );
-                    TPtrC8 silent(KParamNameSilent);
-                    
-                    TInt comp = Mem::Compare((TUint8*)p->data->name->content, (TInt)p->data->name->length, silent.Ptr(), silent.Length());
-                    if( comp == 0)
-                        {
-                        // "Silent"-param found
-                        LOGGER_WRITE( "CSConPCConnSession::TaskInstallL() : Silent-param found " );
-                        if ( p->data->value )
-                            {
-                            TPtrC8 dataValue((TUint8*)p->data->value->content, (TInt)p->data->value->length);
-                            TInt value = DesToInt( dataValue );
-                            if (value == 1)
-                                {
-                                LOGGER_WRITE( "CSConPCConnSession::TaskInstallL() : ESilentInstall " );
-                                task->iInstallParams->iMode = ESilentInstall;
-                                }
-                            else if( value == 0 )
-                                {
-                                LOGGER_WRITE( "CSConPCConnSession::TaskInstallL() : EUnsilentInstall " );
-                                task->iInstallParams->iMode = EUnsilentInstall;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskInstallL() : returned %d", ret );    
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskUnInstallL()
-// Sends an Uninstall -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskUnInstallL( ConML_UnInstallPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( EUninstall );
-    CSConTask* task = CSConTask::NewLC( method );
-    task->iUninstallParams->iMode = EUnknown;
-    
-    if ( aContent->applications->application)       
-        {
-        for ( ConML_ApplicationListPtr_t p = 
-              aContent->applications->application; p && p->data; p = p->next )
-            {
-            if ( p->data )
-                {
-                if ( p->data->name )
-                    {
-                    // get application name
-                    HBufC* nameBuf = CnvUtfConverter::ConvertToUnicodeFromUtf8L( p->data->name->Data() );
-                    task->iUninstallParams->iName.Copy( nameBuf->Des() );
-                    delete nameBuf;
-                    nameBuf = NULL;
-                    }
-                if ( p->data->uid )
-                    {
-                    // parse uid:  UID # Type # Size # Version # Vendor # Parent app. name #
-                    // only UID and Vendor are needed from whole uid-field.
-                    LOGGER_WRITE( "CSConPCConnSession::TaskUnInstallL() : start parsing uid " );
-                    
-                    TPtrC8 buf( p->data->uid->Data() );
-                    
-                    RArray<TPtrC8> arr(6);
-                    CleanupClosePushL( arr );
-                    TBuf8<1> separator(KSConAppInfoSeparator);
-                    
-                    SplitL(buf, separator[0], arr);
-                    if ( arr.Count() >= 5 )
-                    	{
-                    	task->iUninstallParams->iUid = DesToUid( arr[0] );
-                    	task->iUninstallParams->iType = (TSConAppType)DesToInt( arr[1] );
-                    	HBufC* vendorBuf = CnvUtfConverter::ConvertToUnicodeFromUtf8L( arr[4] );
-                    	task->iUninstallParams->iVendor.Copy( vendorBuf->Des() );
-                    	delete vendorBuf;
-                    	vendorBuf = NULL;
-                    	}
-                    CleanupStack::PopAndDestroy( &arr );
-                    
-                        
-                    } // endif p->data->uid
-                }
-            }
-        }
-    
-    if ( aContent->instParams)
-        {
-        if ( aContent->instParams->param )
-            {
-            for ( ConML_ParamListPtr_t p = aContent->instParams->param; 
-                    p && p->data; p = p->next )
-                {
-                LOGGER_WRITE( "CSConPCConnSession::TaskUnInstallL() : Parameters found " );
-                if ( p->data->name )
-                    {
-                    LOGGER_WRITE( "CSConPCConnSession::TaskUnInstallL() : name param found " );
-                    TPtrC8 silent(KParamNameSilent);
-                    
-                    TInt comp = Mem::Compare((TUint8*)p->data->name->content, (TInt)p->data->name->length, silent.Ptr(), silent.Length());
-                    if( comp == 0)
-                        {
-                        // "Silent"-param found
-                        LOGGER_WRITE( "CSConPCConnSession::TaskUnInstallL() : Silent-param found " );
-                        if ( p->data->value )
-                            {
-                            TPtrC8 dataValue((TUint8*)p->data->value->content, (TInt)p->data->value->length);
-                            TInt value = DesToInt( dataValue );
-                            if ( value == 1 )
-                                {
-                                LOGGER_WRITE( "CSConPCConnSession::TaskUnInstallL() : ESilentInstall " );
-                                task->iUninstallParams->iMode = ESilentInstall;
-                                }
-                            else if ( value == 0 )
-                                {
-                                LOGGER_WRITE( "CSConPCConnSession::TaskUnInstallL() : EUnsilentInstall " );
-                                task->iUninstallParams->iMode = EUnsilentInstall;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskUnInstallL() : returned %d", ret );    
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::SplitL(const TDesC& aText, const TChar aSeparator, 
-// RArray<TPtrC>& aArray)
-// Function splits string (eg "name1, name2, name3") into substrings.
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::SplitL(const TDesC8& aText, const TChar aSeparator, 
-                    RArray<TPtrC8>& aArray)
-    {
-    TRACE_FUNC_ENTRY;
-    TPtrC8 ptr;
-    ptr.Set(aText);
-
-    for (;;)
-        {
-        TInt pos=ptr.Locate(aSeparator);
-        if (pos==KErrNotFound)
-            {
-            aArray.AppendL(ptr);
-            break;
-            }
-
-        TPtrC8 subStr=ptr.Left(pos); // get pos characters starting from position 0
-        aArray.AppendL(subStr);
-
-        if (!(ptr.Length()>pos+1))
-            {
-            break;
-            }
-            
-        ptr.Set(ptr.Mid(pos+1));// get all characters starting from position pos+1
-        }
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskListInstalledAppsL()
-// Sends a List installed apps -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskListInstalledAppsL(
-    ConML_ListInstalledAppsPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( EListInstalledApps );
-    CSConTask* task = CSConTask::NewLC( method );
-    if( aContent-> drives )
-        {
-        task->iListAppsParams->iDriveList = DriveList( aContent->drives->drive);
-        }
-    if ( aContent->all )
-        {
-        task->iListAppsParams->iAllApps = ETrue;
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskListInstalledAppsL() : returned %d", ret);
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskListDataOwnersL()
-// Sends a List data owners -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskListDataOwnersL()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( EListDataOwners );
-    CSConTask* task = CSConTask::NewLC( method );
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskListDataOwnersL() : returned %d", ret );    
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskSetBURModeL()
-// Sends a Set BUR mode -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskSetBURModeL(ConML_SetBURModePtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( ESetBURMode );
-    CSConTask* task = CSConTask::NewLC( method );
-    if ( aContent->drives )
-        {
-        task->iBURModeParams->iDriveList = DriveList( aContent->drives->drive);
-        }
-    if ( aContent->partialType )
-        {
-        TInt intValue = DesToInt( aContent->partialType->Data() );
-        task->iBURModeParams->iPartialType = static_cast<TSConBurMode> (intValue) ;
-        }
-    if ( aContent->incType )
-        {
-        TInt intValue = DesToInt( aContent->incType->Data() );
-        task->iBURModeParams->iIncType = static_cast<TSConIncType> (intValue) ;
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskSetBURModeL() : returned %d", ret );    
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskGetDataSizeL()
-// Sends a Get data size -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskGetDataSizeL(ConML_GetDataSizePtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( EGetDataSize );
-    CSConTask* task = CSConTask::NewLC( method );
-    if ( aContent->dataOwners )
-        {
-        for ( ConML_SIDListPtr_t p = aContent->dataOwners->sid; 
-                p && p->data; p=p->next )
-            {
-            CSConDataOwner* dataOwner = new (ELeave) CSConDataOwner();
-            CleanupStack::PushL( dataOwner );
-            if ( p->data->type )
-                {
-                dataOwner->iType = TSConDOType (DesToInt( 
-                    p->data->type->Data() ));
-                }
-            if (p->data->uid )
-                {
-                if( !IsJavaHash( p->data->uid->Data() ) )
-                    {
-                    dataOwner->iUid = DesToUid( p->data->uid->Data() );
-                    }
-                else
-                    {
-                    TPtr hashPtr = DesToHashLC( p->data->uid->Data() );
-                    dataOwner->iJavaHash = HBufC::NewL( hashPtr.Size() );
-                    dataOwner->iJavaHash->Des().Copy( hashPtr );
-                    CleanupStack::PopAndDestroy(); //DesToHashLC()
-                    }
-                }
-            if ( p->data->drives )
-                {
-                dataOwner->iDriveList = DriveList ( p->data->drives->drive );
-                }
-            if ( p->data->transferDataType )
-                {
-                TInt intValue = DesToInt( p->data->transferDataType->Data() );
-                dataOwner->iTransDataType = static_cast<TSConTransferDataType> (intValue);
-                }
-            task->iGetDataSizeParams->iDataOwners.AppendL( dataOwner );
-            CleanupStack::Pop( dataOwner );
-            }
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskGetDataSizeL() : returned %d", ret );    
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskRequestDataL()
-// Sends a Request data -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskRequestDataL(ConML_RequestDataPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( ERequestData );
-    CSConTask* task = CSConTask::NewLC( method );
-    if ( aContent )
-        {
-        if ( aContent->sid )
-            {
-            for ( ConML_SIDListPtr_t p=aContent->sid; p && p->data; p=p->next )
-                {
-                if ( p->data->type )
-                    {
-                    task->iRequestDataParams->iDataOwner->iType = 
-                    TSConDOType ( DesToInt ( p->data->type->Data() ) );
-                    }
-                if ( p->data->uid )
-                    {
-                    if( !IsJavaHash( p->data->uid->Data() ) )
-                        {
-                        task->iRequestDataParams->iDataOwner->iUid = DesToUid(
-                                                     p->data->uid->Data() );
-                        }
-                    else
-                        {
-                        TPtr hashPtr = DesToHashLC( p->data->uid->Data() );
-                        task->iRequestDataParams->iDataOwner->iJavaHash = HBufC::NewL( hashPtr.Size() );
-                        task->iRequestDataParams->iDataOwner->iJavaHash->Des().Copy( hashPtr );
-                        CleanupStack::PopAndDestroy(); //DesToHashLC()
-                        }                                 
-                    }
-                if ( p->data->drives )
-                    {
-                    task->iRequestDataParams->iDataOwner->iDriveList = 
-                    DriveList ( p->data->drives->drive );
-                    }
-                if ( p->data->transferDataType )
-                    {
-                    TInt intValue = DesToInt( p->data->transferDataType->Data() );
-                    task->iRequestDataParams->iDataOwner->iTransDataType =
-                        static_cast<TSConTransferDataType> (intValue);
-                    }
-                }
-            }
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskRequestDataL() : returned %d", ret );    
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskUpdateDeviceInfoL()
-// Sends a Update device info -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskUpdateDeviceInfoL(
-    ConML_UpdateDeviceInfoPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( EUpdateDeviceInfo );
-    CSConTask* task = CSConTask::NewLC( method );
-
-    if ( aContent->deviceInfo)
-        {
-        ConML_DeviceInfoPtr_t dPtr = aContent->deviceInfo;
-        if ( dPtr->version )
-            {
-            task->iDevInfoParams->iVersion.Copy( dPtr->version->Data());
-            }
-        if ( dPtr->maxObjectSize )
-            {
-            task->iDevInfoParams->iMaxObjectSize = DesToInt(
-                                            dPtr->maxObjectSize->Data());
-            }
-        if ( dPtr->supportedMethods )
-            {
-            ConML_SupportedMethodsPtr_t smPtr = dPtr->supportedMethods;
-            if ( smPtr->install )
-                {
-                task->iDevInfoParams->iInstallSupp = ETrue; 
-                }
-            if ( smPtr->unInstall )
-                {
-                task->iDevInfoParams->iUninstallSupp = ETrue;
-                }
-            if ( smPtr->listInstalledApps )
-                {
-                task->iDevInfoParams->iInstAppsSupp = ETrue;
-                }
-            if ( smPtr->listDataOwners )
-                {
-                task->iDevInfoParams->iDataOwnersSupp = ETrue;
-                }
-            if ( smPtr->setBurMode )
-                {
-                task->iDevInfoParams->iSetBURModeSupp = ETrue;
-                }
-            if ( smPtr->getDataSize )
-                {
-                task->iDevInfoParams->iGetSizeSupp = ETrue;
-                }
-            if ( smPtr->requestData )
-                {
-                task->iDevInfoParams->iReqDataSupp = ETrue;
-                }
-            if ( smPtr->supplyData )
-                {
-                task->iDevInfoParams->iSupplyDataSupp = ETrue;  
-                }
-            if ( smPtr->reboot )
-                {
-                task->iDevInfoParams->iRebootSupp = ETrue;
-                }
-            }
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskUpdateDeviceInfoL() : returned %d", ret );    
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskListPublicFilesL()
-// Sends a List public files -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskListPublicFilesL(
-    ConML_ListPublicFilesPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( EListPublicFiles );
-    CSConTask* task = CSConTask::NewLC( method );
-    if ( aContent->sid )
-        {
-        for ( ConML_SIDListPtr_t p = aContent->sid; p && p->data; p = p->next )
-            {
-            CSConDataOwner* dataOwner = new (ELeave) CSConDataOwner();
-            CleanupStack::PushL( dataOwner );
-            if ( p->data->type )                
-                {
-                dataOwner->iType = TSConDOType ( DesToInt( 
-                                        p->data->type->Data() ) );
-                }
-            if ( p->data->uid )
-                {
-                if( !IsJavaHash( p->data->uid->Data() ) )
-                    {
-                    dataOwner->iUid = DesToUid( p->data->uid->Data() );
-                    }
-                else
-                    {
-                    TPtr hashPtr = DesToHashLC( p->data->uid->Data() );
-                    dataOwner->iJavaHash = HBufC::NewL( hashPtr.Size() );
-                    dataOwner->iJavaHash->Des().Copy( hashPtr );
-                    CleanupStack::PopAndDestroy(); //DesToHashLC()
-                    }
-                }
-            if ( p->data->drives )
-                {
-                dataOwner->iDriveList = DriveList ( p->data->drives->drive );
-                }
-            if ( p->data->packageInfo && p->data->packageInfo->name )
-                {
-                // Unicode conversion from 8-bit to 16-bit
-                CnvUtfConverter::ConvertToUnicodeFromUtf8(
-                        dataOwner->iPackageName, 
-                        p->data->packageInfo->name->Data());
-                }
-            task->iPubFilesParams->iDataOwners.AppendL( dataOwner );
-            CleanupStack::Pop( dataOwner );
-            }
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskListPublicFilesL() : returned %d", ret );    
-    return ret;
-    }
-        
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskSupplyDataL()
-// Sends a Supply data -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskSupplyDataL ( ConML_SupplyDataPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( ESupplyData );
-    CSConTask* task = CSConTask::NewLC( method );
-    if (aContent )
-        {
-        for ( ConML_SIDListPtr_t p = aContent->sid; p && p->data; p = p->next )
-            {
-            if ( p->data->type )
-                {
-                task->iSupplyDataParams->iDataOwner->iType = 
-                TSConDOType ( DesToInt( p->data->type->Data() ) );
-                }
-            if ( p->data->uid )
-                {
-                if( !IsJavaHash( p->data->uid->Data() ) )
-                    {
-                    task->iSupplyDataParams->iDataOwner->iUid = DesToUid( 
-                                                p->data->uid->Data() );
-                    }
-                else
-                    {
-                    TPtr hashPtr = DesToHashLC( p->data->uid->Data() );
-                    task->iSupplyDataParams->iDataOwner->iJavaHash = HBufC::NewL( hashPtr.Size() );
-                    task->iSupplyDataParams->iDataOwner->iJavaHash->Des().Copy( hashPtr );
-                    CleanupStack::PopAndDestroy(); //DesToHashLC()
-                    }
-                }
-            if ( p->data->drives )
-                {
-                task->iSupplyDataParams->iDataOwner->iDriveList = 
-                DriveList ( p->data->drives->drive );
-                }
-            if ( p->data->transferDataType )
-                {
-                TInt intValue = DesToInt ( p->data->transferDataType->Data() );
-                task->iSupplyDataParams->iDataOwner->iTransDataType =
-                    static_cast<TSConTransferDataType> (intValue);
-                }
-            if ( p->data->data )
-                {
-                task->iSupplyDataParams->iRestoreData = HBufC8::NewL(
-                                            p->data->data->Data().Size() );
-                *task->iSupplyDataParams->iRestoreData = p->data->data->Data();
-                }
-            if ( p->data->moreData )
-                {
-                task->iSupplyDataParams->iMoreData = ETrue;
-                }
-            else
-                {
-                task->iSupplyDataParams->iMoreData = EFalse;
-                }
-            }
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskSupplyDataL() : returned %d", ret );    
-    return ret;
-}
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskGetDataOwnerStatusL()
-// Sends a Get data owner status -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskGetDataOwnerStatusL
-    ( ConML_GetDataOwnerStatusPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( EGetDataOwnerStatus );
-    CSConTask* task = CSConTask::NewLC( method );
-
-    if ( aContent->dataOwners )
-        {
-        for ( ConML_SIDListPtr_t p = aContent->dataOwners->sid; 
-                p && p->data; p=p->next )
-            {
-            CSConDataOwner* dataOwner = new (ELeave) CSConDataOwner();
-            CleanupStack::PushL( dataOwner );
-            if ( p->data->type )    
-                {
-                dataOwner->iType = TSConDOType (DesToInt(
-                                     p->data->type->Data() ));
-                }
-            if ( p->data->uid )             
-                {
-                if( !IsJavaHash( p->data->uid->Data() ) )
-                    {
-                    dataOwner->iUid = DesToUid( p->data->uid->Data() );
-                    }
-                else
-                    {
-                    TPtr hashPtr = DesToHashLC( p->data->uid->Data() );
-                    dataOwner->iJavaHash = HBufC::NewL( hashPtr.Size() );
-                    dataOwner->iJavaHash->Des().Copy( hashPtr );
-                    CleanupStack::PopAndDestroy(); //DesToHashLC()
-                    }
-                }           
-            task->iGetDataOwnerParams->iDataOwners.AppendL( dataOwner );
-            CleanupStack::Pop( dataOwner );
-            }
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskGetDataOwnerStatusL() : returned %d", ret );    
-    return ret; 
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskRebootL()
-// Sends a Reboot -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskRebootL( )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( EReboot );
-    CSConTask* task = CSConTask::NewLC( method );
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskRebootL() : returned %d", ret );    
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskGetMetadataL()
-// Sends a GetMetadata -task to PCCS service
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::TaskGetMetadataL( ConML_GetMetadataPtr_t aContent )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    TSConMethodName method ( EGetMetadata );
-    CSConTask* task = CSConTask::NewLC( method );
-    if( aContent )
-        {
-        if ( aContent->filename )
-            {
-            // Unicode conversion from 8-bit to 16-bit
-            CnvUtfConverter::ConvertToUnicodeFromUtf8(task->iGetMetadataParams->iFilename, 
-                                                        aContent->filename->Data());    
-            }
-        }
-    ret = iPCDHandler->PutTaskL( task );
-    CleanupStack::Pop( task );
-    LOGGER_WRITE_1( "CSConPCConnSession::TaskGetMetadataL() : returned %d", ret );    
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::TaskRebootL()
-// Appends a status element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendStatusL( 
-    ConML_ConMLPtr_t aContent, CSConStatusReply* reply )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    if ( !reply )
-        {
-        LOGGER_WRITE( "CSConPCConnSession::AppendStatus() : No data in reply!" );
-        return;
-        }
-    aContent->status = new ( ELeave ) ConML_Status_t();
-        
-    if ( reply->iTasks.Count() > 0 ) 
-        {
-        for ( TInt i=0; i < reply->iTasks.Count(); i ++)
-            {
-            ConML_TaskListPtr_t task = new ( ELeave ) ConML_TaskList_t();
-            CleanupStack::PushL( task );
-            GenericListAddL ( &aContent->status->task, task );
-            CleanupStack::Pop(); // task
-            
-            task->data = new ( ELeave ) ConML_Task_t();
-            task->data->id = new ( ELeave ) pcdata_t();
-            task->data->id->SetDataL ( IntToDesLC(reply->iTasks[i]->iTaskId) );
-            CleanupStack::PopAndDestroy(); // IntToDesLC 
-            TSConMethodName method ( reply->iTasks[i]->iMethod );
-            
-            switch ( method )
-                {
-                case EUpdateDeviceInfo:
-                    task->data->updateDeviceInfo = 
-                        new ( ELeave ) ConML_UpdateDeviceInfo_t();
-                    task->data->updateDeviceInfo->results = 
-                        new ( ELeave ) ConML_Results_t();
-                    AppendUpdateDeviceInfoResultsL( 
-                        task->data->updateDeviceInfo->results,
-                        reply->iTasks[i]->iDevInfoParams );
-                    break;
-                
-                case ESetBURMode:
-                    task->data->setBurMode = 
-                        new ( ELeave ) ConML_SetBURMode_t();
-                    task->data->setBurMode->results = 
-                        new ( ELeave) ConML_Results_t();
-                    AppendSetBURModeResultsL( 
-                        task->data->setBurMode->results,
-                        reply->iTasks[i]->iBURModeParams );
-                    break;
-            
-                case EListInstalledApps:
-                    task->data->listInstalledApps = 
-                        new ( ELeave ) ConML_ListInstalledApps_t();
-                    task->data->listInstalledApps->results = 
-                        new ( ELeave ) ConML_Results_t();
-                    AppendListInstalledAppsResultsL( 
-                        task->data->listInstalledApps->results,
-                        reply->iTasks[i]->iListAppsParams);
-                    break;
-                
-                case EInstall:
-                    task->data->install = new ( ELeave ) ConML_Install_t();
-                    task->data->install->results = 
-                        new ( ELeave ) ConML_Results_t();
-                    AppendInstallResultsL( 
-                        task->data->install->results, 
-                        reply->iTasks[i]->iInstallParams );
-                    break;
-            
-                case EUninstall:
-                    task->data->unInstall = new ( ELeave ) ConML_UnInstall_t();
-                    task->data->unInstall->results = 
-                        new ( ELeave ) ConML_Results_t();
-                    AppendUninstallResultsL(
-                        task->data->unInstall->results, 
-                        reply->iTasks[i]->iUninstallParams );
-                    break;
-                
-                case EListDataOwners:
-                    task->data->listDataOwners = 
-                        new ( ELeave ) ConML_ListDataOwners_t();
-                    task->data->listDataOwners->results = 
-                        new ( ELeave ) ConML_Results_t();
-                    AppendListDataOwnersResultsL( 
-                        task->data->listDataOwners->results, 
-                        reply->iTasks[i]->iListDataOwnersParams );
-                    break;
-                
-                case EGetDataOwnerStatus:
-                    task->data->getDataOwnerStatus = 
-                        new ( ELeave ) ConML_GetDataOwnerStatus_t();
-                    task->data->getDataOwnerStatus->results = 
-                        new ( ELeave ) ConML_Results_t();
-                    AppendGetDataOwnerStatusResultsL( 
-                        task->data->getDataOwnerStatus->results,
-                        reply->iTasks[i]->iGetDataOwnerParams);
-                    break;
-                
-                case EGetDataSize:
-                    task->data->getDataSize = 
-                        new ( ELeave ) ConML_GetDataSize_t();
-                    task->data->getDataSize->results = 
-                        new ( ELeave ) ConML_Results_t();
-                    AppendGetDataSizeResultsL( 
-                        task->data->getDataSize->results,
-                        reply->iTasks[i]->iGetDataSizeParams );
-                    break;
-                                
-                case EListPublicFiles:
-                    task->data->listPublicFiles = 
-                        new ( ELeave ) ConML_ListPublicFiles_t();
-                    task->data->listPublicFiles->results = 
-                        new ( ELeave ) ConML_Results_t();
-                    AppendListPublicFilesResultsL ( 
-                        task->data->listPublicFiles->results,
-                        reply->iTasks[i]->iPubFilesParams );
-                    break;
-            
-                case ERequestData:
-                    task->data->requestData = 
-                        new ( ELeave ) ConML_RequestData_t();
-                    task->data->requestData->results = 
-                        new ( ELeave ) ConML_Results_t();
-                    AppendRequestDataResultsL( 
-                        task->data->requestData->results, 
-                        reply->iTasks[i]->iRequestDataParams );
-                    break;
-                
-                case ESupplyData:
-                    task->data->supplyData = 
-                        new ( ELeave ) ConML_SupplyData_t();
-                    task->data->supplyData->results = 
-                        new ( ELeave ) ConML_Results_t();
-                    AppendSupplyDataResultsL ( 
-                        task->data->supplyData->results, 
-                        reply->iTasks[i]->iSupplyDataParams );
-                    break;
-                
-                case EGetMetadata:
-                    task->data->getMetadata = 
-                        new ( ELeave ) ConML_GetMetadata_t();
-                    task->data->getMetadata->results = 
-                        new ( ELeave ) ConML_Results_t();
-                    AppendGetMetadataResultsL ( 
-                        task->data->getMetadata->results, 
-                        reply->iTasks[i]->iGetMetadataParams );
-                    break;
-                    
-                default:
-                    LOGGER_WRITE_1( "CSConPCConnSession:: AppendStatus() : Unknown method  %d ", method );
-                    break;
-                }
-            }
-        }
-    else
-        {
-        LOGGER_WRITE( "CSConPCConnSession::AppendStatus() : No Task " );     
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendUpdateDeviceInfoResultsL()
-// Appends a update device info -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendUpdateDeviceInfoResultsL 
-    ( ConML_ResultsPtr_t aContent, CSConUpdateDeviceInfo* aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aResult )  
-        {
-        if ( aResult->iComplete )
-            {
-            aContent->complete = new ( ELeave ) pcdata_t();
-            }
-        AppendProgressL ( aContent, aResult->iProgress );
-    
-        aContent->deviceInfo = new ( ELeave ) ConML_DeviceInfo_t();
-        aContent->deviceInfo->version = new ( ELeave ) pcdata_t();
-        aContent->deviceInfo->version->SetDataL ( aResult->iVersion );
-
-        aContent->deviceInfo->supportedMethods = 
-            new ( ELeave ) ConML_SupportedMethods_t();
-            
-        if ( aResult->iInstallSupp )
-            {
-            aContent->deviceInfo->supportedMethods->install = 
-                new ( ELeave ) pcdata_t();
-            }
-        if ( aResult->iUninstallSupp )
-            {
-            aContent->deviceInfo->supportedMethods->unInstall = 
-                new ( ELeave ) pcdata_t();
-            }
-        if ( aResult->iInstAppsSupp )
-            {
-            aContent->deviceInfo->supportedMethods->listInstalledApps = 
-                new ( ELeave ) pcdata_t();
-            }
-        if ( aResult->iDataOwnersSupp )
-            {
-            aContent->deviceInfo->supportedMethods->listDataOwners = 
-                new ( ELeave ) pcdata_t();
-            }
-        if ( aResult->iSetBURModeSupp )
-            {
-            aContent->deviceInfo->supportedMethods->setBurMode = 
-                new ( ELeave ) pcdata_t();
-            }
-        if ( aResult->iGetSizeSupp )
-            {
-            aContent->deviceInfo->supportedMethods->getDataSize = 
-                new ( ELeave ) pcdata_t();
-            }
-        if ( aResult->iReqDataSupp )
-            {
-            aContent->deviceInfo->supportedMethods->requestData = 
-                new (ELeave ) pcdata_t();
-            }
-        if ( aResult->iSupplyDataSupp )
-            {
-            aContent->deviceInfo->supportedMethods->supplyData = 
-                new ( ELeave ) pcdata_t();
-            }
-        if ( aResult->iRebootSupp )
-            {
-            aContent->deviceInfo->supportedMethods->reboot = 
-                new ( ELeave ) pcdata_t();
-            }
-        aContent->deviceInfo->maxObjectSize = new ( ELeave ) pcdata_t();
-        aContent->deviceInfo->maxObjectSize->SetDataL ( IntToDesLC(
-            aResult->iMaxObjectSize ));
-        CleanupStack::PopAndDestroy(); // IntToDesLC
-        }
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendSetBURModeResultsL()
-// Appends a Set BUR mode -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendSetBURModeResultsL (
-    ConML_ResultsPtr_t aContent, CSConSetBURMode* aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aResult )
-        {
-        if ( aResult->iComplete )
-            {
-            aContent->complete = new ( ELeave ) pcdata_t();
-            }
-        AppendProgressL ( aContent, aResult->iProgress );
-        }
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendListInstalledAppsResultsL()
-// Appends a List installed apps -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendListInstalledAppsResultsL ( 
-    ConML_ResultsPtr_t aContent, CSConListInstApps* aResult )
-    {
-    TRACE_FUNC_ENTRY;
-
-    if ( aResult )
-        {
-        if ( aResult->iComplete )
-            {
-            aContent->complete = new ( ELeave ) pcdata_t();
-            }
-        AppendProgressL ( aContent, aResult->iProgress );
-        
-        if ( aResult->iApps.Count() > 0 )
-            {
-            // 6 * KMaxFileName should be enought
-            // ( 5 items of TFileName and uid + type + size + 7* "#" )
-            HBufC8* buf = HBufC8::NewLC( 6 * KMaxFileName );
-            TPtr8 ptrBuf = buf->Des();
-            
-            aContent->applications = new ( ELeave ) ConML_Applications_t();
-            for ( TInt i=0; i<aResult->iApps.Count(); i++)
-                {
-                ConML_ApplicationListPtr_t app = 
-                    new ( ELeave )ConML_ApplicationList_t();
-                CleanupStack::PushL ( app );
-                GenericListAddL ( &aContent->applications->application, app );
-                CleanupStack::Pop(); // app
-                
-                app->data = new ( ELeave ) ConML_Application_t();
-                app->data->name = new ( ELeave ) pcdata_t();
-                app->data->name->SetDataL( BufToDesLC( 
-                    aResult->iApps[i]->iName));
-                CleanupStack::PopAndDestroy(); // BufToDesLC
-                
-                // create uid: UID # Type # Size # Version # Vendor # Parent app. name # WidgetBundleId #
-                LOGGER_WRITE( "CSConPCConnSession::AppendListInstalledAppsResultsL() : Create Uid" );
-                
-                ptrBuf.Copy( UidToDesLC( aResult->iApps[i]->iUid ) );
-                CleanupStack::PopAndDestroy(); // UidToDesLC
-                
-                ptrBuf.Append( KSConAppInfoSeparator );
-                
-                ptrBuf.Append( IntToDesLC(aResult->iApps[i]->iType ));
-                CleanupStack::PopAndDestroy(); // IntToDesLC
-                
-                ptrBuf.Append( KSConAppInfoSeparator );
-                
-                ptrBuf.Append( IntToDesLC(aResult->iApps[i]->iSize ) );
-                CleanupStack::PopAndDestroy(); // IntToDesLC
-                
-                ptrBuf.Append( KSConAppInfoSeparator );
-                ptrBuf.Append( aResult->iApps[i]->iVersion );
-                
-                ptrBuf.Append( KSConAppInfoSeparator );
-                ptrBuf.Append( BufToDesLC( aResult->iApps[i]->iVendor ) );
-                CleanupStack::PopAndDestroy(); // BufToDesLC
-                
-                ptrBuf.Append( KSConAppInfoSeparator );
-                ptrBuf.Append( BufToDesLC( aResult->iApps[i]->iParentName ) );
-                CleanupStack::PopAndDestroy(); // BufToDesLC
-                
-                ptrBuf.Append( KSConAppInfoSeparator );
-                if (aResult->iApps[i]->iWidgetBundleId)
-                    {
-                    ptrBuf.Append( BufToDesLC( *aResult->iApps[i]->iWidgetBundleId ) );
-                    CleanupStack::PopAndDestroy(); // BufToDesLC
-                    }
-                
-                ptrBuf.Append( KSConAppInfoSeparator );
-                
-                LOGGER_WRITE( "CSConPCConnSession::AppendListInstalledAppsResultsL() : set data" );
-                app->data->uid = new ( ELeave ) pcdata_t();
-                app->data->uid->SetDataL( *buf );
-                    
-                LOGGER_WRITE( "CSConPCConnSession::AppendListInstalledAppsResultsL() : Info added" );
-                }
-            CleanupStack::PopAndDestroy(buf);       
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendListPublicFilesResultsL()
-// Appends a List public files -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendListPublicFilesResultsL ( 
-    ConML_ResultsPtr_t aContent, CSConListPublicFiles* aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aResult )
-        {
-        if ( aResult->iComplete )
-            {
-            aContent->complete = new ( ELeave ) pcdata_t();
-            }
-        AppendProgressL ( aContent, aResult->iProgress );
-        
-        if ( aResult->iFiles.Count() > 0 )
-            {
-            aContent->files = new ( ELeave ) ConML_Files_t();
-            for ( TInt i=0;i<aResult->iFiles.Count(); i++ )
-                {
-                ConML_FileListPtr_t file = new ( ELeave ) ConML_FileList_t();
-                CleanupStack::PushL( file );
-                GenericListAddL ( &aContent->files->file, file );
-                CleanupStack::Pop(); // file
-                
-                file->data = new ( ELeave ) ConML_File_t();
-                file->data->name = new ( ELeave ) pcdata_t();
-                file->data->name->SetDataL( BufToDesLC (
-                    aResult->iFiles[i]->iPath ) );
-                CleanupStack::PopAndDestroy(); // BufToDesLC
-                
-                file->data->modified = new ( ELeave ) pcdata_t();
-                file->data->modified->SetDataL( BufToDesLC (
-                    aResult->iFiles[i]->iModified ) );
-                CleanupStack::PopAndDestroy(); // BufToDesLC
-                
-                file->data->size = new ( ELeave ) pcdata_t();
-                file->data->size->SetDataL( IntToDesLC ( 
-                    aResult->iFiles[i]->iSize ) );
-                CleanupStack::PopAndDestroy(); // IntToDesLC
-                
-                file->data->userPerm = new ( ELeave ) pcdata_t();
-                switch ( aResult->iFiles[i]->iUserPerm )
-                    {
-                    case EPermReadOnly:
-                        file->data->userPerm->SetDataL ( KSConPermReadOnly );
-                        break;
-                    
-                    case EPermNormal:
-                        file->data->userPerm->SetDataL ( KSConPermNormal );
-                        break;
-                    
-                    default:
-                        LOGGER_WRITE( "CSConPCConnSession:: AppendListPublicFilesResultsL() : Unknown userPerm! " );
-                        break;          
-                    }
-                }
-        }
-    }
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendRequestDataResultsL()
-// Appends a Request data -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendRequestDataResultsL( 
-    ConML_ResultsPtr_t aContent, CSConRequestData* aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aResult )
-        {
-        if ( aResult->iComplete )
-            {
-            aContent->complete = new ( ELeave ) pcdata_t();
-            }
-        AppendProgressL ( aContent, aResult->iProgress );
-        
-        if ( aResult->iMoreData )
-            {
-            aContent->moreData = new ( ELeave ) pcdata_t();
-            }
-        if ( aResult->iBackupData )
-            {
-            aContent->data = new ( ELeave ) pcdata_t();
-            aContent->data->SetDataL( aResult->iBackupData->Des() );
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendSupplyDataResultsL()
-// Appends a Supply data -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendSupplyDataResultsL( 
-    ConML_ResultsPtr_t aContent, CSConSupplyData* aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aResult )
-        {
-        if ( aResult->iComplete )
-            {
-            aContent->complete = new ( ELeave ) pcdata_t();
-            }
-        AppendProgressL( aContent, aResult->iProgress );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendInstallResultsL()
-// Appends an Install -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendInstallResultsL( 
-    ConML_ResultsPtr_t aContent, CSConInstall* aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aResult )
-        {
-        if ( aResult->iComplete )
-            {
-            aContent->complete = new ( ELeave ) pcdata_t();
-            }
-        AppendProgressL( aContent, aResult->iProgress );
-        
-        if ( aResult->iData && aResult->iData->Length() > 0 )
-            {
-            aContent->data = new ( ELeave ) pcdata_t();
-            aContent->data->SetDataL( aResult->iData->Des() );
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendUninstallResultsL()
-// Appends an Uninstall -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendUninstallResultsL( 
-    ConML_ResultsPtr_t aContent, CSConUninstall* aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aResult )
-        {
-        if ( aResult->iComplete )
-            {
-            LOGGER_WRITE( "CSConPCConnSession::AppendUninstallResultsL() Complete" );
-            aContent->complete = new ( ELeave ) pcdata_t();
-            }
-        LOGGER_WRITE_1( "CSConPCConnSession::AppendUninstallResultsL() iProgress: %d", aResult->iProgress );
-        AppendProgressL( aContent, aResult->iProgress );
-        
-        if ( aResult->iData && aResult->iData->Length() > 0 )
-            {
-            aContent->data = new ( ELeave ) pcdata_t();
-            aContent->data->SetDataL( aResult->iData->Des() );
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendListDataOwnersResultsL()
-// Appends a List data owners -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendListDataOwnersResultsL ( 
-    ConML_ResultsPtr_t aContent, CSConListDataOwners* aResult  )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aResult )  
-        {
-        if ( aResult->iComplete )
-            {
-            aContent->complete = new ( ELeave ) pcdata_t();
-            }
-        AppendProgressL( aContent, aResult->iProgress );
-        
-        if ( aResult->iDataOwners.Count() > 0 )
-            {
-            aContent->dataOwners = new ( ELeave ) ConML_DataOwners_t();
-            for ( TInt i=0; i < aResult->iDataOwners.Count(); i ++)
-                {
-                ConML_SIDListPtr_t sid = new ( ELeave ) ConML_SIDList_t();
-                CleanupStack::PushL( sid );
-                GenericListAddL ( &aContent->dataOwners->sid, sid );
-                CleanupStack::Pop();
-            
-                sid->data = new ( ELeave ) ConML_SID_t();
-                
-                sid->data->type = new ( ELeave ) pcdata_t();
-                sid->data->type->SetDataL ( IntToDesLC ( 
-                    aResult->iDataOwners[i]->iType) );  
-                CleanupStack::PopAndDestroy(); // IntToDesLC
-                
-                sid->data->uid = new ( ELeave ) pcdata_t();
-                
-                if( aResult->iDataOwners[i]->iUid.iUid )
-                    {
-                    sid->data->uid->SetDataL ( UidToDesLC ( 
-                        aResult->iDataOwners[i]->iUid ) );
-                    CleanupStack::PopAndDestroy(); // UidToDesLC    
-                    }
-                    
-                if( aResult->iDataOwners[i]->iJavaHash )
-                    {
-                    sid->data->uid->SetDataL ( HashToDesLC ( 
-                        aResult->iDataOwners[i]->iJavaHash->Des() ) );
-                    CleanupStack::PopAndDestroy(); // HashToDesLC
-                    }
-                                
-                if ( HasDrives ( aResult->iDataOwners[i]->iDriveList ) )
-                    {
-                    sid->data->drives = new ( ELeave ) ConML_Drives_t();
-                    AppendDrivesL ( sid->data->drives, 
-                        aResult->iDataOwners[i]->iDriveList );
-                    }       
-            
-                if ( aResult->iDataOwners[i]->iPackageName.Length() > 0 ) 
-                    {
-                    sid->data->packageInfo = 
-                        new ( ELeave ) ConML_PackageInfo_t();
-                    sid->data->packageInfo->name = new ( ELeave ) pcdata_t();
-                    sid->data->packageInfo->name->SetDataL ( BufToDesLC ( 
-                        aResult->iDataOwners[i]->iPackageName  ) );
-
-                    CleanupStack::PopAndDestroy(); // BufToDesLC
-                    }           
-            
-                if ( aResult->iDataOwners[i]->iHasFiles || 
-                aResult->iDataOwners[i]->iSupportsInc ||
-                aResult->iDataOwners[i]->iDelayToPrep ||
-                aResult->iDataOwners[i]->iReqReboot )
-                    {
-                    sid->data->burOptions = new ( ELeave ) ConML_BUROptions_t();
-                    if ( aResult->iDataOwners[i]->iHasFiles ) 
-                        {
-                        sid->data->burOptions->hasFiles = 
-                            new ( ELeave ) pcdata_t();
-                        sid->data->burOptions->hasFiles->SetDataL( IntToDesLC(
-                                aResult->iDataOwners[i]->iHasFiles ));
-                                
-                        CleanupStack::PopAndDestroy(); // IntToDesLC
-                        }
-                    if ( aResult->iDataOwners[i]->iSupportsInc )
-                        {
-                        sid->data->burOptions->supportsInc = 
-                            new ( ELeave ) pcdata_t();
-                        }
-                    if ( aResult->iDataOwners[i]->iDelayToPrep )                        
-                        {
-                        sid->data->burOptions->delayToPrepareData = 
-                            new ( ELeave ) pcdata_t();
-                        }
-                    if ( aResult->iDataOwners[i]->iReqReboot )
-                        {
-                        sid->data->burOptions->requiresReboot = 
-                            new ( ELeave ) pcdata_t();
-                        }
-                    }
-                }
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendGetDataOwnerStatusResultsL()
-// Appends a Get data owner status -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendGetDataOwnerStatusResultsL 
-    ( ConML_ResultsPtr_t aContent, CSConGetDataOwnerStatus* aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aResult )
-        {
-        if ( aResult->iComplete )
-            {
-            aContent->complete = new ( ELeave ) pcdata_t();
-            }
-        AppendProgressL( aContent, aResult->iProgress );
-
-        if ( aResult->iDataOwners.Count() > 0 )
-            {
-            aContent->dataOwners = new ( ELeave ) ConML_DataOwners_t();
-            for ( TInt i=0; i < aResult->iDataOwners.Count(); i ++)
-                {
-                ConML_SIDListPtr_t sid = new ( ELeave ) ConML_SIDList_t();
-                CleanupStack::PushL( sid );
-                GenericListAddL ( &aContent->dataOwners->sid, sid );
-                CleanupStack::Pop();
-            
-                sid->data = new ( ELeave ) ConML_SID_t();
-                
-                sid->data->type = new ( ELeave ) pcdata_t();
-                sid->data->type->SetDataL ( IntToDesLC ( 
-                    aResult->iDataOwners[i]->iType) );  
-                CleanupStack::PopAndDestroy(); // IntToDesLC
-                
-                sid->data->uid = new ( ELeave ) pcdata_t();
-                sid->data->uid->SetDataL ( UidToDesLC ( 
-                    aResult->iDataOwners[i]->iUid ) );
-                CleanupStack::PopAndDestroy(); // UidToDesLC    
-                
-                sid->data->dataOwnerStatus = new ( ELeave ) pcdata_t();
-                sid->data->dataOwnerStatus->SetDataL ( IntToDesLC( 
-                        aResult->iDataOwners[i]->iDataOwnStatus ));
-                
-                CleanupStack::PopAndDestroy(); // IntToDesLC
-                }
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendGetDataSizeResultsL()
-// Appends a Get data owner size -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendGetDataSizeResultsL ( 
-    ConML_ResultsPtr_t aContent, CSConGetDataSize* aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aResult )  
-        {
-        if ( aResult->iComplete )
-            {
-            aContent->complete = new ( ELeave ) pcdata_t();
-            }
-        AppendProgressL( aContent, aResult->iProgress );
-        
-        if ( aResult->iDataOwners.Count() > 0 )
-            {
-            aContent->dataOwners = new ( ELeave ) ConML_DataOwners_t();
-                
-            for ( TInt i=0; i< aResult->iDataOwners.Count(); i++ )      
-                {
-                ConML_SIDListPtr_t sid = new ( ELeave ) ConML_SIDList_t();
-                CleanupStack::PushL( sid );
-                GenericListAddL ( &aContent->dataOwners->sid, sid );
-                CleanupStack::Pop();
-                
-                sid->data = new ( ELeave ) ConML_SID_t();
-                
-                sid->data->type = new ( ELeave ) pcdata_t();
-                sid->data->type->SetDataL ( IntToDesLC ( 
-                    aResult->iDataOwners[i]->iType) );  
-                CleanupStack::PopAndDestroy(); // IntToDesLC
-                    
-                sid->data->uid = new ( ELeave ) pcdata_t();
-                
-                if( aResult->iDataOwners[i]->iUid.iUid )
-                    {
-                    sid->data->uid->SetDataL ( UidToDesLC ( 
-                        aResult->iDataOwners[i]->iUid ) );
-                    CleanupStack::PopAndDestroy(); // UidToDesLC    
-                    }
-
-                if( aResult->iDataOwners[i]->iJavaHash )
-                    {
-                    sid->data->uid->SetDataL ( HashToDesLC ( 
-                        aResult->iDataOwners[i]->iJavaHash->Des() ) );
-                    CleanupStack::PopAndDestroy(); // HashToDesLC
-                    }
-    
-                if ( HasDrives (  aResult->iDataOwners[i]->iDriveList ) )
-                    {
-                    sid->data->drives = new ( ELeave ) ConML_Drives_t();
-                    AppendDrivesL ( sid->data->drives, 
-                        aResult->iDataOwners[i]->iDriveList );
-                    }       
-                
-                sid->data->size = new ( ELeave ) pcdata_t();
-                sid->data->size->SetDataL( IntToDesLC( 
-                    aResult->iDataOwners[i]->iSize ) );
-                CleanupStack::PopAndDestroy(); // IntToDesLC
-                
-                sid->data->transferDataType = new ( ELeave ) pcdata_t();
-                sid->data->transferDataType->SetDataL( IntToDesLC( 
-                        aResult->iDataOwners[i]->iTransDataType ) );
-
-                CleanupStack::PopAndDestroy(); // IntToDesLC
-                }
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendGetMetadataResultsL()
-// Appends a GetMetadata -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendGetMetadataResultsL(
-    ConML_ResultsPtr_t aContent, CSConGetMetadata* aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    if ( aResult )
-        {
-        if ( aResult->iComplete )
-            {
-            aContent->complete = new ( ELeave ) pcdata_t();
-            
-            // add filename only if task is completed
-            aContent->filename = new ( ELeave ) pcdata_t();
-            aContent->filename->SetDataL( BufToDesLC(aResult->iFilename ) );
-            CleanupStack::PopAndDestroy(); // BufToDesLC
-            }
-        AppendProgressL( aContent, aResult->iProgress );
-        
-        if ( aResult->iData )
-            {
-            aContent->data = new ( ELeave ) pcdata_t();
-            aContent->data->SetDataL( aResult->iData->Des() );
-            }
-        
-        if ( aResult->iMoreData )
-            {
-            aContent->moreData = new ( ELeave ) pcdata_t();
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendProgressL()
-// Appends a Progress -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendProgressL ( 
-    ConML_ResultsPtr_t aContent, TInt progress )
-    {
-    TRACE_FUNC_ENTRY;
-    aContent->progress = new ( ELeave ) ConML_Progress_t();
-    aContent->progress->value = new ( ELeave ) pcdata_t();
-    aContent->progress->value->SetDataL ( IntToDesLC ( progress ));
-    CleanupStack::PopAndDestroy(); // IntToDesLC
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::AppendDrivesL()
-// Appends a Drives -element from the reply data of PCCS
-// -----------------------------------------------------------------------------
-//
-void CSConPCConnSession::AppendDrivesL( 
-    ConML_DrivesPtr_t aContent, TDriveList aDrives )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    for ( TInt i = 0; i<KMaxDrives; i++ )
-        {
-        if ( aDrives[i] )
-            {
-            ConML_DriveListPtr_t drive = new ( ELeave ) ConML_DriveList_t();
-            CleanupStack::PushL ( drive );
-            GenericListAddL ( &aContent->drive, drive );
-            CleanupStack::Pop(); // drive
-            
-            drive->data = new ( ELeave ) ConML_Drive_t();
-            drive->data->name = new ( ELeave ) pcdata_t();
-            drive->data->name->SetDataL( DriveNumToDesLC(i+KSConFirstDrive  ));
-            CleanupStack::PopAndDestroy(); // IntToDesLC
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::DriveList()
-// Converts an Drives -element to TDriveList
-// -----------------------------------------------------------------------------
-//
-TDriveList CSConPCConnSession::DriveList( ConML_DriveListPtr_t aContent )
-    {
-    TBuf8<KMaxDrives>  driveBuf;
-    TDriveList driveList;
-
-    for ( ConML_DriveListPtr_t p = aContent; p && p->data; p = p->next )
-        {
-        if ( p->data->name )            
-            {
-            driveBuf.Append( p->data->name->Data() );
-            }
-        }
-
-    for ( TInt i = 0; i<KMaxDrives; i++ )
-        {
-        if ( driveBuf.Locate ( TChar( i + KSConFirstDrive ) ) != KErrNotFound )
-            {
-            driveList.Append( KSConDriveExists );
-            }
-        else
-            {
-            driveList.Append( KSConNoDrive );
-            }
-        }
-    return driveList;
-    }
-
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::IntToDesLC()
-// Converts an integer to descriptor
-// -----------------------------------------------------------------------------
-//
-TDesC8& CSConPCConnSession::IntToDesLC(const TInt& anInt)
-    {
-    HBufC8* buf = HBufC8::NewLC(20);
-    TPtr8 ptrBuf = buf->Des();
-    ptrBuf.Num(anInt);
-    return *buf;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::DriveNumToDesLC()
-// Convers a drive number to equivalent drive letter 
-// -----------------------------------------------------------------------------
-//
-TDesC8& CSConPCConnSession::DriveNumToDesLC( const TInt& anInt )
-    {
-    TChar mark ( anInt );
-    HBufC8* buf = HBufC8::NewLC(1);
-    TPtr8 ptrBuf = buf->Des();
-    ptrBuf.Append(mark);
-    return *buf;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::BufToDesLC()
-// converts a buffer to descriptor
-// -----------------------------------------------------------------------------
-//
-TDesC8& CSConPCConnSession::BufToDesLC( const TDesC& aBuf)
-    {
-    HBufC8* buf = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aBuf );
-    CleanupStack::PushL( buf );
-    return *buf;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::UidToDesLC()
-// converts an UID to a descriptor
-// -----------------------------------------------------------------------------
-//
-TDesC8& CSConPCConnSession::UidToDesLC( const TUid& aUid )
-    {
-    HBufC8* buf = HBufC8::NewLC(10);
-    TPtr8 ptrBuf = buf->Des();
-    ptrBuf.Copy (aUid.Name().Mid(1, 8) );
-    return *buf;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::DesToUid()
-// converts a descriptor to a UID value
-// -----------------------------------------------------------------------------
-//
-TUid CSConPCConnSession::DesToUid ( const TDesC8& aDes )
-    {
-    TLex8 lex( aDes );
-    TUint32 value;
-    lex.Val( value, EHex );
-    TUid uid = TUid::Uid( value );
-    return uid;
-    }   
-    
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::DesToInt()
-// converts a descriptor to a integer value
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCConnSession::DesToInt( const TDesC8& aDes)
-    {
-    TLex8 lex(aDes);
-    TInt value = 0;
-    lex.Val(value);
-    return value;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::HasDrives()
-// Returns ETrue if at least one drive is found from the given TDriveList
-// -----------------------------------------------------------------------------
-//
-TBool CSConPCConnSession::HasDrives( TDriveList& aDrive )
-    {
-    TBool hasDrives ( EFalse );     
-    for ( TInt i = 0; i<KMaxDrives; i++ )
-        {
-        if ( aDrive[i] )
-            {
-            hasDrives = ETrue;
-            }
-        }
-    return hasDrives;
-    }
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::HashToDesLC()
-// converts a Java hash to descriptor
-// -----------------------------------------------------------------------------
-//
-TDesC8& CSConPCConnSession::HashToDesLC( const TDesC& aBuf)
-    {
-    HBufC8* buf = HBufC8::NewLC(aBuf.Size()+5);
-    TPtr8 ptrBuf = buf->Des();
-    // Unicode conversion from 16-bit to 8-bit
-    CnvUtfConverter::ConvertFromUnicodeToUtf8(ptrBuf, aBuf);
-    //Add JAVA_ identifier to the begining of the hash
-    ptrBuf.Insert(0, KSConJavaHashId);
-    return *buf;
-    }
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::DesToHashLC()
-// converts descriptor to Java hash
-// -----------------------------------------------------------------------------
-//    
-TPtr CSConPCConnSession::DesToHashLC( const TDesC8& aDes )
-    {
-    HBufC* buf = HBufC::NewLC(aDes.Size());
-    TPtr ptrBuf = buf->Des();
-    // Unicode conversion from 8-bit to 16-bit
-    CnvUtfConverter::ConvertToUnicodeFromUtf8(ptrBuf, aDes);
-    //Delete JAVA_
-    ptrBuf.Delete(0, KSConJavaHashId().Length());   
-    return ptrBuf;
-    }
-// -----------------------------------------------------------------------------
-// CSConPCConnSession::IsJavaHash()
-// Returns ETrue if descriptor is Java hash, else EFalse
-// -----------------------------------------------------------------------------
-//  
-TBool CSConPCConnSession::IsJavaHash( const TDesC8& aDes )
-    {
-    if ( aDes.FindC(KSConJavaHashId) == 0 )
-        {
-        return ETrue;
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
-
--- a/connectivitymodules/SeCon/servers/syncserver/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Build information file for project SyncServer
-*
-*/
-
-
-PRJ_EXPORTS
-../rom/sconsyncserver.iby      CORE_APP_LAYER_IBY_EXPORT_PATH(sconsyncserver.iby)
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-sconsyncserver.mmp
-
--- a/connectivitymodules/SeCon/servers/syncserver/group/sconsyncserver.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  sconsyncserver mmp file
-*
-*/
-
-
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-
-TARGET          sconsyncserver.exe
-TARGETTYPE      exe
-
-// Same capabilities than in DS Ui application
-CAPABILITY      LocalServices ReadUserData WriteUserData ReadDeviceData WriteDeviceData NetworkServices UserEnvironment ProtServ SwEvent NetworkControl Location
-
-UID             0x0 0x2001A964
-VENDORID        VID_DEFAULT
-
-EPOCSTACKSIZE   0x2000
-EPOCHEAPSIZE	0x500 0x800000 	// minimum and maximum heap sizes
-
-SOURCEPATH      ../src
-SOURCE          sconsyncserver.cpp
-SOURCE          sconsyncsession.cpp
-SOURCE          sconsyncrelationship.cpp
-SOURCE          sconasynchandler.cpp
-SOURCE          cscontimeout.cpp
-
-// common components (dataproviderinfo)
-SOURCEPATH      ../../../clients/syncclient/src
-USERINCLUDE     ../../../clients/syncclient/inc
-SOURCE          scondataproviderinfo.cpp
-
-USERINCLUDE     ..\inc
-
-// Default system include paths
-APP_LAYER_SYSTEMINCLUDE
-
-DEBUGLIBRARY    flogger.lib
-LIBRARY         euser.lib
-LIBRARY         efsrv.lib
-LIBRARY         bafl.lib
-LIBRARY         ecom.lib
-LIBRARY         estor.lib // CDictionaryFileStore
-LIBRARY         smldataprovider.lib
-LIBRARY         nsmlchangefinder.lib
-LIBRARY         smlstoreformat.lib
-LIBRARY         charconv.lib
--- a/connectivitymodules/SeCon/servers/syncserver/inc/cscontimeout.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +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:  CCSconTimeOut header file
-*
-*/
-
-
-#ifndef CSCONTIMEOUT_H
-#define CSCONTIMEOUT_H
-
-#include <e32base.h>	// For CActive, link against: euser.lib
-#include <e32std.h>		// For RTimer, link against: euser.lib
-
-class MTimeOutObserver
-    {
-public:
-    virtual void TimeOut() = 0;
-    };
-
-class CCSconTimeOut : public CActive
-    {
-public:
-    // Cancel and destroy
-    ~CCSconTimeOut();
-
-    // Two-phased constructor.
-    static CCSconTimeOut* NewL( MTimeOutObserver& aTimeOutObserver );
-    
-public:
-    // New functions
-    // Function for making the timeout request
-    void Start(TTimeIntervalMicroSeconds32 aDelay);
-    
-private:
-    // C++ constructor
-    CCSconTimeOut( MTimeOutObserver& aTimeOutObserver );
-    
-    // Second-phase constructor
-    void ConstructL();
-    
-private:
-    // From CActive
-    // Handle completion
-    void RunL();
-    
-    // How to cancel me
-    void DoCancel();
-    
-    // Override to handle leaves from RunL(). Default implementation causes
-    // the active scheduler to panic.
-    TInt RunError(TInt aError);
-    
-private:
-    enum TCSconTimeOutState
-        {
-        EUninitialized, // Uninitialized
-        EInitialized, // Initalized
-        EError
-        // Error condition
-        };
-
-private:
-    TInt iState; // State of the active object
-    RTimer iTimer; // Provides async timing service
-    MTimeOutObserver& iTimeOutObserver;
-    };
-
-#endif // CSCONTIMEOUT_H
--- a/connectivitymodules/SeCon/servers/syncserver/inc/debug.h	Tue Aug 31 15:05:37 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:  Debug utility for SyncServer
-*
-*/
-
-
-#ifndef _SECON_DEBUG_H
-#define _SECON_DEBUG_H
-
-#ifdef _DEBUG
-    
-    // File logging
-    #define __FLOGGING__
-    
-    #include <e32svr.h>
-    #ifdef __FLOGGING__
-        #include <f32file.h>
-        #include <flogger.h>
-    #endif
-    
-    NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow
-        {
-    public:
-        void Overflow(TDes16& /*aDes*/) {}
-        };
-    
-    NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow
-        {
-    public:
-        void Overflow(TDes8& /*aDes*/) {}
-        };
-    
-    _LIT( KLogDir, "SECON" );
-    _LIT( KLogFile, "SeconDebug.txt" );
-    
-    _LIT(KTracePrefix16, "[SeConSync] ");
-    _LIT8(KTracePrefix8, "[SeConSync] ");
-    _LIT8(KFuncEntryFormat8, "%S : Begin");
-    _LIT8(KFuncExitFormat8, "%S : End");
-    _LIT8(KFuncFormat8, "><%S");
-    
-    const TInt KMaxLogLineLength = 512;
-    
-    // old function loggin macros
-    #define FLOG(a) {FPrint(a);}
-    #define FLOG_1(a,b) {FPrint(a,b);}
-    #define FLOG_2(a,b,c) {FPrint(a,b,c);}
-    #define FTRACE(a) {a;}
-    #define LOGGER_ENTERFN( name )      {TRACE_FUNC_ENTRY;}
-    #define LOGGER_LEAVEFN( name )      {TRACE_FUNC_EXIT;}
-    
-    #define LOGGER_WRITE( text )                    {_LIT( KTemp, text ); FPrint( KTemp );}
-    #define LOGGER_WRITE_1( text,par1 )             {_LIT( KTemp, text ); FPrint( KTemp, par1 );}
-    #define LOGGER_WRITE8_1( text,par1 )            {_LIT8( KTemp, text ); FPrint( KTemp, par1 );}
-    #define LOGGER_WRITE_2( text,par1,par2 )        {_LIT( KTemp, text ); FPrint( KTemp, par1, par2 );}
-    #define LOGGER_WRITE_3( text,par1,par2,par3 )   {_LIT( KTemp, text ); FPrint( KTemp, par1, par2, par3 );}
-    
-    // New function logging macros
-    #define TRACE_FUNC_ENTRY {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncEntryFormat8, &ptr8);}
-    #define TRACE_FUNC_EXIT {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncExitFormat8, &ptr8);}
-    #define TRACE_FUNC {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncFormat8, &ptr8);}
-    
-    // Declare the FPrint function
-    inline void FPrint( TRefByValue<const TDesC16> aFmt, ...)
-        {
-        VA_LIST list;
-        VA_START(list,aFmt);
-    #ifdef __FLOGGING__
-        RFileLogger::WriteFormat( KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list );
-    #endif
-        TBuf16<KMaxLogLineLength> theFinalString;
-        theFinalString.Append(KTracePrefix16);
-        TOverflowTruncate16 overflow;
-        theFinalString.AppendFormatList(aFmt,list,&overflow);
-        RDebug::Print(theFinalString);
-        }
-    
-    // Declare the FPrint function
-    inline void FPrint(TRefByValue<const TDesC8> aFmt, ...)
-        {
-        VA_LIST list;
-        VA_START(list, aFmt);
-    #ifdef __FLOGGING__
-        RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
-    #endif
-        TOverflowTruncate8 overflow;
-        TBuf8<KMaxLogLineLength> buf8;
-        buf8.Append(KTracePrefix8);
-        buf8.AppendFormatList(aFmt, list, &overflow);
-        TBuf16<KMaxLogLineLength> buf16(buf8.Length());
-        buf16.Copy(buf8);
-        TRefByValue<const TDesC> tmpFmt(_L("%S"));
-        RDebug::Print(tmpFmt, &buf16);
-        }
-#else
-    
-    // No loggings --> reduced code size
-    #define FLOG(a)
-    #define FLOG_1(a,b)
-    #define FLOG_2(a,b,c)
-    #define FTRACE(a)
-    #define LOGGER_ENTERFN( name )
-    #define LOGGER_LEAVEFN( name )
-    #define LOGGER_WRITE( text )
-    #define LOGGER_WRITE_1( text, par1 )
-    #define LOGGER_WRITE8_1( text, par1 )
-    #define LOGGER_WRITE_2( text, par1, par2 )
-    #define LOGGER_WRITE_3( text, par1, par2, par3 )
-    #define TRACE_FUNC_ENTRY
-    #define TRACE_FUNC_EXIT
-    #define TRACE_FUNC
-
-#endif //_DEBUG
-
-#endif // SECON_DEBUG_H
-
-// End of file
-
--- a/connectivitymodules/SeCon/servers/syncserver/inc/logdatastoreformat.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +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:  Simple class for tracing datastore format
-*
-*/
-
-#ifndef LOGDATASTOREFORMAT_H_
-#define LOGDATASTOREFORMAT_H_
-
-//
-#include "debug.h"
-
-NONSHARABLE_CLASS(TLogDataStoreFormat)
-    {
-    public:
-#ifndef _DEBUG
-// does nothing on release version
-static void TLogDataStoreFormat::LogDataStoreFormatL( const TDesC& /*aLogInfo*/, const CSmlDataStoreFormat& /*aDataStoreFormat*/ )
-    {
-    }
-#else
-static void TLogDataStoreFormat::LogDataStoreFormatL( const TDesC& aLogInfo, const CSmlDataStoreFormat& aDataStoreFormat )
-    {
-    LOGGER_WRITE_1("LogDataStoreFormatL, aLogInfo: %S", &aLogInfo);
-    LOGGER_WRITE_1("DisplayName: %S", &aDataStoreFormat.DisplayName());
-    TBool hasMaxSize = aDataStoreFormat.IsSupported( CSmlDataStoreFormat::EOptionHasMaxSize );
-    TBool hasMaxItems = aDataStoreFormat.IsSupported( CSmlDataStoreFormat::EOptionHasMaxItems );
-    TBool hierarcial = aDataStoreFormat.IsSupported( CSmlDataStoreFormat::EOptionHierarchial );
-    LOGGER_WRITE_1("hasMaxSize: %d", (TInt)hasMaxSize);
-    LOGGER_WRITE_1("hasMaxItems: %d", (TInt)hasMaxItems);
-    LOGGER_WRITE_1("hierarcial: %d", (TInt)hierarcial);
-    LOGGER_WRITE_1("MimeFormatCount: %d", aDataStoreFormat.MimeFormatCount());
-    for ( TInt i = 0; i < aDataStoreFormat.MimeFormatCount(); i++)
-        {
-        LOGGER_WRITE_1("  MimeFormat(%d)",i);
-        const CSmlMimeFormat& mimeformat = aDataStoreFormat.MimeFormat(i);
-        LOGGER_WRITE8_1("  MimeType: %S", &mimeformat.MimeType().DesC());
-        LOGGER_WRITE8_1("  MimeVersion: %S", &mimeformat.MimeVersion().DesC());
-        LOGGER_WRITE_1( "  FieldLevel, bool: %d", (TInt) mimeformat.FieldLevel());
-        LOGGER_WRITE_1( "  PropertyCount: %d", mimeformat.PropertyCount());
-        for ( TInt j=0; j<mimeformat.PropertyCount(); j++ )
-            {
-            LOGGER_WRITE_1("    MimeFormat property(%d)",j);
-            const CSmlDataProperty& dataProp = mimeformat.Property(j);
-            const CSmlDataField& dataField = dataProp.Field();
-            LOGGER_WRITE8_1("    dataField: %S", &dataField.Name().DesC());
-            LOGGER_WRITE_1( "    DisplayName: %S", &dataField.DisplayName());
-            LOGGER_WRITE_1( "    HasMaxSize: %d", (TInt)dataProp.HasMaxSize());
-            LOGGER_WRITE_1( "    MaxSize: %d", dataProp.MaxSize());
-            LOGGER_WRITE_1( "    HasMaxOccur: %d", (TInt)dataProp.HasMaxOccur());
-            LOGGER_WRITE_1( "    MaxOccur: %d", dataProp.MaxOccur());
-            TBool OptionNoTruncate = dataProp.IsSupported(CSmlDataProperty::EOptionNoTruncate);
-            LOGGER_WRITE_1( "    EOptionNoTruncate: %d", (TInt)OptionNoTruncate);
-            LOGGER_WRITE8_1("    DataType(): %S", &dataField.DataType().DesC());
-            LOGGER_WRITE_1( "    EnumValueCount(): %d", dataField.EnumValueCount());
-            for ( TInt k=0; k<dataField.EnumValueCount(); k++)
-                {
-                LOGGER_WRITE8_1("      EnumValue(): %S", &dataField.EnumValue(k).DesC());
-                }
-            LOGGER_WRITE_1("    ParamCount: %d", dataProp.ParamCount());
-            for ( TInt k=0; k<dataProp.ParamCount(); k++)
-                {
-                LOGGER_WRITE_1( "      dataParamField(%d)", k);
-                const CSmlDataPropertyParam& param = dataProp.Param(k);
-                const CSmlDataField& field = param.Field();
-                LOGGER_WRITE8_1("      dataParamField: %S", &field.Name().DesC());
-                LOGGER_WRITE_1( "      dataParamDisplayName: %S", &field.DisplayName());
-                LOGGER_WRITE8_1("      dataParamDataType(): %S", &field.DataType().DesC());
-                LOGGER_WRITE_1( "      dataParamEnumValueCount(): %d", field.EnumValueCount());
-                for ( TInt l=0; l<field.EnumValueCount(); l++)
-                    {
-                    LOGGER_WRITE8_1("        dataParamEnumValue(): %S", &field.EnumValue(l).DesC());
-                    }
-                
-                LOGGER_WRITE("      ---------------");
-                }
-            LOGGER_WRITE(   "    -----------------");
-            }
-        
-        LOGGER_WRITE(   "  -----------------");
-        }
-    }
-#endif
-    };
-
-
-#endif /* LOGDATASTOREFORMAT_H_ */
--- a/connectivitymodules/SeCon/servers/syncserver/inc/sconasynchandler.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +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:  CSconAsyncHandler header
-*
-*/
-
-
-#ifndef SCONASYNCHANDLER_H_
-#define SCONASYNCHANDLER_H_
-
-#include <e32base.h>
-#include <f32file.h>
-
-#include <syncml/SmlDataSyncDefs.h>
-#include <stringpool.h>
-
-#include "cscontimeout.h"
-
-class CSmlDataStore;
-class CSconSyncRelationship;
-class CSmlDataProvider;
-class CNSmlDataItemUidSet;
-class CSmlDataStoreFormat;
-
-NONSHARABLE_CLASS ( CSconAsyncHandler ): public CActive, MTimeOutObserver
-{
-public:
-    static CSconAsyncHandler* NewL();
-	~CSconAsyncHandler();
-	void HandleServiceL( const RMessage2& aMessage );
-	
-private: // From CActive 
-    void RunL();
-    TInt RunError(TInt aError);
-    void DoCancel();
-    
-private: // From MTimeOutObserver
-    void TimeOut();
-    
-private:
-    
-	CSconAsyncHandler();
-	void ConstructL();
-	
-	void HandleChunkMessage();
-    void ListAllImplementationsL();
-    void OpenStoreL();
-	
-	void OpenItemL();
-	void OpenItemCompletedL( TInt aError );
-	
-	void CreateItemL();
-	void CreateItemCompletedL( TInt aError );
-	void ReplaceItemL();
-	void ReplaceItemCompletedL( TInt aError );
-	void MoveItemL();
-	void DeleteItemL();
-	void SoftDeleteItemL();
-	void DeleteAllItemsL();
-	void ReadParentL();
-	void ReadParentCompletedL( TInt aError );
-	
-    void HasHistoryL();
-    void AddedItemsL();
-    void DeletedItemsL();
-    void SoftDeletedItemsL();
-    void ModifiedItemsL();
-    void MovedItemsL();
-	//void ListChangesL();
-	void ResetChangeInfoL();
-	void CommitChangeInfoL();
-	void CloseStore();
-	
-	void SetSyncTimeStampL();
-	void GetSyncTimeStampL();
-	
-	void ExportStoreFormatL();
-	void SetRemoteStoreFormatL();
-	
-	void LeaveIfNoInstanceL();
-	
-	void DoCloseStore();
-	
-	void CleanOldStoresL();
-	void CompleteRequest( TInt aError );
-private:
-    RChunk  iChunk;
-    
-    RStringPool            iStringPool;
-    CSmlDataStoreFormat*   iStoreFormat;
-    CSmlDataProvider*      iDataProvider;
-    CSmlDataStore*         iDataStore;
-    CSconSyncRelationship* iContext;
-    RFs                    iFs;
-	RMessage2              iMessage;
-	
-	// for committing changes
-	CNSmlDataItemUidSet*   iItems;
-	
-	// for opening item
-	TBool iFieldChange;
-	TInt iSize;
-	TInt iParent;
-	TBuf8<64> iMimeType;
-	TBuf8<64> iMimeVer;
-	
-	// for creating item
-	TSmlDbItemUid  iNewItem;
-	HBufC8*        iWriteData;
-	TBool          iCommitInProgress;
-	
-	CCSconTimeOut*         iTimeOut;
-	TBool                  iForceCancel;
-};
-
-#endif /*SCONASYNCHANDLER_H_*/
--- a/connectivitymodules/SeCon/servers/syncserver/inc/sconsyncclientserver.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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:  Sync Client-Server header
-*
-*/
-
-
-#ifndef SCONSYNCCLIENTSERVER_H
-#define SCONSYNCCLIENTSERVER_H
-
-#include <e32base.h>
-
-_LIT(KSconSyncServerName, "sconsyncserver");
-_LIT(KSconSyncServerExe, "sconsyncserver.exe");
-
-
-enum TService
-{
-    ESendChunkHandle,
-    ECancelRequest,
-    EListImplementations,
-    
-    EOpenStore,
-    EOpenItem,
-    ECreateItem,
-    EReplaceItem,
-    EMoveItem,
-    EDeleteItem,
-    ESoftDeleteItem,
-    EDeleteAllItems,
-    EReadParent,
-    
-    EHasHistory,
-    EAddedItems,
-    EDeletedItems,
-    ESoftDeletedItems,
-    EModifiedItems,
-    EMovedItems,
-    
-    //EListChanges,
-    EResetChangeInfo,
-    ECommitChangeInfo,
-    
-    ECloseStore,
-    ESetSyncTimeStamp,
-    EGetSyncTimeStamp,
-    EExportStoreFormat,
-    ESetRemoteStoreFormat,
-    
-    EMaxService     // Not an actual service
-};
-
-#endif // SCONSYNCCLIENTSERVER_H
--- a/connectivitymodules/SeCon/servers/syncserver/inc/sconsyncrelationship.h	Tue Aug 31 15:05:37 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:  CSconSyncRelationship header
-*
-*/
-
-
-#ifndef SCONSYNCRELATIONSHIP_H_
-#define SCONSYNCRELATIONSHIP_H_
-
-#include <e32base.h>
-#include <f32file.h> 
-#include <s32file.h>
-#include <syncml/smldatasyncdefs.h>
-#include <syncmldef.h>
-
-class CDictionaryFileStore;
-
-NONSHARABLE_CLASS ( CSconSyncRelationship ) : public CBase, public MSmlSyncRelationship
-    {
-public:
-    /**
-     * Creates CSconSyncRelationship object.
-     * @param   aFs             reference to open RFs connection
-     * @param   aRelationUid    uniqueID for each server-client pair
-     * @return new CSconSyncRelationship object
-     */
-    static CSconSyncRelationship* NewL( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aProviderId );
-	~CSconSyncRelationship();
-	
-	static void SetTimeStampL( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aId );
-	static void GetTimeStampL( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aId, TDateTime& aTimeStamp );
-	
-public: // From MSmlSyncRelationship
-    
-	/**
-     * Returns the unique identifier for the synchronisation relationship.
-     *
-     * @return             A unique identifier for the sync relationship.
-     */
-    TSmlSyncTaskKey SyncTaskKey() const;
-    
-    /**
-     * Opens a specified stream for reading, and places an item on the cleanup stack to close it.
-     *
-     * @param               aReadStream    On return, an open read stream
-     * @param               aStreamUid     The UID of the stream to open for reading.
-     */
-    void OpenReadStreamLC(RReadStream& aReadStream, TUid aStreamUid);
-    
-    /**
-     * Opens the specified stream, or creates a new one if it does not exist, and places an item on the cleanup stack to close it.
-     *
-     * @param              aWriteStream    On return, an open write stream
-     * @param              aStreamUid      The UID of the stream to open or create
-     */
-    void OpenWriteStreamLC(RWriteStream& aWriteStream, TUid aStreamUid);
-    
-    /**
-     * Tests if the specified stream identified exists in the store.
-     *
-     * @param              aStreamUid The stream UID
-     * @return             Non-zero if the stream exists, otherwise EFalse.
-     */
-    TBool IsStreamPresentL(TUid aStreamUid) const;
-    
-private:
-	CSconSyncRelationship( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aProviderId );
-	void ConstructL();
-	
-private:
-    
-	CDictionaryFileStore* iDictionaryStore;
-	RFs&   iFs;
-	TUid   iID;
-	TSmlDataProviderId iProviderId;
-    };
-
-#endif /*SCONSYNCRELATIONSHIP_H_*/
--- a/connectivitymodules/SeCon/servers/syncserver/inc/sconsyncserver.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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:  CSconSyncServer header
-*
-*/
-
-
-#ifndef __SCONSYNCSERVER_H__
-#define __SCONSYNCSERVER_H__
-
-#include <e32base.h>
-
-class CSconSyncServer : public CPolicyServer
-{
-public:
-    static CSconSyncServer* NewL();
-    static CSconSyncServer* NewLC();      
-    virtual ~CSconSyncServer();
-    
-    void AddSession();
-    void RemoveSession();
-
-private:
-    CSconSyncServer();
-    void ConstructL();
-
-    CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
-    TInt RunError(TInt aError);
-
-private:
-    TInt iSessionCount;
-
-};
-
-#endif // __SCONSYNCSERVER_H__
\ No newline at end of file
--- a/connectivitymodules/SeCon/servers/syncserver/inc/sconsyncsession.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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:  CSconSyncSession header
-*
-*/
-
-
-#ifndef __SCONSYNCSESSION_H__
-#define __SCONSYNCSESSION_H__
-
-#include <e32base.h>
-
-
-class CSconSyncServer;
-class CSconAsyncHandler;
-
-class CSconSyncSession : public CSession2
-    {
-public:
-    static CSconSyncSession* NewL();
-    
-    void CreateL();
-    
-private:
-    CSconSyncSession();
-    ~CSconSyncSession();
-    void ConstructL();
-    
-    CSconSyncServer& Server();
-    void ServiceL(const RMessage2& aMessage);
-    
-private:
-    CSconAsyncHandler* iAsyncHandler;
-    };
-
-#endif // __SCONSYNCSESSION_H__
--- a/connectivitymodules/SeCon/servers/syncserver/rom/sconsyncserver.iby	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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:  IBY file for SconSyncServer
-*
-*/
-
-#ifndef _SCONSYNCSERVER_IBY_
-#define _SCONSYNCSERVER_IBY_
-
-#include <data_caging_paths_for_iby.hrh>
-
-//file content
-file=ABI_DIR\BUILD_DIR\sconsyncserver.exe		PROGRAMS_DIR\sconsyncserver.exe
-
-#endif
--- a/connectivitymodules/SeCon/servers/syncserver/src/cscontimeout.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +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:  CCSconTimeOut implementation
-*
-*/
-
-#include "cscontimeout.h"
-
-CCSconTimeOut::CCSconTimeOut( MTimeOutObserver& aTimeOutObserver ) :
-    CActive(EPriorityStandard), // Standard priority
-    iTimeOutObserver(aTimeOutObserver)
-    {
-    }
-
-
-CCSconTimeOut* CCSconTimeOut::NewL( MTimeOutObserver& aTimeOutObserver )
-    {
-    CCSconTimeOut* self = new (ELeave) CCSconTimeOut( aTimeOutObserver );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-void CCSconTimeOut::ConstructL()
-    {
-    User::LeaveIfError(iTimer.CreateLocal()); // Initialize timer
-    CActiveScheduler::Add(this); // Add to scheduler
-    }
-
-CCSconTimeOut::~CCSconTimeOut()
-    {
-    Cancel(); // Cancel any request, if outstanding
-    iTimer.Close(); // Destroy the RTimer object
-    // Delete instance variables if any
-    }
-
-void CCSconTimeOut::DoCancel()
-    {
-    iTimer.Cancel();
-    }
-
-void CCSconTimeOut::Start(TTimeIntervalMicroSeconds32 aDelay)
-    {
-    Cancel(); // Cancel any request, just to be sure
-    iState = EUninitialized;
-    iTimer.After(iStatus, aDelay); // Set for later
-    SetActive(); // Tell scheduler a request is active
-    }
-
-void CCSconTimeOut::RunL()
-    {
-    /*if (iState == EUninitialized)
-        {
-        // Do something the first time RunL() is called
-        iState = EInitialized;
-        }
-    else if (iState != EError)
-        {
-        // Do something
-        }
-    iTimer.After(iStatus, 1000000); // Set for 1 sec later
-    SetActive(); // Tell scheduler a request is active*/
-    if ( iState == KErrNone )
-        {
-        iTimeOutObserver.TimeOut();
-        }
-    
-    }
-
-TInt CCSconTimeOut::RunError(TInt aError)
-    {
-    return aError;
-    }
--- a/connectivitymodules/SeCon/servers/syncserver/src/sconasynchandler.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1179 +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:  CSconAsyncHandler implementation
-*
-*/
-
-
-#include "sconasynchandler.h"
-
-#include <ecom/ecom.h>
-#include <SmlDataProvider.h>
-#include <s32mem.h>
-#include <nsmlchangefinder.h>
-#include <e32cmn.h>
-#include <ecom/ImplementationInformation.h>
-#include <mmf/common/mmfcontrollerpluginresolver.h>
-
-#include "sconsyncclientserver.h"
-#include "sconsyncrelationship.h"
-#include "scondataproviderinfo.h"
-#include "debug.h"
-#include "logdatastoreformat.h"
-
-// Data Store interface implementation Uid.
-// Load all plugins with this uid.
-const TUid KDSEcomIFUid = {0x101F4D3A};
-
-const TInt KDefaultExpandSize = 1024;
-
-// one store per computer, max store count.
-const TInt KMaxStoresCount = 10;
-
-const TInt KDefaultTimeOutInMicroSeconds = 30 * 1000000; // 30 seconds
-const TInt KDeleteAllTimeOutInMicroSeconds = 300 * 1000000; // 5 minutes
-const TInt KOpenStoreTimeOutInMicroSeconds = 180 * 1000000; // 180 seconds
-
-CSconAsyncHandler::~CSconAsyncHandler()
-    {
-    TRACE_FUNC_ENTRY;
-    Cancel();
-    DoCloseStore();
-    delete iItems;
-    delete iWriteData;
-    delete iDataStore;
-    delete iDataProvider;
-    delete iContext;
-    delete iStoreFormat;
-    iStringPool.Close();
-    iFs.Close();
-    REComSession::FinalClose();
-    iChunk.Close();
-    delete iTimeOut;
-    TRACE_FUNC_EXIT;
-    }
-
-CSconAsyncHandler::CSconAsyncHandler(): CActive( EPriorityStandard )
-    {
-    TRACE_FUNC;
-    CActiveScheduler::Add( this );
-    }
-
-CSconAsyncHandler* CSconAsyncHandler::NewL()
-    {
-    TRACE_FUNC;
-    CSconAsyncHandler* self = new(ELeave) CSconAsyncHandler();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-void CSconAsyncHandler::ConstructL()
-    {
-    TRACE_FUNC;
-    User::LeaveIfError( iFs.Connect() );
-    TInt err = iFs.CreatePrivatePath( EDriveC );
-    LOGGER_WRITE_1("CreatePrivatePath err: %d", err);
-    iStringPool.OpenL();
-    iTimeOut = CCSconTimeOut::NewL( *this );
-    }
-
-// -----------------------------------------------------------------------------
-// CSconAsyncHandler::HandleServiceL()
-// Handles the client request
-// -----------------------------------------------------------------------------
-//
-void CSconAsyncHandler::HandleServiceL( const RMessage2& aMessage )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aMessage.Function() == ECancelRequest )
-        {
-        LOGGER_WRITE("ECancelRequest");
-        if ( IsActive() )
-            {
-            Cancel();
-            LOGGER_WRITE("iMessage.Complete( KErrCancel )");
-            CompleteRequest( KErrCancel );
-            }
-        
-        LOGGER_WRITE("aMessage.Complete( KErrNone )");
-        aMessage.Complete( KErrNone );
-        TRACE_FUNC_EXIT;
-        return;
-        }
-    
-    iTimeOut->Start( KDefaultTimeOutInMicroSeconds );
-    
-    iMessage = aMessage;
-    switch ( aMessage.Function() )
-        {
-        case ESendChunkHandle:
-            LOGGER_WRITE( "CSconSyncSession::ServiceL() : ESendChunkHandle" );
-            HandleChunkMessage();
-            break;
-            
-        case EListImplementations:
-            LOGGER_WRITE( "CSconSyncSession::ServiceL() : EListImplementations" );
-            ListAllImplementationsL();
-            break;
-            
-        case EOpenStore:
-            LOGGER_WRITE( "CSconSyncSession::ServiceL() : EOpenStore" );
-            iTimeOut->Start( KOpenStoreTimeOutInMicroSeconds );
-            OpenStoreL();
-            break;
-            
-        case EOpenItem:
-            OpenItemL();
-            break;
-        case ECreateItem:
-            CreateItemL();
-            break;
-        case EReplaceItem:
-            ReplaceItemL();
-            break;
-        case EMoveItem:
-            MoveItemL();
-            break;
-        case EDeleteItem:
-            DeleteItemL();
-            break;
-        case ESoftDeleteItem:
-            SoftDeleteItemL();
-            break;
-        case EDeleteAllItems:
-            iTimeOut->Start( KDeleteAllTimeOutInMicroSeconds );
-            DeleteAllItemsL();
-            break;
-        case EReadParent:
-            ReadParentL();
-            break;
-            
-        case EHasHistory:
-            HasHistoryL();
-            break;
-        case EAddedItems:
-            AddedItemsL();
-            break;
-        case EDeletedItems:
-            DeletedItemsL();
-            break;
-        case ESoftDeletedItems:
-            SoftDeletedItemsL();
-            break;
-        case EModifiedItems:
-            ModifiedItemsL();
-            break;
-        case EMovedItems:
-            MovedItemsL();
-            break;
-        case EResetChangeInfo:
-            ResetChangeInfoL();
-            break;
-        case ECommitChangeInfo:
-            CommitChangeInfoL();
-            break;
-        case ECloseStore:
-            CloseStore();
-            break;
-        case ESetSyncTimeStamp:
-            SetSyncTimeStampL();
-            break;
-        case EGetSyncTimeStamp:
-            GetSyncTimeStampL();
-            break;
-        case EExportStoreFormat:
-            ExportStoreFormatL();
-            break;
-        case ESetRemoteStoreFormat:
-            SetRemoteStoreFormatL();
-            break;
-            
-        default:
-            aMessage.Complete(KErrNotSupported);
-            break;
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-
-void CSconAsyncHandler::RunL()
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("iStatus.Int(): %d", iStatus.Int());
-    switch ( iMessage.Function() )
-        {
-        case EOpenStore:
-            LOGGER_WRITE( "CSconAsyncHandler::RunL() : EOpenStore" );
-            CompleteRequest( iStatus.Int() );
-            break;
-            
-        case EOpenItem:
-            LOGGER_WRITE( "CSconAsyncHandler::RunL() : EOpenItem" );
-            OpenItemCompletedL( iStatus.Int() );
-            break;
-            
-        case ECreateItem:
-            LOGGER_WRITE( "CSconAsyncHandler::RunL() : ECreateItem" );
-            if (!iCommitInProgress)
-                {
-                // Write data to item
-                CreateItemCompletedL( iStatus.Int() );
-                }
-            else
-                {
-                // commit is done, all ready
-                LOGGER_WRITE( "CSconAsyncHandler::RunL() : ECreateItem, commit done" );
-                TPckg<TSmlDbItemUid> pckg(iNewItem);
-                iMessage.WriteL( 0, pckg, 0);
-                CompleteRequest( iStatus.Int() );
-                }
-            break;
-            
-        case EReplaceItem:
-            LOGGER_WRITE( "CSconAsyncHandler::RunL() : EReplaceItem" );
-            if (!iCommitInProgress)
-                {
-                // Write data to item
-                ReplaceItemCompletedL( iStatus.Int() );
-                }
-            else
-                {
-                // commit is done, all ready
-                LOGGER_WRITE( "CSconAsyncHandler::RunL() : EReplaceItem, commit done" );
-                CompleteRequest( iStatus.Int() );
-                }
-            break;
-            
-        case EMoveItem:
-            LOGGER_WRITE( "CSconAsyncHandler::RunL() : EMoveItem" );
-            CompleteRequest( iStatus.Int() );
-            break;
-            
-        case EDeleteItem:
-            LOGGER_WRITE( "CSconAsyncHandler::RunL() : EDeleteItem" );
-            CompleteRequest( iStatus.Int() );
-            break;
-            
-        case ESoftDeleteItem:
-            LOGGER_WRITE( "CSconAsyncHandler::RunL() : ESoftDeleteItem" );
-            CompleteRequest( iStatus.Int() );
-            break;
-            
-        case EDeleteAllItems:
-            LOGGER_WRITE( "CSconAsyncHandler::RunL() : EDeleteAllItems" );
-            CompleteRequest( iStatus.Int() );
-            break;
-            
-        case EReadParent:
-            LOGGER_WRITE( "CSconAsyncHandler::RunL() : EReadParent" );
-            ReadParentCompletedL( iStatus.Int() );
-            break;
-            
-        case EResetChangeInfo:
-            LOGGER_WRITE( "CSconAsyncHandler::RunL() : EResetChangeInfo" );
-            CompleteRequest( iStatus.Int() );
-            break;
-            
-        case ECommitChangeInfo:
-            LOGGER_WRITE( "CSconAsyncHandler::RunL() : ECommitChangeInfo" );
-            delete iItems;
-            iItems = NULL;
-            CompleteRequest( iStatus.Int() );
-            break;
-            
-        default:
-            LOGGER_WRITE("Not asynchronous function")
-            CompleteRequest( KErrNotSupported );
-            break;
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-TInt CSconAsyncHandler::RunError(TInt aError)
-    {
-    LOGGER_WRITE_1("CSconAsyncHandler::RunError() aError: %d", aError);
-    delete iItems;
-    iItems = NULL;
-    delete iWriteData;
-    iWriteData = NULL;
-    
-    if ( IsActive() )
-        {
-        LOGGER_WRITE("IsActive");
-        //iDataStore->CancelRequest();
-        Cancel();
-        }
-    
-    if ( iDataStore && iMessage.Function() == EOpenItem )
-        {
-        LOGGER_WRITE( "CSconAsyncHandler::RunError() : EOpenItem" );
-        iDataStore->CloseItem();
-        }
-    
-    CompleteRequest( aError );
-    aError = KErrNone;
-    LOGGER_WRITE_1("CSconAsyncHandler::RunError() : Return %d", aError);
-    return aError;
-    //return KErrNone;//aError;
-    }
-
-void CSconAsyncHandler::DoCancel()
-    {
-    TRACE_FUNC_ENTRY;
-    iDataStore->CancelRequest();
-    iTimeOut->Cancel();
-    
-    if ( iStatus == KRequestPending )
-        {
-        LOGGER_WRITE( "iStatus == KRequestPending" );
-        }
-    
-    if ( iDataStore && iMessage.Function() == EOpenItem )
-        {
-        LOGGER_WRITE( "CSconAsyncHandler::RunError() : EOpenItem" );
-        iDataStore->CloseItem();
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::TimeOut()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( IsActive() )
-        {
-        Cancel();
-        CompleteRequest( KErrCancel );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-
-void CSconAsyncHandler::HandleChunkMessage()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret ( KErrNone );
-    
-    ret = iChunk.Open( iMessage, 0, EFalse );
-        
-    LOGGER_WRITE_1( "CSconAsyncHandler::HandleChunkMessageL() : ret %d", ret );
-    CompleteRequest( ret );
-    }
-
-
-
-void CSconAsyncHandler::ListAllImplementationsL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    RImplInfoPtrArray implInfoArray;
-    CleanupResetAndDestroyPushL( implInfoArray );
-    REComSession::ListImplementationsL( KDSEcomIFUid, implInfoArray );
-    
-    const TInt KDataproviderInfoSize = 250; // 250 bytes should be enought
-    TInt requiredSize = implInfoArray.Count() * KDataproviderInfoSize;
-    if ( iChunk.Size() < requiredSize )
-        {
-        User::LeaveIfError( iChunk.Adjust( requiredSize ) );
-        }
-    
-    RMemWriteStream stream ( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( stream );
-    
-    RSconDataProviderInfoArray dpInfoArray;
-    CleanupResetAndDestroyPushL( dpInfoArray );
-    
-    // Collect information from dataproviders
-    for ( TInt i=0; i < implInfoArray.Count(); i++ )
-        {
-        LOGGER_WRITE_1("implInfoArray: %d",i);
-        CImplementationInformation& implInfo = *implInfoArray[i];
-        
-        CSmlDataProvider* dp(NULL);
-        TRAPD( err, dp = CSmlDataProvider::NewL( implInfo.ImplementationUid().iUid ) );
-        LOGGER_WRITE_2("CSmlDataProvider::NewL, uid(0x%08x) err: %d",implInfo.ImplementationUid().iUid, err );
-        if ( !err )
-            {
-            CleanupStack::PushL( dp );
-            
-            CSconDataproviderInfo *dpInfo = CSconDataproviderInfo::NewL();
-            CleanupStack::PushL( dpInfo );
-            
-            dpInfo->SetImplementationUid( implInfo.ImplementationUid() );
-            LOGGER_WRITE_1("ImplementationUid: 0x%08x", implInfo.ImplementationUid().iUid );
-            dpInfo->SetDisplayNameL( implInfo.DisplayName() );
-            LOGGER_WRITE_1("DisplayName: %S", &implInfo.DisplayName() );
-            
-            dpInfo->SetDefaultStoreL( dp->DefaultStoreL() );
-            LOGGER_WRITE_1("DefaultStoreL: %S", &dp->DefaultStoreL() );
-            CDesCArray* stores = dp->ListStoresLC();
-            dpInfo->SetStoresL( *stores );
-            CleanupStack::PopAndDestroy( stores );
-            
-            dpInfoArray.AppendL( dpInfo );
-            CleanupStack::Pop( dpInfo );
-            
-            CleanupStack::PopAndDestroy( dp );
-            }
-        }
-    
-    // Wrtie to stream
-    stream.WriteUint16L( dpInfoArray.Count() );
-    for ( TInt i = 0; i < dpInfoArray.Count(); i++ )
-        {
-        CSconDataproviderInfo& dpInfo = *dpInfoArray[i];
-        dpInfo.ExternalizeL( stream );
-        }
-    
-    stream.CommitL();
-    
-    CleanupStack::PopAndDestroy( &dpInfoArray );
-    CleanupStack::PopAndDestroy( &stream );
-    CleanupStack::PopAndDestroy( &implInfoArray );
-    
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::OpenStoreL()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iDataStore )
-        {
-        LOGGER_WRITE("Warning: Previous DataStore was not closed properly.");
-        DoCloseStore();
-        }
-    
-    // copy data from the chunk
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    
-    TSmlDataProviderId providerId = readStream.ReadUint32L();
-    LOGGER_WRITE_1("providerId: 0x%08x", providerId);
-    
-    TInt len = readStream.ReadUint32L();
-    HBufC* storeName = HBufC::NewLC(len);
-    TPtr storeNamePtr = storeName->Des();
-    readStream.ReadL(storeNamePtr, len);
-    LOGGER_WRITE_1("storeName: %S", &storeNamePtr);
-    
-    TInt contextUid = readStream.ReadUint32L();
-    
-    LOGGER_WRITE_1("contextIdentifier: 0x%08x", contextUid);
-    
-    LOGGER_WRITE("Open provider");
-    delete iDataProvider;
-    iDataProvider = NULL;
-    iDataProvider = CSmlDataProvider::NewL( providerId );
-    
-    delete iContext;
-    iContext = NULL;
-    
-    delete iStoreFormat;
-    iStoreFormat = NULL;
-
-    LOGGER_WRITE("Create context");
-    iContext = CSconSyncRelationship::NewL( iFs, TUid::Uid(contextUid), providerId );
-    
-    
-    LOGGER_WRITE("Create NewStoreInstanceLC");
-    iDataStore = iDataProvider->NewStoreInstanceLC();
-    CleanupStack::Pop( iDataStore );
-    
-    SetActive();
-    iStatus = KRequestPending;
-    LOGGER_WRITE("OpenL");
-    TRAPD(err, iDataStore->OpenL(storeNamePtr,*iContext, iStatus));
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->OpenL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    
-    CleanupStack::PopAndDestroy( storeName );
-    CleanupStack::PopAndDestroy( &readStream );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-
-void CSconAsyncHandler::OpenItemL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    if ( IsActive() )
-        {
-        LOGGER_WRITE("Was still in Active");
-        Cancel();
-        }
-    
-    TSmlDbItemUid itemUid = iMessage.Int0();
-    LOGGER_WRITE_1("Open item: %d", itemUid);
-    
-    // set default values
-    iFieldChange = EFalse;
-    iSize = 0;
-    iParent = 0;
-    iMimeType.Copy(KNullDesC);
-    iMimeVer.Copy(KNullDesC);
-    
-    SetActive();
-    LOGGER_WRITE("iDataStore->OpenItemL");
-    iStatus = KRequestPending;
-    TRAPD( err, iDataStore->OpenItemL(itemUid,iFieldChange,iSize,iParent,iMimeType,iMimeVer,iStatus));
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->OpenItemL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::OpenItemCompletedL( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    // item opened, now read it
-    if ( aError )
-        {
-        CompleteRequest( aError );
-        return;
-        }
-    LeaveIfNoInstanceL();
-    
-    LOGGER_WRITE_1("item size: %d", iSize);
-    
-    TInt totalObjectSize( 0 );
-    totalObjectSize+= sizeof(TInt32);   // data length
-    totalObjectSize+= iSize;            // data
-    totalObjectSize+= sizeof(TInt8);    // iFieldChange
-    totalObjectSize+= sizeof(TInt32);   // iParent
-    totalObjectSize+= sizeof(TInt32);   // iMimeType
-    totalObjectSize+= iMimeType.Length();  // iMimeType
-    totalObjectSize+= sizeof(TInt32);   // iMimeVer
-    totalObjectSize+= iMimeVer.Length();  // iMimeType
-    
-    LOGGER_WRITE_1("iChunk.Size(): %d", iChunk.Size());
-    LOGGER_WRITE_1("iChunk.MaxSize(): %d", iChunk.MaxSize());
-    LOGGER_WRITE_1("totalObjectSize: %d", totalObjectSize);
-    
-    if ( iChunk.Size() < totalObjectSize )
-        {
-        LOGGER_WRITE("adjust chunk");
-        TInt err = iChunk.Adjust( totalObjectSize );
-        LOGGER_WRITE_1("Chunk.Adjust err: %d", err);
-        User::LeaveIfError( err );
-        }
-    LOGGER_WRITE_1("new Chunk size: %d", iChunk.Size());
-    LOGGER_WRITE_1("new ChunkMaxSize(): %d", iChunk.MaxSize());
-    RMemWriteStream stream ( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( stream );
-    
-    LOGGER_WRITE("ReadItemL");
-    HBufC8* tempBuf = HBufC8::NewLC(iSize);
-    TPtr8 tempPtr = tempBuf->Des();
-    
-    TUint8* ptr = (TUint8*) tempPtr.Ptr();
-    
-    TPtr8 tempPtr2( ptr, 0, iSize );
-    LOGGER_WRITE_1( "tempPtr2.Size(): %d", tempPtr2.Size());
-    iDataStore->ReadItemL( tempPtr2 );
-    LOGGER_WRITE("ReadItemL -ok");
-    
-    LOGGER_WRITE_1("readed Length: %d", tempPtr2.Length() );
-    LOGGER_WRITE_1("readed Size: %d", tempPtr2.Size() );
-    
-    LOGGER_WRITE8_1("iMimeType: %S", &iMimeType );
-    LOGGER_WRITE_1("iMimeType.Length(): %d", iMimeType.Length() );
-    LOGGER_WRITE_1("iMimeType Size: %d", iMimeType.Size() );
-    
-    LOGGER_WRITE8_1("iMimeVer: %S", &iMimeVer );
-    LOGGER_WRITE_1("iMimeVer.Length(): %d", iMimeVer.Length() );
-    LOGGER_WRITE_1("iMimeVer Size: %d", iMimeVer.Size() );
-    
-    iDataStore->CloseItem();
-    LOGGER_WRITE("Write to chunk");
-    stream.WriteInt32L( tempPtr2.Length() );
-    stream.WriteL( tempPtr2 );
-    CleanupStack::PopAndDestroy( tempBuf );
-    
-    stream.WriteInt8L( (TInt)iFieldChange );
-    stream.WriteInt32L( iParent );
-    stream.WriteInt32L( iMimeType.Length() );
-    stream.WriteL( iMimeType );
-    stream.WriteInt32L( iMimeVer.Length() );
-    stream.WriteL( iMimeVer );
-    
-    stream.CommitL();
-    LOGGER_WRITE("Writed ok");
-    CleanupStack::PopAndDestroy( &stream );
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::CreateItemL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    iCommitInProgress = EFalse;
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    
-    TSmlDbItemUid parent = readStream.ReadUint32L();
-    TInt len = readStream.ReadUint32L();
-    readStream.ReadL(iMimeType, len);
-    len = readStream.ReadUint32L();
-    readStream.ReadL(iMimeVer, len);
-    len = readStream.ReadUint32L();
-    delete iWriteData;
-    iWriteData = NULL;
-    iWriteData = HBufC8::New(len);
-    TPtr8 dataPtr = iWriteData->Des();
-    readStream.ReadL(dataPtr, len);
-    CleanupStack::PopAndDestroy( &readStream );
-    SetActive();
-    iStatus = KRequestPending;
-    TRAPD(err, iDataStore->CreateItemL( iNewItem, dataPtr.Size(), parent, iMimeType, iMimeVer, iStatus ));
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->CreateItemL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::CreateItemCompletedL( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    User::LeaveIfError( aError );
-    LeaveIfNoInstanceL();
-    // CreateItem completed, now we must write the data to the created item and commit it.
-    
-    iDataStore->WriteItemL( iWriteData->Des() );
-    delete iWriteData;
-    iWriteData = NULL;
-    SetActive();
-    iStatus = KRequestPending;
-    TRAPD(err, iDataStore->CommitItemL( iStatus ));
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->CommitItemL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    iCommitInProgress = ETrue;
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::ReplaceItemL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    
-    iCommitInProgress = EFalse;
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    
-    TSmlDbItemUid uid = readStream.ReadUint32L();
-    TSmlDbItemUid parent = readStream.ReadUint32L();
-    TBool fieldChange = readStream.ReadUint8L();
-    TInt len = readStream.ReadUint32L();
-    delete iWriteData;
-    iWriteData = NULL;
-    iWriteData = HBufC8::New(len);
-    TPtr8 dataPtr = iWriteData->Des();
-    readStream.ReadL(dataPtr, len);
-    
-    CleanupStack::PopAndDestroy( &readStream );
-    SetActive();
-    iStatus = KRequestPending;
-    TRAPD(err,iDataStore->ReplaceItemL( uid,dataPtr.Size(),parent,fieldChange, iStatus ));
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->CommitItemL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::ReplaceItemCompletedL( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    User::LeaveIfError( aError );
-    LeaveIfNoInstanceL();
-    // CreateItem completed, now we must write the data to the created item and commit it.
-    
-    iDataStore->WriteItemL( iWriteData->Des() );
-    delete iWriteData;
-    iWriteData = NULL;
-    
-    SetActive();
-    iStatus = KRequestPending;
-    TRAPD(err, iDataStore->CommitItemL( iStatus ));
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->CommitItemL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    iCommitInProgress = ETrue;
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::MoveItemL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    TSmlDbItemUid uid = iMessage.Int0();
-    TSmlDbItemUid newParent = iMessage.Int1();
-    LOGGER_WRITE_1( "uid: %d", uid );
-    LOGGER_WRITE_1( "newParent: %d", newParent );
-    
-    SetActive();
-    iStatus = KRequestPending;
-    TRAPD(err, iDataStore->MoveItemL( uid, newParent, iStatus )); 
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->MoveItemL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::DeleteItemL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    
-    TSmlDbItemUid uid = iMessage.Int0();
-    LOGGER_WRITE_1( "uid: %d", uid );
-    
-    SetActive();
-    iStatus = KRequestPending;
-    TRAPD(err, iDataStore->DeleteItemL( uid, iStatus ));
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->DeleteItemL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::SoftDeleteItemL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    
-    TSmlDbItemUid uid = iMessage.Int0();
-    LOGGER_WRITE_1( "uid: %d", uid );
-    
-    SetActive();
-    iStatus = KRequestPending;
-    TRAPD(err, iDataStore->SoftDeleteItemL( uid, iStatus ));
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->SoftDeleteItemL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::DeleteAllItemsL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    
-    SetActive();
-    iStatus = KRequestPending;
-    TRAPD(err, iDataStore->DeleteAllItemsL( iStatus ));
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->DeleteAllItemsL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::ReadParentL()
-    {
-    TRACE_FUNC_ENTRY;
-    OpenItemL();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::ReadParentCompletedL( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    // item opened, now read it
-    if ( aError )
-        {
-        CompleteRequest( aError );
-        return;
-        }
-    LeaveIfNoInstanceL();
-    
-    iDataStore->CloseItem();
-    
-    TPckg<TSmlDbItemUid> pckg(iParent);
-    iMessage.WriteL( 1, pckg, 0);
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::HasHistoryL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    TBool hasHistory = iDataStore->HasSyncHistory();
-    
-    TPckgC<TBool> pckg(hasHistory);
-    iMessage.WriteL( 0, pckg, 0);
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::AddedItemsL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    const MSmlDataItemUidSet& items = iDataStore->AddedItems();
-    
-    RMemWriteStream stream ( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( stream );
-    items.ExternalizeL( stream );
-    CleanupStack::PopAndDestroy( &stream );
-    
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::DeletedItemsL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    const MSmlDataItemUidSet& items = iDataStore->DeletedItems();
-    
-    RMemWriteStream stream ( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( stream );
-    items.ExternalizeL( stream );
-    CleanupStack::PopAndDestroy( &stream );
-    
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::SoftDeletedItemsL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    const MSmlDataItemUidSet& items = iDataStore->SoftDeletedItems();
-    
-    RMemWriteStream stream ( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( stream );
-    items.ExternalizeL( stream );
-    CleanupStack::PopAndDestroy( &stream );
-    
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::ModifiedItemsL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    const MSmlDataItemUidSet& items = iDataStore->ModifiedItems();
-    
-    RMemWriteStream stream ( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( stream );
-    items.ExternalizeL( stream );
-    CleanupStack::PopAndDestroy( &stream );
-    
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::MovedItemsL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    const MSmlDataItemUidSet& items = iDataStore->MovedItems();
-    
-    RMemWriteStream stream ( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( stream );
-    items.ExternalizeL( stream );
-    CleanupStack::PopAndDestroy( &stream );
-    
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::ResetChangeInfoL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    SetActive();
-    iStatus = KRequestPending;
-    TRAPD(err, iDataStore->ResetChangeInfoL( iStatus ));
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->ResetChangeInfoL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::CommitChangeInfoL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    
-    if ( iItems )
-        {
-        delete iItems;
-        iItems = NULL;
-        }
-    iItems = new (ELeave) CNSmlDataItemUidSet();
-    iItems->InternalizeL( readStream );
-    
-    CleanupStack::PopAndDestroy( &readStream );
-    
-    SetActive();
-    iStatus = KRequestPending;
-    TRAPD(err, iDataStore->CommitChangeInfoL( iStatus, *iItems ));
-    if ( err )
-        {
-        // we are on active state, call request completed (RunL)
-        LOGGER_WRITE_1("iDataStore->CommitChangeInfoL leaved with err: %d", err);
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::CloseStore()
-    {
-    TRACE_FUNC_ENTRY;
-    DoCloseStore();
-    REComSession::FinalClose();
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::SetSyncTimeStampL()
-    {
-    TRACE_FUNC_ENTRY;
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    TInt relationId = readStream.ReadInt32L();
-    TInt providerId = readStream.ReadInt32L();
-    CleanupStack::PopAndDestroy( &readStream );
-    
-    CSconSyncRelationship::SetTimeStampL( iFs, TUid::Uid(relationId), providerId);
-    
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::GetSyncTimeStampL()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt providerId = iMessage.Int0();
-    TInt relationId = iMessage.Int1();
-        
-    TDateTime time;
-    CSconSyncRelationship::GetTimeStampL( iFs, TUid::Uid(relationId), providerId, time);
-    
-    // write timestamp
-    TPckgC<TDateTime> timeBuf(time);
-    iMessage.WriteL( 2, timeBuf, 0);
-    
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::ExportStoreFormatL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    if ( !iDataProvider )
-        {
-        User::Leave( KErrNotReady );
-        }
-    CBufFlat* buffer = CBufFlat::NewL( KDefaultExpandSize );
-    CleanupStack::PushL( buffer );
-    RBufWriteStream stream( *buffer );
-    CleanupClosePushL( stream );
-    
-    const CSmlDataStoreFormat& storeFormat = iDataProvider->StoreFormatL();
-    TRAP_IGNORE( TLogDataStoreFormat::LogDataStoreFormatL( _L("iDataProvider->StoreFormatL()"), storeFormat ));
-    
-    storeFormat.ExternalizeL( stream );
-    
-    stream.CommitL();
-    CleanupStack::PopAndDestroy( &stream );
-    buffer->Compress();
-    
-    RMemWriteStream chunkStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( chunkStream );
-    
-    chunkStream.WriteInt32L( buffer->Size() );
-    chunkStream.WriteL( buffer->Ptr(0), buffer->Size());
-    chunkStream.CommitL();
-    CleanupStack::PopAndDestroy( &chunkStream );
-    
-    CleanupStack::PopAndDestroy( buffer );
-    
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::SetRemoteStoreFormatL()
-    {
-    TRACE_FUNC_ENTRY;
-    LeaveIfNoInstanceL();
-    
-    RMemReadStream readStream( iChunk.Base(), iChunk.Size() );
-    CleanupClosePushL( readStream );
-    
-    if ( iStoreFormat )
-        {
-        delete iStoreFormat;
-        iStoreFormat = NULL;
-        }
-    iStoreFormat = CSmlDataStoreFormat::NewLC( iStringPool, readStream);
-    CleanupStack::Pop( iStoreFormat );
-    TRAP_IGNORE( TLogDataStoreFormat::LogDataStoreFormatL( _L("iDataProvider->SetRemoteStoreFormatL()"), *iStoreFormat ));
-    iDataStore->SetRemoteStoreFormatL( *iStoreFormat );
-    
-    CleanupStack::PopAndDestroy( &readStream );
-    
-    CompleteRequest( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::LeaveIfNoInstanceL()
-    {
-    if ( !iDataStore )
-        {
-        LOGGER_WRITE("DataStore instance was not ready, leaving KErrNotReady");
-        User::Leave( KErrNotReady );
-        }
-    }
-
-void CSconAsyncHandler::DoCloseStore()
-    {
-    TRACE_FUNC_ENTRY;
-    delete iItems;
-    iItems = NULL;
-    delete iWriteData;
-    iWriteData = NULL;
-    if ( iDataProvider && iContext )
-        {
-        TInt providerId = iDataProvider->Identifier();
-        TInt contextId = iContext->SyncTaskKey();
-        TRAP_IGNORE( CSconSyncRelationship::SetTimeStampL( iFs, TUid::Uid(contextId), providerId) );
-        }
-    delete iDataStore;
-    iDataStore = NULL;
-    delete iDataProvider;
-    iDataProvider = NULL;
-    delete iContext;
-    iContext = NULL;
-    delete iStoreFormat;
-    iStoreFormat = NULL;
-    
-    CleanOldStoresL();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::CleanOldStoresL()
-    {
-    TRACE_FUNC_ENTRY;
-    TFileName path;
-    User::LeaveIfError( iFs.PrivatePath( path ) );
-    CDir* dir;
-    iFs.GetDir( path, KEntryAttNormal, ESortByDate, dir );
-    CleanupStack::PushL( dir );
-    TInt storesCount(0);
-    LOGGER_WRITE_1("count: %d", dir->Count() );
-    for ( TInt i=dir->Count()-1; i >= 0; i-- )
-        {
-        LOGGER_WRITE_1("dir[%d]", i);
-        TEntry entry = (*dir)[i];
-        LOGGER_WRITE_1("file: %S", &entry.iName);
-        _LIT(KContextStoreName, "contextstore");
-        _LIT(KTimeStoreName, "timestore");
-        if ( entry.iName.Find(KContextStoreName) == 0 )
-            {
-            storesCount++;
-            LOGGER_WRITE_1("storeNro: %d", storesCount);
-#ifdef _DEBUG
-            TTime time = entry.iModified;
-            TDateTime dt = time.DateTime();
-            _LIT(KFormat, "%d.%d %02d:%02d");
-            TFileName mod;
-            mod.Format(KFormat, dt.Day()+1, dt.Month()+1, dt.Hour()+1,dt.Minute() );
-            LOGGER_WRITE_1("time: %S", &mod);
-#endif
-            if ( storesCount > KMaxStoresCount )
-                {
-                LOGGER_WRITE_1("delete contextstore: '%S'", &entry.iName );
-                iFs.Delete( entry.iName );
-                TFileName timeStoreFile;
-                timeStoreFile = entry.iName.Right(15);
-                timeStoreFile.Insert(0, KTimeStoreName);
-                LOGGER_WRITE_1("delete timeStoreFile: %S", &timeStoreFile);
-                iFs.Delete( timeStoreFile );
-                }
-            }
-        
-        }
-    CleanupStack::PopAndDestroy( dir );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconAsyncHandler::CompleteRequest( TInt aError )
-    {
-    TRACE_FUNC;
-    iTimeOut->Cancel();
-    LOGGER_WRITE_1("iMessage.Complete( %d )", aError);
-    iMessage.Complete( aError );
-    }
--- a/connectivitymodules/SeCon/servers/syncserver/src/sconsyncrelationship.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +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:  CSconSyncRelationship implementation
-*
-*/
-
-
-#include "sconsyncrelationship.h"
-#include <s32file.h>
-#include <nsmlchangefinder.h>
-
-#include "debug.h"
-
-_LIT(KContextStore, "contextstore_0x%08x.dat");
-_LIT(KTimeStore, "timestore_0x%08x.dat");
-
-CSconSyncRelationship::~CSconSyncRelationship()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iDictionaryStore )
-        {
-        iDictionaryStore->Commit();
-        delete iDictionaryStore;
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-CSconSyncRelationship::CSconSyncRelationship( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aProviderId )
-    : iFs(aFs), iID(aRelationUid), iProviderId(aProviderId)
-    {
-    TRACE_FUNC;
-    
-    }
-
-CSconSyncRelationship* CSconSyncRelationship::NewL( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aProviderId )
-    {
-    TRACE_FUNC_ENTRY;
-    CSconSyncRelationship* self = new (ELeave) CSconSyncRelationship( aFs, aRelationUid, aProviderId );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-void CSconSyncRelationship::SetTimeStampL( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aId )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aRelationUid: 0x%08x", aRelationUid.iUid );
-    LOGGER_WRITE_1("aId: 0x%08x", aId );
-    aFs.SetSessionToPrivate( EDriveC );
-    TFileName file;
-    file.Format(KTimeStore, aRelationUid.iUid);
-    CDictionaryFileStore* dictionaryStore = CDictionaryFileStore::OpenLC(aFs, file, TUid::Uid(0x0001));
-    
-    RDictionaryWriteStream stream;
-    stream.AssignLC( *dictionaryStore, TUid::Uid(aId) );
-    
-    TTime time;
-    time.UniversalTime();
-    
-    TDateTime dateTime = time.DateTime();
-    TPckgBuf<TDateTime> timeBuf(dateTime);
-    
-    stream.WriteL( timeBuf );
-    stream.CommitL();
-    
-    CleanupStack::PopAndDestroy( &stream ); //AssingLC
-    dictionaryStore->Commit();
-    CleanupStack::PopAndDestroy( dictionaryStore );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncRelationship::GetTimeStampL( RFs& aFs, TUid aRelationUid, TSmlDataProviderId aId, TDateTime& aTimeStamp )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aRelationUid: 0x%08x", aRelationUid.iUid );
-    LOGGER_WRITE_1("aId: 0x%08x", aId );
-    User::LeaveIfError( aFs.SetSessionToPrivate( EDriveC ) );
-    TFileName file;
-    file.Format(KTimeStore, aRelationUid.iUid);
-    CDictionaryFileStore* dictionaryStore = CDictionaryFileStore::OpenLC(aFs, file, TUid::Uid(0x0001));
-    TBool present = dictionaryStore->IsPresentL( TUid::Uid(aId) );
-    if ( !present )
-        {
-        LOGGER_WRITE("Stream was not present");
-        User::Leave(KErrNotFound);
-        }
-    RDictionaryReadStream stream;
-    stream.OpenLC( *dictionaryStore, TUid::Uid(aId) );
-    TPckgBuf<TDateTime> timeBuf;
-    stream.ReadL( timeBuf );
-    aTimeStamp = timeBuf();
-    CleanupStack::PopAndDestroy(); //OpenLC
-    CleanupStack::PopAndDestroy( dictionaryStore );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncRelationship::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    iFs.SetSessionToPrivate( EDriveC );
-    TFileName file;
-    file.Format(KContextStore, iID.iUid);
-    iDictionaryStore = CDictionaryFileStore::OpenL(
-            iFs, file, TUid::Uid(0x0001));
-    
-    TRACE_FUNC_EXIT;
-    }
-
-
-TSmlSyncTaskKey CSconSyncRelationship::SyncTaskKey() const
-    {
-    TRACE_FUNC;
-    return static_cast<TSmlSyncTaskKey>(iID.iUid);
-    }
-
-void CSconSyncRelationship::OpenReadStreamLC(RReadStream& aReadStream, TUid aStreamUid)
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aStreamUid: 0x%08x", aStreamUid);
-    TUid streamUid(aStreamUid);
-    if ( aStreamUid.iUid == KNSmlDefaultSnapshotStreamUID )
-        {
-        LOGGER_WRITE_1(" Default stream uid was used, use provider uid (0x%08x) as stream uid", iProviderId);
-        streamUid.iUid = iProviderId;
-        }
-    if ( !IsStreamPresentL( streamUid ) )
-        {
-        LOGGER_WRITE("Stream was not present");
-        User::Leave(KErrNotFound);
-        }
-    
-        
-    static_cast<RDictionaryReadStream&>(aReadStream).OpenLC(
-        *iDictionaryStore, streamUid );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncRelationship::OpenWriteStreamLC(RWriteStream& aWriteStream, TUid aStreamUid)
-    {
-    TRACE_FUNC_ENTRY;
-    
-    LOGGER_WRITE_1("aStreamUid: 0x%08x", aStreamUid);
-    TUid streamUid(aStreamUid);
-    if ( aStreamUid.iUid == KNSmlDefaultSnapshotStreamUID )
-        {
-        LOGGER_WRITE_1(" Default stream uid was used, use provider uid (0x%08x) as stream uid", iProviderId);
-        streamUid.iUid = iProviderId;
-        }
-    static_cast<RDictionaryWriteStream&>(aWriteStream).AssignLC(
-                 *iDictionaryStore, streamUid );
-    TRACE_FUNC_EXIT;
-    }
-
-TBool CSconSyncRelationship::IsStreamPresentL(TUid aStreamUid) const
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aStreamUid: 0x%08x", aStreamUid.iUid );
-    TUid streamUid(aStreamUid);
-    if ( aStreamUid.iUid == KNSmlDefaultSnapshotStreamUID )
-        {
-        LOGGER_WRITE_1(" Default stream uid was used, use provider uid (0x%08x) as stream uid", iProviderId);
-        streamUid.iUid = iProviderId;
-        }
-    TBool present = iDictionaryStore->IsPresentL( streamUid );
-    LOGGER_WRITE_1("CSconSyncRelationship::IsStreamPresentL() return: %d",(TInt)present);
-    return present;
-    }
--- a/connectivitymodules/SeCon/servers/syncserver/src/sconsyncserver.cpp	Tue Aug 31 15:05:37 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:  CSconSyncServer implementation
-*
-*/
-
-
-#include "sconsyncserver.h"
-#include "sconsyncclientserver.h"
-
-#include "sconsyncsession.h"
-#include "debug.h"
-
-const TInt KSConPCConnServerUid = 0x101F99F6;
-
-// Security policy
-const TUint KServerPolicyRangeCount = 2;
-
-const TInt KServerPolicyRanges[KServerPolicyRangeCount] =
-    {
-    0,              // range is 0 inclusive
-    EMaxService     // range is 1-KMaxTInt inclusive
-    };
-
-const TUint8 KServerPolicyElementsIndex[KServerPolicyRangeCount] =
-    {
-    0,                              // applies to 0th range
-    CPolicyServer::ENotSupported    // applies to 1st range
-    };
-
-const CPolicyServer::TPolicyElement KServerPolicyElements[] =
-    {
-    { _INIT_SECURITY_POLICY_S0(KSConPCConnServerUid) /*_INIT_SECURITY_POLICY_C1(ECapabilityReadDeviceData)*/, CPolicyServer::EFailClient }
-    };
-
-const CPolicyServer::TPolicy KServerPolicy =
-    {
-    0 /*CPolicyServer::EAlwaysPass*/, // specifies all connect attempts should pass
-    KServerPolicyRangeCount,                   
-    KServerPolicyRanges,
-    KServerPolicyElementsIndex,
-    KServerPolicyElements
-    };
-
-
-CSconSyncServer* CSconSyncServer::NewL()
-    {
-    CSconSyncServer* self = NewLC();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CSconSyncServer* CSconSyncServer::NewLC()
-    {
-    CSconSyncServer* self = new(ELeave) CSconSyncServer();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-CSconSyncServer::CSconSyncServer() : 
-    CPolicyServer(EPriorityStandard, KServerPolicy, ESharableSessions)
-    {
-    }
-
-void CSconSyncServer::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt error = Start(KSconSyncServerName);
-
-    if (error != KErrNone)
-        {
-        User::Panic(KSconSyncServerName, error);
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-CSconSyncServer::~CSconSyncServer()
-    {
-    TRACE_FUNC;
-    }
-
-CSession2* CSconSyncServer::NewSessionL(const TVersion& aVersion, const RMessage2& /*aMessage*/) const
-    {
-    TRACE_FUNC;
-    TVersion v(1,0,0);
-    if ( !User::QueryVersionSupported(v,aVersion) )
-        {
-        TVersionName vname = aVersion.Name();
-        LOGGER_WRITE_1("Client has wrong version: %S", &vname);
-        User::Leave( KErrNotSupported );
-        }
-    
-    return CSconSyncSession::NewL();
-    }
-
-TInt CSconSyncServer::RunError(TInt aError)
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aError: %d", aError);
-    // Bad descriptor implies bad client
-    if (aError == KErrBadDescriptor)
-        {
-        Message().Panic(KSconSyncServerName, aError);
-        }
-    else
-        {
-        Message().Complete(aError);
-        }
-
-    // Continue handling requests
-    ReStart();
-    TRACE_FUNC_EXIT;
-    return KErrNone;
-    }
-
-void CSconSyncServer::AddSession()
-    {
-    ++iSessionCount;
-    LOGGER_WRITE_1("CSconSyncServer::AddSession(), iSessionCount: %d", iSessionCount);
-    }
-
-void CSconSyncServer::RemoveSession()
-    {
-    --iSessionCount;
-    LOGGER_WRITE_1("CSconSyncServer::RemoveSession(), iSessionCount: %d", iSessionCount);
-    if (iSessionCount == 0)
-        {
-        CActiveScheduler::Stop();
-        }
-    }
-
-LOCAL_C void ExeMainL()
-    {
-    TRACE_FUNC_ENTRY;
-    // Install active scheduler
-    CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
-    CleanupStack::PushL(scheduler);
-    CActiveScheduler::Install(scheduler);
-
-    CSconSyncServer::NewLC();
-
-    User::LeaveIfError(User::RenameThread(KSconSyncServerName));
-    RProcess::Rendezvous(KErrNone);
-
-    CActiveScheduler::Start();
-
-    CleanupStack::PopAndDestroy();  // CSconSyncServer
-    CleanupStack::PopAndDestroy();  // CActiveScheduler
-    TRACE_FUNC_EXIT;
-    }
-
-GLDEF_C TInt E32Main()
-    {
-    TRACE_FUNC_ENTRY;
-    __UHEAP_MARK;
-    CTrapCleanup* cleanup = CTrapCleanup::New();
-    
-    TRAPD(error, ExeMainL());
-    __ASSERT_ALWAYS(!error, User::Panic(KSconSyncServerName, error));
-
-    delete cleanup;
-    __UHEAP_MARKEND;
-    TRACE_FUNC_EXIT;
-    return 0;
-    }
--- a/connectivitymodules/SeCon/servers/syncserver/src/sconsyncsession.cpp	Tue Aug 31 15:05:37 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:  CSconSyncSession implementation
-*
-*/
-
-
-#include "sconsyncsession.h"
-
-#include "sconsyncserver.h"
-#include "sconsyncclientserver.h"
-#include "sconasynchandler.h"
-#include "debug.h"
-
-
-CSconSyncSession::CSconSyncSession() 
-    {
-    TRACE_FUNC;
-    }
-
-CSconSyncSession* CSconSyncSession::NewL()
-    {
-    TRACE_FUNC;
-    CSconSyncSession* self = new(ELeave) CSconSyncSession();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-void CSconSyncSession::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    iAsyncHandler = CSconAsyncHandler::NewL();
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncSession::CreateL()
-    {
-    TRACE_FUNC;
-    Server().AddSession();
-    }
-
-CSconSyncSession::~CSconSyncSession()
-    {
-    TRACE_FUNC_ENTRY;
-    delete iAsyncHandler;
-    
-    Server().RemoveSession();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-CSconSyncServer& CSconSyncSession::Server()
-    {
-    return *static_cast<CSconSyncServer*>(const_cast<CServer2*>(CSession2::Server()));
-    }
-
-
-// -----------------------------------------------------------------------------
-// CSconSyncSession::ServiceL()
-// Handles the client request
-// -----------------------------------------------------------------------------
-//
-void CSconSyncSession::ServiceL(const RMessage2& aMessage)
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TRAPD( err, iAsyncHandler->HandleServiceL( aMessage ));
-    if ( err )
-        {
-        LOGGER_WRITE_1("iAsyncHandler->HandleServiceL leaved: %d", err);
-        if ( iAsyncHandler->IsActive() )
-            {
-            LOGGER_WRITE(" and it was active -> Cancel it");
-            iAsyncHandler->Cancel();
-            }
-        // do server error processing
-        User::Leave( err );
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-
Binary file connectivitymodules/SeCon/services/csc/bld/101f9698.xml has changed
Binary file connectivitymodules/SeCon/services/csc/bld/101f99f6.xml has changed
--- a/connectivitymodules/SeCon/services/csc/bld/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
-* Copyright (c) 2005-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:  Capability Object Module bld.inf file
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS  
-DEFAULT
-
-PRJ_EXPORTS
-../rom/sconcsc.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(sconcsc.iby)
-./101f9698.xml      Z:/private/101F99F6/capability/101f9698.xml
-./fwdcomp.xml       Z:/private/101F99F6/capability/fwdcomp.xml
-./101f99f6.xml      Z:/private/101F99F6/capability/101f99f6.xml
-
-
-PRJ_MMPFILES
-sconcsc.mmp
-
--- a/connectivitymodules/SeCon/services/csc/bld/def/bwinscwu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?CreateCSConCSCL@@YAPAVCSConCSC@@XZ @ 1 NONAME ; class CSConCSC * CreateCSConCSCL(void)
-
--- a/connectivitymodules/SeCon/services/csc/bld/def/eabiuu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	_Z15CreateCSConCSCLv @ 1 NONAME
-	_ZTI8CSConCSC @ 2 NONAME ; #<TI>#
-	_ZTV8CSConCSC @ 3 NONAME ; #<VT>#
-
Binary file connectivitymodules/SeCon/services/csc/bld/fwdcomp.xml has changed
--- a/connectivitymodules/SeCon/services/csc/bld/sconcsc.mmp	Tue Aug 31 15:05:37 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:  Capability Object Module mmp file
-*
-*/
-
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-VENDORID        VID_DEFAULT
-
-CAPABILITY      CAP_GENERAL_DLL
-
-TARGETPATH      sys/bin
-
-TARGET          sconcsc.dll
-TARGETTYPE      DLL
-UID             0x10009D8D 0x101F9698
-
-#if defined(ARMCC)
-DEFFILE	./def/eabiu
-#elif defined(WINSCW) 
-DEFFILE	./def/bwinscw
-#elif defined(WINS)
-DEFFILE	./def/bwins
-#elif defined(ARM)
-DEFFILE	./def/bmarm
-#endif
-
-SOURCEPATH      ../src
-SOURCE          sconcsc.cpp
-SOURCE          capinfo.cpp
-SOURCE          caputils.cpp
-SOURCE          caplist.cpp
-SOURCE          stringlist.cpp
-SOURCE          capparser.cpp
-SOURCE          sconsyncservice.cpp
-SOURCE          sconversioninfo.cpp 
-
-USERINCLUDE     ../inc
-USERINCLUDE     ../../../inc
-
-// Default system include paths.
-APP_LAYER_SYSTEMINCLUDE
-
-DEBUGLIBRARY    flogger.lib
-LIBRARY         euser.lib
-LIBRARY         efsrv.lib
-LIBRARY         bafl.lib
-LIBRARY         sysutil.lib
-LIBRARY         etel.lib
-LIBRARY         etelmm.lib
-LIBRARY         hal.lib
-LIBRARY         platformenv.lib
-LIBRARY         charconv.lib
-LIBRARY	        centralrepository.lib
-LIBRARY         apgrfx.lib
-LIBRARY         apparc.lib
-LIBRARY         sisregistryclient.lib
-LIBRARY         syncmlclientapi.lib
-LIBRARY         javaregistryclient.lib
-LIBRARY         sysversioninfo.lib
-LIBRARY         etel3rdparty.lib
-LIBRARY         platformver.lib
--- a/connectivitymodules/SeCon/services/csc/inc/capability.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,483 +0,0 @@
-/*
-* 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:  Capability service controller
-*
-*/
-
-
-#ifndef _CAPABILITY_H_
-#define _CAPABILITY_H_
-
-#include <e32std.h>
-
-//
-// string sizes
-//
-const TInt KBufSize(128);
-const TInt KTagSize(64);
-const TInt KMaxSize(512);
-
-const TInt KNestingLimit(10);
-
-//
-// this directory contains xml-format files for
-// Service-elements
-//
-_LIT(KCapabilityDirC, "c:\\private\\101F99F6\\capability\\");
-_LIT(KCapabilityDirCImport, "c:\\private\\101F99F6\\import\\");
-_LIT(KCapabilityDirZ, "z:\\private\\101F99F6\\capability\\");
-
-//
-// folder service constants
-//
-_LIT(KFolderServiceName, "Folder-Browsing");
-_LIT(KFolderServiceUid, "F9EC7BC4-953c-11d2-984E-525400DC9E09");
-_LIT(KFolderServiceVersion, "1.0");
-_LIT(KFolderServiceType, "x-obex/folder-listing");
-_LIT(KFolderMemoryTypeTag, "MemType");
-_LIT(KFolderNameTag, "Folder");
-
-_LIT(KFolderImages, "Images");
-_LIT(KFolderGraphics, "Graphics");
-_LIT(KFolderTones, "Tones");
-_LIT(KFolderMusic, "Music");
-_LIT(KFolderVideos, "Videos");
-_LIT(KFolderInstalls, "Installs");
-
-_LIT( KSyncSolutionsServiceName, "SyncSolutions" );
-_LIT( KSyncSolutionsServiceVersion, "1.0" );
-_LIT( KSyncCalendar, "Calendar" );
-_LIT( KSyncContacts, "Contacts" );
-_LIT( KSyncSms, "Sms" );
-_LIT( KSyncBookmark, "Bookmark" );
-
-_LIT( KDesktopSync, "DesktopSync" );
-
-enum TFolderTypes
-    {
-    EFolderImages,
-    EFolderGraphics,
-    EFolderTones,
-    EFolderMusic,
-    EFolderVideos,
-    EFolderInstalls
-    };
-
-
-//
-// misc capabily document strings
-//
-_LIT(KServiceHeader,   "<!-- Capability Object Service -->");
-_LIT(KXmlVersion,      "<?xml version=\"1.0\" ?>");
-_LIT(KComment1,        "<!-- OBEX Capability Object -->");
-_LIT(KDocType,         "<!DOCTYPE Capability SYSTEM \"obex-capability.dtd\">");
-_LIT(KRootBegin,       "<Capability Version=\"1.0\">");
-_LIT(KRootEnd,         "</Capability>");
-_LIT(KCommentBegin,    "<!--");
-_LIT(KCommentEnd,      "-->");
-_LIT(KFormatText, "  ");
-_LIT(KXmlExtension, ".xml");
-
-
-//
-// manufacturers
-//
-_LIT(KManufacturerNokia, "Nokia");
-_LIT(KManufacturerEricsson, "Ericsson");
-_LIT(KManufacturerMotorola, "Motorola");
-_LIT(KManufacturerPanasonic, "Panasonic");
-_LIT(KManufacturerPsion, "Psion");
-_LIT(KManufacturerIntel, "Intel");
-_LIT(KManufacturerCogent, "Cogent");
-_LIT(KManufacturerCirrus, "Cirrus");
-_LIT(KManufacturerLinkup, "Linkup");
-_LIT(KManufacturerTexasInstruments, "TexasInstruments");
-
-
-//
-// media types (TMediaType in e32std.h)
-//
-_LIT(KMediaMMC, "MMC");     // memory card
-_LIT(KMediaFlash, "DEV");   // device memory
-
-//
-// TElementType contains all element types used in 
-// capabilty xml document
-//
-//
-enum TElementType
-    {
-    ECapability,
-    EGeneral,
-    EManufacturer,
-    EModel,
-    ESN,
-    EOEM,
-    ESW,
-    EFW,
-    EHW,
-    ELanguage,
-    EMemory,
-    EMemType,
-    ELocation,
-    EFree,
-    EUsed,
-    EShared,
-    EFileSize,
-    EFolderSize,
-    EFileNLen,
-    EFolderNLen,
-    ECaseSenN,
-
-    EExt,
-    EXNam,
-    EXVal,
-    
-    EObject,
-    EType,
-    EName_Ext,
-    ESize,
-
-    EAccess,
-    EProtocol,
-    EEndpoint,
-    ETarget,
-
-    EInbox,
-    EService,   
-    EName,
-    EUUID,
-    EVersion,
-
-    EAttVersion,
-    EAttDate,
-    
-    EAttCurrentNetwork,
-    EAttHomeNetwork,
-    EAttCountryCode
-    };
-
-
-
-
-//
-// KXmlTokens contains all tokens (=tags) used in 
-// capabilty xml document
-//
-//
-
-typedef const TText*  TTag;
-NONSHARABLE_STRUCT( TXmlToken )
-    {
-    TInt id;
-    TTag tag;
-    };
-
-const TXmlToken KXmlTokens[] =
-    {
-    {ECapability,   _S("Capability")},
-    {EGeneral,      _S("General")},
-    {EManufacturer, _S("Manufacturer")},
-    {EModel,        _S("Model")},
-    {ESN,           _S("SN")}, 
-    {EOEM,          _S("OEM")},
-    {ESW,           _S("SW")},
-    {EFW,           _S("FW")},
-    {EHW,           _S("HW")},
-    {ELanguage,     _S("Language")},
-    {EMemory,       _S("Memory")},
-    {EMemType,      _S("MemType")},
-    {ELocation,     _S("Location")},
-    {EFree,         _S("Free")},
-    {EUsed,         _S("Used")},
-    {EShared,       _S("Shared")},
-    {EFileSize,     _S("FileSize")},
-    {EFolderSize,   _S("FolderSize")},
-    {EFileNLen,     _S("FileNLen")},
-    {EFolderNLen,   _S("FolderNLen")},
-    {ECaseSenN,     _S("CaseSenN")},
-    {EExt,          _S("Ext")},
-    {EXNam,         _S("XNam")},
-    {EXVal,         _S("XVal")},
-    {EObject,       _S("Object")},
-    {EType,         _S("Type")},
-    {EName_Ext,     _S("Name_Ext")},
-    {ESize,         _S("Size")},
-    {EAccess,       _S("Access")},
-    {EProtocol,     _S("Protocol")},
-    {EEndpoint,     _S("Endpoint")},
-    {ETarget,       _S("Target")},
-    {EInbox,        _S("Inbox")},
-    {EService,      _S("Service")},
-    {EName,         _S("Name")},
-    {EUUID,         _S("UUID")},
-    {EVersion,      _S("Version")},
-    {EXNam,             _S("XNam")},
-    {EXVal,             _S("XVal")},
-    {EAttVersion,       _S("Version")},
-    {EAttDate,          _S("Date")},
-    {EAttCurrentNetwork,_S("CurrentNetwork")},
-    {EAttHomeNetwork,   _S("HomeNetwork")},
-    {EAttCountryCode,   _S("CountryCode")}  
-    };
-
-#define NUMXMLTOKENS (sizeof(KXmlTokens)/sizeof(TXmlToken))
-
-
-
-
-//
-// string array to convert symbian TLanguage enums to 
-// ISO 639 language codes
-// 
-// See "http://www.sil.org/iso639-3/default.asp" 
-//
-
-typedef const TText*  TLangString;
-NONSHARABLE_STRUCT( TLangStringStruct )
-    {
-    TInt id;
-    TLangString lang;
-    };
-
-/**
- * Language mapping table.
- */
-const TLangStringStruct KLangStrings[] =
-    {
-    {ELangEnglish,   _S("en")},
-    {ELangFrench,    _S("fr")},
-    {ELangGerman,    _S("de")},
-    {ELangSpanish,   _S("es")},
-    {ELangItalian,   _S("it")},
-    {ELangSwedish,   _S("sv")},
-    {ELangDanish,    _S("da")},
-    {ELangNorwegian, _S("no")},
-    {ELangFinnish, _S("fi")},
-
-    {ELangAmerican, _S("en_US")},
-    {ELangSwissFrench, _S("fr_CH")},
-    {ELangSwissGerman, _S("de_CH")},
-    {ELangPortuguese, _S("pt")},
-    {ELangTurkish, _S("tr")},
-    {ELangIcelandic, _S("is")},
-    {ELangRussian, _S("ru")},
-    {ELangHungarian, _S("hu")},
-    {ELangDutch, _S("nl")},
-    
-    {ELangBelgianFlemish, _S("nl_BE")},
-    {ELangAustralian, _S("aus")},
-    {ELangBelgianFrench, _S("fr_BE")},
-    {ELangAustrian, _S("de_AT")},
-    {ELangNewZealand, _S("en_NZ")},
-    {ELangInternationalFrench, _S("fr")},
-    {ELangCzech, _S("cs")},
-    {ELangSlovak, _S("sk")},
-    {ELangPolish, _S("pl")},
-    
-    {ELangSlovenian, _S("sl")},
-    {ELangTaiwanChinese, _S("zh_TW")},
-    {ELangHongKongChinese, _S("zh_HK")},
-    {ELangPrcChinese, _S("zh_CN")},
-    {ELangJapanese, _S("ja")},
-    {ELangThai, _S("th")},
-    {ELangAfrikaans, _S("af")},
-    {ELangAlbanian, _S("sq")},
-    {ELangAmharic, _S("am")},
-    
-    {ELangArabic, _S("ar")},
-    {ELangArmenian, _S("hy")},
-    {ELangTagalog, _S("tl")},
-    {ELangBelarussian, _S("be")},
-    {ELangBengali, _S("bn")},
-    {ELangBulgarian, _S("bg")},
-    {ELangBurmese, _S("my")},
-    {ELangCatalan, _S("ca")},
-    {ELangCroatian, _S("hr")},
-    
-    {ELangCanadianEnglish, _S("en_CA")},
-    {ELangInternationalEnglish, _S("en")},
-    {ELangSouthAfricanEnglish, _S("en_ZA")},
-    {ELangEstonian, _S("et")},
-    {ELangFarsi, _S("fa")},
-    {ELangCanadianFrench, _S("fr_CA")},
-    {ELangScotsGaelic, _S("gd")},
-    {ELangGeorgian, _S("ka")},
-    {ELangGreek, _S("el")},
-    
-    {ELangCyprusGreek, _S("el_CY")},
-    {ELangGujarati, _S("gu")},
-    {ELangHebrew, _S("he")},
-    {ELangHindi, _S("hi")},
-    {ELangIndonesian, _S("id")},
-    {ELangIrish, _S("ga")},
-    {ELangSwissItalian, _S("it_CH")},
-    {ELangKannada, _S("kn")},
-    {ELangKazakh, _S("kk")},
-    
-    {ELangKhmer, _S("km")},
-    {ELangKorean, _S("ko")},
-    {ELangLao, _S("lo")},
-    {ELangLatvian, _S("lv")},
-    {ELangLithuanian, _S("lt")},
-    {ELangMacedonian, _S("mk")},
-    {ELangMalay, _S("ms")},
-    {ELangMalayalam, _S("ml")},
-    {ELangMarathi, _S("mr")},
-    
-    {ELangMoldavian, _S("mo")},
-    {ELangMongolian, _S("mn")},
-    {ELangNorwegianNynorsk, _S("nn")},
-    {ELangBrazilianPortuguese, _S("pt_BR")},
-    {ELangPunjabi, _S("pa")},
-    {ELangRomanian, _S("ro")},
-    {ELangSerbian, _S("sr")},
-    {ELangSinhalese, _S("si")},
-    {ELangSomali, _S("so")},
-    
-    {ELangInternationalSpanish, _S("es")},
-    {ELangLatinAmericanSpanish, _S("es_US")},
-    {ELangSwahili, _S("sw")},
-    {ELangFinlandSwedish, _S("sv_FI")},
-    {ELangReserved1, _S("en")},  
-    {ELangTamil, _S("ta")},
-    {ELangTelugu, _S("te")},
-    {ELangTibetan, _S("bo")},
-    {ELangTigrinya, _S("ti")},
-    
-    {ELangCyprusTurkish, _S("tr_CY")},
-    {ELangTurkmen, _S("tk")},
-    {ELangUkrainian, _S("uk")},
-    {ELangUrdu, _S("ur")},
-    {ELangReserved2, _S("en")},
-    {ELangVietnamese, _S("vi")},
-    {ELangWelsh, _S("cy")},
-    {ELangZulu, _S("zu")},
-    {ELangOther, _S("other")},
-    
-    {ELangManufacturerEnglish, _S("en")},
-    {ELangSouthSotho, _S("st")},
-    {ELangBasque, _S("eu")},
-    {ELangGalician, _S("gl")},
-    {ELangJavanese, _S("jv")},
-    {ELangMaithili, _S("bh")},
-    {ELangAzerbaijani_Latin, _S("az")},
-    {ELangAzerbaijani_Cyrillic, _S("az")},
-    {ELangOriya, _S("or")},
-    {ELangBhojpuri, _S("bh")},
-    {ELangSundanese, _S("su")},
-    {ELangKurdish_Latin, _S("ku")},
-    {ELangKurdish_Arabic, _S("ku")},
-    {ELangPashto, _S("ps")},
-    {ELangHausa, _S("ha")},
-    {ELangOromo, _S("om")},
-    {ELangUzbek_Latin, _S("uz")},
-    {ELangUzbek_Cyrillic, _S("uz")},
-    {ELangSindhi_Arabic, _S("sd")},
-    {ELangSindhi_Devanagari, _S("sd")},
-    {ELangYoruba, _S("yo")},
-    {ELangCebuano, _S("ceb")},
-    {ELangIgbo, _S("ig")},
-    {ELangMalagasy, _S("mg")},
-    {ELangNepali, _S("ne")},
-	{ELangAssamese, _S("as")},
-    {ELangShona, _S("sn")},
-    {ELangZhuang, _S("za")},
-    {ELangMadurese, _S("mad")},
-    
-    {ELangEnglish_Apac, _S("en")},
-    {ELangEnglish_Taiwan, _S("en")},
-    {ELangEnglish_HongKong, _S("en")},
-    {ELangEnglish_Prc, _S("en")},
-    {ELangEnglish_Japan, _S("en")},
-    {ELangEnglish_Thailand, _S("en")},
-    
-	{ELangFulfulde, _S("ff")},
-    {ELangTamazight, _S("ber")},
-    {ELangBolivianQuechua, _S("qu")},
-    {ELangPeruQuechua, _S("qu")},
-    {ELangEcuadorQuechua, _S("qu")},
-    {ELangTajik_Cyrillic, _S("tg")},
-    {ELangTajik_PersoArabic, _S("tg")},
-    {ELangNyanja, _S("ny")},
-    {ELangHaitianCreole, _S("ht")},
-    {ELangLombard, _S("lmo")},
-    {ELangKoongo, _S("kg")},
-    {ELangAkan, _S("ak")},
-    {ELangHmong, _S("hmn")},
-    {ELangYi, _S("ii")},
-    {ELangTshiluba, _S("lu")},
-    {ELangIlocano, _S("ilo")},
-    {ELangUyghur, _S("ug")},
-    {ELangNeapolitan, _S("nap")},
-    {ELangRwanda, _S("rw")},
-    {ELangXhosa, _S("xh")},
-    {ELangBalochi, _S("bal")},
-    {ElangHiligaynon, _S("hil")},
-    {ELangMinangkabau, _S("min")},
-    {ELangMakhuwa, _S("vmw")},
-    {ELangSantali, _S("sat")},
-    {ELangGikuyu, _S("ki")},
-    {ELangMoore, _S("mos")},
-    {ELangGuarani, _S("gnHI")},
-    {ELangRundi, _S("ru")},
-    {ELangRomani_Latin, _S("rom")},
-    {ELangRomani_Cyrillic, _S("rom")},
-    {ELangTswana, _S("tn")},
-    {ELangKanuri, _S("kr")},
-    {ELangKashmiri_Devanagari, _S("ks")},
-    {ELangKashmiri_PersoArabic, _S("ks")},
-    {ELangUmbundu, _S("umb")},
-    {ELangKonkani, _S("kok")},
-    {ELangBalinese, _S("ban")},
-    {ELangNorthernSotho, _S("nso")},
-    {ELangWolof, _S("wo")},
-    {ELangBemba, _S("bmy")}, 	 	 	
-    {ELangTsonga, _S("ts")},
-    {ELangYiddish, _S("yi")},
-    {ELangKirghiz, _S("ky")},
-    {ELangGanda, _S("lg")},
-    {ELangSoga, _S("xog")},
-    {ELangMbundu, _S("kmb")},
-    {ELangBambara, _S("bm")},
-    {ELangCentralAymara, _S("ay")},
-    {ELangZarma, _S("dje")},
-    {ELangLingala, _S("ln")},
-    {ELangBashkir, _S("ba")},
-    {ELangChuvash, _S("cv")},
-    {ELangSwati, _S("ss")},
-    {ELangTatar, _S("tt")},
-    {ELangSouthernNdebele, _S("nr")},
-    {ELangSardinian, _S("sc")},
-    {ELangScots, _S("sco")},
-    {ELangMeitei, _S("mni")},
-    {ELangWalloon, _S("wa")},
-    {ELangKabardian, _S("kbd")},
-    {ELangMazanderani, _S("mzn")},
-    {ELangGilaki, _S("glk")},
-    {ELangShan, _S("shn")},
-    {ELangLuyia, _S("luy")},
-    {ELanguageLuo, _S("luo")},
-    {ELangSukuma, _S(" 	suk")},
-    {ELangAceh, _S("ace")},
-    {ELangMalay_Apac, _S("ms")}
-    };
-
-#define NUMLANGSTRINGS (sizeof(KLangStrings)/sizeof(TLangStringStruct))
-
-
-
-
-#endif // capability.h
-
--- a/connectivitymodules/SeCon/services/csc/inc/capinfo.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
-* 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:  Capability service controller
-*
-*/
-
-
-#ifndef _CAPINFO_H_
-#define _CAPINFO_H_
-
-#include <e32base.h>
-#include <f32file.h>
-
-#include "caputils.h"
-
-//
-// CCapInfo creates capability document
-// 
-//
-
-class CCapList;
-class CStringList;
-class TSConSolutionInfo;
-class CSconVersionInfo;
-
-NONSHARABLE_CLASS( CCapInfo ) : public CBase
-{
-public:
-    static CCapInfo* NewL();        
-    ~CCapInfo();
-private:
-    CCapInfo();
-    void ConstructL();
-
-public:
-    void CapabilityDocumentL( CBufFlat* aBuf );
-
-private:
-    CCapList* CapList();
-    void SetCapabilityBuf( CBufFlat* aBuf );
-    
-    void GeneralInfoL();
-    void MemoryInfoL();
-    void WriteMemoryInfoL( TMemoryInfo& aInfo );
-    void ServiceInfoL( const TDesC& aDir, const RArray<TFileName>& aExcludeList,
-        RArray<TFileName>& aFilesAdded );
-    void FolderServiceL();
-    
-    void SyncSolutionsServiceL();
-    void WriteSyncSolutionsServiceL( const TSConSolutionInfo& aCalendar,
-    		const TSConSolutionInfo& aContact,
-    		const TSConSolutionInfo& aSms,
-    		const TSConSolutionInfo& aBookmark );
-    void WriteSolutionTagL( const TDesC& aContentName, const TSConSolutionInfo& aSolution );
-    
-    void WriteFolderL( const TDesC& aType, const TDesC& aFullName, const TDesC& aMemory );
-
-    void WriteValueL( TInt aId, const TDesC& aValue );
-    void WriteBigValueL( TInt aId, const TDesC& aValue );
-    void WriteValueL( TInt aId, TInt64 aValue );
-    void WriteTagL( TInt aId, TInt aType );
-    void WriteAttributeL( TInt aId, const TDesC& aVersion, const TDesC& aDate );
-    void WriteL( const TDesC& aText );
-
-    void WriteFromListL( CStringList* aList );
-    void WriteNewLineL();
-
-    void FormatElement( TDes& aText );
-    void AddFormatText( TDes& aText, TInt aNum ) const;
-
-private:
-    RFs             iFsSession;     // has
-    CCapList*       iCapList;       // has
-    HBufC8*         iHeapBuf;       // has
-    TBuf<KMaxSize>  iBuf;
-    TIdStack        iIdStack;
-
-    CBufFlat*       iCapabilityBuf; // uses
-    CSconVersionInfo* iSconInfo;
-};
-
-#endif // CCapability
-
--- a/connectivitymodules/SeCon/services/csc/inc/caplist.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CCapList header file.
-*
-*/
-
-
-#ifndef _CAPLIST_H_
-#define _CAPLIST_H_
-
-// INCLUDES
-
-#include <e32base.h>
-#include <badesca.h>
-#include "stringlist.h"
-
-//
-// Class CCapList
-//
-NONSHARABLE_CLASS( CCapList ) : public CBase
-{
-public:
-    /**
-     * Two-phase constructor.
-     * @return CCapList instance
-     */
-    static CCapList* NewL();
-    /**
-     * Destructor
-     * @return none
-     */
-    ~CCapList();
-
-private:
-    /**
-     * Constructor
-     * @return none
-     */
-    CCapList();
-    /**
-     * Initializes the member data
-     * @return none
-     */
-    void ConstructL();
-    /**
-     * Operator =
-     * @param aList The data to be copied
-     * @return none
-     */
-    void operator=(const CCapList& aList); // not allowed
-
-public:
-    /**
-     * Returns the list
-     * @return The CStringList object
-     */
-    CStringList* List();
-
-public:
-    /**
-     * Find element
-     * @param aId
-     * @param aType
-     * @param aIndex (Default=0)
-     * @return position
-     */
-    TInt Find(TInt aId, TInt aType, TInt aIndex=0);
-    /**
-     * Find from mark
-     * @param aId
-     * @param aType
-     * @return position
-     */
-    TInt FindFromMark(TInt aId, TInt aType);
-    /**
-     * Finds service xml-file identification header. This header must be the first 
-     * line in every service file.
-     * @return ETrue if service header found
-     */
-    TBool FindServiceHeader();
-    /**
-     * Find service
-     * @param aList The source list
-     * @return ETrue if Service is found
-     */
-    TBool FindServiceL(CStringList* aList);
-
-private:
-    CStringList*   iList;           // has
-};
-
-#endif 
-
-// End of file
-
-
--- a/connectivitymodules/SeCon/services/csc/inc/capparser.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,296 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CapParser header file
-*
-*/
-
-
-
-#ifndef _CAPPARSER_H_
-#define _CAPPARSER_H_
-
-// INCLUDES
-
-#include <e32base.h>
-#include <badesca.h>
-
-//
-// Class CapParser
-//
-NONSHARABLE_CLASS( CapParser )
-    {
-
-public:
-    /**
-     * Parses element's id and type (eg. "<Memory>" -> EMemory, EElementBegin)
-     * @param aText
-     * @param aId
-     * @param aType
-     * @return none
-     */
-    static void ParseElement(const TDesC& aText, TInt& aId, TInt& aType);
-    
-public:
-    /**
-     * Constructs element with value (eg. "<Free>23456</Free>").
-     * @param aText
-     * @param aId
-     * @param aValue
-     * @return none
-     */
-    static void MakeElementL(TDes& aText, TInt aId, const TDesC& aValue);   
-    /**
-     * Constructs element without value (eg. "<Memory>" or "</Memory>").
-     * @param aText
-     * @param aId
-     * @param aType
-     * @return none
-     */
-    static void MakeElementL(TDes& aText, TInt aId, TInt aType);
-    /**
-     * Constructs element with attributes "Version" and "Date"(eg. 
-     * "<FW Version="2.2"/>").
-     * @param aText
-     * @param aId
-     * @param aVersion
-     * @param aDate
-     * @return none
-     */
-    static void MakeElementL(TDes& aText, TInt aId, const TDesC& aVersion, 
-                            const TDesC& aDate);
-    /**
-     * Constructs element with attributes
-     * @param aText
-     * @param aId
-     * @param aAttributes
-     * @return none
-     */
-    static void MakeElementL(TDes& aText, TInt aId, CDesCArrayFlat* aAttributes);
-    
-public:
-    /**
-     * Returns capability element id (eg. EMemory).
-     * @param aText
-     * @return none
-     */
-    static TInt ElementId(const TDesC& aText);
-    /**
-     * Returns capability element tag (eg. "Memory").
-     * @param aText
-     * @param aId
-     * @return none
-     */
-    static void GetTagL(TDes& aText, TInt aId);
-    
-private:
-    /**
-     * Replaces special characters to xml compliant.
-     * @param aText
-     * @param aValue
-     * @return none
-     */
-    static void ReplaceSpecialCharsL( TDes& aText, const TDesC& aValue );
-    };
-
-
-//
-// Class TXmlParser
-//
-NONSHARABLE_CLASS( TXmlParser )
-    {
-
-public:
-    enum TElementType
-        {
-        EElementValue,
-        EElementBegin,
-        EElementEnd,
-        EElementEmpty,
-        EElementAtt,
-        EElementComment,
-        EElementVersion,
-        EElementDocType,
-        EElementUnknown
-        };
-
-
-public:
-    /**
-     * Sets a tag
-     * @param aText The tag
-     * @return none
-     */
-    void Set(const TDesC& aText);
-    /**
-     * Returns type
-     * @return type
-     */
-    TInt Type() const;
-    /**
-     * Returns a pointer to a tag
-     * @return The tag pointer
-     */
-    TPtrC Tag() const;
-    /**
-     * Gets the tag
-     * @param aText The tag buffer
-     * @return none
-     */
-    void GetTag(TDes& aText) const;
-
-private:
-    /**
-     * Parses value (eg. <Language>en</Language>)
-     * @return Operation success
-     */
-    TBool ElementValue();
-    /**
-     * Parses beginning tag (eg. <General>)
-     * @return Operation success
-     */
-    TBool ElementBegin();
-    /**
-     * Parses ending tag (eg. </General>)
-     * @return Operation success
-     */
-    TBool ElementEnd();
-    /**
-     * Parses empty element (eg. <CaseSenN/>)
-     * @return Operation success
-     */
-    TBool ElementEmpty();
-    /**
-     * Parses attribute element (eg. <HW Version="1.5"/>)
-     * Note: Attribute values cannot contain equals (=) or quotations (")
-     * @return Operation success
-     */
-    TBool ElementAtt();
-    /**
-     * Identifies comment element ("<!-- OBEX Capability Object -->").
-     * @return Operation success
-     */
-    TBool ElementComment();
-    /**
-     * Parses unknown elements
-     * @return Operation success
-     */
-    TBool ElementUnknown();
-    /**
-     * Identifies version element ("<?xml version="1.0" ?>") 
-     * @return Operation success
-     */
-    TBool ElementVersion();
-    /**
-     * Identifies document type element 
-     * ("<!DOCTYPE Capability SYSTEM "obex-capability.dtd">").
-     * @return Operation success
-     */
-    TBool ElementDocType();
-
-private:
-    /**
-     * Inits the parser
-     * @return none
-     */
-    void Init();
-    /**
-     * Parses xml-element.  
-     * @return none
-     */
-    void Parse();
-
-public:
-    /**
-     * Validates the character
-     * @param aChar The char to be validated.
-     * @return ETrue if the char is valid
-     */
-    static TBool ValidChar(const TChar aChar);
-    /**
-     * Validates the tag
-     * @param aText The tag to be validated.
-     * @return ETrue if the tag is valid
-     */
-    static TBool ValidTag(const TDesC& aText);
-    /**
-     * Returns the number of characters (aChar)
-     * @param aText The buffer
-     * @param aChar The character
-     * @return The number of characters
-     */
-    static TInt Count(const TDesC& aText, const TChar aChar);
-    /**
-     * Returns the position of the first non space character
-     * @param aText The buffer
-     * @return The position
-     */
-    static TInt FirstNonSpace(const TDesC& aText);
-    /**
-     * Returns the position of the last non space character
-     * @param aText The buffer
-     * @return The position
-     */
-    static TInt LastNonSpace(const TDesC& aText);
-    /**
-     * Function returns a sub-string between aPos1 and aPos2
-     * @param aText The buffer
-     * @param aText Start position
-     * @param aText End position
-     * @return The pointer to the substring
-     */
-    static TPtrC SubStr(const TDesC& aText, TInt aPos1, TInt aPos2);
-    /**
-     * Function performs string copy with length checking.
-     * @param aTarget Target buffer
-     * @param aSource Source buffer
-     * @return none
-     */
-    static void StrCopy(TDes& aTarget, const TDesC& aSource);
-
-private:    
-    /**
-     * Returns a string
-     * @return A pointer to a string
-     */
-    TPtrC Str() const;
-    /**
-     * Trimmer function
-     * @return none
-     */
-    void TrimOriginal();
-    /**
-     * Function returns sub string between aPos1 and aPos2
-     * @param aPos1 Start position
-     * @param aPos2 End posiotion
-     * @return none
-     */
-    TPtrC SubStr(TInt pos1, TInt pos2);
-
-private:
-    TPtrC iOriginal;
-    TPtrC iText;
-    TPtrC iTag;
-    TPtrC iValue;
-    TInt  iType;
-
-    TInt iSlash;
-    TInt iFirst;
-    TInt iLast;
-    };
-
-#endif 
-
-// End of file
-
-
--- a/connectivitymodules/SeCon/services/csc/inc/caputils.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,252 +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:  CapUtil header file
-*
-*/
-
-
-// INCLUDES
-
-#ifndef _CAPUTILS_H_
-#define _CAPUTILS_H_
-
-#include "capability.h"
-
-class RFs;
-
-//
-// TMemoryInfo
-//
-NONSHARABLE_CLASS( TMemoryInfo )
-    {
-public:
-    TChar    iDriveLetter;
-    TInt     iDriveNum;
-    TBuf<16> iLocation;
-    TInt64   iFree;
-    TInt64   iUsed;
-    TBool    iShared;
-    TInt64   iFileSize;
-    TInt64   iFolderSize;
-    TInt     iFileNameSize;
-    TInt     iFolderNameSize;
-    TBool    iCaseSensitivity;
-    TUint    iDriveStatus;
-    TInt     iMemNr;
-    };
-
-//
-// CapUtil 
-//
-NONSHARABLE_CLASS( CapUtil )
-    {
-public:
-    /**
-     * Gets default root path from pathinfo. 
-     * @param aText
-     * @param aType
-     * @return none
-     */
-    static void GetDefaultRootPathL( RFs& aFs, TDes& aRootPath );
-    
-    /**
-     * Gets memory type. 
-     * @param aFs
-     * @param aMemoryType
-     * @param aDrive
-     * @return none
-     */
-    static void GetMemoryType( RFs& aFs, TDes& aMemoryType, const TInt aDrive );
-    
-    /**
-     * Gets language
-     * @param aText
-     * @return none
-     */
-    static void GetLanguage( TDes& aText );
-    
-    /**
-     * Gets SW version, SW version date  and device model from SysUtil. 
-     * @param aVersion SW version
-     * @param aDate SW date
-     * @param aModel Device model
-     * @return none
-     */
-    static void GetSWVersionL( TDes& aVersion, TDes& aDate, TDes& aModel );
-    
-    /**
-     * Gets phone manufacturer from HAL. In case manufacturer is not known,
-     * empty value is used.
-     * @param aText Manufacturer
-     * @return none
-     */
-    static void GetManufacturer( TDes& aText );
-    
-    /**
-     * Get memory information for one drive.
-     * @param aFs RFs handle
-     * @param aDriveNumber drive number
-     * @param aInfo Memory information
-     * @return none
-     */
-    static void GetMemoryInfoL( const RFs& aFs, const TInt aDriveNumber, TMemoryInfo& aInfo );
-    
-    /**
-     * Initializes TMemoryInfo.
-     * @param aInfo TMemoryInfo to be initialized
-     * @return none
-     */
-    static void InitMemoryInfo( TMemoryInfo& aInfo );
-    
-    /**
-     * Get language string for aId.
-     * @param aId Language id
-     * @param aText Language text
-     * @return none
-     */
-    static void GetLanguageString( TLanguage aId, TDes& aText );
-    
-    /**
-     * Finds all files in aDir.
-     * @param aFs RFs handle
-     * @param aDir Directory
-     * @param aList List of files in directory
-     * @return none
-     */
-    static void GetFileListL( const RFs& aFs, const TDesC& aDir, 
-                            RArray<TFileName>& aList );
-    
-    
-    /**
-     * Gets operator name, country code, network ID
-     * @param aLongName
-     * @param aCountryCode
-     * @param aNetworkID
-     * @return none
-     */
-    static void GetOperatorNameL( TDes& aLongName, TDes& aCountryCode, TDes& aNetworkID );
-    
-    /**
-     * Creates a panic
-     * @param aReason Panic code
-     * @return none
-     */
-    static void Panic( TInt aReason );
-    
-    /**
-     * String copy with lenght check.
-     * @param aTarget Target string
-     * @param aSource Source string
-     * @return none
-     */
-    static void StrCopy( TDes& aTarget, const TDesC& aSource );
-    
-    /**
-     * Function converts ínteger to string.
-     * @param aText string
-     * @param aNum integer
-     * @return none
-     */
-    static void IntToStr( TDes& aText, TInt64 aNum );
-    
-    /**
-     * Function converts string to integer. If string cannot be converted,
-     * error code is returned.
-     * @param aText string
-     * @param aNum integer
-     * @return error code
-     */
-    static TInt StrToInt( const TDesC& aText, TInt& aNum );
-    
-    /**
-     * Function splits string (eg "name1, name2, name3") into substrings.
-     * @param aText string
-     * @param aSeparator separator character
-     * @param aArray substrings
-     * @return none
-     */
-    static void SplitL( const TDesC& aText, const TChar aSeparator, 
-                        RArray<TPtrC>& aArray );
-    
-    /**
-     * Constructs capability date as string
-     * @param aText string
-     * @param aTime time object
-     * @return none
-     */
-    static void CapabilityDate( TDes& aText, const TTime aTime );
-    
-    /**
-     * Function parses date string of the format "dd-mm-yy".
-     * @param aText string
-     * @return time object
-     */
-    static TTime ParseDateL( const TDesC& aText );
-    
-    /**
-     * Function return TMonth presentation of integer
-     * @param aNum
-     * @return TMonth object
-     */
-    static TMonth Month( TInt aNum );
-    
-    /**
-     * Function checks file extension.
-     * @param aFile File name
-     * @param aExt extension
-     * @return boolean
-     */
-    static TBool CheckFileType( const TDesC& aFile, const TDesC& aExt );
-    };
-
-//
-//  TIdStack
-//
-NONSHARABLE_CLASS( TIdStack )
-    {
-public:
-    
-    /**
-     * Push id to the stack
-     * @param aId Id number
-     * @return none
-     */
-    void Push( TInt aId );
-    
-    /**
-     * Pop id from the stack
-     * @return id
-     */
-    TInt Pop();
-    
-    /**
-     * Size of the stack
-     * @return size
-     */
-    TInt Size() const;
-    
-    /**
-     * Reset the stack.
-     * @return none
-     */
-    void Reset();
-
-private:
-    TInt iPos;
-    TFixedArray<TInt, KNestingLimit> iArray;
-    };
-
-#endif // CapUtils.h
-
-// End of file
--- a/connectivitymodules/SeCon/services/csc/inc/sconcsc.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +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:  CSConCSC header file
-*
-*/
-
-
-// INCLUDES
-
-#ifndef _SCONCSC_H_
-#define _SCONCSC_H_
-
-#include <e32base.h>
-
-class CCapInfo;
-
-//============================================================
-// Class CSConCSC declaration
-//============================================================
-class CSConCSC : public CBase
-{
-public:
-    static CSConCSC* NewL();        
-    ~CSConCSC();
-
-public:
-    // Creates capability object and places it into aBuf.
-    // Returns system error code
-	virtual TInt CapabilityObject( CBufFlat& aBuf );
-
-private:	
-	void CapabilityObjectL( CBufFlat& aBuf );
-	
-	CSConCSC();
-    virtual void ConstructL();
-    
-private: // data
-    CCapInfo*   iCapInfo;
-    
-};
-
-IMPORT_C CSConCSC* CreateCSConCSCL();
-typedef CSConCSC* (*TSConCreateCSConCSCFunc) ();   
-
-
-#endif // SCONCSC
-
-// End of file
-
-
--- a/connectivitymodules/SeCon/services/csc/inc/sconsyncservice.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
-* 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:  CSConSyncService header file.
-*
-*/
-
-
-#ifndef _SCONSYNCSERVICE_H_
-#define _SCONSYNCSERVICE_H_
-
-#include <e32base.h>
-#include <apgcli.h>     // RApaLsSession
-#include <SyncMLClientDS.h>
-
-
-class TApaAppInfo;
-class RApaLsSession;
-class CRepository;
-
-
-class TSConSolutionInfo
-	{
-	public:
-	TSConSolutionInfo():iTime(0){}
-	public:
-	TFileName 	iSolutionName;
-	TUint		iUid;
-	TTime		iTime;
-	};
-
-/**
- *  This class provides information about active sync solutions.
- *
- *  @code
- *   CSConSyncService *syncService = CSConSyncService::NewLC();
- *   SConSolutionInfo solutionInfo;
- *   syncService->GetSolutionL( KSeconCalendarUid, solutionInfo );
- *   CleanupStack::PopAndDestroy( syncService );
- *  @endcode
- *
- *  @since S60 v5.0
- */
-NONSHARABLE_CLASS( CSConSyncService ) : public CBase
-	{
-	public:
-	static CSConSyncService* NewLC();
-	~CSConSyncService();
-	
-	/**
-     * Populate SolutionInfo according to content type.
-     *
-     * @since S60 v5.0
-     * @param aSeconContentType Contenttype to be readed
-     * @param aSolutionInfo contains founded solution info,
-     * 				        solution info is empty if not found
-     * @return none
-     */
-	void GetSolutionL( const TUint aSeconContentType, TSConSolutionInfo& aSolutionInfo );
-	
-	private:
-	
-	CSConSyncService();
-	void ConstructL();
-	
-	// Return correct providerId according to content type.
-	TSmlDataProviderId ProviderId( const TUint32 aSeconContentType ) const;
-	
-	// Parse time from text
-	TInt ParseTimestamp( TTime& aTime, const TDesC& aTimestamp ) const;
-	
-	// Get application caption.
-	void GetApplicationCaptionL( TDes& aCaption, const TUid aAppUid );
-	
-	// Search UID from installed applications, return app caption
-	void GetInstPackageCaptionL( TDes& aCaption, const TUid aPackageUid );
-	
-	// Gets last used profile for selected provider
-	void GetLastUsedProfileNameL( TDes& aProfileName, TTime& aTime,
-			const TSmlDataProviderId& aDataProviderId );
-	
-	// Gets last sync time for certain profile and provider.
-	void GetLastSyncTimeL( TTime& aTime, const TSmlProfileId aSyncProfileId,
-			const TSmlDataProviderId aDataProviderId );
-	
-	// Gets provider task id from profile
-	void GetProviderTaskL( TSmlTaskId& aProviderTask,
-			RSyncMLDataSyncProfile& aSyncProfile,
-			const TSmlDataProviderId aDataProviderId ) const;
-	
-	// Gets latest historyJob where task is correct.
-	const CSyncMLHistoryJob* LatestHistoryJob( RSyncMLHistoryLog& aHistoryLog,
-			TInt aTaskId ) const;
-	
-	// Returns ETrue if task exists in HistoryJob.
-	TBool TaskExist( const CSyncMLHistoryJob* aHistoryJob, TInt aTaskId ) const;
-	
-	private: // data
-	TBool			iApaSessionConnected;
-	RApaLsSession 	iApaSession;
-	TBool			iSyncSessionOpened;
-	RSyncMLSession 	iSyncSession;
-	CRepository* 	iRepository;
-	};
-
-#endif // _SCONSYNCSERVICE_H_
--- a/connectivitymodules/SeCon/services/csc/inc/sconversioninfo.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Handles version fetching
-*
-*/
-
-
-#ifndef SCONVERSIONINFO_H_
-#define SCONVERSIONINFO_H_
-
-#include <e32base.h>
-#include <sysversioninfo.h>
-#include <versioninfo.h>
-#include <etelmm.h>
-#include <sysutil.h>
-
-const TInt KSconSWVersionSize = 50;
-const TInt KSconDateSize = 16;
-const TInt KMaxLangSize = 5;
-
-NONSHARABLE_CLASS( CSconVersionInfo ) : public CBase
-{
-public:
-	CSconVersionInfo();
-	~CSconVersionInfo();
-	
-	static CSconVersionInfo* NewL();
-	
-	/**
-	 * 
-	 * @param aFs RFs session
-	 * @return none.
-	 */
-	void FetchInfoL( RFs& aFs );
-	
-	/**
-	 *  Is all data ready.
-	 *  @return ETrue if FetchInfoL has been called succesfully.
-	 */
-	TBool IsReady();
-	
-	/**
-	 * Get symbian version. FetchInfoL must be called first
-	 * @param aSymbianVersion symbian version
-	 * @return error code.
-	 */
-	TInt GetSymbianVersion( SysVersionInfo::TSymbianOSVersion& aSymbianVersion );
-	
-	/**
-     * Get S60 platform version. FetchInfoL must be called first
-     * @param aS60Version S60 platform version
-     * @return error code.
-     */
-    TInt GetS60Version( VersionInfo::TPlatformVersion& aS60Version );
-    
-public: // data
-    
-    /**  Contains the manufacturer name. For example "Nokia". */
-    HBufC* iManufacturer;
-
-    /**  Contains the phone model sales name. For example "N01". */
-    HBufC* iModel;
-
-    /**  Contains the product code name. For example "RM-1". */
-    HBufC* iProduct;
-
-    /**  Contains the product revision. For example "01". */
-    HBufC* iRevision;
-    
-    TBuf< KSconDateSize > iDate;
-    
-    HBufC* iSWVersion;
-    
-    /** Phone serial number (IMEI or ESN), in character string format. */
-    HBufC* iSerialNumber;
-    
-    TBuf<KMaxLangSize> iLanguage;
-    
-    HBufC* iSysVersionInfo;
-    
-    HBufC* iLangVersion;
-    
-    HBufC* iLangSWVersion;
-    
-    HBufC* iOPVersion;
-    
-    TSize iScreenSize;
-    
-    HBufC* iProductCode;
-    
-    TInt iDesktopSyncError;
-    TInt iDesktopSync;
-    
-private:
-    TBool iInfoFetched; // ETrue if FetchInfoL has been called succesfully.
-    
-    TInt iSymbianVersionError;
-    SysVersionInfo::TSymbianOSVersion iSymbianVersion;
-    
-    TInt iS60VersionError;
-    VersionInfo::TPlatformVersion iS60Version;
-    
-};
-
-#endif /*SCONVERSIONINFO_H_*/
--- a/connectivitymodules/SeCon/services/csc/inc/stringlist.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CStringList header file
-*
-*/
-
-
-#ifndef _STRINGLIST_H_
-#define _STRINGLIST_H_
-
-// INCLUDES
-
-#include <e32base.h>
-#include <badesca.h>  // for CDesCArrayFlat
-#include <f32file.h>
-
-//
-// CStringList is used for storing lines of text.
-//
-NONSHARABLE_CLASS( CStringList ) : public CBase
-{
-public:
-    /**
-     * Two-phase constructor. The created instance is placed to cleanup stack
-     * @param aFileName Default KNullDesC
-     * @return CStringList instance
-     */
-    static CStringList* NewLC();
-    /**
-     * Two-phase constructor.
-     * @param aFileName Default KNullDesC
-     * @return CStringList instance
-     */
-    static CStringList* NewL();
-    /**
-     * Destructor
-     * @return none
-     */
-    ~CStringList();
-    
-public:
-    /**
-     * Returns the count of lines
-     * @return The count
-     */
-    TInt Count() const;
-    /**
-     * Returns pointer to the string
-     * @param aIndex The position
-     * @return String pointer
-     */
-    TPtrC16 ReadPtr(TInt aIndex);
-    /**
-     * Copies a string / strings
-     * @param aSource Source buffer
-     * @param aStart A start position
-     * @param aStop A stop position
-     * @return none
-     */
-    void CopyL(CStringList* aSource, TInt aStart, TInt aStop);
-    /**
-     * Resets iLines
-     * @return none
-     */
-    void Reset();
-    /**
-     * Returns the mark
-     * @return Mark value
-     */
-    TInt Mark() const;
-    /**
-     * Sets mark
-     * @param aMark The mark value
-     * @return none
-     */
-    void SetMark(TInt aMark);
-    /**
-     * Read strings from file.
-     * @param aText The tag buffer
-     * @return none
-     */
-    void ReadFromFileL( RFs& aFs, const TDesC& aName );
-
-private:
-    /**
-     * Default constuctor
-     * @return none
-     */
-    CStringList();
-    /**
-     * Initializes member data
-     * @param aFileName The file name
-     * @return none
-     */
-    void ConstructL();
-    /**
-     * Creates a panic
-     * @param aPanic Panic code
-     * @return none
-     */
-    void Panic(TInt aPanic) const;
-    /**
-     * Copies the string
-     * @param aTarget Target string
-     * @param aSource Source string
-     * @return ETrue if successful
-     */
-    TBool StrCopy(TDes& aTarget, const TDesC& aSource) const;
-    /**
-     * Writes a string
-     * @param aText The string
-     * @return none
-     */
-    void WriteL(const TDesC& aText);
-    /**
-     * Internalizes from file
-     * @param aFileName The name of the file
-     * @return none
-     */
-    void InternalizeL( RFs& aFs, const TDesC& aFileName );
-
-private:
-    TInt            iMark; 
-    CDesCArrayFlat* iLines;
-};
-
-#endif
-
-// End of file
-
-
--- a/connectivitymodules/SeCon/services/csc/rom/sconcsc.iby	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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:  Image description file for project SConCSC
-*
-*/
-
-
-#ifndef __SCONCSC_IBY__
-#define __SCONCSC_IBY__
-//file content
-
-file=ABI_DIR\BUILD_DIR\sconcsc.dll              SHARED_LIB_DIR\sconcsc.dll
-data=ZPRIVATE\101F99F6\capability\101F9698.xml  PRIVATE\101F99F6\capability\101F9698.xml
-data=ZPRIVATE\101F99F6\capability\fwdcomp.xml   PRIVATE\101F99F6\capability\fwdcomp.xml
-data=ZPRIVATE\101F99F6\capability\101F99F6.xml  PRIVATE\101F99F6\capability\101F99F6.xml
-#endif
--- a/connectivitymodules/SeCon/services/csc/src/capinfo.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1031 +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:  CCapInfo implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <utf.h>
-#include <driveinfo.h>
-#include <pathinfo.h>    // for PathInfo::SoundsPath
-#include <seconsdkcrkeys.h>
-#include "sconsyncservice.h"
-#include "capinfo.h"
-#include "caplist.h"
-#include "capparser.h"
-#include "caputils.h"
-#include "stringlist.h"
-#include "sconversioninfo.h"
-#include "debug.h"
-
-
-_LIT8( KLineFeed, "\r\n" );
-
-const TInt KDefaultArrayGranularity = 5;
-
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CCapInfo::NewL()
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CCapInfo* CCapInfo::NewL()
-    {
-    TRACE_FUNC_ENTRY;
-    CCapInfo* self = new (ELeave) CCapInfo();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-    
-// -----------------------------------------------------------------------------
-// CCapInfo::~CCapInfo()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CCapInfo::~CCapInfo()
-    {
-    TRACE_FUNC_ENTRY;
-    iFsSession.Close();
-    delete iHeapBuf;
-    delete iCapList;
-    delete iSconInfo;
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CCapInfo::CapabilityDocumentL(CBufFlat* aBuf)
-// Creates capability xml document end places it in aBuf
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::CapabilityDocumentL(CBufFlat* aBuf)
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err( KErrNone );
-    
-    // set buffer where capability document is written
-    SetCapabilityBuf( aBuf );
-    
-    WriteL( KXmlVersion );
-    WriteL( KComment1 );
-    WriteL( KDocType );
-    WriteL( KRootBegin );
-    
-    
-    //
-    // general
-    //
-    TRAP( err, GeneralInfoL() );
-    if ( err != KErrNone )
-        {
-        LOGGER_WRITE_1( "GeneralInfoL failed : %d", err );
-        User::Leave( err ); 
-        }
-    
-    
-    //
-    // services
-    //
-    // Search service files first from C-drive, and then from Z
-    // Do not add same files twice.
-    
-    RArray<TFileName> excludeList( KDefaultArrayGranularity );
-    CleanupClosePushL( excludeList );
-    RArray<TFileName> filesAdded( KDefaultArrayGranularity );
-    CleanupClosePushL( filesAdded );
-    
-    //read service files from C Import folder
-    TRAP( err, ServiceInfoL( KCapabilityDirCImport, excludeList, filesAdded ) );     
-    LOGGER_WRITE_1( "ServiceInfoL(KCapabilityDirCImport) returned : %d", err );
-    for ( TInt i=0; i<filesAdded.Count(); i++ )
-        {
-        excludeList.Append( filesAdded[i] );
-        }
-    filesAdded.Reset();
-    
-    // read service files from C Capability folder
-    TRAP( err, ServiceInfoL( KCapabilityDirC, excludeList, filesAdded ) ); 
-    LOGGER_WRITE_1( "ServiceInfoL(KCapabilityDirC) returned : %d", err );
-    for ( TInt i=0; i<filesAdded.Count(); i++ )
-        {
-        excludeList.Append( filesAdded[i] );
-        }
-    filesAdded.Reset();
-    
-    // read service files from Z Capability folder
-    TRAP( err, ServiceInfoL( KCapabilityDirZ, excludeList, filesAdded ) );
-    LOGGER_WRITE_1( "ServiceInfoL(KCapabilityDirZ) returned : %d", err );
-    
-    CleanupStack::PopAndDestroy( &filesAdded );
-    CleanupStack::PopAndDestroy( &excludeList );
-    
-        
-    // this service does not come from file
-    TRAP( err, FolderServiceL() );
-    LOGGER_WRITE_1( "FolderServiceL() returned : %d", err );
-    
-    TRAP( err, SyncSolutionsServiceL() );
-    LOGGER_WRITE_1( "SyncSolutionsServiceL() returned: %d", err );
-
-    WriteL( KRootEnd );
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CCapInfo::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    User::LeaveIfError( iFsSession.Connect() );
-    
-    iHeapBuf = HBufC8::NewL( KMaxSize*2 );
-    iCapList = CCapList::NewL();
-    iIdStack.Reset();
-    
-    iSconInfo = CSconVersionInfo::NewL();
-    TInt err(KErrNone);
-    TRAP(err, iSconInfo->FetchInfoL( iFsSession ));
-    LOGGER_WRITE_1("sconInfo->FetchInfoL() Leaved: %d", err);
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::CCapInfo()
-// Constuctor
-// -----------------------------------------------------------------------------
-//
-CCapInfo::CCapInfo()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::CapList()
-// Returns caplist
-// -----------------------------------------------------------------------------
-//
-CCapList* CCapInfo::CapList()
-    {
-    TRACE_FUNC;
-    __ASSERT_DEBUG(iCapList, CapUtil::Panic(KErrGeneral));
-    return iCapList;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::SetCapabilityBuf( CBufFlat* aBuf )
-// Set capability buffer
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::SetCapabilityBuf( CBufFlat* aBuf )
-    {
-    TRACE_FUNC;
-    iCapabilityBuf=aBuf;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::GeneralInfoL()
-// Write general device capability information.
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::GeneralInfoL()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err( KErrNone );
-    TBuf<KBufSize> buf;
-    TBuf<KBufSize> longName;
-    TBuf<KBufSize> coutryCode;
-    TBuf<KBufSize> networkID;
-    
-    WriteTagL(EGeneral, TXmlParser::EElementBegin);
-    
-    if ( !iSconInfo->IsReady() )
-        {
-        LOGGER_WRITE("iSconInfo wasn't ready, call iSconInfo->FetchInfoL");
-        iSconInfo->FetchInfoL( iFsSession );
-        }
-    
-    if ( iSconInfo->iManufacturer )
-        {
-        WriteValueL( EManufacturer, *iSconInfo->iManufacturer );
-        }
-    
-    if ( iSconInfo->iProduct )
-        {
-        WriteValueL( EModel, *iSconInfo->iProduct );
-        }
-    
-    // serial number
-    if ( iSconInfo->iSerialNumber )
-        {
-        WriteValueL( ESN, *iSconInfo->iSerialNumber );
-        }
-    
-    // software version 
-    if ( iSconInfo->iSWVersion )
-        {
-        WriteAttributeL( ESW, *iSconInfo->iSWVersion, iSconInfo->iDate );
-        }
-    
-    // language
-    WriteValueL( ELanguage, iSconInfo->iLanguage );
-
-    // this must succeed - do not trap
-    MemoryInfoL();
-    
-    // Operator
-    TRAP( err, CapUtil::GetOperatorNameL( longName, coutryCode, networkID ) );
-    LOGGER_WRITE_1( "CapUtil::GGetOperatorNameL returned : %d", err );
-    if( err == KErrNone )
-        {
-        LOGGER_WRITE_3( "CSConFsHandler::GetOperatorNameL longName =  %S coutryCode = %S networkID = %S", &longName, &coutryCode, &networkID );       
-        _LIT( KNetworkInfo, "NetworkInfo" );
-        _LIT( KCurrentNetwork, "CurrentNetwork=" );
-        _LIT( KCountryCode, "CountryCode=" );
-        _LIT( KNetworkID, "NetworkID=" );
-        
-        WriteTagL( EExt, TXmlParser::EElementBegin );
-        WriteValueL( EXNam, KNetworkInfo );
-        
-        // write CurrentNetwork
-        buf.Copy( KCurrentNetwork );
-        buf.Append( longName );
-        WriteValueL( EXVal, buf );
-        
-        // write CountryCode
-        buf.Copy( KCountryCode );
-        buf.Append( coutryCode );
-        WriteValueL( EXVal, buf );
-        
-        // write NetworkID
-        buf.Copy( KNetworkID );
-        buf.Append( networkID );
-        WriteValueL( EXVal, buf );
-        
-        WriteTagL( EExt, TXmlParser::EElementEnd );     
-        }
-    
-    if ( iSconInfo->iModel )
-        {
-        // print modelname (phone model sales name. For example "N01".)
-        WriteTagL( EExt, TXmlParser::EElementBegin );
-        _LIT(KModelName, "ModelName");
-        WriteValueL( EXNam, KModelName );
-        WriteValueL( EXVal, *iSconInfo->iModel );
-        WriteTagL( EExt, TXmlParser::EElementEnd ); 
-        }
-        
-    if ( iSconInfo->iProductCode )
-        {
-        // print productcode
-        WriteTagL( EExt, TXmlParser::EElementBegin );
-        _LIT( KProductCode, "ProductCode" );
-        WriteValueL( EXNam, KProductCode );
-        WriteValueL( EXVal, *iSconInfo->iProductCode );
-        WriteTagL( EExt, TXmlParser::EElementEnd );
-        }
-    
-    
-    // print advanced info
-    WriteTagL( EExt, TXmlParser::EElementBegin );
-    _LIT(KAdvancedDeviceInfo, "AdvancedDeviceInfo");
-    WriteValueL( EXNam, KAdvancedDeviceInfo );
-    
-    TBuf<KSysVersionInfoTextLength> temp;
-    
-    if ( iSconInfo->iRevision )
-        {
-        // product revision. For example "01"
-        _LIT( KRevision, "Revision=" );
-        temp.Copy( KRevision );
-        temp.Append( *iSconInfo->iRevision );
-        LOGGER_WRITE_1( "CCapInfo::GeneralInfoL() : %S ", &temp );
-        WriteValueL( EXVal, temp );
-        }
-    
-    
-    if ( iSconInfo->iSysVersionInfo )
-        {
-        _LIT( KFWVersion, "FWVersion=" );
-        temp.Copy( KFWVersion );
-        temp.Append( *iSconInfo->iSysVersionInfo );
-        LOGGER_WRITE_1( "CCapInfo::GeneralInfoL() : %S ", &temp );
-        WriteValueL( EXVal, temp );
-        }
-    
-    SysVersionInfo::TSymbianOSVersion osVersion;
-    err = iSconInfo->GetSymbianVersion( osVersion );
-    LOGGER_WRITE_1("TSymbianOSVersion info error: %d", err)
-    if ( !err )
-        {
-        // Now osVersion contains the Symbian OS version information
-        _LIT( KSymbianOSVersion, "SymbianOSVersion=%d.%d" );
-        temp.Format( KSymbianOSVersion,
-                osVersion.iMajorVersion,
-                osVersion.iMinorVersion  );
-        LOGGER_WRITE_1( "CCapInfo::GeneralInfoL() : %S ", &temp );
-                        
-        WriteValueL( EXVal, temp );
-        }
-    
-    VersionInfo::TPlatformVersion platformVersion;
-    err = iSconInfo->GetS60Version( platformVersion );
-    if ( !err )
-       {
-       _LIT( KS60Version, "S60PlatformVersion=%d.%d" );
-       temp.Format( KS60Version,
-               platformVersion.iMajorVersion,
-               platformVersion.iMinorVersion  );
-       LOGGER_WRITE_1( "CCapInfo::GeneralInfoL() : %S ", &temp );
-       WriteValueL( EXVal, temp );
-       }
-    
-    
-    if ( iSconInfo->iLangVersion )
-        {
-        _LIT( KLangVersion, "LangVersion=" );
-        temp.Copy( KLangVersion );
-        temp.Append( *iSconInfo->iLangVersion );
-        LOGGER_WRITE_1( "CCapInfo::GeneralInfoL() : %S ", &temp );
-        WriteValueL( EXVal, temp );
-        }
-    
-    if ( iSconInfo->iLangSWVersion )
-        {
-        _LIT( KLangSWVersion, "LangSWVersion=" );
-        temp.Copy( KLangSWVersion );
-        temp.Append( *iSconInfo->iLangSWVersion );
-        LOGGER_WRITE_1( "CCapInfo::GeneralInfoL() : %S ", &temp );
-        WriteValueL( EXVal, temp );
-        }
-    
-    if ( iSconInfo->iOPVersion )
-        {
-        // CustomerVersion
-        _LIT( KOPVersion, "OPVersion=" );
-        temp.Copy( KOPVersion );
-        temp.Append( *iSconInfo->iOPVersion );
-        LOGGER_WRITE_1( "CCapInfo::GeneralInfoL() : %S ", &temp );
-        WriteValueL( EXVal, temp );
-        }
-    
-    // screen size
-    LOGGER_WRITE_2("Size, width: %d, height: %d",
-            iSconInfo->iScreenSize.iWidth,
-            iSconInfo->iScreenSize.iHeight );
-    _LIT( KWidth, "ScreenWidth=%d" );
-    _LIT( KHeight, "ScreenHeight=%d" );
-    
-    temp.Format( KWidth, iSconInfo->iScreenSize.iWidth );
-    WriteValueL( EXVal, temp );
-    
-    temp.Format( KHeight, iSconInfo->iScreenSize.iHeight );
-    WriteValueL( EXVal, temp );
-    
-    WriteTagL( EExt, TXmlParser::EElementEnd ); 
-    // end of advanced info
-    
-    WriteTagL(EGeneral, TXmlParser::EElementEnd);
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::MemoryInfoL()
-// Create memory info for all drives (RAM excluded).
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::MemoryInfoL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TMemoryInfo info;
-    TInt devDriveCount = 0;
-    TInt mmcDriveCount = 0;
-    
-    //Write all drivers to folderlisting object
-    TDriveList driveList;
-    // Get all drives that are visible to the user.
-    TInt driveCount;
-    User::LeaveIfError( DriveInfo::GetUserVisibleDrives( iFsSession, driveList, driveCount ) );
-    
-    for( TInt i = EDriveA; i < KMaxDrives; i++ )
-        {
-        if( driveList[i] )
-            {
-            TUint driveStatus;
-            TInt err = DriveInfo::GetDriveStatus( iFsSession, i, driveStatus );
-            if( err )
-                {
-                LOGGER_WRITE_1( "CCapInfo::MemoryInfoL() : DriveInfo::GetDriveStatus: %d", i);
-                continue;
-                }
-            
-            if( !(driveStatus & DriveInfo::EDrivePresent )
-                || driveStatus & DriveInfo::EDriveCorrupt
-                || (driveStatus & DriveInfo::EDriveRemote) )
-                {
-                LOGGER_WRITE_1( "skip drive %d", i);
-                continue;
-                }
-            
-            TRAP( err, CapUtil::GetMemoryInfoL( iFsSession, i, info ));
-            if ( err )
-                {
-                LOGGER_WRITE_1( "CapUtil::GetMemoryInfoL() : Leaved with: %d", err);
-                continue;
-                }
-            
-            info.iDriveStatus = driveStatus;
-            if( driveStatus & DriveInfo::EDriveInternal )
-                {
-                // if internal (DEV) drive, save drive number
-                devDriveCount++;
-                info.iMemNr = devDriveCount;
-                }
-            else if ( driveStatus & DriveInfo::EDriveRemovable )
-                {
-                // if removable (MMC) drive, save drive number
-                mmcDriveCount++;
-                info.iMemNr = mmcDriveCount;
-                }
-            else
-                {
-                // was not internal or removable, skip.
-                LOGGER_WRITE( "CCapInfo::MemoryInfoL() : not internal or removable, skip." );
-                continue;
-                }
-                
-            WriteMemoryInfoL(info);
-            
-            }
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::MemoryInfoL(TMemoryInfo& aInfo)
-// Create memory info for all drives (RAM excluded).
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::WriteMemoryInfoL(TMemoryInfo& aInfo)
-    {
-    TRACE_FUNC_ENTRY;
-    TBuf<KBufSize> buf;
-
-    WriteTagL(EMemory, TXmlParser::EElementBegin);
-
-    if( aInfo.iDriveStatus & DriveInfo::EDriveInternal )
-        {
-        buf = KMediaFlash;
-        }
-    else
-        {
-        buf = KMediaMMC;  // memory card (MMC)
-        }
-        
-    if( aInfo.iMemNr > 1 )
-        {
-        // append memory number DEV2, MMC2..
-        buf.AppendNum( aInfo.iMemNr ); 
-        }
-    
-    WriteValueL(EMemType, buf);
-    WriteValueL(ELocation, aInfo.iLocation);
-    WriteValueL(EFree, aInfo.iFree);
-    WriteValueL(EUsed, aInfo.iUsed);
-    
-    WriteValueL(EFileNLen, aInfo.iFileNameSize);
-
-    WriteTagL(EMemory, TXmlParser::EElementEnd);
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::ServiceInfoL(const TDesC& aDir)
-// Reads service xml-files from directory and writes them into capability 
-// document.
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::ServiceInfoL(const TDesC& aDir, const RArray<TFileName>& aExcludeList,
-    RArray<TFileName>& aFilesAdded)
-    {
-    TRACE_FUNC_ENTRY;
-    CCapList* capList=CapList();
-
-    RArray<TFileName> array( KDefaultArrayGranularity );
-    CleanupClosePushL(array);
-
-    CStringList* stringList=CStringList::NewLC();
-
-    CapUtil::GetFileListL(iFsSession, aDir, array);
-    
-    _LIT(KFormat, "%S%S");
-    TFileName name;
-    TInt count=array.Count();
-    for (TInt i=0; i<count; i++)
-        {
-        TBool exludeFromList(EFalse);
-        
-        // Check if file is already added to list
-        for ( TInt j=0; j<aExcludeList.Count() && !exludeFromList; j++ )
-            {
-            if ( array[i].CompareF(aExcludeList[j]) == 0 )
-                {
-                LOGGER_WRITE_1( "match found at pos %d", j);
-                exludeFromList = ETrue;
-                }
-            }
-        
-        if ( !exludeFromList )
-            {
-            name.Format(KFormat, &aDir, &array[i]);
-            if (!CapUtil::CheckFileType(name, KXmlExtension))
-                {
-                continue;  // only accept .xml files
-                }
-            
-            capList->List()->Reset();
-            capList->List()->ReadFromFileL( iFsSession, name );
-            if (capList->FindServiceL(stringList))
-                {
-                WriteNewLineL();
-                WriteFromListL(stringList);
-                
-                User::LeaveIfError( aFilesAdded.Append(array[i]) );
-                LOGGER_WRITE_1( "File '%S' added to list", &array[i] );
-                }
-            }
-        }
-
-    CleanupStack::PopAndDestroy(stringList);
-    CleanupStack::PopAndDestroy(&array);
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::FolderServiceL()
-// Writes folder service. Notice that this service is created in code because
-// pathinfo component is used to get folder names.
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::FolderServiceL()
-    {
-    TRACE_FUNC_ENTRY;
-    TBuf<KBufSize> rootPath;
-    TBuf<KBufSize> memoryType(KNullDesC);
-    TFileName folderName;
-    _LIT( KFormat, "%S%S" );
-    
-    WriteNewLineL();
-    WriteTagL(EService, TXmlParser::EElementBegin);
-
-    WriteValueL(EName,  KFolderServiceName);
-    WriteValueL(EUUID,  KFolderServiceUid);
-    WriteValueL(EVersion,  KFolderServiceVersion);
-
-    WriteTagL(EObject, TXmlParser::EElementBegin);
-    WriteValueL(EType,  KFolderServiceType);
-    WriteTagL(EObject, TXmlParser::EElementEnd);
-    TInt drive;
-    TInt err;
-    
-    CapUtil::GetDefaultRootPathL( iFsSession, rootPath );
-    if( rootPath.Length() > 0 )
-        {
-        err = iFsSession.CharToDrive( rootPath[0], drive );
-        if( err == KErrNone )
-            {
-            CapUtil::GetMemoryType( iFsSession, memoryType, drive );
-            }
-        }
-
-    // EFolderImages
-    folderName.Format( KFormat, &rootPath, &PathInfo::ImagesPath() );
-    WriteFolderL( KFolderImages, folderName, memoryType );
-    
-    // EFolderGraphics
-    folderName.Format( KFormat, &rootPath, &PathInfo::ImagesPath() );
-    WriteFolderL(KFolderGraphics, folderName, memoryType);
-    
-    // EFolderTones
-    folderName.Format( KFormat, &rootPath, &PathInfo::DigitalSoundsPath() );
-    WriteFolderL(KFolderTones, folderName, memoryType);
-    
-    // EFolderMusic
-    folderName.Format( KFormat, &rootPath, &PathInfo::SoundsPath() );
-    WriteFolderL(KFolderMusic, folderName, memoryType);
-    
-    // EFolderVideos
-    folderName.Format( KFormat, &rootPath, &PathInfo::VideosPath() );
-    WriteFolderL(KFolderVideos, folderName, memoryType);
-    
-    // EFolderInstalls
-    folderName.Format( KFormat, &rootPath, &PathInfo::InstallsPath() );
-    WriteFolderL(KFolderInstalls, folderName, memoryType);
-
-
-    WriteTagL(EService, TXmlParser::EElementEnd);
-    WriteNewLineL();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::SyncSolutionsServiceL()
-// Reads last used syncSolutions from cenrep and writes to capability object
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::SyncSolutionsServiceL()
-    {
-    TRACE_FUNC_ENTRY;
-    TSConSolutionInfo calendar;
-    TSConSolutionInfo contact;
-    TSConSolutionInfo sms;
-    TSConSolutionInfo bookmark;
-    
-    CSConSyncService *syncService = CSConSyncService::NewLC();
-    syncService->GetSolutionL( KSeconCalendarUid, calendar );
-    syncService->GetSolutionL( KSeconContactsUid, contact );
-    syncService->GetSolutionL( KSeconSmsUid, sms );
-    syncService->GetSolutionL( KSeconBookmarkUid, bookmark );
-    CleanupStack::PopAndDestroy( syncService );
-    
-    WriteSyncSolutionsServiceL( calendar, contact, sms, bookmark );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CCapInfo::WriteSyncSolutionsServiceL()
-// Writes SyncSolutionsService data to capability object.
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::WriteSyncSolutionsServiceL( const TSConSolutionInfo& aCalendar,
-        const TSConSolutionInfo& aContact,
-        const TSConSolutionInfo& aSms,
-        const TSConSolutionInfo& aBookmark)
-    {
-    TRACE_FUNC_ENTRY;
-    
-    WriteTagL( EService, TXmlParser::EElementBegin );
-
-    WriteValueL( EName,  KSyncSolutionsServiceName );
-    WriteValueL( EVersion,  KSyncSolutionsServiceVersion );
-    
-    if ( aCalendar.iUid != 0 )
-        {
-        WriteSolutionTagL( KSyncCalendar, aCalendar );
-        }
-    
-    if ( aContact.iUid != 0 )
-        {
-        WriteSolutionTagL( KSyncContacts, aContact );
-        }
-    
-    if ( aSms.iUid != 0 )
-        {
-        WriteSolutionTagL( KSyncSms, aSms );
-        }
-    
-    if ( aBookmark.iUid != 0 )
-        {
-        WriteSolutionTagL( KSyncBookmark, aBookmark );
-        }
-    
-    /*
-     * <Ext>
-     *   <XNam>DesktopSync</XNam>
-     *   <XVal></XVal>
-     * </Ext>
-     * 
-     */
-    if ( !iSconInfo->iDesktopSyncError )
-        {
-        WriteTagL( EExt, TXmlParser::EElementBegin );
-        WriteValueL( EXNam, KDesktopSync );
-        
-        TBuf<KBufSize> buffer;
-        buffer.AppendNum( iSconInfo->iDesktopSync );
-        
-        WriteValueL( EXVal, buffer );
-        WriteTagL( EExt, TXmlParser::EElementEnd );
-        }
-    
-    
-    
-    WriteTagL( EService, TXmlParser::EElementEnd );
-    TRACE_FUNC_EXIT;
-    }
-
-
-
-// -----------------------------------------------------------------------------
-// CCapInfo::WriteSolutionTagL()
-// Writes SyncSolutionsService solution data to capability object.
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::WriteSolutionTagL( const TDesC& aContentName,
-        const TSConSolutionInfo& aSolution )
-    {
-    TRACE_FUNC_ENTRY;
-    _LIT( KFormatUID, "UID=0x%08x" );
-    _LIT( KFormatName, "Name=%S" );
-    _LIT( KFormatDate, "Timestamp=%04d%02d%02dT%02d%02d%02dZ" );
-    
-    WriteTagL( EExt, TXmlParser::EElementBegin );
-    WriteValueL( EXNam, aContentName );
-    
-    TFileName temp;
-    temp.Format( KFormatUID, aSolution.iUid );
-    WriteValueL( EXVal, temp );
-    
-    temp.Format( KFormatName, &aSolution.iSolutionName );
-    WriteValueL( EXVal, temp );
-    
-    if ( aSolution.iTime.Int64() != 0 )
-        {
-        // write time
-        TDateTime time = aSolution.iTime.DateTime();
-        temp.Format( KFormatDate, time.Year(), time.Month() + 1,
-            time.Day() + 1, time.Hour(), time.Minute(), time.Second() );
-        WriteValueL( EXVal, temp );
-        
-        }
-    
-    
-    WriteTagL( EExt, TXmlParser::EElementEnd );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::WriteFolderL(const TDesC& aType, const TDesC& aFullName, 
-// const TDesC& aMemory)
-// Writes one folder name element.
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::WriteFolderL(const TDesC& aType, const TDesC& aFullName, 
-                            const TDesC& aMemory)
-    {
-    TRACE_FUNC_ENTRY;
-    _LIT(KFormat, "%S=%S");
-
-    TBuf<KBufSize> buf; 
-    const TInt KReservedSize = 10;
-    if ( aFullName.Length() + KReservedSize > KBufSize )
-        {
-        return;
-        }
-    buf.Format(KFormat, &KFolderNameTag, &aFullName);
-    
-
-    WriteTagL(EExt, TXmlParser::EElementBegin);
-
-    WriteValueL(EXNam, aType);
-    WriteValueL(EXVal, buf);
-
-    buf.Format(KFormat, &KFolderMemoryTypeTag, &aMemory);
-    WriteValueL(EXVal, buf);
-    
-
-    WriteTagL(EExt, TXmlParser::EElementEnd);
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::WriteL(const TDesC& aText)
-// Writes one element to capability buffer.
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::WriteL(const TDesC& aText)
-    {
-    if (aText.Length() > iBuf.MaxLength())
-        {
-        User::Leave(KErrTooBig);
-        }
-        
-
-    iBuf=aText;
-    iBuf.Trim();
-    FormatElement(iBuf);
-    TPtr8 ptr = iHeapBuf->Des();
-
-    if ( iBuf.Length()+2 > ptr.MaxLength() )
-        {
-        User::Leave(KErrTooBig);
-        }
-        
-    //unicode conversion
-    HBufC8* convBuf = HBufC8::NewLC( iBuf.Size() );
-    TPtr8 convPtr = convBuf->Des();
-    
-    CnvUtfConverter::ConvertFromUnicodeToUtf8(convPtr, iBuf);
-
-    ptr.Copy(convPtr);
-    ptr.Append( KLineFeed );  // linefeed
-    
-    CleanupStack::PopAndDestroy( convBuf );
-    
-    TInt pos=iCapabilityBuf->Size();
-    iCapabilityBuf->InsertL(pos, ptr);
-
-    iBuf=KNullDesC;
-    }
-
-void CCapInfo::WriteNewLineL()
-    {
-    TInt pos=iCapabilityBuf->Size();
-    iCapabilityBuf->InsertL(pos, KLineFeed );
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::WriteValueL(TInt aId, const TDesC& aValue)
-// Constructs element with value (eg <Language>en</Language>)
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::WriteValueL(TInt aId, const TDesC& aValue)
-    {
-    // empty values not written to capability object
-    if (aValue.Length()<1)
-        {
-        LOGGER_WRITE( "WriteValueL: value is empty" );
-        return;
-        }
-
-    TBuf<KBufSize> buf;
-
-    TRAPD(err, CapParser::MakeElementL(buf, aId, aValue));
-    if (err==KErrNone)
-        {
-        WriteL(buf);
-        }
-    else if (err==KErrTooBig)
-        {
-        WriteBigValueL(aId, aValue);
-        }
-    else
-        {
-        User::Leave(err);
-        }
-    
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::WriteBigValueL(TInt aId, const TDesC& aValue)
-// Constructs element with value
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::WriteBigValueL(TInt aId, const TDesC& aValue)
-    {
-    HBufC* hBuf=HBufC::NewL(aValue.Length()+KBufSize);
-    CleanupStack::PushL(hBuf);
-
-    TPtr pBuf(hBuf->Des());
-    CapParser::MakeElementL(pBuf, aId, aValue);
-    WriteL(*hBuf);
-    
-    CleanupStack::PopAndDestroy(hBuf);
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::WriteValueL(TInt aId, TInt64 aValue)
-// Constructs element with integer value
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::WriteValueL(TInt aId, TInt64 aValue)
-    {
-    TBuf<KBufSize> buf;
-    TBuf<KTagSize> value;
-    CapUtil::IntToStr(value, aValue);
-    CapParser::MakeElementL(buf, aId, value);
-    WriteL(buf);
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::WriteTagL(TInt aId, TInt aType)
-// Constructs element without value (eg <Memory>)
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::WriteTagL(TInt aId, TInt aType)
-    {
-    TBuf<KBufSize> buf;
-    CapParser::MakeElementL(buf, aId, aType);
-    WriteL(buf);
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::WriteAttributeL(TInt aId, const TDesC& aVersion, const TDesC& aDate)
-// Constructs element with attributes "Version" and "Date" 
-// (eg <HW Version="1.5"/>)
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::WriteAttributeL(TInt aId, const TDesC& aVersion, 
-                                const TDesC& aDate)
-    {
-    // empty values not written to capability object
-    if (aVersion.Length()<1 && aDate.Length()<1)
-        {
-        LOGGER_WRITE( "WriteAttributeL: attributes are empty" );
-        return;
-        }
-    
-    TBuf<KBufSize> buf;
-    CapParser::MakeElementL(buf, aId, aVersion, aDate);
-    WriteL(buf);
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::WriteFromListL(CStringList* aList)
-// Writes elements from list to capability buffer.
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::WriteFromListL(CStringList* aList)
-    {
-    TInt count=aList->Count();
-
-    for (TInt i=0; i<count; i++)
-        {
-        WriteL(aList->ReadPtr(i));
-        }
-    }   
-
-// -----------------------------------------------------------------------------
-// CCapInfo::FormatElement(TDes& aText)
-// Function adds indentation spaces to capability elements to improve 
-// readability.
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::FormatElement(TDes& aText)
-    {
-    TXmlParser parser;
-
-    parser.Set(aText);
-    TInt type=parser.Type();
-    TBuf<KTagSize> tag;
-    parser.GetTag(tag);
-        
-    if (type==TXmlParser::EElementEnd)
-        {
-        TInt id1=CapParser::ElementId(tag);
-        TInt id2=iIdStack.Pop();
-        
-        __ASSERT_DEBUG(id1==id2, CapUtil::Panic(KErrGeneral));
-        id1=0;
-        id2=0;
-        }
-
-    AddFormatText(aText, iIdStack.Size());
-
-    if (type==TXmlParser::EElementBegin)
-        {
-        TInt id1=CapParser::ElementId(tag);
-        iIdStack.Push(id1);
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CCapInfo::AddFormatText( TDes& aText, TInt aNum ) const
-// Adds format text
-// -----------------------------------------------------------------------------
-//
-void CCapInfo::AddFormatText( TDes& aText, TInt aNum ) const
-    {
-    TBuf<KBufSize> buf;
-    buf = KNullDesC;
-
-    if ( aNum > KNestingLimit )
-        {
-        aNum = KNestingLimit;
-        }
-        
-    for ( TInt i=0; i<aNum; i++ )
-        {
-        buf.Append( KFormatText );
-        }
-    if ( aText.MaxLength()-aText.Length()>buf.Length() )
-        {
-        aText.Insert( 0, buf );
-        }
-    }
-    
-// End of file
-
-
--- a/connectivitymodules/SeCon/services/csc/src/caplist.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CCapList implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "caplist.h"
-#include "caputils.h"
-#include "capparser.h"
-#include "capability.h"
-#include "debug.h"
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-
-// -----------------------------------------------------------------------------
-// CCapList::NewL()
-// Two-phase constructor.
-// -----------------------------------------------------------------------------
-//
-CCapList* CCapList::NewL()
-    {
-    CCapList* self = new(ELeave) CCapList();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapList::~CCapList()
-// Gets phone serial number from etel.
-// -----------------------------------------------------------------------------
-//
-CCapList::~CCapList()
-    {
-    delete iList;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapList::CCapList()
-// Constructor
-// -----------------------------------------------------------------------------
-//
-CCapList::CCapList()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CCapList::ConstructL()
-// Initializes the member data
-// -----------------------------------------------------------------------------
-//
-void CCapList::ConstructL()
-    {
-    iList = CStringList::NewL();
-    }
-
-// -----------------------------------------------------------------------------
-// CCapList::List()
-// Returns the list
-// -----------------------------------------------------------------------------
-//
-CStringList* CCapList::List()
-    {
-    __ASSERT_DEBUG(iList, CapUtil::Panic(KErrGeneral));
-    return iList;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapList::FindFromMark(TInt aId, TInt aType)
-// Find from mark
-// -----------------------------------------------------------------------------
-//
-TInt CCapList::FindFromMark(TInt aId, TInt aType)
-    {
-    TInt mark = List()->Mark();
-    TInt count= List()->Count();
-    
-    if ( mark >= count )
-        {
-        return KErrNotFound;
-        }       
-
-    TInt index=Find(aId, aType, mark);
-    if ( index == KErrNotFound )
-        {
-        return KErrNotFound;
-        }
-        
-
-    __ASSERT_DEBUG(index>=mark, CapUtil::Panic(KErrGeneral));
-
-    List()->SetMark(index+1);
-    return index;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapList::FindServiceHeader()
-// Finds service xml-file identification header. This header must be the first 
-// line in every service file.
-// -----------------------------------------------------------------------------
-//
-TBool CCapList::FindServiceHeader()
-    {
-    TRACE_FUNC_ENTRY;
-    if (List()->Count()<1)
-        {
-        LOGGER_WRITE( "CCapList::FindServiceHeader() : returned EFalse" );
-        return EFalse;
-        }
-
-    TBuf<KBufSize> buf;
-    TPtrC ptr=List()->ReadPtr(0);
-    CapUtil::StrCopy(buf, ptr);
-    buf.Trim();
-    if (buf.Compare(KServiceHeader)==0)
-        {
-        LOGGER_WRITE( "CCapList::FindServiceHeader() : returned ETrue" );
-        return ETrue;
-        }       
-    else
-        {
-        LOGGER_WRITE( "CCapList::FindServiceHeader() : returned EFalse" );
-        return EFalse;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CCapList::FindServiceL(CStringList* aList)
-// Find service
-// -----------------------------------------------------------------------------
-//
-TBool CCapList::FindServiceL(CStringList* aList)
-    {
-    TRACE_FUNC_ENTRY;
-    aList->Reset();
-    List()->SetMark(0);
-
-    if (!FindServiceHeader())
-        {
-        LOGGER_WRITE( "CCapList::FindServiceL(CStringList* aList) : returned EFalse" );
-        return EFalse;
-        }
-        
-
-    for (;;)
-        {
-        TInt start=FindFromMark(EService, TXmlParser::EElementBegin);
-        TInt stop=FindFromMark(EService, TXmlParser::EElementEnd);
-        
-        if (start==KErrNotFound || stop==KErrNotFound || start>=stop)
-            {
-            break;
-            }
-                    
-        aList->CopyL(List(), start, stop);
-        }
-
-    if (aList->Count()>0)
-        {
-        LOGGER_WRITE( "CCapList::FindServiceL(CStringList* aList) : returned ETrue" );
-        return ETrue;
-        }
-    
-    LOGGER_WRITE( "CCapList::FindServiceL(CStringList* aList) : returned EFalse" );   
-    return EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// CCapList::Find(TInt aId, TInt aType, TInt aIndex)
-// Find element
-// -----------------------------------------------------------------------------
-//
-TInt CCapList::Find(TInt aId, TInt aType, TInt aIndex)
-    {
-    TInt count=List()->Count();
-    if (aIndex<0 || aIndex>=count)
-        {
-        CapUtil::Panic(KErrArgument);
-        }
-        
-    for (TInt i=aIndex; i<count; i++)
-        {
-        TPtrC ptr=List()->ReadPtr(i);
-
-        TInt id=0;
-        TInt type=0;
-        
-        CapParser::ParseElement(ptr, id, type);
-        if (type==TXmlParser::EElementUnknown)
-            {
-            continue;  // invalid capability element
-            }
-
-        if (id==aId && aType==type)
-            {
-            return i;
-            }
-        }
-    return KErrNotFound;
-    }
-
-
-// End of files
--- a/connectivitymodules/SeCon/services/csc/src/capparser.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,766 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CapParser implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "capparser.h"
-#include "caputils.h"
-
-const char KFind1 = '&';
-const char KFind2 = '<';
-const char KFind3 = '>';
-const char KFind4 = '"';
-const char KFind5 = '\'';
-
-_LIT( KReplace1, "&amp;" );
-_LIT( KReplace2, "&lt;" );
-_LIT( KReplace3, "&gt;" );
-_LIT( KReplace4, "&quot;" );
-_LIT( KReplace5, "&apos;" );
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CapParser::GetTagL(TDes& aText, TInt aId)
-// Returns capability element tag (eg. "Memory")
-// -----------------------------------------------------------------------------
-//
-void CapParser::GetTagL(TDes& aText, TInt aId)
-    {
-    aText=KNullDesC;
-    
-    TInt count=NUMXMLTOKENS;
-    for (TInt i=0; i<count; i++)
-        {
-        TXmlToken t=KXmlTokens[i];
-        if (t.id==aId)
-            {
-            aText=t.tag;
-            return;
-            }
-        }
-    User::Leave(KErrNotFound);
-    }
-
-// -----------------------------------------------------------------------------
-// CapParser::ElementId(const TDesC& aText)
-// Returns capability element id (eg. EMemory).
-// -----------------------------------------------------------------------------
-//
-TInt CapParser::ElementId(const TDesC& aText)
-    {
-    TBuf<KTagSize>buf;
-    TInt count=NUMXMLTOKENS;
-    for (TInt i=0; i<count; i++)
-        {
-        TXmlToken t=KXmlTokens[i];
-        buf=t.tag;
-        if (buf.Compare(aText)==0)
-            {
-            return t.id;
-            }
-        }
-    return KErrNotFound;
-    }
-
-// -----------------------------------------------------------------------------
-// CapParser::ParseElement(const TDesC& aText, TInt& aId, TInt& aType)
-// Parses element's id and type (eg. "<Memory>" -> EMemory, EElementBegin)
-// -----------------------------------------------------------------------------
-//
-void CapParser::ParseElement(const TDesC& aText, TInt& aId, TInt& aType)
-    {
-    TXmlParser parse;
-    aId=KErrNotFound;
-    
-    parse.Set(aText);
-    aType=parse.Type();
-    if (aType==TXmlParser::EElementUnknown)
-        {
-        return;
-        }
-
-    TPtrC ptr=parse.Tag();
-    aId=ElementId(ptr);
-    }
-
-// -----------------------------------------------------------------------------
-// CapParser::MakeElementL(TDes& aText, TInt aId, const TDesC& aValue)
-// Constructs element with value (eg. "<Free>23456</Free>").
-// -----------------------------------------------------------------------------
-//
-void CapParser::MakeElementL(TDes& aText, TInt aId, const TDesC& aValue)
-    {
-    aText=KNullDesC;
-    ReplaceSpecialCharsL( aText, aValue );
-    
-    TBuf<KTagSize> buf;
-    MakeElementL( buf, aId, TXmlParser::EElementBegin );
-    
-    TInt len = aText.Length() + buf.Length() + buf.Length() + 1;
-    if ( len > aText.MaxLength())
-        {
-        User::Leave(KErrTooBig);
-        }
-    
-    aText.Insert( 0, buf );
-    MakeElementL( buf, aId, TXmlParser::EElementEnd );
-    aText.Append( buf );
-    }
-
-// -----------------------------------------------------------------------------
-// CapParser::MakeElementL(TDes& aText, TInt aId, TInt aType)
-// Constructs element without value (eg. "<Memory>" or "</Memory>").
-// -----------------------------------------------------------------------------
-//
-void CapParser::MakeElementL(TDes& aText, TInt aId, TInt aType)
-    {
-    _LIT(KFormat1, "<%S>");
-    _LIT(KFormat2, "</%S>");
-    _LIT(KFormat3, "<%S/>");
-
-    aText=KNullDesC;
-    TBuf<KTagSize> buf;
-    GetTagL(buf, aId);
-    
-    switch(aType)
-        {
-        case TXmlParser::EElementBegin:
-            aText.Format(KFormat1, &buf);
-            break;
-        case TXmlParser::EElementEnd:
-            aText.Format(KFormat2, &buf);
-            break;
-        case TXmlParser::EElementEmpty:
-            aText.Format(KFormat3, &buf);
-            break;
-        default:
-            CapUtil::Panic(KErrArgument);
-            break;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CapParser::MakeElementL(TDes& aText, TInt aId, const TDesC& aVersion,
-// const TDesC& aDate)
-// Constructs element with attributes "Version" and "Date"(eg. 
-// "<FW Version="2.2"/>").
-// -----------------------------------------------------------------------------
-//
-void CapParser::MakeElementL(TDes& aText, TInt aId, const TDesC& aVersion, 
-                            const TDesC& aDate)
-    {
-    _LIT(KFormat1, "<%S %S=\"%S\" %S=\"%S\"/>");
-    _LIT(KFormat2, "<%S %S=\"%S\"/>");
-
-    aText=KNullDesC;
-    
-    TBuf<KTagSize> element;
-    TBuf<KTagSize> versionTag;
-    TBuf<KTagSize> dateTag;
-    
-    GetTagL(element, aId);
-    GetTagL(versionTag, EAttVersion);
-    GetTagL(dateTag, EAttDate);
-
-    if (aDate.Length()>0)
-        {
-        aText.Format(KFormat1, &element, &versionTag, &aVersion, &dateTag, 
-        &aDate);
-        }       
-    else
-        {
-        aText.Format(KFormat2, &element, &versionTag, &aVersion);
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CapParser::ReplaceSpecialCharsL( TDes& aText, const TDesC& aValue )
-// Replaces special characters to xml compliant.
-// -----------------------------------------------------------------------------
-//
-void CapParser::ReplaceSpecialCharsL( TDes& aText, const TDesC& aValue )
-    {
-    if ( aValue.Length() > aText.MaxLength() )
-        {
-        User::Leave(KErrTooBig);
-        }
-    aText.Copy( aValue );
-    
-    //Replace special characters
-    for( TInt i = 0; i < aText.Length(); i++ )
-        {
-        switch( aText[i] )
-            {
-            case KFind1:
-                if ( aText.Length()+KReplace1().Length()-1 > aText.MaxLength() )
-                    {
-                    User::Leave(KErrTooBig);
-                    }
-                aText.Replace( i, 1, KReplace1 );
-                i+=KReplace1().Length()-1;
-                break;
-            case KFind2:
-                if ( aText.Length()+KReplace2().Length()-1 > aText.MaxLength() )
-                    {
-                    User::Leave(KErrTooBig);
-                    }
-                aText.Replace( i, 1, KReplace2 );
-                i+=KReplace2().Length()-1;
-                break;
-            case KFind3:
-                if ( aText.Length()+KReplace3().Length()-1 > aText.MaxLength() )
-                    {
-                    User::Leave(KErrTooBig);
-                    }
-                aText.Replace( i, 1, KReplace3 );
-                i+=KReplace3().Length()-1;
-                break;
-            case KFind4:
-                if ( aText.Length()+KReplace4().Length()-1 > aText.MaxLength() )
-                    {
-                    User::Leave(KErrTooBig);
-                    }
-                aText.Replace( i, 1, KReplace4 );
-                i+=KReplace4().Length()-1;
-                break;
-            case KFind5:
-                if ( aText.Length()+KReplace5().Length()-1 > aText.MaxLength() )
-                    {
-                    User::Leave(KErrTooBig);
-                    }
-                aText.Replace( i, 1, KReplace5 );
-                i+=KReplace5().Length()-1;
-                break;
-            default:
-                break;
-            }
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::Set(const TDesC& aText)
-// Sets a tag
-// -----------------------------------------------------------------------------
-//
-void TXmlParser::Set(const TDesC& aText)
-    {
-    iOriginal.Set(aText);
-    TrimOriginal();
-    Init();
-    Parse();
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::Init()
-// Inits the parser
-// -----------------------------------------------------------------------------
-//
-void TXmlParser::Init()
-    {
-    iType=EElementUnknown;
-    iTag.Set(KNullDesC);
-    iValue.Set(KNullDesC);
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::GetTag(TDes& aText) const
-// Gets the tag
-// -----------------------------------------------------------------------------
-//
-void TXmlParser::GetTag(TDes& aText) const
-    {
-    StrCopy(aText, iTag);
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::Tag() const
-// Returns a pointer to a tag
-// -----------------------------------------------------------------------------
-//
-TPtrC TXmlParser::Tag() const
-    {
-    return iTag;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::Type() const
-// Returns type
-// -----------------------------------------------------------------------------
-//
-TInt TXmlParser::Type() const
-    {
-    return iType;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::Parse()
-// Parses xml-element.  
-// -----------------------------------------------------------------------------
-//
-void TXmlParser::Parse()
-    {
-    iType=EElementUnknown;
-    
-    // this must be the first check
-    if (ElementUnknown())
-        {
-        return;
-        }       
-    
-    if (ElementBegin())
-        {
-        return;
-        }
-    
-    if (ElementEnd())
-        {
-        return;
-        }
-        
-    if (ElementValue())
-        {
-        return;
-        }
-            
-    if (ElementComment())
-        {
-        return;
-        }
-        
-    if (ElementDocType())
-        {
-        return;
-        }
-        
-    if (ElementVersion())
-        {
-        return;
-        }
-        
-    if (ElementEmpty())
-        {
-        return;
-        }
-        
-    if (ElementAtt())
-        {
-        return;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::ElementUnknown()
-// Parses unknown elements
-// -----------------------------------------------------------------------------
-//
-TBool TXmlParser::ElementUnknown()
-    {
-    TPtrC str=Str();
-    TInt len=str.Length();
-    const TInt KXmlElementMinLength = 3;
-    if ( len < KXmlElementMinLength )
-        {
-        return ETrue;  // too short to be xml element
-        }
-        
-    
-    iFirst=str.Locate('<');
-    iLast=str.LocateReverse('>');
-    iSlash=str.LocateReverse('/');
-
-    if (iFirst!=0 || iLast!=len-1)
-        {
-        return ETrue;  // first char must be "<" and last ">"
-        }
-        
-    return EFalse;    
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::ElementBegin()
-// Parses beginning tag (eg. <General>)
-// -----------------------------------------------------------------------------
-//
-TBool TXmlParser::ElementBegin()
-    {
-    TPtrC str=Str();
-        
-    if (iSlash!=KErrNotFound)
-        {
-        return EFalse;
-        }
-        
-    // remove possible attributes
-    TInt pos=str.Locate(' ');
-    if (pos==KErrNotFound)
-        {
-        pos=iLast;
-        }
-        
-    TPtrC ptr=SubStr(iFirst, pos);
-
-    if (!ValidTag(ptr))
-        {
-        return EFalse;
-        }       
-
-    iType=EElementBegin;
-    iTag.Set(ptr);
-
-    return ETrue;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::ElementEnd()
-// Parses ending tag (eg. </General>)
-// -----------------------------------------------------------------------------
-//
-TBool TXmlParser::ElementEnd()
-    {
-    if (iSlash!=iFirst+1)
-        {
-        return EFalse;
-        }
-        
-    TPtrC ptr=SubStr(iSlash, iLast);
-    if (!ValidTag(ptr))
-        {
-        return EFalse;
-        }       
-
-    iType=EElementEnd;
-    iTag.Set(ptr);
-    return ETrue;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::ElementValue()
-// Parses value (eg. <Language>en</Language>)
-// -----------------------------------------------------------------------------
-//
-TBool TXmlParser::ElementValue()
-    {
-    TPtrC str=Str();
-
-    TInt pos1=str.Locate('>');
-    TInt pos2=str.LocateReverse('<');
-    
-    if (pos1<pos2 && iSlash==pos2+1)
-        {
-        TPtrC ptr1=SubStr(iFirst, pos1);
-        TPtrC ptr2=SubStr(iSlash, iLast);
-        if (!ValidTag(ptr1) || ptr1.Compare(ptr2)!=0)
-            {
-            return EFalse;
-            }
-                    
-        iType=EElementValue;
-        iTag.Set(ptr1);
-        iValue.Set(SubStr(pos1, pos2));
-        return ETrue;
-        }
-    return EFalse;    
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::ElementEmpty()
-// Parses empty element (eg. <CaseSenN/>)
-// -----------------------------------------------------------------------------
-//
-TBool TXmlParser::ElementEmpty()
-    {
-    if (iSlash!=iLast-1)
-        {
-        return EFalse;
-        }       
-    
-    TPtrC ptr=SubStr(iFirst, iSlash);
-    if (!ValidTag(ptr))
-        {
-        return EFalse;
-        }
-        
-    iType=EElementEmpty;
-    iTag.Set(ptr);
-    return ETrue;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::ElementVersion()
-// Identifies version element ("<?xml version="1.0" ?>") 
-// -----------------------------------------------------------------------------
-//
-TBool TXmlParser::ElementVersion()
-    {
-    TPtrC str=Str();
-
-    if ( str.Length()>=3 && str[1]=='?' && str[2]=='x')
-        {
-        iType=EElementVersion;
-        return ETrue;
-        }
-    return EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::ElementDocType()
-// Identifies document type element 
-// ("<!DOCTYPE Capability SYSTEM "obex-capability.dtd">").
-// -----------------------------------------------------------------------------
-//
-TBool TXmlParser::ElementDocType()
-    {
-    TPtrC str=Str();
-    const TInt KElementMinLength = 10;
-    if ( str.Length() < KElementMinLength )
-        {
-        return EFalse;
-        }
-        
-    if (str[1]=='!' && str[2]=='D' && str[3]=='O' && str[4]=='C')
-        {
-        iType=EElementDocType;
-        return ETrue;
-        }
-    return EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::ElementComment()
-// Identifies comment element ("<!-- OBEX Capability Object -->").
-// -----------------------------------------------------------------------------
-//
-TBool TXmlParser::ElementComment()
-    {
-    TPtrC str=Str();
-    
-    if (str.Length()<7)
-        {
-        return EFalse;
-        }
-        
-    if (str[1]=='!' && str[2]=='-' && str[3]=='-')
-        {
-        iType=EElementComment;
-        return ETrue;
-        }
-    
-    return EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::ElementAtt()
-// Parses attribute element (eg. <HW Version="1.5"/>)
-// Note: Attribute values cannot contain equals (=) or quotations (")
-// -----------------------------------------------------------------------------
-//
-TBool TXmlParser::ElementAtt()
-    {
-    TPtrC str=Str();
-    TInt num1=Count(str, '=');
-    TInt num2=Count(str, '"');
-    TInt pos=str.Locate(' ');  // find end of tag
-    
-    if (iSlash==iLast-1 && num1>0 && num2==(2*num1) && pos!=KErrNotFound)
-        {
-        TPtrC ptr1=SubStr(iFirst, pos);
-        if (!ValidTag(ptr1))
-            {
-            return EFalse;
-            }
-            
-        iType=EElementAtt;
-        iTag.Set(ptr1);
-        TPtrC ptr2=SubStr(pos, iSlash);
-        iValue.Set(ptr2);
-        return ETrue;
-        }
-    return EFalse;    
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::Str() const
-// Locates the position of the given character
-// -----------------------------------------------------------------------------
-//
-TPtrC TXmlParser::Str() const
-    {
-    return iText;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::FirstNonSpace(const TDesC& aText)
-// Returns the position of the first non space character
-// -----------------------------------------------------------------------------
-//
-TInt TXmlParser::FirstNonSpace(const TDesC& aText)
-    {
-    TInt len=aText.Length();
-    for (TInt i=0; i<len; i++)
-        {
-        TChar c=aText[i];
-        if (!c.IsSpace())
-            {
-            return i;
-            }
-        }
-    return KErrNotFound;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::LastNonSpace(const TDesC& aText)
-// Returns the position of the last non space character
-// -----------------------------------------------------------------------------
-//
-TInt TXmlParser::LastNonSpace(const TDesC& aText)
-    {
-    TInt last=aText.Length()-1;
-    for (TInt i=last; i>=0; i--)
-        {
-        TChar c=aText[i];
-        if (!c.IsSpace())
-            {
-            return i;
-            }           
-        }
-    return KErrNotFound;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::SubStr(const TDesC& aText, TInt pos1, TInt pos2)
-// Function returns a sub-string between aPos1 and aPos2
-// -----------------------------------------------------------------------------
-//
-TPtrC TXmlParser::SubStr(const TDesC& aText, TInt pos1, TInt pos2)
-    {
-    if (pos1<0 || pos2>=aText.Length() || pos1>=pos2)
-        {
-        return TPtrC(); // return empty descriptor
-        }
-        
-    TInt len=pos2-pos1;
-    return aText.Mid(pos1+1, len-1); 
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::SubStr(TInt pos1, TInt pos2)
-// Function returns a sub-string between aPos1 and aPos2
-// -----------------------------------------------------------------------------
-//
-TPtrC TXmlParser::SubStr(TInt pos1, TInt pos2)
-    {
-    TPtrC str=Str();
-    return SubStr(str, pos1, pos2);
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::StrCopy(TDes& aTarget, const TDesC& aSource)
-// Function performs string copy with length checking.
-// -----------------------------------------------------------------------------
-//
-void TXmlParser::StrCopy(TDes& aTarget, const TDesC& aSource)
-    {
-    TInt len=aTarget.MaxLength();
-    if(len<aSource.Length()) 
-        {
-        aTarget.Copy(aSource.Left(len));
-        }        
-    else
-        {
-        aTarget.Copy(aSource);
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::Count(const TDesC& aText, const TChar aChar)
-// Returns the number of characters (aChar)
-// -----------------------------------------------------------------------------
-//
-TInt TXmlParser::Count(const TDesC& aText, const TChar aChar)
-    {
-    TInt count=0;
-    TInt len=aText.Length();
-
-    for (TInt i=0; i<len; i++)
-        {
-        TChar ch=aText[i];
-        if (ch == aChar)
-            {
-            count++;
-            }
-        }
-    return count;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::TrimOriginal()
-// Trimmer function
-// -----------------------------------------------------------------------------
-//
-void TXmlParser::TrimOriginal()
-    {
-    // trim iOriginal and place into iText
-    iText.Set(KNullDesC);
-    TInt first=FirstNonSpace(iOriginal);
-    TInt last=LastNonSpace(iOriginal);
-    if(first!=KErrNotFound && last!=KErrNotFound && last>first+1)
-        {
-        TPtrC ptr=iOriginal.Mid(first, last-first+1);
-        iText.Set(ptr);
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::ValidChar(const TChar aChar)
-// Validates the character
-// -----------------------------------------------------------------------------
-//
-TBool TXmlParser::ValidChar(const TChar aChar)
-    {
-    if (aChar >= 'A' && aChar <= 'Z')
-        {
-        return ETrue;
-        }
-    if (aChar >= 'a' && aChar <= 'z')
-        {
-        return ETrue;
-        }
-        
-    return EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// TXmlParser::ValidTag(const TDesC& aText)
-// Validates the tag
-// -----------------------------------------------------------------------------
-//
-TBool TXmlParser::ValidTag(const TDesC& aText)
-    {
-    TInt len=aText.Length();
-    for (TInt i=0; i<len; i++)
-        {
-        if (!ValidChar(aText[i]))
-            {
-            return EFalse;
-            }           
-        }
-    return ETrue;
-    }
-    
-// End of file
--- a/connectivitymodules/SeCon/services/csc/src/caputils.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,730 +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:  CapUtil implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <pathinfo.h>
-#include <sysutil.h>
-#include <hal.h>
-#include <hal_data.h>
-#include <etelmm.h>      // for etel
-#include <mmtsy_names.h> // for etel
-#include <utf.h>
-#include <eikenv.h>
-#include <driveinfo.h>
-#include <centralrepository.h>
-#include <sysutildomaincrkeys.h>
-
-#include "caputils.h"
-#include "capability.h"
-#include "debug.h"
-
-const TInt KPackageSize = 65536;
-const TInt KDefaultArrayGranularity = 5;
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CapUtil::GetDefaultRootPathL( RFs& aFs, TDes& aRootPath )
-// Gets default root path
-// -----------------------------------------------------------------------------
-//
-void CapUtil::GetDefaultRootPathL( RFs& aFs, TDes& aRootPath )
-    {
-    TRACE_FUNC_ENTRY;
-    // Use the default mass storage if it is internal drive
-    TInt msDrive;
-    User::LeaveIfError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, msDrive ) );
-    LOGGER_WRITE_1("drive: %d", msDrive);
-    
-    TUint msStatus( 0 );
-    TInt err = DriveInfo::GetDriveStatus( aFs, msDrive, msStatus );
-    LOGGER_WRITE_1("DriveInfo::GetDriveStatus err: %d", err);
-    
-    // if no errors, also check drive status
-    if( !err && !( msStatus & DriveInfo::EDrivePresent )
-        || msStatus & DriveInfo::EDriveCorrupt )
-        {
-        LOGGER_WRITE( "Internal mass storage not present or corrupted" );
-        err = KErrNotFound;
-        }
-    
-    if ( !err && ( msStatus & DriveInfo::EDriveInternal ) )
-        {
-        // Use internal mass storage
-        LOGGER_WRITE( "Use internal mass storage" );
-        User::LeaveIfError( PathInfo::GetRootPath( aRootPath, msDrive ) );
-        }
-    else
-        {
-        // Use phone memory
-        LOGGER_WRITE( "Use phone memory" );
-        StrCopy( aRootPath, PathInfo::PhoneMemoryRootPath() );
-        }
-    LOGGER_WRITE_1( "rootPath: %S", &aRootPath );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::GetMemoryType( RFs& aFs, TDes& aMemoryType, const TInt aDrive )
-// Gets drive memory type
-// -----------------------------------------------------------------------------
-//
-void CapUtil::GetMemoryType( RFs& aFs, TDes& aMemoryType, const TInt aDrive )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aDrive: %d", aDrive);
-    aMemoryType = KNullDesC;
-    TUint driveStatus;
-    TInt err = DriveInfo::GetDriveStatus( aFs, aDrive, driveStatus );
-    if( err )
-        {
-        LOGGER_WRITE_1( "CapUtil::GetMemoryType() : DriveInfo::GetDriveStatus err: %d", err );
-        return;
-        }
-    // search internal or removable drives
-    TBool searchInternalDrives;
-    if( driveStatus & DriveInfo::EDriveInternal )
-        {
-        aMemoryType = KMediaFlash;
-        searchInternalDrives = ETrue;
-        }
-    else
-        {
-        aMemoryType = KMediaMMC;
-        searchInternalDrives = EFalse;
-        }
-    
-    TInt typeNumber(0);
-    TInt driveCount;
-    TDriveList driveList;
-    
-    err = DriveInfo::GetUserVisibleDrives( aFs, driveList, driveCount );
-    if( err )
-        {
-        LOGGER_WRITE_1( "CapUtil::GetMemoryType() : DriveInfo::GetUserVisibleDrives err: %d", err );
-        return;
-        }
-    
-    for( TInt i = EDriveA; i <= aDrive; i++ )
-        {
-        if( driveList[i] )
-            {
-            TUint driveStatus;
-            err = DriveInfo::GetDriveStatus( aFs, i, driveStatus );
-            if( err )
-                {
-                LOGGER_WRITE_1( "CapUtil::GetMemoryType() : DriveInfo::GetDriveStatus err: %d", err );
-                continue;
-                }
-
-            if( !(driveStatus & DriveInfo::EDrivePresent )
-                || driveStatus & DriveInfo::EDriveCorrupt )
-                {
-                LOGGER_WRITE( "not present or corrupted" );
-                continue;
-                }
-            
-            if( driveStatus & DriveInfo::EDriveInternal )
-                {
-                if( searchInternalDrives )
-                    {
-                    typeNumber++;
-                    }
-                }
-            else if( driveStatus & DriveInfo::EDriveRemovable )
-                {
-                if( !searchInternalDrives )
-                    {
-                    typeNumber++;
-                    }
-                }
-            }
-        }
-        
-    if( typeNumber > 1 )
-        {
-        aMemoryType.AppendNum( typeNumber );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::GetOperatornameL(TDes& aLongName, TDes& aCountryCode, TDes& aNetworkID)
-// Gets phone operator name, country code, networkID.
-// -----------------------------------------------------------------------------
-//
-void CapUtil::GetOperatorNameL(TDes& aLongName, TDes& aCountryCode, TDes& aNetworkID)
-    {
-    TRACE_FUNC_ENTRY;
-    TUint32 networkCaps;
-    RTelServer::TPhoneInfo phoneInfo;
-    
-    RTelServer server;
-    RMobilePhone mobilePhone;
-    User::LeaveIfError( server.Connect() );
-    CleanupClosePushL( server );
-    
-    TInt numPhones;
-    User::LeaveIfError( server.EnumeratePhones( numPhones ) );
-    server.GetPhoneInfo( 0, phoneInfo );
-    
-    User::LeaveIfError( mobilePhone.Open( server, phoneInfo.iName ) );
-    CleanupClosePushL( mobilePhone );
-    User::LeaveIfError( mobilePhone.GetNetworkCaps( networkCaps ) );
-    
-    RMobilePhone::TMobilePhoneNetworkInfoV1 mobilePhoneNetworkInfo;
-    RMobilePhone::TMobilePhoneNetworkInfoV1Pckg mobilePhoneNetworkInfoPckg(
-        mobilePhoneNetworkInfo );
-    RMobilePhone::TMobilePhoneLocationAreaV1 mobilePhoneLocationArea;
-    
-    if (networkCaps & RMobilePhone::KCapsGetCurrentNetwork)
-        {
-        TRequestStatus status;
-        mobilePhone.GetCurrentNetwork( 
-            status, mobilePhoneNetworkInfoPckg, mobilePhoneLocationArea );
-        User::WaitForRequest( status );
-        User::LeaveIfError( status.Int() );
-        }
-    
-    CleanupStack::PopAndDestroy( &mobilePhone );
-    CleanupStack::PopAndDestroy( &server );
-    if ( mobilePhoneNetworkInfo.iLongName.Length() > 0 )
-        {
-        StrCopy( aLongName, mobilePhoneNetworkInfo.iLongName );
-        }
-    else if ( mobilePhoneNetworkInfo.iShortName.Length() > 0 )
-        {
-        StrCopy( aLongName, mobilePhoneNetworkInfo.iShortName );
-        }
-    else
-        {
-        StrCopy( aLongName, mobilePhoneNetworkInfo.iDisplayTag );
-        }
-    StrCopy( aCountryCode, mobilePhoneNetworkInfo.iCountryCode );
-    StrCopy( aNetworkID, mobilePhoneNetworkInfo.iNetworkId );
-    
-    TRACE_FUNC_EXIT;
-    }
-// -----------------------------------------------------------------------------
-// CapUtil::GetManufacturer(TDes& aText)
-// Gets phone manufacturer from HAL. In case manufacturer is not known,
-// -----------------------------------------------------------------------------
-//
-void CapUtil::GetManufacturer(TDes& aText)
-    {
-    TRACE_FUNC_ENTRY;
-    TInt num(KErrNotFound);
-    
-    HAL::Get(HALData::EManufacturer, num);
-    
-    switch (num)
-        {
-        case HALData::EManufacturer_Ericsson:
-            aText=KManufacturerEricsson; 
-            break;
-        case HALData::EManufacturer_Motorola:
-            aText=KManufacturerMotorola; 
-            break;
-        case HALData::EManufacturer_Nokia:
-            aText=KManufacturerNokia; 
-            break;
-        case HALData::EManufacturer_Panasonic:
-            aText=KManufacturerPanasonic; 
-            break;
-        case HALData::EManufacturer_Psion:
-            aText=KManufacturerPsion; 
-            break;
-        case HALData::EManufacturer_Intel:
-            aText=KManufacturerIntel; 
-            break;
-        case HALData::EManufacturer_Cogent:
-            aText=KManufacturerCogent; 
-            break;
-        case HALData::EManufacturer_Cirrus:
-            aText=KManufacturerCirrus; 
-            break;
-        case HALData::EManufacturer_Linkup:
-            aText=KManufacturerLinkup; 
-            break;
-        case HALData::EManufacturer_TexasInstruments:
-            aText=KManufacturerTexasInstruments; 
-            break;
-        default: 
-            aText=KNullDesC; 
-            break;
-        }
-
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::GetLanguage(TDes& aText)
-// Gets language
-// -----------------------------------------------------------------------------
-//
-void CapUtil::GetLanguage(TDes& aText)
-    {
-    TRACE_FUNC_ENTRY;
-    TLanguage lang=User::Language();
-    GetLanguageString(lang, aText);
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::GetSWVersionL(TDes& aVersion, TDes& aDate, TDes& aModel)
-// Gets SW version, SW version date  and device model from SysUtil. 
-// -----------------------------------------------------------------------------
-//
-void CapUtil::GetSWVersionL(TDes& aVersion, TDes& aDate, TDes& aModel)
-    {
-    TRACE_FUNC_ENTRY;
-    TBuf<KBufSize> buf;
-    aVersion=KNullDesC;
-    aDate=KNullDesC;
-    aModel=KNullDesC;
-
-    User::LeaveIfError( SysUtil::GetSWVersion( buf ) );
-    RArray<TPtrC> arr(KDefaultArrayGranularity);
-    CleanupClosePushL( arr );
-
-    CapUtil::SplitL(buf, '\n', arr);
-    const TInt KFieldsToFind = 3;
-    if ( arr.Count() < KFieldsToFind )
-        {
-        User::Leave( KErrNotFound );
-        }
-    
-    StrCopy( aVersion, arr[0] );
-    aVersion.Trim();
-
-    StrCopy(aModel,arr[2]);
-    aModel.Trim();
-
-    TBuf<KTagSize> date;
-    StrCopy(date, arr[1]);
-    TTime t;
-    t.UniversalTime(); // this is to avoid warnings
-    TRAPD( err, t = ParseDateL( date ) );
-    if ( err == KErrNone )
-        {
-        CapabilityDate( aDate, t );
-        }
-    
-    CleanupStack::PopAndDestroy( &arr );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::InitMemoryInfo(TMemoryInfo& aInfo)
-// Initializes TMemoryInfo.
-// -----------------------------------------------------------------------------
-//
-void CapUtil::InitMemoryInfo(TMemoryInfo& aInfo)
-    {
-    aInfo.iDriveNum        = KErrNotFound;
-    aInfo.iDriveLetter     = KNoChar;
-    aInfo.iLocation        = KNullDesC;
-    aInfo.iFree            = KErrNotFound;
-    aInfo.iUsed            = KErrNotFound;
-    aInfo.iShared          = EFalse;
-    aInfo.iFileSize        = KErrNotFound;
-    aInfo.iFolderSize      = KErrNotFound;
-    aInfo.iFileNameSize    = KMaxFileName;    // TFileName 256
-    aInfo.iFolderNameSize  = KMaxFileName;    // TFileName 256
-    aInfo.iCaseSensitivity = EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::GetMemoryInfoL( const RFs& aFs, TInt aDriveNumber, TMemoryInfo& aInfo )
-// Get memory information for one drive.
-// -----------------------------------------------------------------------------
-//
-void CapUtil::GetMemoryInfoL( const RFs& aFs, const TInt aDriveNumber, TMemoryInfo& aInfo )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("  aDriveNumber: %d", aDriveNumber);
-    
-    TVolumeInfo volumeInfo;
-    TDriveInfo driveInfo;
-
-    InitMemoryInfo( aInfo );
-
-    User::LeaveIfError( aFs.Drive(driveInfo, aDriveNumber) ); 
-    if ( driveInfo.iDriveAtt == (TUint)KDriveAbsent ) 
-        {
-        LOGGER_WRITE(" iDriveAtt == (TUint)KDriveAbsent, Leave KErrNotFound");
-        User::Leave( KErrNotFound );
-        }
-                
-    User::LeaveIfError( aFs.Volume(volumeInfo, aDriveNumber) );
-
-    User::LeaveIfError( aFs.DriveToChar(aDriveNumber, aInfo.iDriveLetter) );
-    aInfo.iDriveNum = aDriveNumber;
-    aInfo.iLocation.Append( aInfo.iDriveLetter );
-    aInfo.iLocation.Append( KDriveDelimiter );
-    aInfo.iLocation.Append( KPathDelimiter );
-    aInfo.iFree = volumeInfo.iFree;
-    aInfo.iUsed = volumeInfo.iSize - volumeInfo.iFree;
-    
-    // set free memory up to critical level for all drives
-    CRepository* repository = CRepository::NewLC( KCRUidDiskLevel );
-    TInt criticalLevel(0);
-    User::LeaveIfError( repository->Get( KDiskCriticalThreshold, criticalLevel ) );
-    CleanupStack::PopAndDestroy( repository );
-    criticalLevel += KPackageSize; // add obex package size to critical level
-    LOGGER_WRITE_1( "CapUtil::GetMemoryInfoL() criticalLevel: %d", criticalLevel ) ;
-    if ( aInfo.iFree > criticalLevel )
-        {
-        aInfo.iFree = aInfo.iFree - criticalLevel;
-        }       
-    else
-        {
-        aInfo.iFree = 0;
-        }
-    
-    aInfo.iFileSize = aInfo.iFree;
-    aInfo.iFolderSize = aInfo.iFree;
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::GetFileListL( RFs& aFs, const TDesC& aDir, 
-// RArray<TFileName>& aList)
-// Finds all files in aDir.
-// -----------------------------------------------------------------------------
-//
-void CapUtil::GetFileListL( const RFs& aFs, const TDesC& aDir, 
-                            RArray<TFileName>& aList)
-    {
-    TRACE_FUNC_ENTRY;
-    
-    aList.Reset();
-    
-    CDir* dir( NULL );
-    User::LeaveIfError( aFs.GetDir( aDir, KEntryAttMatchMask, ESortByName, dir ) );
-    CleanupStack::PushL( dir );
-    
-    for ( TInt i=0; i < dir->Count(); ++i )
-        {
-        TEntry entry = (*dir)[i];
-        if ( !entry.IsDir() )
-            {
-            User::LeaveIfError( aList.Append( entry.iName ) );
-            }
-        }
-    CleanupStack::PopAndDestroy( dir );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::CheckFileType(const TDesC& aFile, const TDesC& aExt)
-// Function checks file extension.
-// -----------------------------------------------------------------------------
-//
-TBool CapUtil::CheckFileType(const TDesC& aFile, const TDesC& aExt)
-    {
-    TRACE_FUNC_ENTRY;
-    TParse parse;
-    parse.Set(aFile, NULL, NULL);
-    TPtrC ptr=parse.Ext();
-
-    TBuf<KTagSize> buf1;
-    TBuf<KTagSize> buf2;
-    
-    buf1=ptr;
-    buf2=aExt;
-    
-    buf1.LowerCase();
-    buf2.LowerCase();
-
-    if (buf1.Compare(buf2)==0)
-        {
-        LOGGER_WRITE( "CapUtil::CheckFileType(const TDesC& aFile, const TDesC& aExt) : returned ETrue" );
-        return ETrue;
-        }
-        
-    else
-        {
-        LOGGER_WRITE( "CapUtil::CheckFileType(const TDesC& aFile, const TDesC& aExt) : returned EFalse" );
-        return EFalse;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::GetLanguageString(TLanguage aId, TDes& aText)
-// Get language string for aId.
-// -----------------------------------------------------------------------------
-//
-void CapUtil::GetLanguageString(TLanguage aId, TDes& aText)
-    {
-    TRACE_FUNC_ENTRY;
-    aText=KNullDesC;
-    
-    TInt count=NUMLANGSTRINGS;
-    for (TInt i=0; i<count; i++)
-        {
-        TLangStringStruct t=KLangStrings[i];
-        if (t.id == (TInt)aId)
-            {
-            aText=t.lang;
-            return;
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::Panic(TInt aReason)
-// Panic.
-// -----------------------------------------------------------------------------
-//
-#ifdef _DEBUG
-void CapUtil::Panic(TInt aReason)
-#else
-void CapUtil::Panic(TInt /*aReason*/)
-#endif
-    {
-    TRACE_FUNC_ENTRY;
-#ifdef _DEBUG
-    _LIT(KPanicCategory,"CapabilitySC");
-
-    User::Panic(KPanicCategory, aReason);
-#endif
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::StrCopy(TDes& aTarget, const TDesC& aSource)
-// String copy with lenght check.
-// -----------------------------------------------------------------------------
-//
-void CapUtil::StrCopy(TDes& aTarget, const TDesC& aSource)
-    {
-    TInt len=aTarget.MaxLength();
-    if(len<aSource.Length()) 
-        {
-        aTarget.Copy(aSource.Left(len));
-        return;
-        }
-    aTarget.Copy(aSource);
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::IntToStr(TDes& aText, TInt64 aNum)
-// Function converts ínteger to string.
-// -----------------------------------------------------------------------------
-//
-void CapUtil::IntToStr(TDes& aText, TInt64 aNum)
-    {
-    aText.Num(aNum);
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::StrToInt(const TDesC& aText, TInt& aNum)
-// Function converts string to integer. If string cannot be converted,
-// error code is returned.
-// -----------------------------------------------------------------------------
-//
-TInt CapUtil::StrToInt(const TDesC& aText, TInt& aNum)
-    {
-    TLex lex(aText);
-
-    TInt err=lex.Val(aNum); 
-    return err;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::SplitL(const TDesC& aText, const TChar aSeparator, 
-// RArray<TPtrC>& aArray)
-// Function splits string (eg "name1, name2, name3") into substrings.
-// -----------------------------------------------------------------------------
-//
-void CapUtil::SplitL(const TDesC& aText, const TChar aSeparator, 
-                    RArray<TPtrC>& aArray)
-    {
-    TRACE_FUNC_ENTRY;
-    TPtrC ptr;
-    ptr.Set(aText);
-
-    for (;;)
-        {
-        TInt pos=ptr.Locate(aSeparator);
-        if (pos==KErrNotFound)
-            {
-            aArray.AppendL(ptr);
-            break;
-            }
-
-        TPtrC subStr=ptr.Left(pos); // get pos characters starting from position 0
-        aArray.AppendL(subStr);
-
-        if (!(ptr.Length()>pos+1))
-            {
-            break;
-            }
-            
-        ptr.Set(ptr.Mid(pos+1));// get all characters starting from position pos+1
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::ParseDateL(const TDesC& aText)
-// Function parses date string of the format "dd-mm-yy".
-// -----------------------------------------------------------------------------
-//
-TTime CapUtil::ParseDateL(const TDesC& aText)
-    {
-    TRACE_FUNC_ENTRY;
-    RArray<TPtrC> arr(KDefaultArrayGranularity);
-    CleanupClosePushL( arr );
-
-    CapUtil::SplitL( aText, '-', arr );
-    if ( arr.Count() != 3 )
-        {
-        User::Leave( KErrNotSupported );
-        }
-           
-    TInt day; 
-    TInt month; 
-    TInt year;
-    
-    User::LeaveIfError( StrToInt(arr[0], day) );
-    User::LeaveIfError( StrToInt(arr[1], month) );
-    User::LeaveIfError( StrToInt(arr[2], year) );
-
-    TDateTime td;
-    TMonth month2 = Month( month );
-    // if year is defined as two digit, add currect millenium for it
-    const TInt KDefaultMillenium = 2000;
-    if ( year < KDefaultMillenium )
-        {
-        year = year + KDefaultMillenium;
-        }
-        
-
-    User::LeaveIfError( td.Set(year, month2, day-1, 0, 0, 0, 0) );
-
-    CleanupStack::PopAndDestroy( &arr );
-    
-    TTime t(td);
-    TRACE_FUNC_EXIT;
-    return t;
-}
-
-// -----------------------------------------------------------------------------
-// CapUtil::Month(TInt aNum)
-// Function return TMonth presentation of integer
-// -----------------------------------------------------------------------------
-//
-TMonth CapUtil::Month(TInt aNum)
-    {
-    TRACE_FUNC_ENTRY;
-    __ASSERT_DEBUG(aNum>=1 && aNum<=12, Panic(KErrArgument));
-
-    switch (aNum)
-        {
-        case 1: return EJanuary;
-        case 2: return EFebruary;
-        case 3: return EMarch;
-        case 4: return EApril;
-        case 5: return EMay;
-        case 6: return EJune;
-        case 7: return EJuly;
-        case 8: return EAugust;
-        case 9: return ESeptember;
-        case 10: return EOctober;
-        case 11: return ENovember;
-        case 12: return EDecember;
-        default: return EJanuary;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CapUtil::CapabilityDate(TDes& aText, const TTime aTime)
-// Constructs capability date as string
-// -----------------------------------------------------------------------------
-//
-void CapUtil::CapabilityDate(TDes& aText, const TTime aTime)
-    {
-    TRACE_FUNC_ENTRY;
-    _LIT(KFormat,"%04d%02d%02dT%02d%02d%02dZ");
-
-    TDateTime dt=aTime.DateTime();
-    aText.Format(KFormat, dt.Year(), dt.Month()+1, dt.Day()+1, dt.Hour(),
-     dt.Minute(), dt.Second());
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// TIdStack::Pop()
-// Pop id from the stack
-// -----------------------------------------------------------------------------
-//
-TInt TIdStack::Pop()
-    {
-    if (iPos<0)
-        {
-        LOGGER_WRITE( "TIdStack::Pop() returned KErrNotFound" );
-        return KErrNotFound;
-        }
-        
-    TInt id=iArray[iPos];
-    iPos--;
-    return id;
-    }
-
-// -----------------------------------------------------------------------------
-// TIdStack::Push( TInt aId )
-// Push id to the stack
-// -----------------------------------------------------------------------------
-//
-void TIdStack::Push( TInt aId )
-    {
-    if ( Size() >= KNestingLimit )
-        {
-        return;
-        }
-        
-    iPos++;
-    iArray[iPos] = aId;
-    }
-
-// -----------------------------------------------------------------------------
-// TIdStack::Size() const
-// Size of the stack
-// -----------------------------------------------------------------------------
-//
-TInt TIdStack::Size() const
-    {
-    return iPos+1;
-    }
-
-// -----------------------------------------------------------------------------
-// TIdStack::Reset()
-// Reset the stack.
-// -----------------------------------------------------------------------------
-//
-void TIdStack::Reset()
-    {
-    iArray.Reset();
-    iPos=-1;
-    }
-
-// End of file
--- a/connectivitymodules/SeCon/services/csc/src/sconcsc.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-/*
-* 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:  CSConCSC implementation
-*
-*/
-
-
-//
-// This program creates a polymorphic interface DLL that is used
-// to create capability object
-//
-
-// INCLUDE FILES
-
-#include <e32def.h>
-#include <e32uid.h>
-
-#include "sconcsc.h"
-#include "capinfo.h"
-#include "debug.h"
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-
-// -----------------------------------------------------------------------------
-// CreateCSConCSCL()
-// Function to construct CSConCSC object. Note that this function
-// is exported at ordinal 1 and is not a member of any class.
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CSConCSC* CreateCSConCSCL()
-    {
-    TRACE_FUNC;
-    return CSConCSC::NewL();
-    }
-
-
-// -----------------------------------------------------------------------------
-// CSConCSC::NewL()
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CSConCSC* CSConCSC::NewL()
-    {
-    TRACE_FUNC_ENTRY;
-    CSConCSC* self = new (ELeave) CSConCSC();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConCSC::~CSConCSC()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConCSC::~CSConCSC()
-    {
-    TRACE_FUNC_ENTRY;
-    delete iCapInfo;
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConCSC::CapabilityObject(CBufFlat& aBuf)
-// Creates a capability object data and sets data into aBuf.
-// -----------------------------------------------------------------------------
-//
-TInt CSConCSC::CapabilityObject(CBufFlat& aBuf)
-    {
-    TRACE_FUNC_ENTRY;
-    TRAPD(err, CSConCSC::CapabilityObjectL(aBuf));
-    LOGGER_WRITE_1( "CSConCSC::CapabilityObject(CBufFlat& aBuf) : returned %d", err );
-    return err;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConCSC::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CSConCSC::ConstructL()
-    {
-    iCapInfo = CCapInfo::NewL();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConCSC::CSConCSC()
-// Default constructor
-// -----------------------------------------------------------------------------
-//
-CSConCSC::CSConCSC()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConCSC::CapabilityObjectL(CBufFlat& aBuf)
-// Creates a capability object data and sets data into aBuf.
-// -----------------------------------------------------------------------------
-//
-void CSConCSC::CapabilityObjectL(CBufFlat& aBuf)
-    {
-    TRACE_FUNC_ENTRY;
-    iCapInfo->CapabilityDocumentL( &aBuf );
-    TRACE_FUNC_EXIT;
-    }
-
-// End of file
-
--- a/connectivitymodules/SeCon/services/csc/src/sconsyncservice.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,505 +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:  CSConSyncService implementation.
-*
-*/
-
-
-// Includes
-#include <centralrepository.h>
-#include <seconsdkcrkeys.h>
-
-#include <swi/sisregistryentry.h>   // for searching app name from installer
-#include <swi/sisregistrypackage.h>
-#include <swi/sisregistrysession.h>
-#include <javaregistryincludes.h>
-using namespace Java;
-
-#include "sconsyncservice.h"
-#include "capability.h"
-#include "debug.h"
-
-// Constants
-const TInt KDsAppUi = 0x101F6DE4; // NSmlDSSync.exe
-const TSmlDataProviderId KCalendarId = 0x101f6dde;
-const TSmlDataProviderId KContactsId = 0x101f6ddd;
-const TSmlDataProviderId KSmsId = 0x10206b5c;
-const TSmlDataProviderId KBookmarkId = 0x102751ba;
-
-const TInt KDateFormatLength(16);
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::NewLC()
-// -----------------------------------------------------------------------------
-//
-CSConSyncService* CSConSyncService::NewLC()
-	{
-	TRACE_FUNC_ENTRY;
-	CSConSyncService* self = new (ELeave) CSConSyncService();
-	CleanupStack::PushL( self );
-	self->ConstructL();
-	TRACE_FUNC_EXIT;
-	return self;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::CSConSyncService()
-// -----------------------------------------------------------------------------
-//
-CSConSyncService::CSConSyncService()
-	{
-	}
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::~CSConSyncService()
-// -----------------------------------------------------------------------------
-//
-CSConSyncService::~CSConSyncService()
-	{
-	TRACE_FUNC_ENTRY;
-	if ( iApaSessionConnected )
-		{
-		iApaSession.Close();
-		}
-	if ( iSyncSessionOpened )
-		{
-		iSyncSession.Close();
-		}
-	delete iRepository;
-	TRACE_FUNC_EXIT;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::ConstructL()
-// -----------------------------------------------------------------------------
-//
-void CSConSyncService::ConstructL()
-	{
-	iRepository = CRepository::NewL( KCRUidSecon );
-	}
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::GetSolutionL()
-// Populate SolutionInfo according to content type.
-// -----------------------------------------------------------------------------
-//
-void CSConSyncService::GetSolutionL( const TUint aSeconContentType,
-		TSConSolutionInfo& aSolutionInfo )
-	{
-	TRACE_FUNC_ENTRY;
-	TInt appUid;
-	User::LeaveIfError( iRepository->Get( aSeconContentType, appUid ));
-    LOGGER_WRITE_2( "repository readed ok, uid: %d, hex:%x", appUid, appUid );
-    
-    aSolutionInfo.iUid = appUid;
-    if ( aSolutionInfo.iUid == KDsAppUi )
-        {
-        // read profile name
-        LOGGER_WRITE( "Search correct profile" );
-        GetLastUsedProfileNameL( aSolutionInfo.iSolutionName,
-        	aSolutionInfo.iTime, ProviderId( aSeconContentType ) );
-        }
-    else if ( aSolutionInfo.iUid != 0 )
-        {
-        LOGGER_WRITE( "Search correct application name" );
-        TUid appUid = {aSolutionInfo.iUid};
-        GetApplicationCaptionL( aSolutionInfo.iSolutionName, appUid );
-        
-        // get solution timestamp
-        TBuf<KDateFormatLength> timeBuffer;
-        // Timestamp is stored always in next to Uid value on cenrep
-        TInt err = iRepository->Get( aSeconContentType+1, timeBuffer );
-        
-        LOGGER_WRITE_1( "iRepository->Get(time) err: %d", err );
-        if ( err == KErrNone )
-        	{
-	        err = ParseTimestamp( aSolutionInfo.iTime, timeBuffer );
-	        LOGGER_WRITE_1( "ParseTimestamp err: %d", err );
-        	}
-        }
-    TRACE_FUNC_EXIT;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::ProviderId()
-// Return correct providerId according to content type.
-// -----------------------------------------------------------------------------
-//
-TSmlDataProviderId CSConSyncService::ProviderId( const TUint32 aSeconContentType ) const
-	{
-	TSmlDataProviderId providerId(KErrNotFound);
-	switch (aSeconContentType)
-		{
-		case KSeconCalendarUid:
-		providerId = KCalendarId;
-		break;
-		case KSeconContactsUid:
-		providerId = KContactsId;
-		break;
-		case KSeconSmsUid:
-		providerId = KSmsId;
-		break;
-		case KSeconBookmarkUid:
-		providerId = KBookmarkId;
-		break;
-		default:
-		LOGGER_WRITE_1( "Invalid content type: %d", aSeconContentType );
-		}
-	return providerId;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::ParseTimestamp()
-// Parses timestamp to TTime format
-// -----------------------------------------------------------------------------
-//
-TInt CSConSyncService::ParseTimestamp( TTime& aTime, const TDesC& aTimestamp ) const
-	{
-	// timestamp must be in following format:
-	// YYYYMMDDTHHMMSSZ
-	// MM=1..12, DD=1..number of days in month, HH=0..23, MM;SS=0..59
-	// Example 20071224T162215Z = 24.12.2007, 16:22:15 UTC time
-	
-	if ( aTimestamp.Length() != KDateFormatLength )
-		{
-		LOGGER_WRITE_1( "aTimestamp.Length(): %d", aTimestamp.Length() );
-		return KErrArgument;
-		}
-	
-	TPtrC temp;
-	temp.Set(aTimestamp.Ptr());
-	
-	TLex lex(temp.Mid(0,4));
-	TInt year;
-	TInt month;
-	TInt day;
-	TInt hour;
-	TInt minute;
-	TInt second;
-	TInt err = lex.Val( year );
-	if (err != KErrNone) return err;
-	
-	lex = temp.Mid(4,2);
-	err = lex.Val( month );
-	if ( err != KErrNone) return err;
-	month--;
-	
-	lex = temp.Mid(6,2);
-	err = lex.Val( day );
-	if (err != KErrNone) return err;
-	day--;
-	
-	lex = temp.Mid(9,2);
-	err = lex.Val( hour );
-	if (err != KErrNone) return err;
-	
-	lex = temp.Mid(11,2);
-	err = lex.Val( minute );
-	if (err != KErrNone) return err;
-	
-	lex = temp.Mid(13,2);
-	err = lex.Val( second );
-	if (err != KErrNone) return err;
-	
-	TDateTime parsedTime;
-	err = parsedTime.Set(year, (TMonth)month, day, hour, minute, second, 0);
-	if (err != KErrNone) return err;
-	
-	aTime = parsedTime;
-	return err;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::GetApplicationCaptionL()
-// Get application caption.
-// -----------------------------------------------------------------------------
-//
-void CSConSyncService::GetApplicationCaptionL( TDes& aCaption, const TUid aAppUid )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TInt err(KErrNotReady);
-    // connect to RApaLsSession, if not yet ready
-    if ( !iApaSessionConnected )
-    	{
-    	err = iApaSession.Connect();
-    	if ( err == KErrNone )
-    		{
-    		iApaSessionConnected = ETrue;
-    		}
-    	}
-    
-    // Get application caption using RApaLsSession::GetAppInfo
-	TApaAppInfo appInfo;
-	if ( iApaSessionConnected )
-		{
-		err = iApaSession.GetAppInfo( appInfo ,aAppUid );
-		}
-    
-    LOGGER_WRITE_1( "GetAppInfo err: %d", err );
-    if ( err == KErrNone )
-    	{
-    	aCaption = appInfo.iCaption;
-    	}
-    else
-        {
-        // Caption does not exist, search application name from installer
-        GetInstPackageCaptionL( aCaption, aAppUid );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::GetInstPackageCaptionL()
-// Search UID from installed applications, return app caption
-// -----------------------------------------------------------------------------
-//
-void CSConSyncService::GetInstPackageCaptionL( TDes& aCaption, const TUid aPackageUid )
-	{
-	TRACE_FUNC_ENTRY;
-    LOGGER_WRITE("Name not found, search from installer");
-    // Search application name from Installer.
-    Swi::RSisRegistrySession sisRegistry;
-    User::LeaveIfError( sisRegistry.Connect() );
-    CleanupClosePushL( sisRegistry );
-    
-    //Check if uid belongs to SIS package
-    if( sisRegistry.IsInstalledL( aPackageUid ) )
-        {
-        LOGGER_WRITE("SIS package found");
-        Swi::RSisRegistryEntry entry;
-        CleanupClosePushL(entry);
-        User::LeaveIfError( entry.Open( sisRegistry, aPackageUid ) );
-        aCaption.Copy( *entry.PackageNameL() );
-        CleanupStack::PopAndDestroy( &entry );
-        }
-    else
-        {
-        // not sis app, might be java app.
-        LOGGER_WRITE("SIS package not found");
-        CJavaRegistry* javaRegistry = CJavaRegistry::NewLC( );
-        TBool entryExist = javaRegistry->RegistryEntryExistsL( aPackageUid );
-        if ( entryExist )
-            {
-            CJavaRegistryEntry* entry = javaRegistry->RegistryEntryL( aPackageUid );
-            if ( entry )
-                {
-                aCaption.Copy( entry->Name() );
-                delete entry;
-                }
-            }
-        
-        CleanupStack::PopAndDestroy( javaRegistry ); 
-        }
-    
-    CleanupStack::PopAndDestroy( &sisRegistry );
-    TRACE_FUNC_EXIT;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::GetLastUsedProfileNameL()
-// Gets last used profile for selected provider
-// -----------------------------------------------------------------------------
-//
-void CSConSyncService::GetLastUsedProfileNameL( TDes& aProfileName, TTime& aTime,
-		const TSmlDataProviderId& aDataProviderId )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !iSyncSessionOpened )
-		{
-		iSyncSession.OpenL();
-		iSyncSessionOpened = ETrue;
-		}
-    RArray<TSmlProfileId> profiles;
-    CleanupClosePushL( profiles );
-    iSyncSession.ListProfilesL(profiles, ESmlDataSync );
-    TSmlProfileId lastSyncProfile(KErrNotFound);
-    TTime lastSyncTime(0);
-    LOGGER_WRITE_1( "Profiles count: %d", profiles.Count() );
-    for (TInt i=0; i<profiles.Count(); i++)
-    	{
-    	TTime syncTime(0);
-    	GetLastSyncTimeL( syncTime, profiles[i], aDataProviderId );
-    	if ( syncTime.Int64() != 0 && syncTime > lastSyncTime )
-    		{
-    		LOGGER_WRITE_1( "New record, profile: %d",profiles[i]);
-    		lastSyncTime = syncTime;
-    		lastSyncProfile = profiles[i];
-    		}
-    	}
-    CleanupStack::PopAndDestroy( &profiles );
-    LOGGER_WRITE_1( "lastSyncProfile: %d", lastSyncProfile );
-    if ( lastSyncProfile != KErrNotFound )
-    	{
-    	aTime = lastSyncTime;
-    	RSyncMLDataSyncProfile syncProfile;
-    	syncProfile.OpenL( iSyncSession, lastSyncProfile, ESmlOpenRead );
-    	TPtrC displayName = syncProfile.DisplayName();
-    	aProfileName.Copy( displayName );
-    	syncProfile.Close();
-    	}
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::GetLastSyncTimeL()
-// Gets last sync time for certain profile and provider.
-// -----------------------------------------------------------------------------
-//
-void CSConSyncService::GetLastSyncTimeL( TTime& aTime, const TSmlProfileId aSyncProfileId,
-		const TSmlDataProviderId aDataProviderId  )
-	{
-	TRACE_FUNC_ENTRY;
-	LOGGER_WRITE_1( "aSyncProfileId: %d", aSyncProfileId );
-	LOGGER_WRITE_1( "aDataProviderId: 0x%08x", aDataProviderId );
-	if ( !iSyncSessionOpened )
-		{
-		LOGGER_WRITE("iSyncSession is not opened, Leave!");
-		User::Leave( KErrNotReady );
-		}
-	
-	RSyncMLDataSyncProfile syncProfile;
-	syncProfile.OpenL( iSyncSession, aSyncProfileId, ESmlOpenRead );
-    CleanupClosePushL( syncProfile );
-    LOGGER_WRITE( "syncProfile opened OK" );
-    
-    TSmlTaskId providerTask;
-    GetProviderTaskL( providerTask, syncProfile, aDataProviderId  );
-    if ( providerTask != KErrNone )
-    	{
-        RSyncMLHistoryLog historyLog;
-        historyLog.OpenL( iSyncSession, aSyncProfileId );
-        CleanupClosePushL( historyLog );
-        historyLog.SortEntries(CSyncMLHistoryEntry::ESortByTime);
-        LOGGER_WRITE_1( "historyLog.Count: %d", historyLog.Count() );
-        const CSyncMLHistoryJob* historyJob = LatestHistoryJob( historyLog, providerTask );
-        if ( historyJob )
-            {
-            aTime = historyJob->TimeStamp();
-#ifdef _DEBUG
-            TDateTime timeStamp = historyJob->TimeStamp().DateTime();
-            _LIT(KDateFormat, " (%04d%02d%02dT%02d%02d%02d)");
-            const TInt KDateFormatLength(20);
-            TBuf<KDateFormatLength> tempdate;
-            tempdate.Format(KDateFormat, timeStamp.Year(), timeStamp.Month()+1, timeStamp.Day()+1,
-                    timeStamp.Hour(), timeStamp.Minute(), timeStamp.Second());
-            LOGGER_WRITE_1("history found, TimeStamp: %S", &tempdate);
-#endif
-            }
-    	
-        CleanupStack::PopAndDestroy( &historyLog );
-    	}
-    CleanupStack::PopAndDestroy( &syncProfile );
-    TRACE_FUNC_EXIT;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::GetProviderTaskL()
-// Gets provider task id from profile
-// -----------------------------------------------------------------------------
-//
-void CSConSyncService::GetProviderTaskL( TSmlTaskId& aProviderTask,
-		RSyncMLDataSyncProfile& aSyncProfile,
-		const TSmlDataProviderId aDataProviderId  ) const
-	{
-	TRACE_FUNC_ENTRY;
-	aProviderTask = KErrNotFound;
-	
-	RArray<TSmlTaskId> tasks;
-	CleanupClosePushL( tasks );
-	
-	aSyncProfile.ListTasksL( tasks );
-	LOGGER_WRITE_1( "tasks.Count: %d", tasks.Count() );
-	
-	for ( TInt i=0; i<tasks.Count() && aProviderTask==KErrNotFound; i++ )
-		{
-		RSyncMLTask syncTask;
-	    syncTask.OpenL( aSyncProfile, tasks[i] );
-	    if ( syncTask.DataProvider() == aDataProviderId )
-	        {
-	        LOGGER_WRITE_1( "dataprovider task found, taskId: %d", tasks[i] );
-	        aProviderTask = tasks[i];
-	        }
-	    syncTask.Close();
-		}
-	
-	CleanupStack::PopAndDestroy( &tasks );
-	TRACE_FUNC_EXIT;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConSyncService::LatestHistoryJob()
-// Gets latest historyJob where task is correct.
-// -----------------------------------------------------------------------------
-//
- const CSyncMLHistoryJob* CSConSyncService::LatestHistoryJob(
-		 RSyncMLHistoryLog& aHistoryLog, TInt aTaskId ) const
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TInt count = aHistoryLog.Count();
-    if ( count == 0 )
-        {
-        LOGGER_WRITE( "profile has no history job" );
-        TRACE_FUNC_EXIT;
-        return NULL;  // profile has no history job
-        }
-
-    aHistoryLog.SortEntries(CSyncMLHistoryEntry::ESortByTime);    
-
-    // try to find latest sync job (start from last array entry)
-
-    for ( TInt i=count-1; i>=0; i-- )
-        {
-        const CSyncMLHistoryEntry& entry = aHistoryLog[i];
-        const CSyncMLHistoryJob* jobEntry = CSyncMLHistoryJob::DynamicCast(&entry);
-        if ( jobEntry )
-            {
-            if ( TaskExist(jobEntry, aTaskId) )
-                {
-                LOGGER_WRITE( "history job found" );
-                TRACE_FUNC_EXIT;
-                return jobEntry;
-                }
-            }
-        }
-    LOGGER_WRITE( "history job not found" );
-    TRACE_FUNC_EXIT;
-    return NULL;
-    }
-
- // -----------------------------------------------------------------------------
- // CSConSyncService::TaskExist()
- // Returns ETrue if task exists in HistoryJob.
- // -----------------------------------------------------------------------------
- //
-TBool CSConSyncService::TaskExist( const CSyncMLHistoryJob* aHistoryJob, TInt aTaskId ) const
-    {
-    TRACE_FUNC_ENTRY;
-    TInt taskCount = aHistoryJob->TaskCount();
-    for ( TInt i=0; i<taskCount; i++ )
-        {
-        const CSyncMLHistoryJob::TTaskInfo& taskInfo = aHistoryJob->TaskAt(i);
-
-        if ( taskInfo.iTaskId == aTaskId )
-            {
-            LOGGER_WRITE( "task exists." );
-            TRACE_FUNC_EXIT;
-            return ETrue;
-            }
-        }
-    TRACE_FUNC_EXIT;
-    return EFalse;
-    }
-
--- a/connectivitymodules/SeCon/services/csc/src/sconversioninfo.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,270 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  CSconVersionInfo implementation.
-*
-*/
-
-
-#include "sconversioninfo.h"
-
-#include <centralrepository.h>
-#include <DSCapabilityManagementCRKeys.h>
-#include <etel3rdparty.h> // read imsi
-#include <etel.h>
-#include <etelmm.h>
-#include <hal.h>
-
-#include "caputils.h"
-#include "debug.h"
-
-CSconVersionInfo::CSconVersionInfo()
-    {
-    iSymbianVersionError = KErrNotReady;
-    iS60VersionError = KErrNotReady;
-    }
-
-CSconVersionInfo::~CSconVersionInfo()
-    {
-    delete iManufacturer;
-    delete iModel;
-    delete iProduct;
-    delete iRevision;
-    delete iSWVersion;
-    delete iSerialNumber;
-    delete iSysVersionInfo;
-    delete iLangVersion;
-    delete iLangSWVersion;
-    delete iOPVersion;
-    delete iProductCode;
-    }
-
-CSconVersionInfo* CSconVersionInfo::NewL()
-    {
-    CSconVersionInfo* self = new (ELeave) CSconVersionInfo;
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSconVersionInfo::FetchInfoL()
-// fetch device info
-// -----------------------------------------------------------------------------
-//
-void CSconVersionInfo::FetchInfoL( RFs& aFs )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iSymbianVersionError = SysVersionInfo::GetVersionInfo( iSymbianVersion, aFs );
-    iS60VersionError = VersionInfo::GetVersion( iS60Version, aFs );
-    
-    TBuf<KSysVersionInfoTextLength> info;
-    TBuf<KSysVersionInfoTextLength> productBuf;
-    TInt err(KErrNone);
-    delete iSWVersion;
-    iSWVersion = NULL;
-    delete iProduct;
-    iProduct = NULL;
-    // get SW version, SW version date and model
-    TRAP( err, CapUtil::GetSWVersionL( info, iDate, productBuf ) );
-    iSWVersion = info.AllocL();
-    iProduct = productBuf.AllocL();
-    LOGGER_WRITE_1("CapUtil::GetSWVersionL err: %d", err);
-    
-    
-    SysVersionInfo::TProductVersion productVersion;
-    TInt sysVersionError = SysVersionInfo::GetVersionInfo( productVersion, aFs );
-    LOGGER_WRITE_1( "SysVersionInfo::GetVersionInfo returned : %d", sysVersionError );
-    
-    // Use TelServer to get IMEI and also other info if SysVersionInfo is not supported
-    RTelServer telServer;
-    User::LeaveIfError( telServer.Connect() );
-    CleanupClosePushL( telServer );
-    RTelServer::TPhoneInfo teleinfo;
-    User::LeaveIfError( telServer.GetPhoneInfo( 0, teleinfo ) );
-    RMobilePhone phone;
-    User::LeaveIfError( phone.Open( telServer, teleinfo.iName ) );
-    CleanupClosePushL( phone );
-    User::LeaveIfError(phone.Initialise()); 
-    TUint32 teleidentityCaps;
-    phone.GetIdentityCaps( teleidentityCaps );
-    RMobilePhone::TMobilePhoneIdentityV1 telid;
-    TRequestStatus status;
-    phone.GetPhoneId( status, telid );
-    User::WaitForRequest( status );
-    if ( status == KErrNone )
-        {
-        if ( sysVersionError )
-            {
-            LOGGER_WRITE("Use info from TMobilePhoneIdentityV1");
-            delete iModel;
-            iModel = NULL;
-            delete iRevision;
-            iRevision = NULL;
-            
-            // phone model sales name. For example "N01".
-            iModel = telid.iModel.AllocL();
-            // product revision. For example "01"
-            iRevision = telid.iRevision.AllocL();
-            }
-        delete iSerialNumber;
-        iSerialNumber = NULL;
-        // Phone serial number (IMEI or ESN), in character string format.
-        iSerialNumber = telid.iSerialNumber.AllocL();
-        }
-    
-    CleanupStack::PopAndDestroy( &phone );
-    CleanupStack::PopAndDestroy( &telServer );
-        
-    if ( sysVersionError == KErrNone )
-        {
-        // use information from SysVersionInfo instead of previous APIs.
-        LOGGER_WRITE("Using SysVersionInfo");
-        
-        // phone model sales name. For example "N01".
-        delete iModel;
-        iModel = NULL;
-        iModel = productVersion.iModel.AllocL();
-        // product revision. For example "01"
-        delete iRevision;
-        iRevision = NULL;
-        iRevision = productVersion.iRevision.AllocL();
-        // manufacturer name. For example "Nokia"
-        delete iManufacturer;
-        iManufacturer = NULL;
-        iManufacturer = productVersion.iManufacturer.AllocL();
-        // product code name. For example "RM-1"
-        delete iProduct;
-        iProduct = NULL;
-        iProduct = productVersion.iProduct.AllocL();
-        }
-    else
-        {
-        CapUtil::GetManufacturer( info );
-        delete iManufacturer;
-        iManufacturer = NULL;
-        iManufacturer = info.AllocL();
-        }
-        
-    CapUtil::GetLanguage( iLanguage );
-    
-    
-    err = SysVersionInfo::GetVersionInfo( SysVersionInfo::EFWVersion, info, aFs );
-    delete iSysVersionInfo;
-    iSysVersionInfo = NULL;
-    if ( !err )
-        {
-        iSysVersionInfo = info.AllocL();
-        }
-    
-    err = SysUtil::GetLangVersion( info );
-    delete iLangVersion;
-    iLangVersion = NULL;
-    if ( !err )
-        {
-        iLangVersion = info.AllocL();
-        }
-    
-    sysVersionError = SysUtil::GetLangSWVersion( info );
-    delete iLangSWVersion;
-    iLangSWVersion = NULL;
-    if ( !sysVersionError )
-        {
-        iLangSWVersion = info.AllocL();
-        }
-                
-    sysVersionError = SysVersionInfo::GetVersionInfo( SysVersionInfo::EOPVersion, info, aFs );
-    delete iOPVersion;
-    iOPVersion = NULL;
-    if ( !sysVersionError )
-        {
-        iOPVersion = info.AllocL();
-        }
-    
-    
-    sysVersionError = SysVersionInfo::GetVersionInfo( SysVersionInfo::EProductCode, info, aFs );
-    delete iProductCode;
-    iProductCode = NULL;
-    if ( !sysVersionError )
-        {
-        iProductCode = info.AllocL();
-        }
-    
-    // read DesktopSync key value
-    CRepository* repository(NULL);
-    TRAP( iDesktopSyncError, repository = CRepository::NewL( KCRUidDSDCMOConfig ));
-    if ( !iDesktopSyncError )
-        {
-        iDesktopSyncError = repository->Get( KNsmlDesktopSync, iDesktopSync );
-        LOGGER_WRITE_1("iDesktopSyncError: %d", iDesktopSyncError );
-        LOGGER_WRITE_1("iDesktopSync: %d", iDesktopSync );
-        delete repository;
-        }
-    else
-        {
-        LOGGER_WRITE_1("Could not create CRepository, err: %d", iDesktopSyncError );
-        }
-    
-    // screen size
-    HAL::Get(HAL::EDisplayXPixels, iScreenSize.iWidth);
-    HAL::Get(HAL::EDisplayYPixels, iScreenSize.iHeight);
-    
-    iInfoFetched = ETrue;
-    TRACE_FUNC_EXIT;   
-    }
-
-// -----------------------------------------------------------------------------
-// CSconVersionInfo::IsReady()
-// 
-// -----------------------------------------------------------------------------
-//
-TBool CSconVersionInfo::IsReady()
-    {
-    return iInfoFetched;
-    }
-
-// -----------------------------------------------------------------------------
-// CSconVersionInfo::GetSymbianVersion()
-// Get Symbian OS version
-// -----------------------------------------------------------------------------
-//
-TInt CSconVersionInfo::GetSymbianVersion( SysVersionInfo::TSymbianOSVersion& aSymbianVersion )
-    {
-    if ( iSymbianVersionError )
-        {
-        return iSymbianVersionError;
-        }
-    else
-        {
-        aSymbianVersion = iSymbianVersion;
-        return KErrNone;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CSconVersionInfo::GetS60Version()
-// Get S60 platform version
-// -----------------------------------------------------------------------------
-//
-TInt CSconVersionInfo::GetS60Version( VersionInfo::TPlatformVersion& aS60Version )
-    {
-    if ( iS60VersionError )
-        {
-        return iS60VersionError;
-        }
-    else
-        {
-        aS60Version = iS60Version;
-        return KErrNone;
-        }
-    }
-
--- a/connectivitymodules/SeCon/services/csc/src/stringlist.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,268 +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:  CStringList implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "stringlist.h"
-#include "capability.h"
-#include "debug.h"
-
-const TInt KMaxStringlistSize( 1000 );
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CStringList::NewL()
-// Two-phase constructor.
-// -----------------------------------------------------------------------------
-//
-CStringList* CStringList::NewL()
-    {
-    CStringList* self = CStringList::NewLC();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::NewLC()
-// Two-phase constructor. The created instance is placed to cleanup stack
-// -----------------------------------------------------------------------------
-//
-CStringList* CStringList::NewLC()
-    {
-    CStringList* self = new ( ELeave ) CStringList();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::CStringList()
-// Default constuctor
-// -----------------------------------------------------------------------------
-//
-CStringList::CStringList()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::~CStringList()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CStringList::~CStringList()
-    {
-    delete iLines;
-    iLines = NULL;
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CStringList::ConstructL()
-    {
-    const TInt KDefaultArrayGranularity = 10;
-    iLines = new (ELeave) CDesCArrayFlat(KDefaultArrayGranularity);
-    SetMark(0);
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::Count() const
-// Returns the count of lines
-// -----------------------------------------------------------------------------
-//
-TInt CStringList::Count() const
-    {
-    return iLines->Count();
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::Panic(TInt aPanic) const
-// Creates a panic
-// -----------------------------------------------------------------------------
-//
-#ifdef _DEBUG
-void CStringList::Panic(TInt aPanic) const
-#else
-void CStringList::Panic(TInt /*aPanic*/) const
-#endif
-    {
-    TRACE_FUNC_ENTRY;
-#ifdef _DEBUG
-    _LIT(KPanicCategory,"CStringList");
-
-    User::Panic(KPanicCategory, aPanic);
-#endif
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::Reset()
-// Resets iLines
-// -----------------------------------------------------------------------------
-//
-void CStringList::Reset()
-    {
-    iLines->Reset();
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::WriteL(const TDesC& aText)
-// Writes a string
-// -----------------------------------------------------------------------------
-//
-void CStringList::WriteL(const TDesC& aText)
-    {
-    iLines->AppendL(aText);
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::ReadPtr(TInt aIndex)
-// Returns pointer to the string
-// -----------------------------------------------------------------------------
-//
-TPtrC16 CStringList::ReadPtr(TInt aIndex)
-    {
-    if (aIndex<0 || aIndex>=Count())
-        {
-        Panic(KErrArgument);
-        }
-        
-    return iLines->MdcaPoint(aIndex);
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::CopyL(CStringList* aSource, TInt aStart, TInt aStop)
-// Copies a string / strings
-// -----------------------------------------------------------------------------
-//
-void CStringList::CopyL(CStringList* aSource, TInt aStart, TInt aStop)
-    {
-    if (aStart<0 || aStop>=aSource->Count() || aStart>aStop)
-        {
-        Panic(KErrArgument);
-        }        
-    
-    for (TInt i=aStart; i<=aStop; i++)
-        {
-        WriteL(aSource->ReadPtr(i));
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::StrCopy(TDes& aTarget, const TDesC& aSource) const
-// Copies the string
-// -----------------------------------------------------------------------------
-//
-TBool CStringList::StrCopy(TDes& aTarget, const TDesC& aSource) const
-    {
-    TInt len=aTarget.MaxLength();
-    if(len<aSource.Length()) 
-        {
-        aTarget.Copy(aSource.Left(len));
-        return EFalse;
-        }
-    aTarget.Copy(aSource);
-    return ETrue;
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::ReadFromFileL(const TDesC& aFileName)
-// Read strings from file.
-// -----------------------------------------------------------------------------
-//
-
-void CStringList::ReadFromFileL( RFs& aFs, const TDesC& aFileName )
-    {
-    InternalizeL( aFs, aFileName );
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::InternalizeL(const TDesC& aFileName)
-// Internalizes from file
-// -----------------------------------------------------------------------------
-//
-void CStringList::InternalizeL( RFs& aFs, const TDesC& aFileName )
-    {
-    
-    RFile file;
-    User::LeaveIfError( file.Open( aFs, aFileName, EFileRead ) );
-    CleanupClosePushL( file );
-    
-    
-    TFileText textFile;
-    textFile.Set( file );
-    textFile.Seek( ESeekStart );
-    TBuf<KMaxSize> buffer;
-    TInt count(0);
-    for (;;)
-        {
-        count++;
-        if ( count > KMaxStringlistSize )
-            {
-            break;
-            }           
-
-        buffer = KNullDesC;
-        
-        //
-        // Read seems to read chars until newline is reached or
-        // the descriptor is full. In case descriptor becomes full,
-        // err is KErrTooBig and next read starts from the next line. 
-        //
-        TInt err = textFile.Read( buffer );
-        if ( err == KErrEof )
-            {
-            break;
-            }
-            
-        if ( err != KErrNone )
-            {
-            User::Leave( err );
-            }           
-
-        iLines->AppendL( buffer );
-        }
-    
-    CleanupStack::PopAndDestroy( &file ); // file 
-    }
-
-
-// -----------------------------------------------------------------------------
-// CStringList::Mark() const
-// Returns the mark
-// -----------------------------------------------------------------------------
-//
-TInt CStringList::Mark() const
-    {
-    return iMark;
-    }
-
-// -----------------------------------------------------------------------------
-// CStringList::SetMark(TInt aMark)
-// Sets mark
-// -----------------------------------------------------------------------------
-//
-void CStringList::SetMark(TInt aMark)
-    {
-    iMark=aMark;
-    }
-
-// End of files
--- a/connectivitymodules/SeCon/services/ftp/bld/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2004-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:  File Transfer Controller build file.
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS  
-DEFAULT
-
-PRJ_EXPORTS
-../rom/sconftp.iby              CORE_APP_LAYER_IBY_EXPORT_PATH(sconftp.iby)
-../rom/sconftpresources.iby     LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(sconftpresources.iby)
-../loc/sconftp.loc              APP_LAYER_LOC_EXPORT_PATH(sconftp.loc)
-
-PRJ_MMPFILES
-../bld/sconftp.mmp
--- a/connectivitymodules/SeCon/services/ftp/bld/def/bwinscwu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?CreateCSConFTPL@@YAPAVCSConFTP@@XZ @ 1 NONAME ; class CSConFTP * CreateCSConFTPL(void)
-
--- a/connectivitymodules/SeCon/services/ftp/bld/def/eabiuu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	_Z15CreateCSConFTPLv @ 1 NONAME
-	_ZTI8CSConFTP @ 2 NONAME ; #<TI>#
-	_ZTV8CSConFTP @ 3 NONAME ; #<VT>#
-
--- a/connectivitymodules/SeCon/services/ftp/bld/sconftp.mmp	Tue Aug 31 15:05:37 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:  File Transfer Controller mmp file
-*
-*/
-
-
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-VENDORID        VID_DEFAULT
-
-CAPABILITY      CAP_GENERAL_DLL
-
-TARGET          sconftp.dll
-TARGETTYPE      DLL
-
-UID             0x10009D8D 0x101F968A
-
-#if defined(ARMCC)
-DEFFILE ./def/eabiu
-#elif defined(WINSCW)
-DEFFILE ./def/bwinscw
-#elif defined(WINS)
-DEFFILE ./def/bwins
-#elif defined(ARM)
-DEFFILE ./def/bmarm
-#endif
-
-SOURCEPATH      ../src
-SOURCE          sconfshandler.cpp
-SOURCE          sconftp.cpp
-SOURCE          sconinboxhandler.cpp
-
-USERINCLUDE     ../../../inc
-USERINCLUDE     ../inc
-USERINCLUDE     ../../../cntparser/inc
-
-// Default system include paths.
-APP_LAYER_SYSTEMINCLUDE
-
-
-START RESOURCE  ../src/sconftp.rss
-HEADER
-TARGETPATH      RESOURCE_FILES_DIR
-LANGUAGE_IDS
-END
-
-
-LIBRARY         efsrv.lib               // For File server
-LIBRARY         euser.lib               // Base library
-LIBRARY         irobex.lib              // For Object exchange
-LIBRARY         obexutils.lib
-LIBRARY         msgs.lib                // For Inbox entry
-LIBRARY         charconv.lib            // For Unicode conversion
-LIBRARY         bafl.lib                // Basic Application Framework Library
-LIBRARY         commonengine.lib        // For resource reader
-LIBRARY         platformenv.lib         // For pathinfo
-LIBRARY         cntparserserver.lib     // for contacts
-LIBRARY         directorylocalizer.lib  // For localizing directories
-LIBRARY         sysutil.lib
-LIBRARY         centralrepository.lib
-DEBUGLIBRARY    flogger.lib             // For debug logging
--- a/connectivitymodules/SeCon/services/ftp/inc/sconconstants.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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:  Common constants for PC Connectivity
-*
-*/
-
-
-#ifndef __SCONCONSTANTS_H
-#define __SCONCONSTANTS_H
-
-enum TSConProfile
-	{
-	EStandard = 0,
-	EProprietary,
-	EOther
-	};
-
-enum TSConUsedMedia
-	{
-	ESConNoMedia = 0,
-	ESConIRMedia,
-	ESConBTMedia,
-	ESConUSBMedia		
-	};
-
-#endif // __SCONCONSTANTS_H
-
-// End of file
--- a/connectivitymodules/SeCon/services/ftp/inc/sconconsts.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
-* Copyright (c) 2005-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:  Constant definitions for File Transfer Controller
-*
-*/
-
-
-#ifndef _SCONCONSTS_H_
-#define _SCONCONSTS_H_
-
-// Define this to show C-drive logs folder to user
-#define SCON_SHOW_LOGS_FOLDER
-
-_LIT( K_C_ROOT, "C:\\" );
-_LIT( KSConLogsPath, "logs\\" );     // logs folder
-
-// Following folders on MMC are exluded from folder listing
-_LIT( KSConResource, "resource\\" ); // resource folder on MMC
-_LIT( KSConSys, "sys\\" );           // sys folder on MMC
-_LIT( KSConPrivate, "private\\" );   // private folder on MMC
-_LIT( KSConSystem, "system\\" );     // system folder on MMC
-
-// Suite needs access to SuiteConf.xml file
-_LIT( KSConAllowedPath, "Z:\\Private\\101F7C87" );
-
-// For folder listing
-_LIT8( KSConXmlDocBegin,
-       "<?xml version=\"1.0\"?>\n<!DOCTYPE folder-listing SYSTEM \"obex-folder-listing.dtd\"\n  [ <!ATTLIST folder mem-type CDATA #IMPLIED>\n  <!ATTLIST folder label CDATA #IMPLIED> ]>\n<folder-listing version=\"1.0\">\n" );
-_LIT8( KSConXmlParentFolder, "   <parent-folder />\n" );
-_LIT8( KSConXmlFileNameBegin,"   <file name=\"" );
-_LIT8( KSConXmlFolderNameBegin,"   <folder name=\"" );
-_LIT8( KSConXmlDriveNameBegin,"   <drive name=\"" );
-_LIT8( KSConXmlType,"\" type=\"" );
-_LIT8( KSConXmlModified,"\" modified=\"" );
-_LIT8( KSConXmlSize,"\" size=\"" );
-_LIT8( KSConXmlUserAttributes,"\" user-perm=\"" );
-_LIT8( KSConXmlMemoryType,"\" mem-type=\"" );
-_LIT8( KSConXmlMemoryLabel,"\" label=\"" );
-
-_LIT8( KSConXmlTypeWord, "x-epoc/x-app268450404" );
-_LIT8( KSConXmlTypeSheet, "x-epoc/x-app268450429" );
-
-_LIT8( KSConXmlUserEntryArchive,"RWD" );
-_LIT8( KSConXmlUserEntryReadOnly,"R" );
-_LIT8( KSConXmlUserEntryDrive, "RW" );
-
-_LIT8( KSConXmlFileEnd,"\"/>\n" );
-_LIT8( KSConXmlFolderListEnd,"</folder-listing>" );
-_LIT8( KSConDriveCName,"C:" );
-_LIT8( KSConDriveZName,"Z:" );
-_LIT8( KSConFolderListType, "x-obex/folder-listing" );
-
-const TInt KSConMemTypeMaxLength = 5;
-_LIT8( KSConMemoryTypeDev, "DEV" ); // prefix for device memory
-_LIT8( KSConMemoryTypeMmc, "MMC" ); // prefix for MMC memory
-
-// Date field format
-_LIT( KSConXmlDate, "%F%Y%M%DT%H%T%SZ" );
-const TInt KSConDateMaxLength = 16;
-
-//File extensions
-_LIT( KSConEpocWordExt, ".ewd" );
-_LIT( KSConEpocSheetExt, ".sht" );
-
-_LIT8( KFind1,"&" );
-_LIT8( KReplace1, "&amp;" );
-_LIT8( KReplace2, "&lt;" );
-_LIT8( KReplace3, "&gt;" );
-_LIT8( KReplace4, "&quot;" );
-_LIT8( KReplace5, "&apos;" );
-
-_LIT( KSConResourceName, "z:\\Resource\\sconftp.rsc" );
-
-const TInt KSConBufSize = 1024;
-const TInt KSConSetPathDontCreate = 0x01;   // Flags used to indicate SetPath commands
-const TInt KSConSetPathRoot = 0x02;         // Flags used to indicate SetPath commands
-const TInt KSConSetPathForward = 0x02;      // Flags used to indicate SetPath commands
-const TInt KSConSetPathBack = 0x03;         // Flags used to indicate SetPath commands
-const TInt KSConXmlBufSize = 30;
-const TInt KSConDriveNameLength = 2;
-const TInt KSConMaxMimeTypeLength = 25;
-const TInt KSConBufferSize = 262144; // 256KB
-
-const TUid KSConSheetUid = { 0x10003a7d };  // Sheet document uid
-const TUid KSConWordUid = { 0x10003a64 };   // Word document uid
-
-const TInt KDriveLength = 3;
-
-#endif
-
--- a/connectivitymodules/SeCon/services/ftp/inc/sconfshandler.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +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:  CSConFSHandler header file
-*
-*/
-
-
-#ifndef _SCONFSHANDLER_H_
-#define _SCONFSHANDLER_H_
-
-// INCLUDES
-
-#include <e32base.h>
-#include <obexobjects.h>
-
-
-// FORWARD DECLARATIONS
-class CDirectoryLocalizer;
-
-
-//============================================================
-// Class CSConFsHandler declaration
-//============================================================
-NONSHARABLE_CLASS( CSConFsHandler ) : public CBase
-    {
-    public:
-        static CSConFsHandler* NewL( RFs& aFs );
-        ~CSConFsHandler();
-        /**
-         * Parses folder and file listing from specified directory
-         * @param aBuffer Buffer to store the folder list
-         * @param aPathName Folder path
-         * @param aMemNumber memory number (1= DEV or MMC, 2= DEV2 or MMC2..)
-         * @return KErrNone if no errors, else system wide error codes.
-         */
-        TInt ParseFolderListL( CBufFlat* aBuffer, const TPtrC aPathName,
-            const TInt aMemNumber );
-        /**
-         * Gets a file object
-         * @param aBuffer CObexFileObject object where the file will be stored
-         * @param aPathName The path of the file
-         * @param aFileName The name of the file
-         * @return KErrNone if no errors, else system wide error codes.
-         */
-        TInt GetFileObjectL( CObexFileObject*& aBuffer, const TPtrC aPathName,
-            const TPtrC aFileName );
-        /**
-         * Stores a file object
-         * @param aFullPathName The full path and name of the file
-         * @param aTime The time stamp of the file
-         * @param aTempFileName Data temp file
-         * @return KErrNone if no errors, else system wide error codes.
-         */
-        TInt SaveFileObjectL( const TPtrC aFullPathName, const TTime aTime, 
-            const TPtrC aTempFileName );
-        /**
-         * Validates the file name
-         * @param aName File name to be validated
-         * @return KErrNone if no errors, else system wide error codes.
-         */
-        TInt ValidateFileName( const TPtrC aName );
-        /**
-         * Creates a folder
-         * @param aFolderPath The name and the path of the folder
-         * @return KErrNone if no errors, else system wide error codes.
-         */
-        TInt CreateFolderL( const TPtrC aFolderPath );
-        /**
-         * Removes a folder or a file
-         * @param aFullPath The path and name of the object
-         * @return KErrNone if no errors, else system wide error codes.
-         */
-        TInt DeleteObjectL( const TPtrC aFullPath );
-        
-        /**
-         * Copy or Move file/folder
-         * @param aSource
-         * @param aTarget
-         * @param aUseCopyCommand if ETrue does copy, else does move.
-         * @return none.
-         */
-        void DoCopyOrMoveFileL( const TDesC& aSource, const TDesC& aTarget,
-            const TBool aUseCopyCommand );
-        
-        /**
-         * Check if folder can be showed
-         * @param aFullPath The path of the object
-         * @return ETrue if folder exists and can be showed.
-         */
-        TBool IsFolderVisible( const TDesC& aFullPath );
-        
-    private:
-        CSConFsHandler( RFs& aFs );
-        void ConstructL();
-        /**
-         * Updates the name of the data folder from a localized string
-         * @param none
-         * @return none
-         */
-        void GetDataPathNameL();
-        
-        /**
-         * Check if folder is read only
-         * @param aFullPath The path of the object
-         * @return ETrue if folder is read only, or if folder does not exist
-         */
-        TBool IsFolderReadOnly( const TDesC& aFullPath ) const;
-        /**
-         * Check if folder can be deleted
-         * @param aFullPath The path of the object
-         * @return ETrue if folder can be deleted
-         */
-        TBool IsFolderDeletable( const TDesC& aFullPath ) const;
-        /**
-         * Get parent folder
-         * @param aFullPath The folder full path with or without backlash ending
-         * @param aParent The founded parent folder with backlash
-         * @return KErrNone if parent folder founded
-         */
-        TInt GetParentFolder( const TDesC& aFullPath, TDes& aParent);
-        
-        /**
-         * Get folder (and subfolders) size
-         * @param aFullPath The folder full path with backlash ending
-         * @return folder total size
-         */
-        TInt64 GetFolderSizeL( const TDesC& aFullPath );
-        
-        /**
-         * Replaces all special characters to xml compliant ones
-         * @param aDes characters to be checked and replaced
-         */
-        void ReplaceSpecialChars( TDes8& aDes );
-        
-        /**
-         * Check if folder is exluded and cannot be shown to user
-         * @param aFullPath The full path with backlash ending
-         * @return ETrue if folder is exluded
-         */
-        TBool IsExludedPath( const TDesC& aFullPath ) const;
-        
-		/**
-		 * Prints folder information to obex-folder-list
-		 */
-        void PrintFolderL( CBufFlat* aBuffer, TInt& aOffset, const TDesC& aParentPath,
-                            const TDesC8& aMemType, const TEntry& aFolderEntry );
-        /**
-		 * Prints file information to obex-folder-list
-		 */
-        void PrintFileL( CBufFlat* aBuffer, TInt& aOffset, const TEntry& aFileEntry );
-        
-    private:
-        RFs&                 iFs; // not own
-        CDirectoryLocalizer* iLocalizer;
-        TBuf8<KMaxFileName> iDataPathName;  // Localized data path
-    };
-
-#endif
-
-// End of file
-
--- a/connectivitymodules/SeCon/services/ftp/inc/sconftp.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CSConFTP header file
-*
-*/
-
-
-#ifndef _SCONFTP_H_
-#define _SCONFTP_H_
-
-// INCLUDES
-
-#include <e32base.h>
-#include <obexobjects.h>
-
-#include "sconconstants.h"
-
-class CSConInboxHandler;
-class CSConFsHandler;
-
-//============================================================
-// Class CSConFTP declaration
-//============================================================
-class CSConFTP : public CBase
-    {
-    public:
-        // construct / destruct
-        static CSConFTP* NewL();        
-        ~CSConFTP();
-
-        // methods
-         /**
-         * Gets object that contains folder listing from inbox or file system
-         * @param aObject CObexBufObject object
-         * @return KErrNone if no errors, else system wide error codes.
-         */
-         virtual TInt GetFolderObjectL( CObexBufObject*& aObject );
-
-         /**
-         * Gets object that contains a file from file system
-         * @param aFileObject CObexFileObject object
-         * @return KErrNone if no errors, else system wide error codes.
-         */
-         virtual TInt GetFileObjectL( CObexFileObject*& aFileObject );
-
-         /**
-         * Initializes the receiving from the client.
-         * @param aObject CObexBufObject object
-         * @param aObject CBufFlat object
-         * @return KErrNone if no error, else system wide error codes.
-         */
-         virtual TInt PutFileObjectInitL( CObexBufObject*& aObject, 
-                                            CBufFlat*& aBuffer );
-
-         /**
-         * Stores the relayed file object to inbox or file system.
-         * @param aObject CObexBufObject object
-         * @return KErrNone if no error, else system wide error codes.        
-         */
-         virtual TInt PutFileObjectFinalizeL( CObexBufObject*& aObject );
-
-         /**
-         * Changes the current path. The path can point to inbox or file system
-         * @param aPathName The name of the new path
-         * @param aFlags Flag value of OBEX Setpath operation
-         * @return KErrNone if no error, else system wide error codes.
-         */
-         virtual TInt SetPathL( const TPtrC aPathName, const TUint8 aFlags );
-
-         /**
-         * Creates a new folder to file system
-         * @param aFolderName The name of the folder to be created
-         * @return KErrNone if no error, else system wide error codes.
-         */
-         virtual TInt CreateFolderL( const TPtrC aFolderName );
-
-         /**
-         * Deletes file/folder from inbox or file system
-         * @param aObjectName The name of the object (file or folder) to be created
-         * @return KErrNone if no error, else system wide error codes.
-         */
-         virtual TInt DeleteObjectL( const TPtrC aObjectName );
-
-         /**
-         * Gets the current path
-         * @param aPath The name of the current path
-         * @return KErrNone if no error, else system wide error codes.
-         */
-         virtual TInt GetPath( TDes& aPath );
-         
-         /**
-         * Abort file transfer
-         * @param aObject The OBEX stack object which will reseted
-         * @return KErrNone if no error, else system wide error codes.
-         */
-         virtual TInt AbortFileTransfer( CObexBufObject*& aObject );
-
-         /**
-         * Set used transfer profile
-         * @param aProfile The profile id
-         * @return none
-         */
-         virtual void SetProfile( TSConProfile aProfile );
-
-         /**
-         * Set backup status
-         * @param aValue Is backup started or not
-         * @return none
-         */
-         virtual void SetBackupStarted( TBool aValue );
-         
-         /**
-         * Set the used media information
-         * @param aMedia The media which is currently used
-         * @return none
-         */
-         virtual void SetUsedMedia( TSConUsedMedia aMedia );
-
-         /**
-         * Check is current drive space below critical level
-         * @param aFilesize, additional free space needed
-         * @return ETrue if below critical                                                  
-         */
-         virtual TBool IsCurrentDiskSpaceBelowCritical( TUint32 aFilesize = 0 );
-         
-         /**
-         * Read received ConML protocol packet
-         * @param aBuffer The buffer for the data
-         * @return KErrNone if no error, else system wide error codes.                                                                        
-         */
-         virtual TInt ReadWBXMLDataL( CBufFlat*& aBuffer );
-         
-         /**
-         * Delete OBEX stack's temp file
-         * @param none
-         * @return KErrNone if no error, else system wide error codes.
-         */
-         virtual void DeleteTempFile();
-         
-         /**
-         * Move or rename file/folder
-         * @param aSource
-         * @param aTarget
-         * @return KErrNone if no error, else system wide error codes.
-         */
-         virtual TInt MoveFile( const TDesC& aSource, const TDesC& aTarget );
-         
-         /**
-         * Copy file/folder
-         * @param aSource
-         * @param aTarget
-         * @return KErrNone if no error, else system wide error codes.
-         */
-         virtual TInt CopyFile( const TDesC& aSource, const TDesC& aTarget );
-         
-         /**
-         * Set read-only attribute to file or folder
-         * @param aTarget file or folder fullname
-         * @param aReadOnly set read-only permission to ETrue or EFalse
-         * @return KErrNone if no error, else system wide error codes.
-         */
-         virtual TInt SetReadOnly( const TDesC& aTarget, const TBool aReadOnly );
-         
-        /**
-         * Set hidden attribute to file or folder
-         * @param aTarget file or folder fullname
-         * @param aHidden set read-only permission to ETrue or EFalse
-         * @return KErrNone if no error, else system wide error codes.
-         */
-        virtual TInt SetHidden( const TDesC& aTarget, const TBool aHidden );
-         
-    private:
-        // methods
-        /**
-         * Get absolute path from given relative foldername
-         * @param aFolderName relative or absolute filename
-         * @param aFullPath return absolete path of file/folder
-         * @return KErrNone if no error, else system wide error codes.
-        */
-        virtual TInt GetAbsolutePath( const TDesC& aFolderName, TDes& aFullPath );
-        
-        /**
-         * Checks if user can see/access to the drive
-         * @param aDriveNumber drive to be tested
-         * @return ETrue if user can see drive.
-        */
-        TBool IsDriveVisible( const TInt aDriveNumber );
-        
-        /**
-         * Checks if user access to the current volume
-         * @param none
-         * @return ETrue if volume is ok.
-        */
-        TBool IsCurrentVolumeOK();
-        
-        /**
-         * Go to (sub)directory
-         * @param aPath (sub)directory
-         * @param aFlags used to check if new folder(s) should be created
-         * @return KErrNone if no error, else system wide error codes.
-        */
-        TInt SetPathForwardL( const TPtrC aPath, const TUint8 aFlags );
-        
-        /**
-         * Go to parent directory
-         * @param aPath subdirectory under parent (additional)
-         * @return KErrNone if no error, else system wide error codes.
-        */
-        TInt SetPathBackwardL( const TPtrC aPath );
-        
-        /**
-         * Get volume name (Memory card name)
-         * @param aDriveNumber drive where to read
-         * @param aVolumeName if name found return volume name, else localised string
-         * @return KErrNone if no error, else system wide error codes.
-        */
-        TInt GetVolumeNameL(const TInt aDriveNumber, TDes8& aVolumeName);
-        
-        /**
-         * Updates drive information (iCurrentDrive and iCurrentDriveTypeNumber)
-         * @param none
-         * @return none, leaves if error occurs.
-        */
-        void UpdateDriveTypeInfoL();
-        
-        void CreateObexBufObjectL( CObexBufObject*& aObject, CBufFlat*& aBuffer );
-        
-        CSConFTP();
-        virtual void ConstructL();
-    
-    private:
-        CSConInboxHandler*                  iSConInboxHandler;  // Object saving-fetching
-        CBufFlat*                           iBuffer;            // Temporary buffer
-        CSConFsHandler*                     iSConFsHandler;     // Object saving-fetching
-        TBuf<KObexObjectDescriptionSize>    iPathName;          // Path
-        TFileName                           iTempFileName;      // Temp file name
-        RFs                                 iFs;
-        TSConProfile                        iProfile;           // Used profile
-        TBool                               iBackupStarted;
-        TSConUsedMedia                      iMedia;
-        TInt                                iCurrentDrive;
-        TInt                                iCurrentDriveTypeNumber; // DEV=1, DEV2=2, MMC=1, MMC2=2.
-        TInt                                iCriticalDiskLevel;
-    };
-
-    IMPORT_C CSConFTP* CreateCSConFTPL();
-    typedef CSConFTP* (*TSConCreateCSConFTPFunc) ();   
-
-
-#endif // SCONFTP
-
-// End of file
--- a/connectivitymodules/SeCon/services/ftp/inc/sconinboxhandler.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +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:  CSConInboxHandler header file
-*
-*/
-
-
-#ifndef _SCONINBOXHANDLER_H_
-#define _SCONINBOXHANDLER_H_
-
-// INCLUDES
-
-#include <e32base.h>
-#include <e32cons.h>
-#include <msvapi.h>
-
-
-//============================================================
-// Class CSConInboxHandler declaration
-//============================================================
-NONSHARABLE_CLASS( CSConInboxHandler ) : public CBase, MMsvSessionObserver
-    {
-    public:
-        static CSConInboxHandler* NewL();
-        virtual ~CSConInboxHandler();
-        
-        /**
-         * Creates an attachment to device's Inbox
-         * @param aObject CObexBufObject object
-         * @return KErrNone if no errors, else system wide error codes.
-         */
-        TInt CreateInboxAttachmentL( CObexBufObject*& aObject, 
-                                        CBufFlat*& aBuffer );
-        /**
-         * Saves the object to the Inbox
-         * @param aObject CObexBufObject object
-         * @return KErrNone if no errors, else system wide error codes.
-         */
-        TInt SaveObjToInboxL( CObexBufObject*& aObject );
-        /**
-         * Aborts the storing operation
-         * @param aObject CObexBufObject object
-         * @return KErrNone if no errors, else system wide error codes.
-         */
-        TInt AbortInboxOperation( CObexBufObject*& aObject );
-        /**
-         * Implementation of MMsvSessionObserver::HandleSessionEventL
-         * @param aEvent Indicates the event type. 
-         * @param aArg1 Event type-specific argument value 
-         * @param aArg2 Event type-specific argument value 
-         * @param aArg3 Event type-specific argument value
-         * @return none
-         */
-        void HandleSessionEventL( TMsvSessionEvent aEvent, 
-                                TAny* aArg1, 
-                                TAny* aArg2, 
-                                TAny* aArg3 );
-        
-    private:
-        CSConInboxHandler();
-        
-        TInt GetMessageCenterDriveL();
-        
-    private:
-        TInt            iDrive;
-        TMsvId          iMsvIdParent;
-        TMsvId          iMsvIdAttach;
-        RFile           iFile;          
-};
-
-#endif
-
-// End of file
--- a/connectivitymodules/SeCon/services/ftp/loc/sconftp.loc	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* Copyright (c) 2002-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:  Localization file for csconftp
-*
-*/
-
-
-//d:Default name for device
-//l:list_double_pane_t2_cp2
-#define	qtn_secon_device "Phone"
-
-//d:Default name for memory card
-//l:list_double_pane_t2_cp2
-#define	qtn_secon_mmc "Memory card"
-
-//d:Default name for mass storage
-//l:None
-//r:3.2
-#define	qtn_secon_mass_storage "Mass memory"
-
-//d:Default name for data folder
-//l:None
-//r:3.2
-#define	qtn_secon_data_folder "Personal files"
-
-// d: Value in a PC Suite dialog showing program details
-// l: None
-// r: 3.2
-#define qtn_secon_unknown_supplier "Unknown"
--- a/connectivitymodules/SeCon/services/ftp/rom/sconftp.iby	Tue Aug 31 15:05:37 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: Image description file for CSConFTP
-*
-*/
-
-
-#ifndef __SCONFTP_IBY__
-#define __SCONFTP_IBY__
-//file content
-
-file=ABI_DIR\BUILD_DIR\sconftp.dll              SHARED_LIB_DIR\sconftp.dll
-
-#endif
--- a/connectivitymodules/SeCon/services/ftp/rom/sconftpresources.iby	Tue Aug 31 15:05:37 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: Image description file for SConFTP resources.
-*
-*/
-
-#ifndef __SCONFTP_RESOURCE_IBY__
-#define __SCONFTP_RESOURCE_IBY__
-
-data=DATAZ_\RESOURCE_FILES_DIR\sconftp.rsc	RESOURCE_FILES_DIR\sconftp.rsc
-
-#endif
\ No newline at end of file
--- a/connectivitymodules/SeCon/services/ftp/src/sconfshandler.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1505 +0,0 @@
-/*
-* Copyright (c) 2005-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:  File Transfer Controller implementation
-*
-*/
-
-
-// INCLUDE FILES
-#include <stringresourcereader.h>
-#include <sconftp.rsg>
-#include <pathinfo.h>
-#include <connect/sbdefs.h> // to get backup/restore mode
-#include <driveinfo.h>
-#include <bautils.h>
-#include <sysutil.h>
-#include <CDirectoryLocalizer.h>
-
-#include "sconfshandler.h"
-#include "sconconsts.h"
-#include "irmcconsts.h"
-#include "cntparserclient.h"
-#include "cntparserinfolog.h"
-#include "debug.h"
-
-// cntparser related constants
-_LIT(KPhoneBookIrMCL2Request,"telecom/pb.vcf");
-_LIT(KInfoLogIrMCL2Request,"telecom/pb/info.log");
-_LIT(KInfoLogIrMCL2File,"IrMC\\info.log");
-_LIT(KInfoLogPathAndFileName,"c:\\IrMC\\info.log");
-_LIT(KPbPathAndFileName,"c:\\IrMC\\pb.vcf");
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::NewL()
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CSConFsHandler* CSConFsHandler::NewL( RFs& aFs )
-    {
-    TRACE_FUNC_ENTRY;
-    CSConFsHandler* self = new (ELeave) CSConFsHandler( aFs );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::~CSConFsHandler()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConFsHandler::~CSConFsHandler()
-    {
-    TRACE_FUNC_ENTRY;
-    delete iLocalizer;
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::ParseFolderListL( CBufFlat* aBuffer, const TPtrC aPathName
-//                                  , const TInt aMemNumber )
-// Parses folder and file listing from specified directory
-// -----------------------------------------------------------------------------
-//
-TInt CSConFsHandler::ParseFolderListL( CBufFlat* aBuffer, const TPtrC aPathName,
-                                       const TInt aMemNumber )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "CSConFsHandler::ParseFolderListL aPathName =  %S", &aPathName );
-    if( aPathName.Length() == 0 )
-        {
-        LOGGER_WRITE( "CSConFsHandler::ParseFolderListL( CBufFlat* aBuffer, const TPtrC aPathName ) : No path" );
-        return KErrArgument;
-        }
-            
-    if( aPathName.Length() > KDriveLength && !BaflUtils::FolderExists( iFs, aPathName ) )
-        {
-        LOGGER_WRITE( "CSConFsHandler::ParseFolderListL( CBufFlat* aBuffer, const TPtrC aPathName ) : Current folder doesn't exist any more" );
-        return KErrNotFound;
-        }
-    
-    TInt driveNumber;
-    TInt err = iFs.CharToDrive(aPathName[0], driveNumber);
-    if( err )
-        {
-        LOGGER_WRITE_1( "CSConFsHandler::ParseFolderListL : CharToDrive err: %d", err );
-        return KErrNotFound;
-        }
-    TUint driveStatus;
-    err = DriveInfo::GetDriveStatus( iFs, driveNumber, driveStatus);
-    if( err )
-        {
-        LOGGER_WRITE_1( "CSConFsHandler::ParseFolderListL : DriveInfo::GetDriveStatus err: %d", err );
-        return KErrNotFound;
-        }
-    
-    // check mem type (DEV, DEV2, MMC, MMC2..)
-    TBuf8<KSConMemTypeMaxLength> memType;
-    if( driveStatus & DriveInfo::EDriveInternal )
-        {
-        memType.Copy( KSConMemoryTypeDev );
-        if( aMemNumber > 1 )
-            {
-            memType.AppendNum(aMemNumber);
-            }
-        }
-    else if( driveStatus & DriveInfo::EDriveRemovable )
-        {
-        memType.Copy( KSConMemoryTypeMmc );
-        if( aMemNumber > 1 )
-            {
-            memType.AppendNum(aMemNumber);
-            }
-        }
-
-    CDir *entryList = 0;
-    CDir *dirList = 0;
-    
-    // show only normal files and folders
-    TUint entryAttMask = KEntryAttNormal;
-    
-    
-    // get folders and files
-    err = iFs.GetDir( aPathName, entryAttMask, ESortByName, 
-            entryList, dirList );
-    
-    if ( err )
-        {
-        LOGGER_WRITE_1( "ParseFolderListL GetDir returned: %d", err );
-        return err;
-        }
-    
-    CleanupStack::PushL( entryList );
-    CleanupStack::PushL( dirList );
-    
-    TInt offset = 0;
-    
-    LOGGER_WRITE( "CSConFsHandler::ParseFolderList XML creation" );
-    //Create folder XML
-    aBuffer->ResizeL( KSConXmlDocBegin().Length() );
-    aBuffer->Write( offset, KSConXmlDocBegin );
-    offset += KSConXmlDocBegin().Length();
-
-    aBuffer->ExpandL( offset, KSConXmlParentFolder().Length() );
-    aBuffer->Write( offset, KSConXmlParentFolder );
-    offset += KSConXmlParentFolder().Length();
-
-    HBufC* fullNameBuf = HBufC::NewLC( KMaxPath );
-    TPtr fullName = fullNameBuf->Des();
-    
-    // Print folders to folder listing object
-    for( TInt i = 0; i < dirList->Count(); i++ )
-        {
-        const TEntry entry = ( *dirList )[i];
-        
-        fullName.Copy( aPathName );
-        fullName.Append( entry.iName );
-        fullName.Append( KPathDelimiter );
-        
-        // show path if not exluded
-        TBool proceed = !IsExludedPath( fullName );
-        if ( proceed )
-            {
-            PrintFolderL( aBuffer, offset, fullName, memType, entry );
-            }
-        }
-    CleanupStack::PopAndDestroy( fullNameBuf );
-    CleanupStack::PopAndDestroy( dirList );
-    
-    LOGGER_WRITE("Print files");
-    // Print files to folder listing object
-    for( TInt j = 0; j < entryList->Count(); j++ )
-        {
-        const TEntry entry = ( *entryList )[j];
-        PrintFileL( aBuffer, offset, entry );
-        }
-    LOGGER_WRITE("files printed");
-    //Write the end of XML
-    aBuffer->ExpandL( offset, KSConXmlFolderListEnd().Length() );
-    aBuffer->Write( offset, KSConXmlFolderListEnd );
-    aBuffer->Compress();
-    
-    CleanupStack::PopAndDestroy( entryList );
-
-    LOGGER_WRITE_1( "CSConFsHandler::ParseFolderListL() : returned %d", err );
-    return err;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::PrintFolderL
-// Prints folder entry to folder listing object
-// -----------------------------------------------------------------------------
-//
-void CSConFsHandler::PrintFolderL( CBufFlat* aBuffer, TInt& aOffset, const TDesC& aFullPath,
-                    const TDesC8& aMemType, const TEntry& aFolderEntry )
-    {
-    TRACE_FUNC_ENTRY;
-    // initialize Localizer
-    iLocalizer->SetFullPath( aFullPath );
-    
-    TBool dataPath( EFalse );
-    if ( aFullPath.CompareF( PathInfo::PhoneMemoryRootPath() ) == 0 ) // datapath
-        {
-        // printable folder is C:\Data (Localized)
-        dataPath = ETrue;
-        }
-    
-    // print foldername
-    aBuffer->ExpandL( aOffset, KSConXmlFolderNameBegin().Length() );
-    aBuffer->Write( aOffset, KSConXmlFolderNameBegin );
-    aOffset += KSConXmlFolderNameBegin().Length();
-    
-    HBufC8* folderBuf = HBufC8::NewLC( KMaxFileName );
-    TPtr8 folderName = folderBuf->Des();
-    User::LeaveIfError( 
-        CnvUtfConverter::ConvertFromUnicodeToUtf8( folderName, aFolderEntry.iName ) );
-    
-    //Replace special characters
-    ReplaceSpecialChars( folderName );
-
-    aBuffer->ExpandL( aOffset, folderName.Length() );
-    aBuffer->Write( aOffset, folderName );
-    aOffset += folderName.Length();
-    
-    CleanupStack::PopAndDestroy( folderBuf );
-    
-    // print modified time
-    TBuf<KSConDateMaxLength> modifiedTime;
-    TTime time = aFolderEntry.iModified;
-    time.FormatL( modifiedTime, KSConXmlDate );
-    
-    TBuf8<KSConDateMaxLength> modifiedTime8;
-    User::LeaveIfError( 
-        CnvUtfConverter::ConvertFromUnicodeToUtf8( modifiedTime8, modifiedTime ) );
-    
-    aBuffer->ExpandL( aOffset, KSConXmlModified().Length() );
-    aBuffer->Write( aOffset, KSConXmlModified );
-    aOffset += KSConXmlModified().Length();
-    
-    aBuffer->ExpandL( aOffset, modifiedTime8.Length() );
-    aBuffer->Write( aOffset, modifiedTime8 );
-    aOffset += modifiedTime8.Length();
-    
-    // print attributes
-    aBuffer->ExpandL( aOffset, KSConXmlUserAttributes().Length() );
-    aBuffer->Write( aOffset, KSConXmlUserAttributes );
-    aOffset += KSConXmlUserAttributes().Length();
-    
-    // Add user-perm info
-    if( aFolderEntry.IsReadOnly() )
-        {
-        aBuffer->ExpandL( aOffset, 
-            KSConXmlUserEntryReadOnly().Length() );
-        aBuffer->Write( aOffset, KSConXmlUserEntryReadOnly );
-        aOffset += KSConXmlUserEntryReadOnly().Length();
-        }
-    else if( iLocalizer->IsLocalized() || dataPath ) // delete disabled
-        {
-        aBuffer->ExpandL( aOffset, 
-            KSConXmlUserEntryDrive().Length() );
-        aBuffer->Write( aOffset, KSConXmlUserEntryDrive );
-        aOffset += KSConXmlUserEntryDrive().Length();
-        }
-    else
-        {
-        aBuffer->ExpandL( aOffset, 
-            KSConXmlUserEntryArchive().Length() );
-        aBuffer->Write( aOffset, KSConXmlUserEntryArchive );
-        aOffset += KSConXmlUserEntryArchive().Length();
-        }
-    
-    
-    // print memory type
-    aBuffer->ExpandL( aOffset, KSConXmlMemoryType().Length() );
-    aBuffer->Write( aOffset, KSConXmlMemoryType );
-    aOffset += KSConXmlMemoryType().Length();
-    
-    aBuffer->ExpandL( aOffset, aMemType.Length() );
-    aBuffer->Write( aOffset, aMemType );
-    aOffset += aMemType.Length();
-    
-    // print label if exists
-    if( iLocalizer->IsLocalized() )
-        {
-        //get localized folder name
-        HBufC8* labelBuf = 
-            CnvUtfConverter::ConvertFromUnicodeToUtf8L( iLocalizer->LocalizedName() );
-        CleanupStack::PushL( labelBuf );
-        TPtrC8 label = labelBuf->Des();
-        //memory label
-        aBuffer->ExpandL( aOffset, 
-            KSConXmlMemoryLabel().Length() );
-        aBuffer->Write( aOffset, KSConXmlMemoryLabel );
-        aOffset += KSConXmlMemoryLabel().Length();
-        
-        aBuffer->ExpandL( aOffset, label.Length() );
-        aBuffer->Write( aOffset, label );
-        aOffset += label.Length();
-        
-        CleanupStack::PopAndDestroy( labelBuf );
-        }
-    if ( dataPath ) // datapath
-        {
-        //memory label
-        aBuffer->ExpandL( aOffset, 
-            KSConXmlMemoryLabel().Length() );
-        aBuffer->Write( aOffset, KSConXmlMemoryLabel );
-        aOffset += KSConXmlMemoryLabel().Length();
-        
-        aBuffer->ExpandL( aOffset, iDataPathName.Length() );
-        aBuffer->Write( aOffset, iDataPathName );
-        aOffset += iDataPathName.Length();
-        }
-    // print ending
-    aBuffer->ExpandL( aOffset, KSConXmlFileEnd().Length() );
-    aBuffer->Write( aOffset, KSConXmlFileEnd );
-    aOffset += KSConXmlFileEnd().Length();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::PrintFileL
-// Prints file entry to folder listing object
-// -----------------------------------------------------------------------------
-//
-void CSConFsHandler::PrintFileL( CBufFlat* aBuffer, TInt& aOffset, const TEntry& aFileEntry )
-    {
-    LOGGER_WRITE_1("CSConFsHandler::PrintFileL, filename: %S", &aFileEntry.iName );
-    HBufC8* fileBuf = HBufC8::NewLC( KMaxFileName );
-    TPtr8 fileName = fileBuf->Des();
-        
-    User::LeaveIfError( 
-        CnvUtfConverter::ConvertFromUnicodeToUtf8( fileName, aFileEntry.iName ) );
-
-    //Replace special characters
-    ReplaceSpecialChars( fileName );
-        
-    // print filename
-    aBuffer->ExpandL( aOffset, KSConXmlFileNameBegin().Length() );
-    aBuffer->Write( aOffset, KSConXmlFileNameBegin );
-    aOffset += KSConXmlFileNameBegin().Length();
-
-    aBuffer->ExpandL( aOffset, fileName.Length() );
-    aBuffer->Write( aOffset, fileName );
-    aOffset += fileName.Length();
-
-    // print size
-    aBuffer->ExpandL( aOffset, KSConXmlSize().Length() );
-    aBuffer->Write( aOffset, KSConXmlSize );
-    aOffset += KSConXmlSize().Length();
-
-    fileName.Delete( 0, fileName.Length() ); // re-use fileName descriptor
-    fileName.AppendNum( aFileEntry.iSize );
-    aBuffer->ExpandL( aOffset, fileName.Length() );
-    aBuffer->Write( aOffset, fileName );
-    aOffset += fileName.Length();
-    
-    CleanupStack::PopAndDestroy( fileBuf );
-
-    // print modified
-    TBuf<KSConDateMaxLength> modifiedTime;
-    TTime time = aFileEntry.iModified;
-    time.FormatL( modifiedTime, KSConXmlDate );
-    
-    TBuf8<KSConDateMaxLength> modifiedTime8;
-    User::LeaveIfError( 
-        CnvUtfConverter::ConvertFromUnicodeToUtf8( modifiedTime8, modifiedTime ) );
-    
-    
-    aBuffer->ExpandL( aOffset, KSConXmlModified().Length() );
-    aBuffer->Write( aOffset, KSConXmlModified );
-    aOffset += KSConXmlModified().Length();
-    
-    aBuffer->ExpandL( aOffset, modifiedTime8.Length() );
-    aBuffer->Write( aOffset, modifiedTime8 );
-    aOffset += modifiedTime8.Length();
-
-    // attributes
-    aBuffer->ExpandL( aOffset, KSConXmlUserAttributes().Length() );
-    aBuffer->Write( aOffset, KSConXmlUserAttributes );
-    aOffset += KSConXmlUserAttributes().Length();
-
-    if( aFileEntry.IsSystem() )
-        {
-        aBuffer->ExpandL( aOffset, 
-            KSConXmlUserEntryReadOnly().Length() );
-        aBuffer->Write( aOffset, KSConXmlUserEntryReadOnly );
-        aOffset += KSConXmlUserEntryReadOnly().Length();
-        }
-    else if( aFileEntry.IsReadOnly() )
-        {
-        LOGGER_WRITE("was readonly" );
-        aBuffer->ExpandL( aOffset, 
-            KSConXmlUserEntryReadOnly().Length() );
-        aBuffer->Write( aOffset, KSConXmlUserEntryReadOnly );
-        aOffset += KSConXmlUserEntryReadOnly().Length();
-        }
-    else
-        {
-        aBuffer->ExpandL( aOffset, 
-            KSConXmlUserEntryArchive().Length() );
-        aBuffer->Write( aOffset, KSConXmlUserEntryArchive );
-        aOffset += KSConXmlUserEntryArchive().Length();
-        }
-    
-
-    //Word document
-    if ( aFileEntry.iType.IsPresent( KSConWordUid ) ||
-            aFileEntry.iName.Find( KSConEpocWordExt ) == aFileEntry.iName.Length() - 4 )
-        {
-        aBuffer->ExpandL( aOffset, KSConXmlType().Length() );
-        aBuffer->Write( aOffset, KSConXmlType );
-        aOffset += KSConXmlType().Length();
-        
-        aBuffer->ExpandL( aOffset, KSConXmlTypeWord().Length() );
-        aBuffer->Write( aOffset, KSConXmlTypeWord );
-        aOffset += KSConXmlTypeWord().Length();
-        }
-    //Sheet document
-    else if ( aFileEntry.iType.IsPresent( KSConSheetUid ) ||
-            aFileEntry.iName.Find( KSConEpocSheetExt ) == aFileEntry.iName.Length() - 4 )
-        {
-        aBuffer->ExpandL( aOffset, KSConXmlType().Length() );
-        aBuffer->Write( aOffset, KSConXmlType );
-        aOffset += KSConXmlType().Length();
-        
-        aBuffer->ExpandL( aOffset, KSConXmlTypeSheet().Length() );
-        aBuffer->Write( aOffset, KSConXmlTypeSheet );
-        aOffset += KSConXmlTypeSheet().Length();
-        }
-
-    aBuffer->ExpandL( aOffset, KSConXmlFileEnd().Length() );
-    aBuffer->Write( aOffset, KSConXmlFileEnd );
-    aOffset += KSConXmlFileEnd().Length();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::GetFileObjectL( CObexFileObject*& aFileObject, 
-// const TPtrC aPathName, const TPtrC aFileName )
-// Gets a file object
-// -----------------------------------------------------------------------------
-//
-TInt CSConFsHandler::GetFileObjectL( CObexFileObject*& aFileObject, 
-                                const TPtrC aPathName, const TPtrC aFileName )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_2( "CSConFsHandler::GetFileObjectL aFileName =  %S aPathName = %S", &aFileName, &aPathName );
-
-    TInt ret( KErrNone );
-    
-    if( ( aPathName.Length() == 0 || aFileName.Length() == 0 ) && 
-    !( aFileName==KPhoneBookIrMCL2Request || 
-    aFileName==KInfoLogIrMCL2Request ) )
-        {
-        return KErrArgument;
-        }
-
-    if( aPathName.Length() + aFileName.Length() > KMaxFileName )
-        {
-        return KErrAbort;
-        }
-
-    HBufC* pathBuf = HBufC::NewLC( KMaxFileName );
-    TPtr pathBufPtr = pathBuf->Des();
-
-    /*These modifiactions are mean to catch an IrMC L2 request. 
-    If the request is made, then the requested phonebook file and
-    info log -file are created. Path and filename is also changed 
-    to point to these created files.*/
-    if( aFileName == KPhoneBookIrMCL2Request || 
-    aFileName == KInfoLogIrMCL2Request )
-        {
-        LOGGER_WRITE( "CSConFsHandler: IrMC L2 request!" );
-        TInt err;
-        TInt status;
-        TInt contactsSaved = 0;
-        RCntParserServer cntParserServer;
-
-        err = cntParserServer.Connect();
-        if( err != KErrNone )
-            {
-            LOGGER_WRITE( "CSConFsHandler: Cannot connect to the cntparserserver, ABORT!" );
-
-            CleanupStack::PopAndDestroy( pathBuf );
-            return KErrAbort;
-            }
-
-        LOGGER_WRITE( "CSConFsHandler: Time to call CreateIrMCL2PhoneBook" );
-        TBool force = ( aFileName == KInfoLogIrMCL2Request );
-        status=cntParserServer.CreateIrMCL2PhoneBook( KMaximumNumberOfContacts,
-         force );
-        LOGGER_WRITE_1( "CntParserServer.CreateIrMCL2PhoneBook returned %d", status );
-         
-        //Check how many vcards were saved
-        contactsSaved = cntParserServer.ContactsSaved();    
-        LOGGER_WRITE_1( "CntParserServer.ContactsSaved returned %d", contactsSaved );
-
-        err = cntParserServer.Disconnect();
-        LOGGER_WRITE_1( "CntParserServer.Disconnect() %d", err );
-        if( err != KErrNone )
-            {
-            CleanupStack::PopAndDestroy( pathBuf );
-            return KErrAbort;
-            }
-        //save info.log, if pb.vcf has changed (Note: KPBNotUpdated is returned
-        // if no changes made to pb.vcf)
-        if( status == KErrNone )    
-            {
-            LOGGER_WRITE( "CSConFsHandler: Create info.log" );
-
-            CCntParserInfoLog* infoLog=CCntParserInfoLog::NewL();
-            CleanupStack::PushL( infoLog );
-            //see KMaximumNumberOfContacts for more details
-            infoLog->SetMaximumRecords( contactsSaved ); 
-            infoLog->SetTotalRecords( contactsSaved );
-            TFileName privatepath( K_C_ROOT );
-            privatepath.Append( KInfoLogIrMCL2File );
-            infoLog->SaveToFileL( privatepath );
-            CleanupStack::PopAndDestroy( infoLog );
-            }
-
-        if( aFileName == KInfoLogIrMCL2Request )
-            {
-            //Changes filename and path to info.log
-            pathBufPtr.Copy( KInfoLogPathAndFileName ); 
-            }
-        else
-            {
-            //Changes filename and path to pb.vcf
-            pathBufPtr.Copy( KPbPathAndFileName );  
-            }
-        }       
-    else
-        {
-        pathBufPtr.Copy( aPathName );
-        pathBufPtr.Append( aFileName );         
-        }
-    
-    LOGGER_WRITE( "CSConFsHandler::GetFileObjectL() : aFileObject->InitFromFileL( pathBufPtr )" );
-    TRAP( ret, aFileObject->InitFromFileL( pathBufPtr ) );
-    LOGGER_WRITE( "CSConFsHandler::GetFileObjectL() : aFileObject->InitFromFileL( pathBufPtr ) ok" );
-
-    CleanupStack::PopAndDestroy( pathBuf );
-
-    LOGGER_WRITE_1( "CSConFsHandler::GetFileObjectL( CObexFileObject*& aFileObject, const TPtrC aPathName, const TPtrC aFileName ) : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::SaveFileObjectL( const TPtrC aFullPathName, const TTime aTime,
-// const TPtrC aTempFileName )
-// Stores a file object
-// -----------------------------------------------------------------------------
-//
-TInt CSConFsHandler::SaveFileObjectL( const TPtrC aFullPathName, 
-                        const TTime aTime, const TPtrC aTempFileName )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_2( "CSConFsHandler::SaveFileObjectL aFullPathName = %S aTempFileName = %S", &aFullPathName, &aTempFileName );
-
-    TInt ret( KErrNone );
-    
-    if( aFullPathName.Length() == 0 )
-        {
-        iFs.Delete( aTempFileName );
-        return KErrPathNotFound;
-        }
-
-    ret = ValidateFileName( aFullPathName );
-        
-    if( ret == KErrNone )
-        {
-        TUint attr;
-        TInt err = iFs.Att( BaflUtils::DriveAndPathFromFullName(aFullPathName), attr );
-        if ( err == KErrNone && attr & KEntryAttReadOnly )
-            {
-            // folder is read only, permission denied
-            iFs.Delete( aTempFileName );
-            ret = KErrAccessDenied;
-            }
-        else if( !BaflUtils::FileExists( iFs, aFullPathName ) ) 
-            {
-            // file does not exist, rename.
-            ret = iFs.Rename( aTempFileName, aFullPathName );
-
-            if( ret == KErrNone )
-                {
-                ret = iFs.SetModified( aFullPathName, aTime );
-                ret = KErrNone;
-                }
-            else
-                {
-                iFs.Delete( aTempFileName );
-                }
-            }
-        else
-            {
-            LOGGER_WRITE( "CSConFsHandler::SaveFileObjectL() file exists. replace" );
-            // file exists. Replace if not read-only file.
-            TUint attr;
-            ret = iFs.Att( aFullPathName, attr );
-            // Check permissions
-            if( ret == KErrNone && ( attr == KEntryAttNormal || 
-            attr == KEntryAttArchive ) && !(attr & KEntryAttReadOnly) )
-                {
-                ret = iFs.Replace( aTempFileName, aFullPathName );
-                LOGGER_WRITE_1( "CSConFsHandler::SaveFileObjectL() iFs.Replace ret %d", ret);
-                //Set correct time stamp
-                if( ret == KErrNone )
-                    {
-                    ret = iFs.SetModified( aFullPathName, aTime );
-                    ret = KErrNone;
-                    }
-                else
-                    {
-                    iFs.Delete( aTempFileName );
-                    }
-                }
-            else
-                {
-                LOGGER_WRITE( "CSConFsHandler::SaveFileObjectL() no permissions" );
-                iFs.Delete( aTempFileName );
-                ret = KErrAccessDenied;
-                }
-            }   
-        }
-    else
-        {
-        iFs.Delete( aTempFileName );
-        }
-    
-    LOGGER_WRITE_1( "CSConFsHandler::SaveFileObjectL() : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::ValidateFileName( const TPtrC aName )
-// Validates the file name
-// -----------------------------------------------------------------------------
-//
-TInt CSConFsHandler::ValidateFileName( const TPtrC aName )
-    {
-    TInt ret( KErrNone );
-
-    if( !iFs.IsValidName( aName ) )
-        {
-        ret = KErrBadName;
-        }
-
-    LOGGER_WRITE_1( "CSConFsHandler::ValidateFileName( const TPtrC aName ) : returned %d", ret  );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::CreateFolderL( const TPtrC aFolderPath )
-// Creates a folder
-// -----------------------------------------------------------------------------
-//
-TInt CSConFsHandler::CreateFolderL( const TPtrC aFolderPath )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TInt ret( KErrNone );
-    
-    if( aFolderPath.Length() == 0 )
-        {
-        return KErrArgument;
-        }
-    if( aFolderPath.Length() > KMaxPath )
-        {
-        return KErrAbort;
-        }
-    if( BaflUtils::PathExists( iFs, aFolderPath ) )
-        {
-        return KErrAlreadyExists;
-        }
-    // get restore mode
-    TBool restoreInProgress( EFalse );
-    RProperty backupProperty;
-    TInt burState( 0 );
-    TInt burErr = backupProperty.Get( KUidSystemCategory, conn::KUidBackupRestoreKey, burState ); 
-    const conn::TBURPartType partType = 
-        static_cast< conn::TBURPartType >( burState & conn::KBURPartTypeMask );
-    if( burErr == KErrNone &&
-     ( partType == conn::EBURRestorePartial || partType == conn::EBURRestoreFull ) )
-        {
-        // restore mode
-        LOGGER_WRITE( "CSConFsHandler::CreateFolderL() restore mode" );
-        restoreInProgress = ETrue;
-        }
-    
-    // check permissions if not restore mode
-    if ( !restoreInProgress )
-        {
-        if ( IsExludedPath( aFolderPath ) )
-            {
-            // user has no access to this folder
-            LOGGER_WRITE( "CSConFsHandler::CreateFolderL() KErrAccessDenied" );
-            return KErrAccessDenied;
-            }
-        
-        // user can create whole folder path at once and we need to check that
-        // user has permission to create folders. We need to find first folder that 
-        // should be created, and see if parent folder has read-only permission.
-        
-        HBufC* fullPath = HBufC::NewLC( KMaxFileName );
-        TPtr fullPathPtr = fullPath->Des();
-    
-        fullPathPtr.Copy(aFolderPath);
-        TBool parentFound(EFalse);
-        LOGGER_WRITE( "CSConFsHandler::CreateFolder() start loop" );
-        TInt err(KErrNone);
-        while (!parentFound && err==KErrNone)
-            {
-            err = GetParentFolder( fullPathPtr, fullPathPtr );
-            if( err == KErrNone )
-                {
-                if (BaflUtils::PathExists( iFs, fullPathPtr ))
-                    {
-                    parentFound = ETrue;
-                    TUint attr;
-                    ret = iFs.Att( fullPathPtr, attr );
-                    if ( ret == KErrNone &&  (attr & KEntryAttReadOnly || attr & KEntryAttSystem) )
-                        {
-                        // parent folder is read-only
-                        LOGGER_WRITE( "CSConFsHandler::CreateFolderL() KErrAccessDenied" );
-                        err = KErrAccessDenied;
-                        }
-                    }
-                }
-            }
-        
-        CleanupStack::PopAndDestroy( fullPath );
-        if ( err == KErrAccessDenied )
-            {
-            return KErrAccessDenied;
-            }
-        }
-    
-    ret = iFs.MkDirAll( aFolderPath );
-    LOGGER_WRITE_1( "CSConFsHandler::CreateFolderL( const TPtrC aFolderPath ) : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::DeleteObjectL( const TPtrC aFullPath )
-// Removes a folder or a file
-// -----------------------------------------------------------------------------
-//
-TInt CSConFsHandler::DeleteObjectL( const TPtrC aFullPath )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aFullPath: %S", &aFullPath);
-    TInt ret( KErrNone );
-    
-    if( aFullPath.Length() == 0 )
-        {
-        return KErrArgument;
-        }
-    
-    if( aFullPath.Length() > KMaxFileName )
-        {
-        return KErrAbort;
-        }
-    
-    TUint attr;
-    // get source folder permissions.
-    ret = iFs.Att( BaflUtils::DriveAndPathFromFullName(aFullPath), attr );
-    if ( ret == KErrNone && (attr & KEntryAttReadOnly || attr & KEntryAttSystem ) )
-        {
-        return KErrAccessDenied;
-        }
-    
-    
-    // Check file/folder permissions
-    ret = iFs.Att( aFullPath, attr );
-    if ( ret == KErrNone && ( attr & KEntryAttReadOnly || attr & KEntryAttSystem ) )
-        {
-        return KErrAccessDenied;
-        }
-    
-    TBool isFolder(EFalse);
-    ret = BaflUtils::IsFolder( iFs, aFullPath, isFolder );
-    
-    if( isFolder && ret == KErrNone )
-        {
-        HBufC* fullPath = HBufC::NewLC( KMaxFileName );
-        TPtr fullPathPtr = fullPath->Des();
-        
-        fullPathPtr.Copy( aFullPath );
-        //check if there is a slash at the end
-        if( fullPathPtr.LocateReverse( KPathDelimiter ) != fullPathPtr.Length()-1 )
-            {
-            fullPathPtr.Append( KPathDelimiter );
-            }
-        
-        if ( !IsFolderVisible( fullPathPtr ) )
-            {
-            LOGGER_WRITE("folder was not visible");
-            CleanupStack::PopAndDestroy( fullPath );
-            return KErrNotFound;
-            }
-        else if ( !IsFolderDeletable( fullPathPtr ) )
-            {
-            LOGGER_WRITE("folder was not deletable");
-            CleanupStack::PopAndDestroy( fullPath );
-            return KErrAccessDenied;
-            }
-        
-        ret = iFs.RmDir( fullPathPtr );
-        LOGGER_WRITE_1("iFs.RmDir err: %d", ret);
-        //delete non-empty folder
-        if( ret != KErrNone )
-            {
-            CFileMan* fileMan = CFileMan::NewL( iFs );
-            CleanupStack::PushL( fileMan );
-            // if directory contains read-only files, those files are not deleted
-            // and KErrAccessDenied is returned.
-            ret = fileMan->RmDir( fullPathPtr );
-            LOGGER_WRITE_1("fileMan->RmDir err: %d", ret);
-            CleanupStack::PopAndDestroy( fileMan ); //fileman
-            }
-        if( ret == KErrNone )
-            {
-            // check is delete operation really succesfully completed
-            if( BaflUtils::PathExists( iFs, fullPathPtr ) )
-                {
-                // Folder still exist, return error
-                // KErrBadName mapped to precondition failed error.
-                ret = KErrBadName;
-                }
-            }
-        CleanupStack::PopAndDestroy( fullPath ); //fullPath
-        }
-    else if (ret == KErrNone)
-        {
-        // deleting file
-        if ( IsExludedPath( aFullPath ) )
-            {
-            LOGGER_WRITE("Cannot delete from specified folder, return KErrAccessDenied");
-            ret = KErrAccessDenied;
-            }
-        else
-            {
-            ret = iFs.Delete( aFullPath );
-            }
-        }
-    
-    
-    
-    LOGGER_WRITE_1( "CSConFsHandler::DeleteObjectL() : returned %d", ret );
-    return ret;
-    }
-    
-    
-// -----------------------------------------------------------------------------
-// CSConFsHandler::CopyOrMoveFile()
-// Copy or Move file/folder.
-// -----------------------------------------------------------------------------
-//
-void CSConFsHandler::DoCopyOrMoveFileL( const TDesC& aSource, const TDesC& aTarget,
-                                 const TBool aUseCopyCommand)
-    {
-    TRACE_FUNC_ENTRY;
-    TInt lastError(KErrNone);
-    TBool isFolder;
-    
-    if( !iFs.IsValidName( aSource ) || !iFs.IsValidName( aTarget ) )
-        {
-        LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : Not valid name" );
-        User::Leave( KErrBadName );
-        }
-    
-    // will leave if source (file/folder) does not exists.
-    User::LeaveIfError( BaflUtils::IsFolder(iFs, aSource, isFolder ) );
-    
-    // Check source file/folder permissions
-    TUint attr;
-    User::LeaveIfError( iFs.Att( aSource, attr ) );
-    if ( !aUseCopyCommand && (attr & KEntryAttReadOnly || attr & KEntryAttSystem ) )
-        {
-        LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : no permissions, abort" );
-        User::Leave(  KErrAccessDenied );
-        }
-    
-    HBufC* sourceFolderBuf = HBufC::NewLC( KMaxFileName );
-    TPtr sourceFolder = sourceFolderBuf->Des();
-    HBufC* targetFolderBuf = HBufC::NewLC( KMaxFileName );
-    TPtr targetFolder = targetFolderBuf->Des();
-    
-    sourceFolder.Copy( BaflUtils::DriveAndPathFromFullName(aSource) );
-    targetFolder.Copy( BaflUtils::DriveAndPathFromFullName(aTarget) );
-    
-    
-    // check disk space
-    TInt driveNumber;
-    
-    User::LeaveIfError( iFs.CharToDrive(targetFolder[0], driveNumber) );
-    
-    TVolumeInfo volumeInfo;
-    TInt err = iFs.Volume(volumeInfo, driveNumber);
-    if( err != KErrNone )
-        {
-        LOGGER_WRITE_1( "CSConFsHandler::DoCopyOrMoveFileL : iFs.Volume err %d", err );
-        User::Leave( KErrNotFound );
-        }
-    
-    if( !isFolder )
-        {
-        // file handling routines
-        if( !IsFolderVisible( aSource ) )
-            {
-            LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : Current folder doesn't exist" );
-            User::Leave( KErrNotFound );
-            }
-        else if( !aUseCopyCommand && IsFolderReadOnly( sourceFolder ) )
-            {
-            LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : folder read only, abort" );
-            User::Leave( KErrAccessDenied );
-            }
-            
-        // source file is ok, check target
-
-        if( !IsFolderVisible( targetFolder ) )
-            {
-            LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : Current target file/folder doesn't exist" );
-            User::Leave( KErrNotFound );
-            }
-        else if( IsFolderReadOnly( targetFolder ) )
-            {
-            LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : folder read only, abort" );
-            User::Leave( KErrAccessDenied );
-            }
-        else
-            {
-            TBool diskFull( EFalse );
-            TEntry fileEntry;
-            User::LeaveIfError( iFs.Entry( aSource, fileEntry ) );
-            if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, fileEntry.iSize, driveNumber ) )
-                {
-                diskFull = ETrue;
-                }
-            
-            // target ok, ready to copy or move
-            CFileMan* fileMan=CFileMan::NewL(iFs);
-            CleanupStack::PushL(fileMan);
-            
-            if( aUseCopyCommand )
-                {
-                if( diskFull )
-                    {
-                    LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : disk full" );
-                    User::Leave( KErrDiskFull );
-                    }
-                LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : Copy file" );
-                User::LeaveIfError( fileMan->Copy( aSource, aTarget, 0 ) );
-                }
-            else
-                {
-                if( aSource.Find( aTarget.Left(2) ) == KErrNone)
-                    {
-                    // same drive
-                    LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : Rename file" );
-                    User::LeaveIfError( fileMan->Rename( aSource, aTarget, 0 ) );
-                    }
-                else
-                    {
-                    // different drive
-                    if( diskFull )
-                        {
-                        LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : disk full" );
-                        User::Leave( KErrDiskFull );
-                        }
-                    LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : copy file" );
-                    User::LeaveIfError( fileMan->Copy( aSource, aTarget, 0 ) );
-
-                    LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : delete original" );
-                    User::LeaveIfError( fileMan->Delete( aSource, 0 ) );
-                    }
-                }
-            CleanupStack::PopAndDestroy( fileMan ); // fileMan
-            }
-        }
-    else
-        {
-        // set trailing backslash after the final directory name
-        HBufC* tmpSourceBuf = HBufC::NewLC( KMaxFileName );
-        TPtr tmpSourcePtr = tmpSourceBuf->Des();
-        HBufC* tmpTargetBuf = HBufC::NewLC( KMaxFileName );
-        TPtr tmpTargetPtr = tmpTargetBuf->Des();
-        
-        tmpSourcePtr.Copy( aSource );
-        if( tmpSourcePtr.LocateReverse( KPathDelimiter ) != tmpSourcePtr.Length()-1 )
-            {
-            tmpSourcePtr.Append( KPathDelimiter );
-            }
-
-        tmpTargetPtr.Copy( aTarget );
-        if( tmpTargetPtr.LocateReverse( KPathDelimiter ) != tmpTargetPtr.Length()-1 )
-            {
-            tmpTargetPtr.Append( KPathDelimiter );
-            }
-        
-        if( !IsFolderVisible( tmpSourcePtr ) )
-            {
-            LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : Current folder doesn't exist" );
-            User::Leave( KErrNotFound );
-            }
-        else if( !aUseCopyCommand && IsFolderReadOnly( sourceFolder ) )
-            {
-            LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : sourcefolder read only, abort" );
-            User::Leave( KErrAccessDenied );
-            }
-        else if( !aUseCopyCommand && !IsFolderDeletable( tmpSourcePtr ) )
-            {
-            LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : source folder read only, abort" );
-            User::Leave( KErrAccessDenied );
-            }
-        else if( !IsFolderVisible( targetFolder ) )
-            {
-            LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : Current target base-folder doesn't exist" );
-            User::Leave( KErrNotFound );
-            }
-        else if( IsFolderReadOnly( targetFolder) )
-            {
-            LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : target folder read only, abort" );
-            User::Leave( KErrAccessDenied );
-            }
-        else if( BaflUtils::FolderExists(iFs, tmpTargetPtr ) )
-            {
-            LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : target folder exist, abort" );
-            User::Leave( KErrAlreadyExists );
-            }
-        else if ( tmpTargetPtr.Find( tmpSourcePtr ) == KErrNone )
-            {
-            LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : conflict, abort" );
-            User::Leave( KErrInUse );
-            }
-        else
-            {
-            // is folder empty
-            TBool emptyFolder( ETrue );
-            CDir *entryList = 0;
-            CDir *dirList = 0;
-
-            User::LeaveIfError( iFs.GetDir( tmpSourcePtr, KEntryAttNormal, EDirsAnyOrder, 
-            entryList, dirList ) );
-            if( entryList->Count() > 0 || dirList->Count() > 0 )
-                {
-                emptyFolder = EFalse;
-                }
-                
-            delete entryList;
-            delete dirList;
-            
-            // get folder size
-            TBool diskFull( EFalse );
-            if( !emptyFolder )
-                {
-                TInt64 folderSize = GetFolderSizeL(tmpSourcePtr);
-                LOGGER_WRITE_1( "CSConFsHandler::DoCopyOrMoveFileL : folderSize: %d", folderSize );
-                if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, folderSize, driveNumber ) )
-                    {
-                    diskFull = ETrue;
-                    }
-                }
-            
-            
-            CFileMan* fileMan = CFileMan::NewL(iFs);
-            CleanupStack::PushL(fileMan);
-    
-            // ready to copy or move
-            if( aUseCopyCommand )
-                {
-                LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : Copy folder" );
-                if( emptyFolder )
-                    {
-                    // folder is empty, can't copy folder. Create new empty folder.
-                    User::LeaveIfError( iFs.MkDir( tmpTargetPtr ) );
-                    }
-                else
-                    {
-                    // folder not empty
-                    if( diskFull )
-                        {
-                        LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : disk full" );
-                        User::Leave( KErrDiskFull );
-                        }
-                    
-                    User::LeaveIfError( 
-                     fileMan->Copy( aSource, aTarget, CFileMan::ERecurse ) ); 
-                    if( lastError == KErrNone )
-                        {
-                        lastError = fileMan->GetLastError();
-                        }
-                    }
-                
-                TUint attr;
-                TInt err = iFs.Att( tmpSourcePtr, attr );
-                if ( err == KErrNone && (attr & KEntryAttReadOnly ) )
-                    {
-                    //set read only attribute
-                    err = iFs.SetAtt( tmpTargetPtr, KEntryAttReadOnly, KEntryAttArchive );
-                    if (err != KErrNone)
-                        {
-                        // can't set attribute
-                        LOGGER_WRITE_1( "CSConFsHandler::DoCopyOrMoveFileL : iFs.SetAtt err: %d",err );
-                        }
-                    }
-                }
-            else
-                {
-                if( aSource.FindF( aTarget.Left(2) ) == KErrNone)
-                    {
-                    // same drive
-                    LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : Rename folder" );
-                    User::LeaveIfError( fileMan->Rename( aSource, aTarget, 0 ) );
-                    }
-                else
-                    {
-                    // different drive
-                    if( diskFull )
-                        {
-                        LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : disk full" );
-                        User::Leave( KErrDiskFull );
-                        }
-                    
-                    LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : Copy folder" );
-                    if( emptyFolder )
-                        {
-                        // folder is empty, can't copy empty folder. Create empty folder.
-                        User::LeaveIfError( iFs.MkDir( tmpTargetPtr ) );
-                        }
-                    else
-                        {
-                        User::LeaveIfError( 
-                         fileMan->Copy( aSource, aTarget, CFileMan::ERecurse ) );
-                        }
-                    // copy completed, delete original folder.
-                    LOGGER_WRITE( "CSConFsHandler::DoCopyOrMoveFileL : delete original" );
-                    User::LeaveIfError( fileMan->RmDir( tmpSourcePtr ) );
-                    // check was delete operation succesfully completed
-                    if( BaflUtils::PathExists( iFs, tmpSourcePtr ) )
-                        {
-                        // Folder still exist, return error
-                        lastError = KErrAccessDenied;
-                        }
-                    }
-                }
-            CleanupStack::PopAndDestroy(fileMan); // fileMan
-            }
-        CleanupStack::PopAndDestroy(tmpTargetBuf); // tmpTargetBuf
-        CleanupStack::PopAndDestroy(tmpSourceBuf); // tmpSourceBuf
-        }
-    
-    CleanupStack::PopAndDestroy( targetFolderBuf );
-    CleanupStack::PopAndDestroy( sourceFolderBuf );
-    
-    if( lastError != KErrNone )
-        {
-        LOGGER_WRITE_1( "CSConFTP::DoCopyOrMoveFileL() : lastError: %d", lastError );
-        User::Leave( lastError );
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::IsFolderVisible()
-// Check if folder can be showed
-// -----------------------------------------------------------------------------
-//
-TBool CSConFsHandler::IsFolderVisible( const TDesC& aFullPath )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aFullPath: %S", &aFullPath );
-    TBool visible(EFalse);
-    
-    if( !BaflUtils::FolderExists( iFs, aFullPath ) )
-        {
-        LOGGER_WRITE( "CSConFsHandler::IsFolderVisible() notExist ret EFalse" );
-        return EFalse;
-        }
-    
-    // don't show if folder is exluded
-    visible = !IsExludedPath( aFullPath );
-    LOGGER_WRITE_1( "CSConFsHandler::IsFolderVisible() : end, ret %d", (TInt)visible );
-    return visible;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFsHandler::IsFolderReadOnly()
-// Check if folder is read only (system folder)
-// -----------------------------------------------------------------------------
-//
-TBool CSConFsHandler::IsFolderReadOnly( const TDesC& aFullPath ) const
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aFullPath: %S", &aFullPath );
-    TBool readOnly(EFalse);
-    
-    // C-drive root is read only, but there are some exceptions
-    
-    readOnly = IsExludedPath( aFullPath );
-    
-    if ( aFullPath.CompareF( K_C_ROOT ) == 0 )
-        {
-        // Root of C-drive is read-only
-		LOGGER_WRITE("Root of C-Drive is read only");
-        readOnly = ETrue;
-        }
-    
-    // Check folder permissions
-    TUint attr;
-    TInt err = iFs.Att( aFullPath, attr );
-    LOGGER_WRITE_1("iFs.Att err: %d", err);
-    if ( err == KErrNone && (attr & KEntryAttReadOnly || attr & KEntryAttSystem ) )
-        {
-        LOGGER_WRITE("Folder is readonly");
-        readOnly = ETrue;
-        }
-    
-    LOGGER_WRITE_1( "CSConFsHandler::IsFolderReadOnly() : end, ret %d", (TInt)readOnly );
-    return readOnly;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFsHandler::IsFolderDeletable()
-// Check if folder can be deleted. Localized folders cannot delete.
-// In C-drive folders can be deleted only from under C:\\Data\\
-// -----------------------------------------------------------------------------
-//
-TBool CSConFsHandler::IsFolderDeletable( const TDesC& aFullPath ) const
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aFullPath: %S", &aFullPath );
-    TBool deleteAllowed(ETrue);
-    TPath PhoneMem( PathInfo::PhoneMemoryRootPath() ); // "C:\\Data\\"
-
-    if ( aFullPath.CompareF( PhoneMem ) == 0 )
-        {
-        // C:\\Data\\
-        LOGGER_WRITE( "CSConFsHandler::IsFolderDeletable() datapath, ret EFalse" );
-        deleteAllowed = EFalse;
-        }
-    else if ( IsExludedPath( aFullPath ) )
-        {
-        deleteAllowed = EFalse;
-        }
-    
-    iLocalizer->SetFullPath( aFullPath );
-    if ( iLocalizer->IsLocalized() ) // delete disabled
-        {
-        // Cannot delete localized paths (default paths)
-        deleteAllowed = EFalse;
-        }
-    
-    LOGGER_WRITE_1( "CSConFsHandler::IsFolderDeletable() : end, ret %d", (TInt)deleteAllowed );
-    return deleteAllowed;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::GetParentFolder( const TPtrC aFullPath, TDes& aParent)
-// Get parent folder
-// -----------------------------------------------------------------------------
-//
-TInt CSConFsHandler::GetParentFolder( const TDesC& aFullPath, TDes& aParent)
-    {
-    TRACE_FUNC_ENTRY;
-    if (aFullPath.LocateReverse(KPathDelimiter) == aFullPath.Length()-1 )
-        {
-        // remove backlash
-        aParent.Copy(aFullPath.Left(aFullPath.Length()-1));
-        }
-    else
-        {
-        aParent.Copy(aFullPath);
-        }
-    
-    TInt pos = aParent.LocateReverse(KPathDelimiter);
-    if (pos != KErrNotFound)
-        {
-        aParent.Copy(aParent.Left(pos+1));
-        LOGGER_WRITE( "CSConFsHandler::GetParentFolder : end KErrNone" );
-        return KErrNone;
-        }
-    else
-        {
-        LOGGER_WRITE_1( "CSConFsHandler::GetParentFolder : end err %d", pos);
-        return pos;
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFsHandler::CSConFsHandler()
-// Constructor
-// -----------------------------------------------------------------------------
-//
-CSConFsHandler::CSConFsHandler( RFs& aFs ) : iFs(aFs)
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CSConFsHandler::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    iLocalizer = CDirectoryLocalizer::NewL();
-    
-    GetDataPathNameL();
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFsHandler::GetDataPathNameL()
-// Updates the name of the data folder from a localized string
-// -----------------------------------------------------------------------------
-//
-void CSConFsHandler::GetDataPathNameL()
-    {
-    TRACE_FUNC_ENTRY;
-    //Read memory string and convert it
-    TFileName file( KSConResourceName );
-    
-    BaflUtils::NearestLanguageFile( iFs, file );
-       
-    CStringResourceReader* reader = CStringResourceReader::NewL( file );
-    CleanupStack::PushL( reader );
-    
-    CnvUtfConverter::ConvertFromUnicodeToUtf8( iDataPathName, 
-        reader->ReadResourceString( R_SECON_DATA_FOLDER ) );
-    
-    CleanupStack::PopAndDestroy( reader );
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFsHandler::GetFolderSizeL()
-// Get folder (and subfolders) size
-// -----------------------------------------------------------------------------
-//
-TInt64 CSConFsHandler::GetFolderSizeL( const TDesC& aFullPath )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aFullPath: %S", &aFullPath );
-    TInt64 totalSize(0);
-    CDir* dir( NULL );
-    
-    User::LeaveIfError( iFs.GetDir(aFullPath, KEntryAttMatchMask, ESortByName, dir) );
-    CleanupStack::PushL(dir);
-    for( TInt i=0; i<dir->Count(); ++i )
-        {
-        TEntry entry = (*dir)[i];
-        if( !entry.IsDir() )
-            {
-            // file
-            totalSize += entry.iSize;
-            }
-        else
-            {
-            // folder
-            HBufC* subfolderBuf = HBufC::NewLC( KMaxPath );
-            TPtr subfolderPtr = subfolderBuf->Des();
-            
-            subfolderPtr.Copy(aFullPath);
-            subfolderPtr.Append(entry.iName);
-            subfolderPtr.Append( KPathDelimiter );
-            
-            LOGGER_WRITE( "CSConFsHandler::GetFolderSizeL() : get subfolder size" );
-            totalSize += GetFolderSizeL( subfolderPtr );
-            CleanupStack::PopAndDestroy( subfolderBuf );
-            }
-        }
-    CleanupStack::PopAndDestroy(dir);
-    TRACE_FUNC_EXIT;
-    return totalSize;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::ReplaceSpecialChars()
-// Replace special characters to xml compliant
-// -----------------------------------------------------------------------------
-//
-void CSConFsHandler::ReplaceSpecialChars( TDes8& aDes )
-    {
-    for( TInt i = 0; i < aDes.Length(); i++ )
-        {
-        switch( aDes[i] )
-            {
-            case '&':
-                aDes.Delete( i, 1 );
-                aDes.Insert( i, KReplace1 );
-                break;
-            case '<':
-                aDes.Delete( i, 1 );
-                aDes.Insert( i, KReplace2 );
-                break;
-            case '>':
-                aDes.Delete( i, 1 );
-                aDes.Insert( i, KReplace3 );
-                break;
-            case '"':
-                aDes.Delete( i, 1 );
-                aDes.Insert( i, KReplace4 );
-                break;
-            case '\'':
-                aDes.Delete( i, 1 );
-                aDes.Insert( i, KReplace5 );
-                break;
-            default:
-                break;
-            }
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFsHandler::IsExludedPath()
-// Some folders are exluded from user access
-// -----------------------------------------------------------------------------
-//
-TBool CSConFsHandler::IsExludedPath( const TDesC& aFullPath ) const
-    {
-    TInt exluded(ETrue);
-    LOGGER_WRITE_1( "aFullPath: %S", &aFullPath );
-    TPath mmcRoot( PathInfo::MemoryCardRootPath() );
-    if ( aFullPath.Length() == KDriveLength )
-        {
-        // root paths not exluded
-        exluded = EFalse;
-        }
-    else if ( aFullPath.FindF( K_C_ROOT ) == 0 )
-        {
-        if ( aFullPath.FindF( PathInfo::PhoneMemoryRootPath() ) == 0 )
-            {
-            // C:\\Data is visible, not exluded
-            exluded = EFalse;
-            }
-#ifdef SCON_SHOW_LOGS_FOLDER
-        else if ( aFullPath.FindF( KSConLogsPath ) == KDriveLength )
-            {
-            // C:\\Logs is visible, not exluded
-            exluded = EFalse;
-            }
-#endif
-        else {
-            // other paths on C-drive are exluded
-            LOGGER_WRITE_1("CSConFsHandler::IsExludedPath() Path '%S' is not visible to user", &aFullPath);
-            exluded = ETrue;
-            }
-        }
-    // hide undesired folders from E: root level
-    else if( aFullPath.CompareF( mmcRoot ) == 0 )
-        {
-        if ( aFullPath.FindF( KSConSys ) == KDriveLength )
-            {
-            LOGGER_WRITE( "hiding mmcRoot KSConSys" );
-            exluded = ETrue;
-            }
-        else if( aFullPath.FindF( KSConResource ) == KDriveLength )
-            {
-            LOGGER_WRITE( "hiding mmcRoot KSConResource" );
-            exluded = ETrue;
-            }
-        else if( aFullPath.FindF( KSConPrivate ) == KDriveLength )
-            {
-            LOGGER_WRITE( "mmcRoot KSConPrivate" );
-            exluded = ETrue;
-            }
-        else if( aFullPath.FindF( KSConSystem ) == KDriveLength )
-            {
-            LOGGER_WRITE( "hiding mmcRoot KSConSystem" );
-            exluded = ETrue;
-            }
-        }
-    // end of E: root level handling
-    else
-        {
-        // don't exlude paths from other drives
-        exluded = EFalse;
-        }
-    return exluded;
-    }
-
-// End of file
-
-
--- a/connectivitymodules/SeCon/services/ftp/src/sconftp.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1588 +0,0 @@
-/*
-* Copyright (c) 2005-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:  File Transfer Controller implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <pathinfo.h>
-#include <stringresourcereader.h>
-#include <bautils.h>
-#include <driveinfo.h>
-#include <sconftp.rsg>
-#include <centralrepository.h>
-#include <sysutildomaincrkeys.h>
-
-#include "debug.h" 
-#include "sconftp.h"
-#include "sconfshandler.h"
-#include "sconinboxhandler.h"
-#include "sconconsts.h"
-
-const TInt KPackageSize = 65536;
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-
-// -----------------------------------------------------------------------------
-// CreateCSConFTPL()
-// Entry to CSConFTP
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CSConFTP* CreateCSConFTPL()
-    {
-    TRACE_FUNC;
-    return CSConFTP::NewL();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::NewL()
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CSConFTP* CSConFTP::NewL()
-    {
-    TRACE_FUNC_ENTRY;
-    CSConFTP* self = new (ELeave) CSConFTP();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::~CSConFTP()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConFTP::~CSConFTP()
-    {
-    TRACE_FUNC_ENTRY;
-    delete iSConInboxHandler;
-    iSConInboxHandler = NULL;
-    delete iSConFsHandler;
-    iSConFsHandler = NULL;
-    delete iBuffer;
-    iBuffer = NULL;
-
-    iFs.Delete( iTempFileName );
-    iFs.Close();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::GetFolderObjectL( CObexBufObject*& aObjectList )
-// Gets object that contains folder listing from inbox or file system
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::GetFolderObjectL( CObexBufObject*& aObjectList )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TInt ret( KErrNone );
-    TInt offset = 0;
-    TChar driveLetter;
-    TBuf8<KSConDriveNameLength> tmpBuf8;
-    
-    iBuffer->Reset();
-    
-    //default folder list - lists all available drives, inbox
-    if( iPathName.Length() == 0 )
-        {
-        TInt devDriveCount = 0;
-        TInt mmcDriveCount = 0;
-        
-        iBuffer->ResizeL( KSConXmlDocBegin().Length() );
-        iBuffer->Write( offset, KSConXmlDocBegin );
-        offset += KSConXmlDocBegin().Length();
-        
-        //Write all drivers to folderlisting object
-        TDriveList driveList;
-        // Get all drives that are visible to the user.
-        TInt driveCount;
-        User::LeaveIfError( DriveInfo::GetUserVisibleDrives( iFs, driveList, driveCount ) );
-        
-        for( TInt i = EDriveA; i < KMaxDrives; i++ )
-            {
-            if( driveList[i] )
-                {
-                TUint driveStatus;
-                User::LeaveIfError( DriveInfo::GetDriveStatus( iFs, i, driveStatus ) );
-                LOGGER_WRITE_1( "DriveInfo for drive: %d", i);
-
-                if( !(driveStatus & DriveInfo::EDrivePresent )
-                    || driveStatus & DriveInfo::EDriveCorrupt
-                    || (driveStatus & DriveInfo::EDriveRemote) )
-                    {
-                    LOGGER_WRITE_1( "skip drive %d", i);
-                    continue;
-                    }
-                
-                User::LeaveIfError( iFs.DriveToChar( i, driveLetter ) );
-                
-                //Letter to uppercase form.
-                driveLetter.UpperCase();
-                
-                //Folder begin
-                iBuffer->ExpandL( offset, 
-                KSConXmlFolderNameBegin().Length() );
-                iBuffer->Write( offset, KSConXmlFolderNameBegin );
-                offset += KSConXmlFolderNameBegin().Length();
-                
-                iBuffer->ExpandL( offset, KSConDriveCName().Length() );
-                
-                tmpBuf8.Delete( 0, tmpBuf8.Length() );
-                tmpBuf8.Append( driveLetter );
-                tmpBuf8.Append( KDriveDelimiter );
-                
-                iBuffer->Write( offset, tmpBuf8 );
-                offset += KSConDriveNameLength;
-                
-                //permission
-                iBuffer->ExpandL( offset, 
-                KSConXmlUserAttributes().Length() );
-                iBuffer->Write( offset, KSConXmlUserAttributes );
-                offset += KSConXmlUserAttributes().Length();
-                if( driveStatus & DriveInfo::EDriveInternal && devDriveCount==0 )
-                    {
-                    //permission always R for first internal drive
-                    iBuffer->ExpandL( offset, 
-                    KSConXmlUserEntryReadOnly().Length() );
-                    iBuffer->Write( offset, KSConXmlUserEntryReadOnly );
-                    offset += KSConXmlUserEntryReadOnly().Length();
-                    }
-                else
-                    {
-                    //permission always RW
-                    iBuffer->ExpandL( offset, 
-                    KSConXmlUserEntryDrive().Length() );
-                    iBuffer->Write( offset, KSConXmlUserEntryDrive );
-                    offset += KSConXmlUserEntryDrive().Length();
-                    }
-                
-                //memory type
-                iBuffer->ExpandL( offset, 
-                KSConXmlMemoryType().Length() );
-                iBuffer->Write( offset, KSConXmlMemoryType );
-                offset += KSConXmlMemoryType().Length();
-                if( driveStatus & DriveInfo::EDriveInternal )
-                    {
-                    LOGGER_WRITE( "DriveInfo::EDriveInternal" );
-                    // DEV type
-                    devDriveCount++;
-                    if( devDriveCount > 1 )
-                        {
-                        // DEV2
-                        TBuf8<KSConMemTypeMaxLength> memType;
-                        memType.Copy( KSConMemoryTypeDev );
-                        memType.AppendNum(devDriveCount);
-                        iBuffer->ExpandL( offset, memType.Length() );
-                        iBuffer->Write( offset, memType );
-                        offset += memType.Length();
-                        }
-                    else
-                        {
-                        // DEV
-                        iBuffer->ExpandL( offset, 
-                        KSConMemoryTypeDev().Length() );
-                        iBuffer->Write( offset, KSConMemoryTypeDev );
-                        offset += KSConMemoryTypeDev().Length();
-                        }
-                    }
-                if( driveStatus & DriveInfo::EDriveRemovable )
-                    {
-                    LOGGER_WRITE( "DriveInfo::EDriveRemovable" );
-                    // MMC type
-                    mmcDriveCount++;
-                    if( mmcDriveCount > 1 )
-                        {
-                        // MMC2
-                        TBuf8<KSConMemTypeMaxLength> memType;
-                        memType.Copy( KSConMemoryTypeMmc );
-                        memType.AppendNum(mmcDriveCount);
-                        iBuffer->ExpandL( offset, memType.Length() );
-                        iBuffer->Write( offset, memType );
-                        offset += memType.Length();
-                        }
-                    else
-                        {
-                        // MMC
-                        iBuffer->ExpandL( offset, 
-                        KSConMemoryTypeMmc().Length() );
-                        iBuffer->Write( offset, KSConMemoryTypeMmc );
-                        offset += KSConMemoryTypeMmc().Length();
-                        }
-                    }
-                
-                //memory label
-                iBuffer->ExpandL( offset, 
-                KSConXmlMemoryLabel().Length() );
-                iBuffer->Write( offset, KSConXmlMemoryLabel );
-                offset += KSConXmlMemoryLabel().Length();
-                
-                TInt err( KErrNotFound );
-                TBuf8<KMaxFileName> volumeName;
-                if( driveStatus & DriveInfo::EDriveRemovable || devDriveCount == 1 )
-                    {
-                    // get Volume name for C-drive(Phone) and E-drive(MMC)
-                    err = GetVolumeNameL( i, volumeName );
-                    }
-                else
-                    {
-                    // Get localized name for DEV2 (Mass memory)
-                    //Read memory string and convert it
-                    TFileName file( KSConResourceName );
-                    
-                    BaflUtils::NearestLanguageFile( iFs, file );
-                    
-                    CStringResourceReader* reader = CStringResourceReader::NewL( file );
-                    
-                    CnvUtfConverter::ConvertFromUnicodeToUtf8( volumeName, 
-                        reader->ReadResourceString( R_SECON_VALUE_MASS_STORAGE ) );
-                    
-                    delete reader;
-                    err = KErrNone;
-                    }
-                
-                if ( err == KErrNone )
-                    {
-                    iBuffer->ExpandL( offset, 
-                    volumeName.Length() );
-                    iBuffer->Write( offset, volumeName );
-                    offset += volumeName.Length();
-                    }
-                
-                //Write the end of filelist to folderlisting object
-                iBuffer->ExpandL( offset, KSConXmlFileEnd().Length() );
-                iBuffer->Write( offset, KSConXmlFileEnd );
-                offset += KSConXmlFileEnd().Length();
-                }
-            }
-        //Write the end of folderlist to folderlisting object
-        iBuffer->ExpandL( offset, KSConXmlFolderListEnd().Length() );
-        iBuffer->Write( offset, KSConXmlFolderListEnd );
-        iBuffer->Compress();
-        }
-    else
-        {
-        if( IsCurrentVolumeOK() )
-            {
-            ret = iSConFsHandler->ParseFolderListL( iBuffer, iPathName, iCurrentDriveTypeNumber );
-            }
-        else
-            {
-            ret = KErrNotFound;
-            }
-        }
-    
-    //Put data to aObjectList
-    delete aObjectList;
-    aObjectList = NULL;
-    
-    aObjectList = CObexBufObject::NewL( iBuffer );
-    aObjectList->SetTypeL( KSConFolderListType );
-    aObjectList->SetLengthL( iBuffer->Size() );
-    
-    LOGGER_WRITE_1( "CSConFTP::GetFolderObjectL( CObexBufObject*& aObjectList ) : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::GetFileObjectL( CObexFileObject*& aFileObject )
-// Gets object that contains a file from file system
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::GetFileObjectL( CObexFileObject*& aFileObject )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TInt ret( KErrNone );
-    
-    if( aFileObject->Name().Length() == 0 )
-        {
-        return KErrBadName;
-        }
-    
-    // check is current drive ok
-    if( iPathName.Length() > 0 )
-        {
-        TPath path( KSConAllowedPath );
-        path.Append( KPathDelimiter );
-        if( iPathName.CompareF( path ) != 0 )
-            {
-            // was normal path (not KSConAllowedPath)
-            if( !IsCurrentVolumeOK() )
-                {
-                return KErrNotFound;
-                }
-            }
-        }
-    
-    HBufC* nameBuf = HBufC::NewLC( KMaxFileName );
-    TPtr namePtr = nameBuf->Des();
-    namePtr.Append( aFileObject->Name() );
-    
-    if( namePtr.LocateReverse( KPathDelimiter ) == namePtr.Length()-1 )
-        {
-        namePtr.Delete( namePtr.Length()-1, 1 );
-        }
-    
-    ret = iSConFsHandler->GetFileObjectL( aFileObject, iPathName, namePtr );
-    
-    CleanupStack::PopAndDestroy( nameBuf );
-    
-    LOGGER_WRITE_1( "CSConFTP::GetFileObjectL() : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::PutFileObjectInitL( CObexBufObject*& aObject, 
-//                                  CBufFlat*& aBuffer )
-// Initializes the receiving from the client.
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::PutFileObjectInitL( CObexBufObject*& aObject, 
-                                    CBufFlat*& aBuffer )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    
-    RFile file;
-    
-    TBool lowMemory = IsCurrentDiskSpaceBelowCritical();
-    
-    //if Inbox then save temp file to default drive
-    if( iPathName.Length() == 0 )
-        {
-        //When proprietary profile (PC Suite), doesn't allow to use Inbox
-        if( iProfile == EProprietary )
-            {
-            LOGGER_WRITE( "CSConFTP::PutFileObjectInitL() : iProfile EProprietary" );
-            ret = file.Temp( iFs, PathInfo::PhoneMemoryRootPath(), iTempFileName,
-            EFileWrite | EFileShareExclusive );
-            file.Close();
-
-            if( ret == KErrNone )
-                {
-                CreateObexBufObjectL( aObject, aBuffer );
-                }
-            }
-        else
-            {
-            LOGGER_WRITE( "CSConFTP::PutFileObjectInitL() : not EProprietary" );
-            if( lowMemory )
-                {
-                // do not even try to save
-                LOGGER_WRITE( "CSConFTP::PutFileObjectInitL() : disk full" );
-                ret = KErrNoMemory;
-                }
-            else
-                {
-                ret = iSConInboxHandler->CreateInboxAttachmentL( aObject, aBuffer );
-                }
-            }
-        
-        return ret;
-        }
-    else
-        {
-        LOGGER_WRITE_1("iPathName: %S", &iPathName);
-        // check is current drive ok 
-        if( !IsCurrentVolumeOK() )
-            {
-            LOGGER_WRITE( "CSConFTP::PutFileObjectInitL() : drive not visible" );
-            ret = KErrNotFound;
-            }
-        else
-            {
-            ret = file.Temp( iFs, iPathName, iTempFileName, EFileWrite | 
-            EFileShareExclusive );
-            }
-        }
-    
-    file.Close();
-    
-    if( ret == KErrNone )
-        {
-        CreateObexBufObjectL( aObject, aBuffer );
-        
-        if( lowMemory )
-            {
-            // return error. it's up to pccon/ftp plugin howto handle it..
-            LOGGER_WRITE( "CSConFTP::PutFileObjectInitL() : low memory" );
-            ret = KErrNoMemory;
-            }
-        }
-    
-    LOGGER_WRITE_1( "CSConFTP::PutFileObjectInitL( CObexBufObject*& aObject, CBufFlat*& aBuffer ) : returned %d", ret );
-    return ret;
-    }
-
-void CSConFTP::CreateObexBufObjectL( CObexBufObject*& aObject, CBufFlat*& aBuffer )
-    {
-    delete aObject;
-    aObject = NULL;
-    aObject = CObexBufObject::NewL( NULL );
-    
-    delete aBuffer;
-    aBuffer = NULL;
-    
-    aBuffer = CBufFlat::NewL( KSConBufferSize );
-    aBuffer->ResizeL( KSConBufferSize );
-    
-    TObexFilenameBackedBuffer bufferdetails( *aBuffer, iTempFileName, 
-                    CObexBufObject::EDoubleBuffering );
-    TRAPD( err, aObject->SetDataBufL( bufferdetails ));
-    if ( err == KErrNoMemory )
-        {
-        LOGGER_WRITE( "KErrNoMemory, Using singe buffer strategy");
-        // If fails, use singe buffer strategy to save RAM
-        TObexFilenameBackedBuffer lowMemBufferdetails( *aBuffer, iTempFileName, 
-                    CObexBufObject::ESingleBuffering );
-        aObject->SetDataBufL( lowMemBufferdetails );
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::PutFileObjectFinalizeL( CObexBufObject*& aObject )
-// Stores the relayed file object to inbox or file system.
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::PutFileObjectFinalizeL( CObexBufObject*& aObject )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    
-    // if iPathName is not defined trying to save to inbox, no need to call IsCurrentVolumeOK()
-    if( iPathName.Length() > 0 && !IsCurrentVolumeOK() )
-        {
-        // Memory card removed
-        LOGGER_WRITE( "CSConFTP::PutFileObjectFinalizeL() : disk err, return KErrNotFound" );
-        return KErrNotFound;
-        }
-    else if ( iPathName.Length() + aObject->Name().Length() > KMaxFileName )
-        {
-        LOGGER_WRITE( "CSConFTP::PutFileObjectFinalizeL() : Too long filename, return KErrBadName");
-        return KErrBadName;
-        }
-        
-    TBool lowMemory = IsCurrentDiskSpaceBelowCritical();
-    if ( lowMemory )
-        {
-        LOGGER_WRITE( "CSConFTP::PutFileObjectFinalizeL() : Low memory, return KErrNoMemory");
-        return KErrNoMemory;
-        }
-    
-    HBufC* fullPathBuf = HBufC::NewLC( KMaxFileName );
-    TPtr fullPathPtr = fullPathBuf->Des();
-    fullPathPtr.Copy( iPathName );
-    fullPathPtr.Append( aObject->Name() );
-    
-    // Save to inbox if path is not set.
-    if( iPathName.Length() == 0 )
-        {
-        LOGGER_WRITE( "CSConFTP::PutFileObjectFinalizeL before SaveObjectToInbox" );
-        ret = iSConInboxHandler->SaveObjToInboxL( aObject );
-        LOGGER_WRITE_1( "CSConFTP::PutFileObjectFinalize SaveObjectToInbox returned %d", ret );
-        }
-    else if( iPathName.CompareF( K_C_ROOT ) == 0 )
-        {
-        // Saving to root of C:\ is not allowed
-        ret = KErrAccessDenied;
-        }
-    //Save to file system
-    else
-        {
-        TTime time = aObject->Time();
-    
-        // UTC offset   
-        time -= User::UTCOffset();      
-        
-        delete aObject;
-        aObject = NULL;
-            
-        ret = iSConFsHandler->SaveFileObjectL( fullPathPtr, time, 
-        iTempFileName );
-        }
-
-    CleanupStack::PopAndDestroy( fullPathBuf );
-    
-    LOGGER_WRITE_1( "CSConFTP::PutFileObjectFinalizeL( CObexBufObject*& aObject ) : returned %d", ret );
-    
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::SetPathL( const TPtrC aPath, const TUint8 aFlags )
-// Changes the current path. The path can point to inbox or file system
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::SetPathL( const TPtrC aPath, const TUint8 aFlags )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aPath: %S", &aPath );
-    TInt ret( KErrNone );
-
-    if( ( aPath.Length() > 0 && aFlags != KSConSetPathRoot )  
-        || ( iPathName.Length() == KDriveLength  && aFlags == KSConSetPathBack) ) 
-        {
-        // check is current drive ok
-        if( !IsCurrentVolumeOK() )
-            {
-            LOGGER_WRITE( "CSConFTP::SetPathL() : drive not found" );
-            return KErrNotFound;
-            }
-        }
-    
-    ret = KErrNotFound;
-    
-    //path forward, deny access to forbidden directories and drives
-    if( aPath.Length() > 0 
-        && ( iPathName.Length() + aPath.Length() < KMaxFileName ) 
-        && ( aFlags == KSConSetPathForward || aFlags == KSConSetPathDontCreate ) )
-        {
-        ret = SetPathForwardL( aPath, aFlags );
-        }
-    //path backward
-    else if( aFlags == KSConSetPathBack )
-        {
-        ret = SetPathBackwardL( aPath );
-        }
-    //path root
-    else if( aPath.Length() == 0 && aFlags == KSConSetPathRoot )
-        {
-        LOGGER_WRITE( "CSConFTP::SetPathL() : KSConSetPathRoot" );
-        if( iPathName.Length() > 0 )
-            {
-            iPathName.Delete( 0, iPathName.Length() );
-            }
-        iCurrentDrive = KErrNotFound;
-        ret = KErrNone;
-        }
-    
-    if( ret == KErrNone )
-        {
-        // drive may have changed, update info
-        UpdateDriveTypeInfoL();
-        }
-    
-    LOGGER_WRITE_1( "CSConFTP::CSConFTP::SetPathL( const TPtrC aPath, const TUint8 aFlags ) : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::SetPathForwardL( const TPtrC aPath, const TUint8 aFlags )
-// Set path forward
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::SetPathForwardL( const TPtrC aPath, const TUint8 aFlags )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret(KErrNone);
-    HBufC* fullPath = HBufC::NewLC( KMaxFileName );
-    TPtr fullPathPtr = fullPath->Des();
-    
-    if( iPathName.Length() == 0 )
-        {
-        fullPathPtr.Copy( aPath );   
-        }
-    else
-        {
-        fullPathPtr.Copy( iPathName );
-        fullPathPtr.Append( aPath );
-        }
-    LOGGER_WRITE_1( "fullPathPtr: %S", &fullPathPtr );
-    // now fullpath is new path
-    // check validity
-    if( fullPathPtr.Length() < 2 || fullPathPtr[1] != KDriveDelimiter )
-        {
-        LOGGER_WRITE( "CSConFTP::SetPathForwardL() : not valid name" );
-        CleanupStack::PopAndDestroy( fullPath );
-        return KErrNotFound;
-        }
-    
-    if( fullPathPtr.CompareF( KSConAllowedPath ) == 0 )
-        {
-        // Always access to PC Suite configuration file on ROM
-        LOGGER_WRITE( "CSConFTP::SetPathForwardL() : KSConAllowedPath" );
-        iPathName.Copy( fullPathPtr );
-        if( iPathName[iPathName.Length()-1] != KPathDelimiter )
-            {
-            iPathName.Append( KPathDelimiter );
-            }
-        
-        CleanupStack::PopAndDestroy( fullPath );
-        return KErrNone;
-        }
-    
-    // check drive
-    TInt driveNumber;
-    TInt err = iFs.CharToDrive( fullPathPtr[0], driveNumber );
-    if( err != KErrNone || !IsDriveVisible( driveNumber ) )
-        {
-        LOGGER_WRITE( "CSConFTP::SetPathForwardL() : drive err" );
-        CleanupStack::PopAndDestroy( fullPath );
-        return KErrNotFound;
-        }
-    
-    // check folder and create it if needed
-    if( fullPathPtr.Length() > 2 )
-        {
-        TBool isFolder = EFalse;
-        err = BaflUtils::IsFolder( iFs, fullPathPtr, isFolder );
-        if( err != KErrNone )
-            {
-            isFolder = EFalse;
-            }
-        LOGGER_WRITE_1( "CSConFTP::SetPathForwardL() IsFolder: %d", (TInt)isFolder );
-        
-        if( !isFolder )
-            {
-            //if "Don't create" is 1
-            if( aFlags & 2 )
-                {
-                ret = KErrNotFound;
-                }
-            else
-                {
-                CreateFolderL( fullPathPtr );
-                ret = KErrNone;
-                }
-            }
-        else
-            {
-            ret = KErrNone;
-            }
-        }
-    else
-        {
-        ret = KErrNone;
-        }
-    
-    if( ret == KErrNone )
-        {
-        iPathName.Copy( fullPathPtr );
-        
-        if( iPathName[iPathName.Length()-1] != KPathDelimiter )
-            {
-            iPathName.Append( KPathDelimiter );
-            }
-        }
-    
-    CleanupStack::PopAndDestroy( fullPath );
-    LOGGER_WRITE_1( "CSConFTP::SetPathForwardL() : end, ret: %d", ret );
-    return ret;
-    
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::SetPathBackwardL( const TPtrC aPath )
-// Set path backward
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::SetPathBackwardL( const TPtrC aPath )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret(KErrNotFound);
-    if( iPathName.Length() == 0 )
-        {
-        // already in root, exit
-        LOGGER_WRITE( "CSConFTP::SetPathBackwardL() : already in root" );
-        LOGGER_WRITE_1( "CSConFTP::SetPathBackwardL() : end, ret: %d", ret );
-        return ret;
-        }
-    TInt pos;
-    TBool isFolder(EFalse);
-    HBufC* fullPath = HBufC::NewLC( KMaxFileName );
-    TPtr fullPathPtr = fullPath->Des();
-
-    //no directory/folder name
-    if( aPath.Length() == 0 )
-        {
-        LOGGER_WRITE( "CSConFTP::SetPathBackwardL() : no new path, goto parent" );
-        iPathName.Delete( iPathName.Length()-1, 1 );
-        pos = iPathName.LocateReverse( KPathDelimiter );
-        iPathName.Delete( pos+1, iPathName.Length()-pos );
-        ret = KErrNone;
-        }
-    //if folder name
-    else if( aPath.Locate( KDriveDelimiter ) != 1 && iPathName.Length() > KDriveLength  )
-        {
-        LOGGER_WRITE( "CSConFTP::SetPathBackwardL() : goto parent and new path" );                
-        fullPathPtr.Copy( iPathName );
-        fullPathPtr.Delete( fullPathPtr.Length()-1, 1 );
-        pos = fullPathPtr.LocateReverse( KPathDelimiter );
-        fullPathPtr.Delete( pos+1, fullPathPtr.Length()-pos );
-        fullPathPtr.Append( aPath );
-        
-        if( fullPathPtr.CompareF( KSConAllowedPath ) == 0 )
-            {
-            // Always access to PC Suite configuration file on ROM
-            isFolder = ETrue;
-            }
-        else
-            { 
-            TInt driveNumber;
-            TInt err = iFs.CharToDrive(fullPathPtr[0], driveNumber);
-            if( err != KErrNone )
-                {
-                LOGGER_WRITE( "CSConFTP::SetPathForwardL() : drive err" );
-                isFolder = EFalse;
-                }
-            else if( !IsDriveVisible(driveNumber) )
-                {
-                isFolder = EFalse;
-                }
-            else
-                {
-                // drive ok, check folder.
-                err = BaflUtils::IsFolder( iFs, fullPathPtr, isFolder );
-                if( err != KErrNone )
-                    {
-                    isFolder = EFalse;
-                    }
-                }
-            }
-
-        if( isFolder ) 
-            {
-            iPathName.Copy( fullPathPtr );
-
-            if( aPath.LocateReverse( KPathDelimiter ) != aPath.Length()-1 )
-                {
-                iPathName.Append( KPathDelimiter );
-                }
-
-            ret = KErrNone;
-            }
-        else
-            {
-            ret = KErrNotFound;
-            }
-        
-        }
-    //drive
-    else if( aPath.Locate( KDriveDelimiter ) == 1 )
-        {
-        fullPathPtr.Copy( aPath );
-        if( fullPathPtr.LocateReverse( KPathDelimiter ) 
-                    != fullPathPtr.Length()-1 )
-            {
-            fullPathPtr.Append( KPathDelimiter );
-            }
-        
-        TFileName tempPath( KSConAllowedPath );
-        tempPath.Append(KPathDelimiter);
-        if( fullPathPtr.CompareF( tempPath ) == 0 )
-            {
-            // Always access to PC Suite configuration file on ROM
-            isFolder = ETrue;
-            }
-        else
-            {
-            TInt driveNumber;
-            TInt err = iFs.CharToDrive(fullPathPtr[0], driveNumber);
-            if( err != KErrNone )
-                {
-                LOGGER_WRITE( "CSConFTP::SetPathForwardL() : drive err" );
-                isFolder = EFalse;
-                }
-            else if( !IsDriveVisible(driveNumber) )
-                {
-                isFolder = EFalse;
-                }
-            else
-                {
-                // drive ok, check folder.
-                err = BaflUtils::IsFolder( iFs, fullPathPtr, isFolder );
-                if( err != KErrNone )
-                    {
-                    isFolder = EFalse;
-                    }
-                }
-            }
-            
-        if( isFolder ) 
-            {
-            iPathName.Copy( fullPathPtr );
-            
-            if( aPath.LocateReverse( KPathDelimiter ) != aPath.Length()-1 )
-                {
-                iPathName.Append( KPathDelimiter );
-                }
-            
-            ret = KErrNone;
-            }
-        else
-            {
-            ret = KErrNotFound;
-            }               
-        }
-    CleanupStack::PopAndDestroy( fullPath );
-    LOGGER_WRITE_1( "CSConFTP::SetPathBackwardL() : end, ret: %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::CreateFolderL( const TPtrC aFolderName )
-// Creates a new folder to file system
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::CreateFolderL( const TPtrC aFolderName )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aFolderName: %S", &aFolderName );
-    TInt ret( KErrNone );
-    if( aFolderName.Length() == 0 )
-        {
-        return KErrArgument;
-        }
-    
-    HBufC*  pathBuf = HBufC::NewLC( KMaxFileName );
-    TPtr pathBufPtr = pathBuf->Des();
-    //absolute folder path
-    if( aFolderName.Length() > 1 && aFolderName[1] == KDriveDelimiter )
-        {
-        if ( iPathName.Length()>0 )
-            {
-            LOGGER_WRITE( "CSConFTP::CreateFolderL() : KErrBadName" );
-            CleanupStack::PopAndDestroy( pathBuf );
-            return KErrBadName;
-            }
-        pathBufPtr.Copy( aFolderName );
-        }
-    else
-        {
-        pathBufPtr.Copy( iPathName );
-        pathBufPtr.Append( aFolderName );
-        }
-    
-    if( !iFs.IsValidName( pathBufPtr ) )
-        {
-        ret = KErrBadName;
-        }
-    else
-        {
-        // check drive
-        TInt driveNumber;
-        ret = iFs.CharToDrive(pathBufPtr[0], driveNumber);
-        if( ret != KErrNone || !IsDriveVisible(driveNumber) )
-            {
-            LOGGER_WRITE( "CSConFTP::CreateFolderL() : drive err" );
-            ret = KErrNotFound;
-            }
-        }
-
-    if ( ret == KErrNone )
-        {
-        if( pathBufPtr.LocateReverse( KPathDelimiter ) != pathBufPtr.Length()-1 )
-            {
-            pathBufPtr.Append( KPathDelimiter );
-            }
-        ret = iSConFsHandler->CreateFolderL( pathBufPtr );
-        }
-    
-    if( ret == KErrNone || ret == KErrAlreadyExists )
-        {
-        ret = SetPathL( aFolderName, KSConSetPathForward );
-        }
-    
-    CleanupStack::PopAndDestroy( pathBuf );
-    
-    LOGGER_WRITE_1( "CSConFTP::CreateFolderL( const TPtrC aFolderName ) : returned %d", ret );
-    
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::DeleteObjectL( const TPtrC aObjectName )
-// Deletes file/folder from inbox or file system
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::DeleteObjectL( const TPtrC aObjectName )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aObjectName: %S", &aObjectName );
-    TInt ret( KErrNone );
-    TFileName tmpTarget;
-    HBufC* targetBuf = HBufC::NewLC( KMaxFileName );
-    TPtr target = targetBuf->Des();
-    
-    //absolute folder path
-    if( aObjectName.Length() > 1 && aObjectName[1] == KDriveDelimiter )
-        {
-        if ( iPathName.Length()>0 )
-            {
-            LOGGER_WRITE( "CSConFTP::DeleteObjectL() : KErrBadName" );
-            CleanupStack::PopAndDestroy( targetBuf );
-            return KErrBadName;
-            }
-        target.Copy( aObjectName );
-        }
-    else
-        {
-        target.Copy( iPathName );
-        target.Append( aObjectName );
-        }
-    
-    if( !iFs.IsValidName( target ) )
-        {
-        ret = KErrBadName;
-        }
-    else
-        {
-        TInt driveNumber;
-        ret = iFs.CharToDrive(target[0], driveNumber);
-        if( ret != KErrNone || !IsDriveVisible(driveNumber) )
-            {
-            LOGGER_WRITE( "CSConFTP::DeleteObjectL() : drive err" );
-            ret = KErrNotFound;
-            }
-        }
-    
-
-    if ( ret == KErrNone )
-        {
-        ret = iSConFsHandler->DeleteObjectL( target );
-        }
-    
-    CleanupStack::PopAndDestroy( targetBuf );
-    
-    LOGGER_WRITE_1( "CSConFTP::DeleteObjectL( const TPtrC aObjectName ) : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::GetPath( TDes& aPath )
-// Gets the current path
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::GetPath( TDes& aPath )
-    {
-    TRACE_FUNC;
-    aPath.Copy( iPathName );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::AbortFileTransfer( CObexBufObject*& aObject )
-// Abort file transfer
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::AbortFileTransfer( CObexBufObject*& aObject )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err( KErrNone );
-    
-    if( iPathName.Length() == 0 )
-        {
-        iSConInboxHandler->AbortInboxOperation( aObject );
-        }
-    
-    //aObject has to be deleted, otherwise the temp file is locked
-    delete aObject;
-    aObject = NULL;
-    
-    err = iFs.Delete( iTempFileName );
-    
-    LOGGER_WRITE_1( "CSConFTP::AbortFileTransfer( CObexBufObject*& aObject ) : iFs.Delete() err: %d", err );
-    return err;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::SetProfile( TInt aProfile )
-// Set used transfer profile
-// -----------------------------------------------------------------------------
-//
-void CSConFTP::SetProfile( TSConProfile aProfile )
-    {
-    TRACE_FUNC;
-    iProfile = aProfile;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::SetBackupStarted( TBool aValue )
-// Set backup status
-// -----------------------------------------------------------------------------
-//
-void CSConFTP::SetBackupStarted( TBool aValue )
-    {
-    TRACE_FUNC;
-    iBackupStarted = aValue;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::SetUsedMedia( TSConUsedMedia aMedia )
-// Set the used media information
-// -----------------------------------------------------------------------------
-//  
-void CSConFTP::SetUsedMedia( TSConUsedMedia aMedia )
-    {
-    TRACE_FUNC;
-    iMedia = aMedia;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::IsCurrentDiskSpaceBelowCritical( TUint32 aFilesize )
-// Check is current disk space below critical level.
-// -----------------------------------------------------------------------------
-//
-TBool CSConFTP::IsCurrentDiskSpaceBelowCritical( TUint32 aFilesize )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aFilesize: %d", aFilesize );
-    TInt drive;
-    TInt err;
-    
-    if( iCurrentDrive != KErrNotFound )
-        {
-        drive = iCurrentDrive;
-        }
-    else
-        {
-        LOGGER_WRITE( "CSConFTP::IsCurrentDiskSpaceBelowCritical() : drive not specified, use default drive" );
-        err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory, drive );
-        if( err )
-            {
-            LOGGER_WRITE_1( "CSConFTP::IsCurrentDiskSpaceBelowCriticaL() : DriveInfo::GetDefaultDrive err %d", err );
-            return ETrue; //exit
-            }
-        }
-    
-    // check disk space
-    LOGGER_WRITE_1( "drive: %d", drive );
-    TVolumeInfo volumeInfo;
-    err = iFs.Volume(volumeInfo, drive);
-    if( err != KErrNone )
-        {
-        LOGGER_WRITE_1( "CSConFTP::IsCurrentDiskSpaceBelowCritical() : iFs.Volume err %d", err );
-        LOGGER_WRITE( "CSConFTP::IsCurrentDiskSpaceBelowCritical() : End" );
-        return ETrue; //exit
-        }
-    LOGGER_WRITE_1( "volumeInfo.iFree: %Ld", volumeInfo.iFree );
-    TBool diskLevelCritical( EFalse );
-    if ( volumeInfo.iFree - aFilesize <= iCriticalDiskLevel )
-        {
-        // Can not write the data, there's not enough free space on disk.
-        diskLevelCritical = ETrue;
-        }
-
-    LOGGER_WRITE_1( "CSConFTP::IsCurrentDiskSpaceBelowCritical() : ret %d",
-     (TInt)diskLevelCritical );
-    return diskLevelCritical;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::ReadWBXMLDataL( CBufFlat*& aBuffer )
-// Read received ConML protocol packet
-// -----------------------------------------------------------------------------
-//  
-TInt CSConFTP::ReadWBXMLDataL( CBufFlat*& aBuffer )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    
-    RFile file;
-    TInt fileSize;
-    
-    ret = file.Open( iFs, iTempFileName, EFileRead|EFileShareAny );
-    CleanupClosePushL( file );
-    if( ret == KErrNone )
-        {
-        file.Size( fileSize );
-        
-        delete aBuffer;
-        aBuffer = NULL;
-            
-        HBufC8* wbxmlDataBuf = HBufC8::NewLC( fileSize );
-        TPtr8 wbxmlDataPtr = wbxmlDataBuf->Des();
-        
-        file.Read( wbxmlDataPtr );
-        
-        aBuffer = CBufFlat::NewL( KSConBufSize );
-        aBuffer->ExpandL( 0, fileSize );
-        aBuffer->Write( 0, wbxmlDataPtr );
-        
-        CleanupStack::PopAndDestroy( wbxmlDataBuf );
-        }
-    CleanupStack::PopAndDestroy( &file );
-    LOGGER_WRITE_1( "CSConFTP::ReadWBXMLData( CBufFlat*& aBuffer ) : WBXML packet size: %d", fileSize );
-        
-    LOGGER_WRITE_1( "CSConFTP::ReadWBXMLData( CBufFlat*& aBuffer ) : returned %d", ret );
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFTP::DeleteTempFile()
-// Delete OBEX stack's temp file
-// -----------------------------------------------------------------------------
-//  
-void CSConFTP::DeleteTempFile()
-    {
-    TRACE_FUNC_ENTRY;
-    iFs.Delete( iTempFileName );
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFTP::MoveFile()
-// Move file/folder
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::MoveFile(const TDesC& aSource, const TDesC& aTarget)
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err;
-    TFileName tmpSource;
-    TFileName tmpTarget;
-    err = GetAbsolutePath( aSource, tmpSource );
-    if( err == KErrNone )
-        {
-        err = GetAbsolutePath( aTarget, tmpTarget );
-        }
-        
-    if( err == KErrNone )
-        {
-        TInt sourceDrive;
-        TInt targetDrive;
-        
-        err = iFs.CharToDrive( tmpSource[0], sourceDrive );
-        TInt err2 = iFs.CharToDrive( tmpTarget[0], targetDrive );
-        
-        if( err != KErrNone || err2 != KErrNone
-            || !IsDriveVisible( sourceDrive )
-            || !IsDriveVisible( targetDrive ) )
-            {
-            // drive not visible to user
-            err = KErrNotFound;
-            }
-        }
-        
-    if( err == KErrNone )
-        {
-        TRAP( err,
-        iSConFsHandler->DoCopyOrMoveFileL( tmpSource, tmpTarget, EFalse ) );
-        }
-    
-    LOGGER_WRITE_1( "CSConFTP::MoveFile() : end, err: %d", err );
-    return err;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::CopyFile()
-// Copy file/folder
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::CopyFile(const TDesC& aSource, const TDesC& aTarget)
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err;
-    TFileName tmpSource;
-    TFileName tmpTarget;
-    err = GetAbsolutePath( aSource, tmpSource );
-    if (err == KErrNone)
-        {
-        err = GetAbsolutePath( aTarget, tmpTarget );
-        }
-    
-    if( err == KErrNone )
-        {
-        TInt sourceDrive;
-        TInt targetDrive;
-        
-        err = iFs.CharToDrive( tmpSource[0], sourceDrive );
-        TInt err2 = iFs.CharToDrive( tmpTarget[0], targetDrive );
-        
-        if( err != KErrNone || err2 != KErrNone
-            || !IsDriveVisible( sourceDrive )
-            || !IsDriveVisible( targetDrive ) )
-            {
-            // drive not visible to user
-            err = KErrNotFound;
-            }
-        }
-        
-    if (err == KErrNone)
-        {
-        TRAP( err,
-        iSConFsHandler->DoCopyOrMoveFileL( tmpSource, tmpTarget, ETrue ) );
-        }
-    
-    LOGGER_WRITE_1( "CSConFTP::CopyFile() : end, ret: %d", err );
-    return err;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFTP::SetReadOnly()
-// Set read-only permissions to file or folder
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::SetReadOnly(const TDesC& aTarget, const TBool aReadOnly)
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err;
-    TFileName tmpTarget;
-    err = GetAbsolutePath( aTarget, tmpTarget );
-    if( err != KErrNone )
-        {
-        return err;
-        }
-    else
-        {
-        TInt targetDrive;
-        err = iFs.CharToDrive( tmpTarget[0], targetDrive );
-        
-        if( err != KErrNone
-            || !IsDriveVisible( targetDrive ) )
-            {
-            // drive not visible to user
-            return KErrNotFound;
-            }
-        }
-    
-    TBool isFolder(EFalse);
-    err = BaflUtils::IsFolder( iFs, tmpTarget, isFolder );
-    if ( err == KErrNone && isFolder )
-        {
-        tmpTarget.Append(KPathDelimiter);
-        }
-    if ( !iSConFsHandler->IsFolderVisible( tmpTarget ) )
-        {
-        // folder is not visible to user
-        err = KErrAccessDenied;
-        }
-    else
-        {
-        if( aReadOnly )
-            {
-            err = iFs.SetAtt( tmpTarget, KEntryAttReadOnly, KEntryAttArchive );
-            }
-        else
-            {
-            err = iFs.SetAtt( tmpTarget, KEntryAttNormal, KEntryAttReadOnly );
-            }
-        }
-        
-    LOGGER_WRITE_1( "CSConFTP::SetReadOnly() : ret: %d", err );
-    return err;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFTP::SetHidden()
-// Set hidden permissions to file or folder
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::SetHidden( const TDesC& /*aTarget*/, const TBool /*aHidden*/ )
-    {
-	// This is currently not supported.
-    LOGGER_WRITE("CSConFTP::SetHidden return KErrNotSupported");
-    return KErrNotSupported;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::GetAbsolutePath()
-// Get absolute path from relative file/folder
-// -----------------------------------------------------------------------------
-//
-TInt CSConFTP::GetAbsolutePath( const TDesC& aFolderName, TDes &aFullPath )
-    {
-    if (aFolderName.Length() == 0)
-        {
-        return KErrBadName;
-        }
-    //absolute folder path
-    if( aFolderName.Length() > 1 && aFolderName[1] == KDriveDelimiter )
-        {
-        aFullPath.Copy( aFolderName );
-        }
-    // relative to the root folder
-    else if( aFolderName[0] == KPathDelimiter )
-        {
-        if( iPathName.Length() < 2 )
-            {
-            return KErrBadName;
-            }
-        aFullPath.Copy( iPathName.Left(2) );
-        aFullPath.Append( aFolderName );
-        }
-    // relative to the current folder
-    else
-        {
-        aFullPath.Copy( iPathName );
-        if( aFullPath.LocateReverse( KPathDelimiter ) != aFullPath.Length()-1 )
-            {
-            aFullPath.Append( KPathDelimiter );
-            }
-        aFullPath.Append( aFolderName );
-        // no need to check internal root, because iPathName is real target.
-        }
-    
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::CSConFTP()
-// Default constructor
-// -----------------------------------------------------------------------------
-//  
-CSConFTP::CSConFTP() : iProfile( EStandard ), iCurrentDrive( KErrNotFound )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//  
-void CSConFTP::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iBuffer = CBufFlat::NewL( KSConBufSize );
-    User::LeaveIfError( iFs.Connect() );
-    iSConFsHandler = CSConFsHandler::NewL( iFs );
-    iSConInboxHandler = CSConInboxHandler::NewL();
-    
-    CRepository* repository = CRepository::NewLC( KCRUidDiskLevel );
-    User::LeaveIfError( repository->Get( KDiskCriticalThreshold, iCriticalDiskLevel ) );
-    CleanupStack::PopAndDestroy( repository );
-    // inlcude package size
-    iCriticalDiskLevel += KPackageSize;
-    LOGGER_WRITE_1( "criticalLevel: %d", iCriticalDiskLevel );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::GetVolumeNameL()
-// Get volume name
-// -----------------------------------------------------------------------------
-//  
-TInt CSConFTP::GetVolumeNameL(const TInt aDriveNumber, TDes8& aVolumeName)
-    {
-    TRACE_FUNC_ENTRY;
-    TVolumeInfo volumeInfo;
-    TInt ret = iFs.Volume( volumeInfo, aDriveNumber );
-    
-    if ( ret == KErrNone)
-        {
-        CnvUtfConverter::ConvertFromUnicodeToUtf8( aVolumeName,
-             volumeInfo.iName );
-        //Replace special characters
-        for( TInt i = 0; i < aVolumeName.Length(); i++ )
-            {
-            switch( aVolumeName[i] )
-                {
-                case '&':
-                    aVolumeName.Delete( i, 1 );
-                    aVolumeName.Insert( i, KReplace1 );
-                    break;
-                case '<':
-                    aVolumeName.Delete( i, 1 );
-                    aVolumeName.Insert( i, KReplace2 );
-                    break;
-                case '>':
-                    aVolumeName.Delete( i, 1 );
-                    aVolumeName.Insert( i, KReplace3 );
-                    break;
-                case '"':
-                    aVolumeName.Delete( i, 1 );
-                    aVolumeName.Insert( i, KReplace4 );
-                    break;
-                case '\'':
-                    aVolumeName.Delete( i, 1 );
-                    aVolumeName.Insert( i, KReplace5 );
-                    break;
-                default:
-                    break;
-                }
-            }
-        
-        //No name
-        if( aVolumeName.Length() == 0 )
-            {
-            LOGGER_WRITE( "Volume has no name, use default localized name" );
-            //Read memory string and convert it
-            TFileName file( KSConResourceName );
-            
-            BaflUtils::NearestLanguageFile( iFs, file );
-            
-            CStringResourceReader* reader = CStringResourceReader::NewL( file );
-            CleanupStack::PushL( reader );
-            TUint driveStatus;
-            User::LeaveIfError( DriveInfo::GetDriveStatus( iFs, aDriveNumber, driveStatus ) );
-            if( driveStatus & DriveInfo::EDriveRemovable )
-                {
-                // read default MMC name
-                CnvUtfConverter::ConvertFromUnicodeToUtf8( aVolumeName, 
-                reader->ReadResourceString( R_SECON_VALUE_MMC ) );
-                }
-            else
-                {
-                // read default DEV name
-                CnvUtfConverter::ConvertFromUnicodeToUtf8( aVolumeName, 
-                reader->ReadResourceString( R_SECON_VALUE_DEVICE ) );
-                }
-            CleanupStack::PopAndDestroy( reader );
-            }
-        }
-    LOGGER_WRITE_1("GetVolumeNameL returned: %d", ret);
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::IsDriveVisible()
-// Check is drive visible for user
-// -----------------------------------------------------------------------------
-//  
-TBool CSConFTP::IsDriveVisible( const TInt aDriveNumber )
-    {
-    TUint driveStatus;
-    TInt err = DriveInfo::GetDriveStatus( iFs, aDriveNumber, driveStatus);
-    if( err )
-        {
-        LOGGER_WRITE_1( "CSConFTP::IsDriveVisible() : DriveInfo::GetDriveStatus err: %d", err );
-        return EFalse;
-        }
-    if( driveStatus & DriveInfo::EDriveRemote )
-        {
-        LOGGER_WRITE( "CSConFTP::IsDriveVisible() : remote drive" );
-        return EFalse;
-        }
-    if( !(driveStatus & DriveInfo::EDriveUserVisible) )
-        {
-        LOGGER_WRITE( "CSConFTP::IsDriveVisible() : not visible" );
-        return EFalse;
-        }
-    if( !(driveStatus & DriveInfo::EDrivePresent ) )
-        {
-        LOGGER_WRITE( "CSConFTP::IsDriveVisible() : not present" );
-        return EFalse;
-        }
-    if( driveStatus & DriveInfo::EDriveCorrupt )
-        {
-        LOGGER_WRITE( "CSConFTP::IsDriveVisible() : corrupted" );
-        return EFalse;
-        }
-    else
-        {
-        return ETrue;
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConFTP::UpdateDriveTypeInfoL()
-// Test is current volume still ok.
-// -----------------------------------------------------------------------------
-//  
-TBool CSConFTP::IsCurrentVolumeOK()
-    {
-    if( iCurrentDrive == KErrNotFound )
-        {
-        LOGGER_WRITE( "CSConFTP::IsCurrentVolumeOK() : not set" );
-        return EFalse;
-        }
-    
-    TUint driveStatus;
-    TInt err = DriveInfo::GetDriveStatus( iFs, iCurrentDrive, driveStatus);
-    if( err )
-        {
-        LOGGER_WRITE_1( "CSConFTP::IsCurrentVolumeOK() : DriveInfo::GetDriveStatus err: %d", err );
-        return EFalse;
-        }
-    if( !(driveStatus & DriveInfo::EDrivePresent ))
-        {
-        LOGGER_WRITE( "CSConFTP::IsCurrentVolumeOK() : not present" );
-        return EFalse;
-        }
-    if( driveStatus & DriveInfo::EDriveCorrupt )
-        {
-        LOGGER_WRITE( "CSConFTP::IsCurrentVolumeOK() : corrupted" );
-        return EFalse;
-        }   
-    else
-        {
-        return ETrue;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CSConFTP::UpdateDriveTypeInfoL()
-// Updates drive information (iCurrentDrive and iCurrentDriveTypeNumber)
-// -----------------------------------------------------------------------------
-//  
-void CSConFTP::UpdateDriveTypeInfoL()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt driveNumber;
-    iCurrentDriveTypeNumber = 0;
-    
-    if( iPathName.Length() == 0 )
-        {
-        LOGGER_WRITE( "CSConFTP::UpdateDriveTypeInfoL() : drive not specified" );
-        iCurrentDrive = KErrNotFound;
-        return;
-        }
-    
-    User::LeaveIfError( iFs.CharToDrive(iPathName[0], driveNumber) );
-    iCurrentDrive = driveNumber;
-    
-    TUint driveStatus;
-    User::LeaveIfError( DriveInfo::GetDriveStatus( iFs, iCurrentDrive, driveStatus ) );
-    // if true, search internal drives, else search removable drives
-    TBool searchInternalDrives = (driveStatus & DriveInfo::EDriveInternal);
-    
-    TInt driveCount;
-    TDriveList driveList;
-    
-    User::LeaveIfError( DriveInfo::GetUserVisibleDrives( iFs, driveList, driveCount ) );
-    
-    for( TInt i = EDriveA; i <= iCurrentDrive; i++ )
-        {
-        if( driveList[i] )
-            {
-            TUint driveStatus;
-            User::LeaveIfError( DriveInfo::GetDriveStatus( iFs, i, driveStatus ) );
-
-            if( !(driveStatus & DriveInfo::EDrivePresent )
-                || driveStatus & DriveInfo::EDriveCorrupt )
-                {
-                LOGGER_WRITE( "not present or corrupted" );
-                continue;
-                }
-            
-            if( driveStatus & DriveInfo::EDriveInternal )
-                {
-                if( searchInternalDrives )
-                    {
-                    iCurrentDriveTypeNumber++;
-                    }
-                }
-            else if( driveStatus & DriveInfo::EDriveRemovable )
-                {
-                if( !searchInternalDrives )
-                    {
-                    iCurrentDriveTypeNumber++;
-                    }
-                }
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-    
-// End of file
-
--- a/connectivitymodules/SeCon/services/ftp/src/sconftp.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* Copyright (c) 2002-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:  Resource file for sconftp.dll
-*
-*/
-
-
-// -----------------------------------------------------------------------------
-//  RESOURCE IDENTIFIER
-// -----------------------------------------------------------------------------
-//
-NAME SFTP
-
-// -----------------------------------------------------------------------------
-//  INCLUDE FILES
-// -----------------------------------------------------------------------------
-//
-#include <eikon.rh>
-#include <eikon.rsg>
-
-#include <sconftp.loc>
-
-
-RESOURCE RSS_SIGNATURE { }
-
-RESOURCE TBUF r_secon_value_device      { buf = qtn_secon_device; }
-RESOURCE TBUF r_secon_value_mmc         { buf = qtn_secon_mmc; }
-RESOURCE TBUF r_secon_value_mass_storage { buf = qtn_secon_mass_storage; }
-RESOURCE TBUF r_secon_data_folder       { buf = qtn_secon_data_folder; }
-RESOURCE TBUF r_secon_unknown_supplier  { buf = qtn_secon_unknown_supplier; }
--- a/connectivitymodules/SeCon/services/ftp/src/sconinboxhandler.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +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:  File Transfer Controller implementation
-*
-*/
-
-
-// INCLUDE FILES
-#include <obexutilsmessagehandler.h>
-#include <btmsgtypeuid.h>    // BT Message Uid
-
-#include "sconinboxhandler.h"
-#include "debug.h"
-#include "sconconsts.h"
-
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CSConInboxHandler::NewL()
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CSConInboxHandler* CSConInboxHandler::NewL()
-    {
-    TRACE_FUNC_ENTRY;
-    CSConInboxHandler* self = new (ELeave) CSConInboxHandler();
-    
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConInboxHandler::~CSConInboxHandler()
-// Default destructor
-// -----------------------------------------------------------------------------
-//
-CSConInboxHandler::~CSConInboxHandler()
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConInboxHandler::CreateInboxAttachmentL( CObexBufObject*& aObject,
-//                                              CBufFlat*& aBuffer )
-// Creates an attachment to device's Inbox
-// -----------------------------------------------------------------------------
-//  
-TInt CSConInboxHandler::CreateInboxAttachmentL( CObexBufObject*& aObject,
-                                                CBufFlat*& aBuffer )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    iDrive = GetMessageCenterDriveL();
-    
-    delete aObject;
-    aObject = CObexBufObject::NewL( NULL );
-    
-    iFile = RFile();
-    
-    TRAP( ret, TObexUtilsMessageHandler::CreateInboxAttachmentL( aObject, 
-    KUidMsgTypeBt, iMsvIdParent, iFile ) );
-        
-    if( aBuffer )
-        {
-        aBuffer->Reset();
-        delete aBuffer;
-        }
-        
-    aBuffer = CBufFlat::NewL( KSConBufferSize );
-    aBuffer->ResizeL( KSConBufferSize );
-    
-    TObexRFileBackedBuffer bufferdetails( *aBuffer, iFile, 
-    CObexBufObject::EDoubleBuffering );
-    aObject->SetDataBufL( bufferdetails );
-    LOGGER_WRITE_1( "CSConInboxHandler::CreateInboxAttachmentL() : returned %d", ret );
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConInboxHandler::SaveObjToInboxL( CObexBufObject*& aObject )
-// Saves the object to the Inbox
-// -----------------------------------------------------------------------------
-//  
-TInt CSConInboxHandler::SaveObjToInboxL( CObexBufObject*& aObject )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    
-    if( iDrive == EDriveE )
-        {
-        ret = TObexUtilsMessageHandler::GetMmcFileSystemStatus();
-        LOGGER_WRITE_1( "GetMmcFileSystemStatus returned %d", ret );
-        }
-    else
-        {
-        ret = TObexUtilsMessageHandler::GetFileSystemStatus();
-        LOGGER_WRITE_1( "GetFileSystemStatus returned %d", ret );
-        }
-       
-    if( ret == KErrNone )
-        {
-        TInt tempDrive = GetMessageCenterDriveL();
-    
-        if( tempDrive == iDrive )
-            {
-            LOGGER_WRITE_1( "before SaveObjToInboxL in SaveObjToInboxL %d", ret );
-            TRAP( ret, TObexUtilsMessageHandler::SaveObjToInboxL( aObject, 
-            iFile, iMsvIdParent ) );
-            LOGGER_WRITE_1( "after SaveObjToInboxL in SaveObjToInboxL %d", ret );
-            }
-        else
-            {
-            ret = KErrGeneral;
-            }   
-            
-        if( ret != KErrNone )
-            {
-            LOGGER_WRITE_1( "before RemoveInboxEntriesL in SaveObjToInboxL %d", ret );
-            TObexUtilsMessageHandler::RemoveInboxEntriesL( aObject, 
-            iMsvIdParent );
-            LOGGER_WRITE_1( "after RemoveInboxEntriesL in SaveObjToInboxL %d", ret );
-            }
-        }
-        
-    LOGGER_WRITE_1( "CSConInboxHandler::SaveObjToInboxL( CObexBufObject* aObject ) : returned %d", ret );
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConInboxHandler::AbortInboxOperation( CObexBufObject*& aObject )
-// Aborts the storing operation
-// -----------------------------------------------------------------------------
-//  
-TInt CSConInboxHandler::AbortInboxOperation( CObexBufObject*& aObject )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    TRAP( ret, TObexUtilsMessageHandler::RemoveInboxEntriesL( aObject, 
-    iMsvIdParent ) );
-    LOGGER_WRITE_1( "CSConInboxHandler::AbortInboxOperation() returned %d", ret );
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConInboxHandler::GetMessageCenterDriveL()
-// Returns the current message center drive
-// -----------------------------------------------------------------------------
-//  
-TInt CSConInboxHandler::GetMessageCenterDriveL()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt drive;
-    CMsvSession* msvSession = CMsvSession::OpenSyncL( *this );
-    CleanupStack::PushL( msvSession );
-    TDriveUnit driveUnit = msvSession->CurrentDriveL();
-    drive = driveUnit.operator TInt();
-    CleanupStack::PopAndDestroy( msvSession );
-    LOGGER_WRITE_1( "CSConInboxHandler::GetMessageCenterDriveL() returned %d", drive );
-    return drive;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConInboxHandler::HandleSessionEventL( TMsvSessionEvent aEvent, 
-//                              TAny* aArg1, 
-//                              TAny* aArg2, 
-//                              TAny* aArg3 )
-// Implementation of MMsvSessionObserver::HandleSessionEventL
-// -----------------------------------------------------------------------------
-//      
-void CSConInboxHandler::HandleSessionEventL( TMsvSessionEvent /*aEvent*/, 
-                                TAny* /*aArg1*/, 
-                                TAny* /*aArg2*/, 
-                                TAny* /*aArg3*/ )
-    {
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConInboxHandler::CSConInboxHandler()
-// Default constructor
-// -----------------------------------------------------------------------------
-//  
-CSConInboxHandler::CSConInboxHandler()
-    {
-    }   
-
-// End of file
-
--- a/connectivitymodules/SeCon/services/oviaccounthandler/bwins/sconoviaccounthandleru.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?CreateCSconOviAccountHandlerL@@YAPAVCSconOviAccountHandler@@XZ @ 1 NONAME ; class CSconOviAccountHandler * CreateCSconOviAccountHandlerL(void)
-
--- a/connectivitymodules/SeCon/services/oviaccounthandler/eabi/sconoviaccounthandleru.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	_Z29CreateCSconOviAccountHandlerLv @ 1 NONAME
-	_ZTI22CSconOviAccountHandler @ 2 NONAME ; #<TI>#
-	_ZTV22CSconOviAccountHandler @ 3 NONAME ; #<VT>#
-
--- a/connectivitymodules/SeCon/services/oviaccounthandler/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  SconOviAccountHandler bld.inf file
-*
-*/
-
-
-PRJ_PLATFORMS  
-DEFAULT
-
-PRJ_EXPORTS
-../rom/sconoviaccounthandler.iby      CORE_APP_LAYER_IBY_EXPORT_PATH(sconoviaccounthandler.iby)
-
-PRJ_MMPFILES
-sconoviaccounthandler.mmp
--- a/connectivitymodules/SeCon/services/oviaccounthandler/group/sconoviaccounthandler.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  sconoviaccounthandler mmp file
-*
-*/
-
-
-#include <platform_paths.hrh>
-#include <non_foundation_paths.hrh>
-#include <data_caging_paths.hrh>
-
-VENDORID        VID_DEFAULT
-
-CAPABILITY      CAP_GENERAL_DLL
-
-TARGETPATH      sys/bin
-
-TARGET          sconoviaccounthandler.dll
-TARGETTYPE      DLL
-DEFFILE         sconoviaccounthandler.def
-UID             0x10009D8D 0x2001A97A
-
-SOURCEPATH      ../src
-SOURCE          sconoviaccounthandler.cpp
-
-USERINCLUDE     ../inc
-USERINCLUDE     ../../../inc
-
-// System include paths
-APP_LAYER_SYSTEMINCLUDE
-NON_FOUNDATION_MW_LAYER_SYSTEMINCLUDE
-
-DEBUGLIBRARY	flogger.lib
-LIBRARY         euser.lib
-LIBRARY         wsaccountmanager.lib
-LIBRARY         estor.lib // For RWriteStream
--- a/connectivitymodules/SeCon/services/oviaccounthandler/inc/sconoviaccounthandler.h	Tue Aug 31 15:05:37 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:  CSconOviAccountHandler header file
-*
-*/
-
-
-#ifndef _SCONOVIACCOUNTHANDLER_H_
-#define _SCONOVIACCOUNTHANDLER_H_
-
-#include <e32base.h>
-#include <s32strm.h>
-
-_LIT(KSconOviAccountHandlerDllName, "sconoviaccounthandler.dll");
-const TUid KSconOviAccountHandlerDllUid={0x10009D8D};
-
-class CWSOviAccountManager;
-
-/**
- * CSconOviAccountHandler provides Ovi account information.
- * Dynamically loadable dll.
- */
-class CSconOviAccountHandler : public CBase
-{
-    public:
-    static CSconOviAccountHandler* NewL();
-    ~CSconOviAccountHandler();
-    
-    /**
-     * Reads account information from device
-     * @param aAccountInfoStream stream where to export account details.
-     * @leave KErrNotFound if account information does not exist.
-     */
-    virtual void GetOviAccountDetailsL( RWriteStream& aAccountInfoStream );
-    
-    private:
-    void ConstructL();
-    
-    private: // Data
-    CWSOviAccountManager* iOviAccountManager;
-    
-};
-
-IMPORT_C CSconOviAccountHandler* CreateCSconOviAccountHandlerL();
-typedef CSconOviAccountHandler* (*TSConCreateCSconOviAccountHandlerFunc) (); 
-
-#endif // _SCONOVIACCOUNTHANDLER_H_
--- a/connectivitymodules/SeCon/services/oviaccounthandler/rom/sconoviaccounthandler.iby	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image description file for SConOviAccountHandler.
-*
-*/
-
-
-#ifndef _SCONOVIACCOUNTHANDLER_IBY_
-#define _SCONOVIACCOUNTHANDLER_IBY_
-
-file=ABI_DIR\BUILD_DIR\sconoviaccounthandler.dll		SHARED_LIB_DIR\sconoviaccounthandler.dll
-
-#endif
--- a/connectivitymodules/SeCon/services/oviaccounthandler/src/sconoviaccounthandler.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +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:  CSconOviAccountHandler implementation
-*
-*/
-
-
-#include "sconoviaccounthandler.h"
-#include <wsoviaccountmanager.h>
-#include "debug.h"
-
-// Constants
-_LIT8( KUserId, "#UserID: " );
-_LIT8( KFirstName, "\n#FirstName: " );
-_LIT8( KLastName, "\n#LastName: " );
-_LIT8( KEmail, "\n#Email: " );
-_LIT8( KEmailVerified, "\n#EmailVerified: " );
-_LIT8( KMobile, "\n#Mobile: " );
-_LIT8( KMobileVerified, "\n#MobileVerified: " );
-
-
-
-// -----------------------------------------------------------------------------
-// CreateCSconOviAccountHandlerL()
-// Entry to CSconOviAccountHandler
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CSconOviAccountHandler* CreateCSconOviAccountHandlerL()
-    {
-    TRACE_FUNC;
-    return CSconOviAccountHandler::NewL();
-    }
-
-CSconOviAccountHandler* CSconOviAccountHandler::NewL()
-    {
-    TRACE_FUNC;
-    CSconOviAccountHandler* self = new (ELeave) CSconOviAccountHandler();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-    
-CSconOviAccountHandler::~CSconOviAccountHandler()
-    {
-    TRACE_FUNC;
-    delete iOviAccountManager;
-    }
-
-void CSconOviAccountHandler::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    iOviAccountManager = CWSOviAccountManager::NewL();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// GetOviAccountDetailsL()
-// Reads account info and prints details to aAccountInfoStream
-// -----------------------------------------------------------------------------
-//
-void CSconOviAccountHandler::GetOviAccountDetailsL( RWriteStream& aAccountInfoStream )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // not owned
-    CWSAccount* account = iOviAccountManager->Account();
-    if ( !account )
-        {
-        // Account information not found.
-        LOGGER_WRITE("Account information not found, leaving KErrNotFound");
-        User::Leave( KErrNotFound );
-        }
-    
-    // Write userId
-    const TDesC8& userId = account->UserId();
-    aAccountInfoStream.WriteL( KUserId );
-    aAccountInfoStream.WriteL( userId );
-    
-    // Write first name
-    HBufC8* temp = account->AccountItemL( KWSAccAttrAccountFirstName );
-    if ( temp )
-        {
-        aAccountInfoStream.WriteL( KFirstName );
-        aAccountInfoStream.WriteL( temp->Des() );
-        delete temp;
-        temp = NULL;
-        }
-    
-    // Write last name
-    temp = account->AccountItemL( KWSAccAttrAccountLastName );
-    if ( temp )
-        {
-        aAccountInfoStream.WriteL( KLastName );
-        aAccountInfoStream.WriteL( temp->Des() );
-        delete temp;
-        temp = NULL;
-        }
-    
-    // Write email
-    temp = account->AccountItemL( KWSAccAttrAccountEmail );
-    if ( temp )
-        {
-        aAccountInfoStream.WriteL( KEmail );
-        aAccountInfoStream.WriteL( temp->Des() );
-        delete temp;
-        temp = NULL;
-        }
-    
-    // Write email verified (true/false)
-    temp = account->AccountItemL( KWSAccAttrAccountEmailVerified );
-    if ( temp )
-        {
-        aAccountInfoStream.WriteL( KEmailVerified );
-        aAccountInfoStream.WriteL( temp->Des() );
-        delete temp;
-        temp = NULL;
-        }
-    
-    // Write mobile number
-    temp = account->AccountItemL( KWSAccAttrAccountMobile );
-    if ( temp )
-        {
-        aAccountInfoStream.WriteL( KMobile );
-        aAccountInfoStream.WriteL( temp->Des() );
-        delete temp;
-        temp = NULL;
-        }
-    
-    // Write mobile verified
-    temp = account->AccountItemL( KWSAccAttrAccountMobileVerified );
-    if ( temp )
-        {
-        aAccountInfoStream.WriteL( KMobileVerified );
-        aAccountInfoStream.WriteL( temp->Des() );
-        delete temp;
-        temp = NULL;
-        }
-        
-    TRACE_FUNC_EXIT;
-    }
--- a/connectivitymodules/SeCon/services/pcd/bld/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* Copyright (c) 2002-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 provides the information required for building the
-*    whole of a SConPCD
-*
-*/
-
-
-
-PRJ_PLATFORMS
-DEFAULT 
-
-PRJ_EXPORTS
-../rom/sconpcd.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(sconpcd.iby)
-./sbeconfig.xml     Z:/private/10202d56/sbeconfig.xml
-
-PRJ_MMPFILES
-sconpcd.mmp
-
--- a/connectivitymodules/SeCon/services/pcd/bld/def/bwinscwu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?CreateCSConPCDL@@YAPAVCSConPCD@@XZ @ 1 NONAME ; class CSConPCD * CreateCSConPCDL(void)
-
--- a/connectivitymodules/SeCon/services/pcd/bld/def/eabiuu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	_Z15CreateCSConPCDLv @ 1 NONAME
-	_ZTI8CSConPCD @ 2 NONAME ; #<TI>#
-	_ZTV8CSConPCD @ 3 NONAME ; #<VT>#
-
--- a/connectivitymodules/SeCon/services/pcd/bld/sbeconfig.xml	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-<?xml version="1.0" standalone="yes"?>
-<sbe_config>
-	<heap size = "131072" max_retries = "5" reduction_factor = "2"/> 
-	<central_repository uid = "0x10202BE9"/>
-	<exclude_drives list = "z"/>
-	<app_close_delay delay = "4000000"/>
-</sbe_config>
\ No newline at end of file
--- a/connectivitymodules/SeCon/services/pcd/bld/sconpcd.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
-* Copyright (c) 2005-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:  PC Connectivity Signaling Module
-*
-*/
-
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-
-VENDORID        VID_DEFAULT
-
-CAPABILITY      CAP_GENERAL_DLL
-
-TARGETPATH      sys/bin
-
-TARGET          sconpcd.dll
-TARGETTYPE      DLL
-UID             0x10009D8D 0x101F968B
-
-#if defined(ARMCC)
-DEFFILE	./def/eabiu
-#elif defined(WINSCW) 
-DEFFILE	./def/bwinscw
-#elif defined(WINS)
-DEFFILE	./def/bwins
-#elif defined(ARM)
-DEFFILE	./def/bmarm
-#endif
-
-SOURCEPATH      ../src
-SOURCE          sconpcd.cpp
-SOURCE          sconqueue.cpp
-SOURCE          sconinstqueue.cpp
-SOURCE          sconbrqueue.cpp
-SOURCE          sconinstaller.cpp
-SOURCE          sconbackuprestore.cpp
-SOURCE          sconsbeclient.cpp
-SOURCE          sconpcdutility.cpp
-SOURCE          sconmetadata.cpp
-SOURCE          sconvideoparser.cpp
-SOURCE          sconsynchandler.cpp
-SOURCE          cscontimeout.cpp
-
-SOURCEPATH      ../../../common/conmltask/src
-SOURCE          sconconmltask.cpp
-
-USERINCLUDE     ../inc
-USERINCLUDE     ../../../inc
-USERINCLUDE     ../../../common/conmltask/inc
-USERINCLUDE     ../../../clients/syncclient/inc
-
-// Default system include paths
-APP_LAYER_SYSTEMINCLUDE
-
-
-LIBRARY         euser.lib 
-LIBRARY         swinstcli.lib
-LIBRARY         sbeclient.lib
-LIBRARY         sisregistryclient.lib
-LIBRARY         javaregistryclient.lib
-LIBRARY         platformenv.lib
-LIBRARY         efsrv.lib
-LIBRARY         sysutil.lib
-LIBRARY         commonengine.lib        // For resource reader
-// LIBRARY         widgetregistryclient.lib
-LIBRARY         metadatautility.lib
-LIBRARY         exiflib.lib
-LIBRARY         charconv.lib
-LIBRARY         caf.lib                 // for Content Access
-LIBRARY         mediaclientvideo.lib    // for CVideoPlayerUtility
-LIBRARY         ws32.lib                // for RWsSession
-LIBRARY         tneengine.lib           // for CTNEVideoClipInfo
-LIBRARY         imageconversion.lib         // for CImageEncoder
-LIBRARY         mmfcontrollerframework.lib  // for CMMFMetaDataEntry
-LIBRARY         bafl.lib                    // for BaflUtils
-
-LIBRARY         ecom.lib
-LIBRARY         estor.lib // CDictionaryFileStore
-LIBRARY         sconsyncclient.lib
-LIBRARY         smlstoreformat.lib
-LIBRARY	        centralrepository.lib
-LIBRARY         sif.lib
-DEBUGLIBRARY    flogger.lib
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/inc/cscontimeout.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +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:  CSconTimeOut declaration
-*
-*/
-
-
-#ifndef CSCONTIMEOUT_H
-#define CSCONTIMEOUT_H
-
-#include <e32base.h>	// For CActive, link against: euser.lib
-#include <e32std.h>		// For RTimer, link against: euser.lib
-
-class MTimeOutObserver
-    {
-public:
-    virtual void TimeOut() = 0;
-    };
-
-NONSHARABLE_CLASS( CSconTimeOut ) : public CActive
-    {
-public:
-    // Cancel and destroy
-    ~CSconTimeOut();
-    static CSconTimeOut* NewL( MTimeOutObserver& aTimeOutObserver );
-    
-public:
-    // Function for making the timeout request
-    void Start(TTimeIntervalMicroSeconds32 aDelay);
-    
-private:
-    CSconTimeOut( MTimeOutObserver& aTimeOutObserver );
-    void ConstructL();
-    
-private: // From CActive
-    void RunL();
-    void DoCancel();
-    TInt RunError(TInt aError);
-    
-private:
-    RTimer              iTimer; // Provides async timing service
-    MTimeOutObserver&   iTimeOutObserver;
-    };
-
-#endif // CSCONTIMEOUT_H
--- a/connectivitymodules/SeCon/services/pcd/inc/sconbackuprestore.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CSConBackupRestore header file
-*
-*/
-
-
-#ifndef _SCONBACKUPRESTORE_H_
-#define _SCONBACKUPRESTORE_H_
-
-// INCLUDES
-
-#include <e32base.h>
-#include <e32cons.h>
-
-class CSConSBEClient;
-class CSConBackupRestoreQueue;
-class RFs;
-
-//============================================================
-// Class CSConBackupRestore declaration
-//============================================================	
-NONSHARABLE_CLASS( CSConBackupRestore ): public CActive
-	{
-	public:
-		/**
-		 * Two-phase constructor
-		 * @param aQueue The address of CSConBackupRestoreQueue
-		 * @param aFs aReference to RFs connection.
-    	 * @return CSConBackupRestore instance
-		 */
-		static CSConBackupRestore* NewL( 
-			CSConBackupRestoreQueue* aQueue, 
-			RFs& aFs );
-		/**
-		 * Destructor
-		 * @return none
-		 */
-		~CSConBackupRestore();
-		
-		/**
-		 * Starts backup-restore task
-		 * @param aTaskId The task number
-    	 * @return none
-		 */
-		void StartBackupRestore( TInt aTaskId );
-		/**
-		 * Stops executing backup-restore task
-		 * @param aTaskId
-    	 * @return none
-		 */
-		void StopBackupRestore( TInt aTaskId );
-		/**
-		 * Resets backup
-		 * @return none
-		 */
-		void Reset();
-		
-		/**
-		 * Returns the active status of the backup-restore
-		 * @return ETrue if backup-restore is active, else EFalse
-		 */
-		TBool BackupRestoreActive() const;
-		
-	private:
-		/**
-		 * Constructor
-		 * @param aQueue The address of CSConBackupRestoreQueue
-		 * @param aFs aReference to RFs connection.
-		 * @return none
-		 */
-		CSConBackupRestore( CSConBackupRestoreQueue* aQueue, RFs& aFs );
-		/**
-		 * Initializes member data
-		 * @return none
-		 */
-		void ConstructL();
-		/**
-		 * Implementation of CActive::DoCancel()
-		 * @return none
-		 */
-		void DoCancel();
-		/**
-		 * Implementation of CActive::RunL()
-		 * @return none
-		 */
-		void RunL();
-		
-	private:
-		CSConBackupRestoreQueue*		iQueue; 
-		CSConSBEClient*					iSBEClient;
-		TInt							iCurrentTask;
-		TBool							iBackupRestoreActive;
-		RFs&                            iFs;
-	};
-	
-#endif // _SCONBACKUPRESTORE_H_
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/inc/sconbrqueue.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +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:  Backup-Restore Queue header file
-*
-*/
-
-
-#ifndef _SCONBRQUEUE_H_
-#define _SCONBRQUEUE_H_
-
-#include "sconqueue.h"
-
-class CSConTaskQueue;
-
-//============================================================
-// Class CSConBackupRestoreQueue declaration
-//============================================================	
-NONSHARABLE_CLASS ( CSConBackupRestoreQueue ) : public CActive, public CSConTaskQueue
-	{
-	public:
-		/**
-		 * Two-phase constructor
-		 * @param aFs aReference to RFs connection.
-		 * @return CSConBackupRestoreQueue instance
-		 */
-		static CSConBackupRestoreQueue* NewL( RFs& aFs );
-		/**
-		 * Destructor
-		 * @return CSConBackupRestoreQueue instance
-		 */
-		~CSConBackupRestoreQueue();
-		/**
-		 * Adds a new task to queue
-		 * @param aNewTask A new task to be added
-		 * @param aTaskId The task number
-    	 * @return KErrNone if no errors, else system wide error codes
-		 */
-		TInt AddNewTask( CSConTask*& aNewTask, TInt aTaskId );
-		/**
-		 * Cancels a task
-		 * @param aTask The task number
-		 * @param aAllTasks If ETrue => cancel all tasks
-		 * @param aStatus The reply
-    	 * @return none
-		 */	
-		void CancelTask( TInt aTask, TBool aAllTasks );
-		/**
-		 * Resets the queue
-    	 * @return none
-		 */
-		void Reset();
-		/**
-		 * An address pointer to another queue
-		 * @param aTaskQueue The address to another queue
-    	 * @return none
-		 */
-		virtual void QueueAddress( CSConInstallerQueue*& aTaskQueue );
-		/**
-		 * Returns the task type
-		 * @param aTaskId The task number
-    	 * @return task type
-		 */	
-		TSConMethodName GetTaskMethodL( TInt aTaskId );
-		
-	private:
-		/**
-		 * Constructor
-		 * @return none
-		 */
-		CSConBackupRestoreQueue();
-		/**
-		 * Initializes member data
-		 * @param aFs aReference to RFs connection.
-		 * @return none
-		 */
-		void ConstructL( RFs& aFs );
-		/**
-		 * Polls queue
-		 * @return none
-		 */
-		void PollQueue();
-		/**
-		 * Starts queue polling
-		 * @return none
-		 */
-		void StartQueue();
-		/**
-		 * Stops queue polling
-		 * @return none
-		 */
-		void StopQueue();
-		/**
-		 * Implementation of CActive::DoCancel()
-		 * @return none
-		 */
-		void DoCancel();
-		/**
-		 * Implementation of CActive::RunL()
-		 * @return none
-		 */
-		void RunL();
-		
-	private:
-		CSConBackupRestore*			iBackupRestore;
-		CSConInstallerQueue*		iInstQueueAddress;
-	};
-
-
-#endif
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/inc/sconinstaller.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +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:  CSConAppInstaller header file
-*
-*/
-
-
-#ifndef _SCONINSTALLER_H_
-#define _SCONINSTALLER_H_
-
-// INCLUDES
-
-#include <e32base.h>
-#include <e32cons.h>
-#include <usif/sif/sif.h>
-
-#include "sconinstqueue.h"
-
-class CSConUninstall;
-
-//============================================================
-// Class CSConAppInstaller declaration
-//============================================================	
-NONSHARABLE_CLASS ( CSConAppInstaller ): public CActive
-	{
-	public:
-        /**
-         * Constructor
-         * @param aQueue The address of CSConInstallerQueu
-         * @return none
-         */
-        static CSConAppInstaller* NewL( CSConInstallerQueue* aQueue, RFs& aFs );
-		
-		/**
-		 * Destructor
-		 * @return none
-		 */
-		~CSConAppInstaller();
-		
-		/**
-		 * Starts the installer task
-		 * @param aTaskId Task number
-    	 * @return none
-		 */
-		void StartInstaller( TInt& aTaskId );
-		/**
-		 * Stops the installer task
-    	 * @return none
-		 */
-		void StopInstaller( TInt& aTaskId );
-		
-		/**
-		 * Returns the active status of the installer
-		 * @return ETrue if installer is active, else EFalse
-		 */
-		TBool InstallerActive() const;
-		
-	private:
-		/**
-         * Constructor
-         * @param aQueue The address of CSConInstallerQueu
-         * @return none
-         */
-        CSConAppInstaller( CSConInstallerQueue* aQueue, RFs& aFs );
-        
-		void ConstructL();
-		/**
-		 * Implementation of CActive::DoCancel()
-		 * @return none
-		 */
-		void DoCancel();
-		/**
-		 * Implementation of CActive::RunL()
-		 * @return none
-		 */
-		void RunL();
-		
-		void WriteTaskDataL( CSConTask& aTask );
-		
-		void ExternalizeResultArrayIntValL( const TDesC& aName, RWriteStream& aStream );
-		void ExternalizeResultIntValL( const TDesC& aName, RWriteStream& aStream );
-		void ExternalizeResultStringValL( const TDesC& aName, RWriteStream& aStream );
-		/**
-		 * Executes ListInstalledApps task
-		 * @return none
-		 */
-		void ProcessListInstalledAppsL();
-		/**
-         * Executes Install task
-         * @param CSConInstall install params
-         * @return none
-         */
-        void ProcessInstallL( const CSConInstall& aInstallParams );
-		/**
-		 * Executes UnInstall task
-		 * @param CSConUninstall uninstall params
-    	 * @return none
-		 */
-		void ProcessUninstallL( const CSConUninstall& aUninstallParams );
-		
-		//void UninstallSisL( const CSConUninstall& aUninstallParams );
-		//void UninstallJavaL( const TUid& aUid, const TSConInstallMode aMode );
-		//void UninstallWidget( const TUid& aUid, const TSConInstallMode aMode );
-		void DeleteFile( const TDesC& aPath );
-		
-	private:
-	    enum TInstallerState
-	        {
-	        EIdle = 0,
-	        EInstalling,
-	        ESilentInstalling,
-	        EUninstalling,
-	        ESilentUninstalling,
-	        ECustomUninstalling,
-	        ESilentCustomUnistalling,
-	        EListingInstalledApps
-	        };
-	    //TInstallerState                 iInstallerState;
-		CSConInstallerQueue*			iQueue; // Not owned
-		//SwiUI::RSWInstLauncher			iSWInst;
-		//SwiUI::TInstallOptions          iOptions;
-        //SwiUI::TInstallOptionsPckg      iOptionsPckg;   
-		Usif::RSoftwareInstall          iSwInstaller;
-		Usif::COpaqueNamedParams*       iSifOptions;
-		Usif::COpaqueNamedParams*       iSifResults;
-		TInt							iCurrentTask;
-		RFs&                            iFs;
-	};
-	
-#endif // _SCONINSTALLER_H_
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/inc/sconinstqueue.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +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:  Installer Queue header file
-*
-*/
-
-
-#ifndef _SCONINSTQUEUE_H_
-#define _SCONINSTQUEUE_H_
-
-#include "sconqueue.h"
-
-
-//============================================================
-// Class CSConInstallerQueue declaration
-//============================================================	
-NONSHARABLE_CLASS ( CSConInstallerQueue ): public CActive, public CSConTaskQueue
-	{
-	public:
-		/**
-		 * Two-phase constructor
-		 * @return CSConInstallerQueue instance
-		 */
-		static CSConInstallerQueue* NewL( RFs& aFs );
-		/**
-		 * Destructor
-		 * @return none
-		 */
-		~CSConInstallerQueue();
-		
-		/**
-		 * Cancels a task
-		 * @param aTask The task number
-		 * @param aAllTasks If ETrue => cancel all tasks
-		 * @param aStatus The reply
-    	 * @return none
-		 */	
-		void CancelTask( TInt aTask, TBool aAllTasks );
-		
-		/**
-		 * An address pointer to another queue
-		 * @param aTaskQueue The address to another queue
-    	 * @return none
-		 */			
-		void QueueAddress( CSConBackupRestoreQueue*& aTaskQueue );
-		
-	private:
-		/**
-		 * Constructor
-		 * @return none
-		 */
-		CSConInstallerQueue( RFs& aFs );
-		/**
-		 * Initializes member data
-		 * @return none
-		 */
-		void ConstructL();
-		/**
-		 * Polls queue
-		 * @return none
-		 */
-		void PollQueue();
-		/**
-		 * Starts queue polling
-		 * @return none
-		 */
-		void StartQueue();
-		/**
-		 * Stops queue polling
-		 * @return none
-		 */
-		void StopQueue();
-		/**
-		 * Implementation of CActive::DoCancel()
-		 * @return none
-		 */
-		void DoCancel();
-		/**
-		 * Implementation of CActive::RunL()
-		 * @return none
-		 */
-		void RunL();
-		
-	private:
-		CSConAppInstaller* 			iInstaller;	
-		CSConBackupRestoreQueue*	iBRQueueAddress;
-		RFs&                        iFs; 
-	};
-
-
-#endif
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/inc/sconmetadata.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  SConMetadata header file
-*
-*/
-
-
-#ifndef _SCONMETADATA_H_
-#define _SCONMETADATA_H_
-
-#include <MetaDataField.hrh>
-
-class CSConTask;
-class CExifRead;
-class CExifTag;
-//============================================================
-// Class CSConMetadata declaration
-//============================================================  
-NONSHARABLE_CLASS( SConMetadata )
-    {
-    public:
-    
-    /**
-     * Start processing metadata task
-     * @param aTask used task
-     * @param aFs aReference to RFs connection.
-     * @return none
-     */
-    static void ProcessTask( CSConTask& aTask, RFs& aFs );
-    
-    private:
-    
-    /**
-    * Get audio metadata to task
-    * @return none
-    */
-    static void GetAudioMetadataL( CSConTask& aTask );
-    
-    /**
-    * Get video metadata to task
-    * @param aFs aReference to RFs connection.
-    * @return none
-    */
-    static void GetVideoMetadataL( CSConTask& aTask, RFs& aFs );
-    
-    /**
-    * parse exif field
-    * @return HBufC8* parsed data. Leaves if not found
-    */
-    static HBufC8* GetExifTagL( CExifRead* aReader, const TUint8 aTagID ) ;
-    
-    /**
-    * Parse TUint32 value from aData
-    * @return TUint32 value
-    */
-    static TUint32 ReadTUint32( const TDesC8& aData );
-    
-    /**
-     * Read data from file
-     * @param aFs aReference to RFs connection.
-     * @return file data
-     */
-    static HBufC8* GetFileDataLC( const TDesC& aFilename, RFs& aFs );
-    
-    /**
-    * Get exif metadata to task
-    * @param aFs aReference to RFs connection.
-    * @return none
-    */
-    static void ReadExifDataL( CSConTask& aTask, RFs& aFs );
-    
-    /**
-     * Convert latidute/longitude tag to TReal64 value
-     * @return KErrNone if successfully converted
-     */
-    static TInt ConvertRationalTag( const CExifTag& aTag, TDes& aPosDegrees );
-    
-    /**
-     * Get latidute value from Exif
-     * @param aExifRead ExifReader used to read
-     * @param aLatitude readed latidute
-     * @return KErrNone if found
-     */
-    static TInt GetExifGPSLatitudeL( CExifRead& aExifRead, TDes& aLatitude );
-    
-    /**
-     * Get longitude value from Exif
-     * @param aExifRead ExifReader used to read
-     * @param aLongitude readed longitude
-     * @return KErrNone if found
-     */
-    static TInt GetExifGPSLongitudeL( CExifRead& aExifRead, TDes& aLongitude );
-    
-    /**
-     * Get altidute value from Exif
-     * @param aExifRead ExifReader used to read
-     * @param aAltidute readed altidute
-     * @return KErrNone if found
-     */
-    static TInt GetExifGPSAltiduteL( CExifRead& aExifRead, TDes& aAltidute );
-    
-    /**
-    * Appends data field to buffer
-    * @return none
-    */
-    static void AppendUtf8DataFieldL( CBufFlat* aBuffer, const TPtrC aAppendData,
-        const TUint8 aFieldId );
-    
-    /**
-    * Appends data field to buffer
-    * @return none
-    */
-    static void AppendByteDataFieldL( CBufFlat* aBuffer, const TPtrC8 aAppendData,
-        const TUint8 aFieldId );
-    
-    /**
-    * Writes TUint32 value to buffer
-    * @return none
-    */
-    static void WriteTUint32( CBufFlat* aBuffer, TInt offset, TUint32 aValue );
-    
-    /**
-    * Appends data field to buffer
-    * @return none
-    */
-    static void AppendTUintDataFieldL( CBufFlat* aBuffer, TUint32 aValue,
-        const TUint8 aFieldId );
-    
-    /**
-    * Get AudioFieldId
-    * @return TUint8
-    */
-    static TUint8 AudioFieldId( const TMetaDataFieldId fieldId );
-    
-    };
-
-#endif // _SCONMETADATA_H_
--- a/connectivitymodules/SeCon/services/pcd/inc/sconmetadatafielddefs.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +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:  Metadata field definitions
-*
-*/
-
-
-#ifndef _SCONMETADATAFIELDDEFS_H_
-#define _SCONMETADATAFIELDDEFS_H_
-
-// Content type header
-const TUint8 KSconMetadataHeaderAudio( 0x01 );
-const TUint8 KSconMetadataHeaderExif ( 0x02 );
-const TUint8 KSconMetadataHeaderVideo( 0x03 );
-
-const TUint8 KSconMetadataHeaderVersion ( 0x02 ); // format version = 2
-
-// fields for audio
-const TUint8 KSconAudioID3Version   ( 0x01 );
-const TUint8 KSconAudioTitle        ( 0x02 );
-const TUint8 KSconAudioArtist       ( 0x03 );
-const TUint8 KSconAudioAlbum        ( 0x04 );
-const TUint8 KSconAudioYear         ( 0x05 );
-const TUint8 KSconAudioComment      ( 0x06 );
-const TUint8 KSconAudioAlbumTrack   ( 0x07 );
-const TUint8 KSconAudioGenre        ( 0x08 );
-const TUint8 KSconAudioComposer     ( 0x09 );
-const TUint8 KSconAudioCopyright    ( 0x0a );
-const TUint8 KSconAudioOriginalArtist( 0x0b );
-const TUint8 KSconAudioUrl          ( 0x0c );
-const TUint8 KSconAudioUserUrl      ( 0x0d );
-const TUint8 KSconAudioJpeg         ( 0x0e );
-const TUint8 KSconAudioVendor       ( 0x0f );
-const TUint8 KSconAudioRating       ( 0x10 );
-const TUint8 KSconAudioUniqueFileIdentifier( 0x11 );
-const TUint8 KSconAudioDuration     ( 0x12 );
-const TUint8 KSconAudioDate         ( 0x13 );
-
-// fields for exif
-const TUint8 KSconExifThumbnail         ( 0x01 );
-const TUint8 KSconExifDescription       ( 0x02 );
-const TUint8 KSconExifMake              ( 0x03 );
-const TUint8 KSconExifModel             ( 0x04 );
-const TUint8 KSconExifDateTime          ( 0x05 );
-const TUint8 KSconExifSoftware          ( 0x06 );
-const TUint8 KSconExifCopyright         ( 0x07 );
-const TUint8 KSconExifOrientation       ( 0x08 );
-const TUint8 KSconExifXResolution1      ( 0x09 );
-const TUint8 KSconExifXResolution2      ( 0x0a );
-const TUint8 KSconExifYResolution1      ( 0x0b );
-const TUint8 KSconExifYResolution2      ( 0x0c );
-const TUint8 KSconExifResolutionUnit    ( 0x0d );
-const TUint8 KSconExifYCbCrPositioning  ( 0x0e );
-const TUint8 KSconExifIsoSpeedRatings   ( 0x0f );
-const TUint8 KSconExifDateTimeOriginal  ( 0x10 );
-const TUint8 KSconExifDateTimeDigitized ( 0x11 );
-const TUint8 KSconExifMakerNote         ( 0x12 );
-const TUint8 KSconExifUserComment       ( 0x13 );
-const TUint8 KSconExifRelatedSoundFile  ( 0x14 );
-const TUint8 KSconExifExposureTime1     ( 0x15 );
-const TUint8 KSconExifExposureTime2     ( 0x16 );
-const TUint8 KSconExifComponentsConfiguration ( 0x17 );
-const TUint8 KSconExifFlash             ( 0x18 );
-const TUint8 KSconExifColorSpace        ( 0x19 );
-const TUint8 KSconExifPixelXDimension   ( 0x1a );
-const TUint8 KSconExifPixelYDimension   ( 0x1b );
-const TUint8 KSconExifExposureMode      ( 0x1c );
-const TUint8 KSconExifWhiteBalance      ( 0x1d );
-const TUint8 KSconExifSceneCaptureType  ( 0x1e );
-const TUint8 KSconExifExposureProgram   ( 0x1f );
-const TUint8 KSconExifApertureValue1    ( 0x20 );
-const TUint8 KSconExifApertureValue2    ( 0x21 );
-const TUint8 KSconExifExposureBiasValue1 ( 0x22 );
-const TUint8 KSconExifExposureBiasValue2 ( 0x23 );
-const TUint8 KSconExifMeteringMode      ( 0x24 );
-const TUint8 KSconExifLightSource       ( 0x25 );
-const TUint8 KSconExifFileSource        ( 0x26 );
-const TUint8 KSconExifDigitalZoomRatio1 ( 0x27 );
-const TUint8 KSconExifDigitalZoomRatio2 ( 0x28 );
-const TUint8 KSconExifContrast          ( 0x29 );
-const TUint8 KSconExifSaturation        ( 0x2a );
-const TUint8 KSconExifSharpness         ( 0x2b );
-const TUint8 KSconExifExifVersion       ( 0x2c );
-const TUint8 KSconExifFlashPixVersion   ( 0x2d );
-const TUint8 KSconExifThumbXResolution1 ( 0x2e );
-const TUint8 KSconExifThumbXResolution2 ( 0x2f );
-const TUint8 KSconExifThumbYResolution1 ( 0x30 );
-const TUint8 KSconExifThumbYResolution2 ( 0x31 );
-const TUint8 KSconExifThumbResolutionUnit   ( 0x32 );
-const TUint8 KSconExifThumbCompression      ( 0x33 );
-const TUint8 KSconExifThumbJpegInterchangeFormat        ( 0x34 );
-const TUint8 KSconExifThumbJpegInterchangeFormatLength  ( 0x35 );
-const TUint8 KSconExifShutterSpeedValue1 ( 0x36 );
-const TUint8 KSconExifShutterSpeedValue2 ( 0x37 );
-const TUint8 KSconExifBrightnessValue1  ( 0x38 );
-const TUint8 KSconExifBrightnessValue2  ( 0x39 );
-const TUint8 KSconExifCustomRendered    ( 0x3a );
-const TUint8 KSconExifGainControl       ( 0x3b );
-const TUint8 KSconExifGpsVersion        ( 0x3c );
-const TUint8 KSconExifGPSLatitude    	( 0x3d );
-const TUint8 KSconExifGPSLongitude      ( 0x3e );
-const TUint8 KSconExifGPSAltitude       ( 0x3f );
-const TUint8 KSconExifBitDepth	        ( 0x40 );
-
-// fields for video
-const TUint8 KSconVideoFormat			( 0x01 );
-const TUint8 KSconVideoFrameRate		( 0x02 );
-const TUint8 KSconVideoFrameSizeWidth	( 0x03 );
-const TUint8 KSconVideoFrameSizeHeight	( 0x04 );
-const TUint8 KSconVideoVideoBitRate		( 0x05 );
-const TUint8 KSconVideoAudioBitRate		( 0x06 );
-const TUint8 KSconVideoDuration			( 0x07 );
-const TUint8 KSconVideoThumbnail		( 0x08 );
-const TUint8 KSconVideoAudioStreamMimetype	( 0x09 );
-const TUint8 KSconVideoVideoStreamMimetype	( 0x0a );
-
-#endif // _SCONMETADATAFIELDDEFS_H_
--- a/connectivitymodules/SeCon/services/pcd/inc/sconpcd.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CSConPCD service header
-*
-*/
-
-
-#ifndef _SCONPCD_H_
-#define _SCONPCD_H_
-
-// INCLUDES
-
-#include <e32base.h>
-#include <e32cons.h>
-#include <s32strm.h>
-
-#include "sconconmltask.h"
-
-class CSConInstallerQueue;
-class CSConBackupRestoreQueue;
-class CSconSyncHandler;
-
-enum TSConLastConMLOperation
-    {
-    ENoTask = 0,
-    EPutTask,
-    EGetReply
-    };
-
-//============================================================
-// Class CSConPCD declaration
-//============================================================
-class CSConPCD : public CBase
-    {
-    public:
-        /**
-         * Two-phase constructor
-         * @return CSConPCD instance
-         */
-        static CSConPCD* NewL();
-        /**
-         * Destructor
-         * @return none
-         */
-        ~CSConPCD();
-        /**
-         * Receives a new task
-         * @param aTask A new task
-         * @return KErrNone if no errors, else system wide error codes
-         */
-        virtual TInt PutTaskL( CSConTask*& aTask );
-        /**
-         * Returns a reply to previous PutTaskL operation
-         * @return CSConStatusReply if reply exists, else return NULL
-         */
-        virtual CSConStatusReply* GetReply();
-        /**
-         * Resets the module to the initial state
-         * @return none
-         */
-        virtual void ResetPCD();
-        
-        virtual void HandleGetSyncRequestL( const TDesC8& aRequest, RWriteStream& aResult, TInt aMaxObjectSize );
-        virtual void HandlePutSyncRequestL( const TDesC8& aRequest, RReadStream& aResult );
-    
-    private:        
-        /**
-         * Collects a status of a specified task / all tasks
-         * @param aTask The number of the specified task
-         * @param aAll If ETrue => receive status of all tasks
-         * @return KErrNone if no errors, else system wide error codes
-         */
-        TInt GetStatusL( TInt aTask, TBool aAll );
-        
-        /**
-         * Cancels a specified task / all tasks
-         * @param aTask The number of the specified task
-         * @param aAll If ETrue => receive status of all tasks
-         * @return KErrNone if no errors, else system wide error codes
-         */
-        TInt CancelL( TInt aTask, TBool aAll );
-        
-        /**
-         * Fills a reply with predefined supported task -information
-         * @param aTask The task
-         * @return KErrNone if no errors, else system wide error codes
-         */
-        TInt SupportedInstTaskL( CSConTask* aTask );
-        
-        /**
-         * Fills a reply with predefined supported task -information
-         * @param aTask The task
-         * @return KErrNone if no errors, else system wide error codes
-         */
-        TInt SupportedBRTaskL( CSConTask* aTask );
-        
-        /**
-         * Fills a reply with predefined Reboot task -information
-         * @param aTask The task
-         * @return KErrNone if no errors, else system wide error codes
-         */
-        TInt RebootTaskL( const CSConTask* aTask );
-        
-        /**
-         * Fills a reply with predefined GetMetadata task -information
-         * @param aTask The task
-         * @return none
-         */
-        void GetMetadataTaskL( CSConTask& aTask );
-        
-        /**
-         * Creates a reply for UpdateDeviceInfo task
-         * @param aMaxObjectSize A max object size to be used
-         * @return none
-         */
-        TInt UpdateDeviceInfoL( TInt aMaxObjectSize );
-        
-        /**
-         * Stores a reply
-         * @param aReply The reply to be stored
-         * @return none
-         */
-        void StoreReply( CSConStatusReply*& aReply );
-        
-        /**
-         * Constructor
-         * @return none
-         */
-        CSConPCD();
-        /**
-         * Initializes member data
-         * @return none
-         */
-        virtual void ConstructL();
-        
-    private:
-        CSConInstallerQueue*        iInstallerQueue;
-        CSConBackupRestoreQueue*    iBackupRestoreQueue;
-        CSConStatusReply*           iLatestReply;
-        TInt                        iTaskNumber;
-        TSConLastConMLOperation     iLastOperation;
-        RFs                         iFs;
-        CSconSyncHandler*           iSyncHandler;
-    }; 
-    
-    IMPORT_C CSConPCD* CreateCSConPCDL();
-    typedef CSConPCD* (*TSConCreateCSConPCDFunc) (); 
-
-#endif // SCONPCD
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/inc/sconpcdconsts.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CSConPCD constants
-*
-*/
-
-
-#ifndef _SCONPCDCONSTS_H
-#define _SCONPCDCONSTS_H
-
-// Timer value used for queue polling
-const TInt KSConTimerValue( 20000 );
-// ConML Status code: Task completed
-const TInt KSConCodeTaskCompleted( 200 );
-// ConML Status code: Task created
-const TInt KSConCodeTaskCreated( 201 );
-// ConML Status code: Task prcosessing started
-const TInt KSConCodeProcessingStarted( 202 );
-// ConML Status code: Task partially completed
-const TInt KSConCodeTaskPartiallyCompleted( 206 );
-// ConML Status code: Not found
-const TInt KSConCodeNotFound( 404 );
-// ConML Status code: Conflict
-const TInt KSConCodeConflict( 409 );
-// ConML Status code: Not supported
-const TInt KSConCodeNotSupported( 501 );
-// ConML Status code: Incompatible version
-const TInt KSConCodeIncompatible( 507 );
-// ConML Status code: Cancelled
-const TInt KSConCodeCancelled( 514 );
-// ConML Status code: No memory
-const TInt KSConCodeNoMemory( 420 );
-
-
-// ConML Status codes in installer errorcases
-const TInt KSConCodeInstErrUserCancel = KSConCodeCancelled; // User cancelled the operation
-const TInt KSConCodeInstErrFileCorrupted = 600; // File is corrupted
-const TInt KSConCodeInstErrInsufficientMemory = KSConCodeNoMemory; // Insufficient free memory in the drive to perform the operation
-const TInt KSConCodeInstErrPackageNotSupported = KSConCodeIncompatible; // Installation of the package is not supported
-const TInt KSConCodeInstErrSecurityFailure = 601; // Package cannot be installed due to security error
-const TInt KSConCodeInstErrMissingDependency = 602; // Package cannot be installed due to missing dependency
-const TInt KSConCodeInstErrFileInUse = 603; // Mandatory file is in use and prevents the operation
-const TInt KSConCodeInstErrGeneralError = 604; // Unknown error
-const TInt KSConCodeInstErrNoRights = 605; // The package has no rights to perform the operation
-const TInt KSConCodeInstErrNetworkFailure = 606; // Indicates that network failure aborted the operation
-const TInt KSConCodeInstErrBusy = 607; // Installer is busy doing some other operation
-const TInt KSConCodeInstErrAccessDenied = 608;  // Target location of package is not accessible
-const TInt KSConCodeInstUpgradeError = 609;  // The package is an invalid upgrade
-
-const TInt KSConCodeInstErrSifMissingBasePackage = 610;
-const TInt KSConCodeInstErrSifOverflow = 611;
-const TInt KSConCodeInstErrSifSameVersionAlreadyInstalled = 612;
-const TInt KSConCodeInstErrSifNewerVersionAlreadyInstalled = 613;
-const TInt KSConCodeInstErrSifAlreadyActivated = 614;
-const TInt KSConCodeInstErrSifAlreadyDeactivated = 615;
-const TInt KSConCodeInstErrSifBadComponentId = 616;
-const TInt KSConCodeInstErrSifBadInstallerConfiguration = 617;
-const TInt KSConCodeInstErrSifPackageCannotBeInstalledOnThisDevice = 618;
-const TInt KSConCodeInstErrSifUnsupportedLanguage = 619;
-const TInt KSConCodeInstErrScrWriteOperationInProgress = 620;
-const TInt KSConCodeInstErrScrReadOperationInProgress = 621;
-const TInt KSConCodeInstErrScrNoActiveTransaction = 622;
-const TInt KSConCodeInstErrScrUnsupportedLocale = 623;
-
-
-// ConML Status code: 1001...1050 System wide error code
-const TInt KSConCodeFirstSymbianErr( 1000 );
-
-struct SDeviceInfo
-	{
-	TSConMethodName method;
-	TBool support;
-	};
-
-// Supported Backup/Restore and Install methods	
-const SDeviceInfo KSupportedMethods[] =
-	{
-	{ EInstall, 			ETrue },
-	{ EUninstall, 			ETrue },
-	{ EListInstalledApps, 	ETrue },
-	{ EListDataOwners,		ETrue },
-	{ ESetBURMode, 			ETrue },
-	{ ESetInstParams,		ETrue },
-	{ EGetDataSize, 		ETrue },
-	{ ERequestData, 		ETrue },
-	{ ESupplyData, 			ETrue },
-	{ EReboot,				EFalse } // reboot not supported anymore (3.2 ->)
-	};
-	
-// Supported ConML version
-_LIT8( KConMLVersion, "2.0" );
-// SIS mime type for installer
-_LIT8( KSisMimeType, "x-epoc/x-sisx-app" );
-// Java mime type for installer
-_LIT8( KMidletMimeType, "application/java-archive" );
-
-#endif
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/inc/sconpcdutility.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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:  SConPcdUtility header file
-*
-*/
-
-
-#ifndef __CSCONPCDUTILITY_H__
-#define __CSCONPCDUTILITY_H__
-
-
-class CSConTask;
-class CSConInstApp;
-class CSConListInstApps;
-//============================================================
-// Class TSConPcdUtility declaration
-//============================================================  
-NONSHARABLE_CLASS ( SConPcdUtility )
-    {
-    public:     // Methods
-        
-		static void ProcessListInstalledAppsL( CSConTask*& aTask );
-        
-    private:    // Methods
-    	static void AppendInstalledSisL( CSConListInstApps& aListInstApps );
-    	static void AppendInstalledJavaL( CSConListInstApps& aListInstApps );
-    	static void AppendInstalledWidgetsL( CSConListInstApps& aListInstApps );
-        
-        /**
-         * Checks if package is installed to selected drive
-         * @param aSelectedDriveList selected drives
-         * @param aInstalledDrives package drivemask
-         * @return ETrue if package is installed to one of the drives on aDriveList
-         */
-        static TBool IsInstalledToSelectedDrive( const TDriveList& aSelectedDriveList, TUint aInstalledDrives );
-        
-    };
-
-#endif      //  __CSCONPCDUTILITY_H__
--- a/connectivitymodules/SeCon/services/pcd/inc/sconqueue.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/*
-* Copyright (c) 2005-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:  Queue header file
-*
-*/
-
-
-#ifndef _SCONQUEUE_H_
-#define _SCONQUEUE_H_
-
-// INCLUDES
-
-#include <e32base.h>
-#include <e32cons.h>
-
-#include "sconconmltask.h"
-
-class CSConAppInstaller;
-class CSConBackupRestore;
-class CSConInstallerQueue;
-class CSConBackupRestoreQueue;
-
-//============================================================
-// Class CSConTaskQueue declaration
-//============================================================	
-NONSHARABLE_CLASS ( CSConTaskQueue )
-	{
-	public:
-		/**
-		 * Destructor
-		 * @return none
-		 */
-		virtual ~CSConTaskQueue();
-		/**
-		 * Returns the status of a specified task / all tasks
-		 * @param aTask The task number
-		 * @param aAllTasks If ETrue => Receive status of all tasks
-		 * @param aStatus The reply
-    	 * @return none
-		 */
-		virtual void GetQueueStatusL( TInt aTask, TBool aAllTasks, 
-									CSConStatusReply*& aStatus );
-		/**
-		 * Adds a new task to queue
-		 * @param aNewTask A new task to be added
-		 * @param aTaskId The task number
-    	 * @return KErrNone if no errors, else system wide error codes
-		 */
-		virtual TInt AddNewTask( CSConTask*& aNewTask, TInt aTaskId );
-		/**
-		 * Set the task to completed -mode
-		 * @param aTask The task number
-		 * @param aError The task error code
-    	 * @return none
-		 */
-		virtual TInt CompleteTask( TInt aTask, TInt aError );
-		/**
-		 * Set the task progress value
-		 * @param aTask The task number
-		 * @param aProgressValue The progress value
-    	 * @return none
-		 */
-		virtual TInt SetTaskProgress( TInt aTask, TInt aProgressValue );
-		/**
-		 * Receives a specified task
-		 * @param aTaskId The task number
-		 * @param aTask The address to the task
-    	 * @return KErrNone if no errors, else system wide error codes
-		 */
-		virtual TInt GetTask( TInt aTaskId, CSConTask*& aTask );
-		/**
-		 * Removes a task from the queue
-		 * @param aTask The task number
-    	 * @return KErrNone if no errors, else system wide error codes
-		 */
-		virtual TInt RemoveTask( TInt aTask );	
-		/**
-		 * Cancels a task
-		 * @param aTask The task number
-		 * @param aAllTasks If ETrue => cancel all tasks
-    	 * @return none
-		 */	
-		virtual void CancelTask( TInt aTask, TBool aAllTasks );
-		/**
-		 * The status of the process
-    	 * @return ETrue if process active, else EFalse
-		 */
-		virtual TBool QueueProcessActive() const;
-		/**
-		 * Changes the status of the queue process
-    	 * @return none
-		 */
-		virtual void ChangeQueueProcessStatus();
-		/**
-		 * Resets the queue
-    	 * @return none
-		 */
-		virtual void Reset();		
-		/**
-		 * Compares task numbers
-		 * @param aFirst The first task
-		 * @param aSecon The second task
-    	 * @return -1 if the first task number is smaller than the second, 
-    	 * 1 the first task number is greater than the second, 0 if task 
-    	 * numbers are equal
-		 */
-		static TInt Compare( const CSConTask& aFirst, 
-							 const CSConTask& aSecond );
-		/**
-		 * Matches the task numbers
-		 * @param aFirst The first task
-		 * @param aSecon The second task
-    	 * @return ETrue if task numbers match, else EFalse
-		 */
-		static TBool Match( const CSConTask& aFirst, 
-							const CSConTask& aSecond );
-		
-	private:
-		/**
-		 * Pure virtual function for starting the queue observation
-		 * @return none
-		 */
-		virtual void StartQueue() = 0;
-		/**
-		 * Pure virtual function for stoping the queue observation
-		 * @return none
-		 */
-		virtual void StopQueue() = 0;
-		/**
-		 * Pure virtual function for polling the queue
-		 * @return none
-		 */
-		virtual void PollQueue() = 0;
-		
-	protected:
-		RPointerArray<CSConTask>	iQueue;
-		RTimer 						iTimer;
-		TBool						iQueueProcessActive;
-	};
-	
-#endif
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/inc/sconsbeclient.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,232 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CSConSBEClient header file
-*
-*/
-
-
-#ifndef _SCONSBECLIENT_H_
-#define _SCONSBECLIENT_H_
-
-// INCLUDES
-#include <connect/sbeclient.h>
-#include "sconconmltask.h"
-
-using namespace conn;
-
-//============================================================
-// Class CSConSBEClient declaration
-//============================================================
-NONSHARABLE_CLASS ( CSConSBEClient ) : public CActive
-    {
-    public:
-        /**
-         * Two-phase constructor
-         * @param aFs aReference to RFs connection.
-         * @return CSConSBEClient instance
-         */
-        static CSConSBEClient* NewL( RFs& aFs );
-        /**
-         * Destructor
-         * @return none
-         */
-        ~CSConSBEClient();
-        /**
-         * Set backup/restore mode
-         * @param aStatus TRequestStatus of the request
-         * @param aTask Task parameters
-         * @return none
-         */
-        void SetBURMode( TRequestStatus& aStatus, CSConTask*& aTask );
-        /**
-         * Lists public files from data owners
-         * @param aStatus TRequestStatus of the request
-         * @param aTask Task parameters
-         * @return none
-         */
-        void ListPublicFiles( TRequestStatus& aStatus, CSConTask*& aTask );
-        /**
-         * Lists participant data owners
-         * @param aStatus TRequestStatus of the request
-         * @param aTask Task parameters
-         * @return none
-         */
-        void ListDataOwners( TRequestStatus& aStatus, CSConTask*& aTask );
-        /**
-         * Lists data sizes from data owners
-         * @param aStatus TRequestStatus of the request
-         * @param aTask Task parameters
-         * @return none
-         */
-        void GetDataSize( TRequestStatus& aStatus, CSConTask*& aTask );
-        /**
-         * Request a data from a data owner
-         * @param aStatus TRequestStatus of the request
-         * @param aTask Task parameters
-         * @return none
-         */
-        void RequestData( TRequestStatus& aStatus, CSConTask*& aTask );
-        /**
-         * Lists the status of data owners
-         * @param aStatus TRequestStatus of the request
-         * @param aTask Task parameters
-         * @return none
-         */
-        void GetDataOwnerStatus( TRequestStatus& aStatus, CSConTask*& aTask );
-        /**
-         * Supplies a data to a data owner
-         * @param aStatus TRequestStatus of the request
-         * @param aTask Task parameters
-         * @return none
-         */
-        void SupplyData( TRequestStatus& aStatus, CSConTask*& aTask );
-    
-    private:
-        /**
-         * Constructor
-         * @param aFs aReference to RFs connection.
-         * @return none
-         */
-        CSConSBEClient( RFs& aFs );
-        
-        /**
-         * Implementation of CActive::DoCancel()
-         * @return none
-         */
-        void DoCancel();
-        /**
-         * Implementation of CActive::RunL()
-         * @return none
-         */
-        void RunL();
-        
-        /**
-         * Executes SetBURMode task
-         * @return none
-         */
-        void ProcessSetBURModeL();
-        /**
-         * Executes ListPublicFiles task
-         * @return none
-         */
-        void ProcessListPublicFilesL();
-        /**
-         * Executes ListDataOwners task
-         * @return none
-         */
-        void ProcessListDataOwnersL();
-        /**
-         * Executes GetDataSize task
-         * @return none
-         */
-        void ProcessGetDataSizeL();
-        /**
-         * Executes RequestData task
-         * @return KErrNone if no erros. Else system wide error codes.
-         */
-        TInt ProcessRequestDataL();
-		/**
-		 * Request data to iDataBuffer
-		 * @return none
-		 */
-		void RequestDataL( CSBGenericTransferType& aGenericTransferType );
-		/**
-         * Executes GetDataOwnerStatus task
-         * @return none
-         */
-        void ProcessGetDataOwnerStatusL();
-        /**
-         * Executes SupplyData task
-         * @return KErrNone if no errors. Else system wide error codes.
-         */
-        TInt ProcessSupplyDataL();
-        /**
-         * Maps TInt drive number to TDriveNumber
-         * @param aDrive Drive number as TInt
-         * @return drive number as TDriveNumber
-         */
-        TDriveNumber GetDriveNumber( TInt aDrive ) const;
-        /**
-         * Filters the drive list
-         * @param aDriveList Drive list to be filtered
-         * @return none
-         */     
-        void FilterDriveList( TDriveList& aDriveList ) const;
-        /**
-         * Matches the uids
-         * @param aFirst The first uid
-         * @param aSecon The second uid
-         * @return ETrue if uids match, else EFalse
-         */
-        static TBool Match( const TUid& aFirst, 
-                            const TUid& aSecond );
-        /**
-         * Handle error received from Secure Backup Engine
-         * @param aErr Error code from Secure Backup Engine
-         * @return none
-         */
-        void HandleSBEErrorL( TInt& aErr );
-        
-        /**
-         * Appends public files to CSConFile array.
-         * @param aFiles source files to append
-         * @param aSconFiles dataowner list where to add
-         * @return none
-         */
-        void AppendFilesToFilelistL( const RFileArray& aFiles, RPointerArray<CSConFile>& aSconFiles );
-        
-        /**
-         * Gets Package dataowner size
-         * @param aPackageId dataowner
-         * @param TDriveList drives to include
-         * @param TPackageDataType package data type 
-         * @return dataowner data size in specified drives
-         */
-        TUint PackageDataSizeL( TUid aPackageId, const TDriveList& aDriveList,
-                TPackageDataType aPackageDataType ) const;
-        
-        /**
-         * Gets Sid dataowner size
-         * @param aSid dataowner
-         * @param TDriveList drives to include
-         * @param TTransferDataType transfer data type 
-         * @return dataowner data size in specified drives
-         */
-        TUint SidDataSizeL( TUid aSid, const TDriveList& aDriveList,
-                TTransferDataType aTransferDataType ) const;
-        
-        /**
-         * Gets Java dataowner size
-         * @param aJavaHash Java hash value
-         * @param TDriveList drives to include
-         * @return dataowner data size in specified drives
-         */
-         TUint JavaDataSizeL( const TDesC& aJavaHash, const TDriveList& aDriveList ) const;
-         
-	private:
-		CSBEClient*						iSBEClient;
-		TRequestStatus* 				iCallerStatus;
-		CSConTask*						iCurrentTask;
-		TBool							iBURModeNormal;
-		TBool                           iRestoreMode;
-		RFs&                            iFs;
-		TBool                           iAllSnapshotsSuppliedCalled;
-		TBool                           iLastChunk;
-		CBufFlat*                       iDataBuffer;
-		TInt                            iDataBufferSize;
-	};
-
-#endif
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/inc/sconsynchandler.h	Tue Aug 31 15:05:37 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:  CSconSyncHandler header
-*
-*/
-
-
-#ifndef SCONSYNCHANDLER_H_
-#define SCONSYNCHANDLER_H_
-
-#include <e32base.h>
-#include <s32file.h>
-#include "sconsyncclient.h"
-
-class RFs;
-class RWriteStream;
-class RReadStream;
-class RFileReadStream;
-
-NONSHARABLE_CLASS( TCreatedItem )
-    {
-public:
-    TInt            iTemporaryId;
-    TInt            iErrorCode;
-    TSmlDbItemUid   iNewUid;
-    };
-
-NONSHARABLE_CLASS( TReplacedItem )
-    {
-public:
-    TSmlDbItemUid   iItemUid;
-    TInt            iErrorCode;
-    };
-
-NONSHARABLE_CLASS( CSconSyncHandler ) : public CActive
-{
-public:
-    static CSconSyncHandler* NewL( RFs& aFs );
-	~CSconSyncHandler();
-	
-	void HandleGetSyncRequestL( const TDesC8& aRequest, RWriteStream& aResult, TInt aMaxObjectSize );
-	void HandlePutSyncRequestL( const TDesC8& aRequest, RReadStream& aData );
-private:
-	CSconSyncHandler( RFs& aFs );
-	void ConstructL();
-	
-	void ListStoresL( RWriteStream& aResult );
-	void OpenStoreL( const TDesC8& aParams, RWriteStream& aResult );
-	void CloseStoreL( RWriteStream& aResult );
-	
-	void ListChangesL( RWriteStream& aResult );
-	void ResetChangeInfoL( RWriteStream& aResult );
-	void CommitChangesL( const TDesC8& aParams, RWriteStream& aResult );
-	void ReadItemsL( const TDesC8& aParams, RWriteStream& aResult );
-	void GetParentsL( const TDesC8& aParams, RWriteStream& aResult );
-	void CreateItemsL( RReadStream& aData );
-	void GetCreateItemsResponseL( const TDesC8& aParams, RWriteStream& aResult );
-	void ReplaceItemsL( RReadStream& aData );
-	void GetReplaceItemsResponseL( const TDesC8& aParams, RWriteStream& aResult );
-	void MoveItemsL( const TDesC8& aParams, RWriteStream& aResult );
-	void DeleteItemsL( const TDesC8& aParams, RWriteStream& aResult );
-	void SoftDeleteItemsL( const TDesC8& aParams, RWriteStream& aResult );
-	void DeleteAllItemsL( RWriteStream& aResult );
-	void GetDeleteAllItemsStatusL( RWriteStream& aResult );
-	void GetStoreFormatL( RWriteStream& aResult );
-	void SetRemoteStoreFormatL( RReadStream& aData );
-	
-	void CreateNextItemOnStreamL();
-	void ReplaceNextItemOnStreamL();
-	
-	void ReadNextDataBlockL( RWriteStream& aResult );
-	void ReadItemL( TSmlDbItemUid aUid, CBufFlat& aItemData );
-	
-	void LoadRemoteStoreFormatL( TInt aContextId, TInt aProviderId );
-	void SaveRemoteStoreFormatL( CSmlDataStoreFormat& aStoreFormat, TInt aContextId, TInt aProviderId );
-	
-	void CancelOperationsL( RWriteStream& aResult );
-	
-	void Reset();
-	
-	void SetCalendarCenrepL( TInt aProfileId, const TDesC& aServerId );
-	void ClearCalendarCenrepL();
-	
-private: // from CActive
-    void DoCancel();
-    void RunL();
-    TInt RunError( TInt aError );
-	
-private:
-    RFs&                    iFs; // Not owned
-    RSconSyncSession        iSyncSession;
-    TBool                   iConnected;
-    
-    TInt                    iCurrentDataProviderUid;
-    TInt                    iCurrentContextUid;
-    
-    CBufFlat*               iResponseData;
-    
-    enum TSyncStatus
-        {
-        EReady,
-        ECreatingItemsFromFile,
-        EItemsCreated,
-        EReplacingItemsFromFile,
-        EItemsReplaced,
-        EDeletingAllItems
-        };
-    TSyncStatus             iSyncStatus;
-    
-    TInt                    iMaxObjectSize;
-    TInt                    iBytesWrited;
-    TBool                   iHasFileStream;
-    RFileReadStream         iFileStream;
-    TSmlDbItemUid           iCreatedItemUid;
-    TPckg<TSmlDbItemUid>    iCreatedItemUidPckg;
-    TSmlDbItemUid           iTemporaryItemUid;
-    TInt                    iItemsLeftInStream;
-    TInt                    iItemInProgress; // =1 if item is in progress
-    RArray<TCreatedItem>    iCreatedItems;
-    RArray<TReplacedItem>   iReplacedItems;
-    RArray<TSmlDbItemUid>   iItemsToRead;
-    TReplacedItem           iReplacedItem;
-    TFileName               iFileInProgress;
-    TBool                   iCalendarCenrepUsed;
-};
-
-#endif /*SCONSYNCHANDLER_H_*/
--- a/connectivitymodules/SeCon/services/pcd/inc/sconvideoparser.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  CSConVideoParser header file
-*
-*/
-
-
-#ifndef SCONVIDEOPARSER_H
-#define SCONVIDEOPARSER_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <videoplayer.h>
-#include <TNEVideoClipInfo.h>
-#include "cscontimeout.h"
-
-// FORWARD DECLARATIONS
-class CVideoOperationObserver;
-class CVideoPlayerUtility;
-
-// CLASS DECLARATION
-
-//============================================================
-// Class CSConVideoParser declaration
-//============================================================  
-NONSHARABLE_CLASS( CSConVideoParser ) : public CBase,
-                                        public MVideoPlayerUtilityObserver,
-                                        public MTNEVideoClipInfoObserver,
-                                        public MTNEVideoClipThumbObserver,
-                                        private MTimeOutObserver
-{
-public: // Constructors and destructor
-
-    ~CSConVideoParser();
-    static CSConVideoParser* NewLC();
-    
-    /**
-    * Opens file
-    * @return none
-    */
-    void OpenFileL( const RFs& aFs, const TDesC& aFilename );
-    
-    /**
-    * Get video thumbnail
-    * @return video thumbnail in jpeg format,
-    *  return KNullDesC8 if thumbain could not found
-    */
-    const TDesC8& Thumbnail() const;
-    
-    /**
-    * Get video frame rate
-    * @return video frame rate frames/sec
-    */
-    TReal32 VideoFrameRateL() const;
-    
-    /**
-    * Get video frame size
-    * @return none
-    */
-    void VideoFrameSizeL(TSize& aSize) const;
-    
-    /**
-    * Get video format
-    * @return video format mimetype (example: video/mp4v-es) 
-    */
-    const TDesC8& VideoFormatMimeTypeL() const;
-    
-    /**
-    * Get videostream bitrate
-    * @return video bitrate bits/sec
-    */
-    TInt VideoBitRateL() const;
-    
-    /**
-    * Get audiostream bitrate
-    * @return audio bitrate bits/sec
-    */
-    TInt AudioBitRateL() const;
-    
-    /**
-    * Get video duration
-    * @return video duration in milliseconds.
-    */
-    TInt DurationL() const;
-    
-    /**
-    * Get videostream bitrate
-    * @return videostream mimetype
-    */
-    const TDesC& VideoMimeTypeL();
-    
-    /**
-    * Get audiostream mimetype
-    * @return audiostream mimetype
-    */
-    const TDesC& AudioMimeTypeL();
-    
-protected:  // from base classes
-    /** @see MVideoPlayerUtilityObserver::MvpuoOpenComplete */
-    void MvpuoOpenComplete(TInt aError);
-    
-    /** @see MVideoPlayerUtilityObserver::MvpuoPrepareComplete */
-    void MvpuoPrepareComplete(TInt aError);
-    
-    /** @see MVideoPlayerUtilityObserver::MvpuoFrameReady */
-    void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError);
-    
-    /** @see MVideoPlayerUtilityObserver::MvpuoPlayComplete */
-    void MvpuoPlayComplete(TInt aError);
-    
-    /** @see MVideoPlayerUtilityObserver::MvpuoEvent */
-    void MvpuoEvent(const TMMFEvent& aEvent);
-    
-    /** @see MTNEVideoClipInfoObserver::NotifyVideoClipInfoReady */
-    void NotifyVideoClipInfoReady(CTNEVideoClipInfo& aInfo, TInt aError);
-    
-    void NotifyVideoClipThumbCompleted(CTNEVideoClipInfo& aInfo, 
-            TInt aError, 
-            CFbsBitmap* aThumb);
-    
-    /** @see MTimeOutObserver::TimeOut */
-    void TimeOut();
-    
-private:
-    
-    CSConVideoParser();
-    void ConstructL();
-    
-private: // data
-    CVideoPlayerUtility* iVideoUtil;
-    CTNEVideoClipInfo*   iVideoClip;
-    
-    RWsSession          iWsSession;
-    CWsScreenDevice*    iScreen;
-    RWindow*            iWindow;
-    RWindowGroup        iRootWindow;
-    
-    TRequestStatus*     iCallerStatus;
-    CActiveSchedulerWait iWait;
-    CSconTimeOut*       iTimeOut;
-    
-    HBufC8* iThumbnail;
-    HBufC*  iVideoMimeType;
-    HBufC*  iAudioMimeType;
-    
-    TBool iVideoUtilReady;
-    TBool iVideoClipReady;
-    TInt iVideoUtilErr;
-    TInt iVideoClipErr;
-    TBool iAsyncStopCalled;
-};
-
-#endif // SCONVIDEOPARSER_H
-
--- a/connectivitymodules/SeCon/services/pcd/rom/sconpcd.iby	Tue Aug 31 15:05:37 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: Image description file for SConPCD.
-*
-*/
-#ifndef __SCONPCD_IBY__
-#define __SCONPCD_IBY__
-//file content
-
-file=ABI_DIR\BUILD_DIR\sconpcd.dll		system\libs\sconpcd.dll
-
-data=ZPRIVATE\10202D56\sbeconfig.xml	PRIVATE\10202D56\sbeconfig.xml
-
-#endif
--- a/connectivitymodules/SeCon/services/pcd/src/cscontimeout.cpp	Tue Aug 31 15:05:37 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:  CSconTimeOut implementation
-*
-*/
-
-
-#include "cscontimeout.h"
-
-CSconTimeOut::CSconTimeOut( MTimeOutObserver& aTimeOutObserver ) :
-    CActive(EPriorityStandard), // Standard priority
-    iTimeOutObserver(aTimeOutObserver)
-    {
-    }
-
-
-CSconTimeOut* CSconTimeOut::NewL( MTimeOutObserver& aTimeOutObserver )
-    {
-    CSconTimeOut* self = new (ELeave) CSconTimeOut( aTimeOutObserver );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-void CSconTimeOut::ConstructL()
-    {
-    User::LeaveIfError(iTimer.CreateLocal()); // Initialize timer
-    CActiveScheduler::Add(this); // Add to scheduler
-    }
-
-CSconTimeOut::~CSconTimeOut()
-    {
-    Cancel(); // Cancel any request, if outstanding
-    iTimer.Close(); // Destroy the RTimer object
-    }
-
-void CSconTimeOut::DoCancel()
-    {
-    iTimer.Cancel();
-    }
-
-void CSconTimeOut::Start(TTimeIntervalMicroSeconds32 aDelay)
-    {
-    Cancel(); // Cancel any request, just to be sure
-    iTimer.After(iStatus, aDelay); // Set for later
-    SetActive(); // Tell scheduler a request is active
-    }
-
-void CSconTimeOut::RunL()
-    {
-    iTimeOutObserver.TimeOut();
-    }
-
-TInt CSconTimeOut::RunError(TInt aError)
-    {
-    return aError;
-    }
--- a/connectivitymodules/SeCon/services/pcd/src/sconbackuprestore.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CSConBackupRestore implementation
-*
-*/
-
-
-// INCLUDE FILES
-#include <pathinfo.h>
-
-#include "sconbackuprestore.h"
-#include "sconsbeclient.h"
-#include "sconbrqueue.h"
-#include "sconpcdconsts.h"
-
-#include "debug.h"
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-
-// -----------------------------------------------------------------------------
-// CSConBackupRestore* CSConBackupRestore::NewL( CSConBackupRestoreQueue* aQueue,
-//                                          cost TInt& aMaxObjectSize )
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CSConBackupRestore* CSConBackupRestore::NewL( CSConBackupRestoreQueue* aQueue,
-                                              RFs& aFs )
-    {
-    CSConBackupRestore* self = new (ELeave) CSConBackupRestore( aQueue, aFs );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConBackupRestore::CSConBackupRestore( CSConBackupRestoreQueue* aQueue )
-// Constructor
-// -----------------------------------------------------------------------------
-//
-CSConBackupRestore::CSConBackupRestore( CSConBackupRestoreQueue* aQueue, RFs& aFs ) : 
-            CActive( EPriorityStandard ), iQueue( aQueue ), iFs( aFs )
-    {
-    CActiveScheduler::Add( this );
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConBackupRestore::ConstructL( const TInt aMaxObjectSize )
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestore::ConstructL()
-    {
-    iSBEClient = CSConSBEClient::NewL( iFs );
-    }   
-    
-// -----------------------------------------------------------------------------
-// CSConBackupRestore::~CSConBackupRestore()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConBackupRestore::~CSConBackupRestore()
-    {
-    if( iSBEClient )
-        {
-        iSBEClient->Cancel();
-        delete iSBEClient;
-        iSBEClient = NULL;
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConBackupRestore::StartBackupRestore( TInt aTaskId )
-// Starts backup-restore task
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestore::StartBackupRestore( TInt aTaskId )
-    {
-    iBackupRestoreActive = ETrue;
-    CSConTask* task = NULL;
-    
-    TInt ret = iQueue->GetTask( aTaskId, task );
-
-    if( aTaskId > 0 && ret != KErrNotFound )
-        {
-        iCurrentTask = aTaskId;
-        iQueue->SetTaskProgress( aTaskId, KSConCodeProcessingStarted );
-        }
-    
-    switch( task->GetServiceId() )
-        {
-        case ESetBURMode :
-            iQueue->ChangeQueueProcessStatus();
-            iSBEClient->SetBURMode( iStatus, task );
-            break;
-        case EListPublicFiles :
-            iSBEClient->ListPublicFiles( iStatus, task );
-            break;
-        case EListDataOwners :
-            iSBEClient->ListDataOwners( iStatus, task );
-            break;
-        case EGetDataSize :
-            iSBEClient->GetDataSize( iStatus, task );
-            break;
-        case ERequestData :
-            iSBEClient->RequestData( iStatus, task );
-            break;
-        case EGetDataOwnerStatus :
-            iSBEClient->GetDataOwnerStatus( iStatus, task );
-            break;
-        case ESupplyData :
-            iSBEClient->SupplyData( iStatus, task );
-            break;      
-        default :
-            break;
-        }
-    
-    SetActive();    
-    }
-
-// -----------------------------------------------------------------------------
-// CSConBackupRestore::StopBackupRestore( TInt aTaskId )
-// Stops executing backup-restore task
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestore::StopBackupRestore( TInt aTaskId )
-    {
-    TRACE_FUNC_ENTRY;
-     //if the task is active, do cancel
-     if( iCurrentTask == aTaskId )
-        {
-        iBackupRestoreActive = EFalse;
-        iSBEClient->Cancel();
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConBackupRestore::Reset()
-// Resets backup
-// -----------------------------------------------------------------------------
-//  
-void CSConBackupRestore::Reset()
-    {
-    TRACE_FUNC_ENTRY;
-    if( iSBEClient )
-        {
-        iSBEClient->Cancel();
-        delete iSBEClient;
-        iSBEClient = NULL;
-        }
-        
-    TRAP_IGNORE( iSBEClient = CSConSBEClient::NewL( iFs ) );
-    
-    iBackupRestoreActive = EFalse;
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConBackupRestore::BackupRestoreActive()
-// returns backup-restore activity status
-// -----------------------------------------------------------------------------
-//
-TBool CSConBackupRestore::BackupRestoreActive() const
-	{
-	return iBackupRestoreActive;
-	}
-// -----------------------------------------------------------------------------
-// CSConBackupRestore::DoCancel()
-// Implementation of CActive::DoCancel()
-// -----------------------------------------------------------------------------
-//  
-void CSConBackupRestore::DoCancel()
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConBackupRestore::RunL()
-// Implementation of CActive::RunL()
-// -----------------------------------------------------------------------------
-//          
-void CSConBackupRestore::RunL()
-    {
-    TRACE_FUNC;
-    iQueue->CompleteTask( iCurrentTask, iStatus.Int() );
-    iBackupRestoreActive = EFalse;
-    }
-    
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/src/sconbrqueue.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,253 +0,0 @@
-/*
-* Copyright (c) 2005-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:  Backup-Restore Queue implementation
-*
-*/
-
-
-// INCLUDE FILES
-#include "sconbrqueue.h"
-#include "sconbackuprestore.h"
-#include "sconpcdconsts.h"
-#include "sconinstqueue.h"
-#include "debug.h"
-
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::NewL( RFs& aFs )
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CSConBackupRestoreQueue* CSConBackupRestoreQueue::NewL( RFs& aFs )
-	{
-	CSConBackupRestoreQueue* self = new (ELeave) CSConBackupRestoreQueue();
-	CleanupStack::PushL( self );
-	self->ConstructL( aFs );
-	CleanupStack::Pop( self );
-    return self;
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::CSConBackupRestoreQueue()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConBackupRestoreQueue::CSConBackupRestoreQueue() : 
-					CActive( EPriorityStandard )
-	{
-    CActiveScheduler::Add( this );
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::ConstructL( RFs& aFs )
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestoreQueue::ConstructL( RFs& aFs )
-	{
-	iBackupRestore = CSConBackupRestore::NewL( this, aFs );
-	User::LeaveIfError( iTimer.CreateLocal() );
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::~CSConBackupRestoreQueue()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConBackupRestoreQueue::~CSConBackupRestoreQueue()
-	{
-	TRACE_FUNC_ENTRY;
-	Cancel();
-	if( iBackupRestore )
-		{
-		delete iBackupRestore;
-		iBackupRestore = NULL;
-		}
-	
-	TRACE_FUNC_EXIT;
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::StartQueue()
-// Starts queue polling
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestoreQueue::StartQueue()	
-	{
-	if( IsActive() )
-		{
-		Cancel();
-		}
-		
-	iTimer.After( iStatus, KSConTimerValue );
-	SetActive();
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::StopQueue()
-// Stops queue polling
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestoreQueue::StopQueue()	
-	{
-	iTimer.Cancel();
-	}
-
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::AddNewTask( CSConTask*& aNewTask, TInt aTaskId )
-// Adds a new task to queue
-// -----------------------------------------------------------------------------
-//
-TInt CSConBackupRestoreQueue::AddNewTask( CSConTask*& aNewTask, TInt aTaskId )
-	{
-	LOGGER_WRITE_1( "CSConBackupRestoreQueue::AddNewTask aTaskId: %d", aTaskId );
-	TInt ret( KErrNone );
-	
-	aNewTask->iTaskId = aTaskId;
-	
-	//Set progress value "task accepted for execution"
-	aNewTask->SetProgressValue( KSConCodeTaskCreated );
-	aNewTask->SetCompleteValue( EFalse );
-	
-	//For RequestData and SupplyData
-	if( iQueue.Find( aNewTask, CSConTaskQueue::Match ) != KErrNotFound )
-		{
-		RemoveTask( aTaskId );
-		}
-	
-	if( iQueue.Count() == 0 )
-		{
-		StartQueue();
-		}
-
-	ret = iQueue.InsertInOrder( aNewTask, CSConTaskQueue::Compare );
-	return ret;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::CancelTask( TInt aTask, TBool aAllTasks )
-// Cancels a task
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestoreQueue::CancelTask( TInt aTask, TBool aAllTasks )
-	{
-	TRACE_FUNC_ENTRY;
-	//Stop backup/restore
-	if( aTask && !aAllTasks )
-		{
-		LOGGER_WRITE_1("CSConBackupRestoreQueue::CancelTask - Cancel task: %d", aTask);
-		iBackupRestore->StopBackupRestore( aTask );
-		}
-	
-	if( aAllTasks )
-		{
-		LOGGER_WRITE("CSConBackupRestoreQueue::CancelTask - Cancel All");
-		iBackupRestore->Cancel();
-		iBackupRestore->Reset();
-		}
-		
-	CSConTaskQueue::CancelTask( aTask, aAllTasks );
-	TRACE_FUNC_EXIT;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::Reset()
-// Resets the queue
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestoreQueue::Reset()
-	{
-	TRACE_FUNC_ENTRY;
-	CSConTaskQueue::Reset();
-	iBackupRestore->Reset();
-	TRACE_FUNC_EXIT;
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::QueueAddress( CSConInstallerQueue*& aTaskQueue )
-// An address pointer to another queue
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestoreQueue::QueueAddress( CSConInstallerQueue*& aTaskQueue )
-	{
-	iInstQueueAddress = aTaskQueue;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::GetTaskMethod( TInt& aTaskId )
-// Returns the task type
-// -----------------------------------------------------------------------------
-//		
-TSConMethodName CSConBackupRestoreQueue::GetTaskMethodL( TInt aTaskId )
-	{
-	TRACE_FUNC_ENTRY;
-	CSConTask* task = NULL;
-	User::LeaveIfError( CSConTaskQueue::GetTask( aTaskId, task ) );
-	LOGGER_WRITE_1( "CSConBackupRestoreQueue::GetTaskMethodL( TInt aTaskId ) : returned %d",
-        task->GetServiceId() );
-	return task->GetServiceId();
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConBackupRestoreQueue::PollQueue()
-// Polls queue
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestoreQueue::PollQueue()
-	{
-	// find and start next task if BR and installer is inactive
-	if( !iBackupRestore->BackupRestoreActive()
-		&& !iInstQueueAddress->QueueProcessActive() )
-		{
-		//find next task
-		for( TInt i = 0; i < iQueue.Count(); i++ )
-			{
-			TBool complete = iQueue[i]->GetCompleteValue();
-			
-			if( complete == EFalse )
-				{
-				iBackupRestore->StartBackupRestore( 
-				iQueue[i]->iTaskId );
-				i = iQueue.Count() + 1; // jump out from loop
-				}
-			}
-		}
-	}
-
-// -----------------------------------------------------------------------------
-// Implementation of CActive::DoCancel()
-// Entry to CSConPCD
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestoreQueue::DoCancel()
-	{
-	TRACE_FUNC_ENTRY;
-	iTimer.Cancel();
-	TRACE_FUNC_EXIT;
-	}
-	
-// -----------------------------------------------------------------------------
-// Implementation of CActive::RunL()
-// Entry to CSConPCD
-// -----------------------------------------------------------------------------
-//
-void CSConBackupRestoreQueue::RunL()
-	{
-	if( iQueue.Count() > 0 )
-		{
-		PollQueue();
-		StartQueue();
-		}
-	}
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/src/sconinstaller.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,506 +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:  CSConAppInstaller implementation
-*
-*/
-
-
-// INCLUDE FILES
-#include <s32mem.h> // For RBufWriteStream
-#include <utf.h>  // for CnvUtfConverter
-//#include <pathinfo.h>
-#include <usif/sif/sifcommon.h>
-
-using namespace Usif;
-
-#include "debug.h"
-#include "sconinstaller.h"
-#include "sconpcdconsts.h"
-#include "sconpcdutility.h"
-
-
-const TInt KSConSeConUidValue = 0x101f99f6;
-const TUid KSConSeConUid = {KSConSeConUidValue};
-
-_LIT8(KValSep, "=");
-_LIT8(KComma, ",");
-_LIT8(KLineEnd, "\r\n");
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-CSConAppInstaller* CSConAppInstaller::NewL( CSConInstallerQueue* aQueue, RFs& aFs )
-    {
-    CSConAppInstaller* self = new (ELeave) CSConAppInstaller( aQueue, aFs );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::CSConAppInstaller( CSConInstallerQueue* aQueue )
-// Constructor
-// -----------------------------------------------------------------------------
-//
-CSConAppInstaller::CSConAppInstaller( CSConInstallerQueue* aQueue, RFs& aFs ) :
-    CActive( EPriorityStandard ), iQueue( aQueue ), iFs( aFs )
-    {
-    CActiveScheduler::Add( this );
-    }
-
-void CSConAppInstaller::ConstructL()
-    {
-    iSifOptions = COpaqueNamedParams::NewL();
-    iSifResults = COpaqueNamedParams::NewL();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::~CSConAppInstaller()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConAppInstaller::~CSConAppInstaller()
-    {
-    TRACE_FUNC;
-    Cancel();
-    iSwInstaller.Close();
-    delete iSifOptions;
-    delete iSifResults;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::StartInstaller( TInt& aTaskId )
-// Starts the installer task
-// -----------------------------------------------------------------------------
-//
-void CSConAppInstaller::StartInstaller( TInt& aTaskId )
-    {
-    TRACE_FUNC_ENTRY;
-    CSConTask* task = NULL;
-    TRequestStatus* status = NULL;
-    TInt err( KErrNone );
-    
-    TInt ret = iQueue->GetTask( aTaskId, task );
-    
-    if( aTaskId > 0 && ret != KErrNotFound )
-        {
-        if ( IsActive() )
-            {
-            LOGGER_WRITE("WARNING! SConAppInstaller was not on idle state!");
-            iQueue->CompleteTask( aTaskId, KErrInUse );
-            TRACE_FUNC_EXIT;
-            return;
-            }
-        
-        
-        iCurrentTask = aTaskId;
-        iQueue->SetTaskProgress( aTaskId, KSConCodeProcessingStarted );
-        
-        switch( task->GetServiceId() )
-            {
-            case EInstall :
-                iQueue->ChangeQueueProcessStatus();
-                err = iSwInstaller.Connect();
-                if( err == KErrNone )
-                    {
-                    TRAP(err, ProcessInstallL( *task->iInstallParams ));
-                    if( err != KErrNone )
-                        {
-                        LOGGER_WRITE_1( "StartInstaller ProcessInstallL err: %d", err );
-                        iStatus = KRequestPending;
-                        SetActive();
-                        status = &iStatus;
-                        User::RequestComplete( status, err );
-                        }
-                    }
-                
-                break;
-            case EUninstall :
-                iQueue->ChangeQueueProcessStatus();
-                err = iSwInstaller.Connect();
-                if( err == KErrNone )
-                    {
-                    LOGGER_WRITE( "Begin to uninstall.. " );
-                    
-                    TRAP( err, ProcessUninstallL( *task->iUninstallParams ) );
-                    if( err != KErrNone )
-                        {
-                        LOGGER_WRITE_1( "StartInstaller ProcessUninstallL err: %d", err );
-                        iStatus = KRequestPending;
-                        SetActive();
-                        status = &iStatus;
-                        User::RequestComplete( status, err );
-                        }
-                    }
-                
-                break;
-            case EListInstalledApps :
-                iQueue->ChangeQueueProcessStatus();
-                iStatus = KRequestPending;
-                SetActive();
-                TRAP( err, ProcessListInstalledAppsL() );
-                status = &iStatus;
-                User::RequestComplete( status, err );
-                break;
-            default :
-                break;
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::StopInstaller( TInt& aTaskId )
-// Stops the installer task
-// -----------------------------------------------------------------------------
-//
-void CSConAppInstaller::StopInstaller( TInt& aTaskId )
-    {
-    TRACE_FUNC_ENTRY;
-    //If the task is the current task, cancel it first
-    if( iCurrentTask == aTaskId )
-        {
-        Cancel();
-        iSwInstaller.Close();
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// TBool CSConAppInstaller::InstallerActive()
-// returns installer activity status
-// -----------------------------------------------------------------------------
-//
-TBool CSConAppInstaller::InstallerActive() const
-    {
-    return IsActive();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::DoCancel()
-// Implementation of CActive::DoCancel()
-// -----------------------------------------------------------------------------
-//
-void CSConAppInstaller::DoCancel()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    LOGGER_WRITE("Cancel iSwInstaller");
-    iSwInstaller.CancelOperation();
-    /*
-    // find and complete current task
-    CSConTask* task = NULL;
-    TInt ret = iQueue->GetTask( iCurrentTask, task );
-
-    if ( iCurrentTask > 0 && ret != KErrNotFound )
-        {
-
-        switch( task->GetServiceId() )
-            {
-            case EInstall :
-                iQueue->CompleteTask( iCurrentTask, KErrCancel );
-                break;
-            case EUninstall :
-                iQueue->CompleteTask( iCurrentTask, KErrCancel );
-                break;
-            default :
-                break;
-            }
-        }
-        */
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::RunL()
-// Implementation of CActive::RunL()
-// -----------------------------------------------------------------------------
-//
-void CSConAppInstaller::RunL()
-    {
-    TRACE_FUNC_ENTRY;
-    iSwInstaller.Close();
-    iQueue->ChangeQueueProcessStatus();
-    TInt err( iStatus.Int() );
-    LOGGER_WRITE_1( "CSConAppInstaller::RunL() iStatus.Int() : returned %d", err );
-    
-    CSConTask* task = NULL;
-    TInt taskErr = iQueue->GetTask( iCurrentTask, task );
-    if( taskErr == KErrNone )
-        {
-        if ( task->GetServiceId() == EInstall || task->GetServiceId() == EUninstall )
-            {
-            TRAPD(dataErr, WriteTaskDataL( *task ));
-            if (dataErr)
-                {
-                LOGGER_WRITE_1("WriteTaskDataL err: %d", dataErr);
-                }
-            }
-        
-        if( task->GetServiceId() == EInstall && err == KErrNone )
-            {
-            LOGGER_WRITE( "CSConAppInstaller::RunL() : before DeleteFile" );
-            //delete sis after succesfull install
-            DeleteFile( task->iInstallParams->iPath );
-            }
-        }
-    
-    iQueue->CompleteTask( iCurrentTask, err );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::WriteTaskDataL()
-// Writes data to task
-// -----------------------------------------------------------------------------
-//
-void CSConAppInstaller::WriteTaskDataL( CSConTask& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    CBufFlat* buffer = CBufFlat::NewL(200);
-    CleanupStack::PushL(buffer);
-    RBufWriteStream stream( *buffer );
-    CleanupClosePushL( stream );
-    
-    ExternalizeResultArrayIntValL( KSifOutParam_ComponentId , stream);
-    ExternalizeResultIntValL( KSifOutParam_ErrCategory , stream);
-    ExternalizeResultIntValL( KSifOutParam_ErrCode , stream);
-    ExternalizeResultIntValL( KSifOutParam_ExtendedErrCode , stream);
-    ExternalizeResultStringValL( KSifOutParam_ErrMessage , stream);
-    ExternalizeResultStringValL( KSifOutParam_ErrMessageDetails , stream);
-    
-    stream.CommitL();
-    
-    buffer->Compress();
-    
-    HBufC8* data = HBufC8::NewL( buffer->Size() );
-    TPtr8 dataPtr = data->Des();
-    buffer->Read( 0, dataPtr, buffer->Size() );
-    
-    if ( aTask.GetServiceId() == EInstall )
-        {
-        if ( aTask.iInstallParams->iData )
-            {
-            delete aTask.iInstallParams->iData;
-            aTask.iInstallParams->iData = NULL;
-            }
-        aTask.iInstallParams->iData = data;
-        data = NULL;
-        }
-    else if ( aTask.GetServiceId() == EUninstall )
-        {
-        if ( aTask.iUninstallParams->iData )
-            {
-            delete aTask.iUninstallParams->iData;
-            aTask.iUninstallParams->iData = NULL;
-            }
-        aTask.iUninstallParams->iData = data;
-        data = NULL;
-        }
-    else
-        {
-        delete data;
-        data = NULL;
-        }
-    
-    CleanupStack::PopAndDestroy( &stream );
-    CleanupStack::PopAndDestroy( buffer );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSConAppInstaller::ExternalizeResultArrayIntValL( const TDesC& aName, RWriteStream& aStream )
-    {
-    TRACE_FUNC_ENTRY;
-    RArray<TInt> valueArray;
-    TRAPD(err, valueArray = iSifResults->IntArrayByNameL(aName));
-    if ( !err && valueArray.Count() > 0 )
-        {
-        LOGGER_WRITE_1("count: %d", valueArray.Count());
-        TBuf8<100> nameBuf;
-        err = CnvUtfConverter::ConvertFromUnicodeToUtf8( nameBuf, aName );
-        if (!err)
-            {
-            LOGGER_WRITE("2");
-            aStream.WriteL( nameBuf, nameBuf.Length() );
-            aStream.WriteL( KValSep, 1 );
-            aStream.WriteInt32L( valueArray[0] );
-            for (TInt i=1; i<valueArray.Count(); i++)
-                {
-                aStream.WriteL( KComma, 1 );
-                aStream.WriteInt32L( valueArray[i] );
-                }
-            aStream.WriteL( KLineEnd, 2 );
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::ExternalizeResultIntValL()
-// Read integer value and write it to stream
-// -----------------------------------------------------------------------------
-//
-void CSConAppInstaller::ExternalizeResultIntValL( const TDesC& aName, RWriteStream& aStream )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt value;
-    TBool found(EFalse);
-    found = iSifResults->GetIntByNameL(aName, value);
-
-    if (found)
-        {
-        TBuf8<100> nameBuf;
-        TInt err = CnvUtfConverter::ConvertFromUnicodeToUtf8( nameBuf, aName );
-        if (!err)
-            {
-            aStream.WriteL( nameBuf, nameBuf.Length() );
-            aStream.WriteL( KValSep, 1 );
-            aStream.WriteInt32L( value );
-            aStream.WriteL( KLineEnd, 2 );
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::ExternalizeResultStringValL()
-// Read string value and write it to stream
-// -----------------------------------------------------------------------------
-//
-void CSConAppInstaller::ExternalizeResultStringValL( const TDesC& aName, RWriteStream& aStream )
-    {
-    TRACE_FUNC_ENTRY;
-    const TDesC& strValue = iSifResults->StringByNameL( aName );
-    if (strValue.Length() > 0)
-        {
-        TBuf8<100> nameBuf;
-        TInt err = CnvUtfConverter::ConvertFromUnicodeToUtf8( nameBuf, aName );
-        if (!err)
-            {
-            HBufC8* nameVal = CnvUtfConverter::ConvertFromUnicodeToUtf8L( strValue );
-            CleanupStack::PushL( nameVal );
-            aStream.WriteL( nameBuf, nameBuf.Length() );
-            aStream.WriteL( KValSep, 1 );
-            aStream.WriteL( nameVal->Des(), nameVal->Length() );
-            aStream.WriteL( KLineEnd, 2 );
-            CleanupStack::PopAndDestroy( nameVal );
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::ProcessInstallL()
-// Executes Install task
-// -----------------------------------------------------------------------------
-//
-void CSConAppInstaller::ProcessInstallL( const CSConInstall& aInstallParams )
-    {
-    TRACE_FUNC_ENTRY;
-    iSifOptions->Cleanup();
-    iSifResults->Cleanup();
-    
-    if ( aInstallParams.iMode == ESilentInstall )
-        {
-        LOGGER_WRITE( "Begin silent installation.. " );
-        
-        iSifOptions->AddIntL( Usif::KSifInParam_InstallSilently, ETrue );
-        iSifOptions->AddIntL( Usif::KSifInParam_PerformOCSP, EFalse );   
-        // Note if upgrade is allowed, see NeedsInstallingL function.
-        iSifOptions->AddIntL( Usif::KSifInParam_AllowUpgrade, ETrue );
-        iSifOptions->AddIntL( Usif::KSifInParam_AllowUntrusted, EFalse );
-        iSifOptions->AddIntL( Usif::KSifInParam_GrantCapabilities, EFalse ); 
-        // Defined for the install.
-        iSifOptions->AddIntL( Usif::KSifInParam_InstallOptionalItems, ETrue );          
-        iSifOptions->AddIntL( Usif::KSifInParam_IgnoreOCSPWarnings, ETrue );            
-        iSifOptions->AddIntL( Usif::KSifInParam_AllowAppShutdown, ETrue );
-        iSifOptions->AddIntL( Usif::KSifInParam_AllowDownload, ETrue );
-        iSifOptions->AddIntL( Usif::KSifInParam_AllowOverwrite, ETrue );
-
-        iSwInstaller.Install( aInstallParams.iPath, *iSifOptions,
-                *iSifResults, iStatus, ETrue );
-        }
-    else
-        {
-        LOGGER_WRITE( "Begin to install.. " );
-        
-        iSwInstaller.Install( aInstallParams.iPath, *iSifOptions,
-                *iSifResults, iStatus, ETrue );
-        }
-    SetActive();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::ProcessUninstallL( const CSConUninstall& aUninstallParams )
-// Executes UnInstall task
-// -----------------------------------------------------------------------------
-//
-void CSConAppInstaller::ProcessUninstallL( const CSConUninstall& aUninstallParams )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aUid: 0x%08x", aUninstallParams.iUid.iUid );
-    LOGGER_WRITE_1( "aName: %S", &aUninstallParams.iName );
-    LOGGER_WRITE_1( "aVendor: %S", &aUninstallParams.iVendor );
-    LOGGER_WRITE_1( "aType: %d", aUninstallParams.iType );
-    LOGGER_WRITE_1( "aMode: %d", aUninstallParams.iMode );
-    
-    if ( aUninstallParams.iUid == KSConSeConUid )
-	    {
-	    LOGGER_WRITE("Cannot uninstall itself, leave");
-	    // cannot uninstall itself
-	    User::Leave( KErrInUse ); //SwiUI::KSWInstErrFileInUse );
-	    }
-    TComponentId componentId = aUninstallParams.iUid.iUid;
-    iSifOptions->Cleanup();
-    iSifResults->Cleanup();
-    
-    if ( aUninstallParams.iMode == ESilentInstall)
-        {
-        iSifOptions->AddIntL( Usif::KSifInParam_InstallSilently, ETrue );
-        iSwInstaller.Uninstall( componentId, *iSifOptions, *iSifResults, iStatus, ETrue );
-        }
-    else
-        {
-        iSwInstaller.Uninstall( componentId, *iSifOptions, *iSifResults, iStatus, ETrue );
-        }
-    SetActive();
-    TRACE_FUNC_EXIT;
-    }
-    
-//--------------------------------------------------------------------------------
-//void CSConAppInstaller::ProcessListInstalledAppsL()
-//--------------------------------------------------------------------------------
-//
-void CSConAppInstaller::ProcessListInstalledAppsL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    CSConTask* task = NULL;
-    User::LeaveIfError( iQueue->GetTask( iCurrentTask, task ) );
-    
-    SConPcdUtility::ProcessListInstalledAppsL( task );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConAppInstaller::DeleteFile( const TDesC& aPath )
-// Deletes a file 
-// -----------------------------------------------------------------------------
-//  
-void CSConAppInstaller::DeleteFile( const TDesC& aPath )    
-    {
-    TRACE_FUNC;
-    iFs.Delete( aPath );
-    }
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/src/sconinstqueue.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,201 +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:  Installer Queue implementation
-*
-*/
-
-
-// INCLUDE FILES
-#include "sconinstqueue.h"
-#include "sconbrqueue.h"
-#include "sconinstaller.h"
-#include "sconpcdconsts.h"
-#include "debug.h"
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CCSConInstallerQueue* CSConInstallerQueue::NewL()
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CSConInstallerQueue* CSConInstallerQueue::NewL( RFs& aFs )
-	{
-	TRACE_FUNC_ENTRY;
-	CSConInstallerQueue* self = new (ELeave) CSConInstallerQueue( aFs );
-	CleanupStack::PushL( self );
-	self->ConstructL();
-	CleanupStack::Pop( self );
-	TRACE_FUNC_EXIT;
-    return self;
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConInstallerQueue::CSConInstallerQueue()
-// Constructor
-// -----------------------------------------------------------------------------
-//
-CSConInstallerQueue::CSConInstallerQueue( RFs& aFs ) : CActive( EPriorityStandard ), iFs( aFs )
-	{
-    CActiveScheduler::Add( this );
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConInstallerQueue::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CSConInstallerQueue::ConstructL()
-	{
-	TRACE_FUNC_ENTRY;
-	iInstaller = CSConAppInstaller::NewL( this, iFs );
-	User::LeaveIfError( iTimer.CreateLocal() );
-	TRACE_FUNC_EXIT;
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConInstallerQueue::~CSConInstallerQueue()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConInstallerQueue::~CSConInstallerQueue()
-	{
-	TRACE_FUNC_ENTRY;
-	Cancel();
-	if( iInstaller )
-		{
-		iInstaller->Cancel();
-		delete iInstaller;
-		iInstaller = NULL;
-		}
-	TRACE_FUNC_EXIT;
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConInstallerQueue::StartQueue()
-// Starts queue polling
-// -----------------------------------------------------------------------------
-//
-void CSConInstallerQueue::StartQueue()
-	{
-	TRACE_FUNC;
-	if( IsActive() )
-		{
-		Cancel();
-		}
-		
-	iTimer.After( iStatus, KSConTimerValue );
-	SetActive();
-	}
-	
-// -----------------------------------------------------------------------------
-// CSConInstallerQueue::StartQueue()
-// Stops queue polling
-// -----------------------------------------------------------------------------
-//
-void CSConInstallerQueue::StopQueue()	
-	{
-	TRACE_FUNC_ENTRY;
-	iTimer.Cancel();
-	TRACE_FUNC_EXIT;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConInstallerQueue::CancelTask( TInt aTask, TBool aAllTasks )
-// Cancels a task
-// -----------------------------------------------------------------------------
-//
-void CSConInstallerQueue::CancelTask( TInt aTask, TBool aAllTasks )
-	{
-	TRACE_FUNC_ENTRY;
-	//Stop the installer
-	if( aTask && !aAllTasks )
-		{
-		iInstaller->StopInstaller( aTask );
-		}
-	
-	if( aAllTasks )
-		{
-		iInstaller->Cancel();
-		}
-	CSConTaskQueue::CancelTask( aTask, aAllTasks );
-	TRACE_FUNC_EXIT;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConInstallerQueue::QueueAddress( CSConBackupRestoreQueue*& aTaskQueue )
-// An address pointer to another queue
-// -----------------------------------------------------------------------------
-//
-void CSConInstallerQueue::QueueAddress( CSConBackupRestoreQueue*& aTaskQueue )
-	{
-	TRACE_FUNC;
-	iBRQueueAddress = aTaskQueue;
-	}
-
-// -----------------------------------------------------------------------------
-// CSConInstallerQueue::PollQueue()
-// Polls queue
-// -----------------------------------------------------------------------------
-//
-void CSConInstallerQueue::PollQueue()
-	{
-	TRACE_FUNC;
-	// find and start next task if installer and BR is inactive
-	if( !iInstaller->InstallerActive()
-		&& !iBRQueueAddress->QueueProcessActive() )
-		{
-		//find next task
-		for( TInt i = 0; i < iQueue.Count(); i++ )
-			{
-			TBool complete = iQueue[i]->GetCompleteValue();
-			
-			if( complete == EFalse )
-				{
-				iInstaller->StartInstaller( iQueue[i]->iTaskId );
-				i = iQueue.Count() + 1; // jump out from loop
-				}
-			}
-		}
-	}
-
-// -----------------------------------------------------------------------------
-// CSConInstallerQueue::DoCancel()
-// Implementation of CActive::DoCancel()
-// -----------------------------------------------------------------------------
-//
-void CSConInstallerQueue::DoCancel()
-	{
-	TRACE_FUNC;
-	iTimer.Cancel();
-	}
-
-// -----------------------------------------------------------------------------
-// CSConInstallerQueue::RunL()
-// Implementation of CActive::RunL()
-// -----------------------------------------------------------------------------
-//
-void CSConInstallerQueue::RunL()
-	{
-	TRACE_FUNC_ENTRY;
-	LOGGER_WRITE_1( "There are still %d tasks in this queue", iQueue.Count() );
-	if( iQueue.Count() > 0 )
-		{
-		PollQueue();
-		StartQueue();
-		}
-	TRACE_FUNC_EXIT;
-	}
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/src/sconmetadata.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1353 +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:  SConMetadata implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <utf.h>  // for CnvUtfConverter
-#include <MetaDataUtility.h>
-#include <MetaDataFieldContainer.h>
-#include <MetaDataField.hrh>
-#include <caf/content.h>
-#include <caf/data.h>
-#include <ExifRead.h>
-#include <ExifTag.h>
-
-#include "sconmetadata.h"
-#include "sconconmltask.h"
-#include "sconpcdconsts.h"
-#include "sconvideoparser.h"
-#include "debug.h"
-#include "sconmetadatafielddefs.h"
-
-
-
-const TInt KBufferSize(1024);
-// Size of buffer to load from file start to get EXIF thumbnail
-const TInt KJpegLoadBufferSize = 65536; // 64k
-
-
-const TUint32 KFieldMaxLength = 0xFFFFFFFF; // four bytes reserved for "length" information
-
-// GPS related Exif IDs
-const TUint16 KGPSLatitudeRef	= 0x01;
-const TUint16 KGPSLatitude 	 	= 0x02;
-const TUint16 KGPSLongitudeRef	= 0x03;
-const TUint16 KGPSLongitude		= 0x04;
-const TUint16 KGPSAltitudeRef	= 0x05;
-const TUint16 KGPSAltitude		= 0x06;
-
-
-// extensions for exif parser
-_LIT(KJpgExt, ".jpg");
-_LIT(KJpegExt, ".jpeg");
-// extensions for audio metadata parser
-_LIT(KAacExt, ".aac");
-_LIT(KMp3Ext, ".mp3");
-_LIT(KMp4Ext, ".mp4");
-_LIT(KWmaExt, ".wma");
-// extensions for video metadata parser
-_LIT(KM4aExt, ".m4a");
-_LIT(K3gpExt, ".3gp");
-
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// SConMetadata::ProcessTask()
-// ProcessTask
-// -----------------------------------------------------------------------------
-//
-void SConMetadata::ProcessTask( CSConTask& aTask, RFs& aFs )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err(KErrNone);
-    if ( aTask.GetServiceId() == EGetMetadata )
-        {
-        LOGGER_WRITE_1( "SConMetadata::ProcessTask() : file %S",
-            &aTask.iGetMetadataParams->iFilename );
-        
-#ifdef _DEBUG
-        LOGGER_WRITE( "start.. " );
-        TTimeIntervalMicroSeconds sec;
-        TTime start;
-        TTime end;
-        start.HomeTime();
-#endif
-        
-        TParsePtrC filename( aTask.iGetMetadataParams->iFilename );
-        
-        if ( filename.Ext().CompareF( KJpgExt ) == 0
-            || filename.Ext().CompareF( KJpegExt ) == 0 )
-            {
-            // jpg file, try to read exif
-            LOGGER_WRITE( "jpg file, Try to read exif" );
-            TRAP( err, ReadExifDataL( aTask, aFs ) );
-            }
-        else if ( filename.Ext().CompareF( KMp4Ext ) == 0
-            || filename.Ext().CompareF( K3gpExt ) == 0 )
-        	{
-        	LOGGER_WRITE( "Try to read video" );
-        	TRAP( err, GetVideoMetadataL( aTask, aFs ) );
-        	}
-        else if ( filename.Ext().CompareF( KAacExt ) == 0
-            || filename.Ext().CompareF( KM4aExt ) == 0
-            || filename.Ext().CompareF( KMp3Ext ) == 0
-            || filename.Ext().CompareF( KWmaExt ) == 0 )
-            {
-
-            // audio file, try to read audio
-            LOGGER_WRITE( "Try to read audio" );
-            TRAP( err, GetAudioMetadataL( aTask ) );
-            }
-        else
-            {
-            LOGGER_WRITE( "File extension not supported" );
-            err = KErrNotSupported;
-            }
-        
-#ifdef _DEBUG
-        end.HomeTime();
-        sec = end.MicroSecondsFrom( start );
-        
-        LOGGER_WRITE_1( "trapErr %d", err );
-        LOGGER_WRITE_1( "duration: %Ld", sec.Int64() );
-#endif
-        }
-    else
-        {
-        LOGGER_WRITE( "SConMetadata::ProcessTask() : not supported" );
-        err = KErrNotSupported;
-        }
-    
-    LOGGER_WRITE( "SConMetadata::ProcessTask() : CompleteTask" );
-    
-    TInt progress( KSConCodeTaskCompleted );        
-    TBool complete ( ETrue );
-    switch( err )
-        {
-        case KErrNone :
-            progress =  KSConCodeTaskCompleted;
-            break;
-        case KErrNotFound :
-        case KErrBadName :
-            progress =  KSConCodeNotFound;
-            break;
-        default :
-            progress = KSConCodeConflict;
-            break;
-        }
-        
-    aTask.SetCompleteValue( complete );
-    aTask.SetProgressValue( progress );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// SConMetadata::GetAudioMetadataL()
-// Read audio metadata
-// -----------------------------------------------------------------------------
-//
-void SConMetadata::GetAudioMetadataL( CSConTask& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    CMetaDataUtility* metadataUtil = CMetaDataUtility::NewL();
-    CleanupStack::PushL( metadataUtil );
-    
-    LOGGER_WRITE( "SConMetadata::GetAudioMetadataL() : OpenFileL" );
-    metadataUtil->OpenFileL( aTask.iGetMetadataParams->iFilename );
-    
-    TInt count = metadataUtil->MetaDataCount();
-    LOGGER_WRITE_1( "SConMetadata::GetAudioMetadataL() : MetaDataCount %d", count );
-    if ( count > 0 )
-        {
-        const CMetaDataFieldContainer& fields = metadataUtil->MetaDataFieldsL();
-        count = fields.Count();
-        
-        CBufFlat* buffer = CBufFlat::NewL( KBufferSize );
-        CleanupStack::PushL( buffer );
-        buffer->Reset();
-        
-        
-        TInt offset(0);
-        // write object header
-        // Item type (1 byte) + Version (1 byte) = 2 bytes
-        buffer->ExpandL( offset, 2 );
-    
-        // header id
-        TUint8 value( KSconMetadataHeaderAudio );
-        buffer->Write( offset, TPtrC8(&value, 1) );
-        offset++;
-        
-        // header version
-        value = KSconMetadataHeaderVersion;
-        buffer->Write( offset, TPtrC8(&value, 1) );
-        offset++;
-        
-        // Add ID3 field
-        value = metadataUtil->ID3Version();
-        AppendTUintDataFieldL( buffer, value, KSconAudioID3Version );
-        
-        TMetaDataFieldId fieldId;
-        TPtrC fieldData;
-        
-        for ( TInt i = 0; i < count; i++ )
-            {
-            // get field id
-            fields.FieldIdAt( i , fieldId );
-            LOGGER_WRITE_2( "AudioFieldId( %d ): 0x%02x", i, fieldId );
-            
-            if ( fieldId == EMetaDataJpeg )
-                {
-                TPtrC8 field8( fields.Field8( fieldId ) );
-                AppendByteDataFieldL(
-                    buffer,
-                    field8,
-                    AudioFieldId( fieldId ) );
-                }
-            else
-                {
-                // get field data and add UTF-8 formatted text to buffer
-                fieldData.Set( fields.At( i , fieldId ) );
-                AppendUtf8DataFieldL( buffer, fieldData, AudioFieldId( fieldId ) );
-                }
-            
-            }
-        
-        if ( buffer->Size() > 0 )
-            {
-            LOGGER_WRITE_1( "SConMetadata::GetAudioMetadataL() : buffer->Size() %d", buffer->Size() );
-            if ( aTask.iGetMetadataParams->iData )
-                {
-                delete aTask.iGetMetadataParams->iData;
-                aTask.iGetMetadataParams->iData = NULL;
-                }
-            //Initialize the task data buffer
-            aTask.iGetMetadataParams->iData = HBufC8::NewL( buffer->Size() );
-            TPtr8 dataPtr = aTask.iGetMetadataParams->iData->Des();
-            
-            buffer->Read( 0, dataPtr, buffer->Size() );
-            LOGGER_WRITE_1( "SConMetadata::GetAudioMetadataL() dataPtr len: %d", dataPtr.Length());
-            }
-        CleanupStack::PopAndDestroy( buffer );
-        }
-    
-    CleanupStack::PopAndDestroy( metadataUtil );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// SConMetadata::GetVideoMetadataL()
-// Read video metadata
-// -----------------------------------------------------------------------------
-//
-void SConMetadata::GetVideoMetadataL( CSConTask& aTask, RFs& aFs )
-	{
-	TRACE_FUNC_ENTRY;
-	CBufFlat* buffer = CBufFlat::NewL( KBufferSize );
-    CleanupStack::PushL( buffer );
-    buffer->Reset();
-    
-    TInt offset(0);
-    // write object header
-    // Item type (1 byte) + Version (1 byte) = 2 bytes
-    buffer->ExpandL( offset, 2 );
-
-    // header id
-    TUint8 value( KSconMetadataHeaderVideo );
-    buffer->Write( offset, TPtrC8(&value, 1) );
-    offset++;
-    
-    // header version
-    value = KSconMetadataHeaderVersion;
-    buffer->Write( offset, TPtrC8(&value, 1) );
-    offset++;
-    
-	
-	CSConVideoParser* videoParser = CSConVideoParser::NewLC();
-	
-	videoParser->OpenFileL( aFs, aTask.iGetMetadataParams->iFilename );
-	LOGGER_WRITE( "Open completed" );
-	
-	const TUint KFormatMaxLength = 100;
-	TBuf<KFormatMaxLength> formatMimeType;
-    formatMimeType.Copy( videoParser->VideoFormatMimeTypeL() );
-    LOGGER_WRITE_1( "formatMimeType: %S", &formatMimeType);
-    AppendUtf8DataFieldL( buffer, formatMimeType, KSconVideoFormat );
-	
-    // we can't use TReal format, so convert frame rate to frames/ms (or 1000 frames/s)
-	TReal32 frameRate = videoParser->VideoFrameRateL();
-	const TUint KFrameRateMultiplier = 1000;
-    TInt frm = frameRate * KFrameRateMultiplier; 
-    LOGGER_WRITE_1( "frameRate: %f", frameRate );
-    LOGGER_WRITE_1( "frm: %d", frm );
-    AppendTUintDataFieldL( buffer, frm, KSconVideoFrameRate );
-    
-    TSize size;
-    videoParser->VideoFrameSizeL( size );
-    LOGGER_WRITE_2( "VideoFrameSizeL: %d, %d", size.iWidth, size.iHeight);
-    AppendTUintDataFieldL( buffer, size.iWidth, KSconVideoFrameSizeWidth );
-    AppendTUintDataFieldL( buffer, size.iHeight, KSconVideoFrameSizeHeight );
-    
-
-
-    const TUint8 KSconVideoAudioStreamMimetype	( 0x09 );
-    const TUint8 KSconVideoVideoStreamMimetype	( 0x0a );
-    
-    TInt videoBitRate =  videoParser->VideoBitRateL();
-    LOGGER_WRITE_1( "videoBitRate: %d", videoBitRate);
-    AppendTUintDataFieldL( buffer, videoBitRate, KSconVideoVideoBitRate );
-    
-	TInt audioBitRate = videoParser->AudioBitRateL();
-	LOGGER_WRITE_1( "audioBitRate: %d", audioBitRate);
-	AppendTUintDataFieldL( buffer, audioBitRate, KSconVideoAudioBitRate );
-
-	TInt durationMs = videoParser->DurationL();
-	LOGGER_WRITE_1( "duration ms: %d", durationMs);
-	AppendTUintDataFieldL( buffer, durationMs, KSconVideoDuration );
-	
-	TPtrC8 thumbnail = videoParser->Thumbnail();
-	if ( thumbnail.Length() > 0 )
-	    {
-	    AppendByteDataFieldL( buffer, thumbnail, KSconVideoThumbnail );
-	    }
-	
-	TPtrC audioMimeType = videoParser->AudioMimeTypeL();
-	if ( audioMimeType.Length() > 0 )
-		{
-		AppendUtf8DataFieldL( buffer, audioMimeType, KSconVideoAudioStreamMimetype );
-		}
-	
-	TPtrC videoMimeType = videoParser->VideoMimeTypeL();
-	if ( videoMimeType.Length() > 0 )
-		{
-		AppendUtf8DataFieldL( buffer, formatMimeType, KSconVideoVideoStreamMimetype );
-		}
-	
-	CleanupStack::PopAndDestroy( videoParser );
-	LOGGER_WRITE( "videoParser deleted" );
-	
-	
-	if ( buffer->Size() > 0 )
-        {
-        if ( aTask.iGetMetadataParams->iData )
-            {
-            delete aTask.iGetMetadataParams->iData;
-            aTask.iGetMetadataParams->iData = NULL;
-            }
-        //Initialize the task data buffer
-        aTask.iGetMetadataParams->iData = HBufC8::NewL( buffer->Size() );
-        TPtr8 dataPtr = aTask.iGetMetadataParams->iData->Des();
-        
-        buffer->Read( 0, dataPtr, buffer->Size() );
-        }
-    CleanupStack::PopAndDestroy( buffer );
-	
-	
-    TRACE_FUNC_EXIT;
-	}
-
-// -----------------------------------------------------------------------------
-// SConMetadata::AudioFieldId()
-// Map TMetaDataFieldId to KSconAudio field id
-// -----------------------------------------------------------------------------
-//
-TUint8 SConMetadata::AudioFieldId( const TMetaDataFieldId fieldId )
-    {
-    TUint8 ret(NULL);
-    switch( fieldId )
-        {
-        case EMetaDataSongTitle :
-            ret = KSconAudioTitle;
-            break;
-        case EMetaDataArtist :
-            ret = KSconAudioArtist;
-            break;
-        case EMetaDataAlbum :
-            ret = KSconAudioAlbum;
-            break;
-        case EMetaDataYear :
-            ret = KSconAudioYear;
-            break;
-        case EMetaDataComment :
-            ret = KSconAudioComment;
-            break;
-        case EMetaDataAlbumTrack :
-            ret = KSconAudioAlbumTrack;
-            break;
-        case EMetaDataGenre :
-            ret = KSconAudioGenre;
-            break;
-        case EMetaDataComposer :
-            ret = KSconAudioComposer;
-            break;
-        case EMetaDataCopyright :
-            ret = KSconAudioCopyright;
-            break;
-        case EMetaDataOriginalArtist :
-            ret = KSconAudioOriginalArtist;
-            break;
-        case EMetaDataUrl :
-            ret = KSconAudioUrl;
-            break;
-        case EMetaDataUserUrl :
-            ret = KSconAudioUserUrl;
-            break;
-        case EMetaDataJpeg :
-            ret = KSconAudioJpeg;
-            break;
-        case EMetaDataVendor :
-            ret = KSconAudioVendor;
-            break;
-        case EMetaDataRating :
-            ret = KSconAudioRating;
-            break;
-        case EMetaDataUniqueFileIdentifier :
-            ret = KSconAudioUniqueFileIdentifier;
-            break;
-        case EMetaDataDuration :
-            ret = KSconAudioDuration;
-            break;
-        case EMetaDataDate :
-            ret = KSconAudioDate;
-            break;
-        default :
-            LOGGER_WRITE( "SConMetadata::AudioFieldId : ERR field not defined!" );
-            break;
-        }
-    return ret;
-    }
-
-
-// -----------------------------------------------------------------------------
-// SConMetadata::GetExifTagL( CExifRead* aReader, const TUint8 aTagID )
-// This function is used to read exif data that might leave.
-// -----------------------------------------------------------------------------
-//
-HBufC8* SConMetadata::GetExifTagL( CExifRead* aReader, const TUint8 aTagID )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( " aTagID: 0x%02x", aTagID );
-    HBufC8* tempBuf( NULL );
-    
-    switch( aTagID )
-        {
-        case KSconExifThumbnail:
-            tempBuf = aReader->GetThumbnailL();
-            break;
-        case KSconExifDescription:
-            tempBuf = aReader->GetImageDescriptionL();
-            break;
-        case KSconExifMake:
-            tempBuf = aReader->GetMakeL();
-            break;
-        case KSconExifModel:
-            tempBuf = aReader->GetModelL();
-            break;
-        case KSconExifDateTime:
-            tempBuf = aReader->GetDateTimeL();
-            break;
-        case KSconExifSoftware:
-            tempBuf = aReader->GetSoftwareL();
-            break;
-        case KSconExifCopyright:
-            tempBuf = aReader->GetCopyrightL();
-            break;
-        case KSconExifIsoSpeedRatings:
-            tempBuf = aReader->GetIsoSpeedRatingsL();
-            if ( tempBuf )
-                {
-                TInt isoSpeed = ReadTUint32( tempBuf->Des() );
-                LOGGER_WRITE_1(" isoSpeed: %d", isoSpeed);
-                delete tempBuf;
-                
-                const TInt maxLength(5);
-                // no need to push on cleanupstack as leave cannot
-                // happen before returning tempBuf.
-                tempBuf = HBufC8::NewL(maxLength);
-                TPtr8 temp = tempBuf->Des();
-                temp.Num( isoSpeed );
-                }
-            break;
-        case KSconExifDateTimeOriginal:
-            tempBuf = aReader->GetDateTimeOriginalL();
-            break;
-        case KSconExifDateTimeDigitized:
-            tempBuf = aReader->GetDateTimeDigitizedL();
-            break;
-        case KSconExifMakerNote:
-            // makernote contents are up to the manufacturer
-            // not needed.
-            User::Leave( KErrNotSupported );
-            break;
-        case KSconExifUserComment:
-            tempBuf = aReader->GetUserCommentL();
-            break;
-        case KSconExifRelatedSoundFile:
-            tempBuf = aReader->GetRelatedSoundFileL();
-            break;
-        default:
-            User::Leave( KErrNotSupported );
-        }
-    TRACE_FUNC_EXIT;
-    return tempBuf;
-    }
-
-// -----------------------------------------------------------------------------
-// SConMetadata::ReadTUint32()
-// Convert 8-bit binary data to unsigned integer 
-// -----------------------------------------------------------------------------
-//
-TUint32 SConMetadata::ReadTUint32( const TDesC8& aData )
-    {
-    TRACE_FUNC_ENTRY;
-    TUint32 result = 0;
-    TUint8 c;
-    
-    for (TInt i=aData.Length()-1; i>=0; i--)
-        {
-        c = aData[i];
-        result = (result << 8) | c;
-        }
-    
-    LOGGER_WRITE_1( "SConMetadata::ReadTUint32() : returned %d ", result );
-    return result;
-    }
-
-// -----------------------------------------------------------------------------
-// SConMetadata::GetFileDataLC()
-// Read data from file
-// -----------------------------------------------------------------------------
-//
-HBufC8* SConMetadata::GetFileDataLC( const TDesC& aFilename, RFs& aFs )
-	{
-	TRACE_FUNC_ENTRY;
-    RFile file;
-    
-    User::LeaveIfError( file.Open( aFs, aFilename,
-        EFileRead | EFileShareReadersOnly ) );
-    CleanupClosePushL( file );
-    
-    LOGGER_WRITE( "SConMetadata::GetFileDataLC() : file opened" );
-    
-    TInt dataSize(0);
-    ContentAccess::CContent* content;
-    content = ContentAccess::CContent::NewLC( file );
-    ContentAccess::CData* data = content->OpenContentLC( ContentAccess::EPeek );
-    data->DataSizeL(dataSize);
-    
-    LOGGER_WRITE( "SConMetadata::GetFileDataLC() : content opened" );
-    // Read 64k from the beginning of the file
-    if ( dataSize > KJpegLoadBufferSize )
-        {
-        dataSize = KJpegLoadBufferSize;
-        }
-    HBufC8* readBuffer = HBufC8::NewLC( dataSize );
-    TPtr8 readPtr = readBuffer->Des();
-    User::LeaveIfError( data->Read( readPtr, dataSize ) );
-    
-    LOGGER_WRITE( "SConMetadata::GetFileDataLC() : data readed" );
-    CleanupStack::Pop( readBuffer );
-    CleanupStack::PopAndDestroy( data );
-    CleanupStack::PopAndDestroy( content );
-    CleanupStack::PopAndDestroy( &file );
-    
-    CleanupStack::PushL( readBuffer );
-    TRACE_FUNC_EXIT;
-    return readBuffer;
-	}
-
-// -----------------------------------------------------------------------------
-// SConMetadata::ReadExifDataL()
-// Read Exif data
-// -----------------------------------------------------------------------------
-//
-void SConMetadata::ReadExifDataL( CSConTask& aTask, RFs& aFs )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // read data from file
-    HBufC8* jpegReadBuffer = GetFileDataLC( aTask.iGetMetadataParams->iFilename, aFs );
-    
-    CExifRead* reader = CExifRead::NewL(
-        *jpegReadBuffer, CExifRead::ENoJpeg | CExifRead::ENoTagChecking );
-    
-    LOGGER_WRITE( "SConMetadata::ReadExifDataL() : reader created" );
-    CleanupStack::PopAndDestroy( jpegReadBuffer );
-    CleanupStack::PushL( reader );
-    
-
-    CBufFlat* buffer = CBufFlat::NewL( KBufferSize );
-    CleanupStack::PushL( buffer );
-    buffer->Reset();
-    
-    
-    TInt offset(0);
-    // header id (1 byte) + head.version (1 byte) = 2 bytes
-    
-    buffer->ExpandL( offset, 2 );
-    
-    // header id
-    TUint8 value( KSconMetadataHeaderExif );
-    buffer->Write( offset, TPtrC8(&value, 1) );
-    offset++;
-    
-    // header version
-    value = KSconMetadataHeaderVersion;
-    buffer->Write( offset, TPtrC8(&value, 1) );
-    offset++;
-    
-    
-    HBufC8* tempBuf(NULL);
-    
-    TInt err;
-    
-    for ( TInt tagID = KSconExifThumbnail; tagID < KSconExifGpsVersion; tagID++ )
-        {
-        // GetExifTagL function is used only to tags that leaves if data is not found
-        TRAP( err, tempBuf = GetExifTagL( reader, tagID ) );
-        if ( !err )
-            {
-            LOGGER_WRITE("write to buffer");
-            CleanupStack::PushL( tempBuf );
-            AppendByteDataFieldL( buffer, tempBuf->Des(), tagID );
-            CleanupStack::PopAndDestroy( tempBuf );
-            tempBuf = NULL;
-            }
-        else
-            {
-            LOGGER_WRITE_1( "GetExifTagL Leave code %d", err );
-            }
-        }
-    
-    
-    TUint16 value16a;
-    TUint32 value32a;
-    TUint32 value32b;
-    TInt32 val32a;
-    TInt32 val32b;
-    
-    // Orientation
-    err = reader->GetOrientation( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifOrientation );
-        }
-    
-    // XResolution
-    err = reader->GetXResolution( value32a, value32b );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifXResolution1 );
-        AppendTUintDataFieldL( buffer, value32b, KSconExifXResolution2 );
-        }
-    
-    // YResolution
-    err = reader->GetYResolution( value32a, value32b );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifYResolution1 );
-        AppendTUintDataFieldL( buffer, value32b, KSconExifYResolution2 );
-        }
-    
-    // ResolutionUnit
-    err = reader->GetResolutionUnit( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifResolutionUnit );
-        }
-    
-    // YCbCrPositioning
-    err = reader->GetYCbCrPositioning( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifYCbCrPositioning );
-        }
-    
-    // YCbCrPositioning
-    err = reader->GetYCbCrPositioning( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifYCbCrPositioning );
-        }
-    
-    
-    // ExposureTime
-    err = reader->GetExposureTime( value32a, value32b );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifExposureTime1 );
-        AppendTUintDataFieldL( buffer, value32b, KSconExifExposureTime2 );
-        }
-    
-    // ComponentsConfiguration
-    TUint8 value8a;
-    TUint8 value8b;
-    TUint8 value8c;
-    TUint8 value8d;
-    err = reader->GetComponentsConfiguration( value8a, value8b, value8c, value8d );
-    if ( !err )
-        {
-        TInt offset;
-        offset = buffer->Size();
-        
-        // field ID (1 byte) + field lenght (4 bytes) + field data (4bytes) = 9 bytes
-        buffer->ExpandL( offset, 9 );
-        
-        // field id (one byte)
-        TUint8 fieldId( KSconExifComponentsConfiguration );
-        buffer->Write( offset, TPtrC8( &fieldId, 1 ) );
-        offset++;
-        
-        // field lenght
-        WriteTUint32( buffer, offset, 4);
-        offset += 4;
-        
-        buffer->Write( offset, TPtrC8(&value8a, 1) );
-        offset++;
-        buffer->Write( offset, TPtrC8(&value8b, 1) );
-        offset++;
-        buffer->Write( offset, TPtrC8(&value8c, 1) );
-        offset++;
-        buffer->Write( offset, TPtrC8(&value8d, 1) );
-        offset++;
-        }
-    
-    // Flash
-    err = reader->GetFlash( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifFlash );
-        }
-    
-    // ColorSpace
-    err = reader->GetColorSpace( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifColorSpace );
-        }
-    
-    // PixelXDimension
-    err = reader->GetPixelXDimension( value32a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifPixelXDimension );
-        }
-    
-    // PixelYDimension
-    err = reader->GetPixelYDimension( value32a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifPixelYDimension );
-        }
-    
-    // ExposureMode
-    err = reader->GetExposureMode( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifExposureMode );
-        }
-    
-    // WhiteBalance
-    err = reader->GetWhiteBalance( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifWhiteBalance );
-        }
-    
-    // SceneCaptureType
-    err = reader->GetSceneCaptureType( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifSceneCaptureType );
-        }
-    
-    // ExposureProgram
-    err = reader->GetExposureProgram( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifExposureProgram );
-        }
-    
-    // GetApertureValue
-    err = reader->GetApertureValue( value32a, value32b );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifApertureValue1 );
-        AppendTUintDataFieldL( buffer, value32b, KSconExifApertureValue2 );
-        }
-    
-    // GetExposureBiasValue
-    err = reader->GetExposureBiasValue( val32a, val32b );
-    if ( !err )
-        {
-        value32a = val32a;
-        value32b = val32b;
-        AppendTUintDataFieldL( buffer, value32a, KSconExifExposureBiasValue1 );
-        AppendTUintDataFieldL( buffer, value32b, KSconExifExposureBiasValue2 );
-        }
-    
-    // GetMeteringMode
-    err = reader->GetMeteringMode( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifMeteringMode );
-        }
-    
-    // GetLightSource
-    err = reader->GetLightSource( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifLightSource );
-        }
-    
-    // GetFileSource
-    TInt8 val8;
-    err = reader->GetFileSource( val8 );
-    if ( !err )
-        {
-        value8a = val8;
-        AppendTUintDataFieldL( buffer, value8a, KSconExifFileSource );
-        }
-    
-    // GetDigitalZoomRatio
-    err = reader->GetDigitalZoomRatio( value32a, value32b );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifDigitalZoomRatio1 );
-        AppendTUintDataFieldL( buffer, value32b, KSconExifDigitalZoomRatio2 );
-        }
-    
-    // GetContrast
-    err = reader->GetContrast( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifContrast );
-        }
-    
-    // GetSaturation
-    err = reader->GetSaturation( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifSaturation );
-        }
-    
-    // GetSharpness
-    err = reader->GetSharpness( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifSharpness );
-        }
-    
-    // GetExifVersion
-    err = reader->GetExifVersion( value32a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifExifVersion );
-        }
-    
-    // GetFlashPixVersion
-    err = reader->GetFlashPixVersion( value32a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifFlashPixVersion );
-        }
-    
-    // GetThumbnailXResolution
-    err = reader->GetThumbnailXResolution( value32a, value32b );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifThumbXResolution1 );
-        AppendTUintDataFieldL( buffer, value32b, KSconExifThumbXResolution2 );
-        }
-    
-    // GetThumbnailYResolution
-    err = reader->GetThumbnailYResolution( value32a, value32b );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifThumbYResolution1 );
-        AppendTUintDataFieldL( buffer, value32b, KSconExifThumbYResolution2 );
-        }
-    
-    // GetThumbnailResolutionUnit
-    err = reader->GetThumbnailResolutionUnit( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifThumbResolutionUnit );
-        }
-    
-    // GetThumbnailCompression
-    err = reader->GetThumbnailCompression( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifThumbCompression );
-        }
-    
-    // GetJpegInterchangeFormat
-    err = reader->GetJpegInterchangeFormat( value32a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifThumbJpegInterchangeFormat );
-        }
-    
-    // GetJpegInterchangeFormatLength
-    err = reader->GetJpegInterchangeFormatLength( value32a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifThumbJpegInterchangeFormatLength );
-        }
-    
-    // GetShutterSpeedValue
-    err = reader->GetShutterSpeedValue( val32a, val32b );
-    if ( !err )
-        {
-        value32a = val32a;
-        value32b = val32b;
-        AppendTUintDataFieldL( buffer, value32a, KSconExifShutterSpeedValue1 );
-        AppendTUintDataFieldL( buffer, value32b, KSconExifShutterSpeedValue2 );
-        }
-    
-    // GetBrightnessValue
-    err = reader->GetBrightnessValue( val32a, val32b );
-    if ( !err )
-        {
-        value32a = val32a;
-        value32b = val32b;
-        AppendTUintDataFieldL( buffer, value32a, KSconExifBrightnessValue1 );
-        AppendTUintDataFieldL( buffer, value32b, KSconExifBrightnessValue2 );
-        }
-    
-    // GetCustomRendered
-    err = reader->GetCustomRendered( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifCustomRendered );
-        }
-    
-    // GetGainControl
-    err = reader->GetGainControl( value16a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value16a, KSconExifGainControl );
-        }
-    
-    // GetGpsVersion
-    err = reader->GetGpsVersion( value32a );
-    if ( !err )
-        {
-        AppendTUintDataFieldL( buffer, value32a, KSconExifGpsVersion );
-        }
-    
-    // Get GPS coordinates
-    const TUint KCoordinatesMaxLength = 50;
-    TBuf<KCoordinatesMaxLength> gpsInfo;
-    // Latidute
-    err = GetExifGPSLatitudeL( *reader, gpsInfo );
-    if ( !err )
-    	{
-    	AppendUtf8DataFieldL( buffer, gpsInfo ,KSconExifGPSLatitude );
-    	}
-    
-    // Longitude
-    err = GetExifGPSLongitudeL( *reader, gpsInfo );
-    if ( !err )
-    	{
-    	AppendUtf8DataFieldL( buffer, gpsInfo ,KSconExifGPSLongitude );
-    	}
-    
-    // Altidute
-    err = GetExifGPSAltiduteL( *reader, gpsInfo );
-    if ( !err )
-    	{
-    	AppendUtf8DataFieldL( buffer, gpsInfo ,KSconExifGPSAltitude );
-    	}
-    
-    LOGGER_WRITE( "SConMetadata::ReadExifDataL() : All data collected" );
-    
-    if ( buffer->Size() > 0 )
-        {
-        LOGGER_WRITE_1( "SConMetadata::ReadExifDataL() : buffer->Size() %d", buffer->Size() );
-        if ( aTask.iGetMetadataParams->iData )
-            {
-            delete aTask.iGetMetadataParams->iData;
-            aTask.iGetMetadataParams->iData = NULL;
-            }
-        //Initialize the task data buffer
-        aTask.iGetMetadataParams->iData = HBufC8::NewL( buffer->Size() );
-        TPtr8 dataPtr = aTask.iGetMetadataParams->iData->Des();
-        
-        buffer->Read( 0, dataPtr, buffer->Size() );
-        LOGGER_WRITE_1( "SConMetadata::ReadExifDataL() dataPtr len: %d", dataPtr.Length());
-        }
-    CleanupStack::PopAndDestroy( buffer );
-    
-    LOGGER_WRITE( "SConMetadata::ReadExifDataL() : task updated" );
-    
-    CleanupStack::PopAndDestroy( reader );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// void SConMetadata::ConvertRationalTag( const CExifTag& aTag, TDes& aPosDegrees )
-// parses degrees, minutes and seconds from CExifTag and converts it to string format
-// -----------------------------------------------------------------------------
-//
-TInt SConMetadata::ConvertRationalTag( const CExifTag& aTag, TDes& aPosDegrees )
-	{
-	TRACE_FUNC_ENTRY;
-	TInt numer(0);
-	TInt denom(0);
-	TReal64 degrees(0);
-	TReal64 minutes(0);
-	TReal64 seconds(0);
-	
-	const TUint8* ratData = aTag.Data().Ptr();
-	for ( TUint y=0; y < aTag.TagInfo().iDataCount; y++ )
-		{
-		numer = 0;
-		denom = 0;
-		Mem::Copy(&numer, ratData + ((y * 2) * sizeof(numer)), sizeof(numer));
-		Mem::Copy(&denom, ratData + (((y * 2) + 1) * sizeof(numer)), sizeof(denom));	
-		if (denom != 0)
-		    {
-            if ( y == 0 )// degrees
-                {
-                degrees = numer/denom;
-                }
-            else if ( y == 1 )// minutes
-                {
-                minutes = numer/denom;
-                }
-            else if ( y == 2 )// seconds
-                {
-                seconds = numer/denom;
-                }
-		    }
-		}
-	_LIT(KFormat, "%.0f°%.0f'%.2f\"" );
-	aPosDegrees.Format( KFormat, degrees, minutes, seconds );
-	TRACE_FUNC_EXIT;
-	return KErrNone;
-	}
-
-// -----------------------------------------------------------------------------
-// void SConMetadata::GetExifGPSLatitudeL( CExifRead& aExifRead, TDes& aLatitude )
-// Read latidute from ExifReader 
-// -----------------------------------------------------------------------------
-//
-TInt SConMetadata::GetExifGPSLatitudeL( CExifRead& aExifRead, TDes& aLatitude )
-	{
-	TRACE_FUNC_ENTRY;
-	TInt ret(KErrNone);
-	if ( aExifRead.TagExists( KGPSLatitudeRef, EIfdGps )
-		&& aExifRead.TagExists( KGPSLatitude, EIfdGps) )
-		{
-		// get latidute
-		const CExifTag* lat = aExifRead.GetTagL( 
-				EIfdGps, 
-				KGPSLatitude );
-		User::LeaveIfError( ConvertRationalTag( *lat, aLatitude ) );
-		if ( aLatitude.Length()+2 > aLatitude.MaxLength() )
-			{
-			User::Leave( KErrTooBig );
-			}
-		
-		// south or north
-		const CExifTag* latRef = aExifRead.GetTagL( 
-				EIfdGps, 
-				KGPSLatitudeRef );
-		_LIT8( KNorthTagDef8, "N" );
-		_LIT( KNorth, "N " );
-		_LIT( KSouth, "S " );
-		if ( latRef->Data().Find( KNorthTagDef8 ) != KErrNotFound )
-			{
-			aLatitude.Insert( 0, KNorth );
-			}
-		else
-			{
-			aLatitude.Insert( 0, KSouth );
-			}
-		}
-	else
-		{
-		ret=KErrNotFound;
-		}
-	TRACE_FUNC_EXIT;
-	return ret;
-	}
-
-// -----------------------------------------------------------------------------
-// void SConMetadata::GetExifGPSLongitudeL( CExifRead& aExifRead, TDes& aLongitude )
-// Read longitude from ExifReader 
-// -----------------------------------------------------------------------------
-//
-TInt SConMetadata::GetExifGPSLongitudeL( CExifRead& aExifRead, TDes& aLongitude )
-	{
-	TRACE_FUNC_ENTRY;
-	TInt ret(KErrNone);
-	if ( aExifRead.TagExists( KGPSLongitudeRef, EIfdGps )
-		&& aExifRead.TagExists( KGPSLongitude, EIfdGps) )
-		{
-		// get longitude
-		const CExifTag* lon = aExifRead.GetTagL( 
-				EIfdGps, 
-				KGPSLongitude );
-		User::LeaveIfError( ConvertRationalTag( *lon, aLongitude ) );
-		if ( aLongitude.Length()+2 > aLongitude.MaxLength() )
-			{
-			User::Leave( KErrTooBig );
-			}
-		
-		// east or west
-		const CExifTag* lonref = aExifRead.GetTagL( 
-				EIfdGps, 
-				KGPSLongitudeRef );
-		_LIT8( KEastTagDef8, "E" );
-		_LIT( KEast, "E " );
-		_LIT( KWest, "W " );
-		if ( lonref->Data().Find( KEastTagDef8 ) != KErrNotFound )
-			{
-			aLongitude.Insert( 0, KEast );
-			}
-		else
-			{
-			aLongitude.Insert( 0, KWest );
-			}
-		}
-	else
-		{
-		ret = KErrNotFound;
-		}
-	TRACE_FUNC_EXIT;
-	return ret;
-	}
-
-// -----------------------------------------------------------------------------
-// void SConMetadata::GetExifGPSAltiduteL( CExifRead& aExifRead, TDes& aAltidute )
-// Read altidute from ExifReader 
-// -----------------------------------------------------------------------------
-//
-TInt SConMetadata::GetExifGPSAltiduteL( CExifRead& aExifRead, TDes& aAltidute )
-	{
-	TRACE_FUNC_ENTRY;
-	
-	TInt ret(KErrNone);
-	if ( aExifRead.TagExists( KGPSAltitudeRef, EIfdGps )
-		&& aExifRead.TagExists( KGPSAltitude, EIfdGps) )
-		{
-		if ( aAltidute.MaxLength() < 5 )
-			{
-			User::Leave( KErrTooBig );
-			}
-		
-		// get altidute
-		const CExifTag* alt = aExifRead.GetTagL( 
-				EIfdGps, 
-				KGPSAltitude );
-		const TUint8* ratData = alt->Data().Ptr();
-		
-		TInt numer;
-		TInt denom;
-		Mem::Copy(&numer, ratData , sizeof(numer));
-		Mem::Copy(&denom, ratData + (sizeof(numer)), sizeof(denom));
-		
-		TReal32 tmp = numer / denom;
-		
-		// sea level
-		const CExifTag* altref = aExifRead.GetTagL( 
-				EIfdGps, 
-				KGPSAltitudeRef );
-		_LIT8( KAltSealevelDef8, "1" );
-		if ( altref->Data().Find( KAltSealevelDef8 ) != KErrNotFound )
-			{
-			// seaLevelReference -> negative value
-			tmp *= -1;
-			}
-		TRealFormat format;
-		format.iType = KRealFormatFixed;
-		format.iPlaces=1;
-		User::LeaveIfError( aAltidute.Num( tmp, format ) );
-		}
-	else
-		{
-		ret = KErrNotFound;
-		}
-	TRACE_FUNC_EXIT;
-	return ret;
-	}
-
-// -----------------------------------------------------------------------------
-// void SConMetadata::AppendUtf8DataFieldL( CBufFlat* aBuffer,
-//     const TPtrC aAppendData, const TUint8 aFieldId )
-// Write 8bit field id value, data length (32bit) and UTF8 data to buffer 
-// -----------------------------------------------------------------------------
-//
-void SConMetadata::AppendUtf8DataFieldL( CBufFlat* aBuffer,
-    const TPtrC aAppendData, const TUint8 aFieldId )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aFieldId: 0x%02x", aFieldId);
-    HBufC8* tempBuf = HBufC8::NewLC( aAppendData.Size() );
-    TPtr8 temp = tempBuf->Des();
-    
-    CnvUtfConverter::ConvertFromUnicodeToUtf8( temp, aAppendData );
-    LOGGER_WRITE_1( "lenght: %d", temp.Length() );
-    
-    if ( temp.Length() > KFieldMaxLength )
-        {
-        LOGGER_WRITE("Data length is too big, field skipped");
-        CleanupStack::PopAndDestroy( tempBuf );
-        return;
-        }
-    
-    TInt offset;
-    offset = aBuffer->Size();
-    // field ID (1 byte) + field lenght (4 bytes) + field data
-    aBuffer->ExpandL( offset, temp.Length() + 5 );
-    
-    // field id (one byte)
-    aBuffer->Write( offset, TPtrC8(&aFieldId, 1) );
-    offset++;
-    
-    WriteTUint32( aBuffer, offset, temp.Length());
-    offset += 4;
-    
-    // field data
-    aBuffer->Write( offset, temp, temp.Length() );
-    offset += temp.Length();
-    
-    CleanupStack::PopAndDestroy( tempBuf );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// void SConMetadata::AppendByteDataFieldL( CBufFlat* aBuffer,
-//     const TPtrC8 aAppendData, const TUint8 aFieldId )
-// Write 8bit field id value, data length (32bit) and n*8bit data to buffer 
-// -----------------------------------------------------------------------------
-//
-void SConMetadata::AppendByteDataFieldL( CBufFlat* aBuffer,
-    const TPtrC8 aAppendData, const TUint8 aFieldId )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aFieldId: 0x%02x", aFieldId);
-    LOGGER_WRITE_1( "lenght: %d", aAppendData.Length() );
-    if ( aAppendData.Length() > KFieldMaxLength )
-        {
-        LOGGER_WRITE("Data length is too big, field skipped");
-        return;
-        }
-    TInt offset;
-    offset = aBuffer->Size();
-    
-    // field id (1) + field len (4) + datalen = 5 + datalen
-    aBuffer->ExpandL( offset, aAppendData.Length() + 5 );
-    
-    // field id (one byte)
-    aBuffer->Write( offset, TPtrC8(&aFieldId, 1) );
-    offset++;
-    
-    // field data length (32bit unsigned integer, two byte)
-    WriteTUint32( aBuffer, offset, aAppendData.Length() );
-    offset += 4;
-    
-    // field data
-    aBuffer->Write( offset, aAppendData );
-    offset += aAppendData.Length();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// void SConMetadata::AppendTUintDataFieldL( CBufFlat* aBuffer,
-//     const TUint32 aValue, const TUint8 aFieldId )
-// Write 8bit field id value, data length (16bit) and n*8bit data to buffer 
-// -----------------------------------------------------------------------------
-//
-void SConMetadata::AppendTUintDataFieldL( CBufFlat* aBuffer,
-    TUint32 aValue, const TUint8 aFieldId )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aFieldId: 0x%02x", aFieldId);
-    LOGGER_WRITE_1( "aValue dec: %u", aValue);
-    TInt offset;
-    offset = aBuffer->Size();
-    TInt dataLen(1);
-    TUint8 temp[4];
-    TInt i(0);
-    
-    temp[i] = aValue & 0xFF;
-    
-    aValue >>= 8;
-    while( aValue > 0 )
-        {
-        i++;
-        temp[i] = aValue & 0xFF;
-        aValue >>= 8;
-        dataLen++;
-        }
-    // field id (1) + field len (4) + datalen = 5 + datalen
-    aBuffer->ExpandL( offset, 5 + dataLen );
-    
-    // field id (one byte)
-    aBuffer->Write( offset, TPtrC8(&aFieldId, 1) );
-    offset++;
-    
-    // field data length (32bit unsigned integer, two byte)
-    WriteTUint32( aBuffer, offset, dataLen );
-    offset += 4;
-    
-    // field data
-    for( TInt i = dataLen-1; i>=0; i-- )
-        {
-        aBuffer->Write( offset, TPtrC8(&temp[i], 1) );
-        offset++;
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// void SConMetadata::WriteTUint32( CBufFlat* aBuffer, TInt offset, TUint32 aValue )
-// Write 32bit unsigned integer value to buffer.
-// -----------------------------------------------------------------------------
-//
-void SConMetadata::WriteTUint32( CBufFlat* aBuffer, TInt offset, TUint32 aValue )
-    {
-    TUint8 temp[4];
-    TInt i(0);
-    
-    temp[i] = aValue & 0xFF;
-    
-    aValue >>= 8;
-    for ( TInt i=1; i<4; i++ )
-        {
-        temp[i] = aValue & 0xFF;
-        aValue >>= 8;
-        }
-    
-    // high to low
-    for ( TInt i=3; i>=0; i-- )
-        {
-        aBuffer->Write( offset, TPtrC8(&temp[i], 1) );
-        offset++;
-        }
-    }
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/src/sconpcd.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,590 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CSConPCD implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "sconpcd.h"
-#include "sconpcdconsts.h"
-#include "sconinstqueue.h"
-#include "sconbrqueue.h"
-#include "sconmetadata.h"
-#include "sconsynchandler.h"
-#include "debug.h"
-
-const TInt KMaxObjectSize(65536); // informed to PC
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-
-// -----------------------------------------------------------------------------
-// CreateCSConPCDL()
-// Entry to CSConPCD
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CSConPCD* CreateCSConPCDL()
-    {
-    TRACE_FUNC;
-    return CSConPCD::NewL();
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCD::NewL()
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//
-CSConPCD* CSConPCD::NewL()
-    {
-    TRACE_FUNC_ENTRY;
-    CSConPCD* self = new (ELeave) CSConPCD();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCD::CSConPCD()
-// Constructor
-// -----------------------------------------------------------------------------
-//
-CSConPCD::CSConPCD()
-    {
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCD::ConstructL()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//
-void CSConPCD::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    User::LeaveIfError( iFs.Connect() );
-    if ( !CActiveScheduler::Current() )
-        {
-        CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
-        CActiveScheduler::Install( scheduler );
-        }
-    
-    iInstallerQueue = CSConInstallerQueue::NewL( iFs );
-    iBackupRestoreQueue = CSConBackupRestoreQueue::NewL( iFs );
-    iInstallerQueue->QueueAddress( iBackupRestoreQueue );
-    iBackupRestoreQueue->QueueAddress( iInstallerQueue );
-    
-    iSyncHandler = CSconSyncHandler::NewL( iFs );
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCD::~CSConPCD()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConPCD::~CSConPCD()
-    {
-    TRACE_FUNC_ENTRY;
-    delete iInstallerQueue;
-    delete iBackupRestoreQueue;
-    delete iLatestReply;
-    delete iSyncHandler;
-    iFs.Close();
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConPCD::PutTaskL( CSConTask* aTask )
-// Receives a new task
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCD::PutTaskL( CSConTask*& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    TInt maxObjectSize( 0 );
-    
-    if ( iLastOperation == EPutTask )
-        {
-        LOGGER_WRITE( "CSConPCD::PutTaskL() : Two Puts in a row -> Reset()" );
-        ResetPCD();
-        }
-    else
-        {
-        LOGGER_WRITE( "CSConPCD::PutTaskL() : Protocol procedure ok" );
-        iLastOperation = EPutTask;
-        }
-    
-    switch( aTask->GetServiceId() )
-        {
-        case ECancel :
-            ret = CancelL( aTask->iCancelTaskId, aTask->iCancelTaskAll );
-            delete aTask;
-            break;
-        case EGetDataOwnerStatus :
-            ret = SupportedBRTaskL( aTask );
-            break;
-        case EGetDataSize :
-            ret = SupportedBRTaskL( aTask );
-            break;
-        case EGetStatus :
-            ret = GetStatusL( aTask->iGetStatusParams->iTaskId, 
-            		aTask->iGetStatusParams->iAll );
-            delete aTask;
-            break;
-        case EInstall :
-            ret = SupportedInstTaskL( aTask );
-            break;
-        case EListDataOwners :
-            ret = SupportedBRTaskL( aTask );
-            break;
-        case EListInstalledApps :
-            ret = SupportedInstTaskL( aTask );
-            break;
-        case EListPublicFiles :
-            ret = SupportedBRTaskL( aTask );          
-            break;
-        case ERequestData :
-            ret = SupportedBRTaskL( aTask );
-            break;
-        case ESetBURMode :
-            ret = SupportedBRTaskL( aTask );
-            break;
-        case ESetInstParams :
-            ret = SupportedInstTaskL( aTask );
-            break;
-        case ESupplyData :
-            ret = SupportedBRTaskL( aTask );
-            break;
-        case EUninstall :
-            ret = SupportedInstTaskL( aTask );
-            break;
-        case EUpdateDeviceInfo :
-            maxObjectSize = aTask->iDevInfoParams->iMaxObjectSize;
-            ret = UpdateDeviceInfoL( maxObjectSize );
-            iTaskNumber++;
-            delete aTask;
-            break;
-        case EReboot :
-            RebootTaskL( aTask );
-            delete aTask;
-            break;
-        case EGetMetadata :
-        	ret = KErrNone;
-            GetMetadataTaskL( *aTask );
-            delete aTask;
-            break;
-        default :
-            break;
-        }
-    LOGGER_WRITE_1( "CSConPCD::PutTaskL() : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCD::GetReply()
-// Returns a reply to previous PutTaskL operation
-// -----------------------------------------------------------------------------
-//
-CSConStatusReply* CSConPCD::GetReply()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    if ( iLastOperation == EGetReply )
-        {
-        LOGGER_WRITE( "CSConPCD::GetReply() : Two Gets in a row -> Reset()" );
-        ResetPCD();
-        }
-    else
-        {
-        LOGGER_WRITE( "CSConPCD::GetReply() : Protocol procedure ok" );
-        iLastOperation = EGetReply;
-        }
-    CSConStatusReply* reply = iLatestReply;
-    iLatestReply = NULL;
-    TRACE_FUNC_EXIT;
-    return reply;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCD::ResetPCD()
-// Resets the module to the initial state
-// -----------------------------------------------------------------------------
-//
-void CSConPCD::ResetPCD()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iInstallerQueue )
-        {
-        LOGGER_WRITE( "CSConPCD::ResetPCD() : Reseting installer queue" );
-        iInstallerQueue->Reset();
-        }
-        
-    if ( iBackupRestoreQueue )
-        {
-        LOGGER_WRITE( "CSConPCD::ResetPCD() : Reseting backup queue" );
-        iBackupRestoreQueue->Reset();
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCD::HandleGetSyncRequestL()
-// 
-// -----------------------------------------------------------------------------
-//
-void CSConPCD::HandleGetSyncRequestL( const TDesC8& aRequest, RWriteStream& aResult, TInt aMaxObjectSize )
-    {
-    TRACE_FUNC_ENTRY;
-    iSyncHandler->HandleGetSyncRequestL( aRequest, aResult, aMaxObjectSize );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCD::HandlePutSyncRequestL()
-// 
-// -----------------------------------------------------------------------------
-//
-void CSConPCD::HandlePutSyncRequestL( const TDesC8& aRequest, RReadStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    iSyncHandler->HandlePutSyncRequestL( aRequest, aResult );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCD::SupportedInstTaskL( CSConTask* aTask )
-// Fills a reply with predefined supported task -information
-// -----------------------------------------------------------------------------
-//  
-TInt CSConPCD::SupportedInstTaskL( CSConTask* aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    iTaskNumber++;
-    ret = iInstallerQueue->AddNewTask( aTask, iTaskNumber );
-    
-    //Get status for this task
-    TBool all( EFalse );
-    CSConStatusReply* reply = new (ELeave) CSConStatusReply();
-    CleanupStack::PushL( reply );
-    iInstallerQueue->GetQueueStatusL( iTaskNumber, all, reply );
-    CleanupStack::Pop( reply );
-    
-    StoreReply( reply );    
-        
-    LOGGER_WRITE_1( "CSConPCD::SupportedInstTaskL() : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCD::SupportedBRTask( CSConTask* aTask )
-// Fills a reply with predefined supported task -information
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCD::SupportedBRTaskL( CSConTask* aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    
-    TInt taskId;
-    
-    taskId = ++iTaskNumber;
-        
-    ret = iBackupRestoreQueue->AddNewTask( aTask, taskId );
-    LOGGER_WRITE_1( "iBackupRestoreQueue->AddNewTask : ret %d", ret );
-    //Get status for this task
-    TBool all( EFalse );
-    CSConStatusReply* reply = new (ELeave) CSConStatusReply();
-    CleanupStack::PushL( reply );
-    iBackupRestoreQueue->GetQueueStatusL( iTaskNumber, all, reply );
-    CleanupStack::Pop( reply );
-    
-    StoreReply( reply );    
-    
-    TRACE_FUNC_EXIT;
-    return ret;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CSConPCD::RebootTask( const CSConTask* aTask )
-// Fills a reply with predefined unsupported task -information
-// -----------------------------------------------------------------------------
-//  
-TInt CSConPCD::RebootTaskL( const CSConTask* aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNotSupported );
-    iTaskNumber++;
-    TSConMethodName method( aTask->GetServiceId() );
-    CSConStatusReply* reply = new (ELeave) CSConStatusReply();
-    CleanupStack::PushL( reply );
-    CSConTaskReply* taskReply = new (ELeave) CSConTaskReply();
-    CleanupStack::PushL( taskReply );
-    
-    TBool complete( ETrue );
-    taskReply->InitializeL( method, KSConCodeNotSupported, complete );
-    taskReply->iTaskId = iTaskNumber;
-    
-    reply->iNoTasks = EFalse;
-    User::LeaveIfError( reply->iTasks.Append( taskReply ) );
-    CleanupStack::Pop( taskReply );
-    
-    StoreReply( reply );
-    CleanupStack::Pop( reply );
-        
-    LOGGER_WRITE_1( "CSConPCD::RebootTask() : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCD::GetMetadataTask( const CSConTask* aTask )
-// Fills a reply with predefined GetMetadata task -information
-// -----------------------------------------------------------------------------
-//
-void CSConPCD::GetMetadataTaskL( CSConTask& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    aTask.iTaskId = ++iTaskNumber;
-    
-    //Set progress value "task accepted for execution"
-    aTask.SetProgressValue( KSConCodeTaskCreated );
-    aTask.SetCompleteValue( EFalse );
-    
-    SConMetadata::ProcessTask( aTask, iFs );
-    
-    //Get status for this task
- 
-    CSConStatusReply* reply = new (ELeave) CSConStatusReply();
-    CleanupStack::PushL( reply );
-    CSConTaskReply* taskReply = new (ELeave) CSConTaskReply();
-    CleanupStack::PushL( taskReply );
-    taskReply->InitializeL( aTask );
-    User::LeaveIfError( reply->iTasks.Append( taskReply ) );
-    CleanupStack::Pop( taskReply );
-    
-    if ( !aTask.GetComplete() )
-        {
-        // clean all unneccessary data from the reply packet
-        taskReply->CleanTaskData();
-        }
-    
-    
-    StoreReply( reply );
-    CleanupStack::Pop( reply ); 
- 
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCD::GetStatus( TInt aTask, TBool aAll )
-// Collects a status of a specified task / all tasks
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCD::GetStatusL( TInt aTask, TBool aAll )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    
-    // create mergeReply object. Store installer and br replys here.
-    CSConStatusReply* mergeReply = new (ELeave) CSConStatusReply();
-    CleanupStack::PushL( mergeReply );
-            
-    
-    CSConStatusReply* brReply = new (ELeave) CSConStatusReply();
-    CleanupStack::PushL( brReply );
-    iBackupRestoreQueue->GetQueueStatusL( aTask, aAll, brReply );
-    
-    
-    // Create installerReply and populate it
-    CSConStatusReply* installerReply = new (ELeave) CSConStatusReply();
-    CleanupStack::PushL( installerReply );
-    iInstallerQueue->GetQueueStatusL( aTask, aAll, installerReply );
-    
-    if ( !installerReply->iNoTasks || !brReply->iNoTasks )
-        {
-        mergeReply->iNoTasks = EFalse;
-        }
-    else
-        {
-        mergeReply->iNoTasks = ETrue;
-        }
-        
-    for ( TInt i = 0; i < installerReply->iTasks.Count(); i++ )
-        {
-        CSConTaskReply* temp = installerReply->iTasks[i]->CopyAndFreeL();
-        CleanupStack::PushL( temp );
-        mergeReply->iTasks.AppendL( temp );
-        CleanupStack::Pop( temp );
-        }
-    
-    // installer replys are copied to mergereply, delete installerReply
-    CleanupStack::PopAndDestroy( installerReply );
-    
-    // do same for br reply
-    for ( TInt i = 0; i < brReply->iTasks.Count(); i++ )
-        {
-        CSConTaskReply* temp = brReply->iTasks[i]->CopyAndFreeL();
-        CleanupStack::PushL( temp );
-        mergeReply->iTasks.AppendL( temp );
-        CleanupStack::Pop( temp );
-        }
-    
-    CleanupStack::PopAndDestroy( brReply );
-    
-    CleanupStack::Pop( mergeReply );
-    // store reply
-    StoreReply( mergeReply );
-    
-    LOGGER_WRITE_1( "CSConPCD::GetStatus() : returned %d", ret );
-    return ret;
-    }
-        
-// -----------------------------------------------------------------------------
-// CSConPCD::Cancel( TInt aTask, TBool aAll )
-// Cancels a specified task / all tasks
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCD::CancelL( TInt aTask, TBool aAll )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    
-    CSConStatusReply* reply = new (ELeave) CSConStatusReply();
-    iInstallerQueue->CancelTask( aTask, aAll );
-    iBackupRestoreQueue->CancelTask( aTask, aAll );
-    
-    reply->iNoTasks = ETrue;
-    
-    StoreReply( reply );
-    
-    LOGGER_WRITE_1( "CSConPCD::CancelL() : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCD::StoreReply( CSConStatusReply*& aReply )
-// Stores a reply
-// -----------------------------------------------------------------------------
-//
-void CSConPCD::StoreReply( CSConStatusReply*& aReply )  
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iLatestReply )
-        {
-        delete iLatestReply;
-        iLatestReply = NULL;
-        }
-        
-    iLatestReply = aReply;
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConPCD::UpdateDeviceInfo( TInt aMaxObjectSize )
-// Creates a reply for UpdateDeviceInfo task
-// -----------------------------------------------------------------------------
-//
-TInt CSConPCD::UpdateDeviceInfoL( TInt aMaxObjectSize )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-    TSConMethodName method( EUpdateDeviceInfo );
-    
-    CSConStatusReply* reply = new (ELeave) CSConStatusReply();
-    CleanupStack::PushL( reply );
-    CSConTaskReply* taskReply = new (ELeave) CSConTaskReply();
-    CleanupStack::PushL( taskReply );
-    
-    
-    TBool complete( ETrue );
-    TInt progress( KSConCodeTaskCompleted );
-    
-    taskReply->InitializeL( method, progress, complete );
-    taskReply->iTaskId = iTaskNumber;
-        
-    TInt arrayLength = sizeof KSupportedMethods / sizeof KSupportedMethods[0];
-    
-    for ( TInt i = 0; i < arrayLength; i++ )
-        {
-        switch( KSupportedMethods[i].method )
-            {
-            case EGetDataSize :
-                taskReply->iDevInfoParams->iGetSizeSupp = 
-                KSupportedMethods[i].support;
-                break;
-            case EInstall :
-                taskReply->iDevInfoParams->iInstallSupp = 
-                KSupportedMethods[i].support;
-                break;
-            case EListDataOwners :
-                taskReply->iDevInfoParams->iDataOwnersSupp = 
-                KSupportedMethods[i].support;
-                break;
-            case EListInstalledApps :
-                taskReply->iDevInfoParams->iInstAppsSupp = 
-                KSupportedMethods[i].support;
-                break;
-            case ERequestData :
-                taskReply->iDevInfoParams->iReqDataSupp = 
-                KSupportedMethods[i].support;
-                break;
-            case ESetBURMode :
-                taskReply->iDevInfoParams->iSetBURModeSupp = 
-                KSupportedMethods[i].support;
-                break;
-            case ESetInstParams :
-                taskReply->iDevInfoParams->iInstParamsSupp = 
-                KSupportedMethods[i].support;
-                break;
-            case ESupplyData :
-                taskReply->iDevInfoParams->iSupplyDataSupp = 
-                KSupportedMethods[i].support;
-                break;
-            case EUninstall :
-                taskReply->iDevInfoParams->iUninstallSupp = 
-                KSupportedMethods[i].support;
-                break;
-            case EReboot :
-                taskReply->iDevInfoParams->iRebootSupp = 
-                KSupportedMethods[i].support;
-                break;
-            default :
-                break;
-            }
-        }
-    
-    taskReply->iDevInfoParams->iVersion.Copy( KConMLVersion );
-    taskReply->iDevInfoParams->iMaxObjectSize = KMaxObjectSize;
-    
-    reply->iNoTasks = EFalse;
-
-    User::LeaveIfError( reply->iTasks.Append( taskReply ) );
-    StoreReply( reply );
-    
-    CleanupStack::Pop( taskReply );
-    CleanupStack::Pop( reply );
-    LOGGER_WRITE_1( "CSConPCD::UpdateDeviceInfo() : returned %d", ret );
-    return ret;
-    }
-
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/src/sconpcdutility.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,418 +0,0 @@
-/*
-* Copyright (c) 2006-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:  SConPcdUtility implementation
-*
-*/
-
-
-//  CLASS HEADER
-#include <swi/sisregistryentry.h>
-#include <swi/sisregistrysession.h>
-#include <swi/sisregistrypackage.h>
-#include <stringresourcereader.h>
-// #include <WidgetRegistryClient.h>
-#include <javaregistryincludes.h>
-#include <appversion.h>
-#include <mmf/common/mmfcontrollerpluginresolver.h>
-#include <sconftp.rsg>              // Resource to be read header 
-
-using namespace Java;
-
-#include "debug.h"
-#include "sconpcdutility.h"
-#include "sconconmltask.h"
-
-// localized "unknown vendor".
-_LIT( KSConResourceName, "z:\\Resource\\sconftp.rsc" );
-
-
-
-//  METHODS
-//----------------------------------------------------------------------------
-// void SConPcdUtility::ProcessListInstalledAppsL( CSConTask*& aTask )
-//----------------------------------------------------------------------------
-//
-void SConPcdUtility::ProcessListInstalledAppsL( CSConTask*& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    LOGGER_WRITE_1("iAllApps: %d",(TInt)aTask->iListAppsParams->iAllApps);
-    LOGGER_WRITE8_1("driveList: %S", &aTask->iListAppsParams->iDriveList);
-    
-    AppendInstalledSisL( *aTask->iListAppsParams );
-    AppendInstalledJavaL( *aTask->iListAppsParams );
-    AppendInstalledWidgetsL( *aTask->iListAppsParams );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-//----------------------------------------------------------------------------
-// void SConPcdUtility::AppendInstalledSisL( RPointerArray<CSConInstApp> &aApps )
-// Appends installed sis packages and augmentations to aApps array.
-//----------------------------------------------------------------------------
-//
-void SConPcdUtility::AppendInstalledSisL( CSConListInstApps& aListInstApps )
-    {
-    TRACE_FUNC_ENTRY;
-    // Get installed applications from sis registry
-    Swi::RSisRegistrySession sisRegistry;
-    CleanupClosePushL( sisRegistry );
-    User::LeaveIfError( sisRegistry.Connect() );
-    
-    RArray<TUid> uids;
-    CleanupClosePushL(uids);
-    sisRegistry.InstalledUidsL( uids );
-    
-    
-    //Read package information
-    for( TInt i = 0; i < uids.Count(); i++ )
-        {
-        Swi::RSisRegistryEntry entry;
-        CleanupClosePushL(entry);
-        User::LeaveIfError( entry.Open( sisRegistry, uids[i] ) );
-        
-        TBool showIt( EFalse );
-        if ( aListInstApps.iAllApps )
-            {
-            // show all apps -param defined, exlude stubs on ROM
-            if ( !entry.IsInRomL() )
-                {
-                showIt = ETrue;
-                }
-            }
-        else
-            {
-            // show if installed one of the specified drives
-            // don't exlude stubs on ROM
-            showIt = IsInstalledToSelectedDrive( aListInstApps.iDriveList,
-                                                 entry.InstalledDrivesL() );
-            }
-        
-        // Only show if not in rom
-        if ( showIt && entry.IsPresentL() )
-            {    
-            // Add the created object to the list
-            LOGGER_WRITE_1( "SConPcdUtility::ProcessListInstalledAppsL : add pkg, index %d", i );
-            CSConInstApp* app = new (ELeave) CSConInstApp();
-            CleanupStack::PushL( app );
-            
-            HBufC* temp = entry.PackageNameL();
-            TPtrC tempPtr = temp->Des();
-            LOGGER_WRITE_1("PackageNameL: %S", &tempPtr);
-            CleanupStack::PushL( temp );
-            if ( temp->Length() > app->iName.MaxLength() )
-            	{
-            	User::Leave( KErrTooBig );
-            	}
-            app->iName.Copy( *temp );
-            CleanupStack::PopAndDestroy( temp );
-            temp = NULL;
-            
-            temp = entry.UniqueVendorNameL();
-            CleanupStack::PushL( temp );
-            if ( temp->Length() > app->iVendor.MaxLength() )
-            	{
-            	User::Leave( KErrTooBig );
-            	}
-            app->iVendor.Copy( *temp );
-            CleanupStack::PopAndDestroy( temp );
-            temp = NULL;
-            
-            app->iVersion.Copy( entry.VersionL().Name() );
-            app->iType = ESisApplication;
-            app->iSize = entry.SizeL();
-            app->iUid = entry.UidL();
-            
-            User::LeaveIfError( aListInstApps.iApps.Append( app ) );
-            CleanupStack::Pop( app );
-            }
-        
-        // Get possible augmentations
-        RPointerArray<Swi::CSisRegistryPackage> augPackages;
-        CleanupResetAndDestroyPushL( augPackages );
-        entry.AugmentationsL( augPackages );
-        for ( TInt j( 0 ); j < augPackages.Count(); j++ )
-            {
-            Swi::RSisRegistryEntry augmentationEntry;
-            CleanupClosePushL( augmentationEntry );
-            augmentationEntry.OpenL( sisRegistry, *augPackages[j] );
-            
-            TBool showIt( EFalse );
-            if ( aListInstApps.iAllApps )
-                {
-                // show all apps -param defined, exlude stubs on ROM
-                if ( !augmentationEntry.IsInRomL() )
-                    {
-                    showIt = ETrue;
-                    }
-                }
-            else
-                {
-                // show if installed one of the specified drives
-                // don't exlude stubs on ROM
-                showIt = IsInstalledToSelectedDrive( aListInstApps.iDriveList,
-                                        augmentationEntry.InstalledDrivesL() );
-                }
-            
-            // Only show if not in rom
-            if ( showIt && augmentationEntry.IsPresentL() )
-                {
-                CSConInstApp* augApp = new (ELeave) CSConInstApp();
-                CleanupStack::PushL( augApp );
-                augApp->iName.Copy( augPackages[j]->Name() );
-                
-                HBufC* temp = entry.PackageNameL();
-                CleanupStack::PushL( temp );
-                if ( temp->Length() > augApp->iParentName.MaxLength() )
-                	{
-                	User::Leave( KErrTooBig );
-                	}
-                augApp->iParentName.Copy( *temp );
-                CleanupStack::PopAndDestroy( temp );
-                temp = NULL;
-                
-                augApp->iVendor.Copy( augPackages[j]->Vendor() );
-                augApp->iVersion.Copy( augmentationEntry.VersionL().Name() );
-                augApp->iType = ESisAugmentation;
-                augApp->iSize = augmentationEntry.SizeL();
-                augApp->iUid = augmentationEntry.UidL();
-                
-                LOGGER_WRITE_1( "SConPcdUtility::ProcessListInstalledAppsL : add augmentation, index: %d", j );
-                LOGGER_WRITE_1( "SConPcdUtility::ProcessListInstalledAppsL : add augmentation, basepkg: %d", i );
-                TInt augindex = augPackages[j]->Index();
-                LOGGER_WRITE_1( "SConPcdUtility::ProcessListInstalledAppsL : augindex: %d",augindex );
-                User::LeaveIfError( aListInstApps.iApps.Append( augApp ) );
-                CleanupStack::Pop( augApp );   
-                }
-            CleanupStack::PopAndDestroy( &augmentationEntry );
-            }  
-        CleanupStack::PopAndDestroy( &augPackages ); 
-        CleanupStack::PopAndDestroy( &entry );
-        }
-    
-    CleanupStack::PopAndDestroy(&uids);
-    CleanupStack::PopAndDestroy(&sisRegistry);
-    TRACE_FUNC_EXIT;
-    }
-
-//----------------------------------------------------------------------------
-// void SConPcdUtility::AppendInstalledJavaL( RPointerArray<CSConInstApp> &aApps )
-// Appends installed java packages to aApps array.
-//----------------------------------------------------------------------------
-//
-void SConPcdUtility::AppendInstalledJavaL( CSConListInstApps& aListInstApps )
-    {
-    TRACE_FUNC_ENTRY;
-    CJavaRegistry* javaRegistry = CJavaRegistry::NewLC( );
-    RArray<TUid> packageUids;
-    CleanupClosePushL( packageUids );
-    javaRegistry->GetRegistryEntryUidsL( packageUids );
-    LOGGER_WRITE_1("packageUids.Count(): %d", packageUids.Count());
-    for (TInt i=0; i<packageUids.Count(); i++ )
-        {
-        LOGGER_WRITE_1("RegistryEntryL: %d",i);
-        LOGGER_WRITE_1("handle entry uid: 0x%08X",packageUids[i].iUid);
-        CJavaRegistryEntry* entry = javaRegistry->RegistryEntryL( packageUids[i] );
-        if ( entry )
-            {
-            CleanupStack::PushL( entry );
-            if ( entry->Type() >= EGeneralPackage && entry->Type() < EGeneralApplication )
-                {
-                // entry was correct type
-                CJavaRegistryPackageEntry* packageEntry = ( CJavaRegistryPackageEntry* ) entry;
-                
-                // check do we need to filter it out
-                TBool showIt( EFalse );
-                if ( aListInstApps.iAllApps )
-                    {
-                    showIt = ETrue;
-                    }
-                else
-                    {
-                    TDriveNumber drive = packageEntry->Drive();
-                    if ( aListInstApps.iDriveList.Length() > drive
-                            && aListInstApps.iDriveList[ drive ] )
-                        {
-                        showIt = ETrue;
-                        }
-                    }
-                
-                if ( showIt )
-                    {
-                    CSConInstApp* app = new (ELeave) CSConInstApp();
-                    CleanupStack::PushL( app );
-                    // Get Uid, name, type, vendor
-                    app->iUid =  packageEntry->Uid();
-                    app->iName.Copy ( packageEntry->Name() );
-                    LOGGER_WRITE_1( "Name: %S", &app->iName );
-                    app->iType = EJavaApplication;
-                    
-                    // Get version
-                    TAppVersion midletVersion( packageEntry->Version() );
-                    TVersion verType(midletVersion.iMajor, midletVersion.iMinor, midletVersion.iBuild);    
-                    app->iVersion.Copy( verType.Name() );
-                    
-                    // Get vendor
-                    if ( entry->NumberOfCertificateChains() > 0 && packageEntry->Vendor().Length() > 0 )
-                        {
-                        app->iVendor.Copy( packageEntry->Vendor() );
-                        }
-                    else
-                        {
-                        // untrusted applications do not have certificates.
-                        // if the application has a certificate, it is installed either as 
-                        // trusted or not installed at all.
-                        
-                        // unknown vendor
-                        TFileName myFileName( KSConResourceName );
-                        CStringResourceReader* resReader = CStringResourceReader::NewL( myFileName );
-                        TPtrC bufUnknownSuplier;
-                        bufUnknownSuplier.Set( resReader->ReadResourceString( R_SECON_UNKNOWN_SUPPLIER ) );
-                        
-                        app->iVendor.Copy( bufUnknownSuplier );
-                        
-                        delete resReader;
-                        }
-                    
-                    // Get size
-                    app->iSize = packageEntry->UsedUserDiskSpace();
-                    
-                    User::LeaveIfError( aListInstApps.iApps.Append( app ) );
-                    CleanupStack::Pop( app );
-                    }
-                }
-            CleanupStack::PopAndDestroy( entry );
-            }
-        }
-    
-    CleanupStack::PopAndDestroy( &packageUids );
-    CleanupStack::PopAndDestroy( javaRegistry );
-    TRACE_FUNC_EXIT;
-    }
-
-//----------------------------------------------------------------------------
-// void SConPcdUtility::AppendInstalledWidgetsL( RPointerArray<CSConInstApp> &aApps )
-// Appends installed widgets to aApps array.
-//----------------------------------------------------------------------------
-//
-void SConPcdUtility::AppendInstalledWidgetsL( CSConListInstApps& aListInstApps )
-    {
-    // Commented out as WidgetRegistry will be removed from MCL.
-    // TODO: Check how Widgets should be listed on future.
-    /*
-    TRACE_FUNC_ENTRY;
-    RWidgetRegistryClientSession widgetSession;
-    CleanupClosePushL( widgetSession );
-    User::LeaveIfError( widgetSession.Connect() );
-    
-    // Get the list of installed widgets
-    RWidgetInfoArray widgetInfoArr;
-    CleanupClosePushL( widgetInfoArr );
-    widgetSession.InstalledWidgetsL( widgetInfoArr );
-    TFileName bundleId;
-    for ( TInt i = 0; i < widgetInfoArr.Count(); i++ )
-        {
-        CWidgetInfo *item = widgetInfoArr[i];
-        CleanupStack::PushL( item );
-        
-        
-        TBool showIt( EFalse );
-        if ( aListInstApps.iAllApps )
-            {
-            // show all apps -param defined
-            showIt = ETrue;
-            }
-        else
-            {
-            TDriveUnit locationDrive = item->iDriveName->Des();
-            // show if installed one of the specified drives
-            if (  aListInstApps.iDriveList.Length() > locationDrive
-                    && aListInstApps.iDriveList[locationDrive] )
-                {
-                showIt = ETrue;
-                }
-            }
-        
-        if ( showIt )
-            {
-            
-            CSConInstApp* app = new (ELeave) CSConInstApp();
-            CleanupStack::PushL( app );
-            app->iName.Copy( *(item->iBundleName) );
-            app->iType = EWidgetApplication;
-            app->iSize = item->iFileSize;
-            app->iUid = item->iUid;
-            
-            CWidgetPropertyValue* propValue = widgetSession.GetWidgetPropertyValueL(
-                    item->iUid, EBundleVersion );
-            if ( propValue && propValue->iType == EWidgetPropTypeString )
-                {
-                app->iVersion.Copy( *(propValue->iValue.s) );
-                }
-            delete propValue;
-            propValue = NULL;
-            bundleId.Zero();
-            widgetSession.GetWidgetBundleId( item->iUid, bundleId );
-            app->iWidgetBundleId = bundleId.AllocL();
-            
-            User::LeaveIfError( aListInstApps.iApps.Append( app ) );
-            CleanupStack::Pop( app ); // ownership transferred, do not delete
-            }
-        CleanupStack::PopAndDestroy( item );
-        }
-    User::LeaveIfError( widgetSession.Disconnect() );
-    
-    CleanupStack::PopAndDestroy( &widgetInfoArr );
-    CleanupStack::PopAndDestroy( &widgetSession );
-    TRACE_FUNC_EXIT;
-    */
-    }
-
-// ---------------------------------------------------------
-// SConPcdUtility::IsInstalledToSelectedDrive
-// Solve highest drive from aInstalledDrives and check
-// if that drive is selected
-// ---------------------------------------------------------
-//
-TBool SConPcdUtility::IsInstalledToSelectedDrive( const TDriveList& aSelectedDriveList, TUint aInstalledDrives )
-    {
-    TInt locationDrive;
-    if( aInstalledDrives )
-         {
-         // Select the highest drive as location drive
-         TInt drive = EDriveA;
-         while( aInstalledDrives >>= 1 )
-             {
-             drive++;
-             }
-         locationDrive = drive;
-         }
-     else
-         {
-         // No installed files, select C: as location drive
-         locationDrive = EDriveC;
-         }
-    
-    if ( aSelectedDriveList.Length() > locationDrive && aSelectedDriveList[locationDrive] )
-        {
-        LOGGER_WRITE("SConPcdUtility::IsInstalledToSelectedDrive : return ETrue");
-        return ETrue;
-        }
-    else
-        {
-        LOGGER_WRITE("SConPcdUtility::IsInstalledToSelectedDrive : return EFalse");
-        return EFalse;
-        }
-    }
-//  END OF FILE
--- a/connectivitymodules/SeCon/services/pcd/src/sconqueue.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,571 +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:  Queue implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "sconqueue.h"
-#include "sconpcdconsts.h"
-#include "debug.h"
-#include <SWInstDefs.h> // installer errors
-#include <usif/usiferror.h>
-
-// ============================= MEMBER FUNCTIONS ===============================
-
-
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::~CSConTaskQueue()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConTaskQueue::~CSConTaskQueue()
-    {
-    TRACE_FUNC;
-    iQueue.ResetAndDestroy();
-    iQueue.Close(); 
-    iTimer.Close();
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::GetQueueStatus( TInt aTask, TBool aAllTasks, 
-//                                  CSConStatusReply*& aStatus )
-// Returns the status of a specified task / all tasks
-// -----------------------------------------------------------------------------
-//
-void CSConTaskQueue::GetQueueStatusL( TInt aTask, TBool aAllTasks, 
-                                    CSConStatusReply*& aStatus )
-    {
-    RArray<TInt> completedTasks;
-    CleanupClosePushL( completedTasks );
-    if ( aAllTasks )
-        {
-        //if there are tasks
-        if ( iQueue.Count() > 0 )
-            {
-            //set iNoTasks as EFalse
-            aStatus->iNoTasks = EFalse;
-            for ( TInt i = 0; i < iQueue.Count(); i++ )
-                {
-                //Fill reply object
-                CSConTaskReply* taskReply = new (ELeave) CSConTaskReply();
-                CleanupStack::PushL( taskReply );
-                taskReply->InitializeL( *iQueue[i] );
-                User::LeaveIfError( aStatus->iTasks.Append( taskReply ) );
-                CleanupStack::Pop( taskReply );
-                TBool complete = iQueue[i]->GetComplete();
-
-                //Collect completed task numbers to array for deleting
-                if ( complete )
-                    {
-                    completedTasks.Append( iQueue[i]->iTaskId );
-                    }
-                //Otherwise clean all unneccessary data from the reply packet
-                else
-                    {
-                    taskReply->CleanTaskData(); 
-                    }
-                }
-            }
-        else
-            {
-            //no task in the queue
-            aStatus->iNoTasks = ETrue;
-            }
-
-        //Remove completed tasks from queue
-        for ( TInt j = 0; j < completedTasks.Count(); j++ )
-            {
-            RemoveTask( completedTasks[j] );
-            }
-        }
-    else if ( aTask > 0 )
-        {
-        CSConTask* temp = new (ELeave) CSConTask();
-        temp->iTaskId = aTask;
-        TInt index = iQueue.Find( temp, CSConTaskQueue::Match );
-        delete temp;
-        
-        TBool complete = EFalse;
-        CSConTaskReply* taskReply(NULL);
-
-        if ( index != KErrNotFound )
-            {
-            aStatus->iNoTasks = EFalse;
-            //Fill reply object
-            taskReply = new (ELeave) CSConTaskReply();
-            CleanupStack::PushL( taskReply );
-            taskReply->InitializeL( *iQueue[index] );
-            User::LeaveIfError( aStatus->iTasks.Append( taskReply ) );
-            CleanupStack::Pop( taskReply );
-            complete = iQueue[index]->GetComplete();
-            }
-        else
-            {
-            //no task in the queue
-            aStatus->iNoTasks = ETrue;
-            }        
-        
-        //Delete completed tasks from queue
-        if ( complete )
-            {
-            RemoveTask( aTask );
-            }
-        //Otherwise clean all unneccessary data from the reply packet
-        else if ( taskReply )
-            {
-            taskReply->CleanTaskData(); 
-            }
-        }
-    else
-        {
-        //no task in the queue
-        aStatus->iNoTasks = ETrue;
-        }
-    CleanupStack::PopAndDestroy( &completedTasks ); // close
-    }   
-    
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::AddNewTask( CSConTask*& aNewTask, TInt aTaskId )
-// Adds a new task to queue
-// -----------------------------------------------------------------------------
-//
-TInt CSConTaskQueue::AddNewTask( CSConTask*& aNewTask, TInt aTaskId )
-    {
-    TInt ret( KErrNone );
-    
-    aNewTask->iTaskId = aTaskId;
-    
-    //Set progress value "task accepted for execution"
-    aNewTask->SetProgressValue( KSConCodeTaskCreated );
-    aNewTask->SetCompleteValue( EFalse );
-    
-    if ( iQueue.Count() == 0 )
-        {
-        StartQueue();
-        }
-    ret = iQueue.InsertInOrder( aNewTask, CSConTaskQueue::Compare );
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::CompleteTask( TInt aTask, TInt aError )
-// Set the task to completed -mode
-// -----------------------------------------------------------------------------
-//
-TInt CSConTaskQueue::CompleteTask( TInt aTask, TInt aError )
-    {
-    LOGGER_WRITE_1( "CSConTaskQueue::CompleteTask aError: %d", aError );
-    TInt ret(KErrNone);
-    TInt index( KErrNotFound );
-    
-    CSConTask* temp = new CSConTask();
-    if (!temp)
-        return KErrNoMemory;
-    
-    temp->iTaskId = aTask;
-    index = iQueue.Find( temp, CSConTaskQueue::Match );
-    delete temp;
-    
-    if ( index != KErrNotFound )
-        {
-        TBool complete( ETrue );
-        TBool notComplete( EFalse );
-        TInt progress( KSConCodeTaskCompleted );        
-        
-        switch( aError )
-            {
-            case KErrNone :
-                iQueue[index]->SetCompleteValue( complete );
-                progress =  KSConCodeTaskCompleted;
-                break;
-            case KErrNotFound :
-                iQueue[index]->SetCompleteValue( complete );
-                progress =  KSConCodeNotFound;
-                break;
-            case KErrCompletion :
-                iQueue[index]->SetCompleteValue( notComplete );
-                progress = KSConCodeTaskPartiallyCompleted;
-                break;
-
-            // installer specific errors
-            case SwiUI::KSWInstErrUserCancel:
-            	LOGGER_WRITE("User cancelled the operation");
-            	iQueue[index]->SetCompleteValue( complete );
-            	progress = KSConCodeInstErrUserCancel;
-            	break;
-            case SwiUI::KSWInstErrFileCorrupted:
-            case KErrSifCorruptedPackage:
-            	LOGGER_WRITE("File is corrupted");
-            	iQueue[index]->SetCompleteValue( complete );
-            	progress = KSConCodeInstErrFileCorrupted;
-            	break;
-            case SwiUI::KSWInstErrInsufficientMemory:
-            case KErrSifNotEnoughSpace:
-            	LOGGER_WRITE("Insufficient free memory in the drive to perform the operation");
-	            iQueue[index]->SetCompleteValue( complete );
-	            progress = KSConCodeInstErrInsufficientMemory;	
-	            break;
-            case SwiUI::KSWInstErrPackageNotSupported:
-            case KErrSifUnsupportedSoftwareType:
-            	LOGGER_WRITE("Installation of the package is not supported");
-            	iQueue[index]->SetCompleteValue( complete );
-            	progress = KSConCodeInstErrPackageNotSupported;
-            	break;
-            case SwiUI::KSWInstErrSecurityFailure:
-            	LOGGER_WRITE("Package cannot be installed due to security error");
-            	iQueue[index]->SetCompleteValue( complete );
-            	progress = KSConCodeInstErrSecurityFailure;
-            	break;
-            case SwiUI::KSWInstErrMissingDependency:
-            case KErrSifMissingDependencies:
-            	LOGGER_WRITE("Package cannot be installed due to missing dependency");
-            	iQueue[index]->SetCompleteValue( complete );
-            	progress = KSConCodeInstErrMissingDependency;
-            	break;
-            case SwiUI::KSWInstErrFileInUse:
-            	LOGGER_WRITE("Mandatory file is in use and prevents the operation");
-            	iQueue[index]->SetCompleteValue( complete );
-            	progress = KSConCodeInstErrFileInUse;
-            	break;
-            case SwiUI::KSWInstErrGeneralError:
-            case KErrSifUnknown:
-            	LOGGER_WRITE("Unknown error");
-            	iQueue[index]->SetCompleteValue( complete );
-            	progress = KSConCodeInstErrGeneralError;
-            	break;
-            case SwiUI::KSWInstErrNoRights:
-            	LOGGER_WRITE("The package has no rights to perform the operation");
-            	iQueue[index]->SetCompleteValue( complete );
-            	progress = KSConCodeInstErrNoRights;
-            	break;
-            case SwiUI::KSWInstErrNetworkFailure:
-            	LOGGER_WRITE("Indicates that network failure aborted the operation");
-            	iQueue[index]->SetCompleteValue( complete );
-            	progress = KSConCodeInstErrNetworkFailure;
-            	break;
-            case SwiUI::KSWInstErrBusy:
-            	LOGGER_WRITE("Installer is busy doing some other operation");
-            	iQueue[index]->SetCompleteValue( complete );
-        		progress = KSConCodeInstErrBusy;
-            	break;
-            case SwiUI::KSWInstErrAccessDenied:
-            	LOGGER_WRITE("Target location of package is not accessible");
-            	iQueue[index]->SetCompleteValue( complete );
-            	progress = KSConCodeInstErrAccessDenied;
-            	break;
-            case SwiUI::KSWInstUpgradeError:
-            	LOGGER_WRITE("The package is an invalid upgrade");
-            	iQueue[index]->SetCompleteValue( complete );
-            	progress = KSConCodeInstUpgradeError;
-            	break;
-            	
-            case KErrSifMissingBasePackage:
-                LOGGER_WRITE("KErrSifMissingBasePackage");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrSifMissingBasePackage;
-                break;
-            case KErrSifOverflow:
-                LOGGER_WRITE("KErrSifOverflow");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrSifOverflow;
-                break;
-            case KErrSifSameVersionAlreadyInstalled:
-                LOGGER_WRITE("KErrSifSameVersionAlreadyInstalled");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrSifSameVersionAlreadyInstalled;
-                break;
-            case KErrSifNewerVersionAlreadyInstalled:
-                LOGGER_WRITE("KErrSifNewerVersionAlreadyInstalled");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrSifNewerVersionAlreadyInstalled;
-                break;
-            case KErrSifAlreadyActivated:
-                LOGGER_WRITE("KErrSifAlreadyActivated");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrSifAlreadyActivated;
-                break;
-            case KErrSifAlreadyDeactivated:
-                LOGGER_WRITE("KErrSifAlreadyDeactivated");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrSifAlreadyDeactivated;
-                break;
-            case KErrSifBadComponentId:
-                LOGGER_WRITE("KErrSifBadComponentId");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrSifBadComponentId;
-                break;
-            case KErrSifBadInstallerConfiguration:
-                LOGGER_WRITE("KErrSifBadInstallerConfiguration");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrSifBadInstallerConfiguration;
-                break;
-            case KErrSifPackageCannotBeInstalledOnThisDevice:
-                LOGGER_WRITE("KErrSifPackageCannotBeInstalledOnThisDevice");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrSifPackageCannotBeInstalledOnThisDevice;
-                break;
-            case KErrSifUnsupportedLanguage:
-                LOGGER_WRITE("KErrSifUnsupportedLanguage");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrSifUnsupportedLanguage;
-                break;
-            case KErrScrWriteOperationInProgress:
-                LOGGER_WRITE("KErrScrWriteOperationInProgress");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrScrWriteOperationInProgress;
-                break;
-            case KErrScrReadOperationInProgress:
-                LOGGER_WRITE("KErrScrReadOperationInProgress");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrScrReadOperationInProgress;
-                break;
-            case KErrScrNoActiveTransaction:
-                LOGGER_WRITE("KErrScrNoActiveTransaction");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrScrNoActiveTransaction;
-                break;
-            case KErrScrUnsupportedLocale:
-                LOGGER_WRITE("KErrScrUnsupportedLocale");
-                iQueue[index]->SetCompleteValue( complete );
-                progress = KSConCodeInstErrScrUnsupportedLocale;
-                break;
-            
-            default :
-                iQueue[index]->SetCompleteValue( complete );
-                if ( aError < KErrNone && aError >= KErrCorruptSurrogateFound )
-                    {
-                    // aError is always negative
-                    //  -> returned errorcode is from KSConCodeFirstSymbianErr...n
-                    progress = KSConCodeFirstSymbianErr - aError;
-                    }
-                else
-                    {
-                    progress = KSConCodeConflict;
-                    }
-                
-                break;
-            }
-            
-        iQueue[index]->SetProgressValue( progress );
-        }
-    else
-        {
-        ret = KErrNotFound;
-        }
-    StartQueue();
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::SetTaskProgress( TInt aTask, TInt aProgressValue )
-// Set the task progress value
-// -----------------------------------------------------------------------------
-//
-TInt CSConTaskQueue::SetTaskProgress( TInt aTask, TInt aProgressValue )
-    {
-    TInt ret( KErrNone );
-    TInt index( KErrNotFound );
-
-    CSConTask* temp = new CSConTask();
-    if (temp)
-        {
-        temp->iTaskId = aTask;
-        index = iQueue.Find( temp, CSConTaskQueue::Match );
-        delete temp;
-        
-        if ( index != KErrNotFound )
-            {
-            iQueue[index]->SetProgressValue( aProgressValue );
-            }
-        else
-            {
-            ret = KErrNotFound;
-            }
-        }
-    else
-        {
-        ret = KErrNoMemory;
-        }
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::GetTask( TInt aTaskId, CSConTask*& aTask )
-// Receives a specified task
-// -----------------------------------------------------------------------------
-//
-TInt CSConTaskQueue::GetTask( TInt aTaskId, CSConTask*& aTask )
-    {
-    TInt ret( KErrNone );
-    TInt index;
-    
-    CSConTask* temp = new CSConTask();
-    if (temp)
-        {
-        temp->iTaskId = aTaskId;
-        index = iQueue.Find( temp, CSConTaskQueue::Match );
-        delete temp;
-    
-        if ( index != KErrNotFound )
-            {
-            aTask = iQueue[index];
-            }
-        else
-            {
-            ret = KErrNotFound;
-            }
-        }
-    else
-        {
-        ret = KErrNoMemory;
-        }
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::RemoveTask( TInt aTask )
-// Removes a task from the queue
-// -----------------------------------------------------------------------------
-//
-TInt CSConTaskQueue::RemoveTask( TInt aTask )
-    {
-    TInt ret(KErrNone);
-    TInt index( KErrNotFound );
-    
-    CSConTask* temp = new CSConTask();
-    if (temp)
-        {
-        temp->iTaskId = aTask;
-        index = iQueue.Find( temp, CSConTaskQueue::Match );
-        delete temp;
-        
-        if ( index != KErrNotFound ) 
-            {
-            delete iQueue[index];
-            iQueue.Remove( index );
-            iQueue.Compress();
-            }
-        else
-            {
-            ret = KErrNotFound;
-            }
-        
-        if ( iQueue.Count() == 0 )
-            {
-            StopQueue();
-            iQueue.Reset();
-            }
-        }
-    else
-        {
-        ret = KErrNoMemory;
-        }
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::CancelTask( TInt aTask, TBool aAllTasks )
-// Cancels a task
-// -----------------------------------------------------------------------------
-//
-void CSConTaskQueue::CancelTask( TInt aTask, TBool aAllTasks )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    //Remove the task from the queue
-    if ( aTask > 0 && !aAllTasks )
-        {
-        RemoveTask( aTask );
-        }
-        
-    //Remove all tasks from the queue
-    if ( aAllTasks )
-        {
-        iQueue.ResetAndDestroy();
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::QueueProcessActive()
-// The status of the process
-// -----------------------------------------------------------------------------
-//  
-TBool CSConTaskQueue::QueueProcessActive() const
-    {
-    return iQueueProcessActive;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::ChangeQueueProcessStatus()
-// Changes the status of the queue process
-// -----------------------------------------------------------------------------
-//  
-void CSConTaskQueue::ChangeQueueProcessStatus()
-    {
-    iQueueProcessActive = !iQueueProcessActive;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::Reset()
-// Resets the queue
-// -----------------------------------------------------------------------------
-//
-void CSConTaskQueue::Reset()
-    {
-    TRACE_FUNC_ENTRY;
-    iTimer.Cancel();
-    iQueue.ResetAndDestroy();
-    TRACE_FUNC_EXIT;
-    }
-
-// ---------------------------------------------------------
-// CSConTaskQueue::Compare( const CSConTask& aFirst, 
-//                          const CSConTask& aSecond )
-// Compares task numbers
-// ---------------------------------------------------------    
-TInt CSConTaskQueue::Compare( const CSConTask& aFirst, 
-                            const CSConTask& aSecond )
-    {
-    if ( aFirst.iTaskId < aSecond.iTaskId )
-        {
-        return -1;
-        }
-    else if ( aFirst.iTaskId > aSecond.iTaskId )
-        {
-        return 1;
-        }
-    
-    return 0;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConTaskQueue::Match( const CSConTask& aFirst, const CSConTask& aSecond )
-// Matches the task numbers
-// -----------------------------------------------------------------------------
-//
-TInt CSConTaskQueue::Match( const CSConTask& aFirst, const CSConTask& aSecond )
-    {
-    if ( aFirst.iTaskId == aSecond.iTaskId )
-        {
-        return ETrue;
-        }
-        
-    return EFalse;
-    }
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/src/sconsbeclient.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1669 +0,0 @@
-/*
-* Copyright (c) 2005-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:  CSConSBEClient implementation
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <pathinfo.h>
-#include <mmf/common/mmfcontrollerpluginresolver.h>
-
-#include "sconsbeclient.h"
-#include "debug.h"
-
-const TInt KDataBufExpandSize( 1024 );
-const TInt KMaxObjectSize( 1048576 - 1024 ); // Max chunk size is 1MB, but give some space for ConML wbxml
-_LIT( KSConNoDrive, "\x0" );
-_LIT( KSConDriveExists, "\x1" );
-// ============================= MEMBER FUNCTIONS ==============================
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::NewL( cosnt TInt aMaxObjectSize )
-// Two-phase constructor
-// -----------------------------------------------------------------------------
-//  
-CSConSBEClient* CSConSBEClient::NewL( RFs& aFs )
-    {
-    TRACE_FUNC;
-    CSConSBEClient* self = new (ELeave) CSConSBEClient( aFs );
-    return self;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::CSConSBEClient( const TInt aMaxObjectSize )
-// Constructor
-// -----------------------------------------------------------------------------
-//
-CSConSBEClient::CSConSBEClient( RFs& aFs ) : 
-        CActive( EPriorityStandard ), iBURModeNormal( ETrue ), iFs( aFs )
-    {
-    CActiveScheduler::Add( this );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::~CSConSBEClient()
-// Initializes member data
-// -----------------------------------------------------------------------------
-//  
-CSConSBEClient::~CSConSBEClient()
-    {
-    TRACE_FUNC_ENTRY;
-    Cancel();
-    TInt err( KErrNone );
-    
-    if( !iBURModeNormal && iSBEClient )
-        {
-        TDriveList driveList;
-        
-        for( TInt i = 0; i<KMaxDrives; i++ )
-            {
-            if( i == EDriveC || i == EDriveE )
-                {
-                driveList.Append( KSConDriveExists );
-                }
-            else
-                {
-                driveList.Append( KSConNoDrive );
-                }
-            }
-        
-        TRAP( err, iSBEClient->SetBURModeL( driveList, EBURNormal, ENoBackup ) );
-        }
-    
-    if( iSBEClient )
-        {
-        delete iSBEClient;
-        iSBEClient = NULL;
-        }
-    
-    delete iDataBuffer;
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::SetBURMode( TRequestStatus& aStatus, CSConTask*& aTask )
-// Set backup/restore mode
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::SetBURMode( TRequestStatus& aStatus, CSConTask*& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    iCurrentTask = aTask;
-
-    TRequestStatus* status = &iStatus; 
-    User::RequestComplete( status, KErrNone ); 
-    SetActive();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::ListPublicFiles( TRequestStatus& aStatus, 
-//                                  CSConTask*& aTask )
-// Lists public files from data owners
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::ListPublicFiles( TRequestStatus& aStatus, 
-                                    CSConTask*& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    iCurrentTask = aTask;
-    
-    TRequestStatus* status = &iStatus; 
-    User::RequestComplete( status, KErrNone ); 
-    SetActive();    
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::ListDataOwners( TRequestStatus& aStatus, CSConTask*& aTask )
-// Lists participant data owners
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::ListDataOwners( TRequestStatus& aStatus, CSConTask*& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    iCurrentTask = aTask;
-    
-    TRequestStatus* status = &iStatus; 
-    User::RequestComplete( status, KErrNone ); 
-    SetActive();
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::GetDataSize( TRequestStatus& aStatus, CSConTask*& aTask )
-// Lists data sizes from data owners
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::GetDataSize( TRequestStatus& aStatus, CSConTask*& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    iCurrentTask = aTask;
-    
-    TRequestStatus* status = &iStatus; 
-    User::RequestComplete( status, KErrNone ); 
-    SetActive();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::RequestData( TRequestStatus& aStatus, CSConTask*& aTask )
-// Request a data from a data owner
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::RequestData( TRequestStatus& aStatus, CSConTask*& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    iCurrentTask = aTask;
-    
-    TRequestStatus* status = &iStatus;
-    User::RequestComplete( status, KErrNone );          
-    SetActive();    
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::GetDataOwnerStatus( TRequestStatus& aStatus, 
-//                                      CSConTask*& aTask )
-// Lists the status of data owners
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::GetDataOwnerStatus( TRequestStatus& aStatus, 
-                                        CSConTask*& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    iCurrentTask = aTask;
-    
-    TRequestStatus* status = &iStatus; 
-    User::RequestComplete( status, KErrNone ); 
-    SetActive();
-        
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::SupplyData( TRequestStatus& aStatus, CSConTask*& aTask )
-// Supplies a data to a data owner
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::SupplyData( TRequestStatus& aStatus, CSConTask*& aTask )
-    {
-    TRACE_FUNC_ENTRY;
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    iCurrentTask = aTask;
-    
-    TRequestStatus* status = &iStatus; 
-    User::RequestComplete( status, KErrNone ); 
-    SetActive();    
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::DoCancel()
-// Implementation of CActive::DoCancel()
-// -----------------------------------------------------------------------------
-//          
-void CSConSBEClient::DoCancel()
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::RunL()
-// Implementation of CActive::RunL()
-// -----------------------------------------------------------------------------
-//              
-void CSConSBEClient::RunL()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err( KErrNone );
-    TInt ret( KErrNone );
-    
-    //Initialize a connection to the backup server
-    if( !iSBEClient )
-        {
-        iSBEClient = CSBEClient::NewL();
-        }   
-    
-    switch( iCurrentTask->GetServiceId() )
-        {
-        case ESetBURMode :
-            LOGGER_WRITE( "CSConSBEClient::RunL() : ESetBURMode" );
-            TRAP( err, ProcessSetBURModeL() );
-            LOGGER_WRITE_1( "CSConSBEClient::RunL() : ProcessSetBURModeL() : returned %d", err );
-            break;
-        case EListPublicFiles :
-            LOGGER_WRITE( "CSConSBEClient::RunL() : EListPublicFiles" );
-            TRAP( err, ProcessListPublicFilesL() );
-            LOGGER_WRITE_1( "CSConSBEClient::RunL() : ProcessListPublicFilesL() : returned %d", err );
-            break;
-        case EListDataOwners :
-            LOGGER_WRITE( "CSConSBEClient::RunL() : EListDataOwners" ); 
-            TRAP( err, ProcessListDataOwnersL() );
-            LOGGER_WRITE_1( "CSConSBEClient::RunL() : ProcessListDataOwnersL() : returned %d", err );
-            break;
-        case EGetDataSize :
-            LOGGER_WRITE( "CSConSBEClient::RunL() : EGetDataSize" );    
-            TRAP( err, ProcessGetDataSizeL() );
-            LOGGER_WRITE_1( "CSConSBEClient::RunL() : ProcessGetDataSizeL() : returned %d", err );
-            break;
-        case ERequestData :
-            LOGGER_WRITE( "CSConSBEClient::RunL() : ERequestData" );
-            TRAP( err, ret = ProcessRequestDataL() );
-            LOGGER_WRITE_1( "CSConSBEClient::RunL() : ProcessRequestDataL() : returned %d", err );
-            break;  
-        case EGetDataOwnerStatus :
-            LOGGER_WRITE( "CSConSBEClient::RunL() : EGetDataOwnerStatus" );
-            TRAP( err, ProcessGetDataOwnerStatusL() );
-            LOGGER_WRITE_1( "CSConSBEClient::RunL() : ProcessGetDataOwnerStatusL() : returned %d", err );
-            break;
-        case ESupplyData :
-            LOGGER_WRITE( "CSConSBEClient::RunL() : ESupplyData" ); 
-            TRAP( err, ret = ProcessSupplyDataL() );
-            LOGGER_WRITE_1( "CSConSBEClient::RunL() : SupplyDataL() : returned %d", err );
-            break;
-        default :
-            err = KErrNotSupported;
-            LOGGER_WRITE( "CSConSBEClient::RunL() : ERROR! Unknown!" ); 
-            break;
-        }
-    
-    if ( err )
-        {
-        HandleSBEErrorL( err );
-        }
-    else
-        {
-        err = ret;
-        }
-    User::RequestComplete( iCallerStatus, err );
-            
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::ProcessSetBURModeL()
-// Executes SetBURMode task
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::ProcessSetBURModeL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iAllSnapshotsSuppliedCalled = EFalse;
-    iLastChunk = EFalse;
-    
-    TDriveList driveList = iCurrentTask->iBURModeParams->iDriveList;
-    
-    TBURPartType partialType = EBURUnset;
-    iRestoreMode = EFalse;
-    
-    switch( iCurrentTask->iBURModeParams->iPartialType )
-        {
-        case ESConBurNormal :
-            partialType = EBURNormal;
-            break;
-        case ESConBurBackupFull :
-            partialType = EBURBackupFull;
-            break;
-        case ESConBurBackupPartial :
-            partialType = EBURBackupPartial;
-            break;
-        case ESConBurRestoreFull :
-            partialType = EBURRestoreFull;
-            iRestoreMode = ETrue;
-            break;
-        case ESConBurRestorePartial :
-            partialType = EBURRestorePartial;
-            iRestoreMode = ETrue;
-            break;
-        default :
-            partialType = EBURUnset;
-            break;
-        }
-    
-    if ( partialType == EBURBackupFull || partialType == ESConBurBackupPartial )
-        {
-        // initialize buffer
-        if ( !iDataBuffer )
-            iDataBuffer = CBufFlat::NewL( KDataBufExpandSize );
-        else
-            iDataBuffer->Reset();
-        iDataBufferSize=0;
-        }
-    else
-        {
-        delete iDataBuffer;
-        iDataBuffer = 0;
-        }
-    
-    TBackupIncType incType = ENoBackup;
-    
-    switch( iCurrentTask->iBURModeParams->iIncType )    
-        {
-        case ESConNoBackup :
-            incType = ENoBackup;
-            break;
-        case ESConBackupBase :
-            incType = EBackupBase;
-            break;
-        case ESConBackupIncrement :
-            incType = EBackupIncrement;
-            break;
-        default :
-            incType = ENoBackup;
-            break;
-        }
-    
-    iSBEClient->SetBURModeL( driveList, partialType, incType );
-    
-    if( partialType != EBURNormal )
-        {
-        iBURModeNormal = EFalse;
-        }
-    else
-        {
-        iBURModeNormal = ETrue;
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::ProcessListPublicFilesL()
-// Executes ListPublicFiles task
-// -----------------------------------------------------------------------------
-//
-void CSConSBEClient::ProcessListPublicFilesL()
-    {
-    TRACE_FUNC_ENTRY;
-    //Get the secure id
-    TSecureId sid = iCurrentTask->iPubFilesParams->iDataOwners[0]->iUid;
-    TSecureId packageSid;
-    LOGGER_WRITE_1("DO: 0x%08x", sid.iId);
-    TPtrC packageName(KNullDesC);
-    const TUint KSConUidLength = 8; // 8 digits (hex)
-    const TUint KSConUidPrefixLength = 3; // prefix is '#0x'
-    
-    TInt packageNameLength = iCurrentTask->iPubFilesParams->iDataOwners[0]->iPackageName.Length();
-    
-    if ( packageNameLength > KSConUidLength )
-        {
-        // remove uid from package name
-        packageName.Set( 
-                iCurrentTask->iPubFilesParams->iDataOwners[0]->
-                iPackageName.Left( packageNameLength - (KSConUidLength + KSConUidPrefixLength) ) );
-        LOGGER_WRITE_1("PackageName: %S", &packageName );
-        
-        TPtrC sidPtr( iCurrentTask->iPubFilesParams->iDataOwners[0]->
-                iPackageName.Right( KSConUidLength ) );
-        TLex lex(sidPtr);
-        TInt err = lex.Val( packageSid.iId, EHex );
-        if ( err )
-            {
-            LOGGER_WRITE_1("lex.Val error: %d", err);
-            packageName.Set( KNullDesC );
-            packageSid.iId = 0;
-            }
-        LOGGER_WRITE_1("packageSid: 0x%08x", packageSid.iId );
-        }
-    
-    //Get the drive list
-    TDriveList driveList = 
-    iCurrentTask->iPubFilesParams->iDataOwners[0]->iDriveList;
-    
-    RFileArray files;
-    CleanupClosePushL( files );
-    //Go through all the drives in the list
-    for( TInt i = 0; i < KMaxDrives; i++ )
-        {
-        if( driveList[i] )
-            {
-            //Get files from the drive
-            TDriveNumber driveNumber = GetDriveNumber( i );
-            LOGGER_WRITE_1("driveNumber: %d", driveNumber);
-            
-            LOGGER_WRITE("List public files using CSBSecureId");
-            CSBSecureId* secureId = CSBSecureId::NewL( sid );
-            CleanupStack::PushL( secureId );
-            
-            TRAPD( err, iSBEClient->PublicFileListL( driveNumber, *secureId, files ) );
-            
-            if( err != KErrNone && err != KErrNotFound )
-                {
-                LOGGER_WRITE_1("iSBEClient->PublicFileListL leaved: %d", err);
-                User::LeaveIfError( err );
-                }
-            
-            CleanupStack::PopAndDestroy( secureId );
-            LOGGER_WRITE_1("public files: %d", files.Count());
-            AppendFilesToFilelistL( files, iCurrentTask->iPubFilesParams->iFiles) ;
-            
-            if ( packageName.Length() > 0 )
-                {
-                LOGGER_WRITE("Append files registered to packages. Using CSBPackageId");
-                
-                CSBPackageId* packageId = CSBPackageId::NewL(
-                        iCurrentTask->iPubFilesParams->iDataOwners[0]->iUid,
-                        packageSid,
-                        packageName );
-                CleanupStack::PushL( packageId );
-                
-                TRAPD( err, iSBEClient->PublicFileListL( driveNumber, *packageId, files ) );
-                if( err != KErrNone && err != KErrNotFound )
-                    {
-                    LOGGER_WRITE_1("iSBEClient->PublicFileListL leaved: %d", err);
-                    User::LeaveIfError( err );
-                    }
-                CleanupStack::PopAndDestroy( packageId );
-                
-                LOGGER_WRITE_1("public files: %d", files.Count());
-                AppendFilesToFilelistL( files, iCurrentTask->iPubFilesParams->iFiles) ;
-                }
-            
-            files.Reset();
-            }
-        }
-    CleanupStack::PopAndDestroy( &files );
-    TRACE_FUNC_EXIT;
-    }
-
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::ProcessListDataOwnersL()
-// Executes ListDataOwners task
-// -----------------------------------------------------------------------------
-//
-void CSConSBEClient::ProcessListDataOwnersL()
-    {
-    TRACE_FUNC_ENTRY;
-    TBool includeToList( ETrue );
-    RPointerArray<CDataOwnerInfo> dataOwners;
-    RArray<TUid> packageArray;
-    CleanupResetAndDestroyPushL( dataOwners );
-    CleanupClosePushL( packageArray );
-    
-    iSBEClient->ListOfDataOwnersL( dataOwners );
-    LOGGER_WRITE_1( "dataOwners count: %d", dataOwners.Count() );
-    
-    
-    for( TInt i = 0; i < dataOwners.Count(); i++ )
-        {
-        LOGGER_WRITE_2("handling do: %d, count: %d", i, dataOwners.Count());
-        CSConDataOwner* dataOwner = new (ELeave) CSConDataOwner();
-        CleanupStack::PushL( dataOwner );
-        // default values
-        TSecureId sid( 0 );
-        includeToList = ETrue;
-        
-        TCommonBURSettings commonOptions = dataOwners[i]->CommonSettings();
-        TPassiveBURSettings passiveOptions = dataOwners[i]->PassiveSettings();
-        TActiveBURSettings activeOptions = dataOwners[i]->ActiveSettings();
-        
-        //active, passive or hybrid? (common)
-        if( commonOptions & EActiveBUR && commonOptions & EPassiveBUR )
-            {
-            dataOwner->iType = EHybridDataOwner;
-            }       
-        else if( commonOptions & EActiveBUR )
-            {
-            dataOwner->iType = EActiveDataOwner;
-            }
-        else if( commonOptions & EPassiveBUR )
-            {
-            dataOwner->iType = EPassiveDataOwner;
-            }
-                
-        //requires reboot? (common)
-        if( commonOptions & ERequiresReboot )
-            {
-            dataOwner->iReqReboot = ETrue;
-            }
-        else
-            {
-            dataOwner->iReqReboot = EFalse;
-            }
-            
-        //has system files? (common)
-        if( commonOptions & EHasSystemFiles )
-            {
-            dataOwner->iHasFiles = ESystemFiles;
-            }
-            
-        //supports selective? (common)
-        if( commonOptions & ESupportsSelective )
-            {
-            dataOwner->iSupportsSel = ETrue;
-            }
-        else
-            {
-            dataOwner->iSupportsSel = EFalse;
-            }
-            
-        //has public files? (passive)
-        if( passiveOptions & EHasPublicFiles )
-            {
-            if( dataOwner->iHasFiles == ESystemFiles )
-                {
-                dataOwner->iHasFiles = EPublicSystemFiles;
-                }
-            else
-                {
-                dataOwner->iHasFiles = EPublicFiles;    
-                }
-            }
-            
-        //supports incremental? (active and passive)
-        if( activeOptions & EActiveSupportsInc || 
-                passiveOptions & EPassiveSupportsInc  )
-            {
-            dataOwner->iSupportsInc = ETrue;
-            }
-        else
-            {
-            dataOwner->iSupportsInc = EFalse;
-            }
-            
-        //delay to prepare data? (active)
-        if( activeOptions & EDelayToPrepareData )
-            {
-            dataOwner->iDelayToPrep = ETrue;
-            }
-        else
-            {
-            dataOwner->iDelayToPrep = EFalse;
-            }
-            
-        //fill drivelist
-        dataOwner->iDriveList = dataOwners[i]->DriveList();
-        //filter the drive list
-        FilterDriveList( dataOwner->iDriveList );
-                        
-        CSBGenericDataType* genericData = &( dataOwners[i]->Identifier() );
-        TSBDerivedType derived = genericData->DerivedTypeL();
-        
-        if( derived == ESIDDerivedType )
-            {
-            //Uif of the data owner
-            CSBSecureId* secureId = CSBSecureId::NewL( genericData );
-            CleanupStack::PushL( secureId );
-            sid = secureId->SecureIdL();
-        
-            dataOwner->iUid.iUid = (TInt32)sid.iId;
-            LOGGER_WRITE_1("ESIDDerivedType, sid: 0x%08x", dataOwner->iUid.iUid );
-        
-            CleanupStack::PopAndDestroy( secureId );
-            }
-        else if( derived == EPackageDerivedType )
-            {
-            //Package name and uid of the data owner
-            CSBPackageId* packageId = CSBPackageId::NewL( genericData );
-            CleanupStack::PushL( packageId );
-        
-            dataOwner->iPackageName = packageId->PackageNameL();
-            dataOwner->iUid.iUid = packageId->PackageIdL().iUid;
-            LOGGER_WRITE_1("EPackageDerivedType, uid: 0x%08x", dataOwner->iUid.iUid );
-            sid = packageId->SecureIdL();
-            LOGGER_WRITE_1("sid: 0x%08x", sid.iId );
-            
-            // owerload the package name, also add sid information.
-            _LIT(KSidFormat, "#0x%08x");
-            const TInt KSidFormatLength = 11;
-            TBuf<KSidFormatLength> sidFormat;
-            sidFormat.Format( KSidFormat, sid.iId );
-            if ( dataOwner->iPackageName.Length() + sidFormat.Length()
-                <= dataOwner->iPackageName.MaxLength() )
-                {
-                dataOwner->iPackageName.Append( sidFormat );
-                }
-            else
-                {
-                LOGGER_WRITE("WARNING: Package name too long, sid not included.");
-                }
-            
-            LOGGER_WRITE_1("Package name: %S", &dataOwner->iPackageName );
-            if( sid )
-                {
-                //Find if the package is already included to dataowner list
-                if( packageArray.Find( packageId->PackageIdL(), 
-                                        CSConSBEClient::Match ) != KErrNotFound )
-                    {
-                    LOGGER_WRITE("dataowner was already included to list");
-                    //Don't include dataowner to list again
-                    includeToList = EFalse;
-                    }
-                else
-                    {
-                    //Store package's id for filtering
-                    LOGGER_WRITE_1( "Storing package id for filtering, uid: 0x%08x", dataOwner->iUid.iUid );
-                    packageArray.Append( dataOwner->iUid ); 
-                    }
-                }
-            
-            CleanupStack::PopAndDestroy( packageId );
-            }
-        else if( derived == EJavaDerivedType )
-            {
-            //Hash
-            CSBJavaId* javaId = CSBJavaId::NewL( genericData );
-            CleanupStack::PushL( javaId );
-            
-            //Initialize with hash data length and copy hash
-            dataOwner->iJavaHash = HBufC::NewL( javaId->SuiteHashL().Length() );
-            dataOwner->iJavaHash->Des().Copy( javaId->SuiteHashL() );
-            
-            //For ConML: set as passive package
-            dataOwner->iType = EPassiveDataOwner;
-            dataOwner->iPackageName.Copy( javaId->SuiteNameL() );
-            
-#ifdef _DEBUG
-            LOGGER_WRITE("EJavaDerivedType" );
-            LOGGER_WRITE_1("Package name: %S", &dataOwner->iPackageName );
-            TPtrC hash( dataOwner->iJavaHash->Des() );
-            LOGGER_WRITE_1("JavaHash: %S", &hash );
-#endif
-            
-            CleanupStack::PopAndDestroy( javaId );
-            }
-        else
-            {
-            LOGGER_WRITE("Unknown type, ignored from list" );
-            //Unknown type => ignore from list
-            includeToList = EFalse;
-            }
-        
-        if( includeToList ) 
-            {
-            LOGGER_WRITE_1( "Appending to list, uid: 0x%08x", dataOwner->iUid.iUid );
-            iCurrentTask->iListDataOwnersParams->iDataOwners.AppendL( dataOwner );
-            CleanupStack::Pop( dataOwner );
-            }
-        
-        if( sid )
-            {
-            LOGGER_WRITE_1( "Appending package sid to list, sid: 0x%08x", sid.iId );
-            CSConDataOwner* packageDataOwner = dataOwner->CopyL();
-            CleanupStack::PushL( packageDataOwner );
-            //Clear package name
-            packageDataOwner->iPackageName = KNullDesC();
-            //Add sid
-            packageDataOwner->iUid.iUid = sid.iId;
-            iCurrentTask->iListDataOwnersParams->iDataOwners.AppendL( packageDataOwner );
-            CleanupStack::Pop( packageDataOwner );
-            }
-        
-        if( !includeToList )
-            {
-            //Not included to list => delete memory allocation
-            CleanupStack::PopAndDestroy( dataOwner );
-            }
-        }
-        
-    packageArray.Reset();
-    CleanupStack::PopAndDestroy( &packageArray );
-    CleanupStack::PopAndDestroy( &dataOwners );
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::ProcessGetDataSizeL()
-// Executes GetDataSize task
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::ProcessGetDataSizeL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    if ( !iAllSnapshotsSuppliedCalled )
-        {
-        TInt err(KErrNone);
-        // we have to call AllSnapshotsSupplied() to inform active
-        // data owners to start prepare their base data.
-        TRAP( err, iSBEClient->AllSnapshotsSuppliedL() );
-        LOGGER_WRITE_1( "AllSnapshotsSuppliedL() leaved: %d", err );
-        iAllSnapshotsSuppliedCalled = ETrue;
-        }
-    
-    
-    TBool packageData( EFalse );
-    
-    //Calculate data size for every data owner received from the task
-    for( TInt i = 0; i < iCurrentTask->iGetDataSizeParams->iDataOwners.Count();
-        i++ )
-        {
-        packageData = EFalse;
-        CSConDataOwner* dataOwner = 
-            iCurrentTask->iGetDataSizeParams->iDataOwners[i];
-            
-        TTransferDataType tdt( ERegistrationData );
-        TPackageDataType pdt( ESystemData );
-        
-        LOGGER_WRITE_2( "ProcessGetDataSizeL DO %d of %d", i, iCurrentTask->iGetDataSizeParams->iDataOwners.Count() );
-        LOGGER_WRITE_1( "ProcessGetDataSizeL SID 0x%08x", dataOwner->iUid );
-        switch( dataOwner->iTransDataType )
-            {
-            case ESConRegistrationData :
-                LOGGER_WRITE( "CSConSBEClient::ProcessGetDataSize() : ERegistrationData" );
-                tdt = ERegistrationData;
-                break;
-            case ESConPassiveSnapshotData :
-                LOGGER_WRITE( "CSConSBEClient::ProcessGetDataSize() : EPassiveSnapshotData" );
-                tdt = EPassiveSnapshotData;
-                break;
-            case ESConPassiveBaseData :
-                LOGGER_WRITE( "CSConSBEClient::ProcessGetDataSize() : EPassiveBaseData" );
-                tdt = EPassiveBaseData;
-                break;
-            case ESConPassiveIncrementalData :
-                LOGGER_WRITE( "CSConSBEClient::ProcessGetDataSize() : EPassiveIncrementalData" );
-                tdt = EPassiveIncrementalData;
-                break;
-            case ESConActiveSnapshotData :
-                LOGGER_WRITE( "CSConSBEClient::ProcessGetDataSize() : EActiveSnapshotData" );
-                tdt = EActiveSnapshotData;
-                break;
-            case ESConActiveBaseData :
-                LOGGER_WRITE( "CSConSBEClient::ProcessGetDataSize() : EActiveBaseData" );
-                tdt = EActiveBaseData;
-                break;
-            case ESConActiveIncrementalData :
-                LOGGER_WRITE( "CSConSBEClient::ProcessGetDataSize() : EActiveIncrementalData" );
-                tdt = EActiveIncrementalData;
-                break;
-            case ESConSystemData :
-                LOGGER_WRITE( "CSConSBEClient::ProcessGetDataSize() : ESystemData" );
-                pdt = ESystemData;
-                packageData = ETrue;
-                break;
-            case ESConSystemSnapshotData :
-                LOGGER_WRITE( "CSConSBEClient::ProcessGetDataSize() : ESystemSnapshotData" );
-                pdt = ESystemSnapshotData;
-                packageData = ETrue;
-                break;
-            default :
-                break;
-            }
-        
-        if( packageData && !dataOwner->iJavaHash )
-            {
-            dataOwner->iSize = PackageDataSizeL( dataOwner->iUid, dataOwner->iDriveList, pdt );
-            }
-        else if( !dataOwner->iJavaHash )
-            {
-            dataOwner->iSize = SidDataSizeL( dataOwner->iUid, dataOwner->iDriveList, tdt );
-            }
-        else
-            {
-            dataOwner->iSize = JavaDataSizeL( dataOwner->iJavaHash->Des(),
-                    dataOwner->iDriveList );
-            }
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::ProcessRequestDataL()
-// Executes RequestData task
-// -----------------------------------------------------------------------------
-//      
-TInt CSConSBEClient::ProcessRequestDataL()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt ret( KErrNone );
-        
-    TBool packageData = EFalse;
-    TTransferDataType transferDataType( ERegistrationData );
-    TPackageDataType packageDataType( ESystemSnapshotData );    
-    LOGGER_WRITE_1("CSConSBEClient::ProcessRequestDataL() iTransDataType: %d",
-        (TInt)iCurrentTask->iRequestDataParams->iDataOwner->iTransDataType);
-    
-    switch( iCurrentTask->iRequestDataParams->iDataOwner->iTransDataType )
-        {
-        case ESConRegistrationData :
-            transferDataType = ERegistrationData;
-            break;
-        case ESConPassiveSnapshotData :
-            transferDataType = EPassiveSnapshotData;
-            break;
-        case ESConPassiveBaseData :
-            transferDataType = EPassiveBaseData;
-            break;
-        case ESConPassiveIncrementalData :
-            transferDataType = EPassiveIncrementalData;
-            break;
-        case ESConActiveSnapshotData :
-            transferDataType = EActiveSnapshotData;
-            break;
-        case ESConActiveBaseData :
-            transferDataType = EActiveBaseData;
-            break;
-        case ESConActiveIncrementalData :
-            transferDataType = EActiveIncrementalData;
-            break;
-        case ESConSystemData :
-            packageDataType = ESystemData;
-            packageData = ETrue;
-            break;
-        case ESConSystemSnapshotData:
-            packageDataType = ESystemSnapshotData;
-            packageData = ETrue;
-            break;
-        default :
-            break;
-        }
-        
-    
-    //Get the drive number  
-    TDriveNumber driveNumber = EDriveC;
-    TDriveList driveList = iCurrentTask->iRequestDataParams->
-        iDataOwner->iDriveList;
-    
-    for( TInt i = 0; i < KMaxDrives; i++ )
-        {
-        if( driveList[i] )
-            {
-            driveNumber = GetDriveNumber( i );
-            break;
-            }
-        }
-        
-    //Get UID, SID or Java hash
-    TUid uid;
-    TSecureId sid;
-            
-    uid.iUid = 0;
-    sid.iId = 0;
-    
-    if( packageData && !iCurrentTask->iRequestDataParams->iDataOwner->iJavaHash )
-        {
-        uid = iCurrentTask->iRequestDataParams->iDataOwner->iUid;
-        LOGGER_WRITE_1("CSConSBEClient::ProcessRequestDataL() uid: 0x%08x", uid.iUid);
-        }
-    else if( !iCurrentTask->iRequestDataParams->iDataOwner->iJavaHash )
-        {
-        sid = iCurrentTask->iRequestDataParams->iDataOwner->iUid;
-        LOGGER_WRITE_1("CSConSBEClient::ProcessRequestDataL() sid: 0x%08x", sid.iId);
-        }
-    
-
-    LOGGER_WRITE_1( "CSConSBEClient::ProcessRequestDataL() : \
-    Begin - Package data: %d", packageData );
-
-    LOGGER_WRITE_1("iLastChunk: %d", (TInt) iLastChunk );
-    LOGGER_WRITE_1("iDataBufferSize: %d", iDataBufferSize );
-        
-    // if was't last chunk and there are free space left on our packet
-    if( !iLastChunk && iDataBufferSize < KMaxObjectSize ) 
-        {
-        //No data left, request more from the server
-        if( packageData && !iCurrentTask->iRequestDataParams->iDataOwner->iJavaHash )
-            {
-            CSBPackageTransferType* ptt = CSBPackageTransferType::NewL(
-                    uid, driveNumber, packageDataType );
-            CleanupStack::PushL( ptt );
-            
-            RequestDataL( *ptt );
-            
-            CleanupStack::PopAndDestroy( ptt );
-            }
-        else if( !iCurrentTask->iRequestDataParams->iDataOwner->iJavaHash )
-            {
-            CSBSIDTransferType* stt = CSBSIDTransferType::NewL(
-                    sid, driveNumber, transferDataType );
-            CleanupStack::PushL( stt );
-            
-            RequestDataL( *stt );
-            
-            CleanupStack::PopAndDestroy( stt );
-            }
-        else
-            {
-            TPtr javaHashPtr = iCurrentTask->iRequestDataParams->iDataOwner->iJavaHash->Des();
-            CSBJavaTransferType* jtt( NULL );
-            //When ESystemData is requested, request EJavaMIDlet
-            if( packageDataType == ESystemData )
-                {
-                jtt = CSBJavaTransferType::NewL( javaHashPtr, driveNumber, EJavaMIDlet );
-                }
-            //When EPassiveBaseData is requested, request EJavaMIDletData
-            else if( transferDataType == EPassiveBaseData )
-                {
-                jtt = CSBJavaTransferType::NewL( javaHashPtr, driveNumber, EJavaMIDletData );
-                }
-                        
-            if( packageDataType == ESystemData || transferDataType == EPassiveBaseData )
-                {
-                CleanupStack::PushL( jtt );
-                
-                RequestDataL( *jtt );
-                
-                CleanupStack::PopAndDestroy( jtt );   
-                }
-            else
-                {
-                //No data
-                iDataBuffer->Reset();
-                iDataBufferSize = 0;
-                iLastChunk = ETrue;
-                }
-            }
-        }
-    
-    LOGGER_WRITE_1("readed iLastChunk: %d", (TInt) iLastChunk );
-    LOGGER_WRITE_1("readed iDataBufferSize: %d", iDataBufferSize );
-        
-    
-    
-    if( iCurrentTask->iRequestDataParams->iBackupData )
-        {
-        delete iCurrentTask->iRequestDataParams->iBackupData;
-        iCurrentTask->iRequestDataParams->iBackupData = NULL;
-        }
-    
-    TInt dataToRead = KMaxObjectSize;
-    if ( dataToRead > iDataBufferSize )
-        dataToRead = iDataBufferSize;
-    
-    //Initialize the task data buffer
-    iCurrentTask->iRequestDataParams->iBackupData = HBufC8::NewL( dataToRead );
-    //Get descriptor task's buffer
-    TPtr8 backupDataPtr = iCurrentTask->iRequestDataParams->iBackupData->Des();
-    
-    
-    iDataBuffer->Read(0, backupDataPtr, dataToRead );
-    iDataBuffer->Delete(0, dataToRead);
-    iDataBufferSize -= dataToRead;
-    
-    if ( !iLastChunk || iDataBufferSize>0 )
-        {
-        LOGGER_WRITE( "CSConSBEClient::ProcessRequestDataL() : There are more data available" );
-        iCurrentTask->iRequestDataParams->iMoreData = ETrue;
-        //Another task is needed to transfer the data to the client
-        ret = KErrCompletion;
-        }
-    else
-        {
-        LOGGER_WRITE( "CSConSBEClient::ProcessRequestDataL() : All data readed" );
-        iDataBuffer->Reset();
-        iDataBufferSize = 0;
-        // task will be completed, initialize iLastChunk value for next operation
-        iLastChunk = EFalse;
-        }
-    
-        
-    LOGGER_WRITE_1( "CSConSBEClient::ProcessRequestDataL() :  returned %d", ret );
-    return ret;
-    }
-
-void CSConSBEClient::RequestDataL( CSBGenericTransferType& aGenericTransferType )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !iDataBuffer )
-        User::Leave( KErrArgument );
-    
-    do
-        {
-        LOGGER_WRITE( "iSBEClient->RequestDataL() : start" );
-        TRequestStatus status;
-        iSBEClient->RequestDataL( aGenericTransferType, status );
-        User::WaitForRequest( status );
-        LOGGER_WRITE_1( "iSBEClient->RequestDataL() : status.Int() %d", status.Int() );
-        User::LeaveIfError( status.Int() );
-                    
-        //Get the data and store the handle
-        CSBGenericTransferType* gtt = NULL;
-        const TPtrC8& dataPtr = iSBEClient->TransferDataInfoL( gtt, iLastChunk );
-        LOGGER_WRITE_1("data size: %d", dataPtr.Length());
-        delete gtt;
-        iDataBuffer->ExpandL( iDataBufferSize, dataPtr.Length() );
-        iDataBuffer->Write(iDataBufferSize, dataPtr);
-        iDataBufferSize += dataPtr.Length();
-        LOGGER_WRITE_1("total buffer size: %d", iDataBufferSize);
-        }
-    // Continue if there are more data, and our packet is not full
-    while ( !iLastChunk && iDataBufferSize < KMaxObjectSize );
-    
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::ProcessGetDataOwnerStatusL()
-// Executes GetDataOwnerStatus task
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::ProcessGetDataOwnerStatusL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    //If restore-mode, call AllSystemFilesRestored()
-    if( iRestoreMode )
-        {
-        LOGGER_WRITE( "CSConSBEClient::ProcessGetDataOwnerStatusL() : iSBEClient->AllSystemFilesRestored() start" );
-        iSBEClient->AllSystemFilesRestored();
-        LOGGER_WRITE( "CSConSBEClient::ProcessGetDataOwnerStatusL() : iSBEClient->AllSystemFilesRestored() end" );
-        }
-    
-    RSIDStatusArray sidStatus;
-    CleanupClosePushL(sidStatus);
-        
-    for( TInt i = 0; i < iCurrentTask->iGetDataOwnerParams->iDataOwners.Count();
-     i++ )
-        {
-        CSConDataOwner* dataOwner = 
-            iCurrentTask->iGetDataOwnerParams->iDataOwners[i];
-        TSecureId sid( dataOwner->iUid );
-        TDataOwnerStatus dataOwnerStatus = EUnset;
-        TInt dataOwnerError = 0;
-        
-        TDataOwnerAndStatus dataOwnerAndStatus( sid, dataOwnerStatus, 
-            dataOwnerError );
-                
-        sidStatus.Append( dataOwnerAndStatus );
-        }
-    
-    iSBEClient->SIDStatusL( sidStatus );
-    
-    for( TInt j = 0; j < sidStatus.Count(); j++ )
-        {
-        switch( sidStatus[j].iStatus )
-            {
-            case EUnset :
-                iCurrentTask->iGetDataOwnerParams->iDataOwners[j]->
-                iDataOwnStatus = ESConUnset;
-                break;
-            case EDataOwnerNotFound :
-                iCurrentTask->iGetDataOwnerParams->iDataOwners[j]->
-                iDataOwnStatus = ESConNotFound;
-                break;
-            case EDataOwnerReady :
-                iCurrentTask->iGetDataOwnerParams->iDataOwners[j]->
-                iDataOwnStatus = ESConReady;
-                break;
-            case EDataOwnerNotReady :
-                iCurrentTask->iGetDataOwnerParams->iDataOwners[j]->
-                iDataOwnStatus = ESConNotReady;
-                break;
-            case EDataOwnerFailed :
-                iCurrentTask->iGetDataOwnerParams->iDataOwners[j]->
-                iDataOwnStatus = ESConFailed;
-                break;
-            case EDataOwnerNotConnected :
-                iCurrentTask->iGetDataOwnerParams->iDataOwners[j]->
-                iDataOwnStatus = ESConNotConnected;
-                break;
-            case EDataOwnerReadyNoImpl :
-                iCurrentTask->iGetDataOwnerParams->iDataOwners[j]->
-                iDataOwnStatus = ESConNotImplemented;
-                break;
-            default :
-                break;
-            }
-        }
-    sidStatus.Reset();  
-    CleanupStack::PopAndDestroy( &sidStatus );
-
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::ProcessSupplyDataL()
-// Executes SupplyData task
-// -----------------------------------------------------------------------------
-//  
-TInt CSConSBEClient::ProcessSupplyDataL()
-    {
-    TRACE_FUNC_ENTRY;
-    TBool packageData = EFalse;
-    TBool lastChunk = ETrue;
-    TTransferDataType transferDataType( ERegistrationData );
-    TPackageDataType packageDataType( ESystemSnapshotData );    
-    LOGGER_WRITE_1("CSConSBEClient::ProcessSupplyDataL() iTransDataType: %d",
-        (TInt)iCurrentTask->iSupplyDataParams->iDataOwner->iTransDataType);
-    switch( iCurrentTask->iSupplyDataParams->iDataOwner->iTransDataType )
-        {
-        case ESConRegistrationData :
-            transferDataType = ERegistrationData;
-            break;
-        case ESConPassiveSnapshotData :
-            transferDataType = EPassiveSnapshotData;
-            break;
-        case ESConPassiveBaseData :
-            transferDataType = EPassiveBaseData;
-            break;
-        case ESConPassiveIncrementalData :
-            transferDataType = EPassiveIncrementalData;
-            break;
-        case ESConActiveSnapshotData :
-            transferDataType = EActiveSnapshotData;
-            break;
-        case ESConActiveBaseData :
-            transferDataType = EActiveBaseData;
-            break;
-        case ESConActiveIncrementalData :
-            transferDataType = EActiveIncrementalData;
-            break;
-        case ESConSystemData :
-            packageDataType = ESystemData;
-            packageData = ETrue;
-            break;
-        case ESConSystemSnapshotData:
-            packageDataType = ESystemSnapshotData;
-            packageData = ETrue;
-            break;
-        default :
-            break;
-        }
-        
-    //Get the drive number  
-    TDriveNumber driveNumber = EDriveC;
-    TDriveList driveList = iCurrentTask->iSupplyDataParams->iDataOwner->
-        iDriveList;
-    
-    for( TInt i = 0; i < KMaxDrives; i++ )
-        {
-        if( driveList[i] )
-            {
-            driveNumber = GetDriveNumber( i );
-            break;
-            }
-        }
-        
-    //Get UID or SID
-    TUid uid;
-    TSecureId sid;  
-    
-    uid.iUid = 0;
-    sid.iId = 0;
-    
-    if( packageData && !iCurrentTask->iSupplyDataParams->iDataOwner->iJavaHash )
-        {
-        uid = iCurrentTask->iSupplyDataParams->iDataOwner->iUid;
-        LOGGER_WRITE_1( "CSConSBEClient::ProcessSupplyDataL() uid: 0x%08x", uid.iUid );
-        }
-    else if( !iCurrentTask->iSupplyDataParams->iDataOwner->iJavaHash )
-        {
-        sid = iCurrentTask->iSupplyDataParams->iDataOwner->iUid;
-        LOGGER_WRITE_1( "CSConSBEClient::ProcessSupplyDataL() sid: 0x%08x", sid.iId );
-        }
-    
-    
-    if( packageData && !iCurrentTask->iSupplyDataParams->iDataOwner->iJavaHash )
-        {
-        CSBPackageTransferType* ptt = CSBPackageTransferType::NewL( uid, driveNumber, 
-            packageDataType );
-        CleanupStack::PushL( ptt );
-        
-        //Write restore data to chunk
-        LOGGER_WRITE( "iSBEClient->TransferDataAddressL().Copy() : start" );
-        LOGGER_WRITE_1( "CSConSBEClient::ProcessSupplyDataL() :\
-         Received data length: %d", iCurrentTask->iSupplyDataParams->iRestoreData->Length() );
-        iSBEClient->TransferDataAddressL().Copy( iCurrentTask->
-        iSupplyDataParams->iRestoreData->Des() );
-        LOGGER_WRITE( "iSBEClient->TransferDataAddressL().Copy()" );
-        
-        delete iCurrentTask->iSupplyDataParams->iRestoreData;
-        iCurrentTask->iSupplyDataParams->iRestoreData = NULL;
-        
-        //Supply data
-        lastChunk = !( iCurrentTask->iSupplyDataParams->iMoreData );
-        LOGGER_WRITE( "iSBEClient->SupplyDataL( ptt, lastChunk ) : start" );
-        TRequestStatus status;
-        iSBEClient->SupplyDataL( *ptt, lastChunk, status );
-        User::WaitForRequest( status );
-        LOGGER_WRITE( "iSBEClient->SupplyDataL( ptt, lastChunk ) : stop" );
-        
-        User::LeaveIfError( status.Int() );
-        
-        CleanupStack::PopAndDestroy( ptt );
-        }
-    else if( !iCurrentTask->iSupplyDataParams->iDataOwner->iJavaHash )
-        {
-        CSBSIDTransferType* stt = CSBSIDTransferType::NewL( sid, driveNumber, transferDataType );
-        CleanupStack::PushL( stt );
-        
-        //Write restore data to chunk
-        LOGGER_WRITE( "iSBEClient->TransferDataAddressL().Copy() : start" );
-        LOGGER_WRITE_1( "CSConSBEClient::ProcessSupplyDataL() : Received data length: %d",
-         iCurrentTask->iSupplyDataParams->iRestoreData->Length() );
-        iSBEClient->TransferDataAddressL().Copy( iCurrentTask->
-        iSupplyDataParams->iRestoreData->Des() );
-        LOGGER_WRITE( "iSBEClient->TransferDataAddressL().Copy()" );
-        
-        delete iCurrentTask->iSupplyDataParams->iRestoreData;
-        iCurrentTask->iSupplyDataParams->iRestoreData = NULL;
-        
-        //Supply data
-        lastChunk = !( iCurrentTask->iSupplyDataParams->iMoreData );
-        LOGGER_WRITE( "iSBEClient->SupplyDataL( stt, lastChunk ) : start" );
-        TRequestStatus status;
-        iSBEClient->SupplyDataL( *stt, lastChunk, status );
-        User::WaitForRequest( status );
-        LOGGER_WRITE( "iSBEClient->SupplyDataL( stt, lastChunk ) : stop" );
-        
-        User::LeaveIfError( status.Int() );
-        
-        CleanupStack::PopAndDestroy( stt );
-        }
-    else
-        {
-        TPtr javaHashPtr = iCurrentTask->iSupplyDataParams->iDataOwner->iJavaHash->Des();
-        CSBJavaTransferType* jtt( NULL );
-        if( packageDataType == ESystemData )
-            {
-            LOGGER_WRITE( "iSBEClient->SupplyDataL java ESystemData" );
-            jtt = CSBJavaTransferType::NewL( javaHashPtr, driveNumber, EJavaMIDlet );
-            }
-        else if( transferDataType == EPassiveBaseData )
-            {
-            LOGGER_WRITE( "iSBEClient->SupplyDataL java EPassiveBaseData" );
-            jtt = CSBJavaTransferType::NewL( javaHashPtr, driveNumber, EJavaMIDletData );
-            }
-                
-        if( packageDataType == ESystemData || transferDataType == EPassiveBaseData )
-            {
-            CleanupStack::PushL( jtt );
-            //Write restore data to chunk
-            LOGGER_WRITE( "iSBEClient->TransferDataAddressL().Copy() : start" );
-            LOGGER_WRITE_1( "CSConSBEClient::ProcessSupplyDataL() : Received data length: %d",
-             iCurrentTask->iSupplyDataParams->iRestoreData->Length() );
-            iSBEClient->TransferDataAddressL().Copy( iCurrentTask->
-            iSupplyDataParams->iRestoreData->Des() );
-            LOGGER_WRITE( "iSBEClient->TransferDataAddressL().Copy()" );
-            
-            delete iCurrentTask->iSupplyDataParams->iRestoreData;
-            iCurrentTask->iSupplyDataParams->iRestoreData = NULL;
-            
-            //Supply data
-            lastChunk = !( iCurrentTask->iSupplyDataParams->iMoreData );
-            LOGGER_WRITE( "iSBEClient->SupplyDataL( jtt, lastChunk ) : start" );
-            TRequestStatus status;
-            iSBEClient->SupplyDataL( *jtt, lastChunk, status );
-            User::WaitForRequest( status );
-            LOGGER_WRITE( "iSBEClient->SupplyDataL( jtt, lastChunk ) : stop" );
-            
-            User::LeaveIfError( status.Int() );
-            
-            CleanupStack::PopAndDestroy( jtt );
-            }
-        }
-    
-    TInt ret( KErrNone );
-        
-    if( !lastChunk )
-        {
-        ret = KErrCompletion;
-        }
-    
-    LOGGER_WRITE_1( "CSConSBEClient::ProcessSupplyDataL() : returned %d", ret );
-    return ret;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::GetDriveNumber( TInt aDrive ) const
-// Maps TInt drive number to TDriveNumber
-// -----------------------------------------------------------------------------
-//  
-TDriveNumber CSConSBEClient::GetDriveNumber( TInt aDrive ) const
-    {
-    TDriveNumber driveNumber;
-    switch( aDrive )
-        {
-        case 0 :
-            driveNumber = EDriveA;
-            break;
-        case 1 :
-            driveNumber = EDriveB;
-            break;
-        case 2 : 
-            driveNumber = EDriveC;
-            break;
-        case 3 :
-            driveNumber = EDriveD;
-            break;
-        case 4 : 
-            driveNumber = EDriveE;
-            break;
-        case 5 :
-            driveNumber = EDriveF;
-            break;
-        case 6 :
-            driveNumber = EDriveG;
-            break;
-        case 7 :
-            driveNumber = EDriveH;
-            break;
-        case 8 :
-            driveNumber = EDriveI;
-            break;
-        case 9 :
-            driveNumber = EDriveJ;
-            break;
-        case 10 :
-            driveNumber = EDriveK;
-            break;
-        case 11 :
-            driveNumber = EDriveL;
-            break;
-        case 12 :
-            driveNumber = EDriveM;
-            break;
-        case 13 :
-            driveNumber = EDriveN;
-            break;
-        case 14 :
-            driveNumber = EDriveO;
-            break;
-        case 15 :
-            driveNumber = EDriveP;
-            break;
-        case 16 :
-            driveNumber = EDriveQ;
-            break;
-        case 17 :
-            driveNumber = EDriveR;
-            break;
-        case 18 :
-            driveNumber = EDriveS;
-            break;
-        case 19 :
-            driveNumber = EDriveT;
-            break;
-        case 20 :
-            driveNumber = EDriveU;
-            break;
-        case 21 :
-            driveNumber = EDriveV;
-            break;
-        case 22 :
-            driveNumber = EDriveW;
-            break;
-        case 23 :
-            driveNumber = EDriveX;
-            break;
-        case 24 :
-            driveNumber = EDriveY;
-            break;
-        case 25 :
-            driveNumber = EDriveZ;
-            break;
-        default :
-            driveNumber = EDriveC;
-            break;
-        }
-        
-    return driveNumber;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::FilterDriveList( TDriveList& aDriveList ) const
-// Filters the drive list
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::FilterDriveList( TDriveList& aDriveList ) const
-    {
-    TDriveInfo info;
-    
-    for ( TInt i = 0; i < aDriveList.Length(); i++ )
-        {
-        if ( aDriveList[i] )
-            {
-            iFs.Drive( info, i );
-#ifdef __WINS__
-            if ( i == EDriveD )
-                {
-                LOGGER_WRITE( "EDriveD skipped on WINS build" );
-                aDriveList[i] = '\x0';
-                }
-#else
-            if ( info.iType == EMediaRam )
-                {
-                aDriveList[i] = '\x0';
-                }
-#endif
-            }
-        }
-    
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConSBEClient::Match( const CSConTask& aFirst, const CSConTask& aSecond )
-// Matches the uids
-// -----------------------------------------------------------------------------
-//
-TInt CSConSBEClient::Match( const TUid& aFirst, const TUid& aSecond )
-    {
-    if( aFirst == aSecond )
-        {
-        return ETrue;
-        }
-        
-    return EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::HandleSBEErrorL( TInt& aErr )
-// Handle error received from Secure Backup Engine
-// -----------------------------------------------------------------------------
-//  
-void CSConSBEClient::HandleSBEErrorL( TInt& aErr )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( " aErr: %d", aErr );
-    if( aErr == KErrServerTerminated )
-        {
-        LOGGER_WRITE( "Re-connecting to SBE..." );
-        //Session has been terminated, recreate it..
-        delete iSBEClient;
-        iSBEClient = NULL;
-        iSBEClient = CSBEClient::NewL();
-        }
-    else if ( aErr ) // error
-        {
-        if ( iDataBuffer )
-            {
-            iDataBuffer->Reset();
-            iDataBufferSize = 0;
-            }
-        iLastChunk = EFalse;
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::AppendFilesToFilelistL()
-// Appends files from RFileArray to RPointerArray<CSConFile>
-// -----------------------------------------------------------------------------
-//
-void CSConSBEClient::AppendFilesToFilelistL( const RFileArray& aFiles, RPointerArray<CSConFile>& aSconFiles )
-    {
-    TRACE_FUNC_ENTRY;
-    _LIT( KSConXmlDate, "%F%Y%M%DT%H%T%SZ" );
-    for( TInt j = 0; j < aFiles.Count(); j++ )
-        {
-        CSConFile* fileInfo = new (ELeave) CSConFile();
-        CleanupStack::PushL( fileInfo );
-        fileInfo->iPath = aFiles[j].iName;
-        LOGGER_WRITE_1("file: %S", &fileInfo->iPath );                    
-        
-        fileInfo->iSize = aFiles[j].iSize;
-        
-        switch( aFiles[j].iAtt )
-            {
-            case KEntryAttNormal :
-                fileInfo->iUserPerm = EPermNormal;
-                break;
-            case KEntryAttReadOnly :
-                fileInfo->iUserPerm = EPermReadOnly;
-                break;
-            default :
-                fileInfo->iUserPerm = EPermNormal;
-                break;
-            }
-                        
-        TTime time( aFiles[j].iModified );
-        HBufC* timeBuf = HBufC::NewLC( KMaxTimeFormatSpec );
-        TPtr timePtr = timeBuf->Des();
-        time.FormatL( timePtr, KSConXmlDate );
-
-        fileInfo->iModified.Copy( timePtr );
-
-        CleanupStack::PopAndDestroy( timeBuf );    
-
-        aSconFiles.Append( fileInfo );
-        CleanupStack::Pop( fileInfo );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::PackageDataSizeL()
-// Gets Package dataowner size
-// -----------------------------------------------------------------------------
-//
-TUint CSConSBEClient::PackageDataSizeL( TUid aPackageId, const TDriveList& aDriveList,
-        TPackageDataType aPackageDataType ) const
-    {
-    TUint dataSize(0);
-    //Ask data size from every drive
-    for( TInt j = 0; j < KMaxDrives; j++ )
-        {
-        if( aDriveList[j] )
-            {
-            CSBPackageTransferType* ptt( NULL );
-            TDriveNumber driveNumber = GetDriveNumber( j );
-            LOGGER_WRITE_1( "Drive %d", driveNumber );
-            ptt = CSBPackageTransferType::NewL( aPackageId, driveNumber, aPackageDataType );
-            CleanupStack::PushL( ptt );
-            //Get the size and store it to a variable
-            TRAPD( err, dataSize += iSBEClient->ExpectedDataSizeL( *ptt ) );
-            CleanupStack::PopAndDestroy( ptt );
-            LOGGER_WRITE_1( "ExpectedDataSizeL returned for package %d", err );
-            if( err != KErrNone && err != KErrNotFound )
-                {
-                LOGGER_WRITE_1( "ExpectedDataSizeL LEAVE %d", err );
-                User::Leave( err );
-                }
-            }
-        }
-    return dataSize;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::SidDataSizeL()
-// Gets Sid (SecureId) dataowner size
-// -----------------------------------------------------------------------------
-//
-TUint CSConSBEClient::SidDataSizeL( TUid aSid, const TDriveList& aDriveList,
-        TTransferDataType aTransferDataType ) const
-    {
-    TUint dataSize(0);
-    //Ask data size from every drive
-    for( TInt j = 0; j < KMaxDrives; j++ )
-        {
-        if( aDriveList[j] )
-            {
-            CSBSIDTransferType* stt( NULL );
-            TDriveNumber driveNumber = GetDriveNumber( j );
-            LOGGER_WRITE_1( "Drive %d", driveNumber );
-            stt = CSBSIDTransferType::NewL( aSid, driveNumber, aTransferDataType );
-            CleanupStack::PushL( stt );
-            //Get the size and store it to a variable
-            TRAPD( err, dataSize += iSBEClient->ExpectedDataSizeL( *stt ) ); 
-            CleanupStack::PopAndDestroy( stt );
-            LOGGER_WRITE_1( "ExpectedDataSizeL returned for DO %d", err );
-            if( err != KErrNone && err != KErrNotFound )
-                {
-                LOGGER_WRITE_1( "ExpectedDataSizeL LEAVE %d", err );
-                User::Leave( err );
-                }
-            }
-        }
-    return dataSize;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConSBEClient::JavaDataSizeL()
-// Gets Java dataowner size
-// -----------------------------------------------------------------------------
-//
-TUint CSConSBEClient::JavaDataSizeL( const TDesC& aJavaHash, const TDriveList& aDriveList ) const
-    {
-    TUint dataSize(0);
-    //Ask data size from every drive
-    for( TInt j = 0; j < KMaxDrives; j++ )
-        {
-        if( aDriveList[j] )
-            {
-            CSBJavaTransferType* jtt( NULL );
-            
-            TDriveNumber driveNumber = GetDriveNumber( j );
-            LOGGER_WRITE_1( "Drive %d", driveNumber );
-            jtt = CSBJavaTransferType::NewL( aJavaHash, 
-                                            driveNumber, 
-                                            EJavaMIDlet );
-            CleanupStack::PushL( jtt );
-            //Get the size and store it to a variable
-            TRAPD( err, dataSize += iSBEClient->ExpectedDataSizeL( *jtt ) ); 
-            CleanupStack::PopAndDestroy( jtt );
-            LOGGER_WRITE_1( "ExpectedDataSizeL returned for Java(EJavaMIDlet) DO %d", err );
-            if( err != KErrNone && err != KErrNotFound )
-                {
-                LOGGER_WRITE_1( "ExpectedDataSizeL LEAVE %d", err );
-                User::Leave( err );
-                }
-            
-            jtt = NULL;
-            jtt = CSBJavaTransferType::NewL( aJavaHash, 
-                                            driveNumber, 
-                                            EJavaMIDletData );
-            CleanupStack::PushL( jtt );
-            //Get the size and store it to a variable
-            TRAP( err, dataSize += iSBEClient->ExpectedDataSizeL( *jtt ) ); 
-            CleanupStack::PopAndDestroy( jtt );
-            LOGGER_WRITE_1( "ExpectedDataSizeL returned for Java(EJavaMIDletData) DO %d", err );
-            if( err != KErrNone && err != KErrNotFound )
-                {
-                LOGGER_WRITE_1( "ExpectedDataSizeL LEAVE %d", err );
-                User::Leave( err );
-                }
-            }
-        }
-    
-    return dataSize;
-    }
-// End of file
--- a/connectivitymodules/SeCon/services/pcd/src/sconsynchandler.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1460 +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:  CSconSyncHandler implementation
-*
-*/
-
-
-#include "sconsynchandler.h"
-#include <f32file.h>
-#include <S32MEM.H>
-#include <UTF.H>
-#include <mmf/common/mmfcontrollerpluginresolver.h>
-#include <bautils.h>
-#include <nsmlconstants.h>
-#include <centralrepository.h>
-
-#include "debug.h"
-
-// versions up to 5 must be backward compatible
-const TUint16 KFormatVersionNumber ( 1 );
-
-_LIT8(KCommandListStores, "SYNC: ListStores");
-_LIT8(KCommandOpenStore, "SYNC: OpenStore: ");
-_LIT8(KCommandCloseStore, "SYNC: CloseStore");
-_LIT8(KCommandListChanges, "SYNC: ListChanges");
-_LIT8(KCommandResetChangeInfo, "SYNC: ResetChangeInfo");
-_LIT8(KCommandCommitChanges, "SYNC: CommitChanges: ");
-_LIT8(KCommandReadItems, "SYNC: ReadItems: ");
-_LIT8(KCommandGetParents, "SYNC: GetParents: ");
-_LIT8(KCommandCreateItems, "SYNC: CreateItems");
-_LIT8(KCommandGetCreateItemsResponse, "SYNC: GetCreateItemsResponse");
-_LIT8(KCommandGetCreateItems, "SYNC: GetCreateItems: ");
-_LIT8(KCommandReplaceItems, "SYNC: ReplaceItems");
-_LIT8(KCommandGetReplaceItemsResponse, "SYNC: GetReplaceItemsResponse");
-_LIT8(KCommandGetReplaceItems, "SYNC: GetReplaceItems: ");
-_LIT8(KCommandMoveItems, "SYNC: MoveItems");
-_LIT8(KCommandDeleteItems, "SYNC: DeleteItems: ");
-_LIT8(KCommandSoftDeleteItems, "SYNC: SoftDeleteItems: ");
-_LIT8(KCommandDeleteAllItems, "SYNC: DeleteAllItems");
-_LIT8(KCommandDeleteAllItemsStatus, "SYNC: GetDeleteAllItemsStatus");
-_LIT8(KCommandGetStoreFormat, "SYNC: GetStoreFormat");
-_LIT8(KCommandSetRemoteStoreFormat, "SYNC: SetRemoteStoreFormat");
-_LIT8(KCommandGetRestOfData, "SYNC: GetRestOfData");
-_LIT8(KCommandCancel, "SYNC: Cancel");
-
-
-_LIT(KRemoteFormatStore, "remoteformatstore_0x%08x.dat");
-_LIT(KDataFileExtension, ".tmp");
-
-const TInt KTimeStampLength = 16;
-_LIT8(KTimeStampFormat, "%02d%02d%04dT%02d%02d%02dZ");
-
-const TInt KDefaultExpandSize = 1024;
-
-// Calendar sync specific constants
-const TInt KCalendarDsUid = 0x101F6DDE;
-
-CSconSyncHandler::~CSconSyncHandler()
-    {
-    TRACE_FUNC_ENTRY;
-    Cancel();
-    iSyncSession.Close();
-    delete iResponseData;
-    iFileStream.Close();
-    iCreatedItems.Close();
-    iReplacedItems.Close();
-    iItemsToRead.Close();
-    iFs.Delete( iFileInProgress );
-    ClearCalendarCenrepL();
-    TRACE_FUNC_EXIT;
-    }
-
-CSconSyncHandler::CSconSyncHandler( RFs& aFs ) 
-    : CActive( EPriorityStandard ), iFs(aFs), iCreatedItemUidPckg(iCreatedItemUid)
-    {
-    CActiveScheduler::Add( this );
-    }
-
-CSconSyncHandler* CSconSyncHandler::NewL( RFs& aFs)
-    {
-    TRACE_FUNC_ENTRY;
-    CSconSyncHandler* self = new (ELeave) CSconSyncHandler(aFs);
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-void CSconSyncHandler::ConstructL()
-    {
-    TInt err = iFs.CreatePrivatePath( EDriveC );
-    LOGGER_WRITE_1("CreatePrivatePath err: %d", err);
-    iFs.SetSessionToPrivate( EDriveC );
-    }
-
-void CSconSyncHandler::HandleGetSyncRequestL( const TDesC8& aRequest, RWriteStream& aResult, TInt aMaxObjectSize )
-    {
-    TRACE_FUNC_ENTRY;
-    iMaxObjectSize = aMaxObjectSize;
-    iBytesWrited = 0;
-    LOGGER_WRITE_1("iMaxObjectSize: %d", iMaxObjectSize);
-    if ( !iConnected )
-        {
-        LOGGER_WRITE("Try to connect")
-        User::LeaveIfError( iSyncSession.Connect() );
-        iConnected = ETrue;
-        }
-    
-    if ( aRequest.Compare( KCommandListStores ) == KErrNone )
-        {
-        ListStoresL( aResult );
-        }
-    else if ( aRequest.Find( KCommandOpenStore ) == 0 )
-        {
-        TPtrC8 params = aRequest.Mid( KCommandOpenStore().Length() );
-        OpenStoreL( params, aResult );
-        }
-    else if ( aRequest.Find( KCommandCloseStore ) == 0 )
-        {
-        CloseStoreL( aResult );
-        }
-    else if ( aRequest.Find( KCommandListChanges ) == 0 )
-        {
-        ListChangesL( aResult );
-        }
-    else if ( aRequest.Find( KCommandResetChangeInfo ) == 0 )
-        {
-        ResetChangeInfoL( aResult );
-        }
-    else if ( aRequest.Find( KCommandCommitChanges ) == 0 )
-        {
-        TPtrC8 params = aRequest.Mid( KCommandCommitChanges().Length() );
-        CommitChangesL( params, aResult );
-        }
-    else if ( aRequest.Find( KCommandReadItems ) == 0 )
-        {
-        TPtrC8 params = aRequest.Mid( KCommandReadItems().Length() );
-        ReadItemsL( params, aResult );
-        }
-    else if ( aRequest.Find( KCommandGetParents ) == 0 )
-        {
-        TPtrC8 params = aRequest.Mid( KCommandGetParents().Length() );
-        GetParentsL( params, aResult );
-        }
-    else if ( aRequest.Find( KCommandGetRestOfData ) == 0 )
-        {
-        // Get rest of data
-        ReadNextDataBlockL( aResult );
-        }
-    else if ( aRequest.Find( KCommandGetCreateItemsResponse ) == 0 )
-        {
-        GetCreateItemsResponseL( KNullDesC8(), aResult );
-        }
-    else if ( aRequest.Find( KCommandGetCreateItems ) == 0 )
-        {
-        TPtrC8 params = aRequest.Mid( KCommandGetCreateItems().Length() );
-        GetCreateItemsResponseL( params, aResult );
-        }
-    else if ( aRequest.Find( KCommandGetReplaceItemsResponse ) == 0 )
-        {
-        TPtrC8 params = aRequest.Mid( KCommandGetReplaceItemsResponse().Length() );
-        GetReplaceItemsResponseL( KNullDesC8(), aResult );
-        }
-    else if ( aRequest.Find( KCommandGetReplaceItems ) == 0 )
-        {
-        TPtrC8 params = aRequest.Mid( KCommandGetReplaceItems().Length() );
-        GetReplaceItemsResponseL( params, aResult );
-        }
-    else if ( aRequest.Find( KCommandMoveItems ) == 0 )
-        {
-        TPtrC8 params = aRequest.Mid( KCommandMoveItems().Length() );
-        MoveItemsL( params, aResult );
-        }
-    else if ( aRequest.Find( KCommandDeleteItems ) == 0 )
-        {
-        TPtrC8 params = aRequest.Mid( KCommandDeleteItems().Length() );
-        DeleteItemsL( params, aResult );
-        }
-    else if ( aRequest.Find( KCommandSoftDeleteItems ) == 0 )
-        {
-        TPtrC8 params = aRequest.Mid( KCommandSoftDeleteItems().Length() );
-        SoftDeleteItemsL( params, aResult );
-        }
-    else if ( aRequest.Find( KCommandDeleteAllItems ) == 0 )
-        {
-        DeleteAllItemsL( aResult );
-        }
-    else if ( aRequest.Find( KCommandDeleteAllItemsStatus ) == 0 )
-        {
-        GetDeleteAllItemsStatusL( aResult );
-        }
-    else if ( aRequest.Find( KCommandGetStoreFormat ) == 0 )
-        {
-        GetStoreFormatL( aResult );
-        }
-    else if ( aRequest.Find( KCommandCancel ) == 0 )
-        {
-        CancelOperationsL( aResult );
-        }
-    else    
-        {
-        LOGGER_WRITE("Unknown command");
-        User::Leave( KErrNotSupported );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-
-void CSconSyncHandler::HandlePutSyncRequestL( const TDesC8& aRequest, RReadStream& aData )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !iConnected )
-        {
-        LOGGER_WRITE("Try to connect")
-        User::LeaveIfError( iSyncSession.Connect() );
-        iConnected = ETrue;
-        }
-    if ( aRequest.Find( KCommandCreateItems ) == KErrNone )
-        {
-        CreateItemsL( aData );
-        }
-    else if ( aRequest.Find( KCommandReplaceItems ) == 0 )
-        {
-        ReplaceItemsL( aData );
-        }
-    else if ( aRequest.Find( KCommandSetRemoteStoreFormat ) == 0 )
-        {
-        SetRemoteStoreFormatL( aData );
-        }
-    else
-        {
-        LOGGER_WRITE("Unknown command");
-        User::Leave( KErrNotSupported );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::ListStoresL( RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    RSconDataProviderInfoArray infoArray(5);
-    CleanupResetAndDestroyPushL( infoArray );
-    iSyncSession.ListAllImplementationsL( infoArray );
-    LOGGER_WRITE_1("infoArray.Count(): %d", infoArray.Count());
-    aResult.WriteInt32L( infoArray.Count() );
-    for (TInt i=0; i<infoArray.Count(); i++ )
-        {
-        CSconDataproviderInfo& info = (*infoArray[i]);
-        info.ExternalizeL( aResult );
-        }
-    CleanupStack::PopAndDestroy( &infoArray );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::OpenStoreL( const TDesC8& aParams, RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE8_1("Params:'%S'", &aParams);
-    
-    const TUint8* ptr = aParams.Ptr();
-    LOGGER_WRITE_1("Params size: %d", aParams.Size())
-    RMemReadStream stream( ptr , aParams.Size() );
-    CleanupClosePushL( stream );
-
-    TInt providerId = stream.ReadInt32L();
-    LOGGER_WRITE_1("Provider Id: 0x%08x", providerId);
-    TInt contextId = stream.ReadInt32L();
-    LOGGER_WRITE_1("Context Id: 0x%08x", contextId);
-    
-    // read utf8 formatted text
-    TInt len = stream.ReadUint16L();
-    
-    LOGGER_WRITE_1("storeName length: %d", len);
-    HBufC8* buf8 = HBufC8::NewLC( len );
-    TPtr8 bufPtr8 = buf8->Des();
-    stream.ReadL( bufPtr8, len );
-    
-    LOGGER_WRITE8_1("storeName8: %S", &bufPtr8);
-    
-    // and convert it to unicode
-    HBufC* storeName = CnvUtfConverter::ConvertToUnicodeFromUtf8L( bufPtr8 ); 
-    CleanupStack::PopAndDestroy( buf8 );
-    CleanupStack::PushL( storeName );
-    
-    TPtr storeNamePtr = storeName->Des();
-    LOGGER_WRITE_1("storeName: %S", &storeNamePtr);
-    
-    if ( providerId == KCalendarDsUid && aParams.Size() >
-            sizeof(TInt32) // providerId
-            + sizeof(TInt32) // contextId
-            + sizeof(TUint16)// storeName len
-            + len )          // storeName
-        {
-        TInt profileId = stream.ReadInt32L();
-        len = stream.ReadUint16L();
-        HBufC8* buffer = HBufC8::NewLC( len );
-        TPtr8 bufferPtr8 = buffer->Des();
-        stream.ReadL( bufferPtr8, len );
-        HBufC* serverId = CnvUtfConverter::ConvertToUnicodeFromUtf8L( bufferPtr8 ); 
-        CleanupStack::PopAndDestroy( buffer );
-        CleanupStack::PushL( serverId );
-        SetCalendarCenrepL( profileId, serverId->Des() );
-        CleanupStack::PopAndDestroy(serverId);
-        }
-    
-    aResult.WriteUint16L( KFormatVersionNumber );
-    TRAPD( err, iSyncSession.OpenDataStoreL( providerId, storeName->Des(), contextId));
-    if ( err == KErrServerTerminated )
-        {
-        // server terminated, try to reconnect
-        iConnected = EFalse;
-        LOGGER_WRITE("Try to re-connect");
-        err = iSyncSession.Connect();
-        LOGGER_WRITE_1("iSyncSession.Connect() err: %d", err);
-        if ( !err )
-            {
-            iConnected = ETrue;
-            TRAP( err, iSyncSession.OpenDataStoreL( providerId, storeName->Des(), contextId));
-            }
-        }
-    
-    CleanupStack::PopAndDestroy( storeName );
-    CleanupStack::PopAndDestroy( &stream );
-    
-    aResult.WriteInt32L( err );
-    
-    if ( err )
-        {
-        LOGGER_WRITE_1("Error: %d", err);
-        LOGGER_WRITE("iSyncSession.CloseDataStore()");
-        iSyncSession.CloseDataStore();
-        ClearCalendarCenrepL();
-        return;
-        }
-    iCurrentDataProviderUid = providerId;
-    iCurrentContextUid = contextId;
-    
-    
-    // Now the store is opened
-    TRAP(err, LoadRemoteStoreFormatL( contextId, providerId ));
-    if ( err )
-        {
-        aResult.WriteUint8L( 1 ); //  Remote store format needed
-        }
-    else
-        {
-        aResult.WriteUint8L( 0 ); //  Remote store format not needed
-        }
-    
-    // return last sync timestamp, if has synced before.
-    TBool hasHistory = iSyncSession.HasSyncHistoryL();
-    TUint8 historyFlag(0);
-    if ( hasHistory )
-        {
-        historyFlag = 1;
-        }
-    aResult.WriteUint8L( historyFlag );
-    
-    if ( hasHistory )
-        {
-        TDateTime timeStamp;
-        TInt err(KErrNone);
-        TRAP(err, iSyncSession.GetSyncTimeStampL( providerId, contextId, timeStamp));
-        LOGGER_WRITE_1("GetSyncTimeStampL err: %d", err);
-        
-        TBuf8<KTimeStampLength> timeStampBuf;
-        
-        timeStampBuf.Format( KTimeStampFormat, 
-                timeStamp.Day()+1,timeStamp.Month()+1, timeStamp.Year(),
-                timeStamp.Hour(), timeStamp.Minute(), timeStamp.Second() );
-        LOGGER_WRITE8_1("timeStamp: %S", &timeStampBuf);
-        aResult.WriteL( timeStampBuf );
-        }
-    
-    
-    //  for testin purposes only
-    /*
-    if (!remoteStoreSetted)
-        {
-        RStringPool pool;
-        pool.OpenL();
-        CleanupClosePushL( pool );
-        CSmlDataStoreFormat* storeFormat(NULL);
-        TRAPD( err, storeFormat = iSyncSession.StoreFormatL( pool ) );
-        CleanupStack::PushL( storeFormat );
-        
-        iSyncSession.SetRemoteStoreFormatL( *storeFormat );
-        SaveRemoteStoreFormatL( *storeFormat, contextId, providerId );
-        
-        CleanupStack::PopAndDestroy( storeFormat );
-        CleanupStack::PopAndDestroy( &pool );
-        }
-    */
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::LoadRemoteStoreFormatL( TInt aContextId, TInt aProviderId )
-    {
-    TRACE_FUNC_ENTRY;
-    TFileName remoteFormatStore;
-    iFs.SetSessionToPrivate( EDriveC );
-    remoteFormatStore.Format( KRemoteFormatStore, aContextId );
-       
-    CDictionaryFileStore* dictionaryStore =
-        CDictionaryFileStore::OpenLC(iFs, remoteFormatStore, TUid::Uid(0x0001));
-    TBool present = dictionaryStore->IsPresentL( TUid::Uid(aProviderId) );
-    if ( !present )
-        {
-        LOGGER_WRITE("Remote store was not saved");
-        User::Leave( KErrNotFound );
-        }
-    else
-        {
-        RDictionaryReadStream stream;
-        stream.OpenLC( *dictionaryStore, TUid::Uid(aProviderId) );
-        RStringPool stringPool;
-        stringPool.OpenL();
-        CleanupClosePushL( stringPool );
-        CSmlDataStoreFormat* storeFormat = CSmlDataStoreFormat::NewLC(stringPool, stream);
-        iSyncSession.SetRemoteStoreFormatL( *storeFormat );
-        CleanupStack::PopAndDestroy( storeFormat );
-        CleanupStack::PopAndDestroy( &stringPool );
-        CleanupStack::PopAndDestroy(); //OpenLC
-        }
-    CleanupStack::PopAndDestroy( dictionaryStore );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::SaveRemoteStoreFormatL( CSmlDataStoreFormat& aStoreFormat, TInt aContextId, TInt aProviderId)
-    {
-    TRACE_FUNC_ENTRY;
-    iFs.SetSessionToPrivate( EDriveC );
-    TFileName remoteFormatStore;
-    remoteFormatStore.Format( KRemoteFormatStore, aContextId );
-    CDictionaryFileStore* dictionaryStore =
-        CDictionaryFileStore::OpenLC(iFs, remoteFormatStore, TUid::Uid(0x0001));
-    
-    RDictionaryWriteStream stream;
-    stream.AssignLC( *dictionaryStore, TUid::Uid(aProviderId) );
-    
-    aStoreFormat.ExternalizeL( stream );
-    stream.CommitL();
-    CleanupStack::PopAndDestroy(); //AssignLC
-    dictionaryStore->CommitL();
-        
-    CleanupStack::PopAndDestroy( dictionaryStore );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::CloseStoreL( RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    iSyncSession.CloseDataStore();
-    ClearCalendarCenrepL();
-    
-    // Get last used timestamp if provider was open
-    if ( iCurrentDataProviderUid != 0 )
-        {
-        TDateTime timeStamp;
-        iSyncSession.GetSyncTimeStampL(iCurrentDataProviderUid, iCurrentContextUid, timeStamp );
-        
-        iCurrentDataProviderUid = 0;
-        iCurrentContextUid = 0;
-        
-        const TInt KTimeStampLength = 16;
-        TBuf8<KTimeStampLength> timeStampBuf;
-        
-        
-        timeStampBuf.Format( KTimeStampFormat, 
-                timeStamp.Day()+1,timeStamp.Month()+1, timeStamp.Year(),
-                timeStamp.Hour(), timeStamp.Minute(), timeStamp.Second() );
-        aResult.WriteL( timeStampBuf );
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::ListChangesL( RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    RArray<TSmlDbItemUid> items;
-    CleanupClosePushL( items );
-    
-    iSyncSession.AddedItemsL( items );
-    LOGGER_WRITE_1("Added items count: %d", items.Count());
-    aResult.WriteInt32L( items.Count() );
-    for (TInt i=0; i<items.Count(); i++ )
-        {
-        aResult.WriteInt32L( items[i] );
-        }
-    
-    items.Reset();
-    iSyncSession.ModifiedItemsL( items );
-    LOGGER_WRITE_1("Modified items count: %d", items.Count());
-    aResult.WriteInt32L( items.Count() );
-    for (TInt i=0; i<items.Count(); i++ )
-        {
-        aResult.WriteInt32L( items[i] );
-        }
-    
-    items.Reset();
-    iSyncSession.MovedItemsL( items );
-    LOGGER_WRITE_1("Moved items count: %d", items.Count());
-    aResult.WriteInt32L( items.Count() );
-    for (TInt i=0; i<items.Count(); i++ )
-        {
-        aResult.WriteInt32L( items[i] );
-        }
-    
-    items.Reset();
-    iSyncSession.DeletedItemsL( items );
-    LOGGER_WRITE_1("Deleted items count: %d", items.Count());
-    aResult.WriteInt32L( items.Count() );
-    for (TInt i=0; i<items.Count(); i++ )
-        {
-        aResult.WriteInt32L( items[i] );
-        }
-    
-    items.Reset();
-    iSyncSession.SoftDeletedItemsL( items );
-    LOGGER_WRITE_1("SoftDeleted items count: %d", items.Count());
-    aResult.WriteInt32L( items.Count() );
-    for (TInt i=0; i<items.Count(); i++ )
-        {
-        aResult.WriteInt32L( items[i] );
-        }
-    CleanupStack::PopAndDestroy( &items );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::ResetChangeInfoL( RWriteStream& /*aResult*/ )
-    {
-    TRACE_FUNC_ENTRY;
-    iSyncSession.ResetChangeInfoL();
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::CommitChangesL( const TDesC8& aParams, RWriteStream& /*aResult*/ )
-    {
-    TRACE_FUNC_ENTRY;
-    const TUint8* ptr = aParams.Ptr();
-    RMemReadStream stream( ptr , aParams.Size() );
-    CleanupClosePushL( stream );
-    
-    TInt itemCount = stream.ReadInt32L();
-    RArray<TSmlDbItemUid> items;
-    CleanupClosePushL( items );
-    for ( TInt i=0; i<itemCount; i++ )
-        {
-        items.AppendL( stream.ReadInt32L() );
-        }
-    
-    if ( items.Count() > 0 )
-        {
-        iSyncSession.CommitChangeInfoL( items );
-        }
-    
-    CleanupStack::PopAndDestroy( &items );
-    CleanupStack::PopAndDestroy( &stream );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::ReadItemsL( const TDesC8& aParams, RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    iItemsToRead.Reset();
-    LOGGER_WRITE_1("aParams length: %d", aParams.Length());
-    
-    const TUint8* ptr = aParams.Ptr();
-    RMemReadStream stream( ptr , aParams.Size() );
-    CleanupClosePushL( stream );
-    
-    // Read item uids from parameter
-    TInt itemCount = stream.ReadInt32L();
-    LOGGER_WRITE_1("Item count: %d", itemCount);
-    for ( TInt i=0; i<itemCount; i++ )
-        {
-        iItemsToRead.AppendL( stream.ReadInt32L() );
-        LOGGER_WRITE_2("Item[%d] = %d", i, iItemsToRead[i] );
-        }
-    CleanupStack::PopAndDestroy( &stream );
-    LOGGER_WRITE( "Items readed ok" );
-    
-    aResult.WriteInt32L( iItemsToRead.Count() );
-    iBytesWrited += sizeof(TInt32);
-    
-    ReadNextDataBlockL( aResult );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::GetParentsL( const TDesC8& aParams, RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    const TUint8* ptr = aParams.Ptr();
-    RMemReadStream stream( ptr , aParams.Size() );
-    CleanupClosePushL( stream );
-    
-    // Read item uids from parameter
-    TInt itemCount = stream.ReadInt32L();
-    aResult.WriteInt32L( itemCount );
-    LOGGER_WRITE_1("Item count: %d", itemCount);
-    for ( TInt i=0; i<itemCount; i++ )
-        {
-        TSmlDbItemUid itemUid = stream.ReadInt32L();
-        TSmlDbItemUid parent(KErrNotFound);
-        aResult.WriteInt32L( itemUid );
-        TInt err = iSyncSession.GetParent( itemUid, parent);
-        LOGGER_WRITE_1("itemUid: %d", itemUid);
-        LOGGER_WRITE_1("err: %d", err);
-        aResult.WriteInt32L( err );
-        if ( err == KErrNone )
-            {
-            LOGGER_WRITE_1("parent: %d", parent);
-            aResult.WriteInt32L( parent );
-            }
-        }
-    CleanupStack::PopAndDestroy( &stream );
-    aResult.CommitL();
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::ReadNextDataBlockL( RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( (!iResponseData || iResponseData->Size() == 0 ) && iItemsToRead.Count() == 0 )
-        {
-        // no data
-        LOGGER_WRITE("no more data or items");
-        User::Leave(KErrEof);
-        }
-    
-    if ( iResponseData )
-        {
-        // write data from tempbuffer to response buffer
-        TInt writeLength = iResponseData->Size();
-        if ( writeLength > iMaxObjectSize-iBytesWrited )
-            {
-            writeLength = iMaxObjectSize-iBytesWrited;
-            }
-        aResult.WriteL( iResponseData->Ptr(0), writeLength );
-        iBytesWrited += writeLength;
-        
-        if ( iResponseData->Size()  > writeLength )
-            {
-            iResponseData->Delete(0, writeLength);
-            }
-        else
-            {
-            iResponseData->Reset();
-            }
-        }
-    if ( iBytesWrited == iMaxObjectSize )
-        {
-        // responce buffer is full, return it.
-        LOGGER_WRITE("Stream is full, return it");
-        return;
-        }
-    
-    TBool streamIsFull( EFalse );
-    // Read items from server
-    CBufFlat* dataBuffer = CBufFlat::NewL(KDefaultExpandSize);
-    CleanupStack::PushL( dataBuffer );
-    while ( iItemsToRead.Count() > 0 && !streamIsFull )
-        {
-        if ( iMaxObjectSize-iBytesWrited < sizeof(TUint32) )
-            {
-            streamIsFull = ETrue;
-            LOGGER_WRITE("Stream is full, don't read next item");
-            continue;
-            }
-        ReadItemL( iItemsToRead[0], *dataBuffer );
-        aResult.WriteUint32L( dataBuffer->Size() );
-        iBytesWrited += sizeof( TUint32 );
-        
-        TInt writeLength = dataBuffer->Size();
-        if ( writeLength > iMaxObjectSize-iBytesWrited )
-            {
-            writeLength = iMaxObjectSize-iBytesWrited;
-            LOGGER_WRITE_1("Write only %d bytes", writeLength);
-            }
-        aResult.WriteL( dataBuffer->Ptr(0), writeLength );
-        iBytesWrited += writeLength;
-        
-        if ( dataBuffer->Size()  > writeLength )
-            {
-            // write rest to next data block
-            if ( !iResponseData )
-                {
-                iResponseData = CBufFlat::NewL(KDefaultExpandSize);
-                }
-            iResponseData->Reset();
-            LOGGER_WRITE_1("Save %d bytes for next request", dataBuffer->Size() - writeLength);
-            iResponseData->ResizeL( dataBuffer->Size() - writeLength );
-            iResponseData->Write(0, dataBuffer->Ptr( writeLength ));
-            streamIsFull = ETrue;
-            }
-        
-        iItemsToRead.Remove(0);
-        
-        if ( iBytesWrited == iMaxObjectSize )
-            {
-            // writestream is full
-            LOGGER_WRITE("Stream is full");
-            streamIsFull = ETrue;
-            }
-        
-        }
-    aResult.CommitL();
-    
-    CleanupStack::PopAndDestroy( dataBuffer );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::ReadItemL( TSmlDbItemUid aUid, CBufFlat& aItemData )
-    {
-    TRACE_FUNC_ENTRY;
-    aItemData.Reset();
-    CBufFlat* dataBuffer = CBufFlat::NewL(KDefaultExpandSize);
-    CleanupStack::PushL( dataBuffer );
-    TSmlDbItemUid parent(-1);
-    TBool fieldChange(EFalse);
-    
-    TBuf8<256> mimeType;
-    TBuf8<100> mimeVer;
-    TRAPD( err, iSyncSession.OpenItemL( aUid, fieldChange,
-                    parent, mimeType, mimeVer, *dataBuffer ));
-    if ( err )
-        {
-        LOGGER_WRITE_1("Could not read item %d", aUid);
-        // only item uid and errorcode will be writed
-        aItemData.ResizeL( 
-            sizeof(TInt32) +
-            sizeof(TInt32));
-        
-        }
-    else
-        {
-        // reserve memory for all fields
-        aItemData.ResizeL( 
-            sizeof(TInt32) +
-            sizeof(TInt32) +
-            sizeof(TUint8) +
-            sizeof(TInt32) +
-            sizeof(TUint16) +
-            mimeType.Length() +
-            sizeof(TUint16) +
-            mimeVer.Length() +
-            sizeof(TInt32) +
-            dataBuffer->Size()
-            );
-        }
-    
-    RBufWriteStream tempStream( aItemData );
-    CleanupClosePushL( tempStream );
-    tempStream.WriteInt32L( aUid );
-    tempStream.WriteInt32L( err );
-    if ( !err )
-        {
-        tempStream.WriteUint8L( fieldChange );
-        tempStream.WriteInt32L( parent );
-        tempStream.WriteUint16L( mimeType.Length() );
-        tempStream.WriteL( mimeType );
-        tempStream.WriteUint16L( mimeVer.Length() );
-        tempStream.WriteL( mimeVer );
-        tempStream.WriteInt32L( dataBuffer->Size() );
-        tempStream.WriteL( dataBuffer->Ptr(0), dataBuffer->Size() );
-        }
-    tempStream.CommitL();
-    CleanupStack::PopAndDestroy( &tempStream );
-    CleanupStack::PopAndDestroy( dataBuffer );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::CreateItemsL( RReadStream& aData )
-    {
-    TRACE_FUNC_ENTRY;
-    delete iResponseData;
-    iResponseData = NULL;
-    iResponseData = CBufFlat::NewL(KDefaultExpandSize);
-    RBufWriteStream responseStream( *iResponseData );
-    CleanupClosePushL( responseStream );
-    // Read item uids from parameter
-    TInt itemCount = aData.ReadInt32L();
-    LOGGER_WRITE_1("itemCount: %d", itemCount);
-    responseStream.WriteInt32L( itemCount );
-    for ( TInt i=0; i<itemCount; i++ )
-        {
-        LOGGER_WRITE("read from aData stream");
-        TInt tempUid = aData.ReadInt32L();
-        
-        TSmlDbItemUid parent = aData.ReadInt32L();
-        
-        TInt len = aData.ReadUint16L();
-        HBufC8* mimeTypeBuf = HBufC8::NewLC( len );
-        TPtr8 mimeTypePtr = mimeTypeBuf->Des();
-        aData.ReadL(mimeTypePtr, len);
-        
-        len = aData.ReadUint16L();
-        HBufC8* mimeVerBuf = HBufC8::NewLC( len );
-        TPtr8 mimeVerPtr = mimeVerBuf->Des();
-        aData.ReadL(mimeVerPtr, len);
-        
-        len = aData.ReadInt32L();
-        HBufC8* dataBuf = HBufC8::NewLC( len );
-        TPtr8 dataPtr = dataBuf->Des();
-        aData.ReadL( dataPtr, len );
-        
-        TSmlDbItemUid newUid(-1);
-        LOGGER_WRITE("read from aData stream -readed ok");
-        TRAPD( err, iSyncSession.CreateItemL(newUid,
-                parent, mimeTypePtr,
-                mimeVerPtr, dataPtr));
-        
-        CleanupStack::PopAndDestroy( dataBuf );
-        CleanupStack::PopAndDestroy( mimeVerBuf );
-        CleanupStack::PopAndDestroy( mimeTypeBuf );
-        LOGGER_WRITE("Write to responseStream");
-        responseStream.WriteInt32L( tempUid );
-        responseStream.WriteInt32L( err );
-        if ( !err )
-            {
-            responseStream.WriteInt32L( newUid );
-            }
-        LOGGER_WRITE("Write to responseStream -writed ok");
-        }
-    
-    responseStream.CommitL();
-    CleanupStack::PopAndDestroy( &responseStream );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::GetCreateItemsResponseL( const TDesC8& aParams, RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aParams.Length() > 0 )
-        {
-        LOGGER_WRITE_1("params length: %d", aParams.Length());
-        
-        //LOGGER_WRITE8_1("aParams: %S", &aParams);
-        if ( iSyncStatus == EReady )
-            {
-            LOGGER_WRITE("Start creating items from file");
-            iCreatedItems.Reset();
-            const TUint8* ptr = aParams.Ptr();
-            RMemReadStream stream( ptr , aParams.Size() );
-            CleanupClosePushL( stream );
-            TInt filenameLength = stream.ReadInt32L();
-            LOGGER_WRITE_1("filename length: %d", filenameLength );
-            HBufC8* filenameBuf8 = HBufC8::NewLC( /*stream,*/ filenameLength ); // filename
-            TPtr8 filenamePtr = filenameBuf8->Des();
-            stream.ReadL( filenamePtr, filenameLength);
-            LOGGER_WRITE("filename ok");
-            TInt err = CnvUtfConverter::ConvertToUnicodeFromUtf8(iFileInProgress, filenamePtr );
-            LOGGER_WRITE_1("ConvertToUnicodeFromUtf8 err: %d", err);
-            User::LeaveIfError( err );
-            LOGGER_WRITE_1("iFileInProgress: %S", &iFileInProgress);
-            
-            if ( iFileInProgress.RightTPtr(KDataFileExtension().Length()).CompareF(KDataFileExtension) != 0 )
-                {
-                iFileInProgress = KNullDesC();
-                LOGGER_WRITE("File extendion was not correct");
-                User::Leave( KErrAccessDenied );
-                }
-            
-            CleanupStack::PopAndDestroy( filenameBuf8 );
-			
-            LOGGER_WRITE("open file");
-            err = iFileStream.Open(iFs,iFileInProgress, EFileShareReadersOnly);
-            LOGGER_WRITE_1("iFileStream.Open err: %d", err);
-            User::LeaveIfError( err );
-            
-            CleanupStack::PopAndDestroy( &stream );
-            
-            iSyncStatus = ECreatingItemsFromFile;
-            iItemsLeftInStream = iFileStream.ReadInt32L();
-            LOGGER_WRITE_1("iItemsLeftInStream: %d", iItemsLeftInStream);
-            aResult.WriteInt32L( iItemsLeftInStream );
-            aResult.WriteInt32L( 0 ); // completed items since last sync
-            CreateNextItemOnStreamL();
-            iItemsLeftInStream--;
-            }
-        else if ( iSyncStatus == ECreatingItemsFromFile || iSyncStatus == EItemsCreated )
-            {
-            LOGGER_WRITE("Read status");
-            TInt temp = 0;
-            if ( iSyncStatus == ECreatingItemsFromFile )
-                {
-                // one item is on progress, add it to to "left" items.
-                temp = 1;
-                }
-            LOGGER_WRITE_1("left items: %d", iItemsLeftInStream + temp);
-            LOGGER_WRITE_1("completed items: %d", iCreatedItems.Count());
-            aResult.WriteInt32L( iItemsLeftInStream + temp ); // items in progress
-            aResult.WriteInt32L( iCreatedItems.Count() ); // completed items since last get
-            
-            while ( iCreatedItems.Count() > 0 )
-                {
-                aResult.WriteInt32L( iCreatedItems[0].iTemporaryId );
-                aResult.WriteInt32L( iCreatedItems[0].iErrorCode );
-                if ( !iCreatedItems[0].iErrorCode )
-                    {
-                    aResult.WriteInt32L( iCreatedItems[0].iNewUid );
-                    }
-                iCreatedItems.Remove(0);
-                }
-            if ( iSyncStatus == EItemsCreated )
-                {
-                // all done
-                iSyncStatus = EReady;
-                LOGGER_WRITE("iSyncStatus = EReady");
-                }
-            }
-        else
-            {
-            LOGGER_WRITE_1("Wrong sync status: %d", iSyncStatus);
-            User::Leave( KErrInUse );
-            }
-        }
-    else
-        {
-        LOGGER_WRITE("Read response");
-        if ( !iResponseData )
-            {
-            User::Leave( KErrNotReady );
-            }
-        aResult.WriteL( iResponseData->Ptr(0), iResponseData->Size() );
-        delete iResponseData;
-        iResponseData = NULL;
-        }
-    aResult.CommitL();
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::ReplaceItemsL( RReadStream& aData )
-    {
-    TRACE_FUNC_ENTRY;
-    delete iResponseData;
-    iResponseData = NULL;
-    iResponseData = CBufFlat::NewL(KDefaultExpandSize);
-    RBufWriteStream responseStream( *iResponseData );
-    CleanupClosePushL( responseStream );
-    // Read item uids from parameter
-    TInt itemCount = aData.ReadInt32L();
-    
-    responseStream.WriteInt32L( itemCount );
-    for ( TInt i=0; i<itemCount; i++ )
-        {
-        TSmlDbItemUid uid = aData.ReadInt32L();
-        TSmlDbItemUid parent = aData.ReadInt32L();
-        TBool fieldChange = aData.ReadUint8L();
-        TInt len = aData.ReadInt32L();
-        HBufC8* dataBuf = HBufC8::NewLC( len );
-        TPtr8 dataPtr = dataBuf->Des();
-        aData.ReadL( dataPtr, len );
-        
-        TRAPD( err, iSyncSession.ReplaceItemL(uid, 
-                parent, 
-                fieldChange, dataPtr));
-        CleanupStack::PopAndDestroy( dataBuf );
-        
-        responseStream.WriteInt32L( uid );
-        responseStream.WriteInt32L( err );
-        }
-    responseStream.CommitL();
-    CleanupStack::PopAndDestroy( &responseStream );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::GetReplaceItemsResponseL( const TDesC8& aParams, RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aParams.Length() > 0 )
-        {
-        LOGGER_WRITE8_1("aParams: %S", &aParams);
-        if ( iSyncStatus == EReady )
-            {
-            LOGGER_WRITE("Start replacing items from file");
-            iReplacedItems.Reset();
-            
-            // create parameter stream reader
-            const TUint8* ptr = aParams.Ptr();
-            RMemReadStream stream( ptr , aParams.Size() );
-            CleanupClosePushL( stream );
-            
-            // read filename
-            TInt filenameLength = stream.ReadInt32L();
-            LOGGER_WRITE_1("filename length: %d", filenameLength );
-            HBufC8* filenameBuf8 = HBufC8::NewLC( filenameLength ); // filename
-            TPtr8 filenamePtr = filenameBuf8->Des();
-            stream.ReadL( filenamePtr, filenameLength);
-            LOGGER_WRITE("filename ok");
-            
-            TInt err = CnvUtfConverter::ConvertToUnicodeFromUtf8(iFileInProgress, filenameBuf8->Des() );
-            LOGGER_WRITE_1("ConvertToUnicodeFromUtf8 err: %d", err);
-            User::LeaveIfError( err );
-            if ( iFileInProgress.RightTPtr(KDataFileExtension().Length()).CompareF(KDataFileExtension) != 0 )
-                {
-                iFileInProgress = KNullDesC();
-                LOGGER_WRITE("File extendion was not correct");
-                User::Leave( KErrAccessDenied );
-                }
-            
-            // open file
-            err = iFileStream.Open(iFs, iFileInProgress, EFileShareReadersOnly);
-            LOGGER_WRITE_1("iFileStream.Open err: %d", err);
-            User::LeaveIfError( err );
-            
-            CleanupStack::PopAndDestroy( filenameBuf8 );
-            CleanupStack::PopAndDestroy( &stream );
-            
-            iSyncStatus = EReplacingItemsFromFile;
-            iItemsLeftInStream = iFileStream.ReadInt32L();
-            LOGGER_WRITE_1("iItemsLeftInStream: %d", iItemsLeftInStream);
-            // write results to return stream
-            aResult.WriteInt32L( iItemsLeftInStream );
-            aResult.WriteInt32L( 0 ); // completed items since last sync
-            ReplaceNextItemOnStreamL();
-            iItemsLeftInStream--;
-            }
-        else if ( iSyncStatus == EReplacingItemsFromFile || iSyncStatus == EItemsReplaced )
-            {
-            LOGGER_WRITE("Read status");
-            TInt temp = 0;
-            if ( iSyncStatus == EReplacingItemsFromFile )
-                {
-                // one item is on progress, add it to to "left" items.
-                temp = 1;
-                }
-            LOGGER_WRITE_1("left items: %d", iItemsLeftInStream + temp);
-            LOGGER_WRITE_1("completed items: %d", iReplacedItems.Count());
-            aResult.WriteInt32L( iItemsLeftInStream + temp ); // items in progress
-            aResult.WriteInt32L( iReplacedItems.Count() ); // completed items since last get
-            //for (TInt i=0; i<iCreatedItems.Count(); i++)
-            while ( iReplacedItems.Count() > 0 )
-                {
-                aResult.WriteInt32L( iReplacedItems[0].iItemUid );
-                aResult.WriteInt32L( iReplacedItems[0].iErrorCode );
-                iReplacedItems.Remove(0);
-                }
-            if ( iSyncStatus == EItemsReplaced )
-                {
-                // all done
-                iSyncStatus = EReady;
-                LOGGER_WRITE("iSyncStatus = EReady");
-                }
-            }
-        }
-    else
-        {
-        if ( !iResponseData )
-            {
-            LOGGER_WRITE("No response data, leave KErrNotReady");
-            User::Leave( KErrNotReady );
-            }
-        aResult.WriteL( iResponseData->Ptr(0), iResponseData->Size() );
-        aResult.CommitL();
-        delete iResponseData;
-        iResponseData = NULL;
-        }
-    aResult.CommitL();
-    
-    
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::MoveItemsL( const TDesC8& aParams, RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;  
-    const TUint8* ptr = aParams.Ptr();
-    RMemReadStream stream( ptr , aParams.Size() );
-    CleanupClosePushL( stream );
-    
-    // Read item uids from parameter
-    TInt itemCount = stream.ReadInt32L();
-    aResult.WriteInt32L( itemCount );
-    for ( TInt i=0; i<itemCount; i++ )
-        {
-        TSmlDbItemUid uid = stream.ReadInt32L();
-        TSmlDbItemUid newParent = stream.ReadInt32L();
-        TRAPD( err, iSyncSession.MoveItemL( uid,newParent ));
-        
-        aResult.WriteInt32L( uid );
-        aResult.WriteInt32L( err );
-        }
-    aResult.CommitL();
-    CleanupStack::PopAndDestroy( &stream );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::DeleteItemsL( const TDesC8& aParams, RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    const TUint8* ptr = aParams.Ptr();
-    RMemReadStream stream( ptr , aParams.Size() );
-    CleanupClosePushL( stream );
-    
-    // Read item uids from parameter
-    TInt itemCount = stream.ReadInt32L();
-    aResult.WriteInt32L( itemCount );
-    for ( TInt i=0; i<itemCount; i++ )
-        {
-        TSmlDbItemUid uid = stream.ReadInt32L();
-        
-        TRAPD( err, iSyncSession.DeleteItemL( uid ));
-        
-        aResult.WriteInt32L( uid );
-        aResult.WriteInt32L( err );
-        }
-    aResult.CommitL();
-    CleanupStack::PopAndDestroy( &stream );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::SoftDeleteItemsL( const TDesC8& aParams, RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    const TUint8* ptr = aParams.Ptr();
-    RMemReadStream stream( ptr , aParams.Size() );
-    CleanupClosePushL( stream );
-    
-    // Read item uids from parameter
-    TInt itemCount = stream.ReadInt32L();
-    aResult.WriteInt32L( itemCount );
-    for ( TInt i=0; i<itemCount; i++ )
-        {
-        TSmlDbItemUid uid = stream.ReadInt32L();
-        
-        TRAPD( err, iSyncSession.SoftDeleteItemL( uid ));
-        
-        aResult.WriteInt32L( uid );
-        aResult.WriteInt32L( err );
-        }
-    aResult.CommitL();
-    CleanupStack::PopAndDestroy( &stream );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::DeleteAllItemsL( RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( IsActive() )
-        {
-        LOGGER_WRITE("Warning: Was on active state!");
-        Cancel();
-        }
-    SetActive();
-    iStatus = KRequestPending;
-    iSyncStatus = EDeletingAllItems;
-    iSyncSession.DeleteAllItems( iStatus );
-    aResult.WriteInt32L( KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::GetDeleteAllItemsStatusL( RWriteStream& aResult )
-    {
-    if ( iSyncStatus == EDeletingAllItems )
-        {
-        LOGGER_WRITE("CSconSyncHandler::GetDeleteAllItemsStatusL - In progress");
-        aResult.WriteInt8L( 1 ); // 1 = in progress
-        }
-    else
-        {
-        LOGGER_WRITE("CSconSyncHandler::GetDeleteAllItemsStatusL - Ready");
-        aResult.WriteInt8L( 0 ); // 0 = ready
-        aResult.WriteInt32L( iStatus.Int() );
-        }
-    }
-
-void CSconSyncHandler::GetStoreFormatL( RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    RStringPool pool;
-    pool.OpenL();
-    CleanupClosePushL( pool );
-    CSmlDataStoreFormat* storeFormat(NULL);
-    TRAPD( err, storeFormat = iSyncSession.StoreFormatL( pool ) );
-    CleanupStack::PushL( storeFormat );
-    aResult.WriteInt32L( err );
-    if ( !err )
-        {
-        storeFormat->ExternalizeL( aResult );
-        }
-    CleanupStack::PopAndDestroy( storeFormat );
-    CleanupStack::PopAndDestroy( &pool );
-    TRACE_FUNC_EXIT;
-    }
-
-
-void CSconSyncHandler::SetRemoteStoreFormatL( RReadStream& aData )
-    {
-    TRACE_FUNC_ENTRY;
-    RStringPool pool;
-    pool.OpenL();
-    CleanupClosePushL( pool );
-    CSmlDataStoreFormat* serverDataStoreFormat = CSmlDataStoreFormat::NewLC( pool, aData );
-    iSyncSession.SetRemoteStoreFormatL( *serverDataStoreFormat );
-    // Save format for later use
-    TRAPD(err, SaveRemoteStoreFormatL( *serverDataStoreFormat, iCurrentContextUid, iCurrentDataProviderUid ));
-    if ( err )
-        {
-        LOGGER_WRITE_1("SaveRemoteStoreFormatL err: %d", err);
-        }
-    CleanupStack::PopAndDestroy( serverDataStoreFormat );
-    CleanupStack::PopAndDestroy( &pool );
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::CreateNextItemOnStreamL()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( IsActive() )
-        {
-        LOGGER_WRITE("Warning: Was on active state!");
-        Cancel();
-        }
-    iTemporaryItemUid = iFileStream.ReadInt32L();
-    TSmlDbItemUid parent = iFileStream.ReadInt32L();
-    
-    TInt len = iFileStream.ReadUint16L();
-    HBufC8* mimeTypeBuf = HBufC8::NewLC( len );
-    TPtr8 mimeTypePtr = mimeTypeBuf->Des();
-    iFileStream.ReadL(mimeTypePtr, len);
-    
-    len = iFileStream.ReadUint16L();
-    HBufC8* mimeVerBuf = HBufC8::NewLC( len );
-    TPtr8 mimeVerPtr = mimeVerBuf->Des();
-    iFileStream.ReadL(mimeVerPtr, len);
-    
-    len = iFileStream.ReadInt32L();
-    HBufC8* dataBuf = HBufC8::NewLC( len );
-    TPtr8 dataPtr = dataBuf->Des();
-    iFileStream.ReadL( dataPtr, len );    
-    
-    SetActive();
-    iStatus = KRequestPending;
-    iSyncSession.CreateItemL(iCreatedItemUidPckg,
-            parent, mimeTypePtr,
-            mimeVerPtr, dataPtr, iStatus);
-    
-    CleanupStack::PopAndDestroy( dataBuf );
-    CleanupStack::PopAndDestroy( mimeVerBuf );
-    CleanupStack::PopAndDestroy( mimeTypeBuf );
-    
-   
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::ReplaceNextItemOnStreamL()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( IsActive() )
-        {
-        LOGGER_WRITE("Warning: Was on active state!");
-        Cancel();
-        }
-    TSmlDbItemUid uid = iFileStream.ReadInt32L();
-    TSmlDbItemUid parent = iFileStream.ReadInt32L();
-    TBool fieldChange = iFileStream.ReadUint8L();
-    TInt len = iFileStream.ReadInt32L();
-    HBufC8* dataBuf = HBufC8::NewLC( len );
-    TPtr8 dataPtr = dataBuf->Des();
-    iFileStream.ReadL( dataPtr, len );
-    
-    iReplacedItem.iItemUid = uid;
-    
-    SetActive();
-    iStatus = KRequestPending;
-    
-    iSyncSession.ReplaceItemL(uid, 
-                parent, 
-                fieldChange, dataPtr, iStatus);
-    
-    CleanupStack::PopAndDestroy( dataBuf );
-   
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::CancelOperationsL( RWriteStream& aResult )
-    {
-    TRACE_FUNC_ENTRY;
-    Cancel();
-    // all done
-    iFileStream.Close();
-    iTemporaryItemUid = -1;
-    iCreatedItemUid = -1;
-    iSyncStatus = EItemsCreated;
-    iFs.Delete( iFileInProgress );
-    iFileInProgress = KNullDesC();
-    iItemsLeftInStream = 0;
-    _LIT8(KDummyParam, "Cancel");
-    if ( iSyncStatus == EItemsCreated )
-        {
-        GetCreateItemsResponseL( KDummyParam, aResult );
-        }
-    else if ( iSyncStatus == EItemsReplaced )
-        {
-        GetReplaceItemsResponseL( KDummyParam, aResult );
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::DoCancel()
-    {
-    TRACE_FUNC_ENTRY;
-    iSyncSession.CancelRequest();
-    Reset();
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::RunL()
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("iSyncStatus: %d", iSyncStatus);
-    LOGGER_WRITE_1("iStatus: %d", iStatus.Int());
-    if ( iSyncStatus == ECreatingItemsFromFile )
-        {
-        LOGGER_WRITE_1("iTemporaryItemUid: %d", iTemporaryItemUid);
-        LOGGER_WRITE_1("iCreatedItemUid: %d", iCreatedItemUid);
-        TCreatedItem item;
-        item.iTemporaryId = iTemporaryItemUid;
-        item.iErrorCode = iStatus.Int();
-        item.iNewUid = iCreatedItemUid;
-        iCreatedItems.Append( item );
-        if ( iItemsLeftInStream > 0 )
-            {
-            CreateNextItemOnStreamL();
-            iItemsLeftInStream--;
-            LOGGER_WRITE_1("iItemsLeftInStream: %d", iItemsLeftInStream);
-            }
-        else
-            {
-            // all done
-            LOGGER_WRITE("All items added.");
-            iFileStream.Close();
-            iTemporaryItemUid = -1;
-            iCreatedItemUid = -1;
-            iSyncStatus = EItemsCreated;
-            TInt err = iFs.Delete( iFileInProgress );
-            LOGGER_WRITE_2("iFs.Delete( '%S' ) ret: %d", &iFileInProgress, err);
-            iFileInProgress = KNullDesC();
-            }
-        }
-    else if ( iSyncStatus == EReplacingItemsFromFile )
-        {
-        iReplacedItem.iErrorCode = iStatus.Int();
-        iReplacedItems.Append( iReplacedItem );
-        if ( iItemsLeftInStream > 0 )
-            {
-            ReplaceNextItemOnStreamL();
-            iItemsLeftInStream--;
-            LOGGER_WRITE_1("iItemsLeftInStream: %d", iItemsLeftInStream);
-            }
-        else
-            {
-            // all done
-            LOGGER_WRITE("All items replaced.");
-            iFileStream.Close();
-            iSyncStatus = EItemsReplaced;
-            TInt err = iFs.Delete( iFileInProgress );
-            LOGGER_WRITE_2("iFs.Delete( '%S' ) ret: %d", &iFileInProgress, err);
-            iFileInProgress = KNullDesC();
-            }
-        }
-    else if ( iSyncStatus == EDeletingAllItems )
-        {
-        iSyncStatus = EReady;
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-TInt CSconSyncHandler::RunError( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aError: %d", aError);
-    LOGGER_WRITE_1("iSyncStatus: %d", iSyncStatus);
-    TInt err( aError );
-    if ( iSyncStatus == ECreatingItemsFromFile )
-        {
-        iSyncStatus = EItemsCreated;
-        iItemsLeftInStream = 0;
-        iFileStream.Close();
-        err = iFs.Delete( iFileInProgress );
-        LOGGER_WRITE_2("iFs.Delete( '%S' ) ret: %d", &iFileInProgress, err);
-        iFileInProgress = KNullDesC();
-        err = KErrNone;
-        }
-    else if ( iSyncStatus == EReplacingItemsFromFile )
-        {
-        iSyncStatus = EItemsReplaced;
-        iItemsLeftInStream = 0;
-        iFileStream.Close();
-        err = iFs.Delete( iFileInProgress );
-        LOGGER_WRITE_2("iFs.Delete( '%S' ) ret: %d", &iFileInProgress, err);
-        iFileInProgress = KNullDesC();
-        err = KErrNone;
-        }
-    else if ( iSyncStatus == EDeletingAllItems )
-        {
-        iSyncStatus = EReady;
-        }
-    
-    TRACE_FUNC_EXIT;
-    return err;
-    }
-
-void CSconSyncHandler::Reset()
-    {
-    TRACE_FUNC_ENTRY;
-    iFileStream.Close();
-    TInt err = iFs.Delete( iFileInProgress );
-    LOGGER_WRITE_2("iFs.Delete( '%S' ) ret: %d", &iFileInProgress, err);
-    iFileInProgress = KNullDesC();
-    iSyncStatus = EReady;
-    TRACE_FUNC_EXIT;
-    }
-
-void CSconSyncHandler::SetCalendarCenrepL( TInt aProfileId, const TDesC& aServerId )
-    {
-    LOGGER_WRITE(" Write cenrep values");
-    CRepository* rep = CRepository::NewLC(KNsmlDsSessionInfoKey);
-    User::LeaveIfError( rep->Set(EDSSessionProfileId, aProfileId) );
-    User::LeaveIfError( rep->Set(EDSSessionProfileName, KNullDesC) );
-    User::LeaveIfError( rep->Set(EDSSessionServerId, aServerId) );
-    CleanupStack::PopAndDestroy(rep);
-    iCalendarCenrepUsed = ETrue;
-    }
-
-void CSconSyncHandler::ClearCalendarCenrepL()
-    {
-    if ( iCalendarCenrepUsed )
-        {
-        LOGGER_WRITE("Calendar sync, clear cenrep values");
-                
-        CRepository* rep = CRepository::NewLC(KNsmlDsSessionInfoKey);
-        rep->Set(EDSSessionProfileId, KErrNotFound);
-        rep->Set(EDSSessionProfileName, KNullDesC);
-        rep->Set(EDSSessionServerId, KNullDesC);
-        CleanupStack::PopAndDestroy(rep);
-        iCalendarCenrepUsed = EFalse;
-        }
-    }
-
--- a/connectivitymodules/SeCon/services/pcd/src/sconvideoparser.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,569 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  CSConVideoParser implementation
-*
-*/
-
-
-#include <coedef.h> 
-#include <bautils.h>
-#include <imageconversion.h>
-#include "sconvideoparser.h"
-#include "debug.h"
-
-_LIT( KMimeType, "MimeType" );
-_LIT8( KImageEncoderMimeType, "image/jpeg" );
-_LIT( KMimeTypeAudio, "audio/*" );
-_LIT( KMimeTypeVideo, "video/*" );
-
-const TInt KRequestTimeOut( 20000000 ); // 20 sec.
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::CSConVideoParser()
-// -----------------------------------------------------------------------------
-//
-CSConVideoParser::CSConVideoParser()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::~CSConVideoParser()
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSConVideoParser::~CSConVideoParser()
-    {
-    TRACE_FUNC_ENTRY;
-    delete iTimeOut;
-    if ( iVideoClip )
-        {
-        iVideoClip->CancelThumb();
-        }
-    delete iVideoClip;
-    
-    if ( iVideoUtil )
-        {
-        iVideoUtil->Close();
-        }
-    delete iVideoUtil;
-    
-    if ( iWindow )
-        {
-        iWindow->Close();
-        }
-    delete iWindow;
-    iRootWindow.Close();
-    delete iScreen;
-    iWsSession.Close();
-    
-    delete iThumbnail;
-    delete iVideoMimeType;
-    delete iAudioMimeType;
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::NewLC()
-// -----------------------------------------------------------------------------
-//
-CSConVideoParser* CSConVideoParser::NewLC()
-    {
-    CSConVideoParser* self = new (ELeave)CSConVideoParser();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::ConstructL()
-// Constructor
-// -----------------------------------------------------------------------------
-//
-void CSConVideoParser::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    User::LeaveIfError( iWsSession.Connect() );
-    
-    iScreen = new(ELeave) CWsScreenDevice( iWsSession );
-    User::LeaveIfError( iScreen->Construct() );
-    
-    iRootWindow = RWindowGroup(iWsSession);
-    User::LeaveIfError( iRootWindow.Construct(reinterpret_cast<TUint32>(&iWsSession), EFalse) );
-    
-    iWindow = new(ELeave) RWindow( iWsSession );
-    User::LeaveIfError( iWindow->Construct(iRootWindow, reinterpret_cast<TUint32>(&iRootWindow) + 1) );
-    
-    TRect temp(0,0,320,240); // dummy parameter
-    
-    iVideoUtil = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceNone, iWsSession, *iScreen, *iWindow, temp, temp);
-    
-    iTimeOut = CSconTimeOut::NewL( *this );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::OpenFileL( const RFs& aFs, const TDesC& aFileName )
-// Opens video file
-// -----------------------------------------------------------------------------
-//
-void CSConVideoParser::OpenFileL( const RFs& aFs, const TDesC& aFileName )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iVideoUtilReady = EFalse;
-    iVideoClipReady = EFalse;
-    iVideoUtilErr = KErrNone;
-    iVideoClipErr = KErrNone;
-    
-    delete iThumbnail;
-    iThumbnail = NULL;
-    delete iVideoMimeType;
-    iVideoMimeType=NULL;
-    delete iAudioMimeType;
-    iAudioMimeType=NULL;
-    
-    if ( iVideoClip )
-        {
-        iVideoClip->CancelThumb();
-        delete iVideoClip;
-        iVideoClip = NULL;
-        }
-    if ( iVideoUtil )
-        {
-        iVideoUtil->Close();
-        }
-    
-    TBool fileExist = BaflUtils::FileExists( aFs, aFileName );
-    if ( !fileExist )
-        {
-        User::Leave( KErrNotFound );
-        }
-    iAsyncStopCalled = EFalse;
-    iVideoClip = CTNEVideoClipInfo::NewL( aFileName, *this );
-    
-    iVideoUtil->OpenFileL( aFileName );
-    
-    LOGGER_WRITE("Start timeout");
-    iTimeOut->Start( KRequestTimeOut );
-    
-    LOGGER_WRITE("iWait.Start()");
-    iWait.Start();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::Thumbnail()
-// returns video thumbnail in jpg format
-// -----------------------------------------------------------------------------
-//
-const TDesC8& CSConVideoParser::Thumbnail() const
-    {
-    TRACE_FUNC;
-    if ( !iThumbnail )
-        {
-        return KNullDesC8;
-        }
-    return *iThumbnail;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::VideoFrameRateL()
-// returns video frame rate
-// -----------------------------------------------------------------------------
-//
-TReal32 CSConVideoParser::VideoFrameRateL() const
-    {
-    TRACE_FUNC;
-    if ( !iVideoUtil )
-        {
-        User::Leave( KErrNotReady );
-        }
-    return iVideoUtil->VideoFrameRateL();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::VideoFrameSizeL()
-// returns video frame size
-// -----------------------------------------------------------------------------
-//
-void CSConVideoParser::VideoFrameSizeL(TSize& aSize) const
-    {
-    TRACE_FUNC;
-    if ( !iVideoUtil )
-        {
-        User::Leave( KErrNotReady );
-        }
-    return iVideoUtil->VideoFrameSizeL( aSize );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::VideoFormatMimeTypeL()
-// returns video format
-// -----------------------------------------------------------------------------
-//
-const TDesC8& CSConVideoParser::VideoFormatMimeTypeL() const 
-    {
-    TRACE_FUNC;
-    if ( !iVideoUtil )
-        {
-        User::Leave( KErrNotReady );
-        }
-    return iVideoUtil->VideoFormatMimeType();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::VideoBitRateL()
-// returns videostream bitrate
-// -----------------------------------------------------------------------------
-//
-TInt CSConVideoParser::VideoBitRateL() const
-    {
-    TRACE_FUNC;
-    if ( !iVideoUtil )
-        {
-        User::Leave( KErrNotReady );
-        }
-    return iVideoUtil->VideoBitRateL();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::AudioBitRateL()
-// returns audiostream bitrate
-// -----------------------------------------------------------------------------
-//
-TInt CSConVideoParser::AudioBitRateL() const
-    {
-    TRACE_FUNC;
-    if ( !iVideoUtil )
-        {
-        User::Leave( KErrNotReady );
-        }
-    return iVideoUtil->AudioBitRateL();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::DurationL()
-// returns video duration in milliseconds
-// -----------------------------------------------------------------------------
-//
-TInt CSConVideoParser::DurationL() const
-    {
-    TRACE_FUNC;
-    if ( !iVideoUtil )
-        {
-        User::Leave( KErrNotReady );
-        }
-    return iVideoUtil->DurationL().Int64()/1000;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::VideoMimeTypeL()
-// returns video mime type
-// -----------------------------------------------------------------------------
-//
-const TDesC& CSConVideoParser::VideoMimeTypeL()
-    {
-    TRACE_FUNC;
-    if ( !iVideoUtil )
-        {
-        User::Leave( KErrNotReady );
-        }
-    delete iVideoMimeType;
-    iVideoMimeType = NULL;
-    
-    TInt metadataEntries = iVideoUtil->NumberOfMetaDataEntriesL();
-    LOGGER_WRITE_1( "metadataEntries: %d", metadataEntries);
-    
-    for (TInt i=0; i < metadataEntries ; i++)
-        {
-        CMMFMetaDataEntry* entry = iVideoUtil->MetaDataEntryL(i);
-        CleanupStack::PushL( entry );
-        if ( entry->Name().Compare( KMimeType ) == 0 )
-            {
-            if ( entry->Value().MatchF( KMimeTypeVideo ) == 0 )
-                {
-                LOGGER_WRITE_1( "video mimetype found: %S", &entry->Value());
-                iVideoMimeType = HBufC::NewL(entry->Value().Length());
-                TPtr videoMimeTypePtr = iVideoMimeType->Des();
-                videoMimeTypePtr.Copy( entry->Value() );
-                CleanupStack::PopAndDestroy( entry );
-                return *iVideoMimeType;
-                }
-            }
-        CleanupStack::PopAndDestroy( entry );
-        }
-    return KNullDesC;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::AudioMimeTypeL()
-// returns audio mime type
-// -----------------------------------------------------------------------------
-//
-const TDesC& CSConVideoParser::AudioMimeTypeL()
-    {
-    TRACE_FUNC;
-    if ( !iVideoUtil )
-        {
-        User::Leave( KErrNotReady );
-        }
-    delete iAudioMimeType;
-    iAudioMimeType = NULL;
-    TInt metadataEntries = iVideoUtil->NumberOfMetaDataEntriesL();
-    LOGGER_WRITE_1( "metadataEntries: %d", metadataEntries);
-    
-    for (TInt i=0; i < metadataEntries ; i++)
-        {
-        CMMFMetaDataEntry* entry = iVideoUtil->MetaDataEntryL(i);
-        CleanupStack::PushL( entry );
-        
-        if ( entry->Name().Compare( KMimeType ) == 0 )
-            {
-            if ( entry->Value().MatchF( KMimeTypeAudio ) == 0 )
-                {
-                LOGGER_WRITE_1( "video mimetype found: %S", &entry->Value());
-                iAudioMimeType = HBufC::NewL(entry->Value().Length());
-                TPtr audioMimeTypePtr = iAudioMimeType->Des();
-                audioMimeTypePtr.Copy( entry->Value() );
-                CleanupStack::PopAndDestroy( entry );
-                return *iAudioMimeType;
-                }
-            }
-        CleanupStack::PopAndDestroy( entry );
-        }
-    return KNullDesC;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::MvpuoOpenComplete( TInt aError )
-// MVideoPlayerUtilityObserver implementation
-// -----------------------------------------------------------------------------
-//
-void CSConVideoParser::MvpuoOpenComplete( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iVideoUtilReady )
-        {
-        // already timeout
-        LOGGER_WRITE("Already timeout");
-        return;
-        }
-    LOGGER_WRITE_1( "aError: %d", aError );
-    if ( aError == KErrNone )
-        {
-        iVideoUtil->Prepare();
-        }
-    else
-        {
-        iVideoUtilReady = ETrue;
-        iVideoUtilErr = aError;
-        }
-    
-    if ( iVideoUtilReady && iVideoClipReady && !iAsyncStopCalled )
-        {
-        iAsyncStopCalled = ETrue;
-        iTimeOut->Cancel();
-        LOGGER_WRITE("AsyncStop");
-        iWait.AsyncStop();
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::MvpuoPrepareComplete( TInt aError )
-// MVideoPlayerUtilityObserver implementation
-// -----------------------------------------------------------------------------
-//
-void CSConVideoParser::MvpuoPrepareComplete( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iVideoUtilReady )
-        {
-        // already timeout
-        LOGGER_WRITE("Already timeout");
-        return;
-        }
-    LOGGER_WRITE_1( "aError: %d", aError );
-    
-    iVideoUtilReady = ETrue;
-    iVideoUtilErr = aError;
-    
-    if ( iVideoUtilReady && iVideoClipReady && !iAsyncStopCalled )
-        {
-        iAsyncStopCalled = ETrue;
-        iTimeOut->Cancel();
-        LOGGER_WRITE("AsyncStop");
-        iWait.AsyncStop();
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::MvpuoFrameReady()
-// MVideoPlayerUtilityObserver implementation
-// -----------------------------------------------------------------------------
-//
-void CSConVideoParser::MvpuoFrameReady( CFbsBitmap& /*aFrame*/,TInt /*aError*/ )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::MvpuoPlayComplete()
-// MVideoPlayerUtilityObserver implementation
-// -----------------------------------------------------------------------------
-//
-void CSConVideoParser::MvpuoPlayComplete( TInt /*aError*/ )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::MvpuoEvent()
-// MVideoPlayerUtilityObserver implementation
-// -----------------------------------------------------------------------------
-//
-void CSConVideoParser::MvpuoEvent( const TMMFEvent& /*aEvent*/ )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::NotifyVideoClipInfoReady(CTNEVideoClipInfo& aInfo, TInt aError)
-// MTNEVideoClipInfoObserver implementation
-// -----------------------------------------------------------------------------
-//
-void CSConVideoParser::NotifyVideoClipInfoReady(CTNEVideoClipInfo& aInfo, TInt aError)
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iVideoClipReady )
-        {
-        // already timeout
-        LOGGER_WRITE("Already timeout");
-        return;
-        }
-    LOGGER_WRITE_1("aError: %d", aError);
-    if ( aError == KErrNone )
-        {
-        TSize resolution(320,240);
-        TRAPD( err, aInfo.GetThumbL(*this,KBestThumbIndex, &resolution ) );
-        
-        if ( err )
-            {
-            LOGGER_WRITE_1("aInfo.GetThumbL err: %d", err);
-            iVideoClipReady = ETrue;
-            iVideoClipErr = err;
-            }
-        }
-    else
-        {
-        iVideoClipReady = ETrue;
-        iVideoClipErr = aError;
-        }
-    
-    if ( iVideoUtilReady && iVideoClipReady && !iAsyncStopCalled )
-        {
-        iAsyncStopCalled = ETrue;
-        iTimeOut->Cancel();
-        LOGGER_WRITE("AsyncStop");
-        iWait.AsyncStop();
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::NotifyVideoClipThumbCompleted()
-// MTNEVideoClipInfoObserver implementation
-// -----------------------------------------------------------------------------
-//
-void CSConVideoParser::NotifyVideoClipThumbCompleted(CTNEVideoClipInfo& /*aInfo*/, 
-        TInt aError, 
-        CFbsBitmap* aThumb)
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iVideoClipReady )
-        {
-        // already timeout
-        LOGGER_WRITE("Already timeout");
-        delete aThumb;
-        return;
-        }
-    LOGGER_WRITE_1("aError: %d", aError);
-    if ( aError == KErrNone)
-        {
-        delete iThumbnail;
-        iThumbnail = NULL;
-        LOGGER_WRITE("create CImageEncoder");
-        CImageEncoder* encoder = NULL;
-        TRAPD( err, encoder = CImageEncoder::DataNewL( iThumbnail, KImageEncoderMimeType, CImageEncoder::EOptionAlwaysThread ) );
-        LOGGER_WRITE_1("err: %d", err );
-        if ( err == KErrNone )
-            {
-            LOGGER_WRITE("Start Convert");
-            TRequestStatus status;
-            encoder->Convert( &status, *aThumb, NULL );
-            
-            User::WaitForRequest( status );
-            LOGGER_WRITE_1("Convert status: %d", status.Int());
-            LOGGER_WRITE_1("buf Length: %d", iThumbnail->Length());
-            err = status.Int();
-            }
-        delete encoder;
-        }
-    delete aThumb;
-    iVideoClipReady = ETrue;
-    iVideoClipErr = aError;
-    
-    if ( iVideoUtilReady && iVideoClipReady && !iAsyncStopCalled )
-        {
-        iAsyncStopCalled = ETrue;
-        iTimeOut->Cancel();
-        LOGGER_WRITE("AsyncStop");
-        iWait.AsyncStop();
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConVideoParser::TimeOut()
-// Called when timeout has occured, cancels videoclip generation
-// -----------------------------------------------------------------------------
-//
-void CSConVideoParser::TimeOut()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !iVideoClipReady )
-        {
-        iVideoClip->CancelThumb();
-        LOGGER_WRITE("videoclip cancelled");
-        iVideoClipReady = ETrue;
-        iVideoClipErr = KErrCancel;
-        }
-    
-    if ( !iVideoUtilReady )
-        {
-        LOGGER_WRITE("videoUtil cancelled");
-        iVideoUtilReady = ETrue;
-        iVideoUtilErr = KErrCancel;
-        }
-    
-    if ( iVideoUtilReady && iVideoClipReady && !iAsyncStopCalled )
-        {
-        LOGGER_WRITE("AsyncStop");
-        iAsyncStopCalled = ETrue;
-        iWait.AsyncStop();
-        }
-    TRACE_FUNC_EXIT;
-    }
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/bld/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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:  ConML parser and generator
-*	 This file provides the information required for building the
-*    whole of a SConConMLHandler
-*
-*/
-
-
-
-PRJ_PLATFORMS
-DEFAULT 
-
-PRJ_MMPFILES
-sconconmlhandler.mmp
-
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/bld/def/bwinscwu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?CreateCSConConMLHandlerL@@YAPAVCSConConMLHandler@@XZ @ 1 NONAME ; class CSConConMLHandler * CreateCSConConMLHandlerL(void)
-
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/bld/def/eabiu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-EXPORTS
-	_Z24CreateCSConConMLHandlerLv @ 1 NONAME
-	_ZTI13CXMLWorkspace @ 2 NONAME ; #<TI>#
-	_ZTI17CSConConMLHandler @ 3 NONAME ; #<TI>#
-	_ZTV13CXMLWorkspace @ 4 NONAME ; #<VT>#
-	_ZTV17CSConConMLHandler @ 5 NONAME ; #<VT>#
-
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/bld/sconconmlhandler.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-* 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:  ConML Parser and generator
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-VENDORID        VID_DEFAULT
-CAPABILITY      CAP_GENERAL_DLL
-
-TARGETPATH      sys/bin
-
-TARGET          sconconmlhandler.dll
-TARGETTYPE      DLL
-UID             0x10009D8D 0x101F99FA
-
-#if defined(ARMCC)
-DEFFILE	./def/eabi
-#elif defined(WINSCW) 
-DEFFILE	./def/bwinscw
-#elif defined(WINS)
-DEFFILE	./def/bwins
-#elif defined(ARM)
-DEFFILE	./def/bmarm
-#endif
-
-SOURCEPATH      ../src
-SOURCE          sconconmlhandler.cpp
-SOURCE          sconxmlelement.cpp
-SOURCE          sconconmlgenerator.cpp
-SOURCE          sconconmldtd.cpp
-SOURCE          sconxmlworkspace.cpp
-
-USERINCLUDE     ../inc
-USERINCLUDE     ../../../inc
-
-// Default system include paths.
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE   /epoc32/include/libc
-
-LIBRARY         euser.lib
-LIBRARY         estor.lib
-DEBUGLIBRARY    flogger.lib
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmldtd.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,750 +0,0 @@
-/*
-* Copyright (c) 2005-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:  ConML parser/generator
-*
-*/
-
-
-#ifndef __SCONCONMLDTD_H__
-#define __SCONCONMLDTD_H__
-
-#include "sconxmlelement.h"
-
-typedef void *voidPtr_t;
-typedef long memSize_t;
-
-typedef enum 
-    {
-    SML_PCDATA_UNDEFINED = 0,
-    SML_PCDATA_STRING,                   // String type
-    SML_PCDATA_OPAQUE,                   // Opaque type
-    SML_PCDATA_EXTENSION,                // Extention type
-    SML_PCDATA_CDATA                     // XML CDATA type   
-    } pcdataType_t;
-
-typedef enum 
-    {
-    SML_EXT_UNDEFINED = 0,
-    } pcdataExtension_t;
-
-// -----------------------------------------------------------------------------
-// GenericListAddL
-// -----------------------------------------------------------------------------
-template<class T>
-void GenericListAddL( T* aList, T aNewItem )
-    {
-    if( *aList == 0 )
-        {
-        *aList = aNewItem;
-        }
-    else
-        {
-        T c;
-        for( c = *aList; c->next; c = c->next )
-            {}; 
-        c->next = aNewItem;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// pcdata_s
-// -----------------------------------------------------------------------------
-typedef NONSHARABLE_STRUCT( pcdata_s ) : public CXMLElement
-    {
-public:
-    pcdataType_t      contentType;   // The type of data 
-    pcdataExtension_t  extension;     // PCData Extension type
-    memSize_t             length;        // length of the data 
-    voidPtr_t             content;       // Pointer to the data itself
-public:
-    pcdata_s();
-    ~pcdata_s();
-    pcdata_s( const pcdataType_t aType, 
-        const pcdataExtension_t aExt =  SML_EXT_UNDEFINED );
-    void FreeContent();
-    void SetDataL( const TDesC8& aData );
-    TPtrC8 Data() const;
-    void TruncateL( TInt aConsumed );
-    } *pcdataPtr_t, pcdata_t;
-
-// -----------------------------------------------------------------------------
-// pcdata_list_s
-// -----------------------------------------------------------------------------
-typedef NONSHARABLE_STRUCT( pcdata_list_s ) : public CBase
-    {
-    pcdataPtr_t data;
-    struct pcdata_list_s *next;
-
-    pcdata_list_s();
-    ~pcdata_list_s();
-    } *pcdataListPtr_t, pcdataList_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Param_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Param_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t name;
-    pcdataPtr_t value;
-public:
-    ConML_Param_s();
-    ~ConML_Param_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );    
-    }*ConML_ParamPtr_t, ConML_Param_t;
-
-// -----------------------------------------------------------------------------
-// ConML_ParamList_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_ParamList_s ) : public CBase
-    {
-public:
-    ConML_ParamPtr_t data;
-    struct ConML_ParamList_s *next;
-public:
-    ConML_ParamList_s();
-    ~ConML_ParamList_s();
-    }*ConML_ParamListPtr_t, ConML_ParamList_t;  
-    
-// -----------------------------------------------------------------------------
-// ConML_InstParams_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_InstParams_s ) : public CXMLElement
-    {
-public:
-    ConML_ParamListPtr_t param;
-public:
-    ConML_InstParams_s();
-    ~ConML_InstParams_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_InstParamsPtr_t, ConML_InstParams_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Progress_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Progress_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t value;
-public:
-    ConML_Progress_s();
-    ~ConML_Progress_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );    
-    }*ConML_ProgressPtr_t, ConML_Progress_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Application_s
-// -----------------------------------------------------------------------------        
-typedef NONSHARABLE_STRUCT( ConML_Application_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t name;
-    pcdataPtr_t uid;
-public:
-    ConML_Application_s();
-    ~ConML_Application_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_ApplicationPtr_t, ConML_Application_t;
-
-// -----------------------------------------------------------------------------
-// ConML_ApplicationList_s
-// -----------------------------------------------------------------------------        
-    
-typedef NONSHARABLE_STRUCT( ConML_ApplicationList_s ) : public CBase
-    {
-public:
-    ConML_ApplicationPtr_t data;
-    struct ConML_ApplicationList_s *next;
-public:
-    ConML_ApplicationList_s();
-    ~ConML_ApplicationList_s();
-    }*ConML_ApplicationListPtr_t, ConML_ApplicationList_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Applications_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Applications_s ) : public CXMLElement
-    {
-public:
-    ConML_ApplicationListPtr_t application;
-    
-public:
-    ConML_Applications_s();
-    ~ConML_Applications_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_ApplicationsPtr_t, ConML_Applications_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Drive_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Drive_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t name;
-public:
-    ConML_Drive_s();
-    ~ConML_Drive_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_DrivePtr_t, ConML_Drive_t;
-
-// -----------------------------------------------------------------------------
-// ConML_DriveList_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_DriveList_s ) : public CBase
-    {
-public:
-    ConML_DrivePtr_t data;
-    struct ConML_DriveList_s *next;
-public:
-    ConML_DriveList_s();
-    ~ConML_DriveList_s();
-    }*ConML_DriveListPtr_t, ConML_DriveList_t;
-    
-// -----------------------------------------------------------------------------
-// ConML_Drives_s
-// -----------------------------------------------------------------------------        
-typedef NONSHARABLE_STRUCT( ConML_Drives_s ) : public CXMLElement
-    {
-public:
-    ConML_DriveListPtr_t drive;
-public:
-    ConML_Drives_s();
-    ~ConML_Drives_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_DrivesPtr_t, ConML_Drives_t;
-
-// -----------------------------------------------------------------------------
-// ConML_BUROptions_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_BUROptions_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t requiresReboot;
-    pcdataPtr_t hasFiles;
-    pcdataPtr_t supportsInc;
-    pcdataPtr_t delayToPrepareData;
-public:
-    ConML_BUROptions_s();
-    ~ConML_BUROptions_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_BUROptionsPtr_t, ConML_BUROptions_t;
-
-// -----------------------------------------------------------------------------
-// ConML_PackageInfo_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_PackageInfo_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t name;
-public:
-    ConML_PackageInfo_s();
-    ~ConML_PackageInfo_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_PackageInfoPtr_t, ConML_PackageInfo_t;
-
-// -----------------------------------------------------------------------------
-// ConML_SID_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_SID_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t type;
-    pcdataPtr_t uid;
-    ConML_DrivesPtr_t drives;
-    ConML_PackageInfoPtr_t packageInfo;
-    ConML_BUROptionsPtr_t burOptions;
-    pcdataPtr_t size;
-    pcdataPtr_t transferDataType;
-    pcdataPtr_t data;
-    pcdataPtr_t moreData;
-    pcdataPtr_t dataOwnerStatus;
-    
-public:
-    ConML_SID_s();
-    ~ConML_SID_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );    
-    }*ConML_SIDPtr_t, ConML_SID_t;
-
-// -----------------------------------------------------------------------------
-// ConML_SIDList_s
-// -----------------------------------------------------------------------------
-typedef NONSHARABLE_STRUCT( ConML_SIDList_s ) : public CBase
-    {
-public:
-    ConML_SIDPtr_t data;
-    struct ConML_SIDList_s *next;
-public:
-    ConML_SIDList_s();
-    ~ConML_SIDList_s();
-    }*ConML_SIDListPtr_t, ConML_SIDList_t;
-    
-// -----------------------------------------------------------------------------
-// ConML_SupportedMethods_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_SupportedMethods_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t install;
-    pcdataPtr_t unInstall;
-    pcdataPtr_t setInstParams;
-    pcdataPtr_t listInstalledApps;
-    pcdataPtr_t listDataOwners;
-    pcdataPtr_t setBurMode;
-    pcdataPtr_t getDataSize;
-    pcdataPtr_t requestData;
-    pcdataPtr_t supplyData;
-    pcdataPtr_t reboot;
-public:
-    ConML_SupportedMethods_s();
-    ~ConML_SupportedMethods_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_SupportedMethodsPtr_t, ConML_SupportedMethods_t;
-    
-// -----------------------------------------------------------------------------
-// ConML_DeviceInfo_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_DeviceInfo_s ) : public CXMLElement
-        {
-public:
-    pcdataPtr_t version;
-    ConML_SupportedMethodsPtr_t supportedMethods;
-    pcdataPtr_t maxObjectSize;
-public:
-    ConML_DeviceInfo_s();
-    ~ConML_DeviceInfo_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );    
-    }*ConML_DeviceInfoPtr_t, ConML_DeviceInfo_t;
-
-// -----------------------------------------------------------------------------
-// ConML_File_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_File_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t name;
-    pcdataPtr_t modified;
-    pcdataPtr_t size;
-    pcdataPtr_t userPerm;
-public:
-    ConML_File_s();
-    ~ConML_File_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );    
-    }*ConML_FilePtr_t, ConML_File_t;
-
-// -----------------------------------------------------------------------------
-// ConML_FileList_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_FileList_s ) : public CBase
-    {
-public:
-    ConML_FilePtr_t data;
-    struct ConML_FileList_s *next;
-public:
-    ConML_FileList_s();
-    ~ConML_FileList_s();
-    }*ConML_FileListPtr_t, ConML_FileList_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Files_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Files_s ) : public CXMLElement
-    {
-public:
-    ConML_FileListPtr_t  file;
-public:
-    ConML_Files_s();
-    ~ConML_Files_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_FilesPtr_t, ConML_Files_t;
-    
-// -----------------------------------------------------------------------------
-// ConML_DataOwners_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_DataOwners_s ) : public CXMLElement
-    {
-public:
-    ConML_SIDListPtr_t sid;
-public:
-    ConML_DataOwners_s();
-    ~ConML_DataOwners_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );    
-    }*ConML_DataOwnersPtr_t, ConML_DataOwners_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Results_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Results_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t complete;
-    ConML_ProgressPtr_t  progress;
-    ConML_ApplicationsPtr_t applications;
-    ConML_DataOwnersPtr_t dataOwners;
-    pcdataPtr_t filename;
-    pcdataPtr_t moreData;
-    pcdataPtr_t data;
-    ConML_DeviceInfoPtr_t deviceInfo;
-    ConML_FilesPtr_t files; 
-public:
-    ConML_Results_s();
-    ~ConML_Results_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );    
-    }*ConML_ResultsPtr_t, ConML_Results_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Install_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Install_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t name;
-    ConML_InstParamsPtr_t  instParams;
-    ConML_ResultsPtr_t results; 
-public:
-    ConML_Install_s();
-    ~ConML_Install_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_InstallPtr_t, ConML_Install_t;
-
-// -----------------------------------------------------------------------------
-// ConML_UnInstall_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_UnInstall_s ) : public CXMLElement
-    {
-public:
-    ConML_ApplicationsPtr_t applications;
-    ConML_InstParamsPtr_t instParams;
-    ConML_ResultsPtr_t results;
-public:
-    ConML_UnInstall_s();
-    ~ConML_UnInstall_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_UnInstallPtr_t, ConML_UnInstall_t;
-
-// -----------------------------------------------------------------------------
-// ConML_ListInstalledApps_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_ListInstalledApps_s ) : public CXMLElement
-    {
-public:
-    ConML_DrivesPtr_t drives;
-    pcdataPtr_t all;
-    ConML_ResultsPtr_t results;
-public:
-    ConML_ListInstalledApps_s();
-    ~ConML_ListInstalledApps_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_ListInstalledAppsPtr_t, ConML_ListInstalledApps_t;
-    
-// -----------------------------------------------------------------------------
-// ConML_ListDataOwners_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_ListDataOwners_s ) : public CXMLElement
-    {
-public:
-    ConML_ResultsPtr_t results;
-public:
-    ConML_ListDataOwners_s();
-    ~ConML_ListDataOwners_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_ListDataOwnersPtr_t, ConML_ListDataOwners_t;
-
-// -----------------------------------------------------------------------------
-// ConML_SetBURMode_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_SetBURMode_s ) : public CXMLElement
-    {
-public:
-    ConML_DrivesPtr_t drives;
-    pcdataPtr_t partialType;
-    pcdataPtr_t incType;
-    ConML_ResultsPtr_t results;
-public:
-    ConML_SetBURMode_s();
-    ~ConML_SetBURMode_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_SetBURModePtr_t, ConML_SetBURMode_t;
-
-// -----------------------------------------------------------------------------
-// ConML_GetDataSize_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_GetDataSize_s ) : public CXMLElement
-    {
-public:
-    ConML_DataOwnersPtr_t dataOwners;
-    ConML_ResultsPtr_t results;
-public:
-    ConML_GetDataSize_s();
-    ~ConML_GetDataSize_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_GetDataSizePtr_t, ConML_GetDataSize_t;
-
-// -----------------------------------------------------------------------------
-// ConML_RequestData_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_RequestData_s ) : public CXMLElement
-    {
-public:
-    ConML_SIDListPtr_t sid;
-    ConML_ResultsPtr_t results;
-public:
-    ConML_RequestData_s();
-    ~ConML_RequestData_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_RequestDataPtr_t, ConML_RequestData_t;
-
-// -----------------------------------------------------------------------------
-// ConML_UpdateDeviceInfo_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_UpdateDeviceInfo_s ) : public CXMLElement
-    {
-public:
-    ConML_DeviceInfoPtr_t deviceInfo;
-    ConML_ResultsPtr_t results;
-public:
-    ConML_UpdateDeviceInfo_s();
-    ~ConML_UpdateDeviceInfo_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );    
-    }*ConML_UpdateDeviceInfoPtr_t, ConML_UpdateDeviceInfo_t;
-
-// -----------------------------------------------------------------------------
-// ConML_ListPublicFiles_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_ListPublicFiles_s ) : public CXMLElement
-    {
-public:
-    ConML_ResultsPtr_t results;
-    ConML_SIDListPtr_t sid;
-public:
-    ConML_ListPublicFiles_s();
-    ~ConML_ListPublicFiles_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );    
-    }*ConML_ListPublicFilesPtr_t, ConML_ListPublicFiles_t;
-
-// -----------------------------------------------------------------------------
-// ConML_SupplyData_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_SupplyData_s ) : public CXMLElement
-    {
-public:
-    ConML_SIDListPtr_t sid;
-    ConML_ResultsPtr_t results;
-public:
-    ConML_SupplyData_s();
-    ~ConML_SupplyData_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_SupplyDataPtr_t, ConML_SupplyData_t;
-
-// -----------------------------------------------------------------------------
-// ConML_GetDataOwnerStatus_s
-// -----------------------------------------------------------------------------        
-typedef NONSHARABLE_STRUCT( ConML_GetDataOwnerStatus_s ) : public CXMLElement
-    {
-public:
-    ConML_DataOwnersPtr_t dataOwners;
-    ConML_ResultsPtr_t results;
-public:
-    ConML_GetDataOwnerStatus_s();
-    ~ConML_GetDataOwnerStatus_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_GetDataOwnerStatusPtr_t, ConML_GetDataOwnerStatus_t;
-
-// -----------------------------------------------------------------------------
-// ConML_GetMetadata_s
-// -----------------------------------------------------------------------------
-typedef NONSHARABLE_STRUCT( ConML_GetMetadata_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t filename;
-    ConML_ResultsPtr_t results;
-public:
-    ConML_GetMetadata_s();
-    ~ConML_GetMetadata_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_GetMetadataPtr_t, ConML_GetMetadata_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Execute_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Execute_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t id;
-    ConML_InstallPtr_t install;
-    ConML_UnInstallPtr_t  unInstall;
-    ConML_ListInstalledAppsPtr_t listInstalledApps;
-    ConML_ListDataOwnersPtr_t listDataOwners;
-    ConML_SetBURModePtr_t setBurMode;
-    ConML_GetDataSizePtr_t getDataSize;
-    ConML_RequestDataPtr_t requestData;
-    ConML_UpdateDeviceInfoPtr_t updateDeviceInfo;
-    ConML_ListPublicFilesPtr_t listPublicFiles;
-    ConML_SupplyDataPtr_t supplyData;
-    pcdataPtr_t reboot;
-    ConML_GetDataOwnerStatusPtr_t getDataOwnerStatus;
-    ConML_GetMetadataPtr_t getMetadata;
-public:
-    ConML_Execute_s();
-    ~ConML_Execute_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_ExecutePtr_t, ConML_Execute_t;
-    
-// -----------------------------------------------------------------------------
-// ConML_GetStatus_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_GetStatus_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t id;
-    pcdataPtr_t all;
-public:
-    ConML_GetStatus_s();
-    ~ConML_GetStatus_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_GetStatusPtr_t, ConML_GetStatus_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Cancel_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Cancel_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t id;
-    pcdataPtr_t all;
-public:
-    ConML_Cancel_s();
-    ~ConML_Cancel_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_CancelPtr_t, ConML_Cancel_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Reboot_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Reboot_s ) : public CXMLElement
-    {
-public:
-    ConML_ResultsPtr_t results;
-public:
-    ConML_Reboot_s();
-    ~ConML_Reboot_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    }*ConML_RebootPtr_t, ConML_Reboot_t;
-    
-// -----------------------------------------------------------------------------
-// ConML_Task_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Task_s ) : public CXMLElement
-    {
-public:
-    pcdataPtr_t id;
-    ConML_InstallPtr_t install;
-    ConML_UnInstallPtr_t unInstall;
-    ConML_ListInstalledAppsPtr_t listInstalledApps;
-    ConML_ListDataOwnersPtr_t listDataOwners;
-    ConML_SetBURModePtr_t setBurMode;
-    ConML_GetDataSizePtr_t getDataSize;
-    ConML_RequestDataPtr_t requestData;
-    ConML_UpdateDeviceInfoPtr_t updateDeviceInfo;
-    ConML_ListPublicFilesPtr_t listPublicFiles;
-    ConML_GetDataOwnerStatusPtr_t getDataOwnerStatus;
-    ConML_SupplyDataPtr_t supplyData;
-    ConML_RebootPtr_t reboot;
-    ConML_GetMetadataPtr_t getMetadata;
-public:
-    ConML_Task_s();
-    ~ConML_Task_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );    
-    }*ConML_TaskPtr_t, ConML_Task_t;
-
-// -----------------------------------------------------------------------------
-// ConML_TaskList_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_TaskList_s ) : public CBase
-    {
-public:
-    ConML_TaskPtr_t data;
-    struct ConML_TaskList_s *next;
-public:
-    ConML_TaskList_s();
-    ~ConML_TaskList_s();
-    }*ConML_TaskListPtr_t, ConML_TaskList_t;
-
-// -----------------------------------------------------------------------------
-// ConML_Status_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_Status_s ) : public CXMLElement
-    {
-public:
-    ConML_TaskListPtr_t task;
-public:
-    ConML_Status_s();
-    ~ConML_Status_s();
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );    
-    }*ConML_StatusPtr_t, ConML_Status_t;
-
-// -----------------------------------------------------------------------------
-// ConML_ConML_s
-// -----------------------------------------------------------------------------    
-typedef NONSHARABLE_STRUCT( ConML_ConML_s ) : public CXMLElement
-    {
-public:
-    ConML_ExecutePtr_t execute;
-    ConML_GetStatusPtr_t getStatus;
-    ConML_CancelPtr_t cancel;
-    ConML_StatusPtr_t status;   
-        
-public:
-    ConML_ConML_s();
-    ~ConML_ConML_s();
-    TBool NeedsCleanup() const;
-    CXMLElement* BeginElementL
-        ( TUint8 aTag, const TXMLElementParams& aParams = TXMLElementParams() );
-    CXMLElement::TAction EndElementL( TAny* aCallbacks, TUint8 aTag );
-    } *ConML_ConMLPtr_t, ConML_ConML_t;
-                                                                                    
-#endif // __SCONCONMLDTD_H__
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmlgenerator.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,232 +0,0 @@
-/*
-* Copyright (c) 2005-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:  ConML parser/generator
-*
-*/
-
-
-#ifndef __SCONCONMLGENERATOR_H__
-#define __SCONCONMLGENERATOR_H__
-
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-#include "sconxmlelement.h"
-#include "sconconmldtd.h"
-#include "sconconmltags.h"
-#include "sconwbxmldefs.h"
-#include "sconxmlworkspace.h"
-
-// -----------------------------------------------------------------------------
-// MWBXMLConMLCallback - Call back for parsed data
-// -----------------------------------------------------------------------------
-class MWBXMLConMLCallback
-    {
-public:
-     /**
-    * Call back function for delivering the parsed data
-    * @param aContent contains the parsed data
-    * @return none
-    */
-
-    virtual void ConMLL( ConML_ConMLPtr_t aContent ) = 0;
-    };
-
-// -----------------------------------------------------------------------------
-// TWBXMLContentFormat
-// -----------------------------------------------------------------------------
-enum TWBXMLContentFormat
-    {
-    EWBXMLContentFormatOpaque,
-    EWBXMLContentFormatInlineString
-    };
-    
-// -----------------------------------------------------------------------------
-// CSConConMLGenerator - Generates XBXML and XML documents
-// -----------------------------------------------------------------------------
-NONSHARABLE_CLASS( CSConConMLGenerator ) : public CBase
-    {
-public:
-
-    static CSConConMLGenerator* NewL();
-    ~CSConConMLGenerator();
-        
-    /**
-    * Returns the generated WBXML document
-    * @param none 
-    * @return the document as TPtrC8
-    */
-    TPtrC8 WBXMLDocument();
-
-    /**
-    * Returns the generated XML document
-    * @param none 
-    * @return the document as TPtrC8
-    */
-    TPtrC8 XMLDocument();
-    
-    
-    // WBXML Parser
-    
-    /**
-    * Sets the callback function to call after parsing
-    * @param aCallback callback function to call when parsing finished
-    * @return none
-    */
-    void SetCallback ( MWBXMLConMLCallback* aCallbakc );
-    
-    /**
-    * Starts the document after header has been parsed 
-    * @param aVersion - version of WBXML document
-    * @param aPublicId - public ID of WBXML document as known public ID
-    * @param aCharset - Character set of WBXML document
-    * @return none
-    */
-    void StartDocument( TUint8 aVersion, TInt32 aPublicId, TUint32 aCharset );
-
-    /**
-    * Starts the document after header has been parsed 
-    * @param aVersion - version of WBXML document
-    * @param aPublicIdStr - public ID of WBXML document as a inline string 
-    * @param aCharset - Character set of WBXML document
-    * @return none
-    */
-    void StartDocument( 
-        TUint8 aVersion, const TDesC8& aPublicIdStr, TUint32 aCharset );
-    
-    /**
-    * Starts a new element in the document
-    * @param aTag - Tag of the element
-    * @return none
-    */
-    void StartElementL( TWBXMLTag aTag );
-
-    /**
-    * Starts a character data in the document
-    * @param aBuffer - Character data
-    * @return none
-    */
-    void CharactersL( const TDesC8& aBuffer );
-
-    /**
-    * Document has been parsed - the end of document
-    * @param none
-    * @return none
-    */
-    void EndDocument();
-        
-    /**
-    * End tag of an element has been found
-    * @param aTag - tag of the element to be closed 
-    * @return none
-    */
-    void EndElementL( TWBXMLTag aTag );
-    
-    // Generator
-    
-    /**
-    * Starts the generation of a document
-    * @param aContent - data for the document
-    * @return none
-    */
-    TInt GenerateConMLDocument ( ConML_ConMLPtr_t aContent );
-
-private:
-
-    // WBXML Generator
-    void WriteMUint32L( TUint32 aValue );
-    void WriteOpaqueDataL( const TDesC8& aData );
-    void WriteInlineStringL( const TDesC8& aData );
-    
-    // XML Generator
-    void IndentL();
-    TPtrC8 TranslateElement( TUint8 aElement );
-
-    // WBXML / XML Generator
-    void BeginDocumentL( TUint8 aVersion, TInt32 aPublicId, TUint32 aCharset, 
-        const TDesC8& aStringTbl = TPtrC8() );
-    void BeginElementL( TUint8 aElement, TBool aHasContent = EFalse, 
-        TBool aHasAttributes = EFalse );
-    void EndElementL();
-    void AddElementL( 
-        TUint8 aElement, const TDesC8& aContent, 
-        const TWBXMLContentFormat aFormat = EWBXMLContentFormatOpaque );
-    void AppendPCDataL( TUint8 aElement, pcdataPtr_t aContent );
-    void AppendConMLL( ConML_ConMLPtr_t aContent );
-    void AppendExecuteL( ConML_ExecutePtr_t aContent );
-    void AppendSupplyDataL( ConML_SupplyDataPtr_t aContent );
-    void AppendInstallL( ConML_InstallPtr_t aContent );
-    void AppendCancelL ( ConML_CancelPtr_t aContent );
-    void AppendStatusL ( ConML_StatusPtr_t aContent );
-    void AppendGetStatusL( ConML_GetStatusPtr_t aContent );
-    void AppendRebootL( ConML_RebootPtr_t aContent );
-    void AppendTaskL( ConML_TaskPtr_t aContent );
-    void AppendTaskListL( ConML_TaskListPtr_t aContent );
-    void AppendUnInstallL( ConML_UnInstallPtr_t aContent );
-    void AppendListInstalledAppsL ( ConML_ListInstalledAppsPtr_t aContent );
-    void AppendListDataOwnersL ( ConML_ListDataOwnersPtr_t aContent );
-    void AppendBUROptionsL( ConML_BUROptionsPtr_t aContent );
-    void AppendSetBURModeL( ConML_SetBURModePtr_t aContent );
-    void AppendGetDataSizeL( ConML_GetDataSizePtr_t aContent );
-    void AppendRequestDataL( ConML_RequestDataPtr_t aContent );
-    void AppendUpdateDeviceInfoL( ConML_UpdateDeviceInfoPtr_t aContent );
-    void AppendListPublicFilesL( ConML_ListPublicFilesPtr_t aContent );
-    void AppendApplicationL( ConML_ApplicationPtr_t aContent );
-    void AppendApplicationListL( ConML_ApplicationListPtr_t aContent );
-    void AppendApplicationsL( ConML_ApplicationsPtr_t aContent );
-    void AppendParamL( ConML_ParamPtr_t aContent );
-    void AppendParamListL( ConML_ParamListPtr_t aContent );
-    void AppendInstParamsL( ConML_InstParamsPtr_t aContent );
-    void AppendProgressL( ConML_ProgressPtr_t aContent );
-    void AppendResultsL( ConML_ResultsPtr_t aContent );
-    void AppendDriveL( ConML_DrivePtr_t aContent );
-    void AppendDriveListL( ConML_DriveListPtr_t aContent );
-    void AppendDrivesL( ConML_DrivesPtr_t aContent );
-    void AppendDataOwnersL( ConML_DataOwnersPtr_t aContent );
-    void AppendPackageInfoL ( ConML_PackageInfoPtr_t aContent );
-    void AppendSIDL( ConML_SIDPtr_t aContent );
-    void AppendSIDListL( ConML_SIDListPtr_t aContent );
-    void AppendDeviceInfoL( ConML_DeviceInfoPtr_t aContent );
-    void AppendFilesL( ConML_FilesPtr_t aContent );
-    void AppendSupportedMethodsL( ConML_SupportedMethodsPtr_t aContent );
-    void AppendFileListL( ConML_FileListPtr_t  aContent );
-    void AppendFileL( ConML_FilePtr_t aContent );
-    void AppendGetDataOwnerStatusL( ConML_GetDataOwnerStatusPtr_t aContent );
-    void AppendGetMetadataL( ConML_GetMetadataPtr_t aContent );
-    
-    TInt HandleResult( TInt aResult, TInt aTreshold = 0 );
-    
-private:
-    void ConstructL();
-    CSConConMLGenerator();
-    void AddElementL( CXMLElement* aElement );
-
-private:
-    // Parser
-    CXMLStack<CXMLElement>* iCmdStack;
-    CXMLStack<CXMLElement>* iCleanupStack;
-    MWBXMLConMLCallback* iCallback;
-
-    // Generator workspaces 
-    CXMLWorkspace* iWBXMLWorkspace;
-    CXMLWorkspace* iXMLWorkspace;
-
-    // XML
-    RArray<TUint8> iElemStack;
-    TInt iInitialIndentLevel;
-    TBool iDontNewLine;
-    TBool iDontIndent;
-    }; 
-
-#endif // __SCONCONMLGENERATOR_H__
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmlhandler.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
-* Copyright (c) 2005-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:  ConML parser/generator
-*
-*/
-
-
-#ifndef _SCONCONMLHANDLER_H
-#define _SCONCONMLHANDLER_H
-
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-#include "sconconmlgenerator.h"
-#include "sconwbxmldefs.h"
-#include "sconconmlhandlererror.h"
-#include "sconconmldtd.h"
-
-// -----------------------------------------------------------------------------
-// Definitions and constants
-// -----------------------------------------------------------------------------
-
-_LIT8(KWBXMLNull, "\x00");
-
-const TInt KSConBufferGranularity( 32 );
-const TInt KSConDefaultDocumentSize( 2048 );
-
-// -----------------------------------------------------------------------------
-// TWBXMLStackItem
-// -----------------------------------------------------------------------------
-NONSHARABLE_STRUCT( TWBXMLStackItem )
-    {
-public:
-    inline TWBXMLStackItem( TUint8 aTag );
-    inline TUint8 Tag() const;
-
-private:
-    TUint8 iTag;
-    };
-
-#include "sconwbxmlparser.inl"
-
-// -----------------------------------------------------------------------------
-// CSConConMLHandler - WBXML parsing
-// -----------------------------------------------------------------------------
-class CSConConMLHandler : public CBase
-    {
-public:
-    static CSConConMLHandler* NewL();
-    ~CSConConMLHandler();
-    
-    /**
-    * Starts the parsing of a WBXML document
-    * @param aInput - the WBXML document to be parsed
-    * @param aCallback - Call back function to call 
-    * after the document is parsed
-    * @return An error code
-    */
-    virtual TInt ParseDocumentL( CBufFlat& aInput,  
-        MWBXMLConMLCallback* aCallback  );
-    
-    /**
-    * Starts the generating of a WBXML and XML document
-    * @param aContent - the data to be generated into the document
-    * @return An error code
-    */
-    virtual TInt GenerateDocument( ConML_ConMLPtr_t aContent );
-    
-    /**
-    * Returns the generated document in XML -format
-    * @param none
-    * @return The document as TPtrC8
-    */
-    virtual TPtrC8 XMLDocument();
-    
-    /**
-    * Returns the generated document in WBXML -format
-    * @param none
-    * @return The document as TPtrC8
-    */
-    virtual TPtrC8 WBXMLDocument();
-    
-private:
-    CSConConMLHandler();
-    void ConstructL();
-    
-    TInt ParseL();
-    TConMLParserError DoParseDocumentHeaderL();
-    TConMLParserError DoParseDocumentBodyL();
-    TUint8 ReadUint8L();
-    TUint32 ReadMUint32L();
-    TPtrC8 ReadStrIL();
-    TPtrC8 StringTableString( TUint32 aIndex );
-    void ReadStringTableL();    
-    TPtrC8 ReadOpaqueL();
-    void HandleElementL( TUint8 aId );
-    
-private:
-    CSConConMLGenerator* iGenerator;
-    HBufC8* iStringTable;
-    CBufBase* iBuffer;
-    TBool iHeaderParsed;
-    RArray< TUint > iElemStack;
-    TInt iPos;
-    CBufFlat* iParseBuffer;
-    MWBXMLConMLCallback* iCallback;
-    };
-
-    IMPORT_C CSConConMLHandler* CreateCSConConMLHandlerL();
-    typedef CSConConMLHandler* (*TSConCreateCSConConMLHandlerFunc) (); 
-    
-#endif
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmlhandlererror.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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:  ConML parser/generator
-*
-*/
-
-
-#ifndef __SCONCONMLHANDLERERROR_H__
-#define __SCONCONMLHANDLERERROR_H__
-
-// -----------------------------------------------------------------------------
-// Parser error base
-// -----------------------------------------------------------------------------
-
-#define PERRBASE 0x2000
-
-enum TConMLParserError
-	{
-	KWBXMLParserErrorOk = 0,
-	KWBXMLParserErrorEof = PERRBASE,
-	KWBXMLParserErrorEofTooEarly,
-	KWBXMLParserErrorInvalidTag,
-	KWBXMLParserErrorWrongWBXMLVersion,
-	KWBXMLParserErrorWrongPublicId,
-	KWBXMLParserErrorinvalidDocument
-	};
-
-#define GERRBASE 0x3000
-
-enum TWBXMLGeneratorError
-	{
-	KWBXMLGeneratorOk = 0,
-	KWBXMLGeneratorBufferFull = GERRBASE
-	};
-	
-#endif // __SCONCONMLHANDLERERROR_H__
\ No newline at end of file
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmltags.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
-* Copyright (c) 2005-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:  ConML parser/generator
-*
-*/
-
-
-
-#ifndef __SCONCONMLTAGS_H__
-#define __SCONCONMLTAGS_H__
-
-// -----------------------------------------------------------------------------
-// Constants
-// -----------------------------------------------------------------------------
-const TInt32 KSConConMLPublicId = 0x8F;
-const TUint8 KSConConMLVersion = 0x02;
-const TUint32 KSConConMLUTF8 = 0x6a;
-
-_LIT8(KSConConMLPublicIdStr, "-//CONML//DTD ConML 1.0//EN");
-
-// -----------------------------------------------------------------------------
-// TConMLTags
-// -----------------------------------------------------------------------------
-enum TConMLTags
-    {
-        EConMLAll = 5,
-        EConMLApplication,
-        EConMLApplications,
-        EConMLBUROptions,
-        EConMLCancel,
-        EConMLComplete,
-        EConML,
-        EConMLData,
-        EConMLDataOwners,
-        EConMLDataOwnerStatus,
-        EConMLDelayToPrepareData,
-        EConMLDeviceInfo,
-        EConMLDrive,
-        EConMLDrives,
-        EConMLExecute,
-        EConMLFile,
-        EConMLFiles,
-        EConMLGetDataOwnerStatus,
-        EConMLGetDataSize,
-        EConMLGetStatus,
-        EConMLHasFiles,
-        EConMLID,
-        EConMLIncType,
-        EConMLInstall,
-        EConMLInstParams,
-        EConMLListDataOwners,
-        EConMLListInstalledApps,
-        EConMLListPublicFiles,
-        EConMLMaxObjectSize,
-        EConMLModified,
-        EConMLMoreData,
-        EConMLName,
-        EConMLPackageInfo,
-        EConMLParam,
-        EConMLPartialType,
-        EConMLProgress,
-        EConMLReboot,
-        EConMLRequestData,
-        EConMLRequiresReboot,
-        EConMLResults,
-        EConMLSetBURMode,
-        EConMLSetInstParams,
-        EConMLSID,
-        EConMLSize,
-        EConMLStatus,
-        EConMLSupplyData,
-        EConMLSupportedMethods,
-        EConMLSupportsInc,
-        EConMLTask,
-        EConMLTransferDataType,
-        EConMLType,
-        EConMLUID,
-        EConMLUnInstall,
-        EConMLUpdateDeviceInfo,
-        EConMLUserPerm,
-        EConMLValue,
-        EConMLVersion,
-        EConMLGetMetadata,
-        EConMLFilename
-        };
-// -----------------------------------------------------------------------------
-_LIT8( KConMLElements, 
-       "<0>|<1>|<2>|<3>|<4>|All|Application|Applications|BUROptions|Cancel"
-       "|Complete|ConML|Data|DataOwners|DataOwnerStatus|DelayToPrepareData"
-       "|DeviceInfo|Drive|Drives|Execute|File|Files|GetDataOwnerStatus"
-       "|GetDataSize|GetStatus|HasFiles|ID|IncType|Install|InstParams"
-       "|ListDataOwners|ListInstalledApps|ListPublicFiles|MaxObjectSize|"
-       "Modified|MoreData|Name|PackageInfo|Param|PartialType|Progress|"
-       "Reboot|RequestData|RequiresReboot|Results|SetBURMode|SetInstParams|SID|"
-       "Size|Status|SupplyData|SupportedMethods|SupportsInc|Task|"
-       "TransferDataType|Type|UID|UnInstall|UpdateDeviceInfo|UserPerm|"
-       "Value|Version|GetMetadata|Filename" );
-       
-_LIT8(KXMLTagStart, "<");
-_LIT8(KXMLTagStartEndTag, "</");
-_LIT8(KXMLTagEndNoContent, "/>");
-_LIT8(KXMLTagEnd, ">");
-_LIT8(KXMLElemenentSeparator, "|");
-_LIT8(KXMLNamespaceBegin, " xmlns='");
-_LIT8(KXMLNamespaceEnd, "'");
-_LIT8(KXMLIndent, "   ");
-_LIT8(KXMLNewLine, "\r\n");
-
-#endif
\ No newline at end of file
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconwbxmldefs.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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:  ConML parser/generator
-*
-*/
-
-
-#ifndef __SCONWBXMLDEFS_H__
-#define __SCONWBXMLDEFS_H__
-
-// -----------------------------------------------------------------------------
-// Typedefs
-// -----------------------------------------------------------------------------
-typedef TUint8 TWBXMLTag;
-
-// -----------------------------------------------------------------------------
-// Constants
-// -----------------------------------------------------------------------------
-const TWBXMLTag SWITCH_PAGE = 0;
-const TWBXMLTag END = 1;
-const TWBXMLTag ENTITY = 2;
-const TWBXMLTag STR_I = 3;
-const TWBXMLTag LITERAL = 4;
-const TWBXMLTag OPAQUE = 0xc3; 
-
-const TUint8 KWBXMLHasAttributes = (1<<7);
-const TUint8 KWBXMLHasContent = (1<<6);
-
-
-#endif // __SCONWBXMLDEFS_H__
\ No newline at end of file
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconwbxmlparser.inl	Tue Aug 31 15:05:37 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:  ConML parser/generator
-*
-*/
-
-
-#ifndef __SCONWBXMLPARSER_INL__
-#define __SCONWBXMLPARSER_INL__
-
-
-inline TWBXMLStackItem::TWBXMLStackItem( TUint8 aTag )  : iTag(aTag)
-	{
-	}
-
-inline TUint8 TWBXMLStackItem::Tag() const
-	{
-	return iTag;
-	}
-
-#endif // __SCONWBXMLPARSER_INL__
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlelement.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
-* Copyright (c) 2005-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:  ConML parser/generator
-*
-*/
-
-
-#ifndef __SCONXMLELEMENT_H__
-#define __SCONXMLELEMENT_H__
-
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-
-#include <e32base.h>
-#include "sconxmlstack.h"
-
-// -----------------------------------------------------------------------------
-// Class forwards
-// -----------------------------------------------------------------------------
-class MWBXMLConMLCallback;
-struct TXMLElementParams;
-
-// -----------------------------------------------------------------------------
-// CXMLElement - Base class for XML -elements
-// -----------------------------------------------------------------------------
-NONSHARABLE_CLASS( CXMLElement ) : public CBase
-    {
-public:
-    enum TAction 
-        {
-        ENone,
-        EPop,
-        EPopAndDestroy // Pop from stack, callback, delete
-        };
-
-    /**
-    * Sets the data of an element
-    * @param aData - Data of the element
-    * @return none
-    */
-    virtual void SetDataL( const TDesC8& aData );
-    
-    /**
-    * Returns data of an element
-    * @param none
-    * @return Data of the element as TPtrC8
-    */
-    virtual TPtrC8 Data() const;
-        
-    /**
-    * Validates an element's instance 
-    * @param none
-    * @return ETrue if element current instance is valid, 
-    * EFalse if not 
-    */
-    virtual TBool Validate();
-    
-    /**
-    * Checks if instance needs cleanup
-    * @param none
-    * @return ETrue if instance pushed into 
-    * parser's cleanupstack , EFalse if not
-    */
-    virtual TBool NeedsCleanup() const;
-    
-    /**
-    * Offers a new element to this element
-    * @param aTag - tag of the element to be started 
-    * @param aParams - Element parameters
-    * @return new Element instance as CXMLElement
-    */
-    virtual CXMLElement* BeginElementL( 
-        TUint8 aTag, const TXMLElementParams& aParams );
-
-    /**
-    * Offers a new element to this element
-    * @param aTag - tag of the element to be started 
-    * @param aParams - Element parameters
-    * @return new Element instance as CXMLElement
-    */
-    virtual TAction EndElementL( TAny* aCallbacks, TUint8 aTag );
-    };
-
-// -----------------------------------------------------------------------------
-// TElementParams
-// -----------------------------------------------------------------------------
-NONSHARABLE_STRUCT( TXMLElementParams )
-    {
-public:
-    inline TXMLElementParams();
-    TXMLElementParams( 
-        TAny* aCallbacks, 
-        CXMLStack<CXMLElement>* aCmdStack = 0, 
-        CXMLStack<CXMLElement>* aCleanupStack = 0 );
-        
-    /**
-    * Returns the call back function of parameters
-    * @param nonoe
-    * @return call back function as TAny
-    */
-    inline TAny* Callbacks() const;
-    
-    /**
-    * Returns the command stack of the parameters
-    * @param none
-    * @return command stack as CXMLStack
-    */
-    inline CXMLStack<CXMLElement>* CmdStack() const;
-
-    /**
-    * Returns the clean up stack of the parameters
-    * @param none
-    * @return clean up stack as CXMLStack
-    */
-    inline CXMLStack<CXMLElement>* CleanupStack() const;
-
-private:
-    TAny* iCallbacks;
-    CXMLStack<CXMLElement>* iCmdStack;
-    CXMLStack<CXMLElement>* iCleanupStack;
-    };
-
-#include "sconxmlelement.inl"
-
-#endif // __SCONXMLELEMENT_H__
\ No newline at end of file
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlelement.inl	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +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:  ConML parser/generator
-*
-*/
-
-
-#ifndef __SCONXMLELEMENT_INL__
-#define __SCONXMLELEMENT_INL__
-
-// ------------------------------------------------------------------------------------------------
-inline TXMLElementParams::TXMLElementParams() : iCallbacks(0), iCmdStack(0), iCleanupStack(0)
-	{
-	}
-
-// ------------------------------------------------------------------------------------------------
-inline TAny* TXMLElementParams::Callbacks() const
-	{
-	return iCallbacks;
-	}
-
-// ------------------------------------------------------------------------------------------------
-inline CXMLStack<CXMLElement>* TXMLElementParams::CmdStack() const
-	{
-	return iCmdStack;
-	}
-
-// ------------------------------------------------------------------------------------------------
-inline CXMLStack<CXMLElement>* TXMLElementParams::CleanupStack() const
-	{
-	return iCleanupStack;
-	}
-
-#endif // __SCONXMLELEMENT_INL__
\ No newline at end of file
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +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:  ConML parser/generator
-*
-*/
-
-
-#ifndef __SCONXMLSTACK_H__
-#define __SCONXMLSTACK_H__
-
-// -----------------------------------------------------------------------------
-// CNSmlStack - Stack for WBXML / XML elements
-// ----------------------------------------------------------------------------
-
-template <class T>
-class CXMLStack  : public CBase
-	{
-public:
-	static inline CXMLStack* NewL();
-	inline ~CXMLStack();
-        
-        /**
-        *  Removes latest item from the stack
-        * @param none
-        * @return none
-        */
-	inline T* Pop();
-	
-	/**
-        *  Return the latest item from the stack
-        * @param none
-        * @return the item
-        */
-	inline T* Top();
-	
-	/**
-        *  Adds an item to the stack
-        * @param none
-        * @return none
-        */
-	inline void PushL( T* aItem );
-	
-	/**
-        * Returns the number of items in the stack
-        * @param none
-        * @return number of items as TInt
-        */
-	inline TInt Count();
-	
-	/**
-        *  Resets the stack
-        * @param none
-        * @return none
-        */
-	inline void Reset();
-	
-	/**
-        *  Resets and destroys the stack
-        * @param none
-        * @return none
-        */
-	inline void ResetAndDestroy();
-
-
-protected:
-	inline CXMLStack<T>();
-
-private:
-	RPointerArray<T>* iStack;
-	};
-
-#include "sconxmlstack.inl"
-
-#endif // __SCONXMLSTACK_H__
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.inl	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +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:  ConML parser/generator
-*
-*/
-
-
-#ifndef __SCONXMLSTACK_INL__
-#define __SCONXMLSTACK_INL__
-
-
-// ------------------------------------------------------------------------------------------------
-// CXMLStack
-// ------------------------------------------------------------------------------------------------
-template<class T>
-inline CXMLStack<T>::CXMLStack()
-	{
-	}
-
-// ------------------------------------------------------------------------------------------------
-template<class T>
-inline CXMLStack<T>::~CXMLStack()
-	{
-	iStack->ResetAndDestroy();
-	delete iStack;
-	}
-
-// ------------------------------------------------------------------------------------------------
-template<class T>
-inline CXMLStack<T>* CXMLStack<T>::NewL()
-	{
-	CXMLStack<T>* self = new (ELeave) CXMLStack<T>();
-	CleanupStack::PushL(self);
-	self->iStack = new (ELeave) RPointerArray<T>();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-// ------------------------------------------------------------------------------------------------
-template<class T>
-inline T* CXMLStack<T>::Pop()
-	{
-	T* temp = iStack->operator[](iStack->Count() - 1);
-	iStack->Remove(iStack->Count() - 1);
-	return temp;
-	}
-
-// ------------------------------------------------------------------------------------------------
-template<class T>
-inline T* CXMLStack<T>::Top()
-	{
-	if( Count() > 0 )
-		{
-		return iStack->operator[](iStack->Count() - 1);
-		}
-	return 0;
-	}
-
-// ------------------------------------------------------------------------------------------------
-template<class T>
-inline void CXMLStack<T>::PushL( T* aItem )
-	{
-	iStack->AppendL(aItem);
-	}
-
-// ------------------------------------------------------------------------------------------------
-template<class T>
-inline TInt CXMLStack<T>::Count()
-	{
-	return iStack->Count();
-	}
-
-// ------------------------------------------------------------------------------------------------
-template<class T>
-inline void CXMLStack<T>::Reset()
-	{
-	iStack->Reset();
-	}
-
-// ------------------------------------------------------------------------------------------------
-template<class T>
-inline void CXMLStack<T>::ResetAndDestroy()
-	{
-	iStack->ResetAndDestroy();
-	}
-
-#endif  // __SCONXMLSTACK_INL__
-
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlworkspace.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +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:  ConML parser/generator
-*
-*/
-
-
-#ifndef __SCONXMLWORKSPACE_H__
-#define __SCONXMLWORKSPACE_H__
-
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-#include <e32base.h>
-
-// -----------------------------------------------------------------------------
-// CXMLWorkspace - workspace for WBXML / XML -documents
-// -----------------------------------------------------------------------------
-class CXMLWorkspace : public CBase
-	{
-public:
-	~CXMLWorkspace();
-	static CXMLWorkspace* NewL();
-
-	// transaction handling
-	/**
-        * Function to Begin transaction
-        * @param none
-        * @return none
-        */
-	void BeginTransaction();
-	
-	/**
-        * Commits the transactions done
-        * @param none
-        * @return none
-        */
-	void CommitAll();
-	
-	/**
-        *  Commits the latest transacion done
-        * @param none
-        * @return KErrNone or an error code
-        */
-	TInt Commit();
-	
-	/**
-        *  Deletes the latest transacion done
-        * @param none
-        * @return KErrNone or an error code
-        */
-	TInt Rollback();
-
-        /**
-        *  Resets the buffer
-        * @param none
-        * @return KErrNone or an error code
-        */
-	void Reset();
-	
-	/**
-        *  Writes to the buffer
-        * @param none
-        * @return none
-        */
-	void WriteL( const TDesC8& aData );
-	void WriteL( const TUint8 aData );
-	
-	/**
-        * Returns the buffer
-        * @param none
-        * @return the buffer
-        */
-	TPtrC8 Buffer();
-        
-        /**
-        *  Returns the free space left in the buffer
-        * @param none
-        * @return free space of the buffer
-        */
-	TInt FreeSize();
-	
-	/**
-        *  Returns the maximum size of the buffer
-        * @param none
-        * @return Buffer maximum size
-        */
-	TInt MaxSize();
-	
-	/**
-        *  Returns the size of the buffer space used
-        * @param none
-        * @return Size of the buffer used
-        */
-	TInt Size();
-
-protected:
-	void ConstructL();
-
-private:
-	void Delete( TInt aPos, TInt aLength );
-	CXMLWorkspace();
-private:
-	CBufFlat* iBuffer;
-	RArray<TUint>* iTransactions;
-	};
-
-#endif // __SCONXMLWORKSPACE_H__
-	
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/src/sconconmldtd.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1783 +0,0 @@
-/*
-* Copyright (c) 2005-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:  ConML parser/generator
-*
-*/
-
-
-#include "sconconmldtd.h"
-#include "sconconmltags.h"
-#include "sconconmlhandler.h"
-#include "sconconmlhandlererror.h"
-#include "debug.h"
-
-// -----------------------------------------------------------------------------
-// Macros
-// -----------------------------------------------------------------------------
-#define CHECK_NO_DUPLICATE(a) if( a ) { User::Leave( KWBXMLParserErrorinvalidDocument ); }
-
-// -----------------------------------------------------------------------------
-// pcdata_s
-// -----------------------------------------------------------------------------
-pcdata_s::pcdata_s( const pcdataType_t aType, const pcdataExtension_t aExt )
-	: contentType(aType), extension(aExt)
-    {
-    }
-
-pcdata_s::pcdata_s() : contentType(SML_PCDATA_OPAQUE), 
-                       extension(SML_EXT_UNDEFINED)
-    {
-    }
-
-pcdata_s::~pcdata_s()
-    {
-    FreeContent();
-    }
-
-void pcdata_s::FreeContent()
-    {
-    User::Free(content);
-    content = 0;
-    }
-
-void pcdata_s::SetDataL( const TDesC8& aData )
-    {
-    FreeContent();
-    length = aData.Length();
-    content = User::AllocL(length);
-    Mem::Copy(content, aData.Ptr(), length);
-    }
-
-TPtrC8 pcdata_s::Data() const
-    {
-    return TPtrC8((TUint8*)content, length);
-    }
-
-void pcdata_s::TruncateL( TInt aConsumed )
-    {
-    HBufC8* buffer = TPtrC8((TUint8*)content + aConsumed, 
-                             length - aConsumed).AllocLC();
-    SetDataL(*buffer);
-    CleanupStack::PopAndDestroy(); // buffer
-    }
-
-pcdata_list_s::pcdata_list_s()
-    {
-    }
-
-pcdata_list_s::~pcdata_list_s()
-    {
-    delete data;
-    delete next;
-    }
-
-// -----------------------------------------------------------------------------
-// AddDriveL
-// -----------------------------------------------------------------------------
-CXMLElement* AddDriveL(  ConML_DriveListPtr_t* aList )
-    {
-    ConML_DriveListPtr_t itemL = new ( ELeave ) ConML_DriveList_t();
-    CleanupStack::PushL( itemL );
-    itemL->data = new ( ELeave ) ConML_Drive_t();
-    GenericListAddL(aList, itemL);
-    CleanupStack::Pop(); // itemL
-    return itemL->data;
-    }
-
-// -----------------------------------------------------------------------------
-// AddSIDL
-// -----------------------------------------------------------------------------
-CXMLElement* AddSIDL( ConML_SIDListPtr_t * aList )
-    {
-    ConML_SIDListPtr_t itemL = new ( ELeave ) ConML_SIDList_t();
-    CleanupStack::PushL( itemL );
-    itemL->data = new ( ELeave ) ConML_SID_t();
-    GenericListAddL(aList, itemL);
-    CleanupStack::Pop(); // itemL
-    return itemL->data;
-    }
-		
-// -----------------------------------------------------------------------------
-// AddFileL
-// -----------------------------------------------------------------------------
-CXMLElement* AddFileL( ConML_FileListPtr_t * aList )
-    {
-    ConML_FileListPtr_t itemL = new ( ELeave ) ConML_FileList_t();
-    CleanupStack::PushL( itemL );
-    itemL->data = new ( ELeave ) ConML_File_t();
-    GenericListAddL(aList, itemL);
-    CleanupStack::Pop(); // itemL
-    return itemL->data;
-    }
-
-// -----------------------------------------------------------------------------
-// AddApplicationL
-// -----------------------------------------------------------------------------
-CXMLElement* AddApplicationL( ConML_ApplicationListPtr_t * aList )
-    {   
-    ConML_ApplicationListPtr_t itemL = new ( ELeave ) ConML_ApplicationList_t();
-    CleanupStack::PushL( itemL );
-    itemL->data = new ( ELeave ) ConML_Application_t();
-    GenericListAddL(aList, itemL);
-    CleanupStack::Pop(); // itemL
-    return itemL->data;
-    }
-
-// -----------------------------------------------------------------------------
-// AddTaskL
-// -----------------------------------------------------------------------------
-CXMLElement* AddTaskL( ConML_TaskListPtr_t * aList )
-    {
-    ConML_TaskListPtr_t itemL = new ( ELeave ) ConML_TaskList_t();
-    CleanupStack::PushL( itemL );
-    itemL->data = new ( ELeave ) ConML_Task_t();
-    GenericListAddL(aList, itemL);
-    CleanupStack::Pop(); // itemL
-    return itemL->data;
-    }
-	
-// -----------------------------------------------------------------------------
-// AddParamL
-// -----------------------------------------------------------------------------
-CXMLElement* AddParamL( ConML_ParamListPtr_t * aList )
-    {
-    ConML_ParamListPtr_t itemL = new ( ELeave ) ConML_ParamList_t();
-    CleanupStack::PushL( itemL );
-    itemL->data = new ( ELeave ) ConML_Param_t();
-    GenericListAddL(aList, itemL);
-    CleanupStack::Pop(); // itemL
-    return itemL->data;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_Drive_s
-// -----------------------------------------------------------------------------
-ConML_Drive_s::ConML_Drive_s()
-    {
-    }
-
-ConML_Drive_s::~ConML_Drive_s()
-    {
-    delete name;
-    }
-
-CXMLElement* ConML_Drive_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )
-    {
-    switch ( aTag )
-        {
-        case EConMLName:
-            CHECK_NO_DUPLICATE ( name );
-            name = new ( ELeave ) pcdata_t();
-            return name;
-				
-        default:
-            LOGGER_WRITE_1( "ConML_Drive_s::BeginElement() : Unknown element  %02x", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_DriveList_s
-// -----------------------------------------------------------------------------
-ConML_DriveList_s::ConML_DriveList_s()	
-    {
-    }
-
-ConML_DriveList_s::~ConML_DriveList_s()	
-    {
-    delete data;
-    delete next;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_Drives_s
-// -----------------------------------------------------------------------------
-ConML_Drives_s::ConML_Drives_s()
-    {
-    }
-	
-ConML_Drives_s::~ConML_Drives_s()
-    {
-    delete drive;
-    }
-	
-CXMLElement* ConML_Drives_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )
-    {
-    switch ( aTag )
-        {
-        case EConMLDrive:
-            return AddDriveL ( &drive );
-	
-        default:
-            LOGGER_WRITE_1( "ConML_Drives_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_BUROptions_s
-// -----------------------------------------------------------------------------
-ConML_BUROptions_s::ConML_BUROptions_s()
-    {
-    }
-
-ConML_BUROptions_s::~ConML_BUROptions_s()
-    {
-    delete requiresReboot;
-    delete hasFiles;
-    delete supportsInc;
-    delete delayToPrepareData;
-    }
-
-CXMLElement* ConML_BUROptions_s::BeginElementL ( 
-        TUint8 aTag, const TXMLElementParams& /*aParams*/ )
-    {
-    switch ( aTag )
-        {
-        case EConMLRequiresReboot:
-            CHECK_NO_DUPLICATE ( requiresReboot );
-            requiresReboot = new ( ELeave ) pcdata_t();
-            return requiresReboot;
-		
-        case EConMLHasFiles:
-            CHECK_NO_DUPLICATE ( hasFiles );
-            hasFiles = new ( ELeave ) pcdata_t();
-            return hasFiles;
-			
-        case EConMLSupportsInc:
-            CHECK_NO_DUPLICATE ( supportsInc );
-            supportsInc = new ( ELeave ) pcdata_t();
-            return supportsInc;
-		
-        case EConMLDelayToPrepareData:
-            CHECK_NO_DUPLICATE ( delayToPrepareData );
-            delayToPrepareData = new ( ELeave ) pcdata_t();
-            return delayToPrepareData;
-				
-        default:
-            LOGGER_WRITE_1( "ConML_BUROptions_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_PackageInfo_s
-// -----------------------------------------------------------------------------
-ConML_PackageInfo_s::ConML_PackageInfo_s()
-    {
-    }
-
-ConML_PackageInfo_s::~ConML_PackageInfo_s()
-    {
-    delete name;
-    }
-
-CXMLElement* ConML_PackageInfo_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLName:
-            CHECK_NO_DUPLICATE ( name )
-            name = new ( ELeave ) pcdata_t();
-            return name;
-								
-        default:
-            LOGGER_WRITE_1( "ConML_PackageInfo_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-
-// -----------------------------------------------------------------------------
-// ConML_SID_s
-// -----------------------------------------------------------------------------
-ConML_SID_s::ConML_SID_s()
-    {
-    }
-
-ConML_SID_s::~ConML_SID_s()
-    {
-    delete type;
-    delete uid;
-    delete drives;
-    delete packageInfo;
-    delete burOptions;
-    delete size;
-    delete transferDataType;
-    delete data;
-    delete moreData;
-    delete dataOwnerStatus;
-    }
-
-CXMLElement* ConML_SID_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLType:
-            CHECK_NO_DUPLICATE ( type );
-            type = new ( ELeave ) pcdata_t();
-            return type;
-		
-        case EConMLUID:
-            CHECK_NO_DUPLICATE ( uid )
-            uid = new ( ELeave ) pcdata_t();
-            return uid;
-		
-        case EConMLDrives:
-            drives = new ( ELeave ) ConML_Drives_t();
-            return drives;
-		
-        case EConMLPackageInfo:
-            CHECK_NO_DUPLICATE ( packageInfo );
-            packageInfo = new ( ELeave ) ConML_PackageInfo_t();
-            return packageInfo;
-		
-        case EConMLBUROptions:
-            CHECK_NO_DUPLICATE ( burOptions )
-            burOptions = new ( ELeave )	ConML_BUROptions_t();
-            return burOptions;
-			
-        case EConMLSize:
-            CHECK_NO_DUPLICATE ( size );
-            size = new ( ELeave ) pcdata_t();
-            return size;
-		
-        case EConMLTransferDataType:
-            CHECK_NO_DUPLICATE ( transferDataType );
-            transferDataType = new ( ELeave ) pcdata_t();
-            return transferDataType;
-		
-        case EConMLData:
-            CHECK_NO_DUPLICATE ( data );
-            data = new ( ELeave ) pcdata_t();
-            return data;
-		
-        case EConMLMoreData:
-            CHECK_NO_DUPLICATE ( moreData );
-            moreData = new ( ELeave ) pcdata_t();
-            return moreData;
-		
-        case EConMLDataOwnerStatus:
-            CHECK_NO_DUPLICATE ( dataOwnerStatus );
-            dataOwnerStatus = new ( ELeave ) pcdata_t();
-            return dataOwnerStatus;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_SID_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_SIDList_s
-// -----------------------------------------------------------------------------
-ConML_SIDList_s::ConML_SIDList_s()
-    {
-    }
-	
-ConML_SIDList_s::~ConML_SIDList_s()
-    {
-    delete data;
-    delete next;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_DataOwners_s
-// -----------------------------------------------------------------------------
-ConML_DataOwners_s::ConML_DataOwners_s()
-    {
-    }
-
-ConML_DataOwners_s::~ConML_DataOwners_s()
-    {
-    delete sid;
-    }
-
-CXMLElement* ConML_DataOwners_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLSID:
-            return AddSIDL( &sid );
-				
-        default:
-            LOGGER_WRITE_1( "ConML_DataOwners_s::BeginElement()\
-             : Unknown element  %02x ", aTag);
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_Application_s
-// -----------------------------------------------------------------------------
-ConML_Application_s::ConML_Application_s()
-    {
-    }
-	
-ConML_Application_s::~ConML_Application_s()
-    {
-    delete name;
-    delete uid;
-    }
-
-CXMLElement* ConML_Application_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-    	{
-    	case EConMLName:
-            CHECK_NO_DUPLICATE ( name );
-            name = new ( ELeave ) pcdata_t();
-            return name;
-		
-        case EConMLUID:
-            CHECK_NO_DUPLICATE ( uid );
-            uid = new ( ELeave ) pcdata_t();
-            return uid;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_Application_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_ApplicationList_s
-// -----------------------------------------------------------------------------
-ConML_ApplicationList_s::ConML_ApplicationList_s()
-    {
-    }
-
-ConML_ApplicationList_s::~ConML_ApplicationList_s()
-    {
-    delete data;
-    delete next;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_Applications_s
-// -----------------------------------------------------------------------------
-ConML_Applications_s::ConML_Applications_s()	
-    {
-    }
-
-ConML_Applications_s::~ConML_Applications_s()	
-    {
-    delete application;
-    }
-	
-CXMLElement* ConML_Applications_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLApplication:
-            return AddApplicationL( &application );
-				
-        default:
-            LOGGER_WRITE_1( "ConML_DataOwners_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_SupportedMethod_s
-// -----------------------------------------------------------------------------
-ConML_SupportedMethods_s::ConML_SupportedMethods_s()
-    {
-    }
-
-ConML_SupportedMethods_s::~ConML_SupportedMethods_s()
-    {
-    delete install;
-    delete unInstall;
-    delete setInstParams;
-    delete listInstalledApps;
-    delete listDataOwners;
-    delete setBurMode;
-    delete getDataSize;
-    delete requestData;
-    delete supplyData;
-    delete reboot;
-    }
-
-CXMLElement* ConML_SupportedMethods_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )
-    {
-    switch ( aTag )
-        {
-        case EConMLInstall:
-            CHECK_NO_DUPLICATE ( install );
-            install = new ( ELeave ) pcdata_t();
-            return install;
-		
-        case EConMLUnInstall:
-            CHECK_NO_DUPLICATE ( unInstall );
-            unInstall = new ( ELeave ) pcdata_t();
-            return unInstall;
-	
-        case EConMLListInstalledApps:
-            CHECK_NO_DUPLICATE ( listInstalledApps );
-            listInstalledApps = new ( ELeave ) pcdata_t();
-            return listInstalledApps;
-		
-        case EConMLListDataOwners:
-            CHECK_NO_DUPLICATE ( listDataOwners );
-            listDataOwners = new ( ELeave ) pcdata_t();
-            return listDataOwners;
-		
-        case EConMLSetBURMode:
-            CHECK_NO_DUPLICATE ( setBurMode );
-            setBurMode = new ( ELeave ) pcdata_t();
-            return setBurMode;
-		
-        case EConMLGetDataSize:
-            CHECK_NO_DUPLICATE ( getDataSize );
-            getDataSize = new ( ELeave ) pcdata_t();
-            return getDataSize;
-		
-        case EConMLRequestData:
-            CHECK_NO_DUPLICATE ( requestData );
-            requestData = new ( ELeave ) pcdata_t();
-            return requestData;
-		
-        case EConMLSupplyData:
-            CHECK_NO_DUPLICATE (supplyData );
-            supplyData = new ( ELeave ) pcdata_t();
-            return supplyData;
-		
-        case EConMLReboot:
-            CHECK_NO_DUPLICATE ( reboot );
-            reboot = new ( ELeave ) pcdata_t();
-            return reboot;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_SupportedMethods_s::\
-            BeginElement() : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_DeviceInfo_s
-// -----------------------------------------------------------------------------
-ConML_DeviceInfo_s::ConML_DeviceInfo_s()
-    {
-    }
-
-ConML_DeviceInfo_s::~ConML_DeviceInfo_s()
-    {
-    delete version;
-    delete supportedMethods;
-    delete maxObjectSize;
-    }
-
-CXMLElement* ConML_DeviceInfo_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLVersion:
-            CHECK_NO_DUPLICATE (version);
-            version = new ( ELeave ) pcdata_t();
-            return version;
-		
-        case EConMLSupportedMethods:
-            CHECK_NO_DUPLICATE ( supportedMethods);
-            supportedMethods = new ( ELeave ) ConML_SupportedMethods_t();
-            return supportedMethods;
-		
-        case EConMLMaxObjectSize:
-            CHECK_NO_DUPLICATE ( maxObjectSize );
-            maxObjectSize = new ( ELeave ) pcdata_t();
-            return maxObjectSize;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_DeviceInfo_s::BeginElement()\
-             : Unknown element %d", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_DeviceInfo_s
-// -----------------------------------------------------------------------------
-ConML_File_s::ConML_File_s()	
-    {
-    }
-
-ConML_File_s::~ConML_File_s()	
-    {
-    delete name;
-    delete modified;
-    delete size;
-    delete userPerm;
-    }
-
-CXMLElement* ConML_File_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLName:
-            CHECK_NO_DUPLICATE ( name );
-            name = new ( ELeave ) pcdata_t();
-            return name;
-		
-        case EConMLModified:
-            CHECK_NO_DUPLICATE ( modified );
-            modified = new ( ELeave ) pcdata_t();
-            return modified;
-		
-        case EConMLSize:
-            CHECK_NO_DUPLICATE ( size );
-            size = new ( ELeave ) pcdata_t();
-            return size;
-		
-        case EConMLUserPerm:
-            CHECK_NO_DUPLICATE ( userPerm );
-            userPerm = new ( ELeave ) pcdata_t();
-            return userPerm;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_File_s::BeginElement()\
-             : Unknown element %d", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_FileList_s
-// -----------------------------------------------------------------------------
-ConML_FileList_s::ConML_FileList_s()
-    {
-    }
-	
-ConML_FileList_s::~ConML_FileList_s()
-    {
-    delete data;
-    delete next;
-    }	
-
-// -----------------------------------------------------------------------------
-// ConML_Files_s
-// -----------------------------------------------------------------------------
-ConML_Files_s::ConML_Files_s()
-    {
-    }
-
-ConML_Files_s::~ConML_Files_s()
-    {
-    delete file;
-    }
-
-CXMLElement* ConML_Files_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLFile:
-            return AddFileL( &file );
-		
-        default:
-            LOGGER_WRITE_1( "ConML_File_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_Progress_s
-// -----------------------------------------------------------------------------
-ConML_Progress_s::ConML_Progress_s()
-    {
-    }
-	
-// -----------------------------------------------------------------------------
-// ~ConML_Progress_s
-// -----------------------------------------------------------------------------
-ConML_Progress_s::~ConML_Progress_s()
-    {
-    delete value;
-    }
-	
-CXMLElement* ConML_Progress_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLValue:
-            CHECK_NO_DUPLICATE ( value );
-            value = new ( ELeave ) pcdata_t();
-            return value;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_Progress_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_Results_s
-// -----------------------------------------------------------------------------
-ConML_Results_s::ConML_Results_s()
-    {
-    }
-
-ConML_Results_s::~ConML_Results_s()
-    {
-    delete complete;
-    delete progress;
-    delete applications;
-    delete dataOwners;
-    delete filename;
-    delete moreData;
-    delete data;
-    delete deviceInfo;
-    delete files;
-    }
-
-CXMLElement* ConML_Results_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-    {
-        case EConMLComplete:
-            CHECK_NO_DUPLICATE ( complete );
-            complete = new ( ELeave ) pcdata_t();
-            return complete;
-		
-        case EConMLProgress:
-            CHECK_NO_DUPLICATE ( progress );
-            progress = new ( ELeave ) ConML_Progress_t();
-            return progress;
-		
-        case EConMLApplications:
-            CHECK_NO_DUPLICATE ( applications );
-            applications = new ( ELeave ) ConML_Applications_t();
-            return applications;
-		
-        case EConMLDataOwners:
-            CHECK_NO_DUPLICATE ( dataOwners );
-            dataOwners = new ( ELeave ) ConML_DataOwners_t();
-            return dataOwners;
-		
-        case EConMLMoreData:
-            CHECK_NO_DUPLICATE ( moreData );
-            moreData = new ( ELeave ) pcdata_t();
-            return moreData;
-		
-        case EConMLData:
-            CHECK_NO_DUPLICATE ( data );
-            data = new ( ELeave ) pcdata_t();
-            return data;
-		
-        case EConMLDeviceInfo:
-            CHECK_NO_DUPLICATE ( deviceInfo )
-            deviceInfo = new ( ELeave ) ConML_DeviceInfo_t();
-            return deviceInfo;
-		
-        case EConMLFiles:
-            CHECK_NO_DUPLICATE ( files )
-            files = new ( ELeave ) ConML_Files_t();
-            return files;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_Results_s::BeginElement()\
-             : Unknown element  %02x ", aTag);
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_Param_s
-// -----------------------------------------------------------------------------
-ConML_Param_s::ConML_Param_s()
-    {
-    }
-	
-ConML_Param_s::~ConML_Param_s()
-    {
-    delete name;
-    delete value;
-    }
-	
-CXMLElement* ConML_Param_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLName:
-            CHECK_NO_DUPLICATE ( name );
-            name = new ( ELeave ) pcdata_t();
-            return name;
-		
-        case EConMLValue:
-            CHECK_NO_DUPLICATE ( value );
-            value = new ( ELeave ) pcdata_t();
-            return value;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_Param_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_ParamList_s
-// -----------------------------------------------------------------------------
-ConML_ParamList_s::ConML_ParamList_s()
-    {
-    }
-
-ConML_ParamList_s::~ConML_ParamList_s()
-    {
-    delete data;
-    delete next;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_InstParams_s
-// -----------------------------------------------------------------------------
-ConML_InstParams_s::ConML_InstParams_s()
-    {
-    }
-
-ConML_InstParams_s::~ConML_InstParams_s()
-    {
-    delete param;
-    }
-	
-CXMLElement* ConML_InstParams_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLParam:
-            return AddParamL( &param );
-			
-        default:
-            LOGGER_WRITE_1( "ConML_InstParams_s::BeginElement()\
-             : Unknown element  %02x ", aTag);
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_UnInstall_s
-// -----------------------------------------------------------------------------
-ConML_UnInstall_s::ConML_UnInstall_s()
-    {
-    }
-
-ConML_UnInstall_s::~ConML_UnInstall_s()
-    {
-    delete applications;
-    delete instParams;
-    delete results;
-    }
-
-CXMLElement* ConML_UnInstall_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLApplications:
-            CHECK_NO_DUPLICATE ( applications );
-            applications = new ( ELeave ) ConML_Applications_t();
-            return applications;
-		
-        case EConMLInstParams:
-            CHECK_NO_DUPLICATE ( instParams );
-            instParams = new ( ELeave ) ConML_InstParams_t();
-            return instParams;
-				
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results );
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_UnInstall_s::BeginElement()\
-             : Unknown element  %02x ", aTag);
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-
-// -----------------------------------------------------------------------------
-// ConML_ListDataOwners_s
-// -----------------------------------------------------------------------------
-ConML_ListDataOwners_s::ConML_ListDataOwners_s()
-    {
-    }
-
-ConML_ListDataOwners_s::~ConML_ListDataOwners_s()
-    {
-    delete results;
-    }
-
-CXMLElement* ConML_ListDataOwners_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results );
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_ListDataOwners_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_Install_s
-// -----------------------------------------------------------------------------
-ConML_Install_s::ConML_Install_s()
-    {
-    }
-
-ConML_Install_s::~ConML_Install_s()
-    {
-    delete name;
-    delete instParams;
-    delete results;
-    }
-
-CXMLElement* ConML_Install_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLName:
-            CHECK_NO_DUPLICATE ( name );
-            name = new ( ELeave ) pcdata_t();
-            return name;
-			
-        case EConMLInstParams:
-            CHECK_NO_DUPLICATE ( instParams );
-            instParams = new ( ELeave ) ConML_InstParams_t();
-            return instParams;
-		
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results );
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_Install_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_ListInstalledApps
-// -----------------------------------------------------------------------------
-ConML_ListInstalledApps_s::ConML_ListInstalledApps_s()
-    {
-    }
-
-ConML_ListInstalledApps_s::~ConML_ListInstalledApps_s()
-    {
-    delete drives;
-    delete all;
-    delete results;
-    }
-
-CXMLElement* ConML_ListInstalledApps_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLDrives:
-            CHECK_NO_DUPLICATE ( drives );
-            drives = new ( ELeave ) ConML_Drives_t();
-            return drives;
-		
-        case EConMLAll:
-            CHECK_NO_DUPLICATE ( all );
-            all = new ( ELeave ) pcdata_t();
-            return all;
-		
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results );
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_ListInstalledApps_s::\
-            BeginElement() : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_SetBURMode_s
-// -----------------------------------------------------------------------------
-ConML_SetBURMode_s::ConML_SetBURMode_s()
-    {
-    }
-
-ConML_SetBURMode_s::~ConML_SetBURMode_s()
-    {
-    delete drives;
-    delete partialType;
-    delete incType;
-    delete results;
-    }
-
-CXMLElement* ConML_SetBURMode_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLDrives:
-            drives = new ( ELeave ) ConML_Drives_t();
-            return drives;
-		
-        case EConMLPartialType:
-            CHECK_NO_DUPLICATE ( partialType );
-            partialType = new ( ELeave ) pcdata_t();
-            return partialType;
-		
-        case EConMLIncType:
-            CHECK_NO_DUPLICATE ( incType );
-            incType = new ( ELeave ) pcdata_t();
-            return incType;
-		
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results );
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_SetBURMode_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-            }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_GetDataSize_s
-// -----------------------------------------------------------------------------
-ConML_GetDataSize_s::ConML_GetDataSize_s()
-    {
-    }
-
-ConML_GetDataSize_s::~ConML_GetDataSize_s()
-    {
-    delete dataOwners;
-    delete results;
-    }
-
-CXMLElement* ConML_GetDataSize_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLDataOwners:
-            CHECK_NO_DUPLICATE ( dataOwners );
-            dataOwners = new ( ELeave ) ConML_DataOwners_t();
-            return dataOwners;
-		
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results );
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-	
-        default:
-            LOGGER_WRITE_1( "ConML_GetDataSize_s::BeginElement()\
-             : Unknown element  %02x ", aTag);
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }	
-	
-// -----------------------------------------------------------------------------
-// ConML_RequestData_s
-// -----------------------------------------------------------------------------
-ConML_RequestData_s::ConML_RequestData_s()
-    {
-    }
-
-ConML_RequestData_s::~ConML_RequestData_s()
-    {
-    delete sid;
-    delete results;
-    }
-
-CXMLElement* ConML_RequestData_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLSID:
-            return AddSIDL( &sid );
-		
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results );
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_RequestData_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_UpdateDeviceInfo_s
-// -----------------------------------------------------------------------------
-ConML_UpdateDeviceInfo_s::ConML_UpdateDeviceInfo_s()
-    {
-    }
-
-ConML_UpdateDeviceInfo_s::~ConML_UpdateDeviceInfo_s()
-    {
-    delete deviceInfo;
-    delete results;
-    }
-
-CXMLElement* ConML_UpdateDeviceInfo_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLDeviceInfo:
-            CHECK_NO_DUPLICATE ( deviceInfo )
-            deviceInfo = new ( ELeave ) ConML_DeviceInfo_t();
-            return deviceInfo;
-		
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results )
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_UpdateDeviceInfo_s::\
-            BeginElement() : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_ListPublicFiles_s
-// -----------------------------------------------------------------------------
-ConML_ListPublicFiles_s::ConML_ListPublicFiles_s()
-    {
-    }
-
-ConML_ListPublicFiles_s::~ConML_ListPublicFiles_s()
-    {
-    delete results;
-    delete sid;
-    }
-
-CXMLElement* ConML_ListPublicFiles_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results );
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        case EConMLSID:
-            return AddSIDL ( &sid );
-	
-        default:
-            LOGGER_WRITE_1( "ConML_ListPublicFiles_s::\
-            BeginElement() : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_Task_s
-// -----------------------------------------------------------------------------
-ConML_GetDataOwnerStatus_s::ConML_GetDataOwnerStatus_s()
-    {
-    }
-
-ConML_GetDataOwnerStatus_s::~ConML_GetDataOwnerStatus_s()
-    {
-    delete dataOwners;
-    delete results;
-    }
-    
-CXMLElement* ConML_GetDataOwnerStatus_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )
-    {   
-    switch ( aTag )
-        {
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results );
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        case EConMLDataOwners:
-            CHECK_NO_DUPLICATE ( dataOwners );
-            dataOwners = new ( ELeave ) ConML_DataOwners_t();
-            return dataOwners;
-
-        default:
-            LOGGER_WRITE_1( "ConML_GetDataOwnerStatus_s::\
-            BeginElement() : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_GetMetadata_s
-// -----------------------------------------------------------------------------
-ConML_GetMetadata_s::ConML_GetMetadata_s()
-    {
-    }
-
-ConML_GetMetadata_s::~ConML_GetMetadata_s()
-    {
-    delete filename;
-    delete results;
-    }
-    
-CXMLElement* ConML_GetMetadata_s::BeginElementL(
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )
-    {   
-    switch ( aTag )
-        {
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results );
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        case EConMLFilename:
-            CHECK_NO_DUPLICATE ( filename );
-            filename = new ( ELeave ) pcdata_t();
-            return filename;
-
-        default:
-            LOGGER_WRITE_1( "ConML_GetMetadata_s::\
-            BeginElement() : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-	
-// -----------------------------------------------------------------------------
-// ConML_Reboot_s
-// -----------------------------------------------------------------------------
-ConML_Reboot_s::ConML_Reboot_s()
-    {
-    }
-
-ConML_Reboot_s::~ConML_Reboot_s()
-    {
-    delete results;
-    }
-
-CXMLElement* ConML_Reboot_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )
-    {
-    switch ( aTag )
-        {
-        case EConMLResults:
-            CHECK_NO_DUPLICATE ( results );
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_Reboot_s::BeginElementL()\
-             : Unknown element %d ", aTag );
-            User::Leave ( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_Task_s
-// -----------------------------------------------------------------------------
-ConML_Task_s::ConML_Task_s()
-    {
-    }
-
-ConML_Task_s::~ConML_Task_s()
-    {
-    delete id;
-    delete install;
-    delete unInstall;
-    delete listInstalledApps;
-    delete listDataOwners;
-    delete setBurMode;
-    delete getDataSize;
-    delete requestData;
-    delete updateDeviceInfo;
-    delete listPublicFiles;
-    delete getDataOwnerStatus;
-    delete supplyData;
-    delete reboot;
-    delete getMetadata;
-    }
-
-CXMLElement* ConML_Task_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLID:
-            CHECK_NO_DUPLICATE ( id )
-            id = new ( ELeave ) pcdata_t();
-            return id;
-		
-        case EConMLInstall:
-            CHECK_NO_DUPLICATE ( install );
-            install = new ( ELeave ) ConML_Install_t();
-            return install;
-		
-        case EConMLUnInstall:
-            CHECK_NO_DUPLICATE ( unInstall );
-            unInstall = new ( ELeave ) ConML_UnInstall_t();
-            return unInstall;
-		
-        case EConMLListInstalledApps:
-            CHECK_NO_DUPLICATE ( listInstalledApps );
-            listInstalledApps = new ( ELeave ) ConML_ListInstalledApps_t();
-            return listInstalledApps;
-		
-        case EConMLListDataOwners:
-            CHECK_NO_DUPLICATE ( listDataOwners );
-            listDataOwners = new ( ELeave ) ConML_ListDataOwners_t();
-            return listDataOwners;
-		
-        case EConMLSetBURMode:
-            CHECK_NO_DUPLICATE ( setBurMode );
-            setBurMode = new ( ELeave ) ConML_SetBURMode_t();
-            return setBurMode;
-		
-        case EConMLGetDataSize:
-            CHECK_NO_DUPLICATE ( getDataSize );
-            getDataSize = new ( ELeave ) ConML_GetDataSize_t();
-            return getDataSize;
-		
-        case EConMLRequestData:
-            CHECK_NO_DUPLICATE ( requestData )
-            requestData = new ( ELeave ) ConML_RequestData_t();
-            return requestData;
-		
-        case EConMLUpdateDeviceInfo:
-            CHECK_NO_DUPLICATE ( updateDeviceInfo );
-            updateDeviceInfo = new ( ELeave ) ConML_UpdateDeviceInfo_t();
-            return updateDeviceInfo;
-		
-        case EConMLListPublicFiles:
-            CHECK_NO_DUPLICATE ( listPublicFiles );
-            listPublicFiles = new ( ELeave ) ConML_ListPublicFiles_t();
-            return listPublicFiles;
-		
-        case EConMLGetDataOwnerStatus:
-            CHECK_NO_DUPLICATE ( getDataOwnerStatus );
-            getDataOwnerStatus = new ( ELeave ) ConML_GetDataOwnerStatus_t();
-            return getDataOwnerStatus;
-		
-        case EConMLSupplyData:
-            CHECK_NO_DUPLICATE ( supplyData );
-            supplyData = new ( ELeave ) ConML_SupplyData_t();
-            return supplyData;
-		
-        case EConMLReboot:
-            CHECK_NO_DUPLICATE ( reboot );
-            reboot = new ( ELeave ) ConML_Reboot_t();
-            return reboot;
-        case EConMLGetMetadata:
-            CHECK_NO_DUPLICATE ( getMetadata );
-            getMetadata = new ( ELeave ) ConML_GetMetadata_t();
-            return getMetadata;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_Task_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_TaskList_s
-// -----------------------------------------------------------------------------
-ConML_TaskList_s::ConML_TaskList_s()
-    {
-    }
-	
-ConML_TaskList_s::~ConML_TaskList_s()
-    {
-    delete data;
-    delete next;
-    }	
-
-// -----------------------------------------------------------------------------
-// ConML_Status_s
-// -----------------------------------------------------------------------------
-ConML_Status_s::ConML_Status_s()
-    {
-    }
-	
-ConML_Status_s::~ConML_Status_s()
-    {
-    delete task;
-    }
-
-CXMLElement* ConML_Status_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLTask:
-            return AddTaskL( &task );
-				
-        default:
-            LOGGER_WRITE_1( "ConML_Status_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_Cancel_s
-// -----------------------------------------------------------------------------
-ConML_Cancel_s::ConML_Cancel_s()
-    {
-    }
-
-ConML_Cancel_s::~ConML_Cancel_s()
-    {
-    delete id;
-    delete all;
-    }
-
-CXMLElement* ConML_Cancel_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLID:
-            CHECK_NO_DUPLICATE ( id );
-            id = new ( ELeave ) pcdata_t();
-            return id;
-		
-        case EConMLAll:
-            CHECK_NO_DUPLICATE ( all );
-            all = new ( ELeave ) pcdata_t();
-            return all;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_Cancel_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_GetStatus_s
-// -----------------------------------------------------------------------------
-ConML_GetStatus_s::ConML_GetStatus_s()
-    {
-    }
-
-ConML_GetStatus_s::~ConML_GetStatus_s()
-    {
-    delete id;
-    delete all;
-    }
-
-CXMLElement* ConML_GetStatus_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLID:
-        CHECK_NO_DUPLICATE ( id );
-        id = new ( ELeave ) pcdata_t();
-        return id;
-		
-        case EConMLAll:
-            CHECK_NO_DUPLICATE ( all );
-            all = new ( ELeave ) pcdata_t();
-            return all;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_GetStatus_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_SupplyData_s
-// -----------------------------------------------------------------------------
-ConML_SupplyData_s::ConML_SupplyData_s()
-    {
-    }
-
-ConML_SupplyData_s::~ConML_SupplyData_s()
-    {
-    delete sid;
-    delete results;
-    }
-
-CXMLElement* ConML_SupplyData_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    switch ( aTag )
-        {
-        case EConMLSID:
-            return AddSIDL ( &sid );
-		
-        case EConMLResults:
-            results = new ( ELeave ) ConML_Results_t();
-            return results;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_SupplyData_s::BeginElement() :\
-             Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// ConML_Execute_
-// -----------------------------------------------------------------------------
-ConML_Execute_s::ConML_Execute_s()
-    {
-    }
-
-ConML_Execute_s::~ConML_Execute_s()
-    {
-    delete id;
-    delete install;
-    delete unInstall;
-    delete listInstalledApps;
-    delete listDataOwners;
-    delete setBurMode;
-    delete getDataSize;
-    delete requestData;
-    delete updateDeviceInfo;
-    delete listPublicFiles;
-    delete supplyData;
-    delete reboot;
-    delete getDataOwnerStatus;
-    delete getMetadata;
-    }
-
-CXMLElement* ConML_Execute_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )	
-    {
-    
-    switch ( aTag )
-        {
-        case EConMLID:
-            CHECK_NO_DUPLICATE ( id );
-            id = new ( ELeave ) pcdata_t();
-            return id;
-		
-        case EConMLInstall:
-            CHECK_NO_DUPLICATE ( install );
-            install = new ( ELeave ) ConML_Install_t();
-            return install;
-
-        case EConMLUpdateDeviceInfo:
-            CHECK_NO_DUPLICATE (updateDeviceInfo);
-            updateDeviceInfo = new ( ELeave ) ConML_UpdateDeviceInfo_t();
-            return updateDeviceInfo;
-		
-        case EConMLUnInstall:
-            CHECK_NO_DUPLICATE ( unInstall );
-            unInstall = new ( ELeave ) ConML_UnInstall_t();
-            return unInstall;
-			
-        case EConMLListInstalledApps:
-            CHECK_NO_DUPLICATE ( listInstalledApps );
-            listInstalledApps = new ( ELeave ) ConML_ListInstalledApps_t();
-            return listInstalledApps;
-		
-        case EConMLListDataOwners:
-            CHECK_NO_DUPLICATE ( listDataOwners );
-            listDataOwners = new ( ELeave ) ConML_ListDataOwners_t();
-            return listDataOwners;
-		
-        case EConMLSetBURMode:
-            CHECK_NO_DUPLICATE ( setBurMode );
-            setBurMode = new ( ELeave ) ConML_SetBURMode_t();
-            return setBurMode;
-		
-        case EConMLGetDataSize:
-            CHECK_NO_DUPLICATE ( getDataSize );
-            getDataSize = new ( ELeave ) ConML_GetDataSize_t();
-            return getDataSize;
-		
-        case EConMLRequestData:
-            CHECK_NO_DUPLICATE ( requestData );
-            requestData = new ( ELeave ) ConML_RequestData_t();
-            return requestData;
-		
-        case EConMLListPublicFiles:
-            CHECK_NO_DUPLICATE ( listPublicFiles );
-            listPublicFiles = new ( ELeave ) ConML_ListPublicFiles_t();
-            return listPublicFiles;
-		
-        case EConMLSupplyData:
-            CHECK_NO_DUPLICATE ( supplyData );
-            supplyData = new ( ELeave ) ConML_SupplyData_t();
-            return supplyData;
-		
-        case EConMLReboot:
-            CHECK_NO_DUPLICATE ( reboot );
-            reboot = new ( ELeave ) pcdata_t();
-            return reboot;
-		
-        case EConMLGetDataOwnerStatus:
-            CHECK_NO_DUPLICATE ( getDataOwnerStatus );
-            getDataOwnerStatus = new ( ELeave ) ConML_GetDataOwnerStatus_t();
-            return getDataOwnerStatus;
-        
-        case EConMLGetMetadata:
-            CHECK_NO_DUPLICATE ( getMetadata );
-            getMetadata = new ( ELeave ) ConML_GetMetadata_t();
-            return getMetadata;
-		
-        default:
-            LOGGER_WRITE_1( "ConML_Execute_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-	
-// -----------------------------------------------------------------------------
-// ConML_ConML_s
-// -----------------------------------------------------------------------------
-ConML_ConML_s::ConML_ConML_s()
-    {
-    }
-
-ConML_ConML_s::~ConML_ConML_s()
-    {
-    delete execute;
-    delete getStatus;
-    delete cancel;
-    delete status;
-    }
-
-CXMLElement* ConML_ConML_s::BeginElementL( 
-    TUint8 aTag, const TXMLElementParams& /*aParams*/ )
-    {
-    switch( aTag )
-        {
-        case EConMLExecute:
-            CHECK_NO_DUPLICATE( execute );
-            execute = new (ELeave) ConML_Execute_t();
-            return execute;
-		
-        case EConMLGetStatus:
-            CHECK_NO_DUPLICATE ( getStatus );
-            getStatus = new ( ELeave) ConML_GetStatus_t();
-            return getStatus;
-		
-        case EConMLCancel:
-            CHECK_NO_DUPLICATE ( cancel );
-            cancel = new ( ELeave ) ConML_Cancel_t();
-            return cancel;
-		
-        case EConMLStatus:
-            CHECK_NO_DUPLICATE ( status )
-            status = new ( ELeave ) ConML_Status_t();
-            return status;
-			
-        default:
-            LOGGER_WRITE_1( "ConML_ConML_s::BeginElement()\
-             : Unknown element  %02x ", aTag );
-            User::Leave( KWBXMLParserErrorInvalidTag );
-        }
-    return KErrNone;
-    }
-
-CXMLElement::TAction ConML_ConML_s::EndElementL( TAny* aCallbacks, TUint8 aTag )
-    {
-    switch( aTag)
-        {
-        case EConML:
-            ((MWBXMLConMLCallback*) aCallbacks)->ConMLL(this);
-            return EPopAndDestroy;
-				
-        default:
-            return EPop;
-        }
-    }
-
-TBool ConML_ConML_s::NeedsCleanup() const
-    {
-    return ETrue;
-    }
-	
-
-	
-		
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/src/sconconmlgenerator.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1176 +0,0 @@
-/*
-* Copyright (c) 2005-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:  ConML parser/generator
-*
-*/
-
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------    
-#include "sconconmlgenerator.h"
-#include "sconconmlhandlererror.h"
-#include "sconconmldtd.h"
-#include "sconxmlelement.h"
-#include "debug.h"
-
-// -----------------------------------------------------------------------------
-// CSConConMLGenerator
-// -----------------------------------------------------------------------------
-CSConConMLGenerator::CSConConMLGenerator()
-    {
-    }
-    
-// -----------------------------------------------------------------------------
-// ~CSConConMLGenerator
-// -----------------------------------------------------------------------------
-CSConConMLGenerator::~CSConConMLGenerator()
-    {
-    if (iCmdStack)
-        {
-        iCmdStack->Reset();
-        delete iCmdStack;
-        iCmdStack = NULL;
-        }
-        
-    if ( iWBXMLWorkspace )
-        {
-        delete iWBXMLWorkspace;
-        iWBXMLWorkspace = NULL;
-        }
-        
-    if ( iXMLWorkspace )
-        {
-        delete iXMLWorkspace;
-        iXMLWorkspace = NULL;
-        }
-        
-    if (iCleanupStack)
-        {
-        iCleanupStack->ResetAndDestroy();
-        delete iCleanupStack;
-        iCleanupStack = NULL;
-        }
-
-    iElemStack.Close();
-    }
-    
-// -----------------------------------------------------------------------------
-// NewL
-// -----------------------------------------------------------------------------
-CSConConMLGenerator* CSConConMLGenerator::NewL ()
-    {
-    LOGGER_ENTERFN( "CSConConMLGenerator::NewL()" );
-    CSConConMLGenerator* self = new ( ELeave ) CSConConMLGenerator();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(); // self
-    LOGGER_LEAVEFN( "CSConConMLGenerator::NewL()" );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// ConstructL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::ConstructL()
-    {
-    LOGGER_ENTERFN( "CSConConMLGenerator::ConstructL()" );
-    iCmdStack = CXMLStack<CXMLElement>::NewL();
-    iCleanupStack = CXMLStack<CXMLElement>::NewL();
-    iWBXMLWorkspace = CXMLWorkspace::NewL();
-    iXMLWorkspace = CXMLWorkspace::NewL();
-    LOGGER_LEAVEFN( "CSConConMLGenerator::ConstructL()" );
-    }
-    
-// -----------------------------------------------------------------------------
-// SetCallbacks
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::SetCallback ( MWBXMLConMLCallback* aCallback )
-    {
-    iCallback = aCallback;
-    }
-
-// -----------------------------------------------------------------------------
-// StartDocument
-// -----------------------------------------------------------------------------    
-void CSConConMLGenerator::StartDocument( 
-    TUint8 /*aVersion*/, TInt32 /*aPublicId*/, TUint32 /*aCharset*/ )
-    {
-    LOGGER_ENTERFN( "CSConConMLGenerator::StartDocumentL()" );
-    iCmdStack->Reset();
-    LOGGER_LEAVEFN( "CSConConMLGenerator::StartDocumentL()" );
-    }
-
-// -----------------------------------------------------------------------------
-// StartDocument
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::StartDocument( 
-    TUint8 /*aVersion*/, const TDesC8& /*aPublicIdStr*/, TUint32 /*aCharset*/ )
-    {
-    LOGGER_ENTERFN( "CSConConMLGenerator::StartDocumentL()" );
-    iCmdStack->Reset();
-    LOGGER_LEAVEFN( "CSConConMLGenerator::StartDocumentL()" );
-    }
-    
-// -----------------------------------------------------------------------------
-// StartElementL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::StartElementL( TWBXMLTag aTag )
-    {
-    if( iCmdStack->Top() != 0 )
-        {
-        AddElementL(iCmdStack->Top()->BeginElementL( 
-            aTag, TXMLElementParams(iCallback, iCmdStack, iCleanupStack ) ) );
-        }
-    else
-        {
-        if( aTag == EConML )
-            {
-            ConML_ConML_t* element = new (ELeave) ConML_ConML_t();
-            CleanupStack::PushL( element );
-            AddElementL( element );
-            CleanupStack::Pop( element );
-            }
-        else
-            {
-            LOGGER_WRITE( "CSConConMLGenerator::StartElementL() : Leave KWBXMLParserErrorInvalidTag" );
-            User::Leave(KWBXMLParserErrorInvalidTag);
-            }
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// AddElement
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AddElementL( CXMLElement* aElement )
-    {
-    if( aElement )
-        {
-        iCmdStack->PushL(aElement);
-        if( aElement->NeedsCleanup() )
-            {
-            iCleanupStack->PushL(aElement);
-            }
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CharactersL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::CharactersL( const TDesC8& aBuffer )
-    {
-    if( iCmdStack->Top() != 0 )
-        {
-        iCmdStack->Top()->SetDataL(aBuffer);
-        }
-    else
-        {
-        LOGGER_WRITE( "CSConConMLGenerator::CharactersL() : Leave KWBXMLParserErrorInvalidTag" );
-        User::Leave(KWBXMLParserErrorInvalidTag);
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// EndElementL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::EndElementL( TWBXMLTag aTag )
-    {
-    if( iCmdStack->Top() != 0 )
-        {
-        CXMLElement::TAction action = iCmdStack->Top()->EndElementL( 
-            iCallback, aTag );
-        if( action != CXMLElement::ENone )
-            {
-            CXMLElement* elem = iCmdStack->Pop();
-            if( iCleanupStack->Top() == elem )
-                {
-                iCleanupStack->Pop();
-                }
-            if( action == CXMLElement::EPopAndDestroy )
-                {
-                delete elem;
-                }
-            }
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// WriteMUint32L
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::WriteMUint32L( TUint32 aValue )
-    {
-    TUint8 temp[5];
-    TInt i(4);
-    
-    temp[i--] = TUint8(aValue & 0x7F);
-    aValue >>= 7;
-    while( aValue > 0 )
-        {
-        temp[i--] = TUint8((aValue & 0x7F) | 0x80);
-        aValue >>= 7;
-        }
-            
-    while( i < 4 )
-        {
-        iWBXMLWorkspace->WriteL(temp[++i]);
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// WriteOpaqueDataL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::WriteOpaqueDataL( const TDesC8& aData )
-    {
-    iWBXMLWorkspace->WriteL( OPAQUE );
-    WriteMUint32L( aData.Size() );
-    iWBXMLWorkspace->WriteL( aData );
-    iXMLWorkspace->WriteL( aData );
-    }
-    
-// -----------------------------------------------------------------------------
-// WriteInlineStringL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::WriteInlineStringL( const TDesC8& aData )
-    {
-    iWBXMLWorkspace->WriteL( STR_I );
-    iWBXMLWorkspace->WriteL( aData );
-    iWBXMLWorkspace->WriteL( 0 );
-    iXMLWorkspace->WriteL( aData );
-    }
-    
-// -----------------------------------------------------------------------------
-// IndentL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::IndentL()
-    {
-    for( TInt i = 0; i < iElemStack.Count() + iInitialIndentLevel; i++ )
-        {
-        iXMLWorkspace->WriteL(KXMLIndent());
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// TranslateElement
-// -----------------------------------------------------------------------------    
-TPtrC8 CSConConMLGenerator::TranslateElement( TUint8 aElement )
-    {
-    TPtrC8 buf( KConMLElements );
-    while( aElement-- )
-        {
-        TInt pos = buf.Find(KXMLElemenentSeparator());
-        if( pos == KErrNotFound )
-            {
-            return TPtrC8();
-            }
-        buf.Set(buf.Right(buf.Length() - pos - 1));
-        }
-
-    TInt pos = buf.Find(KXMLElemenentSeparator());
-    
-    if( pos != KErrNotFound )
-        {
-        buf.Set(buf.Left(pos));
-        }
-    return buf;
-    }
-    
-// -----------------------------------------------------------------------------
-// EndDocument
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::EndDocument()
-    {
-    LOGGER_ENTERFN( "CSConConMLGenerator::EndDocument()" );
-    LOGGER_LEAVEFN( "CSConConMLGenerator::EndDocument()" );
-    }
-
-    
-// -----------------------------------------------------------------------------
-// GenerateConMLDocument
-// -----------------------------------------------------------------------------
-TInt CSConConMLGenerator::GenerateConMLDocument ( ConML_ConMLPtr_t aContent )
-    {
-    LOGGER_ENTERFN( "CSConConMLGenerator::GenerateConMLDocument()" );
-    iWBXMLWorkspace->Reset();
-    iWBXMLWorkspace->BeginTransaction();
-    iXMLWorkspace->Reset();
-    iXMLWorkspace->BeginTransaction();
-    TRAPD(result, AppendConMLL(aContent));
-    LOGGER_WRITE_1( "CSConConMLGenerator::GenerateConMLDocument()\
-     : returned %d", result );
-    return HandleResult(result);
-    }
-    
-// -----------------------------------------------------------------------------
-// AppendConMLL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendConMLL( ConML_ConMLPtr_t aContent )
-    {
-    BeginDocumentL(KSConConMLVersion, KSConConMLPublicId, KSConConMLUTF8);
-    BeginElementL(EConML, ETrue);
-    AppendExecuteL( aContent->execute );
-    AppendGetStatusL( aContent->getStatus );
-    AppendCancelL( aContent->cancel );
-    AppendStatusL( aContent->status );
-    EndElementL(); // EConML
-    }
-
-// -----------------------------------------------------------------------------
-// AppendExecuteL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendExecuteL( ConML_ExecutePtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLExecute, ETrue );
-        AppendPCDataL( EConMLID, aContent->id );
-        AppendInstallL( aContent->install );
-        AppendUnInstallL( aContent->unInstall );
-        AppendListInstalledAppsL( aContent->listInstalledApps );
-        AppendListDataOwnersL( aContent->listDataOwners );
-        AppendSetBURModeL( aContent->setBurMode );
-        AppendGetDataSizeL( aContent->getDataSize );
-        AppendRequestDataL( aContent->requestData );
-        AppendUpdateDeviceInfoL( aContent->updateDeviceInfo );
-        AppendListPublicFilesL( aContent->listPublicFiles );
-        AppendSupplyDataL( aContent->supplyData );
-        AppendGetDataOwnerStatusL( aContent->getDataOwnerStatus );
-        AppendGetMetadataL( aContent->getMetadata );
-        
-        if ( aContent->reboot )
-            {
-            BeginElementL( EConMLReboot );
-            }
-        EndElementL(); // EConMLExecute
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendSupplyDataL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendSupplyDataL( ConML_SupplyDataPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLSupplyData, ETrue );
-        AppendSIDListL( aContent->sid );
-        AppendResultsL( aContent->results );
-        EndElementL(); // EConMLSupplyData
-        }
-    }
-// -----------------------------------------------------------------------------
-// AppendInstallL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendInstallL( ConML_InstallPtr_t aContent )
-    {
-    if ( aContent)
-        {
-        BeginElementL( EConMLInstall, ETrue );
-        AppendPCDataL( EConMLName, aContent->name );
-        if ( aContent->instParams) 
-            {
-            if ( aContent->instParams->param )
-                {
-                AppendInstParamsL( aContent->instParams );  
-                }
-            else 
-                {
-                BeginElementL( EConMLInstParams );
-                }
-            }
-        AppendResultsL( aContent->results );
-        EndElementL(); // EConMLInstall
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendCancelL
-// -----------------------------------------------------------------------------    
-void CSConConMLGenerator::AppendCancelL ( ConML_CancelPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLCancel, ETrue );
-        AppendPCDataL ( EConMLID, aContent->id );
-        AppendPCDataL( EConMLAll, aContent->all);
-        EndElementL(); // EConMLCancel
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendStatusL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendStatusL ( ConML_StatusPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        if ( aContent->task )
-            {
-            BeginElementL( EConMLStatus, ETrue );
-            AppendTaskListL( aContent->task );
-            EndElementL(); // EConMLStatus
-            }
-        else
-            {
-            BeginElementL( EConMLStatus );  
-            }
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// AppendGetStatusL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendGetStatusL( ConML_GetStatusPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLGetStatus, ETrue );
-        AppendPCDataL( EConMLID, aContent->id);
-        if ( aContent->all )
-            {
-            BeginElementL( EConMLAll );
-            }
-        EndElementL(); // EConMLGetStatus
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendRebootL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendRebootL( ConML_RebootPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLReboot, ETrue );
-        AppendResultsL( aContent->results );
-        EndElementL(); // EConMLReboot
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// AppendTaskL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendTaskL( ConML_TaskPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLTask, ETrue );
-        AppendPCDataL( EConMLID, aContent->id );
-        AppendInstallL(aContent->install );
-        AppendUnInstallL( aContent->unInstall );
-        AppendListInstalledAppsL ( aContent->listInstalledApps );
-        AppendListDataOwnersL ( aContent->listDataOwners );
-        AppendSetBURModeL ( aContent->setBurMode );
-        AppendGetDataSizeL ( aContent->getDataSize );
-        AppendRequestDataL ( aContent->requestData );
-        AppendUpdateDeviceInfoL ( aContent->updateDeviceInfo);
-        AppendListPublicFilesL ( aContent->listPublicFiles );
-        AppendGetDataOwnerStatusL( aContent->getDataOwnerStatus );
-        AppendSupplyDataL( aContent->supplyData );
-        AppendRebootL( aContent->reboot );
-        AppendGetMetadataL( aContent->getMetadata );
-        EndElementL();
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// AppendTaskListL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendTaskListL( ConML_TaskListPtr_t aContent )
-    {
-    for ( ConML_TaskListPtr_t p = aContent; p && p->data; p=p->next )
-        {
-        AppendTaskL( p->data );
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// AppendListInstalledAppsL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendListInstalledAppsL ( 
-    ConML_ListInstalledAppsPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLListInstalledApps, ETrue );
-        AppendDrivesL( aContent->drives );
-        if ( aContent ->all )
-            {
-            BeginElementL( EConMLAll );
-            }
-        AppendResultsL( aContent->results );
-        EndElementL(); // EConMLListInstalledApps
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendListDataOwnersL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendListDataOwnersL ( 
-    ConML_ListDataOwnersPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        if ( aContent->results )
-            {
-            BeginElementL( EConMLListDataOwners, ETrue );
-            AppendResultsL( aContent->results );
-            EndElementL(); // EConMLListDataOwners
-            }
-        else
-            {
-            BeginElementL( EConMLListDataOwners );          
-            }
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CSConConMLGanerator::AppendBUROptionsL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendBUROptionsL( ConML_BUROptionsPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLBUROptions, ETrue );
-        if ( aContent->requiresReboot )
-            {
-            BeginElementL( EConMLRequiresReboot );
-            }
-        if ( aContent->hasFiles )
-            {
-            AppendPCDataL( EConMLHasFiles, aContent->hasFiles );
-            }
-        if ( aContent->supportsInc )
-            {
-            BeginElementL( EConMLSupportsInc );
-            }
-        if ( aContent->delayToPrepareData )
-            {
-            BeginElementL( EConMLDelayToPrepareData );
-            }
-        EndElementL(); // EConMLBUROptions
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendSetBURModeL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendSetBURModeL( ConML_SetBURModePtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLSetBURMode, ETrue );
-        AppendDrivesL( aContent->drives );
-        AppendPCDataL( EConMLPartialType, aContent->partialType );
-        AppendPCDataL( EConMLIncType, aContent->incType );
-        AppendResultsL( aContent->results );
-        EndElementL(); //EConMLSetBURMode
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// AppendUnInstallL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendUnInstallL( ConML_UnInstallPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLUnInstall, ETrue );
-        AppendApplicationsL( aContent->applications );
-        AppendInstParamsL( aContent->instParams );
-        AppendResultsL( aContent->results );
-        EndElementL(); // EConMLUnInstall
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendGetDataSizeL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendGetDataSizeL( ConML_GetDataSizePtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLGetDataSize, ETrue );
-        AppendDataOwnersL( aContent->dataOwners );
-        AppendResultsL( aContent->results );
-        EndElementL(); //EConMLGetDataSize
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendRequestDataL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendRequestDataL( ConML_RequestDataPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLRequestData, ETrue );
-        AppendSIDListL( aContent->sid );
-        AppendResultsL( aContent->results );
-        EndElementL();//EConMLRequestData
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendUpdateDeviceInfoL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendUpdateDeviceInfoL( 
-    ConML_UpdateDeviceInfoPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL(EConMLUpdateDeviceInfo, ETrue);
-        AppendDeviceInfoL( aContent-> deviceInfo );
-        AppendResultsL( aContent->results );
-        EndElementL();// EConMLUpdateDeviceInfo
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendListPublicFilesL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendListPublicFilesL( 
-    ConML_ListPublicFilesPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLListPublicFiles, ETrue );
-        AppendSIDListL ( aContent->sid );
-        AppendResultsL( aContent->results );
-        EndElementL(); // EConMLListPublicFiles
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendApplicationL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendApplicationL( ConML_ApplicationPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL(EConMLApplication, ETrue );
-        AppendPCDataL( EConMLName, aContent->name );
-        AppendPCDataL( EConMLUID, aContent->uid );
-        EndElementL(); //EConMLApplication
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendApplicationListL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendApplicationListL( 
-    ConML_ApplicationListPtr_t aContent )
-    {
-    for ( ConML_ApplicationListPtr_t p = aContent; p && p->data; p = p->next )
-        {
-        AppendApplicationL( p->data );
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendApplicationsL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendApplicationsL( 
-    ConML_ApplicationsPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLApplications, ETrue );
-        AppendApplicationListL( aContent->application );
-        EndElementL(); // EConMLApplications
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendParamL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendParamL( ConML_ParamPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLParam, ETrue );
-        AppendPCDataL( EConMLName, aContent->name );
-        AppendPCDataL( EConMLValue, aContent->value );
-        EndElementL(); // EConMLParam
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendParamListL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendParamListL( ConML_ParamListPtr_t aContent )
-    {
-    for ( ConML_ParamListPtr_t p = aContent; p && p->data; p = p->next )
-        {
-        AppendParamL( p-> data );
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendInstParamsL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendInstParamsL( ConML_InstParamsPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLInstParams, ETrue );
-        AppendParamListL( aContent->param );
-        EndElementL(); //EConMLInstParams
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendProgressL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendProgressL( ConML_ProgressPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLProgress, ETrue );
-        AppendPCDataL( EConMLValue, aContent->value );
-        EndElementL(); // EconMLProgress
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// AppendResultsL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendResultsL( ConML_ResultsPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLResults, ETrue );
-        if ( aContent->complete )
-            {
-            BeginElementL( EConMLComplete );
-            }
-        AppendProgressL( aContent->progress );
-        AppendApplicationsL( aContent->applications );
-        AppendDataOwnersL( aContent->dataOwners );
-        if ( aContent->filename )
-            {
-            AppendPCDataL( EConMLFilename, aContent->filename );
-            }
-        AppendPCDataL( EConMLData, aContent->data );
-        if ( aContent->moreData )
-            {
-            BeginElementL( EConMLMoreData );
-            }
-        AppendDeviceInfoL( aContent->deviceInfo );
-        AppendFilesL( aContent->files );
-        EndElementL(); //EConMLResults
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendDriveL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendDriveL( ConML_DrivePtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLDrive, ETrue );
-        AppendPCDataL( EConMLName, aContent->name );
-        EndElementL(); //EConMLDrive
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendDriveListL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendDriveListL( ConML_DriveListPtr_t aContent )
-    {
-    for ( ConML_DriveListPtr_t p =  aContent; p && p->data; p=p->next )
-        {
-        AppendDriveL( p->data );
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendDrivesL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendDrivesL( ConML_DrivesPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLDrives, ETrue );
-        AppendDriveListL( aContent->drive );
-        EndElementL(); // EConMLDrives
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendDataOwnersL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendDataOwnersL( ConML_DataOwnersPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLDataOwners, ETrue );
-        AppendSIDListL( aContent->sid );
-        EndElementL(); //EConMLDataOwners
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendGetDataOwnerStatusL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendGetDataOwnerStatusL
-    ( ConML_GetDataOwnerStatusPtr_t aContent )
-    {
-    if ( aContent)
-        {
-        BeginElementL( EConMLGetDataOwnerStatus, ETrue );
-        AppendDataOwnersL( aContent->dataOwners );
-        AppendResultsL( aContent->results );
-        EndElementL(); // EconMLGetDataOwnerStatus
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendGetMetadataL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendGetMetadataL
-    ( ConML_GetMetadataPtr_t aContent )
-    {
-    if ( aContent)
-        {
-        BeginElementL( EConMLGetMetadata, ETrue );
-        AppendPCDataL( EConMLFilename, aContent->filename );
-        AppendResultsL( aContent->results );
-        EndElementL(); // EConMLGetMetadata
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendPackageInfoL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendPackageInfoL ( ConML_PackageInfoPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLPackageInfo, ETrue );
-        AppendPCDataL( EConMLName, aContent->name );
-        EndElementL(); // EConMLPackageInfo
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendSIDL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendSIDL( ConML_SIDPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLSID, ETrue );
-        AppendPCDataL( EConMLType, aContent->type );
-        AppendPCDataL( EConMLUID, aContent->uid );
-        AppendPCDataL( EConMLDataOwnerStatus, aContent->dataOwnerStatus );
-        AppendDrivesL( aContent->drives );
-        if ( aContent->size )
-            {
-            AppendPCDataL( EConMLSize, aContent->size ); 
-            }
-        AppendPackageInfoL( aContent->packageInfo );
-        AppendBUROptionsL( aContent->burOptions );
-        AppendPCDataL( EConMLTransferDataType, aContent->transferDataType );
-        AppendPCDataL( EConMLData, aContent->data );
-        if ( aContent->moreData)
-            {
-            BeginElementL(EConMLMoreData );
-            }
-        EndElementL(); // EconMLSID
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// AppendSIDListL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendSIDListL( ConML_SIDListPtr_t aContent )
-    {
-    for ( ConML_SIDListPtr_t p = aContent; p && p->data; p=p->next )
-        {
-        AppendSIDL( p->data );
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendDeviceInfoL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendDeviceInfoL( ConML_DeviceInfoPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLDeviceInfo, ETrue );
-        AppendPCDataL( EConMLVersion, aContent->version );
-        AppendSupportedMethodsL ( aContent->supportedMethods );
-        AppendPCDataL(EConMLMaxObjectSize, aContent->maxObjectSize );
-        EndElementL(); // EConMLDeviceInfo
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendFilesL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendFilesL( ConML_FilesPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLFiles, ETrue );
-        AppendFileListL( aContent->file );
-        EndElementL(); // EConMLFiles
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendSupportedMethodsL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendSupportedMethodsL
-    ( ConML_SupportedMethodsPtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLSupportedMethods, ETrue );
-        if  ( aContent->install )
-            {
-            BeginElementL( EConMLInstall );
-            }
-        if ( aContent->unInstall )
-            {
-            BeginElementL( EConMLUnInstall );
-            }
-        if ( aContent->listInstalledApps )
-            {
-            BeginElementL( EConMLListInstalledApps );
-            }
-        if ( aContent->listDataOwners )
-            {
-            BeginElementL( EConMLListDataOwners );
-            }
-        if ( aContent->setBurMode )
-            {
-            BeginElementL( EConMLSetBURMode );
-            }
-        if ( aContent->getDataSize )
-            {
-            BeginElementL( EConMLGetDataSize );
-            }
-        if ( aContent->requestData )
-            {
-            BeginElementL( EConMLRequestData );
-            }
-        if ( aContent->supplyData )
-            {
-            BeginElementL( EConMLSupplyData );
-            }
-        if ( aContent->reboot )
-            {
-            BeginElementL( EConMLReboot );
-            }
-        EndElementL(); // EConMLSupportedMethods
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendFileListL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendFileListL( ConML_FileListPtr_t  aContent )
-    {
-    if ( aContent )
-        {
-        for ( ConML_FileListPtr_t p = aContent; p && p->data; p = p->next )
-            {
-            AppendFileL(p->data );
-            }
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// AppendFileL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendFileL( ConML_FilePtr_t aContent )
-    {
-    if ( aContent )
-        {
-        BeginElementL( EConMLFile, ETrue );
-        AppendPCDataL( EConMLName, aContent->name );
-        AppendPCDataL( EConMLModified, aContent->modified );
-        AppendPCDataL( EConMLSize, aContent->size );
-        AppendPCDataL( EConMLUserPerm, aContent->userPerm );
-        EndElementL(); // EConMLFile
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// HandleResult
-// -----------------------------------------------------------------------------
-TInt CSConConMLGenerator::HandleResult( TInt aResult, TInt aTreshold )
-    {
-    LOGGER_ENTERFN( "CSConConMLGenerator::HandleResult()" );
-    switch( aResult )
-        {
-        case KErrNone:
-            if( iWBXMLWorkspace->FreeSize() < aTreshold )
-                {               
-                iWBXMLWorkspace->Rollback();
-                return KWBXMLGeneratorBufferFull;
-                }
-            iWBXMLWorkspace->Commit();
-            return KWBXMLGeneratorOk;
-
-        case KErrTooBig:
-            iWBXMLWorkspace->Rollback();
-            return KWBXMLGeneratorBufferFull;
-        }
-    LOGGER_WRITE_1( "CSConConMLGenerator::HandleResult() : returned %d", aResult);
-    return aResult;
-    }
-
-// -----------------------------------------------------------------------------
-// BeginDocumentL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::BeginDocumentL( 
-    TUint8 aVersion, 
-    TInt32 aPublicId, 
-    TUint32 aCharset, 
-    const TDesC8& aStringTbl )
-    {
-    LOGGER_ENTERFN( "CSConConMLGenerator::BeginDocumentL()" );
-    iWBXMLWorkspace->WriteL(aVersion);
-
-    if( aPublicId <= 0 )
-        {
-        iWBXMLWorkspace->WriteL(0);
-        WriteMUint32L(-aPublicId);
-        }
-    else
-        {
-        WriteMUint32L(aPublicId);
-        }
-    WriteMUint32L(aCharset);
-    WriteMUint32L(aStringTbl.Size());
-    iWBXMLWorkspace->WriteL(aStringTbl);
-    LOGGER_LEAVEFN( "CSConConMLGenerator::BeginDocumentL()" );
-    }
-
-// -----------------------------------------------------------------------------
-// BeginElementL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::BeginElementL( 
-    TUint8 aElement, TBool aHasContent, TBool aHasAttributes )
-    {
-    IndentL();
-    iXMLWorkspace->WriteL(KXMLTagStart());
-    iXMLWorkspace->WriteL(TranslateElement(aElement));
-        
-    if( aHasAttributes )
-        {
-        aElement |= KWBXMLHasAttributes;
-        }
-        
-    if( aHasContent )
-        {
-        iXMLWorkspace->WriteL(KXMLTagEnd());
-        iElemStack.Insert(aElement, 0);
-        aElement |= KWBXMLHasContent;
-        }
-    else
-        {
-        iXMLWorkspace->WriteL(KXMLTagEndNoContent());
-        }
-
-    if( !iDontNewLine )
-        {
-        iXMLWorkspace->WriteL(KXMLNewLine());
-        }
-    iDontNewLine = EFalse;
-
-    WriteMUint32L(aElement);
-    }
-
-// -----------------------------------------------------------------------------
-// EndElementL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::EndElementL()
-    {
-    TUint8 elem = iElemStack[0];
-    iElemStack.Remove(0);
-    if( !iDontIndent )
-        {
-        IndentL();
-        }
-    iDontIndent = EFalse;
-    iXMLWorkspace->WriteL(KXMLTagStartEndTag());
-    iXMLWorkspace->WriteL(TranslateElement(elem));
-    iXMLWorkspace->WriteL(KXMLTagEnd());
-    iXMLWorkspace->WriteL(KXMLNewLine());
-    
-    iWBXMLWorkspace->WriteL(END);
-    }
-
-// -----------------------------------------------------------------------------
-// AddElementL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AddElementL( 
-    TUint8 aElement, const TDesC8& aContent, const TWBXMLContentFormat aFormat )
-    {
-    iDontNewLine = ETrue;
-    BeginElementL(aElement, ETrue);
-    if( aFormat == EWBXMLContentFormatOpaque )
-        {
-        WriteOpaqueDataL(aContent);
-        }
-    else
-        {
-        WriteInlineStringL(aContent);
-        }
-    iDontIndent = ETrue;
-    EndElementL();
-    }
-
-// -----------------------------------------------------------------------------
-// AppendPCDataL
-// -----------------------------------------------------------------------------
-void CSConConMLGenerator::AppendPCDataL( TUint8 aElement, pcdataPtr_t aContent )
-    {
-    if( !aContent )
-        {
-        return;
-        }
-
-    if( aContent->contentType == SML_PCDATA_OPAQUE )
-        {
-        AddElementL(aElement, 
-                    TPtrC8((TUint8*)aContent->content, 
-                    aContent->length));
-        }
-    else
-        {
-        LOGGER_WRITE( "CSConConMLGenerator::AppendPCDataL() : Data type not Opaque - ignoring " );
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// WBXMLDocument
-// -----------------------------------------------------------------------------
-TPtrC8 CSConConMLGenerator::WBXMLDocument()
-    {
-    return iWBXMLWorkspace->Buffer();
-    }
-    
-// -----------------------------------------------------------------------------
-// XMLDocument
-// -----------------------------------------------------------------------------
-TPtrC8 CSConConMLGenerator::XMLDocument()
-    {
-    return iXMLWorkspace->Buffer();
-    }
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/src/sconconmlhandler.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,454 +0,0 @@
-/*
-* Copyright (c) 2005-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:  ConML parser/generator
-*
-*/
-
-
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-#include <s32mem.h>
-
-#include "sconconmlhandler.h"
-#include "debug.h"
-
-// -----------------------------------------------------------------------------
-// CreateCSConConMLHandlerL
-// Creates a new instance of CSConConMLHandler
-// -----------------------------------------------------------------------------
-//  
-EXPORT_C CSConConMLHandler* CreateCSConConMLHandlerL()
-    {
-    LOGGER_ENTERFN( "CreateCSConConMLHandlerL()" );
-    LOGGER_LEAVEFN( "CreateCSConConMLHandlerL()" );
-    return CSConConMLHandler::NewL();
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::CSConConMLHandler()
-// Default constructor
-// -----------------------------------------------------------------------------
-//  
-CSConConMLHandler::CSConConMLHandler()
-    {
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::CSConConMLHandler()
-// Default constructor
-// -----------------------------------------------------------------------------
-//  
-CSConConMLHandler::~CSConConMLHandler()
-    {
-    LOGGER_ENTERFN( "CSConConMLHandler::~CSConConMLHandler()" );
-    
-    if ( iParseBuffer )
-        {
-        LOGGER_WRITE( "CSConConMLHandler::~CSConConMLHandler() : phase 1/4 " );
-        delete iParseBuffer;
-        iParseBuffer = NULL;
-        }
-    
-    if ( iBuffer )
-        {
-        LOGGER_WRITE( "CSConConMLHandler::~CSConConMLHandler() : phase 2/4 " );
-        delete iBuffer;
-        iBuffer = NULL;
-        }
-    
-    if ( iGenerator )
-        {
-        LOGGER_WRITE( "CSConConMLHandler::~CSConConMLHandler() : phase 3/4 " );
-        delete iGenerator;
-        iGenerator = NULL;
-        }
-
-    if ( iStringTable )
-        {
-        LOGGER_WRITE( "CSConConMLHandler::~CSConConMLHandler() : phase 4/4 " );
-        delete iStringTable;
-        iStringTable = NULL;
-        }
-
-    iElemStack.Close();
-    
-    LOGGER_LEAVEFN( "CSConConMLHandler::~CSConConMLHandler()" );
-    }
-        
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::CSConConMLHaNewL()
-// Creates a new instance of CSConConMLHandler
-// -----------------------------------------------------------------------------
-//  
-CSConConMLHandler* CSConConMLHandler::NewL()
-    {
-    LOGGER_ENTERFN( "CSConConMLHandler::NewL()" );
-    CSConConMLHandler* self = new ( ELeave ) CSConConMLHandler();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(); // self
-    LOGGER_LEAVEFN( "CSConConMLHandler::NewL()" );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::ConstructL()
-// 2nd phase constructor
-// -----------------------------------------------------------------------------
-//  
-void CSConConMLHandler::ConstructL()
-    {
-    LOGGER_ENTERFN( "CSConConMLHandler::ConstructL()" );
-    iGenerator = CSConConMLGenerator::NewL();
-    iBuffer = CBufFlat::NewL( KSConBufferGranularity );
-    iParseBuffer = CBufFlat::NewL( KSConDefaultDocumentSize );
-    LOGGER_LEAVEFN( "CSConConMLHandler::ConstructL()" );
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::ParseDocumentL()
-// Handles the document parsing, document in aInput
-// -----------------------------------------------------------------------------
-//  
-TInt CSConConMLHandler::ParseDocumentL( 
-    CBufFlat& aInput, MWBXMLConMLCallback* aCallback )
-    {
-    LOGGER_ENTERFN( "CSConConMLHandler::ParseDocument()" );
-    TInt ret ( KErrNone );
-        
-    iPos = 0;
-    iParseBuffer->Reset();
-    iParseBuffer->ResizeL( aInput.Size() );
-    iParseBuffer->Write( 0, aInput.Ptr(0) );
-    iHeaderParsed = EFalse;
-    iGenerator->SetCallback( aCallback );
-
-    while (ret == KWBXMLParserErrorOk )
-        {
-        ret = ParseL();
-        }
-
-    if ( ret == KWBXMLParserErrorEof ) 
-        {
-        ret = KErrNone;
-        }
-    LOGGER_WRITE_1( "CSConConMLHandler::ParseDocument()\
-     returned %d", ret );   
-    return ( ret );
-    }
-
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::GenerateDocument()
-// Starts the generating of a document
-// -----------------------------------------------------------------------------
-//  
-TInt CSConConMLHandler::GenerateDocument( ConML_ConMLPtr_t aContent )
-    {
-    LOGGER_ENTERFN( "CSConConMLHandler::GenerateDocument()" );
-    iGenerator->GenerateConMLDocument ( aContent );
-    LOGGER_LEAVEFN( "CSConConMLHandler::GenerateDocument()" );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::WBXMLDocument()
-// Returns the generated WBXML -document
-// -----------------------------------------------------------------------------
-//  
-TPtrC8 CSConConMLHandler::WBXMLDocument()
-    {
-    return iGenerator->WBXMLDocument();
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::XMLDocument()
-// Returns the generated XML -document
-// -----------------------------------------------------------------------------
-//  
-TPtrC8 CSConConMLHandler::XMLDocument()
-    {
-    return iGenerator->XMLDocument();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::ParseL()
-// Parses the next document tag / header if not parsed yet
-// -----------------------------------------------------------------------------
-//  
-TInt CSConConMLHandler::ParseL()
-    {
-    LOGGER_ENTERFN( "CSConConMLHandler::ParseL()" );
-    if( !iHeaderParsed )
-        {
-        TConMLParserError result(KWBXMLParserErrorOk);
-        TRAPD(err,  result = DoParseDocumentHeaderL());
-        if( err == KErrEof )
-            {
-            LOGGER_WRITE( "CSConConMLHandler::ParseL() : KWBXMLParserErrorEofTooEarly " );
-            return KWBXMLParserErrorEofTooEarly;
-            }
-        return result;
-        }
-    LOGGER_LEAVEFN( "CSConConMLHandler::ParseL()" );
-    return DoParseDocumentBodyL();
-    }
-
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::DoParseDocumentHeaderL()
-// Parses the document header
-// -----------------------------------------------------------------------------
-//  
-TConMLParserError CSConConMLHandler::DoParseDocumentHeaderL()
-    {
-    LOGGER_ENTERFN( "CSConConMLParser::DoParseDocumentHeaderL()" );
-    iHeaderParsed = ETrue;
-
-    // Version
-    TUint8 version = ReadUint8L();
-    
-    // PublicId
-    TInt32 publicId = ReadMUint32L();
-
-    if( publicId == 0 )
-        {
-        publicId = ReadMUint32L();
-        }
-    else
-        {
-        publicId = -publicId;
-        }
-
-    // Charset
-    TUint32 charSet = ReadMUint32L();
-
-    // String table
-    ReadStringTableL();
-
-    // Document begins now
-    if( publicId < 0 )
-        {
-        iGenerator->StartDocument(version, -publicId, charSet);
-        }
-    else
-        {
-        iGenerator->StartDocument(version, 
-            StringTableString(publicId), charSet);
-        }
-    LOGGER_LEAVEFN( "CSConConMLHandler::DoParseDocumentHeaderL()" );
-    return KWBXMLParserErrorOk;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::DoParseDocumentBodyL()
-// Parses the next element of the document
-// -----------------------------------------------------------------------------
-//  
-TConMLParserError CSConConMLHandler::DoParseDocumentBodyL()
-    {
-    LOGGER_ENTERFN( "CSConConMLHandler::DoParseDocumentBodyL()" );
-    TUint8 id(0);
-    TRAPD(err, id = ReadUint8L());
-
-    if( err != KErrNone )
-        {
-        if( err == KErrEof )
-            {
-            iGenerator->EndDocument();
-            if( iElemStack.Count() > 0 )
-                {
-                LOGGER_WRITE( "CSConConMLHandler::DoParseDocumentBodyL() : KWBXMLParserErrorEofTooEarly " );
-                return KWBXMLParserErrorEofTooEarly;
-                }
-            return KWBXMLParserErrorEof;
-            }
-        User::Leave(err);
-        }
-    
-    switch (id) 
-        {
-        case END:
-            {
-            if( !iElemStack.Count() )
-                {
-                LOGGER_WRITE( "CSConConMLHandler::DoParseDocumentBodyL() : KWBXMLParserErrorinvalidDocument " );
-                User::Leave( KWBXMLParserErrorinvalidDocument );
-                }
-            TUint8 tag( iElemStack.operator[](iElemStack.Count() - 1 ));
-            iGenerator->EndElementL( tag );
-            iElemStack.Remove(iElemStack.Count() - 1);
-            }
-            break;
-    
-        case STR_I: 
-            iGenerator->CharactersL(ReadStrIL());
-            break;
-        
-        case OPAQUE:
-            iGenerator->CharactersL(ReadOpaqueL());
-            break;
-
-        default: 
-            HandleElementL(id);
-            break;
-        }
-    LOGGER_LEAVEFN( "CSConConMLHandler::DoParseDocumentBodyL()" );
-    return KWBXMLParserErrorOk;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::ReadUint8L()
-// Reads one byte from the document
-// -----------------------------------------------------------------------------
-//  
-TUint8 CSConConMLHandler::ReadUint8L()
-    {
-    if ( iPos == iParseBuffer->Size()) 
-        {
-        User::Leave ( KErrEof );
-        }
-    TUint8 value;
-    HBufC8* data = HBufC8::NewLC( sizeof(TUint8) );
-    TPtr8 ptr = data->Des();
-    iParseBuffer->Read(iPos, ptr, sizeof(TUint8));
-    iPos+= sizeof(TUint8);
-    value = ptr[0];
-    CleanupStack::PopAndDestroy(1); //data 
-    return value;
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::ReadMUint32L()
-// Reads multibyte coding from the document
-// -----------------------------------------------------------------------------
-//  
-TUint32 CSConConMLHandler::ReadMUint32L()
-    {
-    TUint32 result = 0;
-    TUint8 c;
-    
-    do  {
-        c = ReadUint8L();
-        result = (result << 7) | (c & 0x7f);
-        } while ( c & 0x80 );
-    
-    return result;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::ReadStrIL()
-// Reads string data from the document
-// -----------------------------------------------------------------------------
-//  
-TPtrC8 CSConConMLHandler::ReadStrIL()
-    {
-    iBuffer->Reset();
-    RBufWriteStream bws(*iBuffer);
-    TUint8 c;
-    while( (c = ReadUint8L()) != 0 )
-        {
-        bws.WriteUint8L(c);
-        }
-    bws.CommitL();
-    return iBuffer->Ptr(0);
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::ReadStringTableL()
-// Handles the document's string table
-// -----------------------------------------------------------------------------
-//  
-void CSConConMLHandler::ReadStringTableL()
-    {
-    delete iStringTable;
-    iStringTable = NULL;
-    TUint32 strTblLen = ReadMUint32L();
-
-    if( strTblLen > 0 )
-        {
-        if( iPos+strTblLen > iParseBuffer->Size()) 
-            {
-            LOGGER_WRITE( "CSConConMLHandler::ReadStringTableL() : LEAVE KErrEof " );
-            User::Leave ( KErrEof );
-            }
-        iStringTable = HBufC8::NewL(strTblLen);
-        TPtr8 ptr = iStringTable->Des();
-        iParseBuffer->Read(iPos, ptr, strTblLen);
-        iPos+=strTblLen;
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::StringTableString()
-// Returns a value from the string table according to the given index
-// -----------------------------------------------------------------------------
-//  
-TPtrC8 CSConConMLHandler::StringTableString( TUint32 aIndex )
-    {
-    TPtrC8 temp(iStringTable->Mid(aIndex));
-    TInt pos = temp.Find(KWBXMLNull());
-    if( pos != KErrNotFound )
-        {
-        temp.Set(temp.Left(pos));
-        }
-    return temp;
-    }
-
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::HandleElementL()
-// Starts a new element in the document
-// -----------------------------------------------------------------------------
-//  
-void CSConConMLHandler::HandleElementL( TUint8 aId )
-    {
-    TUint8 tag(TUint8(aId & 0x3f));
-        
-    iGenerator->StartElementL( tag );
-
-    if( aId & 0x40 ) 
-        {
-        iElemStack.Append( tag );
-        }
-    else 
-        {
-        iGenerator->EndElementL(tag);
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CSConConMLHandler::ReadOpaqueL()
-// Reads opaque data from the document
-// -----------------------------------------------------------------------------
-//  
-TPtrC8 CSConConMLHandler::ReadOpaqueL()
-    {
-    iBuffer->Reset();
-    RBufWriteStream bws(*iBuffer);
-    TUint32 length = ReadMUint32L();
-    if( iPos+length > iParseBuffer->Size()) 
-        {
-        LOGGER_WRITE( "CSConConMLHandler::ReadOpaqueL() : LEAVE KErrEof " );
-        User::Leave ( KErrEof );
-        }
-    HBufC8* data = HBufC8::NewLC( length );
-    TPtr8 ptr = data->Des();
-    iParseBuffer->Read( iPos, ptr, length );
-    iPos+= length;
-    bws.WriteL(ptr, length);
-    bws.CommitL();
-    CleanupStack::PopAndDestroy(1); // data
-    
-    return iBuffer->Ptr(0);
-    }
-
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/src/sconxmlelement.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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:  ConML parser/generator
-*
-*/
-
-
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-
-#include "sconxmlelement.h"
-#include "sconconmldtd.h"
-
-// -----------------------------------------------------------------------------
-// TElementParams
-// -----------------------------------------------------------------------------
-TXMLElementParams::TXMLElementParams( 
-    TAny* aCallbacks, 
-    CXMLStack<CXMLElement>* aCmdStack, 
-    CXMLStack<CXMLElement>* aCleanupStack ) :
-	iCallbacks(aCallbacks), 
-	iCmdStack(aCmdStack), 
-	iCleanupStack(aCleanupStack)
-	{
-	}
-
-// -----------------------------------------------------------------------------
-// CXMLElement
-// -----------------------------------------------------------------------------
-CXMLElement* CXMLElement::BeginElementL( 
-    TUint8 /*aTag*/, const TXMLElementParams& /*Params*/ )
-	{
-	return 0;
-	}
-
-// -----------------------------------------------------------------------------
-CXMLElement::TAction CXMLElement::EndElementL( TAny* /*aCallbacks*/, 
-    TUint8 /*aTag*/ )
-	{
-	return EPop;
-	}
-
-
-// -----------------------------------------------------------------------------
-TBool CXMLElement::NeedsCleanup() const
-	{
-	return EFalse;
-	}
-
-// -----------------------------------------------------------------------------
-void CXMLElement::SetDataL( const TDesC8& /*aData*/ )
-	{
-	}
-
-// -----------------------------------------------------------------------------
-TPtrC8 CXMLElement::Data() const
-	{
-	return TPtrC8();
-	}
-
-// -----------------------------------------------------------------------------
-TBool CXMLElement::Validate()
-	{
-	return ETrue;
-	}
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/src/sconxmlworkspace.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +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:  ConML parser/generator
-*
-*/
-
-
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-#include "sconxmlworkspace.h"
-
-// -----------------------------------------------------------------------------
-// CXMLWorkspace
-// -----------------------------------------------------------------------------
-CXMLWorkspace::CXMLWorkspace()
-	{
-	}
-	
-// -----------------------------------------------------------------------------
-// NewL
-// -----------------------------------------------------------------------------
-CXMLWorkspace* CXMLWorkspace::NewL()
-	{
-	CXMLWorkspace* self = new (ELeave) CXMLWorkspace();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(); // self
-	return self;
-	}
-
-// -----------------------------------------------------------------------------
-// ConstructL
-// -----------------------------------------------------------------------------
-void CXMLWorkspace::ConstructL()
-	{
-	iBuffer = CBufFlat::NewL(32);
-	iTransactions = new (ELeave) RArray<TUint>();
-	}
-
-// -----------------------------------------------------------------------------
-// ~CXMLWorkspace
-// -----------------------------------------------------------------------------
-CXMLWorkspace::~CXMLWorkspace()
-	{
-	delete iBuffer;
-	if( iTransactions )
-		{
-		iTransactions->Reset();
-		}
-	delete iTransactions;
-	}
-
-// -----------------------------------------------------------------------------
-// BeginTransaction
-// -----------------------------------------------------------------------------
-void CXMLWorkspace::BeginTransaction()
-	{
-	iTransactions->Append(Size());
-	}
-	
-// -----------------------------------------------------------------------------
-// Commit
-// -----------------------------------------------------------------------------
-TInt CXMLWorkspace::Commit()
-	{
-	if( iTransactions->Count() == 0 )
-		{
-		return KErrGeneral;
-		}
-	iTransactions->Remove(iTransactions->Count() - 1);
-	return KErrNone;
-	}
-
-// -----------------------------------------------------------------------------
-// CommitAll
-// -----------------------------------------------------------------------------
-void CXMLWorkspace::CommitAll()
-	{
-	iTransactions->Reset();
-	}
-
-// -----------------------------------------------------------------------------
-// Rollback
-// -----------------------------------------------------------------------------
-TInt CXMLWorkspace::Rollback()
-	{
-	if( iTransactions->Count() == 0 )
-		{
-		return KErrGeneral;
-		}
-	TUint begin = iTransactions->operator[](iTransactions->Count() - 1);
-	Delete(begin, Size() - begin);
-	iTransactions->Remove(iTransactions->Count() - 1);
-	return KErrNone;
-	}
-	
-// -----------------------------------------------------------------------------
-// Reset
-// -----------------------------------------------------------------------------
-void CXMLWorkspace::Reset()
-	{
-	iBuffer->Reset();
-	}
-
-// -----------------------------------------------------------------------------
-// WriteL
-// -----------------------------------------------------------------------------
-void CXMLWorkspace::WriteL( const TDesC8& aData )
-	{
-	TRAPD(err, iBuffer->InsertL(iBuffer->Size(), aData));
-	if( err != KErrNone )
-		{
-		User::Leave(KErrTooBig);
-		}
-	}
-
-// -----------------------------------------------------------------------------
-// WriteL
-// -----------------------------------------------------------------------------
-void CXMLWorkspace::WriteL( const TUint8 aData )
-	{
-	WriteL(TPtrC8(&aData, 1));
-	}
-
-// -----------------------------------------------------------------------------
-// Buffer
-// -----------------------------------------------------------------------------
-TPtrC8 CXMLWorkspace::Buffer()
-	{
-	return iBuffer->Ptr(0);
-	}
-
-// -----------------------------------------------------------------------------
-// FreeSize
-// -----------------------------------------------------------------------------
-TInt CXMLWorkspace::FreeSize()
-	{
-	return (KMaxTInt32 - Size());
-	}
-
-// -----------------------------------------------------------------------------
-// MaxSize
-// -----------------------------------------------------------------------------
-TInt CXMLWorkspace::MaxSize()
-	{
-	return KMaxTInt32;
-	}
-
-// -----------------------------------------------------------------------------
-// Size
-// -----------------------------------------------------------------------------
-TInt CXMLWorkspace::Size()
-	{
-	return iBuffer->Size();
-	}
-
-// -----------------------------------------------------------------------------
-// Delete
-// -----------------------------------------------------------------------------
-void CXMLWorkspace::Delete( TInt aPos, TInt aLength )
-	{
-	iBuffer->Delete(aPos, aLength);
-	}
--- a/connectivitymodules/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/*
-* Copyright (c) 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:  Build information file
-*
-*/
-
-
-#include "../SeCon/group/bld.inf"
--- a/contentcontrol.pro	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#
-#   Name        : contentcontrol.pro
-#   Part of     : contentcontrol  
-#   Description : This is the project specification file for the contentcontrol project.
-#   Version     : 1
-#
-#   Copyright © 2009 Nokia.  All rights reserved.
-#   This material, including documentation and any related computer
-#   programs, is protected by copyright controlled by Nokia.  All
-#   rights are reserved.  Copying, including reproducing, storing,
-#   adapting or translating, any or all of this material requires the
-#   prior written consent of Nokia.  This material also contains
-#   confidential information which may not be disclosed to others
-#   without the prior written consent of Nokia.
-#
-
-TEMPLATE = subdirs
-CONFIG += ordered
-SUBDIRS += omads
-
-# End of file	--Don't remove this.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/adapter_customization_api.metaxml	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="362b63ad05d47d3510d9b5b064228d45" dataversion="1.0">
+  <name>Adapter Customization API</name>
+  <description>Exports Contact Adapter API to make possible to inherit Contact Adapter and create Extended Contacts Adapters</description>
+  <type>c++</type>
+  <subsystem>omads</subsystem>
+  <libs>
+    <lib name="nsmlcontactsdataprovider.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>no</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 that exports the files belonging to 
+:               Adapter Customization API
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/NSmlContactsDataProvider.h APP_LAYER_PLATFORM_EXPORT_PATH(NSmlContactsDataProvider.h)
+../inc/NSmlContactsDataStore.h APP_LAYER_PLATFORM_EXPORT_PATH(NSmlContactsDataStore.h)
+../inc/MContactsModsFetcher.h APP_LAYER_PLATFORM_EXPORT_PATH(MContactsModsFetcher.h)
+
+PRJ_TESTMMPFILES
+../tsrc/DummyAdapter/group/nsmldummydataprovider.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/inc/MContactsModsFetcher.h	Wed Sep 01 12:30:02 2010 +0100
@@ -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:  DS contacts dataprovider.
+*
+*/
+
+#ifndef MCONTACTSMODSFETCHER_H
+#define MCONTACTSMODSFETCHER_H
+
+//  EXTERNAL INCLUDES
+#include <e32def.h>
+
+
+//  CLASS DEFINITION
+/**
+ * Interface class for Contacts mods fetcher
+ * @since 3.23
+ */
+class MContactsModsFetcher
+    {
+    public:     // Destructor
+
+        virtual ~MContactsModsFetcher() {}
+
+    public:     // Abstract methods
+
+        /**
+        * Cancels the current asynchronous request
+        */
+        virtual void CancelRequest( ) = 0;
+
+        /**
+        * Reads all modifications from clients contacts databse.
+        * @param aStatus  On completion of the operation, contains the result code.
+        */
+        virtual void FetchModificationsL( TRequestStatus& aStatus ) = 0;
+
+    };
+
+#endif      //  MCONTACTSMODSFETCHER_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/inc/NSmlContactsDataProvider.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,160 @@
+/*
+* 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:  DS contacts dataprovider.
+*
+*/
+
+
+#ifndef __NSMLCONTACTSDATAPROVIDER_H__
+#define __NSMLCONTACTSDATAPROVIDER_H__
+
+// INCLUDES
+#include <f32file.h>
+#include <SmlDataProvider.h>
+#include <NSmlContactsDataStore.h>
+
+// CLASS DECLARATION
+
+// ------------------------------------------------------------------------------------------------
+//  CNSmlContactsDataProvider
+//
+//  @lib nsmlcontactsdataprovider.lib
+// ------------------------------------------------------------------------------------------------
+class CNSmlContactsDataProvider : public CSmlDataProvider 
+	{
+	public:
+		/**
+		* Two-phased constructor.
+		*/
+		IMPORT_C static CNSmlContactsDataProvider* NewL();
+
+		/**
+		* Destructor.
+		*/
+		IMPORT_C virtual ~CNSmlContactsDataProvider();
+
+	protected:
+		/**
+		* Two-phased constructor.
+		*/
+	    IMPORT_C static CNSmlContactsDataProvider* NewLC();
+
+		/**
+		* This method handles framework events.
+		* @param					Frameworks event.
+		* @param	aParam1			First parameter.
+		* @param	aParam2			Second parameter.
+		*/
+	    IMPORT_C void DoOnFrameworkEvent(TSmlFrameworkEvent, TInt aParam1, TInt aParam2);
+
+		/**
+		* Check if operation is supported by dataprovider.
+		* @param	aOpId			Operations type.
+		* @return	ETrue if the operation is supported.
+		*/
+	    IMPORT_C TBool DoSupportsOperation(TUid aOpId) const;
+
+		/**
+		* Gets dataproviders own StoreFormat.
+		*/
+	    IMPORT_C const CSmlDataStoreFormat& DoStoreFormatL();
+
+		/**
+		* Lists all contacts databases on client.
+		* @return List of contact databases.
+		*/
+	    IMPORT_C CDesCArray* DoListStoresLC();
+
+		/**
+		* Gets default storename on client.
+		* @return Default storename.
+		*/
+	    IMPORT_C const TDesC& DoDefaultStoreL();
+
+		/**
+		* Constructs new instance of datastore.
+		* @return Newly created instance.
+		*/
+	    IMPORT_C CSmlDataStore* DoNewStoreInstanceLC();
+
+		/**
+		This method returns the set of filters that can be used to send to the SyncML server.
+		* @return New filters.
+		*/
+	    IMPORT_C const RPointerArray<CSyncMLFilter>& DoSupportedServerFiltersL();
+		
+		/**
+		This method checks what filters are supported by server.
+		@param	aServerDataStoreFormat	The store format of server
+		@param	aFilters				The array that includes filters
+		@param	aChangeInfo				The change information about changes that data provider did
+		*/
+	    IMPORT_C void DoCheckSupportedServerFiltersL(const CSmlDataStoreFormat& aServerDataStoreFormat, RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo);
+		
+		/**
+		This method updates dynamic filters up-to-date.
+		@param	aFilters				The array that includes filters
+		@param	aChangeInfo				The change information about changes that data provider did
+		*/
+	    IMPORT_C void DoCheckServerFiltersL(RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo);
+		
+		/**
+		This method generates a record filter query to be sent to the SyncML server for the provided filters.
+		@param	aFilters			The filters to be used for the query generation
+		@param	aMatch				The filter match type to be used
+		@param	aFilterMimeType		The mime type of the returned filter query
+		@param	TSyncMLFilterType 	The filter type of the returned filter query
+		@param	aStoreName			The name of used store
+		@return						The record filter query to be sent to the SyncML server - empty if no record filter involved
+									for this specific filter
+		*/
+	    IMPORT_C HBufC* DoGenerateRecordFilterQueryLC(const RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterMatchType aMatch, TDes& aFilterMimeType, TSyncMLFilterType& aFilterType, TDesC& aStoreName);
+		
+		/**
+		This method generates a field filter query to be sent to the SyncML server for the provided filters.
+		@param	aFilters		The filters to be used for the query generation
+		@param	aFilterMimeType		The mime type of the returned filter query
+		@param	aProperties		The field filter query to be sent to the SyncML server - empty if no field filter involved
+								for this specific filter
+		@param  aStoreName		The name of used store
+		*/
+	    IMPORT_C void DoGenerateFieldFilterQueryL(const RPointerArray<CSyncMLFilter>& aFilters, TDes& aFilterMimeType, RPointerArray<CSmlDataProperty>& aProperties, TDesC& aStoreName);
+
+		/**
+		* C++ constructor.
+		*/
+	    IMPORT_C CNSmlContactsDataProvider();
+
+		/**
+		* 2nd phase constructor.
+		*/
+	    IMPORT_C void ConstructL();
+
+	protected: // New 
+
+	    IMPORT_C virtual const TDesC& GetStoreFormatResourceFileL() const;
+
+	    IMPORT_C virtual CNSmlContactsDataStore* CreateDataStoreLC() const;
+
+	private: // data
+		CNSmlContactsDataStore* iContactsDataStore; 
+		RPointerArray<CSyncMLFilter> iFilterArray;
+		RFs iRfs;
+		RStringPool iStringPool;
+		CSmlDataStoreFormat* iStoreFormat;
+	};
+	
+#endif // __NSMLCONTACTSDATAPROVIDER_H__
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/inc/NSmlContactsDataStore.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,774 @@
+/*
+* Copyright (c) 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:  DS contacts datastore.
+*
+*/
+
+
+#ifndef __NSMLCONTACTSDATASTORE_H__
+#define __NSMLCONTACTSDATASTORE_H__
+
+// INCLUDE FILES
+#include <SmlDataProvider.h>
+#include <SmlDataFormat.h>
+#include <f32file.h>
+
+//vpbk headers
+#include <CVPbkContactManager.h>
+#include <MVPbkContactStore.h>
+#include <MVPbkContactStoreObserver.h>
+#include <MVPbkBatchOperationObserver.h>
+#include <MVPbkContactViewObserver.h>
+#include <CVPbkSortOrder.h>
+#include <CVPbkContactIdConverter.h>
+#include <CVPbkContactLinkArray.h>
+#include <MVPbkContactViewBase.h>
+#include <MVPbkSingleContactOperationObserver.h>
+#include <CVPbkVCardEng.h>
+#include <MVPbkContactCopyObserver.h>
+#include <MVPbkBatchOperationObserver.h>
+#include <MVPbkContactViewObserver.h>
+#include <MVPbkContactOperationBase.h>
+#include <CVPbkSortOrder.h>
+#include <s32mem.h>
+
+// MACROS
+#define KNSmlvCard21Version TVersion(2,1,0);
+#define KNSmlvCard30Version TVersion(3,0,0);
+
+// CONSTANTS
+_LIT(  KNSmlContactStoreNameForDefaultDB, "C:Contacts.cdb" );
+_LIT(  KNSmlDriveC, "C" );
+_LIT8( KNSmlvCard30Name, "text/vcard" );
+_LIT8( KNSmlvCard30Ver, "3.0" );
+_LIT8( KNSmlvCard21Name, "text/x-vcard" );
+_LIT8( KNSmlvCard21Ver, "2.1" );
+
+_LIT8( KVersitTokenHOME, "HOME"  );
+_LIT8( KVersitTokenWORK, "WORK"  );
+_LIT8( KVersitTokenCELL, "CELL"  );
+_LIT8( KVersitTokenPAGER,"PAGER" );
+_LIT8( KVersitTokenFAX,  "FAX"   );
+_LIT8( KVersitTokenVOICE,"VOICE" );
+_LIT8( KVersitTokenVIDEO,"VIDEO" );
+
+//CONSTANTS INTRODUCED FOR HAVING BACKWARD COMPATIBLE PHONE DB SENT TO SERVER
+//THE CHANGE WAS NEEDED AFTER ADAPTING TO VIRTUAL PHONEBOOK
+_LIT( KLegacySymbianDatabase,"C:Contacts.cdb");
+const TInt KOldSymbianDBLength = 20;
+
+_LIT( KVPbhkSymbianDBPrefix,"cntdb://");
+const TInt KVPbhkPrefixLength = 10;
+
+//End NEW CONSTANTS
+const TInt KNSmlContactsGranularity = 8;
+const TInt KNSmlCompactAfterChanges = 16;
+const TInt KNSmlDataStoreMaxSize = 102400;		// 100 k
+const TInt KNSmlDefaultStoreNameMaxSize = 256;
+const TInt KNSmlItemDataExpandSize = 1024;
+const TInt KNSmlNoError = 1;
+
+_LIT(KNSmlContactsStoreFormatRsc_1_1_2,"NSmlContactsDataStoreFormat_1_1_2.rsc");
+_LIT(KNSmlContactsStoreFormatRsc_1_2,"NSmlContactsDataStoreFormat_1_2.rsc");
+
+// FORWARD DECLARATIONS
+class MContactsModsFetcher;
+class CNSmlDataModBase;
+class CNSmlChangeFinder;
+class CNSmlDataItemUidSet;
+	
+// CLASS DECLARATION
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataStore
+//
+// @lib nsmlcontactsdataprovider.lib
+// ------------------------------------------------------------------------------------------------
+class CNSmlContactsDataStore : public CSmlDataStore,
+    public MVPbkContactStoreObserver,
+    public MVPbkSingleContactOperationObserver,
+	public MVPbkContactCopyObserver,
+	public MVPbkBatchOperationObserver,
+	public MVPbkContactViewObserver,
+	public MVPbkContactOperationBase
+	{
+	public:	
+		/**
+		* Two-phased constructor.
+		*/
+	    IMPORT_C static CNSmlContactsDataStore* NewL();
+
+		/**
+		* Destructor.
+		*/
+	    IMPORT_C virtual ~CNSmlContactsDataStore();
+
+		/**
+		* Default store name of client.
+		* @return Default store name.
+		*/
+	    IMPORT_C const TDesC& DefaultStoreNameL() const;
+
+		/**
+		* Gets a list of all contacts databases on client.
+		* @return List of databases.
+		*/
+	    IMPORT_C CDesCArray* DoListStoresLC();
+		
+
+	protected:
+		/**
+		* From MVPbkContactStoreListObserver  
+		* Called when a contact store is ready to use.
+		*/
+	    IMPORT_C void StoreReady( MVPbkContactStore& aContactStore );
+		 
+		/**
+		* From MVPbkContactStoreListObserver  
+		* Called when a contact store becomes unavailable.
+		*/
+	    IMPORT_C void StoreUnavailable(MVPbkContactStore& aContactStore,TInt aReason );
+	
+		/**
+		* From MVPbkContactStoreListObserver  
+		*  Called when changes occur in the contact store.
+		*/
+	    IMPORT_C void HandleStoreEventL(MVPbkContactStore& aContactStore,TVPbkContactStoreEvent aStoreEvent );
+		 
+		/**
+		* From MVPbkSingleContactOperationObserver  
+		* Called when the operation is completed.
+		*/
+	    IMPORT_C void VPbkSingleContactOperationComplete(
+         	MVPbkContactOperationBase& aOperation,
+         	MVPbkStoreContact* aContact ); 
+         
+		/**
+		* From MVPbkSingleContactOperationObserver  
+		*  Called if the operation fails.
+		*/
+	    IMPORT_C void VPbkSingleContactOperationFailed(MVPbkContactOperationBase& aOperation, TInt aError );
+ 		
+ 		/**
+		* From MVPbkContactCopyObserver  
+		* Called when the contact has been successfully commited or
+        * copied. Caller takes the ownership of results.
+   		*/
+	    IMPORT_C void ContactsSaved( MVPbkContactOperationBase& aOperation,
+            MVPbkContactLinkArray* aResults ) ;
+        
+        /**
+		* From MVPbkContactCopyObserver  
+		*Called when there was en error while saving contact(s).
+		*/
+	    IMPORT_C void ContactsSavingFailed( 
+                MVPbkContactOperationBase& aOperation, 
+                TInt aError );
+        // From MVPbkBatchOperationObserver
+    
+	    /**
+	     * Called when one step of the operation is complete.
+	     * @param aOperation Operation whose step has completed
+	     * @param aStepSize Size of the performed step
+	     */     
+	    IMPORT_C void StepComplete( MVPbkContactOperationBase& aOperation, 
+	        TInt aStepSize );
+	    
+	    /**
+	     * Called when one step of the operation fails
+	     * @param aOperation Operation whose step has failed
+	     * @param aStepSize Size of the performed step
+	     * @param aError Error that occured
+	     * @return ETrue if the batch operation should continue, 
+	     *               EFalse otherwise
+	     */     
+	    IMPORT_C TBool StepFailed(
+	        MVPbkContactOperationBase& aOperation,
+	        TInt aStepSize,
+	        TInt aError );
+	    
+	    /**
+	     * Called when operation is completed
+	     * @param aOperation the completed operation
+	     */    
+	    IMPORT_C void OperationComplete( MVPbkContactOperationBase& aOperation );  
+	    
+	    /**
+		* From MVPbkContactViewObserver  
+		* Called when a view is ready for use. 
+		*/
+
+	    IMPORT_C void ContactViewReady(
+		            MVPbkContactViewBase& aView ) ;
+		/**
+		* From MVPbkContactViewObserver  
+		* Called when a view is unavailable for a while. 
+		*/            
+	    IMPORT_C void ContactViewUnavailable(
+		            MVPbkContactViewBase& aView ) ;
+		/**
+		* From MVPbkContactViewObserver  
+		* Called when a contact has been added to the view.
+		*/            
+	    IMPORT_C void ContactAddedToView(
+		            MVPbkContactViewBase& aView, 
+		            TInt aIndex, 
+		            const MVPbkContactLink& aContactLink );
+		/**
+		* From MVPbkContactViewObserver  
+		* Called when a contact has been removed from a view.
+		*/            
+	    IMPORT_C void ContactRemovedFromView(
+		            MVPbkContactViewBase& aView, 
+		            TInt aIndex, 
+		            const MVPbkContactLink& aContactLink ) ;
+		/**
+		* From MVPbkContactViewObserver  
+		* Called when an error occurs in the view.
+		*/            
+	    IMPORT_C void ContactViewError(
+		            MVPbkContactViewBase& aView, 
+		            TInt aError, 
+		            TBool aErrorNotified ) ;
+	
+	protected:
+		/**
+		* 2nd phase constructor.
+		*/
+	    IMPORT_C void ConstructL();
+
+	    /*
+	     * 2nd phase constructor.
+	     * @param aStorename Name of the contact database instance.
+	     * @param aLegaceStore Legacy name of the contact database instance.
+	     *  This store name is used in the communication with server.
+	     */
+	    IMPORT_C void ConstructL( const TDesC& aStoreName, const TDesC& aLegacyStore );
+		/**
+		* DoOpenL() opens the data store specified by aStoreName asynchronously.
+		* @param		aStoreName			The name of the data store to open.
+		* @param		aContext			Identifies the specific synchronisation relationship to use for the synchronisation.
+		* @param		aStatus				On completion of the open, contains the result code.
+		*/
+	    IMPORT_C void DoOpenL(const TDesC& aStoreName, MSmlSyncRelationship& aContext, TRequestStatus& aStatus);
+
+		/**
+		* DoCancelRequest() cancels the current asynchronous request, including open. Only one asynchronous request may be outstanding at any one time.
+		*/
+	    IMPORT_C void DoCancelRequest();
+
+		/**
+		* DoStoreName() returns the name of the open data store.
+		* @return The name of the currently opened data store.
+		*/
+	    IMPORT_C const TDesC& DoStoreName() const;
+
+		/**
+		* DoBeginTransactionL() starts the transaction mode. During this mode calls to CreateItemL, ReplaceItemL,
+		* WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this transaction.
+		* Their RequestStatus must be completed, even if the change is not yet really executed in the Data Store.
+		* If a RequestStatus is completed with an error code, the transaction has failed and a rollback must be
+		* done. In this case RevertTransaction will be called.
+		*/
+	    IMPORT_C void DoBeginTransactionL();
+
+		/**
+		* DoCommitTransactionL() will be called at the end of a successful transaction. At this point in time the
+		* operations within the transaction are applied to the Data Store in an atomic way. If all operations
+		* succeed, the RequestStatus must be completed with KErrNone. If an operation fails, a rollback must be
+		* done and the RequestStatus must be completed with an appropriate error code.
+		*/
+	    IMPORT_C void DoCommitTransactionL(TRequestStatus& aStatus);
+
+		/**
+		* DoRevertTransaction() will be called to abort an ongoing transaction. None of the operations already
+		* submitted may be applied to the Data Store. The RequestStatus must be completed with KErrNone as a revert
+		* cannot fail.
+		*/
+	    IMPORT_C void DoRevertTransaction(TRequestStatus& aStatus);
+
+		/**
+		* DoBeginBatchL() starts the batch mode. During this mode calls to CreateItemL, ReplaceItemL,
+		* WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this batch.
+		* Their RequestStatus must be completed with KErrNone, which only signals acceptance of the operation
+		* for batch processing.
+		*/
+	    IMPORT_C void DoBeginBatchL();
+
+		/**
+		* DoCommitBatchL() will be called at the end of the batch mode. This tells the Data Store to
+		* process the batched operations (in the order they were submitted), and to append the error code
+		* for each operation to aResultArray.
+		* The error codes in aResultArray are only valid if the RequestStatus is completed with KErrNone.
+		* If the RequestStatus is completed with an error code none of the operations in the batch mode
+		* were applied to the Data Store.
+		*/
+	    IMPORT_C void DoCommitBatchL(RArray<TInt>& aResultArray, TRequestStatus& aStatus);
+
+		/**
+		* DoCancelBatch() will be called to abort an ongoing batch mode. None of the operations already
+		* submitted may be applied to the Data Store.
+		*/
+	    IMPORT_C void DoCancelBatch();
+
+		/**
+		* DoSetRemoteStoreFormatL() sets the SyncML server Data Format - this may optionally be used by the Data 
+		* Provider to filter out properties that the server does not support, and should be used to avoid deleting 
+		* these properties in case the server sends a changed item to the Data Provider
+		*/
+	    IMPORT_C void DoSetRemoteStoreFormatL(const CSmlDataStoreFormat& aServerDataStoreFormat);
+
+		/**
+		* DoSetRemoteMaxObjectSize() sets the SyncML server maximum object size - this may optionally be used by the 
+		* Data Provider to not send items to the server exceeding its maximum size. 0 means there is no limit.
+		*/
+	    IMPORT_C void DoSetRemoteMaxObjectSize(TInt aServerMaxObjectSize);
+
+		/**
+		* DoMaxObjectSize() gets the Data Store maximum object size which is reported to the SyncML server. 0 means 
+		* there is no limit.
+		* @return The maximum object size.
+		*/
+	    IMPORT_C TInt DoMaxObjectSize() const;
+
+		/**
+		* DoOpenItemL() opens the data item specified by aUid asynchronously for reading.
+		* @param		aUid				Item UID which going to be read.
+		* @param		aFieldChange		Accept field changes.
+		* @param		aParent				Parent of the item.
+		* @param		aSize				Size of the item data.
+		* @param		aMimeType			MIME type of the item.
+		* @param		aMimeVer			MIME version used on item.
+		* @param		aStatus				On completion of the opening of item, contains the result code.
+		*/
+	    IMPORT_C void DoOpenItemL(TSmlDbItemUid aUid, TBool& aFieldChange, TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType, TDes8& aMimeVer, TRequestStatus& aStatus);
+
+		/**
+		* DoCreateItemL() sets the item properties and reference to aUid which will be created.
+		* @param		aUid				Reference to item UID which going to be created.
+		* @param		aSize				Size of the item to be created.
+		* @param		aParent				Parent of the item.
+		* @param		aMimeType			MIME type of the item.
+		* @param		aMimeVer			MIME version used on item.
+		* @param		aStatus				On completion of the creating an item, contains the result code.
+		*/
+	    IMPORT_C void DoCreateItemL(TSmlDbItemUid& aUid, TInt aSize, TSmlDbItemUid aParent, const TDesC8& aMimeType, const TDesC8& aMimeVer, TRequestStatus& aStatus);
+
+		/**
+		* DoReplaceItemL() opens the data item specified by aUid asynchronously to be updated.
+		* @param		aUid				Item UID which going to be updated.
+		* @param		aSize				Size of the item data.
+		* @param		aParent				Parent of the item.
+		* @param		aFieldChange		Accept field changes.
+		* @param		aStatus				On completion of the updating of item, contains the result code.
+		*/
+	    IMPORT_C void DoReplaceItemL(TSmlDbItemUid aUid, TInt aSize, TSmlDbItemUid aParent, TBool aFieldChange, TRequestStatus& aStatus);
+
+		/**
+		* DoReadItemL() reads data(or size of aBuffer) of an item opened in DoOpenItemL() to given aBuffer.
+		* @param		aBuffer				Buffer to item data.
+		*/
+	    IMPORT_C void DoReadItemL(TDes8& aBuffer);
+
+		/**
+		* DoWriteItemL() writes aData of an item opened in DoCreateItemL() or DoReplaceItemL() to be saved on database.
+		* @param		aData				Item data (or part of data).
+		*/
+	    IMPORT_C void DoWriteItemL(const TDesC8& aData);
+
+		/**
+		* DoCommitItemL() completes an item operation started in DoCreateItemL() or DoReplaceItemL().
+		* @param		aStatus				On completion of the operation, contains the result code.
+		*/
+	    IMPORT_C void DoCommitItemL(TRequestStatus& aStatus);
+
+		/**
+		* DoCloseItem() completes an item operation started in DoOpenItemL().
+		*/
+	    IMPORT_C void DoCloseItem();
+
+		/**
+		* DoMoveItemL() moves item specified by aUid asynchronously.
+		* @param		aUid				Item UID which going to be moved.
+		* @param		aNewParent			A new parent of the item.
+		* @param		aStatus				On completion of the moving an item, contains the result code.
+		*/
+	    IMPORT_C void DoMoveItemL(TSmlDbItemUid aUid, TSmlDbItemUid aNewParent, TRequestStatus& aStatus);
+
+		/**
+		* DoDeleteItemL() deletes item specified by aUid asynchronously.
+		* @param		aUid				Item UID which going to be deleted.
+		* @param		aStatus				On completion of the deleting an item, contains the result code.
+		*/
+	    IMPORT_C void DoDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus);
+
+		/**
+		* DoSoftDeleteItemL() soft deletes item specified by aUid asynchronously.
+		* @param		aUid				Item UID which going to be softdeleted.
+		* @param		aStatus				On completion of the softdeleting an item, contains the result code.
+		*/
+	    IMPORT_C void DoSoftDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus);
+
+		/**
+		* DoDeleteAllItemsL() deletes all items from opened database asynchronously.
+		* @param		aStatus				On completion of delete, contains the result code.
+		*/
+	    IMPORT_C void DoDeleteAllItemsL(TRequestStatus& aStatus);
+
+		/**
+		* DoHasSyncHistory() checks if previous sync with opened server and context.
+		* @return ETrue if there is synchonization history.
+		*/
+	    IMPORT_C TBool DoHasSyncHistory() const;
+
+		/**
+		* DoAddedItems() gets all added items on client since previous synchronization.
+		* @return Added items.
+		*/
+	    IMPORT_C const MSmlDataItemUidSet& DoAddedItems() const;
+
+		/**
+		* DoDeletedItems() gets all deleted items on client since previous synchronization.
+		* @return Deleted items.
+		*/
+	    IMPORT_C const MSmlDataItemUidSet& DoDeletedItems() const;
+
+		/**
+		* DoSoftDeletedItems() gets all softdeleted items on client since previous synchronization.
+		* @return Soft deleted items.
+		*/
+	    IMPORT_C const MSmlDataItemUidSet& DoSoftDeletedItems() const;
+
+		/**
+		* DoModifiedItems() gets all modified items on client since previous synchronization.
+		* @return Modified items.
+		*/
+	    IMPORT_C const MSmlDataItemUidSet& DoModifiedItems() const;
+
+		/**
+		* DoMovedItems() gets all moved items on client since previous synchronization.
+		* @return Moved items.
+		*/
+	    IMPORT_C const MSmlDataItemUidSet& DoMovedItems() const;
+
+		/**
+		* DoResetChangeInfoL() resets client synchronization data => next time will be slow sync.
+		* @param		aStatus				On completion of reset, contains the result code.
+		*/
+	    IMPORT_C void DoResetChangeInfoL(TRequestStatus& aStatus);
+
+		/**
+		* DoCommitChangeInfoL() commits client synchronization changes for given aItems list.
+		* @param		aStatus				On completion of given items, contains the result code.
+		* @param		aItems				Item ids to be commited.
+		*/
+	    IMPORT_C void DoCommitChangeInfoL(TRequestStatus& aStatus, const MSmlDataItemUidSet& aItems);
+
+		/**
+		* DoCommitChangeInfoL() commits all client synchronization changes.
+		* @param		aStatus				On completion of all items, contains the result code.
+		*/
+	    IMPORT_C void DoCommitChangeInfoL(TRequestStatus& aStatus);
+
+		/**
+		* Default constructor.
+		*/
+	    IMPORT_C CNSmlContactsDataStore();
+
+		/**
+		* SetOwnStoreFormatL() Sets dataproviders own storeformat.
+		*/
+	    IMPORT_C void SetOwnStoreFormatL();
+
+		/**
+		* LdoFetchItemL() Fetches item data from database.
+		* @param		aUid				Items uid for fetching.
+		* @param		aItem				Items data after fetch.
+		* 
+		*/
+	    IMPORT_C virtual void LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem );
+
+		/*
+		* LdoAddItemL() Adds item data to database.
+		* @param		aItem				Item data to be added.
+		* @param		aSize				Item data size.
+		*/
+	    IMPORT_C virtual void LdoAddItemL( const TDesC8& aItem,
+		                  TInt aSize);
+		/*
+		* LdoAddItemL() Adds several items to database.
+		* @param		aItem				Items data to be added.
+		* @param		aSize				Items data size.
+		*/
+	    IMPORT_C virtual void LdoAddItemsL( CBufBase*& aItems,TInt aSize);
+		
+		/**
+		* LdoUpdateItemL() Updates item data to database.
+		* 
+		*/
+	    IMPORT_C virtual void LdoUpdateItemL();
+		
+		/**
+		* DriveBelowCriticalLevelL() Checks if there is enough space on client to store added item data.
+		* @param		aSize				Item size to be added.
+		* @return ETrue if there isn't enough drive space.
+		*/
+	    IMPORT_C TBool DriveBelowCriticalLevelL( TInt aSize );
+
+
+		/**
+		* StripPropertyL() Removes aProperty from aItem data.
+		* @param		aItem				Item data to be stripped.
+		* @param		aProperty			Property to be removed from aItem.
+		*/
+	    IMPORT_C void StripPropertyL( HBufC8*& aItem, const TDesC8& aProperty ) const;
+
+		/**
+		* StripPropertyL() Remove aPropertys from aItem data.
+		* @param		aItem				Item(s) data to be stripped.
+		* @param		aProperty			Property to be removed from aItem.
+		*/
+	    IMPORT_C void StripPropertyL( CBufBase*& aItem, const TDesC8& aProperty ) const;
+
+		/**
+		* ExecuteBufferL() Executes all buffered items from buffer.
+		* @param		aResultArray		Array to return statuscodes for each command.
+		*/
+	    IMPORT_C virtual void ExecuteBufferL();
+		
+		/**
+		* ExecuteAddL() Executes all the add commands in buffer.
+		*/
+	    IMPORT_C virtual TInt ExecuteAddL();
+		
+		/**
+		* ExecuteDeleteL() Executes all the delete commands in buffer.
+		*/
+	    IMPORT_C virtual void ExecuteDeleteL();
+		
+		/**
+		* ExecuteBufferL() Executes all the update commands in buffer.
+		*/
+	    IMPORT_C virtual void ExecuteUpdateL();
+		
+		/**
+		* ExecuteMoveL() Executes all the move commands in buffer.
+		*/
+	    IMPORT_C virtual void ExecuteMoveL();
+	
+		/**
+		* AddBufferListL()Adds a new item to buffer.
+		* @param 		aUid 				New item's uid.
+		* @param 		aSize 				New item's size.
+		* @param 		aStatus 			New item's status.
+		* @return Pointer to the buffer.
+		*/
+	    IMPORT_C CBufBase* AddBufferListL(TSmlDbItemUid& aUid, TInt aSize, TInt aStatus);
+		
+		/**
+		* Checks if aItem is confidential or not.
+		* @param    aItem   Item that is checked.
+		* @return   TBool   ETrue if item is confidential.
+		*                   Otherwise EFalse is returned.
+		*/
+	    IMPORT_C TBool IsConfidentialL( MVPbkStoreContact& aItem );
+        
+        /**
+		* Leaving function called when fetch/retrieve 
+		* operation is complete
+		* @param    aContact   contact fetched/retrieved
+		* 
+		*/
+	    IMPORT_C void SingleContactOperationCompleteL(MVPbkStoreContact* aContact);
+        
+        /**
+		* Create a contact view of the store which is opened
+		*/
+	    IMPORT_C void CreateViewL();
+        
+        /**
+		* Delete all the contacts
+		*/
+	    IMPORT_C virtual void DoDeleteAllContactsL();
+        /**
+		* Leaving function called when the operation is complete
+		*/
+	    IMPORT_C void OperationCompleteL();
+        /**
+		* Reset the contacts data buffer
+		*/
+	    IMPORT_C void ResetBuffer();
+
+    protected: // New
+
+        /**
+         * Returns the file name for the store format resources.
+         * @return Store format resource file name. 
+         */
+        IMPORT_C virtual const TDesC& GetStoreFormatResourceFileL();
+
+        /**
+         * Creates the ModsFetcher object for the DataStore.
+         * @return ContactsModsFetcher object. 
+         */
+        IMPORT_C virtual MContactsModsFetcher* CreateModsFetcherL();
+
+        /**
+         * Get datamod instance
+         * @return reference to datamod instance.
+         */
+        IMPORT_C virtual CNSmlDataModBase& GetDataMod();
+        
+	protected: // data
+	
+			// MODULE DATA STRUCTURES
+		enum TNSmlDataStoreStatus  // DataStore status
+			{
+			ENSmlClosed = 1,
+			ENSmlOpenAndWaiting,
+			ENSmlItemOverflow,
+			ENSmlItemOpen,
+			ENSmlItemCreating,
+			ENSmlItemUpdating
+			};
+
+		enum TNSmlCntCommand		// Modification type
+			{
+			ENSmlCntItemAdd = 1,
+			ENSmlCntItemDelete,
+			ENSmlCntItemSoftDelete,
+			ENSmlCntItemRead,
+			ENSmlCntItemMove,
+			ENSmlCntItemReplace,
+			ENSmlCntItemFieldLevelReplace
+			};
+			
+			enum TNSmlLastOp
+			{
+			ENSmlRetrieveOp = 1,
+			ENSmlAddOp,
+			ENSmlDeleteOp,
+			ENSMLFetchOp,
+			ENSMLDeleteAllOp,
+			ENSMLUpdateExportOp,
+			ENSMLUpdateImportOp,
+			ENSmlNone
+			};
+	
+
+		// ------------------------------------------------------------------------------------------------
+		// Buffering Stuff for BatchMode operations
+		// ------------------------------------------------------------------------------------------------
+		class CNSmlContactsBufferItem : public CBase
+			{
+			public:	
+				/**
+				* Destructor.
+				*/
+				~CNSmlContactsBufferItem();
+				
+			public: // data
+				TSmlDbItemUid	*iPUid;			// New item ID 
+				TSmlDbItemUid	iUid;			// Item ID
+				CBufBase		*iItemData;		// Item data
+				HBufC8 			*iMimeType;		// Mimetype
+				HBufC8 			*iMimeVersion;	// Mime version
+				TNSmlCntCommand iModType;		// Commands type
+				TInt			iStatus;		// Command status
+				TInt 			iSize;			// Item size
+			};
+		
+	protected:
+        CNSmlChangeFinder* iChangeFinder;
+        TRequestStatus* iCallerStatus;
+        TBool iSnapshotRegistered;
+	    TBool iBatchMode;
+        TBool iOpened;
+	    TInt64 iOpenedStoreId;
+        TInt iServerMaxObjectSize;
+        TSmlDbItemUid iUid;
+        TInt iItemPos;
+        TNSmlCntCommand iModType;
+        CBufBase* iItemData;
+        CBufBase* iItemDataAddBatch;
+        CBufFlat* iMergeItem;
+        RPointerArray<CNSmlContactsBufferItem> iContactsBufferItemList;
+        TKeyArrayFix iKey;
+        TBool iSyncHistory;
+        CSmlDataStoreFormat* iStoreFormat;
+        TNSmlDataStoreStatus iState;
+
+        CVPbkContactManager* iContactManager;
+        MVPbkContactStore* iStore;
+        CVPbkContactIdConverter* iIdConverter;
+        MVPbkContactViewBase* iContactViewBase;
+        
+        TInt *iSize;
+        RBufWriteStream iWriteStream;
+        RDesReadStream iReadStream;
+        HBufC8* iBuf;
+        TInt  iRetCommand;
+        TInt iIndex;
+        TInt iRetrieveCount;
+        RArray<TInt> *iResultArray;
+        TNSmlLastOp iLastOperation;
+        
+        TInt iStateItem;
+
+	    TBool iFieldLevelReplace;
+
+	private:
+		TBool iTransactionMode;
+		TInt iModificationCount;
+		TPtrC8 iMimeTypeItem;
+		TPtrC8 iMimeVersionItem;
+		TPtrC8 iUsedMimeType;
+		TPtrC8 iUsedMimeVersion;
+		RStringF iServerMimeType;
+		RStringF iServerMimeVersion;	
+		HBufC* iDefaultStoreName;
+				
+		//The symbian Db name that is used for communication with servers
+		//Changes done to mantain backward compatibility of function
+		HBufC* iPacketStoreName;
+
+		CNSmlDataModBase* iDataMod;
+		MContactsModsFetcher* iContactsModsFetcher; 
+
+		RFs iRfs;
+		TInt iDrive;	
+		TInt iItemSize;
+
+		HBufC* iStoreName;
+		
+		RStringPool iStringPool;
+		
+		CNSmlDataItemUidSet* iNewUids;
+		CNSmlDataItemUidSet* iDeletedUids;
+		CNSmlDataItemUidSet* iSoftDeletedUids;
+		CNSmlDataItemUidSet* iReplacedUids;
+		CNSmlDataItemUidSet* iMovedUids;
+		
+		RArray<TInt> iAddResultArray; 
+
+        CVPbkVCardEng* iVCardEngine ;
+        MVPbkContactLink* iContactLink;
+        CVPbkContactLinkArray* iContactLnks;
+		MVPbkContactOperationBase* iDeleteAllOperation;
+	};
+
+
+#endif // __NSMLCONTACTSDATASTORE_H__
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -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:  build info file for DS contact adapter unit tests.
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_MMPFILES
+UT_nsmldsdummyadapter.mmp
+
+PRJ_EXPORTS
+testdata\standard.vcf    c:\data\testdata\standard.vcf
+testdata\basic.vcf    c:\data\testdata\basic.vcf
+testdata\basicInvalid.vcf   c:\data\testdata\basicInvalid.vcf
+testdata\multioccurence.vcf    c:\data\testdata\multioccurence.vcf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmladaptertestutilities.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,329 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Source code file for contact adapter test utilities.
+*
+*/
+
+#include "CNSmlAdapterTestUtilities.h"
+#include <EUnitMacros.h>
+#include <UTF.H> 
+#include <cntitem.h>  // CContactCard
+#include <cntfield.h> // CContactItemField
+#include <cntfldst.h> // CContactTextField
+#include <S32MEM.H>
+
+namespace
+    {
+    // EUNIT_PRINT will truncate descriptors longer than 512 characters.
+    const TInt KEunitPrintMaxLength = 512;
+    }
+
+CNSmlAdapterTestUtilities* CNSmlAdapterTestUtilities::NewL()
+    {
+    CNSmlAdapterTestUtilities* self = CNSmlAdapterTestUtilities::NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+
+CNSmlAdapterTestUtilities* CNSmlAdapterTestUtilities::NewLC()
+    {
+    CNSmlAdapterTestUtilities* self = new( ELeave ) CNSmlAdapterTestUtilities();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;    
+    }
+
+CNSmlAdapterTestUtilities::CNSmlAdapterTestUtilities()
+    {
+    }
+
+CNSmlAdapterTestUtilities::~CNSmlAdapterTestUtilities()
+    {
+    iFs.Close();
+    delete iIdArray;
+    delete iContactDatabase;
+    }
+
+void CNSmlAdapterTestUtilities::ConstructL()
+    {
+    User::LeaveIfError( iFs.Connect() );
+    }
+
+void CNSmlAdapterTestUtilities::OpenVCardFromFileLC( const TDesC& aFileName, RFileReadStream& aReadStream )
+    {
+    TInt err = aReadStream.Open( iFs, aFileName, EFileRead );
+    if (err != KErrNone)
+        {
+        if (err == KErrNotFound)
+            {
+            EUNIT_PRINT( _L("%S ,vCard file not found"), &aFileName );
+            }
+        else if ( err == KErrPathNotFound )
+            {
+            EUNIT_PRINT( _L("%S ,vCard path not found"), &aFileName );        
+            }
+        else 
+            {
+            EUNIT_PRINT( _L("%S , vCard file cannot be opened. Error code %d"), &aFileName, err );
+            }
+        User::Leave( err  );
+        }
+    EUNIT_PRINT( _L("VCard opened") );
+    CleanupClosePushL( aReadStream );
+    }
+
+HBufC* CNSmlAdapterTestUtilities::ReadVCardFromFileLC( const TDesC& aFileName )
+    {
+    HBufC8* vCard8 = ReadVCard8FromFileLC( aFileName );
+    HBufC* vCard = HBufC::NewL( vCard8->Length() ); 
+    vCard8->Des().Copy( *vCard8 );
+    CleanupStack::PopAndDestroy( vCard8 );
+    
+    CleanupStack::PushL( vCard );    
+    return vCard;
+    }
+
+HBufC8* CNSmlAdapterTestUtilities::ReadVCard8FromFileLC( const TDesC& aFileName )
+    {
+    RFileReadStream readStream;
+    OpenVCardFromFileLC(aFileName, readStream);
+    
+    const TInt fileSize = readStream.Source()->SizeL();
+    CBufFlat* buffer = CBufFlat::NewL( fileSize );
+    CleanupStack::PushL( buffer );
+
+    RBufWriteStream writeStream( *buffer );
+    CleanupClosePushL( writeStream );
+    writeStream.WriteL( readStream );
+    writeStream.CommitL();
+    
+    HBufC8* vCard8 = buffer->Ptr(0).AllocL();
+    CleanupStack::PopAndDestroy( 3, &readStream );
+    
+    CleanupStack::PushL( vCard8 );
+    return vCard8;
+    }
+
+CBufFlat* CNSmlAdapterTestUtilities::ReadBufFromFileLC( const TDesC& aFileName )
+    {
+    RFileReadStream readStream;
+    OpenVCardFromFileLC(aFileName, readStream);
+    
+    const TInt fileSize = readStream.Source()->SizeL();
+    CBufFlat* buffer = CBufFlat::NewL( fileSize );
+    CleanupStack::PushL( buffer );
+
+    RBufWriteStream writeStream( *buffer );
+    CleanupClosePushL( writeStream );
+    writeStream.WriteL( readStream );
+    writeStream.CommitL();
+    CleanupStack::PopAndDestroy( &writeStream );
+    CleanupStack::Pop( buffer );
+    CleanupStack::PopAndDestroy( &readStream );
+    CleanupStack::PushL( buffer );
+    return buffer;
+    }
+
+void CNSmlAdapterTestUtilities::SetupEmptyContactDbL( const TDesC& aDbName )
+    {
+    if( aDbName.Length() > 0 )
+        {
+        iContactDatabase = CContactDatabase::ReplaceL( aDbName );
+        }
+    else
+        {
+        iContactDatabase = CContactDatabase::OpenL();  // Use default contact DB.
+        }
+    
+    CContactIdArray* array = iContactDatabase->ContactsChangedSinceL( Time::NullTTime() );
+    CleanupStack::PushL( array );
+    iContactDatabase->DeleteContactsL(*array);        
+    CleanupStack::PopAndDestroy( array );
+    }
+
+/**
+ * Setup contact DB with the following contacts
+ *   + Tim Tester (id index 0)
+ *   + Teddy McTest (id index 1)
+ *   + Tod TestHill (id index 2)
+ *   + Simon Software (id index 3)
+ *   + Cyd Effect (id index 4)
+ *   + Nick Name (id index 5)
+ * 
+ */
+void CNSmlAdapterTestUtilities::SetupAndPopulateContactDbL( const TDesC& aDbName )
+    {
+    if( aDbName.Length() > 0 )
+        {
+        iContactDatabase = CContactDatabase::ReplaceL( aDbName );
+        }
+    else
+        {
+        iContactDatabase = CContactDatabase::OpenL();  // Use default contact DB.
+        }
+    
+    iIdArray = CContactIdArray::NewL();
+
+    // Create test contacts
+    iIdArray->AddL( AddContactL( _L( "Tim" ), _L( "Tester" ), _L( "+358501234567" ) ) );
+    iIdArray->AddL( AddContactL( _L( "Teddy" ), _L("McTest" ), _L( "+358501112222" ) ) );
+    iIdArray->AddL( AddContactL( _L( "Tod" ), _L( "TestHill" ), _L( "+358506666666" ) ) );
+    iIdArray->AddL( AddContactL( _L( "Simon" ), _L( "Software" ), _L( "+3585011223333" ) ) );
+    iIdArray->AddL( AddContactL( _L( "Cyd" ), _L( "Effect" ), _L( "+358503334444" ) ) );
+    iIdArray->AddL( AddContactL( _L( "Nick" ), _L( "Name" ), _L( "+358402223333" ) ) );
+    }
+
+// Helper method to add a simple contact to test contact DB
+TContactItemId CNSmlAdapterTestUtilities::AddContactL(
+        const TDesC& aFirstName,
+        const TDesC& aLastName,
+        const TDesC& aPhoneNumber )
+    {
+    _LIT( KLabelFamilyName, "Last name");
+    _LIT( KLabelGivenName, "First name");
+    _LIT( KLabelPhone, "Phone");
+    //_LIT( KLabelNickname, "X-EPOCSECONDNAME");
+
+    CContactCard* card = CContactCard::NewLC();
+    
+    // Family name field
+    CContactItemField* familyNameField =
+        CContactItemField::NewLC( KStorageTypeText, KUidContactFieldFamilyName );
+    familyNameField->SetLabelL( KLabelFamilyName );
+    familyNameField->SetMapping( KUidContactFieldVCardMapUnusedN );
+    familyNameField->TextStorage()->SetTextL( aLastName );
+    card->AddFieldL( *familyNameField ); // Takes ownership
+    CleanupStack::Pop( familyNameField );
+    
+    // First name field
+    CContactItemField* nameField =
+    CContactItemField::NewLC( KStorageTypeText, KUidContactFieldGivenName );
+    nameField->SetLabelL( KLabelGivenName );
+    nameField->SetMapping( KUidContactFieldVCardMapUnusedN );
+    nameField->TextStorage()->SetTextL( aFirstName );
+    card->AddFieldL( *nameField );
+    CleanupStack::Pop(nameField);
+    
+    // Phone number field
+    CContactItemField* phoneField =
+        CContactItemField::NewLC( KStorageTypeText, KUidContactFieldPhoneNumber );
+    phoneField->SetLabelL( KLabelPhone );
+    phoneField->SetMapping( KUidContactFieldVCardMapTEL );
+    phoneField->TextStorage()->SetTextL( aPhoneNumber );
+    card->AddFieldL( *phoneField );
+    CleanupStack::Pop( phoneField );
+    
+    // Nickname field
+    /*if( aNickname.Length() > 0 )
+    	{
+        CContactItemField* NicknameField =
+            CContactItemField::NewLC( KStorageTypeText, KUidContactFieldSecondName );
+        NicknameField->SetLabelL( KLabelNickname );
+        NicknameField->SetMapping( KUidContactFieldVCardMapSECONDNAME );
+        NicknameField->TextStorage()->SetTextL( aNickname );
+        card->AddFieldL( *NicknameField );
+        CleanupStack::Pop( NicknameField );
+    	}*/
+
+    
+    TContactItemId cardId = iContactDatabase->AddNewContactL( *card );        
+    CleanupStack::PopAndDestroy( card );
+    
+    return cardId;
+    }
+
+/**
+ * Empties the test contact DB to its initial state.
+ */ 
+void CNSmlAdapterTestUtilities::TeardownAndEmptyContactDbL( const TDesC& aDbName )
+    {
+    iContactDatabase->DeleteContactsL( *iIdArray );
+    
+    delete iIdArray;
+    iIdArray = NULL;
+
+    delete iContactDatabase;
+    iContactDatabase = NULL;
+    if( aDbName.Length() > 0 )
+        {
+        TRAP_IGNORE( CContactDatabase::DeleteDatabaseL( aDbName ) );
+        }
+    }
+
+CContactDatabase* CNSmlAdapterTestUtilities::GetDb()
+    {
+    EUNIT_ASSERT( iContactDatabase );
+    return iContactDatabase;
+    }
+
+CContactIdArray* CNSmlAdapterTestUtilities::GetContactArray()
+    {
+    return iIdArray;
+    }
+
+RFs& CNSmlAdapterTestUtilities::FileSession()
+    {
+    return iFs;
+    }
+
+CBufBase* CNSmlAdapterTestUtilities::ExportContactLC( TContactItemId aId )
+    {
+    CContactDatabase* db = CContactDatabase::OpenL();  // Use default contact DB.
+    CleanupStack::PushL( db );
+    CContactIdArray* idArr = CContactIdArray::NewLC();
+    idArr->AddL( aId );
+    CBufFlat* buffer = CBufFlat::NewL( 1024 );
+    CleanupStack::PushL( buffer );
+    RBufWriteStream writeStream( *buffer );
+    CleanupClosePushL( writeStream );
+    
+    TRAPD( err, iContactDatabase->ExportSelectedContactsL( TUid::Uid(KVersitEntityUidVCard), *idArr, 
+        writeStream, CContactDatabase::EExcludeUid, Versit::EUTF8CharSet ) );
+
+    EUNIT_ASSERT_EQUALS_DESC( err, KErrNone, "ExportSelectedContactsL leave" );
+    
+    CleanupStack::PopAndDestroy( &writeStream );
+    CleanupStack::Pop( buffer );
+    CleanupStack::PopAndDestroy( idArr );
+    CleanupStack::PopAndDestroy( db );
+    CleanupStack::PushL( buffer );
+    return buffer;
+    }
+
+void CNSmlAdapterTestUtilities::PrintData( const TDesC& aTitle, CBufBase& aBuf )
+    {
+
+    EUNIT_PRINT( aTitle );
+
+    for (TInt i = 0; i < aBuf.Ptr(0).Length(); i += KEunitPrintMaxLength )
+        {
+        EUNIT_PRINT( aBuf.Ptr(i) );
+        }
+
+    }
+
+void CNSmlAdapterTestUtilities::PrintData( const TDesC8& aTitle, CBufBase& aBuf )
+    {
+
+    EUNIT_PRINT( aTitle );
+
+    for (TInt i = 0; i < aBuf.Ptr(0).Length(); i += KEunitPrintMaxLength )
+        {
+        EUNIT_PRINT( aBuf.Ptr(i) );
+        }
+
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmladaptertestutilities.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for contact adapter test utilities.
+*
+*/
+
+#ifndef CNSMLADAPTERTESTUTILITIES_H_
+#define CNSMLADAPTERTESTUTILITIES_H_
+
+#include <e32base.h>
+#include <f32file.h>
+#include <S32FILE.H>
+#include <cntdb.h>    // CContactDatabase
+#include <cntdef.h>   // TContactItemId 
+
+class CNSmlAdapterTestUtilities : public CBase
+    {
+    public:
+        
+        static CNSmlAdapterTestUtilities* NewL();
+        static CNSmlAdapterTestUtilities* NewLC();
+        virtual ~CNSmlAdapterTestUtilities();
+
+    private:    
+        CNSmlAdapterTestUtilities();
+        void ConstructL();
+
+    public:
+        
+        void OpenVCardFromFileLC( const TDesC& aFileName, RFileReadStream& aReadStream  );
+        HBufC* ReadVCardFromFileLC( const TDesC& aFileName );
+        HBufC8* ReadVCard8FromFileLC( const TDesC& aFileName );
+        CBufFlat* ReadBufFromFileLC( const TDesC& aFileName );
+        
+        // Setting up / Tearing down a test DB with a few contacts
+        void SetupEmptyContactDbL( const TDesC& aDbName );
+        void SetupAndPopulateContactDbL( const TDesC& aDbName );
+        void TeardownAndEmptyContactDbL( const TDesC& aDbName );
+        CContactDatabase* GetDb();
+        CContactIdArray* GetContactArray();
+        RFs& FileSession();
+        CBufBase* ExportContactLC( TContactItemId aId );
+        void PrintData( const TDesC& aTitle , CBufBase& aBuf );
+        void PrintData( const TDesC8& aTitle , CBufBase& aBuf );
+
+    public:
+        // Helper methods
+        TContactItemId AddContactL( const TDesC& aFirstName,
+                 const TDesC& aLastName,
+                 const TDesC& aPhoneNumber );
+        
+    private:    
+        RFs                 iFs;
+        CContactDatabase*   iContactDatabase;
+        CContactIdArray*    iIdArray;
+    };
+
+#endif /* CNSMLADAPTERTESTUTILITIES_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydataprovider_test.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,315 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Source code file for contact adapter's dataprovider unit tests.
+*
+*/
+
+#include "CNSmlDummyDataProvider_Test.h"
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <S32MEM.H>
+#include <nsmlconstants.h> 
+#include <SmlDataProvider.h>
+#include <e32def.h>
+
+// - Construction -----------------------------------------------------------
+
+CNSmlDummyDataProvider_Test* CNSmlDummyDataProvider_Test::NewL()
+    {
+    CNSmlDummyDataProvider_Test* self = CNSmlDummyDataProvider_Test::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CNSmlDummyDataProvider_Test* CNSmlDummyDataProvider_Test::NewLC()
+    {
+    CNSmlDummyDataProvider_Test* self = new( ELeave ) CNSmlDummyDataProvider_Test();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+CNSmlDummyDataProvider_Test::~CNSmlDummyDataProvider_Test()
+    {
+    }
+
+CNSmlDummyDataProvider_Test::CNSmlDummyDataProvider_Test()
+    {
+    }
+
+void CNSmlDummyDataProvider_Test::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+// - Test methods -----------------------------------------------------------
+
+
+
+void CNSmlDummyDataProvider_Test::SetupL(  )
+    {
+    iCNSmlDummyDataProvider = CNSmlDummyDataProvider::NewL();
+    }
+
+
+void CNSmlDummyDataProvider_Test::Teardown(  )
+    {
+    delete iCNSmlDummyDataProvider;
+    iCNSmlDummyDataProvider = NULL;
+    }
+
+
+void CNSmlDummyDataProvider_Test::T_Global_NewLL(  )
+    {
+    CNSmlDummyDataProvider* provider = CNSmlDummyDataProvider::NewL();
+	EUNIT_ASSERT(provider);
+	delete provider;
+    }
+
+void CNSmlDummyDataProvider_Test::GreateAdapterL()
+    {
+    TSmlDataProviderId id = {0x101F6DDD};// Contact Adapter Uid
+    CSmlDataProvider* dp = CSmlDataProvider::NewL( id );
+    CSmlDataStore* store = dp->NewStoreInstanceLC();
+    EUNIT_ASSERT( store );
+    CleanupStack::PopAndDestroy( store );
+    TBool operation = dp->SupportsOperation( KUidSmlSupportBatch );
+    EUNIT_ASSERT( operation );
+    operation = dp->SupportsOperation( KUidSmlSupportMultipleStores );
+    EUNIT_ASSERT( operation );
+    operation = dp->SupportsOperation( KUidSmlSupportSuspendResume );
+    EUNIT_ASSERT( !operation );
+    TPtrC storeName = dp->DefaultStoreL();
+    EUNIT_ASSERT( dp->DefaultStoreL().Compare( _L("C:Contacts.cdb") ) == 0 );
+    const CSmlDataStoreFormat& format = dp->StoreFormatL();
+    EUNIT_ASSERT( format.DisplayName().Compare( _L("Contacts") ) == 0 );
+    EUNIT_PRINT( format.DisplayName() );
+    delete dp;
+    }
+
+void CNSmlDummyDataProvider_Test::GetStoreFormatResourceFileLL()
+    {
+    const TDesC& resourceFile = iCNSmlDummyDataProvider->GetStoreFormatResourceFileL();
+    EUNIT_PRINT( resourceFile );
+    }
+
+void CNSmlDummyDataProvider_Test::DoStoreFormatLL()
+	{
+	const CSmlDataStoreFormat& storeFormat = iCNSmlDummyDataProvider->DoStoreFormatL();
+	EUNIT_PRINT( storeFormat.DisplayName() );
+	EUNIT_PRINT( _L("Property count %d"), storeFormat.FolderPropertyCount() );
+	CBufFlat* store = CBufFlat::NewL(512);
+	CleanupStack::PushL( store );
+	RBufWriteStream writeStream(*store, 0);
+	CleanupClosePushL( writeStream );
+	storeFormat.ExternalizeL( writeStream );
+    CleanupStack::PopAndDestroy(2, store);
+	}
+
+void CNSmlDummyDataProvider_Test::TestStoreSupportForPartialSyncL()
+	{
+	const CSmlDataStoreFormat& storeFormat = iCNSmlDummyDataProvider->DoStoreFormatL();
+	EUNIT_ASSERT_EQUALS( storeFormat.MimeFormatCount(), 1 );
+	EUNIT_ASSERT( !storeFormat.MimeFormat(0).FieldLevel() );
+	}
+
+void CNSmlDummyDataProvider_Test::TestStoreSupportMimeTypeL()
+    {
+    _LIT8( KNSmlvCard21Name, "text/x-vcard" );
+    _LIT8( KNSmlvCard21Ver, "2.1" );
+
+    const CSmlDataStoreFormat& storeFormat = iCNSmlDummyDataProvider->DoStoreFormatL();
+    EUNIT_ASSERT_EQUALS( storeFormat.MimeFormatCount() ,1 );
+    EUNIT_ASSERT_EQUALS( storeFormat.MimeFormat(0).MimeType().DesC(), KNSmlvCard21Name() );
+    EUNIT_ASSERT_EQUALS( storeFormat.MimeFormat(0).MimeVersion().DesC(), KNSmlvCard21Ver() );
+    }
+
+void CNSmlDummyDataProvider_Test::DoListStoresLCL()
+    {
+    CDesCArray* store = iCNSmlDummyDataProvider->DoListStoresLC();
+    TPtrC ptrStoreName = ( *store )[ 0 ];
+    EUNIT_PRINT( ptrStoreName );
+    EUNIT_ASSERT( ptrStoreName.Compare( _L("C:Contacts.cdb") ) == 0 );
+    CleanupStack::PopAndDestroy( store );
+    }
+
+void CNSmlDummyDataProvider_Test::DoOnFrameworkEvent()
+    {
+    iCNSmlDummyDataProvider->DoOnFrameworkEvent( TSmlFrameworkEvent( 0 ), 0, 0 );
+    }
+
+void CNSmlDummyDataProvider_Test::DoSupportedServerFiltersL()
+    {
+    RPointerArray<CSyncMLFilter> filterArray;
+    filterArray = iCNSmlDummyDataProvider->DoSupportedServerFiltersL();
+    filterArray.ResetAndDestroy();
+    filterArray.Close();
+    }
+
+void CNSmlDummyDataProvider_Test::DoCheckSupportedServerFiltersL()
+    {
+    const CSmlDataStoreFormat& storeFormat = iCNSmlDummyDataProvider->DoStoreFormatL();
+    RPointerArray<CSyncMLFilter>* filters = new ( ELeave ) RPointerArray<CSyncMLFilter>();
+    CleanupRPtrArrayPushL( filters );
+    TSyncMLFilterChangeInfo changeInfo( ESyncMLDefault );
+    TRAPD( err, iCNSmlDummyDataProvider->DoCheckSupportedServerFiltersL( storeFormat, *filters, changeInfo ) );
+    EUNIT_ASSERT( err == KErrNotSupported );
+    CleanupStack::PopAndDestroy( filters ); 
+    }
+
+void CNSmlDummyDataProvider_Test::DoCheckServerFiltersL()
+    {
+    RPointerArray<CSyncMLFilter>* filters = new ( ELeave ) RPointerArray<CSyncMLFilter>();
+    CleanupRPtrArrayPushL( filters );
+    TSyncMLFilterChangeInfo changeInfo( ESyncMLDefault );
+    TRAPD( err, iCNSmlDummyDataProvider->DoCheckServerFiltersL( *filters, changeInfo ) );
+    EUNIT_ASSERT( err == KErrNotSupported );  
+    CleanupStack::PopAndDestroy( filters ); 
+    }
+
+void CNSmlDummyDataProvider_Test::DoGenerateRecordFilterQueryL()
+    {
+    RPointerArray<CSyncMLFilter>* filters = new ( ELeave ) RPointerArray<CSyncMLFilter>();
+    CleanupRPtrArrayPushL( filters );
+    TSyncMLFilterMatchType matchType( ESyncMLMatchDisabled );
+    TSyncMLFilterType filterType( ESyncMLTypeInclusive );
+    TBuf<100> mimeType;
+
+    TRAPD( err, { 
+        HBufC* storeName =  NULL;
+        HBufC* record = NULL;
+        record = iCNSmlDummyDataProvider->DoGenerateRecordFilterQueryLC( 
+        *filters, matchType, mimeType, filterType, *storeName );
+        delete record; 
+        delete storeName;
+        }
+        );
+    EUNIT_ASSERT( err == KErrNotSupported );
+
+    CleanupStack::PopAndDestroy( ); //filters
+    }
+
+void CNSmlDummyDataProvider_Test::DoGenerateFieldFilterQueryL()
+    {
+    RPointerArray<CSyncMLFilter>* filters = new ( ELeave ) RPointerArray<CSyncMLFilter>();
+    CleanupRPtrArrayPushL( filters );
+    RPointerArray<CSmlDataProperty> properties; 
+    CleanupStack::PushL( PtrArrCleanupItemRArr( CSmlDataProperty, &properties ) );
+    TBuf<100> mimeType;
+    HBufC* storeName = NULL;
+    TRAPD( err, iCNSmlDummyDataProvider->DoGenerateFieldFilterQueryL( *filters, mimeType, properties, *storeName ) );
+    EUNIT_ASSERT( err == KErrNotSupported );
+    delete storeName;
+    CleanupStack::PopAndDestroy( 2 ); //filters, properties
+    }
+
+// - EUnit test table -------------------------------------------------------
+
+EUNIT_BEGIN_TEST_TABLE(
+    CNSmlDummyDataProvider_Test,
+    "Unit test for Contacts dataprovider.",
+    "UNIT" )
+
+EUNIT_TEST(
+    "Test to verify memory allocation for the object",
+    "CNSmlCmtContactsDataProvider",
+    "",
+    "FUNCTIONALITY",
+    Empty, T_Global_NewLL, Empty)
+    
+EUNIT_TEST(
+    "Test to create contact adapter and few other atapter methods",
+    "CNSmlCmtContactsDataProvider",
+    "",
+    "FUNCTIONALITY",
+    Empty, GreateAdapterL, Empty)
+
+EUNIT_TEST(
+    "Test for GetStoreFormatResourceFileL",
+    "CNSmlCmtContactsDataProvider_Test",
+    "",
+    "FUNCTIONALITY",
+    SetupL, GetStoreFormatResourceFileLL, Teardown )
+
+EUNIT_TEST(
+	"Test to verify DoStoreFormatL function",
+	"CNSmlCmtContactsDataProvider_Test",
+	"",
+	"FUNCTIONALITY",
+	SetupL, DoStoreFormatLL, Teardown )
+
+EUNIT_TEST(
+	"Test DataStore support for field level partial sync",
+	"CNSmlCmtContactsDataProvider_Test",
+	"",
+	"FUNCTIONALITY",
+	SetupL, TestStoreSupportForPartialSyncL, Teardown )
+
+EUNIT_TEST(
+	"Verify operator specific MIME type",
+	"CNSmlDummyDataProvider_Test",
+	"",
+	"FUNCTIONALITY",
+	SetupL, TestStoreSupportMimeTypeL, Teardown )
+
+EUNIT_TEST(
+	"Verify method DoListStoresLCL return value",
+	"CNSmlDummyDataProvider_Test",
+	"",
+	"FUNCTIONALITY",
+	SetupL, DoListStoresLCL, Teardown )
+
+EUNIT_TEST(
+    "Test DoOnFrameworkEvent",
+    "CNSmlDummyDataProvider_Test",
+    "",
+    "FUNCTIONALITY",
+    SetupL, DoOnFrameworkEvent, Teardown )
+
+EUNIT_TEST(
+    "Test DoSupportedServerFiltersL",
+    "CNSmlDummyDataProvider_Test",
+    "",
+    "FUNCTIONALITY",
+    SetupL, DoSupportedServerFiltersL, Teardown )
+
+EUNIT_TEST(
+    "Test DoCheckSupportedServerFiltersL",
+    "CNSmlDummyDataProvider_Test",
+    "",
+    "FUNCTIONALITY",
+    SetupL, DoCheckSupportedServerFiltersL, Teardown )
+
+EUNIT_TEST(
+    "Test DoCheckServerFiltersL",
+    "CNSmlDummyDataProvider_Test",
+    "",
+    "FUNCTIONALITY",
+    SetupL, DoCheckServerFiltersL, Teardown )
+
+EUNIT_TEST(
+    "Test DoGenerateRecordFilterQueryL",
+    "CNSmlDummyDataProvider_Test",
+    "",
+    "FUNCTIONALITY",
+    SetupL, DoGenerateRecordFilterQueryL, Teardown )
+
+EUNIT_TEST(
+    "Test DoGenerateFieldFilterQueryL",
+    "CNSmlDummyDataProvider_Test",
+    "",
+    "FUNCTIONALITY",
+    SetupL, DoGenerateFieldFilterQueryL, Teardown )
+
+EUNIT_END_TEST_TABLE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydataprovider_test.h	Wed Sep 01 12:30:02 2010 +0100
@@ -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:  Header file for contact adapter's dataprovider unit tests.
+*
+*/
+
+#ifndef __CNSMLDUMMYDATAPROVIDER_TEST_H__
+#define __CNSMLDUMMYDATAPROVIDER_TEST_H__
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+#include "nsmldummydataprovider.h"
+
+// FORWARD DECLARATIONS
+
+
+// CLASS DEFINITION
+/**
+ * Generated EUnit test suite class.
+ */
+NONSHARABLE_CLASS( CNSmlDummyDataProvider_Test )
+	: public CEUnitTestSuiteClass
+    {
+    public:  // Constructors and destructor
+
+        static CNSmlDummyDataProvider_Test* NewL();
+        static CNSmlDummyDataProvider_Test* NewLC();
+        ~CNSmlDummyDataProvider_Test();
+
+    private: // Constructors
+
+        CNSmlDummyDataProvider_Test();
+        void ConstructL();
+
+    private: // New methods
+
+    	void Empty() {};
+
+        void SetupL();
+
+        void Teardown();
+
+        void T_Global_NewLL();
+        
+        void GreateAdapterL();
+
+        void GetStoreFormatResourceFileLL();
+
+        void DoStoreFormatLL();
+
+        void TestStoreSupportForPartialSyncL();
+
+        void TestStoreSupportMimeTypeL();
+
+        void DoListStoresLCL();
+        
+        void DoOnFrameworkEvent();
+        
+        void DoSupportedServerFiltersL();
+        
+        void DoCheckSupportedServerFiltersL();
+        
+        void DoCheckServerFiltersL();
+        
+        void DoGenerateRecordFilterQueryL();
+        
+        void DoGenerateFieldFilterQueryL();
+
+    private: // Data
+
+        CNSmlDummyDataProvider* iCNSmlDummyDataProvider;
+
+        EUNIT_DECLARE_TEST_TABLE;
+    };
+
+#endif      //  __CNSMLDUMMYDATAPROVIDER_TEST_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastore_test.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,1320 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Source code file for contact adapter's datastore unit tests.
+*
+*/
+
+#include "CNSmlDummyDataStore_Test.h"
+#include "CNSmlAdapterTestUtilities.h"
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <cntdb.h>
+#include <cntitem.h>
+#include <cntfield.h>
+#include <cntfldst.h>
+#include <s32mem.h>
+#include <BAUTILS.H>
+#include <SmlDataFormat.h>
+#include <CVPbkContactViewDefinition.h>
+#include <CVPbkContactStoreUriArray.h>
+#include <tvpbkcontactstoreuriptr.h>
+#include <VPbkContactStoreUris.h>
+#include "nsmldummydatastore.h"
+#include "cnsmldummydatastorewaiter.h"
+
+namespace
+    {
+    // "abld test export" will export test data.
+    _LIT( KVCardStandard, "c:\\Data\\TestData\\standard.vcf" );
+    _LIT( KVCardBasic, "c:\\Data\\TestData\\basic.vcf" );
+    _LIT( KVCardBasicInvalid, "c:\\Data\\TestData\\basicInvalid.vcf" );
+    _LIT( KVCardMultiOccurence, "c:\\Data\\TestData\\multioccurence.vcf" );
+    }
+
+
+// - Construction -----------------------------------------------------------
+
+CNSmlDummyDataStore_Test* CNSmlDummyDataStore_Test::NewL()
+    {
+    CNSmlDummyDataStore_Test* self = CNSmlDummyDataStore_Test::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CNSmlDummyDataStore_Test* CNSmlDummyDataStore_Test::NewLC()
+    {
+    CNSmlDummyDataStore_Test* self = new( ELeave ) CNSmlDummyDataStore_Test();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+CNSmlDummyDataStore_Test::~CNSmlDummyDataStore_Test()
+    {
+    iWriteStream.Close();
+    iFsSession.Close();
+    delete iCNSmlDummyDataStore;
+    delete iTestUtilities;
+    delete iContactDatabase;
+    delete iIdArray;
+    delete iStoreWaiter;
+    }
+
+CNSmlDummyDataStore_Test::CNSmlDummyDataStore_Test()
+    {
+    }
+
+void CNSmlDummyDataStore_Test::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    User::LeaveIfError( iFsSession.Connect() );
+    }
+
+// from MSmlSyncRelationship
+TSmlSyncTaskKey CNSmlDummyDataStore_Test::SyncTaskKey() const
+    {
+    TSmlSyncTaskKey key = 0;
+    return key;
+    }
+
+void CNSmlDummyDataStore_Test::OpenReadStreamLC(
+        RReadStream& /*aReadStream*/, TUid /*aStreamUid*/)
+    {
+    }
+
+void CNSmlDummyDataStore_Test::OpenWriteStreamLC(
+        RWriteStream& aWriteStream, TUid /*aStreamUid*/ )
+    {
+    User::LeaveIfError(
+            iWriteStream.Replace( iFsSession, _L("store.test"), EFileWrite  ) );
+    aWriteStream = iWriteStream;
+    CleanupClosePushL( aWriteStream );
+    }
+
+TBool CNSmlDummyDataStore_Test::IsStreamPresentL(TUid /*aStreamUid*/) const
+    {
+    return EFalse;
+    }
+
+// - Test methods -----------------------------------------------------------
+
+// ++++++++++++ SETUP METHODS ++++++++++++
+
+void CNSmlDummyDataStore_Test::SetupL(  )
+    {
+    iCNSmlDummyDataStore = CNSmlDummyDataStore::NewL();
+    iTestUtilities = CNSmlAdapterTestUtilities::NewL();
+    // Create contact manager
+    CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
+    uriArray->AppendL( TVPbkContactStoreUriPtr( VPbkContactStoreUris::DefaultCntDbUri() ) );
+    iContactManager = CVPbkContactManager::NewL(*uriArray);
+    CleanupStack::PopAndDestroy(uriArray);
+    }
+
+void CNSmlDummyDataStore_Test::SetupAndOpenStoreL(  )
+    {
+    SetupL();
+
+    iStoreWaiter =
+        CNSmlDummyDataStoreWaiter::NewL( *iCNSmlDummyDataStore );
+    iStoreWaiter->OpenStoreL( *this );
+
+    iContactDatabase = CContactDatabase::OpenL();
+    }
+
+void CNSmlDummyDataStore_Test::SetupPopulateDbAndOpenStoreL()
+    {
+    SetupAndPopulateContactDbL();
+
+    EUNIT_ASSERT_NO_LEAVE(
+    iCNSmlDummyDataStore = CNSmlDummyDataStore::NewL() );
+
+    iStoreWaiter =
+        CNSmlDummyDataStoreWaiter::NewL( *iCNSmlDummyDataStore );
+    iStoreWaiter->OpenStoreL( *this );
+    }
+
+/**
+ * Setup contact DB with the following contacts
+ *   + Tim Tester (id index 0)
+ *   + Teddy McTest (id index 1)
+ *   + Tod TestHill (id index 2)
+ *   + Simon Software (id index 3)
+ *   + Cyd Effect (id index 4)
+ *
+ */
+void CNSmlDummyDataStore_Test::SetupAndPopulateContactDbL()
+    {
+    if( !iContactDatabase )
+        {
+        iContactDatabase = CContactDatabase::OpenL();
+        }
+    if( !iTestUtilities )
+        {
+        iTestUtilities = CNSmlAdapterTestUtilities::NewL();
+        }
+
+    iIdArray = CContactIdArray::NewL();
+
+    // Create test contacts
+    iIdArray->AddL( AddContactL( _L( "Tim" ), _L( "Tester" ), _L( "+358501234567" ) ) );
+    iIdArray->AddL( AddContactL( _L( "Teddy" ), _L("McTest" ), _L( "+358501112222" ) ) );
+    iIdArray->AddL( AddContactL( _L( "Tod" ), _L( "TestHill" ), _L( "+358506666666" ) ) );
+    iIdArray->AddL( AddContactL( _L( "Simon" ), _L( "Software" ), _L( "+3585011223333" ) ) );
+    iIdArray->AddL( AddContactL( _L( "Cyd" ), _L( "Effect" ), _L( "+358503334444" ) ) );
+    }
+
+//// ++++++++++++ TEARDOWN METHODS ++++++++++++
+//
+void CNSmlDummyDataStore_Test::Teardown()
+    {
+    delete iCNSmlDummyDataStore;
+    iCNSmlDummyDataStore = NULL;
+
+    delete iTestUtilities;
+    iTestUtilities = NULL;
+    delete iContactManager;
+    iContactManager = NULL;
+    }
+
+void CNSmlDummyDataStore_Test::TeardownAndCloseStore()
+    {
+    delete iStoreWaiter;
+    iStoreWaiter = NULL;
+
+    delete iContactDatabase;
+    iContactDatabase = NULL;
+
+    Teardown();
+    }
+
+void CNSmlDummyDataStore_Test::TeardownCloseAndEmptyContactDb()
+    {
+    delete iStoreWaiter;
+    iStoreWaiter = NULL;
+
+    delete iCNSmlDummyDataStore;
+    iCNSmlDummyDataStore = NULL;
+
+    TeardownAndEmptyContactDb();
+    }
+
+void CNSmlDummyDataStore_Test::TeardownAndEmptyContactDb()
+    {
+    if (iContactDatabase && iIdArray)
+        {
+        TRAP_IGNORE( iContactDatabase->DeleteContactsL( *iIdArray ) );
+        }
+    
+    delete iIdArray;
+    iIdArray = NULL;
+    delete iContactDatabase;
+    iContactDatabase = NULL;
+    delete iTestUtilities;
+    iTestUtilities = NULL;
+    }
+
+// ++++++++++++ UNIT TEST METHODS ++++++++++++
+
+// ====================== CNSmlDummyDataStore ===========================
+
+// MEMORY ALLOCATION FOR DATASTORE
+void CNSmlDummyDataStore_Test::NewLL(  )
+    {
+    CNSmlDummyDataStore* dataStore = NULL;
+    EUNIT_ASSERT_NO_LEAVE( dataStore = CNSmlDummyDataStore::NewL() );
+    EUNIT_ASSERT( dataStore );
+    delete dataStore;
+    }
+
+// DoOpenL()
+void CNSmlDummyDataStore_Test::DoOpenLL()
+    {
+    CNSmlDummyDataStoreWaiter* storeWaiter =
+    CNSmlDummyDataStoreWaiter::NewLC( *iCNSmlDummyDataStore );
+
+    TRAPD( err, storeWaiter->OpenStoreL( *this ) );
+
+    // Check for leave
+    EUNIT_PRINT( _L( "Leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoOpenL() leave" );
+    CleanupStack::PopAndDestroy( storeWaiter );
+    }
+
+// DoHasSyncHistory()
+void CNSmlDummyDataStore_Test::DoHasSyncHistoryL()
+    {
+    TBool ret = iCNSmlDummyDataStore->DoHasSyncHistory();
+    EUNIT_ASSERT_DESC( ret == EFalse, "DoHasSyncHistory returns faulty value");
+    }
+
+// DoModifiedItems(), DoCommitChangeInfoL()
+void CNSmlDummyDataStore_Test::DoModifiedItemsL()
+    {
+    const MSmlDataItemUidSet& uiSet = iCNSmlDummyDataStore->DoModifiedItems();
+    EUNIT_ASSERT_DESC( uiSet.ItemCount() == 0, "DoModifiedItems returns faulty uid set");
+
+    TInt returnCode = KErrNone;
+
+    TRAPD( err, returnCode = iStoreWaiter->DoCommitChangeInfoL( uiSet ) );
+
+    // Check for leave
+    EUNIT_PRINT( _L( "Leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitChangeInfoL() leave" );
+
+    // Check for return code
+    EUNIT_PRINT( _L( "Return code: %d" ), returnCode );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitChangeInfoL returns error");
+    }
+
+
+// DoResetChangeInfoL()
+void CNSmlDummyDataStore_Test::DoResetChangeInfoLL()
+    {
+    // Temporarily remove ChangeFinders from Store to prevent leaves
+    // when reseting ChangeFinders in code under test.
+    CNSmlChangeFinder* cF = iCNSmlDummyDataStore->iChangeFinder;
+    iCNSmlDummyDataStore->iChangeFinder = NULL;
+
+    TInt returnCode = KErrNone;
+    TRAPD( err, returnCode = iStoreWaiter->DoResetChangeInfoL() );
+
+    // Return ChangeFinders
+    iCNSmlDummyDataStore->iChangeFinder = cF;
+
+    // Check for leave
+    EUNIT_PRINT( _L( "Leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoResetChangeInfoL() leave" );
+
+    // Check for return code
+    EUNIT_PRINT( _L( "Return code: %d" ), returnCode );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoResetChangeInfoL returns error");
+    }
+
+// DoCommitChangeInfoL()
+void CNSmlDummyDataStore_Test::DoCommitChangeInfoLL()
+    {
+    TInt returnCode = KErrNone;
+    TRAPD( err, returnCode = iStoreWaiter->DoCommitChangeInfoL() );
+
+    // Check for leave
+    EUNIT_PRINT( _L( "Leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitChangeInfoL() leave" );
+
+    // Check for return code
+    EUNIT_PRINT( _L( "Return code: %d" ), returnCode );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitChangeInfoL returns error");
+    }
+
+// Item addition - "Normal" (non-batch) mode
+//  (DoCreateItemL(), DoWriteItemL(), DoCommitItemL())
+void CNSmlDummyDataStore_Test::AddSingleItemL()
+    {
+    TBuf8< 20 > type;
+    TBuf8< 20 > ver = KNSmlvCard21Ver();
+    TInt returnCode = KErrNone;
+    iItemUid = KNullContactId;
+
+    // Try creating contact with illegal MIME type
+    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 1") );
+    TRAPD( err, returnCode = iStoreWaiter->DoCreateItemL(
+        iItemUid, 0, type, ver ) );
+
+    EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( returnCode == KErrNotSupported,
+        "DoCreateItemL() accepts illegal MIME" );
+
+    // Create legal contact
+    type = KNSmlvCard21Name();
+    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 2") );
+    TRAP( err, returnCode = iStoreWaiter->DoCreateItemL(
+        iItemUid, 512, type, ver ) );
+
+    EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error");
+
+    // Perform item writing to data store
+    HBufC8* vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasic() );
+    EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 3") );
+    // Non-async call (no need for iStoreWaiter usage)
+    TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+    EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+    CleanupStack::PopAndDestroy( vCard );
+
+    // Commit the contact to be created
+    EUNIT_PRINT( _L("Calling DoCommmitItemL(), STEP 4") );
+    TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
+
+    EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitItemL returns error");
+
+    // Check the imported item
+    EUNIT_ASSERT_DESC( iItemUid != KNullContactId, "Illegal UID for imported contact" );
+    EUNIT_PRINT( _L("Item ID: %d"), iItemUid );
+
+    // Print out the imported vCard
+    CContactIdArray* idArr = CContactIdArray::NewLC();
+    idArr->AddL( iItemUid );
+    CBufFlat* buffer = CBufFlat::NewL( 1024 );
+    CleanupStack::PushL( buffer );
+    RBufWriteStream writeStream( *buffer );
+    CleanupClosePushL( writeStream );
+
+    TRAP( err, iContactDatabase->ExportSelectedContactsL( TUid::Uid(KVersitEntityUidVCard), *idArr,
+        writeStream, CContactDatabase::EExcludeUid, Versit::EUTF8CharSet ) );
+
+    EUNIT_ASSERT_EQUALS_DESC( err, KErrNone, "ExportSelectedContactsL leave" );
+
+    CleanupStack::PopAndDestroy( &writeStream );
+
+    EUNIT_PRINT( buffer->Ptr( 0 ) );
+
+    // Do some asserts
+    EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("N:Smith;John") ) != KErrNotFound );
+    EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("TITLE:Boss") ) != KErrNotFound );
+
+    CleanupStack::PopAndDestroy( 2, idArr );  // buffer, idArr
+
+    // Do cleanup (remove added contact)
+    CContactIdArray* tmpArray = CContactIdArray::NewLC();
+    tmpArray->AddL( iItemUid );
+    TRAP_IGNORE( iContactDatabase->DeleteContactsL( *tmpArray ) );
+    CleanupStack::PopAndDestroy( tmpArray );
+    }
+
+
+// Item addition - Batch mode, empty batch
+//  (DoBeginBatchL(), DoCommitBatchL())
+void CNSmlDummyDataStore_Test::AddEmptyBatchL()
+    {
+    // DoBeginBatchL()
+    TRAPD( err, iCNSmlDummyDataStore->DoBeginBatchL() );
+    EUNIT_PRINT( _L( "DoBeginBatchL(): leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoBeginBatchL() leave" );
+
+    // DoCommitBatchL()
+    TInt returnCode = KErrNone;
+    RArray< TInt > array;
+    TRAP( err, returnCode = iStoreWaiter->DoCommitBatchL( array ) );
+
+    EUNIT_PRINT( _L( "DoCommitBatchL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitBatchL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitBatchL returns error");
+    }
+
+// Item addition - Batch mode with two contacts
+void CNSmlDummyDataStore_Test::AddTwoItemBatchL()
+    {
+    TBuf8<20> type = KNSmlvCard21Name();
+    TBuf8<20> ver = KNSmlvCard21Ver();
+    TInt returnCode = KErrNone;
+    HBufC8* vCard = NULL;
+
+    // DoBeginBatchL()
+    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 1") );
+    TRAPD( err, iCNSmlDummyDataStore->DoBeginBatchL() );
+    EUNIT_PRINT( _L( "DoBeginBatchL(): leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoBeginBatchL() leave" );
+
+    // == == CONTACT ITEM NO 1 == ==
+    vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasic() );
+    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 2") );
+    TRAP( err, returnCode = iStoreWaiter->DoCreateItemL(
+        iItemUid, vCard->Size(), type, ver ) );
+
+    EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error");
+
+    // Perform item writing to data store
+    EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 3") );
+    // Non-async call (no need for iStoreWaiter usage)
+    TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+    EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+    CleanupStack::PopAndDestroy( vCard );
+    vCard = NULL;
+
+    // Commit the contact to be created
+    EUNIT_PRINT( _L("Calling DoCommitItemL(), STEP 4") );
+    TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
+
+    EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitItemL returns error");
+
+    // == == CONTACT ITEM NO 2 == ==
+    vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardStandard() );
+
+    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 5") );
+    TRAP( err, returnCode = iStoreWaiter->DoCreateItemL(
+        iItemUid2, vCard->Size(), type, ver ) );
+    EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error" );
+
+    // Perform item writing to data store
+    EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 6") );
+    // Non-async call (no need for iStoreWaiter usage)
+    TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+    EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+    CleanupStack::PopAndDestroy( vCard );
+
+    // Commit the contact to be created
+    EUNIT_PRINT( _L("Calling DoCommitItemL(), STEP 7") );
+    TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
+    EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitItemL returns error" );
+
+    // Commit batch
+    RArray<TInt> array;
+    EUNIT_PRINT( _L("Calling DoCommitBatchL(), STEP 8") );
+    TRAP( err, returnCode = iStoreWaiter->DoCommitBatchL( array ) );
+
+    EUNIT_PRINT( _L( "DoCommitBatchL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitBatchL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitBatchL returns error" );
+
+    // Verify results
+    for( TInt i = 0; i < array.Count(); i++ )
+        {
+        EUNIT_PRINT( _L( "Contact: %d, Error code: %d "), i, array[ i ] );
+        EUNIT_ASSERT( array[ i ] == KErrNone );
+        }
+    EUNIT_ASSERT_DESC( array.Count() == 2, "Wrong number of contacts added" );
+    EUNIT_PRINT( _L("Item 1 ID = %d"), iItemUid );
+    EUNIT_PRINT( _L("Item 2 ID = %d"), iItemUid2 );
+
+    // Cleanup
+    array.Reset();
+    array.Close();
+
+    CContactIdArray* tmpArray = CContactIdArray::NewLC();
+    tmpArray->AddL( iItemUid );
+    tmpArray->AddL( iItemUid2 );
+    TRAP_IGNORE( iContactDatabase->DeleteContactsL( *tmpArray ) );
+    CleanupStack::PopAndDestroy( tmpArray );
+    }
+
+// Item addition - cancel Batch mode 
+void CNSmlDummyDataStore_Test::CancelBatchL()
+    {
+    TBuf8<20> type = KNSmlvCard21Name();
+    TBuf8<20> ver = KNSmlvCard21Ver();
+    TInt returnCode = KErrNone;
+    HBufC8* vCard = NULL;
+
+    // DoBeginBatchL()
+    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 1") );
+    TRAPD( err, iCNSmlDummyDataStore->DoBeginBatchL() );
+    EUNIT_PRINT( _L( "DoBeginBatchL(): leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoBeginBatchL() leave" );
+
+    // == == CONTACT ITEM NO 1 == ==
+    vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasic() );
+    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 2") );
+    TRAP( err, returnCode = iStoreWaiter->DoCreateItemL(
+        iItemUid, vCard->Size(), type, ver ) );
+
+    EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error");
+
+    // Perform item writing to data store
+    EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 3") );
+    // Non-async call (no need for iStoreWaiter usage)
+    TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+    EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+    CleanupStack::PopAndDestroy( vCard );
+    vCard = NULL;
+
+    // Cancel Batch
+    EUNIT_PRINT( _L("Calling DoCancelBatch(), STEP 4") );
+    iStoreWaiter->DoCancelBatch();
+    }
+
+// DoOpenItemL(), DoReadItemL(), DoCloseItemL()
+//  (LdoFetchItemL(), SingleContactOperationCompleteL())
+void CNSmlDummyDataStore_Test::FetchItemL()
+    {
+    TBuf8<20> type;
+    TBuf8<20> ver;
+    TInt returnCode = KErrNone;
+    TInt size = 0;
+    TSmlDbItemUid parentId = KNullContactId;
+    TBool fieldChange = EFalse;
+
+    // Open item ("Tim Tester") for reading
+    EUNIT_PRINT( _L("Calling DoOpenItemL()") );
+
+    //Make some preparations:
+    // (a) Set remote store format; needed by StripTxL()
+    //      - Otherwise we get access violation
+    EUNIT_ASSERT( iCNSmlDummyDataStore->iStoreFormat );
+    iCNSmlDummyDataStore->DoSetRemoteStoreFormatL(
+        *(iCNSmlDummyDataStore->iStoreFormat) );
+
+    TRAPD( err, returnCode = iStoreWaiter->DoOpenItemL(
+        ( *iIdArray )[ 0 ], fieldChange, size, parentId, type, ver ) );
+
+    EUNIT_PRINT( _L( "DoOpenItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoOpenItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoOpenItemL returns error");
+
+    // Execute some asserts to verify functionality
+    EUNIT_PRINT( _L( "DoOpenItemL(): size: %d" ),
+            size );
+    EUNIT_ASSERT_DESC( size != 0, "Illegal size value" );
+    EUNIT_ASSERT_DESC( parentId == KNullDataItemId, "Wrong parent ID" );
+    EUNIT_ASSERT_DESC( type.Compare( KNSmlvCard21Name() ) == 0,
+        "Illegal MIME type" );
+    EUNIT_ASSERT_DESC( ver.Compare( KNSmlvCard21Ver() ) == 0,
+        "Illegal MIME version" );
+
+    // Read the item contents (i.e. vCard)
+    HBufC8* vCard = HBufC8::NewLC( 86 );
+    TPtr8 vCardPtr = vCard->Des();
+    EUNIT_ASSERT_NO_LEAVE( iCNSmlDummyDataStore->DoReadItemL( vCardPtr ) );
+
+    EUNIT_PRINT( *vCard );
+    EUNIT_ASSERT( vCard->Find( _L8("N:Tester;Tim") ) != KErrNotFound );
+    EUNIT_ASSERT( vCard->Find( _L8("TEL:+358501234567") ) != KErrNotFound );
+
+    CleanupStack::PopAndDestroy( vCard );
+
+    // Close the contact item
+    iCNSmlDummyDataStore->DoCloseItem();
+    }
+
+void CNSmlDummyDataStore_Test::FetchItem2L()
+    {
+    TBuf8<20> type;
+    TBuf8<20> ver;
+    TInt returnCode = KErrNone;
+    TInt size = 0;
+    TSmlDbItemUid parentId = KNullContactId;
+    TBool fieldChange = EFalse;
+
+    TRAPD( err, returnCode = iStoreWaiter->DoOpenItemL(
+        10000, fieldChange, size, parentId, type, ver ) );
+
+    EUNIT_PRINT( _L( "DoOpenItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoOpenItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone || returnCode == KErrNotFound, "DoOpenItemL returns error");
+    }
+
+// Update a standard contact
+//  (DoReplaceItemL(), ExecuteBufferL(), ExecuteUpdateL(), ...)
+void CNSmlDummyDataStore_Test::UpdateItemL()
+    {
+    TInt returnCode = KErrNone;
+    TSmlDbItemUid parentId = KNullContactId;
+    TBool fieldChange = EFalse;
+
+    HBufC8* vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardStandard() );
+
+    // Update "Tim Tester" contact
+    TRAPD( err, returnCode = iStoreWaiter->DoReplaceItemL(
+        ( *iIdArray )[ 0 ], vCard->Size(), parentId, fieldChange ) );
+
+    EUNIT_PRINT( _L( "DoReplaceItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoReplaceItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoReplaceItemL returns error");
+
+    // Perform item writing to data store
+    EUNIT_PRINT( _L("Calling DoWriteItemL()") );
+    TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+    EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoWriteItemL() leave" );
+    CleanupStack::PopAndDestroy( vCard );
+
+    // Commit the contact to be created
+    EUNIT_PRINT( _L("Calling DoCommmitItemL()") );
+    TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
+
+    EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitItemL returns error");
+
+    // Print out the imported vCard
+    CContactIdArray* idArr = CContactIdArray::NewLC();
+    idArr->AddL( ( *iIdArray )[ 0 ] );
+    CBufFlat* buffer = CBufFlat::NewL( 1024 );
+    CleanupStack::PushL( buffer );
+    RBufWriteStream writeStream( *buffer );
+    CleanupClosePushL( writeStream );
+
+    TRAP( err, iContactDatabase->ExportSelectedContactsL(
+        TUid::Uid(KVersitEntityUidVCard), *idArr,
+        writeStream, CContactDatabase::EExcludeUid, Versit::EUTF8CharSet ) );
+
+    EUNIT_ASSERT_EQUALS_DESC( err, KErrNone, "ExportSelectedContactsL leave" );
+
+    CleanupStack::PopAndDestroy( &writeStream );
+
+    EUNIT_PRINT( buffer->Ptr( 0 ) );
+
+    // Do some asserts
+    EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("N:Smith;John") ) != KErrNotFound );
+    EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("TITLE:Boss") ) != KErrNotFound );
+
+    CleanupStack::PopAndDestroy( 2, idArr );  // buffer, idArr
+    }
+
+// Not working - memory leak: Heap cell count, 61, 73, Request count, 0, 1
+//  The test case never receives OpetionComplete() callback from VPbk. Therefore
+//  the request count & heap allocation do not match.
+// DoDeleteItemL(), StepComplete()
+void CNSmlDummyDataStore_Test::DeleteItemL()
+    {
+    // Delete item
+    TInt returnCode = KErrNone;
+    EUNIT_PRINT( _L("Calling DoDeleteItemL()") );
+    TRAPD( err, returnCode = iStoreWaiter->DoDeleteItemL( ( *iIdArray )[ 0 ] ) );
+
+    EUNIT_PRINT( _L( "DoDeleteItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoDeleteItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoDeleteItemL returns error");
+    iCNSmlDummyDataStore->ExecuteDeleteL();
+    // Check that the contact does not exist any more
+    CContactItem* item = NULL;
+    CContactDatabase* cntDb = NULL;
+    TRAP( err, cntDb = CContactDatabase::OpenL() );
+    TRAP( err, item = cntDb->ReadMinimalContactL(
+        ( *iIdArray )[ 0 ] ) );
+    EUNIT_ASSERT( !item );
+    EUNIT_PRINT( _L("Error=%d"), err );
+    EUNIT_ASSERT_EQUALS_DESC( err, KErrNotFound, "Deleted item found" );
+    delete item;
+    item = NULL;
+
+    if( cntDb )
+        {
+        delete cntDb;
+        }
+
+    iIdArray->Remove( 0 );
+    }
+
+// DoDeleteAllItemsL(), DoDeleteAllContactsL(), ...
+void CNSmlDummyDataStore_Test::DeleteAllItemsL()
+    {
+    // Temporarily remove ChangeFinders from Store to prevent leaves
+    // when reseting ChangeFinders in code under test.
+    CNSmlChangeFinder* cF = iCNSmlDummyDataStore->iChangeFinder;
+    CleanupStack::PushL( cF );
+    iCNSmlDummyDataStore->iChangeFinder = NULL;
+
+    TInt returnCode = KErrNone;
+    EUNIT_PRINT( _L("Calling DoDeleteAllItemsL()") );
+    TRAPD( err, returnCode = iStoreWaiter->DoDeleteAllItemsL() );
+
+    // Return ChangeFinders
+    CleanupStack::Pop( cF );
+    iCNSmlDummyDataStore->iChangeFinder = cF;
+
+    EUNIT_PRINT( _L( "DoDeleteAllItemsL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoDeleteAllItemsL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoDeleteAllItemsL returns error");
+
+    // Check that all normal contacts are removed
+    TContactItemId ownCardId = iContactDatabase->OwnCardId();
+
+    TInt contactCount = 0;
+    TInt groupCount = iContactDatabase->GroupCount();
+    TContactIter iter( *iContactDatabase );
+    for( TContactItemId id = iter.FirstL(); id != KNullContactId; id = iter.NextL() )
+        {
+        // KUidContactGroup
+        if( id != ownCardId )
+            {
+            contactCount++;
+            }
+        }
+    EUNIT_PRINT( _L("Number of items in DB=%d"), contactCount );
+    EUNIT_PRINT( _L("Number of groups in DB=%d"), groupCount );
+    EUNIT_ASSERT_DESC( contactCount - groupCount == 0, "All contacts not deleted");
+    }
+
+// GetStoreFormatResourceFileL()
+void CNSmlDummyDataStore_Test::GetStoreFormatResourceFileLL()
+    {
+    const TDesC& resourceFile = iCNSmlDummyDataStore->GetStoreFormatResourceFileL();
+    EUNIT_PRINT( resourceFile );
+    }
+
+
+// VCARD IMPORT TEST CASES
+
+void CNSmlDummyDataStore_Test::RemoveItemFromAddBatchL()
+    {
+    // Test case:
+    // - Run RemoveItemFromAddBatch() and verify its functionality
+
+    if( !iCNSmlDummyDataStore->iItemDataAddBatch )
+        {
+        iCNSmlDummyDataStore->iItemDataAddBatch =
+            CBufFlat::NewL( KNSmlItemDataExpandSize );
+        }
+
+    HBufC8* vCard = NULL;
+    // Test material: basic vCard
+    vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasic );
+    iCNSmlDummyDataStore->iItemDataAddBatch->InsertL(
+        iCNSmlDummyDataStore->iItemDataAddBatch->Size(),
+        *vCard, vCard->Size() );
+    iCNSmlDummyDataStore->iItemDataAddBatch->InsertL(
+        iCNSmlDummyDataStore->iItemDataAddBatch->Size(),
+        KVersitTokenCRLF() );
+    CleanupStack::PopAndDestroy( vCard );
+
+    // Test material 2: vCard with multiple TEL fields
+    vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardMultiOccurence );
+    iCNSmlDummyDataStore->iItemDataAddBatch->InsertL(
+        iCNSmlDummyDataStore->iItemDataAddBatch->Size(),
+        *vCard, vCard->Size() );
+    iCNSmlDummyDataStore->iItemDataAddBatch->InsertL(
+        iCNSmlDummyDataStore->iItemDataAddBatch->Size(),
+        KVersitTokenCRLF() );
+    CleanupStack::PopAndDestroy( vCard );
+
+//    iTestUtilities->PrintData( _L8("Buffer contents"),
+//        *iCNSmlDummyDataStore->iItemDataAddBatch ); // DEBUG PRINT
+    
+    TInt count = 0;
+
+    // ASSERTS
+    count = CountItemsLeftInBatchL(
+        *iCNSmlDummyDataStore->iItemDataAddBatch );
+    EUNIT_PRINT( _L("Items left %d"), count ); // DEBUG PRINT
+    EUNIT_ASSERT_DESC( count == 2, "Wrong initial item count in batch.")
+//    EUNIT_PRINT( _L("Items left %d"), count ); // DEBUG PRINT
+    }
+
+
+void CNSmlDummyDataStore_Test::TestStoreSupportMimeTypeL()
+    {
+    EUNIT_ASSERT( iCNSmlDummyDataStore->iStoreFormat );
+    EUNIT_ASSERT_EQUALS( iCNSmlDummyDataStore->iStoreFormat->MimeFormatCount() ,1 );
+    EUNIT_ASSERT_EQUALS(
+            iCNSmlDummyDataStore->iStoreFormat->MimeFormat(0).MimeType().DesC(),
+            KNSmlvCard21Name() );
+    EUNIT_ASSERT_EQUALS(
+            iCNSmlDummyDataStore->iStoreFormat->MimeFormat(0).MimeVersion().DesC(),
+                    KNSmlvCard21Ver() );
+    }
+
+void CNSmlDummyDataStore_Test::DoBeginTransactionL()
+    {
+    TRAPD( err, iCNSmlDummyDataStore->DoBeginTransactionL() );
+    EUNIT_ASSERT( err == KErrNotSupported );
+    }
+
+void CNSmlDummyDataStore_Test::DoCommitTransactionL()
+    {
+    TRequestStatus status;
+    iCNSmlDummyDataStore->DoCommitTransactionL( status );
+    EUNIT_ASSERT_DESC( status.Int() == KErrNotSupported, "DoCommitTransactionL fail"  )
+    }
+
+void CNSmlDummyDataStore_Test::DoRevertTransaction()
+    {
+    TRequestStatus status;
+    iCNSmlDummyDataStore->DoRevertTransaction( status );
+    EUNIT_ASSERT_DESC( status.Int() == KErrNotSupported, "DoRevertTransaction fail"  )
+    }
+
+void CNSmlDummyDataStore_Test::StoreNameL()
+    {
+    CreateDataStoreL();
+    EUNIT_PRINT( iDataStore->StoreName() );
+    iDataStore->CancelRequest();
+    DeleteDataStoreL();
+    }
+
+void CNSmlDummyDataStore_Test::FindChangedItemsL()
+    {
+    CreateDataStoreL();
+    const MSmlDataItemUidSet& added = iDataStore->AddedItems();
+    EUNIT_ASSERT_DESC( added.ItemCount() == 0, "AddedItems returns faulty uid set");
+    const MSmlDataItemUidSet& deleted = iDataStore->DeletedItems();
+    EUNIT_ASSERT_DESC( deleted.ItemCount() == 0, "DeletedItems returns faulty uid set");
+    const MSmlDataItemUidSet& softDeleted = iDataStore->SoftDeletedItems();
+    EUNIT_ASSERT_DESC( softDeleted.ItemCount() == 0, "SoftDeletedItems returns faulty uid set");
+    const MSmlDataItemUidSet& moved = iDataStore->MovedItems();
+    EUNIT_ASSERT_DESC( moved.ItemCount() == 0, "MovedItems returns faulty uid set");
+    DeleteDataStoreL();
+    }
+
+void CNSmlDummyDataStore_Test::MoveAndDeleteL()
+    {
+    CreateDataStoreL();
+    TSmlDbItemUid uid = 1;
+    TSmlDbItemUid parent = 0;
+    TRequestStatus status;
+    iDataStore->MoveItemL( uid, parent, status );
+    
+    TRequestStatus status2;
+    iDataStore->SoftDeleteItemL( uid, status2 );
+        
+    DeleteDataStoreL();
+    }
+
+void CNSmlDummyDataStore_Test::ExecuteMoveL()
+    {
+    iCNSmlDummyDataStore->ExecuteMoveL();
+    }
+
+void CNSmlDummyDataStore_Test::DoSetRemoteMaxObjectSize()
+    {
+    iCNSmlDummyDataStore->DoSetRemoteMaxObjectSize( 100000 );
+    }
+
+void CNSmlDummyDataStore_Test::DoMaxObjectSize()
+    {
+    TInt size = iCNSmlDummyDataStore->DoMaxObjectSize();
+    EUNIT_ASSERT( size == 102400 );
+    }
+
+void CNSmlDummyDataStore_Test::ContactsSavingFailedL()
+    {
+    TBuf8< 20 > type= KNSmlvCard21Name();
+    TBuf8< 20 > ver = KNSmlvCard21Ver();
+    TInt returnCode = KErrNone;
+    iItemUid = KNullContactId;
+    // Create legal contact
+    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 1") );
+    TRAPD( err, returnCode = iStoreWaiter->DoCreateItemL(
+        iItemUid, 512, type, ver ) );
+
+    EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error");
+
+    // Perform item writing to data store
+    HBufC8* vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasicInvalid() );
+    EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 2") );
+    // Non-async call (no need for iStoreWaiter usage)
+    TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+    EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+    CleanupStack::PopAndDestroy( vCard );
+
+    // Commit the contact to be created
+    EUNIT_PRINT( _L("Calling DoCommmitItemL(), STEP 3") );
+    TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
+
+    EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
+    EUNIT_ASSERT_DESC( returnCode == KErrNotFound, "DoCommitItemL returns error");
+    }
+
+void CNSmlDummyDataStore_Test::StepFailed()
+    {
+    TInt returnCode = KErrNone;
+    // delete contact which not exist
+    EUNIT_PRINT( _L("Calling DoDeleteItemL()") );
+    TRAPD( err, returnCode = iStoreWaiter->DoDeleteItemL( 10000 ) );
+    EUNIT_PRINT( _L( "DoDeleteItemL(): leave code: %d, return code: %d" ),
+        err, returnCode );
+    }
+
+void CNSmlDummyDataStore_Test::GetDataMod()
+    {
+    CNSmlDataModBase& dataMod = iCNSmlDummyDataStore->GetDataMod();
+    }
+
+
+// --------------- Helper methods --------------
+
+// Helper method to add a simple contact to test contact DB
+TContactItemId CNSmlDummyDataStore_Test::AddContactL(
+        const TDesC& aFirstName,
+        const TDesC& aLastName,
+        const TDesC& aPhoneNumber )
+    {
+    _LIT( KLabelFamilyName, "Last name");
+    _LIT( KLabelGivenName, "First name");
+    _LIT( KLabelPhone, "Phone");
+
+    CContactCard* card = CContactCard::NewLC();
+
+    // Family name field
+    CContactItemField* familyNameField =
+        CContactItemField::NewLC( KStorageTypeText, KUidContactFieldFamilyName );
+    familyNameField->SetLabelL( KLabelFamilyName );
+    familyNameField->SetMapping( KUidContactFieldVCardMapUnusedN );
+    familyNameField->TextStorage()->SetTextL( aLastName );
+    card->AddFieldL( *familyNameField ); // Takes ownership
+    CleanupStack::Pop( familyNameField );
+
+    // First name field
+    CContactItemField* nameField =
+    CContactItemField::NewLC( KStorageTypeText, KUidContactFieldGivenName );
+    nameField->SetLabelL( KLabelGivenName );
+    nameField->SetMapping( KUidContactFieldVCardMapUnusedN );
+    nameField->TextStorage()->SetTextL( aFirstName );
+    card->AddFieldL( *nameField );
+    CleanupStack::Pop(nameField);
+
+    // Phone number field
+    CContactItemField* phoneField =
+        CContactItemField::NewLC( KStorageTypeText, KUidContactFieldPhoneNumber );
+    phoneField->SetLabelL( KLabelPhone );
+    phoneField->SetMapping( KUidContactFieldVCardMapTEL );
+    phoneField->TextStorage()->SetTextL( aPhoneNumber );
+    card->AddFieldL( *phoneField );
+    CleanupStack::Pop( phoneField );
+
+    TContactItemId cardId = iContactDatabase->AddNewContactL( *card );
+    CleanupStack::PopAndDestroy( card );
+
+    return cardId;
+    }
+
+TInt CNSmlDummyDataStore_Test::CountItemsLeftInBatchL( CBufBase& aItems )
+    {
+    _LIT8( KVCardBeginTag, "BEGIN:VCARD\r\n");
+    _LIT8( KVCardEndTag, "\r\nEND:VCARD\r\n");
+
+    TInt vCardCount = 0;
+    TBool processed = EFalse;
+
+    HBufC8* tmpBuf = HBufC8::NewLC( aItems.Size() );
+    TPtr8 ptr = tmpBuf->Des();
+    aItems.Read( 0, ptr, aItems.Size() );
+
+    while( !processed )
+        {
+        TInt offsetBegin = ptr.FindF( KVCardBeginTag );
+        TInt offsetEnd = ptr.FindF( KVCardEndTag );
+
+        if( offsetBegin != KErrNotFound && offsetEnd != KErrNotFound )
+            {
+            offsetEnd += KVCardEndTag().Length();
+            vCardCount++;
+            ptr = ptr.MidTPtr( offsetEnd );
+            }
+        else
+            {
+            processed = ETrue;
+            }
+        }
+    CleanupStack::PopAndDestroy( tmpBuf );
+    return vCardCount;
+    }
+
+void CNSmlDummyDataStore_Test::CreateDataStoreL()
+    {
+    TSmlDataProviderId id = {0x101F6DDD};// Contact Adapter Uid
+    CSmlDataProvider* dp = CSmlDataProvider::NewL( id );
+    iDataStore = dp->NewStoreInstanceLC();
+    CleanupStack::Pop( iDataStore );
+    delete dp;
+    }
+
+void CNSmlDummyDataStore_Test::DeleteDataStoreL()
+    {
+    delete iDataStore;
+    iDataStore = NULL;
+    }
+
+void CNSmlDummyDataStore_Test::CreateViewL()
+    {
+    CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
+    CleanupStack::PushL( viewDef );
+    viewDef->SetType( EVPbkContactsView );
+
+    iContactViewBase = iContactManager->CreateContactViewLC( 
+                                         *this, 
+                                         *viewDef, 
+                                         iContactManager->FieldTypes() );
+    CleanupStack::Pop();// iContactViewBase
+    CleanupStack::PopAndDestroy( viewDef );
+    } 
+
+// ------------------  From MVPbkContactViewObserver ---------------------
+void CNSmlDummyDataStore_Test::ContactViewReady( MVPbkContactViewBase& /*aView*/ )
+    {
+    }   
+    
+void CNSmlDummyDataStore_Test::ContactViewUnavailable(
+            MVPbkContactViewBase& /*aView*/ )
+    {
+    }
+
+void CNSmlDummyDataStore_Test::ContactAddedToView(
+            MVPbkContactViewBase& /*aView*/, 
+            TInt /*aIndex*/, 
+            const MVPbkContactLink& /*aContactLink*/ )
+    {
+    }
+
+void CNSmlDummyDataStore_Test::ContactRemovedFromView(
+            MVPbkContactViewBase& /*aView*/, 
+            TInt /*aIndex*/, 
+            const MVPbkContactLink& /*aContactLink*/ )
+    { 
+    }
+    
+void CNSmlDummyDataStore_Test::ContactViewError(
+            MVPbkContactViewBase& /*aView*/, 
+            TInt /*aError*/, 
+            TBool /*aErrorNotified*/ )
+    { 
+    }
+
+// - EUnit test table -------------------------------------------------------
+
+EUNIT_BEGIN_TEST_TABLE(
+    CNSmlDummyDataStore_Test,
+    "Unit tests Contact adapter datastore",
+    "UNIT" )
+
+EUNIT_TEST(
+    "Test to verify memory allocation for the object",
+    "CNSmlContactsDataStore",
+    "NewL",
+    "FUNCTIONALITY",
+    Empty, NewLL, Empty)
+
+EUNIT_TEST(
+    "Open data store",
+    "CNSmlContactsDataStore",
+    "DoOpenL",
+    "FUNCTIONALITY",
+    SetupL, DoOpenLL, Teardown )
+
+EUNIT_TEST(
+    "DoHasSyncHistory",
+    "CNSmlContactsDataStore",
+    "DoHasSyncHistory",
+    "FUNCTIONALITY",
+    SetupAndOpenStoreL, DoHasSyncHistoryL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+    "DoModifiedItems & DoCommitChangeInfoL",
+    "CNSmlContactsDataStore",
+    "DoModifiedItems",
+    "FUNCTIONALITY",
+    SetupAndOpenStoreL, DoModifiedItemsL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+    "DoResetChangeInfoL",
+    "CNSmlContactsDataStore",
+    "DoResetChangeInfoL",
+    "FUNCTIONALITY",
+    SetupAndOpenStoreL, DoResetChangeInfoLL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+    "DoCommitChangeInfoL",
+    "CNSmlContactsDataStore",
+    "DoCommitChangeInfoL",
+    "FUNCTIONALITY",
+    SetupAndOpenStoreL, DoCommitChangeInfoLL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+    "Add single item (normal mode)",
+    "CNSmlContactsDataStore",
+    "DoCreateItemL, DoCommitItemL, ExecuteAddL, LdoAddItem",
+    "FUNCTIONALITY",
+    SetupAndOpenStoreL, AddSingleItemL, TeardownAndCloseStore )
+
+/* TIMEOUT error
+EUNIT_TEST(
+    "Add items in batch mode (empty batch)",
+    "CNSmlContactsDataStore",
+    "DoBeginBatchL, DoCommitBatchL",
+    "FUNCTIONALITY",
+    SetupAndOpenStoreL, AddEmptyBatchL, TeardownAndCloseStore )*/
+    
+EUNIT_TEST(
+    "Add items in batch mode (2 contacts)",
+    "CNSmlContactsDataStore",
+    "DoBeginBatchL, DoCommitBatchL",
+    "FUNCTIONALITY",
+    SetupAndOpenStoreL, AddTwoItemBatchL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+    "CancelBatchL",
+    "CNSmlContactsDataStore",
+    "DoCancelBatch",
+    "FUNCTIONALITY",
+    SetupAndOpenStoreL, CancelBatchL, TeardownAndCloseStore ) 
+
+EUNIT_TEST(
+    "Fetch/read normal contact",
+    "CNSmlContactsDataStore",
+    "LdoFetchItemL",
+    "FUNCTIONALITY",
+    SetupPopulateDbAndOpenStoreL, FetchItemL, TeardownCloseAndEmptyContactDb )
+
+EUNIT_TEST(
+    "Fail fetch",
+    "CNSmlContactsDataStore",
+    "LdoFetchItemL",
+    "FUNCTIONALITY",
+    SetupPopulateDbAndOpenStoreL, FetchItem2L, TeardownCloseAndEmptyContactDb )
+    
+EUNIT_TEST(
+    "Update normal contact",
+    "CNSmlContactsDataStore",
+    "ExecuteUpdateL",
+    "FUNCTIONALITY",
+    SetupPopulateDbAndOpenStoreL, UpdateItemL, TeardownCloseAndEmptyContactDb )
+
+EUNIT_TEST(
+    "Delete normal contact",
+    "CNSmlContactsDataStore",
+    "DoDeleteItemL",
+    "FUNCTIONALITY",
+    SetupPopulateDbAndOpenStoreL, DeleteItemL, TeardownCloseAndEmptyContactDb )
+
+EUNIT_TEST(
+    "Delete all contacts",
+    "CNSmlContactsDataStore",
+    "DoDeleteItemL",
+    "FUNCTIONALITY",
+    SetupPopulateDbAndOpenStoreL, DeleteAllItemsL, TeardownCloseAndEmptyContactDb )
+
+EUNIT_TEST(
+	"Test for GetStoreFormatResourceFileL function",
+	"CNSmlContactsDataStore",
+	"",
+	"FUNCTIONALITY",
+	SetupL, GetStoreFormatResourceFileLL, Teardown )
+
+EUNIT_TEST(
+    "RemoveItemFromAddBatch",
+    "CNSmlContactsDataStore",
+    "RemoveItemFromAddBatch",
+    "FUNCTIONALITY",
+    SetupL, RemoveItemFromAddBatchL, Teardown )
+
+EUNIT_TEST(
+    "Verify operator specific MIME type",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupL, TestStoreSupportMimeTypeL, Teardown )
+
+EUNIT_TEST(
+    "GetDataMod",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupL, GetDataMod, Teardown )
+
+EUNIT_TEST(
+    "DoBeginTransactionL",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupL, DoBeginTransactionL, Teardown )
+
+EUNIT_TEST(
+    "DoCommitTransactionL",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupL, DoCommitTransactionL, Teardown )
+
+EUNIT_TEST(
+    "DoRevertTransaction",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupL, DoRevertTransaction, Teardown )
+
+EUNIT_TEST(
+    "StoreNameL",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupL, StoreNameL, Teardown )
+    
+EUNIT_TEST(
+    "FindChangedItemsL",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupL, FindChangedItemsL, Teardown )   
+
+EUNIT_TEST(
+    "MoveAndDeleteL",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupL, MoveAndDeleteL, Teardown )
+
+EUNIT_TEST(
+    "ExecuteMoveL (move command is not supported)",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupL, ExecuteMoveL, Teardown )
+
+EUNIT_TEST(
+    "DoSetRemoteMaxObjectSize",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupL, DoSetRemoteMaxObjectSize, Teardown )
+
+EUNIT_TEST(
+    "DoMaxObjectSize",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupL, DoMaxObjectSize, Teardown )
+
+EUNIT_TEST(
+    "ContactsSavingFailedL",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupAndOpenStoreL, ContactsSavingFailedL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+    "StepFailed",
+    "CNSmlContactsDataStore",
+    "",
+    "FUNCTIONALITY",
+    SetupPopulateDbAndOpenStoreL, StepFailed, TeardownCloseAndEmptyContactDb )
+
+EUNIT_END_TEST_TABLE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastore_test.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for contact adapter's datastore unit tests.
+*
+*/
+
+#ifndef __CNSMLDUMMYDATASTORE_TEST_H__
+#define __CNSMLDUMMYDATASTORE_TEST_H__
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <SmlDataSyncDefs.h>
+#include <cntdb.h>
+#include <s32mem.h>
+#include <MVPbkContactViewBase.h>
+#include <MVPbkContactViewObserver.h>
+#include <CVPbkContactManager.h>
+
+// FORWARD DECLARATIONS
+class CNSmlDummyDataStore;
+class CNSmlAdapterTestUtilities;
+class CNSmlDummyDataStoreWaiter;
+class CSmlDataStore;
+// CLASS DEFINITION
+
+/**
+ * Generated EUnit test suite class.
+ */
+NONSHARABLE_CLASS( CNSmlDummyDataStore_Test )
+	: public CEUnitTestSuiteClass, 
+	public MSmlSyncRelationship,
+    public MVPbkContactViewObserver
+    {
+    public:  // Constructors and destructor
+
+        static CNSmlDummyDataStore_Test* NewL();
+        static CNSmlDummyDataStore_Test* NewLC();
+        ~CNSmlDummyDataStore_Test();
+
+    private: // Constructors
+
+        CNSmlDummyDataStore_Test();
+        void ConstructL();
+
+    private: // New methods
+
+        void Empty() {};
+
+        // ++ Setup methods ++
+        void SetupL();
+        
+        void SetupAndOpenStoreL();
+        
+        void SetupAndPopulateContactDbL();
+        
+        void SetupPopulateDbAndOpenStoreL();
+
+        // ++ Teardown methods ++
+        void Teardown();
+        
+        void TeardownAndCloseStore();
+        
+        void TeardownAndEmptyContactDb();
+        
+        void TeardownCloseAndEmptyContactDb();
+
+        // ++ DataStore test cases ++
+        void NewLL();
+
+        void DoOpenLL();
+
+        void DoHasSyncHistoryL();
+
+        void DoModifiedItemsL();
+
+        void DoResetChangeInfoLL();
+
+        void DoCommitChangeInfoLL();
+
+        void AddSingleItemL();
+
+        void AddEmptyBatchL();
+
+        void AddTwoItemBatchL();
+        
+        void CancelBatchL();
+
+        void FetchItemL();
+
+        void FetchItem2L();
+        
+        void UpdateItemL();
+
+        void DeleteItemL();
+
+        void DeleteAllItemsL();
+
+        void GetStoreFormatResourceFileLL();
+
+        void RemoveItemFromAddBatchL();
+
+        void TestStoreSupportMimeTypeL();
+        
+        void DoBeginTransactionL();
+        
+        void DoCommitTransactionL();
+        
+        void DoRevertTransaction();
+        
+        void StoreNameL();
+        
+        void FindChangedItemsL();
+        
+        void MoveAndDeleteL();
+        
+        void ExecuteMoveL();
+        
+        void DoSetRemoteMaxObjectSize();
+        
+        void DoMaxObjectSize();
+        
+        void LdoFetchItemL();
+        
+        void ContactsSavingFailedL();
+        
+        void StepFailed();
+        
+        void GetDataMod();
+ 
+//
+
+        // ++ Helper methods ++
+        TContactItemId AddContactL( const TDesC& aFirstName,
+                 const TDesC& aLastName,
+                 const TDesC& aPhoneNumber );
+        TInt CountItemsLeftInBatchL( CBufBase& aItems );
+        
+        void CreateViewL();
+        
+        void CreateDataStoreL();
+
+        void DeleteDataStoreL();
+        
+        // From MVPbkContactViewObserver  
+        void ContactViewReady( MVPbkContactViewBase& aView ) ;
+       
+        void ContactViewUnavailable(
+                    MVPbkContactViewBase& aView ) ;
+        
+        void ContactAddedToView(
+                    MVPbkContactViewBase& aView, 
+                    TInt aIndex, 
+                    const MVPbkContactLink& aContactLink );
+        
+        void ContactRemovedFromView(
+                    MVPbkContactViewBase& aView, 
+                    TInt aIndex, 
+                    const MVPbkContactLink& aContactLink ) ;
+             
+        void ContactViewError(
+                    MVPbkContactViewBase& aView, 
+                    TInt aError, 
+                    TBool aErrorNotified ) ;
+        
+    private: // from MSmlSyncRelationship
+        TSmlSyncTaskKey SyncTaskKey() const;
+        
+        void OpenReadStreamLC(RReadStream& aReadStream, TUid aStreamUid);
+        
+        void OpenWriteStreamLC(RWriteStream& aWriteStream, TUid aStreamUid);
+        
+        TBool IsStreamPresentL(TUid aStreamUid) const;
+
+    private: // Data
+
+        CNSmlDummyDataStore* iCNSmlDummyDataStore;
+        CNSmlAdapterTestUtilities* iTestUtilities;
+
+        CContactDatabase*   iContactDatabase;
+        CContactIdArray*    iIdArray;
+        RFs                 iFsSession;
+        RFileWriteStream    iWriteStream;
+        TSmlDbItemUid       iItemUid;
+        TSmlDbItemUid       iItemUid2;
+
+        CNSmlDummyDataStoreWaiter* iStoreWaiter;
+        MVPbkContactViewBase* iContactViewBase;
+        CVPbkContactManager* iContactManager;
+        
+        CSmlDataStore* iDataStore;
+
+        EUNIT_DECLARE_TEST_TABLE;
+    };
+
+#endif      //  __CNSMLDUMMYDATASTORE_TEST_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastorewaiter.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,309 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Source code file for datastorewaiter helper class.
+*
+*/
+
+//  CLASS HEADER
+#include "cnsmldummydatastorewaiter.h"
+
+// INTERNAL INCLUDES
+#include "NSmlDummyDataStore.h"
+
+//  EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+
+// CONSTANTS
+
+
+// --- Constructors & destructors --------------------------------------------
+CNSmlDummyDataStoreWaiter* CNSmlDummyDataStoreWaiter::NewL(
+        CNSmlDummyDataStore& aStore )
+    {
+    CNSmlDummyDataStoreWaiter* self =
+        CNSmlDummyDataStoreWaiter::NewLC( aStore );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+CNSmlDummyDataStoreWaiter* CNSmlDummyDataStoreWaiter::NewLC(
+    CNSmlDummyDataStore& aStore )
+    {
+    CNSmlDummyDataStoreWaiter* self =
+        new ( ELeave ) CNSmlDummyDataStoreWaiter( aStore );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    return self;
+    }
+
+CNSmlDummyDataStoreWaiter::~CNSmlDummyDataStoreWaiter()
+    {
+    Cancel();
+    delete iWait;
+    iOpen = EFalse;
+    }
+
+CNSmlDummyDataStoreWaiter::CNSmlDummyDataStoreWaiter(
+    CNSmlDummyDataStore& aStore ):
+    CActive( EPriorityNormal ), iStore( aStore ), iOpen( EFalse )
+    {
+
+    }
+
+void CNSmlDummyDataStoreWaiter::ConstructL()
+    {
+    CActiveScheduler::Add( this );
+    iWait = new ( ELeave ) CActiveSchedulerWait();
+    }
+
+// --- From CActive ----------------------------------------------------------
+void CNSmlDummyDataStoreWaiter::DoCancel()
+    {
+    iStore.CancelRequest();
+    }
+
+void CNSmlDummyDataStoreWaiter::RunL()
+    {
+    iWait->AsyncStop();
+    }
+
+// --- Test methods -----------------------------------------------------------
+
+void CNSmlDummyDataStoreWaiter::OpenStoreL( MSmlSyncRelationship& aRelationship, 
+    const TDesC& aStoreName )
+    {
+    Cancel();
+    if ( aStoreName == KNSmlContactStoreNameForDefaultDB )
+        {
+        iStore.OpenL( KNSmlContactStoreNameForDefaultDB, aRelationship, iStatus );
+        }
+    else
+        {
+        iStore.OpenL( aStoreName, aRelationship, iStatus );
+        }
+    SetActive();
+
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+    iOpen = ETrue;
+    }
+
+TInt CNSmlDummyDataStoreWaiter::DoCommitChangeInfoL(
+    const MSmlDataItemUidSet& aItems )
+    {
+    if( !iOpen )
+        {
+        User::Leave( KErrNotReady );
+        }
+
+    Cancel();
+    iStore.DoCommitChangeInfoL( iStatus, aItems );
+    SetActive();
+
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+
+    return iStatus.Int();
+    }
+
+TInt CNSmlDummyDataStoreWaiter::DoResetChangeInfoL()
+    {
+    if( !iOpen )
+        {
+        User::Leave( KErrNotReady );
+        }
+
+    Cancel();
+    iStore.DoResetChangeInfoL( iStatus );
+    SetActive();
+
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+
+    return iStatus.Int();
+    }
+
+TInt CNSmlDummyDataStoreWaiter::DoCommitChangeInfoL()
+    {
+    if( !iOpen )
+        {
+        User::Leave( KErrNotReady );
+        }
+
+    Cancel();
+    iStore.DoCommitChangeInfoL( iStatus );
+    SetActive();
+
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+
+    return iStatus.Int();
+    }
+
+// Item addition in "normal" (non-batch) mode
+TInt CNSmlDummyDataStoreWaiter::DoCreateItemL( TSmlDbItemUid& aUid,
+    TInt aSize, const TDesC8& aMimeType, const TDesC8& aMimeVer )
+    {
+    if( !iOpen )
+        {
+        User::Leave( KErrNotReady );
+        }
+    Cancel();
+    iStore.DoCreateItemL( aUid, aSize, 0, aMimeType, aMimeVer, iStatus );
+
+    SetActive();
+
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+
+    return iStatus.Int();
+    }
+
+TInt CNSmlDummyDataStoreWaiter::DoCommitItemL()
+    {
+    if( !iOpen )
+        {
+        User::Leave( KErrNotReady );
+        }
+    Cancel();
+    iStore.DoCommitItemL( iStatus );
+
+    SetActive();
+
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+
+    return iStatus.Int();
+    }
+
+TInt CNSmlDummyDataStoreWaiter::DoCommitBatchL( RArray<TInt>& aResultArray )
+    {
+    if( !iOpen )
+        {
+        User::Leave( KErrNotReady );
+        }
+    Cancel();
+    iStore.DoCommitBatchL( aResultArray, iStatus );
+
+    SetActive();
+
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+
+    return iStatus.Int();
+    }
+
+void CNSmlDummyDataStoreWaiter::DoCancelBatch()
+    {
+    if( !iOpen )
+        {
+        return;
+        }
+    iStore.DoCancelBatch();
+    }
+
+TInt CNSmlDummyDataStoreWaiter::DoOpenItemL( TSmlDbItemUid aUid,
+    TBool& aFieldChange, TInt& aSize, TSmlDbItemUid& aParent,
+    TDes8& aMimeType, TDes8& aMimeVer )
+    {
+    if( !iOpen )
+        {
+        User::Leave( KErrNotReady );
+        }
+    Cancel();
+    iStore.OpenItemL( aUid, aFieldChange, aSize, aParent, aMimeType,
+        aMimeVer, iStatus );
+
+    SetActive();
+
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+
+    return iStatus.Int();
+    }
+
+TInt CNSmlDummyDataStoreWaiter::DoReplaceItemL( TSmlDbItemUid aUid,
+    TInt aSize, TSmlDbItemUid aParent, TBool aFieldChange )
+    {
+    if( !iOpen )
+        {
+        User::Leave( KErrNotReady );
+        }
+    Cancel();
+    iStore.ReplaceItemL( aUid, aSize, aParent, aFieldChange, iStatus );
+    SetActive();
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+    return iStatus.Int();
+    }
+
+TInt CNSmlDummyDataStoreWaiter::DoDeleteItemL( TSmlDbItemUid aUid )
+    {
+    if( !iOpen )
+        {
+        User::Leave( KErrNotReady );
+        }
+    Cancel();
+    iStore.DeleteItemL( aUid, iStatus );
+
+    SetActive();
+
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+
+    return iStatus.Int();
+    }
+
+TInt CNSmlDummyDataStoreWaiter::DoDeleteAllItemsL()
+    {
+    if( !iOpen )
+        {
+        User::Leave( KErrNotReady );
+        }
+    Cancel();
+    iStore.DeleteAllItemsL( iStatus );
+
+    SetActive();
+
+    if( !iWait->IsStarted() )
+        {
+        iWait->Start();
+        }
+
+    return iStatus.Int();
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastorewaiter.h	Wed Sep 01 12:30:02 2010 +0100
@@ -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:  Header file for datastorewaiter helper class.
+*
+*/
+
+#ifndef __CNSMLDUMMYDATASTOREWAITER_H__
+#define __CNSMLDUMMYDATASTOREWAITER_H__
+
+// INCLUDES
+#include <e32base.h>
+#include "nsmldummydatastore.h"
+
+// FORWARD DECLARATIONS
+class MSmlSyncRelationship;
+
+// CLASS DEFINITION
+
+
+NONSHARABLE_CLASS( CNSmlDummyDataStoreWaiter ):
+    public CActive
+    {
+    public:  // Constructors and destructor
+        static CNSmlDummyDataStoreWaiter* NewL( CNSmlDummyDataStore& aStore );
+        static CNSmlDummyDataStoreWaiter* NewLC( CNSmlDummyDataStore& aStore );
+        virtual ~CNSmlDummyDataStoreWaiter();
+        
+    private:  // Constructors
+        CNSmlDummyDataStoreWaiter( CNSmlDummyDataStore& aStore );
+        void ConstructL();
+        
+    private:  // From CActive
+        void DoCancel();
+        void RunL();
+    
+    public:
+        void OpenStoreL( MSmlSyncRelationship& aRelationship, 
+            const TDesC& aStoreName = KNSmlContactStoreNameForDefaultDB );
+        TInt DoCommitChangeInfoL( const MSmlDataItemUidSet& aItems );
+        TInt DoResetChangeInfoL();
+        TInt DoCommitChangeInfoL();
+        
+        TInt DoCreateItemL( TSmlDbItemUid& aUid, TInt aSize, 
+            const TDesC8& aMimeType, const TDesC8& aMimeVer );
+        TInt DoCommitItemL();
+                
+        TInt DoCommitBatchL( RArray<TInt>& aResultArray );
+        void DoCancelBatch();
+        
+        TInt DoOpenItemL( TSmlDbItemUid aUid, TBool& aFieldChange, 
+            TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType, 
+            TDes8& aMimeVer );
+        TInt DoReplaceItemL( TSmlDbItemUid aUid, TInt aSize, 
+            TSmlDbItemUid aParent, TBool aFieldChange );
+        TInt DoDeleteItemL( TSmlDbItemUid aUid );
+        TInt DoDeleteAllItemsL();
+
+    private:  // Data
+        CActiveSchedulerWait* iWait;
+        CNSmlDummyDataStore& iStore;
+        TBool iOpen;
+    };
+
+#endif // __CNSMLDUMMYDATASTOREWAITER_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummymodsfetcher_test.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,314 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Source code file for contact adapter's modfetcher unit tests.
+*
+*/
+
+#include "CNSmlDummyModsFetcher_Test.h"
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <CNTDB.H>
+#include <cntfield.h>
+#include <CNTFLDST.H>
+#include <nsmlsnapshotitem.h>
+#include <e32hashtab.h>
+#include <nsmlchangefinder.h>
+
+// VPbk includes
+#include <cvpbkcontactstoreuriarray.h>
+#include <tvpbkcontactstoreuriptr.h>
+#include <cvpbkcontactmanager.h>
+#include <VPbkContactStoreUris.h>
+#include <MVPbkContactStoreList.h>
+#include <CVPbkContactViewDefinition.h>
+#include <MVPbkContactLink.h>
+
+#include "CNSmlAdapterTestUtilities.h"
+#include "nsmldummymodsfetcher.h"
+
+namespace
+    {
+    _LIT( KTestDB, "c:eunitdb" );
+    }
+
+//// Implementation UID for contacts adapter
+const TUint KNSmlContactsAdapterImplUid = 0x101F6DDD;
+
+// - Construction -----------------------------------------------------------
+
+CNSmlDummyModsFetcher_Test* CNSmlDummyModsFetcher_Test::NewL()
+    {
+    CNSmlDummyModsFetcher_Test* self = CNSmlDummyModsFetcher_Test::NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+
+CNSmlDummyModsFetcher_Test* CNSmlDummyModsFetcher_Test::NewLC()
+    {
+    CNSmlDummyModsFetcher_Test* self = new( ELeave ) CNSmlDummyModsFetcher_Test();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+CNSmlDummyModsFetcher_Test::~CNSmlDummyModsFetcher_Test()
+    {
+    iReadStream.Close();
+    delete iTestData;
+
+    delete iCNSmlDummyModsFetcher;
+
+    delete iChangeFinder;
+
+    delete iTestUtilities;
+
+    delete iContactManager;
+    }
+
+CNSmlDummyModsFetcher_Test::CNSmlDummyModsFetcher_Test():
+    iKey( TKeyArrayFix( _FOFF( TNSmlSnapshotItem, ItemId() ), ECmpTInt ))
+    {
+    }
+
+void CNSmlDummyModsFetcher_Test::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+// - Test methods -----------------------------------------------------------
+
+// ++++++++++++ SETUP METHODS ++++++++++++
+
+void CNSmlDummyModsFetcher_Test::SetupL(  )
+    {
+    EUNIT_PRINT( _L("SetupL: begin"));
+    iTestUtilities = CNSmlAdapterTestUtilities::NewL();
+    iTestUtilities->SetupAndPopulateContactDbL( KTestDB );
+    iContactDatabase = iTestUtilities->GetDb();
+
+    iTestData = HBufC8::NewL( 1024 );
+    iReadStream.Open( *iTestData );
+
+    EUNIT_PRINT( _L("SetupL: contact mgr"));
+
+    // Create contact manager
+    CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
+    uriArray->AppendL( TVPbkContactStoreUriPtr( VPbkContactStoreUris::DefaultCntDbUri() ) );
+    iContactManager = CVPbkContactManager::NewL(*uriArray);
+    CleanupStack::PopAndDestroy(uriArray);
+
+    // Create store and open it
+    EUNIT_PRINT( _L("SetupL: store"));
+    iStore = iContactManager->ContactStoresL().Find(
+        TVPbkContactStoreUriPtr( VPbkContactStoreUris::DefaultCntDbUri() ) );
+    iStore->OpenL( *this );
+
+    iSyncHistory = EFalse;
+    iSnapshotRegistered = EFalse;
+
+    // Create platform ChangeFinder
+    EUNIT_PRINT( _L("SetupL: ChangeFinder"));
+    TRAPD(err, iChangeFinder = CNSmlChangeFinder::NewL(
+        *this, iKey, iSyncHistory, KNSmlContactsAdapterImplUid ));
+    if( err != KErrNone )
+        {
+        EUNIT_PRINT( _L("ChangeFinder Error: %d"), err );
+        }
+
+    // Finally, create ModsFetcher && assert allocation
+    EUNIT_PRINT( _L("SetupL: ModsFetcher"));
+    iCNSmlDummyModsFetcher = new (ELeave) CNSmlDummyModsFetcher(
+        iSnapshotRegistered,
+        *iContactManager,
+        *iStore,
+        iKey,
+        *iChangeFinder );
+
+    EUNIT_ASSERT( iCNSmlDummyModsFetcher );
+
+    iCNSmlDummyModsFetcher->ConstructL();
+
+    iLastChanged = Time::NullTTime();
+
+    EUNIT_PRINT( _L("SetupL -end"));
+    }
+
+void CNSmlDummyModsFetcher_Test::SetupCreateItemL()
+    {
+    SetupL();
+    iCardId = iTestUtilities->AddContactL( _L("Test"), KNullDesC(),
+        KNullDesC() );
+    }
+
+
+// ++++++++++++ TEARDOWN METHODS ++++++++++++
+
+void CNSmlDummyModsFetcher_Test::Teardown()
+    {
+    iReadStream.Close();
+    delete iTestData;
+    iTestData = NULL;
+
+    EUNIT_PRINT( _L("Teardown"));
+    delete iCNSmlDummyModsFetcher;
+    iCNSmlDummyModsFetcher = NULL;
+    EUNIT_PRINT( _L("Teardown-2"));
+
+    delete iChangeFinder;
+    EUNIT_PRINT( _L("Teardown-3"));
+
+    EUNIT_PRINT( _L("Teardown-4"));
+
+    EUNIT_PRINT( _L("Teardown-5"));
+    if ( iContactManager )
+        {
+            if(iStore)
+            {
+            iStore->Close( *this );
+            }
+        delete iContactManager;
+        iContactManager = NULL;
+        }
+    EUNIT_PRINT( _L("Teardown-6"));
+    TRAP_IGNORE( iTestUtilities->TeardownAndEmptyContactDbL( KTestDB ) );
+    delete iTestUtilities;
+    iTestUtilities = NULL;
+    iCardId = 0;
+    EUNIT_PRINT( _L("Teardown-7"));
+    }
+
+void CNSmlDummyModsFetcher_Test::CreateViewL()
+    {
+    CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
+    CleanupStack::PushL( viewDef );
+    viewDef->SetType( EVPbkContactsView );
+
+    //viewDef->SetUriL( iStore->StoreProperties().Uri().UriDes() );
+
+    iContactViewBase = iContactManager->CreateContactViewLC( 
+                                         *this, 
+                                         *viewDef, 
+                                         iContactManager->FieldTypes() );
+    CleanupStack::Pop();
+    CleanupStack::PopAndDestroy( viewDef );
+    } 
+
+// ++++++++++++ ACTUAL TEST METHODS ++++++++++++
+
+// ------------------ From MSmlSyncRelationship ---------------------
+TSmlSyncTaskKey CNSmlDummyModsFetcher_Test::SyncTaskKey() const
+    {
+    EUNIT_PRINT( _L("SyncTaskKey"));
+    return 0;
+    }
+
+void CNSmlDummyModsFetcher_Test::OpenReadStreamLC(RReadStream& aReadStream, TUid /*aStreamUid*/)
+    {
+    EUNIT_PRINT( _L("OpenReadStreamLC"));
+    aReadStream = iReadStream;
+    CleanupClosePushL( iReadStream );
+
+    EUNIT_PRINT( _L("OpenReadStreamLC - end"));
+    }
+
+void CNSmlDummyModsFetcher_Test::OpenWriteStreamLC(RWriteStream& /*aWriteStream*/, TUid /*aStreamUid*/)
+    {
+    EUNIT_PRINT( _L("OpenWriteStreamLC"));
+    }
+
+TBool CNSmlDummyModsFetcher_Test::IsStreamPresentL(TUid /*aStreamUid*/) const
+    {
+    EUNIT_PRINT( _L("IsStreamPresentL"));
+    return EFalse;
+    }
+// ---------------- MSmlSyncRelationship END -----------------------
+
+// ------------------ From MVPbkContactStoreObserver ---------------------
+void CNSmlDummyModsFetcher_Test::StoreReady(
+    MVPbkContactStore& /*aContactStore*/ )
+    {
+    }
+
+void CNSmlDummyModsFetcher_Test::StoreUnavailable(
+    MVPbkContactStore& /*aContactStore*/, TInt /*aReason*/)
+    {
+    }
+
+void CNSmlDummyModsFetcher_Test::HandleStoreEventL(
+        MVPbkContactStore& /*aContactStore*/,
+        TVPbkContactStoreEvent /*aStoreEvent*/)
+    {
+    }
+
+// ------------------  From MVPbkContactViewObserver ---------------------
+void CNSmlDummyModsFetcher_Test::ContactViewReady( MVPbkContactViewBase& /*aView*/ )
+    {
+    }   
+    
+void CNSmlDummyModsFetcher_Test::ContactViewUnavailable(
+            MVPbkContactViewBase& /*aView*/ )
+    {
+    }
+
+void CNSmlDummyModsFetcher_Test::ContactAddedToView(
+            MVPbkContactViewBase& /*aView*/, 
+            TInt /*aIndex*/, 
+            const MVPbkContactLink& /*aContactLink*/ )
+    {
+    }
+
+void CNSmlDummyModsFetcher_Test::ContactRemovedFromView(
+            MVPbkContactViewBase& /*aView*/, 
+            TInt /*aIndex*/, 
+            const MVPbkContactLink& /*aContactLink*/ )
+    { 
+    }
+    
+void CNSmlDummyModsFetcher_Test::ContactViewError(
+            MVPbkContactViewBase& /*aView*/, 
+            TInt /*aError*/, 
+            TBool /*aErrorNotified*/ )
+    { 
+    }
+
+// ---------------- MVPbkContactStoreObserver END -----------------------
+
+// Helper functions
+
+CContactItemField* CNSmlDummyModsFetcher_Test::CreateConfidentialLC()
+    {
+    CContactItemField* confidentialField =
+        CContactItemField::NewLC( KStorageTypeText, KUidContactFieldClass );
+    confidentialField->SetMapping( KUidContactFieldVCardMapClass );
+    confidentialField->TextStorage()->SetTextL( KNSmlContactSyncNoSync );
+    EUNIT_PRINT( _L("CreateConfidentialLC - END"));
+    return confidentialField;
+    }
+
+
+// - EUnit test table -------------------------------------------------------
+
+EUNIT_BEGIN_TEST_TABLE(
+    CNSmlDummyModsFetcher_Test,
+    "Unit tests for CNSmlDummyModsFetcher.",
+    "UNIT" )
+
+EUNIT_TEST(
+    "CNSmlContactsModsFetcher allocation",
+    "CNSmlContactsModsFetcher",
+    "Allocation",
+    "FUNCTIONALITY",
+    SetupL, Empty, Teardown)
+
+EUNIT_END_TEST_TABLE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummymodsfetcher_test.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,174 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for contact adapter's modfetcher unit tests.
+*
+*/
+
+#ifndef __CNSMLDUMMYMODSFETCHER_TEST_H__
+#define __CNSMLDUMMYMODSFETCHER_TEST_H__
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+#include <SmlDataSyncDefs.h>
+#include <S32MEM.H>
+#include <CNTDEF.H>
+#include <MVPbkContactStore.h>
+#include <MVPbkContactStoreObserver.h>
+#include <MVPbkContactViewObserver.h>
+#include <MVPbkContactViewBase.h>
+
+// FORWARD DECLARATIONS
+class CNSmlDummyModsFetcher;
+class CContactDatabase;
+class CNSmlChangeFinder;
+class CNSmlAdapterTestUtilities;
+class CContactItemField;
+class CVPbkContactManager;
+
+
+// CLASS DEFINITION
+/**
+ * Generated EUnit test suite class.
+ */
+NONSHARABLE_CLASS( CNSmlDummyModsFetcher_Test ):
+    public CEUnitTestSuiteClass,
+	public MSmlSyncRelationship,
+	public MVPbkContactStoreObserver,
+	public MVPbkContactViewObserver
+    {
+    public:  // Constructors and destructor
+
+        static CNSmlDummyModsFetcher_Test* NewL();
+        static CNSmlDummyModsFetcher_Test* NewLC();
+        ~CNSmlDummyModsFetcher_Test();
+
+    private: // Constructors
+
+        CNSmlDummyModsFetcher_Test();
+        void ConstructL();
+
+    private: // New methods
+
+        void Empty() {};
+
+        void SetupL();
+        void SetupCreateItemL();
+
+        void Teardown();
+        
+        void CreateViewL();
+
+        void RunError();
+        
+        void ContactViewUnavailable();
+        
+        void ContactRemovedFromView();
+        
+        void ContactViewError();
+        
+        void VPbkSingleContactOperationFailed();
+
+    public: // MSmlSyncRelationship
+
+        /**
+        Returns the unique identifier for the synchronisation relationship.
+        @return             A unique identifier for the sync relationship.
+        */
+        TSmlSyncTaskKey SyncTaskKey() const;
+
+        /**
+        Opens a specified stream for reading, and places an item on the cleanup stack to close it.
+        @param               aReadStream    On return, an open read stream
+        @param               aStreamUid     The UID of the stream to open for reading.
+        */
+        void OpenReadStreamLC(RReadStream& aReadStream, TUid aStreamUid);
+
+        /**
+        Opens the specified stream, or creates a new one if it does not exist, and places an item on the cleanup stack to close it.
+        @param              aWriteStream    On return, an open write stream
+        @param              aStreamUid      The UID of the stream to open or create
+        */
+        void OpenWriteStreamLC(RWriteStream& aWriteStream, TUid aStreamUid);
+
+        /**
+        Tests if the specified stream identified exists in the store.
+        @param              aStreamUid The stream UID
+        @return             Non-zero if the stream exists, otherwise EFalse.
+        */
+        TBool IsStreamPresentL(TUid aStreamUid) const;
+
+    private: // from MVPbkContactStoreObserver
+        
+        void StoreReady(MVPbkContactStore& aContactStore);
+        
+        void StoreUnavailable(MVPbkContactStore& aContactStore,
+                TInt aReason);
+        
+        void HandleStoreEventL(
+                MVPbkContactStore& aContactStore,
+                TVPbkContactStoreEvent aStoreEvent);
+
+         // From MVPbkContactViewObserver  
+        void ContactViewReady( MVPbkContactViewBase& aView ) ;
+       
+        void ContactViewUnavailable(
+                    MVPbkContactViewBase& aView ) ;
+        
+        void ContactAddedToView(
+                    MVPbkContactViewBase& aView, 
+                    TInt aIndex, 
+                    const MVPbkContactLink& aContactLink );
+        
+        void ContactRemovedFromView(
+                    MVPbkContactViewBase& aView, 
+                    TInt aIndex, 
+                    const MVPbkContactLink& aContactLink ) ;
+             
+        void ContactViewError(
+                    MVPbkContactViewBase& aView, 
+                    TInt aError, 
+                    TBool aErrorNotified ) ;
+                    
+        
+    private: // helper
+
+        CContactItemField* CreateConfidentialLC();
+
+
+    private: // Data
+
+        CNSmlDummyModsFetcher* iCNSmlDummyModsFetcher;
+        CContactDatabase* iContactDatabase;  // Not owned
+        CNSmlChangeFinder* iChangeFinder;
+        TKeyArrayFix iKey;
+        TBool iSyncHistory;
+        TBool iSnapshotRegistered;
+        HBufC8* iTestData;
+        RDesReadStream iReadStream;
+
+        CNSmlAdapterTestUtilities* iTestUtilities;
+        TContactItemId iCardId;
+        TTime iLastChanged;
+
+        // VPbk related
+        CVPbkContactManager* iContactManager;
+        MVPbkContactStore* iStore;
+        MVPbkContactViewBase* iContactViewBase;
+
+        EUNIT_DECLARE_TEST_TABLE;
+
+    };
+
+#endif      //  __CNSMLDUMMYMODSFETCHER_TEST_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/dllmain.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,38 @@
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuite.h>
+#include "CNSmlDummyDataProvider_Test.h"
+#include "CNSmlDummyDataStore_Test.h"
+#include "CNSmlDummyModsFetcher_Test.h"
+
+/**
+* UT_nsmldscontactsdataprovider.dll test suite factory function.
+*/
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    // In this example, a root suite is needed for holding the two suites
+    //with test cases. If there was only one suite with tests, that suite
+    //instance could be returned directly. (see the other examples)
+    CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC(_L("Unit test for Contact adapter"));
+
+    // Unit tests for dataprovider class (CNSmlDummyDataProvider)
+    MEUnitTest* providerSuite = CNSmlDummyDataProvider_Test::NewL();
+    CleanupStack::PushL( providerSuite );
+    rootSuite->AddL( providerSuite );
+    CleanupStack::Pop( providerSuite );
+
+    // Unit tests for datastore class (CNSmlDummyDataStore)
+    MEUnitTest* storeSuite = CNSmlDummyDataStore_Test::NewL();
+    CleanupStack::PushL( storeSuite );
+    rootSuite->AddL( storeSuite );
+    CleanupStack::Pop( storeSuite );
+
+    // Unit tests for ModsFetcher class (CNSmlDummyModsFetcher)
+    MEUnitTest* modsFetcherSuite = CNSmlDummyModsFetcher_Test::NewL();
+    CleanupStack::PushL( modsFetcherSuite );
+    rootSuite->AddL( modsFetcherSuite );
+    CleanupStack::Pop( modsFetcherSuite );
+
+    CleanupStack::Pop( rootSuite );
+
+    return rootSuite;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/basic.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,5 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Smith;John
+TITLE:Boss
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/basicInvalid.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,4 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Smith;John
+TITLE:Boss
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/basic_partial.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,5 @@
+BEGIN:VCARD
+VERSION:2.1
+N:White;John
+URL;WORK:http://www.nokia.com
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/email_type_issue.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Smith;John
+TITLE:Boss
+EMAIL;TYPE=internet:jqpublic@xyz.dom1.com
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/issue1_standard.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Jill;;;
+TEL;CELL:+491713902793 
+URL:http://
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multioccurence.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,9 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Smith;John
+ORG:Firm
+TITLE:Boss
+TEL;WORK;VOICE:123456
+TEL;HOME;VOICE:987654
+TEL;CELL;VOICE:111111
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multioccurence_partial.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,8 @@
+BEGIN:VCARD
+VERSION:2.1
+N:White;John
+ORG:Firm
+TITLE:Boss
+TEL;HOME;VOICE:987654
+TEL;CELL;VOICE:222222
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multioccurence_partial2.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+VERSION:2.1
+N:White;John
+ORG:Firm
+TITLE:Specialist
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multipleVCards.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,34 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Software;Sidney
+FN:Sidney Software
+ORG:Firm
+TITLE:Boss
+TEL;WORK;VOICE:132456798
+TEL;HOME;VOICE:654654987
+TEL;CELL;VOICE:0400654987654
+ADR;WORK:;;Firmstreet 1;New City;Sawo;00000;Finland
+EMAIL;PREF;INTERNET:John.Smith@firm.com
+REV:20080306T115812Z
+END:VCARD
+
+BEGIN:VCARD
+VERSION:2.1
+N:Sorsa;Simon
+FN:Simon Sorsa
+ORG:Duck inc.
+TITLE:Slave
+TEL;CELL;VOICE:123456789
+ADR;WORK:;;Duckstreet 1;Town;HundredAbout;00000;Finland
+EMAIL;PREF;INTERNET:Simon.Sorsa@duck.com
+REV:20080306T115812Z
+END:VCARD
+
+BEGIN:VCARD
+VERSION:2.1
+N:Karhu;Gabriel
+FN:Gabriel Karhu
+TEL;CELL;VOICE:09787967638
+EMAIL;PREF;INTERNET:gabriel.karhu@foobar.com
+REV:20080306T115812Z
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multipleVCards_Standard.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,31 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Software;Sidney
+FN:Sidney Software
+ORG:Firm
+TITLE:Boss
+TEL;WORK;VOICE:132456798
+TEL;HOME;VOICE:654654987
+TEL;CELL;VOICE:0400654987654
+ADR;WORK:;;Firmstreet 1;New City;Sawo;00000;Finland
+EMAIL;PREF;INTERNET:John.Smith@firm.com
+END:VCARD
+
+BEGIN:VCARD
+VERSION:2.1
+N:Sorsa;Simon
+FN:Simon Sorsa
+ORG:Duck inc.
+TITLE:Slave
+TEL;CELL;VOICE:123456789
+ADR;WORK:;;Duckstreet 1;Town;HundredAbout;00000;Finland
+EMAIL;PREF;INTERNET:Simon.Sorsa@duck.com
+END:VCARD
+
+BEGIN:VCARD
+VERSION:2.1
+N:Karhu;Gabriel
+FN:Gabriel Karhu
+TEL;CELL;VOICE:09787967638
+EMAIL;PREF;INTERNET:gabriel.karhu@foobar.com
+END:VCARD
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/photo_issue.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,63 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Hopo1;Hessua;qwerty
+PHOTO;JPEG;ENCODING=BASE64:
+    /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkS
+    Ew8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJ
+    CQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy
+    MjIyMjIyMjIyMjIyMjL/wAARCAC3AMoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEA
+    AAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh
+    MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6
+    Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZ
+    mqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx
+    8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
+    AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV
+    YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hp
+    anN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPE
+    xcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3
+    +iiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+    CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+    CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+    CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+    CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+    CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+    CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooqvf31vpm
+    nXN/eSeXa2sTzTPtJ2ooJY4HJwAelAGH4l8ZWXhu4gtZVjaedCwea6it4IecJ5ru
+    wKhiGxtVmIjkIU7SK5tPFN75Vrqo8X6HqjWWJ9X07SpIxCloFIllXPmSs0bMrZDK
+    GVNoUMees8K6XNp2lyz3iSJqGo3D314jymQxySYxFuyQRGgSMFcAiMEAZqn42+xw
+    W2k3knkR366rZQWkzYEo8y5iEiRt1+aMOGA6qDnjNAHUUVzfh+ZdIv5fC0gkjS2T
+    fpQaNjvskSIf6wDaSjuY8E79oQtnO5ukoAKKKKAI554bW3luLiWOGCJC8kkjBVRQ
+    MkkngADnNcnpEur+L7VtZXUdV0Own2NYQRJaM0sDRIwlfckuGLM4xuHyqvyg5Jse
+    Kfsd/qOn6NqnkDSWim1K++0Y8uSO3MeEfPRd8qSE5xiLaQQxxTtNBtPGD3Gp69Ld
+    3EUrwlNFluHSKyVVWREnhUgPKdyu4kDY3KoyFDMAalh4n0S3+zaReeKtKu9Xj2W0
+    w+0xRySzjCt+7DfKxbPyjoTiugqnNpOm3OljS59PtJdPCKgtHhVogq42jYRjAwMD
+    HGBWf4Rnmk8NWlreSyS6hYILK9aViztNGArOc8kPgSKTgsrq2OaANyiiigAooooA
+    KKKKACiiigAooooAKKKKACiiigArD8aQTXXgXxDb28Uk08umXKRxxqWZ2MTAAAck
+    k8YrcooA5uD4g+Dbm3inTxVowSRA6iS9jRgCM8qxBU+xAI71XF3beKPFmj3WlajH
+    eaXpaT3E0to6SRG5ZRFEpcA5IjknJVTkZQtjK56yigAooooAKKKKAOH8dWNxfanZ
+    2UMf/IV0rU9IimZgEjnljjkTf/FtKwScgHGB610HhjSbjR9Dhhv7n7Vqcv76/ujg
+    madvvHIVflHCrwMIqjtWhfWNvqNnJa3UfmQvgkBipBBBVlYYKsCAQwIIIBBBFY/2
+    HxZH8kWv6U8a8K1xpDtIw7FylwqlvUqqjPQAcUAdBXN+Ep4dQl1/VbOWOewvtTL2
+    s8bBllVIIYWI9vMikGe+MjIIJJ/CZ1m3lj8R6nd34lQo1vaSyWVuFIwwCRvuYMMZ
+    EjvznbtBIroIIIbW3it7eKOGCJAkccahVRQMAADgADjFAElFFFABRRRQAUUUUAFF
+    FFABRRRQAUUUUAFFFFABRRRQAUVj3l9cW/i3SrUybLG5tLoMCow86tCY1Df3tnnk
+    KDyFY4O3jYoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKK
+    ACiiigAooooAz9Y0z+1LNEjm+z3UEqXFtOF3GORTkcZBKkZRgCCyOy5Gc0aTqf8A
+    aUU6Sw+ReWkv2e6gDbxHJtV/lbA3KVdGBwDhhkK2VGhWPqGmXi6idW0iaCO+aJYZ
+    4rlS0dzGhZkXIOY2BdwHAYAO2UfC7QDYorn/APhNvD8H7vU9Sg0i6H3rXU5FtpAe
+    +A5Adc5G9CyEg4Y4o/4Tvwf/ANDXof8A4MYf/iqAOgorn/8AhO/B/wD0Neh/+DGH
+    /wCKrQ0zXdH1vzf7J1Wxv/Jx5n2S4SXZnOM7ScZwevoaANCiiigAooooAKKKKACi
+    svQNSm1XTpbidY1dL27twEBA2xXEkSnknnagJ989OlalABRRRQAUUUUAFFFFABRR
+    RQAUUUUAFFFFABRRRQAUUUUAFZ+p6Fo+t+V/a2lWN/5OfL+126S7M4zjcDjOB09B
+    WhRQBz//AAgng/8A6FTQ/wDwXQ//ABNH/CCeD/8AoVND/wDBdD/8TXQUUAc//wAI
+    J4P/AOhU0P8A8F0P/wATR/wgng//AKFTQ/8AwXQ//E10FFAHP/8ACCeD/wDoVND/
+    APBdD/8AE0f8IJ4P/wChU0P/AMF0P/xNdBRQBXsbCz0yzjs7C0gtLWPOyGCMRouS
+    ScKOBkkn8asUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAF
+    FFFABRRRQAUUUUAFFFFABRRRQB//2Q==
+
+UID:dd7pc23a200904211251281062027
+BDAY:20090415T000000Z
+EMAIL;INTERNET:jaa.joo@ii.fi
+TEL;CELL;PREF:78787878
+TEL;HOME;VOICE:131313
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/standard.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,17 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Smith;John
+FN:John Smith
+ORG:Firm
+TITLE:Boss
+NOTE;ENCODING=QUOTED-PRINTABLE:Liirum larum.=0D=0A
+TEL;WORK;VOICE:132456798
+TEL;HOME;VOICE:654654987
+TEL;CELL;VOICE:0400654987654
+TEL;WORK;FAX:2321654987987
+ADR;WORK:;;Firmstreet 1;New City;Sawo;00000;Finland
+LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Firmstreet 1=0D=0ANew City, Sawo 00000=0D=0AFinland
+URL;WORK:http://www.nokia.com
+EMAIL;PREF;INTERNET:John.Smith@firm.com
+REV:20080306T115812Z
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/tel_type_issue.vcf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,9 @@
+BEGIN:VCARD
+VERSION:2.1
+ORG:nokia
+N:Testaaja;Teppo;Kustaa
+BDAY:20090415T000000Z
+TEL;CELL:123456789
+TEL;HOME;VOICE;PREF:987654321
+TEL;WORK;VOICE:54545454
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/ut_nsmldsdummyadapter.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MMP file for contact adapter unit tests.
+*
+*/
+
+#include <Digia/Eunit/EUnitCaps.h>
+#include <platform_paths.hrh>
+#include <defaultcaps.hrh>
+#include <data_caging_paths.hrh>
+
+// DEFINES
+#define         KMyUniqueUid3 0x01700000
+#define         KEUnitTestDllUid2 0x1000af5a
+MACRO 			__NSML_MODULETEST__
+
+// Build target
+TARGET          UT_nsmldsdummydataprovider.dll
+TARGETTYPE      dll
+UID             KEUnitTestDllUid2 KMyUniqueUid3
+//UID 			0x100039CE 0x2001FDEA
+CAPABILITY      EUNIT_CAPS
+VENDORID        0x00000000
+
+#if defined(ARMCC)
+DEFFILE		.\def\eabicontactsdataprovider_test
+#elif defined(WINSCW)
+DEFFILE		.\def\bwinscwcontactsdataprovider_test
+#endif
+
+// Source files
+SOURCEPATH      .
+SOURCE          DllMain.cpp 
+SOURCE          CNSmlDummyDataProvider_Test.cpp
+SOURCE          CNSmlDummyDataStore_Test.cpp
+SOURCE 			CNSmlAdapterTestUtilities.cpp 
+SOURCE			CNSmlDummyModsFetcher_Test.cpp
+SOURCE          CNSmlDummyDataStoreWaiter.cpp
+
+// Code under test
+SOURCEPATH      ..\DummyAdapter\src
+SOURCE          nsmldummydataprovider.cpp
+SOURCE          nsmldummymodsfetcher.cpp
+SOURCE          nsmldummydatastore.cpp
+SOURCE          nsmldummydllmain.cpp
+SOURCE			nsmldummyutility.cpp
+
+// Include paths
+USERINCLUDE     . ..\DummyAdapter\Inc
+
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 	\epoc32\include\ecom
+SYSTEMINCLUDE 	\epoc32\include\syncml
+SYSTEMINCLUDE	\epoc32\include\internal
+SYSTEMINCLUDE   \epoc32\include\Digia\EUnit
+
+SOURCEPATH      .\testdata
+
+// Dependencies to system components
+LIBRARY		euser.lib EUnit.lib ECom.lib 
+LIBRARY		bafl.lib efsrv.lib estor.lib nsmldebug.lib sysutil.lib
+LIBRARY		nsmlchangefinder.lib cntmodel.lib wbxmllib.lib
+LIBRARY		smlstoreformat.lib smldataprovider.lib
+LIBRARY		nsmldshostclient.lib versit.lib charconv.lib vcard.lib 
+LIBRARY		nsmlcontactsdataprovider.lib nsmldummydataprovider.lib
+LIBRARY     centralrepository.lib flogger.lib
+LIBRARY	    nsmldatamod.lib
+LIBRARY     VPbkEng.lib
+LIBRARY     vpbkvcardEng.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydataprovider.loc	Wed Sep 01 12:30:02 2010 +0100
@@ -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:  Localization file for DS Dummy Adapter.
+*
+*/
+
+//d:Display name for registry info 
+//l:list_setting_pane_t1
+//
+#define qtn_nsml_dummy_adapter_display_name "Contacts (dummy)" 
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydataprovider.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Registery info for DS Dummy Adapter.
+*
+*/
+
+#include "nsmldummydataprovider.loc"
+
+#include <registryinfo.rh>
+#include <nsmldsconstants.h>
+
+RESOURCE REGISTRY_INFO theRegistryInfo
+  {
+  dll_uid = 0x2001FDF1; // DS interface implementation UID
+  interfaces = 
+      {
+      INTERFACE_INFO
+          {
+          interface_uid = KNSmlDSInterfaceUid; // DS interface UID
+          implementations = 
+            {
+            IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x2001FDF1; // DS interface implementation UID
+                version_no = 1; 
+                display_name = qtn_nsml_dummy_adapter_display_name;
+                default_data = "";
+                opaque_data = "";
+                }
+            };
+          }
+      };
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydatastoreformat_1_1_2.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,596 @@
+CHARACTER_SET UTF8
+
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource data for DS Dummy dataprovider.
+*
+*/
+
+#include "SmlDataFormat.rh"
+#include "SmlDataFormat.hrh"
+
+RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
+	{
+	version=1;
+	display_name="Test adapter";
+	sync_types=KSmlSyncType_TwoWay+KSmlSyncType_OneWayFromSvr+
+	           KSmlSyncType_OneWayFromClnt+KSmlSyncType_SlowSync+
+	           KSmlSyncType_RefreshFromSvr+KSmlSyncType_RefreshFromClnt;
+	mime_format=
+		{
+		SML_MIME_FORMAT
+			{
+			version=1;
+			mime_type="text/x-vcard";
+			mime_ver="2.1";
+			properties=
+				{
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Begin";
+					name="BEGIN";
+					data_type="";
+					enum_values={"VCARD"};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="End";
+					name="END";
+					data_type="";
+					enum_values={"VCARD"};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Version";
+					name="VERSION";
+					data_type="";
+					enum_values={"2.1"};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Revision";
+					name="REV";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Name";
+					name="N";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Address";
+					name="ADR";	
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Home address";
+							name="HOME";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Work address";
+							name="WORK";
+							data_type="";
+							enum_values={};
+							}
+						};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Telephone number";
+					name="TEL";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Home telephone";
+							name="HOME";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Work telephone";
+							name="WORK";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Cellular number";
+							name="CELL";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Pager number";
+							name="PAGER";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Fax number";
+							name="FAX";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Video number";
+							name="VIDEO";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Default number";
+							name="PREF";
+							data_type="";
+							enum_values={};
+							},	
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Car telephone";
+							name="CAR";
+							data_type="";
+							enum_values={};
+							}
+						};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="FullName";
+					name="FN";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Email address";
+					name="EMAIL";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="";
+							name="INTERNET";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Home email";
+							name="HOME";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Work email";
+							name="WORK";
+							data_type="";
+							enum_values={};
+							}
+						};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="URL address";
+					name="URL";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Home URL";
+							name="HOME";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Work URL";
+							name="WORK";
+							data_type="";
+							enum_values={};
+							}
+						};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Note";
+					name="NOTE";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Title";
+					name="TITLE";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Organisation";
+					name="ORG";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Photo";
+					name="PHOTO";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Birthday";
+					name="BDAY";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Sound";
+					name="SOUND";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Wireless Village Id";
+					name="X-WV-ID";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+					
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Assistant name";
+					name="X-ASSISTANT";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+					
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Assistant phone";
+					name="X-ASSISTANT-TEL";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Anniversary";
+					name="X-ANNIVERSARY";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Spouse";
+					name="X-SPOUSE";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Children";
+					name="X-CHILDREN";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+			 SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Nickname";
+					name="X-NICKNAME";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Class";
+					name="X-CLASS";
+					data_type="";
+					enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="IMPP";
+					name="X-IMPP";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="PERSONAL";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="HOME";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="WORK";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="BUSINESS";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="MOBILE";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="PREF";
+							data_type="";
+							enum_values={};
+							}
+						};
+					},
+					SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Top contact";
+					name="X-FAVORITE";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				      SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="SIP protocol";
+					name="X-SIP";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="POC";
+							name="POC";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="SWIS";
+							name="SWIS";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Voice over IP";
+							name="VOIP";
+							data_type="";
+							enum_values={};
+							}
+						};
+					},
+                    SML_DATA_PROPERTY
+                              {
+                              version=1;
+                              display_name="Categories";
+                              name="X-CATEGORIES";
+                              data_type="";
+                              enum_values={};
+                              flags= 0;
+                              max_size=256;
+                              max_occur=0;
+                              params={};
+                              }
+				};
+				field_level=0;
+				}
+			};
+		mime_format_tx_pref=0;     // Preferred index for tx
+		mime_format_rx_pref=0;     // Preferred index for rx
+		folder_properties={};
+		filter_capabilities={};
+		max_size=0; 	// no limit
+		max_items=0; 	// no limit
+		flags=0;
+	}
+	
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydatastoreformat_1_2.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,448 @@
+CHARACTER_SET UTF8
+
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource data for DS Dummy dataprovider.
+*
+*/
+
+#include "SmlDataFormat.rh"
+#include "SmlDataFormat.hrh"
+
+RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
+	{
+	version=1;
+	display_name="Test adapter";
+	sync_types=KSmlSyncType_TwoWay+KSmlSyncType_OneWayFromSvr+
+	           KSmlSyncType_OneWayFromClnt+KSmlSyncType_SlowSync+
+	           KSmlSyncType_RefreshFromSvr+KSmlSyncType_RefreshFromClnt;
+	mime_format=
+		{
+		SML_MIME_FORMAT
+			{
+			version=1;
+			mime_type="text/x-vcard";
+			mime_ver="2.1";
+			properties=
+				{
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Begin";
+					name="BEGIN";
+					data_type="";
+					enum_values={"VCARD"};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="End";
+					name="END";
+					data_type="";
+					enum_values={"VCARD"};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Version";
+					name="VERSION";
+					data_type="";
+					enum_values={"2.1"};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Revision";
+					name="REV";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Name";
+					name="N";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Address";
+					name="ADR";	
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Type";
+							name="TYPE";
+							data_type="";
+							enum_values={"HOME", "WORK"};
+							}
+						};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Telephone number";
+					name="TEL";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Type";
+							name="TYPE";
+							data_type="";
+							enum_values={"HOME", "WORK", "CELL", "PAGER", "FAX", "VIDEO", "PREF", "CAR"};
+							}
+						};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="FullName";
+					name="FN";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Email address";
+					name="EMAIL";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Type";
+							name="TYPE";
+							data_type="";
+							enum_values={"INTERNET", "HOME", "WORK"};
+							}
+						};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="URL address";
+					name="URL";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Type";
+							name="TYPE";
+							data_type="";
+							enum_values={"HOME", "WORK"};
+							}
+						};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Note";
+					name="NOTE";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Title";
+					name="TITLE";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Organisation";
+					name="ORG";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Photo";
+					name="PHOTO";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Birthday";
+					name="BDAY";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Sound";
+					name="SOUND";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Wireless Village Id";
+					name="X-WV-ID";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Assistant name";
+					name="X-ASSISTANT";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Assistant phone";
+					name="X-ASSISTANT-TEL";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Anniversary";
+					name="X-ANNIVERSARY";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Spouse";
+					name="X-SPOUSE";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Children";
+					name="X-CHILDREN";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+			 SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Nickname";
+					name="X-NICKNAME";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Class";
+					name="X-CLASS";
+					data_type="";
+					enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="IMPP";
+					name="X-IMPP";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Type";
+							name="TYPE";
+							data_type="";
+							enum_values={"PERSONAL", "HOME", "WORK","BUSINESS", "MOBILE", "PREF"};
+							}
+						};
+					},	
+					SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Top Contact";
+					name="X-FAVORITE";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				     SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="SIP protocol";
+					name="X-SIP";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Type";
+							name="TYPE";
+							data_type="";
+							enum_values={"POC", "SWIS", "VOIP"};
+							}
+						};
+					},
+	                   SML_DATA_PROPERTY
+	                        {
+	                        version=1;
+	                        display_name="Categories";
+	                        name="X-CATEGORIES";
+	                        data_type="";
+	                        enum_values={};
+	                        flags= 0;
+	                        max_size=256;
+	                        max_occur=0;
+	                        params={};
+	                        }
+				};
+				field_level=0;
+				}
+			};
+		mime_format_tx_pref=0;     // Preferred index for tx
+		mime_format_rx_pref=0;     // Preferred index for rx
+		folder_properties={};
+		filter_capabilities={};
+		max_size=0; 	// no limit
+		max_items=0; 	// no limit
+		flags=0;
+	}
+	
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -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:  build info file for DS Dummy adapter
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_MMPFILES
+.\nsmldummydataprovider.mmp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/def/bwinscwdummydataprovideru.def	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/def/eabidummydataprovideru.def	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,9 @@
+EXPORTS
+	_Z24ImplementationGroupProxyRi @ 1 NONAME
+	_ZTI19CNSmlDummyDataStore @ 2 NONAME ; #<TI>#
+	_ZTI21CNSmlDummyModsFetcher @ 3 NONAME ; #<TI>#
+	_ZTI22CNSmlDummyDataProvider @ 4 NONAME ; #<TI>#
+	_ZTV19CNSmlDummyDataStore @ 5 NONAME ; #<VT>#
+	_ZTV21CNSmlDummyModsFetcher @ 6 NONAME ; #<VT>#
+	_ZTV22CNSmlDummyDataProvider @ 7 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/nsmldummydataprovider.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  mmp file for DS Dummy Adapter
+*
+*/
+
+#include <platform_paths.hrh>
+#include <defaultcaps.hrh>
+#include <data_caging_paths.hrh>
+
+CAPABILITY CAP_ECOM_PLUGIN
+
+TARGET          nsmldummydataprovider.dll
+TARGETPATH      PLUGINS_1_DIR
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x2001FDF1
+VENDORID        VID_DEFAULT
+
+#if defined(ARMCC)
+DEFFILE            .\def\eabidummydataprovider
+#elif defined(WINSCW)
+DEFFILE            .\def\bwinscwdummydataprovider
+#endif
+
+SOURCEPATH      ..\src
+SOURCE          nsmldummydataprovider.cpp
+SOURCE          nsmldummymodsfetcher.cpp
+SOURCE          nsmldummydatastore.cpp
+SOURCE          nsmldummydllmain.cpp
+SOURCE			nsmldummyutility.cpp
+
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE     \epoc32\include\ecom
+SYSTEMINCLUDE     \epoc32\include\syncml
+
+
+USERINCLUDE     ..\inc
+
+SOURCEPATH		..\data
+START RESOURCE nsmldummydataprovider.rss
+    HEADER
+    TARGET nsmldummydataprovider.rsc
+    TARGETPATH ECOM_RESOURCE_DIR
+    LANG    sc
+END
+
+START RESOURCE nsmldummydatastoreformat_1_1_2.rss
+	HEADER
+	TARGET         nsmldummydatastoreformat_1_1_2.rsc
+	TARGETPATH  RESOURCE_FILES_DIR 
+	LANG    sc
+END 
+
+START RESOURCE nsmldummydatastoreformat_1_2.rss
+	HEADER
+	TARGET         nsmldummydatastoreformat_1_2.rsc
+	TARGETPATH  RESOURCE_FILES_DIR 
+	LANG    sc
+END 
+
+
+
+LIBRARY        ECom.lib
+LIBRARY        bafl.lib
+LIBRARY        euser.lib
+LIBRARY        efsrv.lib
+LIBRARY        estor.lib
+LIBRARY        sysutil.lib
+LIBRARY        flogger.lib
+LIBRARY        cntmodel.lib
+LIBRARY        wbxmllib.lib
+LIBRARY        centralrepository.lib
+LIBRARY        smlstoreformat.lib
+LIBRARY        smldataprovider.lib
+LIBRARY        nsmldatamod.lib
+LIBRARY        nsmldshostclient.lib
+LIBRARY        nsmlchangefinder.lib  
+LIBRARY        VPbkEng.lib
+LIBRARY        vpbkvcardEng.lib
+LIBRARY        versit.lib
+LIBRARY        vcard.lib
+LIBRARY        nsmlcontactsdataprovider.lib
+LIBRARY        nsmldebug.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummydataprovider.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  DS Dummy dataprovider
+*
+*/
+
+#ifndef CNSMLDUMMYDATAPROVIDER_H
+#define CNSMLDUMMYDATAPROVIDER_H
+
+//  EXTERNAL INCLUDES
+#include <e32base.h>
+
+
+//  INTERNAL INCLUDES
+#include "nsmlcontactsdataprovider.h"
+
+//  CONSTANTS
+const TUint KNSmlDummyAdapterImplUid = 0x2001FDF1;
+
+
+
+//  CLASS DEFINITION
+/**
+ * Dataprovider class for Dummy adapters
+ * @lib nsmldummydataprovider.lib
+ * @since 5.0
+ */
+class CNSmlDummyDataProvider : public CNSmlContactsDataProvider
+    {
+    
+    private:    // Friend class definitions
+        friend class CNSmlDummyDataProvider_Test;
+    
+    public:     // Constructors and destructor
+        static CNSmlDummyDataProvider* NewL();
+        static CNSmlDummyDataProvider* NewLC();
+        ~CNSmlDummyDataProvider();
+
+    protected:    // Constructors
+        CNSmlDummyDataProvider();
+        void ConstructL();
+
+    protected:  // CSmlDataProvider
+
+        /**
+        * Gets dataproviders own StoreFormat.
+        */
+        const CSmlDataStoreFormat& DoStoreFormatL();
+
+    protected: // CNSmlContactsDataProvider
+
+        const TDesC& GetStoreFormatResourceFileL() const;
+
+        CNSmlContactsDataStore* CreateDataStoreLC() const;
+
+        CDesCArray* DoListStoresLC();
+
+    };
+
+
+#endif      //  CNSMLDUMMYDATAPROVIDER_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummydatastore.h	Wed Sep 01 12:30:02 2010 +0100
@@ -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:  DS Dummy datastore
+*
+*/
+
+#ifndef CNSMLDUMMYDATASTORE_H
+#define CNSMLDUMMYDATASTORE_H
+
+//  EXTERNAL INCLUDES
+#include <NSmlContactsDataStore.h>
+
+// Device Info resource filenames
+_LIT( KNSmlDummyContactsStoreFormatRsc_1_1_2, "z:NSmlDummyDataStoreFormat_1_1_2.rsc" );
+_LIT( KNSmlDummyContactsStoreFormatRsc_1_2, "z:NSmlDummyDataStoreFormat_1_2.rsc" );
+
+//  CLASS DEFINITION
+/**
+ * Datastore class for Dummy adapters
+ * @lib nsmldummydataprovider.lib
+ * @since 3.23
+ */
+class CNSmlDummyDataStore : public CNSmlContactsDataStore
+    {
+    private:    // Friend class definitions
+        friend class CNSmlDummyDataStore_Test;
+        friend class CNSmlDummyDataStoreWaiter;
+        
+    public:     // Constructors and destructor
+
+        static CNSmlDummyDataStore* NewL();
+        static CNSmlDummyDataStore* NewLC();
+        ~CNSmlDummyDataStore();
+
+    protected:    // Constructors
+
+        CNSmlDummyDataStore();
+        void ConstructL();
+
+    protected:  // From CNSmlContactsDataStore
+
+        void DoOpenL( const TDesC& aStoreName, MSmlSyncRelationship& aContext,
+            TRequestStatus& aStatus );
+
+        void DoBeginBatchL();
+
+        void DoOpenItemL( TSmlDbItemUid aUid, TBool& aFieldChange,
+            TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType,
+            TDes8& aMimeVer, TRequestStatus& aStatus );
+
+        void DoCommitItemL( TRequestStatus& aStatus );
+
+        void DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus );
+
+        TBool DoHasSyncHistory() const;
+
+        const MSmlDataItemUidSet& DoModifiedItems() const;
+
+        void DoResetChangeInfoL( TRequestStatus& aStatus );
+
+        void DoCommitChangeInfoL( TRequestStatus& aStatus,
+            const MSmlDataItemUidSet& aItems );
+
+        void DoCommitChangeInfoL( TRequestStatus& aStatus );
+
+        void LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem );
+
+        void LdoAddItemL( const TDesC8& aItem, TInt aSize );
+
+        void LdoAddItemsL( CBufBase*& aItems,TInt aSize );
+
+        TInt ExecuteAddL();
+
+        void ExecuteDeleteL();
+
+        void ExecuteUpdateL();
+
+        void SingleContactOperationCompleteL( MVPbkStoreContact* aContact );
+
+        void StepComplete( MVPbkContactOperationBase& aOperation,
+            TInt aStepSize );
+
+        void OperationCompleteL();
+
+        void DoDeleteAllContactsL();
+
+        const TDesC& GetStoreFormatResourceFileL() const;
+
+        MContactsModsFetcher* CreateModsFetcherL();
+
+    protected:  // From MVPbkContactCopyObserver
+
+        void ContactsSaved( MVPbkContactOperationBase& aOperation,
+            MVPbkContactLinkArray* aResults );
+
+        void ContactsSavingFailed( MVPbkContactOperationBase& aOperation,
+            TInt aError );
+
+    };
+
+#endif      //  CNSMLDUMMYDATASTORE_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummymodsfetcher.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  DS Dummy Adapter ModsFetcher
+*
+*/
+
+#ifndef __NSMLDUMMYMODSFETCHER_H__
+#define __NSMLDUMMYMODSFETCHER_H__
+
+// INCLUDES
+#include <SmlDataProvider.h>
+#include <SmlDataFormat.h>
+#include <f32file.h>
+#include <cntdb.h>
+#include <cntitem.h>
+#include <MContactsModsFetcher.h>
+
+#include <cvpbkcontactmanager.h>
+#include <mvpbkcontactstore.h>
+#include <MVPbkContactViewObserver.h>
+#include <CVPbkSortOrder.h>
+#include <MVPbkContactViewBase.h>
+#include <MVPbkSingleContactOperationObserver.h>
+#include <MVPbkContactOperationBase.h>
+
+// CONSTANTS
+const TInt KNSmlSnapshotSize = 56;
+const TInt KNSmlSnapshotSmallSize = 8;
+const TInt KNSmlSnapshotCompressSize = 20;
+_LIT( KNSmlContactSyncNoSync, "none" ); // Taken from phonebook
+
+// CLASS DECLARATION
+class CNSmlChangeFinder;
+class TNSmlSnapshotItem;
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher
+//
+// @lib nsmlcontactsdataprovider.lib
+// ------------------------------------------------------------------------------------------------
+class CNSmlDummyModsFetcher : public CActive, public MContactsModsFetcher,
+				              public MVPbkContactViewObserver,
+						      public MVPbkSingleContactOperationObserver,
+						      public MVPbkContactOperationBase
+
+	{
+	
+    private:    // Friend class definitions
+        friend class CNSmlDummyModsFetcher_Test;
+	
+    public:
+		/**
+		* C++ constructor.
+		* @param		aSnapshotRegistered	    Is snapshot registered.
+		* @param        aContactManager         Reference to ContactManager.
+		* @param        aStore                  Reference to ContactStore.
+		* @param        aKey                    Key array.
+		* @param        aChangeFinder           Reference to Changefinder.
+		*/
+		CNSmlDummyModsFetcher( TBool& aSnapshotRegistered,CVPbkContactManager& aContactManager,MVPbkContactStore& aStore,TKeyArrayFix& aKey, CNSmlChangeFinder& aChangeFinder );
+		/**
+		* Second phase constructor.
+		*/
+        void ConstructL();
+
+		/**
+		* ~CNSmlDummyModsFetcher() destructor.
+		*/
+		virtual ~CNSmlDummyModsFetcher();
+
+    private:   // From MVPbkContactViewObserver
+
+		/**
+		* Called when a view is ready for use.
+		*/
+
+		void ContactViewReady(
+		            MVPbkContactViewBase& aView ) ;
+		/**
+		* Called when a view is unavailable for a while.
+		*/
+		void ContactViewUnavailable(
+		            MVPbkContactViewBase& aView ) ;
+		/**
+		* Called when a contact has been added to the view.
+		*/
+		void ContactAddedToView(
+		            MVPbkContactViewBase& aView,
+		            TInt aIndex,
+		            const MVPbkContactLink& aContactLink );
+		/**
+		* Called when a contact has been removed from a view.
+		*/
+		void ContactRemovedFromView(
+		            MVPbkContactViewBase& aView,
+		            TInt aIndex,
+		            const MVPbkContactLink& aContactLink ) ;
+		/**
+		* Called when an error occurs in the view.
+		*/
+		void ContactViewError(
+		            MVPbkContactViewBase& aView,
+		            TInt aError,
+		            TBool aErrorNotified ) ;
+		            /**
+		* Called when the operation is completed.
+		*/
+        void VPbkSingleContactOperationComplete(MVPbkContactOperationBase& aOperation,MVPbkStoreContact* aContact );
+
+		/**
+		*  Called if the operation fails.
+		*/
+ 		void VPbkSingleContactOperationFailed(
+ 					MVPbkContactOperationBase& aOperation,
+ 					TInt aError );
+
+    private:    //From CActive
+
+		/**
+		* Called when asynchronous operation completes.
+		*/
+		void RunL();
+
+		/**
+		* Called when RunL leaves.
+		*/
+		TInt RunError( TInt aError );
+
+		/**
+		*  Cancels operation.
+		*/
+		void DoCancel();
+
+    private:   //new method
+		/**
+		* Fetches next chunk of data (client contacts data changes).
+		*/
+		void FetchNextContactL();
+		/**
+		* Checks if aItem is confidential or not.
+		* @param    aItem   Item that is checked.
+		* @return   TBool   ETrue if item is confidential.
+		*                   Otherwise EFalse is returned.
+		*/
+        TBool IsConfidentialL( MVPbkStoreContact& aItem );
+        /**
+		* Create a contact view of the store which is opened
+		*/
+        void CreateViewL();
+        /**
+		* Add the fetched contacts id and timestamp
+		* to the snapshot.
+		* @param    aContact   Fetched contact to be
+		*						added to snapshot
+		*/
+        void UpdateSnapshotL( MVPbkStoreContact* aContact );
+
+    private: // from MContactsModsFetcher
+
+        /**
+        * Cancels the current asynchronous request
+        */
+        void CancelRequest( );
+
+        /**
+        * Reads all modifications from clients contacts databse.
+        * @param    aStatus   On completion of the operation, contains the result code.
+        */
+        void FetchModificationsL( TRequestStatus& aStatus );
+
+    private: // data
+		TRequestStatus* iCallerStatus;
+		TTime iFromTime;
+
+
+		CArrayFixSeg<TNSmlSnapshotItem>* iSnapshot;
+
+		TBool& iSnapshotRegistered;
+
+
+		TKeyArrayFix& iKey;
+
+		CNSmlChangeFinder& iChangeFinder;
+		TInt iCurrentSnapshotCounter;
+
+		CVPbkContactManager& iContactManager;
+        MVPbkContactStore& iStore;
+        MVPbkContactViewBase* iContactViewBase;
+        TInt iContactCount;
+
+	};
+
+#endif // __NSMLDUMMYMODSFETCHER_H__
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummyutility.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  DS Dummy Adapter utility
+*
+*/
+
+#ifndef CNSMLDUMMYUTILITY_H
+#define CNSMLDUMMYUTILITY_H
+
+//  EXTERNAL INCLUDES
+//  EXTERNAL INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <e32des16.h>
+
+// INTERNAL INCLUDES
+#include "nsmldebug.h"
+
+class CNSmlDummyUtility
+    {
+    public:
+
+    static void ShowNote( const TDesC& aNote );
+
+    };
+
+
+
+#endif //CNSMLDUMMYUTILITY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/readme.txt	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,9 @@
+What is DummyAdapter?
+
+Dummy adapter is a ECOM plugin, which acts as a stub implementation for Adapter Customization API. It is a SyncML adapter, which fully implements Adapter Customization API interface, but does not extend or restrict the default functionality provided by platform. Dummy adapter works identically compared to platform contact adapter. It enables to synchronize contacts with SyncML servers, such as Nokia OVI server, using vCards.
+
+Dummy adapter can be also used as a skeleton for new operator adapters. This will reduce the work effort to implement new operator specific adapters compared to starting implementation from the scratch.
+
+
+How to synchronize with OVI server using Dummy adapter?
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydataprovider.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  DS Dummy dataprovider
+*
+*/
+
+//  CLASS HEADER
+#include "nsmldummydataprovider.h"
+
+//  EXTERNAL INCLUDES
+#include <DataSyncInternalPSKeys.h>
+#include <e32property.h>
+
+// INTERNAL INCLUDES
+#include "nsmldebug.h"
+#include "nsmldummydatastore.h"
+#include "nsmldummyutility.h"
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::NewL
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataProvider* CNSmlDummyDataProvider::NewL()
+    {
+    CNSmlDummyDataProvider* self = CNSmlDummyDataProvider::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::NewLC
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataProvider* CNSmlDummyDataProvider::NewLC()
+    {
+    CNSmlDummyDataProvider* self = new( ELeave ) CNSmlDummyDataProvider;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::~CNSmlDummyDataProvider
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataProvider::~CNSmlDummyDataProvider()
+    {
+    _DBG_FILE("CNSmlDummyDataProvider::~CNSmlDummyDataProvider(): begin");
+
+    _DBG_FILE("CNSmlDummyDataProvider::~CNSmlDummyDataProvider(): end");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::CNSmlDummyDataProvider
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataProvider::CNSmlDummyDataProvider()
+    {
+    _DBG_FILE("CNSmlDummyDataProvider::CNSmlDummyDataProvider(): begin");
+
+    _DBG_FILE("CNSmlDummyDataProvider::CNSmlDummyDataProvider(): end");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CNSmlDummyDataProvider::ConstructL()
+    {
+    _DBG_FILE("CNSmlDummyDataProvider::ConstructL(): begin");
+    CNSmlContactsDataProvider::ConstructL();
+    _DBG_FILE("CNSmlDummyDataProvider::ConstructL(): end");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::DoStoreFormatL
+// -----------------------------------------------------------------------------
+//
+const CSmlDataStoreFormat& CNSmlDummyDataProvider::DoStoreFormatL()
+    {
+    _DBG_FILE("CNSmlDummyDataProvider::DoStoreFormatL()");
+    return CNSmlContactsDataProvider::DoStoreFormatL();
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::GetStoreFormatResourceFileL
+// -----------------------------------------------------------------------------
+//
+const TDesC& CNSmlDummyDataProvider::GetStoreFormatResourceFileL() const
+    {
+    _DBG_FILE("CNSmlDummyDataProvider::DoStoreFormatL()");
+
+    // Check correct Data Sync protocol
+    TInt value( EDataSyncNotRunning );
+    TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
+                                 KDataSyncStatus,
+                                 value );
+
+    if ( error == KErrNone && value == EDataSyncRunning )
+        {
+        return KNSmlDummyContactsStoreFormatRsc_1_1_2;
+        }
+    else // error or protocol version 1.2
+        {
+        return KNSmlDummyContactsStoreFormatRsc_1_2;
+        }
+    }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyDataProvider::CreateDataStoreLC
+//
+// ------------------------------------------------------------------------------------------------
+CNSmlContactsDataStore* CNSmlDummyDataProvider::CreateDataStoreLC() const
+    {
+    _DBG_FILE("CNSmlDummyDataProvider::CreateDataStoreLC()");
+    CNSmlContactsDataStore* dataStore = CNSmlDummyDataStore::NewLC();
+    return dataStore;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::DoListStoresLC
+// -----------------------------------------------------------------------------
+//
+CDesCArray* CNSmlDummyDataProvider::DoListStoresLC()
+    {
+    _DBG_FILE("CNSmlDummyDataProvider::DoListStoresLC()");
+    return CNSmlContactsDataProvider::DoListStoresLC();
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydatastore.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,392 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  DS Dummy datastore
+*
+*/
+
+//  CLASS HEADER
+#include "nsmldummydatastore.h"
+
+//  EXTERNAL INCLUDES
+#include <DataSyncInternalPSKeys.h>
+#include <e32property.h>
+
+// INTERNAL INCLUDES
+#include "nsmldebug.h"
+#include "nsmldummyutility.h"
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataStore::NewL
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataStore* CNSmlDummyDataStore::NewL()
+    {
+    CNSmlDummyDataStore* self = CNSmlDummyDataStore::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataStore::NewLC
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataStore* CNSmlDummyDataStore::NewLC()
+    {
+    CNSmlDummyDataStore* self = new( ELeave ) CNSmlDummyDataStore;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataStore::CNSmlDummyDataStore
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataStore::CNSmlDummyDataStore()
+    {
+    _DBG_FILE("CNSmlDummyDataStore::CNSmlDummyDataStore(): begin");
+
+    _DBG_FILE("CNSmlDummyDataStore::CNSmlDummyDataStore(): end");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataStore::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CNSmlDummyDataStore::ConstructL()
+    {
+    _DBG_FILE("CNSmlDummyDataStore::ConstructL(): begin");
+
+    CNSmlContactsDataStore::ConstructL();
+
+    _DBG_FILE("CNSmlDummyDataStore::ConstructL(): end");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataStore::~CNSmlDummyDataStore
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataStore::~CNSmlDummyDataStore()
+    {
+    _DBG_FILE("CNSmlDummyDataStore::~CNSmlDummyDataStore(): begin");
+
+    _DBG_FILE("CNSmlDummyDataStore::~CNSmlDummyDataStore(): end");
+    }
+
+// -----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoOpenL
+// -----------------------------------------------------------------------------
+//
+void CNSmlDummyDataStore::DoOpenL( const TDesC& aStoreName,
+    MSmlSyncRelationship& aContext, TRequestStatus& aStatus )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::DoOpenL(): begin");
+
+    CNSmlContactsDataStore::DoOpenL( aStoreName, aContext, aStatus );
+
+    _DBG_FILE("CNSmlDummyDataStore::DoOpenL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoBeginBatchL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::DoBeginBatchL()
+    {
+    _DBG_FILE("CNSmlDummyDataStore::DoBeginBatchL(): begin");
+
+    CNSmlContactsDataStore::DoBeginBatchL();
+
+    _DBG_FILE("CNSmlDummyDataStore::DoBeginBatchL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoOpenItemL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::DoOpenItemL( TSmlDbItemUid aUid,
+    TBool& aFieldChange, TInt& aSize, TSmlDbItemUid& aParent,
+    TDes8& aMimeType, TDes8& aMimeVer, TRequestStatus& aStatus )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::DoOpenItemL(): begin");
+
+	CNSmlContactsDataStore::DoOpenItemL( aUid, aFieldChange,
+			aSize, aParent, aMimeType, aMimeVer, aStatus );
+
+    _DBG_FILE("CNSmlDummyDataStore::DoOpenItemL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoCommitItemL()
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::DoCommitItemL( TRequestStatus& aStatus )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::DoCommitItemL(): begin");
+
+    CNSmlContactsDataStore::DoCommitItemL( aStatus );
+
+    _DBG_FILE("CNSmlDummyDataStore::DoCommitItemL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoDeleteItemL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::DoDeleteItemL(
+    TSmlDbItemUid aUid, TRequestStatus& aStatus )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::DoDeleteItemL(): begin");
+
+    CNSmlContactsDataStore::DoDeleteItemL( aUid, aStatus );
+
+    _DBG_FILE("CNSmlDummyDataStore::DoDeleteItemL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// TBool CNSmlDummyDataStore::DoHasSyncHistory
+// ----------------------------------------------------------------------------
+TBool CNSmlDummyDataStore::DoHasSyncHistory() const
+    {
+    _DBG_FILE("CNSmlDummyDataStore::DoHasSyncHistory()");
+    return CNSmlContactsDataStore::DoHasSyncHistory();
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoModifiedItems
+// ----------------------------------------------------------------------------
+//
+const MSmlDataItemUidSet& CNSmlDummyDataStore::DoModifiedItems() const
+    {
+    _DBG_FILE("CNSmlDummyDataStore::DoModifiedItems()");
+    return CNSmlContactsDataStore::DoModifiedItems();
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoResetChangeInfoL
+// ----------------------------------------------------------------------------
+//
+void CNSmlDummyDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::DoResetChangeInfoL(): begin");
+
+    CNSmlContactsDataStore::DoResetChangeInfoL( aStatus );
+
+    _DBG_FILE("CNSmlDummyDataStore::DoResetChangeInfoL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoCommitChangeInfoL
+// ----------------------------------------------------------------------------
+//
+void CNSmlDummyDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus,
+    const MSmlDataItemUidSet& aItems )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(aItems): begin");
+
+    CNSmlContactsDataStore::DoCommitChangeInfoL( aStatus, aItems );
+
+    _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(aItems): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoCommitChangeInfoL
+// ----------------------------------------------------------------------------
+//
+void CNSmlDummyDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(): begin");
+
+    CNSmlContactsDataStore::DoCommitChangeInfoL( aStatus );
+
+    _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::LdoFetchItemL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::LdoFetchItemL(
+    TSmlDbItemUid& aUid, CBufBase& aItem )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::LdoFetchItemL(): begin");
+
+    CNSmlContactsDataStore::LdoFetchItemL( aUid, aItem );
+
+    _DBG_FILE("CNSmlDummyDataStore::LdoFetchItemL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::LdoAddItemL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::LdoAddItemL( const TDesC8& aItem, TInt aSize )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::LdoAddItemL(): begin");
+
+    CNSmlContactsDataStore::LdoAddItemL( aItem, aSize );
+
+    _DBG_FILE("CNSmlDummyDataStore::LdoAddItemL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::LdoAddItemsL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::LdoAddItemsL( CBufBase*& aItems, TInt aSize)
+    {
+    _DBG_FILE("CNSmlDummyDataStore::LdoAddItemsL(): begin");
+
+	CNSmlContactsDataStore::LdoAddItemsL( aItems, aSize );
+
+    _DBG_FILE("CNSmlDummyDataStore::LdoAddItemsL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// TInt CNSmlDummyDataStore::ExecuteAddL
+// ----------------------------------------------------------------------------
+TInt CNSmlDummyDataStore::ExecuteAddL()
+    {
+    _DBG_FILE("CNSmlDummyDataStore::ExecuteAddL()");
+    return CNSmlContactsDataStore::ExecuteAddL();
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::ExecuteDeleteL
+// ----------------------------------------------------------------------------
+
+void CNSmlDummyDataStore::ExecuteDeleteL()
+    {
+    _DBG_FILE("CNSmlDummyDataStore::ExecuteDeleteL(): begin");
+
+    CNSmlContactsDataStore::ExecuteDeleteL();
+
+    _DBG_FILE("CNSmlDummyDataStore::ExecuteDeleteL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::ExecuteUpdateL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::ExecuteUpdateL()
+    {
+	_DBG_FILE("CNSmlDummyDataStore::ExecuteUpdateL(): begin");
+
+    CNSmlContactsDataStore::ExecuteUpdateL();
+
+	_DBG_FILE("CNSmlDummyDataStore::ExecuteUpdateL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::SingleContactOperationCompleteL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::SingleContactOperationCompleteL(
+    MVPbkStoreContact* aContact )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::SingleContactOperationCompleteL(): begin");
+
+	CNSmlContactsDataStore::SingleContactOperationCompleteL( aContact );
+
+    _DBG_FILE("CNSmlDummyDataStore::SingleContactOperationCompleteL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::ContactsSaved
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::ContactsSaved(
+    MVPbkContactOperationBase& aOperation, MVPbkContactLinkArray* aResults )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::ContactsSaved(): begin");
+
+	CNSmlContactsDataStore::ContactsSaved( aOperation, aResults );
+
+    _DBG_FILE("CNSmlDummyDataStore::ContactsSaved(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::ContactsSavingFailed
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::ContactsSavingFailed(
+    MVPbkContactOperationBase& aOperation, TInt aError )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::ContactsSavingFailed(): begin");
+
+	CNSmlContactsDataStore::ContactsSavingFailed( aOperation, aError );
+
+    _DBG_FILE("CNSmlDummyDataStore::ContactsSavingFailed(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::StepComplete
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::StepComplete(
+    MVPbkContactOperationBase& aOperation, TInt aStepSize )
+    {
+    _DBG_FILE("CNSmlDummyDataStore::StepComplete(): begin");
+
+	CNSmlContactsDataStore::StepComplete( aOperation, aStepSize );
+
+    _DBG_FILE("CNSmlDummyDataStore::StepComplete(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::OperationCompleteL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::OperationCompleteL()
+    {
+    _DBG_FILE("CNSmlDummyDataStore::OperationCompleteL(): begin");
+
+    CNSmlContactsDataStore::OperationCompleteL();
+
+    _DBG_FILE("CNSmlDummyDataStore::OperationCompleteL(): end");
+    }
+
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoDeleteAllContactsL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::DoDeleteAllContactsL()
+    {
+    _DBG_FILE("CNSmlDummyDataStore::DoDeleteAllContactsL(): begin");
+
+    CNSmlContactsDataStore::DoDeleteAllContactsL();
+
+    _DBG_FILE("CNSmlDummyDataStore::DoDeleteAllContactsL(): end");
+    }
+
+// -----------------------------------------------------------------------------
+// const TDesC& CNSmlDummyDataStore::GetStoreFormatResourceFileL
+// -----------------------------------------------------------------------------
+const TDesC& CNSmlDummyDataStore::GetStoreFormatResourceFileL() const
+    {
+    _DBG_FILE("CNSmlDummyDataStore::GetStoreFormatResourceFileL()");
+    // Check correct Data Sync protocol
+    TInt value( EDataSyncNotRunning );
+    TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
+                                 KDataSyncStatus,
+                                 value );
+    if ( error == KErrNone && value == EDataSyncRunning )
+        {
+        return KNSmlDummyContactsStoreFormatRsc_1_1_2;
+        }
+    else // error or protocol version 1.2
+        {
+        return KNSmlDummyContactsStoreFormatRsc_1_2;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// MContactsModsFetcher* CNSmlDummyDataStore::CreateModsFetcherL
+// ----------------------------------------------------------------------------
+MContactsModsFetcher* CNSmlDummyDataStore::CreateModsFetcherL()
+    {
+    _DBG_FILE("CNSmlDummyDataStore::CreateModsFetcherL()");
+
+    return CNSmlContactsDataStore::CreateModsFetcherL();
+    }
+
+
+// END OF FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydllmain.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -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:  DS Dummy adapter entry point
+*
+*/
+
+#include <ImplementationProxy.h>
+#include "nsmldebug.h"
+#include "nsmlDummydataprovider.h"
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy array
+// -----------------------------------------------------------------------------
+//
+#ifndef IMPLEMENTATION_PROXY_ENTRY
+#define IMPLEMENTATION_PROXY_ENTRY( aUid, aFuncPtr ) {{aUid},(aFuncPtr)}
+#endif
+
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( KNSmlDummyAdapterImplUid, CNSmlDummyDataProvider::NewL )
+    };
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+    {
+    _DBG_FILE("ImplementationGroupProxy() for CNSmlDummyDataProvider: begin");
+
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+
+    _DBG_FILE("ImplementationGroupProxy() for CNSmlDummyDataProvider: end");
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummymodsfetcher.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,433 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  DS Dummy Adapter ModsFetcher
+*
+*/
+
+//  CLASS HEADER
+#include "nsmldummymodsfetcher.h"
+
+
+//  EXTERNAL INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <e32cmn.h>
+#include <e32des16.h>
+#include <CVPbkContactViewDefinition.h>
+#include <CVPbkContactIdConverter.h>
+#include <CVPbkContactFieldIterator.h>
+#include <MVPbkContactStoreProperties.h>
+#include <MVPbkStoreContactProperties.h>
+#include <MVPbkViewContact.h>
+#include <MVPbkFieldType.h>
+#include <MVPbkContactFieldTextData.h>
+#include <MVPbkStoreContact.h>
+#include <MVPbkStoreContact2.h>
+#include <MVPbkContactLink.h>
+#include <vpbkeng.rsg>
+
+// INTERNAL INCLUDES
+#include "nsmldebug.h"
+#include "nsmlsnapshotitem.h"
+#include "nsmlchangefinder.h"
+#include "nsmldummyutility.h"
+
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::CNSmlDummyModsFetcher
+// ------------------------------------------------------------------------------------------------
+//
+CNSmlDummyModsFetcher::CNSmlDummyModsFetcher(
+    TBool& aSnapshotRegistered,CVPbkContactManager& aContactManager,
+    MVPbkContactStore& aStore,TKeyArrayFix& aKey,
+    CNSmlChangeFinder& aChangeFinder ) :
+	CActive( EPriorityLow ),
+	iSnapshotRegistered( aSnapshotRegistered ),
+	iKey( aKey ),
+	iChangeFinder( aChangeFinder ),
+	iContactManager( aContactManager ),
+	iStore( aStore ),
+	iContactViewBase( NULL )
+	{
+	_DBG_FILE("CNSmlDummyModsFetcher::CNSmlDummyModsFetcher(): begin");
+	CActiveScheduler::Add( this );
+	_DBG_FILE("CNSmlDummyModsFetcher::CNSmlDummyModsFetcher(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::~CNSmlDummyModsFetcher
+// ------------------------------------------------------------------------------------------------
+//
+CNSmlDummyModsFetcher::~CNSmlDummyModsFetcher()
+	{
+	_DBG_FILE("CNSmlDummyModsFetcher::~CNSmlDummyModsFetcher(): begin");
+
+	Cancel();
+	delete iSnapshot;
+	delete iContactViewBase;
+
+	_DBG_FILE("CNSmlDummyModsFetcher::~CNSmlDummyModsFetcher(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::CancelRequest
+// ----------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::CancelRequest()
+     {
+     _DBG_FILE("CNSmlDummyModsFetcher::CancelRequest(): begin");
+
+     Cancel();
+
+     _DBG_FILE("CNSmlDummyModsFetcher::CancelRequest(): end");
+     }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::FetchModificationsL
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::FetchModificationsL( TRequestStatus& aStatus )
+	{
+	_DBG_FILE("CNSmlDummyModsFetcher::FetchModificationsL(): begin");
+
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	iContactCount = 0;
+	if( !iSnapshot )
+		{
+		iSnapshot = new (ELeave) CArrayFixSeg< TNSmlSnapshotItem >( KNSmlSnapshotSize );
+		}
+
+	if( iContactViewBase )
+	   {
+	   delete iContactViewBase;
+	   iContactViewBase = NULL;
+	   }
+
+	CreateViewL();
+
+	_DBG_FILE("CNSmlDummyModsFetcher::FetchModificationsL(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::ConstructL
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::ConstructL()
+	{
+	_DBG_FILE("CNSmlDummyModsFetcher::ConstructL(): begin");
+
+	iSnapshot = new ( ELeave ) CArrayFixSeg< TNSmlSnapshotItem >( KNSmlSnapshotSmallSize );
+
+	_DBG_FILE("CNSmlDummyModsFetcher::ConstructL(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::RunL
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::RunL()
+	{
+	_DBG_FILE("CNSmlDummyModsFetcher::RunL(): begin");
+
+	if ( !iSnapshotRegistered )
+		{
+		FetchNextContactL();
+		}
+#ifdef __NSML_MODULETEST__
+	else
+		{
+		CActiveScheduler::Stop();
+		}
+#endif
+
+	_DBG_FILE("CNSmlDummyModsFetcher::RunL(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::FetchNextContactL
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::FetchNextContactL()
+	{
+	_DBG_FILE("CNSmlDummyModsFetcher::FetchNextContactL(): begin");
+	if( iContactViewBase->ContactCountL() == 0 )
+		{
+		User::RequestComplete( iCallerStatus, KErrNone );
+		return;
+		}
+	if ( !iSnapshotRegistered )
+		{
+		const MVPbkViewContact& contact = iContactViewBase->ContactAtL( iContactCount );
+
+		MVPbkContactLink* contactLink = contact.CreateLinkLC();
+		iContactManager.RetrieveContactL( *contactLink, *this );
+		CleanupStack::PopAndDestroy();
+		}
+
+	_DBG_FILE("CNSmlDummyModsFetcher::FetchNextContactL(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::DoCancel
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::DoCancel()
+	{
+	_DBG_FILE("CNSmlDummyModsFetcher::DoCancel(): begin");
+
+	User::RequestComplete( iCallerStatus, KErrCancel );
+
+	_DBG_FILE("CNSmlDummyModsFetcher::DoCancel(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::IsConfidentialL
+// ----------------------------------------------------------------------------
+//
+TBool CNSmlDummyModsFetcher::IsConfidentialL( MVPbkStoreContact& aItem )
+    {
+    _DBG_FILE("CNSmlDummyModsFetcher::IsConfidentialL(): begin");
+    TBool ret( EFalse );
+
+    //find X-CLASS field type
+	const MVPbkFieldType* syncclass =
+        iContactManager.FieldTypes().Find( R_VPBK_FIELD_TYPE_SYNCCLASS );
+	CVPbkBaseContactFieldTypeIterator* itr =
+        CVPbkBaseContactFieldTypeIterator::NewLC( *syncclass,
+            aItem.Fields() );
+	while ( itr->HasNext() )
+        {
+        const MVPbkBaseContactField* field = itr->Next();
+        const MVPbkContactFieldTextData& data =
+        	MVPbkContactFieldTextData::Cast( field->FieldData() );
+        TPtrC ptr = data.Text();
+        //compare the sync type
+        if ( ptr.Compare( KNSmlContactSyncNoSync ) == 0 )
+            {
+            _DBG_FILE("CNSmlDummyModsFetcher::IsConfidentialL(): \
+                       find confidential");
+            ret = ETrue;
+            }
+
+        }
+	CleanupStack::PopAndDestroy( itr );
+
+    _DBG_FILE("CNSmlDummyModsFetcher::IsConfidentialL(): end");
+    return ret;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::RunError
+// ----------------------------------------------------------------------------
+ TInt CNSmlDummyModsFetcher::RunError( TInt aError )
+	{
+	DBG_FILE_CODE(aError, _S8("CNSmlDummyModsFetcher::RunError() : error code received "));
+	User::RequestComplete( iCallerStatus, aError );
+	return KErrNone;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::CreateViewL()
+// Create a contact view of the store which is opened
+// -----------------------------------------------------------------------------
+
+void CNSmlDummyModsFetcher::CreateViewL()
+	{
+	_DBG_FILE("CNSmlDummyModsFetcher::CreateViewL(): begin");
+
+	CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
+	CleanupStack::PushL( viewDef );
+	viewDef->SetType( EVPbkContactsView );
+
+	viewDef->SetUriL( iStore.StoreProperties().Uri().UriDes() );
+
+	 iContactViewBase = iContactManager.CreateContactViewLC(
+				                         *this,
+				                         *viewDef,
+				                         iContactManager.FieldTypes()  );
+	CleanupStack::Pop();
+	CleanupStack::PopAndDestroy( viewDef );
+
+	_DBG_FILE("CNSmlDummyModsFetcher::CreateViewL(): end");
+	}
+// ---------------------------------------------------------------------------
+//  CNSmlDummyModsFetcher::UpdateSnapshotL
+//  Add the fetched contacts id and timestamp
+//  to the snapshot.
+// ---------------------------------------------------------------------------
+//
+
+ void CNSmlDummyModsFetcher::UpdateSnapshotL( MVPbkStoreContact* aContact )
+{
+    _DBG_FILE("CNSmlDummyModsFetcher::UpdateSnapshotL(): begin");
+
+	if( !IsConfidentialL( *aContact) )
+		{
+		CVPbkContactIdConverter* idConverter = CVPbkContactIdConverter::NewL( iStore );
+		CleanupStack::PushL( idConverter );
+
+		TInt32 id = idConverter->LinkToIdentifier(
+			*iContactViewBase->ContactAtL( iContactCount).CreateLinkLC() );
+		TNSmlSnapshotItem snap( id );
+
+		MVPbkStoreContact2* tempContact =
+		reinterpret_cast<MVPbkStoreContact2*> ( aContact->StoreContactExtension ( KMVPbkStoreContactExtension2Uid ) );
+
+		MVPbkStoreContactProperties *contactProterties
+									= tempContact ->PropertiesL();
+		CleanupDeletePushL( contactProterties );
+		snap.SetLastChangedDate( contactProterties->LastModifiedL() );
+		CleanupStack::PopAndDestroy();
+
+		iSnapshot->InsertIsqL( snap, iKey );
+		iCurrentSnapshotCounter++;
+		if ( iCurrentSnapshotCounter > KNSmlSnapshotCompressSize )
+			{
+			iSnapshot->Compress();
+			iCurrentSnapshotCounter = 0;
+			}
+		CleanupStack::PopAndDestroy();
+		CleanupStack::PopAndDestroy( idConverter );
+		}
+
+	iContactCount++;
+
+	if ( iContactCount == iContactViewBase->ContactCountL() )
+		{
+		iChangeFinder.SetNewSnapshot( iSnapshot ); // changefinder takes ownership
+		iSnapshot = NULL;
+		iSnapshotRegistered = ETrue;
+		User::RequestComplete( iCallerStatus, KErrNone );
+		}
+
+	_DBG_FILE("CNSmlDummyModsFetcher::UpdateSnapshotL(): end");
+}
+// ---------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::ContactViewReady
+// Implements the view ready function of MVPbkContactViewObserver
+// ---------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::ContactViewReady(
+                MVPbkContactViewBase& /*aView*/ )
+	{
+    _DBG_FILE("CNSmlDummyModsFetcher::ContactViewReady(): begin");
+
+	SetActive();
+	TRequestStatus* status = &iStatus;
+	User::RequestComplete( status, KErrNone );
+
+	_DBG_FILE("CNSmlDummyModsFetcher::ContactViewReady(): end");
+	}
+
+// ---------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::ContactViewUnavailable
+// Implements the view unavailable function of MVPbkContactViewObserver
+// ---------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::ContactViewUnavailable(
+                MVPbkContactViewBase& /*aView*/ )
+{
+}
+
+// ---------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::ContactAddedToView
+// Implements the add contact function of MVPbkContactViewObserver
+// ---------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::ContactAddedToView(
+            MVPbkContactViewBase& /*aView*/,
+            TInt /*aIndex*/,
+            const MVPbkContactLink& /*aContactLink*/ )
+{
+}
+
+// ---------------------------------------------------------------------------
+// Implements the remove contact function of MVPbkContactViewObserver
+// ---------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::ContactRemovedFromView(
+                MVPbkContactViewBase& /*aView*/,
+                TInt /*aIndex*/,
+                const MVPbkContactLink& /*aContactLink*/ )
+{
+}
+
+// ---------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::ContactViewError
+// Implements the view error function of MVPbkContactViewObserver
+// ---------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::ContactViewError(
+            MVPbkContactViewBase& /*aView*/,
+            TInt aError,
+            TBool /*aErrorNotified*/ )
+{
+    _DBG_FILE("CNSmlDummyModsFetcher::ContactViewError(): begin");
+
+    User::RequestComplete( iCallerStatus, aError );
+
+    _DBG_FILE("CNSmlDummyModsFetcher::ContactViewError(): end");
+}
+
+// ---------------------------------------------------------------------------
+//  CNSmlDummyModsFetcher::VPbkSingleContactOperationComplete
+//  Called when the contact operation is completed.
+// ---------------------------------------------------------------------------
+//
+ void CNSmlDummyModsFetcher::VPbkSingleContactOperationComplete(
+		MVPbkContactOperationBase& aOperation,
+		MVPbkStoreContact* aContact )
+{
+    _DBG_FILE("CNSmlDummyModsFetcher::VPbkSingleContactOperationComplete(): begin");
+
+	MVPbkContactOperationBase* operation = &aOperation;
+	if ( operation )
+	{
+		delete operation;
+		operation = NULL;
+	}
+
+	TRAPD( error,UpdateSnapshotL( aContact ) );
+	delete aContact;
+	if( error!= KErrNone )
+	   {
+	   User::RequestComplete( iCallerStatus, error );
+	   }
+	else
+	   {
+	   SetActive();
+	   TRequestStatus* status = &iStatus;
+	   User::RequestComplete( status, KErrNone );
+	   }
+
+	_DBG_FILE("CNSmlDummyModsFetcher::VPbkSingleContactOperationComplete(): end");
+}
+
+// ---------------------------------------------------------------------------
+//  CNSmlDummyModsFetcher::VPbkSingleContactOperationFailed
+//  Called when the contact operation fails
+// ---------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::VPbkSingleContactOperationFailed(
+		MVPbkContactOperationBase& aOperation,
+		 TInt /*aError*/ )
+ {
+    _DBG_FILE("CNSmlDummyModsFetcher::VPbkSingleContactOperationFailed(): begin");
+
+ 	MVPbkContactOperationBase* operation = &aOperation;
+	if ( operation )
+	{
+		delete operation;
+		operation = NULL;
+	}
+
+	_DBG_FILE("CNSmlDummyModsFetcher::VPbkSingleContactOperationFailed(): end");
+ }
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummyutility.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  DS Dummy Adapter utility
+*
+*/
+/*
+* ==============================================================================
+*  Name        : nsmldummyutility.cpp
+*  Part of     : Nokia SyncML / DS Contacts
+*  Description : DS dummy adapters
+*  Version     :
+*
+*  Copyright © 2009 Nokia Corporation.
+*  This material, including documentation and any related
+*  computer programs, is protected by copyright controlled by
+*  Nokia Corporation. All rights are reserved. Copying,
+*  including reproducing, storing, adapting or translating, any
+*  or all of this material requires the prior written consent of
+*  Nokia Corporation. This material also contains confidential
+*  information which may not be disclosed to others without the
+*  prior written consent of Nokia Corporation.
+* ==============================================================================
+*/
+
+//  CLASS HEADER
+#include "nsmldummyutility.h"
+
+
+
+
+void CNSmlDummyUtility::ShowNote( const TDesC& aNote )
+    {
+    DBG_ARGS(aNote);
+    }
+
+
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_agenda_handler_plugin_api/ds_agenda_handler_plugin_api.metaxml	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,13 @@
+<?xml version="1.0" ?>
+<api id="e875aa7198efe7485167b690e8fa48d7" dataversion="1.0">
+<name>ds_agenda_handler_plugin_api</name>
+<description>This api is used for creating new implementation to support multiple calendar feature for Agenda Adapter</description>
+<type>c++</type>
+<subsystem>Agenda Adapter</subsystem>
+<libs></libs>
+<release category="domain" sinceversion=""/>
+<attributes>
+<htmldocprovided>no</htmldocprovided>
+<adaptation>no</adaptation>
+</attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_agenda_handler_plugin_api/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -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 <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/nsmlagendaadapterhandler.h      APP_LAYER_PLATFORM_EXPORT_PATH(nsmlagendaadapterhandler.h)
+../inc/nsmlagendaadapterhandler.inl    APP_LAYER_PLATFORM_EXPORT_PATH(nsmlagendaadapterhandler.inl)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_agenda_handler_plugin_api/inc/nsmlagendaadapterhandler.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+#ifndef C_NSMLAGENDA_ADAPTERHANDLERPLUGIN_H
+#define C_NSMLAGENDA_ADAPTERHANDLERPLUGIN_H
+
+// SYSTEM INCLUDES
+#include <e32base.h>
+#include <s32mem.h>
+#include <ecom.h>
+#include <SmlDataFormat.h>
+#include <nsmlchangefinder.h>
+#include <calcalendarinfo.h>
+#include <e32cmn.h>
+
+// Constants
+const TUid KAgendaAdapterHandlerInterfaceUid = { 0x20029F14 };
+
+/**
+* Interface definition for ECoM plug-in adapters
+*/
+class CNSmlAgendaAdapterHandler: public CBase
+    {
+	public:
+	    /**
+        * Ecom interface static factory method implementation.
+        * @param aImpUid Ecom's implementation uid
+        * @return A pointer to the created instance of CNSmlAgendaAdapterHandler
+        */
+		static inline CNSmlAgendaAdapterHandler* NewL(TUid aImpUid);
+
+		/**
+		* Destructor
+		*/
+		virtual ~CNSmlAgendaAdapterHandler();
+
+	public:
+	    /**
+        * Determines the Server supported folder properties
+        * 
+        * @param aServerDataStoreFormat Class structure of server device information
+        *         
+        */
+	    virtual void CheckServerSupportForFolder( const CSmlDataStoreFormat& aServerDataStoreFormat ) = 0;
+	    
+	    /**
+        * Retrieve the folder from the Organizer db
+        * 
+        * @param aUid variable specifing which Folder to be fetched
+        * @param aStream on return will have the Folder details
+        *         
+        */
+	    virtual void FetchFolderL( const TSmlDbItemUid aUid, RBufWriteStream& aStream ) = 0;
+	    
+	    /**
+        * Determine the list of folders in the Organizer db owned by the calling application
+        * 
+        * @param aFolderUidArray array on return will have UID's of owned folders
+        *         
+        */
+	    virtual void SynchronizableCalendarIdsL( CArrayFixFlat<TUint>* aFolderUidArray ) = 0;
+	    
+	    /**
+        * Create a folder on to Organizer db
+        * 
+        * @param aStream containing the folder details to be created with
+        * @return TCalLocalUid of the newly created folder
+        *         
+        */
+	    virtual TCalLocalUid CreateFolderL( RBufReadStream& aStream ) = 0;
+	    
+	    /**
+        * Replace the existing folder with updated info
+        * 
+        * @param aUid determines folder to act upon
+        * @param aStream containing the folder information to be updated
+        * @param aSyncStatus updated folders current syncstatus
+        *         
+        */
+	    virtual void ReplaceFolderL( const TCalLocalUid& aUid, RBufReadStream& aStream, TBool& aSyncStatus ) = 0;
+	    
+	    /**
+        * Retrieves the foldername 
+        * 
+        * @param aUid of the folder whose name to be determined
+        * @return HBufC* name of the folder
+        *         
+        */
+	    virtual HBufC* FolderNameL( TSmlDbItemUid aUid ) = 0;
+	    
+	    /**
+        * Retrieve the calendar sync capability supported by the device
+        * 
+        * @param aStringPool 
+        * @return CSmlDataStoreFormat* Class structure of supported capabilities
+        *         
+        */	 
+	    virtual CSmlDataStoreFormat* StoreFormatL( RStringPool& aStringPool ) = 0;
+	    
+	    /**
+        * Create a snap shot item
+        * 
+        * @param aUid of folder whose snapshot to be created
+        * @retrun TNSmlSnapshotItem class 
+        *         
+        */
+	    virtual TNSmlSnapshotItem CreateFolderSnapShotItemL( const TCalLocalUid& aUid ) = 0;
+	    
+	    /**
+        * Determine the folder owner
+        * 
+        * @return TInt uid of the owner application
+        *         
+        */	    
+	    virtual TInt DeviceSyncOwner() = 0;
+	    
+	    /**
+        * Determines the sync status of the folder
+        * 
+        * @param aUid determine the folder whose sync status to be retrieved
+        * @return TBool sync status
+        *         
+        */
+	    virtual TBool FolderSyncStatusL( TSmlDbItemUid aUid ) = 0;
+	    
+	    /**
+        * Determines the sync status of the folder
+        * 
+        * @param aFolderName determine the folder whose sync status to be retrieved
+        * @return TBool sync status
+        *         
+        */	    
+	    virtual TBool FolderSyncStatusL( HBufC* aFolderName ) = 0; 
+	    
+	public:
+	    /**
+        * Variable to hold the Plugin's Opaque Data
+        */
+	    HBufC8* iOpaqueData;
+   
+	private:    
+		/**
+		* Used internally to create ECOM implementation
+	    */
+  	   	TUid iDtor_ID_Key;  	   
+    
+    };
+
+#include "nsmlagendaadapterhandler.inl"
+
+#endif		// C_NSMLAGENDA_ADAPTERHANDLERPLUGIN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_agenda_handler_plugin_api/inc/nsmlagendaadapterhandler.inl	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <ecom.h>
+#include "nsmlagendaadapterhandler.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// ----------------------------------------------------------------------------
+// CNSmlAgendaAdapterHandler::NewL
+// Two phase construction
+// ----------------------------------------------------------------------------
+inline CNSmlAgendaAdapterHandler* CNSmlAgendaAdapterHandler::NewL( TUid aImpUid)
+    {
+    TAny* implementation = REComSession::CreateImplementationL ( aImpUid,
+    _FOFF ( CNSmlAgendaAdapterHandler, iDtor_ID_Key ));
+    CNSmlAgendaAdapterHandler* self = REINTERPRET_CAST( CNSmlAgendaAdapterHandler*, implementation );
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// CNSmlAgendaAdapterHandler::~CNSmlAgendaAdapterHandler
+// Destructor
+// ----------------------------------------------------------------------------
+inline CNSmlAgendaAdapterHandler::~CNSmlAgendaAdapterHandler()
+    {
+    REComSession::DestroyedImplementation( iDtor_ID_Key );
+    delete iOpaqueData;
+    }
--- a/contentctrl_plat/ds_contact_adapter_customization_api/ds_contact_adapter_customization_api.metaxml	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0" ?>
-<api id="fd79653552dfddc5384b67f5eab5f62a" dataversion="1.0">
-  <name>DS Contact Adapter Customization API</name>
-  <description>Exports Contact Adapter API to make possible to inherit Contact Adapter and create Extended Contacts Adapters</description>
-  <type>c++</type>
-  <subsystem>omads</subsystem>
-  <libs>
-    <lib name="nsmlcontactsdataprovider.lib" />
-  </libs>
-  <release category="platform"/>
-  <attributes>
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
-  </attributes>
-</api>
--- a/contentctrl_plat/ds_contact_adapter_customization_api/group/bld.inf	Tue Aug 31 15:05:37 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:  File that exports the files belonging to 
-:               DS Contact Adapter Customization API
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-../inc/nsmlcontactsdataprovider.h APP_LAYER_PLATFORM_EXPORT_PATH(nsmlcontactsdataprovider.h)
-../inc/nsmlcontactsdatastore.h APP_LAYER_PLATFORM_EXPORT_PATH(nsmlcontactsdatastore.h)
-
-PRJ_TESTMMPFILES
-../tsrc/DummyAdapter/group/nsmldummydataprovider.mmp
--- a/contentctrl_plat/ds_contact_adapter_customization_api/inc/nsmlcontactsdataprovider.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +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:  DS contacts dataprovider.
-*
-*/
-
-#ifndef __NSMLCONTACTSDATAPROVIDER_H__
-#define __NSMLCONTACTSDATAPROVIDER_H__
-
-// INCLUDES
-#include <f32file.h>
-#include <smldataprovider.h>
-#include <nsmlcontactsdatastore.h>
-
-// CLASS DECLARATION
-
-// ------------------------------------------------------------------------------------------------
-//  CNSmlContactsDataProvider
-//
-//  @lib nsmlcontactsdataprovider.lib
-// ------------------------------------------------------------------------------------------------
-class CNSmlContactsDataProvider : public CSmlDataProvider 
-	{
-	public:
-		/**
-		* Two-phased constructor.
-		*/
-		IMPORT_C static CNSmlContactsDataProvider* NewL();
-
-		/**
-		* Destructor.
-		*/
-		IMPORT_C virtual ~CNSmlContactsDataProvider();
-
-	protected:
-		/**
-		* Two-phased constructor.
-		*/
-		IMPORT_C static CNSmlContactsDataProvider* NewLC();
-
-		/**
-		* This method handles framework events.
-		* @param					Frameworks event.
-		* @param	aParam1			First parameter.
-		* @param	aParam2			Second parameter.
-		*/
-		IMPORT_C void DoOnFrameworkEvent(TSmlFrameworkEvent, TInt aParam1, TInt aParam2);
-
-		/**
-		* Check if operation is supported by dataprovider.
-		* @param	aOpId			Operations type.
-		* @return	ETrue if the operation is supported.
-		*/
-		IMPORT_C TBool DoSupportsOperation(TUid aOpId) const;
-
-		/**
-		* Gets dataproviders own StoreFormat.
-		*/
-		IMPORT_C const CSmlDataStoreFormat& DoStoreFormatL();
-
-		/**
-		* Lists all contacts databases on client.
-		* @return List of contact databases.
-		*/
-		IMPORT_C CDesCArray* DoListStoresLC();
-
-		/**
-		* Gets default storename on client.
-		* @return Default storename.
-		*/
-		IMPORT_C const TDesC& DoDefaultStoreL();
-
-		/**
-		* Constructs new instance of datastore.
-		* @return Newly created instance.
-		*/
-		IMPORT_C CSmlDataStore* DoNewStoreInstanceLC();
-
-		/**
-		This method returns the set of filters that can be used to send to the SyncML server.
-		* @return New filters.
-		*/
-		IMPORT_C const RPointerArray<CSyncMLFilter>& DoSupportedServerFiltersL();
-		
-		/**
-		This method checks what filters are supported by server.
-		@param	aServerDataStoreFormat	The store format of server
-		@param	aFilters				The array that includes filters
-		@param	aChangeInfo				The change information about changes that data provider did
-		*/
-		IMPORT_C void DoCheckSupportedServerFiltersL(const CSmlDataStoreFormat& aServerDataStoreFormat, RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo);
-		
-		/**
-		This method updates dynamic filters up-to-date.
-		@param	aFilters				The array that includes filters
-		@param	aChangeInfo				The change information about changes that data provider did
-		*/
-		IMPORT_C void DoCheckServerFiltersL(RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo);
-		
-		/**
-		This method generates a record filter query to be sent to the SyncML server for the provided filters.
-		@param	aFilters			The filters to be used for the query generation
-		@param	aMatch				The filter match type to be used
-		@param	aFilterMimeType		The mime type of the returned filter query
-		@param	TSyncMLFilterType 	The filter type of the returned filter query
-		@param	aStoreName			The name of used store
-		@return						The record filter query to be sent to the SyncML server - empty if no record filter involved
-									for this specific filter
-		*/
-		IMPORT_C HBufC* DoGenerateRecordFilterQueryLC(const RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterMatchType aMatch, TDes& aFilterMimeType, TSyncMLFilterType& aFilterType, TDesC& aStoreName);
-		
-		/**
-		This method generates a field filter query to be sent to the SyncML server for the provided filters.
-		@param	aFilters		The filters to be used for the query generation
-		@param	aFilterMimeType		The mime type of the returned filter query
-		@param	aProperties		The field filter query to be sent to the SyncML server - empty if no field filter involved
-								for this specific filter
-		@param  aStoreName		The name of used store
-		*/
-		IMPORT_C void DoGenerateFieldFilterQueryL(const RPointerArray<CSyncMLFilter>& aFilters, TDes& aFilterMimeType, RPointerArray<CSmlDataProperty>& aProperties, TDesC& aStoreName);
-
-		/**
-		* C++ constructor.
-		*/
-		IMPORT_C CNSmlContactsDataProvider();
-
-		/**
-		* 2nd phase constructor.
-		*/
-		IMPORT_C void ConstructL();
-
-	protected: // New 
-		
-		IMPORT_C virtual const TDesC& GetStoreFormatResourceFileL() const;
-    	
-		IMPORT_C virtual CNSmlContactsDataStore* CreateDataStoreLC() const;
-		
-	private: // data
-		CNSmlContactsDataStore* iContactsDataStore; 
-		RPointerArray<CSyncMLFilter> iFilterArray;
-		RFs iRfs;
-		RStringPool iStringPool;
-		CSmlDataStoreFormat* iStoreFormat;
-	};
-	
-#endif // __NSMLCONTACTSDATAPROVIDER_H__
-
-// End of File  
--- a/contentctrl_plat/ds_contact_adapter_customization_api/inc/nsmlcontactsdatastore.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,597 +0,0 @@
-/*
-* Copyright (c) 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:  DS contacts datastore.
-*
-*/
-
-#ifndef __NSMLCONTACTSDATASTORE_H__
-#define __NSMLCONTACTSDATASTORE_H__
-
-// INCLUDE FILES
-#include <smldataprovider.h>
-#include <smldataformat.h>
-#include <f32file.h>
-
-// MACROS
-#define KNSmlvCard21Version TVersion(2,1,0);
-#define KNSmlvCard30Version TVersion(3,0,0);
-
-// CONSTANTS
-_LIT(  KNSmlContactStoreNameForDefaultDB, "symbian" );
-_LIT(  KNSmlDriveC, "C" );
-_LIT8( KNSmlvCard30Name, "text/vcard" );
-_LIT8( KNSmlvCard30Ver, "3.0" );
-_LIT8( KNSmlvCard21Name, "text/x-vcard" );
-_LIT8( KNSmlvCard21Ver, "2.1" );
-_LIT8(KUidFormat, "%d");
-
-
-_LIT8( KVersitTokenHOME, "HOME"  );
-_LIT8( KVersitTokenWORK, "WORK"  );
-_LIT8( KVersitTokenCELL, "CELL"  );
-_LIT8( KVersitTokenPAGER,"PAGER" );
-_LIT8( KVersitTokenFAX,  "FAX"   );
-_LIT8( KVersitTokenVOICE,"VOICE" );
-_LIT8( KVersitTokenVIDEO,"VIDEO" );
-
-const TInt KNSmlContactsGranularity = 8;
-const TInt KNSmlCompactAfterChanges = 16;
-const TInt KNSmlDataStoreMaxSize = 102400;		// 100 k
-const TInt KNSmlDefaultStoreNameMaxSize = 256;
-const TInt KNSmlItemDataExpandSize = 1024;
-const TInt KNSmlNoError = 1;
-
-_LIT(KNSmlContactsStoreFormatRsc_1_1_2,"NSmlContactsDataStoreFormat_1_1_2.rsc");
-_LIT(KNSmlContactsStoreFormatRsc_1_2,"NSmlContactsDataStoreFormat_1_2.rsc");
-
-// FORWARD DECLARATIONS
-
-class CNsmlContactsDataStoreExtension;
-class MContactsModsFetcher;
-class CNSmlDataModBase;
-class CNSmlChangeFinder;
-class CNSmlDataItemUidSet;
-class TNSmlSnapshotItem;
-
-// CLASS DECLARATION
-
-// ------------------------------------------------------------------------------------------------
-// CNSmlContactsDataStore
-//
-// @lib nsmlcontactsdataprovider.lib
-// ------------------------------------------------------------------------------------------------
-class CNSmlContactsDataStore : public CSmlDataStore
-	{
-	public:	
-		/**
-		* Two-phased constructor.
-		*/
-		IMPORT_C static CNSmlContactsDataStore* NewL();
-
-		/**
-		* Destructor.
-		*/
-		IMPORT_C virtual ~CNSmlContactsDataStore();
-
-		/**
-		* Default store name of client.
-		* @return Default store name.
-		*/
-		IMPORT_C const TDesC& DefaultStoreNameL() const;
-
-		/**
-		* Gets a list of all contacts databases on client.
-		* @return List of databases.
-		*/
-		IMPORT_C CDesCArray* DoListStoresLC();
-
-	protected:
-		/**
-		* 2nd phase constructor.
-		*/
-		IMPORT_C void ConstructL();
-
-        /**
-        * 2nd phase constructor.
-        * @param aStorename Name of the contact database instance.
-        */
-		IMPORT_C void ConstructL( const TDesC& aStoreName );
-		
-		/**
-		* DoOpenL() opens the data store specified by aStoreName asynchronously.
-		* @param		aStoreName			The name of the data store to open.
-		* @param		aContext			Identifies the specific synchronisation relationship to use for the synchronisation.
-		* @param		aStatus				On completion of the open, contains the result code.
-		*/
-		IMPORT_C void DoOpenL(const TDesC& aStoreName, MSmlSyncRelationship& aContext, TRequestStatus& aStatus);
-
-		/**
-		* DoCancelRequest() cancels the current asynchronous request, including open. Only one asynchronous request may be outstanding at any one time.
-		*/
-		IMPORT_C void DoCancelRequest();
-
-		/**
-		* DoStoreName() returns the name of the open data store.
-		* @return The name of the currently opened data store.
-		*/
-		IMPORT_C const TDesC& DoStoreName() const;
-
-		/**
-		* DoBeginTransactionL() starts the transaction mode. During this mode calls to CreateItemL, ReplaceItemL,
-		* WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this transaction.
-		* Their RequestStatus must be completed, even if the change is not yet really executed in the Data Store.
-		* If a RequestStatus is completed with an error code, the transaction has failed and a rollback must be
-		* done. In this case RevertTransaction will be called.
-		*/
-		IMPORT_C void DoBeginTransactionL();
-
-		/**
-		* DoCommitTransactionL() will be called at the end of a successful transaction. At this point in time the
-		* operations within the transaction are applied to the Data Store in an atomic way. If all operations
-		* succeed, the RequestStatus must be completed with KErrNone. If an operation fails, a rollback must be
-		* done and the RequestStatus must be completed with an appropriate error code.
-		*/
-		IMPORT_C void DoCommitTransactionL(TRequestStatus& aStatus);
-
-		/**
-		* DoRevertTransaction() will be called to abort an ongoing transaction. None of the operations already
-		* submitted may be applied to the Data Store. The RequestStatus must be completed with KErrNone as a revert
-		* cannot fail.
-		*/
-		IMPORT_C void DoRevertTransaction(TRequestStatus& aStatus);
-
-		/**
-		* DoBeginBatchL() starts the batch mode. During this mode calls to CreateItemL, ReplaceItemL,
-		* WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this batch.
-		* Their RequestStatus must be completed with KErrNone, which only signals acceptance of the operation
-		* for batch processing.
-		*/
-		IMPORT_C void DoBeginBatchL();
-
-		/**
-		* DoCommitBatchL() will be called at the end of the batch mode. This tells the Data Store to
-		* process the batched operations (in the order they were submitted), and to append the error code
-		* for each operation to aResultArray.
-		* The error codes in aResultArray are only valid if the RequestStatus is completed with KErrNone.
-		* If the RequestStatus is completed with an error code none of the operations in the batch mode
-		* were applied to the Data Store.
-		*/
-		IMPORT_C void DoCommitBatchL(RArray<TInt>& aResultArray, TRequestStatus& aStatus);
-
-		/**
-		* DoCancelBatch() will be called to abort an ongoing batch mode. None of the operations already
-		* submitted may be applied to the Data Store.
-		*/
-		IMPORT_C void DoCancelBatch();
-
-		/**
-		* DoSetRemoteStoreFormatL() sets the SyncML server Data Format - this may optionally be used by the Data 
-		* Provider to filter out properties that the server does not support, and should be used to avoid deleting 
-		* these properties in case the server sends a changed item to the Data Provider
-		*/
-		IMPORT_C void DoSetRemoteStoreFormatL(const CSmlDataStoreFormat& aServerDataStoreFormat);
-
-		/**
-		* DoSetRemoteMaxObjectSize() sets the SyncML server maximum object size - this may optionally be used by the 
-		* Data Provider to not send items to the server exceeding its maximum size. 0 means there is no limit.
-		*/
-		IMPORT_C void DoSetRemoteMaxObjectSize(TInt aServerMaxObjectSize);
-
-		/**
-		* DoMaxObjectSize() gets the Data Store maximum object size which is reported to the SyncML server. 0 means 
-		* there is no limit.
-		* @return The maximum object size.
-		*/
-		IMPORT_C TInt DoMaxObjectSize() const;
-
-		/**
-		* DoOpenItemL() opens the data item specified by aUid asynchronously for reading.
-		* @param		aUid				Item UID which going to be read.
-		* @param		aFieldChange		Accept field changes.
-		* @param		aParent				Parent of the item.
-		* @param		aSize				Size of the item data.
-		* @param		aMimeType			MIME type of the item.
-		* @param		aMimeVer			MIME version used on item.
-		* @param		aStatus				On completion of the opening of item, contains the result code.
-		*/
-		IMPORT_C void DoOpenItemL(TSmlDbItemUid aUid, TBool& aFieldChange, TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType, TDes8& aMimeVer, TRequestStatus& aStatus);
-
-		/**
-		* DoCreateItemL() sets the item properties and reference to aUid which will be created.
-		* @param		aUid				Reference to item UID which going to be created.
-		* @param		aSize				Size of the item to be created.
-		* @param		aParent				Parent of the item.
-		* @param		aMimeType			MIME type of the item.
-		* @param		aMimeVer			MIME version used on item.
-		* @param		aStatus				On completion of the creating an item, contains the result code.
-		*/
-		IMPORT_C void DoCreateItemL(TSmlDbItemUid& aUid, TInt aSize, TSmlDbItemUid aParent, const TDesC8& aMimeType, const TDesC8& aMimeVer, TRequestStatus& aStatus);
-
-		/**
-		* DoReplaceItemL() opens the data item specified by aUid asynchronously to be updated.
-		* @param		aUid				Item UID which going to be updated.
-		* @param		aSize				Size of the item data.
-		* @param		aParent				Parent of the item.
-		* @param		aFieldChange		Accept field changes.
-		* @param		aStatus				On completion of the updating of item, contains the result code.
-		*/
-		IMPORT_C void DoReplaceItemL(TSmlDbItemUid aUid, TInt aSize, TSmlDbItemUid aParent, TBool aFieldChange, TRequestStatus& aStatus);
-
-		/**
-		* DoReadItemL() reads data(or size of aBuffer) of an item opened in DoOpenItemL() to given aBuffer.
-		* @param		aBuffer				Buffer to item data.
-		*/
-		IMPORT_C void DoReadItemL(TDes8& aBuffer);
-
-		/**
-		* DoWriteItemL() writes aData of an item opened in DoCreateItemL() or DoReplaceItemL() to be saved on database.
-		* @param		aData				Item data (or part of data).
-		*/
-		IMPORT_C void DoWriteItemL(const TDesC8& aData);
-
-		/**
-		* DoCommitItemL() completes an item operation started in DoCreateItemL() or DoReplaceItemL().
-		* @param		aStatus				On completion of the operation, contains the result code.
-		*/
-		IMPORT_C void DoCommitItemL(TRequestStatus& aStatus);
-
-		/**
-		* DoCloseItem() completes an item operation started in DoOpenItemL().
-		*/
-		IMPORT_C void DoCloseItem();
-
-		/**
-		* DoMoveItemL() moves item specified by aUid asynchronously.
-		* @param		aUid				Item UID which going to be moved.
-		* @param		aNewParent			A new parent of the item.
-		* @param		aStatus				On completion of the moving an item, contains the result code.
-		*/
-		IMPORT_C void DoMoveItemL(TSmlDbItemUid aUid, TSmlDbItemUid aNewParent, TRequestStatus& aStatus);
-
-		/**
-		* DoDeleteItemL() deletes item specified by aUid asynchronously.
-		* @param		aUid				Item UID which going to be deleted.
-		* @param		aStatus				On completion of the deleting an item, contains the result code.
-		*/
-		IMPORT_C void DoDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus);
-
-		/**
-		* DoSoftDeleteItemL() soft deletes item specified by aUid asynchronously.
-		* @param		aUid				Item UID which going to be softdeleted.
-		* @param		aStatus				On completion of the softdeleting an item, contains the result code.
-		*/
-		IMPORT_C void DoSoftDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus);
-
-		/**
-		* DoDeleteAllItemsL() deletes all items from opened database asynchronously.
-		* @param		aStatus				On completion of delete, contains the result code.
-		*/
-		IMPORT_C void DoDeleteAllItemsL(TRequestStatus& aStatus);
-
-		/**
-		* DoHasSyncHistory() checks if previous sync with opened server and context.
-		* @return ETrue if there is synchonization history.
-		*/
-		IMPORT_C TBool DoHasSyncHistory() const;
-
-		/**
-		* DoAddedItems() gets all added items on client since previous synchronization.
-		* @return Added items.
-		*/
-		IMPORT_C const MSmlDataItemUidSet& DoAddedItems() const;
-
-		/**
-		* DoDeletedItems() gets all deleted items on client since previous synchronization.
-		* @return Deleted items.
-		*/
-		IMPORT_C const MSmlDataItemUidSet& DoDeletedItems() const;
-
-		/**
-		* DoSoftDeletedItems() gets all softdeleted items on client since previous synchronization.
-		* @return Soft deleted items.
-		*/
-		IMPORT_C const MSmlDataItemUidSet& DoSoftDeletedItems() const;
-
-		/**
-		* DoModifiedItems() gets all modified items on client since previous synchronization.
-		* @return Modified items.
-		*/
-		IMPORT_C const MSmlDataItemUidSet& DoModifiedItems() const;
-
-		/**
-		* DoMovedItems() gets all moved items on client since previous synchronization.
-		* @return Moved items.
-		*/
-		IMPORT_C const MSmlDataItemUidSet& DoMovedItems() const;
-
-		/**
-		* DoResetChangeInfoL() resets client synchronization data => next time will be slow sync.
-		* @param		aStatus				On completion of reset, contains the result code.
-		*/
-		IMPORT_C void DoResetChangeInfoL(TRequestStatus& aStatus);
-
-		/**
-		* DoCommitChangeInfoL() commits client synchronization changes for given aItems list.
-		* @param		aStatus				On completion of given items, contains the result code.
-		* @param		aItems				Item ids to be commited.
-		*/
-		IMPORT_C void DoCommitChangeInfoL(TRequestStatus& aStatus, const MSmlDataItemUidSet& aItems);
-
-		/**
-		* DoCommitChangeInfoL() commits all client synchronization changes.
-		* @param		aStatus				On completion of all items, contains the result code.
-		*/
-		IMPORT_C void DoCommitChangeInfoL(TRequestStatus& aStatus);
-
-		/**
-		* Default constructor.
-		*/
-		IMPORT_C CNSmlContactsDataStore();
-
-		/**
-		* SetOwnStoreFormatL() Sets dataproviders own storeformat.
-		*/
-		IMPORT_C void SetOwnStoreFormatL();
-
-		/**
-		* LdoFetchItemL() Fetches item data from database.
-		* @param		aUid				Items uid for fetching.
-		* @param		aItem				Items data after fetch.
-		* @return KErrNone if successful.
-		*/
-		IMPORT_C TInt LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem );
-
-		/**
-		* LdoAddItemL() Adds item data to database.
-		* @param		aUid				Item uid reference for add.
-		* @param		aItem				Item data to be added.
-		* @param		aSize				Item data size.
-		* @param		aLastModified		Item creation date.
-		* @return KErrNone if successful.
-		*/
-		IMPORT_C TInt LdoAddItemL( TSmlDbItemUid& aUid,
-		                  const TDesC8& aItem,
-		                  TInt aSize,
-		                  TTime& aLastModified );
-
-		/**
-		* LdoAddItemsL() Adds several items to database.
-		* @param		aUids				Array of items uid references for add.
-		* @param		aItem				Items data to be added.
-		* @param		aSize				Items data size.
-		* @param		aLastModified		Last items creation date.
-		* @return KErrNone if successful.
-		*/
-		IMPORT_C TInt LdoAddItemsL( RArray<TInt>& aUids,
-		                   CBufBase*& aItem,
-		                   TInt aSize,
-		                   TTime& aLastModified );
-
-		/**
-		* LdoUpdateItemL() Updates item data to database.
-		* @param		aUid				Item uid for update.
-		* @param		aItem				Item data to be updated.
-		* @param		aSize				Item data size.
-		* @param		aLastModified		Item modification date.
-		* @return KErrNone if successful.
-		*/
-		IMPORT_C TInt LdoUpdateItemL( TSmlDbItemUid aUid,
-		                     const TDesC8& aItem,
-		                     TInt aSize,
-		                     TTime& aLastModified );
-
-		/**
-		* LdoMergeLC() Merges item data from server in update with clients item data.
-		* @param		aUid				Item uid for update.
-		* @param		aItem				Item data to be merged.
-		* @return KErrNone if successful.
-		*/
-		IMPORT_C CBufBase* LdoMergeLC( TSmlDbItemUid& aUid, const TDesC8& aItem );
-
-		/**
-		* DriveBelowCriticalLevelL() Checks if there is enough space on client to store added item data.
-		* @param		aSize				Item size to be added.
-		* @return ETrue if there isn't enough drive space.
-		*/
-		IMPORT_C TBool DriveBelowCriticalLevelL( TInt aSize );
-
-		/**
-		* StripPropertyL() Removes aProperty from aItem data.
-		* @param		aItem				Item data to be stripped.
-		* @param		aProperty			Property to be removed from aItem.
-		*/
-		IMPORT_C void StripPropertyL( HBufC8*& aItem, const TDesC8& aProperty ) const;
-
-		/**
-		* StripPropertyL() Remove aPropertys from aItem data.
-		* @param		aItem				Item(s) data to be stripped.
-		* @param		aProperty			Property to be removed from aItem.
-		*/
-		IMPORT_C void StripPropertyL( CBufBase*& aItem, const TDesC8& aProperty ) const;
-
-		/**
-		* ExecuteBufferL()Executes all buffered items from buffer.
-		* @param		aResultArray		Array to return statuscodes for each command.
-		* @return KErrNone if successful.
-		*/
-		IMPORT_C TInt ExecuteBufferL(RArray<TInt>& aResultArray);
-	
-		/**
-		* AddBufferListL()Adds a new item to buffer.
-		* @param 		aUid 				New item's uid.
-		* @param 		aSize 				New item's size.
-		* @param 		aStatus 			New item's status.
-		* @return Pointer to the buffer.
-		*/
-		IMPORT_C CBufBase* AddBufferListL(TSmlDbItemUid& aUid, TInt aSize, TInt aStatus);
-		
-		/**
-        * Reads all modifications from clients contacts databse.
-        */      
-        TInt FetchModificationsL();
-
-    protected: // New 
-        
-    	IMPORT_C virtual const TDesC& GetStoreFormatResourceFileL() const;    
-        
-        /**
-         * Performs the actual computation for ExecuteBufferL() method.
-         * Allows re-implementation of the method in sub-classes.
-         *
-         * @param aResultArray Array to return statuscodes for each command.
-         * @return KErrNone if successful.
-         */
-        IMPORT_C virtual TInt DoExecuteBufferL(RArray<TInt>& aResultArray);
-        
-        /**
-         * Get datamod instance
-         * @return reference to datamod instance.
-         */
-        IMPORT_C virtual CNSmlDataModBase& GetDataMod();
-
-        /**
-         * Exports the contact in the vCard format from contacts database.
-         * @param aUid UID of the contact to be exported
-         * @param aContactBufBase Upon return includes the contents of
-         *  the exported vCard.
-         *  @return Error code.
-         */
-        IMPORT_C virtual TInt ExportContactsL( const TUid& aUid, 
-            CBufBase& aContactBufBase );
-
-        /**
-         * Imports the contact in the vCard to contacts database.
-         * @param aContactBufBase The contents of the vCards to be 
-         *  imported.
-         * @return An UID array of the contacts which were imported.
-         */
-        IMPORT_C virtual CArrayFixFlat<TUid>* ImportContactsL( 
-            const TDesC8& aContactBufBase );
-
-    protected: // data
-	
-		// MODULE DATA STRUCTURES
-		enum TNSmlDataStoreStatus  // DataStore status
-			{
-			ENSmlClosed = 1,
-			ENSmlOpenAndWaiting,
-			ENSmlItemOverflow,
-			ENSmlItemOpen,
-			ENSmlItemCreating,
-			ENSmlItemUpdating
-			};
-
-		enum TNSmlCntCommand		// Modification type
-			{
-			ENSmlCntItemAdd = 1,
-			ENSmlCntItemDelete,
-			ENSmlCntItemSoftDelete,
-			ENSmlCntItemRead,
-			ENSmlCntItemMove,
-			ENSmlCntItemReplace,
-			ENSmlCntItemFieldLevelReplace
-			};
-
-		// ------------------------------------------------------------------------------------------------
-		// Buffering Stuff for BatchMode operations
-		// ------------------------------------------------------------------------------------------------
-		class CNSmlContactsBufferItem : public CBase
-			{
-			public:	
-				/**
-				* Destructor.
-				*/
-				~CNSmlContactsBufferItem();
-				
-			public: // data
-				TSmlDbItemUid	*iPUid;			// New item ID 
-				TSmlDbItemUid	iUid;			// Item ID
-				CBufBase		*iItemData;		// Item data
-				HBufC8 			*iMimeType;		// Mimetype
-				HBufC8 			*iMimeVersion;	// Mime version
-				TNSmlCntCommand iModType;		// Commands type
-				TInt			iStatus;		// Command status
-				TInt 			iSize;			// Item size
-			};
-
-       
-    protected:
-        TRequestStatus* iCallerStatus;
-        TBool iBatchMode;
-        TNSmlCntCommand iModType;
-        TBool iOpened;
-        TBool iSyncHistory;
-        TInt64 iOpenedStoreId;
-        RPointerArray<CNSmlContactsBufferItem> iContactsBufferItemList;
-        TSmlDbItemUid *iPUid;
-        TSmlDbItemUid iUid;
-        CBufBase* iItemDataAddBatch;
-        RArray<TInt> iAddResultArray;
-        CBufBase* iItemData;
-
-        CNSmlChangeFinder* iChangeFinder;
-        TKeyArrayFix iKey;
-        TBool iSnapshotRegistered;
-		TBool iFieldLevelReplace;
-        CSmlDataStoreFormat* iStoreFormat;
-
-        TInt iServerMaxObjectSize;
-        TInt iItemPos;
-        TNSmlDataStoreStatus iState;
-
-
-        TBool iTransactionMode;
-        TInt iModificationCount;
-
-        TPtrC8 iMimeTypeItem;
-        TPtrC8 iMimeVersionItem;
-
-        TPtrC8 iUsedMimeType;
-        TPtrC8 iUsedMimeVersion;
-
-        RStringF iServerMimeType;
-        RStringF iServerMimeVersion;
-		
-        HBufC* iDefaultStoreName;
-
-        CNSmlDataModBase* iDataMod;
-		
-        RFs iRfs;
-        TInt iDrive;
-
-        TInt iItemSize;
-
-        HBufC* iStoreName;
-
-        RStringPool iStringPool;
-
-        CNSmlDataItemUidSet* iNewUids;
-        CNSmlDataItemUidSet* iDeletedUids;
-        CNSmlDataItemUidSet* iSoftDeletedUids;
-        CNSmlDataItemUidSet* iReplacedUids;
-        CNSmlDataItemUidSet* iMovedUids;
-
-        TBool iLastItem;
-        TInt iStateItem; 
-
-        CNsmlContactsDataStoreExtension* iContactsDataStoreExtension;
-
-        CArrayFixSeg<TNSmlSnapshotItem>* iSnapshot;
-        CArrayFixFlat<TUid>* iCntUidList;
-
-	};
-
-#endif // __NSMLCONTACTSDATASTORE_H__
-
-// End of File  
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/UT_nsmldummydataprovider.mmp	Tue Aug 31 15:05:37 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:  MMP file for contact adapter unit tests.
-*
-*/
-
-#include<Digia/Eunit/EUnitCaps.h>
-#include <platform_paths.hrh>
-#include <defaultcaps.hrh>
-#include <data_caging_paths.hrh>
-
-// DEFINES
-MACRO 			__NSML_MODULETEST__
-
-// Build target
-TARGET          UT_nsmldummydataprovider.dll
-TARGETTYPE      dll
-UID             0x1000af5a 0x01700000
-
-CAPABILITY      EUNIT_CAPS
-VENDORID        0x00000000
-
-#if defined(ARMCC)
-DEFFILE		./def/eabicontactsdataprovider_test
-#elif defined(WINSCW)
-DEFFILE		./def/bwinscwcontactsdataprovider_test
-#endif
-
-// Source files
-SOURCEPATH      .
-SOURCE          dllmain.cpp
-SOURCE          cnsmldummydataprovider_test.cpp
-SOURCE          cnsmldummydatastore_test.cpp
-SOURCE 			cnsmladaptertestutilities.cpp 
-SOURCE          cnsmldummydatastorewaiter.cpp
-// Code under test
-SOURCEPATH      ../DummyAdapter/src
-SOURCE          nsmldummydataprovider.cpp
-SOURCE          nsmldummydatastore.cpp
-
-// Include paths
-USERINCLUDE     . ../DummyAdapter/inc
-
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE 	/epoc32/include/ecom
-SYSTEMINCLUDE 	/epoc32/include/syncml
-SYSTEMINCLUDE	/epoc32/include/internal
-SYSTEMINCLUDE   /epoc32/include/Digia/EUnit
-
-// Dependencies to system components
-LIBRARY         euser.lib
-LIBRARY         EUnit.lib
-LIBRARY         bafl.lib
-LIBRARY         smldataprovider.lib
-LIBRARY         smlstoreformat.lib
-LIBRARY         nsmlcontactsdataprovider.lib
-LIBRARY         efsrv.lib
-LIBRARY         cntmodel.lib
-LIBRARY         estor.lib
-LIBRARY         nsmldebug.lib
-
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/bld.inf	Tue Aug 31 15:05:37 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: Build info file for DS contact adapter unit tests.
-*
-*/
-
-//#include <platform_paths.hrh>
-
-PRJ_MMPFILES
-UT_nsmldummydataprovider.mmp
-
-PRJ_EXPORTS
-testdata\standard.vcf    c:\data\testdata\standard.vcf
-testdata\basic.vcf    c:\data\testdata\basic.vcf
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmladaptertestutilities.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,329 +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:  Source code file for contact adapter test utilities.
-*
-*/
-
-#include "cnsmladaptertestutilities.h"
-#include <eunitmacros.h>
-#include <utf.h> 
-#include <cntitem.h>  // CContactCard
-#include <cntfield.h> // CContactItemField
-#include <cntfldst.h> // CContactTextField
-#include <s32mem.H>
-
-namespace
-    {
-    // EUNIT_PRINT will truncate descriptors longer than 512 characters.
-    const TInt KEunitPrintMaxLength = 512;
-    }
-
-CNSmlAdapterTestUtilities* CNSmlAdapterTestUtilities::NewL()
-    {
-    CNSmlAdapterTestUtilities* self = CNSmlAdapterTestUtilities::NewLC();
-    CleanupStack::Pop();
-    return self;
-    }
-
-CNSmlAdapterTestUtilities* CNSmlAdapterTestUtilities::NewLC()
-    {
-    CNSmlAdapterTestUtilities* self = new( ELeave ) CNSmlAdapterTestUtilities();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;    
-    }
-
-CNSmlAdapterTestUtilities::CNSmlAdapterTestUtilities()
-    {
-    }
-
-CNSmlAdapterTestUtilities::~CNSmlAdapterTestUtilities()
-    {
-    iFs.Close();
-    delete iIdArray;
-    delete iContactDatabase;
-    }
-
-void CNSmlAdapterTestUtilities::ConstructL()
-    {
-    User::LeaveIfError( iFs.Connect() );
-    }
-
-void CNSmlAdapterTestUtilities::OpenVCardFromFileLC( const TDesC& aFileName, RFileReadStream& aReadStream )
-    {
-    TInt err = aReadStream.Open( iFs, aFileName, EFileRead );
-    if (err != KErrNone)
-        {
-        if (err == KErrNotFound)
-            {
-            EUNIT_PRINT( _L("%S ,vCard file not found"), &aFileName );
-            }
-        else if ( err == KErrPathNotFound )
-            {
-            EUNIT_PRINT( _L("%S ,vCard path not found"), &aFileName );        
-            }
-        else 
-            {
-            EUNIT_PRINT( _L("%S , vCard file cannot be opened. Error code %d"), &aFileName, err );
-            }
-        User::Leave( err  );
-        }
-    EUNIT_PRINT( _L("VCard opened") );
-    CleanupClosePushL( aReadStream );
-    }
-
-HBufC* CNSmlAdapterTestUtilities::ReadVCardFromFileLC( const TDesC& aFileName )
-    {
-    HBufC8* vCard8 = ReadVCard8FromFileLC( aFileName );
-    HBufC* vCard = HBufC::NewL( vCard8->Length() ); 
-    vCard8->Des().Copy( *vCard8 );
-    CleanupStack::PopAndDestroy( vCard8 );
-    
-    CleanupStack::PushL( vCard );    
-    return vCard;
-    }
-
-HBufC8* CNSmlAdapterTestUtilities::ReadVCard8FromFileLC( const TDesC& aFileName )
-    {
-    RFileReadStream readStream;
-    OpenVCardFromFileLC(aFileName, readStream);
-    
-    const TInt fileSize = readStream.Source()->SizeL();
-    CBufFlat* buffer = CBufFlat::NewL( fileSize );
-    CleanupStack::PushL( buffer );
-
-    RBufWriteStream writeStream( *buffer );
-    CleanupClosePushL( writeStream );
-    writeStream.WriteL( readStream );
-    writeStream.CommitL();
-    
-    HBufC8* vCard8 = buffer->Ptr(0).AllocL();
-    CleanupStack::PopAndDestroy( 3, &readStream );
-    
-    CleanupStack::PushL( vCard8 );
-    return vCard8;
-    }
-
-CBufFlat* CNSmlAdapterTestUtilities::ReadBufFromFileLC( const TDesC& aFileName )
-    {
-    RFileReadStream readStream;
-    OpenVCardFromFileLC(aFileName, readStream);
-    
-    const TInt fileSize = readStream.Source()->SizeL();
-    CBufFlat* buffer = CBufFlat::NewL( fileSize );
-    CleanupStack::PushL( buffer );
-
-    RBufWriteStream writeStream( *buffer );
-    CleanupClosePushL( writeStream );
-    writeStream.WriteL( readStream );
-    writeStream.CommitL();
-    CleanupStack::PopAndDestroy( &writeStream );
-    CleanupStack::Pop( buffer );
-    CleanupStack::PopAndDestroy( &readStream );
-    CleanupStack::PushL( buffer );
-    return buffer;
-    }
-
-void CNSmlAdapterTestUtilities::SetupEmptyContactDbL( const TDesC& aDbName )
-    {
-    if( aDbName.Length() > 0 )
-        {
-        iContactDatabase = CContactDatabase::ReplaceL( aDbName );
-        }
-    else
-        {
-        iContactDatabase = CContactDatabase::OpenL();  // Use default contact DB.
-        }
-    
-    CContactIdArray* array = iContactDatabase->ContactsChangedSinceL( Time::NullTTime() );
-    CleanupStack::PushL( array );
-    iContactDatabase->DeleteContactsL(*array);        
-    CleanupStack::PopAndDestroy( array );
-    }
-
-/**
- * Setup contact DB with the following contacts
- *   + Tim Tester (id index 0)
- *   + Teddy McTest (id index 1)
- *   + Tod TestHill (id index 2)
- *   + Simon Software (id index 3)
- *   + Cyd Effect (id index 4)
- *   + Nick Name (id index 5)
- * 
- */
-void CNSmlAdapterTestUtilities::SetupAndPopulateContactDbL( const TDesC& aDbName )
-    {
-    if( aDbName.Length() > 0 )
-        {
-        iContactDatabase = CContactDatabase::ReplaceL( aDbName );
-        }
-    else
-        {
-        iContactDatabase = CContactDatabase::OpenL();  // Use default contact DB.
-        }
-    
-    iIdArray = CContactIdArray::NewL();
-
-    // Create test contacts
-    iIdArray->AddL( AddContactL( _L( "Tim" ), _L( "Tester" ), _L( "+358501234567" ) ) );
-    iIdArray->AddL( AddContactL( _L( "Teddy" ), _L("McTest" ), _L( "+358501112222" ) ) );
-    iIdArray->AddL( AddContactL( _L( "Tod" ), _L( "TestHill" ), _L( "+358506666666" ) ) );
-    iIdArray->AddL( AddContactL( _L( "Simon" ), _L( "Software" ), _L( "+3585011223333" ) ) );
-    iIdArray->AddL( AddContactL( _L( "Cyd" ), _L( "Effect" ), _L( "+358503334444" ) ) );
-    iIdArray->AddL( AddContactL( _L( "Nick" ), _L( "Name" ), _L( "+358402223333" ) ) );
-    }
-
-// Helper method to add a simple contact to test contact DB
-TContactItemId CNSmlAdapterTestUtilities::AddContactL(
-        const TDesC& aFirstName,
-        const TDesC& aLastName,
-        const TDesC& aPhoneNumber )
-    {
-    _LIT( KLabelFamilyName, "Last name");
-    _LIT( KLabelGivenName, "First name");
-    _LIT( KLabelPhone, "Phone");
-    //_LIT( KLabelNickname, "X-EPOCSECONDNAME");
-
-    CContactCard* card = CContactCard::NewLC();
-    
-    // Family name field
-    CContactItemField* familyNameField =
-        CContactItemField::NewLC( KStorageTypeText, KUidContactFieldFamilyName );
-    familyNameField->SetLabelL( KLabelFamilyName );
-    familyNameField->SetMapping( KUidContactFieldVCardMapUnusedN );
-    familyNameField->TextStorage()->SetTextL( aLastName );
-    card->AddFieldL( *familyNameField ); // Takes ownership
-    CleanupStack::Pop( familyNameField );
-    
-    // First name field
-    CContactItemField* nameField =
-    CContactItemField::NewLC( KStorageTypeText, KUidContactFieldGivenName );
-    nameField->SetLabelL( KLabelGivenName );
-    nameField->SetMapping( KUidContactFieldVCardMapUnusedN );
-    nameField->TextStorage()->SetTextL( aFirstName );
-    card->AddFieldL( *nameField );
-    CleanupStack::Pop(nameField);
-    
-    // Phone number field
-    CContactItemField* phoneField =
-        CContactItemField::NewLC( KStorageTypeText, KUidContactFieldPhoneNumber );
-    phoneField->SetLabelL( KLabelPhone );
-    phoneField->SetMapping( KUidContactFieldVCardMapTEL );
-    phoneField->TextStorage()->SetTextL( aPhoneNumber );
-    card->AddFieldL( *phoneField );
-    CleanupStack::Pop( phoneField );
-    
-    // Nickname field
-    /*if( aNickname.Length() > 0 )
-    	{
-        CContactItemField* NicknameField =
-            CContactItemField::NewLC( KStorageTypeText, KUidContactFieldSecondName );
-        NicknameField->SetLabelL( KLabelNickname );
-        NicknameField->SetMapping( KUidContactFieldVCardMapSECONDNAME );
-        NicknameField->TextStorage()->SetTextL( aNickname );
-        card->AddFieldL( *NicknameField );
-        CleanupStack::Pop( NicknameField );
-    	}*/
-
-    
-    TContactItemId cardId = iContactDatabase->AddNewContactL( *card );        
-    CleanupStack::PopAndDestroy( card );
-    
-    return cardId;
-    }
-
-/**
- * Empties the test contact DB to its initial state.
- */ 
-void CNSmlAdapterTestUtilities::TeardownAndEmptyContactDbL( const TDesC& aDbName )
-    {
-    iContactDatabase->DeleteContactsL( *iIdArray );
-    
-    delete iIdArray;
-    iIdArray = NULL;
-
-    delete iContactDatabase;
-    iContactDatabase = NULL;
-    if( aDbName.Length() > 0 )
-        {
-        TRAP_IGNORE( CContactDatabase::DeleteDatabaseL( aDbName ) );
-        }
-    }
-
-CContactDatabase* CNSmlAdapterTestUtilities::GetDb()
-    {
-    EUNIT_ASSERT( iContactDatabase );
-    return iContactDatabase;
-    }
-
-CContactIdArray* CNSmlAdapterTestUtilities::GetContactArray()
-    {
-    return iIdArray;
-    }
-
-RFs& CNSmlAdapterTestUtilities::FileSession()
-    {
-    return iFs;
-    }
-
-CBufBase* CNSmlAdapterTestUtilities::ExportContactLC( TContactItemId aId )
-    {
-    CContactDatabase* db = CContactDatabase::OpenL();  // Use default contact DB.
-    CleanupStack::PushL( db );
-    CContactIdArray* idArr = CContactIdArray::NewLC();
-    idArr->AddL( aId );
-    CBufFlat* buffer = CBufFlat::NewL( 1024 );
-    CleanupStack::PushL( buffer );
-    RBufWriteStream writeStream( *buffer );
-    CleanupClosePushL( writeStream );
-    
-    TRAPD( err, iContactDatabase->ExportSelectedContactsL( TUid::Uid(KVersitEntityUidVCard), *idArr, 
-        writeStream, CContactDatabase::EExcludeUid, Versit::EUTF8CharSet ) );
-
-    EUNIT_ASSERT_EQUALS_DESC( err, KErrNone, "ExportSelectedContactsL leave" );
-    
-    CleanupStack::PopAndDestroy( &writeStream );
-    CleanupStack::Pop( buffer );
-    CleanupStack::PopAndDestroy( idArr );
-    CleanupStack::PopAndDestroy( db );
-    CleanupStack::PushL( buffer );
-    return buffer;
-    }
-
-void CNSmlAdapterTestUtilities::PrintData( const TDesC& aTitle, CBufBase& aBuf )
-    {
-
-    EUNIT_PRINT( aTitle );
-
-    for (TInt i = 0; i < aBuf.Ptr(0).Length(); i += KEunitPrintMaxLength )
-        {
-        EUNIT_PRINT( aBuf.Ptr(i) );
-        }
-
-    }
-
-void CNSmlAdapterTestUtilities::PrintData( const TDesC8& aTitle, CBufBase& aBuf )
-    {
-
-    EUNIT_PRINT( aTitle );
-
-    for (TInt i = 0; i < aBuf.Ptr(0).Length(); i += KEunitPrintMaxLength )
-        {
-        EUNIT_PRINT( aBuf.Ptr(i) );
-        }
-
-    }
-
-
-
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmladaptertestutilities.h	Tue Aug 31 15:05:37 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:  Header file for contact adapter test utilities.
-*
-*/
-
-#ifndef CNSMLADAPTERTESTUTILITIES_H_
-#define CNSMLADAPTERTESTUTILITIES_H_
-
-#include <e32base.h>
-#include <f32file.h>
-#include <s32file.h>
-#include <cntdb.h>    // CContactDatabase
-#include <cntdef.h>   // TContactItemId 
-
-class CNSmlAdapterTestUtilities : public CBase
-    {
-    public:
-        
-        static CNSmlAdapterTestUtilities* NewL();
-        static CNSmlAdapterTestUtilities* NewLC();
-        virtual ~CNSmlAdapterTestUtilities();
-
-    private:    
-        CNSmlAdapterTestUtilities();
-        void ConstructL();
-
-    public:
-        
-        void OpenVCardFromFileLC( const TDesC& aFileName, RFileReadStream& aReadStream  );
-        HBufC* ReadVCardFromFileLC( const TDesC& aFileName );
-        HBufC8* ReadVCard8FromFileLC( const TDesC& aFileName );
-        CBufFlat* ReadBufFromFileLC( const TDesC& aFileName );
-        
-        // Setting up / Tearing down a test DB with a few contacts
-        void SetupEmptyContactDbL( const TDesC& aDbName );
-        void SetupAndPopulateContactDbL( const TDesC& aDbName );
-        void TeardownAndEmptyContactDbL( const TDesC& aDbName );
-        CContactDatabase* GetDb();
-        CContactIdArray* GetContactArray();
-        RFs& FileSession();
-        CBufBase* ExportContactLC( TContactItemId aId );
-        void PrintData( const TDesC& aTitle , CBufBase& aBuf );
-        void PrintData( const TDesC8& aTitle , CBufBase& aBuf );
-
-    public:
-        // Helper methods
-        TContactItemId AddContactL( const TDesC& aFirstName,
-                 const TDesC& aLastName,
-                 const TDesC& aPhoneNumber );
-        
-    private:    
-        RFs                 iFs;
-        CContactDatabase*   iContactDatabase;
-        CContactIdArray*    iIdArray;
-    };
-
-#endif /* CNSMLADAPTERTESTUTILITIES_H_ */
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydataprovider_test.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,341 +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:  Source code file for contact adapter's dataprovider unit tests.
-*
-*/
-
-// CLASS HEADER
-#include "cnsmldummydataprovider_test.h"
-
-// EXTERNAL INCLUDES
-#include <eunitmacros.h>
-#include <eunitdecorators.h>
-#include <s32mem.h>
-#include <nsmlconstants.h> 
-#include <smldataprovider.h>
-
-//  LOCAL DEFINITIONS
-namespace
-    {
-    // Note: Currently "symbian" is used as default DB name. Earlier 
-    // was set to "C:Contacts.cdb"
-    _LIT( KDefaultDBName, "symbian" );
-    }
-
-
-
-// - Construction -----------------------------------------------------------
-
-CNSmlDummyDataProvider_Test* CNSmlDummyDataProvider_Test::NewL()
-    {
-    CNSmlDummyDataProvider_Test* self = CNSmlDummyDataProvider_Test::NewLC();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-CNSmlDummyDataProvider_Test* CNSmlDummyDataProvider_Test::NewLC()
-    {
-    CNSmlDummyDataProvider_Test* self = new( ELeave ) CNSmlDummyDataProvider_Test();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-CNSmlDummyDataProvider_Test::~CNSmlDummyDataProvider_Test()
-    {
-    }
-
-CNSmlDummyDataProvider_Test::CNSmlDummyDataProvider_Test()
-    {
-    }
-
-void CNSmlDummyDataProvider_Test::ConstructL()
-    {
-    CEUnitTestSuiteClass::ConstructL();
-    }
-
-
-// - Setup & Teardown ---------------------------------------------------------
-
-void CNSmlDummyDataProvider_Test::SetupL()
-    {
-    iCNSmlDummyDataProvider = CNSmlDummyDataProvider::NewL();
-    }
-    
-void CNSmlDummyDataProvider_Test::Teardown()
-    {
-    delete iCNSmlDummyDataProvider;
-    iCNSmlDummyDataProvider = NULL;
-    }   
-
-// - Actual test methods ------------------------------------------------------
-
-void CNSmlDummyDataProvider_Test::NewLL(  )
-    {
-    CNSmlDummyDataProvider* provider = CNSmlDummyDataProvider::NewL();
-    EUNIT_ASSERT( provider );
-    delete provider;
-    }
-
-void CNSmlDummyDataProvider_Test::CreateAdapterL()
-    {
-    // Platform's Contact Adapter Uid
-    TSmlDataProviderId id = { 0x101F6DDD };
-
-    CSmlDataProvider* dp = CSmlDataProvider::NewL( id );
-    CSmlDataStore* store = dp->NewStoreInstanceLC();
-    EUNIT_ASSERT( store );
-    CleanupStack::PopAndDestroy( store );
-    TBool operation = dp->SupportsOperation( KUidSmlSupportBatch );
-    EUNIT_ASSERT( operation );
-    operation = dp->SupportsOperation( KUidSmlSupportMultipleStores );
-    EUNIT_ASSERT( operation );
-    operation = dp->SupportsOperation( KUidSmlSupportSuspendResume );
-    EUNIT_ASSERT( !operation );
-    TPtrC storeName = dp->DefaultStoreL();
-    EUNIT_ASSERT( dp->DefaultStoreL().Compare( KDefaultDBName ) == 0 );
-    const CSmlDataStoreFormat& format = dp->StoreFormatL();
-    EUNIT_ASSERT( format.DisplayName().Compare( _L("Contacts") ) == 0 );
-    EUNIT_PRINT( format.DisplayName() );
-    delete dp;
-    }
-
-void CNSmlDummyDataProvider_Test::GetStoreFormatResourceFileLL()
-    {
-    const TDesC& resourceFile = iCNSmlDummyDataProvider->GetStoreFormatResourceFileL();
-    EUNIT_PRINT( resourceFile );
-    }
-
-void CNSmlDummyDataProvider_Test::DoStoreFormatLL()
-    {
-    const CSmlDataStoreFormat& storeFormat = iCNSmlDummyDataProvider->DoStoreFormatL();
-    EUNIT_PRINT( storeFormat.DisplayName() );
-    EUNIT_PRINT( _L("Property count %d"), storeFormat.FolderPropertyCount() );
-    CBufFlat* store = CBufFlat::NewL( 512 );
-    CleanupStack::PushL( store );
-    RBufWriteStream writeStream(*store, 0);
-    CleanupClosePushL( writeStream );
-    storeFormat.ExternalizeL( writeStream );
-    CleanupStack::PopAndDestroy( 2, store );
-    }
-
-void CNSmlDummyDataProvider_Test::TestStoreSupportForPartialSyncL()
-    {
-    const CSmlDataStoreFormat& storeFormat = iCNSmlDummyDataProvider->DoStoreFormatL();
-    EUNIT_ASSERT_EQUALS( storeFormat.MimeFormatCount(), 1 );
-    EUNIT_ASSERT( !storeFormat.MimeFormat(0).FieldLevel() );
-    }
-
-void CNSmlDummyDataProvider_Test::TestStoreSupportMimeTypeL()
-    {
-    _LIT8( KNSmlvCard21Name, "text/x-vcard" );
-    _LIT8( KNSmlvCard21Ver, "2.1" );
-
-    const CSmlDataStoreFormat& storeFormat = iCNSmlDummyDataProvider->DoStoreFormatL();
-    EUNIT_ASSERT_EQUALS( storeFormat.MimeFormatCount() ,1 );
-    EUNIT_ASSERT_EQUALS( storeFormat.MimeFormat(0).MimeType().DesC(), KNSmlvCard21Name() );
-    EUNIT_ASSERT_EQUALS( storeFormat.MimeFormat(0).MimeVersion().DesC(), KNSmlvCard21Ver() );
-    }
-
-void CNSmlDummyDataProvider_Test::DoListStoresLCL()
-    {
-    CDesCArray* store = iCNSmlDummyDataProvider->DoListStoresLC();
-    TPtrC ptrStoreName = ( *store )[ 0 ];
-    EUNIT_PRINT( ptrStoreName );
-    EUNIT_ASSERT( ptrStoreName.Compare( KDefaultDBName ) == 0 );
-    CleanupStack::PopAndDestroy( store );
-    }
-
-void CNSmlDummyDataProvider_Test::DoOnFrameworkEvent()
-    {
-    iCNSmlDummyDataProvider->DoOnFrameworkEvent( TSmlFrameworkEvent( 0 ), 0, 0 );
-    }
-
-void CNSmlDummyDataProvider_Test::DoSupportedServerFiltersL()
-    {
-    RPointerArray< CSyncMLFilter > filterArray;
-    filterArray = iCNSmlDummyDataProvider->DoSupportedServerFiltersL();
-    filterArray.ResetAndDestroy();
-    filterArray.Close();
-    }
-
-void CNSmlDummyDataProvider_Test::DoCheckSupportedServerFiltersL()
-    {
-    const CSmlDataStoreFormat& storeFormat =
-        iCNSmlDummyDataProvider->DoStoreFormatL();
-    RPointerArray< CSyncMLFilter >* filters = 
-        new ( ELeave ) RPointerArray< CSyncMLFilter >();
-    CleanupRPtrArrayPushL( filters );
-    TSyncMLFilterChangeInfo changeInfo( ESyncMLDefault );
-
-    TRAPD( err, iCNSmlDummyDataProvider->DoCheckSupportedServerFiltersL(
-        storeFormat, *filters, changeInfo ) );
-
-    EUNIT_ASSERT( err == KErrNotSupported );
-    CleanupStack::PopAndDestroy( filters ); 
-    }
-
-void CNSmlDummyDataProvider_Test::DoCheckServerFiltersL()
-    {
-    RPointerArray< CSyncMLFilter >* filters = 
-        new ( ELeave ) RPointerArray< CSyncMLFilter >();
-    CleanupRPtrArrayPushL( filters );
-    TSyncMLFilterChangeInfo changeInfo( ESyncMLDefault );
-
-    TRAPD( err, iCNSmlDummyDataProvider->DoCheckServerFiltersL( 
-        *filters, changeInfo ) );
-
-    EUNIT_ASSERT( err == KErrNotSupported );  
-    CleanupStack::PopAndDestroy( filters ); 
-    }
-
-void CNSmlDummyDataProvider_Test::DoGenerateRecordFilterQueryL()
-    {
-    RPointerArray< CSyncMLFilter >* filters = 
-        new ( ELeave ) RPointerArray< CSyncMLFilter >();
-    CleanupRPtrArrayPushL( filters );
-    TSyncMLFilterMatchType matchType( ESyncMLMatchDisabled );
-    TSyncMLFilterType filterType( ESyncMLTypeInclusive );
-    TBuf< 100 > mimeType;
-
-    TRAPD( err, { 
-        HBufC* storeName =  NULL;
-        HBufC* record = NULL;
-        record = iCNSmlDummyDataProvider->DoGenerateRecordFilterQueryLC( 
-        *filters, matchType, mimeType, filterType, *storeName );
-        delete record; 
-        delete storeName;
-        }
-        );
-    EUNIT_ASSERT( err == KErrNotSupported );
-
-    CleanupStack::PopAndDestroy( ); //filters
-    }
-
-void CNSmlDummyDataProvider_Test::DoGenerateFieldFilterQueryL()
-    {
-    RPointerArray< CSyncMLFilter >* filters =
-        new ( ELeave ) RPointerArray< CSyncMLFilter >();
-    CleanupRPtrArrayPushL( filters );
-    RPointerArray< CSmlDataProperty > properties; 
-    CleanupStack::PushL( PtrArrCleanupItemRArr( CSmlDataProperty, &properties ) );
-    TBuf<100> mimeType;
-    HBufC* storeName = NULL;
-    TRAPD( err, iCNSmlDummyDataProvider->DoGenerateFieldFilterQueryL( 
-        *filters, mimeType, properties, *storeName ) );
-    EUNIT_ASSERT( err == KErrNotSupported );
-    delete storeName;
-    CleanupStack::PopAndDestroy( 2 ); //filters, properties
-    }
-
-
-// - EUnit test table -------------------------------------------------------
-
-EUNIT_BEGIN_TEST_TABLE(
-    CNSmlDummyDataProvider_Test,
-    "Unit test for Contacts dataprovider.",
-    "UNIT" )
-
-EUNIT_TEST(
-    "Verify memory allocation for DataProvider object",
-    "CNSmlDummyDataProvider",
-    "NewL",
-    "FUNCTIONALITY",
-    SetupL, NewLL, Teardown)
-
-EUNIT_TEST(
-    "Test to create contact adapter and few other atapter methods",
-    "CNSmlCmtContactsDataProvider",
-    "",
-    "FUNCTIONALITY",
-    Empty, CreateAdapterL, Empty)
-
-EUNIT_TEST(
-    "Test for GetStoreFormatResourceFileL",
-    "CNSmlCmtContactsDataProvider_Test",
-    "GetStoreFormatResourceFileL",
-    "FUNCTIONALITY",
-    SetupL, GetStoreFormatResourceFileLL, Teardown )
-
-EUNIT_TEST(
-    "Test to verify DoStoreFormatL function",
-    "CNSmlCmtContactsDataProvider_Test",
-    "DoStoreFormatL",
-    "FUNCTIONALITY",
-    SetupL, DoStoreFormatLL, Teardown )
-
-EUNIT_TEST(
-    "Test DataStore support for field level partial sync",
-    "CNSmlCmtContactsDataProvider_Test",
-    "",
-    "FUNCTIONALITY",
-    SetupL, TestStoreSupportForPartialSyncL, Teardown )
-
-EUNIT_TEST(
-    "Verify operator specific MIME type",
-    "CNSmlDummyDataProvider_Test",
-    "",
-    "FUNCTIONALITY",
-    SetupL, TestStoreSupportMimeTypeL, Teardown )
-
-EUNIT_TEST(
-    "Verify method DoListStoresLCL return value",
-    "CNSmlDummyDataProvider_Test",
-    "DoListStoresLCL",
-    "FUNCTIONALITY",
-    SetupL, DoListStoresLCL, Teardown )
-
-EUNIT_TEST(
-    "Test DoOnFrameworkEvent",
-    "CNSmlDummyDataProvider_Test",
-    "DoOnFrameworkEvent",
-    "FUNCTIONALITY",
-    SetupL, DoOnFrameworkEvent, Teardown )
-
-EUNIT_TEST(
-    "Test DoSupportedServerFiltersL",
-    "CNSmlDummyDataProvider_Test",
-    "DoSupportedServerFiltersL",
-    "FUNCTIONALITY",
-    SetupL, DoSupportedServerFiltersL, Teardown )
-
-EUNIT_TEST(
-    "Test DoCheckSupportedServerFiltersL",
-    "CNSmlDummyDataProvider_Test",
-    "DoCheckSupportedServerFiltersL",
-    "FUNCTIONALITY",
-    SetupL, DoCheckSupportedServerFiltersL, Teardown )
-
-EUNIT_TEST(
-    "Test DoCheckServerFiltersL",
-    "CNSmlDummyDataProvider_Test",
-    "DoCheckServerFiltersL",
-    "FUNCTIONALITY",
-    SetupL, DoCheckServerFiltersL, Teardown )
-
-EUNIT_TEST(
-    "Test DoGenerateRecordFilterQueryL",
-    "CNSmlDummyDataProvider_Test",
-    "DoGenerateRecordFilterQueryL",
-    "FUNCTIONALITY",
-    SetupL, DoGenerateRecordFilterQueryL, Teardown )
-
-EUNIT_TEST(
-    "Test DoGenerateFieldFilterQueryL",
-    "CNSmlDummyDataProvider_Test",
-    "DoGenerateFieldFilterQueryL",
-    "FUNCTIONALITY",
-    SetupL, DoGenerateFieldFilterQueryL, Teardown )
-
-EUNIT_END_TEST_TABLE
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydataprovider_test.h	Tue Aug 31 15:05:37 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:  Header file for contact adapter's dataprovider unit tests.
-*
-*/
-
-#ifndef __CNSMLDUMMYDATAPROVIDER_TEST_H__
-#define __CNSMLDUMMYDATAPROVIDER_TEST_H__
-
-// INCLUDES
-#include <ceunittestsuiteclass.h>
-#include <eunitdecorators.h>
-
-#include "nsmldummydataprovider.h"
-
-// CLASS DEFINITION
-/**
- * Generated EUnit test suite class.
- */
-NONSHARABLE_CLASS( CNSmlDummyDataProvider_Test )
-	: public CEUnitTestSuiteClass
-    {
-    public:  // Constructors and destructor
-
-        static CNSmlDummyDataProvider_Test* NewL();
-        static CNSmlDummyDataProvider_Test* NewLC();
-        ~CNSmlDummyDataProvider_Test();
-
-    private: // Constructors
-
-        CNSmlDummyDataProvider_Test();
-        void ConstructL();
-
-    private: // New methods
-
-        void Empty() {};
-
-        void SetupL();
-
-        void Teardown();
-
-        void NewLL();
-        
-        void CreateAdapterL();
-
-        void GetStoreFormatResourceFileLL();
-
-        void DoStoreFormatLL();
-
-        void TestStoreSupportForPartialSyncL();
-
-        void TestStoreSupportMimeTypeL();
-
-        void DoListStoresLCL();
-        
-        void DoOnFrameworkEvent();
-        
-        void DoSupportedServerFiltersL();
-        
-        void DoCheckSupportedServerFiltersL();
-        
-        void DoCheckServerFiltersL();
-        
-        void DoGenerateRecordFilterQueryL();
-        
-        void DoGenerateFieldFilterQueryL();
-
-    private: // Data
-
-        CNSmlDummyDataProvider* iCNSmlDummyDataProvider;
-
-        EUNIT_DECLARE_TEST_TABLE;
-
-    };
-
-#endif      //  __CNSMLDUMMYDATAPROVIDER_TEST_H__
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydatastore_test.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1020 +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:  Source code file for contact adapter's datastore unit tests.
-*
-*/
-
-// CLASS HEADER
-#include "cnsmldummydatastore_test.h"
-
-// EXTERNAL INCLUDES
-#include <eunitmacros.h>
-#include <eunitdecorators.h>
-#include <cntdb.h>
-#include <cntitem.h>
-#include <cntfield.h>
-#include <cntfldst.h>
-#include <s32mem.h>
-#include <bautils.h>
-#include <smldataformat.h>
-
-// INTERNAL INCLUDES
-#include "cnsmladaptertestutilities.h"
-#include "nsmldummydatastore.h"
-#include "cnsmldummydatastorewaiter.h"
-
-namespace
-    {
-    // "abld test export" will export test data.
-    _LIT( KVCardStandard, "c:\\Data\\TestData\\standard.vcf" );
-    _LIT( KVCardBasic, "c:\\Data\\TestData\\basic.vcf" );
-    }
-
-// - Construction -----------------------------------------------------------
-
-CNSmlDummyDataStore_Test* CNSmlDummyDataStore_Test::NewL()
-    {
-    CNSmlDummyDataStore_Test* self = CNSmlDummyDataStore_Test::NewLC();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-CNSmlDummyDataStore_Test* CNSmlDummyDataStore_Test::NewLC()
-    {
-    CNSmlDummyDataStore_Test* self = new( ELeave ) CNSmlDummyDataStore_Test();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-CNSmlDummyDataStore_Test::~CNSmlDummyDataStore_Test()
-    {
-    iWriteStream.Close();
-    iFsSession.Close();
-    delete iCNSmlDummyDataStore;
-    delete iTestUtilities;
-    delete iContactDatabase;
-    delete iIdArray;
-    delete iStoreWaiter;
-    }
-
-CNSmlDummyDataStore_Test::CNSmlDummyDataStore_Test()
-    {
-    }
-
-void CNSmlDummyDataStore_Test::ConstructL()
-    {
-    CEUnitTestSuiteClass::ConstructL();
-    User::LeaveIfError( iFsSession.Connect() );
-    }
-
-// from MSmlSyncRelationship
-TSmlSyncTaskKey CNSmlDummyDataStore_Test::SyncTaskKey() const
-    {
-    TSmlSyncTaskKey key = 0;
-    return key;
-    }
-
-void CNSmlDummyDataStore_Test::OpenReadStreamLC(
-        RReadStream& /*aReadStream*/, TUid /*aStreamUid*/)
-    {
-    }
-
-void CNSmlDummyDataStore_Test::OpenWriteStreamLC(
-        RWriteStream& aWriteStream, TUid /*aStreamUid*/ )
-    {
-    User::LeaveIfError(
-            iWriteStream.Replace( iFsSession, _L("store.test"), EFileWrite  ) );
-    aWriteStream = iWriteStream;
-    CleanupClosePushL( aWriteStream );
-    }
-
-TBool CNSmlDummyDataStore_Test::IsStreamPresentL(TUid /*aStreamUid*/) const
-    {
-    return EFalse;
-    }
-
-// - Setup & teardown ---------------------------------------------------------
-
-// ++++++++++++ SETUP METHODS ++++++++++++
-
-void CNSmlDummyDataStore_Test::SetupL(  )
-    {
-    iCNSmlDummyDataStore = CNSmlDummyDataStore::NewL();
-    iTestUtilities = CNSmlAdapterTestUtilities::NewL();
-    }
-
-void CNSmlDummyDataStore_Test::SetupAndOpenStoreL(  )
-    {
-    SetupL();
-
-    iStoreWaiter =
-        CNSmlDummyDataStoreWaiter::NewL( *iCNSmlDummyDataStore );
-    iStoreWaiter->OpenStoreL( *this );
-
-    iContactDatabase = CContactDatabase::OpenL();
-    }
-
-void CNSmlDummyDataStore_Test::SetupPopulateDbAndOpenStoreL()
-    {
-    SetupAndPopulateContactDbL();
-
-    EUNIT_ASSERT_NO_LEAVE(
-    iCNSmlDummyDataStore = CNSmlDummyDataStore::NewL() );
-
-    iStoreWaiter =
-        CNSmlDummyDataStoreWaiter::NewL( *iCNSmlDummyDataStore );
-    iStoreWaiter->OpenStoreL( *this );
-    }
-
-/**
- * Setup contact DB with the following contacts
- *   + Tim Tester (id index 0)
- *   + Teddy McTest (id index 1)
- *   + Tod TestHill (id index 2)
- *   + Simon Software (id index 3)
- *   + Cyd Effect (id index 4)
- *
- */
-void CNSmlDummyDataStore_Test::SetupAndPopulateContactDbL()
-    {
-    if( !iContactDatabase )
-        {
-        iContactDatabase = CContactDatabase::OpenL();
-        }
-    if( !iTestUtilities )
-        {
-        iTestUtilities = CNSmlAdapterTestUtilities::NewL();
-        }
-
-    iIdArray = CContactIdArray::NewL();
-
-    // Create test contacts
-    iIdArray->AddL( AddContactL( _L( "Tim" ), _L( "Tester" ), _L( "+358501234567" ) ) );
-    iIdArray->AddL( AddContactL( _L( "Teddy" ), _L("McTest" ), _L( "+358501112222" ) ) );
-    iIdArray->AddL( AddContactL( _L( "Tod" ), _L( "TestHill" ), _L( "+358506666666" ) ) );
-    iIdArray->AddL( AddContactL( _L( "Simon" ), _L( "Software" ), _L( "+3585011223333" ) ) );
-    iIdArray->AddL( AddContactL( _L( "Cyd" ), _L( "Effect" ), _L( "+358503334444" ) ) );
-    }
-
-//// ++++++++++++ TEARDOWN METHODS ++++++++++++
-//
-void CNSmlDummyDataStore_Test::Teardown()
-    {
-    delete iCNSmlDummyDataStore;
-    iCNSmlDummyDataStore = NULL;
-
-    delete iTestUtilities;
-    iTestUtilities = NULL;
-    }
-
-void CNSmlDummyDataStore_Test::TeardownAndCloseStore()
-    {
-    delete iStoreWaiter;
-    iStoreWaiter = NULL;
-
-    delete iContactDatabase;
-    iContactDatabase = NULL;
-
-    Teardown();
-    }
-
-void CNSmlDummyDataStore_Test::TeardownCloseAndEmptyContactDb()
-    {
-    delete iStoreWaiter;
-    iStoreWaiter = NULL;
-
-    delete iCNSmlDummyDataStore;
-    iCNSmlDummyDataStore = NULL;
-
-    TeardownAndEmptyContactDb();
-    }
-
-void CNSmlDummyDataStore_Test::TeardownAndEmptyContactDb()
-    {
-    if (iContactDatabase && iIdArray)
-        {
-        TRAP_IGNORE( iContactDatabase->DeleteContactsL( *iIdArray ) );
-        }
-    
-    delete iIdArray;
-    iIdArray = NULL;
-    delete iContactDatabase;
-    iContactDatabase = NULL;
-    delete iTestUtilities;
-    iTestUtilities = NULL;
-    }
-
-    
-// - Test methods -------------------------------------------------------------
-
-// MEMORY ALLOCATION FOR DATASTORE
-void CNSmlDummyDataStore_Test::NewLL(  )
-    {
-    CNSmlDummyDataStore* dataStore = NULL;
-    EUNIT_ASSERT_NO_LEAVE( dataStore = CNSmlDummyDataStore::NewL() );
-    EUNIT_ASSERT( dataStore );
-    delete dataStore;
-    }
-
-// DoOpenL()
-void CNSmlDummyDataStore_Test::DoOpenLL()
-    {
-    CNSmlDummyDataStoreWaiter* storeWaiter =
-        CNSmlDummyDataStoreWaiter::NewLC( *iCNSmlDummyDataStore );
-
-    TRAPD( err, storeWaiter->OpenStoreL( *this ) );
-
-    // Check for leave
-    EUNIT_PRINT( _L( "Leave code: %d" ), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoOpenL() leave" );
-    CleanupStack::PopAndDestroy( storeWaiter );
-    }
-
-// DoHasSyncHistory()
-void CNSmlDummyDataStore_Test::DoHasSyncHistoryL()
-    {
-    TBool ret = iCNSmlDummyDataStore->DoHasSyncHistory();
-    EUNIT_ASSERT_DESC( ret == EFalse, "DoHasSyncHistory returns faulty value");
-    }
-
-// DoModifiedItems(), DoCommitChangeInfoL()
-void CNSmlDummyDataStore_Test::DoModifiedItemsL()
-    {
-    const MSmlDataItemUidSet& uiSet = iCNSmlDummyDataStore->DoModifiedItems();
-    EUNIT_ASSERT_DESC( uiSet.ItemCount() == 0, "DoModifiedItems returns faulty uid set");
-
-    TInt returnCode = KErrNone;
-
-    TRAPD( err, returnCode = iStoreWaiter->DoCommitChangeInfoL( uiSet ) );
-
-    // Check for leave
-    EUNIT_PRINT( _L( "Leave code: %d" ), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitChangeInfoL() leave" );
-
-    // Check for return code
-    EUNIT_PRINT( _L( "Return code: %d" ), returnCode );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitChangeInfoL returns error");
-    }
-
-// DoResetChangeInfoL()
-void CNSmlDummyDataStore_Test::DoResetChangeInfoLL()
-    {
-    TInt returnCode = KErrNone;
-    TRAPD( err, returnCode = iStoreWaiter->DoResetChangeInfoL() );
-
-    // Check for leave
-    EUNIT_PRINT( _L( "Leave code: %d" ), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoResetChangeInfoL() leave" );
-
-    // Check for return code
-    EUNIT_PRINT( _L( "Return code: %d" ), returnCode );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoResetChangeInfoL returns error");
-    }
-
-// DoCommitChangeInfoL()
-void CNSmlDummyDataStore_Test::DoCommitChangeInfoLL()
-    {
-    TInt returnCode = KErrNone;
-    TRAPD( err, returnCode = iStoreWaiter->DoCommitChangeInfoL() );
-
-    // Check for leave
-    EUNIT_PRINT( _L( "Leave code: %d" ), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitChangeInfoL() leave" );
-
-    // Check for return code
-    EUNIT_PRINT( _L( "Return code: %d" ), returnCode );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitChangeInfoL returns error");
-    }
-
-// Item addition - "Normal" (non-batch) mode
-//  (DoCreateItemL(), DoWriteItemL(), DoCommitItemL(), LdoAddItemL())
-void CNSmlDummyDataStore_Test::AddSingleItemL()
-    {
-    TBuf8< 20 > type;
-    TBuf8< 20 > ver = KNSmlvCard21Ver();
-    TInt returnCode = KErrNone;
-    iItemUid = KNullContactId;
-
-    // Try creating contact with illegal MIME type
-    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 1") );
-    TRAPD( err, returnCode = iStoreWaiter->DoCreateItemL(
-        iItemUid, 0, type, ver ) );
-
-    EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( returnCode == KErrNotSupported,
-        "DoCreateItemL() accepts illegal MIME" );
-
-    // Create legal contact
-    type = KNSmlvCard21Name();
-    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 2") );
-    TRAP( err, returnCode = iStoreWaiter->DoCreateItemL(
-        iItemUid, 512, type, ver ) );
-
-    EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error");
-
-    // Perform item writing to data store
-    HBufC8* vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasic() );
-    EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 3") );
-    // Non-async call (no need for iStoreWaiter usage)
-    TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
-    EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
-    CleanupStack::PopAndDestroy( vCard );
-
-    // Commit the contact to be created
-    EUNIT_PRINT( _L("Calling DoCommmitItemL(), STEP 4") );
-    TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
-
-    EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitItemL returns error");
-
-    // Check the imported item
-    EUNIT_ASSERT_DESC( iItemUid != KNullContactId, "Illegal UID for imported contact" );
-    EUNIT_PRINT( _L("Item ID: %d"), iItemUid );
-
-    // Print out the imported vCard
-    CContactIdArray* idArr = CContactIdArray::NewLC();
-    idArr->AddL( iItemUid );
-    CBufFlat* buffer = CBufFlat::NewL( 1024 );
-    CleanupStack::PushL( buffer );
-    RBufWriteStream writeStream( *buffer );
-    CleanupClosePushL( writeStream );
-
-    TRAP( err, iContactDatabase->ExportSelectedContactsL( TUid::Uid(KVersitEntityUidVCard), *idArr,
-        writeStream, CContactDatabase::EExcludeUid, Versit::EUTF8CharSet ) );
-
-    EUNIT_ASSERT_EQUALS_DESC( err, KErrNone, "ExportSelectedContactsL leave" );
-
-    CleanupStack::PopAndDestroy( &writeStream );
-
-    EUNIT_PRINT( buffer->Ptr( 0 ) );
-
-    // Do some asserts
-    EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("N:Smith;John") ) != KErrNotFound );
-    EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("TITLE:Boss") ) != KErrNotFound );
-
-    CleanupStack::PopAndDestroy( 2, idArr );  // buffer, idArr
-
-    // Do cleanup (remove added contact)
-    CContactIdArray* tmpArray = CContactIdArray::NewLC();
-    tmpArray->AddL( iItemUid );
-    TRAP_IGNORE( iContactDatabase->DeleteContactsL( *tmpArray ) );
-    CleanupStack::PopAndDestroy( tmpArray );
-    }
-
-// Item addition - Batch mode
-// (LdoAddItemsL())
-void CNSmlDummyDataStore_Test::AddItemBatchL()
-    {
-    TBuf8<20> type = KNSmlvCard21Name();
-    TBuf8<20> ver = KNSmlvCard21Ver();
-    TInt returnCode = KErrNone;
-    HBufC8* vCard = NULL;
-
-    // DoBeginBatchL()
-    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 1") );
-    TRAPD( err, iCNSmlDummyDataStore->DoBeginBatchL() );
-    EUNIT_PRINT( _L( "DoBeginBatchL(): leave code: %d" ), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoBeginBatchL() leave" );
-
-    // == == CONTACT ITEM NO 1 == ==
-    vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasic() );
-    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 2") );
-    TRAP( err, returnCode = iStoreWaiter->DoCreateItemL(
-        iItemUid, vCard->Size(), type, ver ) );
-
-    EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error");
-
-    // Perform item writing to data store
-    EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 3") );
-    // Non-async call (no need for iStoreWaiter usage)
-    TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
-    EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
-    CleanupStack::PopAndDestroy( vCard );
-    vCard = NULL;
-
-    // Commit the contact to be created
-    EUNIT_PRINT( _L("Calling DoCommitItemL(), STEP 4") );
-    TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
-
-    EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitItemL returns error");
-
-    // Commit batch
-    RArray<TInt> array;
-    EUNIT_PRINT( _L("Calling DoCommitBatchL(), STEP 5") );
-    TRAP( err, returnCode = iStoreWaiter->DoCommitBatchL( array ) );
-
-    EUNIT_PRINT( _L( "DoCommitBatchL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitBatchL() leave" );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitBatchL returns error" );
-
-    // Verify results
-    for( TInt i = 0; i < array.Count(); i++ )
-        {
-        EUNIT_PRINT( _L( "Contact: %d, Error code: %d "), i, array[ i ] );
-        EUNIT_ASSERT( array[ i ] == KErrNone );
-        }
-    EUNIT_ASSERT_DESC( array.Count() == 1, "Wrong number of contacts added" );
-    EUNIT_PRINT( _L("Item 1 ID = %d"), iItemUid );
-
-    // Cleanup
-    array.Reset();
-    array.Close();
-
-    CContactIdArray* tmpArray = CContactIdArray::NewLC();
-    tmpArray->AddL( iItemUid );
-    TRAP_IGNORE( iContactDatabase->DeleteContactsL( *tmpArray ) );
-    CleanupStack::PopAndDestroy( tmpArray );
-    }
-
-// Item addition - cancel Batch mode 
-void CNSmlDummyDataStore_Test::CancelBatchL()
-    {
-    TBuf8<20> type = KNSmlvCard21Name();
-    TBuf8<20> ver = KNSmlvCard21Ver();
-    TInt returnCode = KErrNone;
-    HBufC8* vCard = NULL;
-
-    // DoBeginBatchL()
-    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 1") );
-    TRAPD( err, iCNSmlDummyDataStore->DoBeginBatchL() );
-    EUNIT_PRINT( _L( "DoBeginBatchL(): leave code: %d" ), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoBeginBatchL() leave" );
-
-    // == == CONTACT ITEM NO 1 == ==
-    vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasic() );
-    EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 2") );
-    TRAP( err, returnCode = iStoreWaiter->DoCreateItemL(
-        iItemUid, vCard->Size(), type, ver ) );
-
-    EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error");
-
-    // Perform item writing to data store
-    EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 3") );
-    // Non-async call (no need for iStoreWaiter usage)
-    TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
-    EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
-    CleanupStack::PopAndDestroy( vCard );
-    vCard = NULL;
-
-    // Cancel Batch
-    EUNIT_PRINT( _L("Calling DoCancelBatch(), STEP 4") );
-    iStoreWaiter->DoCancelBatch();
-    }
-
-// DoOpenItemL(), DoReadItemL(), DoCloseItemL()
-//  (LdoFetchItemL())
-void CNSmlDummyDataStore_Test::FetchItemL()
-    {
-    TBuf8<20> type;
-    TBuf8<20> ver;
-    TInt returnCode = KErrNone;
-    TInt size = 0;
-    TSmlDbItemUid parentId = KNullContactId;
-    TBool fieldChange = EFalse;
-
-    // Open item ("Tim Tester") for reading
-    EUNIT_PRINT( _L("Calling DoOpenItemL()") );
-
-    //Make some preparations:
-    // (a) Set remote store format; needed by StripTxL()
-    //      - Otherwise we get access violation
-    EUNIT_ASSERT( iCNSmlDummyDataStore->iStoreFormat );
-    iCNSmlDummyDataStore->DoSetRemoteStoreFormatL(
-        *(iCNSmlDummyDataStore->iStoreFormat) );
-
-    TRAPD( err, returnCode = iStoreWaiter->DoOpenItemL(
-        ( *iIdArray )[ 0 ], fieldChange, size, parentId, type, ver ) );
-
-    EUNIT_PRINT( _L( "DoOpenItemL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoOpenItemL() leave" );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoOpenItemL returns error");
-
-    // Execute some asserts to verify functionality
-    EUNIT_PRINT( _L( "DoOpenItemL(): size: %d" ),
-            size );
-    EUNIT_ASSERT_DESC( size != 0, "Illegal size value" );
-    EUNIT_ASSERT_DESC( parentId == KNullDataItemId, "Wrong parent ID" );
-    EUNIT_ASSERT_DESC( type.Compare( KNSmlvCard21Name() ) == 0,
-        "Illegal MIME type" );
-    EUNIT_ASSERT_DESC( ver.Compare( KNSmlvCard21Ver() ) == 0,
-        "Illegal MIME version" );
-
-    // Read the item contents (i.e. vCard)
-    HBufC8* vCard = HBufC8::NewLC( 86 );
-    TPtr8 vCardPtr = vCard->Des();
-    EUNIT_ASSERT_NO_LEAVE( iCNSmlDummyDataStore->DoReadItemL( vCardPtr ) );
-
-    EUNIT_PRINT( *vCard );
-    EUNIT_ASSERT( vCard->Find( _L8("N:Tester;Tim") ) != KErrNotFound );
-    EUNIT_ASSERT( vCard->Find( _L8("TEL:+358501234567") ) != KErrNotFound );
-
-    CleanupStack::PopAndDestroy( vCard );
-
-    // Close the contact item
-    iCNSmlDummyDataStore->DoCloseItem();
-    }
-
-// Update a standard contact
-//  (DoReplaceItemL(), ExecuteBufferL()...)
-void CNSmlDummyDataStore_Test::UpdateItemL()
-    {
-    TInt returnCode = KErrNone;
-    TSmlDbItemUid parentId = KNullContactId;
-    TBool fieldChange = EFalse;
-
-    HBufC8* vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardStandard() );
-
-    // Update "Tim Tester" contact
-    TRAPD( err, returnCode = iStoreWaiter->DoReplaceItemL(
-        ( *iIdArray )[ 0 ], vCard->Size(), parentId, fieldChange ) );
-
-    EUNIT_PRINT( _L( "DoReplaceItemL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoReplaceItemL() leave" );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoReplaceItemL returns error");
-
-    // Perform item writing to data store
-    EUNIT_PRINT( _L("Calling DoWriteItemL()") );
-    TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
-    EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoWriteItemL() leave" );
-    CleanupStack::PopAndDestroy( vCard );
-
-    // Commit the contact to be created
-    EUNIT_PRINT( _L("Calling DoCommmitItemL()") );
-    TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
-
-    EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitItemL returns error");
-
-    // Print out the imported vCard
-    CContactIdArray* idArr = CContactIdArray::NewLC();
-    idArr->AddL( ( *iIdArray )[ 0 ] );
-    CBufFlat* buffer = CBufFlat::NewL( 1024 );
-    CleanupStack::PushL( buffer );
-    RBufWriteStream writeStream( *buffer );
-    CleanupClosePushL( writeStream );
-
-    TRAP( err, iContactDatabase->ExportSelectedContactsL(
-        TUid::Uid(KVersitEntityUidVCard), *idArr,
-        writeStream, CContactDatabase::EExcludeUid, Versit::EUTF8CharSet ) );
-
-    EUNIT_ASSERT_EQUALS_DESC( err, KErrNone, "ExportSelectedContactsL leave" );
-
-    CleanupStack::PopAndDestroy( &writeStream );
-
-    EUNIT_PRINT( buffer->Ptr( 0 ) );
-
-    // Do some asserts
-    EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("N:Smith;John") ) != KErrNotFound );
-    EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("TITLE:Boss") ) != KErrNotFound );
-
-    CleanupStack::PopAndDestroy( 2, idArr );  // buffer, idArr
-    }
-
-// DoDeleteItemL()
-void CNSmlDummyDataStore_Test::DeleteItemL()
-    {
-    // Delete item
-    TInt returnCode = KErrNone;
-    EUNIT_PRINT( _L("Calling DoDeleteItemL()") );
-    TRAPD( err, returnCode = iStoreWaiter->DoDeleteItemL( ( *iIdArray )[ 0 ] ) );
-
-    EUNIT_PRINT( _L( "DoDeleteItemL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoDeleteItemL() leave" );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoDeleteItemL returns error");
-    
-    // Check that the contact does not exist any more
-    CContactItem* item = NULL;
-    CContactDatabase* cntDb = NULL;
-    TRAP( err, cntDb = CContactDatabase::OpenL() );
-    TRAP( err, item = cntDb->ReadMinimalContactL(
-        ( *iIdArray )[ 0 ] ) );
-    EUNIT_ASSERT( !item );
-    EUNIT_PRINT( _L("Error=%d"), err );
-    EUNIT_ASSERT_EQUALS_DESC( err, KErrNotFound, "Deleted item found" );
-    delete item;
-    item = NULL;
-
-    if( cntDb )
-        {
-        delete cntDb;
-        }
-
-    iIdArray->Remove( 0 );
-    }
-
-// DoDeleteAllItemsL()
-void CNSmlDummyDataStore_Test::DeleteAllItemsL()
-    {
-    // Temporarily remove ChangeFinder from Store to prevent leaves
-    // when reseting ChangeFinder in code under test.
-    CNSmlChangeFinder* cF = iCNSmlDummyDataStore->iChangeFinder;
-    CleanupStack::PushL( cF );
-    iCNSmlDummyDataStore->iChangeFinder = NULL;
-
-    TInt returnCode = KErrNone;
-    EUNIT_PRINT( _L("Calling DoDeleteAllItemsL()") );
-    TRAPD( err, returnCode = iStoreWaiter->DoDeleteAllItemsL() );
-
-    // Return ChangeFinders
-    CleanupStack::Pop( cF );
-    iCNSmlDummyDataStore->iChangeFinder = cF;
-
-    EUNIT_PRINT( _L( "DoDeleteAllItemsL(): leave code: %d, return code: %d" ),
-        err, returnCode );
-    EUNIT_ASSERT_DESC( err == KErrNone, "DoDeleteAllItemsL() leave" );
-    EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoDeleteAllItemsL returns error");
-
-    // Check that all normal contacts are removed
-    TContactItemId ownCardId = iContactDatabase->OwnCardId();
-
-    TInt contactCount = 0;
-    TInt groupCount = iContactDatabase->GroupCount();
-    TContactIter iter( *iContactDatabase );
-    for( TContactItemId id = iter.FirstL(); id != KNullContactId; id = iter.NextL() )
-        {
-        // KUidContactGroup
-        if( id != ownCardId )
-            {
-            contactCount++;
-            }
-        }
-    EUNIT_PRINT( _L("Number of items in DB=%d"), contactCount );
-    EUNIT_PRINT( _L("Number of groups in DB=%d"), groupCount );
-    EUNIT_ASSERT_DESC( contactCount - groupCount == 0, "All contacts not deleted");
-    }
-
-// GetStoreFormatResourceFileL()
-void CNSmlDummyDataStore_Test::GetStoreFormatResourceFileLL()
-    {
-    const TDesC& resourceFile = iCNSmlDummyDataStore->GetStoreFormatResourceFileL();
-    EUNIT_PRINT( resourceFile );
-    }
-
-void CNSmlDummyDataStore_Test::TestStoreSupportMimeTypeL()
-    {
-    EUNIT_ASSERT( iCNSmlDummyDataStore->iStoreFormat );
-    EUNIT_ASSERT_EQUALS( iCNSmlDummyDataStore->iStoreFormat->MimeFormatCount() ,1 );
-    EUNIT_ASSERT_EQUALS(
-            iCNSmlDummyDataStore->iStoreFormat->MimeFormat(0).MimeType().DesC(),
-            KNSmlvCard21Name() );
-    EUNIT_ASSERT_EQUALS(
-            iCNSmlDummyDataStore->iStoreFormat->MimeFormat(0).MimeVersion().DesC(),
-                    KNSmlvCard21Ver() );
-    }
-
-void CNSmlDummyDataStore_Test::GetDataMod()
-    {
-    CNSmlDataModBase& dataMod = iCNSmlDummyDataStore->GetDataMod();
-    }
-
-void CNSmlDummyDataStore_Test::DoBeginTransactionL()
-    {
-    TRAPD( err, iCNSmlDummyDataStore->DoBeginTransactionL() );
-    EUNIT_ASSERT( err == KErrNotSupported );
-    }
-
-void CNSmlDummyDataStore_Test::DoCommitTransactionL()
-    {
-    TRequestStatus status;
-    iCNSmlDummyDataStore->DoCommitTransactionL( status );
-    User::WaitForRequest( status );
-    EUNIT_ASSERT_DESC( status.Int() == KErrNotSupported, "DoCommitTransactionL fail"  )
-    }
-
-void CNSmlDummyDataStore_Test::DoRevertTransaction()
-    {
-    TRequestStatus status;
-    iCNSmlDummyDataStore->DoRevertTransaction( status );
-    User::WaitForRequest( status );
-    EUNIT_ASSERT_DESC( status.Int() == KErrNotSupported, "DoRevertTransaction fail"  )
-    }
-
-void CNSmlDummyDataStore_Test::StoreNameL()
-    {
-    CreateDataStoreL();
-    EUNIT_PRINT( iDataStore->StoreName() );
-    iDataStore->CancelRequest();
-    DeleteDataStoreL();
-    }
-
-void CNSmlDummyDataStore_Test::FindChangedItemsL()
-    {
-    CreateDataStoreL();
-    const MSmlDataItemUidSet& added = iDataStore->AddedItems();
-    EUNIT_ASSERT_DESC( added.ItemCount() == 0, "AddedItems returns faulty uid set");
-    const MSmlDataItemUidSet& deleted = iDataStore->DeletedItems();
-    EUNIT_ASSERT_DESC( deleted.ItemCount() == 0, "DeletedItems returns faulty uid set");
-    const MSmlDataItemUidSet& softDeleted = iDataStore->SoftDeletedItems();
-    EUNIT_ASSERT_DESC( softDeleted.ItemCount() == 0, "SoftDeletedItems returns faulty uid set");
-    const MSmlDataItemUidSet& moved = iDataStore->MovedItems();
-    EUNIT_ASSERT_DESC( moved.ItemCount() == 0, "MovedItems returns faulty uid set");
-    DeleteDataStoreL();
-    }
-
-void CNSmlDummyDataStore_Test::MoveAndDeleteL()
-    {
-    CreateDataStoreL();
-    TSmlDbItemUid uid = 1;
-    TSmlDbItemUid parent = 0;
-    TRequestStatus status;
-    iDataStore->MoveItemL( uid, parent, status );
-    User::WaitForRequest( status );
-    
-    TRequestStatus status2;
-    iDataStore->SoftDeleteItemL( uid, status2 );
-    User::WaitForRequest( status2 );
-    
-    DeleteDataStoreL();
-    }
-
-void CNSmlDummyDataStore_Test::DoSetRemoteMaxObjectSize()
-    {
-    iCNSmlDummyDataStore->DoSetRemoteMaxObjectSize( 100000 );
-    }
-
-void CNSmlDummyDataStore_Test::DoMaxObjectSize()
-    {
-    TInt size = iCNSmlDummyDataStore->DoMaxObjectSize();
-    EUNIT_ASSERT( size == 102400 );
-    }
-
-
-// --------------- Helper methods --------------
-
-// Helper method to add a simple contact to test contact DB
-TContactItemId CNSmlDummyDataStore_Test::AddContactL(
-        const TDesC& aFirstName,
-        const TDesC& aLastName,
-        const TDesC& aPhoneNumber )
-    {
-    _LIT( KLabelFamilyName, "Last name");
-    _LIT( KLabelGivenName, "First name");
-    _LIT( KLabelPhone, "Phone");
-
-    CContactCard* card = CContactCard::NewLC();
-
-    // Family name field
-    CContactItemField* familyNameField =
-        CContactItemField::NewLC( KStorageTypeText, KUidContactFieldFamilyName );
-    familyNameField->SetLabelL( KLabelFamilyName );
-    familyNameField->SetMapping( KUidContactFieldVCardMapUnusedN );
-    familyNameField->TextStorage()->SetTextL( aLastName );
-    card->AddFieldL( *familyNameField ); // Takes ownership
-    CleanupStack::Pop( familyNameField );
-
-    // First name field
-    CContactItemField* nameField =
-    CContactItemField::NewLC( KStorageTypeText, KUidContactFieldGivenName );
-    nameField->SetLabelL( KLabelGivenName );
-    nameField->SetMapping( KUidContactFieldVCardMapUnusedN );
-    nameField->TextStorage()->SetTextL( aFirstName );
-    card->AddFieldL( *nameField );
-    CleanupStack::Pop(nameField);
-
-    // Phone number field
-    CContactItemField* phoneField =
-        CContactItemField::NewLC( KStorageTypeText, KUidContactFieldPhoneNumber );
-    phoneField->SetLabelL( KLabelPhone );
-    phoneField->SetMapping( KUidContactFieldVCardMapTEL );
-    phoneField->TextStorage()->SetTextL( aPhoneNumber );
-    card->AddFieldL( *phoneField );
-    CleanupStack::Pop( phoneField );
-
-    TContactItemId cardId = iContactDatabase->AddNewContactL( *card );
-    CleanupStack::PopAndDestroy( card );
-
-    return cardId;
-    }
-
-void CNSmlDummyDataStore_Test::CreateDataStoreL()
-    {
-    TSmlDataProviderId id = {0x101F6DDD};// Contact Adapter Uid
-    CSmlDataProvider* dp = CSmlDataProvider::NewL( id );
-    iDataStore = dp->NewStoreInstanceLC();
-    CleanupStack::Pop( iDataStore );
-    delete dp;
-    }
-
-void CNSmlDummyDataStore_Test::DeleteDataStoreL()
-    {
-    delete iDataStore;
-    iDataStore = NULL;
-    }
-
-// - EUnit test table -------------------------------------------------------
-
-EUNIT_BEGIN_TEST_TABLE(
-    CNSmlDummyDataStore_Test,
-    "Unit tests Contact adapter datastore",
-    "UNIT" )
-
-EUNIT_TEST(
-    "Test to verify memory allocation for the object",
-    "CNSmlContactsDataStore",
-    "NewL",
-    "FUNCTIONALITY",
-    Empty, NewLL, Empty)
-
-// The following unit test cases fail because of mis-match in 
-// heap cell count & thread handle count. This is caused by
-// DataStoreExtension component.
-EUNIT_TEST(
-    "Open data store",
-    "CNSmlContactsDataStore",
-    "DoOpenL",
-    "FUNCTIONALITY",
-    SetupL, DoOpenLL, Teardown )
-
-EUNIT_TEST(
-    "DoHasSyncHistory",
-    "CNSmlContactsDataStore",
-    "DoHasSyncHistory",
-    "FUNCTIONALITY",
-    SetupAndOpenStoreL, DoHasSyncHistoryL, TeardownAndCloseStore )
-
-EUNIT_TEST(
-    "DoModifiedItems & DoCommitChangeInfoL",
-    "CNSmlContactsDataStore",
-    "DoModifiedItems",
-    "FUNCTIONALITY",
-    SetupAndOpenStoreL, DoModifiedItemsL, TeardownAndCloseStore )
-
-EUNIT_TEST(
-    "DoResetChangeInfoL",
-    "CNSmlContactsDataStore",
-    "DoResetChangeInfoL",
-    "FUNCTIONALITY",
-    SetupAndOpenStoreL, DoResetChangeInfoLL, TeardownAndCloseStore )
-
-EUNIT_TEST(
-    "DoCommitChangeInfoL",
-    "CNSmlContactsDataStore",
-    "DoCommitChangeInfoL",
-    "FUNCTIONALITY",
-    SetupAndOpenStoreL, DoCommitChangeInfoLL, TeardownAndCloseStore )
-
-EUNIT_TEST(
-    "Add single item (normal mode)",
-    "CNSmlContactsDataStore",
-    "DoCreateItemL, DoCommitItemL, LdoAddItem",
-    "FUNCTIONALITY",
-    SetupAndOpenStoreL, AddSingleItemL, TeardownAndCloseStore )
-
-EUNIT_TEST(
-    "Add item in batch mode",
-    "CNSmlContactsDataStore",
-    "DoBeginBatchL, DoCommitBatchL",
-    "FUNCTIONALITY",
-    SetupAndOpenStoreL, AddItemBatchL, TeardownAndCloseStore )
-
-EUNIT_TEST(
-    "CancelBatchL",
-    "CNSmlContactsDataStore",
-    "DoCancelBatch",
-    "FUNCTIONALITY",
-    SetupAndOpenStoreL, CancelBatchL, TeardownAndCloseStore ) 
-
-EUNIT_TEST(
-    "Fetch/read normal contact",
-    "CNSmlContactsDataStore",
-    "LdoFetchItemL",
-    "FUNCTIONALITY",
-    SetupPopulateDbAndOpenStoreL, FetchItemL, TeardownCloseAndEmptyContactDb )
-
-EUNIT_TEST(
-    "Update normal contact",
-    "CNSmlContactsDataStore",
-    "LdoUpdateItemL",
-    "FUNCTIONALITY",
-    SetupPopulateDbAndOpenStoreL, UpdateItemL, TeardownCloseAndEmptyContactDb )
-
-EUNIT_TEST(
-    "Delete normal contact",
-    "CNSmlContactsDataStore",
-    "DoDeleteItemL",
-    "FUNCTIONALITY",
-    SetupPopulateDbAndOpenStoreL, DeleteItemL, TeardownCloseAndEmptyContactDb )
-
-EUNIT_TEST(
-    "Delete all contacts",
-    "CNSmlContactsDataStore",
-    "DoDeleteItemL",
-    "FUNCTIONALITY",
-    SetupPopulateDbAndOpenStoreL, DeleteAllItemsL, TeardownCloseAndEmptyContactDb )
-// End of failing test cases
-
-EUNIT_TEST(
-    "Test for GetStoreFormatResourceFileL function",
-    "CNSmlContactsDataStore",
-    "",
-    "FUNCTIONALITY",
-    SetupL, GetStoreFormatResourceFileLL, Teardown )
-
-EUNIT_TEST(
-    "Verify operator specific MIME type",
-    "CNSmlContactsDataStore",
-    "",
-    "FUNCTIONALITY",
-    SetupL, TestStoreSupportMimeTypeL, Teardown )
-
-EUNIT_TEST(
-    "GetDataMod",
-    "CNSmlContactsDataStore",
-    "",
-    "FUNCTIONALITY",
-    SetupL, GetDataMod, Teardown )
-
-EUNIT_TEST(
-    "DoBeginTransactionL",
-    "CNSmlContactsDataStore",
-    "",
-    "FUNCTIONALITY",
-    SetupL, DoBeginTransactionL, Teardown )
-
-EUNIT_TEST(
-    "DoCommitTransactionL",
-    "CNSmlContactsDataStore",
-    "",
-    "FUNCTIONALITY",
-    SetupL, DoCommitTransactionL, Teardown )
-
-EUNIT_TEST(
-    "DoRevertTransaction",
-    "CNSmlContactsDataStore",
-    "",
-    "FUNCTIONALITY",
-    SetupL, DoRevertTransaction, Teardown )
-
-EUNIT_TEST(
-    "StoreNameL",
-    "CNSmlContactsDataStore",
-    "",
-    "FUNCTIONALITY",
-    SetupL, StoreNameL, Teardown )
-    
-EUNIT_TEST(
-    "FindChangedItemsL",
-    "CNSmlContactsDataStore",
-    "",
-    "FUNCTIONALITY",
-    SetupL, FindChangedItemsL, Teardown )   
-
-EUNIT_TEST(
-    "MoveAndDeleteL",
-    "CNSmlContactsDataStore",
-    "",
-    "FUNCTIONALITY",
-    SetupL, MoveAndDeleteL, Teardown )
-
-EUNIT_TEST(
-    "DoSetRemoteMaxObjectSize",
-    "CNSmlContactsDataStore",
-    "",
-    "FUNCTIONALITY",
-    SetupL, DoSetRemoteMaxObjectSize, Teardown )
-
-EUNIT_TEST(
-    "DoMaxObjectSize",
-    "CNSmlContactsDataStore",
-    "",
-    "FUNCTIONALITY",
-    SetupL, DoMaxObjectSize, Teardown )
-
-EUNIT_END_TEST_TABLE
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydatastore_test.h	Tue Aug 31 15:05:37 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:  Header file for contact adapter's datastore unit tests.
-*
-*/
-
-#ifndef __CNSMLDUMMYDATASTORE_TEST_H__
-#define __CNSMLDUMMYDATASTORE_TEST_H__
-
-// INCLUDES
-#include <ceunittestsuiteclass.h>
-#include <smldatasyncdefs.h>
-#include <cntdb.h>
-#include <s32mem.h>
-
-// FORWARD DECLARATIONS
-class CNSmlDummyDataStore;
-class CNSmlAdapterTestUtilities;
-class CNSmlDummyDataStoreWaiter;
-class CSmlDataStore;
-
-// CLASS DEFINITION
-/**
- * Generated EUnit test suite class.
- */
-NONSHARABLE_CLASS( CNSmlDummyDataStore_Test )
-	: public CEUnitTestSuiteClass, public MSmlSyncRelationship
-    {
-    public:  // Constructors and destructor
-
-        static CNSmlDummyDataStore_Test* NewL();
-        static CNSmlDummyDataStore_Test* NewLC();
-        ~CNSmlDummyDataStore_Test();
-
-    private: // Constructors
-
-        CNSmlDummyDataStore_Test();
-        void ConstructL();
-
-    private: // New methods
-
-        void Empty() {};
-
-        // ++ Setup methods ++
-        void SetupL();
-        
-        void SetupAndOpenStoreL();
-        
-        void SetupAndPopulateContactDbL();
-        
-        void SetupPopulateDbAndOpenStoreL();
-
-        // ++ Teardown methods ++
-        void Teardown();
-        
-        void TeardownAndCloseStore();
-        
-        void TeardownAndEmptyContactDb();
-        
-        void TeardownCloseAndEmptyContactDb();
-
-        // ++ DataStore test cases ++
-        void NewLL();
-
-        void DoOpenLL();
-
-        void DoHasSyncHistoryL();
-
-        void DoModifiedItemsL();
-
-        void DoResetChangeInfoLL();
-
-        void DoCommitChangeInfoLL();
-
-        void AddSingleItemL();
-
-        void AddItemBatchL();
-        
-        void CancelBatchL();
-
-        void FetchItemL();
-
-        void UpdateItemL();
-
-        void DeleteItemL();
-
-        void DeleteAllItemsL();
-
-        void GetStoreFormatResourceFileLL();
-
-        void TestStoreSupportMimeTypeL();
-        
-        void DoBeginTransactionL();
-        
-        void DoCommitTransactionL();
-        
-        void DoRevertTransaction();
-        
-        void StoreNameL();
-        
-        void FindChangedItemsL();
-        
-        void MoveAndDeleteL();
-        
-        void DoSetRemoteMaxObjectSize();
-        
-        void DoMaxObjectSize();
-        
-        void GetDataMod();
-        
-        // ++ Helper methods ++
-        TContactItemId AddContactL( const TDesC& aFirstName,
-                 const TDesC& aLastName,
-                 const TDesC& aPhoneNumber );
-        
-        void CreateDataStoreL();
-
-        void DeleteDataStoreL();
-
-    private: // from MSmlSyncRelationship
-        TSmlSyncTaskKey SyncTaskKey() const;
-        
-        void OpenReadStreamLC( RReadStream& aReadStream, TUid aStreamUid );
-        
-        void OpenWriteStreamLC( RWriteStream& aWriteStream, TUid aStreamUid );
-        
-        TBool IsStreamPresentL( TUid aStreamUid ) const;
-
-    private: // Data
-
-        CNSmlDummyDataStore* iCNSmlDummyDataStore;
-        CNSmlAdapterTestUtilities* iTestUtilities;
-
-        CContactDatabase*   iContactDatabase;
-        CContactIdArray*    iIdArray;
-        RFs                 iFsSession;
-        RFileWriteStream    iWriteStream;
-        TSmlDbItemUid       iItemUid;
-
-        CNSmlDummyDataStoreWaiter* iStoreWaiter;
-        CSmlDataStore* iDataStore;
-
-        EUNIT_DECLARE_TEST_TABLE;
-    };
-
-#endif      //  __CNSMLDUMMYDATASTORE_TEST_H__
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydatastorewaiter.cpp	Tue Aug 31 15:05:37 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:  Source code file for datastorewaiter helper class.
-*
-*/
-
-//  CLASS HEADER
-#include "cnsmldummydatastorewaiter.h"
-
-// INTERNAL INCLUDES
-#include "nsmldummydatastore.h"
-
-//  EXTERNAL INCLUDES
-#include <eunitmacros.h>
-
-// CONSTANTS
-
-
-// --- Constructors & destructors --------------------------------------------
-CNSmlDummyDataStoreWaiter* CNSmlDummyDataStoreWaiter::NewL(
-        CNSmlDummyDataStore& aStore )
-    {
-    CNSmlDummyDataStoreWaiter* self =
-        CNSmlDummyDataStoreWaiter::NewLC( aStore );
-    CleanupStack::Pop( self );
-
-    return self;
-    }
-
-CNSmlDummyDataStoreWaiter* CNSmlDummyDataStoreWaiter::NewLC(
-    CNSmlDummyDataStore& aStore )
-    {
-    CNSmlDummyDataStoreWaiter* self =
-        new ( ELeave ) CNSmlDummyDataStoreWaiter( aStore );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-
-    return self;
-    }
-
-CNSmlDummyDataStoreWaiter::~CNSmlDummyDataStoreWaiter()
-    {
-    Cancel();
-    delete iWait;
-    iOpen = EFalse;
-    }
-
-CNSmlDummyDataStoreWaiter::CNSmlDummyDataStoreWaiter(
-    CNSmlDummyDataStore& aStore ):
-    CActive( EPriorityNormal ), iStore( aStore ), iOpen( EFalse )
-    {
-
-    }
-
-void CNSmlDummyDataStoreWaiter::ConstructL()
-    {
-    CActiveScheduler::Add( this );
-    iWait = new ( ELeave ) CActiveSchedulerWait();
-    }
-
-// --- From CActive ----------------------------------------------------------
-void CNSmlDummyDataStoreWaiter::DoCancel()
-    {
-    iStore.CancelRequest();
-    }
-
-void CNSmlDummyDataStoreWaiter::RunL()
-    {
-    iWait->AsyncStop();
-    }
-
-// --- Test methods -----------------------------------------------------------
-
-void CNSmlDummyDataStoreWaiter::OpenStoreL( MSmlSyncRelationship& aRelationship, 
-    const TDesC& /*aStoreName*/ )
-    {
-    Cancel();
-    iStore.OpenL( _L("C:Contacts.cdb"), aRelationship, iStatus );
-    SetActive();
-
-    if( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-    iOpen = ETrue;
-    }
-
-TInt CNSmlDummyDataStoreWaiter::DoCommitChangeInfoL(
-    const MSmlDataItemUidSet& aItems )
-    {
-    if( !iOpen )
-        {
-        User::Leave( KErrNotReady );
-        }
-
-    Cancel();
-    iStore.DoCommitChangeInfoL( iStatus, aItems );
-    SetActive();
-
-    if( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-
-    return iStatus.Int();
-    }
-
-TInt CNSmlDummyDataStoreWaiter::DoResetChangeInfoL()
-    {
-    if( !iOpen )
-        {
-        User::Leave( KErrNotReady );
-        }
-
-    Cancel();
-    iStore.DoResetChangeInfoL( iStatus );
-    SetActive();
-
-    if( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-
-    return iStatus.Int();
-    }
-
-TInt CNSmlDummyDataStoreWaiter::DoCommitChangeInfoL()
-    {
-    if( !iOpen )
-        {
-        User::Leave( KErrNotReady );
-        }
-
-    Cancel();
-    iStore.DoCommitChangeInfoL( iStatus );
-    SetActive();
-
-    if( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-
-    return iStatus.Int();
-    }
-
-// Item addition in "normal" (non-batch) mode
-TInt CNSmlDummyDataStoreWaiter::DoCreateItemL( TSmlDbItemUid& aUid,
-    TInt aSize, const TDesC8& aMimeType, const TDesC8& aMimeVer )
-    {
-    if( !iOpen )
-        {
-        User::Leave( KErrNotReady );
-        }
-    Cancel();
-    iStore.DoCreateItemL( aUid, aSize, 0, aMimeType, aMimeVer, iStatus );
-
-    SetActive();
-
-    if( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-
-    return iStatus.Int();
-    }
-
-TInt CNSmlDummyDataStoreWaiter::DoCommitItemL()
-    {
-    if( !iOpen )
-        {
-        User::Leave( KErrNotReady );
-        }
-    Cancel();
-    iStore.DoCommitItemL( iStatus );
-
-    SetActive();
-
-    if( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-
-    return iStatus.Int();
-    }
-
-TInt CNSmlDummyDataStoreWaiter::DoCommitBatchL( RArray<TInt>& aResultArray )
-    {
-    if( !iOpen )
-        {
-        User::Leave( KErrNotReady );
-        }
-    Cancel();
-    iStore.DoCommitBatchL( aResultArray, iStatus );
-
-    SetActive();
-
-    if( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-
-    return iStatus.Int();
-    }
-
-void CNSmlDummyDataStoreWaiter::DoCancelBatch()
-    {
-    if( !iOpen )
-        {
-        return;
-        }
-    iStore.DoCancelBatch();
-    }
-
-TInt CNSmlDummyDataStoreWaiter::DoOpenItemL( TSmlDbItemUid aUid,
-    TBool& aFieldChange, TInt& aSize, TSmlDbItemUid& aParent,
-    TDes8& aMimeType, TDes8& aMimeVer )
-    {
-    if( !iOpen )
-        {
-        User::Leave( KErrNotReady );
-        }
-    Cancel();
-    iStore.OpenItemL( aUid, aFieldChange, aSize, aParent, aMimeType,
-        aMimeVer, iStatus );
-
-    SetActive();
-
-    if( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-
-    return iStatus.Int();
-    }
-
-TInt CNSmlDummyDataStoreWaiter::DoReplaceItemL( TSmlDbItemUid aUid,
-    TInt aSize, TSmlDbItemUid aParent, TBool aFieldChange )
-    {
-    if( !iOpen )
-        {
-        User::Leave( KErrNotReady );
-        }
-    Cancel();
-    iStore.ReplaceItemL( aUid, aSize, aParent, aFieldChange, iStatus );
-    SetActive();
-    if( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-    return iStatus.Int();
-    }
-
-TInt CNSmlDummyDataStoreWaiter::DoDeleteItemL( TSmlDbItemUid aUid )
-    {
-    if( !iOpen )
-        {
-        User::Leave( KErrNotReady );
-        }
-    Cancel();
-    iStore.DeleteItemL( aUid, iStatus );
-
-    SetActive();
-
-    if( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-
-    return iStatus.Int();
-    }
-
-TInt CNSmlDummyDataStoreWaiter::DoDeleteAllItemsL()
-    {
-    if( !iOpen )
-        {
-        User::Leave( KErrNotReady );
-        }
-    Cancel();
-    iStore.DeleteAllItemsL( iStatus );
-
-    SetActive();
-
-    if( !iWait->IsStarted() )
-        {
-        iWait->Start();
-        }
-
-    return iStatus.Int();
-    }
-
-// End of file
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/cnsmldummydatastorewaiter.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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:  Header file for datastorewaiter helper class.
-*
-*/
-
-#ifndef __CNSMLDUMMYDATASTOREWAITER_H__
-#define __CNSMLDUMMYDATASTOREWAITER_H__
-
-// INCLUDES
-#include <e32base.h>
-#include "nsmldummydatastore.h"
-
-// FORWARD DECLARATIONS
-class MSmlSyncRelationship;
-
-// CLASS DEFINITION
-
-
-NONSHARABLE_CLASS( CNSmlDummyDataStoreWaiter ):
-    public CActive
-    {
-    public:  // Constructors and destructor
-        static CNSmlDummyDataStoreWaiter* NewL( CNSmlDummyDataStore& aStore );
-        static CNSmlDummyDataStoreWaiter* NewLC( CNSmlDummyDataStore& aStore );
-        virtual ~CNSmlDummyDataStoreWaiter();
-        
-    private:  // Constructors
-        CNSmlDummyDataStoreWaiter( CNSmlDummyDataStore& aStore );
-        void ConstructL();
-        
-    private:  // From CActive
-        void DoCancel();
-        void RunL();
-    
-    public:
-        void OpenStoreL( MSmlSyncRelationship& aRelationship, 
-            const TDesC& aStoreName = KNSmlContactStoreNameForDefaultDB );
-        TInt DoCommitChangeInfoL( const MSmlDataItemUidSet& aItems );
-        TInt DoResetChangeInfoL();
-        TInt DoCommitChangeInfoL();
-        
-        TInt DoCreateItemL( TSmlDbItemUid& aUid, TInt aSize, 
-            const TDesC8& aMimeType, const TDesC8& aMimeVer );
-        TInt DoCommitItemL();
-                
-        TInt DoCommitBatchL( RArray<TInt>& aResultArray );
-        void DoCancelBatch();
-        
-        TInt DoOpenItemL( TSmlDbItemUid aUid, TBool& aFieldChange, 
-            TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType, 
-            TDes8& aMimeVer );
-        TInt DoReplaceItemL( TSmlDbItemUid aUid, TInt aSize, 
-            TSmlDbItemUid aParent, TBool aFieldChange );
-        TInt DoDeleteItemL( TSmlDbItemUid aUid );
-        TInt DoDeleteAllItemsL();
-
-    private:  // Data
-        CActiveSchedulerWait* iWait;
-        CNSmlDummyDataStore& iStore;
-        TBool iOpen;
-    };
-
-#endif // __CNSMLDUMMYDATASTOREWAITER_H__
-
-// End of file
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/def/bwinscwcontactsdataprovider_testu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
-
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/def/eabicontactsdataprovider_testu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-EXPORTS
-	_Z16CreateTestSuiteLv @ 1 NONAME
-	_ZTI19CNSmlDummyDataStore @ 2 NONAME
-	_ZTI22CNSmlDummyDataProvider @ 3 NONAME
-	_ZTI25CNSmlAdapterTestUtilities @ 4 NONAME
-	_ZTV19CNSmlDummyDataStore @ 5 NONAME
-	_ZTV22CNSmlDummyDataProvider @ 6 NONAME
-	_ZTV25CNSmlAdapterTestUtilities @ 7 NONAME
-
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/dllmain.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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:  DllMain file for contact adapter unit tests.
-*
-*/
-
-//  EXTERNAL INCLUDES
-#include <ceunittestsuite.h>
-#include "cnsmldummydataprovider_test.h"
-#include "cnsmldummydatastore_test.h"
-
-/**
-* UT_nsmldscontactsdataprovider.dll test suite factory function.
-*/
-EXPORT_C MEUnitTest* CreateTestSuiteL()
-    {
-    CEUnitTestSuite* rootSuite = 
-        CEUnitTestSuite::NewLC( _L( "Unit test for Contact adapter" ) );
-
-    // Unit tests for dataprovider class (CNSmlDummyDataProvider)
-    MEUnitTest* providerSuite = CNSmlDummyDataProvider_Test::NewL();
-    CleanupStack::PushL( providerSuite );
-    rootSuite->AddL( providerSuite );
-    CleanupStack::Pop( providerSuite );
-
-    // Unit tests for datastore class (CNSmlDummyDataStore)
-    MEUnitTest* storeSuite = CNSmlDummyDataStore_Test::NewL();
-    CleanupStack::PushL( storeSuite );
-    rootSuite->AddL( storeSuite );
-    CleanupStack::Pop( storeSuite );
-
-    CleanupStack::Pop( rootSuite );
-
-    return rootSuite;
-    }
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/testdata/basic.vcf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-BEGIN:VCARD
-VERSION:2.1
-N:Smith;John
-TITLE:Boss
-END:VCARD
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/ContactsAdapter/testdata/standard.vcf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-BEGIN:VCARD
-VERSION:2.1
-N:Smith;John
-FN:John Smith
-ORG:Firm
-TITLE:Boss
-NOTE;ENCODING=QUOTED-PRINTABLE:Liirum larum.=0D=0A
-TEL;WORK;VOICE:132456798
-TEL;HOME;VOICE:654654987
-TEL;CELL;VOICE:0400654987654
-TEL;WORK;FAX:2321654987987
-ADR;WORK:;;Firmstreet 1;New City;Sawo;00000;Finland
-LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Firmstreet 1=0D=0ANew City, Sawo 00000=0D=0AFinland
-URL;WORK:http://www.nokia.com
-EMAIL;PREF;INTERNET:John.Smith@firm.com
-REV:20080306T115812Z
-END:VCARD
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydataprovider.loc	Tue Aug 31 15:05:37 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:  Localization file for DS Dummy Adapter.
-*
-*/
-
-//d:Display name for registry info 
-//l:list_setting_pane_t1
-//
-#define qtn_nsml_dummy_adapter_display_name "Contacts (dummy)" 
-
-// End of File  
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydataprovider.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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:  Registery info for DS Dummy Adapter.
-*
-*/
-
-#include "nsmldummydataprovider.loc"
-
-#include <registryinfo.rh>
-#include <nsmldsconstants.h>
-
-RESOURCE REGISTRY_INFO theRegistryInfo
-  {
-  dll_uid = 0x2002DC7E; // DS interface implementation UID
-  interfaces = 
-      {
-      INTERFACE_INFO
-          {
-          interface_uid = KNSmlDSInterfaceUid; // DS interface UID
-          implementations = 
-            {
-            IMPLEMENTATION_INFO
-                {
-                implementation_uid = 0x2002DC7E; // DS interface implementation UID
-                version_no = 1; 
-                display_name = qtn_nsml_dummy_adapter_display_name;
-                default_data = "";
-                opaque_data = "";
-                }
-            };
-          }
-      };
-    }
-
-// End of File  
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydatastoreformat_1_1_2.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,508 +0,0 @@
-CHARACTER_SET UTF8/*
-* Copyright (c) 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:  Resource data for DS Dummy DataProvider
-*
-*/
-
-#include "SmlDataFormat.rh"
-#include "SmlDataFormat.hrh"
-
-RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
-	{
-	version=1;
-	display_name="Test Contacts";
-	sync_types=KSmlSyncType_TwoWay+KSmlSyncType_OneWayFromSvr+
-	           KSmlSyncType_OneWayFromClnt+KSmlSyncType_SlowSync+
-	           KSmlSyncType_RefreshFromSvr+KSmlSyncType_RefreshFromClnt;
-	mime_format=
-		{
-		SML_MIME_FORMAT
-			{
-			version=1;
-			mime_type="text/x-vcard";
-			mime_ver="2.1";
-			properties=
-				{
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Begin";
-					name="BEGIN";
-					data_type="";
-					enum_values={"VCARD"};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="End";
-					name="END";
-					data_type="";
-					enum_values={"VCARD"};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Version";
-					name="VERSION";
-					data_type="";
-					enum_values={"2.1"};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Revision";
-					name="REV";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Name";
-					name="N";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Address";
-					name="ADR";	
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params=
-						{
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Home address";
-							name="HOME";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Work address";
-							name="WORK";
-							data_type="";
-							enum_values={};
-							}
-						};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Telephone number";
-					name="TEL";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params=
-						{
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Home telephone";
-							name="HOME";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Work telephone";
-							name="WORK";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Cellular number";
-							name="CELL";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Pager number";
-							name="PAGER";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Fax number";
-							name="FAX";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Video number";
-							name="VIDEO";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Default number";
-							name="PREF";
-							data_type="";
-							enum_values={};
-							},	
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Car telephone";
-							name="CAR";
-							data_type="";
-							enum_values={};
-							}
-						};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="FullName";
-					name="FN";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Email address";
-					name="EMAIL";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params=
-						{
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="";
-							name="INTERNET";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Home email";
-							name="HOME";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Work email";
-							name="WORK";
-							data_type="";
-							enum_values={};
-							}
-						};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="URL address";
-					name="URL";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params=
-						{
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Home URL";
-							name="HOME";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Work URL";
-							name="WORK";
-							data_type="";
-							enum_values={};
-							}
-						};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Note";
-					name="NOTE";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Title";
-					name="TITLE";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Organisation";
-					name="ORG";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Photo";
-					name="PHOTO";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Birthday";
-					name="BDAY";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Sound";
-					name="SOUND";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Wireless Village Id";
-					name="X-WV-ID";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-					
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Assistant name";
-					name="X-ASSISTANT";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-					
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Assistant phone";
-					name="X-ASSISTANT-TEL";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Anniversary";
-					name="X-ANNIVERSARY";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Spouse";
-					name="X-SPOUSE";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Children";
-					name="X-CHILDREN";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-			 SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Nickname";
-					name="X-EPOCSECONDNAME";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Class";
-					name="X-CLASS";
-					data_type="";
-					enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="SIP protocol";
-					name="X-SIP";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params=
-						{
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="POC";
-							name="POC";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="SWIS";
-							name="SWIS";
-							data_type="";
-							enum_values={};
-							},
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Voice over IP";
-							name="VOIP";
-							data_type="";
-							enum_values={};
-							}
-						};
-					}
-				};
-				field_level=0;
-				}
-			};
-		mime_format_tx_pref=0;     // Preferred index for tx
-		mime_format_rx_pref=0;     // Preferred index for rx
-		folder_properties={};
-		filter_capabilities={};
-		max_size=0; 	// no limit
-		max_items=0; 	// no limit
-		flags=0;
-	}
-	
-// End of File  
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydatastoreformat_1_2.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,400 +0,0 @@
-CHARACTER_SET UTF8/*
-* Copyright (c) 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:  Resource data for DS Dummy DataProvider
-*
-*/
-
-#include "SmlDataFormat.rh"
-#include "SmlDataFormat.hrh"
-
-RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
-	{
-	version=1;
-	display_name="Test Contacts";
-	sync_types=KSmlSyncType_TwoWay+KSmlSyncType_OneWayFromSvr+
-	           KSmlSyncType_OneWayFromClnt+KSmlSyncType_SlowSync+
-	           KSmlSyncType_RefreshFromSvr+KSmlSyncType_RefreshFromClnt;
-	mime_format=
-		{
-		SML_MIME_FORMAT
-			{
-			version=1;
-			mime_type="text/x-vcard";
-			mime_ver="2.1";
-			properties=
-				{
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Begin";
-					name="BEGIN";
-					data_type="";
-					enum_values={"VCARD"};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="End";
-					name="END";
-					data_type="";
-					enum_values={"VCARD"};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Version";
-					name="VERSION";
-					data_type="";
-					enum_values={"2.1"};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Revision";
-					name="REV";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Name";
-					name="N";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Address";
-					name="ADR";	
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params=
-						{
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Type";
-							name="TYPE";
-							data_type="";
-							enum_values={"HOME", "WORK"};
-							}
-						};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Telephone number";
-					name="TEL";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params=
-						{
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Type";
-							name="TYPE";
-							data_type="";
-							enum_values={"HOME", "WORK", "CELL", "PAGER", "FAX", "VIDEO", "PREF", "CAR"};
-							}
-						};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="FullName";
-					name="FN";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Email address";
-					name="EMAIL";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params=
-						{
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Type";
-							name="TYPE";
-							data_type="";
-							enum_values={"INTERNET", "HOME", "WORK"};
-							}
-						};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="URL address";
-					name="URL";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params=
-						{
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Type";
-							name="TYPE";
-							data_type="";
-							enum_values={"HOME", "WORK"};
-							}
-						};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Note";
-					name="NOTE";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Title";
-					name="TITLE";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Organisation";
-					name="ORG";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Photo";
-					name="PHOTO";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Birthday";
-					name="BDAY";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Sound";
-					name="SOUND";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Wireless Village Id";
-					name="X-WV-ID";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Assistant name";
-					name="X-ASSISTANT";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Assistant phone";
-					name="X-ASSISTANT-TEL";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Anniversary";
-					name="X-ANNIVERSARY";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Spouse";
-					name="X-SPOUSE";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Children";
-					name="X-CHILDREN";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-			 SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Nickname";
-					name="X-EPOCSECONDNAME";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Class";
-					name="X-CLASS";
-					data_type="";
-					enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="SIP protocol";
-					name="X-SIP";
-					data_type="";
-					enum_values={};
-					flags= 0;
-					max_size=256;
-					max_occur=0;
-					params=
-						{
-						SML_DATA_PROPERTY_PARAM
-							{
-							version=1;
-							display_name="Type";
-							name="TYPE";
-							data_type="";
-							enum_values={"POC", "SWIS", "VOIP"};
-							}
-						};
-					}
-				};
-				field_level=0;
-				}
-			};
-		mime_format_tx_pref=0;     // Preferred index for tx
-		mime_format_rx_pref=0;     // Preferred index for rx
-		folder_properties={};
-		filter_capabilities={};
-		max_size=0; 	// no limit
-		max_items=0; 	// no limit
-		flags=0;
-	}
-	
-// End of File  
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/group/bld.inf	Tue Aug 31 15:05:37 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:  build info file for DS Dummy adapter
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_MMPFILES
-.\nsmldummydataprovider.mmp
-
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/group/def/bwinscwdummydataprovideru.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
-
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/group/def/eabidummydataprovideru.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-EXPORTS
-	_Z24ImplementationGroupProxyRi @ 1 NONAME
-	_ZTI19CNSmlDummyDataStore @ 2 NONAME
-	_ZTI22CNSmlDummyDataProvider @ 3 NONAME
-	_ZTV19CNSmlDummyDataStore @ 4 NONAME
-	_ZTV22CNSmlDummyDataProvider @ 5 NONAME
-
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/group/nsmldummydataprovider.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +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:  mmp file for DS Dummy Adapter
-*
-*/
-
-#include <platform_paths.hrh>
-#include <defaultcaps.hrh>
-#include <data_caging_paths.hrh>
-
-CAPABILITY CAP_ECOM_PLUGIN
-
-TARGET          nsmldummydataprovider.dll
-TARGETPATH      PLUGINS_1_DIR
-TARGETTYPE      PLUGIN
-UID             0x10009D8D 0x2002DC7E
-VENDORID        VID_DEFAULT
-
-#if defined(ARMCC)
-DEFFILE            ./def/eabidummydataprovider
-#elif defined(WINSCW)
-DEFFILE            ./def/bwinscwdummydataprovider
-#endif
-
-SOURCEPATH      ../src
-SOURCE          nsmldummydataprovider.cpp
-SOURCE          nsmldummydatastore.cpp
-SOURCE          nsmldummydllmain.cpp
-
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE     /epoc32/include/ecom
-SYSTEMINCLUDE     /epoc32/include/syncml
-
-USERINCLUDE     ../inc
-
-SOURCEPATH      ../data
-START RESOURCE nsmldummydataprovider.rss
-    HEADER
-    TARGET nsmldummydataprovider.rsc
-    TARGETPATH ECOM_RESOURCE_DIR
-    LANG    sc
-END
-
-START RESOURCE nsmldummydatastoreformat_1_1_2.rss
-    HEADER
-    TARGET         nsmldummydatastoreformat_1_1_2.rsc
-    TARGETPATH  RESOURCE_FILES_DIR 
-    LANG    sc
-END 
-
-START RESOURCE nsmldummydatastoreformat_1_2.rss
-    HEADER
-    TARGET         nsmldummydatastoreformat_1_2.rsc
-    TARGETPATH  RESOURCE_FILES_DIR 
-    LANG    sc
-END 
-
-LIBRARY        ECom.lib
-LIBRARY        bafl.lib
-LIBRARY        euser.lib
-LIBRARY        efsrv.lib
-LIBRARY        estor.lib
-LIBRARY        nsmldebug.lib
-LIBRARY        sysutil.lib
-LIBRARY        nsmlchangefinder.lib  
-LIBRARY        wbxmllib.lib
-LIBRARY        nsmldatamod.lib
-LIBRARY        smlstoreformat.lib
-LIBRARY        smldataprovider.lib
-LIBRARY        nsmldshostclient.lib
-LIBRARY        nsmlcontactsdatastoreextension.lib
-LIBRARY        nsmlcontactsdataprovider.lib
-
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummydataprovider.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +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:  DS Dummy dataprovider
-*
-*/
-
-#ifndef CNSMLDUMMYDATAPROVIDER_H
-#define CNSMLDUMMYDATAPROVIDER_H
-
-//  EXTERNAL INCLUDES
-#include <e32base.h>
-
-
-//  INTERNAL INCLUDES
-#include "nsmlcontactsdataprovider.h"
-
-//  CONSTANTS
-const TUint KNSmlDummyAdapterImplUid = 0x2002DC7E;
-
-
-
-//  CLASS DEFINITION
-/**
- * Dataprovider class for Dummy adapters
- * @lib nsmldummydataprovider.lib
- * @since 5.0
- */
-class CNSmlDummyDataProvider : public CNSmlContactsDataProvider
-    {
-    
-    private:    // Friend class definitions
-        friend class CNSmlDummyDataProvider_Test;
-    
-    public:     // Constructors and destructor
-        static CNSmlDummyDataProvider* NewL();
-        static CNSmlDummyDataProvider* NewLC();
-        ~CNSmlDummyDataProvider();
-
-    protected:    // Constructors
-        CNSmlDummyDataProvider();
-        void ConstructL();
-
-    protected:  // CSmlDataProvider
-        /**
-         * Not supported currently.
-         * When framework event occurs this method is called with type of 
-         * the event TsmlFrameworkEvent and additional parameters aParam1 
-         * and aParam2.
-         */
-        void DoOnFrameworkEvent( TSmlFrameworkEvent aFrameworkEvent,
-            TInt aParam1, TInt aParam2 );
-
-        /**
-         * Returns True if operation of id aOpId is supported otherwise 
-         * returns False. Supported operations are KUidSmlSupportBatch 
-         * and KUidSmlSupportMultipleStores
-         */
-        TBool DoSupportsOperation( TUid aOpId ) const;
-
-        /**
-         * Reads CDP's DataStoreFormat from resources.
-         */
-        const CSmlDataStoreFormat& DoStoreFormatL();
-
-        /**
-         * Reads all Contact database names from client. 
-         * This calls CNSmlContactsDataStore method DoListStoresLC().
-         */
-        CDesCArray* DoListStoresLC();
-
-        /**
-         * Reads default database name from client. This calls 
-         * CNSmlContactsDataStore method DoGetDefaultFileNameL().
-         */
-        const TDesC& DoDefaultStoreL();
-
-        /**
-         * Creates new CSmlDataStore datastore instance
-         */
-        CSmlDataStore* DoNewStoreInstanceLC();
-
-        /**
-         * Not supported on CDP.
-         * (Returns the set of filters that can be used to send to the 
-         * SyncML server.)
-         */
-        const RPointerArray< CSyncMLFilter >& DoSupportedServerFiltersL();
-
-        /**
-         * Not supported on CDP.
-         * (The set of filters that can be used to send to the SyncML 
-         * server filtered with the set of keywords supported by the server.)
-         *  
-         */
-        void DoCheckSupportedServerFiltersL(
-            const CSmlDataStoreFormat& aServerDataStoreFormat, 
-            RPointerArray< CSyncMLFilter >& aFilters, 
-            TSyncMLFilterChangeInfo& aChangeInfo );
-
-        /**
-         * Not supported on CDP.
-         */
-        void DoCheckServerFiltersL( RPointerArray< CSyncMLFilter >& aFilters, 
-            TSyncMLFilterChangeInfo& aChangeInfo );
-
-        /**
-         * Not supported on CDP
-         * (Generates a record filter query to be sent to the SyncML server 
-         * for the provided filters.)
-         */
-        HBufC* DoGenerateRecordFilterQueryLC( 
-            const RPointerArray< CSyncMLFilter >& aFilters, 
-            TSyncMLFilterMatchType aMatch, TDes& aFilterMimeType, 
-            TSyncMLFilterType& aFilterType, TDesC& aStoreName );
-
-        /**
-         * Not supported on CDP
-         * (Generates a field filter query to be sent to the SyncML server 
-         * for the provided filters.)
-         */
-        void DoGenerateFieldFilterQueryL(
-            const RPointerArray< CSyncMLFilter >& aFilters, 
-            TDes& aFilterMimeType, 
-            RPointerArray< CSmlDataProperty >& aProperties, TDesC& aStoreName );
-
-        const TDesC& GetStoreFormatResourceFileL() const;
-        CNSmlContactsDataStore* CreateDataStoreLC() const;
-
-    };
-
-
-#endif      //  CNSMLDUMMYDATAPROVIDER_H
-
-// End of file
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummydatastore.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,313 +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:  DS Dummy datastore
-*
-*/
-
-#ifndef CNSMLDUMMYDATASTORE_H
-#define CNSMLDUMMYDATASTORE_H
-
-//  EXTERNAL INCLUDES
-#include <nsmlcontactsdatastore.h>
-
-// Device Info resource filenames
-_LIT( KNSmlDummyContactsStoreFormatRsc_1_1_2, "NSmlDummyDataStoreFormat_1_1_2.rsc" );
-_LIT( KNSmlDummyContactsStoreFormatRsc_1_2, "NSmlDummyDataStoreFormat_1_2.rsc" );
-
-//  CLASS DEFINITION
-/**
- * Datastore class for Dummy adapters
- * @lib nsmldummydataprovider.lib
- * @since 3.23
- */
-class CNSmlDummyDataStore : public CNSmlContactsDataStore
-    {
-    private:    // Friend class definitions (for unit test purposes)
-        friend class CNSmlDummyDataStore_Test;
-        friend class CNSmlDummyDataStoreWaiter;
-        
-    public:     // Constructors and destructor
-
-        static CNSmlDummyDataStore* NewL();
-        static CNSmlDummyDataStore* NewLC();
-        ~CNSmlDummyDataStore();
-
-    protected:    // Constructors
-
-        CNSmlDummyDataStore();
-        void ConstructL();
-
-    protected:  // From CNSmlContactsDataStore
-
-        /**
-         * Opens datastore for read/write access. Store to open is specified 
-         * by datastore name aStoreName and syncronisation relationship 
-         * aContext. Command status is returned in aStatus. Internal state 
-         * of this class instance is set to ENSmlOpenAndWaiting and was 
-         * expected to be ENSmlClosed before calling this method, otherwise 
-         * KErrInUse error is returned.
-         */
-        void DoOpenL( const TDesC& aStoreName, MSmlSyncRelationship& aContext,
-            TRequestStatus& aStatus);
-
-        /**
-         * Cancels the current asynchronous request (including OpenL()-method.)
-         */
-        void DoCancelRequest();
-
-        /**
-         * Returns the name of the currently opened datastore.
-         */
-        const TDesC& DoStoreName() const;
-
-        /**
-         * Not supported currently (Starts the transaction.)
-         */
-        void DoBeginTransactionL();
-
-        /**
-         * Not supported currently
-         * 
-         * (After executing operations for data items and no errors has 
-         * occurred CommitTransactionL() is called. aStatus is a return 
-         * status for CommitTransactionL()method.) 
-         */
-        void DoCommitTransactionL( TRequestStatus& aStatus );
-
-        /**
-         * Not supported currently
-         *  
-         * (If an execution of an operation for a dataitem fails during 
-         * transaction then RevertTransactionL() is called. aStatus is 
-         * a return status for RevertTransactionL()method. )
-         */
-        void DoRevertTransaction( TRequestStatus& aStatus );
-
-        /**
-         * Starts the batch. During this mode calls to CreateItemL(), 
-         * ReplaceItemL(), WriteItemL(), CommitItemL(), MoveItemL(), 
-         * DeleteItemL() and SoftDeleteItemL() will be buffered until 
-         * DoCommitBatchL().
-         */
-        void DoBeginBatchL();
-
-        /**
-         * Executes all batched commands. Results for items are returned 
-         * in array structure aResultArray and status for CommitBatchL 
-         * is returned in aStatus.
-         */
-        void DoCommitBatchL( RArray< TInt >& aResultArray,
-            TRequestStatus& aStatus );
-
-        /**
-         * Cancels the ongoing batch command buffering and frees all 
-         * buffered commands.
-         */
-        void DoCancelBatch();
-
-        /**
-         * Sets the datastore format according aServerDataStoreFormat 
-         * structure. This is used in stripping and merging.
-         */
-        void DoSetRemoteStoreFormatL(
-            const CSmlDataStoreFormat& aServerDataStoreFormat );
-
-        /**
-         * Sets the SyncML Remote Server maximum object size. This size 
-         * is used to check that only smaller items than maximum object 
-         * size are sent to SyncML Remote Server. 
-         */
-        void DoSetRemoteMaxObjectSize( TInt aServerMaxObjectSize );
-
-        /**
-         * Returns the maximum object size of data provider. Size is read 
-         * from resources if they are already opened otherwise default 
-         * value KNSmlDataStoreMaxSize is returned.
-         */
-        TInt DoMaxObjectSize() const;
-
-        /**        
-         * Indicates that SyncML Remote Server is going to read item with 
-         * ReadItemL() method. Input value aUid indicates item id to open, 
-         * references returned aFieldChange, aSize, aParent, aMimeType, 
-         * aMimeVer and aStatus indicates if fieldchange is possible, 
-         * parent uid, item’s mimetype, item’s mimeversion and status of 
-         * this commands execution respectively. aFieldChange is not currently
-         * supported. Internal state of this class instance is set to 
-         * ENSmlItemOpen and was expected to be ENSmlOpenAndWaiting before 
-         * calling this method, otherwise KErrNotReady error is returned. 
-         */
-        void DoOpenItemL( TSmlDbItemUid aUid, TBool& aFieldChange, 
-            TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType,
-            TDes8& aMimeVer, TRequestStatus& aStatus );
-
-        /**
-         * Indicates that SyncML Remote Server is going to create item with 
-         * WriteItemL() method. Input values aSize, aParent, aMimeType and 
-         * aMimeVer indicates item size that is to be created, parent’s uid, 
-         * item’s mimetype and item’s mimeversion respectively. Status of 
-         * this commands execution is returned in reference aStatus and 
-         * item’s uid that is created is returned in aUid. Internal state 
-         * of this class instance is set to ENSmlItemCreating and was expected 
-         * to be ENSmlOpenAndWaiting before calling this method, otherwise 
-         * KErrNotReady error is returned. 
-         */
-        void DoCreateItemL( TSmlDbItemUid& aUid, TInt aSize,
-            TSmlDbItemUid aParent, const TDesC8& aMimeType, 
-            const TDesC8& aMimeVer, TRequestStatus& aStatus );
-
-        /**
-         * Indicates that SyncPartner is going to replace item’s data with 
-         * WriteItemL() method. Input values aUid, aSize, aParent and 
-         * aFieldChange indicates item’s id, size, parent’s uid that is to 
-         * be replaced and if replace is field change respectively. Status 
-         * of this commands execution is returned in reference aStatus. 
-         * Internal state of this class instance is set to ENSmlItemUpdating 
-         * and was expected to be ENSmlOpenAndWaiting before calling this 
-         * method, otherwise KErrNotReady error is returned.
-         */
-        void DoReplaceItemL( TSmlDbItemUid aUid, TInt aSize,
-            TSmlDbItemUid aParent, TBool aFieldChange, 
-            TRequestStatus& aStatus );
-
-        /**
-         * Reads data from item at Data Store. Item must be opened with 
-         * DoOpenItemL() method before calling this method. Internal state 
-         * of this class instance is expected to be ENSmlItemOpen before 
-         * calling this method, otherwise KErrNotReady error is returned. 
-         * This method leaves with KErrEof when item is completely read.
-         */
-        void DoReadItemL( TDes8& aBuffer );
-
-        /**
-         * DoCreateItemL() or DoReplaceItemL() method must be called before 
-         * this method can be called. This method is called until all data 
-         * to current item is written. Internal state of this class instance 
-         * is expected to be ENSmlItemCreating or ENSmlItemUpdating before 
-         * calling this method, otherwise KErrNotReady error is returned.
-         */
-        void DoWriteItemL( const TDesC8& aData );
-
-        /**
-         * Commits item changes to Contacts database. This method updates 
-         * Contacts database through contacts model method ImportContactsL 
-         * to update or to create item respectively. Internal state of this 
-         * class instance is expected to be ENSmlItemCreating or 
-         * ENSmlItemUpdating before calling this method, otherwise 
-         * KErrNotReady error is returned.On BatchMode KErrNone returned 
-         * and final command status(es) for each buffered command is returned 
-         * when DoCommitBatchL() is called.
-         */
-        void DoCommitItemL( TRequestStatus& aStatus );
-
-        /**
-         * Closes operations for opened item. Called after DoReadItemL().
-         */
-        void DoCloseItem();
-
-        /**
-         * Not supported for Contacts data provider.
-         */
-        void DoMoveItemL( TSmlDbItemUid aUid,
-            TSmlDbItemUid aNewParent, TRequestStatus& aStatus );
-
-        /**
-         * Deletes item with given aUid.
-         */
-        void DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus );
-
-        /**
-         * Soft delete is not supported.
-         */
-        void DoSoftDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus );
-
-        /**
-         * Deletes all items except OwnCardId. ChangeFinder data is resetted.
-         */
-        void DoDeleteAllItemsL( TRequestStatus& aStatus );
-
-        /**
-         * Returns True if synchronisation history is available for server, 
-         * otherwise False. Checks also that database id is not changed 
-         * for some reason.
-         */
-        TBool DoHasSyncHistory() const;
-
-        /**
-         * Returns UIDs of items that are added to client after previous 
-         * synchronization.  ChangeFinder-method FindNewItemsL() called 
-         * to get list.
-         */
-        const MSmlDataItemUidSet& DoAddedItems() const;
-
-        /**
-         * Returns UIDs of items that are deleted from client after previous 
-         * synchronization. ChangeFinder-method FindDeletedItemsL() called 
-         * to get list.
-         */
-        const MSmlDataItemUidSet& DoDeletedItems() const;
-
-        /**
-         * Returns UIDs of items that are softdeleted from client after 
-         * previous synchronization. ChangeFinder-method 
-         * FindSoftDeletedItemsL() called to get list.
-         */
-        const MSmlDataItemUidSet& DoSoftDeletedItems() const;
-
-        /**
-         * Returns UIDs of items that are updated in client after previous 
-         * synchronization. ChangeFinder-method FindChangedItemsL() called 
-         * to get list.
-         */
-        const MSmlDataItemUidSet& DoModifiedItems() const;
-
-        /**
-         * Not actually supported for Contacts.
-         * Returns UIDs of items that are moved in client after previous 
-         * synchronization. ChangeFinder-method FindMovedItemsL() called 
-         * to get list.
-         */
-        const MSmlDataItemUidSet& DoMovedItems() const;
-
-        /**
-         * Resets the current synchronisation history by ChangeFinder 
-         * ResetL()-method. ResetChangeInfoL()status is returned in aStatus.
-         */
-        void DoResetChangeInfoL( TRequestStatus& aStatus );
-
-        /**
-         * Commits change info changes with ChangeFinder 
-         * CommitChangesL()-method and returns status for uid set aItems. 
-         * CommitChangeInfoL()status is returned in aStatus. This method 
-         * is called for all commands succefully executed in HostServer.
-         */
-        void DoCommitChangeInfoL( TRequestStatus& aStatus, 
-            const MSmlDataItemUidSet& aItems );
-
-        /**
-         * Commits change info changes with ChangeFinder 
-         * CommitChangesL()-method and returns status in aStatus.
-         */
-        void DoCommitChangeInfoL( TRequestStatus& aStatus );
-
-        const TDesC& GetStoreFormatResourceFileL() const;        
-        TInt DoExecuteBufferL( RArray< TInt >& aResultArray );
-        CNSmlDataModBase& GetDataMod();
-        TInt ExportContactsL( const TUid& aUid, CBufBase& aContactBufBase );
-        CArrayFixFlat<TUid>* ImportContactsL( const TDesC8& aContactBufBase );
-    };
-
-#endif      //  CNSMLDUMMYDATASTORE_H
-
-// End of file
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/readme.txt	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-What is DummyAdapter?
-
-Dummy adapter is a ECOM plugin, which acts as a stub implementation for Adapter Customization API. It is a SyncML adapter, which fully implements Adapter Customization API interface, but does not extend or restrict the default functionality provided by platform. Dummy adapter works identically compared to platform contact adapter. It enables to synchronize contacts with SyncML servers, such as Nokia OVI server, using vCards.
-
-Dummy adapter can be also used as a skeleton for new operator adapters. This will reduce the work effort to implement new operator specific adapters compared to starting implementation from the scratch.
-
-
-How to synchronize with OVI server using Dummy adapter?
-
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydataprovider.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,251 +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:  DS Dummy dataprovider
-*
-*/
-
-//  CLASS HEADER
-#include "nsmldummydataprovider.h"
-
-//  EXTERNAL INCLUDES
-#include <datasyncinternalpskeys.h>
-#include <e32property.h>
-#include <nsmldebug.h>
-
-// INTERNAL INCLUDES
-#include "nsmldummydatastore.h"
-
-
-// -----------------------------------------------------------------------------
-// CNSmlDummyDataProvider::NewL
-// -----------------------------------------------------------------------------
-//
-CNSmlDummyDataProvider* CNSmlDummyDataProvider::NewL()
-    {
-    CNSmlDummyDataProvider* self = CNSmlDummyDataProvider::NewLC();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlDummyDataProvider::NewLC
-// -----------------------------------------------------------------------------
-//
-CNSmlDummyDataProvider* CNSmlDummyDataProvider::NewLC()
-    {
-    CNSmlDummyDataProvider* self = new( ELeave ) CNSmlDummyDataProvider;
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlDummyDataProvider::~CNSmlDummyDataProvider
-// -----------------------------------------------------------------------------
-//
-CNSmlDummyDataProvider::~CNSmlDummyDataProvider()
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::~CNSmlDummyDataProvider(): begin");
-    _DBG_FILE("CNSmlDummyDataProvider::~CNSmlDummyDataProvider(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlDummyDataProvider::CNSmlDummyDataProvider
-// -----------------------------------------------------------------------------
-//
-CNSmlDummyDataProvider::CNSmlDummyDataProvider()
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::CNSmlDummyDataProvider(): begin");
-    _DBG_FILE("CNSmlDummyDataProvider::CNSmlDummyDataProvider(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataProvider::ConstructL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataProvider::ConstructL()
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::ConstructL(): begin");
-    CNSmlContactsDataProvider::ConstructL();
-    _DBG_FILE("CNSmlDummyDataProvider::ConstructL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataProvider::DoOnFrameworkEvent
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataProvider::DoOnFrameworkEvent( TSmlFrameworkEvent aFrameworkEvent, 
-    TInt aParam1, TInt aParam2 )
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoOnFrameworkEvent(): begin");
-    CNSmlContactsDataProvider::DoOnFrameworkEvent( aFrameworkEvent, 
-        aParam1, aParam2 );
-    _DBG_FILE("CNSmlDummyDataProvider::DoOnFrameworkEvent(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// TBool CNSmlDummyDataProvider::DoSupportsOperation
-// -----------------------------------------------------------------------------
-//
-TBool CNSmlDummyDataProvider::DoSupportsOperation( TUid aOpId ) const
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoSupportsOperation()");
-    return CNSmlContactsDataProvider::DoSupportsOperation( aOpId );
-    }
-
-// -----------------------------------------------------------------------------
-// const CSmlDataStoreFormat& CNSmlDummyDataProvider::DoStoreFormatL
-// -----------------------------------------------------------------------------
-//
-const CSmlDataStoreFormat& CNSmlDummyDataProvider::DoStoreFormatL()
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoStoreFormatL()");
-    return CNSmlContactsDataProvider::DoStoreFormatL();
-    }
-
-// -----------------------------------------------------------------------------
-// CDesCArray* CNSmlDummyDataProvider::DoListStoresLC
-// -----------------------------------------------------------------------------
-//
-CDesCArray* CNSmlDummyDataProvider::DoListStoresLC()
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoListStoresLC()");
-    return CNSmlContactsDataProvider::DoListStoresLC();
-    }
-
-// -----------------------------------------------------------------------------
-// const TDesC& CNSmlDummyDataProvider::DoDefaultStoreL
-// -----------------------------------------------------------------------------
-//
-const TDesC& CNSmlDummyDataProvider::DoDefaultStoreL()
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoDefaultStoreL()");
-    return CNSmlContactsDataProvider::DoDefaultStoreL();
-    }
-
-// -----------------------------------------------------------------------------
-// CSmlDataStore*CNSmlDummyDataProvider::DoNewStoreInstanceLC
-// -----------------------------------------------------------------------------
-//
-CSmlDataStore* CNSmlDummyDataProvider::DoNewStoreInstanceLC()
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoNewStoreInstanceLC()");
-    return CNSmlContactsDataProvider::DoNewStoreInstanceLC();
-    }
-
-// -----------------------------------------------------------------------------
-// const RPointerArray< CSyncMLFilter >& CNSmlDummyDataProvider::
-// -----------------------------------------------------------------------------
-//
-const RPointerArray< CSyncMLFilter >& CNSmlDummyDataProvider::DoSupportedServerFiltersL()
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoSupportedServerFiltersL()");
-    return CNSmlContactsDataProvider::DoSupportedServerFiltersL();
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataProvider::DoCheckSupportedServerFiltersL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataProvider::DoCheckSupportedServerFiltersL(
-    const CSmlDataStoreFormat& aServerDataStoreFormat, 
-    RPointerArray< CSyncMLFilter >& aFilters, 
-    TSyncMLFilterChangeInfo& aChangeInfo )
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoCheckSupportedServerFiltersL(): begin");
-    CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL(
-        aServerDataStoreFormat, aFilters, aChangeInfo );
-    _DBG_FILE("CNSmlDummyDataProvider::DoCheckSupportedServerFiltersL(): end");
-    }
-
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataProvider::DoCheckServerFiltersL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataProvider::DoCheckServerFiltersL( 
-    RPointerArray< CSyncMLFilter >& aFilters, 
-    TSyncMLFilterChangeInfo& aChangeInfo )
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoCheckServerFiltersL(): begin");
-    CNSmlContactsDataProvider::DoCheckServerFiltersL( aFilters, aChangeInfo );
-    _DBG_FILE("CNSmlDummyDataProvider::DoCheckServerFiltersL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// HBufC* CNSmlDummyDataProvider::DoGenerateRecordFilterQueryLC
-// -----------------------------------------------------------------------------
-//
-HBufC* CNSmlDummyDataProvider::DoGenerateRecordFilterQueryLC( 
-    const RPointerArray< CSyncMLFilter >& aFilters, 
-    TSyncMLFilterMatchType aMatch, TDes& aFilterMimeType, 
-    TSyncMLFilterType& aFilterType, TDesC& aStoreName )
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoGenerateRecordFilterQueryLC()");
-    return CNSmlContactsDataProvider::DoGenerateRecordFilterQueryLC( 
-        aFilters, aMatch, aFilterMimeType, aFilterType, aStoreName );
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataProvider::DoGenerateFieldFilterQueryL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataProvider::DoGenerateFieldFilterQueryL(
-    const RPointerArray< CSyncMLFilter >& aFilters, TDes& aFilterMimeType, 
-    RPointerArray< CSmlDataProperty >& aProperties, TDesC& aStoreName )
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoGenerateFieldFilterQueryL(): begin");
-    CNSmlContactsDataProvider::DoGenerateFieldFilterQueryL(
-        aFilters, aFilterMimeType, aProperties, aStoreName );
-    _DBG_FILE("CNSmlDummyDataProvider::DoGenerateFieldFilterQueryL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlDummyDataProvider::GetStoreFormatResourceFileL
-// -----------------------------------------------------------------------------
-//
-const TDesC& CNSmlDummyDataProvider::GetStoreFormatResourceFileL() const
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::DoStoreFormatL(): begin");
-
-    // Check correct Data Sync protocol
-    TInt value( EDataSyncNotRunning );
-    TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
-                                 KDataSyncStatus,
-                                 value );
-
-    if ( error == KErrNone && value == EDataSyncRunning )
-        {
-        _DBG_FILE("CNSmlDummyDataProvider::DoStoreFormatL(): end");
-        return KNSmlDummyContactsStoreFormatRsc_1_1_2;
-        }
-    else // error or protocol version 1.2
-        {
-        _DBG_FILE("CNSmlDummyDataProvider::DoStoreFormatL(): end");
-        return KNSmlDummyContactsStoreFormatRsc_1_2;
-        }
-    }
-
-// ------------------------------------------------------------------------------------------------
-// CNSmlDummyDataProvider::CreateDataStoreLC
-// ------------------------------------------------------------------------------------------------
-//
-CNSmlContactsDataStore* CNSmlDummyDataProvider::CreateDataStoreLC() const
-    {
-    _DBG_FILE("CNSmlDummyDataProvider::CreateDataStoreLC()");
-    CNSmlContactsDataStore* dataStore = CNSmlDummyDataStore::NewLC();
-    return dataStore;
-    }
-
-// End of file
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydatastore.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,496 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  DS Dummy datastore
-*
-*/
-
-//  CLASS HEADER
-#include "nsmldummydatastore.h"
-
-//  EXTERNAL INCLUDES
-#include <DataSyncInternalPSKeys.h>
-#include <e32property.h>
-#include <nsmldebug.h>
-
-// -----------------------------------------------------------------------------
-// CNSmlDummyDataStore::NewL
-// -----------------------------------------------------------------------------
-//
-CNSmlDummyDataStore* CNSmlDummyDataStore::NewL()
-    {
-    CNSmlDummyDataStore* self = CNSmlDummyDataStore::NewLC();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlDummyDataStore::NewLC
-// -----------------------------------------------------------------------------
-//
-CNSmlDummyDataStore* CNSmlDummyDataStore::NewLC()
-    {
-    CNSmlDummyDataStore* self = new( ELeave ) CNSmlDummyDataStore;
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlDummyDataStore::CNSmlDummyDataStore
-// -----------------------------------------------------------------------------
-//
-CNSmlDummyDataStore::CNSmlDummyDataStore()
-    {
-    _DBG_FILE("CNSmlDummyDataStore::CNSmlDummyDataStore()");
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlDummyDataStore::ConstructL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::ConstructL()
-    {
-    _DBG_FILE("CNSmlDummyDataStore::ConstructL(): begin");
-    CNSmlContactsDataStore::ConstructL();
-    _DBG_FILE("CNSmlDummyDataStore::ConstructL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlDummyDataStore::~CNSmlDummyDataStore
-// -----------------------------------------------------------------------------
-//
-CNSmlDummyDataStore::~CNSmlDummyDataStore()
-    {
-    _DBG_FILE("CNSmlDummyDataStore::~CNSmlDummyDataStore()");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoOpenL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoOpenL( const TDesC& aStoreName,
-    MSmlSyncRelationship& aContext, TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoOpenL(): begin");
-    CNSmlContactsDataStore::DoOpenL( aStoreName, aContext, aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoOpenL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoCancelRequest
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoCancelRequest()
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoCancelRequest(): begin");
-    CNSmlContactsDataStore::DoCancelRequest();
-    _DBG_FILE("CNSmlDummyDataStore::DoCancelRequest(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// const TDesC& CNSmlDummyDataStore::DoStoreName
-// -----------------------------------------------------------------------------
-//
-const TDesC& CNSmlDummyDataStore::DoStoreName() const
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoStoreName(): begin");
-    return CNSmlContactsDataStore::DoStoreName();
-    _DBG_FILE("CNSmlDummyDataStore::DoStoreName(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoBeginTransactionL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoBeginTransactionL()
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoBeginTransactionL(): begin");
-    CNSmlContactsDataStore::DoBeginTransactionL();
-    _DBG_FILE("CNSmlDummyDataStore::DoBeginTransactionL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoCommitTransactionL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoCommitTransactionL( TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoCommitTransactionL(): begin");
-    CNSmlContactsDataStore::DoCommitTransactionL( aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoCommitTransactionL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoRevertTransaction
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoRevertTransaction( TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoRevertTransaction(): begin");
-    CNSmlContactsDataStore::DoRevertTransaction( aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoRevertTransaction(): end");
-    }
-
-// ----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoBeginBatchL
-// ----------------------------------------------------------------------------
-void CNSmlDummyDataStore::DoBeginBatchL()
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoBeginBatchL(): begin");
-    CNSmlContactsDataStore::DoBeginBatchL();
-    _DBG_FILE("CNSmlDummyDataStore::DoBeginBatchL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoCommitBatchL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoCommitBatchL( RArray< TInt >& aResultArray,
-    TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoCommitBatchL(): begin");
-    CNSmlContactsDataStore::DoCommitBatchL( aResultArray, aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoCommitBatchL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoCancelBatch
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoCancelBatch()
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoCancelBatch(): begin");
-    CNSmlContactsDataStore::DoCancelBatch();
-    _DBG_FILE("CNSmlDummyDataStore::DoCancelBatch(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoSetRemoteStoreFormatL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoSetRemoteStoreFormatL(
-    const CSmlDataStoreFormat& aServerDataStoreFormat )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoSetRemoteStoreFormatL(): begin");
-    CNSmlContactsDataStore::DoSetRemoteStoreFormatL( aServerDataStoreFormat );
-    _DBG_FILE("CNSmlDummyDataStore::DoSetRemoteStoreFormatL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoSetRemoteMaxObjectSize
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoSetRemoteMaxObjectSize( TInt aServerMaxObjectSize )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoSetRemoteMaxObjectSize(): begin");
-    CNSmlContactsDataStore::DoSetRemoteMaxObjectSize( aServerMaxObjectSize );
-    _DBG_FILE("CNSmlDummyDataStore::DoSetRemoteMaxObjectSize(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// TInt CNSmlDummyDataStore::DoMaxObjectSize
-// -----------------------------------------------------------------------------
-//
-TInt CNSmlDummyDataStore::DoMaxObjectSize() const
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoMaxObjectSize()");
-    return CNSmlContactsDataStore::DoMaxObjectSize();
-    }
-
-// ----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoOpenItemL
-// ----------------------------------------------------------------------------
-void CNSmlDummyDataStore::DoOpenItemL( TSmlDbItemUid aUid,
-    TBool& aFieldChange, TInt& aSize, TSmlDbItemUid& aParent,
-    TDes8& aMimeType, TDes8& aMimeVer, TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoOpenItemL(): begin");
-	CNSmlContactsDataStore::DoOpenItemL( aUid, aFieldChange,
-			aSize, aParent, aMimeType, aMimeVer, aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoOpenItemL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoCreateItemL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoCreateItemL( TSmlDbItemUid& aUid, TInt aSize,
-    TSmlDbItemUid aParent, const TDesC8& aMimeType, const TDesC8& aMimeVer, 
-    TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoCreateItemL(): begin");
-    CNSmlContactsDataStore::DoCreateItemL( aUid, aSize, aParent, aMimeType, 
-        aMimeVer, aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoCreateItemL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoReplaceItemL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoReplaceItemL( TSmlDbItemUid aUid, TInt aSize, 
-    TSmlDbItemUid aParent, TBool aFieldChange, TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoReplaceItemL(): begin");
-    CNSmlContactsDataStore::DoReplaceItemL( aUid, aSize, aParent, aFieldChange, 
-        aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoReplaceItemL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoReadItemL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoReadItemL( TDes8& aBuffer )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoReadItemL(): begin");
-    CNSmlContactsDataStore::DoReadItemL( aBuffer );
-    _DBG_FILE("CNSmlDummyDataStore::DoReadItemL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoWriteItemL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoWriteItemL( const TDesC8& aData )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoWriteItemL(): begin");
-    CNSmlContactsDataStore::DoWriteItemL( aData );
-    _DBG_FILE("CNSmlDummyDataStore::DoWriteItemL(): end");
-    }
-
-// ----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoCommitItemL()
-// ----------------------------------------------------------------------------
-void CNSmlDummyDataStore::DoCommitItemL( TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoCommitItemL(): begin");
-    CNSmlContactsDataStore::DoCommitItemL( aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoCommitItemL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoCloseItem
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoCloseItem()
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoCloseItem(): begin");
-    CNSmlContactsDataStore::DoCloseItem();
-    _DBG_FILE("CNSmlDummyDataStore::DoCloseItem(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoMoveItemL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoMoveItemL( TSmlDbItemUid aUid, 
-    TSmlDbItemUid aNewParent, TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoMoveItemL(): begin");
-    CNSmlContactsDataStore::DoMoveItemL( aUid, aNewParent, aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoMoveItemL(): end");
-    }
-
-// ----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoDeleteItemL
-// ----------------------------------------------------------------------------
-void CNSmlDummyDataStore::DoDeleteItemL(
-    TSmlDbItemUid aUid, TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoDeleteItemL(): begin");
-    CNSmlContactsDataStore::DoDeleteItemL( aUid, aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoDeleteItemL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoSoftDeleteItemL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoSoftDeleteItemL( TSmlDbItemUid aUid, 
-    TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoSoftDeleteItemL(): begin");
-    CNSmlContactsDataStore::DoSoftDeleteItemL( aUid, aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoSoftDeleteItemL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoDeleteAllItemsL
-// -----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoDeleteAllItemsL( TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::: begin");
-    CNSmlContactsDataStore::DoDeleteAllItemsL( aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::: end");
-    }
-
-// ----------------------------------------------------------------------------
-// TBool CNSmlDummyDataStore::DoHasSyncHistory
-// ----------------------------------------------------------------------------
-TBool CNSmlDummyDataStore::DoHasSyncHistory() const
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoHasSyncHistory()");
-    return CNSmlContactsDataStore::DoHasSyncHistory();
-    }
-
-// ----------------------------------------------------------------------------
-// const MSmlDataItemUidSet& CNSmlDummyDataStore::DoAddedItems
-// ----------------------------------------------------------------------------
-//
-const MSmlDataItemUidSet& CNSmlDummyDataStore::DoAddedItems() const
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoAddedItems()");
-    return CNSmlContactsDataStore::DoAddedItems();
-    }
-
-// ----------------------------------------------------------------------------
-// const MSmlDataItemUidSet& CNSmlDummyDataStore::DoDeletedItems
-// ----------------------------------------------------------------------------
-//
-const MSmlDataItemUidSet& CNSmlDummyDataStore::DoDeletedItems() const
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoDeletedItems()");
-    return CNSmlContactsDataStore::DoDeletedItems();
-    }
-
-// ----------------------------------------------------------------------------
-// const MSmlDataItemUidSet& CNSmlDummyDataStore::DoSoftDeletedItems
-// ----------------------------------------------------------------------------
-//
-const MSmlDataItemUidSet& CNSmlDummyDataStore::DoSoftDeletedItems() const
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoSoftDeletedItems()");
-    return CNSmlContactsDataStore::DoSoftDeletedItems();
-    }
-
-// ----------------------------------------------------------------------------
-// const MSmlDataItemUidSet& CNSmlDummyDataStore::DoModifiedItems
-// ----------------------------------------------------------------------------
-//
-const MSmlDataItemUidSet& CNSmlDummyDataStore::DoModifiedItems() const
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoModifiedItems()");
-    return CNSmlContactsDataStore::DoModifiedItems();
-    }
-
-// ----------------------------------------------------------------------------
-// const MSmlDataItemUidSet& CNSmlDummyDataStore::DoMovedItems
-// ----------------------------------------------------------------------------
-//
-const MSmlDataItemUidSet& CNSmlDummyDataStore::DoMovedItems() const
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoMovedItems()");
-    return CNSmlContactsDataStore::DoMovedItems();
-    }
-
-// ----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoResetChangeInfoL
-// ----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoResetChangeInfoL(): begin");
-    CNSmlContactsDataStore::DoResetChangeInfoL( aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoResetChangeInfoL(): end");
-    }
-
-// ----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoCommitChangeInfoL
-// ----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus,
-    const MSmlDataItemUidSet& aItems )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(aItems): begin");
-    CNSmlContactsDataStore::DoCommitChangeInfoL( aStatus, aItems );
-    _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(aItems): end");
-    }
-
-// ----------------------------------------------------------------------------
-// void CNSmlDummyDataStore::DoCommitChangeInfoL
-// ----------------------------------------------------------------------------
-//
-void CNSmlDummyDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(): begin");
-    CNSmlContactsDataStore::DoCommitChangeInfoL( aStatus );
-    _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// const TDesC& CNSmlDummyDataStore::GetStoreFormatResourceFileL
-// -----------------------------------------------------------------------------
-const TDesC& CNSmlDummyDataStore::GetStoreFormatResourceFileL() const
-    {
-    _DBG_FILE("CNSmlDummyDataStore::GetStoreFormatResourceFileL()");
-    // Check correct Data Sync protocol
-    TInt value( EDataSyncNotRunning );
-    TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
-                                 KDataSyncStatus,
-                                 value );
-    if ( error == KErrNone && value == EDataSyncRunning )
-        {
-        return KNSmlDummyContactsStoreFormatRsc_1_1_2;
-        }
-    else // error or protocol version 1.2
-        {
-        return KNSmlDummyContactsStoreFormatRsc_1_2;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// TInt CNSmlDummyDataStore::DoExecuteBufferL
-// -----------------------------------------------------------------------------
-//
-TInt CNSmlDummyDataStore::DoExecuteBufferL( RArray< TInt >& aResultArray)
-    {
-    _DBG_FILE("CNSmlDummyDataStore::DoExecuteBufferL()");
-    return CNSmlContactsDataStore::DoExecuteBufferL( aResultArray );
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlDataModBase& CNSmlDummyDataStore::GetDataMod
-// -----------------------------------------------------------------------------
-//
-CNSmlDataModBase& CNSmlDummyDataStore::GetDataMod()
-    {
-    _DBG_FILE("CNSmlDummyDataStore::GetDataMod()");
-    return CNSmlContactsDataStore::GetDataMod();
-    }
-
-// -----------------------------------------------------------------------------
-// TInt CNSmlDummyDataStore::ExportContactsL
-// -----------------------------------------------------------------------------
-//
-TInt CNSmlDummyDataStore::ExportContactsL( const TUid& aUid, 
-    CBufBase& aContactBufBase )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::ExportContactsL()");
-    return CNSmlContactsDataStore::ExportContactsL( aUid, aContactBufBase );
-    }
-
-// -----------------------------------------------------------------------------
-// CArrayFixFlat<TUid>* CNSmlDummyDataStore::ImportContactsL
-// -----------------------------------------------------------------------------
-//
-CArrayFixFlat<TUid>* CNSmlDummyDataStore::ImportContactsL( 
-    const TDesC8& aContactBufBase )
-    {
-    _DBG_FILE("CNSmlDummyDataStore::ImportContactsL()");
-    return CNSmlContactsDataStore::ImportContactsL( aContactBufBase );
-    }
-
-// END OF FILE
--- a/contentctrl_plat/ds_contact_adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydllmain.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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:  DS Dummy adapter entry point
-*
-*/
-
-#include <ImplementationProxy.h>
-#include "nsmldebug.h"
-#include "nsmlDummydataprovider.h"
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy array
-// -----------------------------------------------------------------------------
-//
-#ifndef IMPLEMENTATION_PROXY_ENTRY
-#define IMPLEMENTATION_PROXY_ENTRY( aUid, aFuncPtr ) {{aUid},(aFuncPtr)}
-#endif
-
-const TImplementationProxy ImplementationTable[] =
-    {
-    IMPLEMENTATION_PROXY_ENTRY( KNSmlDummyAdapterImplUid, CNSmlDummyDataProvider::NewL )
-    };
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy
-// -----------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
-    {
-    _DBG_FILE("ImplementationGroupProxy() for CNSmlDummyDataProvider: begin");
-
-    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
-
-    _DBG_FILE("ImplementationGroupProxy() for CNSmlDummyDataProvider: end");
-    return ImplementationTable;
-    }
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/ds_contactsdatastoreextension_api.metaxml	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<api id="f25efbf3907ccc8bd84cbade3cfa386c" dataversion="2.0">
-  <name>ds_contactsdatastoreextension_api</name>
-  <description>Provides interface to call Contacts QTMobility APIs'</description>
-  <type>c++</type>
-  <collection>contentcontrol</collection>
-  <libs/>
-  <release category="platform" sinceversion=""/>
-  <attributes>
-    <htmldocprovided>no</htmldocprovided>
-    <adaptation>no</adaptation>
-  </attributes>
-</api>
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/group/bld.inf	Tue Aug 31 15:05:37 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:  
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-../inc/nsmlcontactsdatastoreextension.h        APP_LAYER_PLATFORM_EXPORT_PATH(nsmlcontactsdatastoreextension.h)
\ No newline at end of file
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/inc/nsmlcontactsdatastoreextension.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Contacts DataStore Extension API
-*
-*/
-
-#ifndef NSMLCONTACTSDATASTOREEXTENSION_H_
-#define NSMLCONTACTSDATASTOREEXTENSION_H_
-
-class CNsmlContactsDataStoreExtensionPrivate;
-class CNsmlContactItem;
-class RDesReadStream;
-
-class CNsmlContactsDataStoreExtension: public CBase
-{
-public:
-    /**
-    * Two-phased constructor.
-    */
-    IMPORT_C static CNsmlContactsDataStoreExtension* NewL( const TDesC& aManager );
-
-    /**
-    * Destructor.
-    */
-    IMPORT_C virtual ~CNsmlContactsDataStoreExtension();
-    
-protected:
-    /**
-    * C++ constructor.
-    */
-    IMPORT_C CNsmlContactsDataStoreExtension();
-    
-    /**
-    * Two-phased constructor.
-    */
-    IMPORT_C static CNsmlContactsDataStoreExtension* NewLC( const TDesC& aManager );
-    /**
-    * 2nd phase constructor.
-    */
-    IMPORT_C void ConstructL( const TDesC& aManager );
-    
-public: // Methods
-    /**
-    * Fetch the Contact Item from the DB 
-    * @param aUid UID of the desired item to be fetched
-    * @param aContactbufbase on return will have the fetched Contact details
-    */
-    IMPORT_C TInt ExportContactsL( const TUid& aUid, CBufBase& aContactbufbase );
-    
-    /**
-    * Store the Contact Item to the DB
-    * @param aContactbufbase Contact item to be saved to the DB
-    * @return A pointer to list of newly saved Contact UIDs'
-    */
-    IMPORT_C CArrayFixFlat<TUid>* ImportContactsL( const TDesC8& aContactbufbase );
-    
-    /**
-    * Fetch Contact details
-    * @param aUid UID of the desired Contact item
-    * @param aContactitem on return will have pointer class containing contact details
-    */
-    IMPORT_C TInt ReadContactL( const TUid& aUid, CNsmlContactItem* aContactitem );
-    
-    /**
-    * Delete a Contact
-    * @param aUid UID of the desired Contact item
-    * @return status of the operation
-    */
-    IMPORT_C TBool DeleteContactL( const TUid& aUid );
-    
-    /**
-    * Delete List of Contacts
-    * @param aArrDelete List of Contact UIDs' to be deleted
-    * @return status of the operation
-    */
-    IMPORT_C TBool DeleteContactsL( CArrayFixFlat<TUid>* aArrDelete );
-    
-    /**
-    * Delete All Contacts
-    * @return status of the operation
-    */
-    IMPORT_C TBool DeleteAllContactsL();
-    
-    /**
-    * List Supported Stores
-    * @param aCntstores on return will have list of stores
-    */
-    IMPORT_C void ListStoresL( CDesCArray* aCntstores );
-    
-    /**
-    * Unique ID for a Store
-    * @return unique id represented as integer  
-    */
-    IMPORT_C TInt64 MachineIdL();
-    
-    /**
-    * Fetch all available Contacts from the DB
-    * @param aContactuidlist on return will have list of all Contact UIDs'
-    */
-    IMPORT_C void ListContactsL( CArrayFixFlat<TUid>* aContactuidlist );
-	
-private: // Data
-	CNsmlContactsDataStoreExtensionPrivate* d_ptr;
-};
-
-class CNsmlContactItem: public CBase
-{
-public:
-    /**
-    * Two-phased constructor.
-    */
-    IMPORT_C static CNsmlContactItem* NewL();
-
-    /**
-    * Destructor.
-    */
-    IMPORT_C virtual ~CNsmlContactItem();
-    
-protected:
-    /**
-    * C++ constructor.
-    */
-    IMPORT_C CNsmlContactItem();
-    
-    /**
-    * Two-phased constructor.
-    */
-    IMPORT_C static CNsmlContactItem* NewLC();
- 
-public: // Data
-    TTime iLastModified;
-    HBufC8* iGuid;
-    TUid iUid;
-};
-
-#endif /* NSMLCONTACTSDATASTOREEXTENSION_H_*/
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/bwins/TestCntDataStoreExtnu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
-
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/conf/TestCntDataStoreExtn.cfg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-[Test]
-title ALLTEST
-create TestCntDataStoreExtn obj
-obj ImportContacts
-obj ListContacts
-obj ExportContacts
-obj ReadContact
-obj ListStores
-obj MachineID
-obj DeleteContact
-obj ImportContacts
-obj ListContacts
-obj DeleteContacts
-obj ImportContacts
-obj ListContacts
-obj DeleteAllContacts
-delete obj
-[Endtest]
\ No newline at end of file
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/eabi/TestCntDataStoreExtnu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
-
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/group/TestCntDataStoreExtn.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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: definition of dm constants/exported methods
-* 	This is part of remotemgmt_plat.
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-TARGET          TestCntDataStoreExtn.dll
-TARGETTYPE      dll
-UID             0x1000008D 0x2002DC82
-
-CAPABILITY      ALL -TCB
-
-DEFFILE         TestCntDataStoreExtn.def
-
-SOURCEPATH      ../src
-SOURCE          TestCntDataStoreExtn.cpp
-SOURCE          TestCntDataStoreExtnBlocks.cpp
-
-
-USERINCLUDE     ../inc 
-
-
-MW_LAYER_SYSTEMINCLUDE
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY         euser.lib
-LIBRARY			efsrv.lib 
-LIBRARY         stiftestinterface.lib
-LIBRARY         charconv.lib 
-LIBRARY			bafl.lib 
-LIBRARY 		nsmlcontactsdatastoreextension.lib
-
-LANG            SC
-
-
-SMPSAFE
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +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: definition of dm constants/exported methods
-* 	This is part of remotemgmt_plat.
-*
-*/
-
-
-
-PRJ_PLATFORMS
-// specify the platforms your component needs to be built for here
-// defaults to WINS MARM so you can ignore this if you just build these
-DEFAULT
-
-PRJ_TESTEXPORTS
-// NOTE: If using ARS requirements all export operations should be done under this.
-// 'abld test export'
-
-PRJ_EXPORTS
-// Specify the source file followed by its destination here
-// copy will be used to copy the source file to its destination
-// If there's no destination then the source file will be copied
-// to the same name in /epoc32/include
-// Example: 
-/*
-/agnmodel/inc/AGMCOMON.H
-*/
-
-PRJ_TESTMMPFILES
-// NOTE: If using ARS requirements .mmp file operation should be done under this.
-// 'abld test build'
-//./TestCntDataStoreExtn.mmp
-
-PRJ_MMPFILES
-// Specify the .mmp files required for building the important component
-// releasables.
-//
-// Specify "tidy" if the component you need to build doesn't need to be
-// released. Specify "ignore" if the MMP file exists but should be
-// ignored.
-// Example:
-/*
-/agnmodel/group/agnmodel.mmp
-#if defined(MARM)
-/agnmodel/group/agsvexe.mmp
-#endif
-*/
-./TestCntDataStoreExtn.mmp
-
-//  End of File
\ No newline at end of file
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/inc/TestCntDataStoreExtn.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +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:  TestSyncAgent is a STIF TestModule to test the Synch Agent API
-*
-*/
-
-
-
-#ifndef TESTCNTDATASTOREEXTN_H
-#define TESTCNTDATASTOREEXTN_H
-
-//  INCLUDES
-#include <StifLogger.h>
-#include <TestScripterInternal.h>
-#include <StifTestModule.h>
-#include <nsmlcontactsdatastoreextension.h>
-
-// Logging path
-_LIT( KTestCntDataStoreExtnLogPath, "\\logs\\testframework\\TestCntDataStoreExtn\\" ); 
-// Log file
-_LIT( KTestCntDataStoreExtnLogFile, "TestCntDataStoreExtn.txt" ); 
-
-// FORWARD DECLARATIONS
-class CTestCntDataStoreExtn;
-
-
-// CLASS DECLARATION
-/**
-*  TestCntDataStoreExtn test class for STIF Test Framework TestScripter.
-*/
-NONSHARABLE_CLASS(CTestCntDataStoreExtn) : public CScriptBase
-    {
-    public:  // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static CTestCntDataStoreExtn* NewL( CTestModuleIf& aTestModuleIf );
-
-        /**
-        * Destructor.
-        */
-        virtual ~CTestCntDataStoreExtn();
-
-    public: // Functions from base classes
-
-        /**
-        * From CScriptBase Runs a script line.
-        * @param aItem Script line containing method name and parameters
-        * @return Symbian OS error code
-        */
-        virtual TInt RunMethodL( CStifItemParser& aItem );
-
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        CTestCntDataStoreExtn( CTestModuleIf& aTestModuleIf );
-
-        /**
-        * By default Symbian 2nd phase constructor is private.
-        */
-        void ConstructL();
-
-        /**
-        * Frees all resources allocated from test methods.
-        * @since ?Series60_version
-        */
-        void Delete();
-
-        //ADD NEW METHOD DEC HERE
-        /**
-        * Export the contacts
-        */
-        TInt ExportContactsL( CStifItemParser& aItem );
-        
-        /**
-        * Import the contacts
-        */
-        TInt ImportContactsL( CStifItemParser& aItem );
-        
-        /**
-        * Read contact
-        */
-        TInt ReadContactL( CStifItemParser& aItem );
-        
-        /**
-        * Delete contact
-        */
-        TInt DeleteContactL( CStifItemParser& aItem );
-        
-        /**
-        * Delete Contacts
-        */
-        TInt DeleteContactsL( CStifItemParser& aItem );
-        
-        
-        /**
-        * Delete All Contacts
-        */
-        TInt DeleteAllContactsL( CStifItemParser& aItem );
-        
-        /**
-        * List Store
-        */
-        TInt ListStoresL( CStifItemParser& aItem );
-        
-        /**
-        * Machine ID
-        */
-        TInt MachineIdL( CStifItemParser& aItem );
-        
-        /**
-        * List the contacts
-        */
-        TInt ListContactsL( CStifItemParser& aItem );
-        
-    private:    // Data
-        CNsmlContactsDataStoreExtension* iCntDataStoreExtension;
-        CArrayFixFlat<TUid>* iEntryArray;
-				
-    };
-
-#endif      // TESTCNTDATASTOREEXTN
-
-// End of File
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/init/TestFramework.ini	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-#
-# This is STIFTestFramework initialization file
-# Comment lines start with '#'-character.
-# See STIF TestFramework users guide.doc for instructions
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set following test engine settings:
-#	- Set Test Reporting mode. TestReportMode's possible values are:
-#		+ 'Summary': Summary of the tested test cases.
-#		+ 'Environment': Hardware and software info.
-#		+ 'TestCases': Test case report.
-#		+ 'FullReport': Set of all above ones.
-#		+ Example 'TestReportMode= Summary TestCases'
-#
-# 	- CreateTestReport setting controls report creation mode
-#		+ YES, Test report will created.
-#		+ NO, No Test report.
-#
-# 	- File path indicates the base path of the test report.
-# 	- File name indicates the name of the test report.
-#
-# 	- File format indicates the type of the test report.
-#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
-#		+ HTML, Test report will be html type, for example 'TestReport.html'.
-#
-# 	- File output indicates output source of the test report.
-#		+ FILE, Test report logging to file.
-#		+ RDEBUG, Test report logging to using rdebug.
-#
-# 	- File Creation Mode indicates test report overwriting if file exist.
-#		+ OVERWRITE, Overwrites if the Test report file exist.
-#		+ APPEND, Continue logging after the old Test report information if 
-#                 report exist.
-# 	- Sets a device reset module's dll name(Reboot).
-#		+ If Nokia specific reset module is not available or it is not correct one
-#		  StifHWResetStub module may use as a template for user specific reset
-#		  module. 
-
-[Engine_Defaults]
-
-TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
-                                                               'TestCases' or 'FullReport'
-
-CreateTestReport= YES			# Possible values: YES or NO
-
-TestReportFilePath= C:\LOGS\TestFramework\
-TestReportFileName= TestReport
-
-TestReportFormat= TXT			# Possible values: TXT or HTML
-TestReportOutput= FILE			# Possible values: FILE or RDEBUG
-TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
-
-DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
-
-[End_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Module configurations start
-# Modules are added between module tags
-# tags. Module name is specified after ModuleName= tag, like
-# ModuleName= XXXXXXXXX
-# Modules might have initialisation file, specified as
-# IniFile= c:\testframework\YYYYYY
-# Modules might have several configuration files, like
-# TestCaseFile= c:\testframework\NormalCases.txt
-# TestCaseFile= c:\testframework\SmokeCases.txt
-# TestCaseFile= c:\testframework\ManualCases.txt
-
-# (TestCaseFile is synonym for old term ConfigFile)
-
-# Following case specifies demo module settings. Demo module
-# does not read any settings from file, so tags 
-# IniFile and TestCaseFile are not used.
-# In the simplest case it is enough to specify only the
-# name of the test module when adding new test module
-
-
-[New_Module]
-ModuleName= testscripter
-TestCaseFile= c:\testframework\TestCntDataStoreExtn.cfg
-[End_Module]
-
-
-# Load testmoduleXXX, optionally with initialization file and/or test case files
-#[New_Module]
-#ModuleName= testmodulexxx
-
-#TestModuleXXX used initialization file
-#IniFile= c:\testframework\init.txt
-
-#TestModuleXXX used configuration file(s)
-#TestCaseFile= c:\testframework\testcases1.cfg
-#TestCaseFile= c:\testframework\testcases2.cfg
-#TestCaseFile= c:\testframework\manualtestcases.cfg
-
-#[End_Module]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set STIFTestFramework logging overwrite parameters for Logger.
-# 	Hardware and emulator environment logging path and styles can
-# 	be configured from here to overwrite the Logger's implemented values.
-#	
-#	Settings description:
-#	- Indicates option for creation log directory/directories. If log directory/directories
-#         is/are not created by user they will make by software.
-#		+ YES, Create log directory/directories if not allready exist.
-#		+ NO, Log directory/directories not created. Only created one is used.
-#
-#	- Overwrite emulator path setting.
-#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
-#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
-#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
-#
-#	- Overwrite emulator's logging format.
-#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
-#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
-#
-#	- Overwrited emulator logging output source.
-#		+ FILE, Logging to file(s).
-#		+ RDEBUG, Logging to using rdebug(s).
-#
-#	- Overwrite hardware path setting (Same description as above in emulator path).
-#	- Overwrite hardware's logging format(Same description as above in emulator format).
-#	- Overwrite hardware's logging output source(Same description as above in emulator output).
-#
-#	- File Creation Mode indicates file overwriting if file exist.
-#		+ OVERWRITE, Overwrites if file(s) exist.
-#		+ APPEND, Continue logging after the old logging information if file(s) exist.
-#
-#	- Will thread id include to the log filename.
-#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
-#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
-#
-#	- Will time stamps include the to log file.
-#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
-#                 for example'12.Nov.2003 115958    LOGGING INFO'
-#		+ NO, No time stamp(s).
-#
-#	- Will line breaks include to the log file.
-#		+ YES, Each logging event includes line break and next log event is in own line.
-#		+ NO, No line break(s).
-#
-#	- Will event ranking include to the log file.
-#		+ YES, Event ranking number added to each line in log file(s). Ranking number 
-#                 depends on environment's tics, for example(includes time stamp also)
-#                 '012   12.Nov.2003 115958    LOGGING INFO'
-#		+ NO, No event ranking.
-#
-
-[Logger_Defaults]
-
-#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
-
-#CreateLogDirectories= YES		# Possible values: YES or NO
-
-#EmulatorBasePath= C:\LOGS\TestFramework\
-#EmulatorFormat= HTML			# Possible values: TXT or HTML
-#EmulatorOutput= FILE			# Possible values: FILE or RDEBUG
-
-#HardwareBasePath= D:\LOGS\TestFramework\
-#HardwareFormat= HTML			# Possible values: TXT or HTML
-#HardwareOutput= FILE			# Possible values: FILE or RDEBUG
-
-#FileCreationMode= OVERWRITE		# Possible values: OVERWRITE or APPEND
-
-#ThreadIdToLogFile= YES			# Possible values: YES or NO
-#WithTimeStamp= YES			# Possible values: YES or NO
-#WithLineBreak= YES			# Possible values: YES or NO
-#WithEventRanking= YES			# Possible values: YES or NO
-
-[End_Logger_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-# End of file
\ No newline at end of file
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/sis/TestCntDataStoreExtn.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:  Package file for testing common_agent_util_and_definitions_api API
-;File: TestCntDataStoreExtn.pkg;
-;Description : Package file for testing common_agent_util_and_definitions_api API
-;File: TestCntDataStoreExtn.pkg;
-;
-;Auto-generated PKG file for CodeWarrior IDE
-
-;*Languages
-&EN
-;
-;*Standard SIS file header. This section specifies the package name,
-;application UID, and version/build numbers. Add the package TYPE here if needed.
-#{"TestCntDataStoreExtn"},(0x2002DC82),1,0,1;
-;
-
-;*Unique (Non-Localised) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade ofa a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localised vendor name(s) correspodning to language(s).
-%{"Nokia Test EN"}
-
-;*Files To Copy...<src> <destination>
-"\epoc32\release\armv5\urel\TestCntDataStoreExtn.dll" -"C:\sys\bin\TestCntDataStoreExtn.dll"
-"..\conf\TestCntDataStoreExtn.cfg" -"C:\TestFramework\TestCntDataStoreExtn.cfg"
-"..\init\TestFramework.ini" -"C:\TestFramework\TestFramework.ini"
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/src/TestCntDataStoreExtn.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +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: definition of dm constants/exported methods
-* 	This is part of remotemgmt_plat.
-*
-*/
-
-
-
-// INCLUDE FILES
-#include<BADESCA.H>
-#include <Stiftestinterface.h>
-#include "TestCntDataStoreExtn.h"
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::CTestCntDataStoreExtn
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CTestCntDataStoreExtn::CTestCntDataStoreExtn( 
-    CTestModuleIf& aTestModuleIf ):
-        CScriptBase( aTestModuleIf )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CTestCntDataStoreExtn::ConstructL()
-    {
-    iLog = CStifLogger::NewL( KTestCntDataStoreExtnLogPath, 
-            KTestCntDataStoreExtnLogFile,
-                          CStifLogger::ETxt,
-                          CStifLogger::EFile,
-                          EFalse );
-
-    iCntDataStoreExtension = CNsmlContactsDataStoreExtension::NewL( _L("symbian") );
-    iEntryArray = new(ELeave) CArrayFixFlat<TUid>(4);
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CTestCntDataStoreExtn* CTestCntDataStoreExtn::NewL( 
-    CTestModuleIf& aTestModuleIf )
-    {
-    CTestCntDataStoreExtn* self = new (ELeave) CTestCntDataStoreExtn( aTestModuleIf );
-
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-
-    return self;
-
-    }
-
-// Destructor
-CTestCntDataStoreExtn::~CTestCntDataStoreExtn()
-    { 
-
-    // Delete resources allocated from test methods
-    Delete();
-
-    // Delete logger
-    delete iLog; 
-    
-    if( iEntryArray )
-        {
-        delete iEntryArray;
-        iEntryArray = NULL;
-        }
-    
-    if(iCntDataStoreExtension)
-        {
-        delete iCntDataStoreExtension;
-        iCntDataStoreExtension = NULL;
-        }
-
-   }
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-
-// -----------------------------------------------------------------------------
-// LibEntryL is a polymorphic Dll entry point.
-// Returns: CScriptBase: New CScriptBase derived object
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CScriptBase* LibEntryL( 
-    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
-    {
-
-    return ( CScriptBase* ) CTestCntDataStoreExtn::NewL( aTestModuleIf );
-
-    }
-
-
-//  End of File
--- a/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/src/TestCntDataStoreExtnBlocks.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,362 +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:  This file contains all functions that can be called from cfg file.
-*				 These functions call the necessary methods for getting the operation done and 
-*				 writes the output to the Log.
-*
-*/
-
-
-
-// INCLUDE FILES
-#include <e32svr.h>
-#include<BADESCA.H> 
-#include <StifParser.h>
-#include <Stiftestinterface.h>
-#include "TestCntDataStoreExtn.h"
-#include <utf.h>
-#include <f32file.h>
-#include <e32base.h> 
-
-_LIT8(KContact1, "BEGIN:VCARD\r\nVERSION:2.1\r\nN:Contact;Test1;;;\r\nTEL;CELL:1234567890\r\nEND:VCARD\r\n");
-_LIT8(KContact2, "BEGIN:VCARD\r\nVERSION:2.1\r\nN:Contact;Test2;;;\r\nTEL;CELL:0987654321\r\nEND:VCARD\r\n");
-_LIT8(KContact3, "BEGIN:VCARD\r\nVERSION:2.1\r\nN:Contact;Test3;;;\r\nTEL;CELL:1324576809\r\nEND:VCARD\r\n");
-_LIT8(KContact4, "BEGIN:VCARD\r\nVERSION:2.1\r\nN:Contact;Test4;;;\r\nTEL;CELL:0897645321\r\nEND:VCARD\r\n");
-_LIT8(KContact5, "BEGIN:VCARD\r\nVERSION:2.1\r\nN:Contact;Test5;;;\r\nTEL;CELL:1432586790\r\nEND:VCARD\r\n");
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::Delete
-// Delete here all resources allocated and opened from test methods. 
-// Called from destructor. 
-// -----------------------------------------------------------------------------
-//
-void CTestCntDataStoreExtn::Delete() 
-    {
-
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::RunMethodL
-// Run specified method. Contains also table of test mothods and their names.
-// -----------------------------------------------------------------------------
-//
-TInt CTestCntDataStoreExtn::RunMethodL( 
-    CStifItemParser& aItem ) 
-    {
-
-    static TStifFunctionInfo const KFunctions[] =
-        {  
-        ENTRY( "ExportContacts"   , CTestCntDataStoreExtn::ExportContactsL ),
-        ENTRY( "ImportContacts"   , CTestCntDataStoreExtn::ImportContactsL ),
-        ENTRY( "ReadContact"      , CTestCntDataStoreExtn::ReadContactL ),
-        ENTRY( "ListContacts"     , CTestCntDataStoreExtn::ListContactsL ),
-        ENTRY( "DeleteContact"    , CTestCntDataStoreExtn::DeleteContactL ),
-        ENTRY( "DeleteContacts"   , CTestCntDataStoreExtn::DeleteContactsL ),
-        ENTRY( "DeleteAllContacts", CTestCntDataStoreExtn::DeleteAllContactsL ),
-        ENTRY( "ListStores"       , CTestCntDataStoreExtn::ListStoresL ),
-        ENTRY( "MachineID"        , CTestCntDataStoreExtn::MachineIdL ),
-        };
-
-    const TInt count = sizeof( KFunctions ) / 
-                        sizeof( TStifFunctionInfo );
-
-    return RunInternalL( KFunctions, count, aItem );
-
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::ListContactsL
-// Method to List contacts
-// -----------------------------------------------------------------------------
-//
-TInt CTestCntDataStoreExtn::ListContactsL( CStifItemParser& aItem )
-    {  
-    iLog->Log( _L("ListContactsL Begin") );
-    
-    if( iEntryArray )
-        {
-        iEntryArray->Reset();
-        TRAPD( err, iCntDataStoreExtension->ListContactsL( iEntryArray ) );
-        if( err )
-            {
-            return KErrGeneral;
-            }
-        }
-    else
-        {
-        return KErrGeneral;
-        }
-    iLog->Log( _L("ListContactsL End") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::ExportContactsL
-// Method to export contacts
-// -----------------------------------------------------------------------------
-//
-TInt CTestCntDataStoreExtn::ExportContactsL( CStifItemParser& aItem )
-    {   
-    iLog->Log( _L("ExportContactsL Begin") );
-    
-    TInt ret = KErrNone;
-    if( iEntryArray )
-        {
-        if( iEntryArray->Count() > 0 )
-            {
-            for( TInt count = 0; count < iEntryArray->Count(); count++ )
-                {
-                CBufBase* tempData = CBufFlat::NewL( 1024 );
-                TRAPD( err, ret = iCntDataStoreExtension->ExportContactsL( iEntryArray->At(count), *tempData ) );
-                delete tempData;
-                if ( err || ret )
-                    {
-                    return KErrGeneral; 
-                    }
-                }
-            }
-        else
-           {
-           return KErrGeneral;
-           }    
-        }
-    else
-        {
-        return KErrGeneral;
-        }
-    
-    iLog->Log( _L("ExportContactsL End") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::ImportContactsL
-// Method to import contacts
-// -----------------------------------------------------------------------------
-//
-TInt CTestCntDataStoreExtn::ImportContactsL( CStifItemParser& aItem )
-    {   
-    iLog->Log( _L("ImportContactsL Begin") );
-    
-    HBufC8* cntbuf = HBufC8::NewL(500);
-    CArrayFixFlat<TUid>* entryArray = NULL;
-    
-    *cntbuf = KContact1;    
-    
-    TPtr8 ptr = cntbuf->Des();
-    ptr.Append(KContact2);
-    ptr.Append(KContact3);
-    ptr.Append(KContact4);
-    ptr.Append(KContact5);
-    
-    TRAPD( ret, entryArray = iCntDataStoreExtension->ImportContactsL(*cntbuf) );
-    delete cntbuf;
-    
-    
-    if( ret || (entryArray == NULL) )
-        {
-        iLog->Log( _L("ImportContactsL Error") );
-        return KErrGeneral;
-        }
-      
-    delete entryArray;
-    
-    iLog->Log( _L("ImportContactsL End") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::ReadContactL
-// Method to read contact
-// -----------------------------------------------------------------------------
-//
-TInt CTestCntDataStoreExtn::ReadContactL( CStifItemParser& aItem )
-    {
-    iLog->Log( _L("ReadContactL Begin") );
-    if( iEntryArray )
-        {
-        if( iEntryArray->Count() > 0 )
-           {
-           TInt ret( KErrNone );
-           for( TInt count = 0; count < iEntryArray->Count(); count++ )
-               {
-               CNsmlContactItem* contactitem = CNsmlContactItem::NewL();
-               TRAPD(err, ret = iCntDataStoreExtension->ReadContactL( iEntryArray->At(count), contactitem ));
-               delete contactitem;
-               if( err || ret )
-                   {
-                   return KErrGeneral;
-                   }
-               }
-           }
-        else
-            {
-            return KErrGeneral;
-            }
-        }
-    else
-        {
-        return KErrGeneral;
-        }     
-    
-    iLog->Log( _L("ReadContactL End") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::DeleteContactL
-// Method to delete contact
-// -----------------------------------------------------------------------------
-//
-TInt CTestCntDataStoreExtn::DeleteContactL( CStifItemParser& aItem )
-    {
-    iLog->Log( _L("DeleteContactL Begin") );
-    
-    if( iEntryArray )
-        {
-        if( iEntryArray->Count() > 0 )
-           {
-           TBool ret;
-           for( TInt count = 0; count < iEntryArray->Count(); count++ )
-               {
-               TRAPD( err, ret = iCntDataStoreExtension->DeleteContactL( iEntryArray->At(count) ) );
-               if( err || ( ret == EFalse) )
-                   {
-                   return KErrGeneral;
-                   }               
-               }
-           }
-        else
-            {
-            return KErrGeneral;
-            }
-        }
-    else
-        {
-        return KErrGeneral;
-        }
-    iEntryArray->Reset();
-    iLog->Log( _L("DeleteContactL End") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::DeleteContacts
-// Method to delete contacts
-// -----------------------------------------------------------------------------
-//
-TInt CTestCntDataStoreExtn::DeleteContactsL( CStifItemParser& aItem )
-    {
-    iLog->Log( _L("DeleteContactsL Begin") );
-    
-    if( iEntryArray )
-        {
-        if( iEntryArray->Count() > 0 )
-           {
-           TBool ret;           
-           TRAPD( err, ret = iCntDataStoreExtension->DeleteContactsL( iEntryArray ) );
-           if( err || ( ret == EFalse) )
-               {
-               return KErrGeneral;
-               }
-           }
-        else
-            {
-            return KErrGeneral;
-            }
-        }
-    else
-        {
-        return KErrGeneral;
-        }
-    iEntryArray->Reset();
-    iLog->Log( _L("DeleteContactsL End") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::DeleteAllContactsL
-// Method to delete all contacts
-// -----------------------------------------------------------------------------
-//
-TInt CTestCntDataStoreExtn::DeleteAllContactsL( CStifItemParser& aItem )
-    {
-    iLog->Log( _L("DeleteAllContacts Begin") );
-    
-    if( iEntryArray )
-        {
-        if( iEntryArray->Count() > 0 )
-           {
-           TBool ret;
-           TRAPD( err, ret = iCntDataStoreExtension->DeleteAllContactsL() );
-           if( err || ( ret == EFalse) )
-               {
-               return KErrGeneral;
-               }
-           }
-        else
-            {
-            return KErrGeneral;
-            }
-        }
-    else
-        {
-        return KErrGeneral;
-        }
-    iEntryArray->Reset();
-    iLog->Log( _L("DeleteAllContactsL End") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::ListStoresL
-// Method to list stores
-// -----------------------------------------------------------------------------
-//
-TInt CTestCntDataStoreExtn::ListStoresL( CStifItemParser& aItem )
-    {
-    iLog->Log( _L("ListStoresL Begin") );
-    
-    CDesCArray* cntStores = new (ELeave) CDesCArrayFlat(1);
-    TRAPD( err, iCntDataStoreExtension->ListStoresL( cntStores ) );
-    delete cntStores;
-    if(err )
-        {
-        return KErrGeneral;
-        }
-    
-    iLog->Log( _L("ListStoresL End") );
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CTestCntDataStoreExtn::MachineIdL
-// Method to fetch machine id
-// -----------------------------------------------------------------------------
-//
-TInt CTestCntDataStoreExtn::MachineIdL( CStifItemParser& aItem )
-    {
-    iLog->Log( _L("MachineIdL Begin") );
-    TRAPD( err, iCntDataStoreExtension->MachineIdL( ) );
-    if(err)
-        {
-        return KErrGeneral;
-        }    
-    iLog->Log( _L("MachineIdL End") );
-    return KErrNone;
-    }
-
-//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_folder_util_api/ds_folder_util_api.metaxml	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,13 @@
+<?xml version="1.0" ?>
+<api id="7098f3668c6fd3af3740e501929c045b" dataversion="1.0">
+<name>ds_folder_util_api</name>
+<description>Support for folderparsing API</description>
+<type>c++</type>
+<subsystem>DSUtils</subsystem>
+<libs></libs>
+<release category="domain" sinceversion=""/>
+<attributes>
+<htmldocprovided>no</htmldocprovided>
+<adaptation>no</adaptation>
+</attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_folder_util_api/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -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:  
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/nsmlfolderparser.h        APP_LAYER_PLATFORM_EXPORT_PATH(nsmlfolderparser.h)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_folder_util_api/inc/nsmlfolderparser.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,310 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Folder XML parser
+*
+*/
+
+
+// 1.2 Changes: nsmlxmlparser module added
+
+
+#ifndef __NSMLFOLDERPARSER_H__
+#define __NSMLFOLDERPARSER_H__
+
+// ------------------------------------------------------------------------------------------------
+// Includes
+// ------------------------------------------------------------------------------------------------
+#include <e32base.h>
+#include <s32strm.h>
+
+// ------------------------------------------------------------------------------------------------
+// Class forward declarations
+// ------------------------------------------------------------------------------------------------
+class CNSmlXmlParser;
+class CNSmlExtData;
+
+
+//Constants
+
+// the maximum length of an integer in characters
+const TInt KIntegerMaxLength = 12;
+
+// the length of a datetime in characters
+const TInt KDateTimeLength = 16;
+
+// ------------------------------------------------------------------------------------------------
+// Typedefs
+// ------------------------------------------------------------------------------------------------
+// the array used for xval-values
+typedef CArrayPtrFlat<HBufC8> CNSmlXValArray;
+// the array used for extension data
+typedef CArrayPtrFlat<CNSmlExtData> CNSmlExtDataArray;
+
+// enumeration for boolean values
+enum TNSmlBoolean
+    {
+    EBooleanMissing = 0, // not included in the xml
+    EBooleanTrue,
+    EBooleanFalse
+    };
+
+// The error values returned from parser and generator functions
+enum TNSmlParserGeneratorError
+    {
+    EErrorNone,             // no error
+    EOutOfMemory,           // out of memory
+    EMandatoryFieldNotFound,// XNam inside Ext missing
+    EInvalidBooleanValue,   // Invalid value inside boolean elements
+    EInvalidIntegerValue,   // Invalid value inside integer elements
+    EInvalidDatetimeValue,  // Invalid value inside datetime elements
+    EInvalidCDataStructure, // CDATA error
+    EInvalidXmlError,       // Xml includes invalid data, i.e. xml generally against dtd
+    EInvalidFilename,       // file was not found or the filename was otherwise erroneous
+    EUnknownError           // Unknown error
+    };
+
+// extension data (found in and folder)
+class CNSmlExtData : public CBase
+	{
+public:
+	IMPORT_C static CNSmlExtData* NewL();
+	IMPORT_C static CNSmlExtData* NewLC();
+	IMPORT_C virtual ~CNSmlExtData();
+
+	IMPORT_C void AddXValL( HBufC8* aXVal );
+
+	IMPORT_C void GenerateXmlL( TPtr8& aXml, const CNSmlXmlParser* aParser ) const;
+	IMPORT_C TInt CountXmlSize( const CNSmlXmlParser* aParser ) const;
+	IMPORT_C void ConvertIntoEntitiesL( const CNSmlXmlParser* aParser );
+
+private:
+	CNSmlExtData();
+	void ConstructL();
+
+public:
+	HBufC8* iXNam;
+	CNSmlXValArray* iXVals;
+	};
+
+
+// folder attributes
+struct TNSmlFolderAttributeData
+	{
+	IMPORT_C TNSmlFolderAttributeData();
+
+	/*
+	* Returns the count of attributes that are not EBooleanMissing.
+	*/
+	IMPORT_C TInt AttributeCount() const;
+
+	IMPORT_C void GenerateXml( TPtr8& aXml, const CNSmlXmlParser* aParser ) const;
+	IMPORT_C TInt CountXmlSize( const CNSmlXmlParser* aParser ) const;
+
+	TNSmlBoolean iHidden;
+	TNSmlBoolean iSystem;
+	TNSmlBoolean iArchived;
+	TNSmlBoolean iDelete;
+	TNSmlBoolean iWritable;
+	TNSmlBoolean iReadable;
+	TNSmlBoolean iExecutable;
+	};
+
+// Base class for actual parsergenerators. 
+// Implements basic utilities for parsing and generating the xml.
+class CNSmlXmlParser : public CBase  
+	{
+public:
+	/*
+	* The constructor.
+	*/
+	IMPORT_C CNSmlXmlParser();
+
+	/*
+	* The destructor.
+	*/
+	IMPORT_C virtual ~CNSmlXmlParser();
+
+	/*
+	* Parses through the given xml and places the data it contains to 
+	* member variables.	Removes all the comments from the original string.
+	* @param aXml The xml to be parsed.
+	* @return 
+	*/
+	virtual TNSmlParserGeneratorError ParseXml( HBufC8* aXml ) =0;
+
+	/*
+	* Generates xml using the data in member variables of the child class. 
+	* aXml contains the generated xml when method returns successfully. 
+	* Caller should not instantiate 
+	* the buffer, since this method counts the size of the xml and 
+	* instantiates the buffer using the size as its maximum size.
+	* Caller gets the control of the buffer when method returns.
+	* @param aXml A pointer to a buffer, which is instantiated in this 
+	* method and contains the xml when method returns succesfully.
+	* @return 
+	*/
+	virtual TNSmlParserGeneratorError GenerateXml( HBufC8*& aXml ) =0;
+
+	/*
+	* Counts the size of the generated xml, when the xml would be generated 
+	* using the data in child class' member variables.
+	*/
+	virtual TInt CountXmlSizeL() =0;
+
+	/* utility functions */
+
+	void PreProcessL( HBufC8* aXml ) const;
+
+	TPtrC8 BooleanToString( const TNSmlBoolean aValue ) const;
+	TBuf8<KDateTimeLength> DateTimeToStringL( const TTime& aValue ) const;
+	TBuf8<KIntegerMaxLength> IntegerToString( const TInt aValue ) const;
+
+	TNSmlBoolean StringToBooleanL( const TPtrC8& aValue ) const;
+	TInt StringToIntegerL( const TPtrC8& aValue ) const;
+	// Note: Ignores UTC-times (Z-ending) and treats them as local time!
+	TTime StringToTTimeL( TPtrC8& aValue ) const;
+
+	void AppendElement( TPtr8& aPtr, const TDesC8& aElementName, const TDesC8& aValue ) const;
+	void AppendElement( TPtr8& aPtr, const TDesC8& aElementName ) const;
+	void AppendEndElement( TPtr8& aPtr, const TDesC8& aElementName ) const;
+
+	TInt SizeOfElements( const TDesC8& aElementName ) const;
+	TInt SizeOfBoolean( const TNSmlBoolean aValue, const TDesC8& aElementName ) const;
+	TInt SizeOfDatetime( const TDesC8& aElementName ) const;
+	TInt SizeOfInteger( const TDesC8& aElementName ) const;
+	TInt SizeOfString( const HBufC8* aValue, const TDesC8& aElementName ) const;
+
+	TInt EntitiesToCharactersL( HBufC8*& aXml, TInt aStartPos, TInt aEndPos ) const;
+	TInt CharactersToEntitiesL( HBufC8*& aXml, TInt aStartPos, TInt aEndPos ) const;
+
+	TBool IsWhitespace( const TDesC8& aText ) const;
+	void LeaveIfNotWhiteSpaceL( const TDesC8& aText ) const;
+
+	TNSmlParserGeneratorError CheckError( const TInt error ) const;
+
+protected:
+	// parsing methods
+	void ParseL( TPtrC8& aXml );
+	void AddToCompleteL( const TPtrC8 aStr );
+	void ResetBufferL( HBufC8*& aBuf ) const;
+	void AddToBufferL( const TText c, HBufC8*& aBuf ) const;
+
+	virtual void NextElementL( TPtrC8 aElement ) =0;
+	virtual void NextDataL( TPtrC8 aData ) =0;
+
+private:
+	TInt ReplaceL( HBufC8*& aText, const TDesC8& aTarget, const TDesC8& aItem, TInt aStartPos, TInt aEndPos ) const;
+	void CheckDatetimeErrorL( const TInt error ) const;
+
+protected:
+	HBufC8* iBuffer;
+	HBufC8* iCompleteBuffer;
+	};
+
+// Folder parser. Implements parsing and generating of Folder xml.
+class CNSmlFolderParser : public CNSmlXmlParser
+	{
+public:
+	IMPORT_C static CNSmlFolderParser* NewL();
+	IMPORT_C static CNSmlFolderParser* NewLC();
+	IMPORT_C virtual ~CNSmlFolderParser();
+
+	IMPORT_C virtual TNSmlParserGeneratorError ParseXml( HBufC8* aXml );
+	IMPORT_C virtual TNSmlParserGeneratorError GenerateXml( HBufC8*& aXml );
+	IMPORT_C virtual TInt CountXmlSizeL() ;
+
+	IMPORT_C void AddExtL( CNSmlExtData* aExt );
+
+protected:
+	virtual void NextElementL( TPtrC8 aElement );
+	virtual void NextDataL( TPtrC8 aData );
+
+protected:
+	
+	// the folder elements (states) in the order they appear in DTD
+	enum TNSmlCurrentFolderElement
+		{
+		EFolderNone = 0,
+		EFolder,
+		EFolderName, 
+		EFolderCreated,
+		EFolderModified,
+		EFolderAccessed,
+		EAttributes,
+		EAttributesH,
+		EAttributesS,
+		EAttributesA,
+		EAttributesD,
+		EAttributesW,
+		EAttributesR,
+		EAttributesX,
+		EFolderRole,
+		EFolderExt,
+		EFolderExtXNam,
+		EFolderExtXVal
+		};
+	
+	// struct used in folder parsing (which members are already set)
+	struct TNSmlSetFolderValues
+		{
+		TNSmlSetFolderValues();
+		void Reset();
+		
+		TBool iFolder;
+		TBool iName;
+		TBool iCreated;
+		TBool iModified;
+		TBool iAccessed;
+		TBool iAttributes;
+		TBool iAttributesH;
+		TBool iAttributesS;
+		TBool iAttributesA;
+		TBool iAttributesD;
+		TBool iAttributesW;
+		TBool iAttributesR;
+		TBool iAttributesX;
+		TBool iRole;
+		TBool iXNam;
+		};
+	
+private:
+	void StartElementStateChangeL( TNSmlCurrentFolderElement aCurrentState, TNSmlCurrentFolderElement aNextState, TBool aIsSet = EFalse );
+	void EndElementStateChangeL( TNSmlCurrentFolderElement aCurrentState, TNSmlCurrentFolderElement aNextState );
+
+	void GenerateFolderXmlL( HBufC8*& aXml );
+	void ConvertIntoEntitiesL();
+
+	CNSmlFolderParser();
+	void ConstructL();
+
+public:
+	HBufC8* iName;
+	TTime iCreated;
+	TTime iModified;
+	TTime iAccessed;
+	TNSmlFolderAttributeData iAttributes;
+	HBufC8* iRole;
+	CNSmlExtDataArray* iExt;
+
+private:
+	TNSmlCurrentFolderElement iCurrentState;
+	TNSmlCurrentFolderElement iLastState;
+	TNSmlSetFolderValues iSetValues;
+
+	CNSmlExtData* iExtData;
+	};
+
+
+
+#endif // __NSMLFOLDERPARSER_H__
--- a/contentctrl_plat/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ b/contentctrl_plat/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -16,7 +16,9 @@
 *
 */
 
+
+#include "../oma_ds_presync_plugin_api/group/bld.inf"
+#include "../ds_agenda_handler_plugin_api/group/bld.inf"
+#include "../ds_folder_util_api/group/bld.inf"
+#include "../adapter_customization_api/group/bld.inf"
 #include "../ds_data_modification_api/group/bld.inf"
-#include "../ds_contactsdatastoreextension_api/group/bld.inf"
-#include "../ds_contact_adapter_customization_api/group/bld.inf"
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/oma_ds_presync_plugin_api/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 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:  File that exports the files belonging to 
+:                OMA DS PreSync Plugin API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/CPreSyncPlugin.h    APP_LAYER_PLATFORM_EXPORT_PATH(CPreSyncPlugin.h)
+../inc/CPreSyncPlugin.inl     APP_LAYER_PLATFORM_EXPORT_PATH(CPreSyncPlugin.inl)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/oma_ds_presync_plugin_api/inc/CPreSyncPlugin.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,162 @@
+/*
+* 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:  ECom search interface definition
+*
+*/
+
+
+#ifndef CPRESYNC_PLUGIN_H
+#define CPRESYNC_PLUGIN_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32mem.h>
+#include <ecom/ecom.h>
+#include <SyncMLDef.h>
+
+/**
+* CenRep key for storing the roaming setting.
+* 
+*
+* Possible integer values:
+* 
+* 0 Always Ask
+* 1 Always Allow
+* 2 Never Allow
+* 3 Block
+* Default value: 0 (Always Ask)
+*
+*/
+const TUint32 KNSmlRoamingSettingKey = 0x00000005;
+
+/**
+* CenRep key for storing the roaming setting feature.
+* 
+*
+* Possible integer values:
+* 
+* 0 Feature disabled
+* 1 Feature enabled
+*
+*/
+const TUint32 KNSmlDSRoamingFeature = 0x00000006;
+
+
+/**
+ * Constant:    KPreSyncPluginInterfaceUid
+ *
+ * Description: UID of this ECOM interface. 
+ */
+const TUid KPreSyncPluginInterfaceUid = {0x2001955C};
+
+enum TASpRoamingSettingFeature
+    {
+    EAspRoamingSettingFeatureDisabled = 0,
+    EAspRoamingSettingFeatureEnabled = 1
+    };
+
+/**
+ * Class:       MSyncExtObserver
+ *
+ * Description:  
+ */
+
+class MSyncExtObserver
+{
+        public: // Public pure virtual functions.
+
+        /**
+         * Function:    SyncCompleted
+         *
+         */
+        virtual void SyncCompleted(TInt err) = 0;
+ };
+
+
+/**
+ * Class:       CPreSyncPlugin
+ *
+ * Description: Custom ECOM interface definition. This interface is used by
+ *              clients to handle roamong . 
+ */
+class CPreSyncPlugin: public CBase
+{
+public: 
+    /**
+     * Function   :   NewL(TUid aImplementationUid);
+     * Description:   Implementation created based on implementation ID
+     */
+    static CPreSyncPlugin* NewL(TUid aImplementationUid);
+    
+    /**
+     * Function   :   NewL(const TDesC8& aParam);
+     * Description:   Implementation created based Implemetation resolution parameter
+     */
+    static CPreSyncPlugin* NewL(const TDesC8& aParam);
+
+
+    /**
+     * Function:   ~CPreSyncPlugin
+     *
+     * Description: Wraps ECom object destruction. Notifies the ECOM
+     *              framework that specific instance is being destroyed.
+     */
+    virtual ~CPreSyncPlugin();
+
+
+    public: // Public pure virtual functions.
+
+    /**
+     * Function:    IsSupported
+     *
+     */
+    virtual TBool IsSupported() = 0;
+    
+    /**
+     * Function:    CanSync
+     *
+     */
+    virtual TBool CanSyncL() = 0;
+    
+    /**
+     * Function:    SetProfile  
+     *
+     */
+    virtual TBool SetProfile(const TSmlProfileId& aProfileId) = 0;
+    
+    /**
+     * Function:    SyncNow  
+     *
+     */   
+    virtual TInt SyncNow(MSyncExtObserver* aObserver) = 0 ;
+    
+public: 
+
+        /** iDtor_ID_Key Instance identifier key. When instance of an
+             *               implementation is created by ECOM framework, the
+             *               framework will assign UID for it. The UID is used in
+             *               destructor to notify framework that this instance is
+             *               being destroyed and resources can be released.
+             */
+        TUid iDtor_ID_Key;
+
+        
+};
+
+#include "CPreSyncPlugin.inl" // Own base implementations for ECOM
+
+#endif		// CPCS_PLUGIN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/oma_ds_presync_plugin_api/inc/CPreSyncPlugin.inl	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ECom search interface definition
+*
+*/
+
+// Interface's (abstract base class's) destructor
+
+inline CPreSyncPlugin::~CPreSyncPlugin()
+    {
+ 
+       REComSession::DestroyedImplementation(iDtor_ID_Key);
+    }
+
+inline CPreSyncPlugin*
+CPreSyncPlugin::NewL(TUid aImplementationUid)
+    {
+    TAny* ptr = REComSession::CreateImplementationL(
+            aImplementationUid,_FOFF(CPreSyncPlugin,iDtor_ID_Key));
+    // The type of TAny* ptr should be CPreSyncPlugin.
+    return REINTERPRET_CAST(CPreSyncPlugin*, ptr);
+    }
+
+inline CPreSyncPlugin* CPreSyncPlugin::NewL(const TDesC8& aParam)
+    {
+    // Define options, how the default resolver will find appropriate
+    // implementation.
+    TEComResolverParams resolverParams;
+    resolverParams.SetDataType(aParam);
+    resolverParams.SetWildcardMatch(ETrue);     // Allow wildcard matching
+
+    TAny* ptr = REComSession::CreateImplementationL(
+            KPreSyncPluginInterfaceUid,
+        _FOFF(CPreSyncPlugin,iDtor_ID_Key),resolverParams);
+
+    // The type of TAny* ptr should be CTmoPhonebookSyncInterfaceDefinitionDlg.
+    return REINTERPRET_CAST(CPreSyncPlugin*, ptr);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/oma_ds_presync_plugin_api/oma_ds_presync_plugin_api.metaxml	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,13 @@
+<?xml version="1.0" ?>
+<api id="a3db4638620fe5970d01d2487f001745" dataversion="1.0">
+<name>OMA DS PreSync Plugin API</name>
+<description>OMA DS PreSync Plugin Interface. Used for operator customization.</description>
+<type>c++</type>
+<subsystem>omads</subsystem>
+<libs></libs>
+<release category="domain" sinceversion="3.2"/>
+<attributes>
+<htmldocprovided>no</htmldocprovided>
+<adaptation>no</adaptation>
+</attributes>
+</api>
--- a/dsdcmoadapter/group/nsmldsctrldcmoadapter.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ b/dsdcmoadapter/group/nsmldsctrldcmoadapter.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -35,8 +35,6 @@
 
 
 SYSTEMINCLUDE 	/epoc32/include/ecom
-SYSTEMINCLUDE   /epoc32/include/mw/hb/hbwidgets 
-SYSTEMINCLUDE   /epoc32/include/mw/hb/hbcore
 
 SOURCEPATH			../data
 start resource 20022FBC.rss
@@ -47,5 +45,4 @@
 
 LIBRARY 				euser.lib ECom.lib efsrv.lib 
 LIBRARY         centralrepository.lib
-LIBRARY					commonengine.lib  
-LIBRARY       hbcore.lib hbwidgets.lib
\ No newline at end of file
+LIBRARY					commonengine.lib  
\ No newline at end of file
--- a/dsdcmoadapter/src/nsmldsctrldcmoadapter.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/dsdcmoadapter/src/nsmldsctrldcmoadapter.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -17,6 +17,7 @@
 
 //SYSTEM INCLUDES
 #include <centralrepository.h>
+#include <dcmo.rsg>
 #include <e32base.h>
 #include <stringresourcereader.h> 
 #include <f32file.h> 
@@ -24,7 +25,6 @@
 
 //USER INCLUDES
 #include "nsmldsctrldcmoadapter.h"
-#include "hbtextresolversymbian.h"
 
 // CONSTANTS
 const TUid KCRUidDSDCMOConfig = { 0x20022FC0 };
@@ -33,11 +33,9 @@
 // Name of the Plug-in adapter
 _LIT(KNsmlDesktopSyncTitle, "Desktop Sync"); 
 // Description for Desktop Sync adapter
-_LIT(KNsmlDSDCMODescription, "Used to enable/disable the Desktop Sync." );
-// Filename in which title is present
-_LIT( KdcmoResourceFileName, "deviceupdates_" );
-// Path to the translation file
-_LIT( KdcmoResourceFilePath, "z:/resource/qt/translations/" );	
+_LIT(KNsmlDSDCMODescription, "Used to enable/disable the Desktop Sync." ); //use Nsml?????
+// Path used for fetching the string to be displayed
+_LIT( KRuntimeResourceFileName, "z:dcmo.rsc" );
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -217,7 +215,14 @@
 //
 void CNsmlDsCtrlDCMOAdapter::GetLocalizedNameL (HBufC*& aLocName)
 {
-	TBool result = HbTextResolverSymbian::Init(KdcmoResourceFileName, KdcmoResourceFilePath );				
-	_LIT(KTextDesktopSync, "txt_device_update_info_desktop_sync");
-	aLocName = HbTextResolverSymbian::LoadL(KTextDesktopSync);
+	TFileName myFileName;
+	TParse parseObj;
+	parseObj.Set( KRuntimeResourceFileName(), &KDC_RESOURCE_FILES_DIR,NULL );
+	myFileName = parseObj.FullName();
+	CStringResourceReader* readPluginName = CStringResourceReader::NewL( myFileName );
+	CleanupStack::PushL(readPluginName);
+	TPtrC buf;
+	buf.Set(readPluginName->ReadResourceString(R_DM_RUN_TIME_VAR_DESKTOP_SYNC));
+	aLocName = buf.AllocL() ; 
+	CleanupStack::PopAndDestroy(readPluginName);
 }
--- a/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ b/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -25,13 +25,8 @@
 //omads
 #include "../omads/group/bld.inf"
 
-
+//contentctrl_plat
+#include "../contentctrl_plat/group/bld.inf"
 
 //ds dcmo adapter
 #include "../dsdcmoadapter/group/bld.inf"
-
-//connectivity module
-#include "../connectivitymodules/group/bld.inf"
-
-//contentctrl_plat
-#include "../contentctrl_plat/group/bld.inf"
--- a/layers.sysdef.xml	Tue Aug 31 15:05:37 2010 +0300
+++ b/layers.sysdef.xml	Wed Sep 01 12:30:02 2010 +0100
@@ -1,17 +1,14 @@
 <?xml version="1.0"?>
-<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_5_1.dtd" [
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
   <!ENTITY layer_real_source_path "sf/app/contentcontrol" >
 ]>
 
-<SystemDefinition name="contentcontrol" schema="1.5.1">
+<SystemDefinition name="contentcontrol" schema="1.4.0">
   <systemModel>
     <layer name="app_layer">
       <module name="contentcontrol">
         <unit unitID="spdo.contentcontrol" mrp="" bldFile="&layer_real_source_path;/group" name="contentcontrol" />
-        <unit unitID="spdo.contentcontrol.pro" mrp="" bldFile="&layer_real_source_path;" name="contentcontrol_pro" proFile="contentcontrol.pro"/>
       </module>
     </layer>
   </systemModel>
-</SystemDefinition>
-
-
+</SystemDefinition>
\ No newline at end of file
--- a/omads/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -15,12 +15,6 @@
 *
 */
 
-#include <platform_paths.hrh>
 
-PRJ_EXPORTS
-
-//for IAD support
-omads_stub.sis  /epoc32/data/z/system/install/omads_stub.sis
-../rom/omads.iby      CORE_APP_LAYER_IBY_EXPORT_PATH(omads.iby)
-
+#include "../omadsappui/group/bld.inf"
 #include "../omadsextensions/group/bld.inf"
--- a/omads/group/omads_stub.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-;
-; Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:  Stub Package file for omadsextensions
-;
-
-; Languages
-&EN
-
-; Header
-; Name, UID for installation, Maj.Ver., Min.Ver., Variant, FLAG TO SPECIFY UNICODE, System component
-#{"Omads"}, (0x2002E6D9), 1, 0, 0, TYPE=SA
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; DLLs
-
-; from omadsextensions/dsutils
-""-"z:\sys\bin\nsmlcontactsdatastoreextension.dll"
-""-"z:\sys\bin\nsmlCGIScriptParser.dll"
-
-; from omadsextensions
-""-"z:\sys\bin\nsmldatamod.dll"
-
-; Ecom plugin
-; from ds
-""-"z:\sys\bin\nsmlcontactsdataprovider.dll"
-""-"z:\resource\plugin\nsmlcontactsdataprovider.r*"
-
-""-"z:\sys\bin\nsmlagendadataprovider.dll"
-""-"z:\resource\plugin\nsmlagendadataprovider.r*"
-
-""-"z:\sys\bin\nsmlnotepaddataprovider.dll"
-""-"z:\resource\plugin\nsmlnotepaddataprovider.r*"
-
-
-;Resource files
-""-"z:\resource\NSmlContactsDataStoreFormat_1_1_2.r*"
-""-"z:\resource\NSmlContactsDataStoreFormat_1_2.r*"
-""-"z:\resource\NSmlAgendaDataStore_1_1_2.r*"
-""-"z:\resource\NSmlAgendaDataStore_1_2.r*"
-""-"z:\resource\NSmlNotepadDataStoreFormat.r*"
Binary file omads/group/omads_stub.sis has changed
--- a/omads/omads.pro	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#
-#   Name        : omads.pro
-#   Part of     : contentcontrol  
-#   Description : This is the project specification file for the contentcontrol project.
-#   Version     : 1
-#
-#   Copyright © 2009 Nokia.  All rights reserved.
-#   This material, including documentation and any related computer
-#   programs, is protected by copyright controlled by Nokia.  All
-#   rights are reserved.  Copying, including reproducing, storing,
-#   adapting or translating, any or all of this material requires the
-#   prior written consent of Nokia.  This material also contains
-#   confidential information which may not be disclosed to others
-#   without the prior written consent of Nokia.
-#
-
-TEMPLATE = subdirs
-CONFIG += ordered
-SUBDIRS += omadsextensions
-
-# End of file	--Don't remove this.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AiwSyncProvider/group/AiwSyncProvider.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,73 @@
+/*
+* 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:  Project specification file.
+*
+*/
+
+
+#include "../inc/AiwSyncProviderUids.hrh"
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET		AiwSyncProvider.dll
+TARGETTYPE	PLUGIN
+
+VENDORID VID_DEFAULT
+
+CAPABILITY      CAP_ECOM_PLUGIN
+
+// uid for aiwsyncprovider 0x101F871F
+// #define KEComRecognitionUID2 0x10009D8D
+UID	0x10009D8D KAspSyncProviderDllUid
+
+
+USERINCLUDE	../inc
+
+// for AspSyncUtilApi.h
+USERINCLUDE     ../../../omadsappui/AspSyncUtil/inc
+
+// for nsmldssync.loc
+USERINCLUDE     ../../../omadsappui/AspSyncUtil/src
+
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE	/epoc32/include/ecom
+
+SOURCEPATH	../src
+SOURCE		AiwSyncProvider.cpp
+
+
+START RESOURCE  101F871F.rss
+TARGET          AiwSyncProvider
+TARGETPATH ECOM_RESOURCE_DIR
+END
+
+START RESOURCE  AiwSyncProvider.rss
+HEADER
+TARGET          AiwSyncProvider
+TARGETPATH RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
+
+
+LIBRARY	euser.lib
+LIBRARY ServiceHandler.lib
+LIBRARY aspsyncutil.lib
+
+LIBRARY	efsrv.lib
+LIBRARY avkon.lib
+
+DEBUGLIBRARY flogger.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AiwSyncProvider/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,23 @@
+/*
+* 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:  Provides information for building aiwsynprovider.
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+AiwSyncProvider.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AiwSyncProvider/inc/AiwSyncProvider.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,173 @@
+/*
+* 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: AIW provider plugin for data sync 
+*
+*/
+
+
+#ifndef AIWSYNCPROVIDER_H
+#define AIWSYNCPROVIDER_H
+
+//  INCLUDES
+#include <AiwServiceIfMenu.h>
+#include "AspSyncUtilApi.h"
+
+
+// CONSTANTS
+const TInt KBufSize = 128;
+const TInt KSyncApplicationId = 0;
+
+
+
+// CLASS DECLARATION
+
+
+/**
+* CAspSyncProvider
+*  
+* CAspSyncProvider implements CAiwServiceIfMenu interface to
+* allow synchronize functionality to be called via AIW.
+*
+* @lib syncservice.lib
+* @since Series 60 3.0
+*/
+class CAspSyncProvider : public CAiwServiceIfMenu 
+	{
+	public:
+        /**
+        * Two-phased constructor.
+        */
+		static CAspSyncProvider* NewL();
+
+        /**
+        * Destructor.
+        */
+		~CAspSyncProvider();
+
+	public:		
+        /**
+        * From the base class.
+		* Not implemented.
+        */
+		virtual void InitialiseL(MAiwNotifyCallback& aFrameworkCallback,
+			                     const RCriteriaArray& aInterest);
+
+        /**
+        * From the base class.
+		* Not implemented.
+        */
+		virtual void HandleServiceCmdL(const TInt& aCmdId,
+                                       const CAiwGenericParamList& aInParamList,
+                                       CAiwGenericParamList& aOutParamList,
+                                       TUint aCmdOptions = 0,
+                                       const MAiwNotifyCallback* aCallback = NULL);
+
+
+     	 /**
+         * Initialises menu pane by adding provider specific menu items.
+	     * The AIW Framework gives the parameters to be used in addition.
+	     * @param aMenuPane Menu pane handle
+	     * @param aIndex position of item where to add menu items.
+	     * @param aCascadeId ID of cascade menu item.
+	     * @param aInParamList input parameter list for provider's parameters checking
+	     */
+		virtual void InitializeMenuPaneL(CAiwMenuPane& aMenuPane,
+                                         TInt aIndex,
+                                         TInt aCascadeId,
+                                         const CAiwGenericParamList& aInParamList);
+
+        /**
+        * Handle a menu command invoked by the Handler.
+        * @param aMenuCmdId Command ID for the menu command,
+        *        defined by the provider when adding the menu commands.
+        * @param aInParamList Input parameters, could be empty list
+        * @param aOutParamList Output parameters, could be empty list
+        * @param aCmdOptions Options for the command, see KAiwCmdOpt* constants.
+        * @param aCallback callback if asynchronous command handling is wanted by consumer.
+        *    The provider may or may not support this, leaves with KErrNotSupported, it not.
+        */
+		virtual void HandleMenuCmdL(TInt aMenuCmdId,
+                                    const CAiwGenericParamList& aInParamList,
+                                    CAiwGenericParamList& aOutParamList,
+                                    TUint aCmdOptions = 0,
+                                    const MAiwNotifyCallback* aCallback = NULL);
+
+	private:
+        /**
+        * C++ default constructor.
+        */
+		CAspSyncProvider();
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+		void ConstructL();
+
+	
+	private:
+        /**
+		* Gets service command id from AIW parameter list.
+        * @param aInParamList AIW parameter list.
+		* @return Service command id.
+        */
+		TInt GetServiceCommandId(const CAiwGenericParamList& aInParamList);
+
+        /**
+		* Gets calling application id from AIW parameter list.
+        * @param aInParamList AIW parameter list.
+		* @return Application id.
+        */
+	    TInt GetApplicationId(const CAiwGenericParamList& aInParamList);
+
+        /**
+		* Gets sync file name from AIW parameter list.
+        * @param aInParamList AIW parameter list.
+        * @param aText File name.
+		* @return None.
+        */
+	    void GetFileName(const CAiwGenericParamList& aInParamList, TDes& aText);
+	    
+	private:
+        /**
+		* Displays information note.
+        * @param aText Information note text.
+		* @return None.
+        */
+	    void ShowInformationNoteL(const TDesC& aText);
+
+        /**
+		* Gets this plugin resource file name.
+        * @param aText Resource file name.
+		* @return None.
+        */
+		void GetResFileName(TDes& aText);
+		
+        /**
+		* Copies strings.
+        * @param aTarget.
+        * @param aSource.
+		* @return None.
+        */
+    	void StrCopy(TDes& aTarget, const TDesC& aSource);
+
+	private:
+	
+		// CSyncUtilApi handles synchronize operations. 
+		CSyncUtilApi* iSyncUtilApi;
+	};	
+
+#endif  // AIWSYNCPROVIDER_H
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AiwSyncProvider/inc/AiwSyncProvider.rh	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* 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: AIW sync plugin resource header
+*     
+*
+*/
+
+#ifndef _AIW_SYNCPROVIDER_RH
+#define _AIW_SYNCPROVIDER_RH
+
+enum
+	{
+	EAspSyncProviderCmdSynchronize = 1,
+	EAspSyncProviderCmdStart = 2,
+        EAspSyncProviderCmdSettings = 3,
+        EAspSyncProviderCmdRetrieve = 4
+	};
+
+
+#endif  // _AIW_SYNCPROVIDER_RH
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AiwSyncProvider/inc/AiwSyncProviderDebug.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* 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: AIW sync plugin debug definition 
+*
+*/
+
+
+#ifndef _AIW_SYNCPROVIDER_DEBUG_H
+#define _AIW_SYNCPROVIDER_DEBUG_H
+
+
+#ifdef _DEBUG
+
+#include <e32svr.h>
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT(KLogFile,"aiwsyncprovider.txt");
+_LIT(KLogDirFullName,"c:\\logs\\");
+_LIT(KLogDir,"aiwsyncprovider");
+
+// Declare the FPrint function
+inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
+    {
+    VA_LIST list;
+    VA_START(list,aFmt);
+    RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
+    }
+
+// ===========================================================================
+#ifdef __WINS__     // File logging for WINS
+// ===========================================================================
+#define FLOG(a)   { FPrint(a); }
+#define FTRACE(a) { a; }
+// ===========================================================================
+#else               // RDebug logging for target HW
+// ===========================================================================
+#define FLOG(a) { RDebug::Print(a);  }
+#define FTRACE(a) { a; }
+#endif //__WINS__
+
+// ===========================================================================
+#else // // No loggings --> Reduced binary size
+// ===========================================================================
+#define FLOG(a)
+#define FTRACE(a)
+
+#endif // _DEBUG
+
+
+#endif // _AIW_SYNCPROVIDER_DEBUG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AiwSyncProvider/inc/AiwSyncProviderUids.hrh	Wed Sep 01 12:30:02 2010 +0100
@@ -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: AIW sync plugin constants declaration
+*
+*/
+
+#ifndef _ASP_SYNPROVIDER_UIDS_HRH
+#define _ASP_SYNPROVIDER_UIDS_HRH
+
+//
+// Series60 Bulletin Board/Module Uids for Series60 - Part III
+// 270501663/101F871F AiwSyncProvider.dll
+// 270501664/101F8720 AspSyncUtil.dll
+//
+// 0x101F8721 AiwImplemetationUid
+
+// dll uid
+#define KAspSyncProviderDllUid   0x101F871F
+
+// aiw service class uid
+#define KAspSyncProviderIfaceUid 0x101F8652    // KAiwClassMenu (aiw	common.hrh)
+
+// aiw service command uid
+#define KAspSyncProviderImplUid  0x101F8721
+
+
+
+#endif  // _ASP_SYNPROVIDER_UIDS_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AiwSyncProvider/inc/AiwSyncProviderUtil.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* 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:  Utility classes.
+*
+*/
+
+
+#ifndef _AIW_SYNCPROVIDER_H
+#define _AIW_SYNCPROVIDER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <eikenv.h>
+
+
+// CONSTANTS
+
+const TInt KBufSize = 128;
+
+
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+
+/**
+* TAspUtil 
+* 
+*/
+class TUtil
+	{
+    public:
+        static void Panic(TInt aReason);
+		static void StrCopy(TDes& aTarget, const TDesC& aSource);
+		static TInt StrToInt(const TDesC& aText, TInt& aNum);
+		static void Print(const TDesC& aText);
+		static void Print(const TDesC& aText, TInt aNum);
+	};
+
+
+/**
+* TFileLog 
+* 
+*/
+class TFileLog
+    {
+    public:
+        static void Log(const TDesC& aText);
+		static void Log(const TDesC& aText1, const TDesC& aText2);
+		static void GetDateTime(TDes& aStr, TTime aTimeNum, TBool aDate, TBool aTime);
+		static void GetMediumType(TDes& aText, TInt aType);
+    };
+
+
+
+#endif  // _AIW_SYNCPROVIDER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AiwSyncProvider/src/101F871F.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* 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: 
+*     Declares Base service API for all providers to implement in order to
+*     offer services to Application Interworking Framework.
+*
+*/
+
+
+#include <eikon.rh>
+#include "registryinfov2.rh" 
+#include "AiwSyncProvider.rh"
+#include "AiwSyncProviderUids.hrh"
+#include <AiwCommon.hrh>
+
+//
+// plugin resources are placed in z:/system/libs/plugins
+//
+// this resource is needed by CAiwServiceHandler/ECom for
+// finding out what plugins exist
+//
+//
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	resource_format_version = RESOURCE_FORMAT_VERSION_2; 
+	dll_uid = KAspSyncProviderDllUid;  // dll id
+	interfaces = 
+		{
+		INTERFACE_INFO
+			{
+
+			// aiw service class (menu/base)
+			interface_uid = KAiwClassMenu;
+
+			implementations = 
+				{
+				  IMPLEMENTATION_INFO
+					{
+
+					// unique aiw service id that identifies the exact service 
+					implementation_uid = KAspSyncProviderImplUid;
+
+					version_no = 1;
+					display_name = "AIW Sync Provider";
+					default_data = "*";
+					opaque_data = KAiwCmdSynchronizeStr "||" KAiwCmdSynchronizeSelectedStr;
+					}
+				};
+			}
+
+		};
+	}
+
+
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AiwSyncProvider/src/AiwSyncProvider.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,483 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+#include <AiwMenu.h>
+#include <AiwGenericParam.hrh>
+#include <AiwCommon.hrh>
+
+#include <implementationproxy.h>
+
+#include <data_caging_path_literals.hrh>  // for resource and bitmap directories
+
+#include <AiwSyncProvider.rsg>
+#include "AiwSyncProvider.h"
+#include "AiwSyncProviderUids.hrh"
+#include "AiwSyncProvider.rh"
+#include "AiwSyncProviderDebug.h"
+
+#include <aknnotewrappers.h>    // CAknInformationNote
+
+
+
+
+_LIT( KResFileName, "z:AiwSyncProvider.rsc" );
+
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspSyncProvider* CAspSyncProvider::NewL()
+	{
+    FLOG( _L("CAspSyncProvider::NewL START") );
+
+	CAspSyncProvider* self = new (ELeave) CAspSyncProvider();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    
+    FLOG( _L("CAspSyncProvider::NewL END") );
+	return self;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::Constructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspSyncProvider::CAspSyncProvider()
+	{
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspSyncProvider::~CAspSyncProvider()
+	{
+	FLOG( _L("~CAspSyncProvider START") );
+	
+	delete iSyncUtilApi;
+	
+	FLOG( _L("~CAspSyncProvider END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncProvider::ConstructL()
+    {
+    FLOG( _L("CAspSyncProvider::ConstructL START") );
+ 
+	iSyncUtilApi = CSyncUtilApi::NewL();
+
+    FLOG( _L("CAspSyncProvider::ConstructL END") );
+    } 
+
+
+ 
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::InitialiseL (from CAiwServiceIfBase)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncProvider::InitialiseL(MAiwNotifyCallback& /*aFrameworkCallback*/,
+	    						   const RCriteriaArray& /*aInterest*/)
+	{
+	// Not implemented
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::HandleServiceCmdL (from CAiwServiceIfBase)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncProvider::HandleServiceCmdL(const TInt& aCmdId,
+                                         const CAiwGenericParamList& aInParamList,
+                                         CAiwGenericParamList& /*aOutParamList*/,
+                                         TUint /*aCmdOptions*/,
+                                         const MAiwNotifyCallback* /*aCallback*/)
+	{
+	TInt jobId = KErrNotFound;
+	TInt info1 = KErrNotFound;
+	TBuf<KBufSize> info2(KNullDesC);
+	TInt applicationId = GetApplicationId(aInParamList);
+
+	if (aCmdId != KAiwCmdSynchronize)
+		{
+		return;
+		}
+		
+   	if (applicationId == EGenericParamMessageItemEMail)
+		{
+	    GetFileName(aInParamList, info2);
+	    if (info2.Length() == 0)
+	    	{
+	    	FLOG( _L("### mailbox name not found ###") );
+	    	return; // email sync requires mailbox name
+	    	}
+	    info1 = EGenericParamMessageItemEMail;
+		}
+		
+	iSyncUtilApi->SynchronizeL(applicationId, jobId, info1, info2); 
+		
+    
+        
+    // R&D solution: Remove constness.
+    //MAiwNotifyCallback* callback = 
+    //    const_cast< MAiwNotifyCallback* >(aCallback);
+
+	//CAiwGenericParamList* dummyParamList = NULL;
+	
+	//callback->HandleNotifyL(0, 0, *dummyParamList, *dummyParamList);
+	}
+
+
+
+ 
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::InitializeMenuPaneL (from CAiwServiceIfMenu)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncProvider::InitializeMenuPaneL(CAiwMenuPane& aMenuPane,
+											  TInt aIndex,
+											  TInt /*aCascadeId*/,
+											  const CAiwGenericParamList& aInParamList)
+	{
+	FLOG( _L("CAspSyncProvider::InitializeMenuPaneL START") );
+	
+	
+	TFileName resFile;
+	GetResFileName(resFile);
+	
+	FTRACE( RDebug::Print(_L("resfile= '%S'  index= %d"), &resFile, aIndex) );
+
+    TInt serviceCommand = GetServiceCommandId(aInParamList);
+    
+    if (serviceCommand == KErrNotFound)
+    	{
+    	FLOG( _L("### service command not found ###") );
+    	FLOG( _L("CAspSyncProvider::InitializeMenuPaneL END") );
+    	return;
+    	}
+    
+    if (serviceCommand == KAiwCmdSynchronizeSelected)
+    	{
+        TRAPD(ignoreError, aMenuPane.AddMenuItemsL(resFile, R_ASPSYNCPROVIDER_MENU_4, KAiwCmdSynchronizeSelected, aIndex));
+        if (ignoreError != KErrNone)
+        	{
+        	FTRACE( RDebug::Print(_L("### CAiwMenuPane::AddMenuItemsL failed (%d) ###"), ignoreError) );
+        	}
+       	}
+       	
+    if (serviceCommand == KAiwCmdSynchronize)
+    	{
+    	TRAPD(ignoreError, aMenuPane.AddMenuItemsL(resFile, R_ASPSYNCPROVIDER_SUBMENU, KAiwCmdSynchronize, aIndex));
+        if (ignoreError != KErrNone)
+        	{
+        	FTRACE( RDebug::Print(_L("### CAiwMenuPane::AddMenuItemsL failed (%d) ###"), ignoreError) );
+        	}
+    	}
+    	
+    FLOG( _L("CAspSyncProvider::InitializeMenuPaneL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::HandleMenuCmdL (from CAiwServiceIfMenu)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncProvider::HandleMenuCmdL(TInt aMenuCmdId, 
+                                      const CAiwGenericParamList& aInParamList,
+                                      CAiwGenericParamList& /*aOutParamList*/,
+                                      TUint /*aCmdOptions*/,
+                                      const MAiwNotifyCallback* /*aCallback*/)
+	{
+	FLOG( _L("CAspSyncProvider::HandleMenuCmdL START") );
+    
+	TInt jobId = KErrNotFound;
+	TInt info1 = KErrNotFound;
+	TBuf<KBufSize> info2(KNullDesC);
+	TInt applicationId = GetApplicationId(aInParamList);
+	
+	if (applicationId == KErrNotFound)
+		{
+    	FLOG(_L("### application id not found ###"));
+		return; // must have consumer app id
+		}
+	
+	switch (aMenuCmdId)
+		{
+		case EAspSyncProviderCmdStart:
+			if (applicationId == EGenericParamMessageItemEMail)
+				{
+			    GetFileName(aInParamList, info2);
+			    if (info2.Length() == 0)
+			    	{
+			    	FLOG( _L("### mailbox name not found ###") );
+			    	return; // email sync requires mailbox name
+			    	}
+				}
+		
+			iSyncUtilApi->SynchronizeL(applicationId, jobId, info1, info2); 
+            break;
+
+		case EAspSyncProviderCmdSettings:
+		    iSyncUtilApi->ShowSettingsL(applicationId, info1, info2);
+            break;
+            
+		case EAspSyncProviderCmdRetrieve:
+		    applicationId = EGenericParamMessageItemEMail;
+		    info1 = KAiwCmdSynchronizeSelected;
+		    GetFileName(aInParamList, info2);
+		    if (info2.Length() == 0)
+		    	{
+		    	FLOG( _L("### mailbox name not found ###") );
+		    	return; // email sync requires mailbox name
+		    	}
+		    
+		    iSyncUtilApi->SynchronizeL(applicationId, jobId, info1, info2);
+            break; 
+            
+		default:
+		    FTRACE( RDebug::Print(_L("### unknown menu command (%d) ###"), aMenuCmdId) );
+			break;
+		}
+		
+	FLOG( _L("CAspSyncProvider::HandleMenuCmdL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::GetApplicationIdL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSyncProvider::GetApplicationId(const CAiwGenericParamList& aInParamList)
+	{
+	_LIT(KSyncApplicationName, "sync");
+	
+	TInt index = 0;
+	
+	const TAiwGenericParam* param = aInParamList.FindFirst(index, EGenericParamContactItem);
+	if (index >= 0)
+		{
+    	return EGenericParamContactItem;
+		}
+		
+	index = 0;
+	param = aInParamList.FindFirst(index, EGenericParamCalendarItem);
+	if (index >= 0)
+		{
+    	return EGenericParamCalendarItem;
+		}
+
+    index = 0;
+	param = aInParamList.FindFirst(index, EGenericParamMessageItemEMail);
+	if (index >= 0)
+		{
+    	return EGenericParamMessageItemEMail;
+		}
+		
+	index = 0;
+	param = aInParamList.FindFirst(index, EGenericParamNoteItem);
+	if (index >= 0)
+		{
+    	return EGenericParamNoteItem;
+		}
+   
+    index = 0;
+	param = aInParamList.FindFirst(index, EGenericParamMessageItemMMS);
+	if (index >= 0)
+		{
+    	return EGenericParamMessageItemMMS;
+		}
+
+    index = 0;
+	param = aInParamList.FindFirst(index, EGenericParamEmailAddress);
+	if (index >= 0)
+		{
+    	return EGenericParamEmailAddress;
+		}
+
+	// this is for starting Sync application - not used at the moment
+	index = 0;
+	param = aInParamList.FindFirst(index, EGenericParamApplication);
+	if (index >= 0)
+		{
+   	    TPtrC ptr;
+    	const TAiwVariant& val = param->Value();
+	    if (val.Get(ptr))
+		    {
+		    if (ptr.Compare(KSyncApplicationName) == 0)
+		    	{
+		    	return KSyncApplicationId;
+		    	}
+		    }
+		}
+
+	return KErrNotFound;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::GetFileName
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncProvider::GetFileName(const CAiwGenericParamList& aInParamList, TDes& aText)
+	{
+	aText = KNullDesC;
+	TInt index = 0;
+	const TAiwGenericParam* param = aInParamList.FindFirst(index, EGenericParamMessageItemMbox);
+	if (index < 0)
+		{
+		return;
+		}
+
+    TPtrC ptr;
+	const TAiwVariant& val = param->Value();
+	if (!val.Get(ptr))
+		{
+		FLOG(_L("### CAspSyncProvider::GetFileName: param value not found ###"));
+		return;
+		}
+	
+	StrCopy(aText, ptr);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::GetServiceCommandId
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSyncProvider::GetServiceCommandId(const CAiwGenericParamList& aInParamList)
+	{
+	TInt index = 0;
+	const TAiwGenericParam* param = aInParamList.FindFirst(index, EGenericParamServiceCommand);
+	if (index < 0)
+		{
+    	return KErrNotFound;
+		}
+
+    TInt32 num = 0;
+	const TAiwVariant& val = param->Value();
+	if (!val.Get(num))
+		{
+		FLOG(_L("CAspSyncProvider::GetServiceCommandId: param value not found"));
+		return KErrNotFound;
+		}
+	return num;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncProvider::GetResFileName
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncProvider::GetResFileName(TDes& aText)
+	{
+	TParse parse;
+	parse.Set(KResFileName, &KDC_RESOURCE_FILES_DIR, NULL);
+	StrCopy(aText, parse.FullName());
+	}
+
+
+// -------------------------------------------------------------------------------
+// CAspSyncProvider::StrCopy
+//
+// String copy with lenght check.
+// -------------------------------------------------------------------------------
+//
+void CAspSyncProvider::StrCopy(TDes& aTarget, const TDesC& aSource)
+    {
+	TInt len = aTarget.MaxLength();
+    if(len < aSource.Length()) 
+	    {
+		aTarget.Copy(aSource.Left(len));
+		return;
+	    }
+	aTarget.Copy(aSource);
+    }
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowInformationNoteL
+//
+//------------------------------------------------------------------------------
+//
+void CAspSyncProvider::ShowInformationNoteL(const TDesC& aText)
+	{
+	CAknInformationNote* queryDialog = new (ELeave) CAknInformationNote(ETrue);
+	queryDialog->ExecuteLD(aText);
+	}
+
+
+
+
+
+//
+// Rest of the file is for ECom initialization. 
+//
+
+
+
+
+// -----------------------------------------------------------------------------
+// Map the interface UIDs to implementation factory functions
+//
+// -----------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY(KAspSyncProviderImplUid,	CAspSyncProvider::NewL)
+    };
+
+
+// -----------------------------------------------------------------------------
+// Exported proxy for instantiation method resolution
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+{
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+
+    return ImplementationTable;
+}
+
+
+
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AiwSyncProvider/src/AiwSyncProvider.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+#include <eikon.rh>
+#include "registryinfov2.rh" 
+#include "AiwSyncProvider.rh"
+#include<nsmldssync.loc>
+#include "AiwCommon.hrh"
+
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+
+
+
+//  RESOURCE IDENTIFIER
+//NAME MTMU
+
+NAME ASPP
+
+RESOURCE RSS_SIGNATURE { }
+
+
+RESOURCE MENU_PANE r_aspsyncprovider_menu
+{
+    items=
+		{
+		MENU_ITEM { cascade=r_aspsyncprovider_submenu; command=EAspSyncProviderCmdSynchronize; txt=qtn_ds_options_sync; }
+		};
+}
+
+
+RESOURCE MENU_PANE r_aspsyncprovider_menu_2
+{
+    items=
+		{
+		MENU_ITEM { cascade=r_aspsyncprovider_submenu_2; command=EAspSyncProviderCmdSynchronize; txt=qtn_ds_options_sync; }
+		};
+}
+
+
+RESOURCE MENU_PANE r_aspsyncprovider_menu_3
+{
+    items=
+		{
+		MENU_ITEM { cascade=r_aspsyncprovider_submenu_3; command=EAspSyncProviderCmdSynchronize; txt=qtn_ds_options_sync; }
+		};
+}
+
+
+RESOURCE MENU_PANE r_aspsyncprovider_menu_4
+	{
+	items =
+		{
+		MENU_ITEM { command=EAspSyncProviderCmdRetrieve; txt=qtn_ds_options_sync_retrieve; }
+		};
+	}
+
+
+RESOURCE MENU_PANE r_aspsyncprovider_submenu
+	{
+	items =
+		{
+		MENU_ITEM { command=AIW_SUBMENU_TITLE; txt=qtn_ds_options_sync; },
+		MENU_ITEM { command=EAspSyncProviderCmdStart;	 txt=qtn_ds_options_sync_start; },
+		MENU_ITEM { command=EAspSyncProviderCmdSettings; txt=qtn_ds_options_sync_settings; }
+		};
+	}
+
+
+RESOURCE MENU_PANE r_aspsyncprovider_submenu_2
+	{
+	items =
+		{
+		MENU_ITEM { command=AIW_SUBMENU_TITLE; txt=qtn_ds_options_sync; },
+		MENU_ITEM { command=EAspSyncProviderCmdStart;	 txt=qtn_ds_options_sync_start; }
+		};
+	}
+
+
+RESOURCE MENU_PANE r_aspsyncprovider_submenu_3
+	{
+	items =
+		{
+		MENU_ITEM { command=AIW_SUBMENU_TITLE; txt=qtn_ds_options_sync; },
+		MENU_ITEM { command=EAspSyncProviderCmdSettings; txt=qtn_ds_options_sync_settings; }
+		};
+	}
+
+
+
+
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspPreSyncPlugin/data/AspPreSyncDefault.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,53 @@
+/*
+* 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:  
+*
+*/
+
+
+#include <ecom/registryinfov2.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+{
+    resource_format_version = RESOURCE_FORMAT_VERSION_2; 
+	// UID for the DLL
+	dll_uid = 0x2001955E;
+	
+	// Declare array of interface info
+	interfaces = 
+		{
+		INTERFACE_INFO
+			{
+			
+			// UID of interface that is implemented
+			interface_uid = 0x2001955C;
+			
+			implementations = 
+				{
+				
+				// Info for all implementations					
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x2001955D;
+					version_no         = 1;
+					display_name       = "DEFAULT"; 
+					default_data       = "";    
+					opaque_data        = ""; 
+					}
+					
+				};
+			}
+		};
+}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspPreSyncPlugin/group/AspPreSyncDefault.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <platform_paths.hrh>
+#include <defaultcaps.hrh>
+
+
+TARGET AspPreSyncDefault.dll
+TARGETTYPE PLUGIN
+
+// ECom Dll recognition UID followed by the unique UID for this dll
+UID 0x10009D8D 0x2001955E
+//SECUREID 0xE01F614F
+
+
+VENDORID VID_DEFAULT
+
+CAPABILITY      CAP_ECOM_PLUGIN
+
+START  RESOURCE ../data/AspPreSyncDefault.rss
+TARGET          AspPreSyncDefault.rsc
+END
+
+SOURCEPATH      ../src
+SOURCE      proxy.cpp 
+SOURCE      AspPreSyncDefaultPlugin.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE      ../../AspSyncUtil/inc
+APP_LAYER_SYSTEMINCLUDE   
+
+
+LIBRARY avkon.lib
+LIBRARY commonengine.lib //For String loader
+LIBRARY	centralrepository.lib //For Centralrepository
+LIBRARY euser.lib ECom.lib
+LIBRARY cone.lib                  // Symbian OS framework libraries
+LIBRARY bafl.lib                            // Basic Application Framework Library
+LIBRARY charconv.lib                        // Character conversion library
+LIBRARY eikcoctl.lib eiksrv.lib             // Eikon libraries
+LIBRARY eikdlg.lib                          // Eikon libraries
+LIBRARY eikcore.lib                         // Library for eikonEnv static functions (BringForwards)
+LIBRARY eiksrvui.lib                        // Eikon server ui (for suppressing app -key)
+LIBRARY esock.lib                           // Sockects library for host resolver
+LIBRARY AknSkins.lib                        // Skinned icons
+LIBRARY aknNotifierWrapper.lib
+LIBRARY ConnMon.lib
+LIBRARY aknnotify.lib efsrv.lib 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspPreSyncPlugin/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* 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:  
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+
+PRJ_PLATFORMS
+
+
+PRJ_MMPFILES
+    AspPreSyncDefault.mmp
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspPreSyncPlugin/inc/AspPreSyncDefaultPlugin.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,148 @@
+/*
+* 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:  This is the default plugin which will be called before starting
+*                the snchronization.
+*
+*/
+
+
+#ifndef ASPPRESYNCDEFAULTPLUGIN_H
+#define ASPPRESYNCDEFAULTPLUGIN_H
+
+// INCLUDES
+#include <e32cmn.h>
+#include <s32mem.h>
+#include <e32hashtab.h>
+#include <e32property.h>
+#include <centralrepository.h>
+#include <ConeResLoader.h> 
+#include <bautils.h>
+#include <eikenv.h>
+#include "CPreSyncPlugin.h"
+#include <AknQueryDialog.h>
+
+//  INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+class CAknGlobalMsgQuery;
+
+class CRoamingCheck : public CBase
+	{
+	public:
+    /*!
+    @function NewL
+    */
+    static CRoamingCheck* NewL();
+    
+      /*!
+      @function NewLC
+      */
+    static CRoamingCheck* NewLC();
+    
+      /*!
+      @function ConstructL
+      
+      @discussion Perform the second phase construction of a CRoamingCheck object
+      this needs to be public 
+      */
+     void ConstructL();
+
+      /*!
+      @function CRoamingCheck
+      
+      @discussion Perform the first phase of two phase construction.
+      This needs to be public 
+      */
+     CRoamingCheck(CEikonEnv* aEikEnv);
+     /*!
+      @function ~CRoamingCheck
+      @discussion Destroy the object and release all memory objects
+      */
+    ~CRoamingCheck();
+    void ShowGlobalNoteL(TInt aSoftKeyId, 
+              const HBufC* aMessage, TInt& status);
+	private:
+    CAknGlobalMsgQuery* iGlobalNote;
+    CEikonEnv* iEnv;
+    RConeResourceLoader iResLoader;
+    };
+
+
+// FORWARD DECLARATION
+
+// CLASS DECLARATION
+class CPreSyncDefaultPlugin : public CPreSyncPlugin
+{
+	public: 
+	
+		/**
+		* Two phase construction
+		*/
+		static CPreSyncDefaultPlugin* NewL();
+
+		/**
+		* Destructor
+		*/
+		virtual ~CPreSyncDefaultPlugin();
+
+
+     public:
+
+         /**
+          * Function:    IsSupported
+          *
+          */
+         virtual TBool IsSupported();
+         
+         /**
+          * Function:    CanSync
+          *
+          */
+         virtual TBool CanSyncL();
+         
+         /**
+          * Function:    SetProfile  
+          *
+          */
+         virtual TBool SetProfile(const TSmlProfileId& aProfileId);
+         
+         /**
+          * Function:    SyncNow  
+          *
+          */   
+         virtual TInt SyncNow(MSyncExtObserver* aObserver);
+
+		
+	private:
+	    void  ReadRepositoryL(TInt aKey, TInt& aValue);
+	    
+	    
+		/**
+		* Constructor
+		*/
+		CPreSyncDefaultPlugin();
+
+		/**
+		* 2nd phase construtor
+		*/
+		void ConstructL();
+		
+	private:
+	    TSmlProfileId iSyncProfileId;
+};
+	
+
+#endif // ASPPRESYNCDEFAULTPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspPreSyncPlugin/src/AspPreSyncDefaultPlugin.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,289 @@
+/*
+* 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:  Implements the default plugin
+*
+*/
+
+
+// INCLUDES
+#include "AspPreSyncDefaultPlugin.h"
+
+#include <ConeResLoader.h> 
+#include <bautils.h>
+#include <eikenv.h>
+#include <AknGlobalNote.h>
+#include <StringLoader.h>
+#include <avkon.rsg>
+#include <avkon.hrh>
+#include <AknGlobalMsgQuery.h>
+#include <rconnmon.h>
+
+
+#include <AknQueryDialog.h>
+#include <AspSyncUtil.rsg>
+#include <StringLoader.h> 
+#include <aspdefines.h> //For enum TRoamingSettings
+#include <centralrepository.h> //For central Repository
+
+// ============================== MEMBER FUNCTIONS ============================
+
+_LIT(KDC_RESOURCE_FILES_DIR,"\\resource\\");
+_LIT(KResourceFile,        "z:AspSyncUtil.rsc");
+
+
+// -------------------------------------------------------------------------------
+// CRoamingCheck::NewL
+//
+// 
+// -------------------------------------------------------------------------------
+//
+CRoamingCheck* CRoamingCheck::NewL()
+    {
+    CRoamingCheck* self = CRoamingCheck::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -------------------------------------------------------------------------------
+// CRoamingCheck::NewLC
+//
+// 
+// -------------------------------------------------------------------------------
+//
+CRoamingCheck* CRoamingCheck::NewLC()
+    {
+    CRoamingCheck* self = new (ELeave) CRoamingCheck(CEikonEnv::Static());
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// -------------------------------------------------------------------------------
+// CRoamingCheck::CRoamingCheck
+//
+// 
+// -------------------------------------------------------------------------------
+//
+CRoamingCheck::CRoamingCheck(CEikonEnv* aEikEnv) 
+        : iEnv(aEikEnv),iResLoader (*aEikEnv)
+	{
+	}
+
+// -------------------------------------------------------------------------------
+// CRoamingCheck::~CRoamingCheck
+//
+// 
+// -------------------------------------------------------------------------------
+//
+CRoamingCheck::~CRoamingCheck()
+	{    
+    iResLoader.Close();
+	delete iGlobalNote;
+	
+	}
+
+// -------------------------------------------------------------------------------
+// CRoamingCheck::ConstructL
+//
+// 
+// -------------------------------------------------------------------------------
+//
+void CRoamingCheck::ConstructL()
+    {    
+    iGlobalNote = CAknGlobalMsgQuery::NewL();
+    
+    // Resolve resource file path
+    TFileName fileName(0);
+    TParse parse;
+    parse.Set(KResourceFile,&KDC_RESOURCE_FILES_DIR,NULL);
+    fileName.Append( parse.FullName() );
+    // Get language of resource file
+    BaflUtils::NearestLanguageFile(iEnv->FsSession(), fileName );
+    // Open resource file
+    TInt err = iResLoader.Open( fileName );            
+  	}
+    
+// -------------------------------------------------------------------------------
+// CRoamingCheck::ShowGlobalNoteL
+//
+// 
+// -------------------------------------------------------------------------------
+//
+void CRoamingCheck::ShowGlobalNoteL(TInt aSoftKeyId, 
+                  const HBufC* aMessage, TInt& status)
+	{
+    iGlobalNote->CancelMsgQuery();
+	TRequestStatus GlobalNotestatus = KErrNone;
+	iGlobalNote->ShowMsgQueryL( GlobalNotestatus, *aMessage, aSoftKeyId, KNullDesC , KNullDesC ); 
+	User::WaitForRequest(GlobalNotestatus);
+	iGlobalNote->CancelMsgQuery();
+	status=GlobalNotestatus.Int();
+	}
+
+
+// ----------------------------------------------------------------------------
+// CPreSyncDefaultPlugin::NewL
+// Two Phase Construction
+// ----------------------------------------------------------------------------
+CPreSyncDefaultPlugin* CPreSyncDefaultPlugin::NewL()
+{
+	CPreSyncDefaultPlugin* self = new ( ELeave ) CPreSyncDefaultPlugin();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+
+	return self;
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncDefaultPlugin::CPreSyncDefaultPlugin
+// Two Phase Construction
+// ----------------------------------------------------------------------------
+CPreSyncDefaultPlugin::CPreSyncDefaultPlugin()
+{		
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncDefaultPlugin::ConstructL
+// Two Phase Construction
+// ----------------------------------------------------------------------------
+void CPreSyncDefaultPlugin::ConstructL()
+{
+} 
+	
+	
+// ----------------------------------------------------------------------------
+// CPreSyncDefaultPlugin::~CPreSyncDefaultPlugin
+// Destructor
+// ----------------------------------------------------------------------------
+CPreSyncDefaultPlugin::~CPreSyncDefaultPlugin()
+{
+}
+
+
+// -------------------------------------------------------------------------------
+// CPreSyncDefaultPlugin::IsSupported
+//
+// 
+// -------------------------------------------------------------------------------
+//
+TBool CPreSyncDefaultPlugin::IsSupported()
+    {
+    return ETrue;
+    }
+
+// -------------------------------------------------------------------------------
+// CPreSyncDefaultPlugin::CanSyncL
+//
+// 
+// -------------------------------------------------------------------------------
+//
+TBool CPreSyncDefaultPlugin::CanSyncL()
+    {
+    return ETrue;
+    /*
+    TBool ret = ETrue;
+    TInt value(0);
+    
+    ReadRepositoryL(KNSmlRoamingSettingKey, value);    
+    CRoamingCheck* roamingCheck = CRoamingCheck::NewL();
+    CleanupStack::PushL(roamingCheck);
+    
+	HBufC* hBuf = NULL;
+	CAknQueryDialog* queryDialog = NULL;
+    
+    switch(value)
+        {
+        case ERoamingSettingAlwaysAsk:
+			hBuf = StringLoader::LoadLC(R_ASP_NOTE_NETWORK_CONFIRMATION);
+			queryDialog = new (ELeave) CAknQueryDialog;
+			ret = queryDialog->ExecuteLD(R_ASP_ROAMING_CONFIRMATION_QUERY, hBuf->Des());
+			if(ret)
+				{
+				ret = ETrue;
+				}
+			else
+				{
+				ret = EFalse;
+				}
+			CleanupStack::PopAndDestroy(hBuf);
+            break;
+        case ERoamingSettingAlwaysAllow:
+            break;
+        case ERoamingSettingNeverAllow:
+     		hBuf = StringLoader::LoadLC(R_ASP_NOTE_NETWORK_NOT_ALLOWED);
+			queryDialog = new (ELeave) CAknQueryDialog;
+			ret = queryDialog->ExecuteLD(R_ASP_INFORMATION_QUERY, hBuf->Des());
+			CleanupStack::PopAndDestroy(hBuf);
+
+            ret = EFalse;
+            break;
+        case ERoamingSettingBlock:
+			hBuf = StringLoader::LoadLC(R_ASP_NOTE_NOT_HOME_NETWORK);
+			queryDialog = new (ELeave) CAknQueryDialog;
+			ret = queryDialog->ExecuteLD(R_ASP_INFORMATION_QUERY, hBuf->Des());
+			CleanupStack::PopAndDestroy(hBuf);
+
+            ret = EFalse;
+            break;
+        default:
+            break;
+        }
+    
+    CleanupStack::PopAndDestroy(roamingCheck);
+    return ret;
+    */
+    }
+
+// -------------------------------------------------------------------------------
+// CPreSyncDefaultPlugin::ReadRepositoryL
+//
+// 
+// -------------------------------------------------------------------------------
+//
+void CPreSyncDefaultPlugin::ReadRepositoryL(TInt aKey, TInt& aValue)
+    {
+    CRepository* rep = CRepository::NewLC(KCRUidNSmlDSApp);
+    TInt err = rep->Get(aKey, aValue);
+    User::LeaveIfError(err);
+    
+    CleanupStack::PopAndDestroy(rep);
+    }
+
+
+// -------------------------------------------------------------------------------
+// CPreSyncDefaultPlugin::SetProfile
+//
+// 
+// -------------------------------------------------------------------------------
+//
+TBool CPreSyncDefaultPlugin::SetProfile(const TSmlProfileId& aProfileId)
+    {
+    iSyncProfileId = aProfileId;
+    return ETrue;
+    }
+
+// -------------------------------------------------------------------------------
+// CPreSyncDefaultPlugin::SyncNow
+//
+// 
+// -------------------------------------------------------------------------------
+//
+TInt CPreSyncDefaultPlugin::SyncNow(MSyncExtObserver* aObserver)
+    {
+    TInt retValue = 1;
+    return retValue;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspPreSyncPlugin/src/proxy.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -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:
+*
+*/
+
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+#include "AspPreSyncDefaultPlugin.h"
+
+// Map the interface implementation UIDs to implementation factory functions
+const TImplementationProxy ImplementationTable[] =
+    {
+            IMPLEMENTATION_PROXY_ENTRY(0x2001955D,  CPreSyncDefaultPlugin::NewL)
+    };
+
+
+// Exported proxy for instantiation method resolution.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspScheduleHandler/group/aspschedulehandler.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+// 0x101F99FA  uid for AspScheduleHandler
+// 0x101F99FB  uid for repository id
+// 0x101F99FC
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET          	AspScheduleHandler.exe
+TARGETTYPE		EXE
+UID 0x100039CE 0x101F99FA
+
+VENDORID VID_DEFAULT
+
+CAPABILITY  CAP_APPLICATION
+
+
+SOURCEPATH ../src
+
+SOURCE				aspschedulehandler.cpp
+
+USERINCLUDE . 
+USERINCLUDE ../inc
+
+// for AspSyncUtilApi.h
+USERINCLUDE     ../../../omadsappui/AspSyncUtil/inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY	euser.lib
+LIBRARY	efsrv.lib
+LIBRARY	estor.lib
+LIBRARY	schsvr.lib
+LIBRARY aspsyncutil.lib
+DEBUGLIBRARY flogger.lib
+
+
+//VENDORID 0x70000001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspScheduleHandler/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+
+
+aspschedulehandler.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspScheduleHandler/inc/AspDebug.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* 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:  
+*
+*/
+
+
+
+#ifndef NSMLDSSYNC__DEBUG_H
+#define NSMLDSSYNC__DEBUG_H
+
+
+#ifdef _DEBUG
+
+#include <e32svr.h>
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT(KLogFile,"smlsync.txt");
+_LIT(KLogDirFullName,"c:\\logs\\");
+_LIT(KLogDir,"smlsync");
+
+
+// Declare the FPrint function
+inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
+    {
+    VA_LIST list;
+    VA_START(list,aFmt);
+    RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
+    }
+
+// ===========================================================================
+#ifdef __WINS__     // File logging for WINS
+// ===========================================================================
+#define FLOG(a)   { FPrint(a); }
+//#define FLOG(a) { RDebug::Print(a);  }
+#define FTRACE(a) { a; }
+// ===========================================================================
+#else               // RDebug logging for target HW
+// ===========================================================================
+#define FLOG(a) { RDebug::Print(a);  }
+#define FTRACE(a) { a; }
+#endif //__WINS__
+
+// ===========================================================================
+#else // // No loggings --> Reduced binary size
+// ===========================================================================
+#define FLOG(a)
+#define FTRACE(a)
+
+#endif // _DEBUG
+
+
+#endif // NSMLDSSYNC__DEBUG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspScheduleHandler/src/aspschedulehandler.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+#include <schinfo.h>
+#include <schtask.h>
+#include <s32file.h>
+#include <e32math.h>
+#include <e32cons.h>
+
+#include "AspSyncUtilApi.h"
+#include "AspDebug.h"
+
+
+
+// -----------------------------------------------------------------------------
+// SynchronizeL
+//
+// -----------------------------------------------------------------------------
+//
+LOCAL_D void SynchronizeL(RFile& aTaskFile)
+	{
+	CSyncUtilApi* syncUtilApi = CSyncUtilApi::NewL();
+	CleanupStack::PushL(syncUtilApi);
+	
+	syncUtilApi->SynchronizeL(aTaskFile);
+	
+	CleanupStack::PopAndDestroy(syncUtilApi);
+	}
+
+
+// -----------------------------------------------------------------------------
+// ExecuteL
+//
+// -----------------------------------------------------------------------------
+//
+LOCAL_D TInt ExecuteL()
+	{
+	TInt err = KErrNoMemory;
+		
+	RFile file;
+		
+	// Adopt the task file from the Task Scheduler
+	err = file.AdoptFromCreator(TScheduledTaskFile::FsHandleIndex(),
+									TScheduledTaskFile::FileHandleIndex());
+	User::LeaveIfError(err);
+	
+	TRAP(err, SynchronizeL(file));
+	
+	file.Close();
+	
+	User::LeaveIfError(err);		
+	return err;
+	}
+
+
+// -----------------------------------------------------------------------------
+// Execute
+//
+// -----------------------------------------------------------------------------
+//
+LOCAL_D TInt Execute()
+	{
+	TInt err = KErrNoMemory;
+	
+	// construct and install active scheduler
+	CActiveScheduler* scheduler = new CActiveScheduler;
+	if (!scheduler)
+		{
+		return err;
+		}
+	CActiveScheduler::Install(scheduler);
+
+	CTrapCleanup* cleanupStack = CTrapCleanup::New();
+	
+	if (cleanupStack)
+		{
+        TRAP(err, ExecuteL());
+		delete cleanupStack;
+		}
+
+    delete scheduler;
+    
+	return err;
+	}
+
+
+// -----------------------------------------------------------------------------
+// E32Main
+//
+// -----------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+	{
+	return Execute();
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/BWINS/AspSyncUtilu.def	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,6 @@
+EXPORTS
+	?NewL@CSyncUtilApi@@SAPAV1@XZ @ 1 NONAME ; class CSyncUtilApi * CSyncUtilApi::NewL(void)
+	?ShowSettingsL@CSyncUtilApi@@QAEXHHAAVTDes16@@@Z @ 2 NONAME ; void CSyncUtilApi::ShowSettingsL(int, int, class TDes16 &)
+	?SynchronizeL@CSyncUtilApi@@QAEXAAVRFile@@@Z @ 3 NONAME ; void CSyncUtilApi::SynchronizeL(class RFile &)
+	?SynchronizeL@CSyncUtilApi@@QAEXHHHAAVTDes16@@@Z @ 4 NONAME ; void CSyncUtilApi::SynchronizeL(int, int, int, class TDes16 &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/eabi/AspSyncUtilu.def	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,8 @@
+EXPORTS
+	_ZN12CSyncUtilApi12SynchronizeLER5RFile @ 1 NONAME
+	_ZN12CSyncUtilApi12SynchronizeLEiiiR6TDes16 @ 2 NONAME
+	_ZN12CSyncUtilApi13ShowSettingsLEiiR6TDes16 @ 3 NONAME
+	_ZN12CSyncUtilApi4NewLEv @ 4 NONAME
+	_ZTI12CSyncUtilApi @ 5 NONAME DATA 12 ; #<TI>#
+	_ZTV12CSyncUtilApi @ 6 NONAME DATA 20 ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/group/AspSyncUtil.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,142 @@
+/*
+* 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:  Project specification file.
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+#include <bldvariant.hrh>
+
+TARGET        AspSyncUtil.dll
+TARGETTYPE    dll
+
+// 0x101F8720 AspSyncUtil.dll
+UID	0x10009D8D 0x101F8720
+
+VENDORID VID_DEFAULT
+
+CAPABILITY CAP_GENERAL_DLL
+
+
+USERINCLUDE	../inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE	/epoc32/include/ecom
+
+
+SOURCEPATH	../src
+SOURCE		AspSyncUtilApi.cpp
+SOURCE		AspSyncHandler.cpp
+SOURCE		AspUtil.cpp
+SOURCE		AspState.cpp
+SOURCE		AspResHandler.cpp
+SOURCE		AspDbNotifier.cpp
+SOURCE		AspSyncUtil.cpp
+SOURCE		AspProfile.cpp
+SOURCE		AspProgressDialog.cpp
+SOURCE		AspContentDialog.cpp
+SOURCE		AspSettingDialog.cpp
+SOURCE		AspProfileDialog.cpp
+SOURCE		AspDialogUtil.cpp
+SOURCE		AspProfileWizard.cpp
+SOURCE		AspProfileWizardDialog.cpp
+SOURCE		AspLogDialog.cpp
+SOURCE		AspScheduleDialog.cpp
+SOURCE		AspSchedule.cpp
+SOURCE          AspSettingViewDialog.cpp
+SOURCE          AspAutoSyncHandler.cpp
+SOURCE		AspAdvanceSettingsDialog.cpp AspPreSyncPluginInterface.cpp
+
+
+//SOURCE		AspProfileSelectionDialog.cpp
+//SOURCE		AspFilterDialog.cpp
+//SOURCE		AspFilter.cpp
+
+// other resources must be placed in z:/system/data
+START RESOURCE ../src/AspSyncUtil.rss
+TARGETPATH      RESOURCE_FILES_DIR
+HEADER
+LANGUAGE_IDS
+END
+
+
+LIBRARY	euser.lib
+LIBRARY cone.lib 
+
+LIBRARY eikcore.lib 
+LIBRARY avkon.lib
+LIBRARY eikctl.lib
+LIBRARY ecom.lib
+LIBRARY eikdlg.lib
+LIBRARY bafl.lib
+LIBRARY commonengine.lib
+LIBRARY eikcoctl.lib
+LIBRARY estor.lib
+LIBRARY edbms.lib
+LIBRARY AknSkins.lib
+LIBRARY aknicon.lib
+LIBRARY fbscli.lib
+LIBRARY egul.lib
+LIBRARY etext.lib
+LIBRARY gdi.lib
+LIBRARY cdlengine.lib
+LIBRARY AknLayout2Scalable.lib
+
+
+LIBRARY	FeatMgr.lib
+LIBRARY commdb.lib
+LIBRARY apengine.lib
+LIBRARY	efsrv.lib
+LIBRARY commondialogs.lib
+LIBRARY	hlplch.lib
+LIBRARY	apsettingshandlerui.lib
+LIBRARY ConnectionUiUtilities.lib
+LIBRARY Muiu.lib
+LIBRARY ws32.lib
+
+LIBRARY	schsvr.lib
+LIBRARY	centralrepository.lib
+LIBRARY	connmon.lib
+
+LIBRARY	cmmanager.lib
+//LIBRARY SmlClient.lib
+LIBRARY SyncMLClientAPI.lib
+//LIBRARY syncmldatafilter.lib
+LIBRARY nsmltransporthandler.lib
+
+//#ifdef __SAP_POLICY_MANAGEMENT
+LIBRARY	policyengine.lib calinterimapi.lib 
+//#endif
+LIBRARY     	calencommonutils.lib
+LIBRARY			CalenInterimUtils2.lib
+
+//LIBRARY nsmlxml.lib
+//LIBRARY nsmlwbxml.lib
+//LIBRARY nsmltransport.lib
+//LIBRARY nsmlhistorylog.lib
+//LIBRARY nsmldshostserver.lib
+//LIBRARY nsmldshostclient.lib
+//LIBRARY NSmlDSSettings.lib
+//LIBRARY nsmlagentcommon.lib
+
+//LIBRARY nsmldebug.lib
+DEBUGLIBRARY flogger.lib
+
+//EXPORTUNFROZEN
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/group/aspsyncutil_icons.mk	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,87 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+#
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\SYSTEM\APPS\aspsyncutil
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\aspsyncutil.mif
+HEADERFILENAME=$(HEADERDIR)\aspsyncutil.mbg
+
+
+do_nothing : 
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+#
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_prop_sml_http.bmp \
+	/c8,8 qgn_prop_sml_http_off.bmp \
+	/c8,8 qgn_prop_sml_bt.bmp \
+	/c8,8 qgn_prop_sml_bt_off.bmp \
+	/c8,8 qgn_prop_sml_usb.bmp \
+	/c8,8 qgn_prop_sml_usb_off.bmp \
+	/c8,8 qgn_prop_sml_ir.bmp \
+	/c8,8 qgn_prop_sml_ir_off.bmp \
+	/c8,8 qgn_menu_sml_cxt.bmp \
+	/c8,8 qgn_note_sml.bmp \
+	/c8,8 qgn_note_sml_server.bmp \
+	/c8,8 qgn_prop_sml_sync_server.bmp \
+	/c8,8 qgn_prop_sml_sync_to_server.bmp \
+	/c8,8 qgn_prop_sml_sync_from_server.bmp \
+	/c8,8 qgn_prop_sml_sync_off.bmp \
+
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/group/aspsyncutil_icons_dc.mk	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,88 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+#
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\aspsyncutil.mif
+
+HEADERDIR=\epoc32\include
+HEADERFILENAME=$(HEADERDIR)\aspsyncutil.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+#
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_prop_sml_http.bmp \
+	/c8,8 qgn_prop_sml_http_off.bmp \
+	/c8,8 qgn_prop_sml_bt.bmp \
+	/c8,8 qgn_prop_sml_bt_off.bmp \
+	/c8,8 qgn_prop_sml_usb.bmp \
+	/c8,8 qgn_prop_sml_usb_off.bmp \
+	/c8,8 qgn_prop_sml_ir.bmp \
+	/c8,8 qgn_prop_sml_ir_off.bmp \
+	/c8,8 qgn_menu_sml_cxt.bmp \
+	/c8,8 qgn_note_sml.bmp \
+	/c8,8 qgn_note_sml_server.bmp \
+	/c8,8 qgn_prop_sml_sync_server.bmp \
+	/c8,8 qgn_prop_sml_sync_to_server.bmp \
+	/c8,8 qgn_prop_sml_sync_from_server.bmp \
+	/c8,8 qgn_prop_sml_sync_off.bmp \
+	/c8,8 qgn_indi_sync_set_add.bmp \
+	/c8,8 qgn_indi_sett_protected_add.bmp \
+	/c8,8 qgn_prop_sml_new.bmp\
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../loc/NSmlDSSync.loc		APP_LAYER_LOC_EXPORT_PATH(NSmlDSSync.loc)
+../loc/NSmlSyncProfiles.loc      APP_LAYER_LOC_EXPORT_PATH(NSmlSyncProfiles.loc)
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE aspsyncutil.mif
+  OPTION HEADERFILE aspsyncutil.mbg
+  OPTION SOURCES 	\
+    -c8,8 qgn_prop_sml_http -c8,8 qgn_prop_sml_http_off -c8,8 qgn_prop_sml_bt \
+	  -c8,8 qgn_prop_sml_bt_off -c8,8 qgn_prop_sml_usb -c8,8 qgn_prop_sml_usb_off \
+	  -c8,8 qgn_prop_sml_ir -c8,8 qgn_prop_sml_ir_off -c8,8 qgn_menu_sml_cxt \
+	  -c8,8 qgn_note_sml -c8,8 qgn_note_sml_server -c8,8 qgn_prop_sml_sync_server \
+	  -c8,8 qgn_prop_sml_sync_to_server -c8,8 qgn_prop_sml_sync_from_server -c8,8 qgn_prop_sml_sync_off \
+	  -c8,8 qgn_indi_sync_set_add -c8,8 qgn_indi_sett_protected_add -c8,8 qgn_prop_sml_new
+END
+
+PRJ_MMPFILES
+
+//gnumakefile aspsyncutil_icons_dc.mk
+
+
+AspSyncUtil.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspAdvanceSettingsDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,388 @@
+/*
+* 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:  
+*
+*/
+
+
+
+#ifndef ASPADVANCESETTINGSDIALOG_H
+#define ASPADVANCESETTINGSDIALOG_H
+
+
+//  INCLUDES
+
+#include "AspDialogUtil.h"
+
+#include <e32base.h>
+#include <aknlists.h>
+#include <AknDialog.h>
+
+
+
+
+
+// CLASS DECLARATION
+
+
+/**
+*  CAspAdvanceSettingsDialog
+*
+* CAspAdvanceSettingsDialog is used for editing sync connection data.
+*/
+NONSHARABLE_CLASS (CAspAdvanceSettingsDialog) : public CAknDialog, public MEikListBoxObserver
+    {
+    public:
+    
+    
+	public:
+	    /**
+        * Launches dialog.
+        * @param aParam Class that contains dialog parameters.
+        * @return Completion code.
+        */
+		static TBool ShowDialogL();
+
+	public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+		static CAspAdvanceSettingsDialog* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspAdvanceSettingsDialog();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAspAdvanceSettingsDialog();
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	private:
+        /**
+        * From MEikListBoxObserver, called by framework.
+        * @param aListBox.
+        * @param aEventType.
+		* @return None
+        */
+		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+        /**
+        * From the base class.
+		* Called by framework before the dialog is shown.
+        * @param None
+		* @return None
+        */
+        void PreLayoutDynInitL();
+
+        /**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param aButtonId Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+        TBool OkToExitL(TInt aButtonId);
+
+        /**
+        * From the base class.
+		* Called by framework for key event handling.
+        * @param aKeyEvent.
+		* @param aType.
+		* @return Return code.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+
+        /**
+        * From the base class.
+		* Called by framework when dialog is activated.
+        * @param None.
+		* @return None.
+        */
+		void ActivateL();
+		
+		/**
+		* Method to get context sensitive help topic.
+        * @param aContext Help topic to open.
+		* @return None.
+        */
+		void GetHelpContext(TCoeHelpContext& aContext) const;
+
+		/**
+        * From the base class.
+		* Called by framework before menu is shown.
+        * @param aResourceId Menu resource id.
+		* @param aMenuPane Pointer to the menu.
+        * @return None.
+        */
+		void DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane);
+
+		/**
+		* From the base class.
+		* Handles menu events.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		void ProcessCommandL(TInt aCommandId);
+		
+		/**
+		* From base class.
+		* Called when UI layout changes. 
+		* @param aType.
+    	* @return None.
+		*/
+        void HandleResourceChange(TInt aType);
+
+    private:
+		/**
+		* Handles setting item editing.
+		* @param None.
+		* @return None.
+		*/
+		void HandleOKL();
+		
+		/**
+		* Set setting list icons.
+		* @param None.
+		* @return None.
+		*/
+		void SetIconsL();
+
+	
+	public:  // common editors
+							
+		/**
+		* Shows editor for list type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		static TBool EditSettingItemListL(CAspListItemData& aItem);
+ 		/**
+		* Checks whether MSK label and menu command are correct for the context
+		* @param aKeyEvent
+		* @return None.
+		*/
+ 		void CheckContentSettingL(const TKeyEvent& aKeyEvent);
+ 		/**
+		* Checks whether MSK label and menu command are correct for the context 
+		* @param None
+		* @return None.
+		*/
+ 		void CheckContentSettingL();
+        /**
+		* Utility function, updates dialog cba.
+		* @param aResourceId.
+		* @return None.
+		*/
+		void UpdateCbaL(TInt aResourceId);
+		
+		/**
+		* Utility function, updates menu bar.
+		* @param aResource.
+		* @return None.
+		*/
+		
+		void UpdateMenuL(TInt aResource);
+		
+		
+    
+    private:
+    
+		/**
+		* Handles setting item editing.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemL(CAspListItemData& aItem);
+								
+		/**
+		* Set the MSK empty.
+		* @param None.
+		* @return None.
+		*/
+		void SetEmptyMiddleSoftKeyLabelL();
+
+    private:
+		 		        
+        /**
+		* Check setting values before dialog close.
+        * @param aButtonId Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+        TBool CheckSettingValuesL(TInt aButtonId);
+
+        /**
+		* Check setting values before dialog close.
+        * @param aButtonId Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+        TBool CheckSettingValues(TInt aButtonId);
+
+
+	private:
+		/**
+        * Create one CNSmlDSProfileData for each setting.
+        * @param None.
+        * @return None.
+        */
+		void CreateSettingsListL();
+		
+		/**
+        * Initalizes setting item needed for listbox handling.
+        * @param aItem.
+        * @return None.
+        */
+		void InitSettingItemL(CAspListItemData* aItem);
+		
+		/**
+        * Add settings titles into listbox.
+        * @param aListBox.
+        * @param aItemList List of setting items.
+        * @return None.
+        */
+		void UpdateListBoxL(CEikTextListBox* aListBox, CAspSettingList* aItemList);
+
+		/**
+        * Adds one setting item into item list.
+        * @param aItemId Item id.
+        * @param aHeaders Array of item headers.
+		* @return None.
+        */
+		void AddItemL(TInt aItemId, CDesCArray* aHeaders);
+		/**
+        * Adds one setting item into item list.
+        * @param aItemId Item id.
+        * @param aResourceId.
+		* @return None.
+        */
+		void AddItemL(TInt aItemId, TInt aResourceId);
+
+		/**
+        * Set setting item visibility (normal/readonly/hidden).
+        * @param None.
+		* @return None.
+        */
+		void SetVisibility();		
+		
+    private:
+
+        void  WriteRepositoryL(TInt aKey, const TInt& aValue);
+        
+        void  ReadRepositoryL(TInt aKey, TInt& aValue);
+        
+		/**
+        * Creates icon.
+		* @param aId.
+        * @param aFileName.
+		* @param aFileIndex.
+		* @param aFileMaskIndex.
+        * @return Created icon.
+        */
+		CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex);
+		
+		/**
+		* Returns setting item with listbox position aIndex.
+		* @param aIndex Listbox index.
+		* @return Pointer to setting item.
+        */
+		CAspListItemData* GetItemForIndex(TInt aIndex);
+
+		/**
+        * Returns setting item with id aItemId.
+        * @param aItemId Item id.
+        * @return Pointer to setting item.
+        */
+		CAspListItemData* Item(TInt aItemId);
+
+		/**
+		* Returns listbox.
+		* @param None.
+		* @return Pointer to listbox.
+		*/
+		CAknSettingStyleListBox* ListBox();
+
+		/**
+		* Returns profile.
+		* @param None.
+		* @return Pointer to sync profile.
+		*/
+		//CAspProfile* Profile();
+		
+
+	private:
+		// setting list
+		CAknSettingStyleListBox* iSettingListBox;
+
+		// list of setting items
+		CAspSettingList *iSettingList;
+		
+   		// list that contains all contents (applications)
+		//CAspContentList* iContentList;
+
+		// profile data
+		CAspProfile* iProfile;
+
+   		// sync session
+		RSyncMLSession* iSyncSession;
+
+		// for title and icon handling
+		CStatusPaneHandler* iStatusPaneHandler;
+
+		// resource handler
+		CAspResHandler* iResHandler;
+
+		// dialog edit mode
+		TInt iEditMode;
+
+		// for bearer type list construction
+		CAspBearerHandler* iBearerHandler;
+		
+		// for access point selection
+		CAspAccessPointHandler* iApHandler;
+		
+		// long buffer for string handling
+		TBuf<KBufSize255> iBuf;
+		
+		// list that contains all contents (applications)
+		CAspContentList* iContentList;
+		
+		// list that contains all profiles
+		CAspProfileList* iProfileList;
+
+		// id of the calling application
+		TInt iApplicationId;
+		
+		// is setting database in read only state
+		TBool iSettingEnforcement;
+		// profile's server id
+		TBuf<KAspMaxServerIdLength> iOldServerId;
+    	// id of current cba resource
+		TInt iCommandSetId;
+		// is  MSK empty
+		TBool iDefConnSupported;
+		TBool iMSKEmpty;
+    };
+
+
+#endif      // ASPPROFILEDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspAutoSyncHandler.h	Wed Sep 01 12:30:02 2010 +0100
@@ -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: Manages schedules using Symbian Task scheduler  
+*
+*/
+
+
+#ifndef ASPAUTOSYNCHANDLER_H
+#define ASPAUTOSYNCHANDLER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <SyncMLClient.h>    // for RSyncMLSession
+#include <SyncMLObservers.h>
+#include <schtask.h>
+
+#include "AspDefines.h"
+#include "AspUtil.h"
+#include "AspSchedule.h"
+
+
+// CLASS DECLARATION
+
+/**
+* CAspAutoSyncHandler
+*  
+*/
+NONSHARABLE_CLASS (CAspAutoSyncHandler) : public CBase,
+                                          public MSyncMLEventObserver,
+						                  public MSyncMLProgressObserver
+    {
+    public:
+    enum TAutoSyncError
+        {
+	    EOtherSyncRunning      = -100,
+	    EIncorrectProfile      = -101,
+	    EIncorrectSchedule     = -102
+        };
+
+	public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspAutoSyncHandler* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspAutoSyncHandler();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */	
+        CAspAutoSyncHandler();
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+		
+    
+    public:
+        void SynchronizeL(RFile& aTaskFile);
+
+		void DoSynchronizeL();
+        
+    private:
+        void OpenSyncSessionL();
+        void CloseSyncSession();
+        TInt CheckMandatoryDataL(TInt aProfileId);
+        TBool IsRoamingL();
+        TBool IsRoaming();
+                
+
+    private: // from MSyncMLEventObserver
+        
+        void OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier,
+                                  TInt aError, TInt aAdditionalData);
+	
+    private: //from MSyncMLProgressObserver
+	    
+	    void OnSyncMLSyncProgress(TStatus aStatus, TInt aInfo1, TInt aInfo2);
+	    void OnSyncMLDataSyncModifications(TInt aTaskId, 
+        const TSyncMLDataSyncModifications& aClientModifications,
+        const TSyncMLDataSyncModifications& aServerModifications);
+	    void OnSyncMLSyncError(TErrorLevel aErrorLevel, TInt aError,
+	                           TInt aTaskId, TInt aInfo1, TInt aInfo2);
+
+   
+		
+    private:
+		
+		// sync session
+		RSyncMLSession iSyncSession;
+
+		// sync job
+		RSyncMLDataSyncJob iSyncJob;
+
+		// is sync currently running
+		TBool iSyncRunning;
+		
+    	// sync error code
+		TInt iSyncError;
+		
+		// is sync session open
+		TBool iSyncSessionOpen;
+		
+		// for stopping code until sync is finished
+		CActiveSchedulerWait* iWait;
+		
+		// for reading auto sync settings
+		CAspSchedule* iSchedule;
+	};
+
+
+/**
+* CAspSyncSchedule
+*  
+*/
+NONSHARABLE_CLASS (CAspSyncSchedule) : public CBase
+    {
+
+
+	public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspSyncSchedule* NewL();
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CAspSyncSchedule* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CAspSyncSchedule();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */	
+        CAspSyncSchedule();
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	public:
+
+		/**
+        * Delete existing schedule.Called before creating a new schedule 
+        */
+        void DeleteScheduleL(CAspSchedule* aAspSchedule);
+        void DoDeleteScheduleL(CAspSchedule* aAspSchedule);
+
+		/**
+        * Create a new schedule based on changed settings
+        */
+		void CreatePeakScheduleL(CAspSchedule* aAspSchedule);
+		void CreateOffPeakScheduleL(CAspSchedule* aAspSchedule);
+
+		/**
+        * Edit the schedule to start after 15 min/30 mins.This is needed as task scheduler does not support 
+        * schedulling interval less than a hour
+        */
+	
+		void EditPeakScheduleL(CAspSchedule* aAspSchedule);
+		void EditOffPeakScheduleL(CAspSchedule* aAspSchedule);	
+
+		/**
+        *  Post pone the scheduled sync in till next valid time
+        */
+
+		void UpdatePeakScheduleL(CAspSchedule* aAspSchedule);
+		void UpdateOffPeakScheduleL(CAspSchedule* aAspSchedule);
+
+		/**
+        *  Enable schedules
+        */
+		void EnableSchedule(CAspSchedule* aAspSchedule);
+		
+#ifdef _DEBUG
+    public:
+        void LogScheduleL(CAspSchedule* aAspSchedule);
+        TInt LogSchedule(CAspSchedule* aAspSchedule);
+        static void LogIntervalType(TScheduleEntryInfo2& aInfo, TDes& aText);
+        static void LogInterval(TScheduleEntryInfo2& aInfo, TDes& aText);
+        static void LogTsTime(TTsTime aTsTime, TDes& aText);
+        static void LogTaskInfo(TTaskInfo& aInfo, TDes& aText);
+#endif        
+        
+    public:
+
+		/**
+        *  Get next sync time.Reads due time from task scheduler.
+        */       
+		void GetPeakStartTimeL(CAspSchedule* aAspSchedule, TTime& aTime, TBool aHomeTime);
+        void GetOffPeakStartTimeL(CAspSchedule* aAspSchedule, TTime& aTime, TBool aHomeTime);
+        
+    public:
+        TIntervalType IntervalType(TInt aInterval);
+        TTsTime StartTime(TInt aStartHour, TInt aInterval);
+        TInt Interval(TInt aInterval);
+        
+		
+    private:
+		//task scheduler server session
+		RScheduler iScheduler;
+
+
+		// schedule entry list
+		CArrayFixFlat<TScheduleEntryInfo2>* ipeakEntryList;
+		CArrayFixFlat<TScheduleEntryInfo2>* ioffPeakEntryList;
+
+		// schedule entry list
+		CArrayFixFlat<TTaskInfo>* ipeakTaskList;
+		CArrayFixFlat<TTaskInfo>* ioffPeakTaskList;
+		// long buffer for string handling
+		TBuf<KBufSize255> iBuf;
+	};
+
+
+
+#endif  // ASPAUTOSYNCHANDLER_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspContentDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,399 @@
+/*
+* 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: Editing content settings 
+*
+*/
+
+
+#ifndef ASPCONTENTDIALOG_H
+#define ASPCONTENTDIALOG_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <eiklbo.h>
+#include <aknlists.h>
+#include <aknnavide.h>
+#include <AknDialog.h>
+
+#include <CAknCommonDialogsBase.h>  // TCommonDialogType
+
+#include "AspDialogUtil.h"
+
+
+
+// CLASS DECLARATION
+
+
+/**
+* CAspContentDialog
+* 
+* Content dialog is used to edit sync content (sync task) data.
+*/
+NONSHARABLE_CLASS (CAspContentDialog) : public CAknDialog, public MEikListBoxObserver
+    {
+	public:
+	    /**
+        * Launches content dialog.
+        * @param aParam Class that contains dialog parameters.
+        * @return Completion code.
+        */
+		static TBool ShowDialogL(TAspParam& aParam);
+
+	private:
+
+		/**
+		* C++ default constructor.
+		* @param aParam Class that contains dialog parameters.
+		* @return None.
+		*/
+		CAspContentDialog(TAspParam& aParam);
+
+						
+        /**
+        * Two-phased constructor.
+		* @param aParam Class that contains dialog parameters.
+        */
+		static CAspContentDialog* NewL(TAspParam& aParam);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+		void ConstructL();
+
+	    /**
+        * Destructor.
+        */
+		virtual ~CAspContentDialog();
+		
+		/**
+		* Check if the MSK label is correct for the context
+		* @param aKeyEvent Key code.
+	    */	
+		void CheckContentSettingL(const TKeyEvent& aKeyEvent);
+		
+		/**
+		* Update the MSK Label
+		* @param aCommandId command id.
+		* @param aResourceId resource id .
+	    */
+		void UpdateMiddleSoftKeyLabelL(TInt aCommandId,TInt aResourceId);
+		
+
+	private:	
+
+	   /**
+		* From the base class.
+        * Called when dialog is activated.
+        * @return None.
+        */
+		void ActivateL();
+
+		/**
+		* From the base class.
+        * Handles key presses.
+        * @param aKeyEvent Key code.
+		* @param aType Key type.
+        * @return Result code.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+	
+		
+		/**
+		* From the base class.
+		* Handles menu events.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		virtual void ProcessCommandL(TInt aCommandId);
+
+		/**
+        * From the base class
+		* Called by framework before menu is shown.
+        * @param aResourceId Menu resource id.
+		* @param aMenuPane Pointer to the menu.
+        * @return None.
+        */
+		void DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane);
+
+		/**
+		* Handle content parameter editing.
+		* @return None.
+		*/
+		void HandleOKL();
+
+		/**
+		* Method to get context sensitive help topic.
+        * @param aContext Help topic to open.
+		* @return None.
+        */
+		void GetHelpContext(TCoeHelpContext& aContext) const;
+	
+		/**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param aButtonId Id of the pressed button
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+		TBool OkToExitL(TInt aButtonId);
+	
+		/**
+        * From the base class.
+		* Called by framework before the dialog is shown.
+		* @return None.
+        */
+		void PreLayoutDynInitL();
+
+		/**
+        * From MEikListBoxObserver.
+		* Handle listbox events.
+        * @param aListBox Pointer to used listbox.
+		* @param aEventType Event type.
+        * @return None.
+        */
+		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+		
+		/**
+		* From base class.
+		* Called when UI layout changes. 
+		* @param aType.
+    	* @return None.
+		*/
+        void HandleResourceChange(TInt aType);
+        
+		/**
+		* Set setting list icons.
+		* @param None.
+		* @return None.
+		*/
+		void SetIconsL();
+        
+
+	private:
+
+		/**
+		* Check that mandatory fields are set
+		* @return Index of the invalid mandatory item.
+		*/
+		TInt CheckMandatoryFields();
+	
+		/**
+		* Save content parameters into profile.
+    	* @return None.
+		*/
+		void SaveSettingsL();
+
+		/**
+		* Set filter type setting visibility.
+		* @param None.
+		* @return None.
+		*/
+		void SetFilterVisibility(TInt aVisibility);
+    
+    private:
+    		
+		/**
+        * Add settings titles into listbox.
+        * @param aListBox.
+        * @param aItemList List of setting items.
+        * @return None.
+        */
+		void UpdateListBoxL(CEikTextListBox* aListBox, CAspSettingList* aItemList);
+		
+		/**
+        * Create one CAspListItemData for each setting.
+        * @param None.
+        * @return None.
+        */
+		void CreateSettingsListL();
+		
+		/**
+        * Adds one setting item into item list.
+        * @param aItemId Item id.
+        * @param aResourceId.
+		* @return None.
+        */
+		void AddItemL(TInt aItemId, TInt aResourceId);
+		
+		/**
+        * Adds one setting item into item list.
+        * @param aDataProviderId.
+		* @return None.
+        */
+		void AddRemoteDatabaseL(TInt aDataProviderId);
+		
+		/**
+        * Initalizes setting item needed for listbox handling.
+        * @param aItem.
+        * @return None.
+        */
+		void InitSettingItemL(CAspListItemData* aItem);
+
+
+    private:
+
+		/**
+		* Handles setting item editing.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemL(CAspListItemData& aItem);
+
+		/**
+		* Change Yes/No value without showing edit dialog.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemYesNoL(CAspListItemData& aItem);
+		
+		/**
+		* Shows editor for text type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemTextL(CAspListItemData& aItem);
+
+		/**
+		* Shows editor for list type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+        TBool EditSettingItemLocalDatabaseL(CAspListItemData& aItem);
+    
+		/**
+		* Shows editor for list type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		static TBool EditSettingItemListL(CAspListItemData& aItem);
+  
+  
+    private:
+		/**
+		* Utility function.
+		* @param aIndex Listbox index.
+		* @return setting item with listbox position aIndex.
+        */
+		CAspListItemData* GetItemForIndex(TInt aIndex);
+
+		/**
+        * Utility function.
+        * @param aItemId Item id.
+        * @return Pointer to setting item.
+        */
+		CAspListItemData* Item(TInt aItemId);
+		
+		/**
+		* Finds out sync data provider type.
+		* @param None.
+		* @return Data provider type.
+		*/
+		TInt DataProviderType() const;
+		
+		/**
+        * Set setting item visibility (normal/readonly/hidden).
+        * @param None.
+		* @return None.
+        */
+		void SetVisibility();
+		
+		/**
+        * Set all settings to read-only state.
+        * @param None.
+		* @return None.
+        */
+		void SetAllReadOnly();
+		
+		/**
+        * Read sync profile task data.
+        * @param None.
+		* @return None.
+        */
+		void InitTaskDataL();
+		
+		/**
+        * Creates icon.
+		* @param aId.
+        * @param aFileName.
+		* @param aFileIndex.
+		* @param aFileMaskIndex.
+        * @return Created icon.
+        */
+		CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex);
+		
+
+	private:
+		// id of the calling application
+		TInt iApplicationId;
+
+		// list box for setting items 
+		CAknSettingStyleListBox* iListBox;
+		
+		// setting items
+		CAspSettingList *iSettingList;
+		
+		// list that contains all contents (applications)
+		CAspContentList* iContentList;
+
+		// for title and icon handling
+		CStatusPaneHandler* iStatusPaneHandler;
+
+		// session with sync server
+		RSyncMLSession* iSyncSession;
+		
+		// sync profile
+		CAspProfile* iProfile;
+
+		// long buffer for string handling
+		TBuf<KBufSize255> iBuf;
+		
+		// is setting database in read only state
+		TBool iSettingEnforcement;
+		
+		// has user changed sync content local or remote datastore
+		TBool iDataStoreChanged;
+		
+		
+    private:
+		
+		// dialog parameters
+		TAspParam* iDialogParam;
+	
+		// sync data provider
+		TInt iDataProviderId;
+
+		// is content included in sync
+		TBool iTaskEnabled;
+		
+		// sync type
+		TInt iSyncDirection;
+
+		// needed for finding out whether user changed db name
+		TBuf<KBufSize> iLocalDatabase;
+		
+		// needed for finding out whether user changed db name
+		TBuf<KBufSize> iRemoteDatabase;
+		
+		// names of all available local data stores
+		CDesCArray* iLocalDataStores;
+		//is MSK Empty	
+		TBool iMskEmpty;
+	};
+
+
+
+
+#endif      // ASPCONTENTDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspContentListDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,237 @@
+/*
+* 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: Editing Content list (not used anymore) 
+*
+*/
+
+
+#ifndef ASPCONTENTLISTDIALOG_H
+#define ASPCONTENTLISTDIALOG_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <eikdialg.h>
+#include <eiklbo.h>
+#include <aknlists.h>
+
+#include "aspdefines.h"
+#include "asputil.h"
+#include "aspdialogutil.h"
+#include "aspreshandler.h"
+
+#include <aknlistquerydialog.h>
+
+
+
+// CLASS DECLARATION
+
+/**
+* CAspContentListDialog
+*  
+* Content list dialog shows all available sync contents (sync data providers).
+*/
+NONSHARABLE_CLASS (CAspContentListDialog) : public CAknDialog, public MEikListBoxObserver
+    {
+    enum TAspContentListDialogIconIndex
+		{
+	    EIconBothDirections = 0,
+	    EIconDeviceToServer = 1,
+	    EIconServerToDevice = 2,
+	    EIconNotDefined     = 3
+		};
+
+	public:
+
+	    /**
+        * Launches setting dialog.
+        * @param aParam Class that contains dialog parameters.
+        * @return Completion code.
+        */
+		static TBool ShowDialogL(const TAspParam& aParam);
+
+    public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspContentListDialog* NewL(const TAspParam& aParam);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspContentListDialog();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAspContentListDialog(const TAspParam& aParam);
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+
+	private:
+        /**
+        * From the base class.
+		* Called by framework before the dialog is shown.
+        * @param None
+		* @return None
+        */
+		void PreLayoutDynInitL();
+
+		/**
+		* From the base class.
+		* Handles menu events.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		void ProcessCommandL(TInt aCommandId);
+
+        /**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+		TBool OkToExitL(TInt aButtonId);
+		
+        /**
+        * From the base class.
+		* Called by framework for key event handling.
+        * @param aKeyEvent.
+		* @param TEventCode.
+		* @return Return code.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+
+		/**
+        * From the base class.
+		* Called by framework before menu is shown.
+        * @param aResourceId Menu resource id.
+		* @param aMenuPane Pointer to the menu.
+        * @return None.
+        */
+		void DynInitMenuPaneL(TInt aResourceID,	CEikMenuPane* aMenuPane);
+
+	   /**
+		* From the base class.
+        * Called when dialog is activated.
+        * @return None.
+        */
+		void ActivateL();
+		
+		/**
+		* Method to get context sensitive help topic.
+        * @param aContext Help topic to open.
+		* @return None.
+        */
+		void GetHelpContext(TCoeHelpContext& aContext) const;
+		
+		/**
+		* From base class.
+		* Called when UI layout changes. 
+		* @param aType.
+    	* @return None.
+		*/
+        void HandleResourceChange(TInt aType);
+
+    private: // from MEikListBoxObserver
+
+	    /**
+        * From MEikListBoxObserver
+        * @param aListBox Pointer to listbox.
+		* @param aEventType Event type.
+        * @return None.
+        */
+		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+	
+    private:
+		/**
+        * Creates icon.
+		* @param aId.
+        * @param aFileName.
+		* @param aFileIndex.
+		* @param aFileMaskIndex.
+        * @return Created icon.
+        */
+		CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex);
+
+
+		/**
+        * Updates listbox items.
+        * @param None.
+        * @return None.
+        */
+		void UpdateListBoxL();
+
+		/**
+        * Shows content dialog.
+        * @param None.
+        * @return None.
+        */
+		void ShowContentL();
+
+    private:
+		/**
+		* Utility function.
+		* @return Sync session.
+        */
+		RSyncMLSession& Session();
+
+		/**
+        * Utility function.
+        * @return Dialog list box.
+        */
+		CAknDoubleLargeStyleListBox* ListBox();
+
+		/**
+        * Utility function.
+        * @return Currently selected list box item.
+        */
+		TAspProviderItem& SelectedProvider();
+
+
+    private:
+		// id of the calling application
+		TInt iApplicationId;
+
+		// sync profile
+		CAspProfile* iProfile;
+		
+		// sync session
+		RSyncMLSession* iSyncSession;
+
+		// list box that contains all contents (applications)
+		CAknDoubleLargeStyleListBox* iSettingListBox;
+
+		// for title and icon handling
+		CStatusPaneHandler* iStatusPaneHandler;
+
+    	// resource handler
+		CAspResHandler* iResHandler;
+
+		// list that contains all contents (applications)
+		CAspContentList* iContentList;
+    };
+
+
+#endif    // ASPCONTENTLISTDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspDbNotifier.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,305 @@
+/*
+* 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: Used by UI to update settings based on DB changes 
+*
+*/
+
+
+#ifndef ASPDBNOTIFIER_H
+#define ASPDBNOTIFIER_H
+
+#include <e32std.h>
+#include <SyncMLObservers.h>
+
+#include "AspUtil.h"
+
+
+// CLASS DECLARATION
+
+
+/**
+* TAspDbEvent
+*
+* TAspDbEvent represents sync event that is sent to UI.
+*/
+NONSHARABLE_CLASS (TAspDbEvent)
+	{
+	public:
+		TInt iType;	
+		TInt iProfileId;
+		TInt iError;
+
+    public:
+		/**
+        * Constructor
+        * @param aType Event type.
+        * @return None. 
+        */
+    	TAspDbEvent(TInt aType);
+	};
+
+
+
+/**
+* MAspDbEventHandler
+*
+* Observer interface function.
+*/
+NONSHARABLE_CLASS (MAspDbEventHandler)
+	{
+	public:
+		/**
+        * CAspDbNotifier calls this to inform that database has changed.
+        * @param aEvent Database event.
+        * @return None. 
+        */
+		virtual void HandleDbEventL(TAspDbEvent aEvent) = 0;
+	};
+
+
+/**
+* CAspDbNotifier
+* 
+* CAspDbNotifier is used to observe sync database events. These events
+* are used to update UI.
+*/
+NONSHARABLE_CLASS (CAspDbNotifier) : public CBase,
+                                     public MAspActiveCallerObserver,
+                                     public MSyncMLEventObserver
+	{
+    public:
+	    enum TEventType
+			{
+			EUpdate,
+			EUpdateAll,
+			EDelete,
+	        EClose
+			};
+
+	public:
+		/**
+        * Two-phased constructor
+        * @param aDatabase Reference to RDbDatabase instance.
+		* @param aHandler Pointer to MAspDbEventHandler instance.
+        * @return None. 
+        */
+		static CAspDbNotifier* NewL(const TAspParam& aParam, MAspDbEventHandler* aHandler);
+
+        /**
+        * Destructor.
+        */
+		virtual ~CAspDbNotifier();
+
+	private:
+
+		/**
+        * Constructor
+        * @param aParam.
+		* @param aHandler Pointer to event handler.
+        * @return None. 
+        */
+		CAspDbNotifier(const TAspParam& aParam, MAspDbEventHandler* aHandler);
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+		void ConstructL();
+
+	public:
+		/**
+		* Start requesting events from db.
+        * @param None. 
+        * @return None. 
+        */
+		void RequestL();
+
+   
+	private:   // from MAspActiveCallerObserver
+	
+		/**
+        * From MAspActiveCallerObserver
+		* Called when CAspActiveCaller completes.
+        * @param aCallId.
+        * @return None.
+        */
+		void HandleActiveCallL(TInt aCallId);
+
+    private:    // from MSyncMLEventObserver
+        
+		/**
+        * Called when SyncML session events oocur.
+        * @param aEvent Event type.
+        * @param aIdentifier Object id.
+        * @param aError Error code.
+        * @param aAdditionalData Additional data.
+        * @return None.
+        */
+        void OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier, TInt aError, TInt aAdditionalData);
+        
+		/**
+        * Called when SyncML session events oocur.
+        * @param aEvent Event type.
+        * @param aIdentifier Object id.
+        * @param aError Error code.
+        * @param aAdditionalData Additional data.
+        * @return None.
+        */
+        void HandleSessionEventL(TEvent aEvent, TInt aIdentifier, TInt aError, TInt aAdditionalData);
+
+    public:
+		/**
+        * Calls database event observer with delay.
+        * @param None.
+        * @return None.
+        */
+		void CallObserverWithDelay();
+
+		/**
+        * Calls database event observer.
+        * @param None.
+        * @return None.
+        */
+		void CallObserver();
+		
+		/**
+        * Disable/enable observer calling.
+        * @param aDisable.
+        * @return None.
+        */
+		void SetDisabled(TBool aDisable);
+
+		/**
+        * Finds out how many profiles have changed.
+        * @param None.
+        * @return Profile count.
+        */
+		TInt ChangedProfileCount();
+		
+		/**
+        * Get one database event from event array.
+        * @param aIndex.
+        * @return Database event.
+        */
+        TAspDbEvent Event(TInt aIndex);
+        
+		/**
+        * Return number of received database events.
+        * @param None.
+        * @return Event count.
+        */
+		TInt EventCount();
+
+		/**
+        * Reset event array.
+        * @param None.
+        * @return None.
+        */
+		void Reset();
+
+		/**
+        * Find out whether event array contains event that causes UI to close.
+        * @param None.
+        * @return Array index.
+        */
+		TInt FindCloseEvent();
+
+		/**
+        * Find out whether event array contains events for one profile only.
+        * @param None.
+        * @return Array index.
+        */
+		TInt FindSingleProfileEvent();
+		
+		/**
+        * Find out whether event array contains profile event.
+        * @param None.
+        * @return Array index.
+        */
+		TInt FindProfileEvent();
+		
+		/**
+        * Find out whether event array only contains events with same profile id.
+        * @param aId Profile id.
+        * @return Boolean.
+        */
+		TBool IsUniqueProfileId(TInt aId);
+		
+		/**
+        * Creates one update event.
+        * @param aIdentifier Profile id.
+        * @param aError Error code.
+        * @return None.
+        */
+		void CreateUpdateEventL(TInt aIdentifier, TInt aError);
+		
+		/**
+        * Find out whether event array contains delete event.
+        * @param None.
+        * @return Boolean.
+        */
+		TBool ProfileDeleted();
+		
+		/**
+        * Call event observer if event array contains update event.
+        * @param None.
+        * @return None.
+        */
+        void CheckUpdateEventL();
+		
+		/**
+		* Utility function.
+		* @return Sync session.
+        */
+		RSyncMLSession& Session();
+		
+		
+#ifdef _DEBUG
+    private:
+        void GetSyncEventText(TDes& aText, MSyncMLEventObserver::TEvent aEvent);
+        void LogSessionEvent(TEvent& aEvent, TInt aIdentifier, TInt aError);
+#endif
+		
+
+
+	private:  
+		// sync session
+		RSyncMLSession* iSyncSession;
+	
+		// Pointer to event handler
+		MAspDbEventHandler* iHandler;
+
+		// for making function call via active scheduler
+		CAspActiveCaller* iActiveCaller;
+
+		// for storing ids of changed profiles
+		RArray<TAspDbEvent> iList;
+
+		// can observer be called
+		TBool iDisabled;
+
+		// is synchronizing going on
+		//TBool iSyncRunning;
+		
+		// have sync session events been requested from RSyncMLSession
+		TBool iSessionEventRequested;
+		
+		// is this object destroyed
+		TBool* iDestroyedPtr;
+	};
+
+
+#endif   // ASPDBNOTIFIER_H
+
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspDebug.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* 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: Debug macros definition and constant declaration 
+*
+*/
+
+
+
+#ifndef NSMLDSSYNC__DEBUG_H
+#define NSMLDSSYNC__DEBUG_H
+
+
+#ifdef _DEBUG
+
+#include <e32svr.h>
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT(KLogFile,"smlsync.txt");
+_LIT(KLogDirFullName,"c:\\logs\\");
+_LIT(KLogDir,"smlsync");
+
+// Declare the FPrint function
+inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
+    {
+    VA_LIST list;
+    VA_START(list,aFmt);
+    RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
+    }
+
+// ===========================================================================
+#ifdef __WINS__     // File logging for WINS
+// ===========================================================================
+#define FLOG(arg...)   { FPrint(arg); }
+//#define FLOG(a) { RDebug::Print(a);  }
+#define FTRACE(a) { a; }
+// ===========================================================================
+#else               // RDebug logging for target HW
+// ===========================================================================
+//#define FLOG(arg...) { RDebug::Print(arg);  }
+#define FLOG(arg...)   { FPrint(arg); }
+#define FTRACE(a) { a; }
+#endif //__WINS__
+
+// ===========================================================================
+#else // // No loggings --> Reduced binary size
+// ===========================================================================
+#define FLOG(arg...)
+#define FTRACE(a)
+
+#endif // _DEBUG
+
+
+#endif // NSMLDSSYNC__DEBUG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspDefines.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,307 @@
+/*
+* 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:  Contains general data definitions for AspSyncUtil.
+*
+*/
+
+
+#ifndef ASPDEFINES_H
+#define ASPDEFINES_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <AiwGenericParam.hrh>
+
+
+
+// CONSTANTS
+
+// resource files
+_LIT( KResFileName, "z:aspsyncutil.rsc" );
+_LIT( KBitmapFileName, "z:AspSyncUtil.mbm" );
+
+
+_LIT(KHttpHeader, "http://");
+
+// central repository uid for scheduled sync settings
+const TUid KCRUidNSmlDSApp       = { 0x101F9A1D };
+
+//unicode value for clock icon
+const TUint KClockCharacter = 0xF815 ;
+
+// consumer app uids
+const TUid KUidAppSync       = { 0x101F6DE4 };
+const TUid KUidAppPhonebook  = { 0x101F4CCE };
+const TUid KUidAppCalendar   = { 0x10005901 };
+const TUid KUidAppMessages   = { 0x100058C5 };
+const TUid KUidAppNotepad    = { 0x10005907 };
+const TUid KUidAppTest       = { 0x0995CDE9 };
+const TUid KUidAppMailEditor = { 0x101F4CD6 };
+
+
+
+// medium type uids
+const TUid KUidNSmlMediumTypeInternet  = { 0x101F99F0 };
+const TUid KUidNSmlMediumTypeBluetooth = { 0x101F99F1 };
+const TUid KUidNSmlMediumTypeUSB       = { 0x101F99F2 };
+const TUid KUidNSmlMediumTypeIrDA      = { 0x101F99F3 };
+
+
+// medium type uids for convergence
+//const TUid KUidNSmlMediumTypeInternet  = { 0x10009F76 };
+//const TUid KUidNSmlMediumTypeBluetooth = { 0x10009F79 };
+//const TUid KUidNSmlMediumTypeUSB       = { 0x10009FB5 };
+//const TUid KUidNSmlMediumTypeIrDA      = { 0x10009F78 };
+//const TUid KUidNSmlMediumTypeWSP       = { 0x10009F77 };
+//const TUid KUidNSmlMediumTypeNSmlUSB   = { 0x101F9A04 };
+
+
+
+// sync adapder uids
+const TUid KUidNSmlAdapterCalendar  = { 0x101F6DDE };
+const TUid KUidNSmlAdapterContact   = { 0x101F6DDD };
+const TUid KUidNSmlAdapterEMail     = { 0x101F6DDF };
+const TUid KUidNSmlAdapterNote      = { 0x101F8612 };
+const TUid KUidNSmlAdapterSms       = { 0x10206B5C };
+const TUid KUidNSmlAdapterMMS       = { 0x101FB0E9 };
+const TUid KUidNSmlAdapterBookmarks = { 0x102751BA };
+const TUid KUidNsmlAdapterCntGrps   = { 0x101FF972 };
+const TUid KUidNsmlAdapterMedia     = { 0x2001a9a1 };
+
+// convergence sync adapder uids
+//const TUid KUidNSmlAdapterCalendar  = { 0x10009FD1 };
+//const TUid KUidNSmlAdapterContact   = { 0x10009FD3 };
+
+
+// sync application uid
+const TUid KUidSmlSyncApp             = { 0x101F6DE4 };
+
+// password editor constatnts
+_LIT(KSecretEditorMask, "*");
+const TInt KSecretEditorMaskLength = 4;
+
+// string sizes
+const TInt KBufSize = 128;
+const TInt KBufSize255 = 255;
+const TInt KBufSize16 = 16;
+const TInt KBufSize64 = 64;
+const TInt KBufSize32 = 32;
+
+const TInt KDefaultArraySize = 10;
+
+
+//
+// text editor max sizes (from nsmlconstantdefs.h)
+//
+const TInt KAspMaxProfileNameLength         = 50;
+const TInt KAspMaxUsernameLength            = 80;
+const TInt KAspMaxPasswordLength            = 22;
+const TInt KAspMaxLocalNameLength           = 255;
+const TInt KAspMaxAdapterDisplayNameLength  = 50;
+const TInt KAspMaxServerIdLength            = 150;
+const TInt KAspMaxURILength                 = 144;
+const TInt KAspMaxRemoteNameLength          = 125;
+
+// max number of profiles
+const TInt KMaxProfileCount = 50;
+
+// setting dialog listbox update delay after db event
+const TInt KListBoxUpdateDelay = 250;
+
+
+
+// DATA TYPES
+
+enum TAspApplicationIds
+	{
+	EApplicationIdSync = 0,
+	EApplicationIdBookmarks = 1,//value not available in AiwGenericParam.hrh
+	EApplicationIdContact = EGenericParamContactItem,    // 20
+	EApplicationIdCalendar = EGenericParamCalendarItem,  // 21
+	EApplicationIdEmail = EGenericParamMessageItemEMail, // 31
+	EApplicationIdNote = EGenericParamNoteItem,          // 23
+	EApplicationIdMms = EGenericParamMessageItemMMS,     // 32
+	EApplicationIdSms = EGenericParamMessageItemSMS      // 30
+	};
+
+enum TASpSettingValue
+	{
+	EAspSettingDisabled = 0,
+	EAspSettingEnabled = 1
+	};
+
+// NOTE: do not change these enums. They are also used in sync app
+enum TAspDialogMode
+	{
+	EModeDialogWait = 3,
+	EModeDialogNoWait = 4
+	};
+
+enum TDialogMode
+	{
+	EDialogModeEdit,
+	EDialogModeEditMandatory,
+	EDialogModeReadOnly,
+	EDialogModeSettingEnforcement
+	};
+
+enum TAspMandatoryProfileData
+	{
+	EMandatoryOk,
+	EMandatoryNoProfileName,
+    EMandatoryNoHostAddress,
+    EMandatoryIncorrectBearerType,
+    EMandatoryIncorrectAccessPoint,
+
+    EMandatoryNoContent,
+	EMandatoryNoLocalDatabase,
+	EMandatoryNoRemoteDatabase,
+	EMandatoryNoSyncType
+	};
+
+enum TAspSettingItemVisibility
+	{
+	EVisibilityNormal,
+	EVisibilityReadOnly,
+	EVisibilityHidden
+	};
+
+enum TASpBearerType
+	{
+	EAspBearerInternet = 0,
+	EAspBearerUsb = 1,
+	EAspBearerBlueTooth = 2,
+	EAspBearerIrda = 3,
+	EAspBearerWsp = 4,
+	EAspBearerSmlUsb = 5,
+    EAspBearerLast = 6
+	};
+
+
+
+//
+// NOTE: this enum must match to resource r_asp_connection_dialog_setting_items
+//
+enum TAspConnectionSettingItem
+	{
+	EAspProfileName = 0,
+	EAspServerId = 1,
+	EAspConnType = 2,
+	EAspAccessPoint = 3,
+	EAspHostAddress = 4,
+	EAspPort = 5,
+	EAspUsername = 6,
+	EAspPassword = 7,
+	EAspServerAlert = 8,
+	EAspHttpsUsername = 9,
+	EAspHttpsPassword = 10,
+    EAspSyncDirection = 11,
+	EAspProtocolVersion = 12,
+	EAspSyncContent = 13,
+	EAspSchedulingSetting = 14,
+	EAspProfileSetting = 15
+	};
+
+
+enum TAspContentSettingItem
+	{
+	EAspLocalDatabase = 0,
+	EAspRemoteDatabase = 1,
+	EAspUseFilters = 2
+	};
+
+enum TAspAutoSyncSettingItem
+	{
+    EAspAutoSyncProfile = 0,
+    EAspAutoSyncContents,
+    EAspAutoSyncFrequency,
+    EAspAutoSyncPeakSchedule,
+    EAspAutoSyncOffPeakSchedule,
+    EAspAutoSyncScheduleTime,
+    EAspAutoSyncPeakStartTime,
+    EAspAutoSyncPeakEndTime,
+    EAspAutoSyncPeakDays,
+    EAspAutoSyncRoamingStatus
+	};
+
+
+// NOTE: This enum must match with r_asp_sync_type
+enum TAspSyncDirection
+	{
+	ESyncDirectionTwoWay,
+	ESyncDirectionOneWayFromDevice,
+	ESyncDirectionOneWayIntoDevice,
+	ESyncDirectionRefreshFromServer
+	};
+
+// NOTE: This enum must match with r_asp_server_alert_type
+enum TAspSASyncState
+	{
+	ESASyncStateEnable = 0,
+	ESASyncStateConfirm = 1,
+	ESASyncStateDisable = 2
+	};
+
+
+
+// NOTE: this enum must match with property array described in 
+// SyncML_Sync_Agent_Client_API_Specification.doc.
+
+// transport property setting ids
+enum TAspTransportProperties
+	{
+	EPropertyIntenetAccessPoint = 0,
+	EPropertyHttpUsed = 5,
+	EPropertyHttpUserName = 6,
+	EPropertyHttpPassword = 7
+	};
+
+/*
+// transport property setting ids for convergence
+enum TNSmlSyncTransportProperties
+	{
+	EPropertyIntenetAccessPoint = 3,
+	//EPropertyHttpUsed = 0,
+	EPropertyHttpUserName = 0,
+	EPropertyHttpPassword = 1
+	};
+*/
+
+enum TASpProtocolType
+	{
+	EAspProtocol_1_1 = 0,
+	EAspProtocol_1_2 = 1
+	};
+
+// Roaming Settings
+enum TRoamingSettings
+    {
+    ERoamingSettingAlwaysAsk = 0,
+    ERoamingSettingAlwaysAllow = 1,
+    ERoamingSettingNeverAllow = 2,
+    ERoamingSettingBlock = 3
+    };
+
+
+
+
+enum TAdvanceSettingsItem
+    {
+    ERoamingSettings = 0
+    };
+
+#endif  // ASPDEFINES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspDialogUtil.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,874 @@
+/*
+* 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:  Contains general data definitions for AspSyncUtil.
+*
+*/
+
+
+#ifndef ASPDIALOGUTIL_H
+#define ASPDIALOGUTIL_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <aknlistquerycontrol.h>
+#include <aknnavi.h>
+#include <aknnavide.h>
+#include <AknQueryDialog.h>
+
+#include <SyncMLHistory.h>
+
+#include <AknIndicatorContainer.h>      // CAknIndicatorContainer
+#include <aknEditStateIndicator.h>      // MAknEditingStateIndicator
+#include <akncheckboxsettingpage.h>     // CSelectionItemList
+#include <aknradiobuttonsettingpage.h>  // CAknRadioButtonSettingPage
+#include <akntextsettingpage.h>         // CaknTextSettingPage
+#include <aknpasswordsettingpage.h>     // CAknAlphaPasswordSettingPage
+
+#include "AspDefines.h"
+#include "AspProfile.h"
+#include "AspResHandler.h"
+
+
+
+#ifdef RD_DSUI_TIMEDSYNC 
+
+#include <akntabgrp.h>
+#include <AknTabObserver.h>
+
+#endif
+
+/**
+* TDialogUtil
+* 
+* TDialogUtil contains general dialog utilities.
+*/
+NONSHARABLE_CLASS (TDialogUtil)
+	{
+    public:
+		/**
+		* Shows text query.
+		* @param aTitle Title text.
+		* @param aText Message text.
+		* @param aMaxLength Max text length.
+		* @return None.
+		*/
+        static void ShowTextQueryL(const TDesC& aTitle, TDes& aText, TInt aMaxLength);
+		
+		/**
+		* Shows message query (title, text and Ok button).
+		* @param aTitle Title text.
+		* @param aText Message text.
+		* @return None.
+		*/
+		static void ShowMessageQueryL(const TDesC& aTitle, const TDesC& aText);
+
+		/**
+		* Shows message query (title, text and Ok button).
+		* @param aTitle Title text.
+		* @param aResourcet Mssage text resource id.
+		* @return None.
+		*/
+		static void ShowMessageQueryL(const TDesC& aTitle, TInt aResource);
+
+		static void ShowAutoSyncMessageQueryL(const TDesC& aText);
+		/**
+		* Shows yes/no question.
+		* @param aText Question text.
+		* @return ETrue if user selected yes, EFalse otherwise..
+		*/
+		static TBool ShowConfirmationQueryL(const TDesC& aText);
+
+		/**
+		* Shows yes/no question.
+		* @param aText Question text.
+		* @return ETrue if user selected yes, EFalse otherwise..
+		*/
+		static TBool ShowRoamingConfirmationQueryL(const TDesC& aText);
+		        
+		/**
+        * Shows ok/cancel question.
+        * @param aResource Question text.
+        * @return ETrue if user selected ok, EFalse otherwise..
+        */
+        static TBool ShowRoamingConfirmationQueryL(TInt aResource);
+
+		/**
+		* Shows yes/no question.
+		* @param aResource Question text.
+		* @return ETrue if user selected yes, EFalse otherwise..
+		*/
+		static TBool ShowConfirmationQueryL(TInt aResource);
+
+		/**
+		* Shows information text.
+		* @param aText Information text.
+		* @return None.
+		*/
+        static void ShowInformationQueryL(const TDesC& aText);
+        
+		/**
+		* Shows information text.
+		* @param aResource Information text.
+		* @return None.
+		*/
+        static void ShowInformationQueryL(TInt aResource);
+		
+		/**
+		* Shows information text.
+		* @param aResource Information text.
+		* @return None.
+		*/
+		static void ShowInformationNoteL(TInt aResource);
+
+		/**
+		* Shows information text.
+		* @param aText Information text.
+		* @return None.
+		*/
+		static void ShowInformationNoteL(const TDesC& aText);
+
+		/**
+		* Shows error text.
+		* @param aResource Error text.
+		* @return None.
+		*/
+		static void ShowErrorNoteL(TInt aResource);
+
+		/**
+		* Shows error text.
+		* @param aText Error text.
+		* @return None.
+		*/
+		static void ShowErrorNoteL(const TDesC& aText);
+		
+		/**
+		* Shows error text.
+		* @param aResource Error text.
+		* @return None.
+		*/
+		static void ShowErrorQueryL(TInt aResource);
+
+		/**
+		* Shows error text.
+		* @param aText Error text.
+		* @return None.
+		*/
+		static void ShowErrorQueryL(const TDesC& aText);
+
+		/**
+		* Shows dialog with selection list.
+		* @param aTitle Dialog title.
+		* @param aList List of selection items.
+		* @param aSelectedIndex Index of selected item.
+		* @return EFalse if user canceled, ETrue otherwise.
+		*/
+		static TBool ShowListQueryL(const TDesC& aTitle, CDesCArray* aList, TInt* aSelectedIndex);
+		/**
+		* Shows dialog with selection list other than sync application
+		* @param aTitle Dialog title.
+		* @param aList List of selection items.
+		* @param aSelectedIndex Index of selected item.
+		* @return EFalse if user canceled, ETrue otherwise.
+		*/
+		static TBool ShowListQueryIconL(const TDesC& aTitle, CDesCArray* aList, TInt* aSelectedIndex);
+		/**
+		* Shows dialog with selection list.
+		* @param aTitle Dialog title.
+		* @param aList List of selection items.
+		* @param aSelectedIndex Index of selected item.
+		* @return EFalse if user canceled, ETrue otherwise.
+		*/
+		static TBool ShowListQueryL(TInt aTitle, CDesCArray* aList, TInt* aSelectedIndex);
+		/**
+		* Shows dialog with selection list opened from other than sync application
+		* @param aTitle Dialog title.
+		* @param aList List of selection items.
+		* @param aSelectedIndex Index of selected item.
+		* @return EFalse if user canceled, ETrue otherwise.
+		*/
+		static TBool ShowListQueryIconL(TInt aTitle, CDesCArray* aList, TInt* aSelectedIndex);
+
+		/**
+		* Shows dialog with profile list.
+		* @param aList Profile list.
+		* @param aId Id of selected profile.
+		* @param aResource Dialog title resource id.
+		* @return EFalse if user canceled, ETrue otherwise.
+		*/
+		static TBool ShowProfileQueryL(CAspProfileList* aList, TInt& aId, TInt aResource);
+		/**
+		* Shows dialog with profile list displayed other than sync application
+		* @param aList Profile list.
+		* @param aId Id of selected profile.
+		* @param aResource Dialog title resource id.
+		* @param aIndex to know the selected index
+		* @return EFalse if user canceled, ETrue otherwise.
+		*/
+		static TBool ShowProfileQueryAppL(CAspProfileList* aList, TInt& aId, TInt aResource,TInt &aIndex);
+		
+		/**
+		* Deletes menu item.
+		* @param aMenuPane.
+		* @param aCommandId Id of deleted menu.
+		* @return None.
+		*/
+		static void DeleteMenuItem(CEikMenuPane* aMenuPane, TInt aCommandId);
+
+		/**
+		* Constructs an independent CGulIcon object.
+		* @param aID Item ID of the masked bitmap to be created.
+        * @param aFilename Filename to be used to construct the item, 
+        * @param aFileBitmapId Id (for bitmap) in the file. 
+        * @param aFileMaskId Id (for mask) in the file.
+        * @return Pointer to the newly created CGulIcon object.
+        *         Ownership of the object is transferred to the caller.
+		*/
+		static CGulIcon* CreateIconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileBitmapId, TInt aFileMaskId);
+
+		/**
+		* Constructs an image.
+		* @param aID Item ID of the masked bitmap to be created.
+        * @param aFilename Filename to be used to construct the item, 
+        * @param aFileBitmapId Id (for bitmap) in the file. 
+        * @param aFileMaskId Id (for mask) in the file.
+        * @return Pointer to the newly created 	CEikImage object.
+		*/
+		static CEikImage* CreateImageLC(TAknsItemID aId, const TDesC& aFileName, TInt aFileBitmapId, TInt aFileMaskId);
+		
+		/**
+		* Constructs an list box item for CAknDoubleLargeStyleListBox.
+		* @param aFirstLine.
+        * @param aSecondLine 
+        * @param aIndex1. 
+        * @param aIndex2.
+        * @return Pointerto the newly created list box item.
+		*/
+        static HBufC* ConstructListBoxItemLC(const TDesC& aFirstLine, const TDesC& aSecondLine, TInt aIndex);
+        
+		/**
+		* Shows time editor page.
+		* @param aTime.
+        * @return ETrue if not canceled, EFalse otherwise.
+		*/
+		static TBool ShowTimeEditorL(TTime& aTime, const TDesC& aTitle);
+
+		/**
+		* Shows date editor page.
+		* @param aTime.
+        * @return ETrue if not canceled, EFalse otherwise.
+		*/
+		static TBool ShowDateEditorL(TTime& aTime, const TDesC& aTitle);
+		
+		/**
+		* Shows list editor page.
+		* @param aList.
+		* @param aTitle.
+		* @param aCurrent.
+        * @return ETrue if not canceled, EFalse otherwise.
+		*/
+		static TBool ShowListEditorL(CDesCArray* aList, const TDesC& aTitle, TInt& aCurrent);
+		
+		/**
+		* Shows list editor page.
+		* @param aResourceId.
+		* @param aList.
+		* @param aTitle.
+		* @param aCurrent.
+        * @return ETrue if not canceled, EFalse otherwise.
+		*/
+		static TBool ShowListEditorL(TInt aResourceId, CDesCArray* aList, const TDesC& aTitle, TInt& aCurrent);
+		
+		
+		/**
+		* Shows text editor page.
+		* @param aRessourceId.
+		* @param aText.
+		* @param aTitle.
+    	* @param aMandatory.
+		* @param aLatinInput.
+		* @param aMaxLength.
+        * @return ETrue if not canceled, EFalse otherwise.
+		*/
+		static TBool ShowTextEditorL(TInt aResourceId, TDes& aText, const TDesC& aTitle, TBool aMandatory, TBool aLatinInput, TInt aMaxLength);
+		
+		/**
+		* Shows text editor page.
+		* @param aText.
+		* @param aTitle.
+    	* @param aMandatory.
+		* @param aLatinInput.
+		* @param aMaxLength.
+        * @return ETrue if not canceled, EFalse otherwise.
+		*/
+        static TBool ShowTextEditorL(TDes& aText, const TDesC& aTitle, TBool aMandatory, TBool aLatinInput, TInt aMaxLength);		
+
+		/**
+		* Shows integer editor page.
+		* @param aNumber.
+		* @param aTitle.
+    	* @param aMin.
+		* @param aMax.
+		* @param aLatinInput.
+        * @return ETrue if not canceled, EFalse otherwise.
+		*/
+        static TBool ShowIntegerEditorL(TInt& aNumber, const TDesC& aTitle, TInt aMin, TInt aMax, TBool aLatinInput);
+        
+		/**
+		* Shows popup dialog.
+		* @param aText Popup title.
+		* @param aArray Popup lines.
+        * @return None.
+		*/
+        static void ShowPopupDialogL(const TDesC& aText, CDesCArray* aArray);	
+
+		/**
+		* Shows popup dialog.
+		* @param aText Popup title.
+		* @param aArray Popup lines.
+        * @return None.
+		*/
+        static void ShowPopupDialog2L(const TDesC& aText, CDesCArray* aArray);	
+        
+        /**
+		*
+		* Does Descriptor contain string "PC Suite"
+		* Its NOT case sensitive
+		*
+		*/
+		static TBool IsPCSuiteDesC(const TDesC& des);
+		
+		static TInt ShowAutoSyncLogL(TAny* /*aAny*/);
+
+	};
+
+
+
+/**
+* CAspIndicatorHandler
+* 
+* This class is used for changing indicator state.
+*/
+NONSHARABLE_CLASS (CAspIndicatorHandler) : public CBase
+	{
+    public:
+        /**
+        * Destructor.
+        */
+		virtual ~CAspIndicatorHandler();
+
+        /**
+        * C++ default constructor.
+        */
+        CAspIndicatorHandler::CAspIndicatorHandler(MAknEditingStateIndicator* aIndicator);
+
+	public:
+
+		/**
+		* Sets navi pane title.
+		* @param aTitle.
+		* @return None.
+		*/
+		void SetIndicatorStateL(TInt aIndicatorType, const TDesC& aTitle);
+
+	private:
+		// status pane
+		//CEikStatusPane* iStatusPane;
+	
+	    // edit state indicator
+	    MAknEditingStateIndicator* iIndicator;
+        
+        // indicator container
+        CAknIndicatorContainer* iIndicatorContainer;
+        
+        // indicator type
+        TInt iIndicatorType;
+        
+        // has indicator been modified
+        TBool iIndicatorModified;
+        
+        // indicator type
+        TInt iPreviousIndicatorType;
+	};
+
+
+
+/**
+* CAspNaviPaneHandler
+* 
+* This class is used for changing navipane title.
+*/
+NONSHARABLE_CLASS (CAspNaviPaneHandler) : public CBase
+	{
+    public:
+        /**
+        * Destructor.
+        */
+		virtual ~CAspNaviPaneHandler();
+
+        /**
+        * C++ default constructor.
+        */
+		CAspNaviPaneHandler(CEikStatusPane* aStatusPane);
+
+	public:
+
+		/**
+		* Sets navi pane title.
+		* @param aTitle.
+		* @return None.
+		*/
+		void SetNaviPaneTitleL(const TDesC& aTitle);
+		
+		/**
+		* Store navi pane.
+		* @param None.
+		* @return None.
+		*/
+		void StoreNavipaneL();
+
+	private:
+		// status pane
+		CEikStatusPane* iStatusPane;
+	
+	    // navi Pane
+	    CAknNavigationControlContainer* iNaviPane;
+        
+        // navi decorator
+        CAknNavigationDecorator* iNaviDecorator;
+        
+        // has Navidecorator been pushed into navi pane
+        TBool iNavidecoratorPushed;
+        
+        // has navi pane been pushed into navigation pane's object stack
+        TBool iNavipanePushed;
+	};
+
+
+#ifdef RD_DSUI_TIMEDSYNC 
+
+class CAspSettingDialog;
+
+/**
+* CAspTabbedNaviPaneHandler
+* 
+* This class is used for changing tab group.
+*/
+NONSHARABLE_CLASS (CAspTabbedNaviPaneHandler) : public CBase, public MAknTabObserver
+	{
+    public:
+        /**
+        * Destructor.
+        */
+		virtual ~CAspTabbedNaviPaneHandler();
+
+        /**
+        * C++ default constructor.
+        */
+		CAspTabbedNaviPaneHandler(CEikStatusPane* aStatusPane ,CAspSettingDialog *aDialog);
+
+
+		
+	public:
+   		void StoreNavipaneL();
+	    void SetTabTextL(const TDesC& aText, TInt aTabId);
+	    void AddTabL(const TDesC& aText, TInt aTabId);
+	    void DeleteTabsL();
+	    void SetActiveTabL(TInt aTabId);
+		TInt TabIndex(TInt aTabId);
+		void SetTabWidthL();
+	    
+	    
+	private: // from  MAknTabObserver
+	    void TabChangedL(TInt aIndex);
+
+	private:
+		// status pane
+		CEikStatusPane* iStatusPane;
+	
+	    // navi Pane
+	    CAknNavigationControlContainer* iNaviPane;
+        
+        // navi decorator
+        CAknNavigationDecorator* iNaviDecorator;
+        
+       	// Tab group owned by the navigation decorator.
+        CAknTabGroup* iTabGroup;
+
+        
+        // has Navidecorator been pushed into navi pane
+        TBool iNavidecoratorPushed;
+        
+        // has navi pane been pushed into navigation pane's object stack
+        TBool iNavipanePushed;
+        
+        CAspSettingDialog *iDialog;
+	};
+
+#endif 
+
+/**
+* CStatusPaneHandler
+* 
+* This class is used for changing dialog title and image.
+*/
+NONSHARABLE_CLASS (CStatusPaneHandler) : public CBase
+	{
+    public:
+        /**
+        * Two-phased constructor.
+        */
+		static CStatusPaneHandler* NewL(CAknAppUi* aAppUi);
+
+        /**
+        * Destructor.
+        */
+		virtual ~CStatusPaneHandler();
+
+    private:
+        /**
+        * By default Symbian OS constructor is private.
+        */
+		void ConstructL();
+
+        /**
+        * C++ default constructor.
+        */
+		CStatusPaneHandler(CAknAppUi* aAppUi);
+
+	public:
+		/**
+		* Stores original title so it can be restored when dialog closes.
+		* @param  None.
+		* @return None.
+		*/
+        void StoreOriginalTitleL();
+
+		/**
+		* Restores original title.
+		* @param  None.
+		* @return None.
+		*/
+		void RestoreOriginalTitleL();
+
+		/**
+		* Sets dialog title.
+		* @param  aText.
+		* @return None.
+		*/
+		void SetTitleL(const TDesC& aText);
+
+		/**
+		* Sets dialog title.
+		* @param  aResourceId.
+		* @return None.
+		*/
+		void SetTitleL(TInt aResourceId);
+
+	public:
+		/**
+		* Sets dialog title.
+		* @param aAppUi.
+		* @param aText.
+		* @return Return code.
+		*/
+		static TBool SetTitleL(CAknAppUi* aAppUi, const TDesC& aText);
+
+		/**
+		* Gets dialog title.
+		* @param aAppUi.
+		* @param aText.
+		* @return Return code.
+		*/
+		static TBool GetTitleL(CAknAppUi* aAppUi, TDes& aText);
+		
+		/**
+		* Sets dialog image.
+		* @param aFilename.
+		* @param aMainId.
+		* @param aMaskId.
+		* @return None.
+		*/
+		void SetNewImageL(const TDesC& aFilename,TInt aMainId,TInt aMaskId);
+
+		/**
+		* Restores original image.
+		* @param  None.
+		* @return None.
+		*/
+		void RestoreOriginalImageL();
+
+		/**
+		* Sets dialog image.
+		* @param aAppUi.
+		* @param aIcon.
+		* @return Return code.
+		*/
+		static CEikImage* SetImageL(CAknAppUi* aAppUi, CEikImage* aIcon);
+
+		/**
+		* Sets navi pane title.
+		* @param aTitle.
+		* @return None.
+		*/
+		void SetNaviPaneTitleL(const TDesC& aTitle);
+		
+		/**
+		* Sets navi pane title.
+		* @param aTitle.
+		* @return None.
+		*/
+		void SetNaviPaneTitle(const TDesC& aTitle);
+		
+		/**
+		* Sets navi pane title.
+		* @param aTitle.
+		* @return None.
+		*/
+		void SetNaviPaneTitleL(TInt aResource);
+		
+		/**
+		* Store navi pane.
+		* @param None.
+		* @return None.
+		*/
+		void StoreNavipaneL();
+
+	private:
+		// access to app ui
+		CAknAppUi* iAppUi;
+
+		// original status pane title
+		TBuf<KBufSize> iOriginalTitle;
+		
+		// is original status pane title stored
+		TBool iOriginalTitleStored;
+
+		// original context pane image
+		CEikImage* iOriginalImage;
+		
+   	    CAspNaviPaneHandler* iNaviPaneHandler;
+	};
+
+
+
+
+/**
+* CAspSelectionItemList
+*
+* Needed for using cleanupstack with CSelectionItemList.
+*/
+NONSHARABLE_CLASS (CAspSelectionItemList) : public CSelectionItemList
+	{
+    public:
+	    /**
+        * C++ default constructor.
+        */
+	    CAspSelectionItemList(TInt aGranularity);
+
+	    /**
+         * Callback for operator TCleanupItem().
+         */
+	    static void Cleanup(TAny* aObj);
+	};
+
+
+
+
+/**
+*  CAspListItemData
+*  
+*  CAspListItemData represents one setting item in UI setting list
+*/
+NONSHARABLE_CLASS (CAspListItemData) : public CBase
+	{
+	public:
+		enum TAspListItemType
+			{
+			ETypeInternetAccessPoint,
+			ETypeList,
+			ETypeBearerList,
+			ETypeProtocolList,
+			ETypeLocalDatabase,
+			ETypeListYesNo,
+			ETypeSecret,
+			ETypeHostAddress,
+			ETypeFilter,
+			ETypeUseFilters,
+			ETypeSyncContent,
+			ETypeAutoSyncProfile,
+			ETypeAutoSyncContent,
+			ETypeAutoSyncFrequency,
+			ETypeAutoSyncDays,
+			ETypeAutoSyncPeakSchedule,
+			ETypeAutoSyncOffPeakSchedule,
+			ETypeAutoSyncTime,
+			ETypeNumber,
+			ETypeBoolean,
+			ETypeText,
+			ETypeText8,
+			ETypeDate,
+			ETypeTime,
+			ETypeSchedulingSetting,
+			ETypeProfileSetting
+			
+			};
+			
+	public:
+		static CAspListItemData* NewLC();
+    	CAspListItemData();
+		virtual ~CAspListItemData();
+		void ConstructL();
+
+	public:	
+		void SetHeaderL(const TDesC& aText);
+		void SetHeaderL(TInt aResourceId);
+		void SetValueL(const TDesC& aText);
+		void SetValueL(TInt aNumber);
+		void SetDisplayValueL(const TDesC& aText);
+		void SetDisplayValueL(TInt aResource);
+		const TDesC& Header();
+		const TDesC& Value();
+		HBufC* ListItemTextL(TBool aConvert);
+		void Init();
+		TBool IsEmpty();
+
+	public:
+		// number type setting data
+		TInt iNumberData;
+		
+		// date type setting
+		TTime iDate;
+		
+		// time type setting
+		TTime iTime;
+
+		// setting item type
+		TInt iItemType;
+    	
+    	// is setting shown in UI
+		TInt iHidden;
+		
+		// max length for text type setting
+		TInt iMaxLength;
+		
+		// setting editor resource id
+		TInt iResource;
+
+		// list index
+		TInt iIndex;	
+
+		// item id
+		TInt iItemId;
+
+        // is settimg mandatory
+		TBool iMandatory;
+		
+		// is latin input needed ???
+		TBool iLatinInput;
+		
+		// min number type setting value
+		TInt iMinValue;
+
+		// max number type setting value
+		TInt iMaxValue;
+		
+		// filter item - used only in CAspFilterDialog
+		//CAspFilter* iFilter;
+		
+		// did user press "Select" key or "Change" menu option
+		TBool iSelectKeyPressed;
+
+	private:
+		// used in UI when value is empty
+		HBufC*  iDisplayValue;
+		
+		// setting header (title)		
+		HBufC* iHeader;
+
+	    // text type setting value
+	    HBufC* iValue;
+	};
+
+
+
+
+typedef CArrayPtr<CAspListItemData> CAspSettingList; //setting item list for profile page
+
+/**
+* CAspRadioButtonSettingPageEditor
+*
+* Setting page that returns command button id.
+*/
+NONSHARABLE_CLASS (CAspRadioButtonSettingPageEditor) : public CAknRadioButtonSettingPage
+	{
+    public:
+        CAspRadioButtonSettingPageEditor(TInt aResourceID, TInt& aCurrentSelectionIndex, 
+		                           const MDesCArray* aItemArray);
+        ~CAspRadioButtonSettingPageEditor();            
+        
+	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+	};
+
+
+/**
+* CAspTextSettingPagePageEditor
+*
+* Setting page that returns command button id.
+*/
+NONSHARABLE_CLASS (CAspTextSettingPageEditor) : public CAknTextSettingPage
+	{
+    public:
+        CAspTextSettingPageEditor(TInt aResourceID,TDes& aText,TInt aTextSettingPageFlags);                                                    
+                                                     
+        ~CAspTextSettingPageEditor();            
+        
+	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+	};
+
+
+/**
+* CAspAlphaPasswordSettingPageEditor
+*
+* Setting page that returns command button id.
+*/
+NONSHARABLE_CLASS (CAspAlphaPasswordSettingPageEditor) : public CAknAlphaPasswordSettingPage
+	{
+    public:
+        CAspAlphaPasswordSettingPageEditor(TInt aResourceID, TDes& aNewPassword,const TDesC& aOldPassword);                                                    
+                                                     
+        ~CAspAlphaPasswordSettingPageEditor();            
+        
+	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+	};
+
+/**
+* CAspAlphaPasswordSettingPageEditor
+*
+* Setting page that returns command button id.
+*/
+NONSHARABLE_CLASS (CAspIntegerSettingPageEditor) : public CAknIntegerSettingPage
+	{
+    public:
+        CAspIntegerSettingPageEditor(TInt aResourceID, TInt& aValue, TInt aTextSettingPageFlags);                                                    
+                                                     
+        ~CAspIntegerSettingPageEditor();            
+        
+	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+	};
+
+
+#endif      // ASPDIALOGUTIL_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspFilter.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,311 @@
+/*
+* 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:  Contains general data definitions for AspSyncUtil.
+*
+*/
+
+
+
+#ifndef ASPFILTER_H
+#define ASPFILTER_H
+
+
+// INCLUDES
+#include <e32base.h>
+#include <ecom.h>
+
+#include <SyncMLClient.h>    // RSyncMLSession
+#include <SyncMLClientDS.h>  // RSyncMLDataSyncProfile
+
+#include <syncmldatafilter.h>
+//#include <syncmldatafilter.hrh>
+
+
+#include <AknCheckBoxSettingPage.h>  // CSelectionItemList
+
+
+#include "aspdefines.h"
+#include "asputil.h"
+
+
+
+
+
+// CONSTANTS
+
+const TInt KFilterBaseId = 1000;
+const TInt KFilterItemBaseId = 2000;
+
+
+// FORWARD DECLARATIONS
+class CAspFilterItem;
+
+
+// CLASS DECLARATION
+
+
+
+/**
+* CAspFilterList
+*
+* CAspFilterList is used for sync filter operations.
+*/
+NONSHARABLE_CLASS (CAspFilterList) : public CBase
+    {
+
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspFilterList* NewL(const TAspParam& aParam, RPointerArray<CSyncMLFilter>& aArray);
+
+	    /**
+        * Destructor.
+        */
+        ~CAspFilterList();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+	    CAspFilterList(const TAspParam& aParam, RPointerArray<CSyncMLFilter>& aArray);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+	    
+    public:
+        //void InitAllFiltersL();
+        void InitFiltersL();
+        TInt Count();
+        void SetFiltersEnabledL(TBool aEnable);
+        TBool FiltersEnabled();
+        CAspFilter* Item(TInt aIndex);
+        CAspFilter* ItemForId(TInt aId);
+        void SaveL();
+    
+    private:
+		// application id
+		TInt iApplicationId;
+		
+		// sync task
+		//CAspTask* iAspTask;
+		
+		// list of filters
+		RPointerArray<CAspFilter> iFilterList;
+		
+		// is filter feature enabled
+		TBool iFiltersEnabled;
+		
+		RPointerArray<CSyncMLFilter> iArray;
+     };
+
+
+
+
+/**
+* CAspFilter
+*
+* CAspTask is used for sync filter operations.
+*/
+NONSHARABLE_CLASS (CAspFilter) : public CBase
+    {
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CAspFilter* NewLC(CSyncMLFilter* aSyncFilter, TInt aId);
+
+
+	    /**
+        * Destructor.
+        */
+        ~CAspFilter();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+	    CAspFilter(CSyncMLFilter* aSyncFilter, TInt aId);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+	    
+    public:
+        void SaveL();
+        const TDesC& DisplayName();
+        TInt Id();
+        void GetDisplayValueL(TDes& aText);
+        const TDesC& DisplayValueL();
+        TInt ItemCount();
+        CAspFilterItem* Item(TInt aIndex);
+        CAspFilterItem* ItemForId(TInt aId);
+        TBool Enabled();
+        void SetEnabledL(TBool aEnable);
+        
+    private:
+        void InitFilterItemsL();
+        
+   
+    private:
+		// application id
+		TInt iApplicationId;
+		
+		// temporary filter id
+		TInt iId;
+		
+		// sync filter
+		CSyncMLFilter* iSyncFilter;
+		
+		// list of filters
+		RPointerArray<CAspFilterItem> iFilterItemList;
+    };
+
+
+
+
+/**
+* CAspFilterItem
+*
+* CAspFilterItem is used for sync filter operations.
+*/
+NONSHARABLE_CLASS (CAspFilterItem) : public CBase
+    {
+    public:
+	enum TListType
+		{
+		ETypeQuery,
+	    ETypeSingleSelection,
+	    ETypeSingleSelectionUserDefined,
+	    ETypeMultipleSelection,
+	    ETypeMultipleSelectionUserDefined
+		};
+    
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CAspFilterItem* NewLC(CSyncMLFilterProperty* aProperty, TInt aId);
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspFilterItem* NewL(CSyncMLFilterProperty* aProperty, TInt aId);
+
+	    /**
+        * Destructor.
+        */
+        ~CAspFilterItem();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+	    CAspFilterItem(CSyncMLFilterProperty* aProperty, TInt aId);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+	    
+    public:
+    
+        TInt ListType();
+        TInt DataType();
+        const TDesC& DisplayName();
+        const TDesC& DisplayValueL();
+        void GetDisplayValueL(TDes& aText);
+        void GetSelectionL(CSelectionItemList* aList);
+        void SetSelectionL(CSelectionItemList* aList);
+        void CheckEmptySelectionL();
+        TInt Id();
+        TBool IsMandatory();
+        TInt MaxLength();
+        
+    public:
+        void SetBoolL(TBool aBool);
+        TBool BoolL();
+        void SetTextL(const TDesC& aText);
+        void GetTextL(TDes& aText);
+        void GetText(TDes& aText);
+        TTime DateL();
+        void SetDateL(TTime aTime);
+        TTime TimeL();
+        void SetTimeL(TTime aTime);
+        TInt IntL();
+        void SetIntL(TInt aInt);
+
+
+    private:
+        void InitListTypeL();
+        void InitDataTypeL();
+
+        TInt SelectionAndQueryCount();
+        TInt SelectionIndex();
+        TBool QueryValueSelected();
+        
+        void GetQueryValueTextL(TDes& aText);
+        void SetQueryValueTextL(const TDesC& aText);
+        void GetListValueTextL(TDes& aText);
+        void GetListValueTextL(TDes& aText, TInt aIndex);
+
+        TBool IsMultipleSelection();
+        void UpdateQueryValueL(CSelectionItemList* aList);
+        void AddQueryValueL(CSelectionItemList* aList);
+        TInt SelectionCount();
+
+        
+        
+    private:
+		// application id
+		TInt iApplicationId;
+		
+		// filter item id
+		TInt iId;
+		
+		// editor type
+		TInt iListType;
+		
+		// data type
+		TInt iDataType;
+		
+		// temp buffer
+		TBuf<KBufSize> iBuf;
+
+		// temp buffer
+		TBuf8<KBufSize> iBuf8;
+		
+		// temp buffer
+		TBuf<KBufSize> iDisplayValueBuf;
+		
+		// sync filter propperty
+		CSyncMLFilterProperty* iProperty;
+     };
+
+
+
+
+
+
+
+#endif  // ASPFILTER_H
+
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspFilterDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,490 @@
+/*
+* 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:  Contains general data definitions for AspSyncUtil.
+*
+*/
+
+
+#ifndef ASPFILTERDIALOG_H
+#define ASPFILTERDIALOG_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <eiklbo.h>
+#include <aknlists.h>
+#include <aknnavide.h>
+#include <AknDialog.h>
+
+#include <CAknCommonDialogsBase.h>  // TCommonDialogType
+#include <AknRadioButtonSettingPage.h>  // CAknRadioButtonSettingPage
+#include <AknCheckBoxSettingPage.h>  // CAknRadioButtonSettingPage
+
+
+#include "AspDialogUtil.h"
+
+
+
+
+// CLASS DECLARATION
+
+
+/**
+* CAspFilterDialog
+* 
+* CAspFilterDialog shows list of sync filter items. 
+*/
+NONSHARABLE_CLASS (CAspFilterDialog) : public CAknDialog, public MEikListBoxObserver
+    {
+	public:
+	    /**
+        * Launches content dialog.
+        * @param aParam Class that contains dialog parameters.
+        * @return Completion code.
+        */
+		static TBool ShowDialogL(TAspParam& aParam);
+
+	private:
+
+		/**
+		* C++ default constructor.
+		* @param aParam Class that contains dialog parameters.
+		* @return None.
+		*/
+		CAspFilterDialog(TAspParam& aParam);
+
+						
+        /**
+        * Two-phased constructor.
+		* @param aParam Class that contains dialog parameters.
+        */
+		static CAspFilterDialog* NewL(TAspParam& aParam);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+		void ConstructL();
+
+	    /**
+        * Destructor.
+        */
+		~CAspFilterDialog();
+
+	private:	
+
+	   /**
+		* From the base class.
+        * Called when dialog is activated.
+        * @return None.
+        */
+		void ActivateL();
+
+		/**
+		* From the base class.
+        * Handles key presses.
+        * @param aKeyEvent Key code.
+		* @param aType Key type.
+        * @return Result code.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+	
+		
+		/**
+		* From the base class.
+		* Handles menu events.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		virtual void ProcessCommandL(TInt aCommandId);
+
+		/**
+        * From the base class
+		* Called by framework before menu is shown.
+        * @param aResourceId Menu resource id.
+		* @param aMenuPane Pointer to the menu.
+        * @return None.
+        */
+		void DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane);
+
+		/**
+		* Handle content parameter editing.
+		* @return None.
+		*/
+		void HandleOKL();
+
+		/**
+		* Method to get context sensitive help topic.
+        * @param aContext Help topic to open.
+		* @return None.
+        */
+		void GetHelpContext(TCoeHelpContext& aContext) const;
+		
+	
+		/**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param aButtonId Id of the pressed button
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+		TBool OkToExitL(TInt aButtonId);
+	
+		/**
+        * From the base class.
+		* Called by framework before the dialog is shown.
+		* @return None.
+        */
+		void PreLayoutDynInitL();
+
+		/**
+        * From MEikListBoxObserver.
+		* Handle listbox events.
+        * @param aListBox Pointer to used listbox.
+		* @param aEventType Event type.
+        * @return None.
+        */
+		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+	private:
+
+		/**
+		* Check that mandatory fields are set
+		* @return Index of the invalid mandatory item.
+		*/
+		TInt CheckMandatoryFieldsL();
+	
+		/**
+		* Save content parameters into profile.
+    	* @return None.
+		*/
+		void SaveSettingsL();
+
+		/**
+
+
+		/**
+		* Set filter type setting visibility.
+		* @param aVisible Visibility.
+		* @return None.
+		*/
+		void SetFilterSettingsVisibility(TBool aVisible);
+    
+    private:
+    		
+		/**
+        * Add settings titles into listbox.
+        * @param aListBox.
+        * @param aItemList List of setting items.
+        * @return None.
+        */
+		void UpdateListBoxL(CEikTextListBox* aListBox, CAspSettingList* aItemList);
+		
+		/**
+        * Create one CAspListItemData for each setting.
+        * @param None.
+        * @return None.
+        */
+		void CreateSettingsListL();
+		
+		/**
+        * Adds one setting item into item list.
+        * @param aItem.
+		* @return None.
+        */
+		void AddItemL(CAspFilterItem* aFilterItem);
+		
+		/**
+        * Initalizes setting item needed for listbox handling.
+        * @param aItem.
+        * @return None.
+        */
+		static void InitSettingItemL(CAspListItemData* aItem);
+
+
+    public:
+        static TBool EditFilterL(CAspListItemData& aItem);
+        
+    private:
+		static TBool EditSettingItemL(CAspListItemData& aItem);
+        static TBool EditSettingItemQueryL(CAspListItemData& aItem);
+
+        static TBool EditSettingItemTextL(CAspListItemData& aItem);
+        static TBool EditSettingItemListL(CAspListItemData& aItem);
+        static TBool EditSettingItemBooleanL(CAspListItemData& aItem);
+        static TBool EditSettingItemNumberL(CAspListItemData& aItem);
+        static TBool EditSettingItemDateL(CAspListItemData& aItem);
+        static TBool EditSettingItemTimeL(CAspListItemData& aItem);
+
+        
+        static TBool EditMultiChoiceListL(CAspListItemData& aItem);
+        static TBool EditSingleChoiceListL(CAspListItemData& aItem);
+
+	 
+    private:
+		/**
+		* Utility function.
+		* @param aIndex Listbox index.
+		* @return setting item with listbox position aIndex.
+        */
+		CAspListItemData* ItemForIndex(TInt aIndex);
+
+		/**
+        * Utility function.
+        * @param aItemId Item id.
+        * @return Pointer to setting item.
+        */
+		CAspListItemData* Item(TInt aItemId);
+
+  
+		/**
+		* Utility function.
+		* @param None.
+		* @return Sync profile.
+        */
+		RSyncMLDataSyncProfile& Profile();
+
+		/**
+		* Utility function.
+		* @param None.
+		* @return Sync task.
+        */
+		//RSyncMLTask& Task();
+
+		/**
+		* Utility function.
+		* @param None.
+		* @return Listbox.
+        */
+		CAknSettingStyleListBox* ListBox();
+		
+		/**
+		* Utility function.
+		* @param None.
+		* @return Pointer to resource handler.
+		*/
+		CAspResHandler* ResHandler();
+		
+		
+		/**
+        * Set setting item visibility (normal/readonly/hidden).
+        * @param None.
+		* @return None.
+        */
+		void SetVisibility();
+
+		
+		
+
+	private:
+		// id of the calling application
+		TInt iApplicationId;
+
+		// list box for setting items 
+		CAknSettingStyleListBox* iListBox;
+		
+		// setting items
+		CAspSettingList *iSettingList;
+		
+		// CEikStatusPane contains dialog title and image
+		CEikStatusPane* iStatusPane;
+
+		// for title and icon handling
+		CStatusPaneHandler* iStatusPaneHandler;
+
+		// session with sync server
+		RSyncMLSession* iSyncSession;
+		
+		// long buffer for string handling
+		TBuf<KBufSize255> iBuf;
+		
+		// sync task
+		CAspFilter* iFilter;
+		
+		// dialog parameters
+		TAspParam* iDialogParam;
+		
+		// resource handler
+		CAspResHandler* iResHandler;
+	};
+
+
+/**
+* MAspChoiceListObserver
+*
+* MAspChoiceListObserver is for handling choice list events.
+*/
+class MAspChoiceListObserver
+    {
+    public:
+	    virtual TBool HandleChoiceListEventL(TInt aEvent, TInt aListType) = 0;
+    };
+
+
+/**
+* CAspChoiceListSettingPage
+*
+* Radio button setting page that contains "User defined" option.
+*/
+NONSHARABLE_CLASS (CAspChoiceListSettingPage) : public CAknRadioButtonSettingPage
+	{
+    public:
+	enum TEditorType
+		{
+		ETypeNormal,
+	    ETypeUserDefined
+		};
+	
+    public: 
+	    CAspChoiceListSettingPage(TInt aResourceID, TInt& aCurrentSelectionIndex,
+                                  const MDesCArray* aItemArray, 
+                                  MAspChoiceListObserver* aObserver, TInt aType);
+        ~CAspChoiceListSettingPage();            
+	
+    protected: // From CCoeControl
+	    void ProcessCommandL(TInt aCommandId);
+	    
+	private:
+	    MAspChoiceListObserver* iObserver;
+	    TInt iType;
+	};
+
+
+/**
+* CAspMultiChoiceListSettingPage
+*
+* Check box button setting page that contains "User defined" option.
+*/
+NONSHARABLE_CLASS (CAspMultiChoiceListSettingPage) : public CAknCheckBoxSettingPage
+	{
+    public:
+	enum TEditorType
+		{
+		ETypeNormal,
+	    ETypeUserDefined
+		};
+	
+    public: 
+	    CAspMultiChoiceListSettingPage(TInt aResourceID, CSelectionItemList* aItemArray, 
+                                  MAspChoiceListObserver* aObserver, TInt aType);
+        ~CAspMultiChoiceListSettingPage();            
+	
+    protected: // From CCoeControl
+	    void ProcessCommandL(TInt aCommandId);
+	    
+	private:
+	    MAspChoiceListObserver* iObserver;
+	    TInt iType;
+	    CSelectionItemList* iSelectionList;
+	};
+
+
+
+/**
+* CAspChoiceList
+*
+* CAspChoiceList implemets choicelist with "User defined" item.
+*/
+NONSHARABLE_CLASS (CAspChoiceList) : public CBase, public MAspChoiceListObserver
+    {
+    public:
+	enum TListType
+		{
+		ETypeNormal,
+		ETypeTextUserDefined,
+	    ETypeIntegerUserDefined,
+	    ETypeDateUserDefined,
+	    ETypeTimeUserDefined
+		};
+
+    public:
+		static CAspChoiceList* NewLC(const TDesC& aTitle, CSelectionItemList* aList, TInt aType, TInt aMaxLength);
+		~CAspChoiceList();
+	private:
+		CAspChoiceList(const TDesC& aTitle, CSelectionItemList* iList, TInt aType, TInt aMaxLength);
+		void ConstructL();
+    
+    public:
+        TBool ShowListL();
+      
+    public:
+        void AddItemL(CSelectionItemList* aList, TDes& aText, TBool aEnable);
+        void AddItemL(TDes& aText, TBool aEnable);
+        void AddItemL(TInt aNumber, TBool aEnable);
+        void AddUserDefinedL();
+        void RemoveUserDefinedL();
+        CDesCArray* DesArrayLC(CSelectionItemList* aList);
+        void SetSelectedIndex(CSelectionItemList* aList, TInt aIndex);
+        TInt SelectedIndex(CSelectionItemList* aList);
+        TBool EditTextL(TDes& aText, const TDesC& aTitle);
+
+
+    private: // from MAspChoiceListObserver
+	    TBool HandleChoiceListEventL(TInt aEvent, TInt aListType);
+
+
+	private:
+	    TInt  iUserDefinedInt;
+	    TBuf<KBufSize>  iUserDefinedText;
+	    TInt iMaxTextLength;
+	    
+	    TInt iListType;
+        TBuf<KBufSize> iTitle;
+        CSelectionItemList* iSelectionList;
+    };
+
+
+
+/**
+* CAspMultiChoiceList
+*
+* CAspChoiceList implemets multiple selection choicelist with "User defined" item.
+*/
+NONSHARABLE_CLASS (CAspMultiChoiceList) : public CBase, public MAspChoiceListObserver
+    {
+    public:
+		static CAspMultiChoiceList* NewLC(const TDesC& aTitle, CSelectionItemList* aList, TInt aType, TInt aMaxLength);
+		~CAspMultiChoiceList();
+	private:
+		CAspMultiChoiceList(const TDesC& aTitle, CSelectionItemList* iList, TInt aType, TInt aMaxLength);
+		void ConstructL();
+    
+    public:
+        TBool ShowListL();
+
+    
+    public:
+        void AddItemL(CSelectionItemList* aList, TDes& aText, TBool aEnable);
+        void AddItemL(TDes& aText, TBool aEnable);
+        void AddItemL(TInt aNumber, TBool aEnable);
+        void AddUserDefinedL();
+        void RemoveUserDefinedL();
+        TBool EditTextL(TDes& aText, const TDesC& aTitle);
+    
+    private: // from MAspChoiceListObserver
+	    TBool HandleChoiceListEventL(TInt aEvent, TInt aListType);
+
+	private:
+	    TInt  iUserDefinedInt;
+	    TBuf<KBufSize>  iUserDefinedText;
+	    TInt iMaxTextLength;
+	    
+	    TInt iListType;
+        TBuf<KBufSize> iTitle;
+        CSelectionItemList* iSelectionList;
+    };
+
+
+
+#endif      // ASPFILTERDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspLogDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,201 @@
+/*
+* 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:  Contains general data definitions for AspSyncUtil.
+*
+*/
+
+
+#ifndef ASPLOGDIALOG_H
+#define ASPLOGDIALOG_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <SyncMLHistory.h>
+
+#include "AspDefines.h"
+#include "AspProfile.h"
+#include "AspResHandler.h"
+
+
+
+
+/**
+* CAspLogDialog
+*  
+* CAspLogDialog shows sync log information.
+*/
+NONSHARABLE_CLASS (CAspLogDialog) : public CBase
+    {
+	
+	enum TLogItemType
+		{
+	    ELogAddedPhone,
+	    ELogUpdatedPhone,
+	    ELogDeletedPhone,
+	    ELogDiscardedPhone,
+	    ELogMovedPhone,
+	    ELogAddedServer,
+	    ELogUpdatedServer,
+	    ELogDeletedServer,
+	    ELogDiscardedServer,
+	    ELogMovedServer
+		};
+
+	public:
+	    /**
+        * Launches log dialog.
+		* @param None.
+        * @return None.
+        */
+		void ShowDialogL();
+
+    
+	public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspLogDialog* NewL(const TAspParam& aParam);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspLogDialog();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAspLogDialog(const TAspParam& aParam);
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	private:
+
+		/**
+        * Creates text lines that are shown in log dialog.
+		* @param aList.
+		* @param aProfile.
+		* @param aTaskList.
+        * @return None.
+        */
+		void CreateListL(CDesCArray* aList, CAspProfile* aProfile, CAspContentList* aTaskList);
+       
+		/**
+        * Adds one line into listbox array.
+    	* @param aList.
+		* @param aHistoryJob.
+		* @param aTaskList.
+        * @param aType.
+        * @return None.
+        */
+        void AddLogItemsL(CDesCArray* aList, const CSyncMLHistoryJob* aHistoryJob, 
+                                CAspContentList* aTaskList, TInt aType);
+                                
+		/**
+        * Adds one line into listbox array.
+    	* @param aList.
+		* @param aHistoryJob.
+		* @param aTaskList.
+        * @return None.
+        */
+        void AddTaskErrorsL(CDesCArray* aList, const CSyncMLHistoryJob* aHistoryJob, 
+                                CAspContentList* aTaskList);
+                                
+		/**
+        * Gets number of synced items.
+		* @param aTaskInfo.
+		* @param aType.
+        * @return Item count.
+        */
+        TInt SyncedItemCount(const CSyncMLHistoryJob::TTaskInfo& aTaskInfo, TInt aType);
+                                 
+		/**
+        * Get log item text.
+    	* @param aType.
+		* @param aDataProviderId
+		* @param aDisplayName
+        * @return None.
+        */
+        HBufC* LogItemTextLC(TInt aType, TInt aDataProviderId, const TDesC& aDisplayName);
+        
+		/**
+        * Add one line into log item list.
+    	* @param aList.
+		* @param aText
+        * @return None.
+        */
+        void AddLineL(CDesCArray* aList, TDes& aText);
+        
+		/**
+        * Gets latest history (sync) job.
+		* @param aHistoryLog.
+        * @return History job.
+        */
+        CSyncMLHistoryJob* LatestHistoryJob(RSyncMLHistoryLog& aHistoryLog);
+ 
+		/**
+        * Has server been modified during sync.
+    	* @param aHistoryJob.
+        * @return TBool.
+        */
+        TBool ServerModified(const CSyncMLHistoryJob* aHistoryJob);
+
+		/**
+        * Has phone been modified during sync.
+    	* @param aHistoryJob.
+        * @return TBool.
+        */
+        TBool PhoneModified(const CSyncMLHistoryJob* aHistoryJob);
+        
+		/**
+        * Has there been task errors during sync.
+    	* @param aHistoryJob.
+        * @return TBool.
+        */
+        TBool HasTaskErrors(const CSyncMLHistoryJob* aHistoryJob);
+
+
+	private:
+        // profile id
+		TInt iProfileId;
+		
+    	// session with sync server - only used in ConstructL
+		RSyncMLSession* iSyncSession;
+	
+		// resource handler
+		CAspResHandler* iResHandler;
+		
+        // for string handling
+		TBuf<KBufSize255> iBuf;
+		
+        // for string handling
+		TBuf<KBufSize255> iBuf2;
+
+		// list of text lines that are shown in log dialog
+		CDesCArrayFlat* iList;
+	};
+
+
+
+
+
+#endif      // ASPLOGDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspPreSyncPluginInterface.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,137 @@
+/*
+* 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: Roaming warning plugin interface implementation 
+*
+*/
+
+#ifndef ASPPRESYNCPLUGININTERFACE_H
+#define ASPPRESYNCPLUGININTERFACE_H
+
+// INCLUDE FILES
+#include <s32mem.h>
+#include <coemain.h>
+#include <ecom/ecom.h>
+#include <ecom/implementationinformation.h>
+#include <SyncMLDef.h>
+
+class CPreSyncPlugin;
+
+/**
+* Class is used to instantiate the required plugins when the search has been
+* asked. Acts as interface to all Plugins.
+*/
+
+class CPreSyncPluginInterface: public CBase 
+{
+	public:
+
+		/** 
+		* Symbian OS 2 phased constructor.
+		* @return	A pointer to the created instance of CPreSyncPluginInterface.
+		*/
+		static CPreSyncPluginInterface* NewL();
+
+		/** 
+		* Symbian OS 2 phased constructor.
+		* @return	A pointer to the created instance of CPreSyncPluginInterface.
+		*/
+		static CPreSyncPluginInterface* NewLC();
+
+		/**
+		* Destructor.
+		*/      
+		virtual ~CPreSyncPluginInterface();
+
+		/**
+		* Instantiates the required search plug-ins known by the ecom framework.
+		* basically this function first calls ListAllImplementationsL()
+		* and then checks them one by one to match the algorithm name
+		*/
+		void InstantiatePluginL();
+		
+		CPreSyncPlugin* InstantiateRoamingPluginLC( TSmlProfileId aProfileId );
+
+		/**
+		* Unloads all plugins
+		* This should internally call  REComSession::DestroyedImplementation( iDtor_ID_Key )
+		* and then REComSession::FinalClose()
+		*/
+		void UnloadPlugIns(); 
+
+		/**
+		* Lists all implementations which satisfy this ecom interface
+		*
+		* @param aImplInfoArray On return, contains the list of available implementations
+		* 
+		*/   
+		void ListAllImplementationsL( RImplInfoPtrArray& aImplInfoArray );
+		
+
+		/**
+		* Forwards the request to check if language is supported
+		* to the algorithm instance
+		*/
+		TBool IsDefault();   
+		              
+		/**
+		* Forwards the request to recover data fields order for a URI
+		* to the algorithm instance
+		*/
+		TBool IsProfileYours(TSmlProfileId aProfileId);
+
+		/**
+		* Forwards the request to recover sort order for a URI
+		* to the algorithm instance
+		*/
+		void Handle(TSmlProfileId aProfileId); 
+
+	private: 
+
+		/** 
+		* Performs the first phase of two phase construction.
+		*/
+		CPreSyncPluginInterface();  
+
+		/** 
+		* Symbian OS 2 phased constructor.
+		*/
+		void ConstructL();
+
+		/**
+		* Instantiates a PCS plug-in, knowing the implementation uid.
+		* @param aImpUid imp uID
+		*/
+		CPreSyncPlugin* InstantiatePlugInFromImpUidL( const TUid& aImpUid );
+
+
+	private: 
+
+	    /** iDtor_ID_Key Instance identifier key. When instance of an
+	         *               implementation is created by ECOM framework, the
+	         *               framework will assign UID for it. The UID is used in
+	         *               destructor to notify framework that this instance is
+	         *               being destroyed and resources can be released.
+	         */
+	    TUid iDtor_ID_Key;
+
+		// List of plugins that this interface will interact with
+		RPointerArray<CPreSyncPlugin>  iPluginInstances; 
+
+		// Uid of the algorithm in use
+		TUid iPluginInUse;
+};
+
+#endif // ASPPRESYNCPLUGININTERFACE_H
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspProfile.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,1349 @@
+/*
+* 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: Profile structure mapped to server side data sync profile 
+*
+*/
+
+
+#ifndef ASPPROFILE_H
+#define ASPPROFILE_H
+
+// INCLUDES
+#include <e32base.h>
+#include <ecom.h>
+#include <calsession.h>
+
+#include <SyncMLClient.h>    // for RSyncMLSession
+#include <SyncMLClientDS.h>  // for RSyncMLDataSyncProfile
+
+#include "AspDefines.h"
+#include "AspUtil.h"
+
+//For Error EAZG-7KGAK8. Language definiton not found in elang.h 
+const TInt ELangIndon_Apac=327;
+const TUid KCRUidDSDefaultProfileInternalKeys  = { 0x20021338 };
+const TInt KNsmlDsDefaultProfile = 0x0;
+
+// CONSTANTS
+
+// Visibility settings for operator specific sync profiles on UI
+// - Normal = Profile shown without any specific formatting
+// - ReadOnly = Profile fields locked (non-editable), deletion not allowed
+// - Hidden = Profile not shown in UI
+enum TOperatorProfileVisibility
+    {
+    EProfileVisibilityNormal = 0,
+    EProfileVisibilityReadOnly = 1,
+    EProfileVisibilityHidden = 2
+    };
+
+// FORWARD DECLARATIONS
+class CAspProfile;
+
+
+// CLASS DECLARATION
+
+
+
+/**
+* TAspProfileItem
+*
+* TAspProfileItem contains sync profile data.
+*/
+NONSHARABLE_CLASS (TAspProfileItem)
+	{
+	public:
+		/**
+		* Get profile name.
+		* @param None.
+        * @return Profile name.
+        */
+		const TDesC& Name();
+
+		/**
+		* Get profile name.
+		* @param None.
+        * @return Profile name.
+        */
+		HBufC* NameLC();
+
+		/**
+		* Set profile name.
+		* @param aName.
+        * @return None.
+        */
+		void SetName(const TDesC& aName);
+		
+		/**
+		* Initalize object data.
+		* @param None.
+        * @return None.
+        */
+		void Init();
+
+	public:
+		/**
+		* Compare two profile items.
+		* @param aFirst.
+		* @param aSecond.		
+        * @return Compare result.
+        */
+		static TInt CompareItems(const TAspProfileItem& aFirst, const TAspProfileItem& aSecond);
+
+	public:
+		// profile name
+		TBuf<KBufSize> iProfileName;	
+		
+		// profile id 
+		TInt iProfileId;
+		
+		// is profile synced
+		TInt iSynced;
+		
+		// last sync time
+		TTime iLastSync;
+		
+		// bearer type
+		TInt iBearer;
+		
+		// is server alert sync activated
+		TInt iActive;
+		
+		// can profile be deleted
+		TBool iDeleteAllowed;
+		
+		// application id
+		TInt iApplicationId;
+
+		// is all mandatory data found 
+		TInt iMandatoryCheck;
+		
+		// number of sync tasks
+		TInt iTaskCount;
+		
+		// application specific sync task id
+		TInt iTaskId;
+		
+		// server id check sum
+		TUint16 iServerIdCheckSum;
+
+	};
+
+
+
+/**
+* TAspTaskItem
+* 
+* TAspTaskItem contains sync task data.
+*/
+NONSHARABLE_CLASS (TAspTaskItem)
+	{
+	public:
+	    // task id
+    	TInt  iTaskId;
+    	
+    	// sync direction
+		TInt  iSyncDirection;
+		
+		// is remote database defined
+		TBool iRemoteDatabaseDefined;
+		
+		// is local database defined
+		TBool iLocalDatabaseDefined;
+		
+		// is task included in sync
+		TBool iEnabled;
+		
+		// id of data provider that this task uses
+		TInt  iDataProviderId;
+		
+		// last sync time
+		TTime	 iLastSync;
+
+		// task display name
+	    TBuf<KBufSize> iDisplayName;
+	    TBuf<KBufSize> iClientDataSource;
+    };
+
+
+/**
+* TAspDataProviderItem
+* 
+* TAspDataProviderItem contains data provider data.
+*/
+NONSHARABLE_CLASS (TAspProviderItem)
+	{
+    enum TProviderListSortOrder
+	    {
+	    EOrderContact = 4,
+	    EOrderCalendar = 3,
+	    EOrderNotes = 2,
+	    EOrderEmail = 1,
+	    EOrderOther = 0
+    	};
+	
+	public:
+		/**
+		* Compare two profile items.
+		* @param aFirst.
+		* @param aSecond.		
+        * @return Compare result.
+        */
+		static TInt CompareItems(const TAspProviderItem& aFirst, const TAspProviderItem& aSecond);
+		static TInt SortOrder(TInt aDataProviderId);
+	
+	public:
+	    // data provider id
+		TInt  iDataProviderId;
+		
+		// can more than one database be synced 
+		TBool iAllowMultipleDataStores;
+		
+		// is default data store defined
+		TBool iHasDefaultDataStore;
+		
+		// sync protocol
+		TInt  iSyncProtocol;
+
+        // id of sync task that is using this data provider
+		TBool iTaskId;
+		
+		// display name
+	    TBuf<KBufSize> iDisplayName;
+	    
+	   	// default data store name
+		TBuf<KBufSize> iDefaultDataStore;
+		
+		// is this provider included in sync (profile specific)
+		TBool iIsIncludedInSync;
+	};
+
+
+/**
+* TAspFilterInfo
+* 
+* TAspFilterInfo contains profile list filtering data.
+*/
+NONSHARABLE_CLASS (TAspFilterInfo)
+	{
+	public:
+	enum TFilterType
+		{
+	    EIncludeDeletableProfile,
+	    EIncludeRemoteProfile
+		};
+
+	public:
+	    // filter type
+		TInt iFilterType;
+		
+		// filter id (eg. application id 
+		TBool iFilterId;
+		
+		// filter text
+		TBuf<KBufSize>  iFilterText;
+	};
+
+
+/**
+* CAspContentList 
+*
+* CAspContentList contains sync task list and data provider list.
+*/
+NONSHARABLE_CLASS (CAspContentList): public CBase
+    {
+    public:
+
+	enum TListMode
+		{
+	    EInitDataProviders,
+	    EInitTasks,
+	    EInitAll
+		};
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CAspContentList* NewLC(const TAspParam& aParam);
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspContentList* NewL(const TAspParam& aParam);
+
+	    /**
+        * Destructor.
+        */
+        virtual ~CAspContentList();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+	    CAspContentList(const TAspParam& aParam);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+
+	public:
+		/**
+		* Sets sync profile.
+		* @param aProfile.
+        * @return None.
+        */
+		void SetProfile(CAspProfile* aProfile);
+		
+		/**
+		* Find out whether iProfile has been set.
+		* @param None.
+        * @return TBool.
+        */
+		TBool IsLocked();
+	
+		/**
+		* Returns data provider count.
+		* @param None.
+        * @return Data provider count.
+        */
+		TInt ProviderCount();
+
+		/**
+		* Returns Data provider.
+        * @param aIndex List index.
+		* @return Data provider.
+        */
+		TAspProviderItem& ProviderItem(TInt aIndex);
+		
+		/**
+		* Returns list index.
+        * @param aId.
+		* @return List index.
+        */
+        TInt FindProviderIndex(TInt aId);		
+
+		/**
+		* Returns list index.
+        * @param aId.
+		* @return List index.
+        */
+        TInt FindProviderIndexForTask(TInt aId);		
+
+		/**
+		* Returns task count.
+        * @return Task count.
+        */
+		TInt TaskCount();
+		
+		/**
+		* Returns task item.
+        * @param aIndex.
+		* @return Task item.
+        */
+		TAspTaskItem& TaskItem(TInt aIndex);
+		
+		/**
+		* Returns list index.
+        * @param aId.
+		* @return List index.
+        */
+        TInt FindTaskIndex(TInt aId);		
+
+		/**
+		* Returns list index.
+        * @param aId.
+		* @return List index.
+        */
+        TInt FindTaskIndexForProvider(TInt aId);		
+
+		/**
+		* Returns task id.
+        * @param aId.
+		* @return Task id.
+        */
+        TInt FindTaskIdForProvider(TInt aId);		
+		
+		/**
+		* Checks that data provider has default local database.
+		* @param aDataProviderId.
+		* @return ETrue if database exists, EFalse otherwise.
+        */
+		//TBool DefaultLocalDatabaseExist(TInt aDataProviderId);
+		
+		/**
+		* Checks that all content items are valid.
+		* @param aContentCount.
+		* @return Return code.
+        */
+		TInt CheckMandatoryDataL(TInt& aContentCount);
+        
+	public:
+
+		/**
+		* Read sync data providers from RSyncMLSession.
+		* @return None.
+        */
+		void InitDataProvidersL();
+		
+		/**
+		* Read sync data providers from RSyncMLSession.
+		* @return None.
+        */
+		void DoInitDataProvidersL();
+
+		/**
+		* Read all tasks from profile into task list.
+		* @return None.
+        */
+		void InitAllTasksL();
+
+		/**
+		* Read one task from profile into task list.
+		* @return None.
+        */
+		void InitTaskL(TInt aTaskId);
+		
+		/**
+		* Remove task that uses dataprovider aDataProviderId.
+		* @param aDataProviderId.
+		* @return None.
+        */
+		void RemoveTask(TInt aDataProviderId);
+		
+		/**
+		* Remove all tasks from task list.
+		* @param None.
+		* @return None.
+        */
+		void RemoveAllTasks();
+
+		/**
+		* Remove data provider with id aDataProviderId.
+		* @param aDataProviderId.
+		* @return None.
+        */
+		void RemoveDataProvider(TInt aDataProviderId);
+
+		/**
+		* Read one task item from profile.
+        * @param aProfile.
+        * @param aTaskId.
+		* @return Task item.
+        */
+		static TAspTaskItem ReadTaskItemL(RSyncMLDataSyncProfile& aProfile, TInt aTaskId);
+		
+		
+		TInt CreateTaskL(TAspProviderItem& aDataProvider);
+        void CreateTaskL(TInt aDataProviderId, const TDesC& aLocalDatabase,
+                         const TDesC& aRemoteDatabase, TBool aEnabled, TInt aSyncDirection);
+        void CreateTask(TInt aDataProviderId, const TDesC& aLocalDatabase,
+                         const TDesC& aRemoteDatabase, TBool aEnabled, TInt aSyncDirection);
+
+
+        void ReadTaskL(TInt aDataProviderId, TDes& aLocalDatabase, TDes& aRemoteDatabase, TBool& aEnable, TInt& aSyncDirection);
+
+ 
+		void IncludeTaskL(TAspProviderItem& aDataProvider);
+		void IncludeTasks(const CArrayFix<TInt>* aIncludedProviderList);
+		
+		void ModifyTaskIncludedL(TInt aDataProviderId, TBool aIsIncluded, const TDesC& aLocalDatabase);
+		void ModifyTaskIncludedL(TAspProviderItem& aProvider, TBool aIsIncluded, const TDesC& aLocalDatabase);
+		void ModifyTaskDirectionL(TAspProviderItem& aProvider, TInt aDirection);
+		void ModifyTaskDirectionsL(TInt aSyncDirection);
+		TBool CheckTaskDirectionsL();
+		
+		void SetIncludedProviders(const CArrayFix<TInt>* aIncludedProviderList);
+		void GetIncludedProviders(CArrayFix<TInt>* aIncludedProviderList);
+		
+
+		
+		void GetLocalDatabaseList(TInt aDataProviderId, CDesCArray* aList);
+		void GetLocalDatabaseListL(TInt aDataProviderId, CDesCArray* aList);
+		void UpdateLocalDatabaseL();
+		TInt SyncDirection();
+		TSmlSyncType SmlSyncDirection();
+		TBool TaskEnabled(TInt aDataProviderId);
+    	void Sort();
+    	void UpdateDataProviderL(TInt aDataProviderId);
+    	void ReadDataProviderItemL(RSyncMLDataProvider& aProvider, TAspProviderItem& aItem);
+
+
+    	void CreateCalLocalDatabaseL(TDes& aCalName);
+    	void RetrieveCalLocalDatabaseL(TDes& aCalName);
+    	TBool IsCalNameAvailableL(CCalSession& aSession ,TDes& aCalName);
+    	TBool IsValidClientDataSourceL( TDes& aCalName );
+    	
+		
+    private:
+    
+		/**
+		* Utility function.
+		* @return Sync session.
+        */
+		RSyncMLSession& Session();
+
+		/**
+		* Returns sync profile.
+		* @param None.
+		* @return Sync profile.
+        */
+		RSyncMLDataSyncProfile* Profile();
+		
+		
+#ifdef _DEBUG
+    public:
+        void LogL(const TDesC& aText);
+    private:
+    
+        void LogTasksL();
+        void LogDataProvidersL();
+        void GetTaskLogText(TDes& aText, TAspTaskItem& aTask);
+        void GetDataProviderIdText(TDes& aText, TInt aId);
+#endif
+		
+
+
+    private:
+		// id of the calling application
+		TInt iApplicationId;
+    
+		// sync session
+		RSyncMLSession* iSyncSession;
+		
+		// sync profile
+		CAspProfile* iProfile;
+
+		// sync list type
+		TInt iListMode;
+        
+		// data provider list
+		RArray<TAspTaskItem> iTaskList;
+
+		// data provider id list
+		RArray<TAspProviderItem> iProviderList;
+    };
+
+
+
+/**
+* CAspProfileList 
+*
+* CAspProfileList is a list of sync profiles,
+*/
+NONSHARABLE_CLASS (CAspProfileList) : public CBase
+    {
+    public:
+
+	enum TListMode
+		{
+	    EBasePropertiesOnly,
+	    ENoMandatoryCheck,
+	    EMandatoryCheck,
+	    EMandatoryCheckEx,
+	    EEMailRetrieve,
+	    EEMailSync,
+		};
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CAspProfileList* NewLC(const TAspParam& aParam);
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspProfileList* NewL(const TAspParam& aParam);
+
+	    /**
+        * Destructor.
+        */
+        virtual ~CAspProfileList();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+	    CAspProfileList(const TAspParam& aParam);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+
+	public:
+		/**
+		* Returns profile count.
+        * @param None.
+        * @return Profile count.
+        */
+		TInt Count();
+
+		/**
+		* Returns profile count.
+        * @param aApplicationId.
+        * @return Profile count.
+        */
+		TInt Count(TInt aApplicationId);
+
+		/**
+		* Returns profile from list.
+        * @param aIndex List index.
+		* @return Profile.
+        */
+		TAspProfileItem& Item(TInt aIndex);
+
+		/**
+		* Finds profile with name aProfileName.
+		* @param aProfileName Profile name.
+		* @return Profile index or KErrNotFound.
+        */
+		TInt FindProfileIndex(const TDesC& aProfileName);
+		
+		/**
+		* Gets the Default Profile ID from the Cenrep
+		* @param aValue ProfileID read from the Cenrep
+     */
+		void GetDefaultProfileIdL(TInt& aValue);
+		
+		/**
+		* Finds last synced profile index.
+		* @param aProfileName Profile name.
+		* @return Profile index or KErrNotFound.
+        */
+		TInt FindLastSyncedProfileIndexL();
+		
+		/**
+		* Read one profile from database.
+		* @param aProfile.
+		* @param aItem.
+		* @return None.
+        */
+        void ReadProfileItemL(CAspProfile* aProfile, TAspProfileItem& aItem);
+
+		/**
+		* Reads all profiles from database.
+		* @param aListMode.
+		* @return None.
+        */
+		void ReadAllProfilesL(TInt aListMode);
+		
+		/**
+		* Reads all profiles that contain EMail task that uses aLocalDatabase.
+		* @param aLocalDatabase.
+		* @param aListMode.
+		* @return None.
+        */
+		void ReadEMailProfilesL(const TDesC& aLocalDatabase,  TInt aListMode);
+
+		/**
+		* Reads one profile from database.
+		* @param aProfileId.
+		* @return None.
+        */
+		void ReadProfileL(TInt aProfileId);
+
+		/**
+		* Sorts profile list.
+		* @param None.
+		* @return None.
+        */
+    	void Sort();
+
+		/**
+		* Removes profile from profile list.
+		* @param aProfileId.
+		* @return None.
+        */
+		void Remove(TInt aProfileId);
+		
+		/**
+		* Adds profile into profile list.
+		* @param aProfileItem.
+		* @return None.
+        */
+		void AddL(TAspProfileItem& aProfileItem);
+		
+		/**
+		* Constructs filtered profile list.
+		* @param aFilterInfo.
+		* @return Profile list.
+        */
+		CAspProfileList* FilteredListL(TAspFilterInfo& aFilterInfo);
+
+		/**
+		* Replaces profile item.
+		* @param aProfileItem.
+		* @return None.
+        */
+		void ReplaceProfileItemL(TAspProfileItem& aProfileItem);
+
+		/**
+		* Returns profile's list position.
+		* @param aProfileId.
+		* @return List index.
+        */
+		TInt ListIndex(TInt aProfileId);
+		
+		/**
+		* Returns sync session.
+		* @param None.
+		* @return Sync session.
+        */
+		RSyncMLSession& Session();
+		
+		/**
+		* Returns number of profiles that can be deleted.
+		* @param None.
+		* @return Profile count.
+        */
+		TInt DeletableProfileCount();
+		
+		TBool IsAutoSyncProfile(CAspProfile* aProfile);
+		
+	public:
+                             
+		/**
+		* Checks if aServerId is unique in setting databse.
+		* @param aServerId.
+		* @param aProfileId.
+		* @return Return code.
+        */
+        TBool IsUniqueServerId(const TDesC& aServerId, TInt aProfileId);                             
+
+		
+
+	private:
+   		// sync session
+		RSyncMLSession* iSyncSession;
+        
+		// list of profiles
+		RArray<TAspProfileItem> iList;
+
+		// needed for filtering unwanted profiles
+		TInt iApplicationId;
+		
+		// long buffer for string handling 
+		TBuf<KBufSize255> iBuf;
+    };
+
+
+
+/**
+* CAspProfile 
+*
+* CAspProfile is used for getting/setting sync profile settings.
+*/
+NONSHARABLE_CLASS (CAspProfile) : public CBase
+    {
+    
+    public:
+	enum TOpenMode
+		{
+	    EOpenReadWrite,
+	    EOpenRead,
+	    EBaseProperties,
+	    EAllProperties
+		};
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CAspProfile* NewLC(const TAspParam& aParam);
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspProfile* NewL(const TAspParam& aParam);
+
+	    /**
+        * Destructor.
+        */
+        virtual ~CAspProfile();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+	    CAspProfile(const TAspParam& aParam);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+	    
+    public:
+		/**
+		* Open profile.
+		* @param aProfileId.
+		* @param aReadWrite.
+		* @param aOpenMode.
+		* @return None.
+        */
+        void OpenL(TInt aProfileId, TInt aReadWrite, TInt aOpenMode);
+        
+		/**
+		* Create profile.
+		* @param aOpenMode.
+		* @return None.
+        */
+        void CreateL(TInt aOpenMode);
+
+		/**
+		* Create copy profile.
+		* @param aProfileId.
+		* @return None.
+        */
+        void CreateCopyL(TInt aProfileId);
+        
+		/**
+		* Save profile.
+		* @param None.
+		* @return None.
+        */
+        void SaveL();
+        
+		/**
+		* Save profile.
+		* @param None.
+		* @return None.
+        */
+        void Save();
+
+	public:
+		/**
+		* Set profile name.
+		* @param aText.
+		* @return None.
+        */
+        void SetNameL(const TDesC& aText);
+
+		/**
+		* Get profile name.
+		* @param aText.
+		* @return None.
+        */
+        void GetName(TDes& aText);
+
+		/**
+		* Get profile name.
+		* @param None.
+		* @return Profile name.
+        */
+        HBufC* NameL();
+        
+		/**
+		* Set creator id.
+		* @param aCreatorId.
+		* @return None.
+        */
+        void SetCreatorId(TInt aCreatorId);
+        
+		/**
+		* Get creator id.
+		* @param None.
+		* @return Creator id.
+        */
+        TInt CreatorId();
+        
+		/**
+		* Get profile id.
+		* @param None.
+		* @return Profile id.
+        */
+        TInt ProfileId();
+        
+		/**
+		* Can profile be deleted.
+		* @param None.
+		* @return Boolean.
+        */
+        TBool DeleteAllowed();
+
+		/**
+		* Has profile been synced.
+		* @param None.
+		* @return Boolean.
+        */
+		TBool IsSynced();
+
+		/**
+		* Last sync time.
+		* @param None.
+		* @return Sync time.
+        */
+		TTime LastSync();
+    
+		/**
+		* Last sync time.
+		* @param aTaskId.
+		* @return Sync time.
+        */
+		TTime LastSync(TInt aTaskId);
+
+    
+    // settings that connection dialog displays
+    public:
+		/**
+		* Set server id.
+		* @param aText.
+		* @return None.
+        */
+        void SetServerIdL(const TDesC& aText);
+
+		/**
+		* Get server id.
+		* @param aText.
+		* @return None.
+        */
+        void GetServerId(TDes& aText);
+
+		/**
+		* Get protocol version.
+		* @param None.
+		* @return aProtocolVersion.
+        */
+        TInt ProtocolVersion();
+
+		/**
+		* Set protocol version.
+		* @param aProtocolVersion.
+		* @return None.
+        */
+        void SetProtocolVersionL(TInt aProtocolVersion);
+
+		/**
+		* Get bearer type.
+		* @param None.
+		* @return Bearer type.
+        */
+        TInt BearerType();
+        
+		/**
+		* Set bearer type.
+		* @param aId.
+		* @return None.
+        */
+        void SetBearerTypeL(TInt aId);
+
+		/**
+		* Get access point.
+		* @param None.
+		* @return Access point.
+        */
+        TInt AccessPointL();
+        
+		/**
+		* Set access point.
+		* @param aId.
+		* @return None.
+        */
+        void SetAccessPointL(const TInt aId);
+
+		/**
+		* Get host address.
+		* @param aText.
+		* @param aPort.		
+		* @return None.
+        */
+        void GetHostAddress(TDes& aText, TInt& aPort);
+
+		/**
+		* Set host address.
+		* @param aText.
+		* @param aPort.		
+		* @return None.
+        */
+        void SetHostAddressL(const TDesC& aText, const TInt aPort);
+         
+		/**
+		* Get user name.
+		* @param aText.
+		* @return None.
+        */
+        void GetUserName(TDes& aText);
+
+		/**
+		* Set user name.
+		* @param aText.
+		* @return None.
+        */
+        void SetUserNameL(const TDesC& aText);
+        
+		/**
+		* Get password.
+		* @param aText.
+		* @return None.
+        */
+        void GetPassword(TDes& aText);
+
+		/**
+		* Set password.
+		* @param aText.
+		* @return None.
+        */
+        void SetPasswordL(const TDesC& aText);
+        
+		/**
+		* Set server alert sync state.
+		* @param aState.
+		* @return None.
+        */
+        void SetSASyncStateL(TInt aState);
+
+		/**
+		* Get server alert sync state.
+		* @param None.
+		* @return Server alert sync state.
+        */
+        TInt SASyncState();
+
+		/**
+		* Set http authentication state.
+		* @param aEnable.
+		* @return None.
+        */
+        void SetHttpUsedL(TBool aEnable);
+
+		/**
+		* Get http authentication state.
+		* @param aEnable.
+		* @return Boolean.
+        */
+        TBool HttpUsedL();
+         
+		/**
+		* Get http user name.
+		* @param aText.
+		* @return None.
+        */
+        void GetHttpUserNameL(TDes& aText);
+
+		/**
+		* Set http user name.
+		* @param aText.
+		* @return None.
+        */
+        void SetHttpUserNameL(const TDesC& aText);
+ 
+		/**
+		* Get http password.
+		* @param aText.
+		* @return None.
+        */
+        void GetHttpPasswordL(TDes& aText);
+        
+		/**
+		* Set http password.
+		* @param aText.
+		* @return None.
+        */
+        void SetHttpPasswordL(const TDesC& aText);
+ 
+               
+    public:
+  		/**
+		* Open history log.
+		* @param None.
+		* @return None.
+        */
+        void OpenHistoryLog();
+        
+  		/**
+		* Open connection.
+		* @param None.
+		* @return None.
+        */
+        void OpenConnection();
+
+  		/**
+		* Get RSyncMLDataSyncProfile.
+		* @param None.
+		* @return RSyncMLDataSyncProfile.
+        */
+        RSyncMLDataSyncProfile& Profile();
+        
+  		/**
+		* Get RSyncMLSession.
+		* @param None.
+		* @return RSyncMLSession.
+        */
+        RSyncMLSession& Session();
+        
+  		/**
+		* Get application id.
+		* @param None.
+		* @return Application id.
+        */
+        TInt ApplicationId();
+        
+    public:
+  		/**
+		* Get connection property name.
+		* @param aText.
+		* @param aPropertyPos.
+		* @return None.
+        */
+        void GetConnectionPropertyNameL(TDes8& aText, TInt aPropertyPos);
+
+  		/**
+		* Get sync type.
+		* @param aSyncTask.
+		* @return Sync type.
+        */
+        static TInt SyncType(RSyncMLTask& aSyncTask);
+
+  		/**
+		* Set default bearer.
+		* @param None.
+		* @return None.
+        */
+        void SetDefaultBearerL();
+        
+  		/**
+		* Get latest history job.
+		* @param None.
+		* @return History job.
+        */
+        const CSyncMLHistoryJob* LatestHistoryJob();
+        
+  		/**
+		* Get latest history job.
+		* @param aTaskId.
+		* @return History job.
+        */
+        const CSyncMLHistoryJob* LatestHistoryJob(TInt aTaskId);
+
+ 		/**
+		* Find out whether history job contains a task.
+		* @param aHistoryJob.
+		* @return Boolean.
+        */
+        TBool TaskExist(const CSyncMLHistoryJob* aHistoryJob, TInt aTaskId);
+        
+  		/**
+		* Copy values from another profile.
+		* @param aSource.
+		* @return None.
+        */
+        void CopyValuesL(CAspProfile* aSource);
+        
+  		/**
+		* Get default transport id.
+		* @param None.
+		* @return Transport id.
+        */
+        TInt DefaultTransportIdL();
+        
+  		/**
+		* Delete all connections.
+		* @param aId.
+		* @return None.
+        */
+        //void DeleteConnectionsL();
+        
+    public:
+  		/**
+		* Get new profile name.
+		* @param aList.
+		* @param aApplicationId.
+		* @return Profile name.
+        */
+        static HBufC* GetNewProfileNameLC(CAspProfileList* aList, TInt aApplicationId);
+        
+  		/**
+		* Set default values.
+		* @param aProfile.
+		* @return None.
+        */
+        static void SetDefaultValuesL(CAspProfile* aProfile);
+        
+  		/**
+		* Is other sync running.
+		* @param aSyncSession.
+		* @return Boolean.
+        */
+        static TBool OtherSyncRunning(RSyncMLSession* aSyncSession);
+
+  		/**
+		* Get current sync job.
+		* @param aSyncSession.
+		* @return Sync job.
+        */
+        static TInt CurrentJob(RSyncMLSession* aSyncSession);
+        
+  		/**
+		* Is this profile PCSuite profile.
+		* @param aProfile.
+		* @return Boolean.
+        */
+        static TBool IsPCSuiteProfile(CAspProfile* aProfile);
+        
+        /**
+        * Is this profile Operator specific profile.
+        * @param aProfile.
+        * @return Boolean.
+        */
+        static TBool IsOperatorProfileL(CAspProfile* aProfile);
+        
+        /**
+        * Get Operator adapter Uid.
+        * @return Operator adapter Uid .
+        */
+        static TInt OperatorAdapterUidL();  
+        
+        /**
+        * Get Profile adapter Uid.
+        * @return Profile adapter Uid .
+        */
+        static TInt ProfileAdapterUidL();
+
+        /**
+        * Get Operator profile visibility setting. 
+        * @return Visibility setting value.
+        */
+        static TInt ProfileVisibilityL();
+
+        
+        /**
+        * Is this profile read-only operator specific profile.
+        * @return Boolean.
+        */
+        TBool IsReadOnlyOperatorProfileL();
+        
+        /**
+        * Is this profile hidden operator specific profile.
+        * @return Boolean.
+        */
+        TBool IsHiddenOperatorProfileL();
+
+        /**
+         * Does the given serverID equal with the operator specific
+         * serverID value (defined in central repository).
+         * @param aServerId to be compared
+         * @return Boolean
+         */
+        static TBool EqualsToOperatorServerId( const TDesC& aServerId );
+
+    public:
+  		/**
+		* Check mandatory task data.
+		* @param aProfile.
+		* @param aContentCount.
+		* @return Mandatory data status code.
+        */
+        static TInt CheckMandatoryTaskDataL(CAspProfile* aProfile, TInt& aContentCount);
+ 
+  		/**
+		* Check mandatory task data.
+		* @param aProfile.
+		* @param aContentCount.
+		* @return Mandatory data status code.
+        */
+        static TInt CheckMandatoryTaskData(CAspProfile* aProfile, TInt& aContentCount);
+        
+ 		/**
+		* Check mandatory data.
+		* @param aProfile.
+		* @param aContentCount.
+		* @return Mandatory data status code.
+        */
+        static TInt CheckMandatoryData(CAspProfile* aProfile, TInt& aContentCount);
+ 
+  		/**
+		* Check mandatory connection data.
+		* @param aProfile.
+		* @return Mandatory data status code.
+        */
+        static TInt CheckMandatoryConnData(CAspProfile* aProfile);
+    
+    	/**
+		* Delete sync history for a profile
+		* @param None
+		* @return None
+        */
+ 		void DeleteHistory();
+ 	public:
+	    // -----------------------------------------------------------------------------
+		// CAspProfile::GetLocalisedPCSuite
+		//
+		// Returns "PC Suite" string localised to specific language
+		// 
+		// Current requirement is to localise to 2 languages TaiwanChinese and ELangHongKongChinese
+		// For all the rest it will be mapped to "PC suite" only
+		// -----------------------------------------------------------------------------
+		//
+	    void GetLocalisedPCSuite(TDes& aText);
+       
+    //public:
+        //HBufC* HistoryJobsLC();
+
+	private:
+        // historylog open state
+        TBool iHistoryLogOpen;
+        
+        // connection open state
+        TBool iConnectionOpen;
+          
+   		// needed for setting creator id
+		TInt iApplicationId;
+		
+		// long buffer for string handling 
+		TBuf<KBufSize255> iBuf;
+		
+		// long buffer for string handling 
+		TBuf8<KBufSize255> iBuf8;
+
+   		// sync session
+		RSyncMLSession* iSyncSession;
+		
+		// sync profile
+		RSyncMLDataSyncProfile iProfile;
+		
+		// history log
+		RSyncMLHistoryLog iHistoryLog;
+				
+		// sync connection
+		RSyncMLConnection iConnection;
+    };
+
+
+/**
+* CAspTask
+*
+* TAspTask is used for sync task operations.
+*/
+NONSHARABLE_CLASS (TAspTask) : public CBase
+    {
+    public:
+		static TInt SyncDirection(TSmlSyncType aSmlSyncDirection);
+		static TSmlSyncType SmlSyncDirection(TInt aSyncDirection);
+        static TInt FindTaskIdL(CAspProfile* aProfile, TInt aDataProviderId, const TDesC& aLocalDatabase);
+        static TBool CheckLocalDatabaseL(CAspProfile* aProfile, TInt& aDataProviderId);
+        static TBool CheckLocalDatabase(CAspProfile* aProfile, TInt& aDataProviderId);
+    };
+
+
+
+
+
+
+
+#endif  // ASPPROFILE_H
+
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspProfileDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,493 @@
+/*
+* 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: Dialog to edit profile setting 
+*
+*/
+
+
+
+#ifndef ASPPROFILEDIALOG_H
+#define ASPPROFILEDIALOG_H
+
+
+//  INCLUDES
+
+#include "AspDialogUtil.h"
+
+#include <e32base.h>
+#include <aknlists.h>
+#include <AknDialog.h>
+
+
+
+
+
+// CLASS DECLARATION
+
+
+/**
+*  CAspProfileDialog
+*
+* CAspProfileDialog is used for editing sync connection data.
+*/
+NONSHARABLE_CLASS (CAspProfileDialog) : public CAknDialog, public MEikListBoxObserver
+    {
+    public:
+    
+    
+	public:
+	    /**
+        * Launches dialog.
+        * @param aParam Class that contains dialog parameters.
+        * @return Completion code.
+        */
+		static TBool ShowDialogL(const TAspParam& aParam);
+
+	public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+		static CAspProfileDialog* NewL(const TAspParam& aParam);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspProfileDialog();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAspProfileDialog(const TAspParam& aParam);
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	private:
+        /**
+        * From MEikListBoxObserver, called by framework.
+        * @param aListBox.
+        * @param aEventType.
+		* @return None
+        */
+		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+        /**
+        * From the base class.
+		* Called by framework before the dialog is shown.
+        * @param None
+		* @return None
+        */
+        void PreLayoutDynInitL();
+
+        /**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param aButtonId Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+        TBool OkToExitL(TInt aButtonId);
+
+        /**
+        * From the base class.
+		* Called by framework for key event handling.
+        * @param aKeyEvent.
+		* @param aType.
+		* @return Return code.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+
+        /**
+        * From the base class.
+		* Called by framework when dialog is activated.
+        * @param None.
+		* @return None.
+        */
+		void ActivateL();
+		
+		/**
+		* Method to get context sensitive help topic.
+        * @param aContext Help topic to open.
+		* @return None.
+        */
+		void GetHelpContext(TCoeHelpContext& aContext) const;
+
+		/**
+        * From the base class.
+		* Called by framework before menu is shown.
+        * @param aResourceId Menu resource id.
+		* @param aMenuPane Pointer to the menu.
+        * @return None.
+        */
+		void DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane);
+
+		/**
+		* From the base class.
+		* Handles menu events.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		void ProcessCommandL(TInt aCommandId);
+		
+		/**
+		* From base class.
+		* Called when UI layout changes. 
+		* @param aType.
+    	* @return None.
+		*/
+        void HandleResourceChange(TInt aType);
+
+    private:
+		/**
+		* Handles setting item editing.
+		* @param None.
+		* @return None.
+		*/
+		void HandleOKL();
+		
+		/**
+		* Set setting list icons.
+		* @param None.
+		* @return None.
+		*/
+		void SetIconsL();
+
+	
+	public:  // common editors
+	
+		/**
+		* Shows editor for text type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemTextL(CAspListItemData& aItem);
+		
+		/**
+		* Shows editor for number type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		static TBool EditSettingItemNumberL(CAspListItemData& aItem);
+		
+		/**
+		* Shows editor for secret type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		static TBool EditSettingItemSecretL(CAspListItemData& aItem);
+		
+		/**
+		* Shows editor for list type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		static TBool EditSettingItemListL(CAspListItemData& aItem);
+ 		/**
+		* Checks whether MSK label and menu command are correct for the context
+		* @param aKeyEvent
+		* @return None.
+		*/
+ 		void CheckContentSettingL(const TKeyEvent& aKeyEvent);
+ 		/**
+		* Checks whether MSK label and menu command are correct for the context 
+		* @param None
+		* @return None.
+		*/
+ 		void CheckContentSettingL();
+        /**
+		* Utility function, updates dialog cba.
+		* @param aResourceId.
+		* @return None.
+		*/
+		void UpdateCbaL(TInt aResourceId);
+		
+		/**
+		* Utility function, updates menu bar.
+		* @param aResource.
+		* @return None.
+		*/
+		
+		void UpdateMenuL(TInt aResource);
+    
+    private:
+    
+		/**
+		* Handles setting item editing.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemL(CAspListItemData& aItem);
+
+		/**
+		* Change Yes/No setting in place without showing editor.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemYesNoL(CAspListItemData& aItem);
+		
+		/**
+		* Shows editor for bearer type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemBearerListL(CAspListItemData& aItem);
+		
+		/**
+		* Shows editor for protocol version setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemProtocolListL(CAspListItemData& aItem);
+
+		/**
+		* Shows editor for text type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemHostAddressL(CAspListItemData& aItem);
+
+		/**
+		* Shows dialog for access point selection.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemAccessPointL(CAspListItemData& aItem);
+		
+    	/**
+		* Opens content dialog.
+		* @param None.
+		* @return Return code.
+		*/
+		TInt EditSettingItemSyncContentL(CAspListItemData& aItem);
+		
+		/**
+		* Set the MSK empty.
+		* @param None.
+		* @return None.
+		*/
+		void SetEmptyMiddleSoftKeyLabelL();
+
+    private:
+
+		/**
+		* Checks that all mandatory data is found.
+		* @param None.
+		* @return Return code.
+		*/
+		TInt CheckMandatoryFields();
+		
+		/**
+		* Checks that all mandatory data is found.
+		* @param aListItem.
+		* @return Return code.
+		*/
+		TBool CheckMandatoryContentFields(CAspListItemData* aListItem);
+		
+		/**
+		* Checks that server id is unique.
+		* @param None.
+		* @return Return code.
+		*/
+		TInt CheckUniqueServerId();
+
+		/**
+		* Saves profile.
+		* @param None.
+		* @return Return code.
+		*/
+		void SaveSettingsL();
+        
+        /**
+		* Check setting values before dialog close.
+        * @param aButtonId Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+        TBool CheckSettingValuesL(TInt aButtonId);
+
+        /**
+		* Check setting values before dialog close.
+        * @param aButtonId Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+        TBool CheckSettingValues(TInt aButtonId);
+
+		/**
+		* Check if the profile is selected for auto sync ,and if selected check for mandatory settings
+      		* @return None
+        */
+		void CheckAutoSyncSetttigsL();
+
+	private:
+		/**
+        * Create one CNSmlDSProfileData for each setting.
+        * @param None.
+        * @return None.
+        */
+		void CreateSettingsListL();
+		
+		/**
+        * Initalizes setting item needed for listbox handling.
+        * @param aItem.
+        * @return None.
+        */
+		void InitSettingItemL(CAspListItemData* aItem);
+		
+		/**
+        * Add settings titles into listbox.
+        * @param aListBox.
+        * @param aItemList List of setting items.
+        * @return None.
+        */
+		void UpdateListBoxL(CEikTextListBox* aListBox, CAspSettingList* aItemList);
+
+		/**
+        * Adds one setting item into item list.
+        * @param aItemId Item id.
+        * @param aHeaders Array of item headers.
+		* @return None.
+        */
+		void AddItemL(TInt aItemId, CDesCArray* aHeaders);
+
+		/**
+        * Adds one setting item into item list.
+        * @param aItemId Item id.
+        * @param aResourceId.
+		* @return None.
+        */
+		void AddItemL(TInt aItemId, TInt aResourceId);
+
+		/**
+        * Set setting item visibility (normal/readonly/hidden).
+        * @param None.
+		* @return None.
+        */
+		void SetVisibilityL();
+		
+        /**
+        * Set all settings to read-only state.
+        * @param None.
+		* @return None.
+        */
+		void SetAllReadOnly();
+		
+		
+		/**
+        * Adds sync contents into item list.
+        * @param None.
+		* @return None.
+        */
+		void AddContentItemsL();
+
+    private:
+
+		/**
+        * Creates icon.
+		* @param aId.
+        * @param aFileName.
+		* @param aFileIndex.
+		* @param aFileMaskIndex.
+        * @return Created icon.
+        */
+		CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex);
+		
+		/**
+		* Returns setting item with listbox position aIndex.
+		* @param aIndex Listbox index.
+		* @return Pointer to setting item.
+        */
+		CAspListItemData* GetItemForIndex(TInt aIndex);
+
+		/**
+        * Returns setting item with id aItemId.
+        * @param aItemId Item id.
+        * @return Pointer to setting item.
+        */
+		CAspListItemData* Item(TInt aItemId);
+
+		/**
+		* Returns listbox.
+		* @param None.
+		* @return Pointer to listbox.
+		*/
+		CAknSettingStyleListBox* ListBox();
+
+		/**
+		* Returns profile.
+		* @param None.
+		* @return Pointer to sync profile.
+		*/
+		//CAspProfile* Profile();
+		
+
+	private:
+		// setting list
+		CAknSettingStyleListBox* iSettingListBox;
+
+		// list of setting items
+		CAspSettingList *iSettingList;
+		
+   		// list that contains all contents (applications)
+		//CAspContentList* iContentList;
+
+		// profile data
+		CAspProfile* iProfile;
+
+   		// sync session
+		RSyncMLSession* iSyncSession;
+
+		// for title and icon handling
+		CStatusPaneHandler* iStatusPaneHandler;
+
+		// resource handler
+		CAspResHandler* iResHandler;
+
+		// dialog edit mode
+		TInt iEditMode;
+
+		// for bearer type list construction
+		CAspBearerHandler* iBearerHandler;
+		
+		// for access point selection
+		CAspAccessPointHandler* iApHandler;
+		
+		// long buffer for string handling
+		TBuf<KBufSize255> iBuf;
+		
+		// list that contains all contents (applications)
+		CAspContentList* iContentList;
+		
+		// list that contains all profiles
+		CAspProfileList* iProfileList;
+
+		// id of the calling application
+		TInt iApplicationId;
+		
+		// is setting database in read only state
+		TBool iSettingEnforcement;
+		// profile's server id
+		TBuf<KAspMaxServerIdLength> iOldServerId;
+    	// id of current cba resource
+		TInt iCommandSetId;
+		// is  MSK empty
+		TBool iMSKEmpty;
+    };
+
+
+#endif      // ASPPROFILEDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspProfileSelectionDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -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: Dialog to select profile to be used for scheduled sync 
+*
+*/
+
+
+
+#ifndef ASPPROFILESELECTIONDIALOG_H
+#define ASPPROFILESELECTIONDIALOG_H
+
+
+//  INCLUDES
+
+#include "AspDialogUtil.h"
+
+#include <e32base.h>
+#include <aknlists.h>
+#include <AknDialog.h>
+#include <aknselectionlist.h>
+
+// FORWARD DECLARATIONS
+
+
+
+// CLASS DECLARATION
+
+
+/**
+*  CAspProfileSelectionDialog
+*
+* CAspProfileSelectionDialog is used for selecting auto sync profile.
+*/
+NONSHARABLE_CLASS (CAspProfileSelectionDialog) : public CAknDialog, public MEikListBoxObserver
+    {
+    
+	public:
+	    /**
+        * Launches dialog.
+        * @param aParam Class that contains dialog parameters.
+        * @return Completion code.
+        */
+		static TBool ShowDialogL(TAspParam& aParam);
+
+	public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+		static CAspProfileSelectionDialog* NewL(TAspParam& aParam);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspProfileSelectionDialog();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAspProfileSelectionDialog(TAspParam& aParam);
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	private:
+        /**
+        * From MEikListBoxObserver, called by framework.
+        * @param aListBox.
+        * @param aEventType.
+		* @return None
+        */
+		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+        /**
+        * From the base class.
+		* Called by framework before the dialog is shown.
+        * @param None
+		* @return None
+        */
+        void PreLayoutDynInitL();
+
+        /**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param aButtonId Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+        TBool OkToExitL(TInt aButtonId);
+
+        /**
+        * From the base class.
+		* Called by framework for key event handling.
+        * @param aKeyEvent.
+		* @param aType.
+		* @return Return code.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+
+        /**
+        * From the base class.
+		* Called by framework when dialog is activated.
+        * @param None.
+		* @return None.
+        */
+		void ActivateL();
+		
+		/**
+		* Method to get context sensitive help topic.
+        * @param aContext Help topic to open.
+		* @return None.
+        */
+		void GetHelpContext(TCoeHelpContext& aContext) const;
+
+		/**
+        * From the base class.
+		* Called by framework before menu is shown.
+        * @param aResourceId Menu resource id.
+		* @param aMenuPane Pointer to the menu.
+        * @return None.
+        */
+		void DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane);
+
+		/**
+		* From the base class.
+		* Handles menu events.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		void ProcessCommandL(TInt aCommandId);
+		
+		/**
+		* From base class.
+		* Called when UI layout changes. 
+		* @param aType.
+    	* @return None.
+		*/
+        void HandleResourceChange(TInt aType);
+
+    private:
+		/**
+		* Handles setting item editing.
+		* @param None.
+		* @return None.
+		*/
+		void HandleOKL();
+		
+		/**
+		* Set setting list icons.
+		* @param None.
+		* @return None.
+		*/
+		void SetIconsL();
+		
+		/**
+		* Shown sync profile content list.
+		* @param None.
+		* @return None.
+		*/
+		void ShowContentListL();
+
+
+    private:
+		
+		/**
+        * Add settings titles into listbox.
+        * @param None.
+        * @return None.
+        */
+		void UpdateListBoxL();
+		
+		/**
+		* Utility function, updates dialog cba.
+		* @param None.
+		* @return None.
+		*/
+		void UpdateCbaL();
+		
+
+    private:
+
+		/**
+        * Creates icon.
+		* @param aId.
+        * @param aFileName.
+		* @param aFileIndex.
+		* @param aFileMaskIndex.
+        * @return Created icon.
+        */
+		CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex);
+		
+
+
+	private:
+		// dialog parameter for returning value to caller
+		TAspParam* iDialogParam;
+
+  		// id of the calling application
+		TInt iApplicationId;
+		
+		// currently selected profile
+		TInt iProfileId;
+
+		// setting list
+		CAknSingleGraphicStyleListBox* iListBox;
+
+   		// sync session
+		RSyncMLSession* iSyncSession;
+
+		// for title and icon handling
+		CStatusPaneHandler* iStatusPaneHandler;
+
+		// long buffer for string handling
+		TBuf<KBufSize255> iBuf;
+		
+		// list that contains all profiles
+		CAspProfileList* iProfileList;
+		
+		// list that contains all contents (applications)
+		CAspContentList* iContentList;
+		
+		// id of current cba resource
+		TInt iCommandSetId;
+    };
+
+
+#endif      // ASPPROFILESELECTIONDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspProfileWizard.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,308 @@
+/*
+* 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: Used to save setting entered by user in profile creation wizard 
+*
+*/
+
+
+#ifndef ASPPROFILEWIZARD_H
+#define ASPPROFILEWIZARD_H
+
+
+//  INCLUDES
+#include "AspDialogUtil.h"
+
+
+// CONSTANTS
+
+
+
+
+/**
+* CAspWizardItem
+* 
+* CAspWizardItem contains one setting item data.
+*/
+NONSHARABLE_CLASS (CAspWizardItem) : public CBase
+	{
+    public:
+	enum TSettingType
+		{
+	    ETypeStart,
+	    ETypeProfileName,
+	    ETypeProtocolVersion,
+	    ETypeHostAddress,
+	    ETypeServerId,
+	    ETypeBearerType,
+	    ETypeUserName,
+		ETypePassword,
+		ETypeSyncType,
+		ETypeContentSelection,
+		ETypeSyncContent,
+		ETypeSyncContentLocalDatabase,
+		ETypeEnd
+		};
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CAspWizardItem* NewL();
+        
+        /**
+        * Destructor.
+        */
+        ~CAspWizardItem();
+        
+    private:
+        /**
+        * C++ default constructor.
+        */
+        CAspWizardItem();
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+	
+	
+	public:
+        /**
+        * Set string type value.
+        * @param aTex.
+        * @return None.
+        */
+        void SetValueL(const TDesC& aText);
+
+        /**
+        * Get string type value.
+        * @param None. 
+        * @return String type value.
+        */
+		const TDesC& Value();
+
+        /**
+        * Set content name.
+        * @param aTex.
+        * @return None.
+        */
+        void SetContentNameL(const TDesC& aText);
+
+        /**
+        * Get content name.
+        * @param None. 
+        * @return Content name.
+        */
+		const TDesC& ContentName();
+
+        /**
+        * Set header.
+        * @param aTex.
+        * @return None.
+        */
+        void SetHeaderL(const TDesC& aText);
+
+        /**
+        * Set header.
+        * @param aResourceId.
+        * @return None.
+        */
+        void SetHeaderL(TInt aResourceId);
+
+        /**
+        * Get header.
+        * @param None. 
+        * @return Content name.
+        */
+		const TDesC& Header();
+
+        /**
+        * Initalizes setting item.
+        * @param None. 
+        * @return None.
+        */
+		void InitL();
+	
+	public:
+    	// setting type
+		TInt  iSettingType;
+		
+		// identifies settings that have same setting type
+		TInt  iSettingId;
+
+    	// setting editor title resource id
+		TInt iResourceId;
+		
+    	// popup note resource id
+		TInt iPopupNoteResourceId;
+
+    	// error note resource id
+		TInt iErrorNoteResourceId;
+
+		// is this setting included in sync wizard
+		TBool iEnabled;
+
+		// max text length
+		TInt iMaxLength;
+
+		// is setting mandatory
+		TBool iMandatory;
+		
+		// are only western characters allowed
+		TInt iLatinInput;
+		
+		// integer type value
+		TInt iNumber;
+		
+    private:
+		// string type setting value
+	    HBufC* iValue;
+	
+   		// content display name
+	    HBufC* iContentName;
+
+   		// editor header
+	    HBufC* iHeader;
+    };
+
+
+
+
+/**
+* CAspProfileWizard
+*  
+* CAspProfileWizard creates new profile.
+*/
+NONSHARABLE_CLASS (CAspProfileWizard) : public CBase
+    {
+
+	public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspProfileWizard* NewL(TAspParam& aParam);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspProfileWizard();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAspProfileWizard(TAspParam& aParam);
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	private:
+	    /**
+        * Creates setting item list.
+		* @param None.
+        * @return None.
+        */
+	    void CreateSettingListL();
+
+    public:
+        void GetContentSelectionL(CSelectionItemList* aList);
+        void SetContentSelectionL(CSelectionItemList* aList);
+        void SetContentEnabled(const TDesC& aText, TBool aEnabled);
+        void SetContentEnabled(TInt aApplicationId);
+        void SetEnabled(TInt aSettingType, TBool aEnabled);
+        void SetContentLocalDatabaseEnabled(TInt aDataproviderId, TBool aEnabled);
+        void SetContentEnabled(TInt aDataproviderId, TBool aEnabled);
+        TBool ContentEnabled(TInt aDataproviderId);
+        
+        void SetContentEnabled(RArray<TInt>& aDataProviderArray);
+        void GetContentEnabled(RArray<TInt>& aDataProviderArray);
+        void GetContentName(TDes& aText);
+        TInt ContentId(const TDesC& aText);
+    
+    public:
+        CAspWizardItem* CurrentItem();
+        void CreateProfileL();
+        void DeleteProfile();
+        void MoveToNext();
+        void MoveToPrevious();
+        void MoveToStart();
+        TInt CurrentItemType();
+        TInt NumOfCurrentItem(CAspWizardItem* aItem);
+        TInt NumOfEnabledItems();
+        TInt NumOfEnabledContentItems();
+        TInt NumOfContentItems();
+        void SetStringValueL(const TDesC& aValue, TInt aSettingType, TInt aSettingId);
+        void SetStringValueL(const TDesC& aValue, TInt aSettingType);
+        void SetNumberValue(TInt& aValue, TInt aSettingType);
+        TInt CreatedProfileId(void);
+        TInt NumberValue(TInt aSettingType);
+        CDesCArray* LocalDatabaseList(const TInt aDataproviderId);
+
+        
+    private:
+        void GetStringValue(TDes& aValue, TInt aSettingType);
+        void GetStringValue(TDes& aValue, TInt aSettingType, TInt aSettingId);
+        void GetNumberValue(TInt& aValue, TInt aSettingType);
+        TInt IncreaseCurrentIndex(const TInt aIndex);
+        TInt DecreaseCurrentIndex(const TInt aIndex);
+        TBool CheckHostAddress(const TDesC& aText);
+        TInt ContentPopupNoteResourceId(TInt aDataProviderId);
+        //TInt ContentHeaderResourceId(TInt aDataProviderId);
+       
+    private:
+        //TInt ShowTextEditorL(TInt aResourceId, TDes& aText, const TDesC& aTitle, TBool aMandatory, TBool aLatinInput, TInt aMaxLength);
+        
+	private:
+   		// dialog parameter for returning value to caller
+		TAspParam* iDialogParam;
+
+		// id of the calling application
+		TInt iApplicationId;
+		
+		// id of the created profile
+		TInt iProfileId;
+	
+    	// session with sync server
+		RSyncMLSession* iSyncSession;
+	
+   		// list that contains all contents (applications)
+		CAspContentList* iContentList;
+
+        // for string handling
+		TBuf<KBufSize255> iBuf;
+		
+		// list index of current profile setting
+		TInt iCurrentItemIndex;
+		
+    private:
+	
+		// names of all available local data stores
+		CDesCArray* iLocalDataStores;
+		
+		// list of sync contents
+		RPointerArray<CAspWizardItem> iSettingList;
+	};
+
+
+
+
+
+
+#endif      // ASPPROFILEWIZARD_h
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspProfileWizardDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,565 @@
+/*
+* 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: Dialog to create to profile using wizard 
+*
+*/
+
+
+#ifndef ASPPROFILEWIZARDDIALOG_H
+#define ASPPROFILEWIZARDDIALOG_H
+
+// BackGround Context
+#include <AknsBasicBackgroundControlContext.h>
+
+//  INCLUDES
+#include <e32base.h>
+#include <akntextsettingpage.h>         // CAknIntegerSettingPage
+#include <aknpasswordsettingpage.h>     // CAknAlphaPasswordSettingPage
+#include <aknradiobuttonsettingpage.h>  // CAknRadioButtonSettingPage
+#include <AknInfoPopupNoteController.h> // CAknInfoPopupNoteController
+
+#include "AspProfileWizard.h"
+
+
+// CONSTANTS
+
+//const TInt KMsToWaitBeforePopup = 1000;
+const TInt KMsToWaitBeforePopup = 3000;
+const TInt KMsToWaitBeforeRePopup = 6000;
+const TInt KMsTimePopupInView = 60*1000;
+
+/**
+* MAspEditorPageObserver
+*
+* Observer interface function.
+*/
+NONSHARABLE_CLASS (MAspEditorPageObserver)
+	{
+    public:
+	enum TEditorEventType
+		{
+	    EKeyEvent,
+	    EContentCountEvent
+		};
+	
+	public:
+		/**
+        * Editor page call this when editor is about to close.
+        * @param aText Editor text.
+        * @return ETrue if input is ok, EFalse otherwise. 
+        */
+		virtual TBool CheckValidity(const TDesC& aText, TInt aSettingType) = 0;
+
+		/**
+        * Editor page call this to inform observer about editor event.
+        * @param aEvent.
+        * @param aValue.
+        * @return None. 
+        */
+		virtual void HandleEditorEvent(TInt aEvent, TInt aValue) = 0;
+
+		/**
+        * Editor page call this to inform observer about editor event.
+        * @param aEvent.
+        * @param aValue.
+        * @return None. 
+        */
+		virtual void GetNavipaneText(TDes& aText, TInt aContentCount) = 0;
+	};
+
+
+/**
+* TAspSettingPageParam
+*
+* This class is used as general parameter type.
+*/
+NONSHARABLE_CLASS (TAspSettingPageParam)
+	{
+	public:
+	    TInt iCommandId;
+	    TBuf<KBufSize> iPageText;
+	    MAspEditorPageObserver* iObserver;
+	    TInt iSettingType;
+	};
+
+
+/**
+* CAspTextSettingPage
+*
+* Setting page that returns command button id.
+*/
+NONSHARABLE_CLASS (CAspTextSettingPage) : public CAknTextSettingPage                                          
+	{
+    public:
+        CAspTextSettingPage(TInt aResourceID, TDes& aText, TInt aTextSettingPageFlags,
+                            TAspSettingPageParam& aParam);
+        ~CAspTextSettingPage();            
+        
+    protected: // From CCoeControl
+	    void ProcessCommandL(TInt aCommandId);
+	    TBool PostDisplayCheckL();
+	    TBool OkToExitL(TBool aAccept);
+	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+
+	private:
+	    void UpdateNaviPaneL();
+	    
+	private:
+	    TAspSettingPageParam& iParam;
+	    CAspNaviPaneHandler* iNaviPaneHandler;
+	};
+
+
+/**
+* CAspRadioButtonSettingPage
+*
+* Setting page that returns command button id.
+*/
+NONSHARABLE_CLASS (CAspRadioButtonSettingPage) : public CAknRadioButtonSettingPage ,public MEikListBoxObserver
+	{
+    public:
+        CAspRadioButtonSettingPage(TInt aResourceID, TInt& aCurrentSelectionIndex, 
+		                           const MDesCArray* aItemArray, TAspSettingPageParam& aParam);
+        ~CAspRadioButtonSettingPage();            
+        
+    protected: // From CCoeControl
+	    void ProcessCommandL(TInt aCommandId);
+	    TBool PostDisplayCheckL();
+	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+	    //from MEikListBoxObserver for Touch event Handling
+	    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+	    
+	private:
+	    void UpdateNaviPaneL();
+	    
+	private:
+	    TAspSettingPageParam& iParam;
+	    CAspNaviPaneHandler* iNaviPaneHandler;
+	    const MDesCArray* iItemArray;
+	};
+	
+
+/**
+* CAspCheckBoxSettingPage
+*
+* Setting page that returns command button id.
+*/
+NONSHARABLE_CLASS (CAspCheckBoxSettingPage) : public CAknCheckBoxSettingPage,public MEikListBoxObserver
+	{
+    public:
+        CAspCheckBoxSettingPage(TInt aResourceID, CSelectionItemList* aItemArray, TAspSettingPageParam& aParam);
+
+        ~CAspCheckBoxSettingPage();            
+        
+    protected: // From CCoeControl
+	    void ProcessCommandL(TInt aCommandId);
+   	    TBool PostDisplayCheckL();
+   	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+   	    //from MEikListBoxObserver for touch event handling
+        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+    
+	private:
+	    void UpdateNaviPaneL();
+
+	private:
+	    TAspSettingPageParam& iParam;
+   	    CAspNaviPaneHandler* iNaviPaneHandler;
+   	    TInt iSelectionCount;
+   	    CSelectionItemList* iSelectionItemList;
+	};
+
+
+/**
+* CAspAlphaPasswordSettingPage
+*
+* Setting page that returns command button id.
+*/
+NONSHARABLE_CLASS (CAspAlphaPasswordSettingPage) : public CAknAlphaPasswordSettingPage
+	{
+    public:
+        CAspAlphaPasswordSettingPage(TInt aResourceID, TDes& aNewPassword, const TDesC& aOldPassword, TAspSettingPageParam& aParam);
+
+        ~CAspAlphaPasswordSettingPage();            
+        
+    protected: // From CCoeControl
+	    void ProcessCommandL(TInt aCommandId);
+   	    TBool PostDisplayCheckL();
+   	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+	    
+	private:
+	    void UpdateNaviPaneL();
+
+	private:
+	    TAspSettingPageParam& iParam;
+	    CAspNaviPaneHandler* iNaviPaneHandler;
+	   
+	};
+
+
+// Forward Declaration 
+class CAknsBasicBackgroundControlContext;
+
+/**
+*  CAspProfileWizardDialog
+*
+* Dialog for editing profile name, data and connection.
+*/
+NONSHARABLE_CLASS (CAspProfileWizardDialog) : public CAknDialog,
+                                              public MAspActiveCallerObserver,
+                                              public MAspEditorPageObserver
+    {
+	enum TAspProfileDialogListIndex
+		{
+	    EIndexProfileName = 0,
+        EIndexProfileContent = 1,
+	    EIndexProfileConnection = 2
+		};
+
+	public:
+	    /**
+        * Launches profile dialog for editing profile name, data and connection.
+		* @param aParam Class that contains dialog parameters.
+        * @return Completion code.
+        */
+		static TBool ShowDialogL(TAspParam& aParam);
+
+    
+	public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspProfileWizardDialog* NewL(TAspParam& aParam);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspProfileWizardDialog();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAspProfileWizardDialog(TAspParam& aParam);
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+
+	private:
+        /**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+		TBool OkToExitL(TInt aButtonId);
+	   
+	   /**
+        * From the base class.
+		* Called by framework before the dialog is shown.
+        * @param None
+		* @return None
+        */
+		void PreLayoutDynInitL();
+		
+		/**
+		* From the base class.
+		* Handles menu events.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		void ProcessCommandL(TInt aCommandId);
+
+        /**
+        * From the base class.
+		* Called by framework for key event handling.
+        * @param aKeyEvent.
+		* @param TEventCode.
+		* @return Return code.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+	
+	   /**
+		* From the base class.
+        * Called when dialog is activated.
+        * @return None.
+        */
+		void ActivateL();
+		
+		/**
+		* Method to get context sensitive help topic.
+        * @param aContext Help topic to open.
+		* @return None.
+        */
+		//void GetHelpContext(TCoeHelpContext& aContext) const;
+		
+    	/**
+		* From base class.
+		* Called when UI layout changes. 
+		* @param aType.
+    	* @return None.
+		*/
+        void HandleResourceChange(TInt aType);
+        
+
+	private:   // from MAspActiveCallerObserver
+	
+		/**
+        * From MAspActiveCallerObserver
+		* Called when CAspActiveCaller completes.
+        * @param aCallId.
+        * @return None.
+        */
+		void HandleActiveCallL(TInt aCallId);
+		
+	
+	private:   // from MAspEditorPageObserver
+	
+		/**
+        * From MAspEditorPageObserver
+		* Check setting page input.
+        * @param aText.
+        * @param aSettingType.
+        * @return ETrue is input is valid, EFalse othherwise.
+        */
+		TBool CheckValidity(const TDesC& aText, TInt aSettingType);
+        
+		/**
+        * Check setting page input.
+        * @param aText.
+        * @param aSettingType.
+        * @return ETrue is input is valid, EFalse othherwise.
+        */
+		TBool CheckValidityL(const TDesC& aText, TInt aSettingType);
+		
+		/**
+        * Handle editor event.
+        * @param aEvent.
+        * @param aValue.
+        * @return None.
+        */
+		void HandleEditorEvent(TInt aEvent, TInt aValue);
+		
+		/**
+        * Get navipane text.
+        * @param aText.
+        * @param aContentCount.
+        * @return None.
+        */
+		void GetNavipaneText(TDes& aText, TInt aContentCount);
+
+        
+    private:
+   		/**
+		* Utility function, updates dialog cba.
+		* @param aResourceId.
+		* @return None.
+		*/
+		void UpdateCbaL(TInt aResourceId);
+		
+   		/**
+		* Utility function, sets text editor text.
+		* @param aResourceId.
+		* @return None.
+		*/
+		void SetTextEditorTextL(TInt aResource);
+		
+		/**
+        * For setting the background Screen
+		*/
+    	void SetBackgroundContextL();
+    	
+    	/**
+        * Update color and font
+		*/
+    	void UpdateTextColorL();
+    	
+
+    private:
+
+   		/**
+		* Edit setting item.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+        TInt EditSettingItemL(CAspWizardItem* aItem);
+
+   		/**
+		* Edit setting item.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+        TInt EditSettingItemTextL(CAspWizardItem* aItem);
+
+   		/**
+		* Edit setting item.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+        TInt EditSettingItemBearerTypeL(CAspWizardItem* aItem);
+        
+   		/**
+		* Edit setting item.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+        TInt EditSettingItemProtocolVersionL(CAspWizardItem* aItem);
+
+   		/**
+		* Edit setting item.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+        TInt EditSettingItemLocalDatabaseL(CAspWizardItem* aItem);
+
+   		/**
+		* Edit setting item.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+        TInt EditSettingItemSecretL(CAspWizardItem* aItem);
+
+   		/**
+		* Edit setting item.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+        TInt EditSettingItemProfileNameL(CAspWizardItem* aItem);
+
+   		/**
+		* Edit setting item.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+        TInt EditSettingItemHostAddressL(CAspWizardItem* aItem);
+
+   		/**
+		* Edit setting item.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+        TInt EditSettingItemContentSelectionL(CAspWizardItem* aItem);
+        
+   		/**
+		* Edit setting item.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+        TInt ShowTextEditorL(TInt aResourceId, TDes& aText, const TDesC& aTitle,
+                             TBool aMandatory, TBool aLatinInput, TInt aMaxLength, TInt aSettingType);
+
+    private:
+        
+   		/**
+		* Get navi pane text.
+		* @param aText.
+		* @param aCurrent.
+		* @param aFinal.
+		* @return Return code.
+		*/
+        void GetNaviPaneText(TDes& aText, TInt aCurrent, TInt aFinal);
+
+   		/**
+		* Get navi pane text.
+		* @param aText.
+		* @param aItem.
+		* @return Return code.
+		*/
+        void GetNaviPaneText(TDes& aText, CAspWizardItem* aItem);
+        
+		/**
+        * Set default setting values.
+        * @param None.
+        * @return None.
+        */
+		void SetDefaultValuesL();
+        
+        
+   		/**
+		* Show one proifle wizard editor.
+		* @param None.
+		* @return Return code.
+		*/
+        void RunWizardL();
+
+   		/**
+		* Show one proifle wizard editor.
+		* @param None.
+		* @return Return code.
+		*/
+        TInt RunWizard();
+        
+        void ShowPopupNoteL(TInt aResource, TInt aDelay);
+        void HidePopupNote();
+        void ShowErrorNoteL(TInt aError);
+
+       
+    private:
+        // text editor 
+        CEikRichTextEditor* iTextEditor;
+        
+   		// text editor text
+   		HBufC* iTextEditorText;
+		
+  		// handles profile setting data and profile creation
+  		CAspProfileWizard* iWizard;
+  		
+  		// dialog parameter for returning value to caller
+		TAspParam* iDialogParam;
+
+		// id of the calling application
+		TInt iApplicationId;
+
+		// sync session
+		RSyncMLSession* iSyncSession;
+
+		// long buffer for string handling
+		TBuf<KBufSize255> iBuf;
+
+		// for title and icon handling
+		CStatusPaneHandler* iStatusPaneHandler;
+		
+		// for making function call via active scheduler
+		CAspActiveCaller* iActiveCaller;
+		
+		// for bearer type list construction
+		CAspBearerHandler* iBearerHandler;
+		
+		// format string from resource file
+		TBuf<KBufSize> iNaviPaneTextFormat;
+		
+		// popup note
+		CAknInfoPopupNoteController* iPopupNote;
+		
+		// needed for unique server id check
+		CAspProfileList* iProfileList;
+		
+		// Background context
+	    CAknsBasicBackgroundControlContext* iBgContext;
+	    
+	    // Flag for checking whether moving in Backward direction or not 
+	    TBool iMoveBack;
+    };
+
+
+
+
+
+#endif      // ASPPROFILEWIZARDDIALOG_h
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspProgressDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,261 @@
+/*
+* 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: sync progress indication 
+*
+*/
+
+
+#ifndef ASPPROGRESSDIALOG_H
+#define ASPPROGRESSDIALOG_H
+
+
+//  INCLUDES
+#include    <e32base.h>
+#include    <AknWaitDialog.h>
+#include    <AknProgressDialog.h>
+
+#include    "AspDefines.h"
+#include    "AspResHandler.h"
+
+
+// CLASS DECLARATIONS
+
+
+/**
+* MAspProgressDialogObserver
+* 
+* Observer interface function for observing progress dialog.
+*/
+NONSHARABLE_CLASS (MAspProgressDialogObserver)
+    {
+    public:
+        /**
+        * Callback method
+        * Get's called when a dialog is dismissed.
+        */
+        virtual void HandleDialogEventL(TInt aButtonId) = 0;
+    };
+
+
+
+/**
+* CAspProgressDialog2
+*
+* CAspProgressDialog2 is needed to modify CAknProgressDialog::OkToExitL. 
+*/
+NONSHARABLE_CLASS (CAspProgressDialog2) : public CAknProgressDialog
+    {
+	public:
+        /**
+        * C++ default constructor.
+        */
+		CAspProgressDialog2(CEikDialog** aSelfPtr, TInt aApplicationId);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CAspProgressDialog2();
+        
+        /**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+        TBool OkToExitL(TInt aButtonId);
+        
+        /**
+        * From the base class.
+		* Called by framework for key event handling.
+        * @param aKeyEvent.
+		* @param TEventCode.
+		* @return Return code.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+		
+	private:
+   		// has dialog received close event (eg. end key) 
+		TBool iCloseEventReceived;
+
+		// has cancel key been pressed 
+		TBool iCancelEventReceived;
+
+        // has sync been closed
+        TBool iClosed;
+        
+        // has sync been canceled
+        TBool iCanceled;
+		
+  		// id of the calling application
+		TInt iApplicationId;
+    };
+
+
+
+/**
+* CAspProgressDialog
+*  
+* CAspProgressDialog show sync progress dialog.
+*/
+NONSHARABLE_CLASS (CAspProgressDialog) : public CBase, public MProgressDialogCallback
+    {
+
+    public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspProgressDialog* NewL(MAspProgressDialogObserver* aObserver);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspProgressDialog();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAspProgressDialog(MAspProgressDialogObserver* aObserverPtr);
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+        
+		/**
+		* From MProgressDialogCallback.
+        * Called by the framework when dialog is dismissed.
+        * @param aButtonId
+        * @return None
+        */
+        void DialogDismissedL(TInt aButtonId);
+
+    public:        
+        
+        /**
+        * Launches progress dialog with custom bitmap.
+        * @param aLabel.
+        * @param aId.
+        * @param aFileName.
+        * @param aFileBitmapId.
+        * @param aFileMaskId.
+        * @return None.
+        */
+        void LaunchProgressDialogL(const TDesC& aLabel, TAknsItemID aId, const TDesC& aFileName, TInt aFileBitmapId, TInt aFileMaskId);
+
+        
+        /**
+        * Closes progress dialog.
+        * @param None
+        * @return None
+        */
+        void CancelProgressDialogL();
+        
+        /**
+        * Update dialog label text.
+        * @param aText.
+        * @return None.
+        */
+        void UpdateTextL(const TDesC& aText);
+
+        /**
+        * Set progress bar state.
+        * @param aValue.
+        * @return None
+        */
+        void SetProgress(TInt aValue);
+
+        /**
+        * Set progress bar state.
+        * @param aFinalValue.
+        * @return None
+        */
+        void SetFinalProgress(TInt aFinalValue);
+
+        /**
+        * Gets CAknNoteControl from CAknProgressDialog.
+        * @param None
+        * @return CAknNoteControl.
+        */
+		CAknNoteControl* NoteControl();
+
+       /**
+        * Cancels animation.
+        * @param None.
+        * @return None.
+        */
+		void CancelAnimation();
+        
+		/**
+        * Starts animation.
+        * @param None
+        * @return None.
+        */
+		void StartAnimationL();
+		
+		/**
+        * Hides cancel button.
+        * @param None
+        * @return None.
+        */
+		void HideButtonL();
+
+		/**
+        * Set application id.
+        * @param aApplicationId
+        * @return None.
+        */
+		void SetApplicationId(TInt aApplicationId);
+
+		/**
+        * Returns progress dialog
+        * @param None
+        * @return CAspProgressDialog2*
+        */
+		CAspProgressDialog2* ProgressDialog();
+
+    private:
+ 		// id of the calling application
+		TInt iApplicationId;
+    
+        // progress dialog
+		CAspProgressDialog2*	iProgressDialog;
+		
+		// is dialog running
+		TBool iProgressDialogRunning;
+
+        // progress dialog info
+        CEikProgressInfo* iProgressInfo;
+
+		// last label text
+		TBuf<KBufSize> iLastText;
+
+		// animation state
+		TBool iAnimation;
+
+		// resource handler
+		CAspResHandler* iResHandler;
+
+		// dialog observer
+        MAspProgressDialogObserver*	iObserver;
+    };
+
+
+
+
+#endif      // ASPPROGRESSDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspResHandler.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,275 @@
+/*
+* 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: Utility methods to handle resources 
+*
+*/
+
+
+#ifndef ASPRESHANDLER_H
+#define ASPRESHANDLER_H
+
+
+// INCLUDES
+#include <e32base.h>
+#include <eikenv.h>
+#include <aknenv.h>
+#include <StringLoader.h>
+
+#include "AspDefines.h"
+#include <AspSyncUtil.rsg>
+
+
+
+
+// CLASS DECLARATION
+
+
+
+/**
+* CAspResHandler
+*
+* This class is used for reading aspsyncutil resources.
+*/
+NONSHARABLE_CLASS (CAspResHandler) : public CBase
+    {
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CAspResHandler* NewL();
+
+	    /**
+        * Destructor.
+        */
+        ~CAspResHandler();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+	    CAspResHandler();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+
+	
+    public:
+	   /**
+        * Finds out aspsyncutil resource file name.
+        * @param aText.
+		* @return None.
+        */
+        static void GetResFileName(TDes& aText);
+
+	   /**
+        * Finds out aspsyncutil bitmap file name.
+        * @param aText.
+		* @return None.
+        */
+        static void GetBitmapFileName(TDes& aText);
+        
+	   /**
+        * Reads string from resource file.
+        * @param aText Text read from resource file.
+		* @param aResourceId Resource id.
+		* @return None.
+        */
+		static void ReadL(TDes& aText, TInt aResourceId);
+
+	   /**
+        * Reads string from resource file.
+        * @param aText Text read from resource file.
+		* @param aResourceId Resource id.
+		* @param aSubString Substring that is added into read resource.
+		* @return None.
+        */
+		static void ReadL(TDes& aText, TInt aResourceId, const TDesC& aSubString);
+
+	   /**
+        * Reads string from resource file.
+    	* @param aResourceId Resource id.
+		* @return Text read from resource file.
+        */
+		static HBufC* ReadLC(TInt aResourceId);
+
+	   /**
+        * Reads string from resource file.
+    	* @param aResourceId Resource id.
+		* @return Text read from resource file.
+        */
+		static HBufC* ReadL(TInt aResourceId);
+
+	   /**
+        * Reads string from resource file.
+		* @param aResourceId Resource id.
+		* @param aSubString Substring that is added into read resource.
+		* @return Text read from resource file.
+        */
+		static HBufC* ReadLC(TInt aResourceId, const TDesC& aSubString);
+
+	   /**
+        * Reads string from resource file.
+		* @param aResourceId Resource id.
+		* @param aNumber Number that is added into read resource.
+		* @return Text read from resource file.
+        */
+		static HBufC* ReadLC(TInt aResourceId, TInt aNumber);
+		
+	   /**
+        * Reads array of strings from resource file.
+    	* @param aResourceId Resource id.
+		* @return String array.
+        */
+		CDesCArrayFlat* ReadDesArrayLC(TInt aResourceId);
+
+	   /**
+        * Reads array of strings from resource file.
+    	* @param aResourceId Resource id.
+		* @return String array.
+        */
+		CDesCArrayFlat* ReadDesArrayL(TInt aResourceId);
+
+	   /**
+        * Reads array of strings from resource file.
+    	* @param aResourceId Resource id.
+		* @return String array.
+        */
+		static CDesCArrayFlat* ReadDesArrayStaticLC(TInt aResourceId);
+
+		/* Implementation of CMCC PIM v3 begins*/ 
+	   /**
+        * Reads progress dialog progress text from resource file.
+		* @param aContent Content name.
+		* @param aCurrent Currently processed sync item.
+    	* @param aFinal Number of sync items.
+		* @param aPhase Phase of synchronization.
+		* @return Progress text.
+        */
+		HBufC* ReadProgressTextLC(const TDesC& aContent, TInt aCurrent, TInt aFinal, TInt aPhase);
+		/* Implementation of CMCC PIM v3 ends*/
+		
+	   /**
+        * Reads progress dialog progress text from resource file.
+		* @param aContent.
+		* @param aPhase.
+		* @return Progress text.
+        */
+		HBufC* ReadProgressTextLC(const TDesC& aContent, TInt aPhase);
+		
+	   /**
+        * Reads progress dialog progress text from resource file.
+        * Buffers the last aResource to minimize file operations.
+        * @param aResourceId Resource id.
+		* @param aContent Content name.
+		* @return Progress text.
+        */
+		HBufC* ReadProgressTextLC(TInt aResourceId, const TDesC& aContent);
+
+		/* Implementation of CMCC PIM v3 begins*/ 
+	   /**
+	    * Reads progress dialog progress text from resource file.
+	    * Buffers the last aResource to minimize file operations.
+	    * @param aResourceId Resource id.
+	    * @param aCurrent Currently processed sync item.
+        * @param aFinal Number of sync items.
+        * @param aContent Content name.
+	    * @return Progress text.
+	    */
+		HBufC* ReadProgressTextLC(TInt aResourceId, TInt aCurrent, TInt aFinal, const TDesC& aContent);
+		/* Implementation of CMCC PIM v3 ends*/
+		
+	   /**
+        * Reads default profile name from resource file.
+		* @param aIndex Number that is added to proile name (eg. "New Profile(1)").
+		* @param aApplicationId.
+		* @return Profile name.
+        */
+		static HBufC* GetNewProfileNameLC(TInt aIndex, TInt aApplicationId);
+		
+	   /**
+        * Reads sync content name.
+		* @param aDataProviderId.
+		* @param aDefaultText.
+		* @return Content name.
+        */
+		static HBufC* GetContentNameLC(TInt aDataProviderId, const TDesC& aDefaultText);
+		
+	   /**
+        * Reads sync content title.
+		* @param aDataProviderId.
+		* @param aDefaultText.
+		* @return Content title.
+        */
+		static HBufC* GetContentTitleLC(TInt aDataProviderId, const TDesC& aDefaultText);
+
+	   /**
+        * Reads sync content setting text.
+		* @param aDataProviderId.
+		* @param aDefaultText.
+		* @return Content title.
+        */
+		static HBufC* GetContentSettingLC(TInt aDataProviderId, const TDesC& aDefaultText);
+		
+	   /**
+        * Reads remote database setting header rersource id.
+		* @param aDataProviderId.
+		* @return Resource id.
+        */
+		static TInt RemoteDatabaseHeaderId(TInt aDataProviderId);
+		
+	   /**
+        * Reads profile info text.
+		* @param aProfile.
+		* @param aBearer.
+		* @return Profile info text.
+        */
+		static HBufC* ReadProfileInfoTextLC(const TDesC& aProfile, const TDesC& aBearer);
+
+	   /**
+        * Reads profile info text.
+		* @param aProfile.
+		* @param aBearer.
+		* @param aHours.
+		* @param aMinutes.
+		* @return Profile info text.
+        */
+		static HBufC* ReadProfileInfoTextLC(const TDesC& aProfile, const TDesC& aBearer,
+		                                    TInt aHours, TInt aMinutes);
+
+		  /**
+        * Reads profile info text.
+		* @param aProfile.
+		* @param aTime.
+			*/
+		static HBufC* ReadAutoSyncInfoTextLC(const TDesC& aProfile, TTime aTIme);
+		
+    private:
+		//  sync app resource file id
+		TInt iResId;
+
+		// pointer to CEikonEnv
+		CEikonEnv* iEikEnv;
+
+		// progress text format (from resource file)
+		HBufC* iProgressTextFormat;
+		
+		// progress text format id
+		TInt iProgressTextFormatId;
+    };
+
+
+
+#endif  // ASPRESHANDLER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspSchedule.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,412 @@
+/*
+* 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: Scheduled sync implementation and setting access 
+*
+*/
+
+
+#ifndef ASPSCHEDULE_H
+#define ASPSCHEDULE_H
+
+// INCLUDES
+#include <e32base.h>
+#include <SyncMLClient.h>    // for RSyncMLSession
+#include <SyncMLObservers.h>
+
+#include "AspDefines.h"
+#include "AspUtil.h"
+
+
+// CONSTANTS
+const TInt KDefaultStartHour = 12; // 12 noon
+const TInt KStartPeakHour = 8;
+const TInt KStartPeakMin = 00;
+const TInt KEndPeakHour = 17;
+const TInt KEndPeakMin = 00;
+_LIT(KAutoSyncProfileName, "AutoSync Profile");
+
+
+// FORWARD DECLARATIONS
+class CAspProfile;
+class CAspFilterItem;
+
+
+/**
+* CAspSchedule
+*  
+*/
+NONSHARABLE_CLASS (CAspSchedule) : public CBase
+    {
+    private:
+	enum TRepositoryKey
+		{
+	   // ERepositoryKeyInt = 1,
+	    ERepositoryKeyBin = 1
+		};
+		
+    public:
+		
+    enum TWeekdayFlags
+        {
+	    EFlagMonday      = 0x00000001,
+	    EFlagTuesday     = 0x00000002,
+	    EFlagWednesday   = 0x00000004,
+	    EFlagThursday    = 0x00000008,
+	    EFlagFriday      = 0x00000010,
+	    EFlagSaturday    = 0x00000020,
+	    EFlagSunday      = 0x00000040
+        };
+
+	enum TSyncInterval
+		{
+		EIntervalManual = 0,
+		EInterval15Mins,
+		EInterval30Mins,
+		EInterval1hour,
+		EInterval2hours,
+		EInterval4hours,
+		EInterval8hours,
+		EInterval12hours,
+		EManyTimesPerDay,
+		EInterval24hours,
+		EInterval2days,
+		EInterval4days,
+		EInterval7days,
+		EInterval14days,
+		EInterval30days
+		};
+	
+  
+	public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspSchedule* NewL();
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CAspSchedule* NewLC();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CAspSchedule();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */	
+        CAspSchedule();
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	public:
+
+		/**
+        *  auto sync error
+        */	
+	    TInt Error();
+	    void SetError(TInt aError);
+
+		/**
+        *  Profile selected for auto sync
+        */	
+	    TInt ProfileId();
+	    void SetProfileId(TInt aProfileId);
+
+		/**
+        *  week day selection 
+        */	
+	    TBool WeekdayEnabled(TInt aWeekday);
+	    void SetWeekdayEnabled(TInt aWeekday, TBool aEnabled);
+	    
+	    TBool RoamingAllowed();
+	    void SetRoamingAllowed(TBool aAllowed);
+	    
+	    void SelectedDayInfo(TInt& aDayCount, TInt& aWeekday);
+
+		/**
+        * Save all settings using a cenrep key
+        */	
+        void SaveL();
+
+		/**
+        * Auto sync content selection
+        */	
+		void SetContentEnabled(TInt aContent, TInt aEnabled);
+	    TBool ContentEnabled(TInt aContent);
+	    void ContentSelectionInfo(TInt& aContentCnt, TInt& aContent);
+
+		/**
+        * Auto sync interval
+        */	
+        void SetSyncFrequency(TInt aSchedule);
+		void SetSyncPeakSchedule(TInt aSchedule);
+		void SetSyncOffPeakSchedule(TInt aSchedule);
+		TInt SyncFrequency();
+		TInt SyncPeakSchedule();
+		TInt SyncOffPeakSchedule();
+
+		/**
+        * Peak time definition
+        */	
+		void SetStartPeakTime(TTime aStartTime);
+		void SetEndPeakTime(TTime aEndTime);
+		TTime StartPeakTime();
+		TTime EndPeakTime();
+
+		/**
+        * Auto sync enabled/disabled
+        */	
+		void SetDailySyncEnabled(TBool aSyncEnabled);
+		TBool DailySyncEnabled();
+		void SetPeakSyncEnabled(TBool aSyncEnabled);
+		TBool PeakSyncEnabled();
+		void SetOffPeakSyncEnabled(TBool aSyncEnabled);
+		TBool OffPeakSyncEnabled();
+
+		/**
+        * Sync time for intervals >= a day
+        */	
+		void SetAutoSyncScheduleTime(TTime aSchedule);
+		TTime AutoSyncScheduleTime();	
+
+		/**
+        * Schedule handle returned by task scheduler during schedule creation
+        */	
+		void SetPeakScheduleHandle(TInt aHandle);
+		TInt PeakScheduleHandle();
+		void SetOffPeakScheduleHandle(TInt aHandle);
+		TInt OffPeakScheduleHandle();
+
+		/**
+        * A hidden profile used for auto sync.Contents are set as the content selected in auto sync settings
+        *
+        */	
+
+		void CreateAutoSyncProfileL();
+		TInt AutoSyncProfileId();
+		void SetAutoSyncProfileId(TInt aProfileId);
+		void CopyAutoSyncContentsL();
+		void UpdateProfileSettingsL();
+		
+		/**
+        * Check validity of shedule based on current time and user defined peak time
+        *
+        */					
+		TInt IsValidPeakScheduleL();
+		TInt IsValidOffPeakScheduleL();
+
+		TBool IsValidNextPeakScheduleL();
+		TBool IsValidNextOffPeakScheduleL();
+
+		/**
+        * Post pone schedule until next valid time
+        */
+		void UpdatePeakScheduleL();
+		void UpdateOffPeakScheduleL();
+		TIntervalType IntervalType(TInt aInterval);
+
+		void EnableScheduleL();
+
+		/**
+        * Check if any valid mail box exists
+        */
+		TBool MailboxExistL();
+
+		/**
+        * Check mandatory settings for the selected profile
+        */
+		TInt CheckMandatoryDataL(TInt& count,TInt& firstItem);
+
+		/**
+        * Log view opened by clicking View Details link in auto sync error note
+        */
+		void ShowAutoSyncLogL();
+
+		/**
+        *SyncML sever version of selected profile
+        */
+		TInt ProtocolL();
+
+		/**
+        *Server Id modifications so that SAN selects correct profile
+        */
+		void UpdateServerIdL();
+
+		/**
+        *Check if atleast one valid content selected
+        */
+		TBool IsContentSelected();
+		
+		/**
+        *Check if auto sync is enabled
+        */
+		TBool IsAutoSyncEnabled();
+
+		/**
+        *Initialize contents
+        */
+		void InitializeContentsL();
+
+		
+		/**
+        *Check the validity of email selection.
+        */
+		void CheckEmailSelectionL();
+
+				
+    public:
+
+		/**
+        *Update the schedule settings with symbian task scheduler
+        */
+        void UpdateSyncScheduleL();
+        void UpdateSyncSchedule();
+        void GetStartTimeL(TTime& aTime, TBool aHomeTime);
+               
+      
+#ifdef _DEBUG
+		void LogSettings();
+#endif
+
+
+    public:
+   	    TBool CanSynchronizeL();
+		
+	private:
+	    void InitializeL();
+	
+	public:
+        static TTime UniversalStartTime(TInt& aStartHour);
+        static TTime LocalStartTime(TInt aStartHour);
+        
+	
+	private:
+	    void InternalizeL();
+		void DoInternalizeL();
+		void InternalizeL(RReadStream& aStream);
+		void ExternalizeL();
+		void ExternalizeL(RWriteStream& aStream);
+		void WriteRepositoryL(TInt aKey, const TDesC8& aValue);
+		void ReadRepositoryL(TInt aKey, TDes8& aValue);
+		void ResetRepositoryL();
+		
+	private:
+		TInt WeekdayFlag(TInt aWeekday);
+		TBool IsDaySelected(TTime aTime);
+	
+		void OpenSyncSessionL();
+		void CloseSyncSession();
+
+		
+#ifdef _DEBUG        
+	public:
+	    void LogScheduleL();
+	    void LogSyncDays();
+	    void LogSyncInterval();	
+
+
+    public:
+        static void PrintTimeL(TTime aTime);
+        void TestL();
+        void DoTestL();
+        void UpdateValuesL(TInt aCount);
+        CAspSchedule* CreateCopyLC();
+        void CompareValues(CAspSchedule* aSchedule);
+        void AssertEqual(TInt aValue1, TInt aValue2);
+#endif
+
+        	    
+		
+    private:
+   
+         // error code
+        TInt iError;
+
+		// profile id
+		TInt iProfileId;
+		
+		// selected days
+		TUint32 iWeekdayFlags;
+		
+		// start hour
+		TInt iStartHour;
+
+		// is roaming allowed
+		TBool iRoamingAllowed;
+		
+		// data provider id list
+		RArray<TInt> iList;
+		
+        // long buffer for string handling 
+		TBuf<KBufSize255> iBuf;
+		
+		// have settings changed
+		TBool iSettingChanged;
+
+		//content selection flags
+		TUint32 iContentFlags;
+		
+		TInt iStartPeakTimeHr;
+		TInt iStartPeakTimeMin;
+		TInt iEndPeakTimeHr;
+        TInt iEndPeakTimeMin;		
+
+		//peak interval
+		TInt iSyncPeakSchedule;
+
+		//off-peak interval
+		TInt iSyncOffPeakSchedule;
+
+		
+		TBool iPeakSyncEnabled;
+		TBool iOffPeakSyncEnabled;
+
+		//A new RSyncMLProfileBase profile is created for auto sync
+		//Selected Auto sync contents are set as the task items for this profile
+		//All the settings for this profie are copied from the profile selected by user.
+		
+		TInt iAutoSyncProfileId;
+		
+        //Sync time for once a day sync
+		TInt iAutoSyncScheduleTimeHr;
+		TInt iAutoSyncScheduleTimeMin;
+
+		//schedule handles.
+        TInt iPeakScheduleHandle;
+		TInt iOffPeakScheduleHandle;
+
+		// sync session
+		RSyncMLSession iSyncSession;
+
+		// is sync session open
+		TBool iSyncSessionOpen;
+
+		// Daily sync setting
+		TBool iDailySyncEnabled;
+		TInt iSyncFrequency;
+
+		
+    };
+
+#endif  // ASPSCHEDULE_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspScheduleDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,686 @@
+/*
+* 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: Scheduled sync UI 
+*
+*/
+
+
+
+#ifndef ASPSCHEDULEDIALOG_H
+#define ASPSCHEDULEDIALOG_H
+
+
+//  INCLUDES
+
+#include "AspDialogUtil.h"
+
+#include <e32base.h>
+#include <aknlists.h>
+#include <AknDialog.h>
+
+
+// FORWARD DECLARATIONS
+
+class CAspSchedule;
+class CAspProfileWizard;
+
+
+// CLASS DECLARATION
+/**
+* MAuotSyncEditorPageObserver
+*
+* Observer interface function.
+*/
+
+NONSHARABLE_CLASS (MAutoSyncEditorPageObserver)
+	{
+  	
+	public:
+		/**
+        * Editor page call this when editor is about to close.
+        * @param aText Editor text.
+        * @return ETrue if input is ok, EFalse otherwise. 
+        */
+		virtual TBool CheckValidityL() = 0;
+
+		/**
+	*Return the index of email item in provider list
+	*/
+		virtual TInt EmailIndex() = 0;
+
+	};
+
+
+/**
+* TAutoSyncSettingPageParam
+*
+* This class is used as general parameter type.
+*/
+NONSHARABLE_CLASS (TAutoSyncSettingPageParam)
+	{
+	public:
+	    TInt iCommandId;
+	    TBuf<KBufSize> iPageText;
+	    MAutoSyncEditorPageObserver* iObserver;
+	    TInt iSettingType;
+	};
+
+
+/**
+* CAspAutoCheckBoxSettingPage
+*
+* Setting page that returns command button id.
+*/
+NONSHARABLE_CLASS (CAutoSyncCheckBoxSettingPage) : public CAknCheckBoxSettingPage,public MEikListBoxObserver
+	{
+    public:
+        CAutoSyncCheckBoxSettingPage(TInt aResourceID, CSelectionItemList* aItemArray, TAutoSyncSettingPageParam& aParam);
+
+        ~CAutoSyncCheckBoxSettingPage();            
+        
+	public:
+
+		void UpdateCbaL(TInt aResourceId);
+		void DynamicInitL();
+
+	protected: // From CCoeControl
+	    void ProcessCommandL(TInt aCommandId);
+	    
+	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+	    //from MEikListBoxObserver for touch event handling
+        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+		
+	private:
+	    TAutoSyncSettingPageParam& iParam;
+   	    TInt iSelectionCount;
+   	    CSelectionItemList* iSelectionItemList;
+		
+	};
+
+
+
+/**
+*  CAspScheduleDialog
+*
+* CAspScheduleDialog is used for editing sync connection data.
+*/
+NONSHARABLE_CLASS (CAspScheduleDialog) : public CAknDialog, public MEikListBoxObserver,
+																	  public MAutoSyncEditorPageObserver
+    {
+    private:
+		
+	enum TRepositoryKey
+		{
+	    EKeySyncFrequency = 2,
+	    EKeyPeakSyncInterval,
+	    EKeyOffPeakSyncInterval
+		};
+    
+    
+	public:
+	    /**
+        * Launches dialog.
+        * @param aParam Class that contains dialog parameters.
+        * @return Completion code.
+        */
+		static TBool ShowDialogL(const TAspParam& aParam);
+
+	public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+		static CAspScheduleDialog* NewL(const TAspParam& aParam);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspScheduleDialog();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAspScheduleDialog(const TAspParam& aParam);
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	private:
+        /**
+        * From MEikListBoxObserver, called by framework.
+        * @param aListBox.
+        * @param aEventType.
+		* @return None
+        */
+		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+        /**
+        * From the base class.
+		* Called by framework before the dialog is shown.
+        * @param None
+		* @return None
+        */
+        void PreLayoutDynInitL();
+
+        /**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param aButtonId Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+        TBool OkToExitL(TInt aButtonId);
+
+        /**
+        * From the base class.
+		* Called by framework for key event handling.
+        * @param aKeyEvent.
+		* @param aType.
+		* @return Return code.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+
+        /**
+        * From the base class.
+		* Called by framework when dialog is activated.
+        * @param None.
+		* @return None.
+        */
+		void ActivateL();
+		
+		/**
+		* Method to get context sensitive help topic.
+        * @param aContext Help topic to open.
+		* @return None.
+        */
+		void GetHelpContext(TCoeHelpContext& aContext) const;
+
+		/**
+        * From the base class.
+		* Called by framework before menu is shown.
+        * @param aResourceId Menu resource id.
+		* @param aMenuPane Pointer to the menu.
+        * @return None.
+        */
+		void DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane);
+
+		/**
+		* From the base class.
+		* Handles menu events.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		void ProcessCommandL(TInt aCommandId);
+		
+		/**
+		* From base class.
+		* Called when UI layout changes. 
+		* @param aType.
+    	* @return None.
+		*/
+        void HandleResourceChange(TInt aType);
+
+		/**
+		* From TAutoSyncSettingPageParam
+		* Checks validity content selected
+		* @param  None
+		* @return ETrue/EFalse.
+		*/
+
+		TBool CheckValidityL();
+
+		TInt EmailIndex();
+		
+		/**
+		* Checks remote databse settings for the profile
+		* @param  None
+		* @return None.
+		*/
+
+		void CheckMandatoryDataL();
+
+		/**
+		* Checks remote databse settings for the profile
+		* @param  None
+		* @return ETrue/EFalse.
+		*/
+		TBool CheckBearerType();
+
+		
+
+    private:
+		/**
+		* Handles setting item editing.
+		* @param None.
+		* @return None.
+		*/
+		void HandleOKL();
+		
+		/**
+		* Set setting list icons.
+		* @param None.
+		* @return None.
+		*/
+		void SetIconsL();
+
+	
+	public:  // common editors
+	
+		/**
+		* Shows editor for text type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemTextL(CAspListItemData& aItem);
+		
+		/**
+		* Shows editor for number type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemNumberL(CAspListItemData& aItem);
+		
+		/**
+		* Shows editor for list type setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		//TBool EditSettingItemListL(CAspListItemData& aItem);
+ 
+    private:
+    
+		/**
+		* Handles setting item editing.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemL(CAspListItemData& aItem);
+
+		/**
+		* Change Yes/No setting in place without showing editor.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemYesNoL(CAspListItemData& aItem);
+	
+		/**
+		* Shows editor for profile setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemProfileL(CAspListItemData& aItem);
+
+		/**
+		* Shows editor for content setting.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemContentL(CAspListItemData& aItem);
+
+		/**
+		* Shows setting editor.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemWeekdaysL(CAspListItemData& aItem);
+		
+		/**
+		* Shows setting editor.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemTimeL(CAspListItemData& aItem);
+		
+		/**
+		* Shows editor for peak schedule selection
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemPeakScheduleL(CAspListItemData& aItem);
+
+		/**
+		* Shows editor for off-peak schedule selection
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+		TBool EditSettingItemOffPeakScheduleL(CAspListItemData& aItem);
+
+		/**
+		* Shows editor for sync frequency selection
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+
+		TBool EditSettingItemSyncFrequencyL(CAspListItemData& aItem);
+	
+
+    private:
+
+		/**
+		* Checks that all mandatory data is found.
+		* @param None.
+		* @return Return code.
+		*/
+		TInt CheckMandatoryFields();
+		
+		/**
+		* Saves profile.
+		* @param None.
+		* @return None.
+		*/
+		void SaveSettingsL();
+
+	private:
+		/**
+        * Create one CNSmlDSProfileData for each setting.
+        * @param None.
+        * @return None.
+        */
+		void CreateSettingsListL();
+		
+		/**
+        * Initalizes setting item needed for listbox handling.
+        * @param aItem.
+        * @return None.
+        */
+		void InitSettingItemL(CAspListItemData* aItem);
+		
+		/**
+        * Add settings titles into listbox.
+        * @param aListBox.
+        * @param aItemList List of setting items.
+        * @return None.
+        */
+		void UpdateListBoxL(CEikTextListBox* aListBox, CAspSettingList* aItemList);
+
+		/**
+        * Adds one setting item into item list.
+        * @param aItemId Item id.
+        * @param aHeaders Array of item headers.
+		* @return None.
+        */
+		void AddItemL(TInt aItemId, TInt aResourceId);
+
+		/**
+        * Set setting item visibility (normal/readonly/hidden).
+        * @param None.
+		* @return None.
+        */
+		void SetVisibility();
+		
+        /**
+        * Set all settings to read-only state.
+        * @param None.
+		* @return None.
+        */
+		void SetAllReadOnly();
+		
+
+    private:
+
+		/**
+        * Creates icon.
+		* @param aId.
+        * @param aFileName.
+		* @param aFileIndex.
+		* @param aFileMaskIndex.
+        * @return Created icon.
+        */
+		CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex);
+		
+		/**
+		* Returns setting item with listbox position aIndex.
+		* @param aIndex Listbox index.
+		* @return Pointer to setting item.
+        */
+		CAspListItemData* GetItemForIndex(TInt aIndex);
+
+		/**
+        * Returns setting item with id aItemId.
+        * @param aItemId Item id.
+        * @return Pointer to setting item.
+        */
+		CAspListItemData* Item(TInt aItemId);
+
+		/**
+		* Get profile name.
+		* @param aProfileId.
+		* @param aText.
+		* @return None.
+		*/
+		void GetProfileName(TInt& aProfileId, TDes& aText);
+
+		/**
+		* Get content name.
+		* @param aProfileId.
+		* @param aText.
+		* @return None.
+		*/
+		//void GetContentName(TDes& aText);
+
+		/**
+		* Get day name.
+		* @param aProfileId.
+		* @param aText.
+		* @return None.
+		*/
+		void GetWeekdayNameL(TDes& aText);
+
+		/**
+		* Update content list from schedule settings.
+		* @param None.
+		* @return None.
+		*/
+		//void GetContentSelectionL();
+		
+		/**
+		* Get content list from sync profile.
+		* @param aList.
+		* @return None.
+		*/
+		//void GetContentSelection2L(CSelectionItemList* aList);
+		
+		/**
+		* Write selected contents into schedule settings.
+		* @param None.
+		* @return None.
+		*/
+		//void SetContentSelectionL();
+
+		/**
+		* Construct CSelectionItemList.
+		* @param aList.
+		* @return None.
+		*/
+		void GetWeekdaySelectionL(CSelectionItemList* aList);
+
+		/**
+		* Construct CSelectionItemList.
+		* @param aList.
+		* @return None.
+		*/
+		void SetWeekdaySelectionL(CSelectionItemList* aList);
+		
+			/**
+		* Set default day selection
+		* @param None
+		* @return None.
+		*/
+		void SetDefaultdaySelectionL();
+		/**
+		* Construct time text.
+		* @param aText.
+		* @param aTime.
+		* @return None.
+		*/
+		void GetTimeTextL(TDes& aText, TTime aTime);
+		
+   
+       /**
+		*Get content name 
+		* @param aText.
+		* @return None.
+		*/
+        void GetContentsNameL(TDes& aText);
+
+	   /**
+		*Get content selection
+		* @param aList
+		* @return None.
+		*/	   
+        void GetContentSelectionL(CSelectionItemList* aList);
+
+	   /**
+		*Set content selection
+		* @param aList.
+		* @return None.
+		*/
+        void SetContentSelectionL(CSelectionItemList* aList);
+
+		CDesCArray* GetSyncFrequencyListLC();
+		void GetSyncFrequencyValueL(TInt schedule, TDes& aBuf);
+		TInt SyncFrequencyL(const TDesC& aBuf);
+		TInt GetSyncFrequencyPositionL(CDesCArray* arr, TInt aInterval);
+
+		/**
+		*Check if the profile has access point selected
+		* @param aProfileId
+		* @return None.
+		*/
+ 		void CheckAccessPointSelectionL(TInt aProfileId);
+
+		/**
+		*Get list of peak schedule intervals
+		* @return CDesCArray*
+		*/
+		CDesCArray* GetPeakScheduleListLC();
+
+		/**
+		*Get list of peak schedule intervals
+		* @return CDesCArray*
+		*/
+		CDesCArray* GetOffPeakScheduleListLC();
+
+			/**
+		*Get time interval string corresponding to a schedule no
+		* @return CDesCArray*
+		*/
+		void GetPeakScheduleValueL(TInt schedule, TDes& aBuf);
+		void GetOffPeakScheduleValueL(TInt schedule, TDes& aBuf);
+
+			/**
+		*Get time interval value for the string
+		* @return CDesCArray*
+		*/
+		TInt PeakScheduleL(const TDesC& aBuf);
+		TInt OffPeakScheduleL(const TDesC& aBuf);
+
+			/**
+		*Position of selected interval in the list
+		* @return CDesCArray*
+		*/
+		TInt GetPeakPositionL(CDesCArray* arr, TInt aInterval);
+		TInt GetOffPeakPositionL(CDesCArray* arr, TInt aInterval);
+
+			/**
+		*Show auto sync info
+		* @return CDesCArray*
+		*/
+		void ShowAutoSyncInfoL();
+
+			/**
+		*Set default content selection
+		* 
+		*/
+		void SetDefaultContentL();
+			
+			/**
+		*Read cenrep for operator configured sync interval values
+		* 
+		*/
+		void ReadRepositoryL(TInt aKey, TInt& aValue);
+			
+			/**
+		*Create content list
+		* 
+		*/
+		void CreateContentListL();
+
+			/**
+		*Check if time definition is valid.
+		* 
+		*/
+		TBool CheckPeakTime();
+
+	private:
+		// setting list
+		CAknSettingStyleListBox* iSettingListBox;
+
+		// list of setting items
+		CAspSettingList *iSettingList;
+
+		// list that contains all contents (applications)
+		CAspContentList* iContentList;
+
+   		// sync session
+		RSyncMLSession* iSyncSession;
+
+		// for title and icon handling
+		CStatusPaneHandler* iStatusPaneHandler;
+
+		// resource handler
+		CAspResHandler* iResHandler;
+
+		// dialog edit mode
+		TInt iEditMode;
+
+		// long buffer for string handling
+		TBuf<KBufSize255> iBuf;
+		
+		// list that contains all profiles
+		CAspProfileList* iProfileList;
+		
+		// for storing auto sync settings
+		CAspSchedule* iSchedule;
+
+		// profile data
+		CAspProfile* iProfile;
+
+		// id of the calling application
+		TInt iApplicationId;
+		
+		// weekday names
+		CDesCArray* iWeekdayList;
+		
+		// have settings changed
+		TBool iSettingChanged;
+		
+		// Content names
+		CDesCArray* iContentsList;
+
+		TBool iDoCleanUp;
+
+		// is setting database in read only state
+		TBool iSettingEnforcement;
+		
+		
+    };
+
+
+#endif      // ASPSCHEDULEDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspSettingDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,695 @@
+/*
+* 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: Main view setting dialog 
+*
+*/
+
+
+#ifndef ASPSETTINGDIALOG_H
+#define ASPSETTINGDIALOG_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <eikdialg.h>
+#include <eiklbo.h>
+#include <aknlists.h>
+#include <AknDialog.h>
+#include <aknnavi.h>
+#include <AknInfoPopupNoteController.h> // CAknInfoPopupNoteController
+
+#include "AspDefines.h"
+#include "AspDialogUtil.h"
+#include "AspResHandler.h"
+#include "AspDbNotifier.h"
+#include "AspSyncHandler.h"
+
+
+// FORWARD DECLARATIONS
+
+// CONSTANTS
+
+const TInt KSettingDialogPopupDisplayTime = 3*1000;
+
+
+
+// CLASS DECLARATION
+
+/**
+*  CAspSettingDialog
+*
+* This is sync app  main dialog.
+*/
+NONSHARABLE_CLASS (CAspSettingDialog) : public CAknDialog, public MEikListBoxObserver,
+                                        public MAspDbEventHandler, public MAspSyncObserver
+	{
+	
+	enum TAspSettingDialogIconIndex
+		{
+	    EIconIndexHTTP = 0,
+        EIconIndexBT   = 1,
+	    EIconIndexUSB  = 2,
+	    EIconIndexIrda = 3,
+	    EIconIndexSyncOff = 4,
+		EIconIndexMultipleContent = 5
+		};
+
+	public:
+
+	    /**
+        * Launches setting dialog.
+		* @param aParam Class that contains dialog parameters.
+        * @return Return code.
+        */
+		static TBool ShowDialogL(TAspParam& aParam);
+		
+    public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CAspSettingDialog* NewL(TAspParam& aParam);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspSettingDialog();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAspSettingDialog(TAspParam& aParam);
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	private:
+       
+        /**
+        * Called by framework before the dialog is shown.
+        * @param None
+		* @return None
+        */
+		void PostLayoutDynInitL();
+
+        /**
+        * Called by framework after the dialog is shown.
+        * @param None
+		* @return None
+        */
+		void PreLayoutDynInitL();
+
+		/**
+		* Handles menu events.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		void ProcessCommandL(TInt aCommandId);
+	
+		/**
+		* Handles menu events, ProcessCommandL calls this.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		void DoProcessCommandL(TInt aCommandId);
+
+        /**
+        * From the base class.
+		* Called by framework for key event handling.
+        * @param aKeyEvent.
+		* @param TEventCode.
+		* @return Return code.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+
+        /**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+		TBool OkToExitL(TInt aButtonId);
+
+		/**
+        * From the base class.
+		* Called by framework before menu is shown.
+        * @param aResourceId Menu resource id.
+		* @param aMenuPane Pointer to the menu.
+        * @return None.
+        */
+		void DynInitMenuPaneL(TInt aResourceID,	CEikMenuPane* aMenuPane);
+
+	   /**
+		* From the base class.
+        * Called when dialog is activated.
+        * @return None.
+        */
+		void ActivateL();
+		
+		/**
+		* Method to get context sensitive help topic.
+        * @param aContext Help topic to open.
+		* @return None.
+        */
+		void GetHelpContext(TCoeHelpContext& aContext) const;
+		
+		/**
+		* Called when display resolution changes.
+        * @param aType.
+		* @return None.
+        */
+		void HandleResourceChange(TInt aType);
+		
+		/**
+		* Sets settings dialog icons.
+        * @param None.
+		* @return None.
+        */
+		void SetIconsL();
+		
+
+    private: // from MEikListBoxObserver
+        /**
+        * From MEikListBoxObserver, called by framework.
+        * @param aListBox.
+        * @param aEventType.
+		* @return None
+        */
+		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+	
+    private:  // from MAspDbEventHandler
+		/**
+        * From MAspDbEventHandler
+        * @param aStatus EClose, EUnlock, ECommit, ERollback, or ERecover (d32dbms.h).
+        * @return None. 
+        */
+		void HandleDbEventL(TAspDbEvent aEvent);
+
+	private: // from MAspActiveCallerObserver
+		/**
+        * From MAspActiveCallerObserver
+		* Called when CAspActiveCaller completes.
+        * @param aCallId.
+        * @return None.
+        */
+		void HandleActiveCallL(TInt aCallId);
+
+	private: // from MAspSyncObserver
+		/**
+        * From MAspSyncObserver
+		* Called when synchronization completes.
+        * @param aError.
+        * @param aInfo1.
+        * @return None.
+        */
+		void HandleSyncEventL(TInt aError, TInt aInfo1);
+
+
+    private:
+    
+    
+        	/**
+		* Handles setting item editing.
+		* @param None.
+		* @return None.
+		*/
+		void HandleOKL();
+		
+		/**
+        * Creates icon.
+		* @param aId.
+        * @param aFileName.
+		* @param aFileIndex.
+		* @param aFileMaskIndex.
+        * @return Created icon.
+        */
+		CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex);
+
+		/**
+        * Creates set type profile.
+		* @param None.
+        * @return None.
+        */
+		void CreateProfileL();
+
+		/**
+        * Creates application type profile.
+		* @param None.
+        * @return None.
+        */
+		void CreateAppProfileL();
+
+		/**
+        * Creates application type profile for sync app.
+		* @param None.
+        * @return None.
+        */
+		TBool CreateAppProfileFromSyncAppL();
+        		
+		/**
+        * Changes active profile.
+		* @param None.
+        * @return None.
+        */
+        void ChangeProfileL();
+        
+		/**
+        * Shows profile dialog.
+		* @param aEditMode.
+		* @param aFocus 
+        * @return None.
+        */
+		void EditProfileL(TInt aEditMode ,TInt aFocus);
+
+		/**
+        * Shows profile dialog.
+		* @param TInt aEditMode.
+		* @param TInt aFocus.
+        * @return None.
+        */
+		void DoEditProfileL(TInt aEditMode ,TInt aFocus);
+
+		/**
+        * Syncs selected profile.
+		* @param None.
+        * @return None.
+        */
+		void SyncProfileL();
+
+		/**
+        * Syncs selected profile.
+		* @param None.
+        * @return None.
+        */
+		void CopyFromServerL();
+
+		/**
+        * Syncs selected profile.
+		* @param aSyncType.
+        * @return None.
+        */
+		void DoSyncProfileL(TInt aSyncType);
+
+		/**
+        * Shows context menu.
+		* @param aResource.
+        * @return None.
+        */
+        void ShowContextMenuL(TInt aResource);
+        
+		/**
+		* Initialilzes context menu.
+		* @param aMenuPane.
+		* @return None.
+		*/
+		void InitContextMenuL(CEikMenuPane* aMenuPane);
+
+		/**
+		* Initialilzes options menu.
+		* @param aMenuPane.
+		* @return None.
+		*/
+		void InitOptionsMenuL(CEikMenuPane* aMenuPane);
+		
+		/**
+		* Deletes sync profile.
+		* @param None.
+		* @return None.
+		*/
+		void DeleteProfileL();
+        
+		/**
+		* Shows log dialog.
+		* @param None.
+		* @return None.
+		*/
+		void ShowLogDialogL();
+
+		/**
+		* Shows auto sync dialog.
+		* @param None.
+		* @return None.
+		*/
+		void ShowAutoSyncDialogL();
+		
+		/**
+		* Shows popup info note about current profile.
+		* @param None.
+		* @return None.
+		*/
+		void ShowCurrentProfileInfoL();
+
+		/**
+		* Shows popup info note about current profile.
+		* @param None.
+		* @return None.
+		*/
+		void ShowCurrentProfileInfo();
+
+		/**
+		* Shows popup info note about current profile.
+		* @param aProfileId.
+		* @return Boolean.
+		*/
+		TBool ShowAutoSyncProfileInfoL();
+
+		/**
+		* Shows popup info note about current profile.
+		* @param aProfileId.
+		* @return Boolean.
+		*/
+		TBool ShowAutoSyncProfileInfo();
+		/**
+		* Update the MSK Label
+		* @param aCommandId command id.
+		* @param aResourceId resource id .
+	    */
+		void UpdateMiddleSoftKeyLabelL(TInt aCommandId,TInt aResourceId);
+
+		void ShowAutoSyncLog(TAny* /*aAny*/);
+
+    private:
+
+		/**
+		* Utility function.
+		* @param None.
+		* @return Dialog listbox.
+		*/
+		CAknDoubleLargeStyleListBox* ListBox();
+		
+	   /**
+		* Utility function.
+		* @param None.
+		* @return None
+		* To toggle Syncmlmail checkbox in profile settings
+		*/
+		void CancelMailBoxForEnterL();
+
+		/**
+		* Utility function.
+		* @param None.
+		* @return Sync handler.
+		*/
+        TBool SyncRunning();
+
+		/**
+		* Utility function.
+		* @param aProfileId.
+		* @return Profile's listbox index.
+		*/
+		TInt ProfileIndex(TInt aProfileId);
+
+		/**
+		* Utility function, sets listbox current item.
+		* @param None.
+		* @return None.
+		*/
+		void SetCurrentIndex();
+
+		/**
+		* Utility function, stores listbox current item.
+		* @param aIndex.
+		* @return Selected item index.
+		*/
+		void SetCurrentIndex(TInt aIndex);
+
+		/**
+		* Utility function, gets listbox current item.
+		* @param None.
+		* @return Current index.
+		*/
+		TInt CurrentIndex();
+		
+		/**
+		* Utility function, updates dialog cba.
+		* @param aResourceId.
+		* @return None.
+		*/
+		void UpdateCbaL(TInt aResourceId);
+
+		/**
+		* Sets currrent profile.
+		* @param aProfileId.
+		* @return None.
+		*/
+		void DoSetCurrentProfileL(TInt aProfileId);
+
+		/**
+		* Sets currrent profile.
+		* @param None.
+		* @return None.
+		*/
+		void SetCurrentProfileL();
+
+		/**
+		* Utility function.
+		* @param None.
+		* @return Selected profile.
+		*/
+		TAspProfileItem& CurrentProfileL();
+		
+		/**
+		* Utility function.
+		* @param None.
+		* @return ETrue if current profile exists, EFalse otherwise.
+		*/
+		TBool HasCurrentProfile();
+		
+		/**
+		* Utility function.
+		* @param aProfileId.
+		* @return ETrue if current profile has id aProfileId, EFalse otherwise.
+		*/
+		TBool IsCurrentProfile(TInt aProfileId);
+
+		/**
+		* Save current profile.
+		* @param None.
+		* @return None.
+		*/
+		void DoSaveCurrentProfileL();
+
+		/**
+		* Save current profile.
+		* @param None.
+		* @return None.
+		*/
+		TInt SaveCurrentProfile();
+		
+		/**
+		* Update content selection.
+		* @param None.
+		* @return None.
+		*/
+		void UpdateContentSelectionL();
+		
+		/**
+		* Update profile name.
+		* @param None.
+		* @return None.
+		*/
+		void UpdateProfileNameL();
+		
+		/**
+		* Check profile mandatory data
+		* @param None.
+		* @return Return code.
+		*/
+		TInt CheckMandatoryDataL();
+
+		/**
+		* Check profile mandatory data
+		* @param None.
+		* @return Return code.
+		*/
+		TInt DoCheckMandatoryDataL();
+
+		/**
+		* Update navi pane text.
+		* @param aText.
+		* @return None.
+		*/
+        void UpdateNavipaneL(const TDesC& aText);
+        
+		/**
+		* Show popup note.
+		* @param aText.
+		* @return None.
+		*/
+        void ShowPopupNoteL(const TDesC& aText);
+        
+		/**
+		* Cancels checkbox select/unselect.
+		* @param None.
+		* @return None.
+		*/
+        void CancelCheckboxEventL();
+        
+		/**
+		* Cancels checkbox select/unselect.
+		* @param None.
+		* @return None.
+		*/
+        void CancelCheckboxEvent();
+
+		/**
+		* Checks whether email content can be selected.
+		* @param None.
+		* @return EFalse if selection is not possible.
+		*/
+        TBool CheckEmailSelectionL();
+
+		/**
+		* Checks whether email content can be selected.
+		* @param None.
+		* @return EFalse if selection is not possible.
+		*/
+        TBool CheckEmailSelection();
+        
+      public:
+      
+        /**
+        * Updates listbox items.
+        * @param aUpdateProfileList.
+        * @return None.
+        */
+		void UpdateListBoxL();
+		
+        
+        /**
+		* Sets currrent profile.
+		* @param aProfileId.
+		* @return None.
+		*/
+		void SetCurrentProfile(TInt aProfileId);
+		
+		/**
+		* Delete Auto sync history
+		* @param None.
+		* @return None.
+		*/
+		void DeleteAutoSyncHistory();   
+		
+#ifdef RD_DSUI_TIMEDSYNC 
+
+		void SetNextProfileL();
+        void SetPreviousProfileL();
+        void UpdateTabsL();
+        
+#endif
+		void UpdateMarkMenuItem(CEikMenuPane* aMenuPane);
+		void SaveSelectionL();
+
+
+		
+    /**
+		* Checks whether the profile is already opened in another application.
+		* @param aProfileId.
+		* @return ETrue if profile locked ,else EFalse.
+		*/        
+        TBool IsProfileLockedL(TInt aProfileId);
+     
+     
+     /**
+		* Checks whether sync is ongoing for a profile
+		* @param aProfileId.
+		* @return ETrue if sync ongoing ,else EFalse.
+		*/        
+        TBool IsSyncOnGoingL(TInt aProfileId);
+
+#ifdef _DEBUG
+    private: 
+        void TestL();
+        void LogDatabaseEvent(TAspDbEvent aEvent);
+#endif
+
+		
+
+    private:
+   		// list that contains all contents (applications)
+		CAspContentList* iContentList;
+
+		// id of the calling application
+		TInt iApplicationId;
+
+		// id of the dialog mode
+		TInt iDialogMode;
+
+        // profile list (from CNSmlDSSettings)
+		CAspProfileList* iProfileList;
+
+		// list of profiles
+		CAknDoubleLargeStyleListBox* iSettingListBox;
+
+		// for title and icon handling
+		CStatusPaneHandler* iStatusPaneHandler;
+		
+		// for hiding tabs
+		CAknNavigationControlContainer* iNaviPane;
+
+    	// resource handler
+		CAspResHandler* iResHandler;
+
+		// for getting settings database notifications 
+		CAspDbNotifier* iDbNotifier;
+
+		// currently selected listbox item
+		TInt iCurrentListBoxIndex;
+
+		// performs sync operation, uses CNSmlAppEngine
+		CAspSyncHandler* iSyncHandler;
+		
+		// session with sync server
+		RSyncMLSession* iSyncSession;
+		
+		// is setting database in read only state
+		TBool iSettingEnforcement;
+		
+		// long buffer for string handling
+		TBuf<KBufSize255> iBuf;
+
+		// currently open profile id
+		TInt iCurrentProfileId;
+
+		// current profile name
+		TBuf<KAspMaxProfileNameLength> iCurrentProfileName;
+		
+		// popup note
+        CAknInfoPopupNoteController* iPopupNote;
+        
+		// for bearer type list construction
+		CAspBearerHandler* iBearerHandler;
+		
+		// to know whether autosyncdialog is active or not
+		TBool iAutoSyncDialog;
+
+#ifdef RD_DSUI_TIMEDSYNC	
+		// Tab group owned by the navigation decorator.
+        CAspTabbedNaviPaneHandler* iTabHandler;
+
+		//Set if any profile is edited or profile count changed
+		TBool iUpdateTabGroup;
+#endif
+
+		
+    };
+
+
+#endif    // ASPSETTINGDIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspSettingViewDialog.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,332 @@
+/*
+* 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: Edit view setting dialog 
+*
+*/
+
+
+
+#ifndef ASPSETTINGVIEWDIALOG_H
+#define ASPSETTINGVIEWDIALOG_H
+
+
+//  INCLUDES
+
+#include "AspDialogUtil.h"
+
+#include <e32base.h>
+#include <aknlists.h>
+#include <AknDialog.h>
+
+#include <AknInfoPopupNoteController.h> // CAknInfoPopupNoteController
+
+
+
+// CLASS DECLARATION
+
+
+/**
+*  CAspSettingViewDialog
+*
+* CAspSettingViewDialog is used for editing various settings.
+*/
+NONSHARABLE_CLASS (CAspSettingViewDialog) : public CAknDialog, public MEikListBoxObserver
+    {
+    public:
+    
+    
+	public:
+	    /**
+        * Launches dialog.
+        * @param aParam Class that contains dialog parameters.
+        * @return Completion code.
+        */
+		static TBool ShowDialogL(const TAspParam& aParam);
+
+	public:// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+		static CAspSettingViewDialog* NewL(const TAspParam& aParam);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CAspSettingViewDialog();
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CAspSettingViewDialog(const TAspParam& aParam);
+	
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+	private:
+        /**
+        * From MEikListBoxObserver, called by framework.
+        * @param aListBox.
+        * @param aEventType.
+		* @return None
+        */
+		void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+        /**
+        * From the base class.
+		* Called by framework before the dialog is shown.
+        * @param None
+		* @return None
+        */
+        void PreLayoutDynInitL();
+
+        /**
+        * From the base class.
+		* Called by framework before exiting the dialog.
+        * @param aButtonId Button id.
+		* @return ETrue to exit\ EFalse to not to exit.
+        */
+        TBool OkToExitL(TInt aButtonId);
+
+        /**
+        * From the base class.
+		* Called by framework for key event handling.
+        * @param aKeyEvent.
+		* @param aType.
+		* @return Return code.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+
+        /**
+        * From the base class.
+		* Called by framework when dialog is activated.
+        * @param None.
+		* @return None.
+        */
+		void ActivateL();
+		
+		/**
+		* Method to get context sensitive help topic.
+        * @param aContext Help topic to open.
+		* @return None.
+        */
+		void GetHelpContext(TCoeHelpContext& aContext) const;
+
+
+		/**
+		* From the base class.
+		* Handles menu events.
+		* @param  aCommandId Command id.
+		* @return None.
+		*/
+		void ProcessCommandL(TInt aCommandId);
+		
+		/**
+		* From base class.
+		* Called when UI layout changes. 
+		* @param aType.
+    	* @return None.
+		*/
+        void HandleResourceChange(TInt aType);
+
+    private:
+		/**
+		* Handles setting item editing.
+		* @param None.
+		* @return None.
+		*/
+		void HandleOKL();
+		
+		/**
+		* Set setting list icons.
+		* @param None.
+		* @return None.
+		*/
+		void SetIconsL();
+
+	
+	public:  // common editors
+	
+    
+    private:
+    
+		/**
+		* Handles setting item editing.
+		* @param aItem Setting item data.
+		* @return Return code.
+		*/
+	   void EditSettingItemL(CAspListItemData& aItem);
+		
+		/**
+		* Opens profile setting dialog.
+		* @param None.
+		* @return Return code.
+		*/
+	  TInt EditSettingItemProfileSettingL();
+	  
+	  	/**
+		* Opens schedule dialog.
+		* @param None.
+		* @return Return code.
+		*/
+	  TInt EditSettingItemSchedulingSettingL();
+    	/**
+		* Opens content dialog.
+		* @param None.
+		* @return Return code.
+		*/
+	  TInt EditSettingItemSyncContentL(CAspListItemData& aItem);
+
+
+    private:
+
+		
+
+	private:
+		/**
+        * Create one CNSmlDSProfileData for each setting.
+        * @param None.
+        * @return None.
+        */
+		void CreateSettingsListL();
+		
+		/**
+        * Initalizes setting item needed for listbox handling.
+        * @param aItem.
+        * @return None.
+        */
+		void InitSettingItemL(CAspListItemData* aItem);
+		
+		/**
+        * Add settings titles into listbox.
+        * @param aListBox.
+        * @param aItemList List of setting items.
+        * @return None.
+        */
+		void UpdateListBoxL(CEikTextListBox* aListBox, CAspSettingList* aItemList);
+
+		/**
+        * Adds profile setting into item list.
+        * @param None.
+		* @return None.
+        */
+		void AddProfileSettingItemL();
+		/**
+        * Adds scheduling setting into item list.
+        * @param None.
+		* @return None.
+        */
+		void AddSchedulingSettingItemL();
+		/**
+        * Adds sync contents into item list.
+        * @param None.
+		* @return None.
+        */
+		void AddContentItemsL();
+		
+		
+
+    private:
+
+		/**
+        * Creates icon.
+		* @param aId.
+        * @param aFileName.
+		* @param aFileIndex.
+		* @param aFileMaskIndex.
+        * @return Created icon.
+        */
+		CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex);
+		
+		/**
+		* Returns setting item with listbox position aIndex.
+		* @param aIndex Listbox index.
+		* @return Pointer to setting item.
+        */
+		CAspListItemData* GetItemForIndex(TInt aIndex);
+
+		/**
+        * Returns setting item with id aItemId.
+        * @param aItemId Item id.
+        * @return Pointer to setting item.
+        */
+		CAspListItemData* Item(TInt aItemId);
+
+		/**
+		* Returns listbox.
+		* @param None.
+		* @return Pointer to listbox.
+		*/
+		CAknSettingStyleListBox* ListBox();
+
+		/**
+		* Returns profile.
+		* @param None.
+		* @return Pointer to sync profile.
+		*/
+		//CAspProfile* Profile();
+
+		TInt GetIndexFromProvider(TInt aDataProvider);
+
+		void SetVisibility();
+
+	private:
+		// setting list
+		CAknSettingStyleListBox* iSettingListBox;
+
+		// list of setting items
+		CAspSettingList *iSettingList;
+		
+     	// profile data
+		CAspProfile* iProfile;
+
+   		// sync session
+		RSyncMLSession* iSyncSession;
+
+		// for title and icon handling
+		CStatusPaneHandler* iStatusPaneHandler;
+
+		// resource handler
+		CAspResHandler* iResHandler;
+
+		// dialog edit mode
+		TInt iEditMode;
+
+		// long buffer for string handling
+		TBuf<KBufSize255> iBuf;
+
+		TInt iDataProviderId;
+		
+		// list that contains all contents (applications)
+		CAspContentList* iContentList;
+		
+		// list that contains all profiles
+		CAspProfileList* iProfileList;
+
+		// id of the calling application
+		TInt iApplicationId;
+
+		CAspSchedule* iSchedule;
+
+				
+		};
+
+
+#endif      // ASPSETTINGVIEWIALOG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspState.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,195 @@
+/*
+* 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: Utility class to handle sync phases during progress 
+*
+*/
+
+
+#ifndef ASPSTATE_H
+#define ASPSTATE_H
+
+
+//  INCLUDES
+#include <e32base.h>
+
+
+// CONSTANTS
+
+const TInt KTotalProgressUnknown = -1;
+const TInt KTotalProgress = 100;
+
+
+/**
+* CAspState
+*
+* CAspState contains sync state information.
+*/
+NONSHARABLE_CLASS (CAspState) : public CBase
+    {
+    public:
+		enum TSyncPhase
+			{
+			EPhaseConnecting = 0,
+			EPhaseInitialising,
+			EPhaseSending,
+			EPhaseReceiving,
+			EPhaseSynchronizing,
+			EPhaseDisconnecting,
+			EPhaseCanceling,
+			EPhaseNone
+			};
+
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CAspState* NewL();
+        
+        /**
+        * Destructor.
+        */
+        ~CAspState();
+        
+    private:
+        /**
+        * C++ default constructor.
+        */
+        CAspState();
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+    public:
+        /**
+        * Reset state variables.
+        * @param None.
+        * @return None.
+        */
+        void Reset();
+        
+    public:
+        /**
+        * Set synchronization phase.
+        * @param aPhase synchronization phase.
+        * @return None.
+        */
+        void SetSyncPhase(TInt aPhase);
+        
+        /**
+        * Get synchronization phase.
+        * @param None.
+        * @return Synchronization phase.
+        */
+        TInt SyncPhase();
+
+        /**
+        * Set total sync progress.
+        * @param aCount Progress count.
+        * @return None.
+        */
+		void SetTotalProgress(TInt aCount);
+
+        /**
+        * Set sync progress.
+        * @param aCount Progress count.
+        * @return None.
+        */
+		//void SetProgress(TInt aCount);
+
+        /**
+        * Get total sync progress.
+        * @param None. 
+        * @return Progress count.
+        */
+		TInt TotalProgress();
+
+        /**
+        * Increase sync progress.
+        * @param None.
+        * @return None.
+        */
+        void IncreaseProgress();
+        
+        /**
+        * Increase sync progress.
+        * @param aCount.
+        * @return None.
+        */
+        void IncreaseProgress(TInt aCount);
+        
+        /**
+        * Get sync progress.
+        * @param None. 
+        * @return Progress count.
+        */
+		TInt Progress();
+
+        /**
+        * Has IncreaseProgress been called once.
+        * @param None. 
+        * @return Boolean.
+        */
+		TBool FirstProgress();
+
+        /**
+        * Set sync content name.
+        * @param aText Content name.
+        * @return None.
+        */
+        void SetContentL(const TDesC& aText);
+
+        /**
+        * Get sync content name.
+        * @param None. 
+        * @return Content name.
+        */
+		const TDesC& Content();
+
+        /**
+        * Resets progress state.
+        * @param None. 
+        * @return None.
+        */
+		void ResetProgress();
+		
+        /**
+        * Finds out whether total progress count is known.
+        * @param None. 
+        * @return ETrue if total progress count is known, EFalse otherwise.
+        */
+		TBool ProgressKnown();
+        
+    private:
+        // synchronization phase
+		TInt iSyncPhase;
+
+		// total number of sent/received sync items
+		TInt iTotalProgressCount;
+
+		// number of sent/received sync items
+		TInt iProgressCount;
+		
+		// number of increase progress calls, can different than iProgressCount
+		TInt iProgressCount2;
+
+		// name of the content being synced
+		HBufC* iSyncContent;
+    };
+
+#endif  // ASPSTATE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspSyncHandler.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,428 @@
+/*
+* 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: Creates sync job and receives progress events 
+*
+*/
+
+
+#ifndef ASPSYNCHANDLER_H
+#define ASPSYNCHANDLER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <SyncMLObservers.h>
+#include <textresolver.h>
+
+
+#include "AspProgressDialog.h"
+#include "AspState.h"
+#include "AspProfile.h"
+
+
+
+// CLASS DECLARATION
+
+
+/**
+* MAspProgressDialogObserver
+* 
+* Observer interface function for observing sync events.
+*/
+NONSHARABLE_CLASS (MAspSyncObserver)
+    {
+    public:
+        /**
+        * Callback method
+        * Get's called when a synchronization has completed.
+        */
+        virtual void HandleSyncEventL(TInt aError, TInt aInfo1) = 0;
+    };
+
+
+/**
+* TAspSyncParam
+*
+* This class is used as sync parameter type.
+*/
+NONSHARABLE_CLASS (TAspSyncParam)
+	{
+    public:
+    	TAspSyncParam(TInt aApplicationId);
+        
+    public:
+		// calling application id
+		TInt iApplicationId;
+
+		// profile id
+		TInt iProfileId;
+
+		// job id
+		TInt iJobId;
+
+		// taskId
+		TInt iTaskId;
+
+        // sync direction
+		TInt iSyncDirection;
+		
+		// progress dialog modality
+		TInt iDialogMode;
+	};
+
+
+/**
+* CAspSyncHandler
+* 
+* CAspSyncHandler handles data synchronizing.
+*/
+NONSHARABLE_CLASS (CAspSyncHandler) : public CBase, 
+                        public MAspProgressDialogObserver,
+						public MAspActiveCallerObserver,
+						public MSyncMLEventObserver,
+						public MSyncMLProgressObserver
+						
+	{
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+	    static CAspSyncHandler* NewL(const TAspParam& aParam);
+
+	    /**
+        * Destructor.
+        */
+	    virtual ~CAspSyncHandler();
+
+    private:
+	    /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+
+	    /**
+        * C++ default constructor.
+        */
+	    CAspSyncHandler(const TAspParam& aParam);
+
+		
+	private:	
+        /**
+        * From MAspProgressDialogObserver
+    	* Gets called when sync progress dialog closes.
+        * @param aButtonId Button id.
+        * @return None
+        */
+		void HandleDialogEventL(TInt aButtonId);
+
+    
+	private: // from MAspActiveCallerObserver
+		/**
+        * From MAspActiveCallerObserver
+		* Called when CAspActiveCaller completes.
+        * @param aCallId.
+        * @return None.
+        */
+		void HandleActiveCallL(TInt aCallId);
+
+
+    private:    // from MSyncMLEventObserver
+        
+		/**
+        * From MSyncMLEventObserver
+		* Called when SyncML session events oocur.
+        * @param aEvent.
+        * @param aIdentifier.
+        * @param aError.
+        * @param aAdditionalData.
+        * @return None.
+        */
+        void OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier, TInt aError, TInt aAdditionalData);
+	
+	
+    private:  //from MSyncMLProgressObserver
+	    
+	    /**
+	    * Receives notification of a synchronisation error.
+        * @param aErrorLevel  The error level.
+	    * @param aError		  The type of error. This is one of the SyncMLError error values.	
+	    * @param aTaskId      The ID of the task for which the error occurred.
+	    * @param aInfo1       An integer that can contain additional information about the error. Normally 0.
+	    * @param aInfo2       An integer that can contain additional information about the error. Normally 0.
+	    * @return             None.
+	    */
+	    void OnSyncMLSyncError(TErrorLevel aErrorLevel, TInt aError, TInt aTaskId, TInt aInfo1, TInt aInfo2);
+       	
+       	/**
+	    * Receives notification of synchronisation progress.
+	    * @param aStatus	The current status, e.g. 'Connecting'.
+	    * @param aInfo1	An integer that can contain additional information about the progress.
+	    * @param aInfo2	An integer that can contain additional information about the progress.
+	    */
+	    void OnSyncMLSyncProgress(TStatus aStatus, TInt aInfo1, TInt aInfo2);
+	    
+	    /**
+	    * Receives notification of modifications to synchronisation tasks.
+        * @param aTaskId               The ID of the task.
+	    * @param aClientModifications  Modifications made on the clients Data Store.
+	    * @param aServerModifications  Modifications made on the server Data Store.
+	    */
+	    void OnSyncMLDataSyncModifications(TInt aTaskId, const TSyncMLDataSyncModifications& aClientModifications, const TSyncMLDataSyncModifications& aServerModifications);
+
+	private:
+	    void OnSyncMLDataSyncModificationsL(TInt aTaskId, const TSyncMLDataSyncModifications& aClientModifications, const TSyncMLDataSyncModifications& aServerModifications);
+	    
+	    
+	private:
+        /**
+        * Shows progress dialog.
+		* @param None.
+        * @return Error code.
+        */
+        void ShowProgressDialogL();
+
+        /**
+        * Shows error dialog.
+		* @param None.
+        * @return Error code.
+        */
+        void ShowErrorNote();
+        
+        /**
+        * Completes sync operation.
+		* @param aError.
+        * @return None.
+        */
+        void SynchronizeCompleted(TInt aError);
+	
+	public:
+	
+        /**
+        * Performs synchronization.
+		* @param aSyncParam.
+        * @return None
+        */
+        void SynchronizeL(TAspSyncParam& aSyncParam);
+        
+        /**
+        * Sets sync observer.
+		* @param aObserevr.
+        * @return None
+        */
+        void SetObserver(MAspSyncObserver* aObserver);
+
+    
+    private:
+        /**
+        * Performs synchronization.
+		* @param aSyncParam.
+        * @return None
+        */
+        void DoSynchronizeL(TAspSyncParam& aSyncParam);
+
+	private:
+		/**
+        * Utility function.
+        * @return CAspResHandler.
+        */
+		CAspResHandler* ResHandlerL();
+		
+		/**
+        * Utility function.
+        * @return Progress dialog.
+        */
+		CAspProgressDialog* Dialog();
+
+		/**
+        * Utility function.
+        * @return Sync state.
+        */
+		CAspState* State();
+
+    public:
+
+		/**
+        * Utility function.
+        * @return ETrue if sync is currently running, EFalse otherwise.
+        */
+		TBool SyncRunning();
+
+    private:
+		/**
+        * Updates progress dialog.
+        * @param None.
+    	* @return None.
+        */
+		void UpdateDialogL();
+
+		/**
+        * Updates progress dialog.
+        * @param None.
+    	* @return None.
+        */
+		void UpdateDialog();
+
+		/**
+        * Get list profiles that can be used for syncing.
+        * @param aApplicationId Application (sync content) id.
+    	* @return None.
+        */
+		CAspProfileList* GetProfileListLC(TInt aApplicationId);
+		
+		/**
+        * Utility function.
+        * @param None.
+        * @return None.
+        */
+        void CreateContentListL();
+
+		/**
+        * Utility function.
+        * @param None.
+        * @return ETrue if server alert sync, EFalse otherwise.
+        */
+        TBool IsServerAlertSync();
+
+		/**
+        * Opens sync session.
+        * @param None.
+        * @return None.
+        */
+        void OpenSyncSessionL();
+
+		/**
+        * Closes sync session.
+        * @param None.
+        * @return None.
+        */
+        void CloseSyncSession();
+        
+		/**
+        * Calculates progress count.
+        * @param aC Phone side sync events.
+        * @param aS Server side sync events.
+        * @return Progress count.
+        */
+        TInt ProgressCount(const TSyncMLDataSyncModifications& aC,
+                           const TSyncMLDataSyncModifications& aS);
+                           
+		/**
+        * Checks that sync profile has valid local database.
+        * @param aProfileId.
+        * @return None.
+        */
+        void CheckLocalDatabaseL(TInt aProfileId);
+        
+		/**
+        * Checks whether progress dialog needs to be updated.
+        * @param None.
+        * @return Boolean.
+        */
+        TBool UpdateRequired();
+        
+		/**
+        * Completes sync with short delay.
+        * @param aError.
+        * @return None.
+        */
+        void CompleteWithDelay(TInt aError);
+        
+        TBool IsRoamingL();
+        
+        void ReadRepositoryL(TInt aKey, TInt& aValue);
+        
+        TInt BearerTypeL(TInt aProfileId);
+        
+#ifdef _DEBUG
+    private:  // debug code
+        void GetSyncStatusText(TDes& aText, MSyncMLProgressObserver::TStatus aStatus);
+        void GetSyncEventText(TDes& aText, MSyncMLEventObserver::TEvent aEvent);
+        void LogSessionEvent(TEvent& aEvent, TInt aIdentifier, TInt aError);
+        void LogProgressEvent(TStatus& aStatus, TInt aInfo1);
+        void LogErrorEvent(TErrorLevel aErrorLevel, TInt aError);
+        void LogModificationEvent(TInt aTaskId, const TSyncMLDataSyncModifications& aC, const TSyncMLDataSyncModifications& aS);
+        void LogModificationEvent(TInt aTaskId, const TDesC& aText);
+#endif
+
+    private:
+		// id of the calling application
+		TInt iApplicationId;
+
+		// profile id
+		TInt iProfileId;
+		
+		// sync session
+		RSyncMLSession iSyncSession;
+
+		// sync job
+		RSyncMLDataSyncJob iSyncJob;
+		
+		// needed for getting data provider names
+		CAspContentList* iContentList;
+		
+		// shows sync progress dialog
+		CAspProgressDialog* iProgressDialog;
+
+		// sync handler state
+		CAspState* iState;
+
+		// reads strings
+		CAspResHandler* iResHandler;
+
+		// for making function call via active scheduler
+		CAspActiveCaller* iActiveCaller;
+
+		// is sync currently running
+		TBool iSyncRunning;
+		
+		// is current sync servert alert sync
+		TBool iServerAlertSync;
+
+		// is sync session open
+		TBool iSyncSessionOpen;
+		
+		// sync error code
+		TInt iSyncError;
+		
+		// current sync job id
+		TInt iCurrentSyncJobId;
+		
+		// sync observer, used for sending sync completion event
+		MAspSyncObserver* iSyncObserver;
+
+        // for converting error code to error string
+        CTextResolver* iTextResolver;
+        
+		// has "sync completed" event arrived 
+		TBool iCompleteEventReceived;
+		
+		// has "sync stopped" event arrived 
+		TBool iStopEventReceived;
+		
+		// sync modality 
+		TBool iIsSynchronousOperation;
+		
+	    // for stopping code until sync is finished
+    	CActiveSchedulerWait* iWait;
+		
+	};
+	
+	
+
+
+	
+#endif  // ASPSYNCHANDLER_H
+
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspSyncUtil.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,248 @@
+/*
+* 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: Utility methods 
+*
+*/
+
+
+#ifndef ASPSYNCUTIL_H
+#define ASPSYNCUTIL_H
+
+
+// INCLUDES
+#include <e32base.h>
+#include "AspSyncHandler.h"
+#include "AspSettingDialog.h"
+
+
+
+// CLASS DECLARATION
+
+
+/**
+* CAspSyncUtil class
+*
+* CAspSyncUtil implements functionality that is exported in CSyncUtilApi. 
+*/
+NONSHARABLE_CLASS(CAspSyncUtil) : public CBase 
+	{
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+	    static CAspSyncUtil* NewL();
+
+	    /**
+        * Destructor.
+        */
+	    virtual ~CAspSyncUtil();
+
+    private:
+	    /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+
+	    /**
+        * C++ default constructor.
+        */
+	    CAspSyncUtil();
+
+	
+	public:
+		
+        /**
+        * Performs automatic (scheduled) data synchronization. Does not create 
+        * any UI.Gets synchronization data from central repository.
+        * @param aScheduleTaskFile File that contains sync scheduling task. 
+	    * @return None.
+        */
+        void SynchronizeL(RFile& aScheduleTaskFile);        
+        
+        /**
+        * Performs synchronization.
+		* @param aApplicationId Id of calling application.
+		* @param aInfo1.
+		* @param aInfo2.
+        * @return None
+        */
+		void DoSynchronizeL(TInt aApplicationId, TInt aInfo1, const TDesC& aInfo2);
+		
+        /**
+        * Performs synchronization. Creates necessary UI.
+        * @param aApplicationId Calling application id from AiwGenericParam.hrh. 
+        * @param aJobId Sync task id, KErrNotFound if not used. 
+        * @param aInfo1 Extra information, KErrNotFound if not used. 
+        * @param aInfo2 Extra information, KNullDesC if not used. 
+	    * @return None.
+        */
+		void SynchronizeL(TInt aApplicationId, TInt aJobId, TInt aInfo1, TDes& aInfo2);
+
+        /**
+        * Performs synchronization. Creates necessary UI.
+        * @param aApplicationId Calling application id from AiwGenericParam.hrh. 
+        * @param aJobId Sync task id, KErrNotFound if not used. 
+        * @param aInfo1 Extra information, KErrNotFound if not used. 
+        * @param aInfo2 Extra information, KNullDesC if not used. 
+	    * @return None.
+        */
+		void DoSynchronizeL(TInt aApplicationId, TInt aJobId, TInt aInfo1, TDes& aInfo2);
+
+        /**
+        * Shows settings dialog for changing sync settings.
+		* @param aApplicationId Calling application id.
+		* @param aProfileId Profile id.
+		* @param aDialogMode Dialog mode.
+        * @return None.
+        */
+		void ShowSettingsDialogL(TInt aApplicationId, TInt aProfileId, TInt aDialogMode);
+		
+        /**
+        * Shows settings dialog for changing sync settings.
+		* @param aApplicationId Calling application id.
+        * @return None.
+        */
+		void ShowProfileDialogL(TInt aApplicationId);
+		
+        /**
+        * Shows UI for editing synchronization settings.
+        * @param aApplicationId Calling application id from AiwGenericParam.hrh.
+        * @param aInfo1 Extra information, KErrNotFound if not used. 
+        * @param aInfo2 Extra information, KNullDesC if not used.
+	    * @return None.
+        */
+		void ShowSettingsL(TInt aApplicationId, TInt aInfo1, TDes& aInfo2);
+ 		
+        /**
+        * Shows UI for editing synchronization profile.
+        * @param aApplicationId Calling application id from AiwGenericParam.hrh.
+  	    * @return None.
+        */
+		void EditProfileL(TInt aApplicationId);
+		
+        /**
+        * Shows UI for editing synchronization profile.
+        * @param aApplicationId Calling application id from AiwGenericParam.hrh.
+        * @param aProfileId.
+  	    * @return None.
+        */
+		void DoEditProfileL(TInt aAplicationId, TInt aProfileId, TInt aDialogMode);
+
+        /**
+        * Shows UI for editing synchronization profile.
+        * @param aApplicationId Calling application id from AiwGenericParam.hrh.
+        * @param aProfileId.
+  	    * @return None.
+        */
+		void DoEditReadOnlyProfileL(TInt aAplicationId, TInt aProfileId, 
+		                            TInt aDialogMode);
+
+    private:
+
+		/**
+        * Checks profile mandatory fields.
+        * @param aProfileId.
+    	* @return ETrue if mandatory fields are ok, EFalse otherwise.
+        */
+		TBool CheckMandatoryL(TInt aProfileId);
+		
+		/**
+        * Checks already selected profile for mandatory content and correct protocol version
+        * @param aProfileId 
+        * @param aLocalDatabase SyncML mail details name for Email app ,KNullDesC otherwise
+  	    * @return ETrue if task exists and correct protocol selected, EFalse otherwise.
+        */
+		
+		TBool CheckTaskAndProtocolL(TInt aProfileId ,const TDesC& aLocalDatabase);
+
+		/**
+        * Find out whether sync data provider exists.
+        * @param aApplicationId.
+    	* @return ETrue if provider exists, EFalse otherwise.
+        */
+		TBool DataProviderExist(TInt aApplicationId);
+		
+		/**
+        * Checks that app id is valid and data provider exists.
+        * @param aApplicationId.
+    	* @return None.
+        */
+		void CheckAppAndProviderL(TInt aApplicationId);
+		
+		/**
+        * Opens session with sync server.
+        * @param None.
+    	* @return None.
+        */
+		void OpenSyncSessionL();
+
+		/**
+        * Closes session with sync server.
+        * @param None.
+    	* @return None.
+        */
+		void CloseSyncSession();
+		
+		/**
+        * Creates contentlist.
+        * @param None.
+    	* @return None.
+        */
+		void CreateContentListL();
+		
+		/**
+        * Selects profile.
+        * @param aProfileId.
+        * @param aTaskId.
+    	* @param aResourceId.
+    	* @param aLocalDatabase
+    	* @param aCheckId 
+    	* @return None.
+        */
+        TBool SelectProfileL(TInt& aProfileId, TInt& aTaskId, 
+                             TInt aResourceId, const TDesC& aLocalDatabase,TBool aCheckId);
+
+    private:
+		// id of the calling application
+		TInt iApplicationId;
+
+   		// sync session
+		RSyncMLSession iSyncSession;
+		
+		// is sync session open
+		TBool iSyncSessionOpen;
+		
+		// performs sync operation, uses CNSmlAppEngine
+		CAspSyncHandler* iSyncHandler;
+
+		// sync data provider list
+		CAspContentList* iContentList;
+		
+		// settings dialog
+		CAspSettingDialog* iSettingDialog;
+		
+    	// is setting database in read only state
+		TBool iSettingEnforcement;
+		
+    	// resource handler
+		CAspResHandler* iResHandler;
+    };
+
+
+
+#endif  // ASPSYNCUTIL_H
+
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspSyncUtil.rh	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* 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: Resource header 
+*
+*/
+
+#ifndef _ASP_SYNCUTL_RH
+#define _ASP_SYNCUTL_RH
+
+
+
+ 
+
+enum TDialogControlIds
+    {
+    EAspSyncProgressNote = 1,
+    EAspProfileDialogList = 2,
+	EAspSettingDialogList = 3,
+    EAspConnectionDialogList = 4,
+    EAspAutoSyncDialogList = 5,
+    EAspProfileWizardDialogList = 6,
+    EAspProfileWizardDialogList2 = 7,
+    EAspAutoSyncProfileDialogList = 8,
+    EAspSettingViewDialogList = 9,
+    EAdvanceSettingsDialogList = 10
+
+    };
+
+
+enum TAspSettingListIcons
+	{
+	EAspHttpIcon,
+	EAspHttpIconMask,
+	EAspHttpOffIcon,
+	EAspHttpOffIconMask,
+	EAspBTIcon,
+	EAspBTIconMask,
+	EAspBTOffIcon,
+	EAspBTOffIconMask,
+	EAspUSBIcon,
+	EAspUSBIconMask,
+	EAspUSBOffIcon,
+	EAspUSBOffIconMask
+	};
+
+
+enum TAspDialogs
+	{
+	EAspProfileListDialog = 1,
+    EAspProfileDialog = 2,
+    EAspContentDialog = 3,
+	EAspSettingDialog = 4,
+    EAspConnectionDialog = 5,
+    EAspFilterDialog = 6
+	};
+
+enum TAspMenuCommands
+	{
+	EAspMenuCmdSync = 1,
+	EAspMenuCmdEdit = 2,
+	EAspMenuCmdNew = 3,
+	EAspMenuCmdNewApplication = 4,
+	EAspMenuCmdNewSet = 5,
+	EAspMenuCmdDelete = 6,
+    EAspMenuCmdViewLog = 7,
+	EAspMenuCmdHelp = 8,
+	EAspMenuCmdExit = 9,
+    EAspMenuCmdChange = 10,
+    EAspMenuCmdEnable = 11,
+    EAspMenuCmdDisable = 12,
+    EAspMenuCmdChangeProfile = 13,
+    EAspMenuCmdCopyFromServer = 14,
+    EAspMenuCmdAutoSync = 15,
+    EAspMenuCmdView = 16,
+    EAspMenuCmdSelect = 17,
+    EAspMenuCmdUnselect = 18,
+    EAspMenuCmdOpen = 19,
+    EAspMenuCmdMark = 20,
+    EAspMenuCmdUnmark = 21,
+    EAspMenuCmdAdvanceSettings = 22,
+    EAspMenuCmdRoamingSettings = 23,
+    EAspMenuCmdAlwaysAsk = 24,
+    EAspMenuCmdAlwaysAllow = 25,
+    EAspMenuCmdNeverAllow = 26
+
+
+	};
+
+
+enum
+	{
+	EAspSyncProviderCmdSynchronize = 1,
+    EAspSyncProviderCmdSettings
+	};
+
+
+enum
+	{
+	EAspMaxProfileNameLength = 50,
+        EAspMaxPasswordLength = 22
+	};
+
+
+
+#endif  // _ASP_SYNCUTL_RH
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspSyncUtilApi.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,110 @@
+/*
+* 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:  Contains functions that are exported from AspSyncUtil for
+*                performing data synchronization.
+*
+*/
+
+
+#ifndef ASPSYNCUTILAPI_H
+#define ASPSYNCUTILAPI_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32file.h>
+
+
+// FORWARD DECLARATIONS
+class CAspSyncUtil;
+
+
+
+// CLASS DECLARATION
+
+/**
+*  Public API for executing sync ui library functions. 
+* 
+*  @lib aspsyncutil.lib
+*  @since Series60_3.0
+*  
+*/
+class CSyncUtilApi : public CBase
+    {
+
+    public:
+        /**
+        * Two-phased constructor.
+        */
+	    IMPORT_C static CSyncUtilApi* NewL();
+
+	    /**
+        * Destructor.
+        */
+	    virtual ~CSyncUtilApi();
+
+    private:
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+
+        /**
+        * C++ default constructor.
+        */
+	    CSyncUtilApi();
+
+    public:
+
+       /**
+        * Shows UI for editing data synchronization settings.
+        * @since Series60_3.0
+        * @param aAppId Calling application id from AiwGenericParam.hrh.
+        * @param aInfo1 Extra information, KErrNotFound if not used. 
+        * @param aInfo2 Extra information, KNullDesC if not used.
+	    * @return None.
+        */
+		IMPORT_C void ShowSettingsL(TInt aAppId, TInt aInfo1, TDes& aInfo2);
+
+
+        /**
+        * Performs data synchronization. Creates necessary UI.
+        * @since Series60_3.0
+        * @param aAppId Calling application id from AiwGenericParam.hrh. 
+        * @param aJobId Sync job id, KErrNotFound if not used. 
+        * @param aInfo1 Extra information, KErrNotFound if not used. 
+        * @param aInfo2 Extra information, KNullDesC if not used. 
+	    * @return None.
+        */
+        IMPORT_C  void SynchronizeL(TInt aAppId, TInt aJobId, TInt aInfo1, TDes& aInfo2);
+
+ 
+        /**
+        * Performs automatic (scheduled) data synchronization. Does not create 
+        * any UI.Gets synchronization data from central repository.
+        * @since Series60_3.0
+        * @param aScheduleTaskFile File that contains sync scheduling task. 
+	    * @return None.
+        */
+		IMPORT_C void SynchronizeL(RFile& aScheduleTaskFile);
+
+    private:
+		CAspSyncUtil* iSyncUtil;
+    };
+
+
+#endif  // ASPSYNCUTILAPI_H
+
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/AspUtil.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,691 @@
+/*
+* 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: General utilities 
+*
+*/
+
+
+
+#ifndef ASPUTIL_H
+#define ASPUTIL_H
+
+// INCLUDES
+#include <e32base.h>
+#include <ecom.h>
+#include <eikenv.h> 
+
+
+#include <ApSettingsHandlerUI.h>
+
+#include <SyncMLClient.h>    // for RSyncMLSession
+#include <SyncMLClientDS.h>  // for RSyncMLDataSyncProfile
+
+#include <csch_cli.h> // RScheduler
+
+
+#include "AspDefines.h"
+
+
+// CONSTANTS
+
+
+
+// FORWARD DECLARATIONS
+class CAspProfile;
+class CAspProfileList;
+class CAspContentList;
+class CAspTask;
+class CAspFilter;
+class CAspSchedule;
+
+// CLASS DECLARATION
+
+
+/**
+* TAspParam
+*
+* This class is used as general parameter type.
+*/
+NONSHARABLE_CLASS (TAspParam)
+	{
+    public:
+		// calling application id
+		TInt iApplicationId;
+
+		// profile id
+		TInt iProfileId;
+
+		// dialog mode
+		TInt iMode;
+
+		// general id number
+		TInt iId;
+
+		// return value to caller.
+		TInt iReturnValue;
+		
+		// data provider id
+		TInt  iDataProviderId;
+		
+		// sync task id
+		TInt  iSyncTaskId;
+		
+		// sync profile
+		CAspProfile* iProfile;
+		
+		// sync task
+		CAspTask* iSyncTask;
+		
+		// sync filter
+		CAspFilter* iSyncFilter;
+		
+		// session with sync server
+		RSyncMLSession* iSyncSession;
+		
+		// profile list
+		CAspProfileList* iProfileList;
+		
+		// content list
+		CAspContentList* iContentList;
+
+		//auto sync schedule setting
+		CAspSchedule* iSchedule;
+		
+
+    public:
+    	TAspParam(TInt aApplicationId);
+		TAspParam(TInt aApplicationId, RSyncMLSession* aSyncSession);
+	};
+
+
+
+
+
+/**
+* TAspUtil
+* 
+* This class contains general utility functions. 
+*/
+NONSHARABLE_CLASS (TUtil)
+	{
+    public:
+        static void Panic(TInt aReason);
+		static void StrCopy(TDes& aTarget, const TDesC& aSource);
+		static void StrCopy(TDes& aTarget, const TDesC8& aSource);
+		static void StrCopy(TDes8& aTarget, const TDesC& aSource);
+		static HBufC* StrConversion(const TDesC& aText);
+		
+		static void StrAppend(TDes& aTarget, const TDesC& aSource);
+		static void StrInsert(TDes& aTarget, const TDesC& aSource);
+		static void Fill(TDes& aTarget, const TDesC& aOneCharStr, TInt aLength);
+		static TInt StrToInt(const TDesC& aText, TInt& aNum);
+		static TInt AddResFileL(const TDesC& aFile);
+		static TBool IsEmpty(const TDesC& aText);
+		
+		static TInt ProviderIdFromAppId(TInt aApplicationId);
+		static TInt ProviderIdFromAppId(TInt aApplicationId, TBool aOperatorProfile);
+		static TInt OperatorProviderIdFromAppId(TInt aApplicationId);
+		static TInt AppIdFromProviderId(TInt aAdapterId);
+		static TInt AppIdFromOperatorSpecificProviderId(TInt aAdapterId);
+		static TBool IsValidAppId(TInt aApplicationId);
+		static TBool IsValidSID(TInt aApplicationId);
+		
+		static void GetDateTextL(TDes& aText, TTime aDateTime);
+		static void GetTimeTextL(TDes& aText, TTime aDateTime);
+		static HBufC* SyncTimeLC(TTime aLastSync);
+		static void GetDateTimeTextL(TDes& aText, TTime aDateTime);
+		static TBool IsToday(TTime aTime);
+		static TTime ConvertUniversalToHomeTime(const TTime& aUniversalTime);
+		static void LaunchHelpAppL();
+		static void LaunchHelpAppL(CEikonEnv* aEikonkEnv);
+		static TBool SettingEnforcementStateL();
+		static TBool SettingEnforcementState();
+		static CDesCArray* NumberConversionLC(CDesCArray* aList);
+		
+		
+
+
+#ifdef _DEBUG		
+    public:		
+		static void GetMandatoryFieldText(TDes& aText, TInt aStatus);
+		static void Print(const TDesC& aText);
+		static void Print(const TDesC& aText, TInt aNum);
+		
+		static TTime TimeBefore();
+		static TInt TimeAfter(TTime aBefore);
+		static void TimeAfter(TTime aBefore, const TDesC& aText);
+		static void GetApplicationName(TDes& aText, TInt aApplicationId);
+#endif		
+	};
+
+
+
+/**
+*  TStr contains descriptor operations with range checking.
+*/
+NONSHARABLE_CLASS (TStr)
+    {
+    public:
+        TStr(const TDesC& aStr);
+       
+    public:
+        TPtrC Mid(TInt aPos, TInt aLen);
+        TPtrC Mid(TInt aPos);
+        TPtrC Left(TInt aPos);
+        TPtrC Right(TInt aPos);
+        TPtrC Trim();
+        TPtrC SubStr(TInt aStartPos, TInt aEndPos);
+        TPtrC SubStrEx(TInt aStartPos, TInt aEndPos);
+        TInt LastPos();
+        TInt Len();
+        TBool Compare(TInt aPos, TChar aChar);
+        TInt Find(TInt aPos, TChar aChar);
+        
+    public:	
+        TInt FirstNonSpace();
+        TInt LastNonSpace();
+        
+    private:
+        // reference to descriptor
+		const TDesC& iStr;
+    };
+
+
+/**
+*  TURIParser is used for parsing URI.
+*/
+NONSHARABLE_CLASS (TURIParser)
+    {
+    public:
+    enum TDefaultPortNumber
+	    {
+	    EDefaultHttpPort = 80,
+        EDefaultHttpsPort = 443
+    	};
+
+    enum TPortNumberRange
+	    {
+        EMinURIPortNumber = 1,
+        EMaxURIPortNumber = 65535
+    	};
+
+    public:
+        TURIParser(const TDesC& aStr);
+       
+    public:
+        void GetUriWithoutPort(TDes& aText);
+        void GetUriWithPort(TDes& aText, const TInt aPort);
+        TInt Port();
+        TInt DefaultPort();
+        static TBool IsValidUri(const TDesC& aText);
+        static TBool IsValidBluetoothHostAddress(const TDesC& aText);
+        static TBool IsValidPort(const TInt aPort);
+        
+    private:
+        TPtrC ParseHttp();
+        TPtrC ParseAddress();
+        TPtrC ParseDocument();
+        TInt ParsePort(TInt& aPortNumber);
+        TPtrC ParsePort();
+        
+     private:
+        void GetHttpPos(TInt& aStartPos, TInt& aEndPos);
+        void SkipHttp();
+  
+    private:
+        // reference to original URI text
+		const TDesC& iOriginalStr;
+		
+		// pointer to original URI text
+		TPtrC iPtr;
+		
+    };
+
+
+/**
+*  TFlag contains integer flag operations.
+*/
+class TFlag
+    {
+    public:
+        /**
+        * C++ default constructor.
+        */
+        TFlag(TUint32& aFlag);
+    public:
+        /**
+        * Turns given bit(s) on.
+        * @since 2.5
+        * @param aValue Bits to be turned on.
+        * @return None.
+        */
+        void SetOn(const TUint32 aValue);
+
+        /**
+        * Turns given bit(s) off.
+        * @since 2.5
+        * @param aValue Bits to be turned off.
+        * @return None.
+        */
+        void SetOff(const TUint32 aValue);
+
+        /**
+        * Checks if given bit(s) is/are set.
+        * @since 2.5
+        * @param aValue Bitmap to be checked.
+        * @return None.
+        */
+        TBool IsOn(const TUint32 aValue) const;
+        
+    private:
+		// reference to flag (integer)
+        TUint32& iFlag;
+    };
+
+
+/**
+* CAspIdleWait
+* 
+* This class is used for waiting synchronously until
+* active scheduler has completed all pending events.
+*/
+NONSHARABLE_CLASS (CAspIdleWait) : public CBase
+	{
+    public:
+        /**
+        * Two-phased constructor.
+        */
+		static CAspIdleWait* NewL();
+
+        /**
+        * Destructor.
+        */
+		virtual ~CAspIdleWait();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+		CAspIdleWait();
+
+	public:
+		/**
+		* Waits until active schedure has nothing to do.
+		* @param  None.
+		* @return None.
+		*/
+		static void CAspIdleWait::WaitL();
+		
+    private:
+        static TInt IdleCallback(TAny* aThisPtr);        
+
+	private:
+		CActiveSchedulerWait iWait;
+	};
+
+
+
+
+/**
+* MAspActiveCallerObserver
+*
+* MAspActiveCallerObserver is for observing CAspActiveCaller.
+*/
+class MAspActiveCallerObserver
+    {
+    public:
+	    virtual void HandleActiveCallL(TInt aCallId) = 0;
+    };
+
+
+/**
+* CAspActiveCaller
+*
+* CAspActiveCaller is used for generating a call from active scheduler.
+*/
+NONSHARABLE_CLASS (CAspActiveCaller) : public CActive
+    {
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CAspActiveCaller* NewL(MAspActiveCallerObserver* aObserver);
+
+	    /**
+        * Destructor.
+        */
+        virtual ~CAspActiveCaller();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+	    CAspActiveCaller(MAspActiveCallerObserver* aObserver);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+
+	public:
+        /**
+        * Calls observer using active object framework.
+        * @param aCallId.
+		* @param aMilliseconds Delay before observer is called.
+        * @return None
+        */
+		void Start(TInt aCallId, TInt aMilliseconds);
+
+        /**
+        * Make active scheduler call RunL.
+        * @param None
+        * @return None
+        */
+		void Request();
+
+    private:
+        /**
+        * From CActive. Called when asynchronous request completes.
+        * @param None
+        * @return None
+        */
+	    void RunL();
+
+        /**
+        * From CActive. Cancels asynchronous request.
+        * @param None
+        * @return None
+        */
+	    void DoCancel();
+        
+    private:
+		// call that is passed to observer
+		TInt iCallId;
+
+		// timer
+		RTimer iTimer;
+
+		// observer that gets called
+		MAspActiveCallerObserver* iObserver;
+    };
+
+
+
+
+
+/**
+* TAspBearerItem 
+*
+*/
+NONSHARABLE_CLASS (TAspBearerItem)
+	{
+	public:
+		TInt iBearerType;
+    	TBuf<KBufSize> iBearerName;
+	};
+
+
+
+/**
+* CAspBearerHandler 
+*
+* CAspBearerHandler is for constructing list control for selecting
+* bearer type (internet, bluetooth etc.)
+*/
+NONSHARABLE_CLASS (CAspBearerHandler) : public CBase
+    {
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CAspBearerHandler* NewL(const TAspParam& aParam);
+
+	    /**
+        * Destructor.
+        */
+        virtual ~CAspBearerHandler();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+	    CAspBearerHandler(const TAspParam& aParam);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+
+	public:
+	    /**
+        * Finds out whether bearer type is supported.
+		* @param aBearer Bearer type.
+        * @return ETrue if supported, EFalse otherwise.
+        */
+		TBool IsSupported(TInt aBearer);
+
+	    /**
+        * Finds out bearer type for list item.
+		* @param aIndex List index.
+        * @return Bearer type.
+        */
+		TInt BearerForListIndex(TInt aIndex);
+
+		/**
+        * Finds out list position for aBearer.
+		* @param aBearer.
+        * @return List array index.
+        */
+		TInt ListIndexForBearer(TInt aBearer);
+
+		/**
+        * Creates supported bearer list.
+		* @param None.
+        * @return None.
+        */
+		void CreateSupportedBearerListL();
+
+	    /**
+        * Finds out default bearer for a device.
+		* @param None.
+        * @return Bearer type.
+        */
+		TInt DefaultBearer();
+
+	    /**
+        * Gets bearer name string.
+		* @param aText.
+		* @param aBearer.
+        * @return None.
+        */
+		void GetBearerName(TDes& aText, TInt aBearerType);
+
+	    /**
+        * Builds array of bearer names for ui list control.
+		* @param None.
+        * @return Bearer name array.
+        */
+		CDesCArray* BuildBearerListLC();
+
+	    /**
+        * Finds out how many bearer types are supported.
+		* @param None.
+        * @return Bearer count.
+        */
+		TInt SupportedBearerCount();
+		
+	    /**
+        * Convert asp bearer id to sml beareer id.
+		* @param aId.
+        * @return Bearer id.
+        */
+		static TInt SmlBearerId(const TInt aId);
+
+	    /**
+        * Convert sml bearer id to asp beareer id.
+		* @param aId.
+        * @return Bearer id.
+        */
+		static TInt AspBearerId(const TInt aId);
+
+    private:
+   		// sync session
+		RSyncMLSession* iSyncSession;
+
+		// list of bearers that can shown in ui list
+		RArray<TAspBearerItem> iList;
+    };
+
+
+/**
+* TAspAccessPointItem 
+*
+*/
+NONSHARABLE_CLASS (TAspAccessPointItem)
+	{
+	public:
+		TInt  iUid;
+    	TBuf<KBufSize> iName;
+    	
+    	TInt  iUid2;
+	};
+
+
+
+/**
+* CAspAccessPointHandler 
+*
+* CAspAccessPointHandler is for setting internet access points.
+*/
+NONSHARABLE_CLASS (CAspAccessPointHandler) : public CBase
+    {
+    public:
+	enum TExitMode
+		{
+	    EAspDialogSelect,
+	    EAspDialogCancel,
+	    EAspDialogExit
+		};
+		
+	// when ap is set to -1, ap is always asked before sync
+    static const TInt KAskAlways = -1;
+
+	static const TInt KDefaultConnection = -2;
+    
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CAspAccessPointHandler* NewL(const TAspParam& aParam);
+
+	    /**
+        * Destructor.
+        */
+        virtual ~CAspAccessPointHandler();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+	    CAspAccessPointHandler(const TAspParam& aParam);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+	    void ConstructL();
+
+    public:
+	    /**
+        * Displays dialog for selecting one access point.
+		* @param aItem.
+        * @return ETrue if user selected access point, EFalse otherwise.
+        */
+        TInt ShowApSelectDialogL(TAspAccessPointItem& aItem);
+        
+	    /**
+        * Gets access point info.
+		* @param aItem.
+        * @return Error value.
+        */
+		TInt GetInternetApInfo(TAspAccessPointItem& aItem);
+
+	private:
+	    /**
+        * Gets access point info.
+		* @param aItem.
+        * @return Error value.
+        */
+		TInt GetApInfo(TAspAccessPointItem& aItem);
+
+	    /**
+        * Gets access point info.
+		* @param aItem.
+        * @return Error value.
+        */
+		TInt GetApInfoL(TAspAccessPointItem& aItem);
+
+        /**
+        * Utility function.
+		* @param None.
+        * @return Bearer flags.
+        */
+		TInt BearerFlags();
+
+
+    private:
+    
+   		// communications database
+		CCommsDatabase* iCommDb;
+
+    	//access point utilities
+    	CApUtils* iApUtil;
+    	
+    	// access point selection utility
+    	CApSelect* iApSelect;
+    	
+    	// dialog parameters
+    	TAspParam* iParam;
+    	
+    };
+
+
+
+/**
+* TAspSyncError 
+*
+* TAspSyncError is used for error code handling.
+*/
+NONSHARABLE_CLASS (TAspSyncError)
+    {
+    
+    public:
+        static HBufC* GetSmlErrorTextL(TInt aErrorCode, TInt aTransport);
+        static HBufC* GetSmlErrorText(TInt aErrorCode, TInt aTransport);
+      	static TInt GetSmlErrorValue(TInt aErrorCode);
+        
+#ifdef _DEBUG        
+    public:
+        static void GetSyncMLErrorText(TDes& aText, TInt aError);
+#endif
+     
+    };
+
+
+
+
+#endif  // ASPUTIL_H
+
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/inc/xxxxAspDebug.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* 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: Debug constants definition 
+*
+*/
+
+
+
+#ifndef NSMLDSSYNC__DEBUG_H
+#define NSMLDSSYNC__DEBUG_H
+
+
+#ifdef _DEBUG
+
+#include <e32svr.h>
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT(KLogFile,"smlsync.txt");
+_LIT(KLogDirFullName,"c:\\logs\\");
+_LIT(KLogDir,"smlsync");
+
+// Declare the FPrint function
+inline void FPrint(TRefByValue<const TDesC> aFmt, ...)
+    {
+    VA_LIST list;
+    VA_START(list,aFmt);
+    RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, TPtrC(aFmt), list);
+    }
+
+
+//#ifdef __WINS__     // File logging for WINS
+
+//#ifndef __GNUC__          
+//    #define FLOG            RDebug::Print
+//#else   // __GNUC__       
+//    #define FLOG(arg...)    RDebug::Print(arg);
+//#endif // __GNUC__        
+
+
+#ifndef __GNUC__          
+    #define FLOG            FPrint
+#else   // __GNUC__       
+    #define FLOG(arg...)    FPrint(arg);
+#endif // __GNUC__        
+
+//#define FLOG   FPrint
+//#define FLOG(a)   { FPrint(a); }
+//#define FMTLOG(arg...)   { FPrint(arg); }
+//#define FMTLOG(arg...)    RDebug::Print(arg);
+
+//#define FLOG(a) { RDebug::Print(a);  }
+#define FTRACE(a) { a; }
+
+//#else               // RDebug logging for target HW
+
+//#define FLOG(a) { RDebug::Print(a);  }
+//#define FTRACE(a) { a; }
+
+//#endif //__WINS__
+
+
+#else // No loggings --> Reduced binary size
+
+#define FLOG(a)
+#define FTRACE(a)
+
+#endif // _DEBUG
+
+
+#endif // NSMLDSSYNC__DEBUG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/loc/NSmlDSSync.loc	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,2070 @@
+/*
+* Copyright (c) 2002-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:  Localisation file for OmaDSAppUi/AspSyncUtil
+*
+*/
+
+
+
+
+// -----------------------------------------------------------------------------
+// main view strings
+// -----------------------------------------------------------------------------
+
+//d:Title of the application on the title pane
+//l:title_pane_t2/opt9
+//r:3.0
+//
+#define qtn_apps_syncml_title		"Sync"
+
+//d:Title of the application on the application shell list
+//d: used in app shell
+//l:list_single_large_graphic_pane_t1
+//r:3.0
+//
+#define qtn_apps_sml_list			"Sync"
+
+//d:Title of the application on the application shell grid
+//d: used in app shell
+//l:cell_app_pane_t1
+//r:3.0
+//
+#define qtn_apps_sml_grid	"Sync"
+
+//d:Navipane texts on the mainview
+//d:Profile has not been synchronised
+//l:navi_navi_text_pane_t1
+//r:3.0
+//
+#define qtn_sml_main_sync_no_last	"Not synchronised"
+
+//d:Text for empty profile
+//l:list_set_graphic_pane_t1
+//r:3.0
+//
+#define qtn_apps_emptyprofile	"<unnamed set>"
+
+//d:Command in options list.
+//d:Selects the content
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_sml_cmd_mark		"Mark"
+
+//d:Command in options list.
+//d:Unselects the content
+//l:list_single_pane_t1_cp2
+//r:5.0
+//
+#define qtn_sml_cmd_unmark		"Unmark"
+
+
+//d:Command in options list to open advanced setting
+//l:list_single_pane_t1_cp2
+//r:3.2
+//
+#define qtn_sml_cmd_advanced_settings		"Advanced settings"
+
+//d:Roaming setting item (radio button list) 
+//l:list_setting_pane_t1
+//r:3.2
+//
+#define qtn_ds_set_roaming		"Roaming settings"
+
+//d:Used in qtn_ds_set_roaming
+//l:list_set_graphic_pane_t1
+//r:3.2
+//
+#define qtn_sml_always_ask		"Always ask"
+
+//d:Used in qtn_ds_set_roaming
+//l:list_set_graphic_pane_t1
+//r:3.2
+//
+#define qtn_sml_always_allow		"Always allow"
+
+//d:Used in qtn_ds_set_roaming
+//l:list_set_graphic_pane_t1
+//r:3.2
+//
+#define qtn_sml_never_allow		"Never allow"
+
+//d:Command in options list.
+//d:Starts the syncronisation
+//l:list_single_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_cmd_sync		"Synchronise"
+
+//d:Command in options list.
+//d:Opens dialog for creating new sync set.
+//l:list_single_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_cmd_create_new "Create new"
+
+//d:Command in options list.
+//d:Opens settings view with existing profile values
+//l:list_single_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_cmd_edit		"Edit"
+
+//d:Command in options list.
+//d:Deletes currently selected profile
+//l:list_single_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_cmd_delete		"Delete"
+
+//d:Command in options list.
+//d:Opens the profile's last synchronisation log for viewing
+//l:list_single_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_cmd_view_log	"View log"
+
+//d:Command in options list.
+//d:Deletes phone data and then copies all sync data from server to phone
+//l:list_single_pane_t1_cp2
+//r:3.2
+//
+#define qtn_sml_cmd_slow_sync	"Copy all from server"
+
+//d:Command in options list.
+//d:Opens selection list for changing active profile.
+//l:list_single_pane_t1_cp2
+//r:3.2
+//
+#define qtn_sml_cmd_change_profile "Change"
+
+//d:Command in options list.
+//d:Opens automatic sync dialog.
+//l:list_single_pane_t1_cp2
+//r:3.2
+//
+#define qtn_sml_cmd_automatic_sync "Automatic sync"
+
+//d:this message is shown when user tries to start sync using profile that misses 
+//d:some mandatory data.
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_query_mandatory_missing "Some compulsory settings are not defined and synchronisation cannot be started. Define now?"
+
+//d:this message is shown when user tries to start sync and there are no sync profiles. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_query_no_profiles "No sync profiles defined. Define now?"
+
+//d:Title for dialog that shows profile selection list for deleting one profile.
+//l:heading_pane_t1
+//r:3.2
+//
+#define qtn_sml_query_title_delete_profile "Delete profile"
+
+//d:Title for dialog that shows profile selection list for changing active profile.
+//l:heading_pane_t1
+//r:3.2
+//
+#define qtn_sml_query_title_change_profile "Change profile"
+
+//d:Error confirmation dialog
+//d:Shown when user starts synchronization and profile has no contents selected
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_err_nocontent "Profile has no content selected"
+
+//d:This yes/no question is shown to verify command qtn_sml_cmd_slow_sync.
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_query_slow_sync_conf "This operation replaces all phone data with data from the server. Do you want to continue?"
+
+//d:Dialog title. Dialog is used for selecting set (from selection list) for syncing. 
+//l:heading_pane_t1
+//r:3.0
+//
+#define qtn_sml_apps_select_set "Select set for sync:"
+
+//d:This note is shown when user tries to modify read-only profile.
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_main_locked "This sync profile is read-only and cannot be edited."
+
+//d:popup note text that is shown when user changes currently open profile
+//l:popup_preview_text_window/opt6
+//r:3.2
+//
+#define qtn_sml_main_info "profile: %0U, connection method: %1U"
+
+
+
+// -----------------------------------------------------------------------------
+// sync strings needed in other applications
+// -----------------------------------------------------------------------------
+
+
+//d:Menu command in other application's options menu (not Sync app).
+//d:Opens submenu that contains items qtn_ds_options_sync_settings and qtn_sml_cmd_start.
+//l:list_single_pane_t1_cp2/opt3
+//r:3.0
+//
+#define qtn_ds_options_sync "Synchronization"
+
+
+//d:Command in other application (not Sync app) Synchronization sub menu.
+//d:Opens dialog for editing sync settings.
+//l:list_single_popup_submenu_pane_t1
+//r:3.0
+//
+#define qtn_ds_options_sync_settings "Settings"
+
+
+//d:Command in other application (not Sync app) Synchronization sub menu.
+//d:Starts synchronization.
+//l:list_single_popup_submenu_pane_t1
+//r:3.0
+//
+#define qtn_ds_options_sync_start "Start"
+
+//d:Command in other application(not sync app) Default dialog list item for qtn_ds_options_sync_settings
+//d:Starts the Profile wizard
+//l:list_single_pane_t1_cp2/opt1
+//r:5.0
+#define qtn_sml_apps_select_profile_create_new "Create new profile"
+
+//d:this message is shown when user tries to start sync using profile that misses 
+//d:some mandatory data.
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_tarm_mandatory_missing "Unable to synchronise. Profile is locked and mandatory settings are missing."
+
+
+
+
+// -----------------------------------------------------------------------------
+// setting view strings
+// -----------------------------------------------------------------------------
+
+//d:One of the setting items in settings view
+//d:Used also as a title in editing state 
+//l:list_setting_pane_t1/opt1
+//r:3.0
+//
+#define qtn_sml_set_list_profile	"Sync set name"
+
+//d:One of the setting items in settings view
+//d:Used also as a title in editing state 
+//l:list_setting_pane_t1/opt1 
+//r:3.0
+//
+#define qtn_sml_set_list_server_id "Server Id"
+
+//d:Title of settings item
+ //l:list_setting_pane_t1/opt1
+//r:3.0
+//
+#define qtn_sml_set_bearertype "Bearer type"
+
+//d:One of the setting items in settings view
+//d:Used also as a title in editing state
+//l:list_setting_pane_t1/opt1
+//r:3.0
+//
+#define qtn_sml_set_list_access		"Access point"
+
+//d:One of the setting items in settings view
+//d:Used also as a title in editing state
+//l:list_setting_pane_t1/opt1 
+//r:3.0
+//
+#define qtn_sml_set_list_host		"Host address"
+
+//d:One of the setting items in settings view
+//d:Used also as a title in editing state
+//l:list_setting_pane_t1/opt1
+//r:3.0
+//
+#define qtn_sml_set_list_port		"Port"
+
+//d:One of the setting items in settings view
+//d:Used also as a title in editing state
+//l:list_setting_pane_t1/opt1
+//r:3.0
+//
+#define qtn_sml_set_list_username	"User name"
+
+//d:One of the setting items in settings view
+//d:Used also as a title in editing state
+//l:list_setting_pane_t1/opt1
+//r:3.0
+//
+#define qtn_sml_set_list_password	"Password"
+
+//d:One of the setting items in settings view
+//d:Used also as a title in editing state 
+//l:list_setting_pane_t1
+//r:3.0
+//
+#define qtn_ds_set_lbl_active "Allow sync request"
+
+//d:One of the setting items in settings view
+//d:Used also as a title in editing state
+//l:list_setting_pane_t1/opt1 
+//r:3.0
+//
+#define qtn_sml_set_list_https_username	"Https user name"
+
+//d:One of the setting items in settings view
+//d:Used also as a title in editing state
+ //l:list_setting_pane_t1/opt1 
+//r:3.0
+//
+#define qtn_sml_set_list_https_password	"Https password"
+
+//d:Application dialog setting item for selecting sync type (eg. One-way into device)
+//l:list_setting_pane_t1/opt1
+//r:3.0
+//
+#define qtn_sml_sync_type "Sync type"
+
+//d:Value used in qtn_ds_set_lbl_active
+//d:Auto-accept means that server alerts are automatically accepted
+//l:list_set_graphic_pane_t1
+//r:3.2
+//
+#define qtn_sml_set_sync_req_auto "Auto-accept"
+
+//d:Value used in qtn_ds_set_lbl_active
+//d:Ask first means server alerts are always confirmed
+//l:list_set_graphic_pane_t1
+//r:3.2
+//
+#define qtn_sml_set_sync_req_ask_always "Ask first"
+
+//d:Value used in qtn_ds_set_lbl_active
+//d:Not allowed means server alerts are never accepted
+//l:list_set_graphic_pane_t1
+//r:3.2
+//
+#define qtn_sml_set_sync_req_never "Not allowed"
+
+//d:This yes/no question is shown when user has given profile server id that already exists.
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_query_serverid_exists "There is already a profile created for this server. Exit anyway ?"
+
+//d:Value used in qtn_sml_sync_type list.
+//d:Normal sync. Sync items (eg. contatcs) are send from phone to sync server
+//d: and from sync server to phone.
+//l:list_set_graphic_pane_t1
+//r:3.0
+//
+#define qtn_sml_sync_type_normal "Normal"
+
+//d:Value used in qtn_sml_sync_type list
+//d:Sync items (eg. contatcs) are send from phone to sync server.
+//l:list_set_graphic_pane_t1
+//r:3.0
+//
+#define qtn_sml_sync_type_one_way_dev_to_srv "One-way from device"
+
+//d:Value used in qtn_sml_sync_type list
+//d:Sync items (eg. contatcs) are send from sync server to phone.
+//l:list_set_graphic_pane_t1
+//r:3.0
+//
+#define qtn_sml_sync_type_one_way_srv_to_dev "One-way into device"
+
+//d:NOTE: This is defined in "s60\ConnectionUiUtilities\inc\ConnectionUiUtilities.loc"
+//d:(qtn_netw_sett_iap_pref_prompt)
+//d:This string is used as connection dialog access point (qtn_sml_set_list_access)
+//d:setting value when user has selected "Always ask" option in access point selection dialog.
+//l:list_set_graphic_pane_t1
+//r:3.0
+//
+#define qtn_ds_sett_always_ask		"Always ask"
+
+//d:this message is shown when user tries to start sync when sync is already running. 
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_ds_note_hidden_ongoing "Unable to start synchronisation. Other sync process already ongoing."
+
+//d:Text on the information note that is shown when user tries to edit setting that is 
+//d:read-only. 
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_ds_note_read_only "This is read-only setting and cannot be edited"
+
+//d:This yes/no question is shown if user has not filled mandatory field(s) in a dialog.
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_ds_conf_mandatory_missing "Some settings are compulsory and must be defined. Exit anyway?"
+
+//d:One of the setting items in settings view
+//d:Used also as a title in editing state
+//l:list_setting_pane_t1/opt1 
+//r:3.0
+#define qtn_sml_set_list_protocol_version "SyncML version"
+
+//d:Value used in setting view's protocol version list
+//l:list_set_graphic_pane_t1
+//r:3.0
+#define qtn_sml_syncml_1_1 "SyncML 1.1"
+
+//d:Value used in setting view's protocol version list
+//l:list_set_graphic_pane_t1
+//r:3.0
+#define qtn_sml_syncml_1_2 "SyncML 1.2"
+
+//d:Text on the information note that is shown when user changes sync protocol 
+//d:from 1.2 to 1.1. and sync set includes email application.
+//d:This is needed because SyncML version 1.1 does not support email sync.
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_sml_info_proc_change "You cannot synchronise email with SyncML version 1.1"
+
+
+
+// -----------------------------------------------------------------------------
+// setting wizard strings
+// -----------------------------------------------------------------------------
+
+
+//d:Setting item (profile name) title.
+//l:list_setting_pane_t1
+//r:3.2
+//
+#define qtn_sml_set_list_destination_name	"Destinations's name"
+
+//d:Setting item (profile name) title. (new)
+//l:list_setting_pane_t1
+//r:3.2
+//
+#define qtn_sml_set_list_content_selection	"Sync contents"
+
+//d:This Start/Cancel note is shown when user starts profile wizard.
+//l:popup_info_list_pane_t1
+//r:3.2
+//
+#define qtn_ds_conf_profile_wizard_start "This wizard will guide you to create the basic settings for a new synchronisation profile."
+
+//d:Profile wizard's last page text when wizard is launched from sync app (cba Activate/Later).
+//l:popup_info_list_pane_t1
+//r:3.2
+//
+#define qtn_ds_conf_profile_wizard_end "New profile settings saved. For details, see Options and Edit. Activate new profile now?"
+
+//d:Profile wizard's last page text when wizard is launched from other application (cba Ok).
+//l:popup_info_list_pane_t1
+//r:3.2
+//
+#define qtn_ds_conf_profile_wizard_end_app "New profile settings saved. Select Options/Synchronisation/Start to synchronise."
+
+//d:Profile wizard's last page text when wizard is launched from other application (cba Ok).
+//l:popup_info_list_pane_t1
+//r:3.2
+//
+#define qtn_ds_conf_profile_wizard_end_email "New profile settings saved. Start synchronisation from options menu."
+
+//d:Setting item (profile name) title.
+//l:navi_text_pane_t1
+//r:3.2
+//
+#define qtn_sml_wizard_page_counter "Page %0N/%1N"
+
+//d:this message is shown in profile wizard when user does not enter profile name and 
+//d:presses "Next" in profile name editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_profile_name_missing "Profile name must be defined."
+
+//d:this message is shown in profile wizard when user does not enter host address and 
+//d:presses "Next" in host address editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_host_address_missing "Host address must be defined."
+
+//d:this message is shown in profile wizard when user enters incorrect host address. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_incorrect_host_address "Incorrect host address."
+
+//d:this message is shown in profile wizard when user does not enter remote 
+//d:database and presses "Next" in remote database editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_remote_database_missing "Remote database must be defined."
+
+//d:this message is shown in profile wizard when user does not enter MMS
+//d:database and presses "Next" in remote database editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_mms_db_missing "MMS database must be defined."
+
+//d:this message is shown in profile wizard when user does not enter SMS
+//d:database and presses "Next" in remote database editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_sms_db_missing "SMS database must be defined."
+
+//d:this message is shown in profile wizard when user does not enter Bookmark
+//d:database and presses "Next" in remote database editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_bkm_db_missing "Bookmark database must be defined."
+//d:this message is shown in profile wizard when user does not enter remote Contacts 
+//d:database and presses "Next" in remote database editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_contacts_db_missing "Contacts database must be defined."
+
+//d:this message is shown in profile wizard when user does not enter remote Calendar
+//d:database and presses "Next" in remote database editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_calendar_db_missing "Calendar database must be defined."
+
+//d:this message is shown in profile wizard when user does not enter remote Notes
+//d:database and presses "Next" in remote database editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_notes_db_missing  "Notes database must be defined."
+
+//d:this message is shown in profile wizard when user does not enter remote Email
+//d:database and presses "Next" in remote database editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_email_db_missing  "Email database must be defined."
+
+//d:this message is shown in profile wizard when user does not enter user 
+//d:name and presses "Next" in user name editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_username_missing "User name must be defined."
+
+//d:this message is shown in profile wizard when user does not enter password 
+//d:and presses "Next" in password editor. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_password_missing "Password must be defined."
+
+//d:this message is shown in profile wizard when user enters server id that 
+//d:is already used by another profile. 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_incorrect_server_id "There is already a profile created for this server."
+
+//d:Profile wizard editor title. Editor is for Contact remote database name.
+//l:list_setting_pane_t1/opt1
+//r:3.2
+//
+#define qtn_sml_remote_database_cnt "Contacts database"
+
+//d:Profile wizard editor title. Editor is for Calendar remote database name.
+//l:list_setting_pane_t1/opt1
+//r:3.2
+//
+#define qtn_sml_remote_database_agn "Calendar database"
+
+//d:Profile wizard editor title. Editor is for Notes remote database name.
+//l:list_setting_pane_t1/opt1
+//r:3.2
+//
+#define qtn_sml_remote_database_npd "Notes database"
+
+//d:Profile wizard editor title. Editor is for SyncML EMail remote database name.
+//l:list_setting_pane_t1/opt1
+//r:3.2
+//
+#define qtn_sml_remote_database_eml "SyncML EMail database"
+
+//d:Profile wizard editor title. Editor is for SyncML EMail remote database name.
+ //l:list_setting_pane_t1/opt1 
+//r:3.2
+//
+#define qtn_sml_local_database_eml "SyncML EMail mailbox"
+
+//d:Profile wizard editor title. Editor is for SyncML Sms remote database name.
+//l:list_setting_pane_t1/opt1
+//r:3.2
+//
+#define qtn_sml_remote_database_sms "SyncML Sms database"
+
+//d:Profile wizard editor title. Editor is for Multimedia messages remote database name.
+//l:list_setting_pane_t1/opt1
+//r:5.0
+//
+#define qtn_sml_remote_database_mms "MMS database"
+
+//d:Profile wizard editor title. Editor is for Bookmarks remote database name.
+//l:list_setting_pane_t1/opt1
+//r:5.0
+//
+#define qtn_sml_remote_database_bkm "Bookmarks database"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_profile_name "Key in the name for the new sync profile"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_protocol_version "Select the right SyncML version for the sync server"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_content_selection "Select the contents you want to synchronise with this profile"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_contacts_db "Key in the name of the Contacts database on the server"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_calendar_db "Key in the name of the Calendar database on the server"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_notes_db "Key in the name of the Notes database on the server"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_email_db "Key in the name of the DS Email database on the server"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_mailbox "Select the mailbox you want to synchronise"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_sms_db "Key in the name of the DS Sms database on the server"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l: popup_preview_text_window/opt3
+//r:5.0
+//
+#define qtn_ds_wizard_popup_mms_db "Type in the MMS database name"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l: popup_preview_text_window/opt3
+//r:5.0
+//
+#define qtn_ds_wizard_popup_bkm_db "Type in the Bookmarks database name"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_remote_db "Key in the name of the remote database on the server"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_connection_type "Select the connection type you want to synchronise by"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_host_address "Key in the host address for the used sync server"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_server_id "Key in the ID of the sync server"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_username "Key in the user name for the used sync server"
+
+//d:Synchronisation settings wizard info popup note text. 
+//l:popup_preview_text_window/opt3
+//r:3.2
+//
+#define qtn_ds_wizard_popup_password "Key in the password for the used sync server"
+
+
+//d:General error text indicating that profile wizard could not create new profile
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_log_err_profile_wizard "Profile creation failed"
+
+//d:Default title of the new profile 
+//l:list_single_large_graphic_pane_t1_cp2
+//r3.2
+//
+#define qtn_apps_newprofile		"New set (%N)"
+
+//d:Default title of the new set created in Phonebook application 
+//l:list_single_large_graphic_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_apps_content_pb "Phonebook sync (%N)"
+
+
+//d:Default title of the new set created in Calendar application 
+//l:list_single_large_graphic_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_apps_content_cal "Calendar sync (%N)"
+
+
+//d:Default title of the new set created in Email application 
+//l:list_single_large_graphic_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_apps_content_syncml "SyncmlEmail sync (%N)"
+
+
+//d:Default title of the new set created in Note application 
+//l:list_single_large_graphic_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_apps_content_notes "Note sync (%N)"
+
+//cba button text.
+//d:Starts profile wizard
+//l:control_pane_t1/opt7
+//r:3.2
+//
+#define qtn_sml_cba_start "Start"
+
+//cba button text.
+//d:Cancels starting profile wizard
+//l:control_pane_t1/opt7
+//r:3.2
+//
+#define qtn_sml_cba_cancel "Cancel"
+
+//cba button text.
+//d:Moves to next setting editor in profile wizard
+//l:control_pane_t1/opt7
+//r:3.2
+//
+#define qtn_sml_cba_next "Next"
+
+//cba button text.
+//d:Moves to previous setting editor in profile wizard
+//l:control_pane_t1/opt7
+//r:3.2
+//
+#define qtn_sml_cba_back "Back"
+
+//cba button text.
+//d:Activates just created (in profile wizard) profile
+//l:control_pane_t1/opt7
+//r:3.2
+//
+#define qtn_sml_cba_activate "Activate"
+
+//cba button text.
+//d:Does not activate just created (in profile wizard) profile
+//l:control_pane_t1/opt7
+//r:3.2
+//
+#define qtn_sml_cba_later "Later"
+
+// -----------------------------------------------------------------------------
+// automatic sync setting strings
+// -----------------------------------------------------------------------------
+//d:One of the setting items in automatic sync settings dialog
+//d:Setting for selecting profile that is used in auto sync (radio button list) 
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_profile "Automatic sync profile"
+
+//d:Default value for qtn_sml_sett_auto_sync_profile
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_value_not_defined "Not defined"
+
+//d:One of the setting items in automatic sync settings dialog
+//d:Setting for selecting contents to be synchronized (multi selection list) 
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_contents "Automatic sync contents"
+
+//d:Used in qtn_sml_sett_auto_sync_contents
+//d:Setting value when user has selected all contents
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_value_all_contents "All"
+
+//d:Used in qtn_sml_sett_auto_sync_contents
+//d:Setting value when user has selected more than one but not all contents
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_value_selected_contents "Selected Contents"
+
+//d:One of the setting items in automatic sync settings dialog
+//d:Setting for selecting sync interval (radio button list) 
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_freq "Sync frequency"
+
+//d:Used in qtn_sml_sett_auto_sync_freq
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_freq_value_manual "Manual"
+
+//d:Used in qtn_sml_sett_auto_sync_freq
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_freq_many_a_day "Many times per day"
+
+//d:Used in qtn_sml_sett_auto_sync_freq
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_24_hours "Once a day"
+
+//d:Used in qtn_sml_sett_auto_sync_freq
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_2_days "Every 2 days"
+
+//d:Used in qtn_sml_sett_auto_sync_freq
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_4_days "Every 4 days"
+
+//d:Used in qtn_sml_sett_auto_sync_freq
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_7_days "Once a week"
+
+//d:Used in qtn_sml_sett_auto_sync_freq
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_14_days "Every 2 weeks"
+
+//d:Used in qtn_sml_sett_auto_sync_freq
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_30_days "Once a month"
+
+//d:One of the setting items in automatic sync settings dialog
+//d:Setting for selecting peak sync interval (radio button list) 
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_peak_schedule "Peak sync interval"
+
+//d:Used in qtn_sml_sett_auto_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_manual "Manual"
+
+//d:Used in qtn_sml_sett_auto_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_15_mins "Every 15 minutes"
+
+//d:Used in qtn_sml_sett_auto_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_30_mins "Every 30 minutes"
+
+//d:Used in qtn_sml_sett_auto_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_1_hour "Every 1 hour"
+
+//d:Used in qtn_sml_sett_auto_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_2_hours "Every 2 hours"
+
+//d:Used in qtn_sml_sett_auto_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_4_hours "Every 4 hours"
+
+//d:Used in qtn_sml_sett_auto_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_8_hours "Every 8 hours"
+
+//d:Used in qtn_sml_sett_auto_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_12_hours "Every 12 hours"
+
+//d:One of the setting items in automatic sync settings dialog
+//d:Setting for selecting off-peak sync interval (radio button list) 
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_offpeak_schedule "Off-peak sync interval"
+
+//d:Used in qtn_sml_sett_auto_off_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_off_manual "Manual"
+
+//d:Used in qtn_sml_sett_auto_off_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_off_15_mins "Every 15 minutes"
+
+//d:Used in qtn_sml_sett_auto_off_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_off_30_mins "Every 30 minutes"
+
+//d:Used in qtn_sml_sett_auto_off_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_off_1_hour "Every 1 hour"
+
+//d:Used in qtn_sml_sett_auto_off_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_off_2_hours "Every 2 hours"
+
+//d:Used in qtn_sml_sett_auto_off_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_off_4_hours "Every 4 hours"
+
+//d:Used in qtn_sml_sett_auto_off_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_off_8_hours "Every 8 hours"
+
+//d:Used in qtn_sml_sett_auto_off_peak_schedule
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_value_off_12_hours "Every 12 hours"
+
+//d:One of the setting items in automatic sync settings dialog
+//d:Setting for selecting sync days (multi selection list) 
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_days "Peak days"
+
+//d:Used in qtn_sml_sett_auto_sync_days
+//d:Setting value when user has selected all days
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_all_days "All days"
+
+//d:Used in qtn_sml_sett_auto_sync_days
+//d:Setting value when user has selected more than one but not all days
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_sel_days "Selected days"
+
+//d:Used in qtn_sml_sett_auto_sync_days
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_mon "Monday"
+
+//d:Used in qtn_sml_sett_auto_sync_days
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_tue "Tuesday"
+
+//d:Used in qtn_sml_sett_auto_sync_days
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_wed "Wednesday"
+
+//d:Used in qtn_sml_sett_auto_sync_days
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_thu "Thursday"
+
+//d:Used in qtn_sml_sett_auto_sync_days
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_fri "Friday"
+
+//d:Used in qtn_sml_sett_auto_sync_days
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_sat "Saturday"
+
+//d:Used in qtn_sml_sett_auto_sync_days
+//l:list_set_graphic_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_sun "Sunday"
+
+//d:One of the setting items in automatic sync settings dialog
+//d:Setting for selecting sync time when sync interval is >= 1 day
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_time "Synchronisation time"
+
+//d:One of the setting items in automatic sync settings dialog
+//d:Setting for selecting peak start time
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_peak_start "Peak start time"
+
+//d:One of the setting items in automatic sync settings dialog
+//d:Setting for selecting peak end time
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_sml_sett_auto_peak_end "Peak end time"
+
+//d:Title of the automatic profile setting dialog
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_sml_title_profile_settings "Profile settings"
+
+//d:Title of the automatic sync setting dialog
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_sml_title_automatic_sync_settings "Scheduling settings"
+
+//d:One of the setting items in settings view
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_sml_setting_folder_profile "Profile settings"
+
+//d:One of the setting items in settings view
+//l:list_setting_pane_t1
+//r:5.0
+//
+#define qtn_sml_setting_folder_schedule "Scheduling settings"
+
+//d:this message is shown when user tries to delete a profile that is selected for auto sync
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_ds_conf_query_delete_auto_sync_profile "Deleting this profile will end automatic synchronisation. Continue?"
+
+//d:this message is shown when user tries to edit profile settings for a profile that is selected for auto sync
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_sml_note_modify_auto_sync_settings "Modifying this setting may prevent automatic synchronisation with this profile"
+
+//d:this message is shown when user tries to edit scheduling settings from a profile
+//d:and auto sync is set for another profile
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_sml_query_auto_sync_on "Scheduled sync is currently set for another profile. Cancel schedule and define settings for this profile?"
+
+//d:this message is shown when user tries to select a profile that has access point in "ask always" 
+//d;state for auto sync ,or when user edits access point for a profile that is selected for auto sync
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_sml_query_iap_no_ask_always "Automatic synchronisation will not be possible without selecting an access point for profile. Select now?"
+
+//d:this message is shown when sync application is launched ,if auto sync is enabled 
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_sml_main_note_auto_on "Next sync:   %0U ,profile:   %1U"
+
+//d:this message is shown while closing auto sync setting dialog
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_sml_sett_auto_sync_done "Automatic sync is now on. Next sync will happen at %U."
+
+//d:this message is shown when user tries to save auto sync setting ,without defining
+//d:content setting
+//l:popup_note_window
+//r:5.0
+//
+#define qtn_sml_note_auto_contents_missing_settings "Some compulsory settings missing for selected contents. Define now?"
+
+//d:this message is shown as a link to log view in the auto sync error note.
+//l:popup_info_list_pane_t1
+//r:5.0
+//
+#define qtn_sml_main_auto_error_log_link "View details"
+
+//d:this message is shown when auto sync profile is set active profile
+//d:and there has been error in automatic sync. 
+//l:popup_info_list_pane_t1
+//r:3.2
+//
+#define qtn_sml_main_info_error "An error has occurred in automatic synchronization. Please check sync log for more details."
+
+//d:this message is shown when auto sync setting page is tried to save with an invalid peak time definition 
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_sml_incorrect_peak_time "Incorrect peak time definition"
+
+//d:this message is shown during application launch, if auto sync has been failed for a profile because of on going manual sync
+//d:for another profile 
+//l:popup_note_window/opt2
+//r:5.0
+//
+#define qtn_sml_manual_sync_override "Auto sync cancelled. Manual sync in progress"
+
+//d:One of the setting items in automatic sync settings dialog
+//d:Setting for selecting whether user wants to synchronize while roaming
+//d:(phone is not within home network) 
+//l:list_setting_pane_t1
+//r:3.2
+//
+#define qtn_sml_sett_auto_sync_roaming "Sync while roaming"
+
+//d:Used in qtn_sml_sett_auto_sync_interval
+//l:list_set_graphic_pane_t1
+//r:3.2
+//
+#define qtn_sml_sett_auto_sync_roaming_on "Yes"
+
+//d:Used in qtn_sml_sett_auto_sync_interval
+//l:list_set_graphic_pane_t1
+//r:3.2
+//
+#define qtn_sml_sett_auto_sync_roaming_off "Only in home network"
+
+//d:Title of the content list
+//l:heading_pane_t1
+//r:3.2
+//
+#define qtn_sml_auto_sync_view_contents_head  "Contents"
+
+//d:Command in options list.
+//d:Opens selected profile's content list
+//l:list_single_pane_t1_cp2
+//r:3.2
+//
+#define qtn_sml_cmd_view_contents		"View contents"
+
+//d:Command in options list.
+//d:Selects profile for automatic sync
+//l:list_single_pane_t1_cp2
+//r:3.2
+//
+#define qtn_sml_cmd_select		"Select"
+
+//d:msk button text.
+//d:Selects profile for auto sync
+//l:control_pane_t3/opt7
+//r:3.2
+//
+#define qtn_msk_select		"Select"
+
+//d:msk button text.
+//d:View selected profile's contents
+//l:control_pane_t3/opt7 
+//r:3.2
+//*
+#define qtn_msk_view_contents "View contents"
+
+//d:this message is shown when auto sync profile is set active profile 
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_main_info_auto_on "Current profile:%0U, connection method: %1U. Next sync in %0N hours %1N minutes."
+
+// -----------------------------------------------------------------------------
+// application specific setting strings
+// -----------------------------------------------------------------------------
+
+//d:Application dialog setting item for selecting database (selection list)
+//d:that is synced.
+//l:list_setting_pane_t1
+//r:3.0
+//
+#define qtn_sml_local_database "Local database"
+
+//d:Application dialog setting item for selecting remote database for syncing.
+//l:list_setting_pane_t1/opt1
+//r:3.0
+//
+#define qtn_sml_remote_database "Remote database"
+
+//d:Application dialog setting item (Yes/No) for selecting whether sync filters
+//d:should be used in syncing.
+//l:list_setting_pane_t1
+//r:3.0
+//
+#define qtn_nsml_eml_use_filters "Use filters"
+
+//d:Value used in qtn_nsml_eml_use_filters setting (Yes/No).
+//l:list_set_graphic_pane_t1
+//r:3.0
+//
+#define qtn_nsml_eml_use_filters_yes "Yes"
+
+//d:Value used in qtn_nsml_eml_use_filters setting (Yes/No).
+//l:list_set_graphic_pane_t1
+//r:3.0
+//
+#define qtn_nsml_eml_use_filters_no	"No"
+
+//d:One of the setting items in settings view
+//l:list_setting_pane_t1/opt1
+//r:3.2
+//
+#define qtn_sml_content_settings_pb	"Phonebook settings"
+
+//d:One of the setting items in settings view
+//l:list_setting_pane_t1/opt1
+//r:3.2
+//
+#define qtn_sml_content_settings_cal	"Calendar settings"
+ 
+//d:One of the setting items in settings view
+//l:list_setting_pane_t1/opt1
+//r:3.2
+//
+#define qtn_sml_content_settings_notes	"Notes settings"
+
+//d:One of the setting items in settings view
+//l:list_setting_pane_t1/opt1
+//r:3.2
+//
+#define qtn_sml_content_settings_email	"Email settings"
+
+//d:One of the setting items in settings view
+//l:list_setting_pane_t1/opt1
+//r:3.2
+//
+#define qtn_sml_content_settings_sms	"Sms settings"
+
+//d:One of the setting items in settings view
+//l:list_setting_pane_t1/opt1 
+//r:5.0
+//
+#define qtn_sml_content_settings_mms	"MMS settings"
+
+//d:One of the setting items in settings view
+ //l:list_setting_pane_t1/opt1
+//r:5.0
+//
+#define qtn_sml_content_settings_bkm	"Bookmarks settings"
+
+//d:Display name for Contact content. Used eg. in sync progress text
+//d:"Sending Contacts 5/10" 
+//l:list_double_large_graphic_pane_t1
+//r:3.0
+//
+#define qtn_nsml_cnt_display_name "Contacts"
+
+//d:Display name for Calendar content. Used eg. in sync progress text
+//d:"Sending Calendar 5/10" 
+//l:list_double_large_graphic_pane_t1
+//r:3.0
+//
+#define qtn_nsml_agn_display_name "Calendar"
+
+//d:Display name for Notes content. Used eg. in sync progress text
+//d:"Sending Notes 5/10" 
+//l:list_double_large_graphic_pane_t1
+//r:3.0
+//
+#define qtn_nsml_npd_display_name "Notes"
+
+//d:Display name for EMail content. Used eg. in sync progress text
+//d:"Sending EMail 5/10" 
+//l:list_double_large_graphic_pane_t1
+//r:3.0
+//
+#define qtn_nsml_eml_display_name "SyncML Email"
+
+//d:Display name for Sms content. Used eg. in sync progress text
+//d:"Sending EMail 5/10" 
+//l:list_double_large_graphic_pane_t1
+//r:3.0
+//
+#define qtn_nsml_sms_display_name "Sms"
+
+//d:Display name for MMS. Used eg. in sync progress text
+//d:"Sending MMS 5/10" 
+//l:list_double_large_graphic_pane_t1
+//r:5.0
+//
+#define qtn_nsml_mms_display_name "MMS"
+
+//d:Display name for Bookmarks content. Used eg. in sync progress text
+//d:"Sending Bookmarks 5/10" 
+//l:list_double_large_graphic_pane_t1
+//r:5.0
+//
+#define qtn_nsml_bkm_display_name "Bookmarks"
+
+//d:Application dialog title. 
+//l:title_pane_t2/opt9
+//r:3.0
+//
+#define qtn_sml_title_contacts "Contacts"
+
+//d:Application dialog title. 
+//l:title_pane_t2/opt9
+//r:3.0
+//
+#define qtn_sml_title_calendar "Calendar"
+
+//d:Application dialog title. 
+//l:title_pane_t2/opt9
+//r:3.0
+//
+#define qtn_sml_title_notes "Notes"
+
+//d:Application dialog title. 
+//l:title_pane_t2/opt9
+//r:3.0
+//
+#define qtn_sml_title_email "SyncML EMail"
+
+//d:Application dialog title. 
+//l:title_pane_t2/opt9
+//r:3.0
+//
+#define qtn_sml_title_sms "Sms"
+
+//d:Application dialog title. 
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_sml_title_mms "MMS"
+
+//d:Application dialog title. 
+//l:title_pane_t2/opt9
+//r:5.0
+//
+#define qtn_sml_title_bookmarks "Bookmarks"
+
+//d:Text on the information note that is shown when user tries to set email mailbox
+//d:in application dialog but no email mailboxes exist. 
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_sml_info_no_mailboxes "No mailboxes defined. Check your mailbox settings in Messaging Centre."
+
+// -----------------------------------------------------------------------------
+// sync progress dialog strings
+// -----------------------------------------------------------------------------
+
+//d:progress note window which shows the synchronistion progress
+//d:changing text displayed at connect stage
+//d:Image replaced by animation
+//l:popup_note_wait_window
+//r:3.0
+//
+#define qtn_sml_sync_conn		"Connecting\n"
+
+//d:changing text displayed at initialising stage
+//d:Image replaced by animation
+//l:popup_note_wait_window
+//r:3.0
+//
+#define qtn_sml_sync_init		"Initialising\n"
+
+//d:changing text displayed at synchronising stage
+//d:Image replaced by animation
+//l:popup_note_wait_window
+//r:3.0
+//
+#define qtn_sml_sync_sync		"Synchronising\n"
+
+//d:changing text displayed at synchronising stage
+//d:Image replaced by animation
+//l:popup_note_wait_window
+//r:3.0
+//
+#define qtn_sml_sync_sending	"Sending %0U"
+
+/* Implementation of CMCC PIM v3 begins*/
+//d:changing text displayed at synchronising stage
+//d:Image replaced by animation
+//l:popup_note_wait_window
+//r:9.2
+//for TD-SCDMA products only
+//
+#define qtn_sml_sync_sending_xofy_tdscdma   "Sending %0N of %1N %0U"
+/* Implementation of CMCC PIM v3 ends*/ 
+
+/* Implementation of CMCC PIM v3 begins*/
+//d:changing text displayed at synchronising stage
+//d:Image replaced by animation
+//l:popup_note_wait_window
+//r:9.2
+//for TD-SCDMA products only
+//
+#define qtn_sml_sync_sending_xofy_cal_tdscdma   "Sending %0N of %1N of calendar entries"
+/* Implementation of CMCC PIM v3 ends*/ 
+
+//d:changing text displayed at synchronising stage
+//d:Image replaced by animation
+//l:popup_note_wait_window
+//r:3.0
+//
+#define qtn_sml_sync_receiving	"Receiving %0U"
+
+/* Implementation of CMCC PIM v3 begins*/ 
+//d:changing text displayed at synchronising stage
+//d:Image replaced by animation
+//l:popup_note_wait_window
+//r:9.2
+//for TD-SCDMA products only
+//
+#define qtn_sml_sync_receiving_xofy_tdscdma "Receiving %0U:%0N"
+/* Implementation of CMCC PIM v3 ends*/ 
+
+/* Implementation of CMCC PIM v3 begins*/ 
+//d:changing text displayed at synchronising stage
+//d:Image replaced by animation
+//l:popup_note_wait_window
+//r:9.2
+//for TD-SCDMA products only
+//
+#define qtn_sml_sync_receiving_xofy_cal_tdscdma "Receiving calendar entries:%0N"
+/* Implementation of CMCC PIM v3 ends*/ 
+
+//d:changing text displayed at disconnect stage
+//d:Image replaced by animation
+//l:popup_note_wait_window 
+//r:3.0
+//
+#define qtn_sml_sync_disconn	"Disconnecting\n"
+
+//d:changing text displayed after succesful synchronisation
+//d:Image replaced by animation
+//l:popup_note_wait_window 
+//r:3.0
+//
+#define qtn_sml_sync_end_done	"Completed\n\n"
+
+//d:changing text displayed at cancelling stage
+//d:Image replaced by animation
+//l:popup_note_wait_window
+//r:3.0
+//
+#define qtn_sml_sync_cancel		"Cancelling\n"
+
+/* Implementation of CMCC PIM v3 begins*/ 
+//d:changing text displayed at synchronising stage
+//d:Image replaced by animation
+//l:popup_note_window
+//r:9.2
+//for TD-SCDMA products only
+//
+#define qtn_nsml_log_err_serverfull_tdscdma  "Server memory is full"
+/* Implementation of CMCC PIM v3 ends*/ 
+
+
+
+// -----------------------------------------------------------------------------
+// sync log dialog strings
+// -----------------------------------------------------------------------------
+
+
+//d:texts for the log view window
+//d:heading for the log view window list
+//l:heading_pane_t1
+//r:3.0
+//
+#define qtn_sml_log_synclog_title	"Sync log" 
+
+//d:texts for the log view window
+//d:heading for the log view window list
+//l:list_double_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_log_profile			"Set name" 
+
+//d:heading for the log view window list
+//l:list_double_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_log_date			"Date"
+
+//d:heading for the log view window list
+//l:list_double_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_log_time			"Time"
+
+//d:heading for the log view window list
+//l:list_double_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_log_remote			"Remote server"
+
+//d:heading for the log view window list
+//l:list_double_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_log_status			"Status"
+
+//d:heading for the log view window list
+//l:list_double_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_log_phone			"Phone"
+
+//d:heading for the log view window list
+//l:list_double_pane_t1_cp2
+//r:3.0
+//
+#define qtn_sml_log_server			"Server"
+
+//d:heading for the log view window list
+//l:list_double_pane_t1_cp2
+//r:3.2
+//
+#define qtn_sml_log_error			"Errors:"
+
+//d:heading for the log view window list
+//l:list_single_heading_pane_t1
+//r:3.0
+//
+#define qtn_sml_log_ok				"Complete"
+
+//d:heading for the log view window list
+//l:list_single_heading_pane_t1
+//r:3.2
+//
+#define qtn_sml_log_cancelled		"Cancelled"	
+
+//d:heading for the log view window list
+//l:list_single_heading_pane_t1
+//r:3.2
+//
+#define qtn_sml_log_err				"Incomplete"
+
+//d:item in the sync log view
+//d:%U refers to content name
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_added_content "Added %U:" 
+
+//d:item in the sync log view
+//d:%U refers to content name
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_updated_content	"Updated %U:" 
+
+//d:item in the sync log view
+//d:%U refers to content name
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_deleted_content	"Deleted %U:"
+
+//d:item in the sync log view
+//d:%U refers to content name
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_discarded_content "Discarded %U:"
+
+//d:item in the sync log view
+//d:%U refers to content name
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_moved_content "Moved %U:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_added_contacts "Added contacts:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_updated_contacts	"Updated contacts:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_deleted_contacts	"Deleted contacts:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_discarded_contacts "Discarded contacts:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_moved_contacts "Moved contacts:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_added_calendar "Added calendar:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_updated_calendar	"Updated calendar:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_deleted_calendar	"Deleted calendar:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_discarded_calendar "Discarded calendar:"
+
+//d:item in the sync log view
+//l:list_double_pane_t1_cp2 
+//r:3.2
+//
+#define qtn_sml_log_moved_calendar "Moved calendar:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_added_notes "Added notes:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_updated_notes	"Updated notes:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_deleted_notes	"Deleted notes:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_discarded_notes "Discarded notes:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_moved_notes "Moved notes:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_added_email "Added email:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_updated_email	"Updated email:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_deleted_email	"Deleted email:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_discarded_email "Discarded email:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_moved_email "Moved email:"
+
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_added_sms "Added Sms:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_updated_sms	"Updated Sms:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_deleted_sms	"Deleted sms:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_discarded_sms "Discarded sms:"
+
+//d:item in the sync log view
+//l:list_double_pane_t2_cp2 
+//r:3.2
+//
+#define qtn_sml_log_moved_sms "Moved sms:"
+
+//d:item in the sync log view
+//l:list_double_pane_t1_cp2 
+//r:5.0
+//
+#define qtn_sml_log_added_mms "Added MMS:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t1_cp2 
+//r:5.0
+//
+#define qtn_sml_log_updated_mms	"Updated MMS:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t1_cp2 
+//r:5.0
+//
+#define qtn_sml_log_deleted_mms	"Deleted MMS:"
+
+//d:item in the sync log view
+//l:list_double_pane_t1_cp2 
+//r:5.0
+//
+#define qtn_sml_log_discarded_mms "Discarded MMS:"
+
+//d:item in the sync log view
+//l:list_double_pane_t1_cp2 
+//r:5.0
+//
+#define qtn_sml_log_moved_mms "Moved MMS:"
+
+//d:item in the sync log view
+//l:list_double_pane_t1_cp2 
+//r:5.0
+//
+#define qtn_sml_log_added_bkm "Added Bookmarks:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t1_cp2 
+//r:5.0
+//
+#define qtn_sml_log_updated_bkm	"Updated Bookmarks:" 
+
+//d:item in the sync log view
+//l:list_double_pane_t1_cp2 
+//r:5.0
+//
+#define qtn_sml_log_deleted_bkm	"Deleted Bookmarks:"
+
+//d:item in the sync log view
+//l:list_double_pane_t1_cp2 
+//r:5.0
+//
+#define qtn_sml_log_discarded_bkm "Discarded Bookmarks:"
+
+//d:item in the sync log view
+//l:list_double_pane_t1_cp2 
+//r:5.0
+//
+#define qtn_sml_log_moved_bkm "Moved Bookmarks:"
+
+// -----------------------------------------------------------------------------
+// error strings
+// -----------------------------------------------------------------------------
+
+
+//d:Error confirmation dialog
+//d:Message in log if system error occured
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_systemerror "System Error"
+
+//d:Error confirmation dialog
+//d:Message in log if system error occured in server
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_servererror "Error in sync server"
+
+//d:Error confirmation dialog
+//d:Message in log if SyncML protocol error occured
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_protocol "Unable to synchronise with server"
+
+//d:Error confirmation dialog
+//d:Message in log if command sent to server was not supported 
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_cmdnotsupported "Unsupported SyncML software version in server"
+
+//d:Error confirmation dialog
+//d:Message in log if server has unsupported version
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_versionnotsupported "Unsupported SyncML software version in server"
+
+//d:Error confirmation dialog
+//d:Message in log if content type is not supported by server
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_contentnotsupported "Unsupported content type"
+
+//d:Error confirmation dialog
+//d:Message in log if client authentication failed
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_clientauth "Invalid user name or password"
+
+//d:Error confirmation dialog
+//d:Message in log if client authentication failed
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_httpauth "Http authentication failed"
+
+//d:Error confirmation dialog
+//d:Message in log if server was busy
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_serverbusy "Synchronisation server was busy"
+
+//d:Error confirmation dialog
+//d:Message in log if opening local database fails
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_localdatabase "Unable to open database"
+
+//d:Error confirmation dialog
+//d:Message in log if local database has changed
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_localdbchanged "Database changed. Synchronization interrupted."
+
+//d:Error confirmation dialog
+//d:Message in log if remote database name is invalid
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_remotedatabase "Invalid remote database"
+
+//d:Error confirmation dialog
+//d:Message in log if databases cannot be found (?)
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_invaliddatabase "Invalid database"
+
+//d:Error confirmation dialog
+//d:Message in log if server is not responding
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_servernotresponding "Server is not responding"
+
+//d:Error confirmation dialog
+//d:Message in log if server is not responding
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_invalidsynctype "Sync type was not allowed"
+
+//d:Error confirmation dialog
+//d:Message in log if communication error occured
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_comm "Error in communication"
+
+//d:Error confirmation dialog
+//d:Message in log if uri is invalid
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_log_err_uriinvalid "Invalid host address"
+
+//d:Error confirmation dialog
+//d:Message when user tries to simultaneously edit one sync set in more 
+//d:than one application (eg. Phonebook and Sync)
+//l:popup_note_window
+//r:3.0
+//
+#define qtn_nsml_locked_profile "Sync set already in use by another application"
+
+//d:Error confirmation dialog
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_log_err_untrusted_certificate "Server has untrusted certificate"
+
+
+//d:lText of Data synchronization list item in  Control panel Device management view
+//d:Item opens Data sync application
+//l:list_single_large_graphic_pane_t1
+//r:5.0
+//
+#define qtn_cp_folder_data_sync "Sync"
+
+//d: radio button popup menu text
+//l: list_set_graphic_pane_t1
+//w: 
+//r: 3.2
+//
+#define qtn_netw_conset_sett_default_connection "Default Connection"
+
+//d: radio button popup menu title text
+//l: list_setting_pane_t1
+//w: 
+//r: 3.2
+//
+#define qtn_netw_conset_sett_destination "Network connection"
+
+//d: radio button popup menu text
+//l: list_set_graphic_pane_t1
+//w: 
+//r: 3.2
+//
+#define qtn_netw_conset_sett_user_defined "User Defined"
+
+//d:this message is shown when sync is attempted while 'Always ask' is selected and user is in roaming
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_network_confirmation "Foreign network used. Extra costs may exist. Continue sync?"
+
+//d:this message is shown when sync is attempted while 'never allow' is selected and user is in roaming
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_network_not_allowed "Foreign network used. Sync not allowed"
+
+//d:this message is shown when sync is attempted while roaming setting is blocked
+//l:popup_note_window
+//r:3.2
+//
+#define qtn_sml_note_not_home_network "Sync not allowed until in home network"
+
+//d:Title of the advanced settings in options
+//l:title_pane_t2/opt9
+//r:3.2
+//
+#define qtn_sml_title_adv_settings  "Advanced settings"
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/loc/NSmlSyncProfiles.loc	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2002-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:  Localisation file for OmaDSAppUi/AspSyncUtil
+*
+*/
+
+
+//d:PC Suite profile
+//d: PC Suite profile
+//l:navi_text_pane_t1 
+//r:3.1
+//
+#define qtn_sml_pc_suite_profile "PC Suite"
+
+//d:PC Suite Plus profile
+//d:PC Suite Plus profile
+//l:navi_text_pane_t1 
+//r:5.0
+//
+#define qtn_sml_pc_suite_plus_profile "PC Suite Plus"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspAdvanceSettingsDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,1011 @@
+/*
+* 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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "AspAdvanceSettingsDialog.h"
+#include "AspContentDialog.h"
+#include "AspSyncUtil.rh"
+#include "AspDebug.h"
+#include <csxhelp/ds.hlp.hrh>
+
+#include <aspsyncutil.mbg>  // for bitmap enumerations
+#include <AknIconArray.h>   // for GulArray
+#include <aknpasswordsettingpage.h>     // CAknAlphaPasswordSettingPage
+#include <ConnectionUiUtilities.h>      // CConnectionUiUtilities
+#include <featmgr.h>   // FeatureManager
+#include "AspDefines.h" //For enum TRoamingSettings
+#include <centralrepository.h> //For central Repository
+#include "CPreSyncPlugin.h"
+
+const TInt KMSKControlId( CEikButtonGroupContainer::EMiddleSoftkeyPosition );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+TBool CAspAdvanceSettingsDialog::ShowDialogL()
+	{
+	CAspAdvanceSettingsDialog* dialog = CAspAdvanceSettingsDialog::NewL();
+
+	TBool ret = dialog->ExecuteLD(R_ASP_ADVANCE_SETTINGS_DIALOG);
+
+    return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::NewL
+//
+// -----------------------------------------------------------------------------
+CAspAdvanceSettingsDialog* CAspAdvanceSettingsDialog::NewL()
+    {
+    FLOG( _L("CAspAdvanceSettingsDialog::NewL START") );
+
+    CAspAdvanceSettingsDialog* self = new ( ELeave ) CAspAdvanceSettingsDialog();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    FLOG( _L("CAspAdvanceSettingsDialog::NewL END") );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::CAspAdvanceSettingsDialog
+// 
+// -----------------------------------------------------------------------------
+//
+CAspAdvanceSettingsDialog::CAspAdvanceSettingsDialog()
+	{
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::ConstructL()
+    {
+    FLOG( _L("CAspAdvanceSettingsDialog::ConstructL START") );
+	
+	// contruct menu for our dialog
+	CAknDialog::ConstructL(R_ADVANCE_SETTINGS_DIALOG_MENU);
+
+	iResHandler = CAspResHandler::NewL();
+
+	iSettingList = new (ELeave) CArrayPtrFlat<CAspListItemData>(1);
+	
+	// get previous title so it can be restored
+	iStatusPaneHandler = CStatusPaneHandler::NewL(iAvkonAppUi);
+	iStatusPaneHandler->StoreOriginalTitleL();
+	
+	// store current navi pane
+	iStatusPaneHandler->StoreNavipaneL();
+
+	FLOG( _L("CAspAdvanceSettingsDialog::ConstructL END") );
+    } 
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CAspAdvanceSettingsDialog::~CAspAdvanceSettingsDialog()
+    {
+    FLOG( _L("CAspAdvanceSettingsDialog::~CAspAdvanceSettingsDialog START") );
+
+	delete iResHandler;
+	
+	if (iSettingList)
+		{
+		iSettingList->ResetAndDestroy();
+	    delete iSettingList;
+		}
+
+	delete iStatusPaneHandler;
+	
+    if (iAvkonAppUi)
+    	{
+    	iAvkonAppUi->RemoveFromStack(this);
+    	}
+
+	FLOG( _L("CAspAdvanceSettingsDialog::~CAspAdvanceSettingsDialog END") );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::ActivateL
+//
+// Called by system when dialog is activated.
+//------------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::ActivateL()
+	{
+    CAknDialog::ActivateL();
+
+	// this cannot be in ConstructL which is executed before dialog is launched
+	iAvkonAppUi->AddToStackL(this);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspContentListDialog::GetHelpContext
+//
+//------------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::GetHelpContext(TCoeHelpContext& aContext) const
+	{
+	aContext.iMajor = KUidSmlSyncApp;
+	aContext.iContext = KDS_HLP_MAIN_VIEW;    
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::HandleListBoxEventL
+// 
+// -----------------------------------------------------------------------------
+#ifdef RD_SCALABLE_UI_V2
+void CAspAdvanceSettingsDialog::HandleListBoxEventL(CEikListBox* /*aListBox*/,
+                                            TListBoxEvent aEventType)
+	{
+	if( AknLayoutUtils::PenEnabled() )  
+	  {
+	   switch ( aEventType )
+        {
+        case EEventItemSingleClicked:
+              HandleOKL();
+              break;
+         case EEventEnterKeyPressed :
+
+         case EEventItemDraggingActioned :
+         case EEventPenDownOnItem :
+        	  if(iEditMode != EDialogModeSettingEnforcement)
+				    {
+				    TRAPD(err ,CheckContentSettingL());//folder
+		         	User::LeaveIfError(err);
+				    }
+              break;
+         default:
+              break;
+        }
+		
+	  }
+    
+	}
+#else
+void CAspAdvanceSettingsDialog::HandleListBoxEventL(CEikListBox* /*aListBox*/,
+                                            TListBoxEvent /*aEventType*/)
+{
+	
+}
+#endif
+
+
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::PreLayoutDynInitL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::PreLayoutDynInitL()
+    {
+    iSettingListBox = (CAknSettingStyleListBox*) ControlOrNull (EAdvanceSettingsDialogList);
+    
+   	__ASSERT_ALWAYS(iSettingListBox, TUtil::Panic(KErrGeneral));
+    
+	iSettingListBox->SetListBoxObserver(this);
+	iSettingListBox->CreateScrollBarFrameL(ETrue);
+	iSettingListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+	                 CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto);
+	
+	SetIconsL();
+	
+	// create array of setting items (iSettingList)
+	CreateSettingsListL();
+
+	// add setting headers into listbox
+	UpdateListBoxL(iSettingListBox, iSettingList);
+		
+	iStatusPaneHandler->SetNaviPaneTitleL(R_ASP_TITLE_ADVANCED_SETTINGS);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::SetMiddleSoftKeyLabelL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::SetEmptyMiddleSoftKeyLabelL()
+    {
+    ButtonGroupContainer().RemoveCommandFromStack(KMSKControlId,EAknSoftkeyOpen );
+    HBufC* middleSKText = StringLoader::LoadLC( R_TEXT_SOFTKEY_EMPTY );
+
+    ButtonGroupContainer().AddCommandToStackL(
+        KMSKControlId,
+        EAknSoftkeyEmpty,
+        *middleSKText );
+    iMSKEmpty= ETrue;
+    CleanupStack::PopAndDestroy( middleSKText );
+    }
+// ----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::SetIconsL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::SetIconsL()
+    {
+    if (!iSettingListBox)
+    	{
+    	return;
+    	}
+ 
+ 	TFileName bitmapName;
+	CAspResHandler::GetBitmapFileName(bitmapName);
+	CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray(KDefaultArraySize);
+	CleanupStack::PushL(icons);
+	
+	icons->AppendL(IconL(KAknsIIDQgnIndiSettProtectedAdd, bitmapName,
+	                     EMbmAspsyncutilQgn_indi_sett_protected_add,
+	                     EMbmAspsyncutilQgn_indi_sett_protected_add_mask));
+	
+    // delete old icons
+    CArrayPtr<CGulIcon>* arr =
+    iSettingListBox->ItemDrawer()->FormattedCellData()->IconArray();
+    
+    if (arr)
+    	{
+    	arr->ResetAndDestroy();
+	    delete arr;
+	    arr = NULL;
+    	}
+
+	iSettingListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
+	CleanupStack::Pop(icons);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::IconL
+// 
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CAspAdvanceSettingsDialog::IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex)
+	{
+    return TDialogUtil::CreateIconL(aId, aFileName, aFileIndex, aFileMaskIndex);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::DynInitMenuPaneL
+//
+// Called by system before menu is shown.
+//------------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::DynInitMenuPaneL(TInt /*aResourceID*/, CEikMenuPane* aMenuPane)
+	{   
+	CAspListItemData* item = GetItemForIndex(ListBox()->CurrentItemIndex());
+	if (item->iHidden == EVisibilityReadOnly)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChange);
+		}
+	
+	if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdHelp);
+		}
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::ProcessCommandL
+//
+// Handle commands from menu.
+//------------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::ProcessCommandL(TInt aCommandId)
+	{
+	HideMenu();
+
+	switch (aCommandId)
+		{
+		case EAspMenuCmdHelp:
+		case EAknCmdHelp:
+			{
+			TUtil::LaunchHelpAppL(iEikonEnv);
+            break;
+			}
+
+		case EAspMenuCmdChange:
+		case EAspMenuCmdOpen:
+			{				
+    		CAspListItemData* item = GetItemForIndex(ListBox()->CurrentItemIndex());
+
+			if (item->iItemType == CAspListItemData::ETypeListYesNo)
+				{
+				// open editor for Yes/No setting
+				if (EditSettingItemListL(*item))
+					{
+					SetVisibility();
+					UpdateListBoxL(ListBox(), iSettingList);
+					}
+				}				
+			else
+				{
+				HandleOKL();
+				}
+
+			break;
+			}
+		    
+        case EAspMenuCmdExit:
+        case EAknCmdExit:
+        case EEikCmdExit:
+			{
+			// close dialog and exit calling application
+			iAvkonAppUi->ProcessCommandL(EAknCmdExit);
+			break;
+			}
+
+		default:			
+		    break;
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::OkToExitL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspAdvanceSettingsDialog::OkToExitL(TInt aButtonId)
+	{
+	if (aButtonId == EEikBidCancel)
+		{
+		// save silently and close dialog
+		
+		CheckSettingValues(aButtonId);
+
+		return ETrue; // close dialog
+		}
+
+	if (aButtonId == EAknSoftkeyBack)
+        {
+        TBool ret = CheckSettingValues(aButtonId);
+        if (!ret)
+        	{
+        	return EFalse; // leave dialog open
+        	}
+        	
+		return ETrue; // close dialog
+		}
+		
+	if (aButtonId == EAknSoftkeyOpen || aButtonId == EAknSoftkeyEmpty)  // MSK
+        {
+		CAspListItemData* item = GetItemForIndex(ListBox()->CurrentItemIndex());
+		if (item->iHidden == EVisibilityReadOnly)
+			{
+    		if(iEditMode == EDialogModeSettingEnforcement)
+    		{
+    			TDialogUtil::ShowInformationNoteL(R_ASP_PROTECTED_SETTING);
+    		}
+     		else
+     		{
+			TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_READ_ONLY);
+     		}
+			return EFalse;
+			}
+
+        HandleOKL();
+		return EFalse;  // leave dialog open
+		}
+		
+	if (aButtonId == EAknSoftkeyOptions)	
+		{
+		if (iCommandSetId == R_ASP_CBA_OPTIONS_BACK_OPEN)
+			{
+			UpdateMenuL(R_ADVANCE_SETTINGS_DIALOG_MENU);
+			}	
+		else 
+			{
+			UpdateMenuL(R_ASP_PROFILE_DIALOG_MENU);	
+			}
+		return EFalse;
+		}
+	return CAknDialog::OkToExitL(aButtonId);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::CheckSettingValuesL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspAdvanceSettingsDialog::CheckSettingValuesL(TInt /* aButtonId */)
+	{
+	
+    if (iEditMode == EDialogModeReadOnly || 
+        iEditMode == EDialogModeSettingEnforcement)
+    	{
+    	return ETrue;
+    	}
+	
+    return ETrue;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::CheckSettingValues
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspAdvanceSettingsDialog::CheckSettingValues(TInt aButtonId)
+	{
+	TBool ret = EFalse;
+	
+	TRAPD(err, ret = CheckSettingValuesL(aButtonId));
+	if (err != KErrNone)
+		{
+		return ETrue;
+		}
+
+	return ret;
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::OfferKeyEventL
+// 
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspAdvanceSettingsDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+	{
+	if (aType == EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+			case EKeyEnter:
+			case EKeyOK:
+				{
+					OkToExitL(EAknSoftkeyOpen);
+					return EKeyWasConsumed;
+				}
+			case EKeyEscape:  // framework calls this when dialog must shut down
+				{
+				return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+        		}
+			case EKeyUpArrow:
+			case EKeyDownArrow:
+			    {
+			    	if(iEditMode != EDialogModeSettingEnforcement)
+				    {
+				    TRAPD(err ,CheckContentSettingL(aKeyEvent));//folder
+		         	User::LeaveIfError(err);
+				    }
+			    break;
+			    }
+            default:
+				{
+			    break;
+				}
+			}
+		}
+
+	return CAknDialog::OfferKeyEventL( aKeyEvent, aType);
+	}
+
+// ---------------------------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::CheckContentSetting
+// modifies MSK and menu item depending on the item in the list box when touch events are handled
+// ----------------------------------------------------------------------------------------------
+//
+
+void CAspAdvanceSettingsDialog::CheckContentSettingL()
+{
+	TInt curIndex = ListBox()->CurrentItemIndex();
+	TInt count = iSettingList->Count();
+	CAspListItemData* lastItem = (*iSettingList)[--count];
+	
+
+		
+	CAspListItemData* curItem = GetItemForIndex(curIndex);
+	//TBool isPCSuite = CAspProfile::IsPCSuiteProfile(iProfile);
+	//if(isPCSuite && (curItem->iHidden == EVisibilityReadOnly))
+    if(curItem->iHidden == EVisibilityReadOnly)
+	{
+   		SetEmptyMiddleSoftKeyLabelL();
+   		return;
+	}
+	if(curItem->iItemId != EAspSyncContent)
+		{
+		if(iCommandSetId != R_ASP_CBA_OPTIONS_BACK_CHANGE || iMSKEmpty)
+			{
+			UpdateCbaL(R_ASP_CBA_OPTIONS_BACK_CHANGE);
+		
+			}
+		return;		
+		}
+	UpdateCbaL( R_ASP_CBA_OPTIONS_BACK_OPEN);
+
+}
+
+// ----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::CheckContentSetting
+// modifies MSK based on the item
+// ----------------------------------------------------------------------------
+//
+
+void CAspAdvanceSettingsDialog::CheckContentSettingL(const TKeyEvent& aKeyEvent)
+	{
+	
+	TInt curIndex = ListBox()->CurrentItemIndex();
+	TInt count = iSettingList->Count();
+	CAspListItemData* lastItem = (*iSettingList)[--count];
+	
+	switch (aKeyEvent.iCode)
+		{
+		case EKeyUpArrow:
+			{
+				if (curIndex)
+				{
+					curIndex--;
+				}
+				else
+				{
+				    curIndex = lastItem->iIndex;
+				}
+			break;
+			}
+		case EKeyDownArrow:
+			{
+				if (curIndex == lastItem->iIndex)
+				{
+				curIndex = 0;
+				}
+				else
+				{
+				curIndex++;
+				}
+			break;
+			}
+		}
+		
+	CAspListItemData* curItem = GetItemForIndex(curIndex);
+	//TBool isPCSuite = CAspProfile::IsPCSuiteProfile(iProfile);
+	//if(isPCSuite && (curItem->iHidden == EVisibilityReadOnly))
+	if(curItem->iHidden == EVisibilityReadOnly)
+	{
+   		SetEmptyMiddleSoftKeyLabelL();
+   		return;
+	}
+	if(curItem->iItemId != EAspSyncContent)
+		{
+		if(iCommandSetId != R_ASP_CBA_OPTIONS_BACK_CHANGE || iMSKEmpty)
+			{
+			UpdateCbaL(R_ASP_CBA_OPTIONS_BACK_CHANGE);
+		
+			}
+		return;		
+		}
+	UpdateCbaL( R_ASP_CBA_OPTIONS_BACK_OPEN);
+
+	}
+
+// ----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::HandleResourceChange
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::HandleResourceChange(TInt aType)
+    {   
+    if (aType == KEikDynamicLayoutVariantSwitch) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        iSettingListBox->SetSize(mainPaneRect.Size());
+        CCoeControl::HandleResourceChange(aType);
+		DrawDeferred();
+	    return;
+		}
+		
+    if (aType == KAknsMessageSkinChange)
+        {
+        TRAP_IGNORE(SetIconsL());
+        }
+		
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+//------------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::HandleOKL
+//
+//------------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::HandleOKL()
+	{
+	
+	CAspListItemData* item = GetItemForIndex(ListBox()->CurrentItemIndex());
+
+	if (item->iHidden == EVisibilityReadOnly)
+		{
+			if(iEditMode == EDialogModeSettingEnforcement)
+      		{
+    			TDialogUtil::ShowInformationNoteL(R_ASP_PROTECTED_SETTING);
+    		}
+     		else
+     		{
+			TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_READ_ONLY);
+     		}
+		return;
+		}
+
+	if (EditSettingItemL(*item))
+		{
+		SetVisibility();
+		UpdateListBoxL(ListBox(), iSettingList);
+		}
+		
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::CreateSettingsListL
+// 
+// Function creates setting list array (iSettingsList).
+// Note: enum TAspConnectionSettings must match with string array
+// (R_ASP_CONNECTION_DIALOG_SETTING_ITEMS).
+// ----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::CreateSettingsListL()
+	{
+	// read setting headers from resource
+	CDesCArray* arr = iResHandler->ReadDesArrayLC(R_ADVANCE_SETTINGS_DIALOG_ITEMS);
+	
+	// add one CAspListItemData for each setting
+	AddItemL(ERoamingSettings, arr);
+
+	// write setting data into each CAspListItemData
+	TInt count=iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		InitSettingItemL((*iSettingList)[i]);
+		}
+
+	SetVisibility();  // find out what setting appear on UI
+
+	CleanupStack::PopAndDestroy(arr);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::AddItemL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::AddItemL(TInt aItemId, CDesCArray* aHeaders)
+	{
+    CAspListItemData* item = CAspListItemData::NewLC();
+	item->SetHeaderL((*aHeaders)[aItemId]);
+	item->iItemId = aItemId;
+	iSettingList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+// ----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::AddItemL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::AddItemL(TInt aItemId, TInt aResourceId)
+	{
+    CAspListItemData* item = CAspListItemData::NewLC();
+	item->SetHeaderL(aResourceId);
+	item->iItemId = aItemId;
+	iSettingList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+
+// ----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::UpdateListBoxL
+// 
+// Add settings headers into listbox.
+// ----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::UpdateListBoxL(CEikTextListBox* aListBox,
+                                       CAspSettingList* aItemList)
+	{
+	CDesCArray* arr = (CDesCArray*)aListBox->Model()->ItemTextArray();
+	arr->Reset();
+
+	TInt count = aItemList->Count();
+	for (TInt i=0; i<count; i++ )
+		{	
+		CAspListItemData* item = (*aItemList)[i];		
+		TInt aValue = 0;
+		ReadRepositoryL(KNSmlRoamingSettingKey, aValue);
+		if(aValue != ERoamingSettingBlock)
+		{
+		WriteRepositoryL(KNSmlRoamingSettingKey, item->iNumberData);
+		}
+		else
+		{
+		SetEmptyMiddleSoftKeyLabelL();
+		}
+		    		
+		TBool convert = ETrue;
+		if (item->iHidden != EVisibilityHidden)
+			{
+			HBufC* hBuf = item->ListItemTextL(convert);
+			CleanupStack::PushL(hBuf);
+			
+			arr->AppendL(hBuf->Des());
+			
+			// store listbox index (from zero up) into setting item 
+			item->iIndex = arr->Count() - 1;
+
+			CleanupStack::PopAndDestroy(hBuf);
+			}
+		else
+			{
+			item->iIndex = KErrNotFound;
+			}
+		}
+
+	ListBox()->HandleItemAdditionL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::SetVisibility
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::SetVisibility()
+	{
+    TInt aValue(0);
+    TRAPD(err ,ReadRepositoryL(KNSmlRoamingSettingKey, aValue));
+    if(aValue == ERoamingSettingBlock)
+    {
+	Item(ERoamingSettings)->iHidden = EVisibilityReadOnly;
+	}
+	else
+	{
+	Item(ERoamingSettings)->iHidden = EVisibilityNormal;
+	}
+	}
+
+void CAspAdvanceSettingsDialog::ReadRepositoryL(TInt aKey, TInt& aValue)
+    {
+    CRepository* rep = CRepository::NewLC(KCRUidNSmlDSApp);
+    TInt err = rep->Get(aKey, aValue);
+    User::LeaveIfError(err);
+    
+    CleanupStack::PopAndDestroy(rep);
+    }
+
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::InitSettingItemL
+// 
+// Constructs CAspListItemData for one connection setting.
+// -----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::InitSettingItemL(CAspListItemData* aItem)
+	{
+	__ASSERT_ALWAYS(aItem, TUtil::Panic(KErrGeneral));	
+	
+	iBuf = KNullDesC;  // reset common buffer
+	
+	switch (aItem->iItemId)
+		{		
+        case ERoamingSettings:
+            {
+            CDesCArray* arr = iResHandler->ReadDesArrayLC(R_ASP_ROAMING_SETTINGS);
+            TInt aValue(0);
+            ReadRepositoryL(KNSmlRoamingSettingKey, aValue);
+
+            if(aValue == ERoamingSettingBlock)
+                {
+                aItem->iNumberData = ERoamingSettingAlwaysAsk;
+                }
+            else
+                {
+                aItem->iNumberData = aValue;
+                }
+            //aItem->iNumberData = iProfile->SASyncState();
+            aItem->iResource = R_ASP_ROAMING_SETTINGS;
+            aItem->SetValueL((*arr)[aItem->iNumberData]);
+            aItem->iItemType = CAspListItemData::ETypeList;
+            
+            CleanupStack::PopAndDestroy(arr);
+            break;
+            }
+			
+        default:
+           	__ASSERT_DEBUG(EFalse, TUtil::Panic(KErrGeneral));
+			break;
+		
+		}
+	}
+	
+//------------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::EditSettingItemL
+//
+// Calls setting editing functions. 
+//------------------------------------------------------------------------------
+//
+TBool CAspAdvanceSettingsDialog::EditSettingItemL(CAspListItemData& aItem)
+	{
+	TInt ret = EFalse;
+	
+	switch (aItem.iItemType)
+		{
+
+		case CAspListItemData::ETypeList:
+			ret = EditSettingItemListL(aItem);
+		    break;
+		
+
+		default:
+		    break;
+		}
+	
+	return ret;
+	}
+
+//------------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::EditSettingItemListL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspAdvanceSettingsDialog::EditSettingItemListL(CAspListItemData& aItem)
+	{
+	TInt curSelection = aItem.iNumberData;
+	CDesCArray* arr = CAspResHandler::ReadDesArrayStaticLC(aItem.iResource);
+	
+	TBool ret = TDialogUtil::ShowListEditorL(arr, aItem.Header(), curSelection);
+	if (ret)
+		{
+		aItem.iNumberData = curSelection; 
+		aItem.SetValueL((*arr)[curSelection]);
+		}
+
+	CleanupStack::PopAndDestroy(arr);
+	return ret;
+	}
+
+//-----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::GetItemForIndex
+// 
+// Find item in list position aIndex.
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspAdvanceSettingsDialog::GetItemForIndex(TInt aIndex)
+	{
+	CAspListItemData* item = NULL;
+	
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iIndex == aIndex)
+			{
+			item = temp;
+			break;
+			}
+		}
+
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+
+//-----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::Item
+// 
+// Find item with aItemId (TAspConnectionSettingItem).
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspAdvanceSettingsDialog::Item(TInt aItemId)
+	{
+	CAspListItemData* item = NULL;
+
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iItemId == aItemId)
+			{
+			item = temp;
+			break;
+			}
+		}
+	
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::ListBox
+// 
+// -----------------------------------------------------------------------------
+//
+CAknSettingStyleListBox* CAspAdvanceSettingsDialog::ListBox()
+	{
+	return iSettingListBox;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::UpdateCbaL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::UpdateCbaL(TInt aResourceId)
+	{
+	CEikButtonGroupContainer& cba = ButtonGroupContainer();
+	cba.SetCommandSetL(aResourceId);
+	iCommandSetId = aResourceId;
+	iMSKEmpty = EFalse;
+	cba.DrawDeferred();
+	}
+
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::UpdateMenuL
+// 
+// -----------------------------------------------------------------------------
+//
+
+void CAspAdvanceSettingsDialog::UpdateMenuL(TInt aResource)
+	{
+	CEikMenuBar* menuBar = iMenuBar; // from CAknDialog
+	menuBar->SetMenuTitleResourceId(aResource);
+
+	TRAPD(err, menuBar->TryDisplayMenuBarL());
+    		
+	User::LeaveIfError(err);
+	
+			
+	}
+	
+// -----------------------------------------------------------------------------
+// CAspAdvanceSettingsDialog::UpdateMenuL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspAdvanceSettingsDialog::WriteRepositoryL(TInt aKey, const TInt& aValue)
+    {
+    const TUid KCRRoamingSettingUID = {0x101F9A1D};
+    const TUid KRepositoryId = KCRRoamingSettingUID;
+
+    CRepository* rep = CRepository::NewLC(KRepositoryId);
+    TInt err = rep->Set(aKey, aValue);
+    User::LeaveIfError(err);
+    
+    CleanupStack::PopAndDestroy(rep);
+    }
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspAutoSyncHandler.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,1597 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "AspAutoSyncHandler.h"
+#include "AspUtil.h"
+#include "AspDialogUtil.h"
+#include "AspDebug.h"
+
+#include <schinfo.h> // TScheduleEntryInfo2
+#include <s32mem.h>  // RDesWriteStream
+#include <s32file.h> // RFileReadStream
+//#include <centralrepository.h>  // CRepository
+#include <rconnmon.h>
+
+
+
+
+_LIT(KPeakTaskData, "aspschedulehandler peak task");
+_LIT(KOffPeakTaskData, "aspschedulehandler off-peak task");
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+	
+/*******************************************************************************
+ * class CAspAutoSyncHandler
+ *******************************************************************************/
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspAutoSyncHandler* CAspAutoSyncHandler::NewL()
+    {
+    CAspAutoSyncHandler* self = new (ELeave) CAspAutoSyncHandler();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return(self);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::CAspAutoSyncHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CAspAutoSyncHandler::CAspAutoSyncHandler()
+	{
+	iSyncError = KErrNone;
+	iSyncSessionOpen = EFalse;
+	iSyncRunning = EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspAutoSyncHandler::ConstructL()
+    {
+    iWait = new (ELeave) CActiveSchedulerWait();
+    
+    iSchedule = CAspSchedule::NewL();
+    } 
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CAspAutoSyncHandler::~CAspAutoSyncHandler()
+    {
+    if (iWait && iWait->IsStarted())
+        {
+        iWait->AsyncStop();
+        }
+    delete iWait;
+    
+    delete iSchedule;
+    
+    CloseSyncSession();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::OnSyncMLSessionEvent (from MSyncMLEventObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspAutoSyncHandler::OnSyncMLSessionEvent(TEvent aEvent, TInt /*aIdentifier*/,
+                                           TInt aError, TInt /*aAdditionalData*/)
+	{
+	FLOG( _L("CAspAutoSyncHandler::OnSyncMLSessionEvent START") );
+	
+	if (aEvent == EJobStart)
+		{
+        FLOG( _L("EJobStart") );
+		}
+
+	if (aEvent == EJobStop)
+		{
+    	if (aError != KErrNone)
+			{
+			iSyncError = aError;
+    		}
+
+        FLOG( _L("EJobStop") );
+        
+    	iWait->AsyncStop();
+		}
+    	
+	if (aEvent == EJobStartFailed || aEvent == EJobRejected || aEvent == EServerTerminated)
+		{
+		FLOG( _L("EJobStartFailed or EJobRejected or EServerTerminated") );
+		iWait->AsyncStop();
+		}
+		
+	FLOG( _L("CAspAutoSyncHandler::OnSyncMLSessionEvent END") );
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::OnSyncMLSyncError (from MSyncMLProgressObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspAutoSyncHandler::OnSyncMLSyncError(TErrorLevel aErrorLevel,
+                                                TInt aError, TInt /*aTaskId*/,
+                                                TInt /*aInfo1*/, TInt /*aInfo2*/)
+	{
+	FLOG( _L("CAspAutoSyncHandler::OnSyncMLSyncError START") );
+	
+	if (aErrorLevel == ESmlFatalError)
+		{
+		iSyncError = aError;
+		iWait->AsyncStop();
+		}
+
+	FLOG( _L("CAspAutoSyncHandler::OnSyncMLSyncError END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::OnSyncMLSyncProgress (from MSyncMLProgressObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspAutoSyncHandler::OnSyncMLSyncProgress(TStatus /*aStatus*/,
+                                                   TInt /*aInfo1*/, TInt /*aInfo2*/)
+	{
+	// not needed in scheduled sync
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::OnSyncMLDataSyncModifications (from MSyncMLProgressObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspAutoSyncHandler::OnSyncMLDataSyncModifications(TInt /*aTaskId*/, 
+	         const TSyncMLDataSyncModifications& /*aClientModifications*/,
+	         const TSyncMLDataSyncModifications& /*aServerModifications*/)
+	{
+	// not needed in scheduled sync
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::OpenSyncSessionL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspAutoSyncHandler::OpenSyncSessionL()
+	{
+	if (!iSyncSessionOpen)
+		{
+        TRAPD(err, iSyncSession.OpenL());
+        
+        if (err != KErrNone)
+        	{
+        	FLOG( _L("### CAspAutoSyncHandler: RSyncMLSession::OpenL failed (%d) ###"), err );
+        	User::Leave(err);
+        	}
+
+		iSyncSessionOpen = ETrue;
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CloseSyncSession
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspAutoSyncHandler::CloseSyncSession()
+	{
+	if (iSyncSessionOpen)
+		{
+		iSyncJob.Close(); // this can be done when job has not been opened
+		iSyncSession.Close();
+		iSyncSessionOpen = EFalse;
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::CheckMandatoryData
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspAutoSyncHandler::CheckMandatoryDataL(TInt aProfileId)
+	{
+    TAspParam param(EApplicationIdSync, &iSyncSession);
+
+    CAspProfile* profile = CAspProfile::NewLC(param);
+    profile->OpenL(aProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+    
+	param.iProfile = profile;
+	param.iMode = CAspContentList::EInitAll;
+	CAspContentList* list = CAspContentList::NewLC(param);
+
+   	//TInt contentCount = 0;
+	TInt mandatoryConnectionData = CAspProfile::CheckMandatoryConnData(profile);
+	//TInt mandatoryContentData    = list->CheckMandatoryDataL(contentCount);
+	
+	TInt mandatoryBearerType = EMandatoryOk;
+	if (profile->BearerType() != EAspBearerInternet)
+		{
+		mandatoryBearerType = EMandatoryIncorrectBearerType;
+		}
+		
+	TInt mandatoryAccessPoint = EMandatoryOk;
+	/*if (profile->AccessPointL() == CAspAccessPointHandler::KAskAlways)
+		{
+		mandatoryAccessPoint = EMandatoryIncorrectAccessPoint;
+		}*/
+	
+	CleanupStack::PopAndDestroy(list);
+	CleanupStack::PopAndDestroy(profile);
+	
+	if (mandatoryBearerType != EMandatoryOk)
+		{
+		return mandatoryBearerType;
+		}
+
+	if (mandatoryAccessPoint != EMandatoryOk)
+		{
+		return mandatoryAccessPoint;
+		}
+
+	if (mandatoryConnectionData != EMandatoryOk)
+		{
+		return mandatoryConnectionData;
+		}
+		
+	return EMandatoryOk;//mandatoryContentData;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::SynchronizeL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspAutoSyncHandler::SynchronizeL(RFile& aTaskFile)
+	{
+	
+	FLOG( _L("CAspAutoSyncHandler::SynchronizeL START") );
+
+	CFileStore*         store;
+    RStoreReadStream    instream;
+    // Get tasks from scheduler's store
+    store = CDirectFileStore::FromLC(aTaskFile);
+    instream.OpenLC(*store,store->Root());
+    TInt count = instream.ReadInt32L();
+
+	CScheduledTask* task = CScheduledTask::NewLC(instream);
+    HBufC* taskData = const_cast<HBufC*>(&(task->Data()));
+    TPtr ptr = taskData->Des();
+    TBool doCleanUp = ETrue;
+
+	if (ptr.Compare(KPeakTaskData) == 0)
+		{
+	 FLOG( _L("Peak Sync Scheduled") );
+		TInt interval = iSchedule->SyncPeakSchedule();
+		if (iSchedule->IntervalType(interval) == EHourly
+					&& interval != CAspSchedule::EIntervalManual)
+			{
+			if (iSchedule->IsValidPeakScheduleL() != 0)
+				{
+				//postpone peak schedule until next peak start
+				iSchedule->UpdatePeakScheduleL();
+				CleanupStack::PopAndDestroy(task);
+    			CleanupStack::PopAndDestroy( &instream ); 
+				CleanupStack::PopAndDestroy( store ); 
+				doCleanUp = EFalse;
+				return;
+				}
+			else
+				{
+				//schedule next sync
+				if(!iSchedule->IsValidNextPeakScheduleL())
+					{
+					iSchedule->UpdatePeakScheduleL();
+					}
+				else 
+					{
+					CAspSyncSchedule* syncSchedule = CAspSyncSchedule::NewLC();
+					syncSchedule->EditPeakScheduleL(iSchedule);
+					CleanupStack::PopAndDestroy(syncSchedule);
+					}
+				}
+			}
+		else
+			{
+			//schedule next sync
+			CAspSyncSchedule* syncSchedule = CAspSyncSchedule::NewLC();
+			syncSchedule->EditPeakScheduleL(iSchedule);
+			CleanupStack::PopAndDestroy(syncSchedule);
+			}
+		}
+			
+	if (ptr.Compare(KOffPeakTaskData) == 0)
+		{
+		FLOG( _L("Off-Peak Sync Scheduled") );
+		TInt interval = iSchedule->SyncOffPeakSchedule();
+		if (iSchedule->IntervalType(interval) == EHourly)
+			{
+			if (iSchedule->IsValidOffPeakScheduleL() != 0)
+				{
+				//postpone off-schedule until next off-peak start
+				iSchedule->UpdateOffPeakScheduleL();
+				CleanupStack::PopAndDestroy(task);
+				CleanupStack::PopAndDestroy( &instream ); 
+				CleanupStack::PopAndDestroy( store ); 
+				doCleanUp = EFalse;
+				return;
+				}
+			else
+				{
+				//schedule next sync
+				if(!iSchedule->IsValidNextOffPeakScheduleL())
+					{
+					iSchedule->UpdateOffPeakScheduleL();
+					}
+				else
+					{
+					CAspSyncSchedule* syncSchedule = CAspSyncSchedule::NewLC();
+					syncSchedule->EditOffPeakScheduleL(iSchedule);
+					CleanupStack::PopAndDestroy(syncSchedule);
+					}
+				}
+		
+			}
+		}
+
+	if(doCleanUp)	
+		{
+			CleanupStack::PopAndDestroy(task);
+			CleanupStack::PopAndDestroy( &instream ); 
+			CleanupStack::PopAndDestroy( store ); 
+			doCleanUp = EFalse;
+		}
+	
+	iSchedule->SetError(KErrNone);
+	iSchedule->SaveL();
+	
+	TRAPD (err, DoSynchronizeL());
+	User::LeaveIfError(err);
+
+}
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::DoSynchronizeL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspAutoSyncHandler::DoSynchronizeL()
+{
+	
+	OpenSyncSessionL();
+	
+	if (CAspProfile::OtherSyncRunning(&iSyncSession))
+		{
+		FLOG( _L("### other sync running ###") );
+		TInt currentJobId = CAspProfile::CurrentJob(&iSyncSession);
+		if (currentJobId != KErrNotFound)
+			{
+			iSyncJob.OpenL(iSyncSession, currentJobId);
+			if (iSchedule->ProfileId() != iSyncJob.Profile())
+				{
+				FLOG( _L("CAspAutoSyncHandler::SynchronizeL Set Error") );
+				iSchedule->SetError(EOtherSyncRunning);
+				iSchedule->SaveL();
+				}
+			iSyncJob.Close();
+			}
+		FLOG( _L("CAspAutoSyncHandler::SynchronizeL END") );
+		return;
+		}
+	
+    TInt profileId = iSchedule->AutoSyncProfileId();
+	iSchedule->UpdateProfileSettingsL();
+	iSchedule->SaveL();
+
+	
+#ifdef _DEBUG
+	iSchedule->LogScheduleL();
+#endif
+	
+	if (!iSchedule->CanSynchronizeL())
+		{
+		FLOG( _L("### incorrect auto sync settings ###") );
+		FLOG( _L("CAspAutoSyncHandler::SynchronizeL END") );
+	    //iSchedule->SetError(EIncorrectSchedule);
+		//iSchedule->SaveL();
+		return;
+		}
+
+#if 0 //roaming check not supported		
+	if (!iSchedule->RoamingAllowed())
+		{
+		if (IsRoaming())
+			{
+		    FLOG( _L("### cannot sync when roaming ###") );
+		    FLOG( _L("CAspAutoSyncHandler::SynchronizeL END") );
+		    return;
+			}
+		}
+#endif
+
+	
+		
+	if (CheckMandatoryDataL(profileId) != EMandatoryOk)
+		{
+		FLOG( _L("### incorrect sync profile settings ###") );
+		FLOG( _L("CAspAutoSyncHandler::SynchronizeL END") );
+		//iSchedule->SetError(EIncorrectProfile);
+		//iSchedule->SaveL();
+		return;
+		}
+
+
+    iSyncSession.RequestEventL(*this);     // for MSyncMLEventObserver events
+    iSyncSession.RequestProgressL(*this);  // for MSyncMLProgressObserver events
+    
+
+    iSyncJob.CreateL(iSyncSession, profileId);  // start sync
+    
+    iSyncRunning = ETrue;
+    
+    iWait->Start();  // stop here until sync has completed
+    
+   	iSyncRunning = EFalse;
+
+	iSchedule->UpdateServerIdL();
+   	
+   	if (iSyncError != KErrNone)
+		{
+		iSchedule->SetError(iSyncError);
+		iSchedule->SaveL();
+     	FLOG(_L("### auto sync failed (%d) ###"), iSyncError);
+		}
+	
+    FLOG( _L("CAspAutoSyncHandler::SynchronizeL END") );
+
+}
+
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::IsRoamingL
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspAutoSyncHandler::IsRoamingL()
+	{
+	RConnectionMonitor conMon;
+	
+	conMon.ConnectL();
+
+    TRequestStatus status;
+    TInt registrationStatus(0);
+
+    //check network status
+    conMon.GetIntAttribute(EBearerIdGSM, 0, KNetworkRegistration, 
+                            registrationStatus, status);
+
+    User::WaitForRequest(status);
+    conMon.Close();
+    
+    if (registrationStatus == ENetworkRegistrationRoaming)
+    	{
+    	return ETrue;	
+    	}
+    	
+    return EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspAutoSyncHandler::IsRoaming
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspAutoSyncHandler::IsRoaming()
+	{
+	TBool ret = EFalse;
+	TRAPD(err, ret = IsRoamingL());
+	
+	if (err != KErrNone)
+		{
+		ret = EFalse; // default is not roaming	
+		}
+		
+	return ret;
+    }
+
+
+
+/*******************************************************************************
+ * class CAspSyncSchedule
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncSchedule::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspSyncSchedule* CAspSyncSchedule::NewL()
+    {
+    CAspSyncSchedule* self = new (ELeave) CAspSyncSchedule();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return(self);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncSchedule::NewLC
+//
+// -----------------------------------------------------------------------------
+//
+CAspSyncSchedule* CAspSyncSchedule::NewLC()
+    {
+    CAspSyncSchedule* self = new (ELeave) CAspSyncSchedule();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+
+    return(self);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncSchedule::CAspSyncSchedule
+// 
+// -----------------------------------------------------------------------------
+//
+CAspSyncSchedule::CAspSyncSchedule()
+	{
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncSchedule::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::ConstructL()
+    {
+        
+    _LIT(KScheduleHandler, "z:\\sys\\bin\\aspschedulehandler.exe");
+    const TInt KDefaultSchedulePriority = 1;
+    
+    TInt err = iScheduler.Connect();
+	User::LeaveIfError(err);
+	
+    TFileName name(KScheduleHandler);
+    err = iScheduler.Register(name, KDefaultSchedulePriority);
+    User::LeaveIfError(err);
+    
+   	ipeakEntryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo2>(1);
+	ioffPeakEntryList = new (ELeave) CArrayFixFlat<TScheduleEntryInfo2>(1);
+   	ipeakTaskList  = new (ELeave) CArrayFixFlat<TTaskInfo>(1);
+	ioffPeakTaskList  = new (ELeave) CArrayFixFlat<TTaskInfo>(1);
+    } 
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CAspSyncSchedule::~CAspSyncSchedule()
+    {
+    delete ipeakEntryList;
+	delete ioffPeakEntryList;
+    delete ipeakTaskList;
+    delete ioffPeakTaskList;
+	
+    iScheduler.Close();
+    }
+
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::DoDeleteScheduleL
+// - Delete schedules if exist
+// ----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::DoDeleteScheduleL(CAspSchedule* aAspSchedule)
+	{
+	ipeakEntryList->Reset();
+	ioffPeakEntryList->Reset();
+	ipeakTaskList->Reset();
+    ioffPeakTaskList->Reset();
+	
+    TScheduleState2 state;
+    TTsTime time;
+    
+    TInt peakHandle = aAspSchedule->PeakScheduleHandle();
+	TInt offPeakHandle = aAspSchedule->OffPeakScheduleHandle();
+	
+    if (peakHandle == KErrNotFound && offPeakHandle == KErrNotFound)
+    	{
+    	return; // nothing to delete
+    	}
+    if (peakHandle != KErrNotFound)
+    	{
+    	
+    	TInt err = iScheduler.GetScheduleL(peakHandle, state,
+                                  *ipeakEntryList, *ipeakTaskList, time);
+
+    	TInt count = ipeakTaskList->Count();
+
+		for (TInt i=0; i<count; i++)
+    		{
+    		TTaskInfo& task = (*ipeakTaskList)[i];
+    		err = iScheduler.DeleteTask(task.iTaskId);
+    		User::LeaveIfError(err);
+    		}
+    	
+    	err = iScheduler.DeleteSchedule(peakHandle);
+		aAspSchedule->SetPeakScheduleHandle(KErrNotFound);
+		aAspSchedule->SetDailySyncEnabled(EFalse);
+		aAspSchedule->SetPeakSyncEnabled(EFalse);
+		
+    	User::LeaveIfError(err);
+    	}
+
+	if (offPeakHandle != KErrNotFound)
+    	{
+    	
+    	TInt err = iScheduler.GetScheduleL(offPeakHandle, state,
+                                  *ioffPeakEntryList, *ioffPeakTaskList, time);
+
+    	TInt count = ioffPeakTaskList->Count();
+
+		for (TInt i=0; i<count; i++)
+    		{
+    		TTaskInfo& task = (*ioffPeakTaskList)[i];
+    		err = iScheduler.DeleteTask(task.iTaskId);
+    		User::LeaveIfError(err);
+    		}
+    	
+    	err = iScheduler.DeleteSchedule(offPeakHandle);
+		aAspSchedule->SetOffPeakScheduleHandle(KErrNotFound);
+		aAspSchedule->SetOffPeakSyncEnabled(EFalse);
+    	User::LeaveIfError(err);
+    	}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::DeleteScheduleL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::DeleteScheduleL(CAspSchedule* aAspSchedule)
+	{
+
+	TRAPD(err, DoDeleteScheduleL(aAspSchedule));
+	
+	if (err == KErrNone)
+		{
+		FLOG( _L("CAspSyncSchedule::DeleteScheduleL ok"));
+		}
+	else
+		{
+		FLOG( _L("CAspSyncSchedule::DeleteSchedule failed ,err: %d"), err );
+		}
+		
+	if (err != KErrNone && err != KErrNotFound)
+		{
+		User::Leave(err);
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::CreatePeakScheduleL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::CreatePeakScheduleL(CAspSchedule* aAspSchedule)
+	{
+	
+	const TInt KRepeatForever = -1;
+	const TInt KTaskPriority = 2;
+		
+	CAspSchedule* schedule = aAspSchedule;
+	schedule->SetPeakScheduleHandle(KErrNotFound);
+	
+	TTsTime startTime;
+	TIntervalType intervalType;
+	TInt interval;
+	TTime now;
+	now.HomeTime();
+	TInt peakschedule;
+    TInt peakStatus = schedule->IsValidPeakScheduleL();
+
+	TDateTime startday;
+	TInt syncFrequency = schedule->SyncFrequency();
+
+	//Daily schedule can be done using peak schedule
+	if (IntervalType(syncFrequency) == EDaily)
+		{
+		   	startday = now.DateTime();
+			TTime start = schedule->AutoSyncScheduleTime();
+			TDateTime date = start.DateTime();
+			TDateTime time(startday.Year(), startday.Month(), startday.Day(), date.Hour(), date.Minute(), 0, 0);
+			TTime syncTime(time);
+			startTime.SetLocalTime(syncTime);
+		}
+	else
+		{
+		TInt dayCount = 0;
+	    TInt dayIndex = 0;
+        schedule->SelectedDayInfo(dayCount, dayIndex); 
+		if (dayCount == 0)
+			{
+			//no need to schedule if peak days are not selected
+			schedule->SetPeakSyncEnabled(EFalse);
+			return;
+			}
+
+		if(schedule->WeekdayEnabled(now.DayNoInWeek()))
+			{
+			startday = now.DateTime();
+			//If the current time is peak, start now
+			if (peakStatus == 0)
+				{
+				startTime.SetLocalTime(now);
+				}
+			//current time is before peak
+			else if (peakStatus > 0)
+				{
+				TTime start = schedule->StartPeakTime();
+				TDateTime date = start.DateTime();
+				TDateTime time(startday.Year(), startday.Month(), startday.Day(), date.Hour(), date.Minute(), 0, 0);
+				TTime syncTime(time);
+				startTime.SetLocalTime(syncTime);
+				}
+			//current time is after peak.
+			else if (peakStatus < 0)
+				{
+				TTime start = schedule->StartPeakTime();
+				TDateTime date = start.DateTime();
+				now = now + (TTimeIntervalDays)1;
+				while(!schedule->WeekdayEnabled(now.DayNoInWeek()))
+		 			{
+					now = now + (TTimeIntervalDays)1;
+		 			}
+				startday = now.DateTime();
+				TDateTime time(startday.Year(), startday.Month(), startday.Day(), date.Hour(), date.Minute(), 0, 0);
+				TTime syncTime(time);
+				startTime.SetLocalTime(syncTime);
+				}
+			}
+			
+		else
+			{
+			//find the next day selected for sync
+		 	while(!schedule->WeekdayEnabled(now.DayNoInWeek()))
+		 		{
+				now = now + (TTimeIntervalDays)1;
+		 		}
+		 
+		 	startday = now.DateTime();
+		 	TTime start = schedule->StartPeakTime();
+			TDateTime date = start.DateTime();
+			TDateTime time(startday.Year(), startday.Month(), startday.Day(), date.Hour(), date.Minute(), 0, 0);
+			TTime syncTime(time);
+			startTime.SetLocalTime(syncTime);
+		 	}
+
+		}
+	
+	TInt validityPeriod = KMaxTInt;
+	if (schedule->DailySyncEnabled())
+		{
+		peakschedule = schedule->SyncFrequency();
+		}
+	else
+		{
+	 	peakschedule = schedule->SyncPeakSchedule();
+		}
+    intervalType = IntervalType(peakschedule);
+	interval = Interval(peakschedule);
+
+	TScheduleEntryInfo2 peakEntry(startTime, intervalType, interval, (TTimeIntervalMinutes)validityPeriod);
+	
+	
+	#ifdef _DEBUG
+	TBuf<64> buf;
+	LogTsTime(startTime, buf);
+	FLOG(_L("Auto sync start time: %S"), &buf);
+	#endif
+    
+	
+	ipeakEntryList->Reset();
+	ipeakEntryList->AppendL(peakEntry);
+	
+	TSchedulerItemRef ref;
+	TInt err = iScheduler.CreatePersistentSchedule(ref, *ipeakEntryList);
+	User::LeaveIfError(err);
+	
+	//keep the scheduler disabled until settings are saved
+	iScheduler.DisableSchedule(ref.iHandle);
+	
+	schedule->SetPeakScheduleHandle(ref.iHandle);
+	
+	HBufC* hBuf = HBufC::NewMaxLC(KBufSize);
+	hBuf->Des() = KPeakTaskData;
+	
+	TTaskInfo taskInfo;
+	taskInfo.iName = KPeakTaskData;
+	taskInfo.iRepeat = KRepeatForever;
+	taskInfo.iPriority = KTaskPriority;
+
+    err = iScheduler.ScheduleTask(taskInfo, *hBuf, ref.iHandle);
+    User::LeaveIfError(err);
+	
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::CreateOffPeakScheduleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::CreateOffPeakScheduleL(CAspSchedule* aAspSchedule)
+	{
+	
+	const TInt KRepeatForever = -1;
+	const TInt KTaskPriority = 1;
+		
+	CAspSchedule* schedule = aAspSchedule;
+	schedule->SetOffPeakScheduleHandle(KErrNotFound);
+	
+	TTime opStart= schedule->EndPeakTime()+ (TTimeIntervalMinutes)1;
+	TDateTime opStartDate = opStart.DateTime();
+	TTime pStart = schedule->StartPeakTime();
+	TDateTime pStartDate = pStart.DateTime();
+	
+	//Dont create off-peak schedule if the duration is zero
+	if (opStartDate.Hour() == pStartDate.Hour()
+						&& opStartDate.Minute() == pStartDate.Minute())
+		{
+		schedule->SetOffPeakSyncEnabled(EFalse);
+		return;
+		}
+	
+	TTsTime startTime;
+	TIntervalType intervalType;
+	TInt interval;
+
+	TTime now;
+	now.HomeTime();
+	
+	TInt offpeakschedule = schedule->SyncOffPeakSchedule();
+	intervalType = IntervalType(offpeakschedule);
+
+	TInt offPeakStatus = schedule->IsValidOffPeakScheduleL();
+	TDateTime startday;
+	
+	startday = now.DateTime();
+	//If the current time is off peak, start now
+	if (offPeakStatus == 0)
+		{
+		startTime.SetLocalTime(now);
+		}
+	//current time is peak
+	else if (offPeakStatus > 0)
+		{
+		TTime start= schedule->EndPeakTime()+ (TTimeIntervalMinutes)1;
+		TDateTime date = start.DateTime();
+		TDateTime time(startday.Year(), startday.Month(), startday.Day(), date.Hour(), date.Minute(), 0, 0);
+		TTime syncTime(time);
+		startTime.SetLocalTime(syncTime);
+		}
+	
+	TInt validityPeriod = KMaxTInt;
+	
+	interval = Interval(offpeakschedule);
+	
+	TScheduleEntryInfo2 offPeakEntry(startTime, intervalType, interval, (TTimeIntervalMinutes)validityPeriod);
+	
+	#ifdef _DEBUG
+	TBuf<64> buf;
+	LogTsTime(startTime, buf);
+	FLOG(_L("Auto sync start time: %S"), &buf);
+	#endif
+    
+	ioffPeakEntryList->Reset();
+	ioffPeakEntryList->AppendL(offPeakEntry);
+	
+	TSchedulerItemRef ref;
+	TInt err = iScheduler.CreatePersistentSchedule(ref, *ioffPeakEntryList);
+	User::LeaveIfError(err);
+
+	//keep the scheduler disabled until settings are saved
+	iScheduler.DisableSchedule(ref.iHandle);
+	
+	schedule->SetOffPeakScheduleHandle(ref.iHandle);
+	
+	HBufC* hBuf = HBufC::NewMaxLC(KBufSize);
+	hBuf->Des() = KOffPeakTaskData;
+	
+	TTaskInfo taskInfo;
+	taskInfo.iName = KOffPeakTaskData;
+	taskInfo.iRepeat = KRepeatForever;
+	taskInfo.iPriority = KTaskPriority;
+
+    err = iScheduler.ScheduleTask(taskInfo, *hBuf, ref.iHandle);
+    User::LeaveIfError(err);
+	
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSyncSchedule::EnableSchedule()
+// -Enable schedules after settings are saved.
+// -----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::EnableSchedule(CAspSchedule* aAspSchedule)
+	{
+	TInt peakHandle = aAspSchedule->PeakScheduleHandle();
+	TInt offPeakHandle = aAspSchedule->OffPeakScheduleHandle();
+
+	if (peakHandle != KErrNotFound)
+		{
+		iScheduler.EnableSchedule(peakHandle);
+		}
+	if (offPeakHandle != KErrNotFound)
+		{
+		iScheduler.EnableSchedule(offPeakHandle);
+		}
+
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSyncSchedule::EditPeakScheduleL
+// -Edit peak schedule entry
+// -----------------------------------------------------------------------------
+//
+
+void CAspSyncSchedule::EditPeakScheduleL(CAspSchedule* aAspSchedule)
+	{
+
+	ipeakEntryList->Reset();
+	ipeakTaskList->Reset();
+
+	TTsTime tsTime;
+	TScheduleState2 state;
+	TInt peakHandle = aAspSchedule->PeakScheduleHandle();
+		
+	if (peakHandle == KErrNotFound)
+		{
+		User::Leave(KErrNotFound);	
+		}
+	
+	TInt err = iScheduler.GetScheduleL(peakHandle, state, *ipeakEntryList, *ipeakTaskList, tsTime);
+	
+	User::LeaveIfError(err);
+	
+	TInt count = ipeakEntryList->Count();
+	__ASSERT_DEBUG(count == 1, TUtil::Panic(KErrArgument));
+
+	TInt peakInterval;
+	if (aAspSchedule->DailySyncEnabled())
+		{
+		peakInterval = aAspSchedule->SyncFrequency();
+		}
+	else
+		{
+	 	peakInterval = aAspSchedule->SyncPeakSchedule();
+		}
+	TInt interval = Interval(peakInterval);
+	TIntervalType intervalType = IntervalType(peakInterval);
+	TTime now;
+	now.HomeTime();
+	TTsTime startTime ;
+	if (intervalType == EHourly)
+		{
+		if (peakInterval == CAspSchedule::EInterval15Mins
+				       		|| peakInterval == CAspSchedule::EInterval30Mins)
+			{
+			now = now + (TTimeIntervalMinutes)interval ;
+			}
+		else
+			{
+			now = now + (TTimeIntervalHours)interval ;
+			}
+		startTime.SetLocalTime(now);
+		}
+	else
+		{
+		now = now + (TTimeIntervalDays)interval;
+		TDateTime startday = now.DateTime();
+		TTime start = aAspSchedule->AutoSyncScheduleTime();
+		TDateTime date = start.DateTime();
+		TDateTime time(startday.Year(), startday.Month(), startday.Day(), date.Hour(), date.Minute(), 0, 0);
+		TTime syncTime(time);
+		startTime.SetLocalTime(syncTime);
+		}
+	
+	TScheduleEntryInfo2& info = (*ipeakEntryList)[0];
+
+	info.SetStartTime(startTime);
+	info.SetInterval(interval);
+	info.SetIntervalType(intervalType);
+	
+	err = iScheduler.EditSchedule(peakHandle, *ipeakEntryList);
+	User::LeaveIfError(err);
+	
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncSchedule::EditOffPeakScheduleL
+// -Edit off-peak schedule entry
+// -----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::EditOffPeakScheduleL(CAspSchedule* aAspSchedule)
+	{
+
+	ioffPeakEntryList->Reset();
+	ioffPeakTaskList->Reset();
+
+	TTsTime tsTime;
+	TScheduleState2 state;
+	TInt offPeakHandle = aAspSchedule->OffPeakScheduleHandle();
+		
+	if (offPeakHandle == KErrNotFound)
+		{
+		User::Leave(KErrNotFound);	
+		}
+	
+	TInt err = iScheduler.GetScheduleL(offPeakHandle, state, *ioffPeakEntryList, *ioffPeakTaskList, tsTime);
+	
+	User::LeaveIfError(err);
+	
+	TInt count = ioffPeakEntryList->Count();
+	__ASSERT_DEBUG(count == 1, TUtil::Panic(KErrArgument));
+	
+	TInt offPeakInterval = aAspSchedule->SyncOffPeakSchedule();
+	TInt interval = Interval(offPeakInterval);
+	TIntervalType intervalType = IntervalType(offPeakInterval);
+	TTime now;
+	now.HomeTime();
+	TTsTime startTime ;
+	
+	if (offPeakInterval == CAspSchedule::EInterval15Mins
+				       		|| offPeakInterval == CAspSchedule::EInterval30Mins)
+		{
+		now = now + (TTimeIntervalMinutes)interval ;
+		}
+	else
+		{
+		now = now + (TTimeIntervalHours)interval ;
+		}
+	startTime.SetLocalTime(now);
+	
+	
+	TScheduleEntryInfo2& info = (*ioffPeakEntryList)[0];
+
+	info.SetStartTime(startTime);
+	info.SetInterval(interval);
+	info.SetIntervalType(intervalType);
+	
+	err = iScheduler.EditSchedule(offPeakHandle, *ioffPeakEntryList);
+	User::LeaveIfError(err);
+	
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSyncSchedule::UpdatePeakScheduleL
+// -Postpone peak schedule till next peak start
+// -----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::UpdatePeakScheduleL(CAspSchedule* aAspSchedule)
+	{
+
+	ipeakEntryList->Reset();
+	ipeakTaskList->Reset();
+
+	TTime startPeak = aAspSchedule->StartPeakTime();
+		
+	TTime now;
+	now.HomeTime();
+
+		
+	TDateTime startDate = startPeak.DateTime();
+	
+	TDateTime day = now.DateTime();
+	if (day.Hour() > KStartPeakHour)
+		{
+		now = now + (TTimeIntervalDays)1;
+		}
+	TDateTime tomorrow = now.DateTime();
+	
+    TDateTime time(tomorrow.Year(), tomorrow.Month(), tomorrow.Day(), startDate.Hour(), startDate.Minute(), 0, 0);
+	TTime nextPeakStart(time);
+	
+	while(!aAspSchedule->WeekdayEnabled(nextPeakStart.DayNoInWeek()))
+		{
+		nextPeakStart = nextPeakStart + (TTimeIntervalDays)1;
+		}
+	TTsTime tsTime;
+	TScheduleState2 state;
+	TInt peakHandle = aAspSchedule->PeakScheduleHandle();
+		
+	if (peakHandle == KErrNotFound)
+		{
+		User::Leave(KErrNotFound);	
+		}
+	
+	TInt err = iScheduler.GetScheduleL(peakHandle, state, *ipeakEntryList, *ipeakTaskList, tsTime);
+	
+	User::LeaveIfError(err);
+	
+	TInt count = ipeakEntryList->Count();
+	__ASSERT_DEBUG(count == 1, TUtil::Panic(KErrArgument));
+
+	
+	TTsTime startTime ;
+	startTime.SetLocalTime(nextPeakStart);
+	TIntervalType intervalType = IntervalType(aAspSchedule->SyncPeakSchedule());
+	TInt interval = Interval(aAspSchedule->SyncPeakSchedule());	
+	
+	TScheduleEntryInfo2& info = (*ipeakEntryList)[0];
+
+	info.SetStartTime(startTime);
+	info.SetInterval(interval);
+	info.SetIntervalType(intervalType);
+	
+	err = iScheduler.EditSchedule(peakHandle, *ipeakEntryList);
+	User::LeaveIfError(err);
+	
+	
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSyncSchedule::UpdateOffPeakScheduleL
+// -Postpone off-peak schedule till next off-peak start
+// -----------------------------------------------------------------------------
+//
+
+void CAspSyncSchedule::UpdateOffPeakScheduleL(CAspSchedule* aAspSchedule)
+	{
+
+	ioffPeakEntryList->Reset();
+	ioffPeakTaskList->Reset();
+
+	TTime startoffPeak = aAspSchedule->EndPeakTime() + (TTimeIntervalMinutes)1;
+		
+	TTime now;
+	now.HomeTime();
+
+	TInt interval = aAspSchedule->SyncOffPeakSchedule();
+	TIntervalType intervalType = IntervalType(interval);
+	TInt intervalVal = Interval(interval);
+
+	if (interval == CAspSchedule::EInterval15Mins
+				|| interval == CAspSchedule::EInterval30Mins)
+
+		{
+		now = now + (TTimeIntervalMinutes)intervalVal;
+		}
+	else if (intervalType == EHourly)
+		{
+		now = now + (TTimeIntervalHours)intervalVal;
+		}
+	
+	TDateTime startday = startoffPeak.DateTime();
+	TDateTime today = now.DateTime();
+	
+    TDateTime time(today.Year(), today.Month(), today.Day(), startday.Hour(), startday.Minute(), 0, 0);
+	
+	TTime nextOffPeakStart(time);
+	TTsTime tsTime;
+	TScheduleState2 state;
+	TInt offpeakHandle = aAspSchedule->OffPeakScheduleHandle();
+		
+	if (offpeakHandle == KErrNotFound)
+		{
+		User::Leave(KErrNotFound);	
+		}
+	
+	TInt err = iScheduler.GetScheduleL(offpeakHandle, state, *ioffPeakEntryList, *ioffPeakTaskList, tsTime);
+	
+	User::LeaveIfError(err);
+	
+	TInt count = ioffPeakEntryList->Count();
+	__ASSERT_DEBUG(count == 1, TUtil::Panic(KErrArgument));
+
+	
+	TTsTime startTime ;
+	startTime.SetLocalTime(nextOffPeakStart);
+	TScheduleEntryInfo2& info = (*ioffPeakEntryList)[0];
+
+	info.SetStartTime(startTime);
+	info.SetInterval(interval);
+	info.SetIntervalType(intervalType);
+	
+	err = iScheduler.EditSchedule(offpeakHandle, *ioffPeakEntryList);
+	User::LeaveIfError(err);
+	
+	
+	}
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::IntervalType
+// Return  interval type
+// ----------------------------------------------------------------------------
+//
+TIntervalType CAspSyncSchedule::IntervalType(TInt aInterval)
+	{
+	if (aInterval == CAspSchedule::EInterval24hours
+			  || aInterval == CAspSchedule::EInterval2days
+			  || aInterval == CAspSchedule::EInterval4days
+			  || aInterval == CAspSchedule::EInterval7days
+			  || aInterval == CAspSchedule::EInterval14days
+			  || aInterval == CAspSchedule::EInterval30days)
+		{
+		return EDaily;
+		}
+		
+	return EHourly;
+	}
+	
+	
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::Interval
+// Return  interval value
+// ----------------------------------------------------------------------------
+//
+TInt CAspSyncSchedule::Interval(TInt aInterval)
+	{
+	const TInt KIntervalManual  = 0;
+	const TInt KInterval15Mins  = 15;
+	const TInt KInterval30Mins  = 30;
+	const TInt KInterval1hour   = 1;
+	const TInt KInterval2hours  = 2;
+	const TInt KInterval4hours  = 4;
+	const TInt KInterval8hours  = 8;
+	const TInt KInterval12hours = 12;		
+	const TInt KInterval24hours = 1;
+	const TInt KInterval2days   = 2;
+	const TInt KInterval4days   = 4;
+	const TInt KInterval7ays    = 7;
+	const TInt KInterval14days  = 14;
+	const TInt KInterval30days  = 30;
+	
+	    TInt ret = KIntervalManual;
+    
+    switch (aInterval)
+    	{
+    	case CAspSchedule::EIntervalManual:
+    	    ret = KIntervalManual;
+    	    break;
+    	case CAspSchedule::EInterval15Mins:
+    	    ret = KInterval15Mins;
+    	    break;
+    	case CAspSchedule::EInterval30Mins:
+    	    ret = KInterval30Mins;
+    	    break;
+    	case CAspSchedule::EInterval1hour:
+    	    ret = KInterval1hour;
+    	    break;
+    	case CAspSchedule::EInterval2hours:
+    	    ret = KInterval2hours;
+    	    break;
+    	case CAspSchedule::EInterval4hours:
+    	    ret = KInterval4hours;
+    	    break;
+		case CAspSchedule::EInterval8hours:
+    	    ret = KInterval8hours;
+    	    break;
+		case CAspSchedule::EInterval12hours:
+    	    ret = KInterval12hours;
+    	    break;
+		case CAspSchedule::EInterval24hours:
+    	    ret = KInterval24hours;
+    	    break;
+		case CAspSchedule::EInterval2days:
+    	    ret = KInterval2days;
+    	    break;
+		case CAspSchedule::EInterval4days:
+    	    ret = KInterval4days;
+    	    break;
+		case CAspSchedule::EInterval7days:
+    	    ret = KInterval7ays;
+    	    break;
+		case CAspSchedule::EInterval14days:
+    	    ret = KInterval14days;
+    	    break;
+		case CAspSchedule::EInterval30days:	
+    	    ret = KInterval30days;
+    	    break;
+
+			
+        default:
+            break;
+    	}
+    	
+    return ret;	
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::StartTime
+//
+// ----------------------------------------------------------------------------
+//
+TTsTime CAspSyncSchedule::StartTime(TInt aStartHour, TInt aInterval)
+	{
+
+	if (IntervalType(aInterval) == EDaily)
+		{
+	    TTime time = CAspSchedule::LocalStartTime(aStartHour);
+	    TTsTime tsTime(time, EFalse);
+        return tsTime;
+		}
+	
+	TTime time = CAspSchedule::UniversalStartTime(aStartHour);
+    TTsTime tsTime(time, ETrue);
+    return tsTime;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncSchedule::GetPeakStartTimeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::GetPeakStartTimeL(CAspSchedule* aAspSchedule, TTime& aTime, TBool aHomeTime)
+	{
+
+	ipeakEntryList->Reset();
+	ipeakTaskList->Reset();
+	
+	TTsTime tsTime;
+	TScheduleState2 state;
+	TInt peakHandle = aAspSchedule->PeakScheduleHandle();
+	
+	TInt err = iScheduler.GetScheduleL(peakHandle, state, *ipeakEntryList, *ipeakTaskList, tsTime);
+	User::LeaveIfError(err);
+	if (aHomeTime)
+		{
+		aTime = tsTime.GetLocalTime();	
+		}
+	else
+		{
+	    aTime = tsTime.GetUtcTime();		
+		}
+
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncSchedule::GetOffPeakStartTimeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::GetOffPeakStartTimeL(CAspSchedule* aAspSchedule, TTime& aTime, TBool aHomeTime)
+	{
+
+	ioffPeakEntryList->Reset();
+	ioffPeakTaskList->Reset();
+	
+	TTsTime tsTime;
+	TScheduleState2 state;
+	TInt offPeakHandle = aAspSchedule->OffPeakScheduleHandle();
+	
+	TInt err = iScheduler.GetScheduleL(offPeakHandle, state, *ioffPeakEntryList, *ioffPeakTaskList, tsTime);
+	User::LeaveIfError(err);
+	if (aHomeTime)
+		{
+		aTime = tsTime.GetLocalTime();	
+		}
+	else
+		{
+	    aTime = tsTime.GetUtcTime();		
+		}
+
+	}
+
+
+#ifdef _DEBUG
+
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::LogScheduleL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::LogScheduleL(CAspSchedule* aAspSchedule)
+	{
+
+	FLOG( _L("---- scheduler settings ----") );
+
+	TTsTime tsTime;
+	TTime time;
+	TScheduleState2 state;
+	TInt peakhandle = aAspSchedule->PeakScheduleHandle();
+	if (peakhandle != KErrNotFound )
+		{
+		FLOG( _L("---- Peak Time Sync Enabled -> Settings") );
+		ipeakEntryList->Reset();
+		ipeakTaskList->Reset();
+		TInt err = iScheduler.GetScheduleL(peakhandle, state, *ipeakEntryList, *ipeakTaskList, tsTime);
+		User::LeaveIfError(err);
+	
+		TScheduleEntryInfo2 info = (*ipeakEntryList)[0];
+	
+		TBuf<KBufSize> buf;
+	
+		FLOG(_L("peak schedule handle: %d"), peakhandle);
+	
+		LogInterval(info, buf);
+		FLOG(_L("peak interval: %S"), &buf);
+
+		LogIntervalType(info, buf);
+		FLOG(_L("peak interval type: %S"), &buf);
+	
+		LogTsTime(tsTime, buf);
+		FLOG(_L("peak sync start time: %S"), &buf);
+			
+		TTaskInfo taskInfo = (*ipeakTaskList)[0];
+		LogTaskInfo(taskInfo, buf);
+		FLOG(_L("peak task info: %S"), &buf);
+
+		}
+	TInt offPeakhandle = aAspSchedule->OffPeakScheduleHandle();
+	if (offPeakhandle != KErrNotFound )
+		{
+		FLOG( _L("---- Off-Peak Time Sync Enabled -> Settings") );
+		ioffPeakEntryList->Reset();
+	    ioffPeakTaskList->Reset();
+		TInt err = iScheduler.GetScheduleL(offPeakhandle, state, *ioffPeakEntryList, *ioffPeakTaskList, tsTime);
+		User::LeaveIfError(err);
+	
+		TScheduleEntryInfo2 info = (*ioffPeakEntryList)[0];
+	
+		TBuf<KBufSize> buf;
+	
+		FLOG(_L("off-peak schedule handle: %d"), peakhandle);
+	
+		LogInterval(info, buf);
+		FLOG(_L("off-peak interval: %S"), &buf);
+
+		LogIntervalType(info, buf);
+		FLOG(_L("off-peak interval type: %S"), &buf);
+	
+		LogTsTime(tsTime, buf);
+		FLOG(_L("off-peak sync start time: %S"), &buf);
+			
+		TTaskInfo taskInfo = (*ioffPeakTaskList)[0];
+		LogTaskInfo(taskInfo, buf);
+		FLOG(_L("off-peak task info: %S"), &buf);
+
+		}
+		
+	
+		
+	
+	FLOG( _L("---- scheduler settings ----") );
+
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::LogSchedule
+//
+// ----------------------------------------------------------------------------
+//
+TInt CAspSyncSchedule::LogSchedule(CAspSchedule* aAspSchedule)
+	{
+	TInt err = KErrNone;
+	TRAP(err, LogScheduleL(aAspSchedule));
+	
+	return err;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::LogTaskInfo
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::LogTaskInfo(TTaskInfo& aInfo, TDes& aText)
+	{
+	aText.Format(_L("name: %S, repeat: %d, id: %d, priority: %d"), 
+	             &aInfo.iName, aInfo.iRepeat, aInfo.iTaskId, aInfo.iPriority);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::LogIntervalType
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::LogIntervalType(TScheduleEntryInfo2& aInfo, TDes& aText)
+	{
+	aText = _L("unknown");
+	
+	TIntervalType type = aInfo.IntervalType();
+	
+	if (type == EDaily)
+		{
+		aText = _L("EDaily");
+		}
+	if (type == EHourly)
+		{
+		aText = _L("EHourly");
+		}
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::LogInterval
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSyncSchedule::LogInterval(TScheduleEntryInfo2& aInfo, TDes& aText)
+	{
+	TInt num = aInfo.Interval();
+	aText.Format(_L("interval: %d"), num);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspSyncSchedule::LogTime
+//
+// ----------------------------------------------------------------------------
+//
+
+void CAspSyncSchedule::LogTsTime(TTsTime aTsTime, TDes& aText)
+	{
+	TBuf<64> buf1; TBuf<64> buf2;
+
+	TTime time = aTsTime.GetLocalTime();
+	TRAP_IGNORE(TUtil::GetDateTimeTextL(buf1, time));
+	time = aTsTime.GetUtcTime();
+	TRAP_IGNORE(TUtil::GetDateTimeTextL(buf2, time));
+	
+	aText.Format(_L("local: %S  utc: %S"), &buf1, &buf2);
+    }
+
+#endif //  _DEBUG
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspContentDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,1203 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+// INCLUDE FILES
+#include "AspContentDialog.h"
+#include "AspUtil.h"
+#include "AspDefines.h"
+#include "AspDialogUtil.h"
+#include "AspResHandler.h"
+#include "AspDebug.h"
+#include "AspSyncUtil.rh"
+#include <csxhelp/ds.hlp.hrh>
+
+#include <aspsyncutil.mbg>  // for bitmap enumerations
+#include <AknIconArray.h>   // for GulArray
+#include <featmgr.h>   // FeatureManager
+#include "AspSchedule.h"
+
+const TInt KMSKControlId( CEikButtonGroupContainer::EMiddleSoftkeyPosition );
+
+// -----------------------------------------------------------------------------
+// CAspContentDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+TBool CAspContentDialog::ShowDialogL(TAspParam& aParam)
+	{
+	CAspContentDialog* dialog = CAspContentDialog::NewL(aParam);
+
+	return dialog->ExecuteLD(R_ASP_CONTENT_DIALOG);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentDialog::NewL
+//
+// -----------------------------------------------------------------------------
+CAspContentDialog* CAspContentDialog::NewL(TAspParam& aParam)
+    {
+    FLOG( _L("CAspContentDialog::NewL START") );
+    
+    CAspContentDialog* self = new (ELeave) CAspContentDialog(aParam);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    FLOG( _L("CAspContentDialog::NewL END") );
+    return(self);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::CAspContentDialog
+//
+//------------------------------------------------------------------------------
+//
+CAspContentDialog::CAspContentDialog(TAspParam& aParam)
+	{
+	iApplicationId = aParam.iApplicationId;
+	iProfile = aParam.iProfile;
+	iSyncSession = aParam.iSyncSession;
+	iContentList = aParam.iContentList;
+	iDialogParam = &aParam;
+	iDataProviderId = aParam.iDataProviderId;
+	
+	iDataStoreChanged = EFalse;
+	iMskEmpty = EFalse;
+	
+    __ASSERT_ALWAYS(iDataProviderId != KErrNotFound, TUtil::Panic(KErrGeneral));	
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+	__ASSERT_ALWAYS(iContentList, TUtil::Panic(KErrGeneral));
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrGeneral));
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+//
+//------------------------------------------------------------------------------
+//
+CAspContentDialog::~CAspContentDialog()
+	{
+    FLOG( _L("CAspContentDialog::~CAspContentDialog START") );
+	    
+    if (iSettingList)
+    	{
+    	iSettingList->ResetAndDestroy();
+	    delete iSettingList;
+    	}
+
+	delete iStatusPaneHandler;
+	delete iLocalDataStores;
+	
+	if (iAvkonAppUi)
+		{
+		iAvkonAppUi->RemoveFromStack(this);
+		}
+		
+    FLOG( _L("CAspContentDialog::~CAspContentDialog END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentDialog::ConstructL()
+    {
+    FLOG( _L("CAspContentDialog::ConstructL START") );
+    
+	CAknDialog::ConstructL(R_ASP_CONTENT_DIALOG_MENU);
+	
+	iSettingEnforcement = TUtil::SettingEnforcementState();
+	
+    iSettingList = new (ELeave) CArrayPtrFlat<CAspListItemData>(KDefaultArraySize);
+	
+	iLocalDataStores = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
+	iContentList->GetLocalDatabaseList(iDataProviderId, iLocalDataStores);
+	
+	TInt count = iLocalDataStores->Count();
+	if (count == 0)
+		{
+		if (iDataProviderId == KUidNSmlAdapterEMail.iUid)
+			{
+			TDialogUtil::ShowErrorNoteL(R_ASP_NO_MAILBOXES);
+			}
+		else
+			{
+			TDialogUtil::ShowErrorNoteL(R_ASP_LOG_ERR_LOCALDATABASE);
+			User::Leave(KErrNotFound);
+			}
+		}
+		
+	InitTaskDataL();
+
+	// get previous title so it can be restored
+	iStatusPaneHandler = CStatusPaneHandler::NewL(iAvkonAppUi);
+	iStatusPaneHandler->StoreOriginalTitleL();
+	
+	// store current navi pane
+    iStatusPaneHandler->StoreNavipaneL();
+
+	FLOG( _L("CAspContentDialog::ConstructL END") );
+    } 
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::ActivateL (from CCoeControl)
+//
+// Called by system when dialog is activated
+//------------------------------------------------------------------------------
+//
+void CAspContentDialog::ActivateL()
+	{
+    CAknDialog::ActivateL();
+
+	// this cannot be in ConstructL which is executed before dialog is launched
+	iAvkonAppUi->AddToStackL(this);
+    }
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::CheckContentSettingL
+//
+// Check if the MSK label is correct for the context
+//------------------------------------------------------------------------------
+
+void CAspContentDialog::CheckContentSettingL(const TKeyEvent& aKeyEvent)
+	{
+	
+	TInt curIndex = iListBox->CurrentItemIndex();
+	TInt count = iSettingList->Count();
+	CAspListItemData* lastItem = (*iSettingList)[--count];
+	
+	switch (aKeyEvent.iCode)
+		{
+		case EKeyUpArrow:
+			{
+				if (curIndex)
+				{
+					curIndex--;
+				}
+				else
+				{
+				    curIndex = lastItem->iIndex;
+				}
+			break;
+			}
+		case EKeyDownArrow:
+			{
+				if (curIndex == lastItem->iIndex)
+				{
+				curIndex = 0;
+				}
+				else
+				{
+				curIndex++;
+				}
+			break;
+			}
+		}	
+	CAspListItemData* curItem = GetItemForIndex(curIndex);
+	if(curItem->iHidden == EVisibilityReadOnly)
+	{
+		UpdateMiddleSoftKeyLabelL(EAknSoftkeyOpen,R_TEXT_SOFTKEY_EMPTY);
+	   	iMskEmpty = ETrue;
+	   	return;	
+	}
+	if(iMskEmpty)
+	{
+		UpdateMiddleSoftKeyLabelL(EAknSoftkeyEmpty,R_QTN_MSK_CHANGE);
+	   	iMskEmpty = EFalse;
+	}
+
+	}
+	
+//------------------------------------------------------------------------------
+// CAspContentDialog::UpdateMiddleSoftKeyLabelL 
+//
+// Update the MSK 
+//------------------------------------------------------------------------------
+	void CAspContentDialog::UpdateMiddleSoftKeyLabelL(TInt aCommandId,TInt aResourceId)
+	{
+		ButtonGroupContainer().RemoveCommandFromStack(KMSKControlId,aCommandId );
+		HBufC* middleSKText = StringLoader::LoadLC( aResourceId );
+
+		ButtonGroupContainer().AddCommandToStackL(
+		KMSKControlId,
+		aCommandId,
+		*middleSKText );
+		CleanupStack::PopAndDestroy( middleSKText );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::GetHelpContext
+//
+//------------------------------------------------------------------------------
+//
+void CAspContentDialog::GetHelpContext(TCoeHelpContext& aContext) const
+	{
+	aContext.iMajor = KUidSmlSyncApp;
+    
+	TInt dataProvider = DataProviderType();
+	if (dataProvider == EApplicationIdContact)
+		{
+		aContext.iContext = KDS_HLP_SETTINGS_CNT;
+		}
+	else if (dataProvider == EApplicationIdCalendar)
+		{
+		aContext.iContext = KDS_HLP_SETTINGS_CAL;
+		}
+	else if (dataProvider == EApplicationIdNote)
+		{
+		aContext.iContext = KDS_HLP_SETTINGS_NOTES;
+		}
+	else if (dataProvider == EApplicationIdSms)
+		{
+		aContext.iContext = KDS_HLP_SETTINGS_SMS;
+		}
+	else
+		{
+		aContext.iContext = KDS_HLP_MAIN_VIEW;  // unknown application
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::ProcessCommandL
+//
+// Handle menu commands.
+//------------------------------------------------------------------------------
+//
+void CAspContentDialog::ProcessCommandL( TInt aCommandId )
+	{
+	HideMenu();
+
+	switch (aCommandId)
+		{
+
+		case EAknCmdHelp:
+			{
+			TUtil::LaunchHelpAppL(iEikonEnv);
+            break;
+			}
+
+		case EAspMenuCmdChange:
+			{				
+			HandleOKL();
+
+			break;
+			}
+
+        case EAspMenuCmdExit:
+        case EAknCmdExit:
+        case EEikCmdExit:
+			{
+			// close dialog and exit calling application
+			iAvkonAppUi->ProcessCommandL(EAknCmdExit);
+			break;
+			}
+
+
+		default:
+		    break;
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::OfferKeyEventL
+//
+// Handle key events.
+//------------------------------------------------------------------------------
+//
+TKeyResponse CAspContentDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+	{
+	if (aType == EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+			case EKeyEscape:  // framework calls this when dialog must shut down
+				{
+				return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+        		}
+
+			case EKeyEnter:
+			case EKeyOK: // OK button
+				{
+				HandleOKL();
+				return EKeyWasConsumed;
+				}
+			case EKeyUpArrow:
+			case EKeyDownArrow:
+			    {
+			    	if(!iSettingEnforcement)
+				    {
+				    TRAPD(err ,CheckContentSettingL(aKeyEvent));
+		         	User::LeaveIfError(err);
+				    }
+			    break;
+			    }
+			}
+		}
+
+	return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::OkToExitL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspContentDialog::OkToExitL(TInt aButtonId)
+	{
+	if (aButtonId == EEikBidCancel)
+		{
+		// save silently and quit application
+		TRAP_IGNORE(SaveSettingsL());
+		return ETrue;
+		}
+
+	if (aButtonId == EAknSoftkeyBack)
+        {
+		TInt index = CheckMandatoryFields();
+		if (index != KErrNotFound)
+			{
+			if (!TDialogUtil::ShowConfirmationQueryL(R_ASP_EXIT_ANYWAY))
+				{
+				iListBox->SetCurrentItemIndexAndDraw(index);
+				return EFalse; // leave dialog open
+				}
+			}
+		
+		TRAP_IGNORE(SaveSettingsL());
+		
+		return ETrue;
+		}
+		
+	if (aButtonId == EAknSoftkeyOpen||aButtonId == EAknSoftkeyEmpty )  // MSK
+        {
+        HandleOKL();
+		return EFalse;  // leave dialog open
+		}
+		
+
+	return CAknDialog::OkToExitL(aButtonId);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::PreLayoutDynInitL
+//
+// Called by system before the dialog is shown.
+//------------------------------------------------------------------------------
+//
+void CAspContentDialog::PreLayoutDynInitL()
+	{
+	iListBox = (CAknSettingStyleListBox*)Control(EAspContentDialog);
+	
+   	__ASSERT_ALWAYS(iListBox, TUtil::Panic(KErrGeneral));
+	
+	iListBox->SetListBoxObserver(this);
+	iListBox->CreateScrollBarFrameL(ETrue);
+	iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+	                   CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto);
+	                   
+   	SetIconsL();	                   
+	
+    CreateSettingsListL();
+    UpdateListBoxL(iListBox, iSettingList);
+	TInt curIndex = iListBox->CurrentItemIndex();
+		
+	CAspListItemData* curItem = GetItemForIndex(curIndex);
+	TBool isPCSuite = CAspProfile::IsPCSuiteProfile(iProfile);
+	
+	if(iSettingEnforcement || curItem->iHidden == EVisibilityReadOnly)
+	{
+	UpdateMiddleSoftKeyLabelL(EAknSoftkeyOpen,R_TEXT_SOFTKEY_EMPTY);	
+   		
+	}
+	
+	//Set title pane text
+	TInt index = iContentList->FindProviderIndex(iDataProviderId);
+	if (index != KErrNotFound)
+		{
+		TAspProviderItem& item = iContentList->ProviderItem(index);
+    	HBufC* hBuf = CAspResHandler::GetContentTitleLC(iDataProviderId, 
+    	                                                item.iDisplayName);
+	    iStatusPaneHandler->SetTitleL(hBuf->Des());
+	    CleanupStack::PopAndDestroy(hBuf);
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspContentDialog::SetIconsL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspContentDialog::SetIconsL()
+    {
+    if (!iListBox)
+    	{
+    	return;
+    	}
+ 
+ 	TFileName bitmapName;
+	CAspResHandler::GetBitmapFileName(bitmapName);
+	CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray(KDefaultArraySize);
+	CleanupStack::PushL(icons);
+	
+	icons->AppendL(IconL(KAknsIIDQgnIndiSettProtectedAdd, bitmapName, 
+	                     EMbmAspsyncutilQgn_indi_sett_protected_add,
+	                     EMbmAspsyncutilQgn_indi_sett_protected_add_mask));
+	
+    // delete old icons
+    CArrayPtr<CGulIcon>* arr = iListBox->ItemDrawer()->FormattedCellData()->IconArray();
+    if (arr)
+    	{
+    	arr->ResetAndDestroy();
+	    delete arr;
+	    arr = NULL;
+    	}
+
+	iListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
+	CleanupStack::Pop(icons);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentDialog::IconL
+// 
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CAspContentDialog::IconL(TAknsItemID aId, const TDesC& aFileName,
+                                   TInt aFileIndex, TInt aFileMaskIndex)
+	{
+    return TDialogUtil::CreateIconL(aId, aFileName, aFileIndex, aFileMaskIndex);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::DynInitMenuPaneL
+//
+// Called by system before menu is shown.
+//------------------------------------------------------------------------------
+//
+void CAspContentDialog::DynInitMenuPaneL( TInt aResourceID, CEikMenuPane* aMenuPane)
+	{
+    if (aResourceID != R_ASP_CONTENT_DIALOG_MENU_PANE)
+		{
+		return;
+		}
+
+	if (iListBox->Model()->NumberOfItems() == 0)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChange);
+		}
+		
+	CAspListItemData* item = GetItemForIndex(iListBox->CurrentItemIndex());
+
+	if (item->iHidden == EVisibilityReadOnly)
+	    {
+	    TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChange);
+	    }
+	    
+	TInt provider = DataProviderType();
+
+	if (provider == KErrNotFound)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAknCmdHelp);
+		}
+	
+    if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAknCmdHelp);
+		}
+
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::HandleListBoxEventL
+//
+// Handle listbox events.
+//------------------------------------------------------------------------------
+//
+void CAspContentDialog::HandleListBoxEventL(CEikListBox* /*aListBox*/, 
+                                            TListBoxEvent aEventType)
+	{
+    switch ( aEventType )
+        {
+        case EEventItemSingleClicked:
+            HandleOKL();
+            break;
+        default:
+           break;
+        }
+	}
+
+
+//-----------------------------------------------------------------------------
+// CAspContentDialog::HandleOKL
+//
+// Handle content parameter editing.
+//-----------------------------------------------------------------------------
+//
+void CAspContentDialog::HandleOKL()
+	{
+	CAspListItemData* item = GetItemForIndex(iListBox->CurrentItemIndex());
+	if (item->iHidden == EVisibilityReadOnly)
+    	{
+    	if(!iSettingEnforcement)
+    	{
+     	TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_READ_ONLY);
+    	}
+     	else
+     	{
+     		TDialogUtil::ShowInformationNoteL(R_ASP_PROTECTED_SETTING);	
+     	}
+  		return;
+     	}
+
+	if (EditSettingItemL(*item))
+		{
+		SetVisibility();
+		UpdateListBoxL(iListBox, iSettingList);
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspContentDialog::HandleResourceChange
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspContentDialog::HandleResourceChange(TInt aType)
+    {   
+    if (aType == KEikDynamicLayoutVariantSwitch) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        iListBox->SetSize(mainPaneRect.Size());
+        CCoeControl::HandleResourceChange(aType);
+		DrawDeferred();
+	    return;
+		}
+		
+    if (aType == KAknsMessageSkinChange)
+        {
+        TRAP_IGNORE(SetIconsL());
+        }
+		
+		
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::InitTaskDataL
+//
+//------------------------------------------------------------------------------
+//
+void CAspContentDialog::InitTaskDataL()
+	{
+	iContentList->ReadTaskL(iDataProviderId, iLocalDatabase, iRemoteDatabase,
+		                    iTaskEnabled, iSyncDirection);
+		                        
+   	if (iSettingEnforcement)
+		{
+		return;
+		}
+
+    // check that local database exists
+    if (iLocalDatabase.Length() > 0)
+    	{
+    	TInt pos = 0;
+    	if (iLocalDataStores->Find(iLocalDatabase, pos) != 0)
+    		{
+    		iLocalDatabase = KNullDesC; // local database not found
+    		iDataStoreChanged = ETrue;
+    		}
+    	}
+
+    if (iLocalDatabase.Length() == 0)
+    	{
+    	if (iDataProviderId == KUidNSmlAdapterEMail.iUid)
+    		{
+    		iContentList->UpdateDataProviderL(iDataProviderId);
+    		}
+    		
+	    TInt index = iContentList->FindProviderIndex(iDataProviderId);
+	    if (index != KErrNotFound)
+		    {
+		    TAspProviderItem& item = iContentList->ProviderItem(index);
+     		if (item.iDefaultDataStore.Length() > 0)
+			    {
+			    iLocalDatabase = item.iDefaultDataStore;
+			    iDataStoreChanged = ETrue;
+			    }
+		    }
+    	}
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspContentDialog::UpdateListBoxL
+// 
+// Add settings headers into listbox.
+// ----------------------------------------------------------------------------
+//
+void CAspContentDialog::UpdateListBoxL(CEikTextListBox* aListBox,
+                                       CAspSettingList* aItemList)
+	{
+	CDesCArray* arr = (CDesCArray*)aListBox->Model()->ItemTextArray();
+	arr->Reset();
+
+	TInt count = aItemList->Count();
+	for (TInt index=0; index<count; index++ )
+		{
+	   	TBool convert = ETrue;
+	   	TBool isPCSuite=CAspProfile::IsPCSuiteProfile(iProfile);
+	   	TBool readOnly = iProfile->DeleteAllowed();
+
+		CAspListItemData* item = (*aItemList)[index];
+		TInt id=item->iItemId;
+		if(iSettingEnforcement)
+		{
+			if(id==EAspLocalDatabase ||id==EAspRemoteDatabase )
+			convert=EFalse;
+		}
+		else
+		{
+ 			   if(isPCSuite|| !readOnly)
+				{
+					if(id==EAspRemoteDatabase)
+					convert=EFalse;
+				}
+	
+		}
+		if (item->iHidden != EVisibilityHidden)
+			{
+			HBufC* hBuf = item->ListItemTextL(convert);
+			CleanupStack::PushL(hBuf);
+
+			arr->AppendL(hBuf->Des());
+			
+			// store listbox index (from zero up) into setting item 
+			item->iIndex = arr->Count() - 1;
+
+			CleanupStack::PopAndDestroy(hBuf);
+			}
+		else
+			{
+			item->iIndex = KErrNotFound;
+			}
+		}
+
+	aListBox->HandleItemAdditionL();
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspContentDialog::CreateSettingsListL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspContentDialog::CreateSettingsListL()
+	{
+	AddItemL(EAspLocalDatabase, R_ASP_SETT_LOCAL_DATABASE);
+	AddRemoteDatabaseL(iDataProviderId);
+
+	// write setting data into each CAspListItemData
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		InitSettingItemL((*iSettingList)[i]);
+		}
+
+    SetVisibility();
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspContentDialog::AddItemL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspContentDialog::AddItemL(TInt aItemId, TInt aResourceId)
+	{
+    CAspListItemData* item = CAspListItemData::NewLC();
+	item->SetHeaderL(aResourceId);
+	item->iItemId = aItemId;
+	iSettingList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspContentDialog::AddRemoteDatabaseL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspContentDialog::AddRemoteDatabaseL(TInt aDataProviderId)
+	{
+    CAspListItemData* item = CAspListItemData::NewLC();
+    TInt resId = CAspResHandler::RemoteDatabaseHeaderId(aDataProviderId);
+	item->SetHeaderL(resId);
+	item->iItemId = EAspRemoteDatabase;
+	iSettingList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentDialog::SetVisibility
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentDialog::SetVisibility()
+	{
+    TBool isPCSuite = CAspProfile::IsPCSuiteProfile(iProfile);
+    TBool readOnly = iProfile->DeleteAllowed();
+    	
+	Item(EAspLocalDatabase)->iHidden = EVisibilityNormal;
+	if (iLocalDataStores->Count() < 2)
+		{
+		if (iDialogParam->iDataProviderId != KUidNSmlAdapterEMail.iUid)
+			{
+			Item(EAspLocalDatabase)->iHidden = EVisibilityHidden;
+			}
+		}
+		
+	if (isPCSuite)
+		{
+		if (Item(EAspLocalDatabase)->iHidden == EVisibilityNormal)
+			{
+			if (iDialogParam->iDataProviderId != KUidNSmlAdapterEMail.iUid)
+				{
+				Item(EAspLocalDatabase)->iHidden = EVisibilityReadOnly;
+				}
+			}
+		
+		TInt provider = DataProviderType();
+	    if (provider != KErrNotFound)
+		    {
+		    Item(EAspRemoteDatabase)->iHidden = EVisibilityReadOnly;    
+		    }
+		}
+
+	if(!readOnly)
+		{
+		TInt provider = DataProviderType();
+	    if (provider != KErrNotFound)
+		    {
+		    Item(EAspRemoteDatabase)->iHidden = EVisibilityReadOnly;    
+		    }
+		}
+		
+    if (iSettingEnforcement)
+    	{
+    	SetAllReadOnly(); // profile database is locked
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentDialog::SetAllReadOnly
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentDialog::SetAllReadOnly()
+	{
+	TInt count = iSettingList->Count();
+
+	for (TInt i=0; i<count; i++ )
+		{
+		CAspListItemData* item = (*iSettingList)[i];
+		if (item->iHidden != EVisibilityHidden)
+			{
+			item->iHidden = EVisibilityReadOnly;
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentDialog::InitSettingItemL
+// 
+// Constructs CAspListItemData for one setting.
+// -----------------------------------------------------------------------------
+//
+void CAspContentDialog::InitSettingItemL(CAspListItemData* aItem)
+	{
+	iBuf = KNullDesC;  // reset common buffer
+	
+	switch (aItem->iItemId)
+		{
+		case EAspLocalDatabase:
+			{
+    		aItem->SetValueL(iLocalDatabase);
+    		aItem->SetDisplayValueL(R_ASP_SETTING_VALUE_NONE);
+    		
+    		aItem->iMaxLength = KAspMaxLocalNameLength;
+    		aItem->iLatinInput = ETrue;
+    		aItem->iItemType = CAspListItemData::ETypeLocalDatabase;
+			break;
+			}
+
+		case EAspRemoteDatabase:
+			{
+			aItem->SetValueL(iRemoteDatabase);
+			aItem->SetDisplayValueL(R_ASP_MUST_BE_DEFINED);
+			
+			aItem->iMaxLength = KAspMaxRemoteNameLength;
+			aItem->iLatinInput = ETrue;
+			aItem->iMandatory = ETrue;
+			aItem->iItemType = CAspListItemData::ETypeText;
+			break;
+			}
+
+        default:
+			break;
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::SaveSettingsL
+//
+// Save content settings.
+//------------------------------------------------------------------------------
+//
+void CAspContentDialog::SaveSettingsL()
+	{
+	if (iSettingEnforcement)
+		{
+		return;
+		}
+    	
+	TBool localDatabaseChanged = EFalse;
+	TBool remoteDatabaseChanged = EFalse;
+
+	TPtrC ptr1 = Item(EAspLocalDatabase)->Value();
+	if (ptr1.Compare(iLocalDatabase) != 0)
+		{
+		localDatabaseChanged = ETrue;
+		}
+		
+	TPtrC ptr2 = Item(EAspRemoteDatabase)->Value();
+	if (ptr2.Compare(iRemoteDatabase) != 0)
+		{
+		remoteDatabaseChanged = ETrue;
+		}
+	
+	if (remoteDatabaseChanged || localDatabaseChanged || iDataStoreChanged)
+		{
+		iLocalDatabase = Item(EAspLocalDatabase)->Value();
+	    iRemoteDatabase = Item(EAspRemoteDatabase)->Value();
+        
+   	    iContentList->CreateTaskL(iDataProviderId, iLocalDatabase, iRemoteDatabase,
+	                              iTaskEnabled, iSyncDirection);
+		                          
+        iContentList->InitAllTasksL(); // iContentList comes from main view		                          
+		}
+		
+#ifdef RD_DSUI_TIMEDSYNC
+	CAspSchedule* schedule = CAspSchedule::NewLC();
+	TInt profileId = schedule->ProfileId();
+	if (profileId == iProfile->ProfileId())
+		{
+		schedule->UpdateProfileSettingsL();
+		}
+	CleanupStack::PopAndDestroy(schedule);
+#endif
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::CheckMandatoryFields
+//
+// Check that mandatory fields are filled correctly.
+//------------------------------------------------------------------------------
+//
+TInt CAspContentDialog::CheckMandatoryFields()
+	{
+	if (iSettingEnforcement)
+		{
+		return KErrNotFound;
+		}
+
+    if (!iContentList->TaskEnabled(iDataProviderId))
+    	{
+   		return KErrNotFound; // not part of sync - no need to check mandatory
+    	}
+	
+    TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* item = (*iSettingList)[i];
+		if (item->iMandatory && item->IsEmpty() && (item->iHidden == EVisibilityNormal))
+			{
+			return item->iIndex;
+			}
+		}
+		
+	return KErrNotFound;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::EditSettingItemL
+//
+// Calls setting editing functions. 
+//------------------------------------------------------------------------------
+//
+TBool CAspContentDialog::EditSettingItemL(CAspListItemData& aItem)
+	{
+	TBool ret = EFalse;
+	
+	switch (aItem.iItemType)
+		{
+		case CAspListItemData::ETypeText:
+			ret = EditSettingItemTextL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeList:
+			ret = EditSettingItemListL(aItem);
+		    break;
+		
+		case CAspListItemData::ETypeLocalDatabase:
+			ret = EditSettingItemLocalDatabaseL(aItem);
+			break;
+
+		default:
+		    break;
+
+		}
+
+    return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::EditSettingItemListL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspContentDialog::EditSettingItemListL(CAspListItemData& aItem)
+	{
+	TInt curSelection = aItem.iNumberData;
+	CDesCArray* arr = CAspResHandler::ReadDesArrayStaticLC(aItem.iResource);
+	
+	TBool ret = TDialogUtil::ShowListEditorL(arr, aItem.Header(), curSelection);
+	if (ret)
+		{
+		aItem.iNumberData = curSelection; 
+		aItem.SetValueL((*arr)[curSelection]);
+		}
+
+	CleanupStack::PopAndDestroy(arr);
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::EditSettingItemTextL
+//
+// Edit text setting item.
+//------------------------------------------------------------------------------
+//
+TBool CAspContentDialog::EditSettingItemTextL(CAspListItemData& aItem)
+	{
+	TUtil::StrCopy(iBuf, aItem.Value());
+	
+    TBool ret = TDialogUtil::ShowTextEditorL(iBuf, aItem.Header(), 
+                aItem.iMandatory, aItem.iLatinInput, aItem.iMaxLength);
+   	if (ret)
+		{
+		aItem.SetValueL(iBuf);
+		}
+		
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::EditSettingItemLocalDatabaseL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspContentDialog::EditSettingItemLocalDatabaseL(CAspListItemData& aItem)
+	{
+	if (iLocalDataStores->Count() < 1)
+		{
+		if (iDataProviderId == KUidNSmlAdapterEMail.iUid)
+			{
+			TDialogUtil::ShowErrorNoteL(R_ASP_NO_MAILBOXES);
+			}
+			
+		return EFalse;
+		}
+	
+	TInt curSelection = 0;
+	TInt countDatabase = iLocalDataStores->Count();
+	
+	while (iLocalDataStores->Find(iLocalDatabase, curSelection) && (curSelection < countDatabase))
+		{
+		curSelection++;
+		}
+	if (TDialogUtil::ShowListEditorL(iLocalDataStores, aItem.Header(), curSelection))
+		{
+		aItem.SetValueL((*iLocalDataStores)[curSelection]);
+		return ETrue;
+		}
+
+	return EFalse;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentDialog::EditSettingItemYesNoL
+//
+// Change Yes/No value straight if ok key is pressed.
+//------------------------------------------------------------------------------
+//
+TBool CAspContentDialog::EditSettingItemYesNoL(CAspListItemData& aItem)
+	{
+	CDesCArray* arr = CAspResHandler::ReadDesArrayStaticLC(aItem.iResource);
+	
+	if (aItem.iNumberData == EAspSettingDisabled)
+		{
+		aItem.iNumberData = EAspSettingEnabled;
+		}
+	else
+		{
+		aItem.iNumberData = EAspSettingDisabled;
+		}
+	
+	
+	// store localized setting text (Yes/No)
+	aItem.SetValueL( (*arr)[aItem.iNumberData] );
+
+	CleanupStack::PopAndDestroy(arr);
+	return ETrue;
+	}
+
+
+//-----------------------------------------------------------------------------
+// CAspContentDialog::GetItemForIndex
+// 
+// Find item in list position aIndex.
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspContentDialog::GetItemForIndex(TInt aIndex)
+	{
+	CAspListItemData* item = NULL;
+	
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iIndex == aIndex)
+			{
+			item = temp;
+			break;
+			}
+		}
+
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+
+//-----------------------------------------------------------------------------
+// CAspContentDialog::Item
+// 
+// Find item with aItemId (TAspConnectionSettingItem).
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspContentDialog::Item(TInt aItemId)
+	{
+	CAspListItemData* item = NULL;
+
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iItemId == aItemId)
+			{
+			item = temp;
+			break;
+			}
+		}
+	
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentDialog::DataProviderType
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspContentDialog::DataProviderType() const
+    {
+    if (iDialogParam->iDataProviderId == KUidNSmlAdapterContact.iUid)
+    	{
+    	return EApplicationIdContact;
+    	}
+    if (iDialogParam->iDataProviderId == KUidNSmlAdapterCalendar.iUid)
+    	{
+    	return EApplicationIdCalendar;
+    	}
+    if (iDialogParam->iDataProviderId == KUidNSmlAdapterEMail.iUid)
+    	{
+    	return EApplicationIdEmail;
+    	}
+    if (iDialogParam->iDataProviderId == KUidNSmlAdapterNote.iUid)
+    	{
+    	return EApplicationIdNote;
+    	}
+    if (iDialogParam->iDataProviderId == KUidNSmlAdapterSms.iUid)
+    	{
+    	return EApplicationIdSms;
+    	}
+	if (iDialogParam->iDataProviderId == KUidNSmlAdapterMMS.iUid)
+    	{
+    	return EApplicationIdMms;
+    	}
+    if (iDialogParam->iDataProviderId == KUidNSmlAdapterBookmarks.iUid)
+    	{
+    	return EApplicationIdBookmarks;
+    	}
+
+    return KErrNotFound;
+    } 
+
+
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspContentListDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,493 @@
+/*
+* 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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "AspContentListDialog.h"
+#include "AspContentDialog.h"
+#include "AspDialogUtil.h"
+#include "AspSyncUtil.rh"  // for menu command ids
+#include "AspUtil.h"
+#include "AspDebug.h"
+#include "AspDefines.h"
+#include "AspResHandler.h"
+#include <csxhelp/ds.hlp.hrh>
+
+
+#include <AspSyncUtil.mbg>  // for bitmap enumerations
+#include <akniconarray.h>  // GulArray
+#include <FeatMgr.h>   // FeatureManager
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspContentListDialog::ShowDialogL(const TAspParam& aParam)
+	{
+    CAspContentListDialog* dialog = CAspContentListDialog::NewL(aParam);
+
+	TBool ret = dialog->ExecuteLD(R_ASP_CONTENT_LIST_DIALOG);
+
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspContentListDialog* CAspContentListDialog::NewL(const TAspParam& aParam)
+    {
+    FLOG( _L("CAspContentListDialog::NewL START") );
+
+    CAspContentListDialog* self = new (ELeave) CAspContentListDialog(aParam);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    FLOG( _L("CAspContentListDialog::NewL END") );
+    return(self);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::CAspContentListDialog
+// 
+// -----------------------------------------------------------------------------
+CAspContentListDialog::CAspContentListDialog(const TAspParam& aParam) 
+    {
+	iApplicationId = aParam.iApplicationId;
+	iProfile = aParam.iProfile;
+	iSyncSession = aParam.iSyncSession;
+	
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrGeneral));		
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+void CAspContentListDialog::ConstructL()
+    {
+    FLOG( _L("CAspContentListDialog::ConstructL START" ) );
+
+	// contruct menu for our dialog
+	CAknDialog::ConstructL(R_ASP_CONTENT_LIST_DIALOG_MENU);
+
+	// get previous title so it can be restored
+	iStatusPaneHandler = CStatusPaneHandler::NewL(iAvkonAppUi);
+	iStatusPaneHandler->StoreOriginalTitleL();
+
+
+    TAspParam param(iApplicationId, iSyncSession);
+	param.iProfile = iProfile;
+	param.iMode = CAspContentList::EInitAll;
+
+	iContentList = CAspContentList::NewL(param);
+
+    iStatusPaneHandler->SetTitleL(R_ASP_CONTENT_LIST_DIALOG_TITLE);
+
+	FLOG( _L("CAspContentListDialog::ConstructL END") );
+    } 
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+CAspContentListDialog::~CAspContentListDialog()
+    {
+    FLOG( _L("CAspContentListDialog::~CAspContentListDialog START") );
+    
+    if (iAvkonAppUi)
+    	{
+    	iAvkonAppUi->RemoveFromStack(this);
+    	}
+
+	delete iStatusPaneHandler;
+	delete iContentList;
+	
+	FLOG( _L("CAspContentListDialog::~CAspContentListDialog END") );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspContentListDialog::ActivateL (from CCoeControl)
+//
+// Called by system when dialog is activated.
+//------------------------------------------------------------------------------
+//
+void CAspContentListDialog::ActivateL()
+	{
+    CAknDialog::ActivateL();
+
+	// this cannot be in ConstructL which is executed before dialog is launched
+	iAvkonAppUi->AddToStackL(this);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspContentListDialog::GetHelpContext
+//
+//------------------------------------------------------------------------------
+//
+void CAspContentListDialog::GetHelpContext(TCoeHelpContext& aContext) const
+	{
+	aContext.iMajor = KUidSmlSyncApp;
+	//aContext.iContext = KDS_HLP_APPS_VIEW;    
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentListDialog::ProcessCommandL
+//
+// Handle commands from menu.
+//------------------------------------------------------------------------------
+//
+void CAspContentListDialog::ProcessCommandL(TInt aCommandId)
+	{
+	HideMenu();
+
+	switch (aCommandId)
+		{
+        case EAspMenuCmdEdit:
+			{
+			ShowContentL();
+			break;
+			}
+        
+        case EAspMenuCmdHelp:
+			{
+			TUtil::LaunchHelpAppL(iEikonEnv);
+			break;
+			}
+
+        case EAspMenuCmdExit:
+        case EAknCmdExit:
+        case EEikCmdExit:
+			{
+			// close dialog and exit calling application
+			iAvkonAppUi->ProcessCommandL(EAknCmdExit);
+			break;
+			}
+
+		default:
+			{
+			break;
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspContentListDialog::OkToExitL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspContentListDialog::OkToExitL(TInt aButtonId)
+	{
+	if (aButtonId == EEikBidCancel)
+		{
+		// exit going on - must return true.
+		return ETrue;
+		}
+
+	if (aButtonId == EAknSoftkeyBack)
+        {
+		return ETrue;
+		}
+
+	return CAknDialog::OkToExitL(aButtonId);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspContentListDialog::OfferKeyEventL
+// 
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspContentListDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+	{
+	if (aType == EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+			case EKeyOK:
+				{
+				ShowContentL();
+				return EKeyWasConsumed;
+				}
+    		
+			case EKeyEscape:  // framework calls this when dialog must shut down
+				{
+			    return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+				}
+ 
+			default:
+				{
+			    break;
+				}
+			}
+		}
+
+	return CAknDialog::OfferKeyEventL( aKeyEvent, aType);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::PreLayoutDynInitL
+//
+// Called by framework before dialog is shown.
+// -----------------------------------------------------------------------------
+//
+void CAspContentListDialog::PreLayoutDynInitL()
+    {
+    iSettingListBox = (CAknDoubleLargeStyleListBox*) ControlOrNull (EAspContentListDialogList);
+    
+   	__ASSERT_ALWAYS(iSettingListBox, TUtil::Panic(KErrGeneral));
+	
+	iSettingListBox->SetListBoxObserver(this);
+	iSettingListBox->CreateScrollBarFrameL(ETrue);
+	iSettingListBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+
+	TFileName bitmapName;
+	CAspResHandler::GetBitmapFileName(bitmapName);
+
+	CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray(KDefaultArraySize);
+	CleanupStack::PushL(icons);
+
+ 	// NOTE: icons must be appended in correct order (TAspContentListDialogIconIndex)
+ 	icons->AppendL(IconL(KAknsIIDQgnPropSmlSyncServer, bitmapName, EMbmAspsyncutilQgn_prop_sml_sync_server, EMbmAspsyncutilQgn_prop_sml_sync_server_mask));
+	icons->AppendL(IconL(KAknsIIDQgnPropSmlSyncToServer, bitmapName, EMbmAspsyncutilQgn_prop_sml_sync_to_server, EMbmAspsyncutilQgn_prop_sml_sync_to_server_mask));
+	icons->AppendL(IconL(KAknsIIDQgnPropSmlSyncFromServer, bitmapName, EMbmAspsyncutilQgn_prop_sml_sync_from_server, EMbmAspsyncutilQgn_prop_sml_sync_from_server_mask));
+	icons->AppendL(IconL(KAknsIIDQgnPropSmlSyncOff, bitmapName, EMbmAspsyncutilQgn_prop_sml_sync_off, EMbmAspsyncutilQgn_prop_sml_sync_off_mask));
+
+	iSettingListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
+	CleanupStack::Pop(icons);
+
+	UpdateListBoxL();
+	
+	iSettingListBox->UpdateScrollBarsL();
+	iSettingListBox->ScrollBarFrame()->MoveVertThumbTo(0);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::IconL
+// 
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CAspContentListDialog::IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex)
+	{
+    return TDialogUtil::CreateIconL(aId, aFileName, aFileIndex, aFileMaskIndex);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::DynInitMenuPaneL
+//
+// Called by framework before menu is shown.
+// -----------------------------------------------------------------------------
+//
+void CAspContentListDialog::DynInitMenuPaneL(TInt aResourceID, 	CEikMenuPane* /*aMenuPane*/)
+	{
+    if (aResourceID != R_ASP_CONTENT_LIST_DIALOG_MENU_PANE)
+		{
+		return;
+		}
+
+	if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdHelp);
+		}
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::HandleListBoxEventL (from MEikListBoxObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentListDialog::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent /*aEventType*/)
+	{
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspContentListDialog::HandleResourceChange
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspContentListDialog::HandleResourceChange(TInt aType)
+    {   
+    if (aType == KEikDynamicLayoutVariantSwitch) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        iSettingListBox->SetSize(mainPaneRect.Size());
+        CCoeControl::HandleResourceChange(aType);
+		DrawDeferred();
+	    return;
+		}
+		
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::UpdateListBoxL
+//	
+// -----------------------------------------------------------------------------
+//
+void CAspContentListDialog::UpdateListBoxL()
+	{
+	TInt iconIndex = EIconNotDefined;
+	
+	CAknDoubleLargeStyleListBox* listBox = ListBox();
+	CDesCArray* items = (CDesCArray*) listBox->Model()->ItemTextArray();
+	items->Reset();
+    listBox->ItemDrawer()->ClearAllPropertiesL();
+	
+	TInt count = iContentList->ProviderCount();
+
+	for (TInt i=0; i<count; i++)
+		{
+		HBufC* firstLine = NULL;
+		HBufC* secondLine = NULL;
+				
+		iconIndex = EIconNotDefined;
+		TAspProviderItem& providerItem = iContentList->ProviderItem(i);
+		
+		firstLine = CAspResHandler::GetContentNameLC(providerItem.iDataProviderId, providerItem.iDisplayName);
+		
+		TInt index = iContentList->FindTaskIndexForProvider(providerItem.iDataProviderId);
+		
+		if (index != KErrNotFound)
+			{
+			TAspTaskItem& task = iContentList->TaskItem(index);
+			TInt status = iContentList->CheckMandatoryTaskDataL(task.iTaskId);
+	        if (status == EMandatoryOk)
+			    {
+			    secondLine = CAspResHandler::ReadLC(R_ASP_DEFINED);
+                if (task.iSyncDirection == ESyncDirectionTwoWay)
+				    {
+				    iconIndex = EIconBothDirections;
+				    }
+			    if (task.iSyncDirection == ESyncDirectionOneWayFromDevice)
+				    {
+				    iconIndex = EIconDeviceToServer;
+				    }
+			    if (task.iSyncDirection == ESyncDirectionOneWayIntoDevice)
+				    {
+				    iconIndex = EIconServerToDevice;
+				    }
+			    }
+			else
+				{
+				secondLine = CAspResHandler::ReadLC(R_ASP_NOT_DEFINED);
+				}
+			}
+		else
+			{
+			secondLine = CAspResHandler::ReadLC(R_ASP_NOT_DEFINED);
+			}
+		
+		TPtr ptr1 = firstLine->Des();
+		AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr1);
+		TPtr ptr2 = secondLine->Des();
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr2);
+
+		HBufC* hBuf = NULL;
+		hBuf = TDialogUtil::ConstructListBoxItemLC(firstLine->Des(), secondLine->Des(), iconIndex);
+
+		items->AppendL(hBuf->Des());
+		
+		CleanupStack::PopAndDestroy(hBuf);
+		CleanupStack::PopAndDestroy(secondLine);
+		CleanupStack::PopAndDestroy(firstLine);
+		}
+
+	listBox->HandleItemAdditionL();
+
+	if (listBox->Model()->NumberOfItems() == 0)
+		{
+		User::Leave(KErrNotFound);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::ShowContentL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentListDialog::ShowContentL()
+	{
+ 	TAspParam param(iApplicationId, iSyncSession);
+    param.iProfile = iProfile;
+    param.iDataProviderId = SelectedProvider().iDataProviderId;
+    param.iSyncTaskId = KErrNotFound;
+
+    CAspContentDialog::ShowDialogL(param);
+     
+    iContentList->InitAllTasksL();
+    
+	UpdateListBoxL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::ListBox
+//
+// -----------------------------------------------------------------------------
+//
+CAknDoubleLargeStyleListBox* CAspContentListDialog::ListBox()
+	{
+	__ASSERT_DEBUG(iSettingListBox, TUtil::Panic(KErrGeneral));
+
+	return iSettingListBox;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::SelectedProvider
+//
+// -----------------------------------------------------------------------------
+//
+TAspProviderItem& CAspContentListDialog::SelectedProvider()
+	{
+	TInt index = ListBox()->CurrentItemIndex();
+
+	return iContentList->ProviderItem(index);
+	}
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspDbNotifier.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,586 @@
+/*
+* 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:  
+*
+*/
+
+
+
+#include "AspDbNotifier.h"
+#include "AspDebug.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+/******************************************************************************
+ * class TAspDbEvent
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// TAspDbEvent::TAspDbEvent
+//
+// -----------------------------------------------------------------------------
+//
+TAspDbEvent::TAspDbEvent(TInt aType)
+ : iType(aType), iProfileId(KErrNotFound), iError(KErrNone)
+	 {
+	 }
+
+
+
+/******************************************************************************
+ * class CAspDbNotifier
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::CAspDbNotifier
+//
+// -----------------------------------------------------------------------------
+//
+CAspDbNotifier::CAspDbNotifier(const TAspParam& aParam, MAspDbEventHandler* aHandler)
+ : iSyncSession(aParam.iSyncSession), iHandler(aHandler)
+ 	{
+ 	iSessionEventRequested = EFalse;
+ 	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspDbNotifier* CAspDbNotifier::NewL(const TAspParam& aParam, MAspDbEventHandler* aHandler)
+	{
+	CAspDbNotifier* self = new (ELeave) CAspDbNotifier(aParam, aHandler);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::ConstructL()
+	{
+    FLOG( _L("CAspDbNotifier::ConstructL START") );
+    
+	iActiveCaller = CAspActiveCaller::NewL(this);
+    
+    FLOG( _L("CAspDbNotifier::ConstructL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspDbNotifier::~CAspDbNotifier()
+	{		
+    FLOG( _L("CAspDbNotifier::~CAspDbNotifier START") );
+    
+	delete iActiveCaller;
+	iList.Close();
+    
+    if (iSessionEventRequested)
+    	{
+    	Session().CancelEvent();
+    	}
+    	
+    if (iDestroyedPtr)
+        {
+        *iDestroyedPtr = ETrue;
+        iDestroyedPtr = NULL;
+        }
+
+    FLOG( _L("CAspDbNotifier::~CAspDbNotifier END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::RequestL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::RequestL()
+	{
+	if (!iSessionEventRequested)
+		{
+		Session().RequestEventL(*this);  // request MSyncMLEventObserver events
+		iSessionEventRequested = ETrue;
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::OnSyncMLSessionEvent (from MSyncMLEventObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier, TInt aError, TInt aAdditionalData)
+	{
+    FLOG( _L("CAspDbNotifier::OnSyncMLSessionEvent START") );
+
+#ifdef _DEBUG
+    LogSessionEvent(aEvent, aIdentifier, aError);
+#endif
+
+    TRAP_IGNORE(HandleSessionEventL(aEvent, aIdentifier, aError, aAdditionalData));
+	
+    FLOG( _L("CAspDbNotifier::OnSyncMLSessionEvent END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::HandleSessionEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::HandleSessionEventL(TEvent aEvent, TInt aIdentifier, TInt aError, TInt /*aAdditionalData*/)
+	{
+	if (aEvent != MSyncMLEventObserver::EProfileCreated &&
+	    aEvent != MSyncMLEventObserver::EProfileChanged &&
+	    aEvent != MSyncMLEventObserver::EProfileDeleted &&
+	    aEvent != MSyncMLEventObserver::EServerTerminated)
+		{
+		return; // setting dialog does not need this event
+		}
+	
+	TAspDbEvent event(aEvent);
+
+    event.iError = aError;
+		
+	if (aEvent == MSyncMLEventObserver::EProfileCreated || 
+	    aEvent == MSyncMLEventObserver::EProfileChanged ||
+	    aEvent == MSyncMLEventObserver::EProfileDeleted )
+		{
+		event.iProfileId = aIdentifier;
+		}
+	else
+		{
+		event.iProfileId = KErrNotFound;
+		}
+	
+	iList.AppendL (event);
+	
+	CallObserverWithDelay();
+	RequestL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::CreateUpdateEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::CreateUpdateEventL(TInt aIdentifier, TInt aError)
+	{
+	TAspDbEvent event(MSyncMLEventObserver::EProfileChanged);
+	event.iProfileId = aIdentifier;
+    event.iError = aError;
+	
+	iList.Reset();
+	iList.AppendL (event);
+	
+	CallObserverWithDelay();
+	RequestL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::CheckUpdateEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::CheckUpdateEventL()
+	{
+	if (iList.Count() == 0)
+		{
+		return; // no database events - no need to update UI
+		}
+		
+	CallObserverWithDelay();
+	RequestL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::SetDisabled
+//
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::SetDisabled(TBool aDisable)
+	{
+    iDisabled = aDisable;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::Reset
+//
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::Reset()
+	{
+    iDisabled = EFalse;
+	iList.Reset();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::EventCount
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspDbNotifier::EventCount()
+	{
+	return iList.Count();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::Event
+//
+// -----------------------------------------------------------------------------
+//
+TAspDbEvent CAspDbNotifier::Event(TInt aIndex)
+	{
+	__ASSERT_DEBUG(aIndex>=0 && aIndex<iList.Count(), TUtil::Panic(KErrGeneral));
+
+	return iList[aIndex];
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::Session
+// 
+// -----------------------------------------------------------------------------
+//
+RSyncMLSession& CAspDbNotifier::Session()
+	{
+	__ASSERT_DEBUG(iSyncSession, TUtil::Panic(KErrGeneral));
+	
+	return *iSyncSession;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::CallObserverWithDelay
+//
+// This is needed to avoid unnecessary observer calls (eg. in case 10 events are
+// reported in short time only last is reported to observer). 
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::CallObserverWithDelay(void)
+	{
+    FLOG( _L("CAspDbNotifier::CallObserverWithDelay START") );
+    
+    iActiveCaller->Cancel();
+	iActiveCaller->Start(KErrNone, KListBoxUpdateDelay);
+		
+    FLOG( _L("CAspDbNotifier::CallObserverWithDelay END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::CallObserver
+//
+// this function investigates received events from last observer call
+// and calls observer to inform UI what to do. 
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::CallObserver()
+	{
+    FLOG( _L("CAspDbNotifier::CallObserver START") );
+	
+	TAspDbEvent event(EUpdateAll);
+
+	//
+	// check for critical error
+	//
+	if (FindCloseEvent() != KErrNotFound)
+		{
+		event.iType = EClose;
+		TRAP_IGNORE(iHandler->HandleDbEventL(event));
+		
+		FLOG( _L("CAspDbNotifier::CallObserver END") );
+		return; // some database problem - UI should close
+		}
+	
+	
+	//
+	// check if only one profile has changed
+	//
+	TInt index = FindSingleProfileEvent();
+	if (index != KErrNotFound)
+		{
+		TAspDbEvent& e = iList[index];
+        event.iProfileId = e.iProfileId; 
+        
+        event.iType = EUpdate;
+        if (ProfileDeleted())
+			{
+			event.iType = EDelete;
+			}
+	
+		TRAP_IGNORE(iHandler->HandleDbEventL(event));
+		
+        FLOG( _L("CAspDbNotifier::CallObserver END") );
+        return;
+		}
+	
+		
+	//
+	// check if 2 or more profiles have changed
+	//
+	if (FindProfileEvent() != KErrNotFound)
+		{
+	    event.iType = EUpdateAll;
+    	TRAP_IGNORE(iHandler->HandleDbEventL(event));
+	
+        FLOG( _L("CAspDbNotifier::CallObserver END") );
+        return;
+    	}
+    
+    FLOG( _L("CAspDbNotifier::CallObserver END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::FindCloseEvent
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspDbNotifier::FindCloseEvent()
+	{
+	TInt count = iList.Count();
+
+	for (TInt i=0; i<count; i++)
+		{
+		TAspDbEvent& event = iList[i];
+		if (event.iType == MSyncMLEventObserver::EServerTerminated)
+			{
+			return i;
+			}
+		}
+
+	return KErrNotFound;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::FindProfileEvent
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspDbNotifier::FindProfileEvent()
+	{
+	TInt count = iList.Count();
+
+    for (TInt i=0; i<count; i++)
+		{
+		TAspDbEvent& event = iList[i];
+		if (event.iProfileId != KErrNotFound)
+			{
+			return i;
+			}
+		}
+
+	return KErrNotFound;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::FindSingleProfileEvent
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspDbNotifier::FindSingleProfileEvent()
+	{
+	TInt count = iList.Count();
+
+	// find out whether list contains update events for one profile only
+	for (TInt i=0; i<count; i++)
+		{
+		TAspDbEvent& event = iList[i];
+		if (event.iProfileId != KErrNotFound && IsUniqueProfileId(event.iProfileId))
+			{
+			return i;
+        	}
+		}
+
+	return KErrNotFound;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::ProfileDeleted
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspDbNotifier::ProfileDeleted()
+	{
+	TInt count = iList.Count();
+
+	for (TInt i=0; i<count; i++)
+		{
+		TAspDbEvent& event = iList[i];
+		if (event.iType == MSyncMLEventObserver::EProfileDeleted)
+			{
+			return ETrue;
+			}
+		}
+
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::IsUniqueProfileId
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspDbNotifier::IsUniqueProfileId(TInt aId)
+	{
+	TInt count = iList.Count();
+
+    for (TInt i=0; i<count; i++)
+		{
+		TAspDbEvent& event = iList[i];
+		if (event.iProfileId != KErrNotFound && event.iProfileId != aId)
+			{
+			return EFalse;
+			}
+		}
+
+	return ETrue;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspDbNotifier::HandleActiveCallL (from MAspActiveCallerObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::HandleActiveCallL(TInt /*aCallId*/)
+	{
+    FLOG( _L("CAspDbNotifier::HandleActiveCallL START") );
+
+	if (iDisabled)
+		{
+		FLOG( _L("CAspDbNotifier::HandleActiveCallL: event observing disabled") );
+		FLOG( _L("CAspDbNotifier::HandleActiveCallL END") );
+		return;  // UI has disabled notifications
+		}
+
+    TBool destroyed(EFalse);
+    iDestroyedPtr = &destroyed;
+
+	CallObserver();
+	
+    if (!destroyed)   // destructor sets this to ETrue
+        {
+    	Reset();
+    	iDestroyedPtr = NULL;
+        }
+	
+    FLOG( _L("CAspDbNotifier::HandleActiveCallL END") );
+	}
+
+
+
+#ifdef _DEBUG
+
+// -----------------------------------------------------------------------------
+// LogSessionEvent
+//
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::LogSessionEvent(TEvent& aEvent, TInt aIdentifier, TInt aError)
+	{
+    TBuf<KBufSize> eventStr;
+    GetSyncEventText(eventStr, aEvent);
+
+	if (aError == KErrNone)
+		{
+		FTRACE( RDebug::Print(_L("event='%S' id=%d"), &eventStr, aIdentifier) );
+		}
+	else
+		{
+		FTRACE( RDebug::Print(_L("### event='%S' id=%d err=%d ###"), &eventStr, aIdentifier, aError) );
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// GetSyncEventText
+//
+// -----------------------------------------------------------------------------
+//
+void CAspDbNotifier::GetSyncEventText(TDes& aText, MSyncMLEventObserver::TEvent aEvent)
+	{
+    aText = _L("Unknown");
+    		
+	if (aEvent == MSyncMLEventObserver::EJobStart)
+		{
+		aText = _L("EJobStart");
+		}
+	if (aEvent == MSyncMLEventObserver::EJobStartFailed)
+		{
+		aText = _L("EJobStartFailed");
+		}
+	if (aEvent == MSyncMLEventObserver::EJobStop)
+		{
+		aText = _L("EJobStop");
+		}
+	if (aEvent == MSyncMLEventObserver::EJobRejected)
+		{
+		aText = _L("EJobRejected");
+		}
+	if (aEvent == MSyncMLEventObserver::EProfileCreated)
+		{
+		aText = _L("EProfileCreated");
+		}
+	if (aEvent == MSyncMLEventObserver::EProfileChanged)
+		{
+		aText = _L("EProfileChanged");
+		}
+	if (aEvent == MSyncMLEventObserver::EProfileDeleted)
+		{
+		aText = _L("EProfileDeleted");
+		}
+	if (aEvent == MSyncMLEventObserver::ETransportTimeout)
+		{
+		aText = _L("ETransportTimeout");
+		}
+	if (aEvent == MSyncMLEventObserver::EServerSuspended)
+		{
+		aText = _L("EServerSuspended");
+		}
+	if (aEvent == MSyncMLEventObserver::EServerTerminated)
+		{
+		aText = _L("EServerTerminated");
+		}
+	}
+
+#endif
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspDialogUtil.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,1954 @@
+/*
+* 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:  
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "AspDialogUtil.h"
+#include "AspUtil.h"
+#include "AspSchedule.h"
+#include <aspsyncutil.mbg>  // for bitmap enumerations
+
+#include <aknnavilabel.h>
+#include <akntitle.h>           // CAknTitlePane
+#include <akncontext.h>         // CAknTitlePane
+#include <aknnotewrappers.h>    // CAknInformationNote
+#include <eikmenup.h>           // CEikMenuPane
+#include <aknlists.h>           // CAknSingleHeadingPopupMenuStyleListBox
+
+#include <aknmfnesettingpage.h>         // CAknDateSettingPage
+#include <aknradiobuttonsettingpage.h>  // CAknRadioButtonSettingPage
+#include <akntextsettingpage.h>         // CAknIntegerSettingPage
+#include <aknmessagequerydialog.h>      // CAknMessageQueryDialog
+#include <AknIndicatorContainer.h>
+
+#include <AknIconArray.h>   // for GulArray
+#include <gulicon.h>
+
+#include "AspSettingDialog.h"
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+
+/*******************************************************************************
+ * class TDialogUtil
+ *******************************************************************************/
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowTextQueryL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowTextQueryL(const TDesC& aTitle, TDes& aText, TInt aMaxLength)
+	{
+	CAknTextQueryDialog* query = CAknTextQueryDialog::NewL(aText);
+	CleanupStack::PushL(query);
+	query->SetPromptL(aTitle);
+	if (aMaxLength > 0)
+		{
+		query->SetMaxLength(aMaxLength);
+		}
+    CleanupStack::Pop(query);		
+
+	query->ExecuteLD(R_ASP_TEXT_QUERY);
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowMessageQueryL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowMessageQueryL(const TDesC& aTitle, const TDesC& aText)
+	{
+	TPtrC ptr = aText;
+	CAknMessageQueryDialog* query = CAknMessageQueryDialog::NewL(ptr);
+	query->PrepareLC(R_ASP_MESSAGE_QUERY);
+	_LIT(KEmpty, " ");
+	if (aTitle.Compare(KEmpty) != 0 )
+		{
+		CAknPopupHeadingPane* headingPane = query->Heading();
+		headingPane->SetTextL(aTitle);
+		}
+	query->RunLD();
+	}
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowAutoSyncMessageQueryL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowAutoSyncMessageQueryL(const TDesC& aText)
+	{
+	TPtrC ptr = aText;
+	HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_MAIN_AUTO_ERROR_LOG_LINK);
+	CAknMessageQueryDialog* query = CAknMessageQueryDialog::NewL(ptr);
+	CleanupStack::PushL(query);
+
+	TCallBack LogView(TDialogUtil::ShowAutoSyncLogL);
+	query->SetLink(LogView);
+    query->SetLinkTextL(hBuf->Des());
+	
+	//CAknPopupHeadingPane* headingPane = query->Heading();
+	//headingPane->SetTextL(aTitle);
+
+	CleanupStack::Pop(query);
+	query->ExecuteLD(R_ASP_MESSAGE_QUERY);
+
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowMessageQueryL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowMessageQueryL(const TDesC& aTitle, TInt aResource)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
+	ShowMessageQueryL(aTitle, hBuf->Des());
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+	
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowConfirmationQueryL
+//
+//------------------------------------------------------------------------------
+//
+TBool TDialogUtil::ShowConfirmationQueryL(const TDesC& aText)
+	{
+	CAknQueryDialog* queryDialog = new (ELeave) CAknQueryDialog;
+	TBool ret = queryDialog->ExecuteLD(R_ASP_CONFIRMATION_QUERY, aText);
+	return ret;
+	}
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowRoamingConfirmationQueryL
+//
+//------------------------------------------------------------------------------
+//
+TBool TDialogUtil::ShowRoamingConfirmationQueryL(const TDesC& aText)
+    {
+    CAknQueryDialog* queryDialog = new (ELeave) CAknQueryDialog;
+    TBool ret = queryDialog->ExecuteLD(R_ASP_ROAMING_CONFIRMATION_QUERY, aText);
+    return ret;
+    }
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowRoamingConfirmationQueryL
+//
+//------------------------------------------------------------------------------
+//
+TBool TDialogUtil::ShowRoamingConfirmationQueryL(TInt aResource)
+    {
+    HBufC* hBuf = CAspResHandler::ReadLC(aResource);
+    TBool ret = ShowRoamingConfirmationQueryL(hBuf->Des());
+    CleanupStack::PopAndDestroy(hBuf);
+    return ret;
+    }
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowConfirmationQueryL
+//
+//------------------------------------------------------------------------------
+//
+TBool TDialogUtil::ShowConfirmationQueryL(TInt aResource)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
+	TBool ret = ShowConfirmationQueryL(hBuf->Des());
+	CleanupStack::PopAndDestroy(hBuf);
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowInformationQueryL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowInformationQueryL(const TDesC& aText)
+	{
+	CAknQueryDialog* queryDialog = new (ELeave) CAknQueryDialog;
+	queryDialog->ExecuteLD(R_ASP_INFORMATION_QUERY, aText);
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowInformationQueryL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowInformationQueryL(TInt aResource)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
+	ShowInformationQueryL(hBuf->Des());
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowInformationNoteL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowInformationNoteL(TInt aResource)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
+    ShowInformationNoteL(hBuf->Des());
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowInformationNoteL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowInformationNoteL(const TDesC& aText)
+	{
+	CAknInformationNote* queryDialog = new (ELeave) CAknInformationNote(ETrue);
+	queryDialog->ExecuteLD(aText);
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowErrorNoteL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowErrorNoteL(TInt aResource)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
+	ShowErrorNoteL(hBuf->Des());
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowErrorNoteL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowErrorNoteL(const TDesC& aText)
+	{
+	CAknErrorNote* errorNote = new (ELeave) CAknErrorNote(ETrue);
+	errorNote->ExecuteLD(aText);
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowErrorQueryL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowErrorQueryL(TInt aResource)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
+	ShowErrorQueryL(hBuf->Des());
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowErrorQueryL
+//
+//------------------------------------------------------------------------------
+//
+void TDialogUtil::ShowErrorQueryL(const TDesC& aText)
+	{
+	CAknQueryDialog* queryDialog = new (ELeave) CAknQueryDialog;
+	queryDialog->ExecuteLD(R_ASP_ERROR_QUERY, aText);
+	}
+
+
+// -----------------------------------------------------------------------------
+// TDialogUtil::ShowListQueryL
+// 
+// -----------------------------------------------------------------------------
+TBool TDialogUtil::ShowListQueryL(const TDesC& aTitle, CDesCArray* aList, TInt* aSelectedIndex)
+	{
+	CAknListQueryDialog* query = new (ELeave) CAknListQueryDialog(aSelectedIndex);
+	CleanupStack::PushL(query);
+
+	query->PrepareLC(R_ASP_LIST_QUERY);
+	query->SetItemTextArray(aList);
+	query->SetOwnershipType(ELbmDoesNotOwnItemArray);
+	CAknPopupHeadingPane* headingPane = query->QueryHeading();
+	headingPane->SetTextL(aTitle);
+	
+	CleanupStack::Pop(query);
+
+	return query->RunLD();
+	}
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowListQueryIconL
+//
+//------------------------------------------------------------------------------
+TBool TDialogUtil::ShowListQueryIconL(const TDesC& aTitle, CDesCArray* aList, TInt* aSelectedIndex)
+	{
+	  
+	 CAknListQueryDialog* query = new (ELeave) CAknListQueryDialog(aSelectedIndex);
+	 CleanupStack::PushL(query);
+	 query->PrepareLC(R_ASP_LIST_APP_QUERY);
+	 
+	 
+	 query->SetItemTextArray(aList);
+	 query->SetOwnershipType(ELbmOwnsItemArray);
+	 
+	 CArrayPtr<CGulIcon>* iconList = new (ELeave) CAknIconArray(1);
+	 CleanupStack::PushL(iconList);
+	 
+ 	 TFileName bitmapName;
+ 	 CAspResHandler::GetBitmapFileName(bitmapName);
+ 	 //renders Qgn_Prop_Sml_New icon
+	 iconList->AppendL(CreateIconL(KAknsIIDQgnPropSmlNew, bitmapName, 
+	                     EMbmAspsyncutilQgn_prop_sml_new,
+	                     EMbmAspsyncutilQgn_prop_sml_new_mask) );
+	 query->SetIconArrayL(iconList);
+	 CAknPopupHeadingPane* headingPane = query->QueryHeading();
+ 	 headingPane->SetTextL(aTitle);
+ 	  
+	 CleanupStack::Pop(iconList);
+	 CleanupStack::Pop(query);
+	 return query->RunLD();
+	}
+
+// -----------------------------------------------------------------------------
+// TDialogUtil::ShowListQueryL
+// 
+// -----------------------------------------------------------------------------
+TBool TDialogUtil::ShowListQueryL(TInt aTitle, CDesCArray* aList, TInt* aSelectedIndex)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(aTitle);
+
+    TBool ret = ShowListQueryL(hBuf->Des(), aList, aSelectedIndex);
+   	CleanupStack::PopAndDestroy(hBuf);
+   	
+   	return ret;
+	}
+
+//------------------------------------------------------------------------------
+//TDialogUtil::ShowListQueryIconL
+//
+//------------------------------------------------------------------------------
+TBool TDialogUtil::ShowListQueryIconL(TInt aTitle, CDesCArray* aList, TInt* aSelectedIndex)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(aTitle);
+
+    TBool ret = ShowListQueryIconL(hBuf->Des(), aList, aSelectedIndex);
+   	CleanupStack::PopAndDestroy(hBuf);
+   	
+   	return ret;
+	}
+// -----------------------------------------------------------------------------
+// TDialogUtil::ShowProfileQueryL
+// 
+// -----------------------------------------------------------------------------
+TBool TDialogUtil::ShowProfileQueryL(CAspProfileList* aList, TInt& aId, TInt aResource)
+	{
+	aId = KErrNotFound;
+	
+	CDesCArray* arr = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
+	CleanupStack::PushL(arr);
+
+	TInt count = aList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProfileItem& profile = aList->Item(i);
+		arr->AppendL(profile.iProfileName);
+		}
+
+    TInt index=KErrNotFound;
+	TBool ret = ShowListQueryL(aResource, arr, &index);
+	
+	if (ret)
+		{
+	    TAspProfileItem& profile = aList->Item(index);
+	    aId = profile.iProfileId;
+		}
+
+	CleanupStack::PopAndDestroy(arr);
+	return ret;
+	}
+//------------------------------------------------------------------------------
+//TDialogUtil::ShowProfileQueryAppL
+//
+//-----------------------------------------------------------------------------
+
+TBool TDialogUtil::ShowProfileQueryAppL(CAspProfileList* aList, TInt& aId, TInt aResource,TInt &index1)
+{
+	aId = KErrNotFound;
+	
+	CDesCArray* arr = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
+	CleanupStack::PushL(arr);
+      
+    
+	HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_SELECT_PROFILE_CREATE_NEW);
+    TPtr ptr = hBuf->Des();
+  
+    //"%d\t%S" for formatting the icon and text data in the query dialog 
+   	 _LIT(KListItemFormat,"%d\t%S");
+	 TBuf<KBufSize> item;
+     item.Format(KListItemFormat,0 , &ptr);
+	 arr->AppendL(item);
+   	 CleanupStack::PopAndDestroy(hBuf);
+       
+    
+	 TInt count = aList->Count();
+	 for (TInt i=0; i< count; i++)
+		{
+		TAspProfileItem& profile = aList->Item(i);
+		//"\t%S" no need of keeping icon for profile list
+		_LIT(KListItemFormat,"\t%S");
+		HBufC* hBuf1=TUtil::StrConversion(profile.iProfileName);
+		TPtr ptr1=hBuf1->Des();
+		item.Format(KListItemFormat,&ptr1);
+		CleanupStack::PopAndDestroy(hBuf1);
+	    arr->AppendL(item);
+		}
+		
+	
+	TInt index=KErrNotFound;
+	TBool ret = ShowListQueryIconL(aResource, arr, &index);
+
+	if (ret)
+		{
+		
+		  if(index==0) //to check if R_ASP_SELECT_PROFILE_CREATE_NEW is selected
+				{
+	   				 ret=EFalse;
+	   				 index1=1;
+	    			 CleanupStack::Pop(arr);
+					 return ret;
+				}
+		
+	    TAspProfileItem& profile = aList->Item(index-1);
+	    aId = profile.iProfileId;
+	    
+		}
+
+	CleanupStack::Pop(arr);
+	return ret;
+}
+
+
+// -----------------------------------------------------------------------------
+// TDialogUtil::DeleteMenuItem
+//
+// -----------------------------------------------------------------------------
+//
+void TDialogUtil::DeleteMenuItem(CEikMenuPane* aMenuPane, TInt aCommandId)
+	{
+	TInt pos=KErrNotFound;
+    if (aMenuPane->MenuItemExists(aCommandId, pos))
+		{
+		aMenuPane->DeleteMenuItem(aCommandId);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// TDialogUtil::CreateIconL
+//
+// Constructs an independent CGulIcon object with fallback support.
+// If no matching item (aId) is found in the currently active skin,
+// attempts to construct the item using the given file (last 3 parameters).
+// -----------------------------------------------------------------------------
+//
+CGulIcon* TDialogUtil::CreateIconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileBitmapId, TInt aFileMaskId)
+	{
+    CGulIcon* icon = AknsUtils::CreateGulIconL(AknsUtils::SkinInstance(), aId, aFileName, aFileBitmapId, aFileMaskId);
+	return icon;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TDialogUtil::CreateImageL
+//
+// -----------------------------------------------------------------------------
+//
+CEikImage* TDialogUtil::CreateImageLC(TAknsItemID aId, const TDesC& aFileName, TInt aFileBitmapId, TInt aFileMaskId)
+	{
+	CFbsBitmap* bitmap1 = NULL;
+	CFbsBitmap* bitmap2 = NULL;
+	
+	CEikImage* image = new (ELeave) CEikImage;
+	CleanupStack::PushL(image);
+
+	AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), aId, bitmap1, bitmap2, aFileName, aFileBitmapId, aFileMaskId);
+	image->SetPicture(bitmap1, bitmap2);
+	CleanupStack::Pop(2); // bitmap1 bitmap2
+
+	return image;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TDialogUtil::ConstructListBoxItemL
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* TDialogUtil::ConstructListBoxItemLC(const TDesC& aFirstLine, const TDesC& aSecondLine, TInt /*aIndex*/)
+	{
+    _LIT(KFormat, "%d\t%S\t%S");
+	
+	TInt len = aFirstLine.Length() + aSecondLine.Length() + KBufSize16;
+	
+	HBufC* hBuf = HBufC::NewLC(len);
+	TPtr ptr = hBuf->Des();
+	
+	ptr.Format(KFormat, 1, &aFirstLine, &aSecondLine);
+	
+	
+	return hBuf;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TDialogUtil::ShowTimeEditorL
+//
+// -----------------------------------------------------------------------------
+//
+TBool TDialogUtil::ShowTimeEditorL(TTime& aTime, const TDesC& aTitle)
+	{
+    CAknTimeSettingPage* dlg = new (ELeave) CAknTimeSettingPage(R_ASP_SETTING_TIME, aTime);
+    
+   	CleanupStack::PushL(dlg);
+	dlg->ConstructL();
+	dlg->SetSettingTextL(aTitle);
+	CleanupStack::Pop(dlg);
+
+    
+    if (dlg->ExecuteLD(CAknSettingPage::EUpdateWhenAccepted))
+        {
+        return ETrue;
+        }
+        
+    return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TDialogUtil::ShowDateEditorL
+//
+// -----------------------------------------------------------------------------
+//
+TBool TDialogUtil::ShowDateEditorL(TTime& aTime, const TDesC& aTitle)
+	{
+    CAknDateSettingPage* dlg = new (ELeave) CAknDateSettingPage(R_ASP_SETTING_DATE, aTime);
+    
+   	CleanupStack::PushL(dlg);
+	dlg->ConstructL();
+	dlg->SetSettingTextL(aTitle);
+	CleanupStack::Pop(dlg);
+
+    if (dlg->ExecuteLD(CAknSettingPage::EUpdateWhenAccepted))
+        {
+        return ETrue;
+        }
+        
+    return EFalse;
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowListEditorL
+//
+//------------------------------------------------------------------------------
+//
+TBool TDialogUtil::ShowListEditorL(CDesCArray* aList, const TDesC& aTitle, TInt& aCurrent)
+	{
+
+	CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage(
+	                                       R_ASP_SETTING_RADIO, aCurrent, aList);
+	CleanupStack::PushL(dlg);
+	dlg->SetSettingTextL(aTitle); 
+	CleanupStack::Pop(dlg);
+
+	return dlg->ExecuteLD();
+	}
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowListEditorL
+//
+//------------------------------------------------------------------------------
+//
+TBool TDialogUtil::ShowListEditorL(TInt aResourceId, CDesCArray* aList, const TDesC& aTitle, TInt& aCurrent)
+	{
+	CAspRadioButtonSettingPageEditor* dlg = new (ELeave) CAspRadioButtonSettingPageEditor(
+	                                       aResourceId, aCurrent, aList);
+	CleanupStack::PushL(dlg);
+	dlg->SetSettingTextL(aTitle); 
+	CleanupStack::Pop(dlg);
+
+	return dlg->ExecuteLD();
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowTextEditorL
+//
+//------------------------------------------------------------------------------
+//
+TBool TDialogUtil::ShowTextEditorL(TInt aResourceId, TDes& aText, const TDesC& aTitle, TBool aMandatory, TBool aLatinInput, TInt aMaxLength)
+	{
+	TInt flags(CAknTextSettingPage::EZeroLengthAllowed);
+
+	if (aMandatory)
+		{
+		flags = CAknTextSettingPage::EZeroLengthNotOffered;
+		}
+
+	CAspTextSettingPageEditor * dlg = new (ELeave) CAspTextSettingPageEditor(aResourceId, aText, flags);
+	CleanupStack::PushL(dlg);
+
+	dlg->SetSettingTextL(aTitle); 
+	dlg->ConstructL();
+	dlg->TextControl()->SetTextLimit(aMaxLength);
+
+	if (aLatinInput)
+		{		
+		dlg->TextControl()->SetAvkonWrap(ETrue);
+		dlg->TextControl()->SetAknEditorCase(EAknEditorLowerCase);
+		dlg->TextControl()->SetAknEditorFlags(EAknEditorFlagNoT9 | EAknEditorFlagLatinInputModesOnly);
+		}
+	
+	CleanupStack::Pop(dlg);
+
+	// CAknTextSettingPage::ExecuteLD only return boolean. See CAknSettingPage::ProcessCommandL
+	// what softkey values map to ETrue and EFalse.
+	TInt ret = dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
+	if (ret)
+		{
+    	return ETrue;
+		}
+
+	return EFalse;
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowTextEditorL
+//
+//------------------------------------------------------------------------------
+//
+TBool TDialogUtil::ShowTextEditorL(TDes& aText, const TDesC& aTitle, TBool aMandatory, TBool aLatinInput, TInt aMaxLength)
+	{
+	return ShowTextEditorL(R_ASP_SETTING_TEXT, aText, aTitle, aMandatory, aLatinInput, aMaxLength);
+	}
+
+
+//------------------------------------------------------------------------------
+// TDialogUtil::ShowIntegerEditorL
+//
+//------------------------------------------------------------------------------
+//
+TBool TDialogUtil::ShowIntegerEditorL(TInt& aNumber, const TDesC& aTitle, TInt aMin, TInt aMax, TBool aLatinInput)
+	{
+	CAspIntegerSettingPageEditor* dlg = new (ELeave) CAspIntegerSettingPageEditor(
+	                              R_ASP_SETTING_NUMBER, aNumber,
+	                              CAknIntegerSettingPage::EInvalidValueNotOffered);
+	CleanupStack::PushL(dlg);
+	dlg->ConstructL();
+	dlg->SetSettingTextL(aTitle);
+	CleanupStack::Pop(dlg);
+	
+	CAknIntegerEdwin* editor = dlg->IntegerEditorControl();
+	if (aMin != KErrNotFound)
+		{
+		editor->SetMinimumIntegerValue(aMin);
+		}
+	if (aMax != KErrNotFound)
+		{
+		editor->SetMaximumIntegerValue(aMax);
+		}
+
+	editor->SetAknEditorNumericKeymap(EAknEditorPlainNumberModeKeymap);
+	
+	if (aLatinInput)
+		{
+		editor->SetAknEditorFlags(EAknEditorFlagLatinInputModesOnly);
+		editor->SetValueL(aNumber);
+		}
+
+	if (dlg->ExecuteLD(CAknIntegerSettingPage::EUpdateWhenChanged))
+		{
+		return ETrue;
+		}
+
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TDialogUtil::ShowPopupDialogL
+// 
+// -----------------------------------------------------------------------------
+void TDialogUtil::ShowPopupDialogL(const TDesC& aText, CDesCArray* aArray)
+	{
+	CAknSingleHeadingPopupMenuStyleListBox* listBox = new (ELeave) CAknSingleHeadingPopupMenuStyleListBox;
+	CleanupStack::PushL(listBox);
+
+
+	CAknPopupList* popupList = CAknPopupList::NewL(listBox, R_AVKON_SOFTKEYS_OK_EMPTY, AknPopupLayouts::EMenuWindow);
+	CleanupStack::PushL(popupList);
+
+	listBox->ConstructL(popupList, EAknListBoxViewerFlags);
+	
+	CDesCArray* array = (CDesCArray*) listBox->Model()->ItemTextArray();
+	listBox->CreateScrollBarFrameL(ETrue); 
+	listBox->ScrollBarFrame()->	SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+    
+	TInt count = aArray->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		TPtrC ptr = (*aArray)[i];
+		array->AppendL(ptr);
+		}
+	
+	popupList->SetTitleL(aText);
+
+	popupList->ExecuteLD();
+
+	CleanupStack::Pop(popupList);
+	CleanupStack::PopAndDestroy(listBox);
+	}
+
+
+// -----------------------------------------------------------------------------
+// TDialogUtil::ShowPopupDialog2L
+// 
+// -----------------------------------------------------------------------------
+void TDialogUtil::ShowPopupDialog2L(const TDesC& aText, CDesCArray* aArray)
+	{
+    CAknDoublePopupMenuStyleListBox* listBox = new(ELeave) CAknDoublePopupMenuStyleListBox;
+    
+    CleanupStack::PushL(listBox);
+
+    // Avkon popup list with heading
+    CAknPopupList* popupList = CAknPopupList::NewL(listBox, R_AVKON_SOFTKEYS_OK_EMPTY, AknPopupLayouts::EMenuDoubleWindow);
+    CleanupStack::PushL(popupList);
+    
+    // Set listbox properties and create item array
+    listBox->ConstructL(popupList, EAknListBoxViewerFlags);
+    listBox->CreateScrollBarFrameL(ETrue);
+    listBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+    
+   	CDesCArray* array = (CDesCArray*) listBox->Model()->ItemTextArray();
+	TInt count = aArray->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		TPtrC ptr = (*aArray)[i];
+		array->AppendL(ptr);
+		}
+    popupList->SetTitleL(aText);
+    	
+    popupList->ExecuteLD();
+
+    CleanupStack::Pop(popupList);
+    CleanupStack::PopAndDestroy(listBox);
+	}
+
+// -----------------------------------------------------------------------------
+// TDialogUtil::ShowAutoSyncLogL
+// 
+// -----------------------------------------------------------------------------
+TInt TDialogUtil::ShowAutoSyncLogL(TAny* /*aAny*/)
+	{
+
+	CAspSchedule* schedule = CAspSchedule::NewLC();
+	TRAPD (err,schedule->ShowAutoSyncLogL());
+	CleanupStack::PopAndDestroy(schedule);
+
+	if (err == KErrNone)
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+//-----------------------------------------------------------------------------
+//
+//Does Descriptor contain string "PC Suite"
+//Its NOT case sensitive
+//
+//-----------------------------------------------------------------------------
+TBool TDialogUtil::IsPCSuiteDesC(const TDesC& des)
+{
+	_LIT(KPCSuite, "pc suite");
+	TPtrC pcSuitePtr(KPCSuite);
+	
+	TBuf<KBufSize64> buf;
+	TUtil::StrCopy(buf,des);
+	buf.LowerCase();
+	if (buf.Match(pcSuitePtr) == 0)
+	{
+		return ETrue;
+	}
+		
+	return EFalse;
+}
+	    		
+
+/*******************************************************************************
+ * class CAspIndicatorHandler
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspIndicatorHandler::~CAspIndicatorHandler()
+    {
+    if (iIndicator && iIndicatorContainer && iIndicatorModified)
+    	{
+        if (iPreviousIndicatorType == EAknNaviPaneEditorIndicatorMessageLength)
+        	{
+        	TRAP_IGNORE( iIndicatorContainer->SetIndicatorValueL(
+                      TUid::Uid(EAknNaviPaneEditorIndicatorMessageLength), KNullDesC) );
+            }
+
+        iIndicatorContainer->SetIndicatorState(TUid::Uid(iIndicatorType), EAknIndicatorStateOff);
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspIndicatorHandler::CAspIndicatorHandler
+//
+// -----------------------------------------------------------------------------
+//
+CAspIndicatorHandler::CAspIndicatorHandler(MAknEditingStateIndicator* aIndicator) : iIndicator(aIndicator)
+	{
+	iIndicatorContainer = iIndicator->IndicatorContainer();
+    iIndicatorModified = EFalse;
+    iPreviousIndicatorType = KErrNotFound;
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspIndicatorHandler::SetIndicatorStateL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspIndicatorHandler::SetIndicatorStateL(TInt aIndicatorType, const TDesC& aText)
+	{
+    if (iIndicator && iIndicatorContainer)
+    	{
+   	
+        if (iPreviousIndicatorType == EAknNaviPaneEditorIndicatorMessageLength)
+        	{
+        	iIndicatorContainer->SetIndicatorValueL(
+                      TUid::Uid(EAknNaviPaneEditorIndicatorMessageLength), KNullDesC);
+            }
+
+    	iIndicatorContainer->SetIndicatorState(TUid::Uid(aIndicatorType),
+                                               EAknIndicatorStateOn);
+                                               
+        iIndicatorModified = ETrue;
+        iPreviousIndicatorType = aIndicatorType;
+        
+                                               
+        if (aIndicatorType == EAknNaviPaneEditorIndicatorMessageLength)
+        	{
+        	iIndicatorContainer->SetIndicatorValueL(
+                                 TUid::Uid(EAknNaviPaneEditorIndicatorMessageLength), aText);
+            iPreviousIndicatorType = aIndicatorType;
+            }
+    	}
+	
+	}
+
+
+
+/*******************************************************************************
+ * class CAspNaviPaneHandler
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspNaviPaneHandler::~CAspNaviPaneHandler()
+    {
+   	if (iNaviDecorator)
+		{
+		if (iNaviPane && iNavidecoratorPushed)
+			{
+			iNaviPane->Pop(iNaviDecorator);
+			}
+	
+		delete iNaviDecorator;
+		}
+		
+	if (iNaviPane && iNavipanePushed)
+		{
+		iNaviPane->Pop(); // restore previous navi pane
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspNaviPaneHandler::CAspNaviPaneHandler
+//
+// -----------------------------------------------------------------------------
+//
+CAspNaviPaneHandler::CAspNaviPaneHandler(CEikStatusPane* aStatusPane) : iStatusPane(aStatusPane)
+	{
+	iNavidecoratorPushed = EFalse;
+	iNavipanePushed = EFalse;
+	
+	if (iStatusPane)
+		{
+		TRAP_IGNORE( iNaviPane = (CAknNavigationControlContainer*)iStatusPane->ControlL(TUid::Uid(EEikStatusPaneUidNavi)) );
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspNaviPaneHandler::SetNaviPaneTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspNaviPaneHandler::SetNaviPaneTitleL(const TDesC& aTitle)
+	{
+	if (!iStatusPane || !iNaviPane)
+		{
+		return;
+		}
+
+    if (iNaviDecorator)
+        {
+        CAknNaviLabel* naviLabel = static_cast<CAknNaviLabel*>(iNaviDecorator->DecoratedControl());
+        if (naviLabel)
+        	{
+        	naviLabel->SetTextL(aTitle);
+        	iNaviDecorator->DrawDeferred();
+        	}
+        }
+     else
+    	{
+    	iNaviDecorator = iNaviPane->CreateNavigationLabelL(aTitle);
+    	iNaviPane->PushL(*iNaviDecorator); // activate navi label in navi pane
+    	iNavidecoratorPushed = ETrue;
+    	}
+    	
+    //CFbsBitmap* bitmap = NULL;
+    //CFbsBitmap* bitmapMask = NULL;
+    //AknsUtils::CreateIconL(AknsUtils::SkinInstance(), KAknsIIDQgnPropSmlHttp,
+    //                       bitmap, bitmapMask, bitmapName,
+    //                       EMbmAspsyncutilQgn_prop_sml_http, EMbmAspsyncutilQgn_prop_sml_http_mask);
+    //iNaviDecorator = naviPane->CreateNavigationImageL(bitmap, bitmapMask);
+    //naviPane->PushL(*iNaviDecorator);
+    	
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspNaviPaneHandler::StoreNavipaneL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspNaviPaneHandler::StoreNavipaneL()
+	{
+	if (!iNaviPane || !iStatusPane || iNavipanePushed)
+		{
+		return;
+		}
+
+	if (iStatusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)).IsPresent())
+		{
+		iNaviPane->PushDefaultL();
+		iNavipanePushed = ETrue;
+		}
+	}
+
+#ifdef RD_DSUI_TIMEDSYNC
+
+/*******************************************************************************
+ * class CAspTabbedNaviPaneHandler
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspTabbedNaviPaneHandler::~CAspTabbedNaviPaneHandler()
+    {
+   	if (iNaviDecorator)
+		{
+		if (iNaviPane && iNavidecoratorPushed)
+			{
+			iNaviPane->Pop(iNaviDecorator);
+			}
+	
+		delete iNaviDecorator;
+		}
+		
+	if (iNaviPane && iNavipanePushed)
+		{
+		iNaviPane->Pop(); // restore previous navi pane
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspTabbedNaviPaneHandler::CAspTabbedNaviPaneHandler
+//
+// -----------------------------------------------------------------------------
+//
+CAspTabbedNaviPaneHandler::CAspTabbedNaviPaneHandler(CEikStatusPane* aStatusPane ,CAspSettingDialog *aDialog) 
+						  : iStatusPane(aStatusPane)
+	{
+	iNavidecoratorPushed = EFalse;
+	iNavipanePushed = EFalse;
+	
+	iDialog = aDialog;
+	
+	if (iStatusPane)
+		{
+		TRAP_IGNORE( iNaviPane = (CAknNavigationControlContainer*)iStatusPane->ControlL(TUid::Uid(EEikStatusPaneUidNavi)) );
+		}
+		
+    if (iNaviPane)
+        {
+        TRAP_IGNORE(iNaviDecorator = iNaviPane->CreateTabGroupL(this));    
+        if (iNaviDecorator)
+            {
+            TRAP_IGNORE(iNaviPane->PushL(*iNaviDecorator));
+            iNavidecoratorPushed = ETrue;
+    
+            iTabGroup = static_cast<CAknTabGroup*>( iNaviDecorator->DecoratedControl() );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CAspTabbedNaviPaneHandler::SetTabWidthL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspTabbedNaviPaneHandler::SetTabWidthL()
+{
+	
+	if (iTabGroup)
+	    {
+	     if (iTabGroup->TabCount() == 1)
+	         {
+	         iTabGroup->SetTabFixedWidthL(KTabWidthWithOneTab);     	
+	         }
+	     else if (iTabGroup->TabCount() == 2)
+	         {
+	         iTabGroup->SetTabFixedWidthL(KTabWidthWithTwoLongTabs);     	
+	         }
+	     else
+	         {
+	         iTabGroup->SetTabFixedWidthL(KTabWidthWithThreeLongTabs);     		
+	         }
+	      }
+}
+// -----------------------------------------------------------------------------
+// CAspTabbedNaviPaneHandler::SetTabTextL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspTabbedNaviPaneHandler::SetTabTextL(const TDesC& aText, TInt aTabId)
+	{
+	if (iTabGroup)
+	    {
+	    iTabGroup->ReplaceTabTextL(aTabId, aText);
+	    }
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspTabbedNaviPaneHandler::AddTabL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspTabbedNaviPaneHandler::AddTabL(const TDesC& aText, TInt aTabId)
+	{
+	if (iTabGroup)
+	    {
+	    iTabGroup->AddTabL(aTabId, aText);
+	    }
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspTabbedNaviPaneHandler::DeleteTabsL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspTabbedNaviPaneHandler::DeleteTabsL()
+	{
+	if (iTabGroup)
+	    {
+	    TInt count = iTabGroup->TabCount();
+	    for (TInt i=0; i<count; i++)
+	        {
+	        TInt id = iTabGroup->TabIdFromIndex(0);
+	        iTabGroup->DeleteTabL(id);
+	        }
+	    }
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspTabbedNaviPaneHandler::SetActiveTabL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspTabbedNaviPaneHandler::SetActiveTabL(TInt aTabId)
+	{
+	if (iTabGroup)
+	    {
+	    TInt index = iTabGroup->TabIndexFromId(aTabId);
+	    if (index != KErrNotFound)
+	        {
+	        iTabGroup->SetActiveTabById(aTabId);    
+	        }
+	    }
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspTabbedNaviPaneHandler::StoreNavipaneL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspTabbedNaviPaneHandler::StoreNavipaneL()
+	{
+	if (!iNaviPane || !iStatusPane || iNavipanePushed)
+		{
+		return;
+		}
+
+	if (iStatusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)).IsPresent())
+		{
+		iNaviPane->PushDefaultL();
+		iNavipanePushed = ETrue;
+		}
+	}
+
+// ----------------------------------------------------------------------------
+// CAspTabbedNaviPaneHandler::TabIndex
+// 
+// ----------------------------------------------------------------------------
+//
+TInt CAspTabbedNaviPaneHandler::TabIndex(TInt aTabId)
+	{
+	return iTabGroup->TabIndexFromId(aTabId);
+	}
+
+// ----------------------------------------------------------------------------
+// CAspTabbedNaviPaneHandler::TabChangedL (from MAknTabObserver)
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspTabbedNaviPaneHandler::TabChangedL(TInt aIndex)
+	{
+	TInt profileId = iTabGroup->TabIdFromIndex(aIndex );
+	iDialog->SetCurrentProfile(profileId);
+	iDialog->UpdateTabsL();
+	iDialog->UpdateListBoxL();
+	}
+
+#endif
+
+
+
+
+/*******************************************************************************
+ * class CStatusPaneHandler
+ *******************************************************************************/
+
+// -----------------------------------------------------------------------------
+// CStatusPaneHandler::NewL
+//
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CStatusPaneHandler* CStatusPaneHandler::NewL(CAknAppUi* aAppUi)
+    {
+    CStatusPaneHandler* self = new (ELeave) CStatusPaneHandler(aAppUi);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CStatusPaneHandler::~CStatusPaneHandler()
+    {
+	TRAP_IGNORE(RestoreOriginalTitleL());
+	TRAP_IGNORE(RestoreOriginalImageL());
+	
+	delete iNaviPaneHandler;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CStatusPaneHandler::ConstructL
+//
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::ConstructL(void)
+    {
+    iNaviPaneHandler = new (ELeave) CAspNaviPaneHandler(iAppUi->StatusPane());
+    }
+
+
+// -----------------------------------------------------------------------------
+// CStatusPaneHandler::CStatusPaneHandler
+//
+// -----------------------------------------------------------------------------
+//
+CStatusPaneHandler::CStatusPaneHandler(CAknAppUi* aAppUi) : iAppUi(aAppUi)
+	{
+	__ASSERT_ALWAYS(iAppUi, TUtil::Panic(KErrGeneral));
+
+	iOriginalTitleStored = EFalse;
+	iOriginalTitle = KNullDesC;
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::GetTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+TBool CStatusPaneHandler::GetTitleL(CAknAppUi* aAppUi, TDes& aTitle)
+	{
+	aTitle = KNullDesC;
+
+	CEikStatusPane* statusPane = aAppUi->StatusPane();
+    if (statusPane && statusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)).IsPresent())
+		{
+        CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
+            (statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle)));
+        if (titlePane->Text()) 
+			{
+		    TUtil::StrCopy(aTitle, *titlePane->Text());
+			return ETrue;
+    		}
+		}
+
+	return EFalse;
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+TBool CStatusPaneHandler::SetTitleL(CAknAppUi* aAppUi, const TDesC& aTitle)
+	{
+	CEikStatusPane* statusPane = aAppUi->StatusPane();
+    if (statusPane && statusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)).IsPresent())
+		{
+        CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
+            (statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle)));
+        if (titlePane->Text()) 
+			{
+	   		titlePane->SetTextL(aTitle);
+			return ETrue;
+			}
+		}
+	return EFalse;
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetNaviPaneTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::SetNaviPaneTitleL(const TDesC& aTitle)
+	{
+	iNaviPaneHandler->SetNaviPaneTitleL(aTitle);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetNaviPaneTitle
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::SetNaviPaneTitle(const TDesC& aTitle)
+	{
+	TRAP_IGNORE(iNaviPaneHandler->SetNaviPaneTitleL(aTitle));
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetNaviPaneTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::SetNaviPaneTitleL(TInt aResource)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(aResource);
+    SetNaviPaneTitleL(hBuf->Des());
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::StoreNavipaneL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::StoreNavipaneL()
+	{
+	iNaviPaneHandler->StoreNavipaneL();
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::StoreOriginalTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::StoreOriginalTitleL()
+	{
+	TBool ret = GetTitleL(iAppUi, iOriginalTitle);
+	
+	if (ret)
+		{
+		iOriginalTitleStored = ETrue;
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::RestoreOriginalTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::RestoreOriginalTitleL()
+	{
+	if (iOriginalTitleStored)
+		{
+		SetTitleL(iAppUi, iOriginalTitle);
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::SetTitleL(const TDesC& aText)
+	{
+	if (iOriginalTitleStored)
+		{
+		SetTitleL(iAppUi, aText);
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetTitleL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::SetTitleL(TInt aResourceId)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(aResourceId);
+	SetTitleL(hBuf->Des());
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetNewImageL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::SetNewImageL(const TDesC& aFilename,TInt aMainId,TInt aMaskId)
+	{
+	__ASSERT_DEBUG(!iOriginalImage, TUtil::Panic(KErrGeneral)); // can set image only once
+
+	CEikImage* image = new (ELeave) CEikImage;
+	CleanupStack::PushL(image);
+	
+	image->CreatePictureFromFileL(aFilename, aMainId, aMaskId);
+
+	iOriginalImage = SetImageL(iAppUi, image);
+
+	if (iOriginalImage)
+		{
+        CleanupStack::Pop(image); // ownership transferred to context pane
+		return;
+		}
+
+	CleanupStack::PopAndDestroy(image);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::RestoreOriginalImageL
+// 
+// ----------------------------------------------------------------------------
+//
+void CStatusPaneHandler::RestoreOriginalImageL()
+	{
+	if (!iOriginalImage)
+		{
+		return; // image has not been replaced
+		}
+
+	CEikImage* image = NULL;
+	TRAPD(err, image = SetImageL(iAppUi, iOriginalImage));
+
+	if (err == KErrNone && image)
+		{
+		delete image; // delete our own image
+		}
+	else
+		{
+		delete iOriginalImage; // delete original image (could not restore it)
+		iOriginalImage = NULL;
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CStatusPaneHandler::SetImageL
+// 
+// ----------------------------------------------------------------------------
+//
+CEikImage* CStatusPaneHandler::SetImageL(CAknAppUi* aAppUi, CEikImage* aIcon)
+	{
+	CEikStatusPane* statusPane = aAppUi->StatusPane();
+    if (statusPane && statusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidContext)).IsPresent())
+		{
+        CAknContextPane* contextPane = static_cast<CAknContextPane*>
+            (statusPane->ControlL(TUid::Uid(EEikStatusPaneUidContext)));
+        if (contextPane) 
+			{
+	   		return contextPane->SwapPicture(aIcon);
+			}
+		}
+
+	return NULL;
+	}
+
+
+
+
+/*******************************************************************************
+ * class CAspSelectionItemList
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspSelectionItemList::Cleanup
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSelectionItemList::Cleanup(TAny* aObj)
+    {
+    CAspSelectionItemList* list = static_cast<CAspSelectionItemList*>(aObj);
+	list->ResetAndDestroy();
+	delete list;
+	list = NULL;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSelectionItemList::CAspSelectionItemList
+//
+// -----------------------------------------------------------------------------
+//
+CAspSelectionItemList::CAspSelectionItemList(TInt aGranularity) 
+: CSelectionItemList(aGranularity)
+	{
+	}
+
+
+
+/*******************************************************************************
+ * class CAspListItemData
+ *******************************************************************************/
+
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::NewLC
+// 
+//------------------------------------------------------------------------------
+//
+CAspListItemData* CAspListItemData::NewLC()
+	{
+	CAspListItemData* self = new (ELeave) CAspListItemData;
+	CleanupStack::PushL( self);
+	self->ConstructL();
+	return self;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::ConstructL
+//
+//------------------------------------------------------------------------------
+//
+void CAspListItemData::ConstructL()
+	{
+	Init();
+	
+    iHeader  = HBufC::NewL(0);
+	iDisplayValue = HBufC::NewL(0);
+	iValue = HBufC::NewL(0);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspListItemData::CAspListItemData
+// -----------------------------------------------------------------------------
+//
+CAspListItemData::CAspListItemData()
+	{
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+//
+//------------------------------------------------------------------------------
+//
+CAspListItemData::~CAspListItemData()
+	{
+	delete iHeader;
+	delete iDisplayValue;
+	delete iValue;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::Header
+//
+//------------------------------------------------------------------------------
+//
+const TDesC& CAspListItemData::Header()
+	{
+	__ASSERT_ALWAYS(iHeader, TUtil::Panic(KErrGeneral));
+	
+	return *iHeader;
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::SetHeaderL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspListItemData::SetHeaderL(const TDesC& aText)
+	{
+	delete iHeader;
+	iHeader = NULL;
+	iHeader = aText.AllocL();
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::SetHeaderL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspListItemData::SetHeaderL(TInt aResourceId)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(aResourceId);
+    SetHeaderL(hBuf->Des());
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::Value
+// 
+//------------------------------------------------------------------------------
+//
+const TDesC& CAspListItemData::Value()
+	{
+	__ASSERT_ALWAYS(iValue, TUtil::Panic(KErrGeneral));
+	
+	return *iValue;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::SetValue
+// 
+//------------------------------------------------------------------------------
+//
+void CAspListItemData::SetValueL(const TDesC& aText)
+	{
+    delete iValue;
+    iValue = NULL;
+	iValue = aText.AllocL();
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::SetValueL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspListItemData::SetValueL(TInt aNumber)
+	{
+	TBuf<KBufSize32> buf;
+	buf.Num(aNumber);
+	SetValueL(buf);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::SetDisplayValue
+// 
+//------------------------------------------------------------------------------
+//
+void CAspListItemData::SetDisplayValueL(const TDesC& aText)
+	{
+	delete iDisplayValue;
+	iDisplayValue = NULL;
+	iDisplayValue = aText.AllocL();
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::SetDisplayValue
+// 
+//------------------------------------------------------------------------------
+//
+void CAspListItemData::SetDisplayValueL(TInt aResource)
+	{
+	delete iDisplayValue;
+	iDisplayValue = NULL;
+	
+	iDisplayValue = StringLoader::LoadL(aResource);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::IsEmpty
+// 
+//------------------------------------------------------------------------------
+//
+TBool CAspListItemData::IsEmpty()
+	{
+	if (!iValue)
+		{
+		return ETrue;
+		}
+		
+	if (TUtil::IsEmpty(iValue->Des()))
+		{
+		return ETrue;
+		}
+		
+	return EFalse;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::ListItemTextL
+//
+// Constructs header and value suitable for listbox.
+// List item syntax:
+// "\t<header>\t\t<value>\t<mandatorychar>\t\t<readonlyicon>"
+//------------------------------------------------------------------------------
+//
+HBufC* CAspListItemData::ListItemTextL(TBool aConvert)
+	{
+	_LIT(KTab, "\t");
+	_LIT(KMandatoryChar, "*");
+	_LIT(KReadOnlyIconIndex, "0");
+	
+	HBufC* hBuf = HBufC::NewL(KBufSize255);
+	TPtr ptr = hBuf->Des();
+	
+	ptr.Append(KTab);
+	ptr.Append(iHeader->Des());
+	ptr.Append(KTab);
+	ptr.Append(KTab);
+	                                              //"PC Suite" string in Host address field and server id should be displayed as chinese
+	if (IsEmpty() || iItemType == ETypeSecret || (TDialogUtil::IsPCSuiteDesC(iValue->Des()) && (iItemId == EAspHostAddress || iItemId == EAspServerId)))
+		{
+		ptr.Append(iDisplayValue->Des());
+		}
+	else
+		{
+		ptr.Append(iValue->Des());
+		}
+
+	ptr.Append(KTab);
+	
+	if (iMandatory)
+		{
+		ptr.Append(KMandatoryChar);
+		}
+	
+	ptr.Append(KTab);
+	ptr.Append(KTab);
+	
+	if (iHidden == EVisibilityReadOnly)
+		{
+		ptr.Append(KReadOnlyIconIndex);
+		}
+
+	if (aConvert)
+		{
+		AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
+		}
+
+	return hBuf;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspListItemData::Init
+// 
+//------------------------------------------------------------------------------
+//
+void CAspListItemData::Init()
+	{
+	iNumberData = KErrNotFound;
+	iDate = 0;
+	iTime = 0;
+	
+	iItemType = KErrNotFound;
+	iHidden = EVisibilityNormal;
+	iMaxLength = KBufSize;
+	iResource = KErrNotFound;
+	iIndex = KErrNotFound;
+	iItemId = KErrNotFound;
+	
+	iMandatory = EFalse;
+	iLatinInput = EFalse;
+	
+	iMinValue = KErrNotFound;
+	iMaxValue = KErrNotFound;
+	
+	//iFilter = 0;
+	iSelectKeyPressed = EFalse;
+	
+	iValue = NULL;
+	iDisplayValue = NULL;
+	iHeader = NULL;
+    }
+
+
+		
+/*******************************************************************************
+ * class CAspRadioButtonSettingPageEditor
+ *******************************************************************************/
+
+
+//------------------------------------------------------------------------------
+// CAspRadioButtonSettingPageEditor::CAspRadioButtonSettingPage
+// 
+//------------------------------------------------------------------------------
+//
+CAspRadioButtonSettingPageEditor::CAspRadioButtonSettingPageEditor(TInt aResourceID,
+                            TInt& aCurrentSelectionIndex,
+                            const MDesCArray* aItemArray
+                            )
+                            
+ : CAknRadioButtonSettingPage(aResourceID, aCurrentSelectionIndex, aItemArray)
+	{
+	}
+	
+	
+// ----------------------------------------------------------------------------
+// CAspRadioButtonSettingPageEditor::OfferKeyEventL
+//
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspRadioButtonSettingPageEditor::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
+                                                 TEventCode aType)
+    {
+		    if(EKeyEnter == aKeyEvent.iCode)
+		    {
+		    	ProcessCommandL(EAknSoftkeyOk);
+		    	return EKeyWasConsumed;
+		    }
+		    return CAknRadioButtonSettingPage::OfferKeyEventL(aKeyEvent, aType);
+    }
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspRadioButtonSettingPageEditor::~CAspRadioButtonSettingPageEditor()
+	{
+	}
+
+		
+/*******************************************************************************
+ * class CAspTextSettingPageEditor
+ *******************************************************************************/
+
+
+//------------------------------------------------------------------------------
+// CAspTextSettingPageEditor::CAspTextSettingPageEditor
+// 
+//------------------------------------------------------------------------------
+//
+CAspTextSettingPageEditor::CAspTextSettingPageEditor(TInt aResourceID, 
+                                                     TDes& aText, 
+                                                     TInt aTextSettingPageFlags)                      
+ : CAknTextSettingPage(aResourceID, aText, aTextSettingPageFlags)
+	{
+	}
+	
+	
+// ----------------------------------------------------------------------------
+// CAspTextSettingPageEditor::OfferKeyEventL
+//
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspTextSettingPageEditor::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
+                                                 TEventCode aType)
+    {
+		    if(EKeyEnter == aKeyEvent.iCode)
+		    {
+		    	ProcessCommandL(EAknSoftkeyOk);
+		    	return EKeyWasConsumed;
+		    }
+		    return CAknTextSettingPage::OfferKeyEventL(aKeyEvent, aType);
+    }
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspTextSettingPageEditor::~CAspTextSettingPageEditor()
+	{
+	}
+
+		
+/*******************************************************************************
+ * class CAspAlphaPasswordSettingPageEditor
+ *******************************************************************************/
+
+
+//------------------------------------------------------------------------------
+// CAspAlphaPasswordSettingPageEditor::CAspAlphaPasswordSettingPageEditor
+// 
+//------------------------------------------------------------------------------
+//
+CAspAlphaPasswordSettingPageEditor::CAspAlphaPasswordSettingPageEditor(TInt aResourceID, 
+                                                     TDes& aNewPassword, 
+                                                     const TDesC& aOldPassword)                      
+ : CAknAlphaPasswordSettingPage(aResourceID,aNewPassword,aOldPassword)
+	{
+	}
+	
+	
+// ----------------------------------------------------------------------------
+// CAspAlphaPasswordSettingPageEditor::OfferKeyEventL
+//
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspAlphaPasswordSettingPageEditor::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
+                                                 TEventCode aType)
+    {
+		    if(EKeyEnter == aKeyEvent.iCode)
+		    {
+		    	ProcessCommandL(EAknSoftkeyOk);
+		    	return EKeyWasConsumed;
+		    }
+		    return CAknAlphaPasswordSettingPage::OfferKeyEventL(aKeyEvent, aType);
+    }
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspAlphaPasswordSettingPageEditor::~CAspAlphaPasswordSettingPageEditor()
+	{
+	}
+
+/*******************************************************************************
+ * class CAspIntegerSettingPageEditor
+ *******************************************************************************/
+
+
+//------------------------------------------------------------------------------
+// CAspIntegerSettingPageEditor::CAspIntegerSettingPageEditor
+// 
+//------------------------------------------------------------------------------
+//
+CAspIntegerSettingPageEditor::CAspIntegerSettingPageEditor(TInt aResourceID, 
+												TInt& aValue, 
+												TInt aTextSettingPageFlags)
+ : CAknIntegerSettingPage(aResourceID,aValue,aTextSettingPageFlags)
+	{
+	}
+	
+	
+// ----------------------------------------------------------------------------
+// CAspIntegerSettingPageEditor::OfferKeyEventL
+//
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspIntegerSettingPageEditor::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
+                                                 TEventCode aType)
+    {
+		    if(EKeyEnter == aKeyEvent.iCode)
+		    {
+		    	ProcessCommandL(EAknSoftkeyOk);
+		    	return EKeyWasConsumed;
+		    }
+		    return CAknIntegerSettingPage::OfferKeyEventL(aKeyEvent, aType);
+    }
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspIntegerSettingPageEditor::~CAspIntegerSettingPageEditor()
+	{
+	}
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspFilter.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,1322 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDES
+
+#include <SyncMLTransportProperties.h>
+
+
+#include "aspfilter.h"
+#include "aspprofile.h"
+#include "AspResHandler.h"
+#include "AspDialogUtil.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+/*******************************************************************************
+ * class CAspFilterList
+ *******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterList::NewL
+//
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CAspFilterList* CAspFilterList::NewL(const TAspParam& aParam, RPointerArray<CSyncMLFilter>& aArray)
+    {
+    CAspFilterList* self = new(ELeave) CAspFilterList(aParam, aArray);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterList::~CAspFilterList
+//
+// -----------------------------------------------------------------------------
+//
+CAspFilterList::~CAspFilterList()
+    {
+    iFilterList.ResetAndDestroy();
+    iFilterList.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterList::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterList::ConstructL()
+    {
+    InitFiltersL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterList::CAspFilterList
+//
+// -----------------------------------------------------------------------------
+//
+CAspFilterList::CAspFilterList(const TAspParam& aParam, RPointerArray<CSyncMLFilter>& aArray)
+	{
+	iApplicationId = aParam.iApplicationId;
+	//iAspTask = aParam.iSyncTask;
+	iArray = aArray;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterList::InitFiltersL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterList::InitFiltersL()
+	{
+	//TSyncMLFilterChangeInfo changeInfo = ESyncMLDefault;
+	//RPointerArray<CSyncMLFilter>& arr = iAspTask->Task().SupportedServerFiltersL(changeInfo);
+	
+	TInt count = iArray.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CSyncMLFilter* filter = iArray[i];
+		CAspFilter* aspFilter = CAspFilter::NewLC(filter, i);
+		iFilterList.AppendL(aspFilter);
+		CleanupStack::Pop(aspFilter);
+		}
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// CAspFilterList::Count
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspFilterList::Count()
+	{
+	return iFilterList.Count();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterList::FiltersEnabled
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspFilterList::FiltersEnabled()
+	{
+    TInt count = iFilterList.Count();
+    
+    for (TInt i=0; i<count; i++)
+    	{
+    	CAspFilter* filter = iFilterList[i];
+    	if (filter->Enabled())
+    		{
+    		return ETrue;
+    		}
+    	}
+    	
+    return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterList::SetFiltersEnabledL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterList::SetFiltersEnabledL(TBool aEnable)
+	{
+    TInt count = iFilterList.Count();
+    
+    for (TInt i=0; i<count; i++)
+    	{
+    	CAspFilter* filter = iFilterList[i];
+    	filter->SetEnabledL(aEnable);
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterList::SaveL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterList::SaveL()
+	{
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterList::Item
+// 
+// -----------------------------------------------------------------------------
+//
+CAspFilter* CAspFilterList::Item(TInt aIndex)
+	{
+	if (aIndex < 0 || aIndex >= iFilterList.Count())
+	    {
+		TUtil::Panic(KErrArgument);
+	    }
+
+	return iFilterList[aIndex];
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspFilterList::ItemForIdL
+// 
+// -----------------------------------------------------------------------------
+//
+CAspFilter* CAspFilterList::ItemForId(TInt aId)
+	{
+    TInt count = iFilterList.Count();
+    
+    for (TInt i=0; i<count; i++)
+    	{
+    	CAspFilter* filter = iFilterList[i];
+    	if (filter->Id() == aId)
+    		{
+    		return filter;
+    		}
+    	}
+	
+	return NULL;
+	}
+
+
+
+
+
+/*******************************************************************************
+ * class CAspFilter
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::NewLC
+//
+// -----------------------------------------------------------------------------
+//
+CAspFilter* CAspFilter::NewLC(CSyncMLFilter* aSyncFilter, TInt aId)
+    {
+    CAspFilter* self = new(ELeave) CAspFilter(aSyncFilter, aId);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::~CAspFilter
+//
+// -----------------------------------------------------------------------------
+//
+CAspFilter::~CAspFilter()
+    {
+    iFilterItemList.ResetAndDestroy();
+    iFilterItemList.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::ConstructL
+//
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CAspFilter::ConstructL()
+    {
+    InitFilterItemsL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::CAspFilter
+//
+// -----------------------------------------------------------------------------
+//
+CAspFilter::CAspFilter(CSyncMLFilter* aSyncFilter, TInt aId)
+	{
+	iId = KFilterBaseId + aId;
+	iSyncFilter = aSyncFilter;
+	
+    __ASSERT_ALWAYS(iSyncFilter, TUtil::Panic(KErrGeneral));		
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspFilter::SaveL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilter::SaveL()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::InitFilterItemsL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilter::InitFilterItemsL()
+	{
+	RPointerArray<CSyncMLFilterProperty>& arr = iSyncFilter->FilterProperties();
+	
+	TInt count = arr.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CSyncMLFilterProperty* property = arr[i];
+		CAspFilterItem* item = CAspFilterItem::NewLC(property, i);
+		iFilterItemList.AppendL(item);
+		CleanupStack::Pop(item);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::DisplayName
+// 
+// -----------------------------------------------------------------------------
+//
+const TDesC& CAspFilter::DisplayName()
+	{
+	return iSyncFilter->DisplayName();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::GetDisplayValueL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspFilter::GetDisplayValueL(TDes& aText)
+	{
+	aText = KNullDesC;
+	
+	if (!Enabled())
+		{
+		CAspResHandler::ReadL(aText, R_ASP_NOT_DEFINED);
+		}
+	else if (iFilterItemList.Count() == 1)
+		{
+	    CAspFilterItem* item = iFilterItemList[0];
+	    item->GetDisplayValueL(aText);
+		}
+	else if (iFilterItemList.Count() > 1)
+		{
+		CAspResHandler::ReadL(aText, R_ASP_MULTIPLE_SELECTION);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::Id
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspFilter::Id()
+	{
+	return iId;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::ItemCount
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspFilter::ItemCount()
+	{
+	return iFilterItemList.Count();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::Item
+// 
+// -----------------------------------------------------------------------------
+//
+CAspFilterItem* CAspFilter::Item(TInt aIndex)
+	{
+	if (aIndex < 0 || aIndex >= ItemCount())
+	    {
+		TUtil::Panic(KErrArgument);
+	    }
+
+	return iFilterItemList[aIndex];
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::ItemForIdL
+// 
+// -----------------------------------------------------------------------------
+//
+CAspFilterItem* CAspFilter::ItemForId(TInt aId)
+	{
+    TInt count = ItemCount();
+    
+    for (TInt i=0; i<count; i++)
+    	{
+    	CAspFilterItem* item = Item(i);
+    	if (item->Id() == aId)
+    		{
+    		return item;
+    		}
+    	}
+	
+	return NULL;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::Enabled
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspFilter::Enabled()
+	{
+	return iSyncFilter->Enabled();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilter::SetEnabledL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspFilter::SetEnabledL(TBool aEnable)
+	{
+	iSyncFilter->SetEnabledL(aEnable);
+	}
+
+
+
+	
+
+	
+	
+/*******************************************************************************
+ * class CAspFilterItem
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::NewLC
+//
+// -----------------------------------------------------------------------------
+//
+CAspFilterItem* CAspFilterItem::NewLC(CSyncMLFilterProperty* aProperty, TInt aId)
+    {
+    CAspFilterItem* self = new(ELeave) CAspFilterItem(aProperty, aId);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspFilterItem* CAspFilterItem::NewL(CSyncMLFilterProperty* aProperty, TInt aId)
+    {
+    CAspFilterItem* self = new(ELeave) CAspFilterItem(aProperty, aId);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::~CAspFilterItem
+//
+// -----------------------------------------------------------------------------
+//
+CAspFilterItem::~CAspFilterItem()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::ConstructL()
+    {
+    InitListTypeL();
+    InitDataTypeL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::CAspFilterItem
+// -----------------------------------------------------------------------------
+//
+CAspFilterItem::CAspFilterItem(CSyncMLFilterProperty* aProperty, TInt aId)
+	{
+	iId = aId + KFilterItemBaseId;
+	iProperty = aProperty;
+	
+	__ASSERT_ALWAYS(iProperty, TUtil::Panic(KErrGeneral));
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::ListType
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspFilterItem::ListType()
+	{
+	return iListType;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::DataType
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspFilterItem::DataType()
+	{
+	return iDataType;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::InitListType
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::InitListTypeL()
+	{
+	TInt defaultValueCount = iProperty->DefaultValueCount();
+	TBool querySupported = iProperty->CanUseQueryValue();
+	TBool multiSelectionSupported = iProperty->SupportsMultipleSelection(); 
+
+    if (defaultValueCount == 0 && querySupported)
+    	{
+    	iListType = ETypeQuery;
+    	}
+    else if (defaultValueCount > 0 && !querySupported && !multiSelectionSupported)
+    	{
+    	iListType = ETypeSingleSelection;
+    	}
+    else if (defaultValueCount > 0 && querySupported && !multiSelectionSupported)
+    	{
+    	iListType = ETypeSingleSelectionUserDefined;
+    	}
+    else if (defaultValueCount > 0 && !querySupported && multiSelectionSupported)
+    	{
+    	iListType = ETypeMultipleSelection;
+    	}
+    else if (defaultValueCount > 0 && querySupported && multiSelectionSupported)
+    	{
+    	iListType = ETypeMultipleSelectionUserDefined;
+    	}
+    else
+    	{
+    	User::Leave(KErrNotSupported);
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::InitDataType
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::InitDataTypeL()
+	{
+	if (!iProperty->CanUseQueryValue())
+		{
+		iDataType = CAspListItemData::ETypeList;
+		return;
+		}
+		
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+		
+    switch (type)
+    	{
+    	case ESyncMLDataTypeBool:
+    	    iDataType = CAspListItemData::ETypeBoolean;
+    	    break;
+    	case ESyncMLDataTypeNumber:
+    	    iDataType = CAspListItemData::ETypeNumber;
+    	    break;
+    	case ESyncMLDataTypeDate:
+    	    iDataType = CAspListItemData::ETypeDate;
+    	    break;
+    	case ESyncMLDataTypeTime:
+    	    iDataType = CAspListItemData::ETypeTime;
+    	    break;
+    	case ESyncMLDataTypeText8:
+    	    iDataType = CAspListItemData::ETypeText;
+    	    break;
+    	case ESyncMLDataTypeText16:
+    	    iDataType = CAspListItemData::ETypeText;
+    	    break;
+
+    	default:
+    	    User::Leave(KErrNotSupported);
+    	    break;
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::DisplayName
+// 
+// -----------------------------------------------------------------------------
+//
+const TDesC& CAspFilterItem::DisplayName()
+	{
+	return iProperty->DisplayName();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::DisplayValueL
+// 
+// -----------------------------------------------------------------------------
+//
+const TDesC& CAspFilterItem::DisplayValueL()
+	{
+	GetDisplayValueL(iDisplayValueBuf);
+	return iDisplayValueBuf;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::GetDisplayValueL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::GetDisplayValueL(TDes& aText)
+	{
+	aText = KNullDesC;
+	
+	if (ListType() == ETypeQuery)
+		{
+		GetQueryValueTextL(aText);
+		}
+	else if (SelectionAndQueryCount() > 1)
+		{
+		CAspResHandler::ReadL(aText, R_ASP_MULTIPLE_SELECTION);
+		}
+	else if (SelectionAndQueryCount() == 1)
+		{
+		if (QueryValueSelected())
+			{
+			GetQueryValueTextL(aText);
+			}
+		else
+			{
+			GetListValueTextL(aText);
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::GetQueryValueTextL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::GetQueryValueTextL(TDes& aText)
+	{
+	aText = KNullDesC;
+	
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+		
+	switch (type)
+		{
+		case ESyncMLDataTypeText16:
+	    	GetText(aText);
+		    break;
+
+		case ESyncMLDataTypeText8:
+		    GetText(aText);
+		    break;
+		    
+		case ESyncMLDataTypeNumber:
+		    aText.Num(iProperty->QueryValueIntL());
+    	    break;
+
+		case ESyncMLDataTypeBool:
+			{
+		    CDesCArray* stringData = CAspResHandler::ReadDesArrayStaticLC(R_ASP_FILTER_ITEM_YESNO);
+		    if (iProperty->QueryValueBoolL())
+		    	{
+		    	aText = (*stringData)[1];
+		    	}
+		    else
+		    	{
+		    	aText = (*stringData)[0];
+		    	}
+		    CleanupStack::PopAndDestroy(stringData);
+		    break;
+			}
+		
+		case ESyncMLDataTypeDate:
+		    TUtil::GetDateTextL(aText, iProperty->QueryValueDateL());
+		    break;
+		    
+		case ESyncMLDataTypeTime:
+		    TUtil::GetTimeTextL(aText, iProperty->QueryValueTimeL());
+		    break;
+
+		default:
+		    break;
+	
+		}
+		
+
+	if (TUtil::IsEmpty(aText))
+		{
+		CAspResHandler::ReadL(aText, R_ASP_SETTING_VALUE_NONE);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::SetQueryValueTextL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::SetQueryValueTextL(const TDesC& aText)
+	{
+	TInt num = 0;
+	
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+		
+	switch (type)
+		{
+		case ESyncMLDataTypeText16:
+	    	iProperty->SetQueryValueText16L(aText);
+		    break;
+
+		case ESyncMLDataTypeText8:
+		    TUtil::StrCopy(iBuf8, aText);
+	    	iProperty->SetQueryValueText8L(iBuf8);
+		    break;
+		    
+		case ESyncMLDataTypeNumber:
+    	    User::LeaveIfError(TUtil::StrToInt(aText, num));
+		    iProperty->SetQueryValueIntL(num);
+    	    break;
+
+		case ESyncMLDataTypeBool:
+		    User::LeaveIfError(TUtil::StrToInt(aText, num));
+		    if (num)
+		    	{
+		    	iProperty->SetQueryValueBoolL(ETrue);
+		    	}
+		    else
+		    	{
+		    	iProperty->SetQueryValueBoolL(EFalse);
+		    	}
+    	    break;
+
+		case ESyncMLDataTypeDate:
+    	    User::LeaveIfError(TUtil::StrToInt(aText, num));
+		    iProperty->SetQueryValueDateL(num);
+    	    break;
+
+		case ESyncMLDataTypeTime:
+    	    User::LeaveIfError(TUtil::StrToInt(aText, num));
+		    iProperty->SetQueryValueTimeL(num);
+    	    break;
+
+		default:
+		    break;
+	
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::GetListValueTextL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::GetListValueTextL(TDes& aText)
+	{
+	aText = KNullDesC;
+	TInt index = SelectionIndex();
+	if (index == KErrNotFound)
+		{
+		CAspResHandler::ReadL(aText, R_ASP_SETTING_VALUE_NONE);
+		return; // list does not have one item selected
+		}
+		
+	GetListValueTextL(aText, index);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::GetListValueTextL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::GetListValueTextL(TDes& aText, TInt aIndex)
+	{
+	aText = KNullDesC;
+	
+	if (aIndex < 0 || aIndex >= iProperty->DefaultValueCount())
+		{
+		TUtil::Panic(KErrArgument);
+		}
+		
+	TSyncMLFilterPropertyDataType type = iProperty->DefaultValueDataType();
+		
+	switch (type)
+		{
+		case ESyncMLDataTypeText16:
+	    	TUtil::StrCopy(aText, iProperty->DefaultValueText16L(aIndex));
+		    break;
+
+		case ESyncMLDataTypeText8:
+	    	TUtil::StrCopy(aText, iProperty->DefaultValueText8L(aIndex));
+		    break;
+		    
+		case ESyncMLDataTypeNumber:
+		    aText.Num(iProperty->DefaultValueIntL(aIndex));
+    	    break;
+
+		case ESyncMLDataTypeBool:
+			{
+			CDesCArray* stringData = CAspResHandler::ReadDesArrayStaticLC(R_ASP_FILTER_ITEM_YESNO);
+		    if (iProperty->DefaultValueBoolL(aIndex))
+		    	{
+		    	aText = (*stringData)[1];
+		    	}
+		    else
+		    	{
+		    	aText = (*stringData)[0];
+		    	}
+		    CleanupStack::PopAndDestroy(stringData);
+		    break;
+			}
+		
+		case ESyncMLDataTypeDate:
+		    TUtil::GetDateTextL(aText, iProperty->DefaultValueDateL(aIndex));
+		    break;
+		    
+		case ESyncMLDataTypeTime:
+		    TUtil::GetTimeTextL(aText, iProperty->DefaultValueTimeL(aIndex));
+		    break;
+
+		default:
+		    break;
+	
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::SelectionCount
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspFilterItem::SelectionCount()
+	{
+	TInt count = 0;
+	TInt defaultValueCount = iProperty->DefaultValueCount();
+	
+	for (TInt i=0; i<defaultValueCount; i++)
+		{
+		if (iProperty->IsDefaultValueSelected(i))
+			{
+			count++;
+			}
+		}
+
+   	return count;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::SelectionAndQueryCount
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspFilterItem::SelectionAndQueryCount()
+	{
+	TInt count = SelectionCount();
+
+	if (QueryValueSelected())
+		{
+		count++;
+		}
+   		
+   	return count;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::SelectionIndex
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspFilterItem::SelectionIndex()
+	{
+	if (SelectionCount() != 1)
+		{
+		return KErrNotFound;
+		}
+	if (QueryValueSelected())
+		{
+		return KErrNotFound;
+		}
+		
+	TInt count = iProperty->DefaultValueCount();
+	
+	for (TInt i=0; i<count; i++)
+		{
+		if (iProperty->IsDefaultValueSelected(i))
+			{
+			return i;
+			}
+		}
+		
+	return KErrNotFound;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::QueryValueSelected
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspFilterItem::QueryValueSelected()
+	{
+	if (iProperty->DefaultValueCount() > 0 && iProperty->CanUseQueryValue())
+		{
+    	if (iProperty->IsQueryValueSelected())
+			{
+			return ETrue;
+        	}
+		}
+	
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::Id
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspFilterItem::Id()
+	{
+	return iId;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::IsMandatory
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspFilterItem::IsMandatory()
+	{
+	if (iListType == ETypeMultipleSelection || iListType == ETypeMultipleSelectionUserDefined)
+		{
+		if (!iProperty->SupportsEmptySelection())
+			{
+			return ETrue;
+			}
+		}
+		
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::MaxLength
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspFilterItem::MaxLength()
+	{
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+    if (type != ESyncMLDataTypeText8 && type != ESyncMLDataTypeText16)
+    	{
+    	return 0;
+    	}
+    
+   return iProperty->MaxTextLength();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::GetSelectionL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::GetSelectionL(CSelectionItemList* aList)
+	{
+	__ASSERT_ALWAYS(aList, TUtil::Panic(KErrGeneral));
+	
+	TBuf<KBufSize> buf;
+	
+	TInt count = iProperty->DefaultValueCount();
+	for (TInt i=0; i<count; i++)
+		{
+		TBool selected = iProperty->IsDefaultValueSelected(i);
+		GetListValueTextL(buf, i);
+     	
+		CSelectableItem* item = new (ELeave) CSelectableItem(buf, selected);
+   	    CleanupStack::PushL(item);
+	    item->ConstructL();
+	    aList->AppendL(item);
+	    CleanupStack::Pop(item);
+    	}
+    	
+    AddQueryValueL(aList);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::SetSelectionL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::SetSelectionL(CSelectionItemList* aList)
+	{
+	TInt count = aList->Count();
+	TInt defaultValuecount = iProperty->DefaultValueCount();
+	
+	__ASSERT_ALWAYS(count >= defaultValuecount, TUtil::Panic(KErrGeneral));
+	
+	for (TInt i=0; i<defaultValuecount; i++)
+		{
+		TBool selected = (*aList)[i]->SelectionStatus();
+		if (selected)
+			{
+			iProperty->SelectDefaultValueL(i);
+			}
+		else
+			{
+			iProperty->UnselectDefaultValueL(i);
+			}
+     	}
+    	
+    UpdateQueryValueL(aList);
+    
+    CheckEmptySelectionL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::CheckEmptySelectionL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::CheckEmptySelectionL()
+	{	
+	if (iListType != ETypeMultipleSelection && iListType != ETypeMultipleSelectionUserDefined)
+		{
+		return;
+		}
+	
+	if (SelectionAndQueryCount() == 0 && !iProperty->SupportsEmptySelection())
+		{
+		if (iProperty->DefaultValueCount() > 0)
+			{
+			iProperty->SelectDefaultValueL(0);
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::UpdateQueryValueL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::UpdateQueryValueL(CSelectionItemList* aList)
+	{	
+	if (iListType != ETypeSingleSelectionUserDefined && iListType != ETypeMultipleSelectionUserDefined)
+		{
+		return;
+		}
+	
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	if (type != ESyncMLDataTypeNumber && type != ESyncMLDataTypeText16 && type != ESyncMLDataTypeText8)
+		{
+		return; // "User defined" list only supports number and text
+		}
+	
+	
+	TInt count = aList->Count();
+	TInt defaultValueCount = iProperty->DefaultValueCount();
+	
+	__ASSERT_ALWAYS(count == defaultValueCount+1, TUtil::Panic(KErrGeneral));
+	
+		
+	CSelectableItem* item = (*aList)[count-1];
+	
+	SetQueryValueTextL(item->ItemText());
+		
+	if (!item->SelectionStatus())
+		{
+		iProperty->UnselectQueryValueL();
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::AddQueryValueL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::AddQueryValueL(CSelectionItemList* aList)
+	{	
+	if (iListType != ETypeSingleSelectionUserDefined && iListType != ETypeMultipleSelectionUserDefined)
+		{
+		return;
+		}
+		
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	if (type != ESyncMLDataTypeNumber && type != ESyncMLDataTypeText16 && type != ESyncMLDataTypeText8)
+		{
+		return; // "User defined" list only supports number and text
+		}
+
+
+	
+	TBuf<KBufSize> buf;
+	TBool selected = iProperty->IsQueryValueSelected();
+	GetQueryValueTextL(buf);
+
+	CSelectableItem* item = new (ELeave) CSelectableItem(buf, selected);
+   	CleanupStack::PushL(item);
+	item->ConstructL();
+	aList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::GetTextL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::GetTextL(TDes& aText)
+	{
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	
+	__ASSERT_DEBUG(type==ESyncMLDataTypeText8 || type==ESyncMLDataTypeText16, TUtil::Panic(KErrGeneral));
+	
+	if (type == ESyncMLDataTypeText8)
+		{
+		TUtil::StrCopy(aText, iProperty->QueryValueText8L());
+		}
+	else
+		{
+	    TUtil::StrCopy(aText, iProperty->QueryValueText16L());
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::GetText
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::GetText(TDes& aText)
+	{
+	TRAPD(err, GetTextL(aText));
+	
+	if (err != KErrNone)
+		{
+		aText = KNullDesC;
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::SetTextL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::SetTextL(const TDesC& aText)
+	{
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	
+	__ASSERT_DEBUG(type==ESyncMLDataTypeText8 || type==ESyncMLDataTypeText16, TUtil::Panic(KErrGeneral));
+	
+	if (type == ESyncMLDataTypeText8)
+		{
+	    TUtil::StrCopy(iBuf8, aText);
+    	iProperty->SetQueryValueText8L(iBuf8);
+		}
+	else
+		{
+		iProperty->SetQueryValueText16L(aText);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::BoolL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspFilterItem::BoolL()
+	{
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	
+	__ASSERT_DEBUG(type==ESyncMLDataTypeBool, TUtil::Panic(KErrGeneral));
+	
+	return iProperty->QueryValueBoolL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::SetBoolL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::SetBoolL(TBool aBool)
+	{
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	
+	__ASSERT_DEBUG(type==ESyncMLDataTypeBool, TUtil::Panic(KErrGeneral));
+	
+	iProperty->SetQueryValueBoolL(aBool);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::IntL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspFilterItem::IntL()
+	{
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	
+	__ASSERT_DEBUG(type==ESyncMLDataTypeNumber, TUtil::Panic(KErrGeneral));
+	
+	return iProperty->QueryValueIntL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::SetIntL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::SetIntL(TInt aInt)
+	{
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	
+	__ASSERT_DEBUG(type==ESyncMLDataTypeNumber, TUtil::Panic(KErrGeneral));
+	
+	iProperty->SetQueryValueIntL(aInt);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::DateL
+//
+// -----------------------------------------------------------------------------
+//
+TTime CAspFilterItem::DateL()
+	{
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	
+	__ASSERT_DEBUG(type==ESyncMLDataTypeDate, TUtil::Panic(KErrGeneral));
+	
+	return iProperty->QueryValueDateL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::SetDateL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::SetDateL(TTime aTime)
+	{
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	
+	__ASSERT_DEBUG(type==ESyncMLDataTypeDate, TUtil::Panic(KErrGeneral));
+	
+	return iProperty->SetQueryValueDateL(aTime);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::TimeL
+//
+// -----------------------------------------------------------------------------
+//
+TTime CAspFilterItem::TimeL()
+	{
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	
+	__ASSERT_DEBUG(type==ESyncMLDataTypeTime, TUtil::Panic(KErrGeneral));
+	
+	return iProperty->QueryValueTimeL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterItem::SetTimeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterItem::SetTimeL(TTime aTime)
+	{
+	TSyncMLFilterPropertyDataType type = iProperty->QueryValueDataType();
+	
+	__ASSERT_DEBUG(type==ESyncMLDataTypeTime, TUtil::Panic(KErrGeneral));
+	
+	return iProperty->SetQueryValueTimeL(aTime);
+	}
+
+
+
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspFilterDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,1643 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "AspFilterDialog.h"
+#include "AspFilter.h"
+#include "AspUtil.h"
+#include "AspDefines.h"
+#include "AspDialogUtil.h"
+#include "AspResHandler.h"
+#include "AspSyncUtil.rh"
+#include "AspDebug.h"
+
+#include <AknRadioButtonSettingPage.h>  // CAknRadioButtonSettingPage
+#include <AknCheckBoxSettingPage.h>  // CAknRadioButtonSettingPage
+#include <AknTextSettingPage.h>         // for CAknIntegerSettingPage
+
+//#include "ds.hlp.hrh"  // help text ids
+
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+/*******************************************************************************
+ * class CAspMultiChoiceListSettingPage
+ *******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+TBool CAspFilterDialog::ShowDialogL(TAspParam& aParam)
+	{
+	CAspFilterDialog* dialog = CAspFilterDialog::NewL(aParam);
+
+	TBool ret = dialog->ExecuteLD(R_ASP_FILTER_DIALOG);
+
+    return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterDialog::NewL
+//
+// -----------------------------------------------------------------------------
+CAspFilterDialog* CAspFilterDialog::NewL(TAspParam& aParam)
+    {
+    CAspFilterDialog* self = new (ELeave) CAspFilterDialog(aParam);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return( self );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::CAspFilterDialog
+//
+//------------------------------------------------------------------------------
+//
+CAspFilterDialog::CAspFilterDialog(TAspParam& aParam)
+	{
+	iApplicationId = aParam.iApplicationId;
+	iDialogParam = &aParam;
+	iFilter = aParam.iSyncFilter;
+	
+    __ASSERT_ALWAYS(iFilter, TUtil::Panic(KErrGeneral));	
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+//
+//------------------------------------------------------------------------------
+//
+CAspFilterDialog::~CAspFilterDialog()
+	{
+	if (iSettingList)
+		{
+		iSettingList->ResetAndDestroy();
+	    delete iSettingList;
+		}
+
+	delete iStatusPaneHandler;
+	delete iResHandler;
+	
+	if (iAvkonAppUi)
+		{
+		iAvkonAppUi->RemoveFromStack(this);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspFilterDialog::ConstructL()
+    {
+	CAknDialog::ConstructL(R_ASP_FILTER_DIALOG_MENU);
+	
+	iResHandler = CAspResHandler::NewL();
+    iSettingList = new (ELeave) CArrayPtrFlat<CAspListItemData>(10);
+	
+	// get previous title so it can be restored
+	iStatusPaneHandler = CStatusPaneHandler::NewL(iAvkonAppUi);
+	iStatusPaneHandler->StoreOriginalTitleL();
+    } 
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::ActivateL (from CCoeControl)
+//
+// Called by system when dialog is activated
+//------------------------------------------------------------------------------
+//
+void CAspFilterDialog::ActivateL()
+	{
+    CAknDialog::ActivateL();
+
+	// this cannot be in ConstructL which is executed before dialog is launched
+	iAvkonAppUi->AddToStackL(this);
+    }
+
+
+//-----------------------------------------------------------------------------
+// CAspFilterDialog::HandleOKL
+//
+// Handle content parameter editing.
+//-----------------------------------------------------------------------------
+//
+void CAspFilterDialog::HandleOKL()
+	{
+	CAspListItemData* item = ItemForIndex(ListBox()->CurrentItemIndex());
+	item->iFilter = iFilter;
+
+	if (EditSettingItemL(*item))
+		{
+		SetVisibility();
+		UpdateListBoxL(ListBox(), iSettingList);
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::ProcessCommandL
+//
+// Handle menu commands.
+//------------------------------------------------------------------------------
+//
+void CAspFilterDialog::ProcessCommandL( TInt aCommandId )
+	{
+	HideMenu();
+
+	switch (aCommandId)
+		{
+		case EAspMenuCmdHelp:
+			{
+            break;
+			}
+
+		case EAspMenuCmdChange:
+			{				
+			CAspListItemData* item = ItemForIndex(ListBox()->CurrentItemIndex());
+			item->iSelectKeyPressed = EFalse;
+			HandleOKL();
+
+			break;
+			}
+
+        case EAspMenuCmdExit:
+        case EAknCmdExit:
+        case EEikCmdExit:
+			{
+			// close dialog and exit calling application
+			iAvkonAppUi->ProcessCommandL(EAknCmdExit);
+			break;
+			}
+
+
+		default:
+		    break;
+		}
+	
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::OkToExitL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::OkToExitL(TInt aButtonId)
+	{
+	if (aButtonId == EEikBidCancel)
+		{
+		// save silently and quit application (= return ETrue)
+		TRAP_IGNORE(SaveSettingsL());
+	
+		return ETrue;
+		}
+
+	if ( aButtonId == EAknSoftkeyBack )
+        {
+		TInt index = CheckMandatoryFieldsL();
+		if (index != KErrNotFound)
+			{
+			if (!TDialogUtil::ShowConfirmationQueryL(R_ASP_EXIT_ANYWAY))
+				{
+				ListBox()->SetCurrentItemIndexAndDraw(index);
+				return EFalse; // leave dialog open
+				}
+			}
+		
+		SaveSettingsL();
+		return ETrue;
+		}
+
+	return CAknDialog::OkToExitL(aButtonId);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::OfferKeyEventL
+//
+// Handle key events.
+//------------------------------------------------------------------------------
+//
+TKeyResponse CAspFilterDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+	{
+
+	if (aType == EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+			case EKeyEscape:  // framework calls this when dialog must shut down
+				{
+				return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+        		}
+
+			case EKeyOK: // OK button
+				{
+				CAspListItemData* item = ItemForIndex(ListBox()->CurrentItemIndex());
+			    item->iSelectKeyPressed = ETrue;
+
+				HandleOKL();
+				return EKeyWasConsumed;
+				}
+			}
+		}
+
+	return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::PreLayoutDynInitL
+//
+// Called by system before the dialog is shown.
+//------------------------------------------------------------------------------
+//
+void CAspFilterDialog::PreLayoutDynInitL()
+	{
+	iListBox = (CAknSettingStyleListBox*)Control(EAspFilterDialog);
+	
+	ListBox()->SetListBoxObserver(this);
+	ListBox()->CreateScrollBarFrameL( ETrue );
+	ListBox()->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto ); 
+	
+    CreateSettingsListL();
+    UpdateListBoxL(ListBox(), iSettingList);
+	
+	//Set title pane text
+	iStatusPaneHandler->SetTitleL(iFilter->DisplayName());
+	}
+
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::DynInitMenuPaneL
+//
+// Called by system before menu is shown.
+//------------------------------------------------------------------------------
+//
+void CAspFilterDialog::DynInitMenuPaneL( TInt aResourceID, CEikMenuPane* aMenuPane)
+	{
+    if (aResourceID != R_ASP_FILTER_DIALOG_MENU_PANE)
+		{
+		return;
+		}
+
+	if (ListBox()->Model()->NumberOfItems() == 0)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChange);
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::HandleListBoxEventL
+//
+// Handle listbox events.
+//------------------------------------------------------------------------------
+//
+void CAspFilterDialog::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+	{
+	if (aEventType == EEventEnterKeyPressed || aEventType == EEventItemSingleClicked)
+		{
+		HandleOKL();
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspFilterDialog::UpdateListBoxL
+// 
+// Add settings headers into listbox.
+// ----------------------------------------------------------------------------
+//
+void CAspFilterDialog::UpdateListBoxL(CEikTextListBox* aListBox, CAspSettingList* aItemList)
+	{
+	CDesCArray* arr = (CDesCArray*)aListBox->Model()->ItemTextArray();
+	arr->Reset();
+
+	TInt count = aItemList->Count();
+	for (TInt index=0; index<count; index++ )
+		{
+	   	TBool convert = ETrue;
+
+		CAspListItemData* item = (*aItemList)[index];
+		if (item->iHidden != EVisibilityHidden)
+			{
+			HBufC* hBuf = item->ListItemTextL(convert);
+			CleanupStack::PushL(hBuf);
+
+			arr->AppendL(hBuf->Des());
+			
+			// store listbox index (from zero up) into setting item 
+			item->iIndex = arr->Count() - 1;
+
+			CleanupStack::PopAndDestroy(hBuf);
+			}
+		else
+			{
+			item->iIndex = KErrNotFound;
+			}
+		}
+
+	ListBox()->HandleItemAdditionL();
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspFilterDialog::CreateSettingsListL
+// 
+// Function creates setting list array (iSettingList).
+// ----------------------------------------------------------------------------
+//
+void CAspFilterDialog::CreateSettingsListL()
+	{
+    TInt count = iFilter->ItemCount();	
+	for (TInt i=0; i<count; i++)
+		{
+		CAspFilterItem* item = iFilter->Item(i);
+		AddItemL(item);
+		}
+		
+	// write setting data into each CAspListItemData
+	count=iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* item = (*iSettingList)[i];
+		item->iFilter = iFilter;
+		
+		InitSettingItemL(item);
+		}
+
+	SetVisibility();  // find out what setting appear on UI
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspFilterDialog::AddItemL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspFilterDialog::AddItemL(CAspFilterItem* aFilterItem)
+	{
+    CAspListItemData* item = CAspListItemData::NewLC();
+	item->SetHeaderL(aFilterItem->DisplayName());
+	item->iItemId =aFilterItem->Id();
+	item->iItemType = aFilterItem->DataType();
+	item->iMandatory = aFilterItem->IsMandatory();
+	
+	if (item->iMandatory)
+		{
+		item->SetDisplayValueL(R_ASP_MUST_BE_DEFINED);
+		}
+	else
+		{
+		item->SetDisplayValueL(R_ASP_SETTING_VALUE_NONE);
+		}
+		
+	iSettingList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterDialog::InitSettingItemL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspFilterDialog::InitSettingItemL(CAspListItemData* aItem)
+	{
+	__ASSERT_ALWAYS(aItem->iFilter, TUtil::Panic(KErrGeneral));
+	
+	CAspFilterItem* filterItem = aItem->iFilter->ItemForId(aItem->iItemId);
+	
+	if (filterItem->ListType() != CAspFilterItem::ETypeQuery)
+		{
+		aItem->SetValueL(filterItem->DisplayValueL());
+		return; // this filter item is list, not a single value
+		}
+	
+	
+	HBufC* hBuf = HBufC::NewLC(KBufSize255);
+	TPtr ptr = hBuf->Des();
+	
+    	
+	switch (aItem->iItemType)
+		{
+		case CAspListItemData::ETypeNumber:
+			{
+			aItem->SetValueL(filterItem->IntL());
+		    aItem->iNumberData = filterItem->IntL();
+            break;
+			}
+
+		case CAspListItemData::ETypeText:
+			{
+			filterItem->GetText(ptr);
+   			aItem->SetValueL(ptr);
+    		break;
+			}
+
+		case CAspListItemData::ETypeBoolean:
+			{
+			CDesCArray* stringData = CAspResHandler::ReadDesArrayStaticLC(R_ASP_FILTER_ITEM_YESNO);
+			
+			aItem->iNumberData = EAspSettingEnabled;      // 1;
+			if (!filterItem->BoolL())
+				{
+				aItem->iNumberData = EAspSettingDisabled; // 0;
+				}
+			
+         	aItem->SetValueL((*stringData)[aItem->iNumberData]);
+         	aItem->iResource = R_ASP_FILTER_ITEM_YESNO;
+         	
+         	CleanupStack::PopAndDestroy(stringData);
+			break;
+     		}
+
+		case CAspListItemData::ETypeTime:
+			{
+    		aItem->iTime = filterItem->TimeL();
+    		if (aItem->iTime > 0)
+    			{
+    			TUtil::GetTimeTextL(ptr, aItem->iTime);
+    		    aItem->SetValueL(ptr);
+    			}
+	
+			break;
+			}
+
+		case CAspListItemData::ETypeDate:
+			{
+    		aItem->iDate = filterItem->DateL();
+    		if (aItem->iDate > 0)
+    			{
+    			TUtil::GetDateTextL(ptr, aItem->iDate);
+    		    aItem->SetValueL(ptr);
+    			}
+	
+			break;
+			}
+
+        default:
+			TUtil::Panic(KErrArgument);
+			break;
+		
+		}
+		
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterDialog::SetVisibility
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspFilterDialog::SetVisibility()
+	{
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::SaveSettingsL
+//
+//------------------------------------------------------------------------------
+//
+void CAspFilterDialog::SaveSettingsL()
+	{
+    iFilter->SaveL();
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::CheckMandatoryFieldsL
+//
+// Check that mandatory fields are filled correctly.
+//------------------------------------------------------------------------------
+//
+TInt CAspFilterDialog::CheckMandatoryFieldsL()
+	{ 
+    TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* item = (*iSettingList)[i];
+		if (item->iMandatory && item->IsEmpty())
+			{
+			return item->iIndex;
+			}
+		}
+		
+	return KErrNotFound;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::EditFilterL
+//
+// NOTE: Function is not used by CAspFilterDialog. It can be called from
+// other dialogs in case filter only contains one filter item.
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::EditFilterL(CAspListItemData& aItem)
+	{
+    __ASSERT_ALWAYS(aItem.iFilter, TUtil::Panic(KErrGeneral));
+	
+	if (aItem.iFilter->ItemCount() != 1)
+		{
+		return EFalse; // this functions edits filter with one filter item
+		}
+		
+	CAspFilterItem* filterItem = aItem.iFilter->Item(0);
+		
+	__ASSERT_ALWAYS(filterItem, TUtil::Panic(KErrGeneral));
+	
+	
+	CAspListItemData* item = CAspListItemData::NewLC();
+	
+	item->SetHeaderL(filterItem->DisplayName());
+	item->iItemId = filterItem->Id();
+	item->iItemType = filterItem->DataType();
+	item->iMandatory = filterItem->IsMandatory();
+	
+	item->iSelectKeyPressed = aItem.iSelectKeyPressed;
+	item->iFilter = aItem.iFilter;
+
+	if (item->iMandatory)
+		{
+		item->SetDisplayValueL(R_ASP_MUST_BE_DEFINED);
+		}
+	else
+		{
+		item->SetDisplayValueL(R_ASP_SETTING_VALUE_NONE);
+		}
+	
+	InitSettingItemL(item);
+	
+	TBool ret = EditSettingItemL(*item);
+	
+    CleanupStack::PopAndDestroy(item);
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::EditSettingItemL
+//
+// Calls setting editing functions. 
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::EditSettingItemL(CAspListItemData& aItem)
+	{
+	__ASSERT_ALWAYS(aItem.iFilter, TUtil::Panic(KErrGeneral));
+	
+	TBool ret = EFalse;
+
+	CAspFilterItem* filterItem = aItem.iFilter->ItemForId(aItem.iItemId);
+    TInt type = filterItem->ListType();
+    
+	switch (type)
+		{
+		case CAspFilterItem::ETypeQuery:
+			ret = EditSettingItemQueryL(aItem);
+		    break;
+
+		case CAspFilterItem::ETypeSingleSelection:
+			ret = EditSingleChoiceListL(aItem);
+		    break;
+		
+		case CAspFilterItem::ETypeSingleSelectionUserDefined:
+			ret = EditSingleChoiceListL(aItem);
+		    break;
+
+		case CAspFilterItem::ETypeMultipleSelection:
+		    ret = EditMultiChoiceListL(aItem);
+		   	break;
+
+		case CAspFilterItem::ETypeMultipleSelectionUserDefined:
+		    ret = EditMultiChoiceListL(aItem);
+		   	break;
+
+		default:
+		    break;
+
+		}
+
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::EditSettingItemQueryL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::EditSettingItemQueryL(CAspListItemData& aItem)
+	{
+	TBool ret = EFalse;
+	
+	switch (aItem.iItemType)
+		{
+		case CAspListItemData::ETypeText:
+			ret = EditSettingItemTextL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeNumber:
+			ret = EditSettingItemNumberL(aItem);
+		    break;
+		
+		case CAspListItemData::ETypeBoolean:
+		    if (aItem.iSelectKeyPressed)
+		    	{
+		    	ret = EditSettingItemBooleanL(aItem);
+		    	}
+		    else
+		    	{
+		    	ret = EditSettingItemListL(aItem);
+		    	}
+		    break;
+
+		case CAspListItemData::ETypeTime:
+		    ret = EditSettingItemTimeL(aItem);
+		   	break;
+
+		case CAspListItemData::ETypeDate:
+		    ret = EditSettingItemDateL(aItem);
+		   	break;
+
+		default:
+		    break;
+
+		}
+
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::EditSingleChoiceListL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::EditSingleChoiceListL(CAspListItemData& aItem)
+	{
+	CAspSelectionItemList*	list = new (ELeave) CAspSelectionItemList(1);
+	CleanupStack::PushL(TCleanupItem(CAspSelectionItemList::Cleanup, list));
+
+	CAspFilterItem* filterItem = (aItem.iFilter)->ItemForId(aItem.iItemId);
+	TInt listType = filterItem->ListType();
+	TInt dataType = filterItem->DataType();
+	
+	TInt type = CAspChoiceList::ETypeNormal;
+	if (listType == CAspFilterItem::ETypeSingleSelectionUserDefined &&
+	    dataType == CAspListItemData::ETypeNumber)
+		{
+		type = CAspChoiceList::ETypeIntegerUserDefined;
+		}
+	
+	if (listType == CAspFilterItem::ETypeSingleSelectionUserDefined &&
+	    dataType == CAspListItemData::ETypeText)
+		{
+		type = CAspChoiceList::ETypeTextUserDefined;
+		}
+	
+	filterItem->GetSelectionL(list);
+	
+	CAspChoiceList* editor = CAspChoiceList::NewLC(filterItem->DisplayName(), list, type, filterItem->MaxLength());
+	
+	TBool ret = editor->ShowListL();
+	if (ret)
+		{
+		filterItem->SetSelectionL(list);
+		aItem.SetValueL(filterItem->DisplayValueL());
+		}
+		
+	
+	CleanupStack::PopAndDestroy(editor);
+	CleanupStack::PopAndDestroy(list);
+	
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::EditMultiChoiceListL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::EditMultiChoiceListL(CAspListItemData& aItem)
+	{
+	CAspSelectionItemList*	list = new (ELeave) CAspSelectionItemList(1);
+	CleanupStack::PushL(TCleanupItem(CAspSelectionItemList::Cleanup, list));
+	
+	CAspFilterItem* filterItem = aItem.iFilter->ItemForId(aItem.iItemId);
+	TInt listType = filterItem->ListType();
+	TInt dataType = filterItem->DataType();
+	
+	TInt type = CAspChoiceList::ETypeNormal;
+	if (listType == CAspFilterItem::ETypeMultipleSelectionUserDefined &&
+	    dataType == CAspListItemData::ETypeNumber)
+		{
+		type = CAspChoiceList::ETypeIntegerUserDefined;
+		}
+	if (listType == CAspFilterItem::ETypeMultipleSelectionUserDefined &&
+	    dataType == CAspListItemData::ETypeText)
+		{
+		type = CAspChoiceList::ETypeTextUserDefined;
+		}
+	
+	filterItem->GetSelectionL(list);
+	
+	CAspMultiChoiceList* editor = CAspMultiChoiceList::NewLC(filterItem->DisplayName(), list, type, filterItem->MaxLength());
+	
+	TBool ret = editor->ShowListL();
+	if (ret)
+		{
+		filterItem->SetSelectionL(list);
+		aItem.SetValueL(filterItem->DisplayValueL());
+		}
+	
+	
+	CleanupStack::PopAndDestroy(editor);
+	CleanupStack::PopAndDestroy(list);
+	
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::EditSettingItemTextL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::EditSettingItemTextL(CAspListItemData& aItem)
+	{
+	CAspFilterItem* filterItem = aItem.iFilter->ItemForId(aItem.iItemId);
+	
+	HBufC* hBuf = HBufC::NewLC(KBufSize255);
+	TPtr ptr = hBuf->Des();
+	
+	TUtil::StrCopy(ptr, aItem.Value());
+	
+	TBool ret = TDialogUtil::ShowTextEditorL(ptr, aItem.Header(), aItem.iMandatory, aItem.iLatinInput, filterItem->MaxLength());
+	if (ret)
+		{
+		aItem.SetValueL(ptr);
+		filterItem->SetTextL(ptr);
+		}
+		
+	CleanupStack::PopAndDestroy(hBuf);
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::EditSettingItemListL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::EditSettingItemListL(CAspListItemData& aItem)
+	{
+	CAspFilterItem* filterItem = aItem.iFilter->ItemForId(aItem.iItemId);
+	
+	TInt curSelection = aItem.iNumberData;
+	CDesCArray* stringData = CAspResHandler::ReadDesArrayStaticLC(aItem.iResource);
+	
+	TBool ret = TDialogUtil::ShowListEditorL(stringData, aItem.Header(), curSelection);
+	if (ret)
+		{
+		aItem.iNumberData = curSelection; 
+		aItem.SetValueL((*stringData)[curSelection]);
+		filterItem->SetIntL(aItem.iNumberData);
+		}
+
+	CleanupStack::PopAndDestroy(stringData);
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::EditSettingItemBooleanL
+//
+// Change Yes/No value straight if ok key is pressed
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::EditSettingItemBooleanL(CAspListItemData& aItem)
+	{
+	CAspFilterItem* filterItem = aItem.iFilter->ItemForId(aItem.iItemId);
+		
+	CDesCArray* stringData = CAspResHandler::ReadDesArrayStaticLC(R_ASP_FILTER_ITEM_YESNO);
+	
+	if (aItem.iNumberData == EAspSettingDisabled)
+		{
+		aItem.iNumberData = EAspSettingEnabled;
+		}
+	else
+		{
+		aItem.iNumberData = EAspSettingDisabled;
+		}
+	
+	aItem.SetValueL( (*stringData)[aItem.iNumberData] );
+	filterItem->SetIntL(aItem.iNumberData);
+
+	CleanupStack::PopAndDestroy(stringData);
+	return ETrue;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::EditSettingItemNumberL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::EditSettingItemNumberL(CAspListItemData& aItem)
+	{
+	CAspFilterItem* filterItem = aItem.iFilter->ItemForId(aItem.iItemId);
+		
+	TBool ret = TDialogUtil::ShowIntegerEditorL(aItem.iNumberData, aItem.Header(), aItem.iMinValue, aItem.iMaxValue);
+
+	if (ret)
+		{
+		aItem.SetValueL(aItem.iNumberData);
+		filterItem->SetIntL(aItem.iNumberData);
+		}
+
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::EditSettingItemDateL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::EditSettingItemDateL(CAspListItemData& aItem)
+	{
+	CAspFilterItem* filterItem = aItem.iFilter->ItemForId(aItem.iItemId);
+	
+	TBool ret = TDialogUtil::ShowDateEditorL(aItem.iDate, aItem.Header());
+
+	if (ret)
+		{
+		TBuf<KBufSize> buf;
+		TUtil::GetDateTextL(buf, aItem.iDate);
+	    aItem.SetValueL(buf);
+        filterItem->SetDateL(aItem.iDate);
+		}
+
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::EditSettingItemTimeL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspFilterDialog::EditSettingItemTimeL(CAspListItemData& aItem)
+	{
+	CAspFilterItem* filterItem = aItem.iFilter->ItemForId(aItem.iItemId);
+	
+	TBool ret = TDialogUtil::ShowTimeEditorL(aItem.iTime, aItem.Header());
+
+	if (ret)
+		{
+		TBuf<KBufSize> buf;
+		TUtil::GetTimeTextL(buf, aItem.iTime);
+	    aItem.SetValueL(buf);
+        filterItem->SetTimeL(aItem.iTime);
+		}
+
+	return ret;
+	}
+
+
+//-----------------------------------------------------------------------------
+// CAspFilterDialog::ItemForIndex
+// 
+// Find item in list position aIndex.
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspFilterDialog::ItemForIndex(TInt aIndex)
+	{
+	CAspListItemData* item = NULL;
+	
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iIndex == aIndex)
+			{
+			item = temp;
+			break;
+			}
+		}
+
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+
+//-----------------------------------------------------------------------------
+// CAspFilterDialog::Item
+// 
+// Find item with aItemId (TAspConnectionSettingItem).
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspFilterDialog::Item(TInt aItemId)
+	{
+	CAspListItemData* item = NULL;
+
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iItemId == aItemId)
+			{
+			item = temp;
+			break;
+			}
+		}
+	
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterDialog::ResHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CAspResHandler* CAspFilterDialog::ResHandler()
+	{
+	__ASSERT_DEBUG(iResHandler, TUtil::Panic(KErrGeneral));
+
+	return iResHandler;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspFilterDialog::ListBox
+// 
+// -----------------------------------------------------------------------------
+//
+CAknSettingStyleListBox* CAspFilterDialog::ListBox()
+	{
+    __ASSERT_DEBUG(iListBox, TUtil::Panic(KErrGeneral));	
+	
+	return iListBox;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspFilterDialog::GetHelpContext
+//
+//------------------------------------------------------------------------------
+//
+void CAspFilterDialog::GetHelpContext(TCoeHelpContext& aContext) const
+	{
+	aContext.iMajor=KUidSmlSyncApp;
+	//aContext.iContext=KDS_HLP_APPLICATION;
+	}
+
+
+
+
+
+
+/*******************************************************************************
+ * class CAspMultiChoiceListSettingPage
+ *******************************************************************************/
+
+
+//------------------------------------------------------------------------------
+// CAspMultiChoiceListSettingPage::ProcessCommandL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspMultiChoiceListSettingPage::ProcessCommandL(TInt aCommandId)
+	{
+		
+	if (iType == ETypeUserDefined && aCommandId == EAknSoftkeySelect)
+		{
+		CAknSetStyleListBox* listBox = ListBoxControl();
+		TInt bottomIndex = listBox->BottomItemIndex();
+		TInt currentIndex = listBox->CurrentItemIndex();
+		
+		TBool itemChecked = (*iSelectionList)[currentIndex]->SelectionStatus();
+		
+		if (bottomIndex == currentIndex && !itemChecked) //  "User defined" has focus and is checked
+			{
+			
+			if (!iObserver->HandleChoiceListEventL(0, 0))
+				{
+				return;  // leave editor open if user defined editor is canceled
+				}
+			}
+		}
+		
+	CAknCheckBoxSettingPage::ProcessCommandL(aCommandId);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspMultiChoiceListSettingPage::CAspMultiChoiceListSettingPage
+// 
+//------------------------------------------------------------------------------
+//
+CAspMultiChoiceListSettingPage::CAspMultiChoiceListSettingPage(TInt aResourceID, CSelectionItemList* aItemArray,
+                                                               MAspChoiceListObserver* aObserver, TInt aType)
+ : CAknCheckBoxSettingPage(aResourceID, aItemArray)
+	{
+	iObserver = aObserver;
+	iType = aType;
+	iSelectionList = aItemArray;
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspMultiChoiceListSettingPage::~CAspMultiChoiceListSettingPage()
+	{
+	}
+
+
+
+
+/*******************************************************************************
+ * class CAspChoiceListSettingPage
+ *******************************************************************************/
+
+
+//------------------------------------------------------------------------------
+// CAspChoiceListSettingPage::ProcessCommandL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspChoiceListSettingPage::ProcessCommandL(TInt aCommandId)
+	{
+		
+	if (iType == ETypeUserDefined && aCommandId == EAknSoftkeySelect)
+		{
+		CAknSetStyleListBox* listBox = ListBoxControl();
+		TInt num1 = listBox->BottomItemIndex();
+		TInt num2 = listBox->CurrentItemIndex();
+		
+		if (num1 == num2)
+			{
+			if (!iObserver->HandleChoiceListEventL(0, 0))
+				{
+				return;  // leave editor open if user defined editor is canceled
+				}
+			}
+		}
+		
+	CAknRadioButtonSettingPage::ProcessCommandL(aCommandId);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspChoiceListSettingPage::CAspChoiceListSettingPage
+// 
+//------------------------------------------------------------------------------
+//
+CAspChoiceListSettingPage::CAspChoiceListSettingPage(TInt aResourceID, TInt& aCurrentSelectionIndex, 
+                                                     const MDesCArray* aItemArray,
+                                                     MAspChoiceListObserver* aObserver, TInt aType)
+ : CAknRadioButtonSettingPage(aResourceID, aCurrentSelectionIndex, aItemArray)
+	{
+	iObserver = aObserver;
+	iType = aType;
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspChoiceListSettingPage::~CAspChoiceListSettingPage()
+	{
+	}
+
+
+
+
+	
+/*******************************************************************************
+ * class CAspChoiceList
+ *******************************************************************************/
+	
+	
+	
+// -----------------------------------------------------------------------------
+// CAspChoiceList::NewLC
+//
+// -----------------------------------------------------------------------------
+CAspChoiceList* CAspChoiceList::NewLC(const TDesC& aTitle, CSelectionItemList* aList, TInt aType, TInt aMaxLength)
+    {
+    CAspChoiceList* self = new (ELeave) CAspChoiceList(aTitle, aList, aType, aMaxLength);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+
+    return(self);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspChoiceList::CAspChoiceList
+// 
+//------------------------------------------------------------------------------
+//
+CAspChoiceList::CAspChoiceList(const TDesC& aTitle, CSelectionItemList* aList, TInt aType, TInt aMaxLength)
+	{
+	__ASSERT_DEBUG(aList, TUtil::Panic(KErrGeneral));
+	
+	TUtil::StrCopy(iTitle, aTitle);
+	iSelectionList = aList;
+	iListType = aType;
+	iMaxTextLength = aMaxLength;
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspChoiceList::~CAspChoiceList()
+	{
+	}
+
+	
+//------------------------------------------------------------------------------
+// CAspChoiceList::ConstructL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspChoiceList::ConstructL()
+	{
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspChoiceList::ShowListL
+// 
+//------------------------------------------------------------------------------
+//
+TBool CAspChoiceList::ShowListL()
+	{
+	TInt current = SelectedIndex(iSelectionList);
+	TInt listType = CAspChoiceListSettingPage::ETypeNormal;
+	if (iListType != CAspChoiceList::ETypeNormal)
+		{
+		listType = CAspChoiceListSettingPage::ETypeUserDefined;
+		AddUserDefinedL(); // replace last item text as "User defined"
+		}
+		
+	CDesCArray* arr = DesArrayLC(iSelectionList);
+
+	CAspChoiceListSettingPage* dlg = new (ELeave) CAspChoiceListSettingPage(
+	                                       R_ASP_SETTING_RADIO, current, arr, this, listType);
+	CleanupStack::PushL(dlg);
+	dlg->SetSettingTextL(iTitle); 
+	CleanupStack::Pop(dlg);
+
+	TBool ret = dlg->ExecuteLD();
+	
+	SetSelectedIndex(iSelectionList, current);
+	if (iListType != CAspChoiceList::ETypeNormal)
+		{
+		RemoveUserDefinedL(); // restore original last item text
+		}
+	
+	CleanupStack::PopAndDestroy(arr);
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspChoiceList::DesArrayLC
+// 
+//------------------------------------------------------------------------------
+//
+CDesCArray* CAspChoiceList::DesArrayLC(CSelectionItemList* aList)
+	{
+	CDesCArray* arr = new (ELeave) CDesCArrayFlat(5);
+	CleanupStack::PushL(arr);
+	
+	TInt count = aList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CSelectableItem* item = (*aList)[i];
+		TBuf<128> buf(item->ItemText());
+		arr->AppendL(item->ItemText());
+		}
+		
+	return arr;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspChoiceList::SelectedIndex
+// 
+//------------------------------------------------------------------------------
+//
+TInt CAspChoiceList::SelectedIndex(CSelectionItemList* aList)
+	{
+    TInt count = aList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CSelectableItem* item = (*aList)[count-1];
+		if (item->SelectionStatus())
+			{
+			return i;
+			}
+		}
+		
+	return KErrNotFound;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspChoiceList::SetSelectedIndex
+// 
+//------------------------------------------------------------------------------
+//
+void CAspChoiceList::SetSelectedIndex(CSelectionItemList* aList, TInt aIndex)
+	{
+    TInt count = aList->Count();
+    
+    __ASSERT_DEBUG(aIndex<count, TUtil::Panic(KErrGeneral));
+    
+	for (TInt i=0; i<count; i++)
+		{
+		CSelectableItem* item = (*aList)[i];
+		if (i == aIndex)
+			{
+			item->SetSelectionStatus(ETrue);
+			}
+		else
+			{
+			item->SetSelectionStatus(EFalse);
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspChoiceList::AddItemL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspChoiceList::AddItemL(CSelectionItemList* aList, TDes& aText, TBool aEnable)
+	{
+	CSelectableItem* item = new (ELeave) CSelectableItem(aText, aEnable);
+   	CleanupStack::PushL(item);
+	item->ConstructL();
+	aList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+	
+
+//------------------------------------------------------------------------------
+// CAspChoiceList::AddUserDefined
+// 
+//------------------------------------------------------------------------------
+//
+void CAspChoiceList::AddUserDefinedL()
+	{
+	TInt count = iSelectionList->Count();
+	CSelectableItem* item = (*iSelectionList)[count-1];
+	
+	TBool selected = item->SelectionStatus();
+	iUserDefinedText = item->ItemText();
+	if (iListType == CAspChoiceList::ETypeIntegerUserDefined)
+		{
+		User::LeaveIfError(TUtil::StrToInt(iUserDefinedText, iUserDefinedInt));
+		}
+
+	
+	delete item;
+	iSelectionList->Delete(count-1);
+	iSelectionList->Compress();
+
+	TBuf<KBufSize> buf;
+	CAspResHandler::ReadL(buf, R_ASP_LIST_USER_DEFINED);
+	
+	
+	AddItemL(iSelectionList, buf, selected);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspChoiceList::RemoveUserDefined
+// 
+//------------------------------------------------------------------------------
+//
+void CAspChoiceList::RemoveUserDefinedL()
+	{
+	TInt count = iSelectionList->Count();
+	CSelectableItem* item = (*iSelectionList)[count-1];
+    TBool selected = item->SelectionStatus();
+
+	delete item;
+	iSelectionList->Delete(count-1);
+	iSelectionList->Compress();
+
+	if (iListType == CAspChoiceList::ETypeIntegerUserDefined)
+		{
+		iUserDefinedText.Num(iUserDefinedInt);
+		}
+	AddItemL(iSelectionList, iUserDefinedText, selected);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspChoiceList::EditTextL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspChoiceList::EditTextL(TDes& aText, const TDesC& aTitle)
+	{
+	TBool mandatory = EFalse;
+	TBool latinInput = ETrue;
+	TInt maxLength = iMaxTextLength;
+	
+	return TDialogUtil::ShowTextEditorL(aText, aTitle, mandatory, latinInput, maxLength);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspChoiceList::HandleChoiceListEventL
+// 
+//------------------------------------------------------------------------------
+//
+TBool CAspChoiceList::HandleChoiceListEventL(TInt /*aEvent*/, TInt /*aListType*/)
+	{
+	if (iListType == CAspChoiceList::ETypeIntegerUserDefined)
+		{
+		return TDialogUtil::ShowIntegerEditorL(iUserDefinedInt, iTitle, KErrNotFound, KErrNotFound);
+		}
+	else if (iListType == CAspChoiceList::ETypeTextUserDefined)
+		{
+		return EditTextL(iUserDefinedText, iTitle);
+		}
+		
+	return EFalse;
+	}
+
+	
+	
+	
+/*******************************************************************************
+ * class CAspMultiChoiceList
+ *******************************************************************************/
+	
+	
+// -----------------------------------------------------------------------------
+// CAspMultiChoiceList::NewLC
+//
+// -----------------------------------------------------------------------------
+CAspMultiChoiceList* CAspMultiChoiceList::NewLC(const TDesC& aTitle, CSelectionItemList* aList, TInt aType, TInt aMaxLength)
+    {
+    CAspMultiChoiceList* self = new (ELeave) CAspMultiChoiceList(aTitle, aList, aType, aMaxLength);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+
+    return(self);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspMultiChoiceList::CAspMultiChoiceList
+// 
+//------------------------------------------------------------------------------
+//
+CAspMultiChoiceList::CAspMultiChoiceList(const TDesC& aTitle, CSelectionItemList* aList, TInt aType, TInt aMaxLength)
+	{
+	__ASSERT_DEBUG(aList, TUtil::Panic(KErrGeneral));
+	
+	TUtil::StrCopy(iTitle, aTitle);
+	iSelectionList = aList;
+	iListType = aType;
+	iMaxTextLength = aMaxLength;
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspMultiChoiceList::~CAspMultiChoiceList()
+	{
+	}
+	
+	
+//------------------------------------------------------------------------------
+// CAspMultiChoiceList::ConstructL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspMultiChoiceList::ConstructL()
+	{
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspMultiChoiceList::ShowListL
+// 
+//------------------------------------------------------------------------------
+//
+TBool CAspMultiChoiceList::ShowListL()
+	{
+	TInt listType = CAspChoiceListSettingPage::ETypeNormal;
+	if (iListType != CAspChoiceList::ETypeNormal)
+		{
+		listType = CAspChoiceListSettingPage::ETypeUserDefined;
+		AddUserDefinedL(); // replace last item text as "User defined"
+		}
+	
+
+	CAspMultiChoiceListSettingPage* dlg = new (ELeave) CAspMultiChoiceListSettingPage(
+	                                       R_ASP_SETTING_RADIO, iSelectionList, this, listType);
+	CleanupStack::PushL(dlg);
+	dlg->SetSettingTextL(iTitle); 
+	CleanupStack::Pop(dlg);
+
+	TBool ret = dlg->ExecuteLD();
+	
+	if (iListType != CAspChoiceList::ETypeNormal)
+		{
+		RemoveUserDefinedL(); // set original last item text
+		}
+	
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspMultiChoiceList::AddItemL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspMultiChoiceList::AddItemL(CSelectionItemList* aList, TDes& aText, TBool aEnable)
+	{
+	CSelectableItem* item = new (ELeave) CSelectableItem(aText, aEnable);
+   	CleanupStack::PushL(item);
+	item->ConstructL();
+	aList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspMultiChoiceList::AddItemL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspMultiChoiceList::AddItemL(TDes& aText, TBool aEnable)
+	{
+	AddItemL(iSelectionList, aText, aEnable);
+	}
+	
+	
+//------------------------------------------------------------------------------
+// CAspMultiChoiceList::AddItemL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspMultiChoiceList::AddItemL(TInt aNumber, TBool aEnable)
+	{
+	TBuf<KBufSize> buf;
+	
+	buf.Num(aNumber);
+	AddItemL(iSelectionList, buf, aEnable);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspMultiChoiceList::AddUserDefined
+// 
+//------------------------------------------------------------------------------
+//
+void CAspMultiChoiceList::AddUserDefinedL()
+	{
+	TInt count = iSelectionList->Count();
+	CSelectableItem* item = (*iSelectionList)[count-1];
+	
+	TBool selected = item->SelectionStatus();
+	iUserDefinedText = item->ItemText();
+	if (iListType == CAspChoiceList::ETypeIntegerUserDefined)
+		{
+		User::LeaveIfError(TUtil::StrToInt(iUserDefinedText, iUserDefinedInt));
+		}
+
+	
+	delete item;
+	iSelectionList->Delete(count-1);
+	iSelectionList->Compress();
+
+	TBuf<KBufSize> buf;
+	CAspResHandler::ReadL(buf, R_ASP_LIST_USER_DEFINED);
+	
+	
+	AddItemL(iSelectionList, buf, selected);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspMultiChoiceList::RemoveUserDefined
+// 
+//------------------------------------------------------------------------------
+//
+void CAspMultiChoiceList::RemoveUserDefinedL()
+	{
+	TInt count = iSelectionList->Count();
+	CSelectableItem* item = (*iSelectionList)[count-1];
+    TBool selected = item->SelectionStatus();
+
+	delete item;
+	iSelectionList->Delete(count-1);
+	iSelectionList->Compress();
+
+	if (iListType == CAspChoiceList::ETypeIntegerUserDefined)
+		{
+		iUserDefinedText.Num(iUserDefinedInt);
+		}
+	AddItemL(iSelectionList, iUserDefinedText, selected);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspMultiChoiceList::EditTextL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspMultiChoiceList::EditTextL(TDes& aText, const TDesC& aTitle)
+	{
+	TBool mandatory = ETrue;
+	TBool latinInput = ETrue;
+	TInt maxLength = iMaxTextLength;
+	
+	return TDialogUtil::ShowTextEditorL(aText, aTitle, mandatory, latinInput, maxLength);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspMultiChoiceList::HandleChoiceListEventL
+// 
+//------------------------------------------------------------------------------
+//
+TBool CAspMultiChoiceList::HandleChoiceListEventL(TInt /*aEvent*/, TInt /*aListType*/)
+	{
+	if (iListType == CAspChoiceList::ETypeIntegerUserDefined)
+		{
+		return TDialogUtil::ShowIntegerEditorL(iUserDefinedInt, iTitle, KErrNotFound, KErrNotFound);
+		}
+	else if (iListType == CAspChoiceList::ETypeTextUserDefined)
+		{
+		return EditTextL(iUserDefinedText, iTitle);
+		}
+		
+	return EFalse;
+	}
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspLogDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,730 @@
+/*
+* 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:  
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "AspLogDialog.h"
+#include "AspDialogUtil.h"
+#include "AspUtil.h"
+#include "AspDebug.h"
+
+#include <SyncMLErr.h>  // sync error codes
+#include "AspSchedule.h"
+
+
+
+/*******************************************************************************
+ * class CAspLogDialog
+ *******************************************************************************/
+
+
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+void CAspLogDialog::ShowDialogL()
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(R_SML_LOG_SYNCLOG_TITLE);
+
+    TDialogUtil::ShowPopupDialog2L(hBuf->Des(), iList);
+    
+   	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::NewL
+//
+// -----------------------------------------------------------------------------
+CAspLogDialog* CAspLogDialog::NewL(const TAspParam& aParam)
+    {
+    CAspLogDialog* self = new (ELeave) CAspLogDialog(aParam);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return(self);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::CAspLogDialog
+// 
+// -----------------------------------------------------------------------------
+//
+CAspLogDialog::CAspLogDialog(const TAspParam& aParam)
+	{
+    iProfileId = aParam.iProfileId;
+	iSyncSession = aParam.iSyncSession;
+
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrArgument));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspLogDialog::ConstructL()
+    {
+    iResHandler = CAspResHandler::NewL();
+    iList = new (ELeave) CDesCArrayFlat(1);
+   		
+    TAspParam param(KErrNotFound, iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);   		
+	profile->OpenL(iProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+	
+    TAspParam param2(KErrNotFound, iSyncSession);
+	param2.iProfile = profile;
+	param2.iMode = CAspContentList::EInitAll;
+	CAspContentList* taskList = CAspContentList::NewLC(param2);
+	
+	CreateListL(iList, profile, taskList);
+	
+	CleanupStack::PopAndDestroy(taskList);
+	CleanupStack::PopAndDestroy(profile);
+    } 
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CAspLogDialog::~CAspLogDialog()
+    {
+	delete iResHandler;
+    delete iList;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::CreateListL
+// 
+// Example log format:
+//
+// Profile: PC Suite
+// Server: PC Suite
+// Date: 13/10/2004
+// Time: 11:04
+// Status: Complete
+//
+// Phone:  
+//
+// Added Contacts:
+//  4
+// Added Notes:
+//  12
+// Deleted Calendar:
+//  2
+//
+// Server:
+//
+// Added contacts:
+//  12
+// 
+// -----------------------------------------------------------------------------
+void CAspLogDialog::CreateListL(CDesCArray* aList, CAspProfile* aProfile,
+                                CAspContentList* aTaskList)
+	{
+	_LIT(KTab, "\t");
+	
+	aList->Reset();
+	
+	const CSyncMLHistoryJob* historyJob = aProfile->LatestHistoryJob();
+   	if (!historyJob)
+   		{
+   		User::Leave(KErrNotFound);  // this profile has not been synced
+   		}
+
+		
+	TTime time = historyJob->TimeStamp();
+	
+	CAspResHandler::ReadL(iBuf, R_QTN_SML_LOG_PROFILE); //profile name heading
+	iBuf.Append(KTab);
+
+#ifdef RD_DSUI_TIMEDSYNC
+	 CAspSchedule* schedule = CAspSchedule::NewLC();
+	 TInt asProfileId = schedule->AutoSyncProfileId();
+	 if (asProfileId == aProfile->ProfileId())
+		{
+		TInt profileId = schedule->ProfileId();
+		TAspParam param(KErrNotFound, iSyncSession);
+		CAspProfile* profile = CAspProfile::NewLC(param);
+		profile->OpenL(profileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+
+		profile->GetName(iBuf2);
+		CleanupStack::PopAndDestroy(profile);
+		}
+	 else
+		{
+		aProfile->GetName(iBuf2);
+		}
+	 CleanupStack::PopAndDestroy(schedule);
+#else	 
+	aProfile->GetName(iBuf2);
+#endif
+	iBuf.Append(iBuf2);
+	AddLineL(aList, iBuf);
+    
+	CAspResHandler::ReadL(iBuf, R_QTN_SML_LOG_REMOTE); //server name heading
+	iBuf.Append(KTab);
+
+	if(aProfile->IsPCSuiteProfile(aProfile))
+	{
+		aProfile->GetLocalisedPCSuite(iBuf2);
+	}
+	else
+	{
+		TInt num = 0;
+		aProfile->GetHostAddress(iBuf2, num);
+	}	
+	iBuf.Append(iBuf2);
+	AddLineL(aList, iBuf);
+		
+    CAspResHandler::ReadL(iBuf, R_QTN_SML_LOG_DATE); // sync date heading
+	iBuf.Append(KTab);
+	TUtil::GetDateTextL(iBuf2, time);
+	iBuf.Append(iBuf2);
+	AddLineL(aList, iBuf);
+
+	CAspResHandler::ReadL(iBuf, R_QTN_SML_LOG_TIME); // sync time heading
+	iBuf.Append(KTab);
+    TUtil::GetTimeTextL(iBuf2, time);
+	iBuf.Append(iBuf2);
+	AddLineL(aList, iBuf);	
+		
+
+	//
+	// check sync errors
+	//
+	CAspResHandler::ReadL(iBuf, R_QTN_SML_LOG_STATUS); // status heading
+	iBuf.Append(KTab);	
+		
+	TInt syncError = historyJob->ResultCode();
+	if (syncError != KErrNone && syncError != SyncMLError::KErrSlowSync)
+		{
+		if (syncError == KErrCancel)
+			{
+			CAspResHandler::ReadL(iBuf2, R_QTN_SML_LOG_CANCELLED);
+			}
+		else
+			{
+			CAspResHandler::ReadL(iBuf2, R_QTN_SML_LOG_ERR);
+			}
+		
+		iBuf.Append(iBuf2);
+		AddLineL(aList, iBuf);
+		
+		// Added for syncml engine error handling and displaying in view logs
+		if (syncError <= SyncMLError::KErrSyncEngineErrorBase)
+			{
+			TInt id = TAspSyncError::GetSmlErrorValue (syncError) ;
+			CAspResHandler::ReadL(iBuf, R_QTN_SML_LOG_ERROR); // sync error heading
+			iBuf.Append(KTab);
+			CAspResHandler::ReadL(iBuf2, id);
+			iBuf.Append(iBuf2);
+			AddLineL(aList, iBuf);
+			}
+		
+		return;
+		}
+	
+	if (HasTaskErrors(historyJob))
+		{
+		CAspResHandler::ReadL(iBuf2, R_QTN_SML_LOG_ERR);
+		iBuf.Append(iBuf2);
+    	AddLineL(aList, iBuf);
+		}
+    else
+    	{
+    	CAspResHandler::ReadL(iBuf2, R_QTN_SML_LOG_OK);
+	    iBuf.Append(iBuf2);
+    	AddLineL(aList, iBuf);
+    	}
+		
+	
+	if (PhoneModified(historyJob))
+		{
+		CAspResHandler::ReadL(iBuf, R_QTN_SML_LOG_PHONE);
+	    iBuf.Append(KTab);
+   	    AddLineL(aList, iBuf);
+
+        AddLogItemsL(aList, historyJob, aTaskList, ELogAddedPhone);
+        AddLogItemsL(aList, historyJob, aTaskList, ELogUpdatedPhone);
+        AddLogItemsL(aList, historyJob, aTaskList, ELogDeletedPhone);
+        AddLogItemsL(aList, historyJob, aTaskList, ELogDiscardedPhone);
+        AddLogItemsL(aList, historyJob, aTaskList, ELogMovedPhone);
+		}
+
+	
+	if (ServerModified(historyJob))
+		{
+		CAspResHandler::ReadL(iBuf, R_QTN_SML_LOG_SERVER);
+	    iBuf.Append(KTab);
+   	    AddLineL(aList, iBuf);
+
+        AddLogItemsL(aList, historyJob, aTaskList, ELogAddedServer);
+        AddLogItemsL(aList, historyJob, aTaskList, ELogUpdatedServer);
+        AddLogItemsL(aList, historyJob, aTaskList, ELogDeletedServer);
+        AddLogItemsL(aList, historyJob, aTaskList, ELogDiscardedServer);
+        AddLogItemsL(aList, historyJob, aTaskList, ELogMovedServer);
+		}
+
+	if (HasTaskErrors(historyJob))
+		{
+		CAspResHandler::ReadL(iBuf, R_QTN_SML_LOG_ERROR);
+	    iBuf.Append(KTab);
+   	    AddLineL(aList, iBuf);
+
+        AddTaskErrorsL(aList, historyJob, aTaskList);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::AddLogItemsL
+// 
+// -----------------------------------------------------------------------------
+void CAspLogDialog::AddLogItemsL(CDesCArray* aList, const CSyncMLHistoryJob* aHistoryJob, 
+                                 CAspContentList* aTaskList, TInt aType)
+	{
+	_LIT(KFormat, "%S\t%d");
+	
+	TInt taskCount = aHistoryJob->TaskCount();
+	for (TInt i=0; i<taskCount; i++)
+		{
+		const CSyncMLHistoryJob::TTaskInfo& taskInfo = aHistoryJob->TaskAt(i);
+        	
+        TInt index = aTaskList->FindProviderIndexForTask(taskInfo.iTaskId);
+        if (index == KErrNotFound)
+    	    {
+       	    continue; // profile no longer has this task
+    	    }
+       	TAspProviderItem& provider = aTaskList->ProviderItem(index);
+     
+     
+		TInt count = SyncedItemCount(taskInfo, aType);
+		if (count == 0)
+			{
+			continue;
+			}
+
+		HBufC* hBuf = LogItemTextLC(aType, provider.iDataProviderId, provider.iDisplayName);
+	    TPtr ptr = hBuf->Des();
+	    iBuf.Format(KFormat, &ptr, count);
+	    CleanupStack::PopAndDestroy(hBuf);
+	    
+       	AddLineL(aList, iBuf);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::AddTaskErrorsL
+// 
+// -----------------------------------------------------------------------------
+void CAspLogDialog::AddTaskErrorsL(CDesCArray* aList, 
+                                   const CSyncMLHistoryJob* aHistoryJob, 
+                                   CAspContentList* aTaskList)
+	{
+	_LIT(KTab, "\t");
+	
+	TInt taskCount = aHistoryJob->TaskCount();
+	for (TInt i=0; i<taskCount; i++)
+		{
+		const CSyncMLHistoryJob::TTaskInfo& taskInfo = aHistoryJob->TaskAt(i);
+        	
+        TInt index = aTaskList->FindProviderIndexForTask(taskInfo.iTaskId);
+        if (index == KErrNotFound)
+    	    {
+       	    continue; // profile no longer has this task
+    	    }
+    
+    	TAspProviderItem& provider = aTaskList->ProviderItem(index);
+  	
+		if (taskInfo.iError != KErrNone && taskInfo.iError != SyncMLError::KErrSlowSync)
+		    {
+	    	iBuf = KNullDesC;
+	    	HBufC* hBuf = CAspResHandler::GetContentNameLC(provider.iDataProviderId,
+	    	                                               provider.iDisplayName);
+	        iBuf.Append(hBuf->Des());
+	        CleanupStack::PopAndDestroy(hBuf);
+
+		    CAspResHandler::ReadL(iBuf2, R_QTN_SML_LOG_ERR); // "Incomplete"
+		    iBuf.Append(KTab);
+     	    iBuf.Append(iBuf2);
+     	    
+#ifdef _DEBUG 
+       	    TBuf<64> buf;
+     	    buf.Format(_L(" (%d)"), taskInfo.iError);
+     	    iBuf.Append(buf);
+#endif
+     	    
+     	    AddLineL(aList, iBuf);
+    		}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::PhoneModified
+// 
+// -----------------------------------------------------------------------------
+TBool CAspLogDialog::PhoneModified(const CSyncMLHistoryJob* aHistoryJob)
+	{
+	TInt taskCount = aHistoryJob->TaskCount();
+	for (TInt i=0; i<taskCount; i++)
+		{
+		const CSyncMLHistoryJob::TTaskInfo& task = aHistoryJob->TaskAt(i);
+	    
+	    TInt count = task.iServerItemsAdded + task.iServerItemsChanged +
+	                 task.iServerItemsDeleted + task.iServerItemsFailed +
+	                 task.iServerItemsMoved;
+        
+        if (count > 0)
+        	{
+        	return ETrue;
+        	}
+		}
+		
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::ServerModified
+// 
+// -----------------------------------------------------------------------------
+TBool CAspLogDialog::ServerModified(const CSyncMLHistoryJob* aHistoryJob)
+	{
+	TInt taskCount = aHistoryJob->TaskCount();
+	for (TInt i=0; i<taskCount; i++)
+		{
+		const CSyncMLHistoryJob::TTaskInfo& task = aHistoryJob->TaskAt(i);
+
+	    TInt count = task.iItemsAdded + task.iItemsChanged +
+	                 task.iItemsDeleted + task.iItemsFailed +
+	                 task.iItemsMoved;
+        
+        if (count > 0)
+        	{
+        	return ETrue;
+        	}
+		}
+		
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::HasTaskErrors
+// 
+// -----------------------------------------------------------------------------
+TBool CAspLogDialog::HasTaskErrors(const CSyncMLHistoryJob* aHistoryJob)
+	{
+	TInt taskCount = aHistoryJob->TaskCount();
+	for (TInt i=0; i<taskCount; i++)
+		{
+		const CSyncMLHistoryJob::TTaskInfo& taskInfo = aHistoryJob->TaskAt(i);
+        
+        if (taskInfo.iError != KErrNone && taskInfo.iError != SyncMLError::KErrSlowSync)
+        	{
+        	FLOG(_L("### CAspLogDialog::HasTaskErrors (%d) ###"), taskInfo.iError);
+        	return ETrue;
+        	}
+		}
+		
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::AddLineL
+// 
+// -----------------------------------------------------------------------------
+void CAspLogDialog::AddLineL(CDesCArray* aList, TDes& aText)
+	{
+	AknTextUtils::DisplayTextLanguageSpecificNumberConversion(aText);
+	aList->AppendL(aText);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::SyncedItemCount
+// 
+// -----------------------------------------------------------------------------
+TInt CAspLogDialog::SyncedItemCount(const CSyncMLHistoryJob::TTaskInfo& aTaskInfo, TInt aType)
+	{
+	TInt count = 0;
+
+	switch (aType)
+		{
+		case ELogAddedPhone:
+			count = aTaskInfo.iServerItemsAdded;
+			break;
+		case ELogUpdatedPhone:
+			count = aTaskInfo.iServerItemsChanged;
+			break;
+		case ELogDeletedPhone:
+			count = aTaskInfo.iServerItemsDeleted;
+			break;
+		case ELogDiscardedPhone:
+			count = aTaskInfo.iServerItemsFailed;
+			break;
+		case ELogMovedPhone:
+			count = aTaskInfo.iServerItemsMoved;
+			break;
+
+		case ELogAddedServer:
+			count = aTaskInfo.iItemsAdded;
+			break;
+		case ELogUpdatedServer:
+			count = aTaskInfo.iItemsChanged;
+			break;
+		case ELogDeletedServer:
+			count = aTaskInfo.iItemsDeleted;
+			break;
+		case ELogDiscardedServer:
+			count = aTaskInfo.iItemsFailed;
+			break;
+		case ELogMovedServer:
+			count = aTaskInfo.iItemsMoved;
+			break;
+
+		default:
+			break;
+		}
+
+	return count;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspLogDialog::LogItemTextLC
+// 
+// -----------------------------------------------------------------------------
+HBufC* CAspLogDialog::LogItemTextLC(TInt aType, TInt aDataProviderId, const TDesC& aDisplayName)
+	{
+	TInt resourceId = KErrNotFound;
+	
+	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
+		{
+		if (aType == ELogAddedPhone || aType == ELogAddedServer)
+			{
+			resourceId = R_QTN_SML_LOG_ADDED_CONTACTS;
+			}
+		if (aType == ELogUpdatedPhone || aType == ELogUpdatedServer)
+			{
+			resourceId = R_QTN_SML_LOG_UPDATED_CONTACTS;
+			}
+		if (aType == ELogDeletedPhone || aType == ELogDeletedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DELETED_CONTACTS;
+			}
+		if (aType == ELogDiscardedPhone || aType == ELogDiscardedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DISCARDED_CONTACTS;
+			}
+		if (aType == ELogMovedPhone || aType == ELogMovedServer)
+			{
+			resourceId = R_QTN_SML_LOG_MOVED_CONTACTS;
+			}
+		}
+	else if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
+		{
+		if (aType == ELogAddedPhone || aType == ELogAddedServer)
+			{
+			resourceId = R_QTN_SML_LOG_ADDED_CALENDAR;
+			}
+		if (aType == ELogUpdatedPhone || aType == ELogUpdatedServer)
+			{
+			resourceId = R_QTN_SML_LOG_UPDATED_CALENDAR;
+			}
+		if (aType == ELogDeletedPhone || aType == ELogDeletedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DELETED_CALENDAR;
+			}
+		if (aType == ELogDiscardedPhone || aType == ELogDiscardedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DISCARDED_CALENDAR;
+			}
+		if (aType == ELogMovedPhone || aType == ELogMovedServer)
+			{
+			resourceId = R_QTN_SML_LOG_MOVED_CALENDAR;
+			}
+		}
+	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
+		{
+		if (aType == ELogAddedPhone || aType == ELogAddedServer)
+			{
+			resourceId = R_QTN_SML_LOG_ADDED_EMAIL;
+			}
+		if (aType == ELogUpdatedPhone || aType == ELogUpdatedServer)
+			{
+			resourceId = R_QTN_SML_LOG_UPDATED_EMAIL;
+			}
+		if (aType == ELogDeletedPhone || aType == ELogDeletedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DELETED_EMAIL;
+			}
+		if (aType == ELogDiscardedPhone || aType == ELogDiscardedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DISCARDED_EMAIL;
+			}
+		if (aType == ELogMovedPhone || aType == ELogMovedServer)
+			{
+			resourceId = R_QTN_SML_LOG_MOVED_EMAIL;
+			}
+		}
+	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
+		{
+		if (aType == ELogAddedPhone || aType == ELogAddedServer)
+			{
+			resourceId = R_QTN_SML_LOG_ADDED_NOTES;
+			}
+		if (aType == ELogUpdatedPhone || aType == ELogUpdatedServer)
+			{
+			resourceId = R_QTN_SML_LOG_UPDATED_NOTES;
+			}
+		if (aType == ELogDeletedPhone || aType == ELogDeletedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DELETED_NOTES;
+			}
+		if (aType == ELogDiscardedPhone || aType == ELogDiscardedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DISCARDED_NOTES;
+			}
+		if (aType == ELogMovedPhone || aType == ELogMovedServer)
+			{
+			resourceId = R_QTN_SML_LOG_MOVED_NOTES;
+			}
+		}
+	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
+		{
+		if (aType == ELogAddedPhone || aType == ELogAddedServer)
+			{
+			resourceId = R_QTN_SML_LOG_ADDED_SMS;
+			}
+		if (aType == ELogUpdatedPhone || aType == ELogUpdatedServer)
+			{
+			resourceId = R_QTN_SML_LOG_UPDATED_SMS;
+			}
+		if (aType == ELogDeletedPhone || aType == ELogDeletedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DELETED_SMS;
+			}
+		if (aType == ELogDiscardedPhone || aType == ELogDiscardedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DISCARDED_SMS;
+			}
+		if (aType == ELogMovedPhone || aType == ELogMovedServer)
+			{
+			resourceId = R_QTN_SML_LOG_MOVED_SMS;
+			}
+		}
+	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
+		{
+		if (aType == ELogAddedPhone || aType == ELogAddedServer)
+			{
+			resourceId = R_QTN_SML_LOG_ADDED_MMS;
+			}
+		if (aType == ELogUpdatedPhone || aType == ELogUpdatedServer)
+			{
+			resourceId = R_QTN_SML_LOG_UPDATED_MMS;
+			}
+		if (aType == ELogDeletedPhone || aType == ELogDeletedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DELETED_MMS;
+			}
+		if (aType == ELogDiscardedPhone || aType == ELogDiscardedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DISCARDED_MMS;
+			}
+		if (aType == ELogMovedPhone || aType == ELogMovedServer)
+			{
+			resourceId = R_QTN_SML_LOG_MOVED_MMS;
+			}
+		}
+
+	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
+		{
+		if (aType == ELogAddedPhone || aType == ELogAddedServer)
+			{
+			resourceId = R_QTN_SML_LOG_ADDED_BKM;
+			}
+		if (aType == ELogUpdatedPhone || aType == ELogUpdatedServer)
+			{
+			resourceId = R_QTN_SML_LOG_UPDATED_BKM;
+			}
+		if (aType == ELogDeletedPhone || aType == ELogDeletedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DELETED_BKM;
+			}
+		if (aType == ELogDiscardedPhone || aType == ELogDiscardedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DISCARDED_BKM;
+			}
+		if (aType == ELogMovedPhone || aType == ELogMovedServer)
+			{
+			resourceId = R_QTN_SML_LOG_MOVED_BKM;
+			}
+		}
+	
+	else  // unknown data provider
+		{
+		if (aType == ELogAddedPhone || aType == ELogAddedServer)
+			{
+			resourceId = R_QTN_SML_LOG_ADDED_CONTENT;
+			}
+		if (aType == ELogUpdatedPhone || aType == ELogUpdatedServer)
+			{
+			resourceId = R_QTN_SML_LOG_UPDATED_CONTENT;
+			}
+		if (aType == ELogDeletedPhone || aType == ELogDeletedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DELETED_CONTENT;
+			}
+		if (aType == ELogDiscardedPhone || aType == ELogDiscardedServer)
+			{
+			resourceId = R_QTN_SML_LOG_DISCARDED_CONTENT;
+			}
+		if (aType == ELogMovedPhone || aType == ELogMovedServer)
+			{
+			resourceId = R_QTN_SML_LOG_MOVED_CONTENT;
+			}
+
+        __ASSERT_DEBUG(resourceId != KErrNotFound, TUtil::Panic(KErrGeneral));
+        
+		return CAspResHandler::ReadLC(resourceId, aDisplayName);
+		}
+	
+	__ASSERT_DEBUG(resourceId != KErrNotFound, TUtil::Panic(KErrGeneral));
+	
+    return CAspResHandler::ReadLC(resourceId);
+	}
+
+
+
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspPreSyncPluginInterface.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,177 @@
+/*
+* 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:  This implementation enumerates and returns the plugin
+*
+*/
+
+
+// INCLUDE FILES
+#include <nsmlconstants.h>
+#include "AspPreSyncPluginInterface.h"
+#include "CPreSyncPlugin.h"
+
+_LIT(kDefault,"DEFAULT");
+
+// ============================== MEMBER FUNCTIONS ============================
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::NewL
+// Two Phase Construction
+// ----------------------------------------------------------------------------
+CPreSyncPluginInterface* CPreSyncPluginInterface::NewL()
+{    
+    CPreSyncPluginInterface* self = CPreSyncPluginInterface::NewLC();
+    CleanupStack::Pop( self );
+      
+    return self;
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::NewLC
+// Two Phase Construction
+// ---------------------------------------------------------------------------- 
+CPreSyncPluginInterface* CPreSyncPluginInterface::NewLC()
+{   
+    CPreSyncPluginInterface* self = new( ELeave ) CPreSyncPluginInterface();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    
+    return self;
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::CPreSyncPluginInterface
+// Constructor
+// ----------------------------------------------------------------------------    
+CPreSyncPluginInterface::CPreSyncPluginInterface()
+{
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::ConstructL
+// 2nd phase constructor
+// ---------------------------------------------------------------------------- 
+void CPreSyncPluginInterface::ConstructL()
+{
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::~CPreSyncPluginInterface
+// Constructor
+// ---------------------------------------------------------------------------- 
+CPreSyncPluginInterface::~CPreSyncPluginInterface( ) 
+{
+    UnloadPlugIns();    
+}
+        
+/**
+* Lists all implementations which satisfy this ecom interface
+*
+* @param aImplInfoArray On return, contains the list of available implementations
+* 
+*/   
+inline void CPreSyncPluginInterface::ListAllImplementationsL( RImplInfoPtrArray& aImplInfoArray )
+{
+    REComSession::ListImplementationsL( KPreSyncPluginInterfaceUid, aImplInfoArray );
+}
+        
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::InstantiateAllPlugInsL
+// Instantiates all plugins
+// ----------------------------------------------------------------------------     
+CPreSyncPlugin* CPreSyncPluginInterface::InstantiateRoamingPluginLC( TSmlProfileId aProfileId )
+{
+    RImplInfoPtrArray infoArray;
+    TBool bHandleSync = EFalse;
+    CPreSyncPlugin* syncPlugin = NULL;
+    CPreSyncPlugin* defaultSyncPlugin = NULL;
+
+	CleanupRImplInfoPtrArrayPushL( &infoArray );
+
+    // Get list of all implementations
+    TRAPD(error, ListAllImplementationsL( infoArray ));
+    
+    if (error != KErrNone)
+        {
+		CleanupStack::PopAndDestroy( &infoArray );
+		User::Leave( error );
+        }
+    // Instantiate plugins for all impUIds by calling 
+    // InstantiatePlugInFromImpUidL
+    for ( TInt i=0; i<infoArray.Count(); i++ )
+        {
+        // Get imp info
+        CImplementationInformation& info( *infoArray[i] );
+
+		TUid impUid ( info.ImplementationUid() );	        
+	    
+
+        if ( info.DisplayName().Compare(kDefault) == 0 )
+            {			
+	        //instantiate plugin for impUid
+	        defaultSyncPlugin = InstantiatePlugInFromImpUidL( impUid );
+			defaultSyncPlugin->SetProfile(aProfileId);
+			break;
+            }
+		else
+		    {
+			syncPlugin = InstantiatePlugInFromImpUidL( impUid );
+			syncPlugin->SetProfile(aProfileId);
+			if(syncPlugin->IsSupported())
+			    {
+				bHandleSync = ETrue;
+				break;
+			    }
+			else
+			    {
+                delete syncPlugin;
+			    }
+		    }
+        }
+
+    CleanupStack::PopAndDestroy( &infoArray );
+	if(bHandleSync)
+	{		
+		delete defaultSyncPlugin;
+	    CleanupStack::PushL(syncPlugin);
+		return syncPlugin;
+	}
+	else
+	{      
+        CleanupStack::PushL(defaultSyncPlugin);
+		return defaultSyncPlugin;
+	}    
+ }
+
+// -----------------------------------------------------------------------------
+// CPreSyncPluginInterface::UnloadPlugIns
+// Unloads plugins
+// -----------------------------------------------------------------------------
+void CPreSyncPluginInterface::UnloadPlugIns()
+{    
+    REComSession::FinalClose();
+}
+
+// ----------------------------------------------------------------------------
+// CPreSyncPluginInterface::InstantiatePlugInFromImpUidL
+// Instantiates plugin
+// ---------------------------------------------------------------------------- 
+CPreSyncPlugin* CPreSyncPluginInterface::InstantiatePlugInFromImpUidL( const TUid& aImpUid )
+{    
+   // REComSession
+    CPreSyncPlugin *preSyncPlugin = CPreSyncPlugin::NewL(aImpUid);    
+    return preSyncPlugin;
+}
+    
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspProfile.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,4639 @@
+/*
+* 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:  
+*
+*/
+
+
+
+// INCLUDES
+
+#include <SyncMLTransportProperties.h>
+#include <featmgr.h>   // FeatureManager
+#include <centralrepository.h> // CRepository
+#include <NsmlOperatorDataCRKeys.h> // KCRUidOperatorDatasyncInternalKeys
+
+#include <calsession.h>
+#include <calcalendarinfo.h>
+#include <e32math.h>
+#include <gdi.h>
+
+#include "AspProfile.h"
+#include "AspResHandler.h"
+#include "AspDialogUtil.h"
+#include "AspDebug.h"
+#include "AspSchedule.h"
+#include "AspDefines.h"
+#include <centralrepository.h> //CRepository
+#include <calenmulticaluids.hrh> // Calendar File Meta Data Properties
+#include <calenmulticalutil.h>
+#include <CalenInterimUtils2.h>
+
+_LIT(KCharUnderscore, "_");
+_LIT( KNSmlAgendaFileNameForDefaultDB, "c:calendar" );
+
+/*******************************************************************************
+ * class TAspProviderItem
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// TAspProviderItem::CompareItems
+//
+// -----------------------------------------------------------------------------
+//
+TInt TAspProviderItem::CompareItems(const TAspProviderItem& aFirst, const TAspProviderItem& aSecond)
+	{
+	const TInt KNegative = -1;
+	const TInt KPositive = 1;
+	
+	TInt firstOrder = SortOrder(aFirst.iDataProviderId);
+	TInt secondOrder = SortOrder(aSecond.iDataProviderId);
+	
+	if (firstOrder > secondOrder)
+		{
+		return KNegative;
+		}
+	else if (secondOrder > firstOrder)
+		{
+		return KPositive;
+		}
+	else
+		{
+		return 0;
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// TAspProviderItem::CompareItems
+//
+// -----------------------------------------------------------------------------
+//
+TInt TAspProviderItem::SortOrder(TInt aDataProviderId)
+	{
+	TInt ret = EOrderOther;
+	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
+		{
+		ret = EOrderContact;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
+		{
+		ret = EOrderCalendar;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
+		{
+		ret = EOrderNotes;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
+		{
+		ret = EOrderEmail;
+		}
+	return ret;
+	}
+	
+	
+
+/*******************************************************************************
+ * class CAspContentList
+ *******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::NewLC
+//
+// -----------------------------------------------------------------------------
+//
+CAspContentList* CAspContentList::NewLC(const TAspParam& aParam)
+    {
+   	FLOG( _L("CAspContentList::NewLC START") );
+   	
+    CAspContentList* self = new (ELeave) CAspContentList(aParam);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+
+    FLOG( _L("CAspContentList::NewLC END") );
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspContentList* CAspContentList::NewL(const TAspParam& aParam)
+    {
+   	FLOG( _L("CAspContentList::NewL START") );
+   	
+    CAspContentList* self = new (ELeave) CAspContentList(aParam);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+    FLOG( _L("CAspContentList::NewL END") );
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspContentList::~CAspContentList()
+    {
+	iProviderList.Close();
+	iTaskList.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::ConstructL(void)
+    {
+	if (iListMode == EInitDataProviders)
+		{
+        InitDataProvidersL();
+		}
+	else if (iListMode == EInitTasks)
+		{
+		__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+		
+        InitAllTasksL();
+		}
+	else 
+		{
+		__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+		
+		InitDataProvidersL();
+		InitAllTasksL();
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::CAspContentList
+//
+// -----------------------------------------------------------------------------
+//
+CAspContentList::CAspContentList(const TAspParam& aParam)
+	{
+	iSyncSession = aParam.iSyncSession;
+	iProfile = aParam.iProfile;
+	iListMode = aParam.iMode;
+	iApplicationId = aParam.iApplicationId;
+
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrGeneral));
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::SetProfile
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::SetProfile(CAspProfile* aProfile)
+	{
+	if (aProfile)
+		{
+
+	    __ASSERT_ALWAYS(iProfile == NULL, TUtil::Panic(KErrGeneral));
+
+		}
+
+	iProfile = aProfile;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::IsLocked
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspContentList::IsLocked()
+	{
+	if (iProfile)
+		{
+		return ETrue;
+		}
+		
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::ProviderCount
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspContentList::ProviderCount()
+	{
+	return iProviderList.Count();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::ProviderItem
+// 
+// -----------------------------------------------------------------------------
+//
+TAspProviderItem& CAspContentList::ProviderItem(TInt aIndex)
+	{
+	if (aIndex < 0 || aIndex >= ProviderCount())
+	    {
+		TUtil::Panic(KErrArgument);
+	    }
+
+	return iProviderList[aIndex];
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::FindProviderIndex
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspContentList::FindProviderIndex(TInt aId)
+	{
+	TInt count = iProviderList.Count();
+	
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProviderItem& item = iProviderList[i];
+		if (item.iDataProviderId == aId)
+			{
+			return i;
+			}
+		}
+		
+	return KErrNotFound;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::FindProviderIndexForTask
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspContentList::FindProviderIndexForTask(TInt aId)
+	{
+	TInt index = FindTaskIndex(aId);
+	if (index == KErrNotFound)
+		{
+		return KErrNotFound;
+		}
+	
+	TAspTaskItem& item = TaskItem(index);
+	
+	return FindProviderIndex(item.iDataProviderId);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::TaskCount
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspContentList::TaskCount()
+	{
+	return iTaskList.Count();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::TaskItem
+// 
+// -----------------------------------------------------------------------------
+//
+TAspTaskItem& CAspContentList::TaskItem(TInt aIndex)
+	{
+	if ((aIndex < 0) || (aIndex >= TaskCount()))
+	    {
+		TUtil::Panic(KErrArgument);
+	    }
+
+	return iTaskList[aIndex];
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::FindTaskIndex
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspContentList::FindTaskIndex(TInt aId)
+	{
+	TInt count = iTaskList.Count();
+	
+	for (TInt i=0; i<count; i++)
+		{
+		TAspTaskItem& task = iTaskList[i];
+		if (task.iTaskId == aId)
+			{
+			return i;
+			}
+		}
+		
+	return KErrNotFound;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::FindTaskIndexForProvider
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspContentList::FindTaskIndexForProvider(TInt aId)
+	{
+	TInt count = iTaskList.Count();
+	
+	for (TInt i=0; i<count; i++)
+		{
+		TAspTaskItem& item = iTaskList[i];
+		if (item.iDataProviderId == aId)
+			{
+			return i;
+			}
+		}
+		
+	return KErrNotFound;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::FindTaskIdForProvider
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspContentList::FindTaskIdForProvider(TInt aId)
+	{
+	TInt index = FindTaskIndexForProvider(aId);
+	if (index == KErrNotFound)
+		{
+		return KErrNotFound;
+		}
+		
+	TAspTaskItem& item = iTaskList[index];
+	return item.iTaskId;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::DoInitDataProvidersL
+// 
+// Initialize data provider list.
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::DoInitDataProvidersL()
+	{
+	FLOG( _L("CAspContentList::DoInitDataProvidersL START") );
+	
+	iProviderList.Reset();
+	
+	RArray<TSmlDataProviderId> arr;
+	
+	Session().ListDataProvidersL(arr);
+	CleanupClosePushL(arr);
+
+	TBool operatorProfile = CAspProfile::IsOperatorProfileL(iProfile);
+	TInt operatorUid = CAspProfile::OperatorAdapterUidL();
+	TInt profileUid = CAspProfile::ProfileAdapterUidL();
+	
+	TInt count = arr.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		RSyncMLDataProvider provider;
+		TInt id = arr[i];
+		
+		TRAPD(err, provider.OpenL(Session(), id));
+	
+		if (err == KErrNone)
+			{
+    		CleanupClosePushL(provider);
+
+	    	TAspProviderItem item;
+		    ReadDataProviderItemL(provider, item);
+		    if( (item.iDataProviderId == KUidNsmlAdapterCntGrps.iUid) ||
+		             (item.iDataProviderId == KUidNSmlAdapterSms.iUid) || 
+		             (item.iDataProviderId == KUidNSmlAdapterMMS.iUid) ||
+		             (item.iDataProviderId == KUidNsmlAdapterMedia.iUid))
+		        {
+		          CleanupStack::PopAndDestroy(&provider);
+		          continue;
+		        }
+            item.iIsIncludedInSync = EFalse;
+		    
+		    if (TUtil::IsEmpty(item.iDisplayName))
+		    	{
+		    	// providers must have display name
+		    	CleanupStack::PopAndDestroy(&provider);
+		    	FTRACE( RDebug::Print(_L("### provider has no display name (id=%x) ###"), item.iDataProviderId) );
+		    	continue;
+		    	}
+
+		    if ( iApplicationId == 0 )
+		        {
+                if( operatorUid != KUidNSmlAdapterContact.iUid &&
+                    operatorUid != 0 )
+                    {
+                    // Dedicated operator specific adapter in use
+                    if ( operatorProfile )
+                        {
+                        // Operator profile: show other adapters than platform's 
+                        //  contacts adapter
+                        if ( id != KUidNSmlAdapterContact.iUid )
+                            {
+                            User::LeaveIfError(iProviderList.Append(item)); 
+                            }
+                        }
+                    else
+                        {
+                        // Non-operator profile: show other adapters than
+                        //  operator specific contacts adapter & profile adapter
+                        if ( id != operatorUid && id != profileUid )
+                            {
+                            User::LeaveIfError(iProviderList.Append(item));
+                            }
+                        }
+                    }
+                else
+                    {
+                    // Platform's contacts adapter used as operator adapter
+                    if( operatorProfile || 
+                        ( !operatorProfile && id != profileUid ) )
+                        {
+                        User::LeaveIfError(iProviderList.Append(item));
+                        }
+                    }
+                }
+		    else
+		        {
+                User::LeaveIfError(iProviderList.Append(item));
+		        }
+            
+	        CleanupStack::PopAndDestroy(&provider);
+		    }
+		    
+		if (err != KErrNone)
+			{
+			FTRACE( RDebug::Print(_L("### RSyncMLDataProvider::Open failed (id=%x, err=%d) ###"), id, err) );
+			}
+		
+		}
+		
+	CleanupStack::PopAndDestroy(&arr);
+	
+	FLOG( _L("CAspContentList::DoInitDataProvidersL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::UpdateDataProviderL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::UpdateDataProviderL(TInt aDataProviderId)
+	{
+	TInt index = FindProviderIndex(aDataProviderId);
+	if (index == KErrNotFound)
+		{
+		return;  // unknown provider
+		}
+	TAspProviderItem& providerItem = ProviderItem(index);
+		
+	RArray<TSmlDataProviderId> arr;
+	Session().ListDataProvidersL(arr);
+	CleanupClosePushL(arr);
+
+	TInt count = arr.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		RSyncMLDataProvider provider;
+		TInt id = arr[i];
+		
+		TRAPD(err, provider.OpenL(Session(), id));
+	
+		if (err == KErrNone)
+			{
+    		CleanupClosePushL(provider);
+
+		    TInt id = provider.Identifier();
+		    if (id == aDataProviderId)
+		    	{
+       		    ReadDataProviderItemL(provider, providerItem);
+       		    CleanupStack::PopAndDestroy(&provider);
+       		    break;
+		    	}
+       
+	        CleanupStack::PopAndDestroy(&provider);
+		    }
+		}
+		
+	CleanupStack::PopAndDestroy(&arr);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::ReadDataProviderItemL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::ReadDataProviderItemL(RSyncMLDataProvider& aProvider, 
+                                            TAspProviderItem& aItem)
+	{
+    aItem.iTaskId=KErrNotFound;
+	aItem.iDataProviderId = aProvider.Identifier();
+		    
+    aItem.iSyncProtocol = ESmlVersion1_2;
+    //item.iSyncProtocol = provider.RequiredProtocolVersionL();
+		    
+		    
+    aItem.iAllowMultipleDataStores = aProvider.AllowsMultipleDataStores();
+    TUtil::StrCopy(aItem.iDisplayName, aProvider.DisplayName());
+	
+    TPtrC ptr = aProvider.DefaultDataStoreName();
+    if (TUtil::IsEmpty(ptr))
+    	{
+    	aItem.iHasDefaultDataStore = EFalse;
+    	aItem.iDefaultDataStore = KNullDesC;
+    	}
+    else
+    	{
+    	aItem.iHasDefaultDataStore = ETrue;
+    	TUtil::StrCopy(aItem.iDefaultDataStore, ptr);
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::InitDataProvidersL
+// 
+// Initialize data provider list.
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::InitDataProvidersL()
+	{
+
+#ifdef _DEBUG
+   	TTime time_1 = TUtil::TimeBefore();
+#endif
+
+    DoInitDataProvidersL();
+    Sort();
+    
+#ifdef _DEBUG
+   	TUtil::TimeAfter(time_1, _L("CAspContentList::DoInitDataProvidersL took"));
+#endif
+
+
+#ifndef __SYNCML_DS_EMAIL   // KFeatureIdSyncMlDsEmail
+    RemoveDataProvider(KUidNSmlAdapterEMail.iUid);
+#endif
+
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// CAspContentList::RemoveDataProvider
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::RemoveDataProvider(TInt aDataProviderId)
+	{
+    TInt index = FindProviderIndex(aDataProviderId);
+        
+    // remove data provider with id aDataProviderId
+    if (index != KErrNotFound)
+    	{
+    	iProviderList.Remove(index);
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::InitAllTasksL
+//
+// Initialize task list.
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::InitAllTasksL()
+	{
+	FLOG( _L("CAspContentList::InitAllTasksL START") );
+	
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+	
+	iTaskList.Reset();
+	
+	RArray<TSmlTaskId> arr;
+    
+	iProfile->Profile().ListTasksL(arr); // IPC call
+	CleanupClosePushL(arr);
+	
+	TInt count = arr.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		TAspTaskItem item = ReadTaskItemL(iProfile->Profile(), arr[i]);
+		
+		item.iLastSync = iProfile->LastSync(item.iTaskId);
+		
+    	User::LeaveIfError(iTaskList.Append(item));
+		}
+		
+	
+    CleanupStack::PopAndDestroy(&arr);
+    
+    FLOG( _L("CAspContentList::InitAllTasksL END") );
+	}
+
+// -----------------------------------------------------------------------------
+// CAspContentList::UpdateLocalDatabaseL()
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::UpdateLocalDatabaseL()
+{
+	InitDataProvidersL();
+	InitAllTasksL();
+	RSyncMLDataProvider provider;
+	TRAPD(err, provider.OpenL(Session(), KUidNSmlAdapterEMail.iUid));
+	
+	if (err == KErrNone)
+		{
+    	CleanupClosePushL(provider);
+    	TAspProviderItem item;
+		ReadDataProviderItemL(provider, item);
+		}
+	TInt index = FindTaskIdForProvider( KUidNSmlAdapterEMail.iUid);
+	if (index != KErrNotFound)
+		{
+		TAspTaskItem emailItem = ReadTaskItemL(iProfile->Profile(), index);
+
+		CDesCArray* databaseList = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
+		CleanupStack::PushL(databaseList);
+		GetLocalDatabaseList(KUidNSmlAdapterEMail.iUid, databaseList);
+	
+		TInt count = databaseList->Count();
+		TBool taskUpdated = EFalse;
+		for (TInt i = 0; i < count ;i++)
+			{
+			
+			if ((*databaseList)[i].Compare(emailItem.iClientDataSource) == 0)
+				{
+				taskUpdated = ETrue;
+				break;
+				}
+			}
+		if (!taskUpdated)
+			{
+			TBuf<KBufSize> aLocalDatabase;
+			TBuf<KBufSize> aRemoteDatabase;
+			TInt aSyncDirection;
+			TBool aTaskEnabled;
+			ReadTaskL(KUidNSmlAdapterEMail.iUid, aLocalDatabase, aRemoteDatabase,
+		    	               aTaskEnabled, aSyncDirection);
+			
+			if(count == 0) 
+			{
+				if(aLocalDatabase != KNullDesC)
+				{
+					aLocalDatabase = KNullDesC;
+					aTaskEnabled = EFalse;
+					
+					CreateTaskL(KUidNSmlAdapterEMail.iUid,aLocalDatabase , aRemoteDatabase,
+	                              aTaskEnabled, aSyncDirection);
+	                				
+				}
+			}
+			else
+			{
+				aLocalDatabase = provider.DefaultDataStoreName();
+				CreateTaskL(KUidNSmlAdapterEMail.iUid,aLocalDatabase , aRemoteDatabase,
+	                              aTaskEnabled, aSyncDirection);
+			
+			}
+			
+			
+
+			}
+		
+		
+		CleanupStack::PopAndDestroy(databaseList);
+		}
+
+	if (err == KErrNone)
+	{
+	CleanupStack::PopAndDestroy(&provider);
+	}
+}
+
+// -----------------------------------------------------------------------------
+// CAspContentList::InitTaskL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::InitTaskL(TInt aTaskId)
+	{
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+	
+    TAspTaskItem task = ReadTaskItemL(iProfile->Profile(), aTaskId);
+    
+    // try to remove old task
+    TInt index = FindTaskIndex(aTaskId);
+    if (index != KErrNotFound)
+    	{
+    	iTaskList.Remove(index);
+    	}
+    
+    task.iLastSync = iProfile->LastSync(aTaskId);
+	
+	// add new task
+	User::LeaveIfError(iTaskList.Append(task));
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::RemoveTask
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::RemoveTask(TInt aDataProviderId)
+	{
+    TInt index = FindTaskIndexForProvider(aDataProviderId);
+        
+    // remove task that uses dataprovider aDataProviderId
+    if (index != KErrNotFound)
+    	{
+    	iTaskList.Remove(index);
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::RemoveAllTasks
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::RemoveAllTasks()
+	{
+   	iTaskList.Reset();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::ReadTaskItemL
+//
+// Reads one task from sync profile.
+// -----------------------------------------------------------------------------
+//
+TAspTaskItem CAspContentList::ReadTaskItemL(RSyncMLDataSyncProfile& aProfile, TInt aTaskId)
+	{
+	RSyncMLTask task;
+	TAspTaskItem item;
+
+#ifdef _DEBUG	
+	TTime _time = TUtil::TimeBefore();
+#endif
+	
+	TRAPD(err, task.OpenL(aProfile, aTaskId));  // IPC call
+	if (err != KErrNone)
+		{
+		FLOG( _L("### RSyncMLTask::OpenL failed (id=%d, err=%d) ###"), aTaskId, err );
+	    User::Leave(err);
+		}
+
+#ifdef _DEBUG		
+	TUtil::TimeAfter(_time, _L("*RSyncMLTask::Open took"));
+#endif	
+		
+   	item.iTaskId = aTaskId; 
+	TUtil::StrCopy(item.iDisplayName, task.DisplayName());
+	item.iSyncDirection = TAspTask::SyncDirection(task.DefaultSyncType());
+	
+	item.iDataProviderId = task.DataProvider();
+	item.iEnabled = task.Enabled();
+
+	item.iClientDataSource = task.ClientDataSource();
+    item.iLocalDatabaseDefined = EFalse;
+    item.iRemoteDatabaseDefined = EFalse;
+	if (!TUtil::IsEmpty(task.ClientDataSource()))
+		{
+		item.iLocalDatabaseDefined = ETrue;
+		}
+	if (!TUtil::IsEmpty(task.ServerDataSource()))
+		{
+		item.iRemoteDatabaseDefined = ETrue;
+		}
+	
+	task.Close();
+	
+	return item;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::Session
+// 
+// -----------------------------------------------------------------------------
+//
+RSyncMLSession& CAspContentList::Session()
+	{
+	__ASSERT_DEBUG(iSyncSession, TUtil::Panic(KErrGeneral));
+	
+	return *iSyncSession;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::CheckMandatoryDataL
+//
+// Function checks that all tasks have mandatory data.
+// -----------------------------------------------------------------------------
+//
+TInt CAspContentList::CheckMandatoryDataL(TInt& aContentCount)
+	{
+	aContentCount = 0;
+	TInt goodContentCount = 0;
+
+	TInt count = iTaskList.Count();
+
+	for (TInt i=0; i<count; i++)
+		{
+		TAspTaskItem& task = iTaskList[i];
+
+		if (!task.iEnabled)
+			{
+			continue; // task not part of sync - no need to check mandatory fields
+			}
+			
+		if (iApplicationId != KErrNotFound && iApplicationId != EApplicationIdSync)
+			{
+			TInt appId = TUtil::AppIdFromProviderId(task.iDataProviderId);
+			if (appId != iApplicationId)
+				{
+				continue; // task not part of sync - no need to check mandatory fields
+				}
+			}
+			
+       	if (!task.iRemoteDatabaseDefined)
+			{
+			aContentCount = goodContentCount;
+		    return EMandatoryNoRemoteDatabase;
+			}
+       	
+       	if (task.iDataProviderId == KUidNSmlAdapterCalendar.iUid)
+       	    {
+            TBool status = EFalse;
+            status = IsValidClientDataSourceL( task.iClientDataSource );
+       	    if ( !status )
+       	        {
+       	        TInt index = FindProviderIndex(task.iDataProviderId);
+       	        TAspProviderItem& provider = ProviderItem(index);
+       	              	        
+                TBuf<KBufSize> localDatabase;
+       	        TBuf<KBufSize> remoteDatabase;
+       	        TInt syncDirection;
+       	        TBool taskEnabled;
+       	        ReadTaskL(provider.iDataProviderId, localDatabase, remoteDatabase,
+       	           taskEnabled, syncDirection);
+       	        
+       	        //Creating new task creates new calendar local database
+                CreateTaskL(provider.iDataProviderId, localDatabase, remoteDatabase,
+                   taskEnabled, syncDirection);
+                
+                InitAllTasksL();
+                InitDataProvidersL();
+       	        }
+       	    
+       	    }
+
+		goodContentCount++;
+		}
+
+    aContentCount = goodContentCount;
+    
+    if (goodContentCount > 0)
+		{
+       	return EMandatoryOk;
+		}
+	else
+		{
+		return EMandatoryNoContent;
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::IncludeTasks
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::IncludeTasks(const CArrayFix<TInt>* aIncludedProviderList)
+	{
+	// update iIsIncludedInSync for all provider items (used in IncludeTaskL)
+	SetIncludedProviders(aIncludedProviderList);
+	
+	TInt count = iProviderList.Count();
+	
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProviderItem& item = iProviderList[i];
+		TRAPD(err, IncludeTaskL(item));
+		
+		if (err != KErrNone)
+			{
+			FLOG( _L("### CAspContentList::IncludeTaskL failed (id=%x, err=%d) ###"), item.iDataProviderId, err );
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::SetIncludedProviders
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::SetIncludedProviders(const CArrayFix<TInt>* aIncludedProviderList)
+	{
+	// exclude all providers
+	TInt providerCount = iProviderList.Count();
+	for (TInt i=0; i<providerCount; i++)
+		{
+        (iProviderList[i]).iIsIncludedInSync = EFalse;
+		}
+		
+	// include selected providers (aIncludedProviderList comes from ui)
+	TInt count = aIncludedProviderList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+        TInt index = (*aIncludedProviderList)[i];
+        
+        __ASSERT_ALWAYS(index>=0, TUtil::Panic(KErrGeneral));
+        __ASSERT_ALWAYS(index<providerCount, TUtil::Panic(KErrGeneral));
+        
+        (iProviderList[index]).iIsIncludedInSync = ETrue;
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::GetIncludedProviders
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::GetIncludedProviders(CArrayFix<TInt>* aIncludedProviderList)
+	{
+
+	// get list indexes of data providers with enabled task
+	
+	TInt count = iProviderList.Count();
+	
+	for (TInt i=0; i<count; i++)
+		{
+        TAspProviderItem& item = iProviderList[i];
+        TInt index = FindTaskIndexForProvider(item.iDataProviderId);
+        if (index != KErrNotFound)
+        	{
+        	TAspTaskItem& item2 = iTaskList[index];
+        	if (item2.iEnabled)
+        		{
+        		TRAP_IGNORE(aIncludedProviderList->AppendL(i));
+        		}
+        	}
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::IncludeTaskL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::IncludeTaskL(TAspProviderItem& aDataProvider)
+	{
+	if (!aDataProvider.iIsIncludedInSync)
+		{
+		// exclude task (if exists) from sync
+		ModifyTaskIncludedL(aDataProvider, EFalse, KNullDesC);
+		return;
+		}
+	
+	TInt index = FindTaskIndexForProvider(aDataProvider.iDataProviderId);
+	if (index == KErrNotFound)
+		{
+		// task does not exist - create new
+	    TInt id = CreateTaskL(aDataProvider);
+	    InitTaskL(id);
+		}
+	else
+	 	{
+	 	// include in sync
+		ModifyTaskIncludedL(aDataProvider, ETrue, KNullDesC);
+	 	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::ModifyTaskIncludedL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::ModifyTaskIncludedL(TInt aDataProviderId, TBool aIsIncluded, const TDesC& aLocalDatabase)
+	{
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+	
+    TInt index = FindProviderIndex(aDataProviderId);
+	if (index != KErrNotFound)
+		{
+		TAspProviderItem& item = iProviderList[index];
+		if (!TUtil::IsEmpty(aLocalDatabase))
+		{
+			ModifyTaskIncludedL(item, aIsIncluded, aLocalDatabase);	
+		}
+		else
+		{
+			ModifyTaskIncludedL(item, aIsIncluded, KNullDesC);
+		}
+	}
+	}
+
+// -----------------------------------------------------------------------------
+// CAspContentList::ModifyTaskIncludedL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::ModifyTaskIncludedL(TAspProviderItem& aProvider, TBool aIsIncluded, const TDesC& aLocalDatabase)
+	{
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+	
+	TInt index = FindTaskIndexForProvider(aProvider.iDataProviderId);
+	if (index == KErrNotFound)
+		{
+		if (!TUtil::IsEmpty(aLocalDatabase) && (aProvider.iDataProviderId == KUidNSmlAdapterEMail.iUid))
+		{
+			CreateTaskL(aProvider.iDataProviderId,aLocalDatabase,KNullDesC,ETrue,TAspTask::SyncDirection(SmlSyncDirection()));
+	 		iProfile->Profile().UpdateL();
+	 			 
+	    }
+		return; // no task for this provider
+		}
+		
+	TAspTaskItem& item = iTaskList[index];
+	if ((item.iEnabled == aIsIncluded) && (aProvider.iDataProviderId != KUidNSmlAdapterEMail.iUid))
+		{
+		return; // nothing to modify
+		}
+	
+	if(aProvider.iDataProviderId == KUidNSmlAdapterEMail.iUid)
+	{
+	RSyncMLTask task;
+	CleanupClosePushL(task);
+    
+	task.OpenL(iProfile->Profile(), item.iTaskId);
+	if (!TUtil::IsEmpty(aLocalDatabase))
+	{
+		CreateTaskL(aProvider.iDataProviderId,aLocalDatabase,task.ServerDataSource(),
+	 			 ETrue,TAspTask::SyncDirection(task.DefaultSyncType()));
+	
+	}
+
+	task.SetEnabledL(aIsIncluded);
+	// store task into database
+	task.UpdateL();
+	
+	iProfile->Profile().UpdateL();
+	
+	item.iEnabled = aIsIncluded;
+	CleanupStack::PopAndDestroy(&task);
+	}
+	else
+	{
+		RSyncMLTask task;
+		CleanupClosePushL(task);
+    
+	task.OpenL(iProfile->Profile(), item.iTaskId);
+	task.SetEnabledL(aIsIncluded);
+	
+	// store task into database
+	task.UpdateL();
+	iProfile->Profile().UpdateL();
+	
+	item.iEnabled = aIsIncluded;
+	
+	CleanupStack::PopAndDestroy(&task);
+	}
+	}
+
+// -----------------------------------------------------------------------------
+// CAspContentList::ModifyTaskDirectionL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::ModifyTaskDirectionL(TAspProviderItem& aProvider, TInt aSyncDirection)
+	{
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+	
+	TInt index = FindTaskIndexForProvider(aProvider.iDataProviderId);
+	if (index == KErrNotFound)
+		{
+		return; // no task for this provider
+		}
+		
+	TAspTaskItem& item = iTaskList[index];
+	if (item.iSyncDirection == aSyncDirection)
+		{
+		return; // nothing to modify
+		}
+	
+	RSyncMLTask task;
+	CleanupClosePushL(task);
+    
+	task.OpenL(iProfile->Profile(), item.iTaskId);
+	task.SetDefaultSyncTypeL(TAspTask::SmlSyncDirection(aSyncDirection));
+	
+	// store task into database
+	task.UpdateL();
+	iProfile->Profile().UpdateL();
+	
+	item.iSyncDirection = aSyncDirection;
+	
+	CleanupStack::PopAndDestroy(&task);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::ModifyTaskDirectionsL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::ModifyTaskDirectionsL(TInt aSyncDirection)
+	{
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+	
+	TInt count = iProviderList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+        TAspProviderItem& item = iProviderList[i];
+        ModifyTaskDirectionL(item, aSyncDirection);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::CheckTaskDirectionsL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspContentList::CheckTaskDirectionsL()
+	{
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+
+    TInt previous = KErrNotFound;
+    
+	TInt count = iTaskList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+        TAspTaskItem& item = iTaskList[i];
+        if (item.iSyncDirection != previous && previous != KErrNotFound)
+        	{
+        	return EFalse;
+        	}
+        	
+        previous = item.iSyncDirection;
+		}
+		
+	return ETrue;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::CreateTaskL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspContentList::CreateTaskL(TAspProviderItem& aDataProvider)
+	{
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+		
+	if (!aDataProvider.iHasDefaultDataStore)
+		{
+		User::Leave(KErrNotFound);
+		}
+		
+	RSyncMLTask task;
+	CleanupClosePushL(task);
+	
+	if (aDataProvider.iDataProviderId == KUidNSmlAdapterCalendar.iUid )
+        {
+        TBuf<128> calLocalDb ;
+        CreateCalLocalDatabaseL(calLocalDb);        
+        task.CreateL(iProfile->Profile(), aDataProvider.iDataProviderId, 
+                KNullDesC, calLocalDb);
+        }
+    else
+        {
+        task.CreateL(iProfile->Profile(), aDataProvider.iDataProviderId, 
+	              KNullDesC, aDataProvider.iDefaultDataStore);
+        }
+	task.SetEnabledL(aDataProvider.iIsIncludedInSync);
+	task.SetDefaultSyncTypeL(SmlSyncDirection());
+	
+	// store task into database
+	task.UpdateL();
+	iProfile->Profile().UpdateL();
+	
+	TInt id = task.Identifier();
+	
+	CleanupStack::PopAndDestroy(&task);
+	
+	return id;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::CreateTaskL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::CreateTaskL(TInt aDataProviderId,
+                                  const TDesC& aLocalDatabase,
+                                  const TDesC& aRemoteDatabase,
+                                  TBool aEnabled, TInt aSyncDirection)
+	{
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+		
+	TInt providerIndex = FindProviderIndex(aDataProviderId);
+	if (providerIndex == KErrNotFound)
+		{
+		return;
+		}
+	 
+	// remove existing task for aDataProviderId
+    TInt taskIndex = FindTaskIndexForProvider(aDataProviderId);
+    if (taskIndex != KErrNotFound)
+    	{
+    	TAspTaskItem& item = TaskItem(taskIndex);
+        iProfile->Profile().DeleteTaskL(item.iTaskId);
+        iProfile->Profile().UpdateL();
+        RemoveTask(aDataProviderId);  // remove deleted task from task list   	
+    	}
+    
+    TAspProviderItem& item = ProviderItem(providerIndex);
+    
+	RSyncMLTask task;
+	CleanupClosePushL(task);
+	
+	if (TUtil::IsEmpty(aLocalDatabase))
+		{
+		if(!ProviderItem(providerIndex).iHasDefaultDataStore)
+			{
+			// defult data store name was probably truncated
+			task.CreateL(iProfile->Profile(), aDataProviderId, 
+			             aRemoteDatabase, KNullDesC);
+			aEnabled = EFalse;
+			}
+		else
+			{
+			if (aDataProviderId == KUidNSmlAdapterCalendar.iUid )
+                {
+                TBuf<KBufSize> calLocalDb ;
+				TRAPD(err ,RetrieveCalLocalDatabaseL(calLocalDb));
+				if (err != KErrNone)
+					{
+					CreateCalLocalDatabaseL(calLocalDb);
+					}								
+                task.CreateL(iProfile->Profile(), aDataProviderId, 
+                                              aRemoteDatabase, calLocalDb);
+                }
+            else
+                {
+                task.CreateL(iProfile->Profile(), aDataProviderId, 
+			             aRemoteDatabase, item.iDefaultDataStore);
+                }
+			}
+		}
+	else
+		{
+		if (aDataProviderId == KUidNSmlAdapterCalendar.iUid )
+		    {
+		    TBuf<128> calLocalDb ;
+		    TRAPD(err ,RetrieveCalLocalDatabaseL(calLocalDb));
+		    if (err != KErrNone)
+		        {
+		        CreateCalLocalDatabaseL(calLocalDb);
+		        }		    
+		    task.CreateL(iProfile->Profile(), aDataProviderId, 
+		                                  aRemoteDatabase, calLocalDb);
+		    }
+		else
+		    {
+		    task.CreateL(iProfile->Profile(), aDataProviderId, 
+		                                              aRemoteDatabase, aLocalDatabase);
+		    }
+		}
+	
+	task.SetEnabledL(aEnabled);
+	task.SetDefaultSyncTypeL(TAspTask::SmlSyncDirection(aSyncDirection));
+	
+	// store task into database
+	task.UpdateL();
+	iProfile->Profile().UpdateL();
+	
+	CleanupStack::PopAndDestroy(&task);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::CreateTask
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::CreateTask(TInt aDataProviderId, 
+                                 const TDesC& aLocalDatabase,
+                                 const TDesC& aRemoteDatabase,
+                                 TBool aEnabled, TInt aSyncDirection)
+	{
+	FLOG( _L("CAspContentList::CreateTask START") );
+	
+	TRAPD(err, CreateTaskL(aDataProviderId, aLocalDatabase, aRemoteDatabase, aEnabled, aSyncDirection));
+	
+	if (err != KErrNone)
+		{
+		FLOG( _L("### CreateTask failed (id=%x err=%d) ###"), aDataProviderId, err );
+		}
+		
+	FLOG( _L("CAspContentList::CreateTask END") );
+	}
+
+// -----------------------------------------------------------------------------
+// CAspContentList::CreateTask
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::CreateCalLocalDatabaseL(TDes& aCalName)
+    {
+                
+    
+    TBuf<KBufSize> buffer;
+    iProfile->GetName(buffer);
+	
+	TInt currentProfileId = iProfile->ProfileId();
+	
+	if (buffer.Compare(KAutoSyncProfileName) == 0)
+		{
+		CAspSchedule* schedule = CAspSchedule::NewLC();
+		currentProfileId = schedule->ProfileId();
+		TAspParam param(iApplicationId, iSyncSession);
+		CAspProfile* selectedProfile = CAspProfile::NewLC(param);
+		selectedProfile->OpenL(currentProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+		selectedProfile->GetName(buffer);
+		CleanupStack::PopAndDestroy(selectedProfile);
+		CleanupStack::PopAndDestroy(schedule);
+		}
+		
+    CCalSession* calSession = CCalSession::NewL();
+    CleanupStack::PushL(calSession);
+    
+        
+    TInt suffix = 0;
+    TInt suffixLen = 0;
+    TInt delPos = buffer.Length();
+    
+    while (!IsCalNameAvailableL(*calSession ,buffer))
+        {
+        //A db with profile name already exists , try profile_1 ,profile_2 etc..
+        if (!suffix)
+            {
+            buffer.Append(KCharUnderscore);
+            ++delPos;
+            }
+        else
+            {
+            while (suffix/10)
+                {
+                ++suffixLen;
+                }
+            
+            buffer.Delete(delPos ,++suffixLen);
+            suffixLen = 0;
+            }   
+        buffer.AppendNum(++suffix);
+        }
+    
+    TBuf8<128> keyBuff;
+    TUint calValue = 0;
+    CCalCalendarInfo* calinfo = CCalCalendarInfo::NewL();
+    CleanupStack::PushL(calinfo);
+    //Visibility
+    calinfo->SetEnabled(ETrue);
+    
+    calinfo->SetNameL(buffer);
+    calinfo->SetColor(Math::Random());
+    
+    // Set Meta Data Properties
+    // LUID Meta Property
+    keyBuff.Zero();
+    keyBuff.AppendNum( EFolderLUID );
+    calValue = CCalenMultiCalUtil::GetNextAvailableOffsetL();
+    FLOG(_L("CNSmlOviAgendaAdapterPlugin::CreateFolderItemL: nextoffset: '%d'"), calValue);
+    TPckgC<TUint> pckgUidValue( calValue );
+    calinfo->SetPropertyL( keyBuff, pckgUidValue );
+    
+    // Create & Modified Time Meta Property
+    keyBuff.Zero();
+    keyBuff.AppendNum( ECreationTime );
+    TTime time;
+    time.HomeTime();
+    TPckgC<TTime> pckgCreateTimeValue( time );
+    calinfo->SetPropertyL( keyBuff, pckgCreateTimeValue );
+    keyBuff.Zero();
+    keyBuff.AppendNum( EModificationTime );
+    calinfo->SetPropertyL( keyBuff, pckgCreateTimeValue );
+    
+    // Sync Status
+    keyBuff.Zero();
+    keyBuff.AppendNum( ESyncStatus );
+    TBool syncstatus( ETrue );
+    TPckgC<TBool> pckgSyncStatusValue( syncstatus );
+    calinfo->SetPropertyL( keyBuff, pckgSyncStatusValue );
+    
+    // Global UID MetaDataProperty 
+    keyBuff.Zero();
+    keyBuff.AppendNum( EGlobalUUID );
+    CCalenInterimUtils2* interimUtils = CCalenInterimUtils2::NewL();
+    CleanupStack::PushL( interimUtils );
+    HBufC8* guuid = interimUtils->GlobalUidL();
+    TPtr8 guuidPtr = guuid->Des();
+    CleanupStack::PushL( guuid );
+    calinfo->SetPropertyL( keyBuff, guuidPtr );
+    CleanupStack::PopAndDestroy( guuid );
+    CleanupStack::PopAndDestroy( interimUtils );
+          
+    // Owner Name
+    keyBuff.Zero();
+    keyBuff.AppendNum( EDeviceSyncServiceOwner );
+    TPckgC<TInt> pckgAppUIDValue( KCRUidNSmlDSApp.iUid );    
+    calinfo->SetPropertyL( keyBuff, pckgAppUIDValue );
+
+    // Profile ID Meta Property
+    keyBuff.Zero();
+    keyBuff.AppendNum( EDeviceSyncProfileID );
+    TPckgC<TInt> pckgProfileIdValue( currentProfileId );    
+    calinfo->SetPropertyL( keyBuff, pckgProfileIdValue );
+
+    // Lock the SYNC option
+   keyBuff.Zero();
+   keyBuff.AppendNum( ESyncConfigEnabled );
+   TBool synclockstatus( ETrue );
+   TPckgC<TBool> pckgSyncLockValue( synclockstatus );
+   calinfo->SetPropertyL( keyBuff, pckgSyncLockValue );
+    
+    // Create the CalFile
+    HBufC* calfilename = CCalenMultiCalUtil::GetNextAvailableCalFileL();
+    calSession->CreateCalFileL( calfilename->Des(), *calinfo );
+		
+    aCalName.Copy(KNSmlAgendaFileNameForDefaultDB);
+    
+    delete calfilename;
+    
+    CleanupStack::PopAndDestroy(calinfo);
+    CleanupStack::PopAndDestroy(calSession);
+    }
+
+// -----------------------------------------------------------------------------
+// CAspContentList::IsCalNameAvailableL
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspContentList::IsCalNameAvailableL(CCalSession& aSession ,TDes& aCalName)
+    {
+    CCalSession* vCalSubSession = NULL;  
+    CDesCArray* calfilearr = aSession.ListCalFilesL();
+    
+    for(TInt i = 0; i < calfilearr->Count(); i++)
+        {
+        vCalSubSession = CCalSession::NewL(aSession);
+        CleanupStack::PushL(vCalSubSession);
+        vCalSubSession->OpenL(calfilearr->MdcaPoint(i));
+    
+        CCalCalendarInfo* caleninfo = vCalSubSession->CalendarInfoL(); 
+        
+        if (aCalName == caleninfo->NameL())
+            {
+            delete caleninfo;
+            delete calfilearr;
+            CleanupStack::PopAndDestroy(vCalSubSession);
+            return EFalse;
+            }
+    
+        delete caleninfo;    
+        CleanupStack::PopAndDestroy(vCalSubSession); 
+        }
+    delete calfilearr;
+    return ETrue;
+    
+    }
+// -----------------------------------------------------------------------------
+// CAspContentList::RetrieveCalLocalDatabaseL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::RetrieveCalLocalDatabaseL(TDes& aCalName)
+    {
+      
+    FLOG(_L("CAspContentList::RetrieveCalLocalDatabaseL: BEGIN"));   
+      
+    TBuf8<128> keyBuff;
+    CCalSession* vCalSession = NULL;
+    CCalSession* vCalSubSession = NULL;   
+    
+    vCalSession = CCalSession::NewL();
+    CleanupStack::PushL(vCalSession);
+    
+    CDesCArray* calfilearr = vCalSession->ListCalFilesL();            
+    
+    TBool dbFound = EFalse;
+    for(TInt i = 0; i < calfilearr->Count(); i++)
+        {
+        vCalSubSession = CCalSession::NewL(*vCalSession);
+        CleanupStack::PushL(vCalSubSession);
+        vCalSubSession->OpenL(calfilearr->MdcaPoint(i));
+        
+        CCalCalendarInfo* caleninfo = vCalSubSession->CalendarInfoL(); 
+        CleanupStack::PushL(caleninfo);
+		
+		//Get MARKASDELETE MetaData property
+		keyBuff.Zero();
+		TBool markAsdelete = EFalse;
+		keyBuff.AppendNum( EMarkAsDelete );
+		TPckgC<TBool> pckMarkAsDelete(markAsdelete);
+		TRAPD(err,pckMarkAsDelete.Set(caleninfo->PropertyValueL(keyBuff)));
+		if ( err == KErrNone )
+			{
+			markAsdelete = pckMarkAsDelete();
+			if( markAsdelete )
+				{
+				CleanupStack::PopAndDestroy(caleninfo);
+				CleanupStack::PopAndDestroy(vCalSubSession);  	  	 
+				continue;
+				}
+			}
+        
+        TInt profileId;
+        keyBuff.Zero();
+        keyBuff.AppendNum( EDeviceSyncProfileID );
+        TPckgC<TInt> intBuf(profileId);
+        TRAP_IGNORE(intBuf.Set(caleninfo->PropertyValueL(keyBuff)));
+        profileId = intBuf();
+		
+        TBuf<KBufSize> buffer;
+		iProfile->GetName(buffer);
+		
+		TInt currentProfileId = iProfile->ProfileId();
+	
+		if (buffer.Compare(KAutoSyncProfileName) == 0)
+			{
+			CAspSchedule* schedule = CAspSchedule::NewLC();
+			currentProfileId = schedule->ProfileId();
+			CleanupStack::PopAndDestroy(schedule);		
+			}
+		
+        if ( profileId == currentProfileId)
+            {
+            aCalName.Append(caleninfo->FileNameL());
+            dbFound = ETrue;
+            CleanupStack::PopAndDestroy(caleninfo);   
+            CleanupStack::PopAndDestroy(vCalSubSession);
+            break;
+            }
+        CleanupStack::PopAndDestroy(caleninfo);    
+        CleanupStack::PopAndDestroy(vCalSubSession); 
+        }
+		
+		if( dbFound == EFalse )
+			{
+			delete calfilearr; 
+			User::Leave( KErrNotFound );
+			}
+ 
+    delete calfilearr;     
+    CleanupStack::PopAndDestroy(vCalSession);
+    }
+
+// -----------------------------------------------------------------------------
+// CAspContentList::IsValidClientDataSource
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspContentList::IsValidClientDataSourceL( TDes& aCalName )
+    {
+    TBool datasourcefound = ETrue;
+    TBuf8<KBufSize> keyBuff;
+    CCalCalendarInfo* caleninfo = NULL;
+    CCalSession* session = CCalSession::NewL();
+    CleanupStack::PushL(session);
+    TRAPD (err, session->OpenL(aCalName));
+    
+    if( err == KErrNotFound )
+        {
+        datasourcefound = EFalse;
+        }
+    else
+        {
+        caleninfo = session->CalendarInfoL(); 
+        CleanupStack::PushL(caleninfo);
+                
+        //Get MARKASDELETE MetaData property
+        keyBuff.Zero();
+        TBool markAsdelete = EFalse;
+        keyBuff.AppendNum( EMarkAsDelete );
+        TPckgC<TBool> pckMarkAsDelete(markAsdelete);
+        TRAP(err,pckMarkAsDelete.Set(caleninfo->PropertyValueL(keyBuff)));
+        if ( err == KErrNone )
+            {
+            markAsdelete = pckMarkAsDelete();
+            if( markAsdelete )
+                {
+                datasourcefound = EFalse;
+                }
+            }
+        CleanupStack::PopAndDestroy(caleninfo);
+        }
+    CleanupStack::PopAndDestroy(session);
+    return datasourcefound;
+    }
+
+// -----------------------------------------------------------------------------
+// CAspContentList::ReadTaskL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::ReadTaskL(TInt aDataProviderId, TDes& aLocalDatabase,
+                                TDes& aRemoteDatabase, TBool& aEnable, TInt& aSyncDirection)
+
+	{
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+
+	aLocalDatabase = KNullDesC;
+	aRemoteDatabase = KNullDesC;
+	aSyncDirection = SyncDirection();
+	aEnable = EFalse;
+
+	TInt index = FindTaskIndexForProvider(aDataProviderId);
+	if (index == KErrNotFound)
+		{
+		return;
+		}
+	 
+    TAspTaskItem& item = TaskItem(index);
+    
+	RSyncMLTask task;
+	CleanupClosePushL(task);
+	
+	task.OpenL(iProfile->Profile(), item.iTaskId);
+	
+	aLocalDatabase = task.ClientDataSource();
+	aRemoteDatabase = task.ServerDataSource();
+	aEnable = task.Enabled();
+	aSyncDirection = TAspTask::SyncDirection(task.DefaultSyncType());
+		
+	CleanupStack::PopAndDestroy(&task);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::GetLocalDatabaseListL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::GetLocalDatabaseListL(TInt aDataProviderId, CDesCArray* aList)
+	{
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrGeneral));
+	
+    RSyncMLDataProvider provider;	
+    CleanupClosePushL(provider);
+
+    provider.OpenL(*iSyncSession, aDataProviderId);
+    provider.GetDataStoreNamesL(*aList);
+    
+    CleanupStack::PopAndDestroy(&provider);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::GetLocalDatabaseList
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::GetLocalDatabaseList(TInt aDataProviderId, CDesCArray* aList)
+	{
+	TRAP_IGNORE(GetLocalDatabaseListL(aDataProviderId, aList));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::SmlSyncDirection
+//
+// -----------------------------------------------------------------------------
+//
+TSmlSyncType CAspContentList::SmlSyncDirection()
+	{
+	TInt syncDirection = SyncDirection();
+	return TAspTask::SmlSyncDirection(syncDirection);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::SyncDirection
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspContentList::SyncDirection()
+	{
+	if (iTaskList.Count() == 0)
+		{
+		return ESyncDirectionTwoWay; // default sync direction
+		}
+		
+	TAspTaskItem& item = iTaskList[0];
+	return item.iSyncDirection;  // all tasks have same sync direction
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::TaskEnabled
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspContentList::TaskEnabled(TInt aDataProviderId)
+	{
+	TBool ret = EFalse;
+	
+    TInt index = FindTaskIndexForProvider(aDataProviderId);
+    if (index != KErrNotFound)
+    	{
+    	TAspTaskItem& item = TaskItem(index);
+    	if (item.iEnabled)
+    		{
+    		ret = ETrue;
+    		}
+    	}
+    	
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::Sort
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::Sort()
+	{
+	iProviderList.Sort(TLinearOrder<TAspProviderItem>(TAspProviderItem::CompareItems));
+	}
+
+
+#ifdef _DEBUG
+
+// -----------------------------------------------------------------------------
+// CAspContentList::LogL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::LogL(const TDesC& aText)
+	{
+	FLOG( _L("CAspContentList::LogL START") );
+
+	if (aText.Length() > 0)
+		{
+		FTRACE( RDebug::Print(_L("Profile = '%S'"), &aText) );
+		}
+		
+	LogTasksL();
+	LogDataProvidersL();
+	
+	FLOG( _L("CAspContentList::LogL END") );
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspContentList::LogTasksL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::LogTasksL()
+	{
+    FLOG( _L("---- sync tasks ----") );
+    
+	TInt count = iTaskList.Count();
+	
+	for (TInt i=0; i<count; i++)
+		{
+		TAspTaskItem& t = iTaskList[i];
+		TBuf<128> buf;
+		GetTaskLogText(buf, t);
+		FLOG(buf);
+		}
+		
+	FLOG( _L("---- sync tasks ----") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::GetTaskLogText
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::GetTaskLogText(TDes& aText, TAspTaskItem& aTask)
+	{
+	TBuf<KBufSize64> buf;
+	GetDataProviderIdText(buf, aTask.iDataProviderId);
+	
+	aText.Format(_L("id=%d, remote_db=%d, local_db=%d, enabled=%d, providerId=%x, providername='%S'"),
+	             aTask.iTaskId, aTask.iRemoteDatabaseDefined, aTask.iLocalDatabaseDefined,
+	             aTask.iEnabled, aTask.iDataProviderId, &buf);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspContentList::LogDataProvidersL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::LogDataProvidersL()
+	{
+    FLOG( _L("---- data providers ----") );
+    
+	TInt count = iProviderList.Count();
+	
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProviderItem& item = iProviderList[i];
+		TBuf<32> buf;
+		GetDataProviderIdText(buf, item.iDataProviderId);
+		if (item.iHasDefaultDataStore)
+			{
+			FTRACE( RDebug::Print(_L("id=%S (%x), name='%S'"), &buf, item.iDataProviderId, &item.iDisplayName) );
+			}
+		else
+			{
+			FTRACE( RDebug::Print(_L("id=%S (%x), name='%S', ### no default data provider ###"), &buf, item.iDataProviderId, &item.iDisplayName) );
+			}
+		}
+		
+	FLOG( _L("---- data providers ----") );
+	}
+
+    
+// -----------------------------------------------------------------------------
+// CAspContentList::GetDataProviderIdText
+//
+// -----------------------------------------------------------------------------
+//
+void CAspContentList::GetDataProviderIdText(TDes& aText, TInt aId)
+	{
+	aText = _L("unknown");
+	
+	if (aId == KUidNSmlAdapterContact.iUid)
+		{
+		aText = _L("KUidNSmlAdapterContact");
+		}
+	if (aId == KUidNSmlAdapterCalendar.iUid)
+		{
+		aText = _L("KUidNSmlAdapterCalendar");
+		}
+	if (aId == KUidNSmlAdapterEMail.iUid)
+		{
+		aText = _L("KUidNSmlAdapterEMail");
+		}
+	if (aId == KUidNSmlAdapterNote.iUid)
+		{
+		aText = _L("KUidNSmlAdapterNote");
+    	}
+	if (aId == KUidNSmlAdapterSms.iUid)
+		{
+		aText = _L("KUidNSmlAdapterSms");
+    	}
+	if (aId == KUidNSmlAdapterMMS.iUid)
+		{
+		aText = _L("KUidNSmlAdapterMMS");
+    	}
+	if (aId == KUidNSmlAdapterBookmarks.iUid)
+		{
+		aText = _L("KUidNSmlAdapterBookmarks");
+    	}
+	}
+	
+#endif
+
+
+
+/*******************************************************************************
+ * class TAspProfileItem
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// TAspProfileItem::Init
+//
+// -----------------------------------------------------------------------------
+//
+void TAspProfileItem::Init()
+	{
+	iProfileName = KNullDesC;
+	iProfileId = KErrNotFound;
+	iSynced = EFalse;
+	iLastSync = 0;
+	iBearer = KErrNotFound;
+	iActive = EFalse;
+	iDeleteAllowed = EFalse;
+	iApplicationId = KErrNotFound;
+	iMandatoryCheck = KErrNotFound;
+	iTaskCount = KErrNotFound;
+	iTaskId = KErrNotFound;
+	}
+
+
+
+
+// -----------------------------------------------------------------------------
+// TAspProfileItem::NameLC
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* TAspProfileItem::NameLC()
+	{
+	return iProfileName.AllocLC();
+	}
+
+
+// -----------------------------------------------------------------------------
+// TAspProfileItem::Name
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC& TAspProfileItem::Name()
+	{
+	return iProfileName;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TAspProfileItem::SetName
+//
+// -----------------------------------------------------------------------------
+//
+void TAspProfileItem::SetName(const TDesC& aName)
+	{
+	TUtil::StrCopy(iProfileName, aName);
+	}
+
+
+// -----------------------------------------------------------------------------
+// TAspProfileItem::CompareItems
+//
+// -----------------------------------------------------------------------------
+//
+TInt TAspProfileItem::CompareItems(const TAspProfileItem& aFirst, const TAspProfileItem& aSecond)
+	{
+	return aFirst.iProfileName.CompareC(aSecond.iProfileName);
+	}
+
+
+
+
+
+
+/*******************************************************************************
+ * class CAspProfileList
+ *******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::NewLC
+//
+// -----------------------------------------------------------------------------
+//
+CAspProfileList* CAspProfileList::NewLC(const TAspParam& aParam)
+    {
+    FLOG( _L("CAspProfileList::NewLC START") );
+    
+    CAspProfileList* self = new (ELeave) CAspProfileList(aParam);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	
+	
+    FLOG( _L("CAspProfileList::NewLC END") );
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspProfileList* CAspProfileList::NewL(const TAspParam& aParam)
+    {
+    FLOG( _L("CAspProfileList::NewL START") );
+    
+    CAspProfileList* self = new (ELeave) CAspProfileList(aParam);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+    FLOG( _L("CAspProfileList::NewL END") );
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspProfileList::~CAspProfileList()
+    {
+	iList.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileList::ConstructL(void)
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::CAspProfileList
+//
+// -----------------------------------------------------------------------------
+//
+CAspProfileList::CAspProfileList(const TAspParam& aParam)
+	{
+	__ASSERT_ALWAYS(aParam.iSyncSession, TUtil::Panic(KErrGeneral));
+
+	iSyncSession = aParam.iSyncSession;
+	iApplicationId = aParam.iApplicationId;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::Count
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfileList::Count()
+	{
+	return iList.Count();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::Count
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfileList::Count(TInt aApplicationId)
+	{
+	TInt profileCount = 0;
+	TInt count = iList.Count();
+
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProfileItem& item = iList[i];
+		if (item.iApplicationId == aApplicationId)
+			{
+			profileCount++;
+			}
+		}
+	
+	return profileCount;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::DeletableProfileCount
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfileList::DeletableProfileCount()
+	{
+	TInt profileCount = 0;
+	TInt count = iList.Count();
+
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProfileItem& item = iList[i];
+		if (item.iDeleteAllowed)
+			{
+			profileCount++;
+			}
+		}
+	
+	return profileCount;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::Item
+// 
+// -----------------------------------------------------------------------------
+//
+TAspProfileItem& CAspProfileList::Item(TInt aIndex)
+	{
+	if ((aIndex < 0) || (aIndex >= Count()))
+	    {
+		TUtil::Panic(KErrArgument);
+	    }
+
+	return iList[aIndex];
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::FindProfileIndex
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfileList::FindProfileIndex(const TDesC& aProfileName)
+	{
+	TInt count = iList.Count();
+
+	for (TInt i=0; i<count; i++)
+		{
+		TPtrC ptr = Item(i).Name();
+		if (ptr.Compare(aProfileName) == 0)
+			{
+			return i;
+			}
+		}
+
+	return KErrNotFound;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::GetDefaultProfileIdL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileList::GetDefaultProfileIdL(TInt& aValue)
+	{
+	const TUid KRepositoryId = KCRUidDSDefaultProfileInternalKeys;
+	
+    CRepository* rep = CRepository::NewLC(KRepositoryId);
+    TInt err = rep->Get(KNsmlDsDefaultProfile, aValue);
+	User::LeaveIfError(err);
+	CleanupStack::PopAndDestroy(rep);    
+	}
+	
+// -----------------------------------------------------------------------------
+// CAspProfileList::FindLastSyncedProfileIndexL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfileList::FindLastSyncedProfileIndexL()
+	{
+	TInt index = KErrNotFound;
+	TTime syncTime = 0;
+	
+	TInt count = iList.Count();
+
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProfileItem& item = iList[i];
+		if (item.iLastSync > syncTime)
+			{
+			syncTime = item.iLastSync;
+			index = i;
+			}
+		}
+	
+	if (index == KErrNotFound && count > 0)
+		{
+		//Read the Default Profile Id from the Cenrep
+		TInt defaultprofileId;
+		GetDefaultProfileIdL(defaultprofileId);
+		for (TInt i=0; i<count; i++)
+			{
+			TAspProfileItem& item = iList[i];
+			if ( item.iProfileId == defaultprofileId )
+				{
+				index = i;
+				break;
+				}
+			}
+		
+		if(index == KErrNotFound)
+			{
+			TAspParam param(iApplicationId, iSyncSession);
+	    	    	
+			for( TInt i=0; i<count; i++)
+				{
+				CAspProfile* profile = CAspProfile::NewLC(param);
+				TAspProfileItem& item = iList[i];
+				profile->OpenL(item.iProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);	
+				if( CAspProfile::IsPCSuiteProfile(profile) )
+					{
+					index = i;
+					CleanupStack::PopAndDestroy(profile);
+					break;
+					}
+				else
+					{
+					CleanupStack::PopAndDestroy(profile);
+					}			
+				}
+			}
+		}
+	return index;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::FilteredList
+//
+// -----------------------------------------------------------------------------
+//
+CAspProfileList* CAspProfileList::FilteredListL(TAspFilterInfo& aFilterInfo)
+	{
+	TInt type = aFilterInfo.iFilterType;
+	
+	if (type != TAspFilterInfo::EIncludeDeletableProfile &&
+	    type != TAspFilterInfo::EIncludeRemoteProfile)
+		{
+		TUtil::Panic(KErrNotSupported);
+		}
+		
+	TAspParam param(iApplicationId, iSyncSession);
+	CAspProfileList* profileList = CAspProfileList::NewLC(param);
+	
+	TInt count = iList.Count();
+
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProfileItem& item = iList[i];
+		
+		if (type == TAspFilterInfo::EIncludeDeletableProfile)
+			{
+		    if (item.iDeleteAllowed)
+			    {
+			    profileList->AddL(item);
+			    }
+			}
+
+		if (type == TAspFilterInfo::EIncludeRemoteProfile)
+			{
+		    if (item.iBearer == EAspBearerInternet)
+			    {
+			    profileList->AddL(item);
+			    }
+			}
+    	}
+	
+		
+	CleanupStack::Pop(profileList);
+	return profileList;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::ReplaceProfileItemL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileList::ReplaceProfileItemL(TAspProfileItem& aProfileItem)
+	{
+	// remove old profile with same id
+	Remove(aProfileItem.iProfileId);
+	
+	// add new profile 
+    User::LeaveIfError(iList.Append(aProfileItem));
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// CAspProfileList::ReadProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileList::ReadProfileL(TInt aProfileId)
+	{
+	FLOG( _L("CAspProfileList::ReadProfileL START") );
+	
+	TAspParam param(iApplicationId, iSyncSession);
+    CAspProfile* profile = CAspProfile::NewLC(param);
+	
+	profile->OpenL(aProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+	
+	TAspProfileItem item;
+	item.Init();
+
+	if (iApplicationId != EApplicationIdSync)
+		{
+		TInt dataProviderId = TUtil::ProviderIdFromAppId(iApplicationId, CAspProfile::IsOperatorProfileL(profile));
+		TInt taskId = TAspTask::FindTaskIdL(profile, dataProviderId, KNullDesC);
+		item.iTaskId = taskId; // needed for syncing only one content 
+		}
+	
+	ReadProfileItemL(profile, item);
+	
+	//item.iMandatoryCheck = CAspProfile::CheckMandatoryData(profile, item.iTaskCount);
+	
+	ReplaceProfileItemL(item);
+
+#ifdef _DEBUG
+    TAspParam param2(iApplicationId, iSyncSession);
+	param2.iProfile = profile;
+	param2.iMode = CAspContentList::EInitAll;
+	CAspContentList* contentList = CAspContentList::NewLC(param2);
+
+    contentList->LogL(item.iProfileName);
+    
+    CleanupStack::PopAndDestroy(contentList);
+#endif	
+	
+	CleanupStack::PopAndDestroy(profile);
+	
+	FLOG( _L("CAspProfileList::ReadProfileL END") );
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// CAspProfileList::ReadAllProfilesL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileList::ReadAllProfilesL(TInt aListMode)
+	{
+	FLOG( _L("CAspProfileList::ReadAllProfilesL START") );
+	
+#ifdef _DEBUG
+    	TTime time_1 = TUtil::TimeBefore();
+#endif
+	
+	iList.Reset();
+	
+	RArray<TSmlProfileId> arr;
+    Session().ListProfilesL(arr, ESmlDataSync);
+   	CleanupClosePushL(arr);
+
+	TInt count = arr.Count();
+
+	//Hiding OVI Sync profile
+	const TUid KUidOtaSyncCenRep                = { 0x20016C06 };
+	const TUid KCRUidOtaSyncProfileId           = { 0x102 };
+	TInt oviProfileId = KErrNotFound;
+	CRepository* centRep = NULL;
+
+	TRAPD(err ,centRep = CRepository::NewL(KUidOtaSyncCenRep));
+	if (err == KErrNone)
+		{
+		CleanupStack::PushL(centRep);
+		centRep->Get(KCRUidOtaSyncProfileId.iUid, oviProfileId);
+    	CleanupStack::PopAndDestroy();// centRep
+		}
+	for (TInt i=0; i<count; i++)
+		{
+		TAspParam param(iApplicationId, iSyncSession);
+		CAspProfile* profile = CAspProfile::NewLC(param);
+		TInt id = arr[i];
+		
+		//Hiding OVI Sync profile
+		if (id == oviProfileId)
+			{
+			CleanupStack::PopAndDestroy(profile);
+			continue;
+		    }
+		if (aListMode == EBasePropertiesOnly)
+			{
+			profile->OpenL(id, CAspProfile::EOpenRead, CAspProfile::EBaseProperties);
+			}
+		else
+			{
+			profile->OpenL(id, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+			}
+			
+		
+		// Hidden operator specific profile should not be visible
+		if (profile->IsHiddenOperatorProfileL())
+		    {
+		    CleanupStack::PopAndDestroy(profile);
+		    continue;
+		    }
+
+		TAspProfileItem item;
+		item.Init();
+		
+		if (iApplicationId != EApplicationIdSync)
+			{
+			TInt dataProviderId = TUtil::ProviderIdFromAppId(iApplicationId, CAspProfile::IsOperatorProfileL(profile));
+			TInt taskId = TAspTask::FindTaskIdL(profile, dataProviderId, KNullDesC);
+			item.iTaskId = taskId; // needed for syncing only one content 
+			}
+		
+		if (aListMode == EBasePropertiesOnly)
+			{
+			profile->GetName(item.iProfileName);
+			if (TUtil::IsEmpty(item.iProfileName))
+				{
+				CAspResHandler::ReadL(item.iProfileName,R_ASP_UNNAMED_SET);
+				}
+			item.iApplicationId = profile->CreatorId();
+			item.iProfileId = profile->ProfileId();
+			}
+		else
+			{
+			ReadProfileItemL(profile, item);
+			}
+		
+		if (aListMode == EMandatoryCheck || aListMode == EMandatoryCheckEx)
+			{
+			item.iMandatoryCheck = CAspProfile::CheckMandatoryData(profile, item.iTaskCount);
+			}
+
+		if (aListMode == EMandatoryCheckEx && item.iMandatoryCheck != EMandatoryOk)
+			{
+			CleanupStack::PopAndDestroy(profile);
+			continue;  // ignore profile that misses some mandatory data
+			}
+		
+		if(IsAutoSyncProfile(profile))
+			{
+			CleanupStack::PopAndDestroy(profile);
+			continue;  // auto sync profile should be hidden
+			}
+		
+		User::LeaveIfError(iList.Append(item));
+		
+		CleanupStack::PopAndDestroy(profile);
+		}
+        
+    CleanupStack::PopAndDestroy(&arr);
+    
+#ifdef _DEBUG    
+    TUtil::TimeAfter(time_1, _L("ReadAllProfilesL took"));
+#endif
+    
+    FLOG( _L("CAspProfileList::ReadAllProfilesL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::ReadEMailProfilesL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileList::ReadEMailProfilesL(const TDesC& aLocalDatabase, TInt /*aListMode*/)
+	{
+	FLOG( _L("CAspProfileList::ReadEMailProfilesL START") );
+	
+	iList.Reset();
+	
+	RArray<TSmlProfileId> arr;
+    Session().ListProfilesL(arr, ESmlDataSync);
+   	CleanupClosePushL(arr);
+
+	TInt count = arr.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		TAspParam param(iApplicationId, iSyncSession);
+		CAspProfile* profile = CAspProfile::NewLC(param);
+		
+		TInt id = arr[i];
+		profile->OpenL(id, CAspProfile::EOpenRead, CAspProfile::EBaseProperties);
+		
+		TAspProfileItem item;
+		item.Init();
+		
+		TInt taskId = TAspTask::FindTaskIdL(profile, KUidNSmlAdapterEMail.iUid, aLocalDatabase);
+		item.iTaskId = taskId; // needed for syncing only one content
+		
+		if( taskId != KErrNotFound )
+		{
+		profile->GetName(item.iProfileName);
+		item.iApplicationId = profile->CreatorId();
+		item.iProfileId = profile->ProfileId();
+		
+		if(IsAutoSyncProfile(profile))
+			{
+			CleanupStack::PopAndDestroy(profile);
+			continue;  // auto sync profile should be hidden
+			}
+		
+		User::LeaveIfError(iList.Append(item));
+		}
+		CleanupStack::PopAndDestroy(profile);
+		}
+        
+    CleanupStack::PopAndDestroy(&arr);
+    
+    FLOG( _L("CAspProfileList::ReadEMailProfilesL END") );
+	}
+
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::ReadProfileItemL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileList::ReadProfileItemL(CAspProfile* aProfile, TAspProfileItem& aItem)
+	{
+	aProfile->GetName(iBuf);
+	if (TUtil::IsEmpty(iBuf))
+		{
+		CAspResHandler::ReadL(iBuf, R_ASP_UNNAMED_SET);
+		}
+    aItem.SetName(iBuf);
+	
+	aProfile->GetServerId(iBuf);
+	TInt len = iBuf.Size();  // number of bytes
+	TUint16 checkSum = 0;
+	if (len > 0)
+		{
+		Mem::Crc(checkSum, iBuf.Ptr(), len);
+		}
+	aItem.iServerIdCheckSum = checkSum;
+
+	aItem.iProfileId = aProfile->ProfileId();
+	aItem.iSynced    = aProfile->IsSynced();
+	aItem.iLastSync  = aProfile->LastSync();
+	aItem.iBearer    = aProfile->BearerType();
+    
+    aItem.iActive = EFalse;
+    if (aProfile->SASyncState() != ESASyncStateDisable)
+    	{
+    	aItem.iActive = ETrue;
+    	}
+    	
+	aItem.iDeleteAllowed = aProfile->DeleteAllowed();
+	aItem.iMandatoryCheck = EMandatoryOk;
+	aItem.iApplicationId = aProfile->CreatorId();
+	
+	aItem.iTaskCount = 0;
+    }
+		
+	
+// -----------------------------------------------------------------------------
+// CAspProfileList::Sort
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileList::Sort()
+	{
+	iList.Sort(TLinearOrder<TAspProfileItem>(TAspProfileItem::CompareItems));
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::Remove
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileList::Remove(TInt aProfileId)
+	{
+	TInt count = iList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProfileItem& item = iList[i];
+		if (item.iProfileId == aProfileId)
+			{
+			iList.Remove(i);
+			return;
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::AddL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileList::AddL(TAspProfileItem& aProfileItem)
+	{
+	User::LeaveIfError(iList.Append(aProfileItem));
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::ListIndex
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfileList::ListIndex(TInt aProfileId)
+	{
+	TInt count = iList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProfileItem& item = iList[i];
+		if (item.iProfileId == aProfileId)
+			{
+			return i;
+			}
+		}
+
+	return KErrNotFound;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::Session
+// 
+// -----------------------------------------------------------------------------
+//
+RSyncMLSession& CAspProfileList::Session()
+	{
+	__ASSERT_DEBUG(iSyncSession, TUtil::Panic(KErrGeneral));
+	
+	return *iSyncSession;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileList::IsUniqueServerId
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspProfileList::IsUniqueServerId(const TDesC& aServerId, TInt aProfileId)
+	{
+	TInt serverIdLen = aServerId.Length();
+	if (serverIdLen == 0)
+		{
+		return ETrue;
+		}
+
+    // Operator specific serverID is not considered as unique
+	if (CAspProfile::EqualsToOperatorServerId(aServerId))
+	    {
+	    return EFalse;
+	    }
+
+	TBool serverIdFound = EFalse;
+	
+	TInt count = iList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+	   	TAspProfileItem& item = iList[i];
+		if (item.iProfileId == aProfileId)
+			{
+			continue;
+			}
+
+		TUint16 checkSum = 0;
+		TInt len = aServerId.Size(); // number of bytes
+	
+		Mem::Crc(checkSum, aServerId.Ptr(), len);
+		if (item.iServerIdCheckSum == checkSum)
+			{
+			serverIdFound = ETrue;
+			break;
+			}
+		}
+
+    if (serverIdFound)
+    	{
+    	return EFalse;
+    	}
+    	
+    return ETrue;
+	}
+
+
+TBool CAspProfileList::IsAutoSyncProfile(CAspProfile* aProfile)
+	{
+	TBuf<KBufSize> profileName;
+	aProfile->GetName(profileName);
+	if (profileName.Compare(KAutoSyncProfileName) == 0)
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+/******************************************************************************
+ * class CAspProfile
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::NewLC
+//
+// -----------------------------------------------------------------------------
+//
+CAspProfile* CAspProfile::NewLC(const TAspParam& aParam)
+    {
+    FLOG( _L("CAspProfile::NewLC START") );
+    
+    CAspProfile* self = new (ELeave) CAspProfile(aParam);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+
+	FLOG( _L("CAspProfile::NewLC END") );
+	return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CAspProfile::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspProfile* CAspProfile::NewL (const TAspParam& aParam)
+    {
+    FLOG( _L("CAspProfile::NewL START") );
+    
+    CAspProfile* self = new (ELeave) CAspProfile(aParam);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+    FLOG( _L("CAspProfile::NewL END") );
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspProfile::~CAspProfile()
+    {
+    if (iHistoryLogOpen)
+    	{
+    	iHistoryLog.Close();
+    	}
+
+    if (iConnectionOpen)
+    	{
+    	iConnection.Close();
+    	}
+    
+    iProfile.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::ConstructL()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::CAspProfile
+//
+// -----------------------------------------------------------------------------
+//
+CAspProfile::CAspProfile(const TAspParam& aParam)
+	{
+	__ASSERT_ALWAYS(aParam.iSyncSession, TUtil::Panic(KErrGeneral));
+
+	iSyncSession = aParam.iSyncSession;
+	iApplicationId = aParam.iApplicationId;
+	
+	
+    iHistoryLogOpen = EFalse;
+    iConnectionOpen = EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::OpenL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::OpenL(TInt aProfileId, TInt aReadWrite, TInt aOpenMode)
+    {
+    FLOG( _L("CAspProfile::OpenL START") );
+    
+    if (aReadWrite == EOpenRead)
+    	{
+    	iProfile.OpenL(*iSyncSession, aProfileId, ESmlOpenRead);
+    	}
+    else
+    	{
+    	iProfile.OpenL(*iSyncSession, aProfileId, ESmlOpenReadWrite);
+    	}
+    
+    if (aOpenMode == EAllProperties)
+    	{
+    	OpenConnection();  // this updates iConnectionOpen
+    	OpenHistoryLog();  // this updates iHistoryLogOpen
+    	}
+    	
+    FLOG( _L("CAspProfile::OpenL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::CreateL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::CreateL(TInt aOpenMode)
+    {
+    FLOG( _L("CAspProfile::CreateL START") );
+    
+   	iProfile.CreateL(*iSyncSession);
+   	iProfile.SetCreatorId(iApplicationId);  // creator application id
+   	iProfile.UpdateL();
+   	
+	// create connection for new profile (convergence)
+    //TInt transportId = DefaultTransportIdL();
+    //iConnection.CreateL(iProfile, transportId);
+    //iConnection.UpdateL();
+    //iConnection.Close();
+    //iProfile.UpdateL();	
+   	
+    if (aOpenMode == EAllProperties)
+    	{
+    	OpenConnection();  // this updates iConnectionOpen
+    	OpenHistoryLog();  // this updates iHistoryLogOpen
+    	}
+    	
+    FLOG( _L("CAspProfile::CreateL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::DefaultTransportIdL 
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::DefaultTransportIdL()
+    {
+    TAspParam param(EApplicationIdSync, iSyncSession);
+    CAspBearerHandler* bearerHandler = CAspBearerHandler::NewL(param);
+    CleanupStack::PushL(bearerHandler);
+    
+    TInt id = bearerHandler->DefaultBearer(); 
+    
+    CleanupStack::PopAndDestroy(bearerHandler);
+    
+    if (id == KErrNotFound)
+    	{
+    	User::Leave(KErrNotFound);
+    	}
+    	
+    return CAspBearerHandler::SmlBearerId(id);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::CreateCopyL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::CreateCopyL(TInt aProfileId)
+    {
+    FLOG( _L("CAspProfile::CreateCopyL START") );
+    
+    CreateL(EAllProperties);
+    
+    TAspParam param(iApplicationId, iSyncSession);
+    CAspProfile* profile = CAspProfile::NewLC(param);
+    profile->OpenL(aProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+    
+    CopyValuesL(profile);
+    
+    CleanupStack::PopAndDestroy(profile);
+    
+    FLOG( _L("CAspProfile::CreateCopyL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::SaveL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SaveL()
+    {
+    //iProfile.UpdateL();  // convergence
+    
+    if (iConnectionOpen)
+    	{
+    	iConnection.UpdateL();
+    	}
+    	
+   	iProfile.UpdateL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::Save
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::Save()
+    {
+    TRAPD(err, SaveL());
+    
+    if (err != KErrNone)
+    	{
+    	FLOG( _L("###  CAspProfile::SaveL failed (%d) ###"), err );
+    	}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::GetName
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::GetName(TDes& aText)
+	{
+ 		if(!IsPCSuiteProfile(this))
+ 		{
+			TUtil::StrCopy(aText, iProfile.DisplayName());
+			return;
+ 		}
+ 		//For PC suite profile Localise as per specifications
+ 		GetLocalisedPCSuite(aText);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::NameL
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspProfile::NameL()
+	{
+	return iProfile.DisplayName().AllocL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::SetNameL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetNameL(const TDesC& aText)
+	{
+	iProfile.SetDisplayNameL(aText);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::CreatorId
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::CreatorId()
+	{
+	return iProfile.CreatorId();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::SetCreatorId
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetCreatorId(TInt aCreatorId)
+	{
+	iProfile.SetCreatorId(aCreatorId);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::ProfileId
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::ProfileId()
+	{
+	return iProfile.Identifier();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::DeleteAllowed
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspProfile::DeleteAllowed()
+    {
+    TBool operatorProfile = EFalse;
+    TRAPD( err, operatorProfile = IsReadOnlyOperatorProfileL() );
+
+    // Disallow deletion of operator specific profile
+    if( err == KErrNone && operatorProfile )
+        {
+        return EFalse;
+        }
+    else
+        {
+        return iProfile.DeleteAllowed();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::IsSynced
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspProfile::IsSynced()
+    {
+    if (!iHistoryLogOpen)
+    	{
+    	return EFalse;
+    	}
+    	
+    if (iHistoryLog.Count() == 0)
+        {
+        return EFalse;
+        }
+    
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::LastSync
+//
+// -----------------------------------------------------------------------------
+//
+TTime CAspProfile::LastSync()
+    {
+    if (!iHistoryLogOpen)
+    	{
+    	return 0;
+    	}
+
+    if (iHistoryLog.Count() == 0)
+        {
+        return 0;  // profile has not been synced
+        }
+        
+    const CSyncMLHistoryJob* job = LatestHistoryJob();
+    if (!job)
+    	{
+    	return 0;
+    	}
+    
+    return job->TimeStamp();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::LastSync
+//
+// -----------------------------------------------------------------------------
+//
+TTime CAspProfile::LastSync(TInt aTaskId)
+    {
+    if (!iHistoryLogOpen)
+    	{
+    	return 0;
+    	}
+
+    if (iHistoryLog.Count() == 0)
+        {
+        return 0;  // profile has not been synced
+        }
+        
+    const CSyncMLHistoryJob* job = LatestHistoryJob(aTaskId);
+    if (!job)
+    	{
+    	return 0;
+    	}
+    
+    return job->TimeStamp();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::GetServerId
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::GetServerId(TDes& aText)
+	{
+	TUtil::StrCopy(aText, iProfile.ServerId());  // convert TDes8 to TDes
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::SetGetServerIdL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetServerIdL(const TDesC& aText)
+	{
+	TUtil::StrCopy(iBuf8, aText);  // convert TDes to TDes8
+	iProfile.SetServerIdL(iBuf8);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::ProtocolVersion
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::ProtocolVersion()
+	{
+	TSmlProtocolVersion version = iProfile.ProtocolVersion();
+	if (version == ESmlVersion1_1_2)
+		{
+		return EAspProtocol_1_1;
+		}
+		
+	return EAspProtocol_1_2;
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// CAspProfile::SetProtocolVersionL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetProtocolVersionL(TInt aProtocolVersion)
+	{
+	if (aProtocolVersion == EAspProtocol_1_1)
+		{
+		iProfile.SetProtocolVersionL(ESmlVersion1_1_2);
+		}
+	else
+		{
+		iProfile.SetProtocolVersionL(ESmlVersion1_2);
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::BearerType
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::BearerType()
+	{
+	if (!iConnectionOpen)
+		{
+	    return KErrNotFound;	
+		}
+
+	TInt id = iConnection.Identifier();
+   	return CAspBearerHandler::AspBearerId(id);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::SetBearerTypeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetBearerTypeL(TInt aId)
+	{
+	if (!iConnectionOpen)
+		{
+		return;
+		}
+	
+	TInt newBearer = CAspBearerHandler::SmlBearerId(aId);
+    
+    if (newBearer != KErrNotFound)
+    	{
+    	TInt currentBearer = iConnection.Identifier();
+    	if (currentBearer != newBearer)
+    		{
+    		iConnection.CreateL(Profile(), newBearer);
+    		}
+    	}
+	}
+
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::SetBearerTypeL (convergence)
+//
+// -----------------------------------------------------------------------------
+//
+/*
+void CAspProfile::SetBearerTypeL(TInt aId)
+	{
+	TInt newBearer = CAspBearerHandler::SmlBearerId(aId);
+	if (newBearer == KErrNotFound)
+		{
+		return;  // unknown bearer
+		}
+	
+   	TInt currentBearer = KErrNotFound;
+   	if (iConnectionOpen)
+   	    {
+   		currentBearer = iConnection.Identifier();
+   	    }
+   	if (currentBearer == newBearer)
+   		{
+   		return;	// bearer has not changed
+   		}
+
+	if (iConnectionOpen)
+	    {
+		iConnection.Close();
+		iConnectionOpen = EFalse;
+	    }
+
+	DeleteConnectionsL(0);
+    			
+	TRAPD(err, iConnection.CreateL(iProfile, newBearer));
+   	if (err == KErrNone)
+    	{
+    	iConnection.UpdateL();
+        iConnection.Close();
+        iProfile.UpdateL();
+        iConnection.OpenL(iProfile, newBearer);
+        iConnectionOpen = ETrue;    		    				    
+      	}
+    }
+*/
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::DeleteConnectionsL (convergence)
+//
+// -----------------------------------------------------------------------------
+//
+/*
+void CAspProfile::DeleteConnectionsL()
+    {
+   	RArray<TSmlConnectionId> arr;
+   	Profile().ListConnectionsL(arr);
+   	CleanupClosePushL(arr);
+   	
+   	TInt count = arr.Count();
+    	
+   	for (TInt i=0; i<count; i++)
+   	    {
+   	    TInt id = arr[i];
+   	    iProfile.DeleteConnectionL(id);
+   	    iProfile.UpdateL();
+   	    }
+   	    
+   	CleanupStack::PopAndDestroy(&arr);
+    }
+*/
+
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::AccessPointL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::AccessPointL()
+	{
+	if (!iConnectionOpen)
+		{
+    	return KErrNotFound;
+		}
+	
+	if (iConnection.Identifier() != KUidNSmlMediumTypeInternet.iUid)
+		{
+		return KErrNotFound; // this setting is only for internet bearer
+		}
+		
+	TBuf8<KBufSize32> key;
+	TBuf<KBufSize32> value;
+	TInt num = KErrNotFound;
+
+	GetConnectionPropertyNameL(key, EPropertyIntenetAccessPoint);
+	TUtil::StrCopy(value, iConnection.GetPropertyL(key)); // convert TDes8 to TDes
+	if (TUtil::IsEmpty(value))
+		{
+		return KErrNotFound;
+		}
+		
+	User::LeaveIfError(TUtil::StrToInt(value, num));
+	return num;
+	}
+		
+	
+// -----------------------------------------------------------------------------
+// CAspProfile::SetAccessPointL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetAccessPointL(const TInt aId)
+	{
+    if (!iConnectionOpen)	
+    	{
+    	return;
+    	}
+    	
+	if (iConnection.Identifier() != KUidNSmlMediumTypeInternet.iUid)
+		{
+		return; // this setting is only for internet bearer
+		}
+
+	TBuf<KBufSize32> buf;
+	TBuf8<KBufSize32> key;
+	TBuf8<KBufSize32> value;
+	
+	buf.Num(aId);
+	TUtil::StrCopy(value, buf);  // convwert TDes to TDes8
+	
+	GetConnectionPropertyNameL(key, EPropertyIntenetAccessPoint);
+	iConnection.SetPropertyL(key, value);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::GetHostAddress
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::GetHostAddress(TDes& aText, TInt& aPort)
+	{
+	aText = KNullDesC;
+	aPort = TURIParser::EDefaultHttpPort;
+	
+    if (!iConnectionOpen)	
+    	{
+      	return;
+    	}
+	
+	if (BearerType() != EAspBearerInternet)
+		{
+		TUtil::StrCopy(aText, iConnection.ServerURI()); // convert TDes8 to TDes
+		return;  // port number handling is for internet bearer only 
+		}
+
+	TUtil::StrCopy(iBuf, iConnection.ServerURI()); // convert TDes8 to TDes
+	
+	TURIParser parser(iBuf);
+	
+	parser.GetUriWithoutPort(aText);
+
+	aPort = parser.Port();
+	if (aPort == KErrNotFound)
+		{
+		aPort = parser.DefaultPort();
+		}
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// CAspProfile::SetHostAddressL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetHostAddressL(const TDesC& aText, const TInt aPort)
+	{
+    if (!iConnectionOpen)	
+    	{
+    	return;
+    	}
+	
+	if (BearerType() != EAspBearerInternet)
+		{
+		TUtil::StrCopy(iBuf, aText); // port number handling is for inteernet bearer only 
+		}
+	else
+		{
+		TURIParser parser(aText); // add port number to internet host address
+	    parser.GetUriWithPort(iBuf, aPort);
+		}
+	
+	TUtil::StrCopy(iBuf8, iBuf);  // convert TDes to TDes8
+	iConnection.SetServerURIL(iBuf8);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::GetUserName
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::GetUserName(TDes& aText)
+	{
+	TUtil::StrCopy(aText, iProfile.UserName());   // convert TDes8 to TDes
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// CAspProfile::SetUserNameL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetUserNameL(const TDesC& aText)
+	{
+	TUtil::StrCopy(iBuf8, aText);  // conver TDes to TDes8
+	iProfile.SetUserNameL(iBuf8);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::GetPassword
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::GetPassword(TDes& aText)
+	{
+	TUtil::StrCopy(aText, iProfile.Password());   // convert TDes8 to TDes
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// CAspProfile::SetPasswordL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetPasswordL(const TDesC& aText)
+	{
+	TUtil::StrCopy(iBuf8, aText);    // conver TDes to TDes8
+	iProfile.SetPasswordL(iBuf8);
+	}
+
+	
+// -----------------------------------------------------------------------------
+// CAspProfile::SASyncState
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::SASyncState()
+	{
+	TSmlServerAlertedAction state = iProfile.SanUserInteraction();
+
+	if (state == ESmlConfirmSync)
+		{
+		return ESASyncStateConfirm;
+		}
+	else if (state == ESmlDisableSync)
+		{
+		return ESASyncStateDisable;
+		}
+	else 
+		{
+		return ESASyncStateEnable;
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::SetSASyncStateL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetSASyncStateL(TInt aState)
+    {
+	if (aState == ESASyncStateConfirm)
+		{
+		Profile().SetSanUserInteractionL(ESmlConfirmSync);
+		}
+	else if (aState == ESASyncStateDisable)
+		{
+		Profile().SetSanUserInteractionL(ESmlDisableSync);
+		}
+	else
+		{
+		Profile().SetSanUserInteractionL(ESmlEnableSync);
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::SetHttpUsedL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetHttpUsedL(TBool aEnable)
+	{
+    if (!iConnectionOpen)	
+    	{
+    	return;
+    	}
+
+	if (iConnection.Identifier() != KUidNSmlMediumTypeInternet.iUid)
+		{
+		return; // this setting is only for internet bearer
+		}
+	
+	TBuf8<KBufSize32> key;
+	TBuf8<KBufSize32> value;
+	
+	if (aEnable)
+		{
+		value.Num(1); 
+		}
+	else
+		{
+		value.Num(0);
+		}
+		
+	GetConnectionPropertyNameL(key, EPropertyHttpUsed);
+	iConnection.SetPropertyL(key, value);
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// CAspProfile::HttpUsedL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspProfile::HttpUsedL()
+	{
+    if (!iConnectionOpen)	
+    	{
+    	return EFalse;
+    	}
+	
+	if (iConnection.Identifier() != KUidNSmlMediumTypeInternet.iUid)
+		{
+		return EFalse; // this setting is only for internet bearer
+		}
+
+	TBuf8<KBufSize32> key; 
+	TBuf<KBufSize32> value;
+	TInt intValue;
+	
+	GetConnectionPropertyNameL(key, EPropertyHttpUsed);
+	TUtil::StrCopy(value, iConnection.GetPropertyL(key));  // convert TDes8 to TDes
+	
+    User::LeaveIfError(TUtil::StrToInt(value, intValue));
+	
+    if (intValue == 0)
+    	{
+    	return EFalse; 
+    	}
+    return ETrue;
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspProfile::GetHttpUsernameL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::GetHttpUserNameL(TDes& aText)
+	{
+	aText = KNullDesC;
+	
+    if (!iConnectionOpen)	
+    	{
+    	return;
+    	}
+
+	if (iConnection.Identifier() != KUidNSmlMediumTypeInternet.iUid)
+		{
+		return; // this setting is only for internet bearer
+		}
+	
+
+	TBuf8<KBufSize32> key; 
+	
+	GetConnectionPropertyNameL(key, EPropertyHttpUserName);
+	TUtil::StrCopy(aText, iConnection.GetPropertyL(key));  // convert TDes8 to TDes
+  	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspProfile::SetHttpUsernameL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetHttpUserNameL(const TDesC& aText)
+	{
+    if (!iConnectionOpen)	
+    	{
+    	return;
+    	}
+	
+	if (iConnection.Identifier() != KUidNSmlMediumTypeInternet.iUid)
+		{
+		return; // this setting is only for internet bearer
+		}
+
+	TBuf8<KBufSize32> key;
+	
+	GetConnectionPropertyNameL(key, EPropertyHttpUserName);
+	TUtil::StrCopy(iBuf8, aText);  // convert TDes to TDes8
+	iConnection.SetPropertyL(key, iBuf8);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::GetHttpPasswordL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::GetHttpPasswordL(TDes& aText)
+	{
+   	aText = KNullDesC;
+   	
+    if (!iConnectionOpen)	
+    	{
+    	return;
+    	}
+
+	if (iConnection.Identifier() != KUidNSmlMediumTypeInternet.iUid)
+		{
+		return; // this setting is only for internet bearer
+		}
+
+
+	TBuf8<KBufSize32> key; 
+	
+	GetConnectionPropertyNameL(key, EPropertyHttpPassword);
+	TUtil::StrCopy(aText, iConnection.GetPropertyL(key));  // convert TDes8 to TDes
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspProfile::SetHttpPasswordL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetHttpPasswordL(const TDesC& aText)
+	{
+    if (!iConnectionOpen)	
+    	{
+    	return;
+    	}
+	
+	if (iConnection.Identifier() != KUidNSmlMediumTypeInternet.iUid)
+		{
+		return; // this setting is only for internet bearer
+		}
+    		
+	TBuf8<KBufSize32> key;
+	
+	GetConnectionPropertyNameL(key, EPropertyHttpPassword);
+	TUtil::StrCopy(iBuf8, aText);  // convert TDes to TDes8
+	iConnection.SetPropertyL(key, iBuf8);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::Profile
+//
+// -----------------------------------------------------------------------------
+//
+RSyncMLDataSyncProfile& CAspProfile::Profile()
+    {
+    return iProfile;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::LatestHistoryJob
+//
+// -----------------------------------------------------------------------------
+//
+const CSyncMLHistoryJob* CAspProfile::LatestHistoryJob()
+    {
+    if (!iHistoryLogOpen)
+    	{
+    	return NULL;
+    	}
+
+    TInt count = iHistoryLog.Count();
+    if (count == 0)
+        {
+        return NULL;  // profile has no history job
+        }
+        
+    iHistoryLog.SortEntries(CSyncMLHistoryEntry::ESortByTime);    
+    
+    // try to find latest sync job (start from last array entry)
+    for (TInt i=count-1; i>=0; i--)
+    	{
+        const CSyncMLHistoryEntry& entry = iHistoryLog[i];
+        const CSyncMLHistoryJob* jobEntry = CSyncMLHistoryJob::DynamicCast(&entry);
+        if (jobEntry)
+        	{
+        	return jobEntry;
+        	}
+    	}
+
+    return NULL;  // profile has no history job
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::LatestHistoryJob
+//
+// -----------------------------------------------------------------------------
+//
+const CSyncMLHistoryJob* CAspProfile::LatestHistoryJob(TInt aTaskId)
+    {
+    if (!iHistoryLogOpen)
+    	{
+    	return NULL;
+    	}
+
+    TInt count = iHistoryLog.Count();
+    if (count == 0)
+        {
+        return NULL;  // profile has no history job
+        }
+        
+    iHistoryLog.SortEntries(CSyncMLHistoryEntry::ESortByTime);    
+    
+    // try to find latest sync job (start from last array entry)
+    for (TInt i=count-1; i>=0; i--)
+    	{
+        const CSyncMLHistoryEntry& entry = iHistoryLog[i];
+        const CSyncMLHistoryJob* jobEntry = CSyncMLHistoryJob::DynamicCast(&entry);
+        if (jobEntry)
+        	{
+        	if (TaskExist(jobEntry, aTaskId))
+        		{
+        		return jobEntry;
+        		}
+        	}
+    	}
+
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CAspProfile::DeleteHistory
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::DeleteHistory()
+	{
+	if (iHistoryLogOpen)
+    	{
+    	iHistoryLog.DeleteAllEntriesL();	
+    	}  
+    	
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::TaskExist
+// 
+// -----------------------------------------------------------------------------
+TBool CAspProfile::TaskExist(const CSyncMLHistoryJob* aHistoryJob, TInt aTaskId)
+	{
+	TInt taskCount = aHistoryJob->TaskCount();
+	for (TInt i=0; i<taskCount; i++)
+		{
+		const CSyncMLHistoryJob::TTaskInfo& taskInfo = aHistoryJob->TaskAt(i);
+        
+        if (taskInfo.iTaskId == aTaskId)
+        	{
+        	return ETrue;
+        	}
+		}
+		
+	return EFalse;
+	}
+
+
+
+/* 
+// -----------------------------------------------------------------------------
+// CAspProfile::HistoryJobsLC (debugging code)
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspProfile::HistoryJobsLC()
+    {
+   	HBufC* hBuf = HBufC::NewLC(1024);
+	TPtr ptr = hBuf->Des();
+
+    if (!iHistoryLogOpen)
+    	{
+    	return hBuf;
+    	}
+
+    TInt count = iHistoryLog.Count();
+    if (count == 0)
+        {
+        return hBuf;  // profile has no history job
+        }
+        
+    // sort array
+    iHistoryLog.SortEntries(CSyncMLHistoryEntry::ESortByTime);    
+    
+    // try to find latest sync job (start from last array entry)
+    for (TInt i=count-1; i>=0; i--)
+    //for (TInt i=0; i<count; i++)
+    	{
+        const CSyncMLHistoryEntry& entry = iHistoryLog[i];
+        const CSyncMLHistoryJob* jobEntry = CSyncMLHistoryJob::DynamicCast(&entry);
+        if (jobEntry)
+        	{
+        	TTime t = jobEntry->TimeStamp();
+        	TBuf<128> buf;
+        	TUtil::GetDateTimeTextL(buf, t);
+        	ptr.Append(buf);
+        	ptr.Append(_L("\n"));
+        	}
+    	}
+
+    return hBuf;
+    }
+*/
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::OpenHistoryLog
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::OpenHistoryLog()
+    {
+    TInt id = ProfileId();
+   	TRAPD(err, iHistoryLog.OpenL(Session(), id));
+   	if (err == KErrNone)
+   		{
+   		iHistoryLogOpen = ETrue;
+    	}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::OpenConnection
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::OpenConnection()
+    {
+   	TInt err = KErrNone;
+   	RArray<TSmlTransportId> arr;
+   	
+    TRAP(err, Profile().ListConnectionsL(arr));
+    if (err != KErrNone)
+    	{
+    	return; 
+    	}
+    if (arr.Count() == 0)
+    	{
+     	arr.Close();  
+    	return; // no connection
+    	}
+        	
+    TInt transportId = arr[0];
+    arr.Close();
+    	
+    TRAP(err, iConnection.OpenL(iProfile, transportId));
+    if (err == KErrNone)
+    	{
+    	iConnectionOpen = ETrue;
+    	}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::Session
+// 
+// -----------------------------------------------------------------------------
+//
+RSyncMLSession& CAspProfile::Session()
+	{
+	__ASSERT_DEBUG(iSyncSession, TUtil::Panic(KErrGeneral));
+	
+	return *iSyncSession;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::ApplicationId
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::ApplicationId()
+	{
+	return iApplicationId;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::GetConnectionPropertyNameL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::GetConnectionPropertyNameL(TDes8& aText, TInt aPropertyPos)
+	{
+	//
+	// at the moment RSyncMLTransport is only needed for internet connection settings
+	//
+	RSyncMLTransport transport;
+	transport.OpenL(Session(), KUidNSmlMediumTypeInternet.iUid);  // no ICP call
+	CleanupClosePushL(transport);
+	
+	const CSyncMLTransportPropertiesArray&  arr = transport.Properties();
+	
+    __ASSERT_DEBUG(arr.Count()>aPropertyPos, TUtil::Panic(KErrGeneral));
+    	
+	const TSyncMLTransportPropertyInfo& info = arr.At(aPropertyPos);
+	aText = info.iName;
+	
+	CleanupStack::PopAndDestroy(&transport);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::CopyValuesL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::CopyValuesL(CAspProfile* aSource)
+    {
+    TBuf<KBufSize255> buf;
+    TInt num = 0;
+    
+    num = aSource->ProtocolVersion();
+    SetProtocolVersionL(num);
+    if (num == EAspProtocol_1_2)
+    	{
+    	if (!IsPCSuiteProfile(aSource))
+    		{
+        	aSource->GetServerId(buf);
+        	SetServerIdL(buf);
+    		}
+    	}
+    	
+    num = aSource->BearerType();
+    SetBearerTypeL(num);
+    
+    num = aSource->AccessPointL();
+
+	//check if the access point is valid
+	TAspAccessPointItem item;
+	item.iUid = num;
+	TAspParam param(iApplicationId, iSyncSession);
+	CAspAccessPointHandler* apHandler = CAspAccessPointHandler::NewL(param);
+	CleanupStack::PushL(apHandler);
+	TInt ret = apHandler->GetInternetApInfo(item);
+	if (ret == KErrNone)
+	    {
+	    SetAccessPointL(num);
+	    }
+	else
+	    {
+	    SetAccessPointL(CAspAccessPointHandler::KDefaultConnection);
+	    }    
+    CleanupStack::PopAndDestroy(apHandler);
+	
+    aSource->GetHostAddress(buf, num);
+    SetHostAddressL(buf, num);
+     
+    aSource->GetUserName(buf);
+    SetUserNameL(buf);
+     
+    aSource->GetPassword(buf);
+    SetPasswordL(buf);
+    
+    num = aSource->SASyncState();
+    SetSASyncStateL(num);
+    
+    if (aSource->BearerType() == EAspBearerInternet)
+    	{
+    	num = aSource->HttpUsedL();
+    	SetHttpUsedL(num);
+    	
+    	aSource->GetHttpUserNameL(buf);
+    	SetHttpUserNameL(buf);
+    	
+    	aSource->GetHttpPasswordL(buf);
+    	SetHttpPasswordL(buf);
+    	}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::SetDefaultValuesL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::SetDefaultValuesL(CAspProfile* aProfile)
+	{
+	aProfile->SetSASyncStateL(ESASyncStateConfirm);
+	aProfile->SetHttpUsedL(EFalse);
+	aProfile->SetAccessPointL(CAspAccessPointHandler::KDefaultConnection);
+	aProfile->SetProtocolVersionL(EAspProtocol_1_2);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::GetNewProfileNameL
+// 
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspProfile::GetNewProfileNameLC(CAspProfileList* aList, TInt aApplicationId)
+	{
+    HBufC* hBuf = NULL;
+    
+    for (TInt i=1; i<=KMaxProfileCount; i++)
+		{
+        hBuf = CAspResHandler::GetNewProfileNameLC(i, aApplicationId);
+		if (aList->FindProfileIndex(hBuf->Des()) == KErrNotFound)
+			{
+			break;
+     		}
+     	
+     	if (i == KMaxProfileCount)
+     		{
+     		break; // too many profiles - use existing name
+     		}
+     		
+     	CleanupStack::PopAndDestroy(hBuf);
+     	hBuf = NULL;
+		}
+		
+	if (!hBuf)
+		{
+		User::Leave(KErrNotFound);
+		}
+		
+	return hBuf;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::CheckMandatoryDataL
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::CheckMandatoryData(CAspProfile* aProfile, TInt& aContentCount)
+	{
+	aContentCount = 0;
+	
+	TInt ret = CheckMandatoryConnData(aProfile);
+	if (ret != EMandatoryOk)
+		{
+		return ret;
+		}
+
+    ret = CheckMandatoryTaskData(aProfile, aContentCount);
+    
+    return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::CheckMandatoryConnData
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::CheckMandatoryConnData(CAspProfile* aProfile)
+	{
+	const TInt KMaxHostAddressLength = KAspMaxURILength + 5;
+	
+	TBuf<KMaxHostAddressLength> buf;
+	TInt num;
+
+	aProfile->GetName(buf);
+	if (TUtil::IsEmpty(buf))
+		{
+		return EMandatoryNoProfileName;
+		}
+
+	aProfile->GetHostAddress(buf, num);
+	if (TUtil::IsEmpty(buf))
+		{
+		return EMandatoryNoHostAddress;
+		}
+
+    return EMandatoryOk;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::CheckMandatoryTaskDataL
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::CheckMandatoryTaskDataL(CAspProfile* aProfile, TInt& aContentCount)
+	{
+    TAspParam param(aProfile->ApplicationId(), &(aProfile->Session()));
+	param.iProfile = aProfile;
+	param.iMode = CAspContentList::EInitTasks;
+	
+	CAspContentList* list = CAspContentList::NewLC(param);
+    
+    TInt ret = list->CheckMandatoryDataL(aContentCount);
+	CleanupStack::PopAndDestroy(list);
+	
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::CheckMandatoryTaskData
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::CheckMandatoryTaskData(CAspProfile* aProfile, TInt& aContentCount)
+	{
+	TInt ret = EMandatoryNoContent;
+	
+	TRAP_IGNORE(ret = CheckMandatoryTaskDataL(aProfile, aContentCount));
+	
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::OtherSyncRunning
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspProfile::OtherSyncRunning(RSyncMLSession* aSyncSession)
+	{
+	TInt currentJob = CurrentJob(aSyncSession);
+
+    if (currentJob != KErrNotFound)
+		{
+		return ETrue;
+		}
+	
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfile::CurrentJob
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfile::CurrentJob(RSyncMLSession* aSyncSession)
+	{
+	TInt currentJob = KErrNotFound;
+	TSmlUsageType usageType = ESmlDataSync;
+	TRAP_IGNORE(aSyncSession->CurrentJobL(currentJob, usageType));
+		
+	if (currentJob >= 0)
+		{
+		return currentJob;	
+		}
+	return KErrNotFound;
+	}
+
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::IsPCSuiteProfile
+// 
+//-----------------------------------------------------------------------------
+//
+TBool CAspProfile::IsPCSuiteProfile(CAspProfile* aProfile)
+	{
+	_LIT(KPCSuite, "pc suite");
+
+	if (aProfile->DeleteAllowed())
+		{
+		return EFalse; // this is not "PC Suite" profile 
+		}
+	
+	TInt num = KErrNotFound;
+	TBuf<KBufSize64> buf;
+	aProfile->GetHostAddress(buf, num);
+	buf.LowerCase();
+	
+	if (buf.Compare(KPCSuite) == 0)
+		{
+		return ETrue;
+		}
+		
+	return EFalse;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspProfile::GetLocalisedPCSuite
+//
+// Returns "PC Suite" string localised to specific language
+// 
+// Current requirement is to localise to 2 languages TaiwanChinese and ELangHongKongChinese
+// For all the rest it will be mapped to "PC suite" only
+// -----------------------------------------------------------------------------
+//
+void CAspProfile::GetLocalisedPCSuite(TDes& aText)
+{
+ 		TLanguage language = User::Language();
+         
+ 		switch(language)
+ 		{
+ 			case ELangTaiwanChinese:
+            case ELangHongKongChinese:
+ 			case ELangEnglish_HongKong:
+ 			case ELangPrcChinese:
+ 			case ELangEnglish_Taiwan:
+			case ELangEnglish_Prc:
+ 			case ELangMalay_Apac:
+ 			case ELangIndon_Apac: 
+            {
+            	HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_PC_SUITE_PROFILE);
+            	TUtil::StrCopy(aText,*hBuf);
+            	CleanupStack::PopAndDestroy(hBuf);
+            	return;
+            }
+            default:
+            {
+            	TUtil::StrCopy(aText, iProfile.DisplayName());
+            	return;
+            }
+ 		}
+}
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::IsOperatorProfileL
+// 
+//-----------------------------------------------------------------------------
+//
+TBool CAspProfile::IsOperatorProfileL( CAspProfile* aProfile )
+    {
+    if ( !aProfile )
+        {
+        return EFalse;
+        }
+
+    TBuf<KBufSize255> serverId;
+    TBuf8<KBufSize255> serverIdUtf8;
+    TBuf8<KBufSize255> value;
+    
+    aProfile->GetServerId( serverId );
+    if ( serverId.Length() > 0 )
+        {
+        serverIdUtf8.Copy( serverId );
+    
+        CRepository* rep = CRepository::NewLC( KCRUidOperatorDatasyncInternalKeys );
+        TInt err = rep->Get( KNsmlOpDsOperatorSyncServerId, value );
+        CleanupStack::PopAndDestroy( rep );
+    
+        if ( !err && serverIdUtf8.Compare( value ) == 0 )
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::OperatorAdapterUidL
+// 
+//-----------------------------------------------------------------------------
+//
+TInt CAspProfile::OperatorAdapterUidL()
+    {
+    TInt value = 0;
+    CRepository* rep = CRepository::NewLC( KCRUidOperatorDatasyncInternalKeys );
+    rep->Get( KNsmlOpDsOperatorAdapterUid, value );
+    CleanupStack::PopAndDestroy( rep );
+    return value;
+    }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::ProfileAdapterUidL
+// 
+//-----------------------------------------------------------------------------
+//
+TInt CAspProfile::ProfileAdapterUidL()
+    {
+    TInt value = 0;
+    CRepository* rep = CRepository::NewLC( KCRUidOperatorDatasyncInternalKeys );
+    rep->Get( KNsmlOpDsProfileAdapterUid, value );
+    CleanupStack::PopAndDestroy( rep );
+    return value;
+    }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::ProfileVisibilityL
+// 
+//-----------------------------------------------------------------------------
+//
+TInt CAspProfile::ProfileVisibilityL()
+    {
+    TInt value = 0;
+    CRepository* rep = CRepository::NewLC( KCRUidOperatorDatasyncInternalKeys );
+    rep->Get( KNsmlOpDsSyncProfileVisibility, value );
+    CleanupStack::PopAndDestroy( rep );
+    return value;
+    }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::IsReadOnlyOperatorProfileL
+// 
+//-----------------------------------------------------------------------------
+//
+TBool CAspProfile::IsReadOnlyOperatorProfileL()
+    {
+    return ( IsOperatorProfileL( this ) && 
+        ProfileVisibilityL() == EProfileVisibilityReadOnly );
+    }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::IsHiddenOperatorProfileL
+// 
+//-----------------------------------------------------------------------------
+//
+TBool CAspProfile::IsHiddenOperatorProfileL()
+    {
+    return ( IsOperatorProfileL( this ) && 
+        ProfileVisibilityL() == EProfileVisibilityHidden );
+    }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::EqualsToOperatorServerIdL
+// 
+//-----------------------------------------------------------------------------
+//
+TBool CAspProfile::EqualsToOperatorServerId( const TDesC& aServerId )
+    {
+    if ( aServerId.Length() > 0 )
+        {
+        TBuf8<KBufSize255> serverIdUtf8;
+        TBuf8<KBufSize255> value;
+        serverIdUtf8.Copy( aServerId );
+
+        // Read operator specific serverId from cenrep
+        CRepository* rep = NULL;
+        TRAPD( err, rep = CRepository::NewL( KCRUidOperatorDatasyncInternalKeys ) );
+        if( err == KErrNone )
+            {
+            rep->Get( KNsmlOpDsOperatorSyncServerId, value );
+            delete rep;
+
+            if ( serverIdUtf8.Compare( value ) == 0 )
+                {
+                return ETrue;
+                }
+            }
+        }
+
+    return EFalse;
+    }
+
+/*******************************************************************************
+ * class TAspTask
+ *******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// TAspTask::SmlSyncDirection
+//
+// -----------------------------------------------------------------------------
+//
+TSmlSyncType TAspTask::SmlSyncDirection(TInt aSyncDirection)
+	{
+	TSmlSyncType type = ESmlTwoWay;
+	
+	if (aSyncDirection == ESyncDirectionOneWayFromDevice)
+		{
+		type = ESmlOneWayFromClient;
+		}
+	if (aSyncDirection == ESyncDirectionOneWayIntoDevice)
+		{
+		type = ESmlOneWayFromServer;
+		}
+	if (aSyncDirection == ESyncDirectionRefreshFromServer)
+		{
+		type = ESmlRefreshFromServer;
+		}
+		
+	return type;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TAspTask::SmlSyncDirection
+//
+// -----------------------------------------------------------------------------
+//
+TInt TAspTask::SyncDirection(TSmlSyncType aSmlSyncDirection)
+    {
+	TInt type = ESyncDirectionTwoWay;
+	
+	if (aSmlSyncDirection == ESmlOneWayFromClient)
+		{
+		type = ESyncDirectionOneWayFromDevice;
+		}
+	if (aSmlSyncDirection == ESmlOneWayFromServer)
+		{
+		type = ESyncDirectionOneWayIntoDevice;
+		}
+	if (aSmlSyncDirection == ESmlRefreshFromServer)
+		{
+		type = ESyncDirectionRefreshFromServer;
+		}
+		
+
+	return type;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TAspTask::FindTaskIdL
+//
+// -----------------------------------------------------------------------------
+//
+
+TInt TAspTask::FindTaskIdL(CAspProfile* aProfile, TInt aDataProviderId, const TDesC& aLocalDatabase)
+	{
+	TInt ret = KErrNotFound;
+	
+	RArray<TSmlTaskId> arr;
+	aProfile->Profile().ListTasksL(arr); // IPC call
+	CleanupClosePushL(arr);
+	
+	TInt count = arr.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		TInt taskId = arr[i];
+	    RSyncMLTask task;
+    	task.OpenL(aProfile->Profile(), taskId);  // IPC call
+		
+	    if (aDataProviderId != task.DataProvider())
+	    	{
+	    	task.Close();
+	    	continue; // wrong data provider
+	    	}
+    	if (!task.Enabled())
+    		{
+    		task.Close();
+    		continue; // task not in use
+    		}
+
+	    if (TUtil::IsEmpty(aLocalDatabase))
+	    	{
+	    	ret = taskId;  // parameter aLocalDatabase is empty - no db name check
+	    	}
+	    else
+	    	{
+	    	TPtrC ptr = task.ClientDataSource();
+	        if (ptr.Compare(aLocalDatabase) == 0)
+	    	    {
+	    	    ret = taskId;
+	    	    }
+	    	}
+	
+	    task.Close();
+		
+		if (ret != KErrNotFound)
+			{
+			break;
+			}
+		}
+		
+    CleanupStack::PopAndDestroy(&arr);		
+    
+    return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TAspTask::CheckLocalDatabase
+// 
+// -----------------------------------------------------------------------------
+//
+TInt TAspTask::CheckLocalDatabase(CAspProfile* aProfile, TInt& aDataProviderId)
+	{
+	TBool ret = ETrue;
+	
+	TRAPD(err, ret = CheckLocalDatabaseL(aProfile, aDataProviderId));
+	if (err != KErrNone)
+		{
+		return ETrue; // check failed, ETrue means profile has local database
+		}
+		
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TAspTask::CheckLocalDatabaseL
+//
+// -----------------------------------------------------------------------------
+//
+
+TBool TAspTask::CheckLocalDatabaseL(CAspProfile* aProfile, TInt& aDataProviderId)
+	{
+	FLOG( _L("TAspTask::CheckLocalDatabaseL START") );
+	
+	TInt ret = ETrue;
+	aDataProviderId = KErrNotFound;
+	
+	RArray<TSmlTaskId> arr;
+	aProfile->Profile().ListTasksL(arr); // IPC call
+	CleanupClosePushL(arr);
+	
+	TInt count = arr.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		// open sync task
+		RSyncMLTask task;
+        TInt taskId = arr[i];
+    	TRAPD(err, task.OpenL(aProfile->Profile(), taskId));  // IPC call
+	    if (err != KErrNone)
+		    {
+		    FTRACE( RDebug::Print(_L("### RSyncMLTask::OpenL failed (id=%d, err=%d) ###"), taskId, err) );
+	        User::Leave(err);
+		    }
+		    
+		CleanupClosePushL(task);
+		    
+    	TInt dataProviderId = task.DataProvider();
+    	TBool enabled = task.Enabled();
+    	
+        if (dataProviderId != KUidNSmlAdapterEMail.iUid)
+        	{
+	    	CleanupStack::PopAndDestroy(&task);
+	    	continue;  // only email sync task is checked
+        	}
+
+	    if (!enabled)
+	    	{
+	    	CleanupStack::PopAndDestroy(&task);
+	    	continue;  // this task is not included in sync
+	    	}
+     	
+        
+        // open data provider
+       	RSyncMLDataProvider dataProvider;
+        TRAPD(err2, dataProvider.OpenL(aProfile->Session(), dataProviderId));
+   	    if (err2 != KErrNone)
+		    {
+		    FTRACE( RDebug::Print(_L("### RSyncMLDataProvider::OpenL failed (id=%xd, err=%d) ###"), dataProviderId, err2) );
+	        User::Leave(err);
+		    }
+		CleanupClosePushL(dataProvider);
+        
+        TPtrC localDatabase = task.ClientDataSource();
+        
+        if (TUtil::IsEmpty(localDatabase))
+        	{
+        	TPtrC defaultDatabase = dataProvider.DefaultDataStoreName();
+        	if (TUtil::IsEmpty(defaultDatabase))
+        		{
+        		aDataProviderId = dataProviderId;
+        		ret = EFalse;
+        		}
+        	}
+        else
+        	{
+        	CDesCArrayFlat* localDataStores= new (ELeave) CDesCArrayFlat(KDefaultArraySize);
+        	CleanupStack::PushL(localDataStores);
+        	dataProvider.GetDataStoreNamesL(*localDataStores);
+        	TInt dataStorecount = localDataStores->Count();
+        	
+        	if (dataStorecount > 0)
+        		{
+	        	TInt found = localDataStores->Find(localDatabase, count);
+        	   	if (found != 0)  // 0 means database was found
+        		    {
+        		    aDataProviderId = dataProviderId;
+        		    ret = EFalse;
+        		    }
+        		}
+        	else
+        		{
+        		aDataProviderId = dataProviderId;
+        		ret = EFalse;
+        		}
+        		
+        	CleanupStack::PopAndDestroy(localDataStores);
+        	}
+	
+	    CleanupStack::PopAndDestroy(&dataProvider);
+	    CleanupStack::PopAndDestroy(&task);
+		
+		if (!ret)
+			{
+			break;
+			}
+		}
+		
+    CleanupStack::PopAndDestroy(&arr);
+    
+    FLOG( _L("TAspTask::CheckLocalDatabaseL END") );
+    return ret;
+	}
+
+
+
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspProfileDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,2142 @@
+/*
+* 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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "AspProfileDialog.h"
+#include "AspContentDialog.h"
+#include "AspSyncUtil.rh"
+#include "AspDebug.h"
+#include <csxhelp/ds.hlp.hrh>
+
+#include <aspsyncutil.mbg>  // for bitmap enumerations
+#include <AknIconArray.h>   // for GulArray
+#include <aknpasswordsettingpage.h>     // CAknAlphaPasswordSettingPage
+#include <ConnectionUiUtilities.h>      // CConnectionUiUtilities
+#include <featmgr.h>   // FeatureManager
+#include <cmdefconnvalues.h>
+#include <cmmanager.h>
+
+#include "AspSchedule.h"
+
+const TInt KMSKControlId( CEikButtonGroupContainer::EMiddleSoftkeyPosition );
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+TBool CAspProfileDialog::ShowDialogL(const TAspParam& aParam)
+	{
+	CAspProfileDialog* dialog = CAspProfileDialog::NewL(aParam);
+
+	TBool ret = dialog->ExecuteLD(R_ASP_PROFILE_DIALOG);
+
+    return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::NewL
+//
+// -----------------------------------------------------------------------------
+CAspProfileDialog* CAspProfileDialog::NewL(const TAspParam& aParam)
+    {
+    FLOG( _L("CAspProfileDialog::NewL START") );
+
+    CAspProfileDialog* self = new ( ELeave ) CAspProfileDialog(aParam);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    FLOG( _L("CAspProfileDialog::NewL END") );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::CAspProfileDialog
+// 
+// -----------------------------------------------------------------------------
+//
+CAspProfileDialog::CAspProfileDialog(const TAspParam& aParam)
+	{
+    iSyncSession = aParam.iSyncSession;
+    iApplicationId = aParam.iApplicationId;
+    iProfile = aParam.iProfile;
+    iContentList = aParam.iContentList;
+    iProfileList = aParam.iProfileList;
+    iEditMode = aParam.iMode;
+    iMSKEmpty = EFalse;
+       
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+	__ASSERT_ALWAYS(iContentList, TUtil::Panic(KErrGeneral));
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrGeneral));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileDialog::ConstructL()
+    {
+    FLOG( _L("CAspProfileDialog::ConstructL START") );
+	
+	// contruct menu for our dialog
+	CAknDialog::ConstructL(R_ASP_PROFILE_DIALOG_MENU);
+
+	iResHandler = CAspResHandler::NewL();
+
+	iSettingList = new (ELeave) CArrayPtrFlat<CAspListItemData>(1);
+
+    TAspParam param(KErrNotFound, iSyncSession);
+	iBearerHandler = CAspBearerHandler::NewL(param);
+	iApHandler = CAspAccessPointHandler::NewL(param);
+	
+	// get previous title so it can be restored
+	iSettingEnforcement = TUtil::SettingEnforcementState();
+	iStatusPaneHandler = CStatusPaneHandler::NewL(iAvkonAppUi);
+	iStatusPaneHandler->StoreOriginalTitleL();
+	
+	FLOG( _L("CAspProfileDialog::ConstructL END") );
+    } 
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CAspProfileDialog::~CAspProfileDialog()
+    {
+    FLOG( _L("CAspProfileDialog::~CAspProfileDialog START") );
+
+	delete iResHandler;
+	
+	if (iSettingList)
+		{
+		iSettingList->ResetAndDestroy();
+	    delete iSettingList;
+		}
+
+	delete iStatusPaneHandler;
+	delete iBearerHandler;
+	delete iApHandler;
+	
+    if (iAvkonAppUi)
+    	{
+    	iAvkonAppUi->RemoveFromStack(this);
+    	}
+
+	FLOG( _L("CAspProfileDialog::~CAspProfileDialog END") );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::ActivateL
+//
+// Called by system when dialog is activated.
+//------------------------------------------------------------------------------
+//
+void CAspProfileDialog::ActivateL()
+	{
+    CAknDialog::ActivateL();
+
+	// this cannot be in ConstructL which is executed before dialog is launched
+	iAvkonAppUi->AddToStackL(this);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspContentListDialog::GetHelpContext
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileDialog::GetHelpContext(TCoeHelpContext& aContext) const
+	{
+	aContext.iMajor = KUidSmlSyncApp;
+	aContext.iContext = KDS_HLP_SETTINGS;    
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::HandleListBoxEventL
+// 
+// -----------------------------------------------------------------------------
+void CAspProfileDialog::HandleListBoxEventL(CEikListBox* /*aListBox*/,
+                                            TListBoxEvent aEventType)
+	{
+	if( AknLayoutUtils::PenEnabled() )  
+	  {
+	   switch ( aEventType )
+        {
+        case EEventItemSingleClicked:
+              HandleOKL();
+              break;
+         case EEventEnterKeyPressed :
+         
+         case EEventItemDraggingActioned :
+         case EEventPenDownOnItem :
+        	  if(iEditMode != EDialogModeSettingEnforcement)
+				    {
+				    TRAPD(err ,CheckContentSettingL());//folder
+		         	User::LeaveIfError(err);
+				    }
+              break;
+         default:
+              break;
+        }
+		
+	  }
+    
+	}
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::PreLayoutDynInitL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspProfileDialog::PreLayoutDynInitL()
+    {
+    iSettingListBox = (CAknSettingStyleListBox*) ControlOrNull (EAspProfileDialogList);
+    
+   	__ASSERT_ALWAYS(iSettingListBox, TUtil::Panic(KErrGeneral));
+    
+	iSettingListBox->SetListBoxObserver(this);
+	iSettingListBox->CreateScrollBarFrameL(ETrue);
+	iSettingListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+	                 CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto);
+	
+	SetIconsL();
+	
+	// create array of setting items (iSettingList)
+	CreateSettingsListL();
+
+	// add setting headers into listbox
+	UpdateListBoxL(iSettingListBox, iSettingList);
+	
+	if (iEditMode == EDialogModeEditMandatory)
+		{
+		TInt index = CheckMandatoryFields();
+		if (index != KErrNotFound)
+			{
+			ListBox()->SetCurrentItemIndexAndDraw(index);
+			}
+		}
+	
+	TInt curIndex = ListBox()->CurrentItemIndex();
+		
+	CAspListItemData* curItem = GetItemForIndex(curIndex);
+	TBool isPCSuite = CAspProfile::IsPCSuiteProfile(iProfile);
+    	
+   	//if((isPCSuite && curItem->iHidden == EVisibilityReadOnly)
+   	if(curItem->iHidden == EVisibilityReadOnly
+   		|| iEditMode == EDialogModeSettingEnforcement)
+   	{
+   	   	 SetEmptyMiddleSoftKeyLabelL();
+   	}
+   	
+#ifdef RD_DSUI_TIMEDSYNC 
+	iStatusPaneHandler->SetTitleL(R_ASP_TITLE_PROFILE_SETTINGS);
+#else
+    iProfile->GetName(iBuf);
+    iStatusPaneHandler->SetTitleL(iBuf);
+#endif
+	iStatusPaneHandler->SetNaviPaneTitleL(KNullDesC);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileDialog::SetMiddleSoftKeyLabelL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspProfileDialog::SetEmptyMiddleSoftKeyLabelL()
+    {
+    ButtonGroupContainer().RemoveCommandFromStack(KMSKControlId,EAknSoftkeyOpen );
+    HBufC* middleSKText = StringLoader::LoadLC( R_TEXT_SOFTKEY_EMPTY );
+
+    ButtonGroupContainer().AddCommandToStackL(
+        KMSKControlId,
+        EAknSoftkeyEmpty,
+        *middleSKText );
+    iMSKEmpty= ETrue;
+    CleanupStack::PopAndDestroy( middleSKText );
+    }
+// ----------------------------------------------------------------------------
+// CAspProfileDialog::SetIconsL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspProfileDialog::SetIconsL()
+    {
+    if (!iSettingListBox)
+    	{
+    	return;
+    	}
+ 
+ 	TFileName bitmapName;
+	CAspResHandler::GetBitmapFileName(bitmapName);
+	CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray(KDefaultArraySize);
+	CleanupStack::PushL(icons);
+	
+	// Create the lock icon as the last icon in the table
+	CFbsBitmap* skinnedBitmap = NULL;
+    CFbsBitmap* skinnedMask = NULL;
+    
+	// Make the icon and put it in the array
+    CGulIcon* icon = CGulIcon::NewL();
+    CleanupStack::PushL(icon);
+    icon->SetBitmapsOwnedExternally(EFalse);
+		
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    // Create color icon
+    AknsUtils::CreateColorIconL(skin,
+							    KAknsIIDQgnIndiSettProtectedAdd, 
+							    KAknsIIDQsnIconColors,
+							    EAknsCIQsnIconColorsCG13,
+							    skinnedBitmap, 
+							    skinnedMask,
+							    bitmapName,
+							    EMbmAspsyncutilQgn_indi_sett_protected_add, 
+							    EMbmAspsyncutilQgn_indi_sett_protected_add_mask,
+							    KRgbBlack
+							   );
+	
+    icon->SetMask(skinnedMask);     // ownership transferred
+    icon->SetBitmap(skinnedBitmap); // ownership transferred
+    
+	icons->AppendL( icon );  
+
+	CleanupStack::Pop(icon); // icon
+    // Create the lock icon for highlight
+    skinnedBitmap = NULL;
+    skinnedMask = NULL;
+    
+    // delete old icons
+    CArrayPtr<CGulIcon>* arr =
+		iSettingListBox->ItemDrawer()->FormattedCellData()->IconArray();
+    
+    if (arr)
+    	{
+    	arr->ResetAndDestroy();
+	    delete arr;
+	    arr = NULL;
+    	}
+
+	iSettingListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
+	CleanupStack::Pop(icons);
+    }
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::IconL
+// 
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CAspProfileDialog::IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex)
+	{
+    return TDialogUtil::CreateIconL(aId, aFileName, aFileIndex, aFileMaskIndex);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::DynInitMenuPaneL
+//
+// Called by system before menu is shown.
+//------------------------------------------------------------------------------
+//
+void CAspProfileDialog::DynInitMenuPaneL(TInt /*aResourceID*/, CEikMenuPane* aMenuPane)
+	{
+   
+   	if (ListBox()->Model()->NumberOfItems() == 0) 
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChange);
+		return;
+		}
+
+	CAspListItemData* item = GetItemForIndex(ListBox()->CurrentItemIndex());
+	if (item->iHidden == EVisibilityReadOnly)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChange);
+		}
+	
+	if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAknCmdHelp);
+		}
+	
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::ProcessCommandL
+//
+// Handle commands from menu.
+//------------------------------------------------------------------------------
+//
+void CAspProfileDialog::ProcessCommandL(TInt aCommandId)
+	{
+	HideMenu();
+
+	switch (aCommandId)
+		{
+		case EAknCmdHelp:
+			{
+			TUtil::LaunchHelpAppL(iEikonEnv);
+            break;
+			}
+
+		case EAspMenuCmdChange:
+		case EAspMenuCmdOpen:
+			{				
+    		CAspListItemData* item = GetItemForIndex(ListBox()->CurrentItemIndex());
+
+			if (item->iItemType == CAspListItemData::ETypeListYesNo)
+				{
+				// open editor for Yes/No setting
+				if (EditSettingItemListL(*item))
+					{
+					SetVisibilityL();
+					UpdateListBoxL(ListBox(), iSettingList);
+					}
+				}				
+			else
+				{
+				HandleOKL();
+				}
+
+			break;
+			}
+		    
+        case EAspMenuCmdExit:
+        case EAknCmdExit:
+        case EEikCmdExit:
+			{
+			// close dialog and exit calling application
+			iAvkonAppUi->ProcessCommandL(EAknCmdExit);
+			break;
+			}
+
+		default:			
+		    break;
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::OkToExitL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::OkToExitL(TInt aButtonId)
+	{
+	if (aButtonId == EEikBidCancel)
+		{
+		// save silently and close dialog
+		
+		CheckSettingValues(aButtonId);
+
+		TRAP_IGNORE(SaveSettingsL());
+		return ETrue; // close dialog
+		}
+
+	if (aButtonId == EAknSoftkeyBack)
+        {
+        TBool ret = CheckSettingValues(aButtonId);
+        if (!ret)
+        	{
+        	return EFalse; // leave dialog open
+        	}
+        	
+		TRAP_IGNORE(SaveSettingsL());
+		return ETrue; // close dialog
+		}
+		
+	if (aButtonId == EAknSoftkeyOpen || aButtonId == EAknSoftkeyEmpty)  // MSK
+        {
+		CAspListItemData* item = GetItemForIndex(ListBox()->CurrentItemIndex());
+		if (item->iHidden == EVisibilityReadOnly)
+			{
+    		if(iEditMode == EDialogModeSettingEnforcement)
+    		{
+    			TDialogUtil::ShowInformationNoteL(R_ASP_PROTECTED_SETTING);
+    		}
+     		else
+     		{
+			TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_READ_ONLY);
+     		}
+			return EFalse;
+			}
+
+        HandleOKL();
+		return EFalse;  // leave dialog open
+		}
+		
+	if (aButtonId == EAknSoftkeyOptions)	
+		{
+		if (iCommandSetId == R_ASP_CBA_OPTIONS_BACK_OPEN)
+			{
+			UpdateMenuL(R_ASP_PROFILE_CONTEXT_MENU);
+			}	
+		else 
+			{
+			UpdateMenuL(R_ASP_PROFILE_DIALOG_MENU);	
+			}
+		return EFalse;
+		}
+	return CAknDialog::OkToExitL(aButtonId);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::CheckSettingValuesL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::CheckSettingValuesL(TInt aButtonId)
+	{
+    if (iEditMode == EDialogModeReadOnly || 
+        iEditMode == EDialogModeSettingEnforcement)
+    	{
+    	return ETrue;
+    	}
+	
+	if (aButtonId == EEikBidCancel)
+		{
+		TInt index = CheckUniqueServerId();
+		if (index != KErrNotFound)
+			{
+			Item(EAspServerId)->SetValueL(iOldServerId);
+			}
+
+		return ETrue;
+		}
+
+	TInt mandatoryIndex = CheckMandatoryFields();
+	if (mandatoryIndex != KErrNotFound)
+		{
+		if (!TDialogUtil::ShowConfirmationQueryL(R_ASP_EXIT_ANYWAY))
+			{
+			ListBox()->SetCurrentItemIndexAndDraw(mandatoryIndex);
+			return EFalse; // leave dialog open
+			}
+				
+	    TInt serverIdIndex = CheckUniqueServerId();
+	    if (serverIdIndex != KErrNotFound)
+	    	{
+	    	Item(EAspServerId)->SetValueL(iOldServerId);
+	    	}
+		}
+	else
+		{
+		TInt serverIdIndex = CheckUniqueServerId();
+	    if (serverIdIndex != KErrNotFound)
+		    {
+		    if (!TDialogUtil::ShowConfirmationQueryL(R_ASP_SERVER_ID_EXISTS))
+			    {
+			    ListBox()->SetCurrentItemIndexAndDraw(serverIdIndex);
+			    return EFalse; // leave dialog open
+			    }
+		    else
+			    {
+			    Item(EAspServerId)->SetValueL(iOldServerId);
+			    }
+		    }
+		}
+
+    return ETrue;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::CheckSettingValues
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::CheckSettingValues(TInt aButtonId)
+	{
+	TBool ret = EFalse;
+	
+	TRAPD(err, ret = CheckSettingValuesL(aButtonId));
+	if (err != KErrNone)
+		{
+		return ETrue;
+		}
+
+	return ret;
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileDialog::OfferKeyEventL
+// 
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspProfileDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+	{
+	if (aType == EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+			case EKeyEnter:
+				{
+					HandleOKL();
+					return EKeyWasConsumed;
+				}
+			case EKeyEscape:  // framework calls this when dialog must shut down
+				{
+				return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+        		}
+			case EKeyUpArrow:
+			case EKeyDownArrow:
+			    {
+			    	if(iEditMode != EDialogModeSettingEnforcement)
+				    {
+				    TRAPD(err ,CheckContentSettingL(aKeyEvent));//folder
+		         	User::LeaveIfError(err);
+				    }
+			    break;
+			    }
+            default:
+				{
+			    break;
+				}
+			}
+		}
+
+	return CAknDialog::OfferKeyEventL( aKeyEvent, aType);
+	}
+
+// ---------------------------------------------------------------------------------------------
+// CAspProfileDialog::CheckContentSetting
+// modifies MSK and menu item depending on the item in the list box when touch events are handled
+// ----------------------------------------------------------------------------------------------
+//
+
+void CAspProfileDialog::CheckContentSettingL()
+{
+	TInt curIndex = ListBox()->CurrentItemIndex();
+	TInt count = iSettingList->Count();
+	CAspListItemData* lastItem = (*iSettingList)[--count];
+	
+
+		
+	CAspListItemData* curItem = GetItemForIndex(curIndex);
+	TBool isPCSuite = CAspProfile::IsPCSuiteProfile(iProfile);
+	if(isPCSuite && (curItem->iHidden == EVisibilityReadOnly))
+	{
+   		SetEmptyMiddleSoftKeyLabelL();
+   		return;
+	}
+	if(curItem->iItemId != EAspSyncContent)
+		{
+		if(iCommandSetId != R_ASP_CBA_OPTIONS_BACK_CHANGE || iMSKEmpty)
+			{
+			UpdateCbaL(R_ASP_CBA_OPTIONS_BACK_CHANGE);
+		
+			}
+		return;		
+		}
+	UpdateCbaL( R_ASP_CBA_OPTIONS_BACK_OPEN);
+
+}
+
+// ----------------------------------------------------------------------------
+// CAspProfileDialog::CheckContentSetting
+// modifies MSK depending on the item
+// ----------------------------------------------------------------------------
+//
+
+void CAspProfileDialog::CheckContentSettingL(const TKeyEvent& aKeyEvent)
+	{
+	
+	TInt curIndex = ListBox()->CurrentItemIndex();
+	TInt count = iSettingList->Count();
+	CAspListItemData* lastItem = (*iSettingList)[--count];
+	
+	switch (aKeyEvent.iCode)
+		{
+		case EKeyUpArrow:
+			{
+				if (curIndex)
+				{
+					curIndex--;
+				}
+				else
+				{
+				    curIndex = lastItem->iIndex;
+				}
+			break;
+			}
+		case EKeyDownArrow:
+			{
+				if (curIndex == lastItem->iIndex)
+				{
+				curIndex = 0;
+				}
+				else
+				{
+				curIndex++;
+				}
+			break;
+			}
+		}
+		
+	CAspListItemData* curItem = GetItemForIndex(curIndex);
+	if(curItem->iHidden == EVisibilityReadOnly)
+	{
+   		SetEmptyMiddleSoftKeyLabelL();
+   		return;
+	}
+	if(curItem->iItemId != EAspSyncContent)
+		{
+		if(iCommandSetId != R_ASP_CBA_OPTIONS_BACK_CHANGE || iMSKEmpty)
+			{
+			UpdateCbaL(R_ASP_CBA_OPTIONS_BACK_CHANGE);
+		
+			}
+		return;		
+		}
+	UpdateCbaL( R_ASP_CBA_OPTIONS_BACK_OPEN);
+
+	}
+
+// ----------------------------------------------------------------------------
+// CAspProfileDialog::HandleResourceChange
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspProfileDialog::HandleResourceChange(TInt aType)
+    {   
+    if (aType == KEikDynamicLayoutVariantSwitch) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        iSettingListBox->SetSize(mainPaneRect.Size());
+        CCoeControl::HandleResourceChange(aType);
+		DrawDeferred();
+	    return;
+		}
+		
+    if (aType == KAknsMessageSkinChange)
+        {
+        TRAP_IGNORE(SetIconsL());
+        }
+		
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::CheckMandatoryFields
+//
+// Check that all mandatory fields are filled.
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileDialog::CheckMandatoryFields()
+	{ 
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* item = (*iSettingList)[i];
+		
+		if (!CheckMandatoryContentFields(item))
+			{
+			return item->iIndex;
+			}
+			
+		if ( item->iMandatory && item->IsEmpty() && (item->iHidden == EVisibilityNormal) )
+			{
+			return item->iIndex;
+			}
+		}
+
+    return KErrNotFound;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::CheckUniqueServerId
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileDialog::CheckUniqueServerId()
+	{
+	TPtrC ptr = Item(EAspServerId)->Value();
+	
+	if (iOldServerId.Compare(ptr) == 0)
+		{
+		return KErrNotFound;  // server id has not changed
+		}
+	
+	if (!iProfileList)
+		{
+		return KErrNotFound;
+		}
+
+	TInt profileId = iProfile->ProfileId();
+
+	if (iProfileList->IsUniqueServerId(Item(EAspServerId)->Value(), profileId))
+		{
+		return KErrNotFound;
+		}
+		
+	return Item(EAspServerId)->iIndex;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::CheckMandatoryContentFields
+//
+// Check that all mandatory fields are filled.
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::CheckMandatoryContentFields(CAspListItemData* aListItem)
+	{
+	if (aListItem->iItemType != CAspListItemData::ETypeSyncContent)
+		{
+		return ETrue;
+		}
+		
+	TInt index = iContentList->FindTaskIndexForProvider(aListItem->iNumberData);
+	if (index == KErrNotFound)
+		{
+		return ETrue;
+		}
+		
+	TAspTaskItem& item = iContentList->TaskItem(index);
+	if (item.iEnabled && !item.iRemoteDatabaseDefined)
+		{
+		return EFalse;
+		}
+		
+    return ETrue;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::HandleOKL
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileDialog::HandleOKL()
+	{
+	CAspListItemData* item = GetItemForIndex(ListBox()->CurrentItemIndex());
+
+	if (item->iHidden == EVisibilityReadOnly)
+		{
+			if(iEditMode == EDialogModeSettingEnforcement)
+      		{
+    			TDialogUtil::ShowInformationNoteL(R_ASP_PROTECTED_SETTING);
+    		}
+     		else
+     		{
+			TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_READ_ONLY);
+     		}
+		return;
+		}
+
+	if (EditSettingItemL(*item))
+		{
+		SetVisibilityL();
+		UpdateListBoxL(ListBox(), iSettingList);
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileDialog::CreateSettingsListL
+// 
+// Function creates setting list array (iSettingsList).
+// Note: enum TAspConnectionSettings must match with string array
+// (R_ASP_CONNECTION_DIALOG_SETTING_ITEMS).
+// ----------------------------------------------------------------------------
+//
+void CAspProfileDialog::CreateSettingsListL()
+	{
+	// read setting headers from resource
+	CDesCArray* arr = iResHandler->ReadDesArrayLC(R_ASP_CONNECTION_DIALOG_SETTING_ITEMS);
+	
+	// add one CAspListItemData for each setting
+	AddItemL(EAspProfileName, arr);
+	AddItemL(EAspProtocolVersion, arr);
+	AddItemL(EAspServerId, arr);
+
+	AddItemL(EAspConnType, arr);
+	AddItemL(EAspAccessPoint,R_ASP_NETWORK_DESTINATION);
+	AddItemL(EAspHostAddress, arr);
+	AddItemL(EAspPort, arr);
+	AddItemL(EAspUsername, arr);
+	AddItemL(EAspPassword, arr);
+	
+#ifdef __SYNCML_DS_ALERT
+	AddItemL(EAspServerAlert, arr);
+#endif
+
+	AddItemL(EAspHttpsUsername, arr);
+	AddItemL(EAspHttpsPassword, arr);
+	
+	AddItemL(EAspSyncDirection, arr);
+	
+#ifndef	RD_DSUI_TIMEDSYNC 
+	AddContentItemsL();
+#endif
+
+	// write setting data into each CAspListItemData
+	TInt count=iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		InitSettingItemL((*iSettingList)[i]);
+		}
+
+	SetVisibilityL();  // find out what setting appear on UI
+
+	CleanupStack::PopAndDestroy(arr);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileDialog::AddItemL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspProfileDialog::AddItemL(TInt aItemId, CDesCArray* aHeaders)
+	{
+    CAspListItemData* item = CAspListItemData::NewLC();
+	item->SetHeaderL((*aHeaders)[aItemId]);
+	item->iItemId = aItemId;
+	iSettingList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileDialog::AddItemL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspProfileDialog::AddItemL(TInt aItemId, TInt aResourceId)
+	{
+    CAspListItemData* item = CAspListItemData::NewLC();
+	item->SetHeaderL(aResourceId);
+	item->iItemId = aItemId;
+	iSettingList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileDialog::AddContentItemsL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspProfileDialog::AddContentItemsL()
+	{
+   	TInt count = iContentList->ProviderCount();
+
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProviderItem& providerItem = iContentList->ProviderItem(i);
+		TInt appId = TUtil::AppIdFromProviderId(providerItem.iDataProviderId);
+		if (iApplicationId != EApplicationIdSync && iApplicationId != appId)
+			{
+			continue;
+			}
+		
+        // In Phonebooks synchronization settings, remove another provider from
+        //  end of settings item list (unless platform's contacts adapter is
+        //  is defined as operator specific adapter and thus there is no dedicated
+        //  operator specific adapter)
+        if (appId == EApplicationIdContact)
+            {
+            TInt operatorUid = CAspProfile::OperatorAdapterUidL();
+            if ( operatorUid != KUidNSmlAdapterContact.iUid &&
+                operatorUid != 0 )
+                {
+                // Operator profile: do not display s60 contacts adapter
+                if (CAspProfile::IsOperatorProfileL(iProfile))
+                    {
+                    if (operatorUid != providerItem.iDataProviderId)
+                        {
+                        continue;   
+                        }
+                    }
+                // Non-operator profile: Do not display operator adapter
+                else if (operatorUid == providerItem.iDataProviderId)
+                    {
+                    continue;                    
+                    }                    
+                }
+            }
+
+		HBufC* firstLine = CAspResHandler::GetContentSettingLC(
+		                                   providerItem.iDataProviderId,
+		                                   providerItem.iDisplayName);
+		
+	    CAspListItemData* item = CAspListItemData::NewLC();
+    
+    	item->SetHeaderL(firstLine->Des());
+	    item->iItemId = EAspSyncContent;
+	    item->iItemType = CAspListItemData::ETypeSyncContent;
+	    item->iNumberData = providerItem.iDataProviderId;
+	    iSettingList->AppendL(item);
+	    CleanupStack::Pop(item);
+	    
+	    CleanupStack::PopAndDestroy(firstLine);
+    	}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileDialog::UpdateListBoxL
+// 
+// Add settings headers into listbox.
+// ----------------------------------------------------------------------------
+//
+void CAspProfileDialog::UpdateListBoxL(CEikTextListBox* aListBox,
+                                       CAspSettingList* aItemList)
+	{
+	CDesCArray* arr = (CDesCArray*)aListBox->Model()->ItemTextArray();
+	arr->Reset();
+
+	TInt count = aItemList->Count();
+	for (TInt i=0; i<count; i++ )
+		{	
+		CAspListItemData* item = (*aItemList)[i];
+		TInt id = item->iItemId;
+		
+		TBool convert = ETrue;
+	   TBool isPCSuite=CAspProfile::IsPCSuiteProfile(iProfile);
+       TBool readOnly = iProfile->DeleteAllowed();
+       if(isPCSuite && !readOnly||iSettingEnforcement)
+        {
+                if(id==EAspAccessPoint || id==EAspSyncDirection ||id==EAspConnType)
+        	       convert = EFalse;//no number conversion
+        }
+       if(!isPCSuite &&!readOnly)
+       {
+                if(id==EAspAccessPoint ||id==EAspConnType)
+        	       convert = EFalse;//no number conversion
+       }	
+		if (id == EAspServerId || id == EAspHostAddress ||
+	       id == EAspPort || id == EAspUsername || id == EAspHttpsUsername||iSettingEnforcement)
+			{
+			convert = EFalse; // no number conversion
+			}
+
+		if (item->iHidden != EVisibilityHidden)
+			{
+			HBufC* hBuf = item->ListItemTextL(convert);
+			CleanupStack::PushL(hBuf);
+			
+			arr->AppendL(hBuf->Des());
+			
+			// store listbox index (from zero up) into setting item 
+			item->iIndex = arr->Count() - 1;
+
+			CleanupStack::PopAndDestroy(hBuf);
+			}
+		else
+			{
+			item->iIndex = KErrNotFound;
+			}
+		}
+
+	ListBox()->HandleItemAdditionL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::SetVisibilityL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspProfileDialog::SetVisibilityL()
+	{
+    TBool isPCSuite = CAspProfile::IsPCSuiteProfile(iProfile);
+    
+    TBool readOnly = iProfile->DeleteAllowed();
+	
+	if (Item(EAspProtocolVersion)->iNumberData == EAspProtocol_1_1)
+		{
+		Item(EAspServerId)->iHidden = EVisibilityHidden;
+		}
+	else if (isPCSuite || !readOnly)
+		{
+		Item(EAspServerId)->iHidden = EVisibilityReadOnly;
+		}
+	else
+		{
+		Item(EAspServerId)->iHidden = EVisibilityNormal;
+		}
+	
+	
+	if (isPCSuite || !readOnly)
+		{
+		Item(EAspConnType)->iHidden = EVisibilityReadOnly;
+		}
+	else
+		{
+		Item(EAspConnType)->iHidden = EVisibilityNormal;
+		}
+
+	if (isPCSuite || !readOnly)
+		{
+		Item(EAspHostAddress)->iHidden = EVisibilityReadOnly;
+		}
+	else
+		{
+		Item(EAspHostAddress)->iHidden = EVisibilityNormal;
+		}
+		
+	if(isPCSuite)
+	{
+		Item(EAspSyncDirection)->iHidden = EVisibilityReadOnly;
+	}
+	else
+	{
+		Item(EAspSyncDirection)->iHidden = EVisibilityNormal;
+	}
+    
+		
+
+	if (iBearerHandler->SupportedBearerCount() == 1)
+		{
+		Item(EAspConnType)->iHidden = EVisibilityReadOnly;
+		}
+	
+    Item(EAspUsername)->iHidden = EVisibilityNormal;
+	Item(EAspPassword)->iHidden = EVisibilityNormal;
+
+	if (Item(EAspConnType)->iNumberData != EAspBearerInternet)
+		{
+		Item(EAspAccessPoint)->iHidden = EVisibilityHidden;
+		Item(EAspPort)->iHidden = EVisibilityHidden;
+		Item(EAspHttpsUsername)->iHidden = EVisibilityHidden;
+		Item(EAspHttpsPassword)->iHidden = EVisibilityHidden;
+    	}
+	else
+		{
+		Item(EAspAccessPoint)->iHidden = EVisibilityNormal;
+		Item(EAspPort)->iHidden = EVisibilityNormal;
+		Item(EAspHttpsUsername)->iHidden = EVisibilityNormal;
+		Item(EAspHttpsPassword)->iHidden = EVisibilityNormal;
+		}
+		
+#ifdef __SYNCML_DS_ALERT
+    Item(EAspServerAlert)->iHidden = EVisibilityNormal;
+#endif
+	
+    if (iEditMode == EDialogModeReadOnly || 
+        iEditMode == EDialogModeSettingEnforcement ||
+        iProfile->IsReadOnlyOperatorProfileL() )
+    	{
+    	SetAllReadOnly();
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentDialog::SetAllReadOnly
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspProfileDialog::SetAllReadOnly()
+	{
+	TInt count = iSettingList->Count();
+
+	for (TInt i=0; i<count; i++ )
+		{
+		CAspListItemData* item = (*iSettingList)[i];
+		if (item->iHidden != EVisibilityHidden)
+			{
+			item->iHidden = EVisibilityReadOnly;
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::InitSettingItemL
+// 
+// Constructs CAspListItemData for one connection setting.
+// -----------------------------------------------------------------------------
+//
+void CAspProfileDialog::InitSettingItemL(CAspListItemData* aItem)
+	{
+	__ASSERT_ALWAYS(aItem, TUtil::Panic(KErrGeneral));	
+	
+	iBuf = KNullDesC;  // reset common buffer
+	
+	switch (aItem->iItemId)
+		{
+		case EAspProfileName:
+			{
+			iProfile->GetName(iBuf);
+			aItem->SetValueL(iBuf);
+			aItem->SetDisplayValueL(R_ASP_MUST_BE_DEFINED);
+			
+			aItem->iMaxLength = KAspMaxProfileNameLength;
+			aItem->iLatinInput = EFalse;
+			aItem->iItemType = CAspListItemData::ETypeText;
+			aItem->iMandatory = ETrue;
+			break;
+			}
+
+		case EAspProtocolVersion:
+			{
+			CDesCArray* arr = iResHandler->ReadDesArrayLC(R_ASP_PROTOCOL_VERSION);
+    
+    		aItem->iNumberData = iProfile->ProtocolVersion();
+			aItem->SetValueL((*arr)[aItem->iNumberData]);
+				
+			aItem->iResource = R_ASP_PROTOCOL_VERSION;
+			aItem->iItemType = CAspListItemData::ETypeProtocolList;
+			
+			CleanupStack::PopAndDestroy(arr);
+			break;
+			}
+
+		case EAspServerId:
+			{
+			iProfile->GetServerId(iBuf);
+			aItem->SetValueL(iBuf);
+			if(TDialogUtil::IsPCSuiteDesC(iBuf))
+			{
+				aItem->SetDisplayValueL(R_ASP_PC_SUITE_PROFILE);	
+			}
+			else
+			{
+			aItem->SetDisplayValueL(R_ASP_SETTING_VALUE_NONE);
+			}
+
+			aItem->iMaxLength = KAspMaxServerIdLength;
+			aItem->iLatinInput = ETrue;
+			aItem->iItemType = CAspListItemData::ETypeText;
+			
+			TUtil::StrCopy(iOldServerId, iBuf);
+			break;
+			}
+		
+		
+		case EAspConnType:
+			{
+			aItem->iNumberData = iProfile->BearerType();
+
+			if (!iBearerHandler->IsSupported(aItem->iNumberData))
+				{
+				aItem->iNumberData = iBearerHandler->DefaultBearer();
+				}
+
+ 			iBearerHandler->GetBearerName(iBuf, aItem->iNumberData);
+			aItem->SetValueL(iBuf);
+			aItem->iItemType = CAspListItemData::ETypeBearerList;
+
+			break;
+			}
+		
+		case EAspAccessPoint:
+			{
+			TAspAccessPointItem item;
+	        item.iUid = iProfile->AccessPointL();
+	        TInt ret = iApHandler->GetInternetApInfo(item);
+	        if (ret == KErrNone)
+	        	{
+	        	aItem->iNumberData = item.iUid;
+	        	aItem->SetValueL(item.iName);
+	        	aItem->iResource = R_ASP_NETWORK_CONNECTION;
+	        	}
+	        else
+	        	{
+	        	aItem->iNumberData = CAspAccessPointHandler::KDefaultConnection;	
+	        	aItem->SetDisplayValueL(R_ASP_DEFAULT_CONNECTION);
+	        	aItem->iResource = R_ASP_NETWORK_CONNECTION;
+	        	}
+	        aItem->iItemType = CAspListItemData::ETypeInternetAccessPoint;
+			break;
+			}
+		
+		case EAspHostAddress:
+			{
+			iProfile->GetHostAddress(iBuf, aItem->iNumberData);
+			aItem->SetValueL(iBuf);
+			if(TDialogUtil::IsPCSuiteDesC(iBuf))
+			{
+				aItem->SetDisplayValueL(R_ASP_PC_SUITE_PROFILE);	
+	 		}
+	        else
+	        {
+	        	aItem->SetDisplayValueL(R_ASP_MUST_BE_DEFINED);
+	        }
+			
+			aItem->iMaxLength = KAspMaxURILength;
+			aItem->iLatinInput = ETrue;
+			aItem->iItemType = CAspListItemData::ETypeHostAddress;
+			aItem->iMandatory = ETrue;
+			
+			break;
+			}
+		    
+		case EAspPort:
+			{
+			iProfile->GetHostAddress(iBuf, aItem->iNumberData);
+			if ( aItem->iNumberData > TURIParser::EMaxURIPortNumber || aItem->iNumberData < TURIParser::EMinURIPortNumber)
+  					 	aItem->iNumberData = TURIParser::EDefaultHttpPort;	
+			aItem->SetValueL(aItem->iNumberData);
+			
+			aItem->iMaxLength = KBufSize16;
+			aItem->iMaxValue = TURIParser::EMaxURIPortNumber;
+			aItem->iMinValue = TURIParser::EMinURIPortNumber;
+			aItem->iItemType = CAspListItemData::ETypeNumber;
+			aItem->iLatinInput = ETrue;
+			break;
+			}
+		    
+		case EAspUsername:
+			{
+			iProfile->GetUserName(iBuf);
+			aItem->SetValueL(iBuf);
+			aItem->SetDisplayValueL(R_ASP_SETTING_VALUE_NONE);
+
+			aItem->iMaxLength = KAspMaxUsernameLength;
+			aItem->iLatinInput = ETrue;
+			aItem->iItemType = CAspListItemData::ETypeText;
+			break;
+			}
+		    
+		case EAspPassword:
+			{
+			iProfile->GetPassword(iBuf);
+			aItem->SetValueL(iBuf);
+			TUtil::Fill(iBuf, KSecretEditorMask, KSecretEditorMaskLength);
+			aItem->SetDisplayValueL(iBuf);
+
+			aItem->iMaxLength = KAspMaxPasswordLength;
+			aItem->iItemType = CAspListItemData::ETypeSecret;
+			break;
+			}
+		
+		case EAspHttpsUsername:
+			{
+			iProfile->GetHttpUserNameL(iBuf);
+			aItem->SetValueL(iBuf);
+			aItem->SetDisplayValueL(R_ASP_SETTING_VALUE_NONE);
+
+			aItem->iMaxLength = KAspMaxUsernameLength;
+			aItem->iLatinInput = ETrue;
+			aItem->iItemType = CAspListItemData::ETypeText;
+			break;
+			}
+
+		case EAspHttpsPassword:
+			{
+			iProfile->GetHttpPasswordL(iBuf);
+			aItem->SetValueL(iBuf);
+			TUtil::Fill(iBuf, KSecretEditorMask, KSecretEditorMaskLength);
+			aItem->SetDisplayValueL(iBuf);
+
+			aItem->iMaxLength = KAspMaxPasswordLength;
+			aItem->iItemType = CAspListItemData::ETypeSecret;
+			break;
+			}
+		
+		case EAspServerAlert:
+			{
+			CDesCArray* arr = iResHandler->ReadDesArrayLC(R_ASP_SERVER_ALERT_TYPE);
+
+            aItem->iNumberData = iProfile->SASyncState();
+			aItem->iResource = R_ASP_SERVER_ALERT_TYPE;
+			aItem->SetValueL((*arr)[aItem->iNumberData]);
+			aItem->iItemType = CAspListItemData::ETypeList;
+			
+			CleanupStack::PopAndDestroy(arr);
+			break;
+			}
+			
+		case EAspSyncDirection:
+			{
+    		CDesCArray* arr;
+    		TBool isPCSuite = CAspProfile::IsPCSuiteProfile(iProfile);
+    		if(isPCSuite)
+			 {
+			 	
+			    arr = iResHandler->ReadDesArrayLC(R_ASP_SYNC_PCSUITE_TYPE);
+    			aItem->iResource = R_ASP_SYNC_PCSUITE_TYPE;
+    			   		
+			 }
+			 else
+			 {
+			 	arr = iResHandler->ReadDesArrayLC(R_ASP_SYNC_TYPE);
+    			aItem->iResource =R_ASP_SYNC_TYPE ;
+    			   		
+			 }
+    	
+    		aItem->iNumberData = iContentList->SyncDirection();
+			aItem->SetValueL((*arr)[aItem->iNumberData]);
+			aItem->iItemType = CAspListItemData::ETypeList;
+    		
+    		CleanupStack::PopAndDestroy(arr);
+			break;
+			}
+			
+        
+        case EAspSyncContent:
+        	{
+        	break;
+        	}
+        	
+        default:
+           	__ASSERT_DEBUG(EFalse, TUtil::Panic(KErrGeneral));
+			break;
+		
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileDialog::SaveSettingsL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspProfileDialog::SaveSettingsL()
+	{
+    if (iEditMode == EDialogModeReadOnly || 
+        iEditMode == EDialogModeSettingEnforcement)
+    	{
+    	return;
+    	}
+
+   	iBuf = KNullDesC;  // reset common buffer
+   	
+	TInt count = iSettingList->Count();
+	
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* item = (*iSettingList)[i];
+		
+		switch (item->iItemId)
+			{
+			case EAspProfileName:
+			    iProfile->SetNameL(item->Value());
+			    break;
+
+			case EAspProtocolVersion:
+				iProfile->SetProtocolVersionL(item->iNumberData);
+			    break;
+
+			case EAspServerId:
+			    iProfile->SetServerIdL(item->Value());
+			    break;
+
+			case EAspConnType:
+				iProfile->SetBearerTypeL(item->iNumberData);
+			    break;
+
+			case EAspAccessPoint:
+				iProfile->SetAccessPointL(item->iNumberData);
+			    break;
+
+			case EAspHostAddress:
+				{
+				iBuf = item->Value();
+				TURIParser parser(iBuf);
+				TInt portNumber = parser.Port();
+	            if (!parser.IsValidPort(portNumber))
+		            {
+		            	if ( Item(EAspPort)->iNumberData > TURIParser::EMaxURIPortNumber || Item(EAspPort)->iNumberData < TURIParser::EMinURIPortNumber)
+  							    Item(EAspPort)->iNumberData = TURIParser::EDefaultHttpPort;	
+				 		portNumber = Item(EAspPort)->iNumberData;    	
+		            }
+
+				iProfile->SetHostAddressL(iBuf, portNumber);
+				break;
+				}
+
+			case EAspPort:
+				break;  // port is included in host address
+
+			case EAspUsername:
+				iProfile->SetUserNameL(item->Value());
+			    break;
+			
+			case EAspPassword:
+			    iProfile->SetPasswordL(item->Value());
+			    break;
+
+			case EAspServerAlert:
+				{
+				iProfile->SetSASyncStateL(item->iNumberData);
+			    break;
+				}
+
+			case EAspHttpsUsername:
+			    iProfile->SetHttpUserNameL(item->Value());
+			    break;
+
+			case EAspHttpsPassword:
+			    iProfile->SetHttpPasswordL(item->Value());
+			    break;
+			    
+			case EAspSyncDirection:
+				iContentList->ModifyTaskDirectionsL(item->iNumberData);
+				break;
+			    
+			}
+
+		}
+
+	iProfile->Save();
+	iContentList->UpdateLocalDatabaseL();
+#ifdef RD_DSUI_TIMEDSYNC
+	CheckAutoSyncSetttigsL();
+#endif
+	}
+	
+	
+//------------------------------------------------------------------------------
+// CAspProfileDialog::EditSettingItemL
+//
+// Calls setting editing functions. 
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::EditSettingItemL(CAspListItemData& aItem)
+	{
+	TInt ret = EFalse;
+
+#ifdef RD_DSUI_TIMEDSYNC 
+	CAspSchedule* schedule = CAspSchedule::NewLC();
+	if (schedule->IsAutoSyncEnabled())
+		{
+		TInt profileId = schedule->ProfileId();
+		if (profileId == iProfile->ProfileId())
+			{
+			TDialogUtil::ShowInformationQueryL(R_ASP_NOTE_MODIFY_AUTO_SYNC_SETTINGS);
+			}
+		}
+    CleanupStack::PopAndDestroy(schedule);
+#endif
+
+	switch (aItem.iItemType)
+		{
+		case CAspListItemData::ETypeInternetAccessPoint:
+		    ret = EditSettingItemAccessPointL(aItem);
+		    break;
+			
+		case CAspListItemData::ETypeText:
+			ret = EditSettingItemTextL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeSecret:
+			ret = EditSettingItemSecretL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeNumber:
+			ret = EditSettingItemNumberL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeList:
+			ret = EditSettingItemListL(aItem);
+		    break;
+		
+		case CAspListItemData::ETypeBearerList:
+			ret = EditSettingItemBearerListL(aItem);
+		    break;
+		    
+		case CAspListItemData::ETypeProtocolList:
+			ret = EditSettingItemProtocolListL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeListYesNo:
+			ret = EditSettingItemYesNoL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeHostAddress:
+			ret = EditSettingItemHostAddressL(aItem);
+			break;
+
+		case CAspListItemData::ETypeSyncContent:
+			ret = EditSettingItemSyncContentL(aItem);
+			break;
+
+		default:
+		    break;
+		}
+	
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::EditSettingItemYesNoL
+//
+// Change Yes/No value without showing radio button editor.
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::EditSettingItemYesNoL(CAspListItemData& aItem)
+	{
+	CDesCArray* arr = iResHandler->ReadDesArrayLC(aItem.iResource);
+	
+	if (aItem.iNumberData == EAspSettingDisabled)
+		{
+		aItem.iNumberData = EAspSettingEnabled;
+		}
+	else
+		{
+		aItem.iNumberData = EAspSettingDisabled;
+		}
+	
+	
+	// store localized setting text (Yes/No)
+	aItem.SetValueL( (*arr)[aItem.iNumberData] );
+
+	CleanupStack::PopAndDestroy(arr);
+	return ETrue;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::EditSettingItemNumberL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::EditSettingItemNumberL(CAspListItemData& aItem)
+	{
+	TBool ret = TDialogUtil::ShowIntegerEditorL(aItem.iNumberData, aItem.Header(), 
+	                         aItem.iMinValue, aItem.iMaxValue, aItem.iLatinInput);
+
+	if (ret)
+		{
+		aItem.SetValueL(aItem.iNumberData);
+		}
+
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::EditSettingItemSecretL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::EditSettingItemSecretL(CAspListItemData& aItem)
+	{
+	TBuf<KBufSize64> newPassword;
+	newPassword = aItem.Value();
+	
+	
+	CAspAlphaPasswordSettingPageEditor* pwd = new (ELeave) CAspAlphaPasswordSettingPageEditor(
+		                                R_ASP_SETTING_PASSWORD, newPassword, aItem.Value());
+	
+	CleanupStack::PushL(pwd);
+	pwd->SetSettingTextL(aItem.Header()); 
+	pwd->ConstructL();
+	pwd->AlphaPasswordEditor()->SetMaxLength(aItem.iMaxLength);
+	//pwd->AlphaPasswordEditor()->RevealSecretText(ETrue);  // pasi
+	CleanupStack::Pop(pwd);
+
+	if (pwd->ExecuteLD(CAknSettingPage::EUpdateWhenChanged))
+		{
+		aItem.SetValueL(newPassword);
+		return ETrue;
+		}
+	
+	return EFalse;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::EditSettingItemTextL
+//
+// Edit text setting item.
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::EditSettingItemTextL(CAspListItemData& aItem)
+	{
+	TUtil::StrCopy(iBuf, aItem.Value());
+	
+	TInt len = iBuf.Length();
+	if (len > aItem.iMaxLength)
+		{
+		iBuf.SetLength(aItem.iMaxLength);
+		}
+	
+    TBool ret = TDialogUtil::ShowTextEditorL(iBuf, aItem.Header(), 
+                             aItem.iMandatory, aItem.iLatinInput, aItem.iMaxLength);
+   	if (ret)
+		{
+		aItem.SetValueL(iBuf);
+		}
+		
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::EditSettingItemHostAddressL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::EditSettingItemHostAddressL(CAspListItemData& aItem)
+	{
+	_LIT(KHttpHeader, "http://");
+	
+	TBool httpHeaderUsed = EFalse;
+	TInt bearer = Item(EAspConnType)->iNumberData;
+	HBufC* hBuf = HBufC::NewLC(KBufSize255);
+	TPtr ptr = hBuf->Des();
+	TUtil::StrCopy(ptr, aItem.Value());
+	if (TUtil::IsEmpty(aItem.Value()) && bearer == EAspBearerInternet)
+		{
+		aItem.SetValueL(KHttpHeader);
+		httpHeaderUsed = ETrue;
+		}
+		
+	TBool ret = EFalse;
+	for(;;)
+	{
+	ret = EditSettingItemTextL(aItem);
+	
+	if (httpHeaderUsed && (aItem.Value().Compare(KHttpHeader) == 0))
+		{
+		aItem.SetValueL(KNullDesC);
+		}
+	
+	
+	if (ret)
+		{
+		if(bearer == EAspBearerInternet)
+		{
+			if (!TURIParser::IsValidUri(aItem.Value()))
+			{			
+			TDialogUtil::ShowInformationNoteL(R_ASP_LOG_ERR_URIINVALID);
+			}
+		else
+			{
+			TPtrC ptr = aItem.Value();
+			TURIParser parser(ptr);
+	        TInt portNumber = parser.Port();
+	        if (parser.IsValidPort(portNumber))
+		        {
+		        Item(EAspPort)->iNumberData = portNumber;
+		        Item(EAspPort)->SetValueL(portNumber);
+		        }
+		    break;    
+			}	
+		}
+		else if(bearer == EAspBearerBlueTooth)
+		{
+			if (!TURIParser::IsValidBluetoothHostAddress(aItem.Value()))
+		    {
+		    TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_INCORRECT_HOST_ADDRESS);
+		   
+		    }
+		    else
+		    {
+		    	break;
+		    }
+			}
+		}
+	else if(!ret) 
+		{
+		aItem.SetValueL(ptr);
+		break;	
+		}
+	else
+		{
+		 break;	
+		}
+	}
+	CleanupStack::PopAndDestroy(); //hBuf
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::EditSettingItemListL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::EditSettingItemListL(CAspListItemData& aItem)
+	{
+	TInt curSelection = aItem.iNumberData;
+	CDesCArray* arr = CAspResHandler::ReadDesArrayStaticLC(aItem.iResource);
+	
+	TBool ret = TDialogUtil::ShowListEditorL(arr, aItem.Header(), curSelection);
+	if (ret)
+		{
+		aItem.iNumberData = curSelection; 
+		aItem.SetValueL((*arr)[curSelection]);
+		}
+
+	CleanupStack::PopAndDestroy(arr);
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::EditSettingItemProtocolListL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::EditSettingItemProtocolListL(CAspListItemData& aItem)
+	{
+#ifdef __SYNCML_DS_EMAIL   // KFeatureIdSyncMlDsEmail
+	TInt oldSelection = aItem.iNumberData;
+#endif
+	
+	TInt curSelection = aItem.iNumberData;
+	CDesCArray* arr2 = iResHandler->ReadDesArrayLC(aItem.iResource);
+	CDesCArray* arr = TUtil::NumberConversionLC(arr2);
+	
+	
+	if (TDialogUtil::ShowListEditorL(arr, aItem.Header(), curSelection))
+		{
+		aItem.iNumberData = curSelection; 
+		aItem.SetValueL((*arr)[curSelection]);
+		
+	    
+#ifdef __SYNCML_DS_EMAIL   // KFeatureIdSyncMlDsEmail
+
+	    TBool emailSync = EFalse;
+	    TInt id = iProfile->ApplicationId();
+	    if (id == EApplicationIdSync || id == EApplicationIdEmail)
+	    	{
+	    	emailSync = ETrue;
+	    	}
+		
+
+#ifdef RD_DSUI_TIMEDSYNC
+		if (curSelection == EAspProtocol_1_1 )
+				{
+				CAspSchedule* schedule = CAspSchedule::NewLC();
+				TInt profileId = schedule->ProfileId();
+				if (profileId == iProfile->ProfileId())
+					{
+					TInt selectedContentCnt = 0;
+					TInt selectedContentIndex = 0;
+					TInt emailIndex = iContentList->FindProviderIndex(KUidNSmlAdapterEMail.iUid);
+					schedule->ContentSelectionInfo(selectedContentCnt, selectedContentIndex);
+					if (selectedContentCnt == 1 && selectedContentIndex == emailIndex)
+						{
+						schedule->SetProfileId(KErrNotFound);
+						schedule->SetContentEnabled(emailIndex, EFalse);
+						schedule->SetSyncPeakSchedule(CAspSchedule::EIntervalManual);
+						schedule->SetSyncOffPeakSchedule(CAspSchedule::EIntervalManual);
+						schedule->SetSyncFrequency(CAspSchedule::EIntervalManual);
+						schedule->UpdateSyncScheduleL();
+						schedule->SaveL();
+						}
+					}
+				CleanupStack::PopAndDestroy(schedule);
+				}
+#endif
+		
+#endif
+		
+		CleanupStack::PopAndDestroy(arr);
+		CleanupStack::PopAndDestroy(arr2);
+		return ETrue;
+		}
+
+	CleanupStack::PopAndDestroy(arr);
+	CleanupStack::PopAndDestroy(arr2);
+	return EFalse;
+	}
+//------------------------------------------------------------------------------
+// CAspProfileDialog::EditSettingItemAccessPointL
+//
+//------------------------------------------------------------------------------
+//	
+TBool CAspProfileDialog::EditSettingItemAccessPointL(CAspListItemData& aItem)
+{
+
+	TBool ret;
+	TInt selection = 0;
+	TInt curSelection = aItem.iNumberData;
+	CDesCArray* arr = CAspResHandler::ReadDesArrayStaticLC(aItem.iResource);
+	if(curSelection < 0)
+	{
+		curSelection = 0;
+	}
+	else
+	{
+		curSelection = 1;
+	}
+	ret = TDialogUtil::ShowListEditorL(arr, aItem.Header(), curSelection);
+	CleanupStack::PopAndDestroy(arr);
+	if(!ret)
+	{
+		return EFalse;
+	}
+	if (curSelection == 0 )
+		{
+		aItem.iNumberData = CAspAccessPointHandler::KDefaultConnection;
+		aItem.SetValueL(KNullDesC);
+		aItem.SetDisplayValueL(R_ASP_DEFAULT_CONNECTION);
+		selection = CAspAccessPointHandler::KDefaultConnection;
+		}	
+	if(selection == CAspAccessPointHandler::KDefaultConnection)
+	{
+	#ifdef RD_DSUI_TIMEDSYNC
+   	CAspSchedule* schedule = CAspSchedule::NewLC();
+	TInt profileId = schedule->ProfileId();
+	TInt enabled = schedule->IsAutoSyncEnabled();
+	CleanupStack::PopAndDestroy(schedule);
+	if(profileId == iProfile->ProfileId() && enabled)
+		{
+		TBool showQuery = ETrue;
+			RCmManager cmmgr;
+			cmmgr.OpenL();
+			TCmDefConnValue defConnValue;
+			cmmgr.ReadDefConnL(defConnValue);
+			cmmgr.Close();
+			if(defConnValue.iType == ECmDefConnDestination)
+			{
+				showQuery = EFalse;
+			}
+		if(showQuery)
+		{
+			HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_QUERY_IAP_NO_ASK_ALWAYS);
+    		if (!TDialogUtil::ShowConfirmationQueryL(hBuf->Des()))
+	 		{
+	  	  		CleanupStack::PopAndDestroy(hBuf);
+				return ETrue;// user selected "Always ask" option 
+    	}	
+			CleanupStack::PopAndDestroy(hBuf);
+		}
+		else
+		{
+			return ETrue;
+		}
+			
+		}
+		else
+		{
+			return ETrue;
+		}
+    	   	
+	#else
+		return ETrue;
+	#endif
+	}
+	TAspAccessPointItem item;
+	item.iUid2 = aItem.iNumberData;
+	
+	ret = iApHandler->ShowApSelectDialogL(item);
+	
+	if (ret == CAspAccessPointHandler::EAspDialogSelect)
+		{
+		aItem.iNumberData = item.iUid;
+		aItem.SetValueL(item.iName);
+		return ETrue;
+		}
+	else if (ret == CAspAccessPointHandler::EAspDialogExit)
+		{
+		ProcessCommandL(EAknCmdExit); // user has selected "Exit" from options menu
+		}
+	else
+		{
+		// user canceled ap selection
+		return EFalse;
+		}
+		
+	return EFalse;
+}
+
+//------------------------------------------------------------------------------
+// CAspProfileDialog::EditSettingItemBearerListL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileDialog::EditSettingItemBearerListL(CAspListItemData& aItem)
+	{
+	CDesCArray* arr = iBearerHandler->BuildBearerListLC();
+	if (arr->Count() == 0) 
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	TInt curSelection = iBearerHandler->ListIndexForBearer(aItem.iNumberData);
+	if (curSelection == KErrNotFound)
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	if (TDialogUtil::ShowListEditorL(arr, aItem.Header(), curSelection))
+		{
+		aItem.iNumberData = iBearerHandler->BearerForListIndex(curSelection);
+       	aItem.SetValueL((*arr)[curSelection]);
+		CleanupStack::PopAndDestroy(arr);
+		return ETrue;
+		}
+	
+	CleanupStack::PopAndDestroy(arr);
+	return EFalse;
+	}
+
+
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::EditSettingItemSyncContentL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfileDialog::EditSettingItemSyncContentL(CAspListItemData& aItem)
+	{
+ 	TAspParam param(iApplicationId, iSyncSession);
+    param.iProfile = iProfile;
+    param.iDataProviderId = aItem.iNumberData;
+    param.iSyncTaskId = KErrNotFound;
+    param.iContentList = iContentList;
+
+    CAspContentDialog::ShowDialogL(param);
+     
+    return ETrue;
+	}
+
+
+//-----------------------------------------------------------------------------
+// CAspProfileDialog::GetItemForIndex
+// 
+// Find item in list position aIndex.
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspProfileDialog::GetItemForIndex(TInt aIndex)
+	{
+	CAspListItemData* item = NULL;
+	
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iIndex == aIndex)
+			{
+			item = temp;
+			break;
+			}
+		}
+
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+
+//-----------------------------------------------------------------------------
+// CAspProfileDialog::Item
+// 
+// Find item with aItemId (TAspConnectionSettingItem).
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspProfileDialog::Item(TInt aItemId)
+	{
+	CAspListItemData* item = NULL;
+
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iItemId == aItemId)
+			{
+			item = temp;
+			break;
+			}
+		}
+	
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::ListBox
+// 
+// -----------------------------------------------------------------------------
+//
+CAknSettingStyleListBox* CAspProfileDialog::ListBox()
+	{
+	return iSettingListBox;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::UpdateCbaL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspProfileDialog::UpdateCbaL(TInt aResourceId)
+	{
+	CEikButtonGroupContainer& cba = ButtonGroupContainer();
+	cba.SetCommandSetL(aResourceId);
+	iCommandSetId = aResourceId;
+	iMSKEmpty = EFalse;
+	cba.DrawDeferred();
+	}
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::UpdateMenuL
+// 
+// -----------------------------------------------------------------------------
+//
+
+void CAspProfileDialog::UpdateMenuL(TInt aResource)
+	{
+	CEikMenuBar* menuBar = iMenuBar; // from CAknDialog
+	menuBar->SetMenuTitleResourceId(aResource);
+
+	TRAPD(err, menuBar->TryDisplayMenuBarL());
+    		
+	User::LeaveIfError(err);
+	}
+
+// -----------------------------------------------------------------------------
+// CAspProfileDialog::CheckAutoSyncSetttigsL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspProfileDialog::CheckAutoSyncSetttigsL()
+	{
+	CAspSchedule* schedule = CAspSchedule::NewLC();
+	TInt profileId = schedule->ProfileId();
+	if (profileId == iProfile->ProfileId())
+			{
+			if (iProfile->BearerType() != EAspBearerInternet)
+				{
+				schedule->SetProfileId(KErrNotFound);
+				schedule->SetSyncPeakSchedule(CAspSchedule::EIntervalManual);
+				schedule->SetSyncOffPeakSchedule(CAspSchedule::EIntervalManual);
+				schedule->SetSyncFrequency(CAspSchedule::EIntervalManual);
+				schedule->UpdateSyncScheduleL();
+				schedule->SaveL();
+				}
+			else
+				{
+				schedule->UpdateProfileSettingsL();
+				}
+			}
+	CleanupStack::PopAndDestroy(schedule);	
+	}
+	
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspProfileSelectionDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,608 @@
+/*
+* 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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "AspProfileSelectionDialog.h"
+#include "AspSchedule.h"
+#include "AspProfileWizard.h"
+#include "AspSyncUtil.rh"
+#include "AspDebug.h"
+#include <csxhelp/ds.hlp.hrh>
+
+#include <AspSyncUtil.mbg>  // for bitmap enumerations
+#include <Avkon.mbg>
+#include <akniconarray.h>   // for GulArray
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+TBool CAspProfileSelectionDialog::ShowDialogL(TAspParam& aParam)
+	{
+	CAspProfileSelectionDialog* dialog = CAspProfileSelectionDialog::NewL(aParam);
+
+	TBool ret = dialog->ExecuteLD(R_ASP_AUTO_SYNC_PROFILE_DIALOG);
+
+    return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::NewL
+//
+// -----------------------------------------------------------------------------
+CAspProfileSelectionDialog* CAspProfileSelectionDialog::NewL(TAspParam& aParam)
+    {
+    FLOG( _L("CAspProfileSelectionDialog::NewL START") );
+
+    CAspProfileSelectionDialog* self = new (ELeave) CAspProfileSelectionDialog(aParam);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    FLOG( _L("CAspProfileSelectionDialog::NewL END") );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::CAspProfileSelectionDialog
+// 
+// -----------------------------------------------------------------------------
+//
+CAspProfileSelectionDialog::CAspProfileSelectionDialog(TAspParam& aParam)
+	{
+    iSyncSession = aParam.iSyncSession;
+    iApplicationId = aParam.iApplicationId;
+    iProfileId = aParam.iProfileId;
+    iDialogParam = &aParam;
+           
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrGeneral));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::ConstructL()
+    {
+    FLOG( _L("CAspProfileSelectionDialog::ConstructL START") );
+	
+	CAknDialog::ConstructL(R_ASP_AUTO_SYNC_PROFILE_DIALOG_MENU);
+
+	TAspParam param(iApplicationId, iSyncSession);
+	CAspProfileList* list = CAspProfileList::NewLC(param);
+	list->ReadAllProfilesL(CAspProfileList::ENoMandatoryCheck);
+		
+    TAspFilterInfo info;
+    info.iFilterType = TAspFilterInfo::EIncludeRemoteProfile;
+    iProfileList = list->FilteredListL(info);
+    iProfileList->Sort();
+    CleanupStack::PopAndDestroy(list);
+	
+    param.iMode = CAspContentList::EInitDataProviders;
+	iContentList = CAspContentList::NewL(param);
+
+
+	// get previous title so it can be restored
+	iStatusPaneHandler = CStatusPaneHandler::NewL(iAvkonAppUi);
+	iStatusPaneHandler->StoreOriginalTitleL();
+	
+	iCommandSetId = R_ASP_CBA_OPTIONS_SELECT_BACK;
+	
+	FLOG( _L("CAspProfileSelectionDialog::ConstructL END") );
+    }
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CAspProfileSelectionDialog::~CAspProfileSelectionDialog()
+    {
+    FLOG( _L("CAspProfileSelectionDialog::~CAspProfileSelectionDialog START") );
+
+    delete iProfileList;
+    delete iContentList;
+	delete iStatusPaneHandler;
+	
+    if (iAvkonAppUi)
+    	{
+    	iAvkonAppUi->RemoveFromStack(this);
+    	}
+
+	FLOG( _L("CAspProfileSelectionDialog::~CAspProfileSelectionDialog END") );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspProfileSelectionDialog::ActivateL
+//
+// Called by system when dialog is activated.
+//------------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::ActivateL()
+	{
+    CAknDialog::ActivateL();
+
+	// this cannot be in ConstructL which is executed before dialog is launched
+	iAvkonAppUi->AddToStackL(this);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspContentListDialog::GetHelpContext
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::GetHelpContext(TCoeHelpContext& aContext) const
+	{
+	aContext.iMajor = KUidSmlSyncApp;
+	//aContext.iContext = KDS_HLP_SET_CONN_SETTINGS;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::HandleListBoxEventL
+// 
+// -----------------------------------------------------------------------------
+void CAspProfileSelectionDialog::HandleListBoxEventL(CEikListBox* /*aListBox*/,
+                                             TListBoxEvent /*aEventType*/)
+	{
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::PreLayoutDynInitL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::PreLayoutDynInitL()
+    {
+    iListBox = (CAknSingleGraphicStyleListBox*) (ControlOrNull(EAspAutoSyncProfileDialogList));
+    
+   	__ASSERT_ALWAYS(iListBox, TUtil::Panic(KErrGeneral));
+    
+	iListBox->SetListBoxObserver(this);
+	iListBox->CreateScrollBarFrameL(ETrue);
+	iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+	                 CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto);
+	
+	SetIconsL();
+	
+    
+    TInt index = iProfileList->ListIndex(iProfileId);
+    if (index == KErrNotFound)
+    	{
+    	// select first profile
+    	if (iProfileList->Count() > 0)
+    		{
+   	    	TAspProfileItem& item = iProfileList->Item(0);
+   	    	iProfileId = item.iProfileId;	
+    		}
+    	}
+
+    UpdateListBoxL();
+    
+
+	iStatusPaneHandler->SetTitleL(R_ASP_TITLE_AUTOMATIC_SYNC_PROFILE_SELECTION);
+	iStatusPaneHandler->SetNaviPaneTitleL(KNullDesC);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::SetIconsL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::SetIconsL()
+    {
+    if (!iListBox)
+    	{
+    	return;
+    	}
+ 
+ 	TFileName bitmapName;
+	CAspResHandler::GetBitmapFileName(bitmapName);
+	CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray(KDefaultArraySize);
+	CleanupStack::PushL(icons);
+		
+	
+	icons->AppendL(IconL(KAknsIIDQgnPropCheckboxOff, bitmapName,
+	                     EMbmAvkonQgn_prop_checkbox_off,
+	                     EMbmAvkonQgn_prop_checkbox_off_mask));
+
+	/*
+	icons->AppendL(IconL(KAknsIIDQgnIndiMarkedAdd, bitmapName, 
+	                     EMbmAvkonQgn_indi_marked_add,
+	                     EMbmAvkonQgn_indi_marked_add_mask));
+	*/
+
+	icons->AppendL(IconL(KAknsIIDQgnIndiSettProtectedAdd, bitmapName, 
+	                     EMbmAspsyncutilQgn_indi_sett_protected_add,
+	                     EMbmAspsyncutilQgn_indi_sett_protected_add_mask));
+	
+    // delete old icons
+    CArrayPtr<CGulIcon>* arr = iListBox->ItemDrawer()->ColumnData()->IconArray();
+    if (arr)
+    	{
+    	arr->ResetAndDestroy();
+	    delete arr;
+	    arr = NULL;
+    	}
+
+	iListBox->ItemDrawer()->ColumnData()->SetIconArray(icons);
+	CleanupStack::Pop(icons);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::IconL
+// 
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CAspProfileSelectionDialog::IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex)
+	{
+    return TDialogUtil::CreateIconL(aId, aFileName, aFileIndex, aFileMaskIndex);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileSelectionDialog::DynInitMenuPaneL
+//
+// Called by system before menu is shown.
+//------------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane)
+	{
+    if (aResourceID != R_ASP_AUTO_SYNC_PROFILE_DIALOG_MENU_PANE)
+		{
+		return;
+		}
+		
+	TInt index = iListBox->CurrentItemIndex();
+	if (index != KErrNotFound)
+		{
+	    TAspProfileItem& item = iProfileList->Item(index);
+	
+	    if (iProfileId == item.iProfileId)
+		    {
+		    TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdSelect);
+		    }
+		}
+	else
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdSelect);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdView);
+		}
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspProfileSelectionDialog::ProcessCommandL
+//
+// Handle commands from menu.
+//------------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::ProcessCommandL(TInt aCommandId)
+	{
+	HideMenu();
+
+	switch (aCommandId)
+		{
+		case EAspMenuCmdHelp:
+			{
+            break;
+			}
+
+		case EAspMenuCmdSelect:
+			{
+			HandleOKL();
+			break;
+			}
+
+		case EAspMenuCmdView:
+			{
+			ShowContentListL();			
+			break;
+			}
+
+        case EAspMenuCmdExit:
+        case EAknCmdExit:
+        case EEikCmdExit:
+			{
+			// close dialog and exit calling application
+			iAvkonAppUi->ProcessCommandL(EAknCmdExit);
+			break;
+			}
+
+		default:			
+		    break;
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileSelectionDialog::OkToExitL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileSelectionDialog::OkToExitL(TInt aButtonId)
+	{
+	(*iDialogParam).iReturnValue = EFalse;
+	(*iDialogParam).iProfileId = iProfileId;
+	
+	if (aButtonId == EEikBidCancel)
+		{
+		return ETrue;
+		}
+
+	if (aButtonId == EAknSoftkeyBack)
+        {
+       	(*iDialogParam).iReturnValue = ETrue;
+		return ETrue;
+		}
+
+	if (aButtonId == EAknSoftkeyOpen)  // MSK
+        {
+        HandleOKL();
+		return EFalse;  // leave dialog open
+		}
+
+	return CAknDialog::OkToExitL(aButtonId);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::OfferKeyEventL
+// 
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspProfileSelectionDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,
+                                                      TEventCode aType)
+	{
+	
+	// catch listbox item "gain focus" here
+	if (aType == EEventKeyUp)
+		{
+		UpdateCbaL();
+		return CAknDialog::OfferKeyEventL( aKeyEvent, aType);
+		}
+		
+	if (aType == EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+			case EKeyEnter:
+			case EKeyOK:
+				{
+     			HandleOKL();
+				return EKeyWasConsumed;
+				}
+
+			case EKeyEscape:  // framework calls this when dialog must shut down
+				{
+				return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+        		}
+
+            default:
+				{
+			    break;
+				}
+			}
+		}
+
+	return CAknDialog::OfferKeyEventL( aKeyEvent, aType);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::HandleResourceChange
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::HandleResourceChange(TInt aType)
+    {   
+    if (aType == KEikDynamicLayoutVariantSwitch) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        iListBox->SetSize(mainPaneRect.Size());
+        CCoeControl::HandleResourceChange(aType);
+		DrawDeferred();
+	    return;
+		}
+		
+    if (aType == KAknsMessageSkinChange)
+        {
+        TRAP_IGNORE(SetIconsL());
+        }
+		
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspProfileSelectionDialog::HandleOKL
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::HandleOKL()
+	{
+	if (iCommandSetId == R_ASP_CBA_OPTIONS_VIEW_CONTENT_BACK)
+		{
+		ShowContentListL();
+		return;
+		}
+		
+	TInt index = iListBox->CurrentItemIndex();
+	if (index != KErrNotFound)
+		{
+	    TAspProfileItem& item = iProfileList->Item(index);
+	
+	    if (item.iProfileId != iProfileId)
+		    {
+		    iProfileId = item.iProfileId; // uselect
+		    UpdateListBoxL();
+		    }
+		}
+	
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::UpdateListBoxL
+// 
+// Add settings headers into listbox.
+// ----------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::UpdateListBoxL()
+	{
+	_LIT(KFormat, "%d\t%S");
+		
+	CDesCArray* arr = (CDesCArray*) iListBox->Model()->ItemTextArray();
+	arr->Reset();
+
+	TInt count = iProfileList->Count();
+	for (TInt i=0; i<count; i++ )
+		{
+		TAspProfileItem& item = iProfileList->Item(i);
+
+		TBuf<KBufSize> buf;
+		
+		if (item.iProfileId == iProfileId)
+			{
+			buf.Format(KFormat, 1, &item.iProfileName);
+			}
+		else
+			{
+			buf.Format(KFormat, 0, &item.iProfileName);
+			}
+
+		arr->AppendL(buf);
+		}
+
+	iListBox->HandleItemAdditionL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::UpdateCbaL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::UpdateCbaL()
+    {
+   	TInt index = iListBox->CurrentItemIndex();
+   	if (index == KErrNotFound)
+   		{
+   		return;	
+   		}
+   		
+	TAspProfileItem& item = iProfileList->Item(index);
+	CEikButtonGroupContainer& cba = ButtonGroupContainer();
+	
+	if (item.iProfileId == iProfileId)
+		{
+		if (iCommandSetId != R_ASP_CBA_OPTIONS_VIEW_CONTENT_BACK)
+			{
+	        cba.SetCommandSetL(R_ASP_CBA_OPTIONS_VIEW_CONTENT_BACK);
+	        cba.DrawDeferred();
+	        iCommandSetId = R_ASP_CBA_OPTIONS_VIEW_CONTENT_BACK;
+			}
+		}
+    else 
+    	{
+    	if (iCommandSetId != R_ASP_CBA_OPTIONS_SELECT_BACK)
+    		{
+    	    cba.SetCommandSetL(R_ASP_CBA_OPTIONS_SELECT_BACK);
+    	    cba.DrawDeferred();
+    	    iCommandSetId = R_ASP_CBA_OPTIONS_SELECT_BACK;		
+    		}
+    	}
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileSelectionDialog::ShowContentListL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspProfileSelectionDialog::ShowContentListL()
+	{
+	TInt index = iListBox->CurrentItemIndex();
+	if (index == KErrNotFound)
+		{
+		return;	
+		}
+		
+	TAspProfileItem& item = iProfileList->Item(index);
+	
+    TAspParam param(iApplicationId, iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+    
+   	profile->OpenL(item.iProfileId, CAspProfile::EOpenRead,
+                                          CAspProfileList::EBasePropertiesOnly);
+    iContentList->SetProfile(profile);
+    TRAPD(err, iContentList->InitAllTasksL());
+    iContentList->SetProfile(NULL);
+    User::LeaveIfError(err);
+    CleanupStack::PopAndDestroy(profile);
+                                          
+
+	CDesCArray* arr = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
+	CleanupStack::PushL(arr);
+	
+    TInt count = iContentList->ProviderCount();
+    for (TInt i=0; i<count; i++)
+    	{
+    	TAspProviderItem& item = iContentList->ProviderItem(i);
+    	
+    	TInt index = iContentList->FindTaskIndexForProvider(item.iDataProviderId);
+    	if (index != KErrNotFound)
+    		{
+    		HBufC* hBuf = CAspResHandler::GetContentNameLC(item.iDataProviderId,
+		                                               item.iDisplayName);
+		    arr->AppendL(hBuf->Des());
+		    CleanupStack::PopAndDestroy(hBuf);
+    		}
+    	}
+
+	HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_TITLE_AUTOMATIC_SYNC_CONTENT_LIST);
+	
+	TDialogUtil::ShowPopupDialogL(hBuf->Des(), arr);
+	
+	CleanupStack::PopAndDestroy(hBuf);
+	CleanupStack::PopAndDestroy(arr);
+	}
+	
+	
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspProfileWizard.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,1310 @@
+/*
+* 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:  
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "AspProfileWizard.h"
+#include "AspUtil.h"
+#include "AspDebug.h"
+#include "AspSyncUtil.rh"
+
+
+#include <textresolver.h>
+#include <applayout.cdl.h>      // Multiline_Message_writing_texts_Line_3
+#include <aknlayoutscalable_apps.cdl.h>
+
+				 
+
+
+
+/*******************************************************************************
+ * class CAspWizardItem
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspWizardItem::NewL
+//
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CAspWizardItem* CAspWizardItem::NewL()
+    {
+    CAspWizardItem* self = new (ELeave) CAspWizardItem();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspWizardItem::~CAspWizardItem()
+    {
+    if (iValue)
+		{
+		delete iValue;
+		iValue = NULL ;
+		}
+    delete iContentName;
+    delete iHeader;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspWizardItem::CAspWizardItem
+//
+// -----------------------------------------------------------------------------
+//
+CAspWizardItem::CAspWizardItem()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspWizardItem::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspWizardItem::ConstructL()
+    {
+	InitL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspWizardItem::SetValueL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspWizardItem::SetValueL(const TDesC& aText)
+	{
+	if (iValue)
+		{
+		delete iValue;
+		iValue = NULL;
+		}
+	iValue = aText.AllocL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspWizardItem::Value
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC& CAspWizardItem::Value()
+	{
+	__ASSERT_ALWAYS(iValue, TUtil::Panic(KErrGeneral));
+		
+	return *iValue;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspWizardItem::SetContentNameL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspWizardItem::SetContentNameL(const TDesC& aText)
+	{
+	delete iContentName;
+	iContentName = NULL;
+	iContentName = aText.AllocL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspWizardItem::ContentName
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC& CAspWizardItem::ContentName()
+	{
+	__ASSERT_ALWAYS(iContentName, TUtil::Panic(KErrGeneral));
+		
+	return *iContentName;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspWizardItem::SetHeaderL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspWizardItem::SetHeaderL(const TDesC& aText)
+	{
+	delete iHeader;
+	iHeader = NULL;
+	iHeader = aText.AllocL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspWizardItem::SetHeaderL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspWizardItem::SetHeaderL(TInt aResourceId)
+	{
+	delete iHeader;
+	iHeader = NULL;
+	iHeader = CAspResHandler::ReadL(aResourceId);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspWizardItem::Header
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC& CAspWizardItem::Header()
+	{
+	__ASSERT_ALWAYS(iHeader, TUtil::Panic(KErrGeneral));
+		
+	return *iHeader;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspWizardItem::InitL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspWizardItem::InitL()
+	{
+	iSettingType = KErrNotFound;
+	iSettingId = KErrNotFound;
+	iResourceId = KErrNotFound;
+	iPopupNoteResourceId = KErrNotFound;
+	iErrorNoteResourceId = KErrNotFound;
+	iEnabled = ETrue;
+	iMaxLength = 0;
+	iMandatory = ETrue;
+	iLatinInput = ETrue;  // accept only western chars
+	iNumber = 0;
+	SetValueL(KNullDesC);
+	SetContentNameL(KNullDesC);
+	SetHeaderL(KNullDesC);
+    }
+
+
+	
+	
+
+/*******************************************************************************
+ * class CAspProfileWizard
+ *******************************************************************************/
+
+
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizard::NewL
+//
+// -----------------------------------------------------------------------------
+CAspProfileWizard* CAspProfileWizard::NewL(TAspParam& aParam)
+    {
+    CAspProfileWizard* self = new (ELeave) CAspProfileWizard(aParam);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return(self);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizard::CAspProfileWizard
+// 
+// -----------------------------------------------------------------------------
+//
+CAspProfileWizard::CAspProfileWizard(TAspParam& aParam)
+	{
+	iApplicationId = aParam.iApplicationId;
+	iSyncSession = aParam.iSyncSession;
+	
+	iDialogParam = &aParam;
+	iProfileId = KErrNotFound;
+	iCurrentItemIndex = 0;
+
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrArgument));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizard::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizard::ConstructL()
+    {
+    TAspParam param(iApplicationId, iSyncSession);
+	param.iMode = CAspContentList::EInitDataProviders;
+	iContentList = CAspContentList::NewL(param);
+
+   	// get email syncml mailboxes
+   	iLocalDataStores = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
+	iContentList->GetLocalDatabaseList(KUidNSmlAdapterEMail.iUid, iLocalDataStores);
+
+    CreateSettingListL();
+
+    SetContentEnabled(iApplicationId);
+
+   	if (iLocalDataStores->Count() == 0)
+   		{
+   		SetContentEnabled(KUidNSmlAdapterEMail.iUid, EFalse);
+   		}
+   	TBool emailEnabled = ContentEnabled(KUidNSmlAdapterEMail.iUid);
+	SetContentLocalDatabaseEnabled(KUidNSmlAdapterEMail.iUid, emailEnabled);
+	
+	if (iApplicationId == EApplicationIdEmail)
+		{
+		SetEnabled(CAspWizardItem::ETypeProtocolVersion, EFalse);
+		}
+    } 
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CAspProfileWizard::~CAspProfileWizard()
+    {
+    delete iLocalDataStores;
+    
+    iSettingList.ResetAndDestroy();
+    iSettingList.Close();
+    
+    delete iContentList;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizard::CreateSettingListL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizard::CreateSettingListL()
+    {
+    TInt localDbCount = iLocalDataStores->Count();
+    
+	CAspWizardItem* item = CAspWizardItem::NewL();
+	item->iSettingType = CAspWizardItem::ETypeStart;
+	item->iResourceId = R_ASP_SET_WIZARD_START;
+	item->SetHeaderL(item->iResourceId);
+	item->iEnabled = ETrue; // start must always be enabled
+	iSettingList.Append(item);
+
+	item = CAspWizardItem::NewL();
+	item->iSettingType = CAspWizardItem::ETypeProfileName;
+	item->iResourceId = R_ASP_SET_DESTINATION_NAME;
+	item->iPopupNoteResourceId = R_ASP_WIZARD_POPUP_PROFILE_NAME;
+	item->iErrorNoteResourceId = R_ASP_NOTE_PROFILE_NAME_MISSING;
+	item->SetHeaderL(item->iResourceId);
+	item->iMaxLength = KAspMaxProfileNameLength;
+	item->iLatinInput = EFalse; // accept also non-western chars
+	iSettingList.Append(item);
+
+	item = CAspWizardItem::NewL();
+	item->iSettingType = CAspWizardItem::ETypeProtocolVersion;
+	item->iResourceId = R_ASP_SET_PROTOCOL_VERSION;
+	item->iPopupNoteResourceId = R_ASP_WIZARD_POPUP_PROTOCOL_VERSION;
+	item->SetHeaderL(item->iResourceId);
+	iSettingList.Append(item);
+
+	item = CAspWizardItem::NewL();
+	item->iSettingType = CAspWizardItem::ETypeContentSelection;
+	item->iResourceId = R_ASP_SET_CONTENT_SELECTION;
+	item->iPopupNoteResourceId = R_ASP_WIZARD_POPUP_CONTENT_SELECTION;
+	item->SetHeaderL(item->iResourceId);
+    iSettingList.Append(item);
+
+    TInt count = iContentList->ProviderCount();
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProviderItem& p = iContentList->ProviderItem(i);
+	
+	    //if (p.iDataProviderId == KUidNSmlAdapterEMail.iUid && localDbCount == 0)
+	    //	{
+	    //	continue; // leave email out - no email SyncML mailboxes found
+	    //	}
+	    
+	    item = CAspWizardItem::NewL();
+	    item->iSettingType = CAspWizardItem::ETypeSyncContent;
+	    item->iSettingId = p.iDataProviderId;
+	    item->iResourceId = 
+	          CAspResHandler::RemoteDatabaseHeaderId(p.iDataProviderId);
+	    item->iPopupNoteResourceId = 
+	          ContentPopupNoteResourceId(p.iDataProviderId);
+	    
+	    if (p.iDataProviderId == KUidNSmlAdapterContact.iUid)
+            {
+            item->iErrorNoteResourceId = R_ASP_NOTE_CONTACTS_DB_MISSING;
+            }
+        else if (p.iDataProviderId == KUidNSmlAdapterCalendar.iUid)
+            {
+            item->iErrorNoteResourceId = R_ASP_NOTE_CALENDAR_DB_MISSING;
+            }
+        else if (p.iDataProviderId == KUidNSmlAdapterSms.iUid)
+            {
+            item->iErrorNoteResourceId = R_ASP_NOTE_SMS_DATABASE_MISSING;
+            }
+        else if (p.iDataProviderId == KUidNSmlAdapterMMS.iUid)
+            {
+            item->iErrorNoteResourceId = R_ASP_NOTE_MMS_DATABASE_MISSING;
+            }
+        else if (p.iDataProviderId == KUidNSmlAdapterNote.iUid)
+            {
+            item->iErrorNoteResourceId = R_ASP_NOTE_NOTES_DB_MISSING;
+            }
+        else if (p.iDataProviderId == KUidNSmlAdapterBookmarks.iUid)
+            {
+            item->iErrorNoteResourceId = R_ASP_NOTE_BKM_DATABASE_MISSING;
+            }
+        else
+            {
+            item->iErrorNoteResourceId = R_ASP_NOTE_REMOTE_DATABASE_MISSING;
+            }
+	    item->SetHeaderL(item->iResourceId);
+	    item->iMaxLength = KAspMaxRemoteNameLength;
+	    
+	    HBufC* hBuf = CAspResHandler::GetContentNameLC(p.iDataProviderId, p.iDisplayName);
+	    item->SetContentNameL(hBuf->Des());
+        CleanupStack::PopAndDestroy(hBuf);
+	    
+        iSettingList.Append(item);
+        
+        if (p.iDataProviderId == KUidNSmlAdapterEMail.iUid && localDbCount > 1)
+        	{
+	        item = CAspWizardItem::NewL();
+	        item->iSettingType = CAspWizardItem::ETypeSyncContentLocalDatabase;
+	        item->iSettingId = p.iDataProviderId;
+	        item->iResourceId = R_ASP_LOCAL_DATABASE_EML;
+	        item->iPopupNoteResourceId = R_ASP_WIZARD_POPUP_EMAIL_LOCAL_DB;
+	        item->SetHeaderL(item->iResourceId);
+    
+            iSettingList.Append(item);
+        	}
+		}
+
+	item = CAspWizardItem::NewL();
+	item->iSettingType = CAspWizardItem::ETypeBearerType;
+	item->iResourceId = R_ASP_SET_BEARER_TYPE;
+	item->iPopupNoteResourceId = R_ASP_WIZARD_POPUP_CONNECTION_TYPE;
+	item->SetHeaderL(item->iResourceId);
+    iSettingList.Append(item);
+
+	item = CAspWizardItem::NewL();
+	item->iSettingType = CAspWizardItem::ETypeHostAddress;
+	item->iResourceId = R_ASP_SET_HOST_ADDRESS;
+	item->iPopupNoteResourceId = R_ASP_WIZARD_POPUP_HOST_ADDRESS;
+	item->iErrorNoteResourceId = R_ASP_NOTE_HOST_ADDRESS_MISSING;
+	item->SetHeaderL(item->iResourceId);
+	item->iMaxLength = KAspMaxURILength;
+    iSettingList.Append(item);
+
+	item = CAspWizardItem::NewL();
+	item->iSettingType = CAspWizardItem::ETypeServerId;
+	item->iResourceId = R_ASP_SET_SERVER_ID;
+	item->iPopupNoteResourceId = R_ASP_WIZARD_POPUP_SERVER_ID;
+	item->iErrorNoteResourceId = KErrNotFound;
+	item->SetHeaderL(item->iResourceId);
+	item->iMaxLength = KAspMaxServerIdLength;
+    iSettingList.Append(item);
+
+	item = CAspWizardItem::NewL();
+	item->iSettingType = CAspWizardItem::ETypeUserName;
+	item->iResourceId = R_ASP_SET_USERNAME;
+	item->iPopupNoteResourceId = R_ASP_WIZARD_POPUP_USERNAME;
+	item->iErrorNoteResourceId = R_ASP_NOTE_USERNAME_MISSING;
+	item->SetHeaderL(item->iResourceId);
+	item->iMaxLength = KAspMaxUsernameLength;
+    iSettingList.Append(item);
+
+	item = CAspWizardItem::NewL();
+	item->iSettingType = CAspWizardItem::ETypePassword;
+	item->iResourceId = R_ASP_SET_PASSWORD;
+	item->iPopupNoteResourceId = R_ASP_WIZARD_POPUP_PASSWORD;
+	item->iErrorNoteResourceId = R_ASP_NOTE_PASSWORD_MISSING;
+	item->SetHeaderL(item->iResourceId);
+	item->iMaxLength = KAspMaxPasswordLength;
+    iSettingList.Append(item);
+    
+	item = CAspWizardItem::NewL();
+	item->iSettingType = CAspWizardItem::ETypeEnd;
+	item->iResourceId = R_ASP_SET_WIZARD_END;
+	item->SetHeaderL(item->iResourceId);
+	item->iEnabled = ETrue; // end must always be enabled
+	iSettingList.Append(item);
+    } 
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizard::ContentPopupNoteResourceId
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfileWizard::ContentPopupNoteResourceId(TInt aDataProviderId)
+	{
+	TInt ret = R_ASP_WIZARD_POPUP_REMOTE_DB;
+	
+	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
+		{
+		ret = R_ASP_WIZARD_POPUP_CONTACTS_DB;
+		}
+	if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
+		{
+		ret = R_ASP_WIZARD_POPUP_CALENDAR_DB;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
+		{
+		ret = R_ASP_WIZARD_POPUP_EMAIL_DB;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
+		{
+    	ret = R_ASP_WIZARD_POPUP_NOTES_DB;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
+		{
+    	ret = R_ASP_WIZARD_POPUP_SMS_DB;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
+		{
+    	ret = R_ASP_WIZARD_POPUP_MMS_DB;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
+		{
+    	ret = R_ASP_WIZARD_POPUP_BKM_DB;
+		}
+    
+
+    return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::GetContentSelectionL
+// 
+// Construct CSelectionItemList from setting list.
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::GetContentSelectionL(CSelectionItemList* aList)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContent)
+			{
+	        TBuf<KBufSize> buf(item->ContentName());
+	        CSelectableItem* selectableItem = new (ELeave) CSelectableItem(
+	                                          buf, item->iEnabled);
+   	        CleanupStack::PushL(selectableItem);
+	        selectableItem->ConstructL();
+	        aList->AppendL(selectableItem);
+	        CleanupStack::Pop(selectableItem);
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::SetContentSelectionL
+// 
+// Update setting list from CSelectionItemList.
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::SetContentSelectionL(CSelectionItemList* aList)
+	{
+	TInt count = aList->Count();
+	
+	for (TInt i=0; i<count; i++)
+		{
+		CSelectableItem* selectableItem = (*aList)[i];
+		TBool selected = selectableItem->SelectionStatus();
+		SetContentEnabled(selectableItem->ItemText(), selected);
+		}
+		
+	TBool emailEnabled = ContentEnabled(KUidNSmlAdapterEMail.iUid);
+	SetContentLocalDatabaseEnabled(KUidNSmlAdapterEMail.iUid, emailEnabled);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::SetContentEnabled
+// 
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::SetContentEnabled(const TDesC& aText, TBool aEnabled)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContent)
+			{
+	        TPtrC ptr = item->ContentName();
+	        if (ptr.Compare(aText) == 0)
+	        	{
+	        	item->iEnabled = aEnabled;
+	        	break;
+	        	}
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::ContentId
+// 
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizard::ContentId(const TDesC& aText)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContent)
+			{
+	        TPtrC ptr = item->ContentName();
+	        if (ptr.Compare(aText) == 0)
+	        	{
+	        	return item->iSettingId;
+	        	}
+			}
+		}
+		
+	return KErrNotFound;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::SetContentEnabled
+// 
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::SetContentEnabled(TInt aApplicationId)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType != CAspWizardItem::ETypeSyncContent)
+			{
+			continue;
+			}
+		
+		if (aApplicationId == EApplicationIdSync)
+			{
+			item->iEnabled = ETrue; // sync app enables all contents
+			}
+		else
+			{
+			TInt appId = TUtil::AppIdFromProviderId(item->iSettingId);
+		    if (appId == aApplicationId)
+			    {
+			    item->iEnabled = ETrue;
+			    }
+		    else
+			    {
+			    item->iEnabled = EFalse;
+			    }
+			}
+		}
+		
+	if (aApplicationId != EApplicationIdSync)
+		{
+		// only sync app shows content selection page
+		SetEnabled(CAspWizardItem::ETypeContentSelection, EFalse);
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::SetContentLocalDatabaseEnabled
+// 
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::SetContentLocalDatabaseEnabled(TInt aDataproviderId, TBool aEnabled)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContentLocalDatabase)
+			{
+			if (item->iSettingId == aDataproviderId)
+			    {
+			    item->iEnabled = aEnabled;
+			    }
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::SetContentEnabled
+// 
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::SetContentEnabled(TInt aDataproviderId, TBool aEnabled)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContent)
+			{
+			if (item->iSettingId == aDataproviderId)
+			    {
+			    item->iEnabled = aEnabled;
+			    }
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::ContentEnabled
+// 
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileWizard::ContentEnabled(TInt aDataproviderId)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContent)
+			{
+			if (item->iSettingId == aDataproviderId)
+			    {
+			    return item->iEnabled;
+			    }
+			}
+		}
+		
+	return EFalse;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::SetContentEnabled
+// 
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::SetContentEnabled(RArray<TInt>& aDataProviderArray)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContent)
+			{
+			item->iEnabled = EFalse;
+			if (aDataProviderArray.Find(item->iSettingId) != KErrNotFound)
+				{
+				item->iEnabled = ETrue;
+				}
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::GetContentEnabled
+// 
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::GetContentEnabled(RArray<TInt>& aDataProviderArray)
+	{
+	aDataProviderArray.Reset();
+	
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContent)
+			{
+			if (item->iEnabled)
+				{
+				aDataProviderArray.Append(item->iSettingId);
+				}
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::GetContentName
+// 
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::GetContentName(TDes& aText)
+	{
+	aText = KNullDesC;
+	
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContent)
+			{
+			if (item->iEnabled)
+				{
+				aText = item->ContentName();
+				}
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::SetEnabled
+// 
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::SetEnabled(TInt aSettingType, TBool aEnabled)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == aSettingType)
+			{
+        	item->iEnabled = aEnabled;
+        	break;
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::DeleteProfile
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::DeleteProfile()
+	{
+	FLOG( _L("CAspProfileWizard::DeleteProfile START") );
+	
+	if (iProfileId != KErrNotFound)
+		{
+		TRAPD(err, iSyncSession->DeleteProfileL(iProfileId));
+		iProfileId = KErrNotFound;
+		
+		if (err != KErrNone)
+			{
+			FLOG( _L("### RSyncMLSession::DeleteProfileL failed (%d) ###"), err );
+			}
+		}
+		
+	FLOG( _L("CAspProfileWizard::DeleteProfile END") );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::CreateProfileL
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::CreateProfileL()
+	{
+	FLOG( _L("CAspProfileWizard::CreateProfileL START") );
+	
+	TAspParam param(iApplicationId, iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+	
+	iProfileId = KErrNotFound;
+	profile->CreateL(CAspProfile::EAllProperties);
+	iProfileId = profile->ProfileId();
+	
+	CAspProfile::SetDefaultValuesL(profile);
+	
+	GetStringValue(iBuf, CAspWizardItem::ETypeProfileName);
+	profile->SetNameL(iBuf);
+    
+	TInt protocol = NumberValue(CAspWizardItem::ETypeProtocolVersion);
+	profile->SetProtocolVersionL(protocol);
+
+	TInt bearerType = NumberValue(CAspWizardItem::ETypeBearerType);
+	profile->SetBearerTypeL(bearerType);
+	
+	GetStringValue(iBuf, CAspWizardItem::ETypeHostAddress);
+	TURIParser parser(iBuf);
+	TInt portNumber = parser.Port();
+	if (!parser.IsValidPort(portNumber))
+		{
+		portNumber = parser.DefaultPort();
+		}
+    profile->SetHostAddressL(iBuf, portNumber);
+    
+    GetStringValue(iBuf, CAspWizardItem::ETypeServerId);
+    profile->SetServerIdL(iBuf);
+	
+	GetStringValue(iBuf, CAspWizardItem::ETypeUserName);
+	profile->SetUserNameL(iBuf);
+	
+	GetStringValue(iBuf, CAspWizardItem::ETypePassword);
+	profile->SetPasswordL(iBuf);
+	
+	profile->SaveL();
+	iContentList->SetProfile(profile);
+	
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContent)
+			{
+			if (item->iEnabled)
+				{
+				TBuf<KBufSize> localDb;
+				GetStringValue(iBuf, CAspWizardItem::ETypeSyncContent,
+				               item->iSettingId);
+				
+				GetStringValue(localDb, CAspWizardItem::ETypeSyncContentLocalDatabase,
+				               item->iSettingId);
+				               
+				iContentList->CreateTask(item->iSettingId,
+				              localDb, iBuf, ETrue, ESyncDirectionTwoWay);
+				}
+			}
+		}
+	
+	iContentList->SetProfile(NULL);
+	CleanupStack::PopAndDestroy(profile);
+	
+	FLOG( _L("CAspProfileWizard::CreateProfileL END") );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::SetStringValueL
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::SetStringValueL(const TDesC& aValue,
+                                        TInt aSettingType, TInt aSettingId)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == aSettingType && item->iSettingId == aSettingId)
+			{
+			item->SetValueL(aValue);
+			break;
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::SetStringValueL
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::SetStringValueL(const TDesC& aValue, TInt aSettingType)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == aSettingType)
+			{
+			item->SetValueL(aValue);
+			break;
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::GetStringValue
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::GetStringValue(TDes& aValue, TInt aSettingType)
+	{
+	aValue = KNullDesC;
+	
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == aSettingType)
+			{
+			TUtil::StrCopy(aValue, item->Value());
+			break;
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::GetStringValue
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::GetStringValue(TDes& aValue, TInt aSettingType, TInt aSettingId)
+	{
+	aValue = KNullDesC;
+	
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == aSettingType && item->iSettingId == aSettingId)
+			{
+			TUtil::StrCopy(aValue, item->Value());
+			break;
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::GetNumberValue
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::GetNumberValue(TInt& aValue, TInt aSettingType)
+	{
+	aValue = KErrNotFound;
+	
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == aSettingType)
+			{
+			aValue = item->iNumber;
+			break;
+			}
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::NumberValue
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizard::NumberValue(TInt aSettingType)
+	{
+	TInt num = KErrNotFound;
+	GetNumberValue(num, aSettingType);
+	return num;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::SetNumberValue
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::SetNumberValue(TInt& aValue, TInt aSettingType)
+	{
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == aSettingType)
+			{
+			item->iNumber = aValue;
+			break;
+			}
+		}
+	}
+	
+	
+//------------------------------------------------------------------------------
+// CAspProfileWizard::NumOfEnabledContentItems
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizard::NumOfEnabledContentItems()
+	{
+	TInt total = 0;
+
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContent)
+			{
+			if (item->iEnabled)
+				{
+				total++;
+				}
+			}
+		}
+		
+	return total;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::NumOfContentItems
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizard::NumOfContentItems()
+	{
+	TInt total = 0;
+
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iSettingType == CAspWizardItem::ETypeSyncContent)
+			{
+			total++;
+			}
+		}
+		
+	return total;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::NumOfEnabledItems
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizard::NumOfEnabledItems()
+	{
+	TInt total = 0;
+
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		if (item->iEnabled)
+			{
+			total++;
+			}
+		}
+		
+	return total;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::NumOfCurrentItem
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizard::NumOfCurrentItem(CAspWizardItem* aItem)
+	{
+	// find position of aItem in the list of all enabled items
+	TInt current = 0;
+
+	TInt count = iSettingList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspWizardItem* item = iSettingList[i];
+		
+		if (!item->iEnabled)
+			{
+			continue;
+			}
+		
+		current++;
+				
+		if (item->iSettingType == aItem->iSettingType)
+			{
+			if (item->iSettingType != CAspWizardItem::ETypeSyncContent)
+				{
+				break;
+				}
+				
+		    if (item->iSettingId == aItem->iSettingId)
+		    	{
+		    	break;
+		    	}
+			}
+		}
+		
+	return current;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::CurrentItem
+//
+//------------------------------------------------------------------------------
+//
+CAspWizardItem* CAspProfileWizard::CurrentItem()
+	{
+	TInt count = iSettingList.Count();
+	
+	__ASSERT_ALWAYS(iCurrentItemIndex >= 0, TUtil::Panic(KErrGeneral));
+	__ASSERT_ALWAYS(iCurrentItemIndex < count, TUtil::Panic(KErrGeneral));
+	
+	return iSettingList[iCurrentItemIndex];
+	}
+	
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::CurrentItemType
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizard::CurrentItemType()
+	{
+	CAspWizardItem* item = CurrentItem();
+	
+	return  item->iSettingType;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::CreatedProfileId
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizard::CreatedProfileId()
+	{
+	return iProfileId;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::MoveToNext
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::MoveToNext()
+	{
+	iCurrentItemIndex = IncreaseCurrentIndex(iCurrentItemIndex);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::MoveToPrevious
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::MoveToPrevious()
+	{
+	iCurrentItemIndex = DecreaseCurrentIndex(iCurrentItemIndex);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizard::MoveToStart
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizard::MoveToStart()
+	{
+	iCurrentItemIndex = 0;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizard::IncreaseCurrentIndex
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfileWizard::IncreaseCurrentIndex(const TInt aIndex)
+	{
+	TInt maxIndex = iSettingList.Count() - 1;
+	TInt index = aIndex;
+	
+	for (;;)
+		{
+		__ASSERT_DEBUG(index < maxIndex, TUtil::Panic(KErrGeneral));
+
+		if (!(index < maxIndex))
+			{
+			return maxIndex;
+			}
+				
+		index++;
+				
+	    CAspWizardItem* item = iSettingList[index];
+	    if (item->iEnabled)
+	    	{
+	    	break;
+	    	}
+		}
+		
+	return index;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizard::DecreaseCurrentIndex
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfileWizard::DecreaseCurrentIndex(const TInt aIndex)
+	{
+	TInt index = aIndex;
+	
+	for (;;)
+		{
+		__ASSERT_DEBUG(index > 0, TUtil::Panic(KErrGeneral));
+		
+		if (!(index > 0))
+			{
+			return 0;
+			}
+			
+		index--;
+		
+	    CAspWizardItem* item = iSettingList[index];
+	    if (item->iEnabled)
+	    	{
+	    	break;
+	    	}
+		}
+		
+	return index;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizard::LocalDatabaseList
+//
+// -----------------------------------------------------------------------------
+//
+CDesCArray* CAspProfileWizard::LocalDatabaseList(const TInt aDataproviderId)
+	{
+	__ASSERT_DEBUG(aDataproviderId == KUidNSmlAdapterEMail.iUid, 
+	               TUtil::Panic(KErrGeneral));
+	
+	return iLocalDataStores;
+	}
+	
+
+
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspProfileWizardDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,1810 @@
+/*
+* 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:  
+*
+*/
+
+
+// INCLUDE FILES
+#include <txtfrmat.h>
+#include <txtfmlyr.h>
+#include <gdi.h>
+// BackGround Context
+#include <AknsBasicBackgroundControlContext.h>
+
+#include "AspProfileWizardDialog.h"
+#include "AspUtil.h"
+#include "AspDialogUtil.h"
+#include "AspDebug.h"
+#include "AspSyncUtil.rh"
+
+#include <textresolver.h>
+#include <eikrted.h>  // CEikRichTextEditor
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+/*******************************************************************************
+ * class CAspTextSettingPage
+ *******************************************************************************/
+
+
+//------------------------------------------------------------------------------
+// CAspTextSettingPage::CAspTextSettingPage
+// 
+//------------------------------------------------------------------------------
+//
+CAspTextSettingPage::CAspTextSettingPage(TInt aResourceID, TDes& aText,
+                     TInt aTextSettingPageFlags, TAspSettingPageParam& aParam)
+ : CAknTextSettingPage(aResourceID, aText, aTextSettingPageFlags), iParam(aParam)
+	{
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspTextSettingPage::~CAspTextSettingPage()
+	{
+	delete iNaviPaneHandler;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspTextSettingPage::OKToExitL
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspTextSettingPage::OkToExitL(TInt aButtonId)
+	{
+	 // command id set in ProcessCommandL
+	if (iParam.iCommandId == EAknSoftkeyOk || iParam.iCommandId == EEikBidSelect)
+		{
+		if (iParam.iObserver)
+			{
+			CEikEdwin* edwin = TextControl();
+			HBufC* hBuf = NULL;
+			TInt len = edwin->TextLength();
+			if (len == 0)
+				{
+				hBuf = HBufC::NewL(0);
+				}
+			else
+				{
+				hBuf = edwin->GetTextInHBufL();
+				}
+				
+			TBool ret = iParam.iObserver->CheckValidity(hBuf->Des(),
+			                                            iParam.iSettingType);
+			
+			delete hBuf;
+			return ret;
+			}
+		}
+
+	return  CAknTextSettingPage::OkToExitL(aButtonId);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspTextSettingPage::ProcessCommandL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspTextSettingPage::ProcessCommandL(TInt aCommandId)
+	{
+    iParam.iCommandId = aCommandId; // return command id to caller
+    
+    CAknTextSettingPage::ProcessCommandL(aCommandId);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CIMSSettingsWizardEditTextPage::PostDisplayCheckL
+//
+// ----------------------------------------------------------------------------
+//
+TBool CAspTextSettingPage::PostDisplayCheckL()
+    {
+    // Set the text to navipane
+    UpdateNaviPaneL();
+
+    return ETrue;
+    }
+    
+// ----------------------------------------------------------------------------
+// CIMSSettingsWizardEditTextPage::UpdateIndicatorL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspTextSettingPage::UpdateNaviPaneL()
+    {
+    
+    if (!iNaviPaneHandler)
+           {
+           iNaviPaneHandler = new (ELeave) CAspNaviPaneHandler(
+                                  iEikonEnv->AppUiFactory()->StatusPane());
+           }
+           
+       iNaviPaneHandler->SetNaviPaneTitleL(iParam.iPageText);
+    }
+    
+
+// ----------------------------------------------------------------------------
+// CAspTextSettingPage::OfferKeyEventL
+//
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspTextSettingPage::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
+                                                 TEventCode aType)
+    {
+    if(EKeyEnter == aKeyEvent.iCode)
+    {
+    	ProcessCommandL(EAknSoftkeyOk);
+    	return EKeyWasConsumed;
+    }
+    if (aType == EEventKeyDown && iParam.iObserver)
+        {
+       	iParam.iObserver->HandleEditorEvent(
+       	                  MAspEditorPageObserver::EKeyEvent, 0);
+        }
+        
+    return CAknTextSettingPage::OfferKeyEventL(aKeyEvent, aType);
+    }
+
+
+
+/*******************************************************************************
+ * class CAspRadioButtonSettingPage
+ *******************************************************************************/
+
+
+//------------------------------------------------------------------------------
+// CAspRadioButtonSettingPage::CAspRadioButtonSettingPage
+// 
+//------------------------------------------------------------------------------
+//
+CAspRadioButtonSettingPage::CAspRadioButtonSettingPage(TInt aResourceID,
+                            TInt& aCurrentSelectionIndex,
+                            const MDesCArray* aItemArray,
+                            TAspSettingPageParam& aParam)
+                            
+ : CAknRadioButtonSettingPage(aResourceID, aCurrentSelectionIndex, aItemArray),
+   iParam(aParam)
+	{
+	iItemArray = aItemArray;
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspRadioButtonSettingPage::~CAspRadioButtonSettingPage()
+	{
+	delete iNaviPaneHandler;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspRadioButtonSettingPage::ProcessCommandL
+//------------------------------------------------------------------------------
+//
+void CAspRadioButtonSettingPage::ProcessCommandL(TInt aCommandId)
+	{
+    if (aCommandId == EAknSoftkeyOk || aCommandId == EEikBidSelect)
+    	{
+    	TInt index = ListBoxControl()->CurrentItemIndex();
+    	TBuf<KBufSize> buf;
+    	buf.Num(index);
+    	TBool ret = iParam.iObserver->CheckValidity(buf, iParam.iSettingType);
+    	}
+    
+    iParam.iCommandId = aCommandId; // return command id to caller
+    
+    CAknRadioButtonSettingPage::ProcessCommandL(aCommandId);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspRadioButtonSettingPage::PostDisplayCheckL
+// ----------------------------------------------------------------------------
+//
+TBool CAspRadioButtonSettingPage::PostDisplayCheckL()
+    {
+    UpdateNaviPaneL();
+
+    return ETrue;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspRadioButtonSettingPage::UpdateNaviPaneL
+// ----------------------------------------------------------------------------
+//
+void CAspRadioButtonSettingPage::UpdateNaviPaneL()
+    {
+    if (!iNaviPaneHandler)
+    	{
+    	iNaviPaneHandler = new (ELeave) CAspNaviPaneHandler(
+    	                       iEikonEnv->AppUiFactory()->StatusPane());
+    	}
+    	
+    iNaviPaneHandler->SetNaviPaneTitleL(iParam.iPageText);
+    }
+
+//----------------------------------------------------------------------------
+//CAspRadioButtonSettingPage::HandleListBoxEventL
+//----------------------------------------------------------------------------
+//
+
+
+void CAspRadioButtonSettingPage::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
+{
+
+    TInt oldSelect = ListBoxControl()->CurrentItemIndex();
+    CAknRadioButtonSettingPage::HandleListBoxEventL( aListBox, aEventType );
+    if ( oldSelect != ListBoxControl()->CurrentItemIndex() )
+
+    {
+
+       TBuf<KBufSize> buf;
+       buf.Num(oldSelect);
+       TBool ret = iParam.iObserver->CheckValidity(buf, iParam.iSettingType);
+    }
+}
+
+// ----------------------------------------------------------------------------
+// CAspRadioButtonSettingPage::OfferKeyEventL
+//
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspRadioButtonSettingPage::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
+                                                 TEventCode aType)
+    {
+        if(EKeyEnter == aKeyEvent.iCode)
+    {
+    	ProcessCommandL(EAknSoftkeyOk);
+    	return EKeyWasConsumed;
+    }
+    if (aType == EEventKeyDown && iParam.iObserver)
+        {
+       	iParam.iObserver->HandleEditorEvent(
+                              MAspEditorPageObserver::EKeyEvent, 0);    
+        }
+        
+    return CAknRadioButtonSettingPage::OfferKeyEventL(aKeyEvent, aType);
+    }
+
+
+
+/*******************************************************************************
+ * class CAspAlphaPasswordSettingPage
+ *******************************************************************************/
+
+
+//------------------------------------------------------------------------------
+// CAspAlphaPasswordSettingPage::CAspAlphaPasswordSettingPage
+// 
+//------------------------------------------------------------------------------
+//
+CAspAlphaPasswordSettingPage::CAspAlphaPasswordSettingPage(TInt aResourceID,
+                              TDes& aNewPassword, const TDesC& aOldPassword,
+                              TAspSettingPageParam& aParam)
+                              
+ : CAknAlphaPasswordSettingPage(aResourceID, aNewPassword, aOldPassword),
+   iParam(aParam)
+	{
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspAlphaPasswordSettingPage::~CAspAlphaPasswordSettingPage()
+	{
+	delete iNaviPaneHandler;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspAlphaPasswordSettingPage::ProcessCommandL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspAlphaPasswordSettingPage::ProcessCommandL(TInt aCommandId)
+	{
+    iParam.iCommandId = aCommandId; // return command id to caller
+    
+    CAknAlphaPasswordSettingPage::ProcessCommandL(aCommandId);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspAlphaPasswordSettingPage::PostDisplayCheckL
+
+// ----------------------------------------------------------------------------
+//
+TBool CAspAlphaPasswordSettingPage::PostDisplayCheckL()
+    {
+    UpdateNaviPaneL();
+
+    return ETrue;
+    }
+
+// ----------------------------------------------------------------------------
+// CAspAlphaPasswordSettingPage::UpdateNaviPaneL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspAlphaPasswordSettingPage::UpdateNaviPaneL()
+    {
+    
+    if (!iNaviPaneHandler)
+               {
+               iNaviPaneHandler = new (ELeave) CAspNaviPaneHandler(
+                                      iEikonEnv->AppUiFactory()->StatusPane());
+               }
+               
+           iNaviPaneHandler->SetNaviPaneTitleL(iParam.iPageText);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspAlphaPasswordSettingPage::OfferKeyEventL
+//
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspAlphaPasswordSettingPage::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
+                                                 TEventCode aType)
+    {
+    if (aType == EEventKeyDown && iParam.iObserver)
+        {
+       	iParam.iObserver->HandleEditorEvent(
+                                MAspEditorPageObserver::EKeyEvent, 0);    
+        }
+        
+    return CAknAlphaPasswordSettingPage::OfferKeyEventL(aKeyEvent, aType);
+    }
+
+
+/*******************************************************************************
+ * class CAspCheckBoxSettingPage
+ *******************************************************************************/
+
+
+//------------------------------------------------------------------------------
+// CAspCheckBoxSettingPage::CAspCheckBoxSettingPage
+// 
+//------------------------------------------------------------------------------
+//
+CAspCheckBoxSettingPage::CAspCheckBoxSettingPage(TInt aResourceID,
+                   CSelectionItemList* aItemArray, TAspSettingPageParam& aParam)
+                   
+ : CAknCheckBoxSettingPage(aResourceID, aItemArray), iParam(aParam)
+	{
+    iSelectionItemList = aItemArray;
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAspCheckBoxSettingPage::~CAspCheckBoxSettingPage()
+	{
+	delete iNaviPaneHandler;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspCheckBoxSettingPage::ProcessCommandL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspCheckBoxSettingPage::ProcessCommandL(TInt aCommandId)
+	{
+    if (aCommandId == EAknSoftkeyMark)
+    	{
+        CAknSetStyleListBox* listbox = ListBoxControl();
+        TInt index = listbox->CurrentItemIndex();
+       	CSelectableItem* selectableItem = (*iSelectionItemList)[index];
+       	TBuf<KBufSize> buf;
+       	buf = selectableItem->ItemText();
+       	
+       	TBool ret = iParam.iObserver->CheckValidity(buf, iParam.iSettingType);
+			
+       	if (ret)
+       	
+       		{
+            CAknCheckBoxSettingPage::ProcessCommandL(aCommandId);
+            return;
+       		}
+       	else
+       		{
+       		return;	
+       		}
+    	}
+    
+    	
+    iParam.iCommandId = aCommandId; // return command id to caller
+
+    CAknCheckBoxSettingPage::ProcessCommandL(aCommandId);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspCheckBoxSettingPage::PostDisplayCheckL
+//
+// ----------------------------------------------------------------------------
+//
+TBool CAspCheckBoxSettingPage::PostDisplayCheckL()
+    {
+    UpdateNaviPaneL();
+    
+    iSelectionCount = ListBoxControl()->SelectionIndexes()->Count();
+
+    return ETrue;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspCheckBoxSettingPage::UpdateNaviPaneL
+// ----------------------------------------------------------------------------
+//
+void CAspCheckBoxSettingPage::UpdateNaviPaneL()
+    {
+    if (!iNaviPaneHandler)
+    	{
+    	iNaviPaneHandler = new (ELeave) CAspNaviPaneHandler(
+    	                       iEikonEnv->AppUiFactory()->StatusPane());
+    	}
+    	
+    iNaviPaneHandler->SetNaviPaneTitleL(iParam.iPageText);
+    }
+
+// ----------------------------------------------------------------------------
+// CAspCheckBoxSettingPage::OfferKeyEventL
+//
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspCheckBoxSettingPage::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
+                                                 TEventCode aType)
+    {
+    if(EKeyEnter == aKeyEvent.iCode)
+    {
+    	ProcessCommandL(EAknSoftkeyMark);
+    	return EKeyWasConsumed;
+    }
+   
+    if (aType == EEventKeyDown && iParam.iObserver)
+        {
+       	iParam.iObserver->HandleEditorEvent(
+                              MAspEditorPageObserver::EKeyEvent, 0);    
+        }
+
+    if (aType == EEventKeyUp && iParam.iObserver)
+        {
+	    TInt count = ListBoxControl()->SelectionIndexes()->Count();
+       	if (count != iSelectionCount)
+       		{
+       		iParam.iObserver->GetNavipaneText(iParam.iPageText, count);
+       	    UpdateNaviPaneL();
+       	    iSelectionCount = count;
+       		}
+        }
+        
+    return CAknCheckBoxSettingPage::OfferKeyEventL(aKeyEvent, aType);
+    }
+// ----------------------------------------------------------------------------
+// CAspCheckBoxSettingPage::HandleListBoxEventL
+//
+// ----------------------------------------------------------------------------
+//
+
+				 
+void CAspCheckBoxSettingPage::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
+{
+	TInt index;
+	CSelectableItem* selectableItem;
+	if( AknLayoutUtils::PenEnabled() )  
+	{
+	  	switch(aEventType)
+	
+		{   
+		  case EEventItemSingleClicked:
+       		 	 index=aListBox->CurrentItemIndex();
+       		 	 selectableItem = (*iSelectionItemList)[index];
+       		 	 if(selectableItem->SelectionStatus())
+       		 	 {
+       		   		this->ProcessCommandL(EAknSoftkeyUnmark);	
+       		 	 }
+       		     else
+       		     {
+       			    this->ProcessCommandL(EAknSoftkeyMark);
+       		     }
+		        break;
+	 	default:
+			    break;
+		}	
+	}
+
+}
+
+/*******************************************************************************
+ * class CAspProfileWizardDialog
+ *******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspProfileWizardDialog::ShowDialogL(TAspParam& aParam)
+	{
+    CAspProfileWizardDialog* dialog = CAspProfileWizardDialog::NewL(aParam);
+
+	TBool ret = dialog->ExecuteLD(R_ASP_PROFILE_WIZARD_DIALOG);
+
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspProfileWizardDialog* CAspProfileWizardDialog::NewL(TAspParam& aParam)
+    {
+    FLOG( _L("CAspProfileWizardDialog::NewL START") );
+
+    CAspProfileWizardDialog* self = new (ELeave) CAspProfileWizardDialog(aParam);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    FLOG( _L("CAspProfileWizardDialog::NewL END") );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::CAspProfileWizardDialog
+// 
+// -----------------------------------------------------------------------------
+//
+CAspProfileWizardDialog::CAspProfileWizardDialog(TAspParam& aParam) 
+    {
+    iSyncSession = aParam.iSyncSession;
+	iApplicationId = aParam.iApplicationId;
+	iDialogParam = &aParam;
+	
+	iBgContext = NULL;
+	iMoveBack = EFalse ;
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrGeneral));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::ConstructL()
+    {
+    FLOG( _L("CAspProfileWizardDialog::ConstructL START") );
+
+    if (iApplicationId == KErrNotFound)
+    	{
+    	User::Leave(KErrNotFound); // unknown caller app
+    	}
+	
+    TAspParam param2(KErrNotFound, iSyncSession);
+	iBearerHandler = CAspBearerHandler::NewL(param2);
+
+	iStatusPaneHandler = CStatusPaneHandler::NewL(iAvkonAppUi);
+	iStatusPaneHandler->StoreOriginalTitleL();
+	
+	CAspResHandler::ReadL(iNaviPaneTextFormat, R_ASP_WIZARD_PAGE_COUNTER);
+	
+	iActiveCaller = CAspActiveCaller::NewL(this);
+
+	TAspParam param(iApplicationId, iSyncSession);
+	iWizard = CAspProfileWizard::NewL(param);
+	SetDefaultValuesL();
+	
+	param.iApplicationId = EApplicationIdSync;
+	iProfileList = CAspProfileList::NewL	(param);
+	iProfileList->ReadAllProfilesL(CAspProfileList::ENoMandatoryCheck);
+	
+	iPopupNote = CAknInfoPopupNoteController::NewL();
+	
+    if (iApplicationId == EApplicationIdEmail)
+    	{
+   	    CDesCArray* arr = iWizard->LocalDatabaseList(KUidNSmlAdapterEMail.iUid);
+	    if (!arr)
+		    {
+		    TDialogUtil::ShowErrorNoteL(R_ASP_NO_MAILBOXES);
+		    User::Leave(KErrNotFound); // no syncml mailbox
+		    }
+		
+	    if (arr->Count() == 0) 
+		    {
+		    TDialogUtil::ShowErrorNoteL(R_ASP_NO_MAILBOXES);
+		    User::Leave(KErrNotFound); // no syncml mailbox
+		    }
+    	}
+
+	FLOG( _L("CAspProfileWizardDialog::ConstructL END") );
+    } 
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspProfileWizardDialog::~CAspProfileWizardDialog()
+    {
+    FLOG( _L("CAspProfileWizardDialog::~CAspProfileWizardDialog START") );
+
+    if (iAvkonAppUi)
+    	{
+    	iAvkonAppUi->RemoveFromStack(this);
+    	}
+
+	delete iWizard;
+	if(iTextEditorText)
+		{
+		delete iTextEditorText;
+		}
+    delete iBearerHandler;
+	delete iStatusPaneHandler;
+	delete iActiveCaller;
+	delete iProfileList;
+	
+	if (iPopupNote)
+		{
+    	iPopupNote->HideInfoPopupNote();
+	    delete iPopupNote;
+		}
+	
+	if (iBgContext)
+		{
+		delete iBgContext ;
+		iBgContext = NULL ;
+		}
+
+	
+	FLOG( _L("CAspProfileWizardDialog::~CAspProfileWizardDialog END") );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::ActivateL (from CCoeControl)
+//
+// Called by system when dialog is activated.
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::ActivateL()
+	{
+    FLOG( _L("CAspProfileWizardDialog::ActivateL START") );
+    
+    CAknDialog::ActivateL();
+
+	// this cannot be in ConstructL which is executed before dialog is launched
+	iAvkonAppUi->AddToStackL(this);
+	
+    FLOG( _L("CAspProfileWizardDialog::ActivateL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::OKToExitL
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspProfileWizardDialog::OkToExitL(TInt aButtonId)
+	{
+    FLOG( _L("CAspProfileWizardDialog::OkToExitL START") );
+	
+	iDialogParam->iReturnValue = KErrNotFound;
+	iDialogParam->iProfileId = KErrNotFound;
+
+	if (aButtonId == EEikBidOk)
+		{
+		if (iWizard->CurrentItemType() == CAspWizardItem::ETypeStart)
+			{
+			if (iTextEditorText)
+   				{
+   			 	delete iTextEditorText;
+				iTextEditorText = NULL;
+				}
+    		TRect mainPane;
+			AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow, mainPane );
+   	 		iTextEditor->SetRect(mainPane);
+    		iTextEditor->SetTextL(iTextEditorText);
+    		UpdateCbaL(R_ASP_CBA_NEXT_BACK_NEXT);
+		
+			iWizard->MoveToNext();
+			
+			// start wizard when this completes (in HandleActiveCallL)
+			iActiveCaller->Request();
+			 
+			FLOG( _L("CAspProfileWizardDialog::OkToExitL END") );
+			return EFalse;
+			}
+		else if (iWizard->CurrentItemType() == CAspWizardItem::ETypeEnd)
+			{
+			iDialogParam->iReturnValue = KErrNone;
+			iDialogParam->iProfileId = iWizard->CreatedProfileId();
+	        
+	        FLOG( _L("CAspProfileWizardDialog::OkToExitL END") );
+			return ETrue;
+			}
+		//Case of quick succession clicks on touch screen profile creation wizard
+		else
+			{
+			   return EFalse;	
+			}
+		}
+	//Case of quick succession backs on touch screen profile creation wizard
+	else if(aButtonId == EAknSoftkeyDone)
+	{
+		return EFalse;
+	}
+		
+		
+	
+	FLOG( _L("CAspProfileWizardDialog::OkToExitL END") );
+	return CAknDialog::OkToExitL(aButtonId);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::ProcessCommandL
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::ProcessCommandL(TInt /*aCommandId*/)
+	{
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileWizardDialog::OfferKeyEventL
+// 
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspProfileWizardDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+	{
+	if (aType == EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+			case EKeyEnter:
+			{
+			     TryExitL(EEikBidOk);
+			     return EKeyWasConsumed;
+			}
+			case EKeyOK:
+				{
+				break;
+				}
+
+			case EKeyEscape:  // framework calls this when dialog must shut down
+				{
+				return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+        		}
+
+            default:
+				{
+				//return iTextEditor->OfferKeyEventL(aKeyEvent, aType);
+			    break;
+				}
+			}
+		}
+
+	return CAknDialog::OfferKeyEventL( aKeyEvent, aType);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::PreLayoutDynInitL
+//
+// Called by framework before dialog is shown.
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::PreLayoutDynInitL()
+    {
+    FLOG( _L("CAspProfileWizardDialog::PreLayoutDynInitL START") );
+   
+    iTextEditor = (CEikRichTextEditor*) ControlOrNull (EAspProfileWizardDialogList);
+    
+    User::LeaveIfNull(iTextEditor);
+   
+    SetTextEditorTextL(R_ASP_SET_WIZARD_START);
+    
+	TRect mainPane;
+    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPane);        
+    iTextEditor->SetRect(mainPane);
+	
+	SetBackgroundContextL ();
+	
+    iStatusPaneHandler->SetNaviPaneTitleL(KNullDesC);
+    iStatusPaneHandler->SetTitleL(R_ASP_SETTING_DIALOG_TITLE);
+    
+    FLOG( _L("CAspProfileWizardDialog::PreLayoutDynInitL END") );
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProfileWizardDialog::HandleResourceChange
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::HandleResourceChange(TInt aType)
+    {   
+    if (aType == KEikDynamicLayoutVariantSwitch) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        iTextEditor->SetSize(mainPaneRect.Size());
+        SetBackgroundContextL();
+        CCoeControl::HandleResourceChange(aType);
+		DrawDeferred();
+	    return;
+		}
+	if (aType == KAknsMessageSkinChange)
+		{
+		// When skin changes, we need to update text color
+		TRAP_IGNORE(UpdateTextColorL());
+		}
+		
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::HandleActiveCallL (from MAspActiveCallerObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::HandleActiveCallL(TInt /*aCallId*/)
+	{
+    FLOG( _L("CAspProfileWizardDialog::HandleActiveCallL START") );
+	
+	TInt err = RunWizard();
+	
+	if (err != KErrNone)
+		{
+		iWizard->DeleteProfile();
+		
+		ShowErrorNoteL(err);
+
+        TryExitL(EEikBidCancel); // close profile wizard dialog
+		}
+
+    FLOG( _L("CAspProfileWizardDialog::HandleActiveCallL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::RunWizard
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspProfileWizardDialog::RunWizard()
+	{
+    FLOG( _L("CAspProfileWizardDialog::RunWizard START") );
+    
+    TRAPD(err, RunWizardL());
+	
+	HidePopupNote();
+	
+	if (err != KErrNone)
+		{
+		iWizard->MoveToStart();
+		FLOG( _L("### RunWizardL failed (%d) ###"), err );
+		}
+		
+    FLOG( _L("CAspProfileWizardDialog::RunWizard END") );
+	return err;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::RunWizardL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::RunWizardL()
+	{
+	for (;;)
+		{
+		CAspWizardItem* item = iWizard->CurrentItem();
+	
+	    if (item->iSettingType == CAspWizardItem::ETypeEnd)
+		    {
+		    iMoveBack = ETrue ;
+		    iWizard->CreateProfileL();
+		    
+		    if (iApplicationId == EApplicationIdSync)
+		    	{
+		    	SetTextEditorTextL(R_ASP_SET_WIZARD_END);
+		        UpdateCbaL(R_ASP_CBA_ACTIVATE_LATER_ACTIVATE);
+		    	}
+		    else if (iApplicationId == EApplicationIdEmail)
+		    	{
+		    	SetTextEditorTextL(R_ASP_SET_WIZARD_END_EMAIL);
+		    	UpdateCbaL(R_AVKON_SOFTKEYS_OK_EMPTY);
+		    	}
+		    else
+		    	{
+		    	SetTextEditorTextL(R_ASP_SET_WIZARD_END_APP);
+		    	UpdateCbaL(R_AVKON_SOFTKEYS_OK_EMPTY);
+		    	}
+
+		    TBuf<KBufSize> buf;
+		    GetNaviPaneText(buf, item);
+		    iStatusPaneHandler->SetNaviPaneTitleL(buf);
+		    
+		    return; // return to wizard dialog view
+		    }
+		
+	    if (item->iSettingType == CAspWizardItem::ETypeStart)
+		    {
+		    iMoveBack = ETrue ;
+		    SetTextEditorTextL(R_ASP_SET_WIZARD_START);
+		    UpdateCbaL(R_ASP_CBA_START_CANCEL_START);
+		    return; // return to wizard dialog view
+		    }
+
+	    TInt ret = EditSettingItemL(item); // show setting editor
+	
+	    if (ret == EAknSoftkeyOk || ret == EEikBidSelect)
+		    {
+		    iMoveBack = EFalse ;
+		    iWizard->MoveToNext();
+        	}
+	    else if (ret == EAknSoftkeyDone)
+		    {
+		    iMoveBack = ETrue ;
+		    iWizard->MoveToPrevious();
+			}
+	    else
+	        {
+	        iMoveBack = EFalse ;
+	        iWizard->MoveToStart();
+		    return; // probably system cancel - wizard must close
+		    }
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::EditSettingItemL
+//
+// Calls setting editing functions. 
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizardDialog::EditSettingItemL(CAspWizardItem* aItem)
+	{
+	TInt ret = EAknSoftkeyOk;
+	
+	ShowPopupNoteL(aItem->iPopupNoteResourceId, KMsToWaitBeforePopup);
+	
+	switch (aItem->iSettingType)
+		{
+		case CAspWizardItem::ETypeStart:
+		    break;
+			
+		case CAspWizardItem::ETypeProfileName:
+			ret = EditSettingItemProfileNameL(aItem);
+		    break;
+
+		case CAspWizardItem::ETypeProtocolVersion:
+			ret = EditSettingItemProtocolVersionL(aItem);
+		    break;
+
+		case CAspWizardItem::ETypeHostAddress:
+			ret = EditSettingItemHostAddressL(aItem);
+		    break;
+
+		case CAspWizardItem::ETypeServerId:
+			ret = EditSettingItemTextL(aItem);
+		    break;
+
+		case CAspWizardItem::ETypeBearerType:
+			ret = EditSettingItemBearerTypeL(aItem);
+		    break;
+
+		case CAspWizardItem::ETypeUserName:
+			ret = EditSettingItemTextL(aItem);
+		    break;
+		
+		case CAspWizardItem::ETypePassword:
+			ret = EditSettingItemSecretL(aItem);
+		    break;
+		    
+		case CAspWizardItem::ETypeContentSelection:
+			ret = EditSettingItemContentSelectionL(aItem);
+		    break;
+
+		case CAspWizardItem::ETypeSyncContent:
+	    	ret = EditSettingItemTextL(aItem);
+		    break;
+
+		case CAspWizardItem::ETypeSyncContentLocalDatabase:
+	    	ret = EditSettingItemLocalDatabaseL(aItem);
+		    break;
+
+		case CAspWizardItem::ETypeEnd:
+			break;
+
+		default:
+		    break;
+		}
+
+	HidePopupNote();
+	
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::EditSettingItemTextL
+//
+// Edit text setting item.
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizardDialog::EditSettingItemTextL(CAspWizardItem* aItem)
+	{
+	TUtil::StrCopy(iBuf, aItem->Value());
+	
+	TInt flags(CAknTextSettingPage::EZeroLengthAllowed);
+
+    TAspSettingPageParam param;
+    param.iCommandId = EAknSoftkeyOk;
+    GetNaviPaneText(param.iPageText, aItem);
+    param.iObserver = this;
+    param.iSettingType = aItem->iSettingType;
+    
+	CAspTextSettingPage* dlg = new (ELeave) CAspTextSettingPage(
+	                     R_ASP_SETTING_TEXT_NEXT_BACK, iBuf, flags, param);
+	CleanupStack::PushL(dlg);
+
+	dlg->SetSettingTextL(aItem->Header()); 
+	dlg->ConstructL();
+	dlg->TextControl()->SetTextLimit(aItem->iMaxLength);
+
+	if (aItem->iLatinInput)
+		{		
+		dlg->TextControl()->SetAvkonWrap(ETrue);
+		dlg->TextControl()->SetAknEditorCase(EAknEditorLowerCase);
+		dlg->TextControl()->SetAknEditorFlags(EAknEditorFlagNoT9 |
+		                                EAknEditorFlagLatinInputModesOnly);
+		}
+	
+	CleanupStack::Pop(dlg);
+
+    //
+	// CAknTextSettingPage::ExecuteLD returns boolean. 
+	// See CAknSettingPage::ProcessCommandL what softkey values map to
+	// ETrue and EFalse.
+	// Profile wizard editors return EAknSoftkeyDone for "Back" and 
+	// EAknSoftkeyOk for "Next". Editors need "positive" ids for saving
+	// setting values.
+	//
+	TInt ret = dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
+   
+
+    aItem->SetValueL(iBuf);
+    
+    return param.iCommandId;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::EditSettingItemProtocolVersionL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileWizardDialog::EditSettingItemProtocolVersionL(CAspWizardItem* aItem)
+	{
+	TInt curSelection = aItem->iNumber;
+	CDesCArray* arr2 = CAspResHandler::ReadDesArrayStaticLC(R_ASP_PROTOCOL_VERSION);
+	CDesCArray* arr = TUtil::NumberConversionLC(arr2);
+	
+    TAspSettingPageParam param;
+    param.iCommandId = EAknSoftkeyOk;
+    GetNaviPaneText(param.iPageText, aItem);
+    param.iObserver = this;
+    param.iSettingType = aItem->iSettingType;
+	
+	CAspRadioButtonSettingPage* dlg = new (ELeave) CAspRadioButtonSettingPage(
+	                                  R_ASP_SETTING_RADIO_NEXT_BACK, 
+	                                  curSelection, arr, param);
+	CleanupStack::PushL(dlg);
+	dlg->SetSettingTextL(aItem->Header()); 
+	CleanupStack::Pop(dlg);
+
+	dlg->ExecuteLD();
+	
+	aItem->iNumber = curSelection;
+   	aItem->SetValueL((*arr)[curSelection]);
+   	
+   	if (curSelection == EAspProtocol_1_1)
+   		{
+   		iWizard->SetContentEnabled(KUidNSmlAdapterEMail.iUid, EFalse);
+        iWizard->SetEnabled(CAspWizardItem::ETypeServerId, EFalse);
+   		}
+   	else
+   		{
+   		iWizard->SetEnabled(CAspWizardItem::ETypeServerId, ETrue);
+   		}
+
+	CleanupStack::PopAndDestroy(arr);
+	CleanupStack::PopAndDestroy(arr2);
+   	return param.iCommandId;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::EditSettingItemBearerTypeL
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizardDialog::EditSettingItemBearerTypeL(CAspWizardItem* aItem)
+	{
+	CDesCArray* arr = iBearerHandler->BuildBearerListLC();
+	if (arr->Count() == 0) 
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	TInt curSelection = iBearerHandler->ListIndexForBearer(aItem->iNumber);
+	if (curSelection == KErrNotFound)
+		{
+		User::Leave(KErrNotFound);
+		}
+
+
+    TAspSettingPageParam param;
+    param.iCommandId = EAknSoftkeyOk;
+    GetNaviPaneText(param.iPageText, aItem);
+    param.iObserver = this;
+    param.iSettingType = aItem->iSettingType;
+	
+	CAspRadioButtonSettingPage* dlg = new (ELeave) CAspRadioButtonSettingPage(
+	                                  R_ASP_SETTING_RADIO_NEXT_BACK, 
+	                                  curSelection, arr, param);
+	CleanupStack::PushL(dlg);
+	dlg->SetSettingTextL(aItem->Header()); 
+	CleanupStack::Pop(dlg);
+
+	dlg->ExecuteLD();
+		
+	aItem->iNumber = iBearerHandler->BearerForListIndex(curSelection);
+   	aItem->SetValueL((*arr)[curSelection]);
+	
+	CleanupStack::PopAndDestroy(arr);
+		
+   	return param.iCommandId;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::EditSettingItemLocalDatabaseL
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizardDialog::EditSettingItemLocalDatabaseL(CAspWizardItem* aItem)
+	{
+	CDesCArray* arr = iWizard->LocalDatabaseList(aItem->iSettingId);
+	if (!arr)
+		{
+		User::Leave(KErrNotFound);
+		}
+		
+	if (arr->Count() == 0) 
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	TInt curSelection = aItem->iNumber;
+	if (curSelection < 0)
+		{
+		curSelection = 0;
+		}
+
+
+    TAspSettingPageParam param;
+    param.iCommandId = EAknSoftkeyOk;
+    GetNaviPaneText(param.iPageText, aItem);
+    param.iObserver = this;
+    param.iSettingType = aItem->iSettingType;
+	
+	CAspRadioButtonSettingPage* dlg = new (ELeave) CAspRadioButtonSettingPage(
+	                                  R_ASP_SETTING_RADIO_NEXT_BACK, 
+	                                  curSelection, arr, param);
+	CleanupStack::PushL(dlg);
+	dlg->SetSettingTextL(aItem->Header()); 
+	CleanupStack::Pop(dlg);
+
+	dlg->ExecuteLD();
+		
+	aItem->iNumber = curSelection;
+   	aItem->SetValueL((*arr)[curSelection]);
+	
+   	return param.iCommandId;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::EditSettingItemSecretL
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizardDialog::EditSettingItemSecretL(CAspWizardItem* aItem)
+	{
+	TBuf<KBufSize64> newPassword;
+	TUtil::StrCopy(newPassword, aItem->Value());
+	
+	
+    TAspSettingPageParam param;
+    param.iCommandId = EAknSoftkeyOk;
+    GetNaviPaneText(param.iPageText, aItem);
+    param.iObserver = this;
+    param.iSettingType = aItem->iSettingType;
+
+	CAspAlphaPasswordSettingPage* pwd = new (ELeave) CAspAlphaPasswordSettingPage(
+		     R_ASP_SETTING_PASSWORD_NEXT_BACK, newPassword, aItem->Value(), param);
+
+	CleanupStack::PushL(pwd);
+	pwd->SetSettingTextL(aItem->Header()); 
+	pwd->ConstructL();
+	pwd->AlphaPasswordEditor()->SetMaxLength(aItem->iMaxLength);
+	//pwd->AlphaPasswordEditor()->RevealSecretText(ETrue);
+	CleanupStack::Pop(pwd);
+
+	TInt ret = pwd->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
+		
+	aItem->SetValueL(newPassword);
+   	
+   	return param.iCommandId;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::EditSettingItemProfileNameL
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizardDialog::EditSettingItemProfileNameL(CAspWizardItem* aItem)
+	{
+	TInt commandId = EditSettingItemTextL(aItem);
+      	
+    return commandId;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::EditSettingItemHostAddressL
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizardDialog::EditSettingItemHostAddressL(CAspWizardItem* aItem)
+	{
+	_LIT(KIPAddressRegX,"http://*");
+	TInt bearer = iWizard->NumberValue(CAspWizardItem::ETypeBearerType);
+	TPtrC ptr = aItem->Value();
+	TPtrC httpHeader(KIPAddressRegX); 
+	
+	if (bearer == EAspBearerInternet)
+		{
+		   //If existing ptr is NOT an IP address
+		   if(ptr.MatchC(httpHeader) == KErrNotFound)
+		   {
+				aItem->SetValueL(KHttpHeader);   	
+		   }
+		}
+	else
+		{
+		    //If existing ptr is IP address
+		    if(ptr.MatchC(httpHeader) != KErrNotFound)
+		    {
+		    	aItem->SetValueL(KNullDesC); 		
+		    }
+		}
+	
+	TInt commandId;
+	while (ETrue)
+		{
+		commandId = EditSettingItemTextL(aItem);
+		if (commandId == EAknSoftkeyOk && bearer == EAspBearerInternet)
+			{
+			if (!TURIParser::IsValidUri(aItem->Value()))
+				{			
+				TDialogUtil::ShowInformationNoteL(R_ASP_LOG_ERR_URIINVALID);
+				}
+			else
+				{
+				break;	
+				}
+			}
+		else
+			{
+			break;	
+			}
+		}
+    return commandId;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::EditSettingItemContentSelectionL
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspProfileWizardDialog::EditSettingItemContentSelectionL(CAspWizardItem* aItem)
+	{
+	CAspSelectionItemList* list = new (ELeave) CAspSelectionItemList(1);
+	CleanupStack::PushL(TCleanupItem(CAspSelectionItemList::Cleanup, list));
+	
+	iWizard->GetContentSelectionL(list);
+	
+    TAspSettingPageParam param;
+    param.iCommandId = EAknSoftkeyOk;
+    GetNaviPaneText(param.iPageText, aItem);
+    param.iObserver = this;
+    param.iSettingType = aItem->iSettingType;
+
+	CAspCheckBoxSettingPage* dlg = new (ELeave) CAspCheckBoxSettingPage(
+	                                   R_ASP_SETTING_CHECK_NEXT_BACK, list, param);
+	
+   	CleanupStack::PushL(dlg);
+    dlg->SetSettingTextL(aItem->Header());
+	CleanupStack::Pop(dlg);
+
+    TBool ret = dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
+    
+    iWizard->SetContentSelectionL(list);
+    
+	CleanupStack::PopAndDestroy(list);
+
+   	return param.iCommandId;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::CheckValidity (from MAspEditorPageObserver)
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileWizardDialog::CheckValidity(const TDesC& aText, TInt aSettingType)
+	{
+	TInt ret = ETrue;
+	
+	TRAPD(err, ret = CheckValidityL(aText, aSettingType));
+	
+	if (err != KErrNone)
+		{
+		return ETrue;
+		}
+	
+	return ret;
+	}
+	
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::CheckValidityL (from MAspEditorPageObserver)
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspProfileWizardDialog::CheckValidityL(const TDesC& aText, TInt aSettingType)
+	{
+	if (aSettingType == CAspWizardItem::ETypeProfileName)
+		{
+	    if (TUtil::IsEmpty(aText))
+		    {
+		    TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_PROFILE_NAME_MISSING);
+		    return EFalse;
+		    }
+		}
+		
+	if (aSettingType == CAspWizardItem::ETypeSyncContent)
+		{
+	    if (TUtil::IsEmpty(aText))
+		    {
+		    CAspWizardItem* item = iWizard->CurrentItem();
+		    if (item->iErrorNoteResourceId == R_ASP_NOTE_CONTACTS_DB_MISSING)
+		    	{
+		    	TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_CONTACTS_DB_MISSING);
+		    	return EFalse;
+		    	}
+		    else if (item->iErrorNoteResourceId == R_ASP_NOTE_CALENDAR_DB_MISSING)
+		    	{	
+		    	TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_CALENDAR_DB_MISSING);
+		    	return EFalse;
+		    	}
+		    else if (item->iErrorNoteResourceId == R_ASP_NOTE_NOTES_DB_MISSING)
+		    	{
+		    	TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_NOTES_DB_MISSING);
+		    	return EFalse;
+		    	}
+		    else if (item->iErrorNoteResourceId == R_ASP_NOTE_EMAIL_DB_MISSING)
+		    	{
+		    	TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_EMAIL_DB_MISSING);
+		    	return EFalse;
+		    	} 
+		    else if (item->iErrorNoteResourceId == R_ASP_NOTE_MMS_DATABASE_MISSING)
+		    	{
+		    	TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_MMS_DATABASE_MISSING);
+		    	return EFalse;
+		    	} 
+		    else if (item->iErrorNoteResourceId == R_ASP_NOTE_SMS_DATABASE_MISSING)
+		        {
+		        TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_SMS_DATABASE_MISSING);
+		        return EFalse;
+		        } 
+		    else if (item->iErrorNoteResourceId == R_ASP_NOTE_BKM_DATABASE_MISSING)
+		    	{
+		    	TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_BKM_DATABASE_MISSING);
+		    	return EFalse;
+		    	} 
+		    else
+		    	{
+		    	TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_REMOTE_DATABASE_MISSING);
+		    	return EFalse;
+    	    	}
+    	        	    
+    	    }
+		}
+
+	if (aSettingType == CAspWizardItem::ETypeHostAddress)
+		{
+	    if (TUtil::IsEmpty(aText))
+		    {
+		    TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_HOST_ADDRESS_MISSING);
+		    return EFalse;
+		    }
+		TInt bearer = iWizard->NumberValue(CAspWizardItem::ETypeBearerType);
+		if	(bearer == EAspBearerInternet)		    
+			{
+				if (!TURIParser::IsValidUri(aText))
+			    {
+			    TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_INCORRECT_HOST_ADDRESS);
+			    return EFalse;
+			    }
+			}
+			else if (bearer == EAspBearerBlueTooth)
+			{
+				if (!TURIParser::IsValidBluetoothHostAddress(aText))
+			    {
+			    TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_INCORRECT_HOST_ADDRESS);
+			    return EFalse;
+			    }
+			}
+		}
+    
+	if (aSettingType == CAspWizardItem::ETypeServerId)
+		{
+	    if (!iProfileList->IsUniqueServerId(aText, KErrNotFound))
+		    {
+		    TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_INCORRECT_SERVER_ID);
+		    return EFalse;
+		    }
+		}
+
+	if (aSettingType == CAspWizardItem::ETypeContentSelection)
+		{
+		TInt adapterId = iWizard->ContentId(aText);
+		if (adapterId == KUidNSmlAdapterEMail.iUid)
+			{
+		    TInt protocol = iWizard->NumberValue(CAspWizardItem::ETypeProtocolVersion);
+		   	
+		   	
+		   	CDesCArray* arr = iWizard->LocalDatabaseList(KUidNSmlAdapterEMail.iUid);
+	        if (!arr)
+		        {
+		        TDialogUtil::ShowErrorNoteL(R_ASP_NO_MAILBOXES);
+		        return EFalse;  // no syncml mailbox
+		        }
+		
+	        if (arr->Count() == 0) 
+		        {
+		        TDialogUtil::ShowErrorNoteL(R_ASP_NO_MAILBOXES);
+		        return EFalse;   // no syncml mailbox
+		        }
+			}
+		}
+
+	
+
+	return ETrue;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::GetNavipaneText (from MAspEditorPageObserver)
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::GetNavipaneText(TDes& aText, TInt aContentCount)
+	{
+    CAspWizardItem* item = iWizard->CurrentItem();
+    
+    TInt total = iWizard->NumOfEnabledItems();
+    total--; // start page not included in page count
+    
+    TInt current = iWizard->NumOfCurrentItem(item);
+    current--; // start page not included in page count
+    
+    TInt enabledContentCount = iWizard->NumOfEnabledContentItems();
+    
+    total = total - enabledContentCount;
+    total = total + aContentCount;
+
+    GetNaviPaneText(aText, current, total);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspProfileWizardDialog::HandleEditorEvent (from MAspEditorPageObserver)
+//
+//------------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::HandleEditorEvent(TInt aEvent, TInt /*aValue*/)
+	{
+	if (aEvent == MAspEditorPageObserver::EKeyEvent)
+		{
+		HidePopupNote();
+		TRAP_IGNORE( ShowPopupNoteL(KErrNotFound, KMsToWaitBeforeRePopup) );
+		}
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::SetDefaultValuesL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::SetDefaultValuesL()
+	{
+	// use existing profile list for name creation
+	if (iDialogParam->iProfileList)
+		{
+	    HBufC* hBuf = CAspProfile::GetNewProfileNameLC(
+	                  iDialogParam->iProfileList, iApplicationId);
+	    iWizard->SetStringValueL(hBuf->Des(), CAspWizardItem::ETypeProfileName);  
+	    CleanupStack::PopAndDestroy(hBuf);
+		}
+	else
+		{
+		// create profile list for name creation
+	    TAspParam param(EApplicationIdSync, iSyncSession);
+        CAspProfileList* list =  CAspProfileList::NewLC(param);
+	    list->ReadAllProfilesL(CAspProfileList::EBasePropertiesOnly);
+	
+	    HBufC* hBuf = CAspProfile::GetNewProfileNameLC(list, iApplicationId);
+	    iWizard->SetStringValueL(hBuf->Des(), CAspWizardItem::ETypeProfileName);
+	    CleanupStack::PopAndDestroy(hBuf);
+	
+	    CleanupStack::PopAndDestroy(list);
+		}
+		
+	if (iBearerHandler)
+		{
+		TInt bearerType = iBearerHandler->DefaultBearer();
+		iWizard->SetNumberValue(bearerType, CAspWizardItem::ETypeBearerType);
+		}
+		
+	TInt num = EAspProtocol_1_2;
+	iWizard->SetNumberValue(num, CAspWizardItem::ETypeProtocolVersion);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::GetNaviPaneText
+//
+// Function constructs navi pane text. Text format is:
+// "Page %0N/%1N"  (eg "Page 5/6")
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::GetNaviPaneText(TDes& aText, TInt aCurrent, TInt aFinal)
+	{
+    TBuf <KBufSize> buf;
+    
+    // replace  %0N with aCurrent
+    StringLoader::Format(buf, iNaviPaneTextFormat, 0, aCurrent);
+    
+    // replace %1N with aFinal
+    StringLoader::Format(aText, buf, 1, aFinal);
+    
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion(aText);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::GetNaviPaneText
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::GetNaviPaneText(TDes& aText, CAspWizardItem* aItem)
+	{
+    TInt total = iWizard->NumOfEnabledItems();
+    total--; // start page not included in page count
+    
+    TInt current = iWizard->NumOfCurrentItem(aItem);
+    current--; // start page not included in page count
+
+    GetNaviPaneText(aText, current, total);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::UpdateCbaL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::UpdateCbaL(TInt aResourceId)
+    {
+    CEikButtonGroupContainer& cba = ButtonGroupContainer();
+    cba.SetCommandSetL(aResourceId);
+    cba.DrawDeferred();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::SetTextEditorTextL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::SetTextEditorTextL(TInt aResource)
+	{
+	if(iTextEditorText)
+		{
+		delete iTextEditorText;
+		iTextEditorText = NULL;		
+		}
+	if (iMoveBack)
+		{
+		TRect mainPane;
+    	AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPane);        
+    	iTextEditor->SetRect(mainPane);
+		}
+	iTextEditorText = CAspResHandler::ReadL(aResource);
+	UpdateTextColorL() ;
+	iTextEditor->SetTextL(iTextEditorText);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::ShowPopupNote
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::ShowPopupNoteL(TInt aResource, TInt aDelay) 
+    {
+    if (aResource != KErrNotFound)
+    	{
+    	HBufC* hBuf = CAspResHandler::ReadLC(aResource);    
+        iPopupNote->SetTextL(hBuf->Des());
+        CleanupStack::PopAndDestroy(hBuf);
+    	}
+    	
+    iPopupNote->SetTimePopupInView(KMsTimePopupInView);    
+    iPopupNote->SetTimeDelayBeforeShow(aDelay);
+    iPopupNote->ShowInfoPopupNote();    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::HidePopupNote
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::HidePopupNote() 
+    {
+    iPopupNote->HideInfoPopupNote();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::ShowErrorNoteL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::ShowErrorNoteL(TInt aError)
+	{
+	if (aError == KErrNoMemory || aError == KErrDiskFull)
+		{
+		CTextResolver* tr = CTextResolver::NewLC();
+		iBuf = tr->ResolveErrorString(aError, CTextResolver::ECtxNoCtxNoSeparator);
+     	CleanupStack::PopAndDestroy(tr);
+		}
+	else
+		{
+		CAspResHandler::ReadL(iBuf, R_ASP_LOG_ERR_PROFILE_WIZARD);
+		}
+		
+    TDialogUtil::ShowErrorNoteL(iBuf);
+	}
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::SetBackgroundContextL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::SetBackgroundContextL( )
+{
+	TRect mainPane( 0,0,0,0 );
+		
+	AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, mainPane );
+	
+	if (iBgContext)
+		{
+		delete iBgContext ;
+		iBgContext = NULL ;
+		}
+	
+	iBgContext = CAknsBasicBackgroundControlContext::NewL( 
+                        KAknsIIDQsnBgAreaMain, mainPane, EFalse );
+		
+	iTextEditor->SetSkinBackgroundControlContextL( iBgContext );                            
+}
+
+
+// -----------------------------------------------------------------------------
+// CAspProfileWizardDialog::UpdateTextColorL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProfileWizardDialog::UpdateTextColorL() 
+	{
+	TRgb textColor( KRgbBlack );
+	AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), 
+	                           textColor,
+	                           KAknsIIDQsnTextColors,
+	                           EAknsCIQsnTextColorsCG6 );
+
+
+	const CFont* sysfont = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont); 
+	TFontSpec sysfontspec = sysfont->FontSpecInTwips();
+
+	TCharFormat charFormat;
+	TCharFormatMask charFormatMask;
+	charFormat.iFontSpec = sysfontspec;
+
+	charFormat.iFontPresentation.iTextColor = textColor; 
+	charFormatMask.SetAll();
+	charFormatMask.SetAttrib( EAttFontHeight );
+	charFormatMask.SetAttrib( EAttColor );
+	CCharFormatLayer* formatLayer = CCharFormatLayer::NewL(charFormat, charFormatMask);
+	iTextEditor->SetCharFormatLayer(formatLayer);
+	}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspProgressDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,531 @@
+/*
+* 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:  
+*
+*/
+
+
+// INCLUDE FILES
+#include "AspProgressDialog.h"
+#include "AspSyncUtil.rh"
+#include "AspUtil.h"
+#include "AspDebug.h"
+#include "AspDefines.h"
+#include "AspResHandler.h"
+#include "AspDialogUtil.h"
+
+
+#include <eikprogi.h>
+#include <notecontrol.h>
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+/*******************************************************************************
+ * class CAspProgressDialog
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::CAspProgressDialog
+//
+// -----------------------------------------------------------------------------
+//
+CAspProgressDialog::CAspProgressDialog(MAspProgressDialogObserver* aObserver) : iObserver(aObserver)
+    {
+    FLOG( _L("CAspProgressDialog: CAspProgressDialog") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspProgressDialog* CAspProgressDialog::NewL(MAspProgressDialogObserver* aObserver)
+    {
+    FLOG( _L("CAspProgressDialog::NewL START") );
+
+    CAspProgressDialog* self = new (ELeave) CAspProgressDialog(aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    FLOG( _L("CAspProgressDialog::NewL END") );
+    return(self);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProgressDialog::ConstructL()
+    {
+    FLOG( _L("CAspProgressDialog::ConstructL START") );
+
+	iLastText = KNullDesC;
+	iAnimation = EFalse;
+	iResHandler = CAspResHandler::NewL();
+	iProgressDialogRunning = EFalse;
+    
+	FLOG( _L("CAspProgressDialog::ConstructL END") );
+    } 
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspProgressDialog::~CAspProgressDialog()
+    {
+    FLOG( _L("CAspProgressDialog::~CAspProgressDialog START") );
+
+	delete iResHandler;
+    delete iProgressDialog;
+
+	FLOG( _L("CAspProgressDialog::~CAspProgressDialog END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::LaunchProgressDialogL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProgressDialog::LaunchProgressDialogL(const TDesC& aLabel, TAknsItemID aId, const TDesC& aFileName, TInt aFileBitmapId, TInt aFileMaskId)
+	{
+    FLOG( _L("CAspProgressDialog::LaunchProgressDialogL START") );
+
+	iProgressDialog = new(ELeave) CAspProgressDialog2(reinterpret_cast<CEikDialog**>(&iProgressDialog), iApplicationId);
+    
+	iProgressDialog->PrepareLC(R_ASP_PROGRESS_NOTE);
+    iProgressDialog->SetTextL(aLabel);
+	
+	CEikImage* image = TDialogUtil::CreateImageLC(aId, aFileName, aFileBitmapId, aFileMaskId);
+    iProgressDialog->SetImageL(image);
+	CleanupStack::Pop(image);
+
+    // get reference to progress info bar
+    iProgressInfo = iProgressDialog->GetProgressInfoL();
+    iProgressDialog->SetCallback(this);
+    
+    iProgressDialog->RunLD();
+    iProgressDialogRunning = ETrue;
+
+	FLOG( _L("CAspProgressDialog::LaunchProgressDialogL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::CancelProgressDialogL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProgressDialog::CancelProgressDialogL()
+    {
+    FLOG( _L("CAspProgressDialog::CancelProgressDialogL START") );
+
+	if (!iProgressDialogRunning)
+		{
+		return; // dialog is already closed
+		}
+		
+	if(iProgressDialog)
+        {        
+        iProgressDialog->ProcessFinishedL();
+        iProgressDialogRunning = EFalse;
+        }    
+
+	FLOG( _L("CAspProgressDialog::CancelProgressDialogL END") );
+    }
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::ProgressDialog
+//
+// -----------------------------------------------------------------------------
+//
+CAspProgressDialog2* CAspProgressDialog::ProgressDialog()
+	{
+	return iProgressDialog;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::UpdateTextL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProgressDialog::UpdateTextL(const TDesC& aText)
+    {
+    FLOG( _L("CAspProgressDialog::UpdateTextL START") );
+
+	__ASSERT_DEBUG(iProgressDialog, TUtil::Panic(KErrGeneral));
+
+	if (iLastText.Compare(aText) == 0)
+		{
+		return;  // text has not changed
+		}
+    
+    iProgressDialog->SetTextL(aText);
+	TUtil::StrCopy(iLastText, aText);
+	
+	FLOG( _L("aText is '%S'"), &aText );
+
+	FLOG( _L("CAspProgressDialog::UpdateTextL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::SetProgress
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProgressDialog::SetProgress(TInt aValue)
+    {
+    FLOG( _L("CAspProgressDialog::SetProgress START") );
+    
+	__ASSERT_DEBUG(iProgressDialog  && iProgressInfo, TUtil::Panic(KErrGeneral));
+
+	CEikProgressInfo::SInfo info = iProgressInfo->Info();
+
+	TInt val = aValue;
+	if (val > info.iFinalValue)
+		{
+		val = info.iFinalValue;
+		}
+	
+	iProgressInfo->SetAndDraw(val);
+	
+	FLOG( _L("aValue is %d"), aValue );
+    
+	FLOG( _L("CAspProgressDialog::SetProgress END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::SetFinalProgress
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProgressDialog::SetFinalProgress(TInt aFinalValue)
+	{
+    FLOG( _L("CAspProgressDialog::SetFinalProgress START") );
+    
+    __ASSERT_DEBUG(iProgressInfo, TUtil::Panic(KErrGeneral));
+
+    if (aFinalValue < 0)
+    	{
+    	iProgressInfo->SetFinalValue(0);
+    	}
+    else
+    	{
+    	iProgressInfo->SetFinalValue(aFinalValue);
+    	}
+    	
+	iProgressInfo->SetAndDraw(0);
+
+	FLOG( _L("aFinalValue is %d"), aFinalValue );
+	
+	FLOG( _L("CAspProgressDialog::SetFinalProgress END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::NoteControl
+//
+// -----------------------------------------------------------------------------
+//
+CAknNoteControl* CAspProgressDialog::NoteControl()
+	{
+    CAknNoteControl* note = STATIC_CAST(CAknNoteControl*, iProgressDialog->ControlOrNull(EAspSyncProgressNote));
+
+	__ASSERT_DEBUG(note, TUtil::Panic(KErrGeneral));
+
+	return note;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::CancelAnimation
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProgressDialog::CancelAnimation()
+	{
+	FLOG( _L("CAspProgressDialog::CancelAnimation START") );
+	
+	NoteControl()->CancelAnimation();
+	iAnimation = EFalse;
+
+	FLOG( _L("CAspProgressDialog::CancelAnimation END") );
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspProgressDialog::StartAnimationL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspProgressDialog::StartAnimationL()
+	{
+	FLOG( _L("CAspProgressDialog::StartAnimationL START") );
+	
+	if (!iAnimation)
+		{
+		NoteControl()->StartAnimationL();
+		iAnimation = ETrue;
+		
+		FLOG( _L("animation started") );
+		}
+		
+    FLOG( _L("CAspProgressDialog::StartAnimationL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::DialogDismissedL (From MProgressDialogCallback)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProgressDialog::DialogDismissedL(TInt aButtonId)
+    {
+    FLOG( _L("CAspProgressDialog::DialogDismissedL START" ) );
+  
+    if (!iObserver)
+		{
+		FLOG( _L("### no observer ###") );
+		FLOG( _L("CAspProgressDialog::DialogDismissedL END") );
+		return; // no observer
+		}
+	
+	// end key handling
+	if (aButtonId == EKeyPhoneEnd)
+	    {
+        TRAP_IGNORE(iObserver->HandleDialogEventL(EKeyPhoneEnd));
+        }
+
+	// this dialog only sends one cancel event - other events are ignored 
+	if (aButtonId == EEikBidCancel)
+		{
+        TRAP_IGNORE(iObserver->HandleDialogEventL(EEikBidCancel));
+        }
+
+    FLOG( _L("CAspProgressDialog::DialogDismissedL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog::HideButtonL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspProgressDialog::HideButtonL()
+    {
+    const TInt KLastButtonIndex = 2;
+    
+   	CEikButtonGroupContainer& container = iProgressDialog->ButtonGroupContainer();
+	
+	container.RemoveCommandFromStack(KLastButtonIndex, EAknSoftkeyCancel);
+	container.AddCommandToStackL(KLastButtonIndex, EAknSoftkeyEmpty, KNullDesC);
+	container.DrawDeferred();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspProgressDialog::SetApplicationId
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspProgressDialog::SetApplicationId(TInt aApplicationId)
+	{
+	iApplicationId = aApplicationId;
+	}
+
+
+
+
+
+/*******************************************************************************
+ * class CAspProgressDialog2
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog2::CAspProgressDialog2
+//
+// -----------------------------------------------------------------------------
+//
+CAspProgressDialog2::CAspProgressDialog2(CEikDialog** aSelfPtr, TInt aApplicationId)
+ : CAknProgressDialog(aSelfPtr)
+	{
+	FLOG( _L("CAspProgressDialog2::CAspProgressDialog2 START") );
+	
+    iCloseEventReceived = EFalse;
+    iCancelEventReceived = EFalse;
+    iClosed = EFalse;
+    iCanceled = EFalse;
+	iApplicationId = aApplicationId;
+	
+	if (iApplicationId != EApplicationIdSync)
+		{
+		// to make sure that wserv does not change our priority even we lose foreground.
+	    // this is needed for receiving event EKeyPhoneEnd without delay.
+	    
+	    RWsSession& wsSession = iEikonEnv->WsSession();
+	    wsSession.ComputeMode(RWsSession::EPriorityControlDisabled);
+	    
+	    FLOG( _L("RWsSession::ComputeMode(RWsSession::EPriorityControlDisabled)") );
+	    
+		}
+		
+	FLOG( _L("CAspProgressDialog2::CAspProgressDialog2 END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspProgressDialog2::~CAspProgressDialog2()
+    {
+    FLOG( _L("CAspProgressDialog2::~CAspProgressDialog2 START") );
+
+	if (iApplicationId != EApplicationIdSync)
+		{
+		RWsSession& wsSession = iEikonEnv->WsSession();
+	    wsSession.ComputeMode(RWsSession::EPriorityControlComputeOff);
+	    
+	    FLOG( _L("RWsSession::ComputeMode(RWsSession::EPriorityControlComputeOff)") );
+		}
+
+    if (iAvkonAppUi)
+        {
+        iAvkonAppUi->RemoveFromStack(this);
+        }
+
+	FLOG( _L("CAspProgressDialog2::~CAspProgressDialog2 END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspProgressDialog2::OkToExitL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspProgressDialog2::OkToExitL(TInt aButtonId)
+    {
+    FLOG( _L("CAspProgressDialog2::OkToExitL START") );
+    
+    // close key handling
+    if (iCloseEventReceived && !iClosed)
+        {
+   	    if (iCallback)
+   	    	{
+   	    	TRAP_IGNORE(iCallback->DialogDismissedL(EKeyPhoneEnd));
+   	    	
+   	    	FLOG( _L("CAspProgressDialog2::OkToExitL: close handling done") );
+  	    	}
+   		    
+        if (iAvkonAppUi)
+            {
+            // prevent further close events
+            iAvkonAppUi->RemoveFromStack(this);
+            }
+            
+        FLOG( _L("CAspProgressDialog2::OkToExitL END") );
+
+        iClosed = ETrue;
+        return ETrue;
+        }
+
+    // cancel key handling
+    if (aButtonId == EEikBidCancel && iCancelEventReceived && !iCanceled && !iClosed)
+        {
+        if (iCallback)
+        	{
+        	TRAP_IGNORE(iCallback->DialogDismissedL(EEikBidCancel));
+        	
+        	FLOG( _L("CAspProgressDialog2::OkToExitL: cancel key handling done") );
+        	}
+        
+		FLOG( _L("CAspProgressDialog2::OkToExitL END") );
+		
+		iCanceled = ETrue;
+		return EFalse; // leave dialog open - let observer close it
+		}
+
+
+    FLOG( _L("CAspProgressDialog2::OkToExitL END") );
+    
+    return CAknProgressDialog::OkToExitL(aButtonId);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspProgressDialog2::OfferKeyEventL
+// 
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspProgressDialog2::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+	{
+	FLOG( _L("CAspProgressDialog2::OfferKeyEventL START") );
+	
+	if (aKeyEvent.iScanCode == EStdKeyDevice1)
+		{
+		iCancelEventReceived = ETrue;
+		FLOG( _L("CAspProgressDialog2::OfferKeyEventL: EStdKeyDevice1 received") );
+     	}
+		
+
+	if (aType == EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+
+            case EKeyEscape:  // iCode 27 (0x1b)
+            	{
+            	iCloseEventReceived = ETrue;
+            	FLOG( _L("CAspProgressDialog2::OfferKeyEventL: EKeyEscape received") );
+            	break;
+            	}
+            	
+            case EKeyPhoneEnd:
+             	{
+             	iCloseEventReceived = ETrue;
+                FLOG( _L("CAspProgressDialog2::OfferKeyEventL: EKeyPhoneEnd received") );
+                break;
+               	}
+
+            default:
+                FLOG( _L("event key code is %d"),  aKeyEvent.iCode);        
+			    break;
+			}
+		}
+
+
+    FLOG( _L("CAspProgressDialog2::OfferKeyEventL END") );
+    
+	return CAknProgressDialog::OfferKeyEventL(aKeyEvent, aType);
+	}
+
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspResHandler.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,721 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDES
+#include "AspResHandler.h"
+#include "AspUtil.h"
+#include "AspState.h"
+
+#include <akntabgrp.h>      // for AknTextUtils
+#include <StringLoader.h>
+#include <data_caging_path_literals.hrh>  // for resource and bitmap directories
+
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspResHandler* CAspResHandler::NewL()
+    {
+    CAspResHandler* self = new (ELeave) CAspResHandler();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspResHandler::~CAspResHandler()
+    {
+	if (iResId)
+		{
+        iEikEnv->DeleteResourceFile(iResId);
+		}
+
+	delete iProgressTextFormat;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspResHandler::ConstructL(void)
+    {
+	iEikEnv = CEikonEnv::Static();
+	
+	// add resource file
+	TFileName buf;
+	GetResFileName(buf);
+	iResId = TUtil::AddResFileL(buf);
+
+	iProgressTextFormatId = KErrNotFound;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::CAspResHandler
+//
+// -----------------------------------------------------------------------------
+//
+CAspResHandler::CAspResHandler()
+	{
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspResHandler::ReadL(TDes& aText, TInt aResourceId)
+	{
+	StringLoader::Load(aText, aResourceId);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspResHandler::ReadL(TDes& aText, TInt aResourceId, const TDesC& aSubString)
+	{
+    HBufC* hBuf = StringLoader::LoadLC(aResourceId, aSubString);
+    TUtil::StrCopy(aText, *hBuf);
+    CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadLC
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::ReadLC(TInt aResourceId)
+	{
+    return StringLoader::LoadLC(aResourceId);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadL
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::ReadL(TInt aResourceId)
+	{
+    return StringLoader::LoadL(aResourceId);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadDesArrayLC
+//
+// -----------------------------------------------------------------------------
+//
+CDesCArrayFlat* CAspResHandler::ReadDesArrayLC(TInt aResourceId)
+	{
+	CDesCArrayFlat* arr = iEikEnv->ReadDesCArrayResourceL(aResourceId);
+	CleanupStack::PushL(arr);
+    return arr;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadDesArrayL
+//
+// -----------------------------------------------------------------------------
+//
+CDesCArrayFlat* CAspResHandler::ReadDesArrayL(TInt aResourceId)
+	{
+	CDesCArrayFlat* arr = iEikEnv->ReadDesCArrayResourceL(aResourceId);
+    return arr;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadDesArrayStaticLC
+//
+// -----------------------------------------------------------------------------
+//
+CDesCArrayFlat* CAspResHandler::ReadDesArrayStaticLC(TInt aResourceId)
+	{
+	CDesCArrayFlat* arr = CEikonEnv::Static()->ReadDesCArrayResourceL(aResourceId);
+	CleanupStack::PushL(arr);
+    return arr;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadLC
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::ReadLC(TInt aResourceId, const TDesC& aSubString)
+	{
+	HBufC* hBuf = StringLoader::LoadL(aResourceId, aSubString);
+	CleanupStack::PushL(hBuf);
+	return hBuf;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadLC
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::ReadLC(TInt aResourceId, TInt aNumber)
+	{
+	HBufC* hBuf = StringLoader::LoadL(aResourceId, aNumber);
+	CleanupStack::PushL(hBuf);
+	return hBuf;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::GetResFileName
+//
+// -----------------------------------------------------------------------------
+//
+void CAspResHandler::GetResFileName(TDes& aText)
+	{
+	TParse parse;
+	parse.Set(KResFileName, &KDC_RESOURCE_FILES_DIR, NULL);
+	TUtil::StrCopy(aText, parse.FullName());
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::GetBitmapFileName
+//
+// -----------------------------------------------------------------------------
+//
+void CAspResHandler::GetBitmapFileName(TDes& aText)
+	{
+	TParse parse;
+	parse.Set(KBitmapFileName, &KDC_APP_BITMAP_DIR, NULL);
+	TUtil::StrCopy(aText, parse.FullName());
+	}
+
+/* Implementation of CMCC PIM v3 begins*/
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadProgressTextLC
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::ReadProgressTextLC(const TDesC& aContent, TInt aCurrent, TInt aFinal, TInt aPhase)
+    {
+    HBufC* hBuf = NULL;
+    
+    TBool isCalendar = EFalse;
+    HBufC* content = ReadLC(R_ASP_CONTENT_NAME_CALENDAR);
+    if ( !content->Compare(aContent) )
+        {
+        isCalendar = ETrue;
+        }
+    CleanupStack::PopAndDestroy(content); //content
+    
+    if (aPhase == CAspState::EPhaseSending)
+        {
+        if (isCalendar)
+            {
+            hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_SENDING_XOFY_CAL, aCurrent, aFinal, aContent);
+            }
+        else
+            {
+            hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_SENDING_XOFY, aCurrent, aFinal, aContent);
+            }
+        }
+    else if (aPhase == CAspState::EPhaseReceiving)
+        {
+        if (isCalendar)
+            {
+            hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_RECEIVING_XOFY_CAL, aCurrent, aFinal, aContent);
+            }
+        else
+            {
+            hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_RECEIVING_XOFY, aCurrent, aFinal, aContent);
+            }
+        }
+    else
+        {
+        hBuf = HBufC::NewLC(0);  // empty string
+        }
+
+    return hBuf;
+    }
+/* Implementation of CMCC PIM v3 ends*/
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadProgressTextL
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::ReadProgressTextLC(const TDesC& aContent, TInt aPhase)
+	{
+	HBufC* hBuf = NULL;
+	
+	if (aPhase == CAspState::EPhaseSending)
+		{
+	    hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_SENDING, aContent);
+		}
+	else if (aPhase == CAspState::EPhaseReceiving)
+		{
+		hBuf = ReadProgressTextLC(R_QTN_SML_SYNC_RECEIVING, aContent);
+		}
+    else
+    	{
+    	hBuf = HBufC::NewLC(0);  // empty string
+    	}
+	
+	return hBuf;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadProgressTextL
+//
+// Function constructs progress dialog text that is shown with progress bar.
+// Text format is one of the following:
+// "Sending %U"
+// "Receiving %U"
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::ReadProgressTextLC(TInt aResourceId, const TDesC& aContent)
+	{
+    
+    if (aResourceId != iProgressTextFormatId)
+    	{
+    	delete iProgressTextFormat;
+    	iProgressTextFormat = NULL;
+    	iProgressTextFormat = StringLoader::LoadL(aResourceId, iEikEnv);
+    	iProgressTextFormatId = aResourceId;
+    	}
+    	
+    TInt len = iProgressTextFormat->Length() + aContent.Length();
+    
+    HBufC* hBuf = HBufC::NewLC(len);
+    TPtr ptr = hBuf->Des();
+
+    
+    // replace  %0U with content name (eg "Contacts")
+    StringLoader::Format(ptr, iProgressTextFormat->Des(), 0, aContent);
+    
+    //HBufC* hBuf = StringLoader::LoadLC(aResourceId, aContent);
+   
+    return hBuf;
+	}
+
+/* Implementation of CMCC PIM v3 begins*/
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadProgressTextL
+//
+// Function constructs progress dialog text that is shown with progress bar.
+// Text format is one of the following:
+// "Sending %0N of %1N %U"
+// "Receiving %0U: %0N"
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::ReadProgressTextLC(TInt aResourceId, TInt aCurrent, TInt aFinal, const TDesC& aContent)
+    {
+    
+    if (aResourceId != iProgressTextFormatId)
+        {
+        delete iProgressTextFormat;
+        iProgressTextFormat = NULL;
+        iProgressTextFormat = StringLoader::LoadL(aResourceId, iEikEnv);
+        iProgressTextFormatId = aResourceId;
+        }
+    
+    TInt len = iProgressTextFormat->Length() + aContent.Length();// + 8;
+    
+    HBufC* hBuf = HBufC::NewLC(len);
+    TPtr ptr = hBuf->Des();
+
+    HBufC* temp = HBufC::NewLC(len);
+    TPtr tempPtr = temp->Des();
+    
+    if (iProgressTextFormatId == R_QTN_SML_SYNC_RECEIVING_XOFY || iProgressTextFormatId == R_QTN_SML_SYNC_RECEIVING_XOFY_CAL)
+        {
+        // replace %0N with current item
+        StringLoader::Format(tempPtr, iProgressTextFormat->Des(), 0, aCurrent);
+        }
+    else
+        {
+        // replace %0N with current item
+        StringLoader::Format(ptr, iProgressTextFormat->Des(), 0, aCurrent);
+        // replace %1N with total items
+        StringLoader::Format(tempPtr, ptr, 1, aFinal);
+        }
+    if (iProgressTextFormatId == R_QTN_SML_SYNC_RECEIVING_XOFY_CAL || iProgressTextFormatId == R_QTN_SML_SYNC_SENDING_XOFY_CAL)
+        {
+        ptr.Copy(tempPtr);
+        }
+    else
+        {
+        // replace  %0U with content name (eg "Contacts")
+        StringLoader::Format(ptr, tempPtr, 0, aContent);
+        }
+    CleanupStack::PopAndDestroy(temp); //temp
+    
+    return hBuf;
+    }
+/* Implementation of CMCC PIM v3 ends*/
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadProfileInfoTextLC
+//
+// Text format: 
+// "Profile: %0U, connection: %1U"
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::ReadProfileInfoTextLC(const TDesC& aProfile, const TDesC& aBearer)
+	{
+    HBufC* hBuf   = HBufC::NewLC(KBufSize255);
+    HBufC* temp   = HBufC::NewLC(KBufSize255);
+    HBufC* format = ReadLC(R_ASP_POPUP_PROFILE_INFO);
+    	
+    TPtr ptr = hBuf->Des();
+    TPtr tempPtr = temp->Des();
+    
+    // replace  %0U with profile name
+    StringLoader::Format(tempPtr, format->Des(), 0, aProfile);
+    
+    // replace %1U with bearer name
+    StringLoader::Format(ptr, tempPtr, 1, aBearer);
+    
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
+    
+    
+    CleanupStack::PopAndDestroy(format);
+    CleanupStack::PopAndDestroy(temp);
+    
+    return hBuf;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadProfileInfoTextLC
+//
+// Text format: 
+// "Profile: %0U, connection: %1U. Next sync in %0N hours %1N minutes"
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::ReadProfileInfoTextLC(const TDesC& aProfile, const TDesC& aBearer,
+		                                    TInt aHours, TInt aMinutes)
+	{
+    HBufC* hBuf   = HBufC::NewLC(KBufSize255);
+    HBufC* temp   = HBufC::NewLC(KBufSize255);
+    HBufC* format = ReadLC(R_ASP_POPUP_AUTO_SYNC_PROFILE);
+    	
+    TPtr ptr = hBuf->Des();
+    TPtr tempPtr = temp->Des();
+    
+    // replace  %0U with profile name
+    StringLoader::Format(tempPtr, format->Des(), 0, aProfile);
+    
+    // replace %1U with bearer name
+    StringLoader::Format(ptr, tempPtr, 1, aBearer);
+    
+    // replace %0N with hours
+    StringLoader::Format(tempPtr, ptr, 0, aHours);
+
+    // replace %1N with minutes
+    StringLoader::Format(ptr, tempPtr, 1, aMinutes);
+
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
+    
+    
+    CleanupStack::PopAndDestroy(format);
+    CleanupStack::PopAndDestroy(temp);
+    
+    return hBuf;
+	}
+		                                    		
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::ReadAutoSyncInfoTextLC
+//
+// Text format: 
+// "Next sync: %0U, profile: %1U"
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::ReadAutoSyncInfoTextLC(const TDesC& aProfile, TTime aTime)
+	{
+    HBufC* hBuf   = HBufC::NewLC(KBufSize255);
+    HBufC* temp   = HBufC::NewLC(KBufSize255);
+    HBufC* format = ReadLC(R_ASP_MAIN_NOTE_AUTO_ON);
+    	
+    TPtr ptr = hBuf->Des();
+    TPtr tempPtr = temp->Des();
+
+	TTime currentTime;
+	currentTime.HomeTime();
+	TDateTime today = currentTime.DateTime();
+	TDateTime syncDay = aTime.DateTime();
+
+	TBuf<64> aTimeString;
+	if(today.Day() == syncDay.Day() && today.Month() == syncDay.Month())
+		{
+		//show next sync time
+		TBuf<KBufSize> timeFormat;
+		CAspResHandler::ReadL(timeFormat, R_QTN_TIME_USUAL_WITH_ZERO);
+		aTime.FormatL(aTimeString, timeFormat);
+
+		}
+	else 
+		{
+		//show sync day
+		TBuf<KBufSize> dateFormat;
+		CAspResHandler::ReadL(dateFormat, R_QTN_DATE_USUAL_WITH_ZERO);
+		aTime.FormatL(aTimeString, dateFormat);
+
+		}
+	
+	
+    // replace  %0U with Next Sync
+    StringLoader::Format(tempPtr, format->Des(), 0, aTimeString);
+        
+    // replace %1U with profile name
+    StringLoader::Format(ptr, tempPtr, 1, aProfile);
+    
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr);
+    
+    
+    CleanupStack::PopAndDestroy(format);
+    CleanupStack::PopAndDestroy(temp);
+    
+    return hBuf;
+	}
+		                
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::GetNewProfileNameLC
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::GetNewProfileNameLC(TInt aIndex, TInt aApplicationId)
+	{
+	HBufC* hBuf = NULL;
+	
+	switch (aApplicationId)
+		{
+		case EApplicationIdContact:
+			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_PHONEBOOK, aIndex);
+			break;
+		case EApplicationIdCalendar:
+			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_CALENDAR, aIndex);
+			break;
+		case EApplicationIdEmail:
+			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_EMAIL, aIndex);
+			break;
+		case EApplicationIdNote:
+			hBuf =  StringLoader::LoadLC(R_ASP_PROFILENAME_NOTE, aIndex);
+			break;
+		default:
+			hBuf =  StringLoader::LoadLC(R_QTN_APPS_NEWPROFILE, aIndex);
+			break;
+		}
+		
+	return hBuf;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::GetContentNameLC
+// 
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::GetContentNameLC(TInt aDataProviderId, const TDesC& aDefaultText)
+	{
+    if (aDataProviderId == KUidNSmlAdapterContact.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_PHONEBOOK);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_CALENDAR);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_EMAIL);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_NOTE);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_SMS);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_MMS);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_NAME_BKM);
+		}
+	else
+		{
+		return aDefaultText.AllocLC();
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::GetContentTitleLC
+// 
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::GetContentTitleLC(TInt aDataProviderId, const TDesC& aDefaultText)
+	{
+	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_PHONEBOOK);
+		}
+	if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_CALENDAR);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_EMAIL);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
+		{
+    	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_NOTE);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
+		{
+    	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_SMS);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
+		{
+    	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_MMS);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
+		{
+    	return CAspResHandler::ReadLC(R_ASP_CONTENT_TITLE_BKM);
+		}
+	else
+		{
+		return aDefaultText.AllocLC();
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspResHandler::GetContentSettingLC
+// 
+// -----------------------------------------------------------------------------
+//
+HBufC* CAspResHandler::GetContentSettingLC(TInt aDataProviderId, const TDesC& aDefaultText)
+	{
+	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_PHONEBOOK);
+		}
+	if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_CALENDAR);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
+		{
+		return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_EMAIL);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
+		{
+    	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_NOTES);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
+		{
+    	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_SMS);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
+		{
+    	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_MMS);
+		}
+	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
+		{
+    	return CAspResHandler::ReadLC(R_ASP_CONTENT_SETTING_BKM);
+		}
+	else
+		{
+		return aDefaultText.AllocLC();
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspResHandler::RemoteDatabaseHeaderId
+//
+//------------------------------------------------------------------------------
+//
+TInt CAspResHandler::RemoteDatabaseHeaderId(TInt aDataProviderId)
+	{
+	TInt ret = R_ASP_REMOTE_DATABASE;
+	
+	if (aDataProviderId == KUidNSmlAdapterContact.iUid)
+		{
+		ret = R_ASP_REMOTE_DATABASE_CNT;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterCalendar.iUid)
+		{
+		ret = R_ASP_REMOTE_DATABASE_AGN;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterEMail.iUid)
+		{
+		ret = R_ASP_REMOTE_DATABASE_EML;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterNote.iUid)
+		{
+		ret = R_ASP_REMOTE_DATABASE_NPD;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterSms.iUid)
+		{
+		ret = R_ASP_REMOTE_DATABASE_SMS;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterMMS.iUid)
+		{
+		ret = R_ASP_REMOTE_DATABASE_MMS;
+		}
+	else if (aDataProviderId == KUidNSmlAdapterBookmarks.iUid)
+		{
+		ret = R_ASP_REMOTE_DATABASE_BKM;
+		}
+		
+	return ret;
+	}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspSchedule.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,2481 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "AspSchedule.h"
+#include "AspUtil.h"
+#include "AspDialogUtil.h"
+#include "AspDebug.h"
+#include "AspProfile.h"
+#include "AspLogDialog.h"
+#include "AspAutoSyncHandler.h"
+
+#include "schinfo.h" // TScheduleEntryInfo2
+#include <s32mem.h>  // RDesWriteStream
+#include <s32file.h> // RFileReadStream
+#include <bautils.h> // BaflUtils
+#include <centralrepository.h>  // CRepository
+#include <rconnmon.h>
+#include <SyncMLClientDS.h>
+
+
+
+/*******************************************************************************
+ * class CAspSchedule
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspSchedule* CAspSchedule::NewL()
+    {
+    CAspSchedule* self = new (ELeave) CAspSchedule();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return(self);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::NewLC
+//
+// -----------------------------------------------------------------------------
+//
+CAspSchedule* CAspSchedule::NewLC()
+    {
+    CAspSchedule* self = new (ELeave) CAspSchedule();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+
+    return(self);
+    }
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::CAspSchedule
+// 
+// -----------------------------------------------------------------------------
+//
+CAspSchedule::CAspSchedule()
+	{
+	iSettingChanged = EFalse;
+	iSyncSessionOpen = EFalse;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::ConstructL()
+    {
+    InternalizeL();
+	
+	if(iAutoSyncProfileId == KErrNotFound)
+		{
+		CreateAutoSyncProfileL();
+		}
+	
+		
+    } 
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CAspSchedule::~CAspSchedule()
+    {
+    iList.Close();
+	CloseSyncSession();
+    }
+
+
+// ----------------------------------------------------------------------------
+// InitializeL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSchedule::InitializeL()
+    {
+    
+    FLOG( _L("CAspSchedule::InitializeL START") );
+    iError          = KErrNone;
+    iProfileId      = KErrNotFound;
+    iRoamingAllowed = EFalse;
+	iDailySyncEnabled = EFalse;
+	iPeakSyncEnabled = EFalse;
+	iOffPeakSyncEnabled = EFalse;
+	
+
+	iContentFlags = 0xFF;
+	iSyncFrequency          = EIntervalManual;
+	iSyncPeakSchedule       = EIntervalManual;
+    iSyncOffPeakSchedule    = EIntervalManual;
+
+    iPeakScheduleHandle = KErrNotFound;
+	iOffPeakScheduleHandle = KErrNotFound;
+
+	iStartPeakTimeHr		 = KStartPeakHour;
+	iStartPeakTimeMin		 = KStartPeakMin;
+	iEndPeakTimeHr         = KEndPeakHour;
+	iEndPeakTimeMin         = KEndPeakMin;
+
+	iAutoSyncProfileId = KErrNotFound;
+	iAutoSyncScheduleTimeHr = KDefaultStartHour;
+	iAutoSyncScheduleTimeMin = 0;
+
+	SetWeekdayEnabled(EMonday,    ETrue);
+   	SetWeekdayEnabled(ETuesday,   ETrue);
+   	SetWeekdayEnabled(EWednesday, ETrue);
+   	SetWeekdayEnabled(EThursday,  ETrue);
+   	SetWeekdayEnabled(EFriday,    ETrue);
+   	SetWeekdayEnabled(ESaturday,  EFalse);
+   	SetWeekdayEnabled(ESunday,    EFalse);
+
+	InitializeContentsL();
+	FLOG( _L("CAspSchedule::InitializeL END") );
+
+    }
+
+// ----------------------------------------------------------------------------
+// InitializeContentsL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSchedule::InitializeContentsL()
+	{
+	OpenSyncSessionL();
+	TAspParam param(EApplicationIdSync, &iSyncSession);
+	param.iMode = CAspContentList::EInitDataProviders;
+	CAspContentList* asContentList = CAspContentList::NewLC(param);		
+	
+	TInt providerCount = asContentList->ProviderCount();
+	
+	for (TInt index = 0; index < providerCount; index++)
+		{
+		TAspProviderItem& provider = asContentList->ProviderItem(index);
+			
+		if (provider.iDataProviderId == KUidNSmlAdapterEMail.iUid)
+			{
+			if (MailboxExistL())
+				{
+				SetContentEnabled(index, ETrue);
+				}
+			else
+				{
+				SetContentEnabled(index, EFalse);
+				}
+			}
+		else
+			{
+			SetContentEnabled(index, ETrue);
+			}
+		
+		}
+	CleanupStack::PopAndDestroy(asContentList);
+
+
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::DoInternalizeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::DoInternalizeL()
+	{
+	const TInt KMaxLength = 1024;
+	
+    HBufC8*  hBuf = HBufC8::NewLC(KMaxLength);
+    TPtr8 ptr = hBuf->Des();
+    
+    ReadRepositoryL(ERepositoryKeyBin, ptr);
+    
+    RDesReadStream stream(ptr);
+    stream.PushL();
+    
+    InternalizeL(stream);
+    
+    stream.Pop();
+    stream.Close();
+    
+    CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::InternalizeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::InternalizeL()
+	{
+	FLOG( _L("CAspSchedule::InternalizeL START") );
+	TRAPD(err, DoInternalizeL());
+	
+	if (err == KErrNoMemory || err == KErrLocked || err == KErrAlreadyExists)
+		{
+		FLOG( _L("CAspSchedule::InternalizeL Error 1:  %d"),err );
+		User::Leave(err);
+		}
+		
+	else if (err != KErrNone)
+		{
+		FLOG( _L("CAspSchedule::InternalizeL Error 2:  %d"),err );
+		ResetRepositoryL();  // settings corrupted
+	    InitializeL();
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::InternalizeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::InternalizeL(RReadStream& aStream)
+	{
+	const TInt KAutoSyncSettingCount = 20;
+	
+    iList.Reset();
+    
+    // total setting count
+	TInt32 count = 0;
+	
+	TRAPD(err, count = aStream.ReadInt32L());
+	
+	if (err != KErrNone && err != KErrEof)
+		{
+		User::Leave(err);
+		}
+	
+	if (count != KAutoSyncSettingCount)
+		{
+		InitializeL(); // settings not found - use defaults
+		SaveL();
+		return;
+		}
+    
+    
+    iError                 = aStream.ReadInt32L();
+    iProfileId             = aStream.ReadInt32L();
+    iWeekdayFlags          = aStream.ReadInt32L();
+    TInt roamingAllowed    = aStream.ReadInt32L();
+
+
+	
+	iPeakScheduleHandle = aStream.ReadInt32L();
+	iOffPeakScheduleHandle = aStream.ReadInt32L();
+	iContentFlags           = aStream.ReadInt32L();
+	iSyncPeakSchedule       = aStream.ReadInt32L();
+    iSyncOffPeakSchedule    = aStream.ReadInt32L();
+	iStartPeakTimeHr		= aStream.ReadInt32L();
+	iStartPeakTimeMin		= aStream.ReadInt32L();
+	iEndPeakTimeHr          = aStream.ReadInt32L();
+	iEndPeakTimeMin         = aStream.ReadInt32L();
+	iSyncFrequency          = aStream.ReadInt32L();
+	iDailySyncEnabled 			= aStream.ReadInt32L();
+	iPeakSyncEnabled        = aStream.ReadInt32L();
+	iOffPeakSyncEnabled		= aStream.ReadInt32L();
+
+	iAutoSyncProfileId		= aStream.ReadInt32L();
+	
+	iAutoSyncScheduleTimeHr = aStream.ReadInt32L();
+	iAutoSyncScheduleTimeMin = aStream.ReadInt32L();
+	
+#ifdef _DEBUG
+    LogSettings();
+#endif
+
+    iRoamingAllowed = EFalse;
+    if (roamingAllowed)
+    	{
+    	iRoamingAllowed = ETrue;
+    	}
+
+	CheckEmailSelectionL();
+    }   
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::CheckEmailSelectionL()
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::CheckEmailSelectionL()
+	{
+	TRAPD(err, OpenSyncSessionL());
+	if (err != KErrNone)
+		{
+		
+		/*OpenSynSessionL() may leave when system time is changed so that peak and off-peak syncs are
+		scheduled simulataneously.In that case also next sync time has to be updated. So a leave here should be
+		trapped and return to the time update function.	
+		*/
+		
+		FLOG( _L("Session cannot be opened now : return") );
+		return;
+		}
+	TAspParam param(EApplicationIdSync, &iSyncSession);
+	param.iMode = CAspContentList::EInitDataProviders;
+	CAspContentList* asContentList = CAspContentList::NewLC(param);		
+	
+	TInt providerCount = asContentList->ProviderCount();
+
+	TInt emailIndex = asContentList->FindProviderIndex(KUidNSmlAdapterEMail.iUid);
+					
+	if (!MailboxExistL())
+		{
+		SetContentEnabled(emailIndex, EFalse);
+		}
+	else if (!IsAutoSyncEnabled())
+		{
+		SetContentEnabled(emailIndex, ETrue);
+		}
+
+	if (iProfileId != KErrNotFound
+		 					&& !ProtocolL())
+		{
+		SetContentEnabled(emailIndex, EFalse);
+		}
+	
+	CleanupStack::PopAndDestroy(asContentList);
+
+	}
+	
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::ExternalizeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::ExternalizeL()
+	{
+	const TInt KMaxLength = 1024;
+	
+    HBufC8*  hBuf = HBufC8::NewLC(KMaxLength);
+    TPtr8 ptr = hBuf->Des();
+    RDesWriteStream stream(ptr);
+    stream.PushL();
+    
+    ExternalizeL(stream);
+    
+    stream.CommitL();
+    stream.Pop();
+    stream.Close();
+    
+    TRAPD (err,WriteRepositoryL(ERepositoryKeyBin, ptr));
+	User::LeaveIfError(err);
+    
+    CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::ExternalizeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::ExternalizeL(RWriteStream& aStream)
+	{
+	const TInt KAutoSyncSettingCount = 20;
+	
+        
+    TInt roamingAllowed = 0;
+    if (iRoamingAllowed)
+    	{
+    	roamingAllowed = 1;
+    	}
+    
+   
+    aStream.WriteInt32L(KAutoSyncSettingCount);
+	aStream.WriteInt32L(iError);
+    aStream.WriteInt32L(iProfileId);
+    aStream.WriteInt32L(iWeekdayFlags);
+    aStream.WriteInt32L(roamingAllowed);
+
+	aStream.WriteInt32L(iPeakScheduleHandle);
+	aStream.WriteInt32L(iOffPeakScheduleHandle);
+    aStream.WriteInt32L(iContentFlags);
+	aStream.WriteInt32L(iSyncPeakSchedule);
+	aStream.WriteInt32L(iSyncOffPeakSchedule);
+	aStream.WriteInt32L(iStartPeakTimeHr);
+	aStream.WriteInt32L(iStartPeakTimeMin);
+	aStream.WriteInt32L(iEndPeakTimeHr);
+   	aStream.WriteInt32L(iEndPeakTimeMin);
+	aStream.WriteInt32L(iSyncFrequency);
+	aStream.WriteInt32L(iDailySyncEnabled);
+	aStream.WriteInt32L(iPeakSyncEnabled);
+	aStream.WriteInt32L(iOffPeakSyncEnabled);
+	aStream.WriteInt32L(iAutoSyncProfileId);
+
+    aStream.WriteInt32L(iAutoSyncScheduleTimeHr);
+	aStream.WriteInt32L(iAutoSyncScheduleTimeMin);
+
+#ifdef _DEBUG
+	LogSettings();
+#endif
+
+	
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::WriteRepositoryL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::WriteRepositoryL(TInt aKey, const TDesC8& aValue)
+	{
+	const TUid KRepositoryId = KCRUidNSmlDSApp; // 0x101F9A1D
+
+    CRepository* rep = CRepository::NewLC(KRepositoryId);
+    TInt err = rep->Set(aKey, aValue);
+    User::LeaveIfError(err);
+    
+    CleanupStack::PopAndDestroy(rep);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::ReadRepositoryL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::ReadRepositoryL(TInt aKey, TDes8& aValue)
+	{
+	const TUid KRepositoryId = KCRUidNSmlDSApp;
+
+    CRepository* rep = CRepository::NewLC(KRepositoryId);
+    TInt err = rep->Get(aKey, aValue);
+    User::LeaveIfError(err);
+    
+    CleanupStack::PopAndDestroy(rep);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::ResetRepositoryL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::ResetRepositoryL()
+	{
+	const TUid KRepositoryId = KCRUidNSmlDSApp;
+
+    CRepository* rep = CRepository::NewLC(KRepositoryId);
+    TInt err = rep->Reset();
+    User::LeaveIfError(err);
+    
+    CleanupStack::PopAndDestroy(rep);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SaveL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SaveL()
+	{
+	ExternalizeL();
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::PeakScheduleHandle
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSchedule::PeakScheduleHandle()
+	{
+	return iPeakScheduleHandle;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetPeakScheduleHandle
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SetPeakScheduleHandle(TInt aScheduleHandle)
+	{
+	iPeakScheduleHandle = aScheduleHandle;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetPeakScheduleHandle
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSchedule::OffPeakScheduleHandle()
+	{
+	return iOffPeakScheduleHandle;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetPeakScheduleHandle
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SetOffPeakScheduleHandle(TInt aScheduleHandle)
+	{
+	iOffPeakScheduleHandle = aScheduleHandle;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::ProfileId
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSchedule::ProfileId()
+	{
+	return iProfileId;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetProfileId
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SetProfileId(TInt aProfileId)
+	{
+	iProfileId = aProfileId;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::DailySyncEnabled
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSchedule::DailySyncEnabled()
+	{
+	return iDailySyncEnabled;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetDailySyncEnabled
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SetDailySyncEnabled(TBool aSyncEnabled)
+	{
+	iDailySyncEnabled = aSyncEnabled;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::PeakSyncEnabled
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSchedule::PeakSyncEnabled()
+	{
+	return iPeakSyncEnabled;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetPeakSyncEnabled
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SetPeakSyncEnabled(TBool aSyncEnabled)
+	{
+	iPeakSyncEnabled = aSyncEnabled;
+	}
+// -----------------------------------------------------------------------------
+// CAspSchedule::OffPeakSyncEnabled
+//
+// -----------------------------------------------------------------------------
+//
+
+TBool CAspSchedule::OffPeakSyncEnabled()
+	{
+	return iOffPeakSyncEnabled;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetOffPeakSyncEnabled
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SetOffPeakSyncEnabled(TBool aSyncEnabled)
+	{
+	iOffPeakSyncEnabled = aSyncEnabled;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::WeekdayEnabled
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSchedule::WeekdayEnabled(TInt aWeekday)
+	{
+	TInt dayFlag = WeekdayFlag(aWeekday);
+	
+	TFlag flag(iWeekdayFlags);
+	
+	return flag.IsOn(dayFlag);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetWeekdayEnabled
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SetWeekdayEnabled(TInt aWeekday, TInt aEnabled)
+	{
+	TInt dayFlag = WeekdayFlag(aWeekday);
+	
+	TFlag flag(iWeekdayFlags);
+	
+	if (aEnabled)
+		{
+		flag.SetOn(dayFlag);
+		}
+	else
+		{
+		flag.SetOff(dayFlag);
+		}
+	iSettingChanged = ETrue;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::WeekdayFlag
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSchedule::WeekdayFlag(TInt aWeekday)
+	{
+	TInt ret = EFlagMonday;
+	
+	switch (aWeekday)
+		{
+		case EMonday:
+		    ret = EFlagMonday;
+		    break;
+		case ETuesday:
+		    ret = EFlagTuesday;
+		    break;
+		case EWednesday:
+		    ret = EFlagWednesday;
+		    break;
+		case EThursday:
+		    ret = EFlagThursday;
+		    break;
+		case EFriday:
+		    ret = EFlagFriday;
+		    break;
+		case ESaturday:
+		    ret = EFlagSaturday;
+		    break;
+		case ESunday:
+		    ret = EFlagSunday;
+		    break;
+		default:
+		    TUtil::Panic(KErrArgument);
+		    break;
+		}
+		
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SelectedDayInfo
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SelectedDayInfo(TInt& aDayCount, TInt& aWeekday)
+	{
+	aDayCount = 0;
+
+	for (TInt i=EMonday; i<=ESunday; i++)
+		{
+		if (WeekdayEnabled(i))
+			{
+			aDayCount++;
+			aWeekday = i;
+			}
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetContentEnabled
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SetContentEnabled(TInt aContent, TInt aEnabled)
+	{
+	TInt contentFlag = 1 << aContent;
+	TFlag flag(iContentFlags);
+	if (aEnabled)
+		{
+		flag.SetOn(contentFlag);
+		}
+	else
+		{
+		flag.SetOff(contentFlag);
+		}
+	iSettingChanged = ETrue;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::ContentEnabled
+// 
+// -----------------------------------------------------------------------------
+//
+
+TBool CAspSchedule::ContentEnabled(TInt aContent)
+	{
+	TInt contentFlag = 1 << aContent;
+	TFlag flag(iContentFlags);
+	return flag.IsOn(contentFlag);
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::ContentSelectionInfo
+//
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::ContentSelectionInfo(TInt& aContentCnt, TInt& aContent)
+	{
+	aContentCnt = 0;
+	OpenSyncSessionL();
+	TAspParam param(EApplicationIdSync, &iSyncSession);
+	param.iMode = CAspContentList::EInitDataProviders;
+	CAspContentList* asContentList = CAspContentList::NewLC(param);		
+	
+	//contents are saved in the sorted order of data providers
+	TInt providerCount = asContentList->ProviderCount();
+	for (TInt i= 0; i < providerCount; i++)
+		{
+		if (ContentEnabled(i))
+			{
+			aContentCnt++;
+			aContent = i;
+			}
+		}
+	CleanupStack::PopAndDestroy(asContentList);
+	
+	}	
+	
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::StartPeakTime
+//
+// -----------------------------------------------------------------------------
+//
+
+TTime CAspSchedule::StartPeakTime()
+	{
+	TDateTime time(0, EJanuary, 0, iStartPeakTimeHr, iStartPeakTimeMin, 0, 0);
+	TTime startTime(time);
+	return startTime;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetStartPeakTime
+//
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::SetStartPeakTime(TTime aStartTime)
+	{
+	TDateTime startTime  = aStartTime.DateTime();
+	if (iStartPeakTimeHr != startTime.Hour() || iStartPeakTimeMin != startTime.Minute())
+		{
+		iStartPeakTimeHr = startTime.Hour();
+		iStartPeakTimeMin = startTime.Minute();
+		iSettingChanged = ETrue;
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::EndPeakTime
+//
+// -----------------------------------------------------------------------------
+//
+
+
+TTime CAspSchedule::EndPeakTime()
+	{
+	TDateTime time(0, EJanuary, 0, iEndPeakTimeHr, iEndPeakTimeMin, 0, 0);
+	TTime endTime(time);
+	return endTime;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetEndPeakTime
+//
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::SetEndPeakTime(TTime aEndTime)
+	{
+	TDateTime endTime  = aEndTime.DateTime();
+	
+	if (iEndPeakTimeHr != endTime.Hour() || iEndPeakTimeMin != endTime.Minute())
+		{
+		iEndPeakTimeHr = endTime.Hour();
+		iEndPeakTimeMin = endTime.Minute();
+		iSettingChanged = ETrue;
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SyncFrequency
+//
+// -----------------------------------------------------------------------------
+//
+
+TInt CAspSchedule::SyncFrequency()
+	{
+	return iSyncFrequency;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetSyncFrequency
+//
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::SetSyncFrequency(TInt aSchedule)
+	{
+	if (aSchedule != iSyncFrequency)
+		{
+		iSyncFrequency = aSchedule;
+		iSettingChanged = ETrue;
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SyncPeakSchedule
+//
+// -----------------------------------------------------------------------------
+//
+
+TInt CAspSchedule::SyncPeakSchedule()
+	{
+	return iSyncPeakSchedule;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetSyncPeakSchedule
+//
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::SetSyncPeakSchedule(TInt aSchedule)
+	{
+	if (aSchedule != iSyncPeakSchedule)
+		{
+		iSyncPeakSchedule = aSchedule;
+		iSettingChanged = ETrue;
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SyncOffPeakSchedule
+//
+// -----------------------------------------------------------------------------
+//
+
+TInt CAspSchedule::SyncOffPeakSchedule()
+	{
+	return iSyncOffPeakSchedule;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetSyncOffPeakSchedule
+//
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::SetSyncOffPeakSchedule(TInt aSchedule)
+	{
+	if (aSchedule != iSyncOffPeakSchedule)
+		{
+		iSyncOffPeakSchedule = aSchedule;
+		iSettingChanged = ETrue;
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::AutoSyncScheduleTime
+//
+// -----------------------------------------------------------------------------
+//
+
+TTime CAspSchedule::AutoSyncScheduleTime()
+	{
+	TDateTime time(0, EJanuary, 0, iAutoSyncScheduleTimeHr, iAutoSyncScheduleTimeMin, 0, 0);
+	TTime scheduleTime(time);
+	return scheduleTime;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetAutoSyncScheduleTime
+//
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::SetAutoSyncScheduleTime(TTime aSchedule)
+	{
+	TDateTime schedule  = aSchedule.DateTime();
+	
+	//To do- check value
+	if (iAutoSyncScheduleTimeHr != schedule.Hour() || iAutoSyncScheduleTimeMin != schedule.Minute())
+		{
+		iAutoSyncScheduleTimeHr = schedule.Hour();
+		iAutoSyncScheduleTimeMin = schedule.Minute();
+		iSettingChanged = ETrue;
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::RoamingAllowed
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSchedule::RoamingAllowed()
+	{
+	return iRoamingAllowed;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetRoamingAllowed
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SetRoamingAllowed(TBool aRoamingAllowed)
+	{
+	iRoamingAllowed = aRoamingAllowed;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::Error
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSchedule::Error()
+	{
+	return iError;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetError
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::SetError(TInt aError)
+	{
+	iError = aError;
+	}
+
+
+
+// ----------------------------------------------------------------------------
+// CAspSchedule::UniversalStartTime
+//
+// ----------------------------------------------------------------------------
+//
+TTime CAspSchedule::UniversalStartTime(TInt& aStartHour)
+	{
+	// add two hours to current universal time and 
+	// set minutes to 0 (eg. 13:45 -> 15:00)
+    TTime time;
+    time.UniversalTime();
+ 
+    TTimeIntervalHours twoHours(2);
+    time += twoHours;
+	
+    TDateTime dateTime = time.DateTime();
+    dateTime.SetMinute(0);
+   	dateTime.SetSecond(0);
+	dateTime.SetMicroSecond(0);
+
+	aStartHour = dateTime.Hour();  // return start hour to caller
+	
+    TTime time2(dateTime);
+    return time2;
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSchedule::LocalStartTime
+//
+// ----------------------------------------------------------------------------
+//
+TTime CAspSchedule::LocalStartTime(TInt aStartHour)
+	{
+	TTime time;
+	time.HomeTime();
+	
+	TDateTime dateTime = time.DateTime();
+	dateTime.SetMinute(0);
+	dateTime.SetSecond(0);
+	dateTime.SetMicroSecond(0);
+	dateTime.SetHour(aStartHour);
+	
+	TTime time2(dateTime); 
+	TTime now;
+	now.HomeTime();
+	if (now > time2)
+		{
+	    TTimeIntervalDays oneDay(1);
+	    time2 += oneDay;
+		}
+		
+	return time2;
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSchedule::IsDaySelected
+//
+// ----------------------------------------------------------------------------
+//
+TBool CAspSchedule::IsDaySelected(TTime aTime)
+	{
+	TDay day = aTime.DayNoInWeek();
+	TBool ret = WeekdayEnabled(day);
+
+	return ret;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::UpdateSyncScheduleL
+// Called when any auto sync setting is changed
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::UpdateSyncScheduleL()
+	{
+	FLOG( _L("CAspSchedule::UpdateSyncScheduleL START") );
+	
+	CAspSyncSchedule* schedule = CAspSyncSchedule::NewLC();
+	
+	TInt profileId      = ProfileId();
+	TBool contentStatus = IsContentSelected();
+		    
+   	if (profileId == KErrNotFound || !contentStatus)
+		{
+		SetDailySyncEnabled(EFalse);
+		SetPeakSyncEnabled(EFalse);
+		SetOffPeakSyncEnabled(EFalse);
+		schedule->DeleteScheduleL(this);
+		CleanupStack::PopAndDestroy(schedule);
+		return;
+		}
+
+   	if (!IsAutoSyncEnabled())
+   		{
+		//Manual Sync selected ---->Delete schedule, if exists
+	 	 schedule->DeleteScheduleL(this);
+    	}
+   	else
+   		{
+   		if (iDailySyncEnabled)
+   			{
+			//Daily sync enabled ,use peak scheduling with intervals more than a day
+	  	 	schedule->DeleteScheduleL(this);
+			SetDailySyncEnabled(ETrue);
+			schedule->CreatePeakScheduleL(this);
+			}
+  		else
+   			{
+   		 	if (iPeakSyncEnabled != 0 && iOffPeakSyncEnabled ==0)
+  				{
+  				//Only peak sync enabled
+	  	 		schedule->DeleteScheduleL(this);
+				SetPeakSyncEnabled(ETrue);
+				schedule->CreatePeakScheduleL(this);
+				}
+   			else if (iPeakSyncEnabled == 0 && iOffPeakSyncEnabled !=0)
+  				{			
+  				//Only peak sync enabled
+	  			schedule->DeleteScheduleL(this);
+				SetOffPeakSyncEnabled(ETrue);
+				schedule->CreateOffPeakScheduleL(this);
+				}
+   			else if (iPeakSyncEnabled && iOffPeakSyncEnabled)
+    			{
+      			schedule->DeleteScheduleL(this);
+				SetPeakSyncEnabled(ETrue);
+				SetOffPeakSyncEnabled(ETrue);
+				schedule->CreatePeakScheduleL(this);
+      			schedule->CreateOffPeakScheduleL(this);
+				}   
+   			}
+   		}
+
+  	
+    	CleanupStack::PopAndDestroy(schedule);
+    
+#ifdef _DEBUG
+    
+    CAspSyncSchedule* s = CAspSyncSchedule::NewLC();
+    FLOG( _L("") );
+    LogScheduleL();
+    FLOG( _L("") );
+    s->LogSchedule(this);
+    FLOG( _L("") );
+    CleanupStack::PopAndDestroy(s);
+    
+#endif  //    _DEBUG 
+    
+    FLOG( _L("CAspSchedule::UpdateSyncScheduleL END") );
+	}
+
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::UpdateSyncSchedule
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::UpdateSyncSchedule()
+	{
+	TRAPD(err, UpdateSyncScheduleL());
+	
+	if (err != KErrNone)
+		{
+		FLOG( _L("### CAspSchedule::UpdateSyncScheduleL failed (err=%d) ###"), err );
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::GetStartTimeL
+// -Get next auto sync start time ,peak/off-peak whichever is earlier and enabled
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::GetStartTimeL(TTime& aTime, TBool aHomeTime)
+	{
+
+	CAspSyncSchedule* s = CAspSyncSchedule::NewLC();
+
+	if (iDailySyncEnabled)
+		{
+		s->GetPeakStartTimeL(this, aTime, aHomeTime);
+		}
+	else if (iPeakSyncEnabled != 0 && iOffPeakSyncEnabled ==0)
+		{
+		s->GetPeakStartTimeL(this, aTime, aHomeTime);
+		}
+	else if (iPeakSyncEnabled == 0 && iOffPeakSyncEnabled !=0)
+		{
+		s->GetOffPeakStartTimeL(this, aTime, aHomeTime);
+		}
+	else //peak & off-peak schedules enabled
+		{
+		TTime peakStart;
+		TTime offPeakStart;
+		
+		s->GetPeakStartTimeL(this, peakStart, aHomeTime);
+		s->GetOffPeakStartTimeL(this, offPeakStart, aHomeTime);
+
+		if (peakStart < offPeakStart)
+			{
+			aTime = peakStart;
+			}
+		else
+			{
+			aTime = offPeakStart;
+			}
+		}
+    CleanupStack::PopAndDestroy(s);
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::CanSynchronizeL
+// Check primary auto sync settings
+// -----------------------------------------------------------------------------
+//
+TBool CAspSchedule::CanSynchronizeL()
+	{
+	if (iProfileId == KErrNotFound && iAutoSyncProfileId == KErrNotFound)
+		{
+        FLOG( _L("CAspSchedule::CanSynchronizeL Failed :CP1") );
+		return EFalse;
+		}
+	OpenSyncSessionL();
+	TAspParam param(EApplicationIdSync, &iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+
+	TRAPD (err, profile->OpenL(iProfileId, CAspProfile::EOpenRead, 
+	                           CAspProfile::EBaseProperties));
+	if (err == KErrNotFound)
+		{
+		SetProfileId(KErrNotFound);
+		if (iAutoSyncProfileId != KErrNotFound)
+			{
+			TRAPD (err1, profile->OpenL(iAutoSyncProfileId, CAspProfile::EOpenRead, 
+	                           CAspProfile::EBaseProperties));
+			if (err1 == KErrNotFound)
+				{
+				SetAutoSyncProfileId(KErrNotFound);
+				}
+			}		
+		UpdateSyncSchedule();
+		SaveL();
+		CleanupStack::PopAndDestroy(profile);
+		FLOG( _L("CAspSchedule::CanSynchronizeL Failed :CP2") );
+		return EFalse;
+		}
+	CleanupStack::PopAndDestroy(profile);
+
+	if (!IsContentSelected())
+		{
+		UpdateSyncSchedule();
+		SaveL();
+		FLOG( _L("CAspSchedule::CanSynchronizeL Failed :CP3") );
+		return EFalse;
+		}
+	
+	if (!IsAutoSyncEnabled())
+		{
+        FLOG( _L("CAspSchedule::CanSynchronizeL Failed :CP4") );
+		return EFalse;
+		}
+	
+	return ETrue;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::IsValidPeakScheduleL
+// Check if current time is peak
+// -----------------------------------------------------------------------------
+//
+TInt CAspSchedule::IsValidPeakScheduleL()
+	{
+	//convert all time values to same day and comapre
+	const TInt KPositive = 1;
+	const TInt KZero = 0;
+	const TInt KNegative = -1;
+
+	TTime startPeak = StartPeakTime();
+	TTime endPeak   = EndPeakTime();
+	
+	TInt retVal = 0;
+	TTime now;
+	now.HomeTime();
+	
+	if (!WeekdayEnabled(now.DayNoInWeek()))
+		{
+		retVal = KPositive; 
+		return retVal;
+		}
+
+	TDateTime timenow = now.DateTime();
+	TDateTime date = startPeak.DateTime();
+	TInt nowHr  = timenow.Hour();
+	TInt nowMin = timenow.Minute();
+	TInt day    = date.Day();
+
+    TDateTime time(0, EJanuary, day, nowHr, nowMin, 0, 0);
+	TTime curTime(time);
+	
+	if ( curTime >= startPeak && curTime < endPeak)
+		{
+		retVal =  KZero; //In peak period
+		}
+	else if (curTime < startPeak)
+		{
+		retVal = KPositive;
+		}
+	else if (curTime > endPeak)
+		{
+		retVal = KNegative;
+		}
+    
+    return retVal;
+	
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::IsValidOffPeakScheduleL
+// Check if the current time off-peak
+// -----------------------------------------------------------------------------
+//
+
+TInt CAspSchedule::IsValidOffPeakScheduleL()
+	{
+	//convert all time values to same day and comapre
+	const TInt KPositive = 1;
+	const TInt KZero = 0;
+		
+	TTime startOffPeak = EndPeakTime()+ (TTimeIntervalMinutes)1;
+	TTime endOffPeak   = StartPeakTime() + (TTimeIntervalDays)1 -(TTimeIntervalMinutes)1 ;
+	TInt retVal = 0;
+	TTime now;
+	now.HomeTime();
+
+	if (!WeekdayEnabled(now.DayNoInWeek()))
+		{
+		retVal = KZero; 
+		return retVal;
+		}
+
+	TDateTime timenow = now.DateTime();
+	TDateTime date = startOffPeak.DateTime();
+	TInt nowHr  = timenow.Hour();
+	TInt nowMin = timenow.Minute();
+	TInt day    = date.Day();
+
+    TDateTime time(0, EJanuary, day, nowHr, nowMin, 0, 0);
+	TTime curTime(time);
+	
+	if (curTime < StartPeakTime() || (curTime >= startOffPeak && curTime < endOffPeak ))
+		{
+		retVal = KZero; 
+		}
+	else if (curTime < startOffPeak)
+		{
+		retVal = KPositive;		
+		}
+	
+	return retVal;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::IsValidNextPeakScheduleL
+// -Add sync interval to current time and checks if the next schedule will be in peak period.
+// -otherwise sync can be postponed until next peak start
+// -----------------------------------------------------------------------------
+//
+TBool CAspSchedule::IsValidNextPeakScheduleL()
+	{
+	//convert all time vakues to same day and compare
+	TTime startPeak = StartPeakTime();
+	TTime endPeak   = EndPeakTime();
+	
+	TTime now;
+	now.HomeTime();
+
+	CAspSyncSchedule* syncSchedule = CAspSyncSchedule::NewLC();
+	TInt interval = SyncPeakSchedule();
+    TIntervalType intervalType = syncSchedule->IntervalType(interval);
+  	
+	TInt intervalVal = syncSchedule->Interval(interval);
+
+	if (interval == EInterval15Mins
+				|| interval == EInterval30Mins)
+		{
+		now = now + (TTimeIntervalMinutes)intervalVal;
+		}
+	else if (intervalType == EHourly)
+		{
+		now = now + (TTimeIntervalHours)intervalVal;
+		}
+		
+	CleanupStack::PopAndDestroy(syncSchedule);	
+	if (!WeekdayEnabled(now.DayNoInWeek()))
+		{
+		return EFalse;
+		}
+	TDateTime timenow = now.DateTime();
+	TDateTime date = startPeak.DateTime();
+	TInt nowHr  = timenow.Hour();
+	TInt nowMin = timenow.Minute();
+	TInt day    = date.Day();
+
+    TDateTime time(0, EJanuary, day, nowHr, nowMin, 0, 0);
+	TTime nextPeakSync(time);
+	
+	if ( nextPeakSync >= startPeak && nextPeakSync < endPeak)
+		{
+		return ETrue; //In peak period
+		}
+
+	return EFalse;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::IsValidNextOffPeakScheduleL
+// -Add sync interval to current time and checks if the next schedule will be in off-peak period.
+// -otherwise sync can be postponed until next off-peak start
+// -----------------------------------------------------------------------------
+//
+TBool CAspSchedule::IsValidNextOffPeakScheduleL()
+	{
+
+    TTime startOffPeak = EndPeakTime()+ (TTimeIntervalMinutes)1;
+	TTime endOffPeak   = StartPeakTime() + (TTimeIntervalDays)1 -(TTimeIntervalMinutes)1 ;
+	
+	TTime now;
+	now.HomeTime();
+
+	CAspSyncSchedule* syncSchedule = CAspSyncSchedule::NewLC();
+	TInt interval = SyncOffPeakSchedule();
+    TIntervalType intervalType = syncSchedule->IntervalType(interval);
+  	
+	TInt intervalVal = syncSchedule->Interval(interval);
+
+	if (interval == EInterval15Mins
+				|| interval == EInterval30Mins)
+		{
+		now = now + (TTimeIntervalMinutes)intervalVal;
+		}
+	else if (intervalType == EHourly)
+		{
+		now = now + (TTimeIntervalHours)intervalVal;
+		}
+		
+	CleanupStack::PopAndDestroy(syncSchedule);
+
+	if (!WeekdayEnabled(now.DayNoInWeek()))
+		{
+		return ETrue;
+		}
+	
+	TDateTime timenow = now.DateTime();
+	TDateTime date = startOffPeak.DateTime();
+	TInt nowHr  = timenow.Hour();
+	TInt nowMin = timenow.Minute();
+	TInt day    = date.Day();
+
+    TDateTime time(0, EJanuary, day, nowHr, nowMin, 0, 0);
+	TTime nextOffPeakSync(time);
+
+	if (nextOffPeakSync < StartPeakTime() || (nextOffPeakSync >= startOffPeak && nextOffPeakSync < endOffPeak ))
+		{
+		return ETrue; //in off-peak period
+		}
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::CreateAutoSyncProfileL
+// -Creates a hidden profile that is used for auto sync.
+// -It is created when auto sync is used for first time
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::CreateAutoSyncProfileL()
+	{
+	if (iAutoSyncProfileId != KErrNotFound)
+		{
+		return;			
+		}
+	OpenSyncSessionL();
+
+	TBuf<KBufSize> aBufName(KAutoSyncProfileName);
+	
+	TAspParam param(EApplicationIdSync, &iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+
+	profile->CreateL(CAspProfile::EAllProperties);
+	CAspProfile::SetDefaultValuesL(profile);
+	profile->SetNameL(aBufName);
+	profile->SetSASyncStateL(ESmlDisableSync);
+	profile->SaveL();
+	
+	iAutoSyncProfileId = profile->ProfileId();
+	SaveL();
+	
+	CleanupStack::PopAndDestroy(profile);
+	
+	
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::AutoSyncProfileId
+// -----------------------------------------------------------------------------
+//
+
+TInt CAspSchedule::AutoSyncProfileId()
+	{
+	return iAutoSyncProfileId;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::SetAutoSyncProfileId
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::SetAutoSyncProfileId(TInt aProfileId)
+	{
+	iAutoSyncProfileId = aProfileId;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::CopyAutoSyncContentsL
+// -Copy contents selected in Automatic sync settings view to the profiles content list
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::CopyAutoSyncContentsL()
+	{
+	FLOG( _L("CAspSchedule::CopyAutoSyncContentsL START") );
+	if (iAutoSyncProfileId == KErrNotFound)
+		{
+		return;
+		}
+	OpenSyncSessionL();
+	TAspParam param(EApplicationIdSync, &iSyncSession);
+	
+	param.iMode = CAspContentList::EInitDataProviders;
+	CAspContentList* asContentList = CAspContentList::NewLC(param);		
+	
+	CAspProfile* profile = CAspProfile::NewLC(param);
+
+	TRAPD (err, profile->OpenL(iAutoSyncProfileId, CAspProfile::EOpenReadWrite, 
+	                           CAspProfile::EAllProperties));
+	User::LeaveIfError(err);
+
+	asContentList->SetProfile(profile);
+	asContentList->InitAllTasksL();
+		
+	TBool aEnabled;
+	
+	TInt providerCount = asContentList->ProviderCount();
+		
+	for (TInt i= 0; i < providerCount; i++)
+		{
+		if(ContentEnabled(i))
+			{
+			aEnabled = ETrue;
+			}
+		else
+			{
+			aEnabled = EFalse;
+			}
+		TAspProviderItem& provider = asContentList->ProviderItem(i);	
+		if (provider.iDataProviderId != KErrNotFound)
+			{
+			asContentList->ModifyTaskIncludedL(provider.iDataProviderId, aEnabled, KNullDesC);
+			}
+		}
+	CleanupStack::PopAndDestroy(profile);
+	CleanupStack::PopAndDestroy(asContentList);
+	FLOG( _L("CAspSchedule::CopyAutoSyncContentsL END") );
+     
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::UpdateProfileSettingsL
+// -Copy latest settings from profile selected for sync to auto sync profile.
+// -Called before every scheduled sync to get updated settings
+// -Also called when any settings changed
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::UpdateProfileSettingsL()
+	{
+	FLOG( _L("CAspSchedule::UpdateProfileSettingsL START") );
+	if (iProfileId == KErrNotFound || iAutoSyncProfileId == KErrNotFound)
+		{
+		return;
+		}
+	OpenSyncSessionL();
+	TAspParam param(EApplicationIdSync, &iSyncSession);
+
+	param.iMode = CAspContentList::EInitDataProviders;
+			
+	CAspContentList* asContentList = CAspContentList::NewL(param);
+	CleanupStack::PushL(asContentList);
+	CAspContentList* contentList = CAspContentList::NewL(param);
+	CleanupStack::PushL(contentList);
+	
+    CAspProfile* selectedProfile = CAspProfile::NewLC(param);
+    selectedProfile->OpenL(iProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+
+	CAspProfile* autosyncProfile = CAspProfile::NewLC(param);
+	autosyncProfile->OpenL(iAutoSyncProfileId, CAspProfile::EOpenReadWrite, CAspProfile::EAllProperties);
+
+	autosyncProfile->CopyValuesL(selectedProfile);
+	autosyncProfile->SetSASyncStateL(ESmlDisableSync);
+	autosyncProfile->SaveL();
+
+    //Copy database names.
+    contentList->SetProfile(selectedProfile);
+	contentList->InitAllTasksL();
+	
+	TBuf<KBufSize> aLocalDatabase;
+	TBuf<KBufSize> aRemoteDatabase;
+	TInt aSyncDirection;
+	TBool aTaskEnabled;
+	
+	asContentList->SetProfile(autosyncProfile);
+	asContentList->InitAllTasksL();
+	
+	TInt providerCount = asContentList->ProviderCount();
+	
+ 	for (TInt i= 0; i < providerCount; i++)
+		{
+		TAspProviderItem& provider = asContentList->ProviderItem(i);
+			
+		contentList->ReadTaskL(provider.iDataProviderId, aLocalDatabase, aRemoteDatabase,
+		                    aTaskEnabled, aSyncDirection);
+		
+		
+		if(ContentEnabled(i))
+			{
+			aTaskEnabled = ETrue;
+			}
+		else
+			{
+			aTaskEnabled = EFalse;
+			}
+
+		if (provider.iDataProviderId == KUidNSmlAdapterEMail.iUid)
+			{
+			if (!MailboxExistL())
+				{
+				continue;
+				}
+			RSyncMLDataProvider provider;
+			TInt err;
+			TRAP(err, provider.OpenL(iSyncSession, KUidNSmlAdapterEMail.iUid));
+			aLocalDatabase = provider.DefaultDataStoreName();
+			}
+		
+		if (aTaskEnabled)
+			{		
+			TBuf<KBufSize> asLocaldb;
+			TBuf<KBufSize> asRemotedb;
+			TBool asTask;
+			TInt asDirection;
+		
+			asContentList->ReadTaskL(provider.iDataProviderId,asLocaldb,asRemotedb,
+													asTask,asDirection);
+													
+		    if (asLocaldb != aLocalDatabase || asRemotedb != aRemoteDatabase ||
+		    					asTask != aTaskEnabled || asDirection != aSyncDirection )
+		    	{
+		    	TRAPD(err,	asContentList->CreateTaskL(provider.iDataProviderId, aLocalDatabase, aRemoteDatabase,
+	                              aTaskEnabled, aSyncDirection));
+		    	User::LeaveIfError(err);
+		    	}
+			}
+	
+		}
+	CleanupStack::PopAndDestroy(autosyncProfile);
+	CleanupStack::PopAndDestroy(selectedProfile);
+	
+	CleanupStack::PopAndDestroy(contentList);
+	CleanupStack::PopAndDestroy(asContentList);
+	FLOG( _L("CAspSchedule::UpdateProfileSettingsL END") );
+	
+   }
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::UpdatePeakSchedule
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::UpdatePeakScheduleL()
+	{
+	//Today's peak time ended ,postpone the peak scheduling until tomorrow peak start time
+	CAspSyncSchedule* syncSchedule = CAspSyncSchedule::NewLC();
+    TIntervalType intervalType = syncSchedule->IntervalType(SyncPeakSchedule());
+    if(intervalType == EDaily )
+    	{
+		CleanupStack::PopAndDestroy(syncSchedule);
+		return;
+		}
+	syncSchedule->UpdatePeakScheduleL(this);
+	CleanupStack::PopAndDestroy(syncSchedule);		
+
+    }
+// -----------------------------------------------------------------------------
+// CAspSchedule::UpdateOffPeakSchedule
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::UpdateOffPeakScheduleL()
+	{
+	//postpone the off-peak scheduling until tomorrow off-peak start time
+	CAspSyncSchedule* syncSchedule = CAspSyncSchedule::NewLC();
+    TIntervalType intervalType = syncSchedule->IntervalType(SyncOffPeakSchedule());
+    if (intervalType == EDaily )
+    	{
+		CleanupStack::PopAndDestroy(syncSchedule);
+		return;
+		}
+	syncSchedule->UpdateOffPeakScheduleL(this);
+	CleanupStack::PopAndDestroy(syncSchedule);		
+
+    }
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::EnableSchedule
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::EnableScheduleL()
+	{
+	if ( iPeakScheduleHandle == KErrNotFound && iOffPeakScheduleHandle == KErrNotFound)
+		{
+		return;
+		}
+	CAspSyncSchedule* syncSchedule = CAspSyncSchedule::NewLC();
+	syncSchedule->EnableSchedule(this);
+	CleanupStack::PopAndDestroy(syncSchedule);		
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::UpdateOffPeakSchedule
+// -----------------------------------------------------------------------------
+//
+TIntervalType CAspSchedule::IntervalType(TInt aInterval)
+	{
+	if (aInterval == EInterval24hours
+			  || aInterval == EInterval2days
+			  || aInterval == EInterval4days
+			  || aInterval == EInterval7days
+			  || aInterval == EInterval14days
+			  || aInterval == EInterval30days)
+		{
+		return EDaily;
+		}
+		
+	return EHourly;
+	}
+
+// ----------------------------------------------------------------------------
+// CAspSchedule::MailboxExistL()
+// Return ETrue if any mail box exists, EFlase otherwise
+// ----------------------------------------------------------------------------
+//
+TBool CAspSchedule::MailboxExistL()
+	{
+	OpenSyncSessionL();
+	TBool mailboxExist = EFalse;
+	TAspParam param(EApplicationIdSync, &iSyncSession);
+	param.iMode = CAspContentList::EInitDataProviders;
+	CAspContentList* contentList = CAspContentList::NewL(param);
+	CleanupStack::PushL(contentList);
+	// get email syncml mailboxes
+   	CDesCArray* localDataStores = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
+	CleanupStack::PushL(localDataStores);
+	contentList->GetLocalDatabaseList(KUidNSmlAdapterEMail.iUid, localDataStores);
+
+    if (localDataStores->Count() > 0)
+   		{
+   		mailboxExist = ETrue;
+   		}
+
+	CleanupStack::PopAndDestroy(localDataStores);
+	CleanupStack::PopAndDestroy(contentList);
+
+	return mailboxExist;
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSchedule::ProtocolL()
+// Return server protocol version 
+// ----------------------------------------------------------------------------
+//
+TInt CAspSchedule::ProtocolL()
+	{
+	OpenSyncSessionL();
+	TAspParam param(EApplicationIdSync, &iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+	profile->OpenL(iProfileId, CAspProfile::EOpenRead,
+                                         CAspProfile::EBaseProperties);
+	TInt protocol = profile->ProtocolVersion();
+	CleanupStack::PopAndDestroy(profile);
+	return protocol;
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSchedule::IsAutoSyncEnabled()
+// Return ETrue if autosync enable ,EFalse otherwise 
+// ----------------------------------------------------------------------------
+//
+TBool CAspSchedule::IsAutoSyncEnabled()
+	{
+	if (iDailySyncEnabled || iPeakSyncEnabled || iOffPeakSyncEnabled)
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::OpenSyncSessionL
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::OpenSyncSessionL()
+	{
+	if (!iSyncSessionOpen)
+		{
+        TRAPD(err, iSyncSession.OpenL());
+        
+        if (err != KErrNone)
+        	{
+        	FLOG( _L("### CAspSchedule: RSyncMLSession::OpenL failed (%d) ###"), err );
+        	User::Leave(err);
+        	}
+
+		iSyncSessionOpen = ETrue;
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::CloseSyncSession
+// -----------------------------------------------------------------------------
+//
+
+void CAspSchedule::CloseSyncSession()
+	{
+	if (iSyncSessionOpen)
+		{
+		iSyncSession.Close();
+		iSyncSessionOpen = EFalse;
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::CheckMandatoryData
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspSchedule::CheckMandatoryDataL(TInt& count,TInt& firstItem)
+	{
+	FLOG( _L("CAspSchedule::CheckMandatoryDataL START") );
+	OpenSyncSessionL();
+    TAspParam param(EApplicationIdSync, &iSyncSession);
+
+    CAspProfile* profile = CAspProfile::NewLC(param);
+    profile->OpenL(iProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+    
+	param.iProfile = profile;
+	param.iMode = CAspContentList::EInitAll;
+	CAspContentList* list = CAspContentList::NewLC(param);
+
+   	TInt index = 0;
+	count = 0;
+	firstItem = 0;
+	
+	TInt providerCount = list->ProviderCount();
+	
+	for (TInt i= 0; i < providerCount; i++)
+		{
+		if (ContentEnabled(i))
+			{
+			FLOG( _L("Content Id : %d"),i );
+			TAspProviderItem& provider = list->ProviderItem(i);	
+			index = list->FindTaskIndexForProvider(provider.iDataProviderId);
+			if (index == KErrNotFound )
+				{
+				FLOG( _L("Index not found , Id : %d"),i );
+				count++;
+				if(count == 1)
+					{
+					firstItem = i;
+					}
+				continue;
+				}
+			TAspTaskItem& task = list->TaskItem(index);
+			if (provider.iDataProviderId == KUidNSmlAdapterEMail.iUid)
+				{
+				if(!task.iRemoteDatabaseDefined || !task.iLocalDatabaseDefined)
+					{
+					count++;
+					if(count == 1)
+						{
+						firstItem = i;
+						}
+					}
+				}
+			else
+				{
+				if (!task.iRemoteDatabaseDefined)
+					{
+					count++;
+					if(count == 1)
+						{
+						firstItem = i;
+						}
+					}
+				}
+			}
+			}
+		
+	CleanupStack::PopAndDestroy(list);
+	CleanupStack::PopAndDestroy(profile);
+	
+	if (count)
+		{
+		return EFalse;
+		}
+
+	FLOG( _L("CAspSchedule::CheckMandatoryDataL END") );
+	return ETrue;
+
+   }
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::ShowAutoSyncLogL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::ShowAutoSyncLogL()
+	{
+	FLOG( _L("CAspSchedule::ShowAutoSyncLogL START") );
+	OpenSyncSessionL();
+    TAspParam param(EApplicationIdSync, &iSyncSession);
+	param.iProfileId = iProfileId;
+
+	CAspProfile* asProfile = CAspProfile::NewLC(param);
+	asProfile->OpenL(iAutoSyncProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+	
+	CAspProfile* profile = CAspProfile::NewLC(param);
+	profile->OpenL(iProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+
+	if (asProfile->LastSync() > profile->LastSync())
+		{
+		param.iProfileId = iAutoSyncProfileId;
+		}
+	CleanupStack::PopAndDestroy(profile);
+	CleanupStack::PopAndDestroy(asProfile);
+	
+    CAspLogDialog* dialog = CAspLogDialog::NewL(param);
+    CleanupStack::PushL(dialog);
+        
+    dialog->ShowDialogL();
+        
+    CleanupStack::PopAndDestroy(dialog);
+	FLOG( _L("CAspSchedule::ShowAutoSyncLogL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::UpdateServerIdL
+// Do server id modifications so that SAN selectes correct profile instead of hidden
+// auto sync profile.
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::UpdateServerIdL()
+	{
+	FLOG( _L("CAspSchedule::ClearAutoSyncProfileServerL START") );
+	OpenSyncSessionL();
+	TAspParam param(EApplicationIdSync, &iSyncSession);
+		
+	CAspProfile* asprofile = CAspProfile::NewLC(param);
+	TRAPD (err, asprofile->OpenL(iAutoSyncProfileId, CAspProfile::EOpenReadWrite, 
+	                           CAspProfile::EAllProperties));
+	User::LeaveIfError(err);
+
+	CAspProfile* profile = CAspProfile::NewLC(param);
+	TRAPD (err1, profile->OpenL(iProfileId, CAspProfile::EOpenReadWrite, 
+	                           CAspProfile::EAllProperties));
+	User::LeaveIfError(err1);
+
+	asprofile->GetServerId(iBuf);
+	profile->SetServerIdL(iBuf);
+	asprofile->SetServerIdL(KNullDesC);
+	profile->SaveL();
+	asprofile->SaveL();
+	
+	CleanupStack::PopAndDestroy(profile);
+	CleanupStack::PopAndDestroy(asprofile);
+	FLOG( _L("CAspSchedule::ClearAutoSyncProfileServerL END") );
+	}
+// -----------------------------------------------------------------------------
+// CAspSchedule::IsContentSelected
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSchedule::IsContentSelected()
+	{
+	TInt selectedContentCnt = 0;
+	TInt selectedContentIndex = 0;
+	
+	ContentSelectionInfo(selectedContentCnt, selectedContentIndex);
+	if (selectedContentCnt)
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+
+#ifdef _DEBUG
+
+void CAspSchedule::LogSettings()
+	{
+	FLOG( _L("iProfileId   %d"),iProfileId);
+	FLOG( _L("iPeakScheduleHandle   %d"),iPeakScheduleHandle);
+	FLOG( _L("iOffPeakScheduleHandle   %d"),iOffPeakScheduleHandle);
+   	FLOG( _L("iStartPeakTimeHr   %d"),iStartPeakTimeHr);
+	FLOG( _L("iStartPeakTimeMin   %d"),iStartPeakTimeMin);
+	FLOG( _L("iEndPeakTimeHr   %d"),iEndPeakTimeHr);
+	FLOG( _L("iEndPeakTimeMin   %d"),iEndPeakTimeMin);
+	FLOG( _L("iSyncPeakSchedule   %d"),iSyncPeakSchedule);
+	FLOG( _L("iSyncOffPeakSchedule   %d"),iSyncOffPeakSchedule);
+	FLOG( _L("iDailySyncEnabled   %d"),iDailySyncEnabled);
+	FLOG( _L("iPeakSyncEnabled   %d"),iPeakSyncEnabled);
+	FLOG( _L("iOffPeakSyncEnabled   %d"),iOffPeakSyncEnabled);
+    FLOG( _L("iAutoSyncProfileId   %d"),iAutoSyncProfileId);
+    FLOG( _L("iAutoSyncScheduleTimeHr   %d"),iAutoSyncScheduleTimeHr);
+    FLOG( _L("iAutoSyncScheduleTimeMin   %d"),iAutoSyncScheduleTimeMin);
+	
+	
+	}
+
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::LogScheduleL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::LogScheduleL()
+	{
+	TBuf<128> buf; TBuf<128> buf2;
+	
+	FLOG( _L("---- automatic sync settings ----") );
+	
+	TTime time;
+	time.HomeTime();
+    TUtil::GetDateTimeTextL(buf, time);
+    buf2.Format(_L("current time: %S"), &buf);
+    FLOG(buf2);
+    
+    if (PeakSyncEnabled())
+    	{
+    	buf = _L("Peak sync enabled");
+    	}
+   
+    FLOG(buf);
+
+	if (OffPeakSyncEnabled())
+    	{
+    	buf = _L("Off-Peak sync enabled");
+    	}
+    FLOG(buf);
+	 
+    TInt id = ProfileId();
+    FLOG(_L("profile id: %d"), id);
+    
+    LogSyncInterval();
+    LogSyncDays();
+
+#if 0   
+    if (RoamingAllowed())
+    	{
+    	buf = _L("roaming allowed: yes");
+    	}
+    else
+    	{
+    	buf = _L("roaming allowed: no");
+       	}
+    FLOG(buf);
+#endif
+    FLOG( _L("---- automatic sync settings ----") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::LogSyncDays
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::LogSyncDays()
+	{
+	TBuf<128> buf; TBuf<128> buf2;
+	
+	buf = KNullDesC;
+	
+	if (WeekdayEnabled(EMonday))
+    	{
+    	buf.Append(_L("monday "));
+    	}
+	if (WeekdayEnabled(ETuesday))
+    	{
+    	buf.Append(_L("tuesday "));
+    	}
+	if (WeekdayEnabled(EWednesday))
+    	{
+    	buf.Append(_L("wednesday "));
+    	}
+	if (WeekdayEnabled(EThursday))
+    	{
+    	buf.Append(_L("thursday "));
+    	}
+	if (WeekdayEnabled(EFriday))
+    	{
+    	buf.Append(_L("friday "));
+    	}
+	if (WeekdayEnabled(ESaturday))
+    	{
+    	buf.Append(_L("saturday "));
+    	}
+	if (WeekdayEnabled(ESunday))
+    	{
+    	buf.Append(_L("sunday "));
+    	}
+	if (buf.Length() == 0)
+    	{
+    	buf.Append(_L("none"));
+    	}
+
+    buf2.Format(_L("sync days: %S"), &buf);
+    FLOG(buf2);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::LogSyncInterval
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::LogSyncInterval()
+	{
+	TBuf<128> buf; TBuf<128> buf2;
+	
+	switch (iSyncPeakSchedule)
+		{
+		case CAspSchedule::EIntervalManual:
+		    buf = _L("Manual");
+		    break;
+		case CAspSchedule::EInterval15Mins:
+		    buf = _L("15 minutes");
+		    break;
+		case CAspSchedule::EInterval30Mins:
+		    buf = _L("30 minutes");
+		    break;
+		case CAspSchedule::EInterval1hour:
+		    buf = _L("1 hour");
+		    break;
+		case CAspSchedule::EInterval2hours:
+		    buf = _L("2 hours");
+		    break;
+		case CAspSchedule::EInterval4hours:
+		    buf = _L("4 hours");
+		    break;
+		case CAspSchedule::EInterval8hours:
+		    buf = _L("8 hours");
+		    break;
+		case CAspSchedule::EInterval12hours:
+		    buf = _L("12 hours");
+		    break;
+		case CAspSchedule::EInterval24hours:
+		    buf = _L("24 hours");
+		    break;
+		case CAspSchedule::EInterval2days:
+		    buf = _L("2 days");
+		    break;
+		case CAspSchedule::EInterval4days:
+		    buf = _L("4 days");
+		    break;
+		case CAspSchedule::EInterval7days:
+		    buf = _L("7 days");
+		    break;
+		case CAspSchedule::EInterval14days:
+		    buf = _L("14 days");
+		    break;
+		case CAspSchedule::EInterval30days:
+		    buf = _L("30 days");
+		    break;
+		default:
+		    buf = _L("unknown sync interval");
+		    break;
+		}
+		
+    buf2.Format(_L("sync interval: %S"), &buf);
+    FLOG(buf2);
+    }
+
+#endif  // _DEBUG
+
+
+#ifdef _DEBUG
+
+
+// ----------------------------------------------------------------------------
+// CAspSchedule::PrintTimeL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSchedule::PrintTimeL(TTime aTime)
+	{
+	TBuf<128> buf;
+	TUtil::GetDateTimeTextL(buf, aTime);
+	TDialogUtil::ShowInformationQueryL(buf);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::TestL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::TestL()
+	{
+	TRAPD(err, DoTestL());
+	
+	if (err != KErrNone)
+		{
+	    TBuf<KBufSize> buf;
+        buf.Format(_L("TestL failed (%d)"), err);
+        TDialogUtil::ShowErrorNoteL(buf);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSchedule::DoTestL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSchedule::DoTestL()
+	{
+	const TInt KTestCount = 500;
+	
+    TInt err = KErrNone;
+    
+    ResetRepositoryL();
+    
+    CAspSchedule* s = NULL;
+    TInt count = 0;
+    for (; count<KTestCount; count++)
+    	{
+        TRAP(err, InternalizeL());
+        if (err != KErrNone)
+        	{
+        	User::Leave(err);
+        	}
+        
+        if (s)
+        	{
+      		CompareValues(s);
+        	CleanupStack::PopAndDestroy(s);
+        	s = NULL;
+        	}
+
+        TRAP(err, UpdateValuesL(count));
+        if (err != KErrNone)
+        	{
+        	User::Leave(err);
+        	}
+        
+        s = CreateCopyLC();
+        	
+        TRAP(err, ExternalizeL());
+        if (err != KErrNone)
+        	{
+        	User::Leave(err);
+        	}
+     	}
+    	
+    if (s)
+    	{
+    	CleanupStack::PopAndDestroy(s);
+    	}
+    	
+    TBuf<KBufSize> buf;
+    buf.Format(_L("centrep test ok (%d)"), count);
+    TDialogUtil::ShowErrorNoteL(buf);
+    
+    	
+	return;
+	}
+
+
+// ----------------------------------------------------------------------------
+// UpdateValuesL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSchedule::UpdateValuesL(TInt aCount)
+    {
+    TInt num = 100 * aCount;
+    TBool isEven = aCount % 2;
+    
+    iPeakScheduleHandle = num+1;
+	iOffPeakScheduleHandle = num +1;
+  
+    iError          = num+3;
+    
+    iPeakSyncEnabled = isEven;
+	iOffPeakSyncEnabled = isEven;
+    iProfileId = num+4;
+    
+    iRoamingAllowed = isEven;
+    
+	if (isEven)
+    	{
+    	SetWeekdayEnabled(EMonday, ETrue);
+    	SetWeekdayEnabled(ETuesday, ETrue);
+    	SetWeekdayEnabled(EWednesday, ETrue);
+    	SetWeekdayEnabled(EThursday, ETrue);
+    	SetWeekdayEnabled(EFriday, ETrue);
+    	SetWeekdayEnabled(ESaturday, EFalse);
+    	SetWeekdayEnabled(ESunday, EFalse);
+    	}
+    else
+    	{
+    	SetWeekdayEnabled(EMonday, EFalse);
+    	SetWeekdayEnabled(ETuesday, EFalse);
+    	SetWeekdayEnabled(EWednesday, EFalse);
+    	SetWeekdayEnabled(EThursday, EFalse);
+    	SetWeekdayEnabled(EFriday, EFalse);
+    	SetWeekdayEnabled(ESaturday, ETrue);
+    	SetWeekdayEnabled(ESunday, ETrue);
+    	}
+    }
+
+
+// ----------------------------------------------------------------------------
+// CreateCopyLC
+//
+// ----------------------------------------------------------------------------
+//
+CAspSchedule* CAspSchedule::CreateCopyLC()
+    {
+    CAspSchedule* s = CAspSchedule::NewL();
+    CleanupStack::PushL(s);
+    
+    s->iPeakScheduleHandle = iPeakScheduleHandle;
+	s->iOffPeakScheduleHandle = iOffPeakScheduleHandle;
+    s->iError = iError;
+    s->SetProfileId(ProfileId());
+    s->SetPeakSyncEnabled(PeakSyncEnabled());
+    s->SetRoamingAllowed(RoamingAllowed());
+    
+    
+    TBool enabled = EFalse;
+    if (WeekdayEnabled(EMonday))
+    	{
+        enabled = ETrue;    	
+    	}
+    s->SetWeekdayEnabled(EMonday, enabled);    	
+    	
+    enabled = EFalse;
+    if (WeekdayEnabled(ETuesday))
+    	{
+        enabled = ETrue;    	
+    	}
+    s->SetWeekdayEnabled(ETuesday, enabled);    	
+    
+    enabled = EFalse;
+    if (WeekdayEnabled(EWednesday))
+    	{
+        enabled = ETrue;    	
+    	}
+    s->SetWeekdayEnabled(EWednesday, enabled);    	
+    
+    enabled = EFalse;
+    if (WeekdayEnabled(EThursday))
+    	{
+        enabled = ETrue;    	
+    	}
+    s->SetWeekdayEnabled(EThursday, enabled);    	
+    
+    enabled = EFalse;
+    if (WeekdayEnabled(EFriday))
+    	{
+        enabled = ETrue;    	
+    	}
+    s->SetWeekdayEnabled(EFriday, enabled);
+    
+    enabled = EFalse;
+    if (WeekdayEnabled(ESaturday))
+    	{
+        enabled = ETrue;    	
+    	}
+    s->SetWeekdayEnabled(ESaturday, enabled);    	
+    
+    enabled = EFalse;
+    if (WeekdayEnabled(ESunday))
+    	{
+        enabled = ETrue;    	
+    	}
+    s->SetWeekdayEnabled(ESunday, enabled);
+    
+    return s;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CompareValues
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSchedule::CompareValues(CAspSchedule* aSchedule)
+    {
+    CAspSchedule* s = aSchedule;
+    
+    AssertEqual(s->PeakScheduleHandle(), PeakScheduleHandle());
+    AssertEqual(s->OffPeakScheduleHandle(), OffPeakScheduleHandle());
+    AssertEqual(s->Error(), Error());
+    AssertEqual(s->ProfileId(), ProfileId());
+
+	AssertEqual(s->PeakSyncEnabled(), PeakSyncEnabled());
+	AssertEqual(s->OffPeakSyncEnabled(), OffPeakSyncEnabled());
+   
+    AssertEqual(s->RoamingAllowed(), RoamingAllowed());
+    
+    AssertEqual(s->iWeekdayFlags, iWeekdayFlags);    
+  
+    AssertEqual(s->WeekdayEnabled(EMonday), WeekdayEnabled(EMonday));
+    AssertEqual(s->WeekdayEnabled(ETuesday), WeekdayEnabled(ETuesday));
+    AssertEqual(s->WeekdayEnabled(EWednesday), WeekdayEnabled(EWednesday));
+    AssertEqual(s->WeekdayEnabled(EThursday), WeekdayEnabled(EThursday));
+    AssertEqual(s->WeekdayEnabled(EFriday), WeekdayEnabled(EFriday));
+    AssertEqual(s->WeekdayEnabled(ESaturday), WeekdayEnabled(ESaturday));
+    AssertEqual(s->WeekdayEnabled(ESunday), WeekdayEnabled(ESunday));
+    }
+
+
+// ----------------------------------------------------------------------------
+// AssertEqual
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSchedule::AssertEqual(TInt aValue1, TInt aValue2)
+    {
+    __ASSERT_DEBUG(aValue1 == aValue2, TUtil::Panic(KErrArgument));
+    }
+
+#endif  // _DEBUG
+
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspScheduleDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,2807 @@
+/*
+* 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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "AspScheduleDialog.h"
+#include "AspProfileSelectionDialog.h"
+#include "AspSchedule.h"
+#include "AspProfileWizard.h"
+#include "AspSyncUtil.rh"
+#include "AspDebug.h"
+#include <csxhelp/ds.hlp.hrh>
+
+#include <aspsyncutil.mbg>  // for bitmap enumerations
+#include <AknIconArray.h>   // for GulArray
+#include <featmgr.h>   // FeatureManager
+
+#include "AspProfile.h"
+#include "AspContentDialog.h"
+#include "AspSettingViewDialog.h"
+#include <ConnectionUiUtilities.h>    
+#include <cmdefconnvalues.h>
+#include <cmmanager.h>
+const TInt KMSKControlId( CEikButtonGroupContainer::EMiddleSoftkeyPosition );
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// AspScheduleDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+TBool CAspScheduleDialog::ShowDialogL(const TAspParam& aParam)
+	{
+	CAspScheduleDialog* dialog = CAspScheduleDialog::NewL(aParam);
+
+	TBool ret = dialog->ExecuteLD(R_ASP_AUTO_SYNC_DIALOG);
+
+    return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspScheduleDialog::NewL
+//
+// -----------------------------------------------------------------------------
+CAspScheduleDialog* CAspScheduleDialog::NewL(const TAspParam& aParam)
+    {
+    FLOG( _L("CAspScheduleDialog::NewL START") );
+
+    CAspScheduleDialog* self = new (ELeave) CAspScheduleDialog(aParam);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    FLOG( _L("CAspScheduleDialog::NewL END") );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspScheduleDialog::CAspScheduleDialog
+// 
+// -----------------------------------------------------------------------------
+//
+CAspScheduleDialog::CAspScheduleDialog(const TAspParam& aParam)
+	{
+    iSyncSession = aParam.iSyncSession;
+    iApplicationId = aParam.iApplicationId;
+    iProfileList = aParam.iProfileList;
+    iEditMode = aParam.iMode;
+	iProfile = aParam.iProfile;
+	iContentList = aParam.iContentList;
+	iSchedule = aParam.iSchedule;
+
+	iDoCleanUp = EFalse;
+	           
+	__ASSERT_ALWAYS(iProfileList, TUtil::Panic(KErrGeneral));
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrGeneral));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspScheduleDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::ConstructL()
+    {
+    FLOG( _L("CAspScheduleDialog::ConstructL START") );
+	
+	CAknDialog::ConstructL(R_ASP_AUTO_SYNC_DIALOG_MENU);
+
+	iResHandler = CAspResHandler::NewL();
+
+	iSettingEnforcement = TUtil::SettingEnforcementState();
+	
+	iSettingList = new (ELeave) CArrayPtrFlat<CAspListItemData>(KDefaultArraySize);
+
+	if (!iSchedule)
+		{
+		iDoCleanUp = ETrue;
+		iSchedule = CAspSchedule::NewL();
+		}
+    
+    iWeekdayList = iResHandler->ReadDesArrayL(R_ASP_AUTO_SYNC_DAYS_LIST);
+    iContentsList = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
+	// get previous title so it can be restored
+	iStatusPaneHandler = CStatusPaneHandler::NewL(iAvkonAppUi);
+	iStatusPaneHandler->StoreOriginalTitleL();
+	
+    iSettingChanged = EFalse;
+
+	
+	FLOG( _L("CAspScheduleDialog::ConstructL END") );
+    }
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CAspScheduleDialog::~CAspScheduleDialog()
+    {
+    FLOG( _L("CAspScheduleDialog::~CAspScheduleDialog START") );
+
+	delete iResHandler;
+	
+	if (iSettingList)
+		{
+		iSettingList->ResetAndDestroy();
+	    delete iSettingList;
+		}
+	if (iDoCleanUp)
+		{
+		delete iSchedule;
+		}
+    delete iWeekdayList;
+    delete iContentsList;
+	delete iStatusPaneHandler;
+
+    if (iAvkonAppUi)
+    	{
+    	iAvkonAppUi->RemoveFromStack(this);
+    	}
+
+	FLOG( _L("CAspScheduleDialog::~CAspScheduleDialog END") );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::ActivateL
+//
+// Called by system when dialog is activated.
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::ActivateL()
+	{
+    CAknDialog::ActivateL();
+
+	// this cannot be in ConstructL which is executed before dialog is launched
+	iAvkonAppUi->AddToStackL(this);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspContentListDialog::GetHelpContext
+//
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::GetHelpContext(TCoeHelpContext& aContext) const
+	{
+	aContext.iMajor = KUidSmlSyncApp;
+	aContext.iContext = KDS_HLP_SETTINGS;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspScheduleDialog::HandleListBoxEventL
+// 
+// -----------------------------------------------------------------------------
+
+void CAspScheduleDialog::HandleListBoxEventL(CEikListBox* /*aListBox*/,
+                                            TListBoxEvent aEventType)
+	{
+	if( AknLayoutUtils::PenEnabled() )  
+	  {
+	   switch ( aEventType )
+        {
+         case EEventItemSingleClicked:
+              HandleOKL();
+              break;
+         case EEventEnterKeyPressed :
+         case EEventItemDraggingActioned :
+         case EEventPenDownOnItem :
+              break;
+         default:
+              break;
+        }
+		
+	  }
+    
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspScheduleDialog::PreLayoutDynInitL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::PreLayoutDynInitL()
+    {
+    iSettingListBox = (CAknSettingStyleListBox*) ControlOrNull (EAspAutoSyncDialogList);
+    
+   	__ASSERT_ALWAYS(iSettingListBox, TUtil::Panic(KErrGeneral));
+    
+	if(iSettingEnforcement)
+	{
+	ButtonGroupContainer().RemoveCommandFromStack(KMSKControlId,EAknSoftkeyOpen );	
+	HBufC* middleSKText = StringLoader::LoadLC( R_TEXT_SOFTKEY_EMPTY );
+
+    ButtonGroupContainer().AddCommandToStackL(
+        KMSKControlId,
+        EAknSoftkeyEmpty,
+        *middleSKText );
+    CleanupStack::PopAndDestroy( middleSKText );
+	}
+	iSettingListBox->SetListBoxObserver(this);
+	iSettingListBox->CreateScrollBarFrameL(ETrue);
+	iSettingListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+	                 CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto);
+	
+	SetIconsL();
+	
+	// create array of setting items (iSettingList)
+	CreateSettingsListL();
+
+	// add setting headers into listbox
+	UpdateListBoxL(iSettingListBox, iSettingList);
+	
+	if (iEditMode == EDialogModeEditMandatory)
+		{
+		TInt index = CheckMandatoryFields();
+		if (index != KErrNotFound)
+			{
+			iSettingListBox->SetCurrentItemIndexAndDraw(index);
+			}
+		}
+	
+
+	iStatusPaneHandler->SetTitleL(R_ASP_TITLE_AUTOMATIC_SYNC_SETTINGS);
+	iStatusPaneHandler->SetNaviPaneTitleL(KNullDesC);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::SetIconsL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::SetIconsL()
+    {
+    if (!iSettingListBox)
+    	{
+    	return;
+    	}
+ 
+ 	TFileName bitmapName;
+	CAspResHandler::GetBitmapFileName(bitmapName);
+	CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray(KDefaultArraySize);
+	CleanupStack::PushL(icons);
+	
+	icons->AppendL(IconL(KAknsIIDQgnIndiSettProtectedAdd, bitmapName, 
+	                     EMbmAspsyncutilQgn_indi_sett_protected_add,
+	                     EMbmAspsyncutilQgn_indi_sett_protected_add_mask));
+	
+    // delete old icons
+    CArrayPtr<CGulIcon>* arr = iSettingListBox->ItemDrawer()->FormattedCellData()->IconArray();
+    if (arr)
+    	{
+    	arr->ResetAndDestroy();
+	    delete arr;
+	    arr = NULL;
+    	}
+
+	iSettingListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
+	CleanupStack::Pop(icons);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspScheduleDialog::IconL
+// 
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CAspScheduleDialog::IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex)
+	{
+    return TDialogUtil::CreateIconL(aId, aFileName, aFileIndex, aFileMaskIndex);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::DynInitMenuPaneL
+//
+// Called by system before menu is shown.
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane)
+	{
+    if (aResourceID != R_ASP_AUTO_SYNC_DIALOG_MENU_PANE)
+		{
+		return;
+		}
+
+	if (iSettingListBox->Model()->NumberOfItems() == 0) 
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChange);
+		return;
+		}
+
+	CAspListItemData* item = GetItemForIndex(iSettingListBox->CurrentItemIndex());
+	if (item->iHidden == EVisibilityReadOnly)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChange);
+		}
+	
+	if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAknCmdHelp);
+		}
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::ProcessCommandL
+//
+// Handle commands from menu.
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::ProcessCommandL(TInt aCommandId)
+	{
+	HideMenu();
+
+	switch (aCommandId)
+		{
+		case EAknCmdHelp:
+			{
+			
+			TUtil::LaunchHelpAppL(iEikonEnv);
+            break;
+
+			}
+
+		case EAspMenuCmdChange:
+			{				
+    		CAspListItemData* item = GetItemForIndex(iSettingListBox->CurrentItemIndex());
+
+			if (item->iItemType == CAspListItemData::ETypeListYesNo)
+				{
+				// open editor for Yes/No setting
+			/*	if (EditSettingItemListL(*item))
+					{
+					SetVisibility();
+					UpdateListBoxL(iSettingListBox, iSettingList);
+					
+					iSettingChanged = ETrue;
+					}*/
+				}				
+			else
+				{
+				HandleOKL();
+				}
+
+			break;
+			}
+		    
+        case EAspMenuCmdExit:
+        case EAknCmdExit:
+        case EEikCmdExit:
+			{
+			// close dialog and exit calling application
+			iAvkonAppUi->ProcessCommandL(EAknCmdExit);
+			break;
+			}
+
+		default:			
+		    break;
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::OkToExitL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::OkToExitL(TInt aButtonId)
+	{
+	if (aButtonId == EEikBidCancel)
+		{
+    //	TRAP_IGNORE(SaveSettingsL());
+		return ETrue;
+		}
+
+	if (aButtonId == EAknSoftkeyBack)
+        {
+   #if 0
+		TInt mandatoryIndex = CheckMandatoryFields();
+		if (mandatoryIndex != KErrNotFound)
+			{
+			if (!TDialogUtil::ShowConfirmationQueryL(R_ASP_EXIT_ANYWAY))
+				{
+				iSettingListBox->SetCurrentItemIndexAndDraw(mandatoryIndex);
+				return EFalse; // leave dialog open
+				}
+			}
+   #endif
+		if (iSettingChanged)
+			{
+			if(!CheckPeakTime())
+				{
+				HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_INCORRECT_PEAK_TIME);
+				TDialogUtil::ShowInformationNoteL(hBuf->Des());
+				CleanupStack::PopAndDestroy(hBuf);
+				return EFalse;
+				}
+		    TRAPD(err, SaveSettingsL());
+		    if (err == KErrNone)
+			    {
+			    CheckMandatoryDataL();
+		        iSchedule->CopyAutoSyncContentsL();
+				iSchedule->UpdateProfileSettingsL();
+				iSchedule->UpdateSyncSchedule();
+			    iSchedule->SaveL(); // for saving sync schedule id
+			    iSchedule->EnableScheduleL(); 
+			    }
+			}
+		ShowAutoSyncInfoL();
+		return ETrue;
+		}
+		
+	if (aButtonId == EAknSoftkeyOpen || aButtonId == EAknSoftkeyEmpty)  // MSK
+        {
+        HandleOKL();
+		return EFalse;  // leave dialog open
+		}
+	
+	return CAknDialog::OkToExitL(aButtonId);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::OfferKeyEventL
+// 
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspScheduleDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,
+                                                      TEventCode aType)
+	{
+	if (aType == EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+			case EKeyEnter:
+			case EKeyOK:
+				{
+				CAspListItemData* item = 
+				GetItemForIndex(iSettingListBox->CurrentItemIndex());
+     			if (item->iHidden == EVisibilityReadOnly)
+     				{
+     				TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_READ_ONLY);
+  					return EKeyWasConsumed;
+     				}
+		
+				
+				HandleOKL();
+				return EKeyWasConsumed;
+				}
+
+			case EKeyEscape:  // framework calls this when dialog must shut down
+				{
+				return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+        		}
+
+            default:
+				{
+			    break;
+				}
+			}
+		}
+
+	return CAknDialog::OfferKeyEventL( aKeyEvent, aType);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::HandleResourceChange
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::HandleResourceChange(TInt aType)
+    {   
+    if (aType == KEikDynamicLayoutVariantSwitch) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        iSettingListBox->SetSize(mainPaneRect.Size());
+        CCoeControl::HandleResourceChange(aType);
+		DrawDeferred();
+	    return;
+		}
+		
+    if (aType == KAknsMessageSkinChange)
+        {
+        TRAP_IGNORE(SetIconsL());
+        }
+		
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::CheckMandatoryFields
+//
+// Check that all mandatory fields are filled.
+//------------------------------------------------------------------------------
+//
+TInt CAspScheduleDialog::CheckMandatoryFields()
+	{ 
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* item = (*iSettingList)[i];
+			
+		if ( item->iMandatory && item->IsEmpty() && (item->iHidden == EVisibilityNormal) )
+			{
+			return item->iIndex;
+			}
+		}
+
+    return KErrNotFound;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::HandleOKL
+//
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::HandleOKL()
+	{
+	CAspListItemData* item = GetItemForIndex(iSettingListBox->CurrentItemIndex());
+
+	if (item->iHidden == EVisibilityReadOnly)
+		{
+		if(!iSettingEnforcement)
+    	{
+     	TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_READ_ONLY);
+    	}
+     	else
+     	{
+     		TDialogUtil::ShowInformationNoteL(R_ASP_PROTECTED_SETTING);	
+     	}
+		return;
+		}
+
+	if (EditSettingItemL(*item))
+		{
+		SetVisibility();
+		UpdateListBoxL(iSettingListBox, iSettingList);
+		
+		iSettingChanged = ETrue;
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::CreateSettingsListL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::CreateSettingsListL()
+	{
+
+    AddItemL(EAspAutoSyncProfile,R_ASP_SETT_AUTO_SYNC_PROFILE);
+    AddItemL(EAspAutoSyncContents, R_ASP_SETT_AUTO_SYNC_CONTENTS);
+	AddItemL(EAspAutoSyncFrequency, R_ASP_SETT_AUTO_SYNC_FREQ);	
+    AddItemL(EAspAutoSyncPeakSchedule, R_ASP_SETT_AUTO_PEAK_SCHEDULE);
+    AddItemL(EAspAutoSyncOffPeakSchedule, R_ASP_SETT_AUTO_OFF_PEAK_SCHEDULE);
+    AddItemL(EAspAutoSyncScheduleTime, R_ASP_SETT_AUTO_SYNC_TIME);
+	AddItemL(EAspAutoSyncPeakStartTime, R_ASP_SETT_AUTO_PEAK_START);
+    AddItemL(EAspAutoSyncPeakEndTime, R_ASP_SETT_AUTO_PEAK_END);
+	AddItemL(EAspAutoSyncPeakDays, R_ASP_SETT_AUTO_SYNC_DAYS);
+
+//roaming to be implemented later
+#if 0 
+	AddItemL(EAspAutoSyncRoamingStatus, R_ASP_SETTING_AUTO_SYNC_ROAMING_STATUS);
+#endif
+
+	// write setting data into each CAspListItemData
+	TInt count=iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		InitSettingItemL((*iSettingList)[i]);
+		}
+
+	SetVisibility();  // find out what setting appear on UI
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::AddItemL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::AddItemL(TInt aItemId, TInt aResourceId)
+	{
+    CAspListItemData* item = CAspListItemData::NewLC();
+	item->SetHeaderL(aResourceId);
+	item->iItemId = aItemId;
+	iSettingList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::UpdateListBoxL
+// 
+// Add settings headers into listbox.
+// ----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::UpdateListBoxL(CEikTextListBox* aListBox,
+                                        CAspSettingList* aItemList)
+	{
+	CDesCArray* arr = (CDesCArray*)aListBox->Model()->ItemTextArray();
+	arr->Reset();
+
+	TInt count = aItemList->Count();
+	for (TInt i=0; i<count; i++ )
+		{	
+		CAspListItemData* item = (*aItemList)[i];
+		
+		TBool convert = ETrue;
+
+		if (item->iHidden != EVisibilityHidden)
+			{
+			HBufC* hBuf = item->ListItemTextL(convert);
+			CleanupStack::PushL(hBuf);
+			
+			arr->AppendL(hBuf->Des());
+			
+			// store listbox index (from zero up) into setting item 
+			item->iIndex = arr->Count() - 1;
+
+			CleanupStack::PopAndDestroy(hBuf);
+			}
+		else
+			{
+			item->iIndex = KErrNotFound;
+			}
+		}
+
+	iSettingListBox->HandleItemAdditionL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspScheduleDialog::SetVisibility
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::SetVisibility()
+	{
+
+	Item(EAspAutoSyncScheduleTime)->iHidden = EVisibilityHidden;
+	Item(EAspAutoSyncPeakStartTime)->iHidden = EVisibilityHidden;
+	Item(EAspAutoSyncPeakEndTime)->iHidden = EVisibilityHidden;
+	Item(EAspAutoSyncPeakSchedule)->iHidden = EVisibilityHidden;
+	Item(EAspAutoSyncOffPeakSchedule)->iHidden = EVisibilityHidden;
+	Item(EAspAutoSyncPeakDays)->iHidden = EVisibilityHidden;
+
+	if (Item(EAspAutoSyncFrequency)->iNumberData == CAspSchedule::EManyTimesPerDay)
+		{
+		Item(EAspAutoSyncScheduleTime)->iHidden = EVisibilityHidden;
+		Item(EAspAutoSyncPeakSchedule)->iHidden = EVisibilityNormal;
+		Item(EAspAutoSyncOffPeakSchedule)->iHidden = EVisibilityNormal;
+		if (Item(EAspAutoSyncPeakSchedule)->iNumberData || 
+								Item(EAspAutoSyncOffPeakSchedule)->iNumberData)
+			{
+			Item(EAspAutoSyncPeakStartTime)->iHidden = EVisibilityNormal;
+     		Item(EAspAutoSyncPeakEndTime)->iHidden = EVisibilityNormal;
+			Item(EAspAutoSyncPeakDays)->iHidden = EVisibilityNormal;
+			}
+		}
+	if (iSchedule->IntervalType(Item(EAspAutoSyncFrequency)->iNumberData) == EDaily  )
+		{
+		Item(EAspAutoSyncScheduleTime)->iHidden = EVisibilityNormal;
+		}
+	
+	if (iEditMode == EDialogModeReadOnly || iSettingEnforcement)
+    	{
+    	SetAllReadOnly();
+    	}
+ 
+  	}
+
+
+// -----------------------------------------------------------------------------
+// CAspContentDialog::SetAllReadOnly
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::SetAllReadOnly()
+	{
+	TInt count = iSettingList->Count();
+
+	for (TInt i=0; i<count; i++ )
+		{
+		CAspListItemData* item = (*iSettingList)[i];
+		if (item->iHidden != EVisibilityHidden)
+			{
+			item->iHidden = EVisibilityReadOnly;
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspScheduleDialog::InitSettingItemL
+// 
+// Constructs CAspListItemData for one connection setting.
+// -----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::InitSettingItemL(CAspListItemData* aItem)
+	{
+	__ASSERT_ALWAYS(aItem, TUtil::Panic(KErrGeneral));	
+	
+	iBuf = KNullDesC;  // reset common buffer
+	
+	switch (aItem->iItemId)
+		{
+
+		case EAspAutoSyncProfile:
+			{
+			if (!iSchedule->IsAutoSyncEnabled())
+				{
+				aItem->iNumberData = KErrNotFound;
+				}
+			else
+				{
+				aItem->iNumberData = iSchedule->ProfileId();
+				}
+			
+			GetProfileName(aItem->iNumberData, iBuf);
+			aItem->SetValueL(iBuf);
+			aItem->SetDisplayValueL(R_ASP_SETT_VALUE_NOT_DEFINED);
+			aItem->iMandatory = ETrue;
+			aItem->iItemType = CAspListItemData::ETypeAutoSyncProfile;
+			break;
+			}
+		case EAspAutoSyncContents:
+		    {
+			if (!iSchedule->IsAutoSyncEnabled())
+				{
+				SetDefaultContentL();
+				}
+			GetContentsNameL(iBuf);
+			aItem->SetValueL(iBuf);
+			aItem->SetDisplayValueL(R_ASP_SETTING_VALUE_NONE);
+			aItem->iItemType = CAspListItemData::ETypeAutoSyncContent;
+			break;	
+		    }
+		case EAspAutoSyncFrequency:
+			{
+			CDesCArray* arr = GetSyncFrequencyListLC();
+			aItem->iNumberData = iSchedule->SyncFrequency();
+			if (iSchedule->ProfileId() == KErrNotFound || !iSchedule->IsContentSelected()
+															|| !iSchedule->IsAutoSyncEnabled())
+				{
+				aItem->iNumberData = CAspSchedule::EIntervalManual;
+				}
+			TInt currentSelection = GetSyncFrequencyPositionL(arr, aItem->iNumberData); 
+			aItem->SetValueL((*arr)[currentSelection]);
+			aItem->iItemType = CAspListItemData::ETypeAutoSyncFrequency;
+			CleanupStack::PopAndDestroy(arr);
+			break;
+
+			}
+		case EAspAutoSyncPeakSchedule:
+			{
+			CDesCArray* arr = GetPeakScheduleListLC();
+			aItem->iNumberData = iSchedule->SyncPeakSchedule();
+			if (iSchedule->ProfileId() == KErrNotFound || !iSchedule->IsContentSelected()
+														|| !iSchedule->IsAutoSyncEnabled())
+				{
+				aItem->iNumberData = CAspSchedule::EIntervalManual;
+				}
+			TInt currentSelection = GetPeakPositionL(arr, aItem->iNumberData); 
+			aItem->SetValueL((*arr)[currentSelection]);
+			aItem->iItemType = CAspListItemData::ETypeAutoSyncPeakSchedule;
+			CleanupStack::PopAndDestroy(arr);
+			break;
+			}
+		
+		case EAspAutoSyncOffPeakSchedule:
+			{
+			CDesCArray* arr = GetOffPeakScheduleListLC();
+			aItem->iNumberData = iSchedule->SyncOffPeakSchedule();
+			if (iSchedule->ProfileId() == KErrNotFound || !iSchedule->IsContentSelected()
+															|| !iSchedule->IsAutoSyncEnabled())
+				{
+				aItem->iNumberData = CAspSchedule::EIntervalManual;
+				}
+			TInt currentSelection = GetOffPeakPositionL(arr, aItem->iNumberData); 
+			aItem->SetValueL((*arr)[currentSelection]);
+			aItem->iItemType = CAspListItemData::ETypeAutoSyncOffPeakSchedule;
+			CleanupStack::PopAndDestroy(arr);
+			break;
+			}
+		case EAspAutoSyncScheduleTime:
+			{
+			if (iSchedule->DailySyncEnabled())
+				{
+				aItem->iTime = iSchedule->AutoSyncScheduleTime();
+				}
+			else
+				{
+				TTime currentTime;
+				currentTime.HomeTime();
+				aItem->iTime = currentTime;
+				}
+			
+			GetTimeTextL(iBuf, aItem->iTime);  
+			aItem->SetValueL(iBuf);
+			aItem->SetDisplayValueL(R_ASP_SETTING_VALUE_NONE);
+			aItem->iItemType = CAspListItemData::ETypeAutoSyncTime;
+			Item(EAspAutoSyncScheduleTime)->iHidden = EVisibilityHidden;
+			break;
+			}
+		case EAspAutoSyncPeakStartTime:
+			{
+			if (iSchedule->ProfileId() == KErrNotFound || !iSchedule->IsContentSelected()
+													    || !iSchedule->IsAutoSyncEnabled())
+				{
+				TDateTime time(0, EJanuary, 0, KStartPeakHour, KStartPeakMin, 0, 0);
+				TTime startTime(time);
+				aItem->iTime = time;
+				}
+			else
+				{
+				aItem->iTime = iSchedule->StartPeakTime();	
+				}
+
+			GetTimeTextL(iBuf, aItem->iTime);  
+			aItem->SetValueL(iBuf);
+			aItem->SetDisplayValueL(R_ASP_SETTING_VALUE_NONE);
+			aItem->iItemType = CAspListItemData::ETypeAutoSyncTime;
+			break;
+			}
+		case EAspAutoSyncPeakEndTime:
+			{
+			if (iSchedule->ProfileId() == KErrNotFound || !iSchedule->IsContentSelected()
+													    || !iSchedule->IsAutoSyncEnabled())
+				{
+				TDateTime time(0, EJanuary, 0, KEndPeakHour, KEndPeakMin, 0, 0);
+				TTime startTime(time);
+				aItem->iTime = time;
+				}
+			else
+				{
+				aItem->iTime = iSchedule->EndPeakTime();	
+				}
+			GetTimeTextL(iBuf, aItem->iTime);			
+			aItem->SetValueL(iBuf);
+			aItem->SetDisplayValueL(R_ASP_SETTING_VALUE_NONE);
+			aItem->iItemType = CAspListItemData::ETypeAutoSyncTime;
+			break;
+			}
+		case EAspAutoSyncPeakDays:
+			{
+			if (iSchedule->ProfileId() == KErrNotFound || !iSchedule->IsContentSelected()
+													    || !iSchedule->IsAutoSyncEnabled())
+				{
+				SetDefaultdaySelectionL();
+				}
+			GetWeekdayNameL(iBuf);
+			aItem->SetValueL(iBuf);
+			aItem->SetDisplayValueL(R_ASP_SETTING_VALUE_NONE);				
+			aItem->iResource = R_ASP_AUTO_SYNC_DAYS_LIST;
+			aItem->iItemType = CAspListItemData::ETypeAutoSyncDays;
+	   		break;
+			}		 
+		case EAspAutoSyncRoamingStatus:
+			{
+			CDesCArray* arr = iResHandler->ReadDesArrayLC(R_ASP_AUTO_SYNC_ROAMING_YESNO);
+    		
+    		if (iSchedule->RoamingAllowed())
+				{
+				aItem->iNumberData = EAspSettingEnabled;  // 1
+				}
+			else
+				{
+				aItem->iNumberData = EAspSettingDisabled; // 0
+				}
+
+			aItem->iResource = R_ASP_AUTO_SYNC_ROAMING_YESNO;
+			aItem->SetValueL((*arr)[aItem->iNumberData]);
+			aItem->iItemType = CAspListItemData::ETypeListYesNo;
+			
+			CleanupStack::PopAndDestroy(arr);
+            break;
+			}
+        	
+        default:
+           	TUtil::Panic(KErrGeneral);
+			break;
+	
+	  	
+		}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::SaveSettingsL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::SaveSettingsL()
+	{
+   	iBuf = KNullDesC;  // reset common buffer
+   	
+	TInt count = iSettingList->Count();
+
+	if (iSettingEnforcement)
+		{
+		return;
+		}
+	
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* item = (*iSettingList)[i];
+		
+		switch (item->iItemId)
+			{
+			case EAspAutoSyncProfile:
+				{
+				TInt oldProfile = iSchedule->ProfileId();
+				iSchedule->SetProfileId(item->iNumberData);
+				if(oldProfile != iSchedule->ProfileId())
+					{
+                    iSchedule->SaveL(); //Saved values to be used in Update
+					iSchedule->UpdateProfileSettingsL();
+					}
+				break;
+				}
+				
+			case EAspAutoSyncContents:
+			    break;//handled in EditSettingItemContentL  
+			case EAspAutoSyncFrequency:
+				{
+				iSchedule->SetSyncFrequency(item->iNumberData);
+				if (iSchedule->IntervalType(item->iNumberData) == EDaily)
+					{
+					iSchedule->SetDailySyncEnabled(ETrue);
+					}
+				else
+					{
+					iSchedule->SetDailySyncEnabled(EFalse);	
+					}
+
+				}
+			case EAspAutoSyncPeakSchedule:
+				{
+				iSchedule->SetSyncPeakSchedule(item->iNumberData);
+				if(item->iNumberData)
+					{
+					iSchedule->SetPeakSyncEnabled(ETrue);
+					}
+				else
+					{
+					iSchedule->SetPeakSyncEnabled(EFalse);	
+					}
+				break;
+				}
+			case EAspAutoSyncOffPeakSchedule:
+				{
+				iSchedule->SetSyncOffPeakSchedule(item->iNumberData);
+			    if(item->iNumberData)
+					{
+					iSchedule->SetOffPeakSyncEnabled(ETrue);
+					}
+				else
+					{
+					iSchedule->SetOffPeakSyncEnabled(EFalse);	
+					}
+				break;
+				}
+			case EAspAutoSyncScheduleTime:
+			    iSchedule->SetAutoSyncScheduleTime(item->iTime);
+			case EAspAutoSyncPeakStartTime:
+				iSchedule->SetStartPeakTime(item->iTime);
+				break;
+			case EAspAutoSyncPeakEndTime:
+				iSchedule->SetEndPeakTime(item->iTime);
+				break;
+			case EAspAutoSyncPeakDays:
+				 break;//handled in EditSettingItemWeekdaysL
+            case EAspAutoSyncRoamingStatus:
+			    iSchedule->SetRoamingAllowed(item->iNumberData);
+			    break;
+			    
+            default:
+                break;
+			}
+		}
+
+	iSchedule->SaveL();
+	}
+	
+	
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::EditSettingItemL
+//
+// Calls setting editing functions. 
+//------------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::EditSettingItemL(CAspListItemData& aItem)
+	{
+	TInt ret = EFalse;
+	
+	switch (aItem.iItemType)
+		{
+		case CAspListItemData::ETypeText:
+			ret = EditSettingItemTextL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeAutoSyncTime:
+			ret = EditSettingItemTimeL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeAutoSyncFrequency:
+			ret = EditSettingItemSyncFrequencyL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeAutoSyncPeakSchedule:
+			ret = EditSettingItemPeakScheduleL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeAutoSyncOffPeakSchedule:
+			ret = EditSettingItemOffPeakScheduleL(aItem);
+		    break;
+		
+		case CAspListItemData::ETypeAutoSyncProfile:
+			ret = EditSettingItemProfileL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeAutoSyncContent:
+		    ret = EditSettingItemContentL(aItem);
+			break;
+		    
+		case CAspListItemData::ETypeAutoSyncDays:
+			ret = EditSettingItemWeekdaysL(aItem);
+		    break;
+
+		case CAspListItemData::ETypeListYesNo:
+			ret = EditSettingItemYesNoL(aItem);
+		    break;
+
+		default:
+		    break;
+		}
+	
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::EditSettingItemYesNoL
+//
+// Change Yes/No value without showing radio button editor.
+//------------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::EditSettingItemYesNoL(CAspListItemData& aItem)
+	{
+	CDesCArray* arr = iResHandler->ReadDesArrayLC(aItem.iResource);
+	
+	if (aItem.iNumberData == EAspSettingDisabled)
+		{
+		aItem.iNumberData = EAspSettingEnabled;
+		}
+	else
+		{
+		aItem.iNumberData = EAspSettingDisabled;
+		}
+	
+	
+	// store localized setting text (Yes/No)
+	aItem.SetValueL( (*arr)[aItem.iNumberData] );
+
+	CleanupStack::PopAndDestroy(arr);
+	return ETrue;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::EditSettingItemNumberL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::EditSettingItemNumberL(CAspListItemData& aItem)
+	{
+	TBool ret = TDialogUtil::ShowIntegerEditorL(aItem.iNumberData, aItem.Header(),
+	                         aItem.iMinValue, aItem.iMaxValue, aItem.iLatinInput);
+
+	if (ret)
+		{
+		aItem.SetValueL(aItem.iNumberData);
+		}
+
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::EditSettingItemTextL
+//
+// Edit text setting item.
+//------------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::EditSettingItemTextL(CAspListItemData& aItem)
+	{
+	TUtil::StrCopy(iBuf, aItem.Value());
+	
+    TBool ret = TDialogUtil::ShowTextEditorL(iBuf, aItem.Header(),
+                             aItem.iMandatory, aItem.iLatinInput, aItem.iMaxLength);
+   	if (ret)
+		{
+		aItem.SetValueL(iBuf);
+		}
+		
+	return ret;
+	}
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::EditSettingItemSyncFrequencyL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::EditSettingItemSyncFrequencyL(CAspListItemData& aItem)
+	{
+	CDesCArray* arr = GetSyncFrequencyListLC();
+	TInt curSelection = GetSyncFrequencyPositionL(arr, aItem.iNumberData); 
+	TBool ret = TDialogUtil::ShowListEditorL(arr, aItem.Header(), curSelection);
+	if (ret)
+		{
+		aItem.iNumberData = SyncFrequencyL((*arr)[curSelection]); 
+		aItem.SetValueL((*arr)[curSelection]);
+		}
+
+	if (iSchedule->IntervalType(aItem.iNumberData) == EDaily
+					|| aItem.iNumberData == CAspSchedule::EIntervalManual)
+		{
+		Item(EAspAutoSyncPeakSchedule)->iNumberData = CAspSchedule::EIntervalManual;
+		GetPeakScheduleValueL(CAspSchedule::EIntervalManual, iBuf);
+		Item(EAspAutoSyncPeakSchedule)->SetValueL(iBuf);
+		Item(EAspAutoSyncOffPeakSchedule)->iNumberData = CAspSchedule::EIntervalManual;
+		GetPeakScheduleValueL(CAspSchedule::EIntervalManual, iBuf);
+		Item(EAspAutoSyncOffPeakSchedule)->SetValueL(iBuf);
+		}
+		
+	CleanupStack::PopAndDestroy(arr);
+	return ret;
+	}
+
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::EditSettingItemPeakScheduleL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::EditSettingItemPeakScheduleL(CAspListItemData& aItem)
+	{
+
+	CDesCArray* arr = GetPeakScheduleListLC();
+
+	TInt curSelection = GetPeakPositionL(arr, aItem.iNumberData); 
+	TBool ret = TDialogUtil::ShowListEditorL(arr, aItem.Header(), curSelection);
+	if (ret)
+		{
+		aItem.iNumberData = PeakScheduleL((*arr)[curSelection]); 
+		aItem.SetValueL((*arr)[curSelection]);
+		}
+
+	CleanupStack::PopAndDestroy(arr);
+	return ret;
+	}
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::EditSettingItemOffPeakScheduleL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::EditSettingItemOffPeakScheduleL(CAspListItemData& aItem)
+	{
+	
+	CDesCArray* arr = GetOffPeakScheduleListLC();
+
+	TInt curSelection = GetOffPeakPositionL(arr, aItem.iNumberData); 
+	TBool ret = TDialogUtil::ShowListEditorL(arr, aItem.Header(), curSelection);
+	if (ret)
+		{
+		aItem.iNumberData = OffPeakScheduleL((*arr)[curSelection]); ; 
+		aItem.SetValueL((*arr)[curSelection]);
+		}
+	
+	CleanupStack::PopAndDestroy(arr);
+	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::EditSettingItemProfileL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::EditSettingItemProfileL(CAspListItemData& aItem)
+	{
+
+	TAspFilterInfo info;
+    info.iFilterType = TAspFilterInfo::EIncludeRemoteProfile;
+    CAspProfileList* remoteProfList = iProfileList->FilteredListL(info);
+    CleanupStack::PushL(remoteProfList);
+	
+	TInt asProfileId = iSchedule->AutoSyncProfileId();
+	if(asProfileId != KErrNotFound)
+		{
+		remoteProfList->Remove(asProfileId);
+		}
+    TInt curSelection = remoteProfList->ListIndex(aItem.iNumberData);
+    TInt count = remoteProfList->Count();
+   
+    CDesCArray* profileNames = new (ELeave) CDesCArrayFlat(KMaxProfileCount);
+	CleanupStack::PushL(profileNames);
+    for(TInt index = 0; index < count; ++index)
+		{
+		TAspProfileItem& item = remoteProfList->Item(index);
+		GetProfileName(item.iProfileId ,iBuf);
+		profileNames->AppendL(iBuf);
+		}
+	
+	TBool ret = TDialogUtil::ShowListEditorL(profileNames, aItem.Header(), curSelection);
+
+	if (ret)
+		{
+		TAspProfileItem& item = remoteProfList->Item(curSelection);
+		aItem.iNumberData = item.iProfileId;
+		GetProfileName(item.iProfileId, iBuf);
+		aItem.SetValueL(iBuf);
+
+		if (aItem.iNumberData != KErrNotFound)
+		{
+	    CheckAccessPointSelectionL(aItem.iNumberData);
+		}
+		}
+	CleanupStack::PopAndDestroy(profileNames);
+	CleanupStack::PopAndDestroy(remoteProfList);
+	return ret;  // ETrue or EFalse
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::EditSettingItemWeekdaysL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::EditSettingItemWeekdaysL(CAspListItemData& aItem)
+	{
+	CAspSelectionItemList* list = new (ELeave) CAspSelectionItemList(1);
+	CleanupStack::PushL(TCleanupItem(CAspSelectionItemList::Cleanup, list));
+	
+	GetWeekdaySelectionL(list);
+
+	CAknCheckBoxSettingPage* dlg = new (ELeave) CAknCheckBoxSettingPage(
+	                                   R_ASP_MULTI_SELECTION_LIST, list);
+	
+   	CleanupStack::PushL(dlg);
+    dlg->SetSettingTextL(aItem.Header());
+	CleanupStack::Pop(dlg);
+
+    TBool ret = dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
+    
+    if (ret)
+    	{
+        SetWeekdaySelectionL(list);
+        GetWeekdayNameL(iBuf);
+        aItem.SetValueL(iBuf);
+    	}
+    
+	CleanupStack::PopAndDestroy(list);
+
+   	return ret;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::EditSettingItemTimeL
+//
+//------------------------------------------------------------------------------
+//
+//
+TBool CAspScheduleDialog::EditSettingItemTimeL(CAspListItemData& aItem)
+	{
+
+	TBool ret = TDialogUtil::ShowTimeEditorL(aItem.iTime, aItem.Header());
+	
+	if (ret)
+		{
+ 		GetTimeTextL(iBuf, aItem.iTime);
+		aItem.SetValueL(iBuf);
+		}
+
+   	return ret;
+	}
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::EditSettingItemContentL
+//
+//------------------------------------------------------------------------------
+//
+//
+TBool CAspScheduleDialog::EditSettingItemContentL(CAspListItemData& aItem)
+	{
+	
+	CAspSelectionItemList* list = new (ELeave) CAspSelectionItemList(1);
+	CleanupStack::PushL(TCleanupItem(CAspSelectionItemList::Cleanup, list));
+
+	TInt emailIndex = iContentList->FindProviderIndex(KUidNSmlAdapterEMail.iUid);
+	if (!iSchedule->MailboxExistL())
+		{
+		iSchedule->SetContentEnabled(emailIndex, EFalse);
+		}
+	
+	TInt profileId = Item(EAspAutoSyncProfile)->iNumberData;
+	if (profileId != KErrNotFound)
+		{
+		TAspParam param(iApplicationId, iSyncSession);
+
+		CAspProfile* profile = CAspProfile::NewLC(param);
+		profile->OpenL(profileId, CAspProfile::EOpenRead,
+                                         CAspProfile::EBaseProperties);
+		TInt protocol = profile->ProtocolVersion();
+		CleanupStack::PopAndDestroy(profile);
+		if (protocol == EAspProtocol_1_1)
+			{
+	  		iSchedule->SetContentEnabled(emailIndex, EFalse);
+			}
+		}
+	GetContentSelectionL(list);
+	
+	//CAknCheckBoxSettingPage* dlg = new (ELeave) CAknCheckBoxSettingPage(
+	//                                   R_ASP_MULTI_SELECTION_LIST, list);
+
+	TAutoSyncSettingPageParam param;
+    param.iCommandId = EAknSoftkeyUnmark;
+   
+    param.iObserver = this;
+    
+
+	CAutoSyncCheckBoxSettingPage* dlg = new (ELeave) CAutoSyncCheckBoxSettingPage(
+	                                   R_ASP_MULTI_SELECTION_LIST, list, param);
+
+	
+   	CleanupStack::PushL(dlg);
+    dlg->SetSettingTextL(aItem.Header());
+
+	CleanupStack::Pop(dlg);
+
+    TBool ret = dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
+	
+	if (ret)
+    	{
+        SetContentSelectionL(list);
+        GetContentsNameL(iBuf);
+        aItem.SetValueL(iBuf);
+    	}
+
+	CleanupStack::PopAndDestroy(list);
+
+   	return ret;
+	
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::CheckAccessPointSelection
+// Check if the selected profile has valid access point
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::CheckAccessPointSelectionL(TInt aProfileId)
+	{
+	
+	CAspProfile* profile = NULL;
+	TAspParam param(iApplicationId, iSyncSession);
+	TBool doCleanUp = EFalse;
+
+	if (iProfile && aProfileId == iProfile->ProfileId())//setting view opened & selected same profile
+		{
+		profile = iProfile;
+		}
+	else
+		{
+		profile = CAspProfile::NewLC(param);//Automatic sync menu opened
+		TRAPD(err, profile->OpenL(aProfileId, CAspProfile::EOpenReadWrite,
+                                         CAspProfile::EAllProperties));
+    	if (err == KErrLocked)
+    		{
+    		CleanupStack::PopAndDestroy(profile);
+    		TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+			return;
+			}
+		doCleanUp = ETrue;
+		}
+
+	TInt accessPoint = profile->AccessPointL();
+	TAspAccessPointItem item;
+    item.iUid = accessPoint;
+	CAspAccessPointHandler* apHandler = CAspAccessPointHandler::NewL(param);
+	CleanupStack::PushL(apHandler);
+
+	TInt ret = apHandler->GetInternetApInfo(item);
+	if (ret == KErrNone)
+	   	{
+			CleanupStack::PopAndDestroy(apHandler);
+			if (doCleanUp)
+				{
+		 		CleanupStack::PopAndDestroy(profile);
+		 		}
+		return;
+	   		}
+		RCmManager cmmgr;
+		cmmgr.OpenL();
+		TCmDefConnValue defConnValue;
+		cmmgr.ReadDefConnL(defConnValue);
+		cmmgr.Close();
+		if(defConnValue.iType == ECmDefConnDestination)
+		{
+			CleanupStack::PopAndDestroy(apHandler);
+			if (doCleanUp)
+		     {
+	 		 CleanupStack::PopAndDestroy(profile);
+	 		 }
+		return;
+		}
+		
+	HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_QUERY_IAP_NO_ASK_ALWAYS);
+	if (!TDialogUtil::ShowConfirmationQueryL(hBuf->Des()))
+	    {
+	  	 CleanupStack::PopAndDestroy(hBuf);
+		 CleanupStack::PopAndDestroy(apHandler);
+	  	 if (doCleanUp)
+		     {
+	 		 CleanupStack::PopAndDestroy(profile);
+	 		 }
+		 return ;// user selected "Always ask" option 
+		}
+	else
+		{
+		item.iUid2 = accessPoint;
+		TInt ret = apHandler->ShowApSelectDialogL(item);
+	
+		if (ret == CAspAccessPointHandler::EAspDialogSelect)
+			{
+			profile->SetAccessPointL(item.iUid);
+			profile->Save();
+			}
+		}	
+		
+	CleanupStack::PopAndDestroy(hBuf);
+	CleanupStack::PopAndDestroy(apHandler);
+		
+	if (doCleanUp)
+	     {
+	 	 CleanupStack::PopAndDestroy(profile);
+		 }
+	return;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::GetProfileName
+//
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::GetProfileName(TInt& aProfileId, TDes& aText)
+	{
+	aText = KNullDesC;
+	
+	TInt index = iProfileList->ListIndex(aProfileId);
+    
+    if (index == KErrNotFound)
+    	{
+    	aProfileId = KErrNotFound;
+        return; // profile does not exist	
+    	}
+    	
+    TAspProfileItem& item = iProfileList->Item(index);
+    aText = item.iProfileName;
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::GetWeekdayNameL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::GetWeekdayNameL(TDes& aText)
+	{
+	const TInt KWeekdayCount = ESunday + 1;
+	
+	aText = KNullDesC;
+	
+	TInt selectedDayCount = 0;
+	TInt selectedDayIndex = 0;
+	
+	iSchedule->SelectedDayInfo(selectedDayCount, selectedDayIndex);
+		
+	if (selectedDayCount == 1)
+		{
+		aText = (*iWeekdayList)[selectedDayIndex];
+		}
+	else if (selectedDayCount == KWeekdayCount)
+		{
+		CAspResHandler::ReadL(aText, R_ASP_SETT_AUTO_SYNC_ALL_DAYS);
+		}
+	else if (selectedDayCount > 1)
+		{
+		CAspResHandler::ReadL(aText, R_ASP_SETT_AUTO_SYNC_SEL_DAYS);
+		}
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::GetWeekdaySelectionL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::GetWeekdaySelectionL(CSelectionItemList* aList)
+	{
+	for (TInt i=EMonday; i<=ESunday; i++)
+		{
+		TBuf<KBufSize> buf((*iWeekdayList)[i]);
+		TBool enabled = iSchedule->WeekdayEnabled(i);
+
+        CSelectableItem* selectableItem =
+                         new (ELeave) CSelectableItem(buf, enabled);
+                         
+        CleanupStack::PushL(selectableItem);
+        selectableItem->ConstructL();
+        aList->AppendL(selectableItem);
+        CleanupStack::Pop(selectableItem);
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::SetWeekdaySelectionL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::SetWeekdaySelectionL(CSelectionItemList* aList)
+	{
+	TInt count = aList->Count();
+	
+	__ASSERT_DEBUG(count == ESunday + 1, TUtil::Panic(KErrGeneral));
+	
+	for (TInt i=0; i<count; i++)
+		{
+		CSelectableItem* selectableItem = (*aList)[i];
+		TBool selected = selectableItem->SelectionStatus();
+		iSchedule->SetWeekdayEnabled(i, selected);
+		}
+	}
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::SetDefaultdaySelectionL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::SetDefaultdaySelectionL()
+	{
+	iSchedule->SetWeekdayEnabled(EMonday,    ETrue);
+   	iSchedule->SetWeekdayEnabled(ETuesday,   ETrue);
+   	iSchedule->SetWeekdayEnabled(EWednesday, ETrue);
+   	iSchedule->SetWeekdayEnabled(EThursday,  ETrue);
+   	iSchedule->SetWeekdayEnabled(EFriday,    ETrue);
+   	iSchedule->SetWeekdayEnabled(ESaturday,  EFalse);
+   	iSchedule->SetWeekdayEnabled(ESunday,    EFalse);
+	}
+
+//-----------------------------------------------------------------------------
+// CAspScheduleDialog::GetItemForIndex
+// 
+// Find item in list position aIndex.
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspScheduleDialog::GetItemForIndex(TInt aIndex)
+	{
+	CAspListItemData* item = NULL;
+	
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iIndex == aIndex)
+			{
+			item = temp;
+			break;
+			}
+		}
+
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+
+//-----------------------------------------------------------------------------
+// CAspScheduleDialog::Item
+// 
+// Find item with aItemId (TAspConnectionSettingItem).
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspScheduleDialog::Item(TInt aItemId)
+	{
+	CAspListItemData* item = NULL;
+
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iItemId == aItemId)
+			{
+			item = temp;
+			break;
+			}
+		}
+	
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspScheduleDialog::GetTimeTextL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::GetTimeTextL(TDes& aText, TTime aTime)
+	{
+	HBufC* hBuf = CAspResHandler::ReadLC(R_QTN_TIME_USUAL_WITH_ZERO);
+    aTime.FormatL(aText, *hBuf);
+    CleanupStack::PopAndDestroy(hBuf);
+	}
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::GetContentsNameL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::GetContentsNameL(TDes& aText)
+	{
+	
+	TInt contentCount = iContentList->ProviderCount();
+	
+	aText = KNullDesC;
+	
+	TInt selectedContentCnt = 0;
+	TInt selectedContentIndex = 0;
+	
+	iSchedule->ContentSelectionInfo(selectedContentCnt, selectedContentIndex);
+		
+	if (selectedContentCnt == contentCount)
+		{
+		CAspResHandler::ReadL(aText, R_ASP_SETT_VALUE_ALL_CONTENTS);
+		}
+	else if (selectedContentCnt > 0)
+		{
+		CAspResHandler::ReadL(aText, R_ASP_SETT_VALUE_SELECTED_CONTENTS);
+		}
+    }
+
+
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::GetContentSelectionL
+// Get selected contents 
+//------------------------------------------------------------------------------
+//
+
+void CAspScheduleDialog::GetContentSelectionL(CSelectionItemList* aList)
+	{
+	
+	TInt providerCount = iContentList->ProviderCount();
+	
+	CreateContentListL();
+	for (TInt index = 0; index < providerCount; index++)
+		{
+		TBuf<KBufSize> buf((*iContentsList)[index]);
+		TBool enabled = iSchedule->ContentEnabled(index);
+
+        CSelectableItem* selectableItem =
+                         new (ELeave) CSelectableItem(buf, enabled);
+                         
+        CleanupStack::PushL(selectableItem);
+        selectableItem->ConstructL();
+        aList->AppendL(selectableItem);
+        CleanupStack::Pop(selectableItem);
+		}
+	}
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::CreateContentList
+// 
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::CreateContentListL()
+	{
+
+	TInt providerCount = iContentList->ProviderCount();
+
+	for (TInt index = 0; index < providerCount; index++)
+		{
+		HBufC* name = NULL;
+		TAspProviderItem& provider = iContentList->ProviderItem(index);
+		name = CAspResHandler::GetContentNameLC(
+		            provider.iDataProviderId, provider.iDisplayName);	
+		//iContentsList->AppendL(provider.iDisplayName);
+		iContentsList->AppendL(*name);
+		CleanupStack::PopAndDestroy();//name
+		}
+	}
+	
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::SetDefaultContentL
+// Set default content selection
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::SetDefaultContentL()
+	{
+	
+	TInt providerCount = iContentList->ProviderCount();
+	
+	for (TInt index = 0; index < providerCount; index++)
+		{
+		TAspProviderItem& provider = iContentList->ProviderItem(index);
+			
+		if (provider.iDataProviderId == KUidNSmlAdapterEMail.iUid)
+			{
+			if (iSchedule->MailboxExistL())
+				{
+				iSchedule->SetContentEnabled(index, ETrue);
+				}
+			else
+				{
+				iSchedule->SetContentEnabled(index, EFalse);
+				}
+
+			if (iSchedule->ProfileId() != KErrNotFound
+		 					&& !iSchedule->ProtocolL())
+				{
+				iSchedule->SetContentEnabled(index, EFalse);
+				}
+			}
+		else
+			{
+			iSchedule->SetContentEnabled(index, ETrue);
+			}
+		}
+	
+	}
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::SetContentSelectionL
+// Set selected contents 
+//------------------------------------------------------------------------------
+//
+	
+void CAspScheduleDialog::SetContentSelectionL(CSelectionItemList* aList)
+	{
+    
+    TInt count = aList->Count();
+
+	for (TInt i=0; i<count; i++)
+		{
+		CSelectableItem* selectableItem = (*aList)[i];
+		TBool selected = selectableItem->SelectionStatus();
+		iSchedule->SetContentEnabled(i, selected);
+		}
+    
+    }
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::GetSyncFrequencyListLC
+// 
+//------------------------------------------------------------------------------
+//
+
+CDesCArray* CAspScheduleDialog::GetSyncFrequencyListLC()
+	{
+	const TInt KScheduleCount = 5;
+	CDesCArray* scheduleList = new (ELeave) CDesCArrayFlat(KScheduleCount);
+	CleanupStack::PushL(scheduleList);
+
+	GetSyncFrequencyValueL(CAspSchedule::EIntervalManual, iBuf);
+	scheduleList->AppendL(iBuf);
+	
+	GetSyncFrequencyValueL(CAspSchedule::EManyTimesPerDay, iBuf);
+	scheduleList->AppendL(iBuf);
+
+	GetSyncFrequencyValueL(CAspSchedule::EInterval24hours, iBuf);
+	scheduleList->AppendL(iBuf);
+	
+	TInt keyVal;
+	TRAPD (err ,ReadRepositoryL(EKeySyncFrequency, keyVal));
+	if (err == KErrNone)
+		{
+		TUint mask = 1;
+		for(TInt schedule = 0; schedule < KScheduleCount; ++schedule)
+			{
+			TInt offsetSyncFreq = 10;
+			if (mask & keyVal)
+				{
+				offsetSyncFreq +=schedule;
+				GetSyncFrequencyValueL(offsetSyncFreq ,iBuf);
+				scheduleList->AppendL(iBuf);		
+				}
+			mask = mask << 1;
+			}
+		}
+	else
+		{
+		//defualt items in the list
+		
+		GetSyncFrequencyValueL(CAspSchedule::EInterval2days, iBuf);
+		scheduleList->AppendL(iBuf);
+
+		GetSyncFrequencyValueL(CAspSchedule::EInterval7days, iBuf);
+		scheduleList->AppendL(iBuf);
+
+		GetSyncFrequencyValueL(CAspSchedule::EInterval30days, iBuf);
+		scheduleList->AppendL(iBuf);
+		
+		}
+	return scheduleList;
+
+	}
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::GetSyncFrequencyValueL
+// 
+//------------------------------------------------------------------------------
+//
+
+void CAspScheduleDialog::GetSyncFrequencyValueL(TInt schedule, TDes& aBuf)
+	{
+	aBuf = KNullDesC;
+	
+	switch(schedule)
+		{
+		case CAspSchedule::EIntervalManual:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_SYNC_FREQ_VALUE_MANUAL);
+			break;
+		case CAspSchedule::EInterval24hours:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_24_HOURS);
+			break;
+		case CAspSchedule::EInterval2days:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_2_DAYS);
+			break;
+		case CAspSchedule::EInterval4days:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_4_DAYS);
+			break;
+		case CAspSchedule::EInterval7days:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_7_DAYS);
+			break;
+		case CAspSchedule::EInterval14days:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_14_DAYS);
+			break;
+		case CAspSchedule::EInterval30days:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_30_DAYS);
+			break;
+		case CAspSchedule::EManyTimesPerDay:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_SYNC_FREQ_MANY_A_DAY);
+			break;
+			
+		default:
+			break;
+		}
+		
+	}
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::PeakSchedule
+// Get sync frequency number from string
+// ----------------------------------------------------------------------------
+//
+TInt CAspScheduleDialog::SyncFrequencyL(const TDesC& aBuf)
+	{
+	       		
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_SYNC_FREQ_VALUE_MANUAL);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EIntervalManual;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_SYNC_FREQ_MANY_A_DAY);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EManyTimesPerDay;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_24_HOURS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval24hours;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_2_DAYS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval2days;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_4_DAYS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval4days;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_7_DAYS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval7days;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_14_DAYS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval14days;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_30_DAYS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval30days;
+			}
+		
+	   	
+    	return KErrNotFound;
+	}
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::GetSyncFrequencyPositionL
+// Get position of selected interval from the interval list
+// ----------------------------------------------------------------------------
+//
+TInt CAspScheduleDialog::GetSyncFrequencyPositionL(CDesCArray* arr, TInt aInterval)
+	{
+	const TInt KScheduleCount = 8;
+	for (TInt i=0; i < KScheduleCount; i++)
+		{
+		if(aInterval == SyncFrequencyL((*arr)[i]))
+		return i;
+		}
+	return KErrNotFound;
+
+	}
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::GetPeakScheduleListLC
+// 
+//------------------------------------------------------------------------------
+//
+
+CDesCArray* CAspScheduleDialog::GetPeakScheduleListLC()
+	{
+	const TInt KScheduleCount = 7;
+	CDesCArray* scheduleList = new (ELeave) CDesCArrayFlat(KScheduleCount);
+	CleanupStack::PushL(scheduleList);
+
+	GetPeakScheduleValueL(CAspSchedule::EIntervalManual, iBuf);
+	scheduleList->AppendL(iBuf);
+
+	TInt keyVal;
+	TRAPD (err,	ReadRepositoryL(EKeyPeakSyncInterval, keyVal));
+	if (err == KErrNone)
+		{
+		TUint mask = 1;
+		for(TInt schedule = 1; schedule <= KScheduleCount; ++schedule)
+			{
+			if (mask & keyVal)
+				{
+				GetPeakScheduleValueL(schedule ,iBuf);
+				scheduleList->AppendL(iBuf);		
+				}
+			mask = mask << 1;
+			}
+		}
+	else
+		{
+		GetPeakScheduleValueL(CAspSchedule::EInterval15Mins, iBuf);
+		scheduleList->AppendL(iBuf);
+
+		GetPeakScheduleValueL(CAspSchedule::EInterval1hour, iBuf);
+		scheduleList->AppendL(iBuf);
+
+		GetPeakScheduleValueL(CAspSchedule::EInterval2hours, iBuf);
+		scheduleList->AppendL(iBuf);
+
+		GetPeakScheduleValueL(CAspSchedule::EInterval4hours, iBuf);
+		scheduleList->AppendL(iBuf);
+
+		GetPeakScheduleValueL(CAspSchedule::EInterval12hours, iBuf);
+		scheduleList->AppendL(iBuf);
+		}
+	return scheduleList;
+
+	}
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::GetPeakScheduleValueL
+// 
+//------------------------------------------------------------------------------
+//
+
+void CAspScheduleDialog::GetPeakScheduleValueL(TInt schedule, TDes& aBuf)
+	{
+	aBuf = KNullDesC;
+	
+	switch(schedule)
+		{
+		case CAspSchedule::EIntervalManual:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_MANUAL);
+			break;
+		case CAspSchedule::EInterval15Mins:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_15_MINS);
+			break;
+		case CAspSchedule::EInterval30Mins:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_30_MINS);
+			break;
+		case CAspSchedule::EInterval1hour:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_1_HOUR);
+			break;
+		case CAspSchedule::EInterval2hours:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_2_HOURS);
+			break;
+		case CAspSchedule::EInterval4hours:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_4_HOURS);
+			break;
+		case CAspSchedule::EInterval8hours:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_8_HOURS);
+			break;
+		case CAspSchedule::EInterval12hours:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_12_HOURS);
+			break;
+				
+		default:
+			break;
+		}
+		
+	}
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::GetOffPeakScheduleListLC
+// 
+//------------------------------------------------------------------------------
+//
+
+CDesCArray* CAspScheduleDialog::GetOffPeakScheduleListLC()
+	{
+	const TInt KScheduleCount = 7;
+	CDesCArray* scheduleList = new (ELeave) CDesCArrayFlat(KScheduleCount);
+	CleanupStack::PushL(scheduleList);
+
+	GetOffPeakScheduleValueL(CAspSchedule::EIntervalManual, iBuf);
+	scheduleList->AppendL(iBuf);
+
+	TInt keyVal;
+	TRAPD (err,	ReadRepositoryL(EKeyOffPeakSyncInterval, keyVal));
+	if (err == KErrNone)
+		{
+		TUint mask = 1;
+		for(TInt schedule = 1; schedule <= KScheduleCount; ++schedule)
+			{
+			if (mask & keyVal)
+				{
+				GetOffPeakScheduleValueL(schedule ,iBuf);
+				scheduleList->AppendL(iBuf);		
+				}
+			mask = mask << 1;
+			}
+		}
+	else
+		{
+		GetOffPeakScheduleValueL(CAspSchedule::EInterval15Mins, iBuf);
+		scheduleList->AppendL(iBuf);
+
+		GetOffPeakScheduleValueL(CAspSchedule::EInterval1hour, iBuf);
+		scheduleList->AppendL(iBuf);
+
+		GetOffPeakScheduleValueL(CAspSchedule::EInterval2hours, iBuf);
+		scheduleList->AppendL(iBuf);
+
+		GetOffPeakScheduleValueL(CAspSchedule::EInterval4hours, iBuf);
+		scheduleList->AppendL(iBuf);
+
+		GetOffPeakScheduleValueL(CAspSchedule::EInterval12hours, iBuf);
+		scheduleList->AppendL(iBuf);
+		}
+	
+	return scheduleList;
+	}
+
+//------------------------------------------------------------------------------
+// CAspScheduleDialog::GetOffPeakScheduleValueL
+// 
+//------------------------------------------------------------------------------
+//
+void CAspScheduleDialog::GetOffPeakScheduleValueL(TInt schedule, TDes& aBuf)
+	{
+	aBuf = KNullDesC;
+	
+	switch(schedule)
+		{
+		case CAspSchedule::EIntervalManual:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_OFF_MANUAL);
+			break;
+		case CAspSchedule::EInterval15Mins:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_OFF_15_MINS);
+			break;
+		case CAspSchedule::EInterval30Mins:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_OFF_30_MINS);
+			break;
+		case CAspSchedule::EInterval1hour:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_OFF_1_HOUR);
+			break;
+		case CAspSchedule::EInterval2hours:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_OFF_2_HOURS);
+			break;
+		case CAspSchedule::EInterval4hours:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_OFF_4_HOURS);
+			break;
+		case CAspSchedule::EInterval8hours:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_OFF_8_HOURS);
+			break;
+		case CAspSchedule::EInterval12hours:
+			iResHandler->ReadL(aBuf, R_ASP_SETT_AUTO_VALUE_OFF_12_HOURS);
+			break;
+		
+		default:
+			break;
+		}
+	
+	}
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::PeakScheduleL
+// Get peak schedule number from string
+// ----------------------------------------------------------------------------
+//
+TInt CAspScheduleDialog::PeakScheduleL(const TDesC& aBuf)
+	{
+	       		
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_MANUAL);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EIntervalManual;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_15_MINS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval15Mins;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_30_MINS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval30Mins;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_1_HOUR);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval1hour;
+			}
+        iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_2_HOURS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval2hours;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_4_HOURS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval4hours;
+			}
+	    iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_8_HOURS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval8hours;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_12_HOURS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval12hours;
+			}
+		
+	   	
+    	return KErrNotFound;
+	}
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::OffPeakScheduleL
+// Get off-peak schedule number from string
+// ----------------------------------------------------------------------------
+//
+TInt CAspScheduleDialog::OffPeakScheduleL(const TDesC& aBuf)
+	{
+	       		
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_OFF_MANUAL);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EIntervalManual;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_OFF_15_MINS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval15Mins;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_OFF_30_MINS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval30Mins;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_OFF_1_HOUR);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval1hour;
+			}
+        iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_OFF_2_HOURS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval2hours;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_OFF_4_HOURS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval4hours;
+			}
+	    iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_OFF_8_HOURS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval8hours;
+			}
+		iResHandler->ReadL(iBuf, R_ASP_SETT_AUTO_VALUE_OFF_12_HOURS);
+		if(iBuf.Compare(aBuf) == 0)
+			{
+			return CAspSchedule::EInterval12hours;
+			}
+		
+		
+    	return KErrNotFound;
+	}
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::GetPeakPositionL
+// Get position of selected interval from the interval list
+// ----------------------------------------------------------------------------
+//
+TInt CAspScheduleDialog::GetPeakPositionL(CDesCArray* arr, TInt aInterval)
+	{
+	const TInt KScheduleCount = 6;
+	for (TInt i=0; i < KScheduleCount; i++)
+		{
+		if(aInterval == PeakScheduleL((*arr)[i]))
+		return i;
+		}
+	return KErrNotFound;
+
+	}
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::GetOffPeakPositionL
+// Get position of selected interval from the interval list
+// ----------------------------------------------------------------------------
+//
+TInt CAspScheduleDialog::GetOffPeakPositionL(CDesCArray* arr, TInt aInterval)
+	{
+	const TInt KScheduleCount = 6;
+	for (TInt i=0; i < KScheduleCount; i++)
+		{
+		if(aInterval == OffPeakScheduleL((*arr)[i]))
+		return i;
+		}
+	return KErrNotFound;
+
+	}
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::CheckMandatoryDataL
+// 
+// ----------------------------------------------------------------------------
+//
+
+void CAspScheduleDialog::CheckMandatoryDataL()
+	{
+	FLOG( _L("CAspScheduleDialog::CheckMandatoryDataL START") );
+	
+	if (iSchedule->ProfileId() == KErrNotFound)
+		{
+		return;
+		}
+	if (!iSchedule->IsAutoSyncEnabled())
+		{
+		return;
+		}
+	
+	TInt incompleteCount;
+	TInt firstItem;
+
+	TBool ret = iSchedule->CheckMandatoryDataL(incompleteCount, firstItem);
+	if (!ret)
+		{
+		if (!TDialogUtil::ShowConfirmationQueryL(R_ASP_NOTE_AUTO_CONTENTS_MISSING_SETTINGS))
+			{
+			return ; 
+			}
+
+		TAspParam param(iApplicationId, iSyncSession);
+			
+		TBool doCleanUp = EFalse;
+
+		CAspProfile* profile = NULL;
+		TInt aProfileId = iSchedule->ProfileId();
+
+		if (iProfile && (aProfileId == iProfile->ProfileId()))//setting view opened & selected same profile
+			{
+			profile = iProfile;
+			}
+		else
+			{
+			profile = CAspProfile::NewLC(param);//Automatic sync menu opened
+			TRAPD(err, profile->OpenL(aProfileId, CAspProfile::EOpenReadWrite,
+                                         CAspProfile::EAllProperties));
+		 
+    		if (err == KErrLocked)
+    			{
+    			CleanupStack::PopAndDestroy(profile);
+    			TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+				return ;
+				}
+			doCleanUp = ETrue;
+			iContentList->SetProfile(profile);
+			}
+
+		TAspProviderItem& provider = iContentList->ProviderItem(firstItem);	
+		param.iProfile = profile;
+		param.iContentList = iContentList;
+		param.iDataProviderId = provider.iDataProviderId;
+		param.iProfileList = iProfileList;
+		param.iMode = iEditMode;
+		param.iSchedule = iSchedule;
+		if (incompleteCount == 1)
+			{
+			CAspContentDialog::ShowDialogL(param);
+			}
+		else if (incompleteCount >1)
+			{
+			CAspSettingViewDialog::ShowDialogL(param);
+			}
+			
+		if (doCleanUp)
+			{
+			iContentList->SetProfile(NULL);
+			CleanupStack::PopAndDestroy(profile);
+			}
+
+		}
+
+	if (!CheckBearerType())
+			{
+			iSchedule->SetProfileId(KErrNotFound);
+			return;
+			}
+	if (!iSchedule->MailboxExistL() || !iSchedule->ProtocolL())
+			{
+			TInt emailIndex = iContentList->FindProviderIndex(KUidNSmlAdapterEMail.iUid);
+			iSchedule->SetContentEnabled(emailIndex, EFalse);
+			}
+		
+	FLOG( _L("CAspScheduleDialog::CheckMandatoryDataL END") );
+	
+	}
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::ShowAutoSyncInfoL
+// Show next auto sync time 
+// ----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::ShowAutoSyncInfoL()
+	{
+	FLOG( _L("CAspScheduleDialog::ShowAutoSyncInfoL START") );
+	if (iSchedule->ProfileId() == KErrNotFound)
+		{
+		iSchedule->SetDailySyncEnabled(EFalse);
+		iSchedule->SetPeakSyncEnabled(EFalse);
+		iSchedule->SetOffPeakSyncEnabled(EFalse);
+        FLOG( _L("Profile Not Found") );
+		return ;
+		}
+		
+	if (!iSchedule->IsAutoSyncEnabled())
+		{
+		return;
+		}
+
+	if (iSchedule->PeakSyncEnabled() && !iSchedule->OffPeakSyncEnabled())
+		{
+		TInt dayCount = 0;
+	    TInt dayIndex = 0;
+        iSchedule->SelectedDayInfo(dayCount, dayIndex); 
+		if (dayCount == 0)
+			{
+			return;
+			}
+		}
+	if (iSchedule->PeakSyncEnabled() && (iSchedule->IsValidPeakScheduleL() == 0)
+						|| iSchedule->OffPeakSyncEnabled() && (iSchedule->IsValidOffPeakScheduleL() == 0 ))
+		{
+		return;
+		}
+	
+	TTime currentTime;
+	currentTime.HomeTime();
+	TDateTime today = currentTime.DateTime();
+	
+	TDateTime startDay = iSchedule->AutoSyncScheduleTime().DateTime();
+	
+	if (iSchedule->SyncFrequency() >= CAspSchedule::EInterval24hours)
+		{
+		if (startDay.Hour() == today.Hour() && startDay.Minute() <= today.Minute())
+			{
+			return;
+			}
+		else if (startDay.Hour() < today.Hour())
+			{
+			return;
+			}
+		}
+
+	TTime nextSync;
+    iSchedule->GetStartTimeL(nextSync ,ETrue);
+   	 
+	TDateTime syncDay = nextSync.DateTime();
+
+	TBuf<KBufSize> aTimeString;
+	if(today.Day() == syncDay.Day() && today.Month() == syncDay.Month())
+		{
+		//show next sync time
+		TBuf<KBufSize> timeFormat;
+		CAspResHandler::ReadL(timeFormat, R_QTN_TIME_USUAL_WITH_ZERO);
+		nextSync.FormatL(aTimeString, timeFormat);
+		}
+	else 
+		{
+		//show sync day
+		TBuf<KBufSize> dateFormat;
+		CAspResHandler::ReadL(dateFormat, R_QTN_DATE_USUAL_WITH_ZERO);
+		nextSync.FormatL(aTimeString, dateFormat);
+		}
+	
+	HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_SETT_AUTO_SYNC_DONE, aTimeString);
+	TDialogUtil::ShowInformationNoteL(hBuf->Des());
+
+	CleanupStack::PopAndDestroy(hBuf);
+
+	FLOG( _L("CAspScheduleDialog::ShowAutoSyncInfoL END") );
+
+   	
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::CheckBearerType
+// Return ETrue if bearer type of the selected profile is internet & EFalse otherwise
+// ----------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::CheckBearerType()
+	{
+	TAspParam param(iApplicationId, iSyncSession);
+	
+	CAspProfile* profile = CAspProfile::NewLC(param);
+
+	TInt aProfileId = iSchedule->ProfileId();
+	TRAPD(err, profile->OpenL(aProfileId, CAspProfile::EOpenRead,
+                                         CAspProfile::EAllProperties));
+	User::LeaveIfError(err);
+	if (profile->BearerType() != EAspBearerInternet)
+		{
+		CleanupStack::PopAndDestroy(profile);
+		return EFalse;
+		}
+	CleanupStack::PopAndDestroy(profile);
+	return ETrue;
+	}
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::CheckPeakTime
+// Check peak time definition
+// ----------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::CheckPeakTime()
+	{
+	if (Item(EAspAutoSyncPeakSchedule)->iNumberData == CAspSchedule::EIntervalManual
+				&& Item(EAspAutoSyncOffPeakSchedule)->iNumberData == CAspSchedule::EIntervalManual)
+		{
+		return ETrue;
+		}
+	if (Item(EAspAutoSyncPeakStartTime)->iTime >= Item(EAspAutoSyncPeakEndTime)->iTime)
+		{
+		return EFalse;
+		}
+	return ETrue;
+	}
+
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::CheckValidityL
+// Check validity of content selected
+// ----------------------------------------------------------------------------
+//
+TBool CAspScheduleDialog::CheckValidityL()
+	{
+	TBool ret = ETrue;
+	TRAPD(err, ret = iSchedule->MailboxExistL())
+	User::LeaveIfError(err);
+	if (!ret)
+		{
+		TDialogUtil::ShowErrorNoteL(R_ASP_NO_MAILBOXES);
+		TInt emailIndex = iContentList->FindProviderIndex(KUidNSmlAdapterEMail.iUid);
+		iSchedule->SetContentEnabled(emailIndex, EFalse);
+		return EFalse;  // no syncml mailbox
+		}
+	TInt profileId = Item(EAspAutoSyncProfile)->iNumberData;
+	if (profileId != KErrNotFound)
+		{
+		TAspParam param(iApplicationId, iSyncSession);
+
+		CAspProfile* profile = CAspProfile::NewLC(param);
+		profile->OpenL(profileId, CAspProfile::EOpenRead,
+                                         CAspProfile::EBaseProperties);
+		TInt protocol = profile->ProtocolVersion();
+		CleanupStack::PopAndDestroy(profile);
+
+		}
+	return ETrue;
+	}
+// ----------------------------------------------------------------------------
+// CAspScheduleDialog::EmailIndex
+//  ----------------------------------------------------------------------------
+//
+TInt CAspScheduleDialog::EmailIndex()
+	{
+	TInt index = iContentList->FindProviderIndex(KUidNSmlAdapterEMail.iUid);
+	return index;
+
+	}
+	
+// -----------------------------------------------------------------------------
+// CAspScheduleDialog::ReadRepositoryL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspScheduleDialog::ReadRepositoryL(TInt aKey, TInt& aValue)
+	{
+	const TUid KRepositoryId = KCRUidNSmlDSApp;
+	const TInt KSyncFrequencyCount = 3;
+	const TInt KSyncIntervalCount = 5;
+
+    CRepository* rep = CRepository::NewLC(KRepositoryId);
+    TInt err = rep->Get(aKey, aValue);
+	User::LeaveIfError(err);
+	CleanupStack::PopAndDestroy(rep);
+    
+
+	TInt keyVal = aValue;
+	if (aKey == EKeySyncFrequency)
+		{
+		TInt intervalCount = 0;
+		TUint mask = 1;
+		TInt maxSchedules = 5;
+		for (TInt i = 0 ;i < maxSchedules ;i++)
+			{
+			if (mask & keyVal)
+				{
+				intervalCount++;
+				}
+			mask = mask << 1;
+			}
+		if (keyVal >= 0x32 || intervalCount != KSyncFrequencyCount)
+			{
+			User::Leave(KErrGeneral);
+			}
+		}
+	else if (aKey == EKeyPeakSyncInterval ||
+									aKey == EKeyOffPeakSyncInterval)
+		{
+		TInt intervalCount = 0;
+		TUint mask = 1;
+		TInt maxSchedules = 7;
+		for (TInt i = 0 ;i < maxSchedules ;i++)
+			{
+			if (mask & keyVal)
+				{
+				intervalCount++;
+				}
+			mask = mask << 1;
+			}
+		if (keyVal >= 0x128 || intervalCount != KSyncIntervalCount)
+			{
+			User::Leave(KErrGeneral);
+			}
+		}
+	}
+
+//------------------------------------------------------------------------------
+// CAutoSyncCheckBoxSettingPage::CAspCheckBoxSettingPage
+// 
+//------------------------------------------------------------------------------
+//
+CAutoSyncCheckBoxSettingPage::CAutoSyncCheckBoxSettingPage(TInt aResourceID,
+                   CSelectionItemList* aItemArray, TAutoSyncSettingPageParam& aParam)
+                   
+ : CAknCheckBoxSettingPage(aResourceID, aItemArray), iParam(aParam)
+	{
+    iSelectionItemList = aItemArray;
+	}
+
+
+//------------------------------------------------------------------------------
+// Destructor
+// 
+//------------------------------------------------------------------------------
+//
+CAutoSyncCheckBoxSettingPage::~CAutoSyncCheckBoxSettingPage()
+	{
+	
+	}
+
+
+//------------------------------------------------------------------------------
+// CAutoSyncCheckBoxSettingPage::ProcessCommandL
+// 
+//------------------------------------------------------------------------------
+//
+void CAutoSyncCheckBoxSettingPage::ProcessCommandL(TInt aCommandId)
+	{
+    if (aCommandId == EAknSoftkeyUnmark || aCommandId == EAknSoftkeyMark)
+    	{
+        
+        CAknSetStyleListBox* listbox = ListBoxControl();
+    	TInt index = listbox->CurrentItemIndex();
+       	CSelectableItem* selectableItem = (*iSelectionItemList)[index];
+       	TBool ret = ETrue;
+
+		UpdateCbaL(R_ASP_CBA_OK_CANCEL_MARK);
+		TInt emailIndex = iParam.iObserver->EmailIndex();
+		if (index == emailIndex)
+			{
+       		ret = iParam.iObserver->CheckValidityL();
+			}       	
+		
+		TInt count = ListBoxControl()->SelectionIndexes()->Count();
+		TInt selected = count - 1;
+		if (selectableItem->SelectionStatus())
+			{
+        	if (!selected)//all unselected
+				{
+				UpdateCbaL(R_ASP_CBA_EMPTY_CANCEL_MARK);
+				}
+			}
+		else
+			{
+			if (index == emailIndex && !ret && !count)
+				{
+				UpdateCbaL(R_ASP_CBA_EMPTY_CANCEL_MARK);
+				}
+			}
+			
+       	if (ret)
+       		{
+            CAknCheckBoxSettingPage::ProcessCommandL(aCommandId);
+            return;
+       		}
+       	else
+       		{
+       		return;	
+       		}
+    	}
+    
+        	
+    iParam.iCommandId = aCommandId; // return command id to caller
+
+    CAknCheckBoxSettingPage::ProcessCommandL(aCommandId);
+	}
+	
+
+//------------------------------------------------------------------------------
+// CAutoSyncCheckBoxSettingPage::OfferKeyEventL
+// 
+//------------------------------------------------------------------------------
+//
+TKeyResponse CAutoSyncCheckBoxSettingPage::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
+                                                 TEventCode aType)
+    {
+		    if(EKeyEnter == aKeyEvent.iCode)
+		    {
+		    	ProcessCommandL(EAknSoftkeyMark);
+		    	return EKeyWasConsumed;
+		    }
+		    return CAknCheckBoxSettingPage::OfferKeyEventL(aKeyEvent, aType);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAutoSyncCheckBoxSettingPage::UpdateCbaL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAutoSyncCheckBoxSettingPage::UpdateCbaL(TInt aResourceId)
+    {
+    CEikButtonGroupContainer* cba = Cba();
+    cba->SetCommandSetL(aResourceId);
+    cba->DrawDeferred();
+    }
+// -----------------------------------------------------------------------------
+// CAutoSyncCheckBoxSettingPage::DynamicInitL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAutoSyncCheckBoxSettingPage::DynamicInitL()
+	{
+	TInt count = iSelectionItemList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CSelectableItem* selectableItem = (*iSelectionItemList)[i];
+		TBool selected = selectableItem->SelectionStatus();
+		if (selected)
+			{
+			return;
+			}
+		}
+	UpdateCbaL(R_ASP_CBA_EMPTY_CANCEL_MARK);
+	}
+	
+// ----------------------------------------------------------------------------
+// CAutoSyncCheckBoxSettingPage::HandleListBoxEventL
+//
+// ----------------------------------------------------------------------------
+//
+
+				 
+void CAutoSyncCheckBoxSettingPage::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
+{
+	TInt index = 0;
+	CSelectableItem* selectableItem;
+	if( AknLayoutUtils::PenEnabled() )  
+	{
+	  	switch(aEventType)
+	
+		{   
+			 case EEventItemSingleClicked:
+       		 	 index=aListBox->CurrentItemIndex();
+       		 	 selectableItem = (*iSelectionItemList)[index];
+       		 	 if(selectableItem->SelectionStatus())
+       		 	 {
+       		   		this->ProcessCommandL(EAknSoftkeyUnmark);	
+       		 	 }
+       		     else
+       		     {
+       			    this->ProcessCommandL(EAknSoftkeyMark);
+       		     }
+		        break;
+	 	default:
+			    break;
+		}	
+	}
+
+}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspSettingDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,2949 @@
+/*
+* 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:  
+*
+*/
+
+
+// INCLUDE FILES
+#include <AknIconArray.h>   // for GulArray
+#include <aknconsts.h>      // for KAvkonBitmapFile
+
+#include "AspSettingDialog.h"
+#include "AspProfileDialog.h"
+#include "AspScheduleDialog.h"
+#include "AspSchedule.h"
+#include "AspDialogUtil.h"
+#include "AspLogDialog.h"
+#include "AspUtil.h"
+#include "AspProfileWizardDialog.h"
+#include "AspDebug.h"
+#include "AspSyncUtil.rh"
+#include "AspAdvanceSettingsDialog.h"
+
+#include <aknsettingitemlist.h>
+
+#include <csxhelp/ds.hlp.hrh>  // for help text ids
+
+#ifndef RD_DSUI_TIMEDSYNC 
+#include <avkon.mbg>
+#else
+#include "AspSettingViewDialog.h"
+#endif
+#include <DataSyncInternalPSKeys.h>
+#include "AspAutoSyncHandler.h"
+#include <featmgr.h>   // FeatureManager
+
+const TInt KMSKControlId( CEikButtonGroupContainer::EMiddleSoftkeyPosition );
+
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+
+/******************************************************************************
+ * class CAspSettingDialog
+ ******************************************************************************/
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspSettingDialog::ShowDialogL(TAspParam& aParam)
+	{
+    CAspSettingDialog* dialog = CAspSettingDialog::NewL(aParam);
+
+	TBool ret = dialog->ExecuteLD(R_ASP_SETTING_DIALOG);
+
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspSettingDialog* CAspSettingDialog::NewL(TAspParam& aParam)
+    {
+    FLOG( _L("CAspSettingDialog::NewL START") );
+
+    CAspSettingDialog* self = new (ELeave) CAspSettingDialog(aParam);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    FLOG( _L("CAspSettingDialog::NewL END") );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::CAspSettingDialog
+// 
+// -----------------------------------------------------------------------------
+//
+CAspSettingDialog::CAspSettingDialog(TAspParam& aParam) 
+    {
+	iApplicationId = aParam.iApplicationId;
+	iSyncSession = aParam.iSyncSession;
+	iDialogMode = aParam.iMode;
+	
+	iCurrentProfileId = KErrNotFound;
+	iCurrentProfileName = KNullDesC;
+	
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrGeneral));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::ConstructL()
+    {
+    FLOG( _L("CAspSettingDialog::ConstructL START") );
+
+    CAknDialog::ConstructL(R_ASP_SETTING_DIALOG_MENU);
+    
+    iSettingEnforcement = TUtil::SettingEnforcementState();
+
+	TAspParam param(iApplicationId, iSyncSession);
+	iProfileList = CAspProfileList::NewL(param);
+	iProfileList->ReadAllProfilesL(CAspProfileList::ENoMandatoryCheck);
+	iProfileList->Sort();
+	
+    param.iMode = CAspContentList::EInitDataProviders;
+	iContentList = CAspContentList::NewL(param);
+	
+	// get previous title so it can be restored
+	iStatusPaneHandler = CStatusPaneHandler::NewL(iAvkonAppUi);
+	iStatusPaneHandler->StoreOriginalTitleL();
+	
+	iAutoSyncDialog = EFalse;
+	
+#ifdef RD_DSUI_TIMEDSYNC 
+
+    iTabHandler = new (ELeave) CAspTabbedNaviPaneHandler(iAvkonAppUi->StatusPane() ,this);
+	iUpdateTabGroup = ETrue;
+
+#else
+	// store current navi pane
+	iStatusPaneHandler->StoreNavipaneL();
+	
+#endif
+	
+	
+
+	iResHandler = CAspResHandler::NewL();
+
+	// start listening sync database events
+	iDbNotifier = CAspDbNotifier::NewL(param, this);
+	iDbNotifier->RequestL();
+	
+	iPopupNote = CAknInfoPopupNoteController::NewL();
+    iBearerHandler = CAspBearerHandler::NewL(param);
+
+	SetCurrentProfileL();
+	
+	FLOG( _L("CAspSettingDialog::ConstructL END") );
+    } 
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspSettingDialog::~CAspSettingDialog()
+    {
+    FLOG( _L("CAspSettingDialog::~CAspSettingDialog START") );
+
+	delete iProfileList;
+	delete iContentList;
+	
+	delete iStatusPaneHandler;
+	delete iResHandler;
+	
+	delete iDbNotifier;
+	iDbNotifier = NULL;
+	
+	delete iSyncHandler;   // created when sync is started
+	
+	if (iAvkonAppUi)
+		{
+		iAvkonAppUi->RemoveFromStack(this);
+		}
+
+	if (iPopupNote)
+		{
+    	iPopupNote->HideInfoPopupNote();
+	    delete iPopupNote;
+		}
+
+	delete iBearerHandler;
+
+#ifdef RD_DSUI_TIMEDSYNC
+
+	delete iTabHandler;
+#endif
+
+	FLOG( _L("CAspSettingDialog::~CAspSettingDialog END") );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspSettingDialog::ActivateL (from CCoeControl)
+//
+// Called by system when dialog is activated
+//------------------------------------------------------------------------------
+//
+void CAspSettingDialog::ActivateL()
+	{
+    CAknDialog::ActivateL();
+
+	// this cannot be in ConstructL which is executed before dialog is launched
+	iAvkonAppUi->AddToStackL(this);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspSettingDialog::GetHelpContext
+//
+//
+//------------------------------------------------------------------------------
+//
+void CAspSettingDialog::GetHelpContext(TCoeHelpContext& aContext) const
+	{
+	aContext.iMajor = KUidSmlSyncApp;
+	aContext.iContext = KDS_HLP_MAIN_VIEW;    
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspSettingDialog::ProcessCommandL
+//
+// Handle commands from menu.
+//------------------------------------------------------------------------------
+//
+void CAspSettingDialog::ProcessCommandL(TInt aCommandId)
+	{
+	TInt err = KErrNone;
+
+    // prevent db notifications while processing menu command
+	//Notifier()->SetDisabled(ETrue);
+	TRAP(err, DoProcessCommandL(aCommandId));
+	//Notifier()->SetDisabled(EFalse);
+	
+	if (err != KErrNone)
+		{
+		iDbNotifier->CheckUpdateEventL();
+		FLOG( _L("### CAspSettingDialog::ProcessCommandL failed (%d) ###"), err );
+		User::Leave(err);
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspSettingDialog::DoProcessCommandL
+//
+// Handle commands from menu.
+//------------------------------------------------------------------------------
+//
+void CAspSettingDialog::DoProcessCommandL(TInt aCommandId)
+	{
+	HideMenu();
+
+	switch (aCommandId)
+		{
+        case EAspMenuCmdSync:
+			{
+			SyncProfileL();
+			break;
+			}
+		case EAspMenuCmdCopyFromServer:
+			{
+			CopyFromServerL();
+			break;
+			}
+        case EAspMenuCmdChangeProfile:
+			{
+			ChangeProfileL();
+			break;
+			}
+        case EAspMenuCmdEdit:
+			{
+			EditProfileL(EDialogModeEdit ,KErrNotFound);
+			break;
+			}
+        case EAspMenuCmdNewSet:
+			{
+			CreateProfileL();
+			break;
+			}
+		case EAspMenuCmdDelete:
+			{
+			DeleteProfileL();
+	   		break;
+			}
+		case EAspMenuCmdViewLog:
+			{
+			ShowLogDialogL();
+			break;
+			}
+		case EAspMenuCmdAutoSync:
+			{
+			ShowAutoSyncDialogL();
+			break;
+			}
+		case EAspMenuCmdAdvanceSettings:
+		    {
+		    //CAspAdvanceSettingsDialog* dialog = CAspAdvanceSettingsDialog::NewL();
+		    //CleanupStack::PushL(dialog);
+		        
+		    CAspAdvanceSettingsDialog::ShowDialogL();
+		        
+		    //CleanupStack::PopAndDestroy(dialog);
+
+		    //ShowContextMenuL(R_ASP_ROAMING_SETTINGS_CONTEXT_MENU);
+		    break;
+		    }
+        case EAspMenuCmdRoamingSettings:
+            {
+            ShowContextMenuL(R_ASP_ROAMING_SETTINGS_CONTEXT_MENU);
+            break;
+            }		
+
+		case EAspMenuCmdMark:
+		case EAspMenuCmdUnmark:
+			{
+			SaveSelectionL();
+			break;	
+			}
+    case EAknCmdHelp:
+			{
+            TUtil::LaunchHelpAppL(iEikonEnv);
+			break;
+		  }
+
+        case EAspMenuCmdExit:
+        case EAknCmdExit:
+        case EEikCmdExit:
+			{
+   		
+            //
+			// Exit dialog
+			//
+			// CEikAppUi::ProcessCommandL starts CAknAppShutter that 
+			// closes all dialogs and finally calling application. Before 
+			// dialog is closed (deleted) it's OkToExitL(EEikBidCancel)
+			// is called. EEikBidCancel means OkToExitL must silently
+			// save and return ETrue.
+			//
+			iAvkonAppUi->ProcessCommandL(EAknCmdExit);
+
+			break;
+			}
+
+		default:
+			{
+			break;
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::OkToExitL
+//
+// Called by framework before dialog is closed.
+// -----------------------------------------------------------------------------
+//
+TBool CAspSettingDialog::OkToExitL(TInt aButtonId)
+    {
+    
+	// Options/Exit, End key, Close key ('c')
+	if (aButtonId == EEikBidCancel)
+		{
+		// framework calls this when dialog must shut down
+    	return ETrue;
+		}
+
+	// Back key (cba)
+	if (aButtonId == EAknSoftkeyBack)
+        {
+        if( iAutoSyncDialog )
+            {
+            return EFalse;
+            }
+        else
+            {
+            return ETrue;
+            }
+		}
+
+    // Exit key (cba)
+	if (aButtonId == EAknSoftkeyExit)
+        {
+        if (iDialogMode == EModeDialogNoWait && iApplicationId == EApplicationIdSync)
+        	{
+            //  close sync app
+        	iAvkonAppUi->ProcessCommandL(EAknCmdExit);
+        	}
+
+        return ETrue;
+		}
+		
+	if (aButtonId == EAknSoftkeyMark || aButtonId == EAknSoftkeyUnmark 
+		|| aButtonId == EAknSoftkeyOpen)  // MSK
+        {
+
+		if (iProfileList->Count() == 0)
+			{
+			return EFalse;
+			}
+        
+        if (IsProfileLockedL(iCurrentProfileId))
+        	{
+        	TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+			CancelCheckboxEvent();
+			return EFalse;
+			}
+        
+        if (iSettingEnforcement)
+			{
+			TDialogUtil::ShowInformationNoteL(R_ASP_PROTECTED_SETTING);
+			return EFalse;  // leave dialog open;
+			}
+        
+        if (!CheckEmailSelection())
+        	{
+        	return EFalse;  // leave dialog open;
+        	}
+				
+		TInt ret =  SaveCurrentProfile();
+		if (ret != KErrNone)
+			{
+			CancelCheckboxEvent();
+			}
+			
+		return EFalse;  // leave dialog open
+		}
+		
+
+	return CAknDialog::OkToExitL(aButtonId);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingDialog::CancelMailBoxForEnterL
+// 
+// ----------------------------------------------------------------------------
+//
+
+void CAspSettingDialog::CancelMailBoxForEnterL()
+{
+	CListBoxView* view = iSettingListBox->View();
+	
+    TInt index = view->CurrentItemIndex();
+    TAspProviderItem& item = iContentList->ProviderItem(index);
+    TBool selected = view->ItemIsSelected(index);
+    
+    if(selected)
+    {
+        view->DeselectItem(index);
+    }
+    else
+    {
+    	view->SelectItemL(index);
+    }   
+    
+}
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingDialog::OfferKeyEventL
+// 
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspSettingDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+	{
+	if (aType == EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+			//case EKeyOK:
+			//	{
+			//	ShowContextMenuL(R_ASP_SETTING_DIALOG_CONTEXT_MENU);
+			//	return EKeyWasConsumed;
+			//	}
+			case EKeyEnter:
+			{
+                   CancelMailBoxForEnterL();
+                   OkToExitL(EAknSoftkeyOpen);
+                   return EKeyWasConsumed;
+			}
+
+			case EKeyEscape:  // framework calls this when dialog must shut
+				{
+				return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+        		}
+        		
+			//case EStdKeyHome:
+			//	{
+			//	DeleteSelectedProfileL();
+			//	return EKeyWasConsumed;
+			//	}
+
+#ifdef RD_DSUI_TIMEDSYNC 
+
+			case EKeyLeftArrow:
+				{
+				SetPreviousProfileL();
+				return EKeyWasConsumed;
+				}
+
+			case EKeyRightArrow:
+				{
+				SetNextProfileL();
+				return EKeyWasConsumed;
+				}
+
+#endif
+            default:
+			    break;
+			}
+		}
+
+	return CAknDialog::OfferKeyEventL( aKeyEvent, aType);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingDialog::HandleResourceChange
+// 
+// ----------------------------------------------------------------------------
+//
+
+void CAspSettingDialog::HandleResourceChange(TInt aType)
+    {   
+    if (aType == KEikDynamicLayoutVariantSwitch) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        iSettingListBox->SetSize(mainPaneRect.Size());
+        CCoeControl::HandleResourceChange(aType);
+		DrawDeferred();
+	    return;
+		}
+		
+    if (aType == KAknsMessageSkinChange)
+        {
+        TRAP_IGNORE(SetIconsL());
+        }
+        
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+/*
+void CAspSettingDialog::HandleResourceChange(TInt aType)
+    {   
+    if (aType == KEikDynamicLayoutVariantSwitch) //Handle change in layout orientation
+        {
+  
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        TBuf<299> buf;
+        buf.Format(_L("(%d,%d) (%d,%d)"), mainPaneRect.iTl.iX, mainPaneRect.iTl.iY, mainPaneRect.iBr.iX, mainPaneRect.iBr.iY);
+
+        SetRect(mainPaneRect);
+        iSettingListBox->HandleResourceChange(aType);
+		DrawNow();
+  
+        
+        CAknDialog::HandleResourceChange(aType);
+        
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        
+        iSettingListBox->SetSize(mainPaneRect.Size());
+        //iSettingListBox->HandleResourceChange(aType);
+        CCoeControl::HandleResourceChange(aType);
+		DrawDeferred();
+		
+		
+	    return;
+		}
+		
+    if (aType == KAknsMessageSkinChange)
+        {
+        TRAP_IGNORE(SetIconsL());
+        }
+        
+    CCoeControl::HandleResourceChange(aType);
+    }
+*/
+
+// ----------------------------------------------------------------------------
+// CAspSettingDialog::SetIconsL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSettingDialog::SetIconsL()
+    {
+    if (!iSettingListBox)
+    	{
+    	return;
+    	}
+ 
+ 	TFileName bitmapName;
+	CAspResHandler::GetBitmapFileName(bitmapName);
+	CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray(KDefaultArraySize);
+	CleanupStack::PushL(icons);
+	
+	// NOTE: icons must be appended in correct order (TAspSettingDialogIconIndex)
+	icons->AppendL(IconL(KAknsIIDQgnPropCheckboxOn, KAvkonBitmapFile, 
+	                     EMbmAvkonQgn_prop_checkbox_on,
+	                     EMbmAvkonQgn_prop_checkbox_on_mask));
+	                     
+	icons->AppendL(IconL(KAknsIIDQgnPropCheckboxOff, KAvkonBitmapFile,
+	                     EMbmAvkonQgn_prop_checkbox_off,
+	                     EMbmAvkonQgn_prop_checkbox_off_mask));
+	
+    // delete old icons
+    CArrayPtr<CGulIcon>* arr = iSettingListBox->ItemDrawer()->FormattedCellData()->IconArray();
+    if (arr)
+    	{
+    	arr->ResetAndDestroy();
+	    delete arr;
+	    arr = NULL;
+    	}
+
+	iSettingListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
+	CleanupStack::Pop(icons);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingDialog::ShowContextMenuL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspSettingDialog::ShowContextMenuL(TInt aResource)
+	{
+	if (SyncRunning())
+		{
+		return;
+		}
+	
+	//
+	// Switch to Context specific options menu,
+	// Show it and switch back to main options menu.
+	// 
+	CEikMenuBar* menuBar = iMenuBar; // from CAknDialog
+	menuBar->SetMenuTitleResourceId(aResource);
+
+
+	// TRAP displaying of menu bar.
+	// If it fails, the correct resource is set back before leave.
+	TRAPD(err, menuBar->TryDisplayMenuBarL());
+	
+	menuBar->SetMenuTitleResourceId(R_ASP_SETTING_DIALOG_MENU);
+		
+	User::LeaveIfError(err);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::PostLayoutDynInitL
+//
+// Called by framework after dialog is shown.
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::PostLayoutDynInitL()
+	{
+	#ifdef RD_DSUI_TIMEDSYNC
+	ShowAutoSyncProfileInfo();
+	#else
+  ShowCurrentProfileInfo();
+  #endif
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::PreLayoutDynInitL
+//
+// Called by framework before dialog is shown.
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::PreLayoutDynInitL()
+    {
+    iSettingListBox = (CAknDoubleLargeStyleListBox*) ControlOrNull (EAspSettingDialogList);
+    
+   	__ASSERT_ALWAYS(iSettingListBox, TUtil::Panic(KErrGeneral));
+	
+	iSettingListBox->SetListBoxObserver(this);
+	iSettingListBox->CreateScrollBarFrameL(ETrue);
+	iSettingListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+	                 CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+	
+	SetIconsL();
+	UpdateListBoxL();
+
+#ifdef RD_DSUI_TIMEDSYNC 
+
+	UpdateTabsL();
+#else
+
+	UpdateNavipaneL(iCurrentProfileName);
+#endif
+
+	
+	iSettingListBox->UpdateScrollBarsL();
+	iSettingListBox->ScrollBarFrame()->MoveVertThumbTo(0);
+
+	iStatusPaneHandler->SetTitleL(R_ASP_SETTING_DIALOG_TITLE);
+
+	SetCurrentIndex();
+//#ifdef RD_DSUI_CP_INTEGRATION
+	TBool flag = CEikonEnv::Static()->StartedAsServerApp() ;
+	if (flag || iApplicationId != EApplicationIdSync)
+/*#else
+	if (iApplicationId != EApplicationIdSync)
+#endif */
+		{
+		UpdateCbaL(R_ASP_CBA_OPTIONS_BACK_MARK);
+		}
+		
+	if(iSettingEnforcement)
+	{
+		UpdateMiddleSoftKeyLabelL(EAknSoftkeyOpen,R_TEXT_SOFTKEY_EMPTY);	
+   	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::DynInitMenuPaneL
+//
+// Called by framework before menu is shown.
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::DynInitMenuPaneL(TInt aResourceID, 	CEikMenuPane* aMenuPane)
+	{
+	TInt menu1 = R_ASP_SETTING_DIALOG_MENU_PANE;
+	TInt menu2 = R_ASP_SETTING_DIALOG_CONTEXT_MENU_PANE;
+	
+    if (aResourceID != menu1 && aResourceID != menu2)
+		{
+		return; // not one of our menus
+		}
+
+	if (aResourceID == R_ASP_SETTING_DIALOG_CONTEXT_MENU_PANE)
+		{
+		InitContextMenuL(aMenuPane); // separate handling for context menu
+		}
+	else
+		{
+		InitOptionsMenuL(aMenuPane);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::InitContextMenuL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::InitContextMenuL(CEikMenuPane* /*aMenuPane*/)
+	{
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::InitOptionsMenuL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::InitOptionsMenuL(CEikMenuPane* aMenuPane)
+	{
+	TInt profileCount = iProfileList->Count();
+	TInt providerCount = iContentList->ProviderCount();
+	TInt deletableProfileCount = iProfileList->DeletableProfileCount();
+	
+	if (providerCount == 0)  // no data providers
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdSync);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdNewSet);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdEdit);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChangeProfile);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdDelete);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdAutoSync);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdViewLog);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdCopyFromServer);
+		return;
+    	}
+	
+	
+	// Options/Sync
+	// Options/Copy all from server
+	if (iCurrentProfileId == KErrNotFound && profileCount > 0)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdSync);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdCopyFromServer);
+		}
+	if (iSettingEnforcement && profileCount == 0)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdSync);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdCopyFromServer);
+		}
+
+	if (iCurrentProfileId == KErrNotFound)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdCopyFromServer);
+		}
+
+	// Options/Change
+	if (profileCount == 0)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChangeProfile);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdMark);
+	    TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdUnmark);	 
+		}
+	if (profileCount == 1 && iCurrentProfileId != KErrNotFound)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChangeProfile);
+		}
+	
+	// Options/Edit
+	if (iCurrentProfileId == KErrNotFound)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdEdit);
+		}
+	
+	// Options/Auto sync
+	if (iCurrentProfileId == KErrNotFound)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdAutoSync);
+		}
+
+	// Options/New
+	if (iSettingEnforcement)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdNewSet);
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdMark);
+	    TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdUnmark);	 
+		}
+
+	// Options/Delete   
+   if (IsSyncOnGoingL(iCurrentProfileId) || iSettingEnforcement 
+   										|| deletableProfileCount == 0)
+    	{
+    	TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdDelete);
+     	}
+	
+	// Options/View log
+	if (iCurrentProfileId == KErrNotFound)
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdViewLog);
+		}
+	
+	if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
+		{
+		TDialogUtil::DeleteMenuItem(aMenuPane, EAknCmdHelp);
+		}
+		
+#ifdef RD_DSUI_TIMEDSYNC 
+	if(profileCount)
+		{
+	 	//Delete active profile
+	 	TAspParam param(iApplicationId, iSyncSession);
+	 	TAspProfileItem& currentProfile = CurrentProfileL();
+	 	if(!currentProfile.iDeleteAllowed)
+	 		{
+	    	TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdDelete);
+			}
+	 	//Change profile option is removed
+	 	TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdChangeProfile);
+	 	
+
+	 	CAspSchedule* schedule = CAspSchedule::NewLC();
+	 	TInt asProfileId = schedule->AutoSyncProfileId();
+	 	if (iCurrentProfileId == schedule->ProfileId()
+	 							&& asProfileId != KErrNotFound)
+			{
+			CAspProfile* asProfile = CAspProfile::NewLC(param);
+			asProfile->OpenL(asProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+			if (!asProfile->IsSynced() && !currentProfile.iSynced)
+				{
+				TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdViewLog);
+				}
+			CleanupStack::PopAndDestroy(asProfile);
+			}
+	 	else
+			{
+			if (!currentProfile.iSynced)
+		    	{
+	        	TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdViewLog);
+		    	}
+
+			}
+		 CleanupStack::PopAndDestroy(schedule);
+		}
+#else
+	 
+	 
+	 TAspProfileItem& profile = CurrentProfileL();
+     if (!profile.iSynced)
+		 {
+	         iProfileList->ReadProfileL(iCurrentProfileId);
+	       }
+	  
+	   if (!profile.iSynced)
+	           {
+	     TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdViewLog);
+		 }
+#endif
+if(!iSettingEnforcement)
+{
+	UpdateMarkMenuItem(aMenuPane);
+}
+#ifndef RD_DSUI_TIMEDSYNC
+     TDialogUtil::DeleteMenuItem(aMenuPane, EAspMenuCmdAutoSync);
+#endif
+
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::IsSyncOnGoing
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSettingDialog::IsSyncOnGoingL(TInt aProfileId)
+	{
+	TInt currentJobId = CAspProfile::CurrentJob(iSyncSession);
+	if (currentJobId != KErrNotFound)
+			{
+			RSyncMLDataSyncJob syncJob;
+			syncJob.OpenL(*iSyncSession, currentJobId);
+			if (syncJob.Profile() == aProfileId)
+				{
+				syncJob.Close();
+				return ETrue;
+				}
+			syncJob.Close();
+			}
+	return EFalse;
+	}
+
+	
+#ifdef RD_DSUI_TIMEDSYNC 
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::SetNextProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::SetNextProfileL()
+	{
+    FLOG( _L("CAspSettingDialog::SetNextProfileL START") );
+
+	if (iProfileList->Count() == 0)
+		{
+		return;
+		}
+    
+    TInt currentIndex = iProfileList->ListIndex(iCurrentProfileId);
+    if (currentIndex == KErrNotFound)
+    	{
+    	FLOG( _L("CAspSettingDialog::SetNextProfileL END") );
+    	
+    	User::Leave(KErrNotFound);
+    	}
+    
+    TInt newIndex = 0;
+    TInt count = iProfileList->Count();
+    if (currentIndex >= count-1)
+        {
+        newIndex = 0;
+        }
+    else
+        {
+        newIndex = currentIndex + 1;
+        }
+    TAspProfileItem& olditem = iProfileList->Item(currentIndex);        
+    TAspProfileItem& item = iProfileList->Item(newIndex);
+
+	if (item.iProfileName.Compare(KAutoSyncProfileName) == 0)
+			{
+			if(newIndex >= count-1)
+				{
+				newIndex = 0;
+				}
+			else
+				{
+				newIndex++;
+				}
+			TAspProfileItem& newItem = iProfileList->Item(newIndex);
+			SetCurrentProfile(newItem.iProfileId);
+			}
+	else 
+		{
+		SetCurrentProfile(item.iProfileId);
+		}
+	
+	//ShowCurrentProfileInfo();
+    UpdateListBoxL();
+	//UpdateNavipaneL(iCurrentProfileName);
+    UpdateTabsL();
+        
+    FLOG( _L("CAspSettingDialog::SetNextProfileL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::SetPreviousProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::SetPreviousProfileL()
+	{
+    FLOG( _L("CAspSettingDialog::SetPreviousProfileL START") );
+
+	if (iProfileList->Count() == 0)
+		{
+		return;
+		}
+    
+    TInt currentIndex = iProfileList->ListIndex(iCurrentProfileId);
+    if (currentIndex == KErrNotFound)
+    	{
+    	FLOG( _L("CAspSettingDialog::SetNextProfileL END") );
+    	
+    	User::Leave(KErrNotFound);
+    	}
+    
+    TInt newIndex = 0;
+    TInt count = iProfileList->Count();
+    if (currentIndex == 0)
+        {
+        newIndex = count - 1;
+        }
+    else
+        {
+        newIndex = currentIndex - 1;
+        }
+   
+    TAspProfileItem& item = iProfileList->Item(newIndex);
+
+	if (item.iProfileName.Compare(KAutoSyncProfileName) == 0)
+		{
+		if(newIndex == 0)
+			{
+				newIndex = count - 1;
+			}
+		else
+			{
+				newIndex--;
+			}
+			TAspProfileItem& newItem = iProfileList->Item(newIndex);
+			SetCurrentProfile(newItem.iProfileId);
+		}
+	else
+		{
+		 SetCurrentProfile(item.iProfileId);	
+		}
+
+   
+	//ShowCurrentProfileInfo();
+    UpdateListBoxL();
+	//UpdateNavipaneL(iCurrentProfileName);
+	UpdateTabsL();
+
+    FLOG( _L("CAspSettingDialog::SetPreviousProfileL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::UpdateTabsL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::UpdateTabsL()
+	{
+    FLOG( _L("CAspSettingDialog::UpdateTabsL START") );
+
+	TInt count = iProfileList->Count();
+	if (count == 0)
+		{
+		//handle no profile condition
+		iTabHandler->DeleteTabsL();
+		_LIT(KEmpty, " ");
+		TBuf<64> tabText(KEmpty);
+		TInt profileId = KMaxProfileCount;
+		iTabHandler->AddTabL(tabText, profileId);
+		iTabHandler->SetActiveTabL(profileId);
+		return;
+		}
+
+	if (iTabHandler->TabIndex(iCurrentProfileId) == KErrNotFound)
+		{
+		iUpdateTabGroup = ETrue;
+		}
+	if (iUpdateTabGroup)
+		{
+		//update changed settings
+	    iProfileList->ReadAllProfilesL(CAspProfileList::ENoMandatoryCheck);
+		iProfileList->Sort();
+    	SetCurrentProfile(iCurrentProfileId);
+		count = iProfileList->Count();
+		iTabHandler->DeleteTabsL();
+        for (TInt i=0; i<count; i++)
+        	{
+        	TAspProfileItem& item = iProfileList->Item(i);
+			iTabHandler->AddTabL(item.iProfileName, item.iProfileId);
+    		}
+    	iTabHandler->SetTabWidthL();
+		iUpdateTabGroup = EFalse;		
+		}
+	if (iCurrentProfileId != KErrNotFound)
+		{
+		iTabHandler->SetTabTextL(iCurrentProfileName, iCurrentProfileId);	
+		}
+	CAspSchedule* schedule = CAspSchedule::NewLC();
+	if (iCurrentProfileId == schedule->ProfileId()
+							 && schedule->IsAutoSyncEnabled())
+		{
+		//show indicator icon for profile that has auto sync ON.
+		_LIT(KSpace,"  ");
+		TBuf<64> tabText;
+		tabText.Append(KClockCharacter);//Unicode character U+F815 (clock)
+		tabText.Append(KSpace);
+		tabText.Append(iCurrentProfileName);
+		iTabHandler->SetTabTextL(tabText, iCurrentProfileId);
+		}
+		
+	if (iCurrentProfileId != KErrNotFound)
+        {
+        iTabHandler->SetActiveTabL(iCurrentProfileId);    
+        }
+
+	CleanupStack::PopAndDestroy(schedule);
+	
+	
+    FLOG( _L("CAspSettingDialog::UpdateTabsL END") );
+	}
+
+#endif
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::UpdateMarkMenuItem
+//
+// -----------------------------------------------------------------------------
+//
+
+void CAspSettingDialog::UpdateMarkMenuItem(CEikMenuPane* aMenuPane)
+	{
+	
+	CListBoxView* view = iSettingListBox->View();
+    
+    TInt index = view->CurrentItemIndex();
+    TBool mark = view->ItemIsSelected(index);
+	
+	aMenuPane->SetItemDimmed(EAspMenuCmdMark,mark);
+	aMenuPane->SetItemDimmed(EAspMenuCmdUnmark,!mark);
+		
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::SaveSelection
+// Update Mark/Unmark selected from menu 
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::SaveSelectionL()
+{
+    if (IsProfileLockedL(iCurrentProfileId))
+       	{
+       	TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+		return;
+		}
+       
+       if (iSettingEnforcement)
+		{
+		TDialogUtil::ShowInformationNoteL(R_ASP_PROTECTED_SETTING);
+		return; 
+		}
+		
+	//update check box & profile
+    CListBoxView* view = iSettingListBox->View();
+    
+    TInt index = view->CurrentItemIndex();
+    TBool selected = view->ItemIsSelected(index);
+    if (selected)
+    	{
+        view->DeselectItem(index);
+       	}
+    else
+    	{
+    	view->SelectItemL(index);
+    	}
+    iSettingListBox->SetCurrentItemIndex(index);
+    if (!CheckEmailSelection())
+       	{
+       	return; 
+       	}
+	TInt ret =  SaveCurrentProfile();
+	if (ret != KErrNone)
+		{
+		CancelCheckboxEvent();
+		}
+	
+}
+
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::DoSetCurrentProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::DoSetCurrentProfileL(TInt aProfileId)
+	{
+    FLOG( _L("CAspSettingDialog::DoSetCurrentProfileL START") );
+    
+    iCurrentProfileId = KErrNotFound;
+    iCurrentProfileName = KNullDesC;
+    iContentList->RemoveAllTasks();
+    iProfileList->ReadAllProfilesL(CAspProfileList::ENoMandatoryCheck);
+	iProfileList->Sort();
+	
+	if (iProfileList->Count() == 0)
+		{
+		return;
+		}
+        
+    if (aProfileId == KErrNotFound)
+    	{
+    	FLOG( _L("CAspSettingDialog::DoSetCurrentProfileL END") );
+    	User::Leave(KErrNotFound);
+    	}
+    	
+    TInt index = iProfileList->ListIndex(aProfileId);
+    if (index == KErrNotFound)
+    	{
+    	FLOG( _L("### unknown profile (id=%d) ###"), aProfileId );
+    	FLOG( _L("CAspSettingDialog::DoSetCurrentProfileL END") );
+    	
+    	User::Leave(KErrNotFound);
+    	}
+    
+    TAspParam param(iApplicationId, iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+	
+	//if profile already locked ,open as read only
+	if (IsProfileLockedL(aProfileId))
+	{
+	   profile->OpenL(aProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+    
+	}
+	else
+	{
+	   profile->OpenL(aProfileId, CAspProfile::EOpenReadWrite, CAspProfile::EAllProperties);
+	}
+	
+    iContentList->SetProfile(profile);
+    
+    // read sync tasks from database into content list
+    iContentList->InitAllTasksL();
+    if (IsProfileLockedL(aProfileId))
+    {
+    	iContentList->UpdateLocalDatabaseL();
+    }
+    
+    if (!iContentList->CheckTaskDirectionsL())
+       	{
+        if (!iSettingEnforcement)
+           	{
+           	iContentList->ModifyTaskDirectionsL(ESyncDirectionTwoWay);
+    	   	}
+    	   	
+    	FLOG( _L("### sync direction conflict ###") );
+    	}
+    
+    //check if mailbox exists
+    CDesCArray* localDataStores = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
+	CleanupStack::PushL(localDataStores);
+	iContentList->GetLocalDatabaseList(KUidNSmlAdapterEMail.iUid, localDataStores);
+
+    TInt num = profile->ProtocolVersion();
+    if (num == EAspProtocol_1_1 || localDataStores->Count() == 0)
+    	{
+    	TInt index = iContentList->FindTaskIdForProvider( KUidNSmlAdapterEMail.iUid);
+		if (index != KErrNotFound)
+			{
+			TAspTaskItem emailItem = iContentList->ReadTaskItemL(profile->Profile(), index);
+			if (emailItem.iEnabled)
+				{
+		    	iContentList->ModifyTaskIncludedL(KUidNSmlAdapterEMail.iUid, EFalse, KNullDesC);
+				}
+			}
+    	}
+	CleanupStack::PopAndDestroy(localDataStores);
+	
+    iContentList->SetProfile(NULL);
+    
+    iCurrentProfileId = aProfileId;
+    
+    profile->GetName(iCurrentProfileName);
+  	if (TUtil::IsEmpty(iCurrentProfileName))
+		{
+		CAspResHandler::ReadL(iCurrentProfileName, R_ASP_UNNAMED_SET);
+		}
+
+  
+    CleanupStack::PopAndDestroy(profile);
+    
+    FLOG( _L("CAspSettingDialog::DoSetCurrentProfileL END") );
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::SetCurrentProfile
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::SetCurrentProfile(TInt aProfileId)
+	{
+	if (iContentList->IsLocked())
+		{
+		return; // iContentList used by CAspProfileDialog
+		}
+		
+	TInt err = KErrNone;
+	TInt oldCurrentProfileId = iCurrentProfileId;
+	
+	TRAP(err, DoSetCurrentProfileL(aProfileId));
+	
+	iContentList->SetProfile(NULL);
+	
+    if (err != KErrNone)
+    	{
+        iCurrentProfileId = KErrNotFound;
+        iCurrentProfileName = KNullDesC;
+        iContentList->RemoveAllTasks();
+       	}
+       	
+    if (err != KErrNone && oldCurrentProfileId != KErrNotFound)
+    	{
+   		// some error - try restoring old current profile
+   		TRAP(err, DoSetCurrentProfileL(oldCurrentProfileId));
+   		
+   		iContentList->SetProfile(NULL);
+	
+	    if (err != KErrNone)
+    	    {
+            iCurrentProfileId = KErrNotFound;
+    	    iCurrentProfileName = KNullDesC;
+            iContentList->RemoveAllTasks();
+    	    }
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::SetCurrentProfile
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::SetCurrentProfileL()
+	{
+
+#ifdef RD_DSUI_TIMEDSYNC //display profiles in alphabetic order.
+	TInt index = 0;
+	if (!iProfileList->Count())
+		{
+		index = KErrNotFound;
+		}
+
+#else
+	TInt index = iProfileList->FindLastSyncedProfileIndexL();
+
+#endif
+	if (index != KErrNotFound)
+		{
+		TAspProfileItem& item = iProfileList->Item(index);
+		SetCurrentProfile(item.iProfileId);
+		}
+	else
+		{
+		SetCurrentProfile(KErrNotFound);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::CurrentProfileL
+//
+// -----------------------------------------------------------------------------
+//
+TAspProfileItem& CAspSettingDialog::CurrentProfileL()
+	{
+	TInt index = iProfileList->ListIndex(iCurrentProfileId);
+	if (index == KErrNotFound)
+		{
+		User::Leave(KErrNotFound);
+		}
+		
+	return iProfileList->Item(index);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::HasCurrentProfile
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSettingDialog::HasCurrentProfile()
+	{
+	TInt ret = ETrue;
+	
+	if (iCurrentProfileId == KErrNotFound)
+		{
+		ret = EFalse;
+		}
+		
+	if (iProfileList->Count() == 0)
+		{
+		ret = EFalse;
+		}
+		
+	if (ret)
+		{
+	    TInt index = iProfileList->ListIndex(iCurrentProfileId);	
+	    
+	    __ASSERT_DEBUG(index != KErrNotFound, TUtil::Panic(KErrGeneral));
+		}
+	
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::IsCurrentProfile
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSettingDialog::IsCurrentProfile(TInt aProfileId)
+	{
+	if (aProfileId != KErrNotFound && aProfileId == iCurrentProfileId)
+		{
+		return ETrue;
+		}
+		
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::DoSaveCurrentProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::DoSaveCurrentProfileL()
+	{
+	if (iSettingEnforcement)
+		{
+		return;  // read-only profile
+		}
+
+	if (!HasCurrentProfile())
+		{
+		User::Leave(KErrNotFound);
+		}
+
+    TAspParam param(iApplicationId, iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+    profile->OpenL(iCurrentProfileId, CAspProfile::EOpenReadWrite, 
+                                      CAspProfile::EAllProperties);
+
+	iContentList->SetProfile(profile);
+	// store selected sync tasks into database
+	iContentList->IncludeTasks(iSettingListBox->SelectionIndexes());
+	iContentList->SetProfile(NULL);
+	
+	CleanupStack::PopAndDestroy(profile);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::SaveCurrentProfile
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSettingDialog::SaveCurrentProfile()
+	{
+	TRAPD(err, DoSaveCurrentProfileL());
+	
+	iContentList->SetProfile(NULL);
+	
+    if (err == KErrLocked)
+   		{
+        TRAP_IGNORE( TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE) );
+        }
+
+	if (err != KErrNone)
+		{
+		FLOG( _L("### CAspSettingDialog::SaveCurrentProfile: err=%d ###"), err );
+    	}
+    	
+    return err;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::EditProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::EditProfileL(TInt aEditMode ,TInt aFocus)
+	{
+	if (iSettingEnforcement)
+		{
+		aEditMode = EDialogModeSettingEnforcement;
+		}
+    
+    if (IsProfileLockedL(iCurrentProfileId))
+		{
+		TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+		return;
+		}
+	TRAPD(err, DoEditProfileL(aEditMode ,aFocus));
+    iContentList->SetProfile(NULL);
+	User::LeaveIfError(err);
+
+#ifdef RD_DSUI_TIMEDSYNC 
+	iUpdateTabGroup = ETrue;
+	UpdateTabsL();
+#endif
+
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::DoEditProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::DoEditProfileL(TInt aEditMode, TInt aFocus)
+	{
+	if (!HasCurrentProfile())
+		{
+		return;
+		}
+		
+    TAspParam param(iApplicationId, iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+    
+    iContentList->SetProfile(profile);
+    
+    if (aEditMode == EDialogModeEdit || aEditMode == EDialogModeEditMandatory)
+    	{
+    	profile->OpenL(iCurrentProfileId, CAspProfile::EOpenReadWrite,
+                                          CAspProfile::EAllProperties);
+                                          
+    	}
+    else
+    	{
+    	profile->OpenL(iCurrentProfileId, CAspProfile::EOpenRead,
+                                          CAspProfile::EAllProperties);
+    	}
+
+		
+	TAspParam param2(iApplicationId, iSyncSession);
+	param2.iProfile = profile;
+	param2.iMode = aEditMode;
+    param2.iContentList = iContentList;
+    param2.iProfileList = iProfileList;  // needed for unique server id check
+    param2.iDataProviderId = aFocus;
+ 
+#ifdef RD_DSUI_TIMEDSYNC 
+	CAspSettingViewDialog::ShowDialogL(param2);
+#else
+	CAspProfileDialog::ShowDialogL(param2);
+#endif
+
+	iContentList->SetProfile(NULL);
+	CleanupStack::PopAndDestroy(profile);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::CheckMandatoryDataL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSettingDialog::CheckMandatoryDataL()
+	{
+	TInt ret = EMandatoryOk;
+	
+	TRAPD(err, ret = DoCheckMandatoryDataL());
+	
+	User::LeaveIfError(err);
+		
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::DoCheckMandatoryDataL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSettingDialog::DoCheckMandatoryDataL()
+	{
+	if (!HasCurrentProfile())
+		{
+		User::Leave(KErrNotFound);
+		}
+		
+    TAspParam param(iApplicationId, iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+    profile->OpenL(iCurrentProfileId, CAspProfile::EOpenReadWrite,
+                                      CAspProfile::EAllProperties);
+    
+    
+    TInt mandatoryConnectionData = CAspProfile::CheckMandatoryConnData(profile);
+    iContentList->SetProfile(profile);	
+	TInt contentCount = 0;
+	TInt mandatoryContentData = iContentList->CheckMandatoryDataL(contentCount);
+	iContentList->SetProfile(NULL);
+	CleanupStack::PopAndDestroy(profile);
+
+	if (mandatoryConnectionData != EMandatoryOk)
+		{
+		return mandatoryConnectionData;
+		}
+		
+	return mandatoryContentData;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::DeleteProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::DeleteProfileL()
+    {
+
+#ifdef RD_DSUI_TIMEDSYNC 
+	 TAspParam param(iApplicationId, iSyncSession);
+	 CAspProfile* profile = CAspProfile::NewLC(param);
+     TRAPD(err,profile->OpenL(iCurrentProfileId, CAspProfile::EOpenReadWrite,
+                                      CAspProfile::EAllProperties));
+
+	 if (err == KErrLocked)
+   		{
+        TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+		CleanupStack::PopAndDestroy(profile);
+		return;
+	 	}
+	 CAspSchedule* schedule = CAspSchedule::NewLC();
+	
+	 TInt profileId = schedule->ProfileId();
+	 if (profileId == iCurrentProfileId && schedule->IsAutoSyncEnabled())
+	 	{
+		HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_DS_CONF_QUERY_DELETE_AUTO_SYNC_PROFILE);
+		if (!TDialogUtil::ShowConfirmationQueryL(hBuf->Des()))
+			{
+			CleanupStack::PopAndDestroy(hBuf);
+			CleanupStack::PopAndDestroy(schedule);
+	        CleanupStack::PopAndDestroy(profile);
+			return;
+			}
+		CleanupStack::PopAndDestroy(hBuf);
+		schedule->SetProfileId(KErrNotFound);
+		schedule->UpdateSyncScheduleL();
+		schedule->SaveL();
+		}
+	 else
+	 	{
+		TBuf<KBufSize> profileName;
+	 	profile->GetName(profileName);
+	 	HBufC* hBuf1 = CAspResHandler::ReadLC(R_ASP_QUERY_COMMON_CONF_DELETE, profileName);
+
+	 	if (!TDialogUtil::ShowConfirmationQueryL(hBuf1->Des()))
+		    {
+			CleanupStack::PopAndDestroy(hBuf1);
+			CleanupStack::PopAndDestroy(schedule);
+			CleanupStack::PopAndDestroy(profile);
+			return;
+	 		}
+		CleanupStack::PopAndDestroy(hBuf1);
+	 	}
+	CleanupStack::PopAndDestroy(schedule);
+	CleanupStack::PopAndDestroy(profile);
+	if (!IsSyncOnGoingL(iCurrentProfileId))
+		{
+		TRAPD (err1,iSyncSession->DeleteProfileL(iCurrentProfileId));
+		
+		if (err1 == KErrLocked)
+   			{
+       		TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+       		}
+    	User::LeaveIfError(err);
+		}
+	iUpdateTabGroup = ETrue;	
+	SetPreviousProfileL();
+	
+	
+#else
+
+    TAspFilterInfo info;
+    info.iFilterType = TAspFilterInfo::EIncludeDeletableProfile;
+    CAspProfileList* filteredList = iProfileList->FilteredListL(info);
+    CleanupStack::PushL(filteredList);
+    
+	TInt count = filteredList->Count();
+	TInt err = KErrNone;
+
+	if (count == 1)
+		{
+		TAspProfileItem& profile = filteredList->Item(0);
+
+		HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_CONFIRM_DELETE, profile.iProfileName);
+	    if (TDialogUtil::ShowConfirmationQueryL(hBuf->Des()))
+		    {
+		    if (!IsSyncOnGoingL(profile.iProfileId))
+		    	{
+		    	TRAP(err, iSyncSession->DeleteProfileL(profile.iProfileId));
+		    	}
+		    }
+   		
+   		CleanupStack::PopAndDestroy(hBuf);
+    	}
+	
+	else if (count > 0)
+		{
+		TInt profileId = KErrNotFound;
+	    if (TDialogUtil::ShowProfileQueryL(filteredList, profileId,
+	                                       R_ASP_QUERY_TITLE_DELETE_PROFILE))
+		    {
+		    if (!IsSyncOnGoingL(profileId))
+		    	{
+		    	TRAP(err, iSyncSession->DeleteProfileL(profileId));
+		    	}
+		    }
+		}
+
+	if (err == KErrLocked)
+   		{
+        TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+        }
+    User::LeaveIfError(err);
+    
+	CleanupStack::PopAndDestroy(filteredList);
+
+#endif
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::ShowLogDialogL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::ShowLogDialogL()
+    {
+    
+	TAspParam param(iApplicationId, iSyncSession);
+	TAspProfileItem& profile = CurrentProfileL();
+	param.iProfileId = profile.iProfileId;
+
+#ifdef RD_DSUI_TIMEDSYNC 
+   	
+	CAspSchedule* schedule = CAspSchedule::NewLC();
+	if (iCurrentProfileId == schedule->ProfileId())
+		{
+		TInt asProfileId = schedule->AutoSyncProfileId();
+		CAspProfile* asProfile = CAspProfile::NewLC(param);
+		asProfile->OpenL(asProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+
+		/*if (asProfile->LastSync() > profile.iLastSync)
+			{
+			param.iProfileId = asProfileId;
+			}*/	
+		TTime now;
+		now.HomeTime();
+		if (profile.iLastSync == 0)
+			{
+			param.iProfileId = asProfileId;
+			}
+		else if ((asProfile->LastSync()< now && profile.iLastSync < now)
+								|| (asProfile->LastSync() > now && profile.iLastSync > now))
+			{
+			if (asProfile->LastSync() > profile.iLastSync)
+				{
+				param.iProfileId = asProfileId;
+				}
+			}
+		else if	((asProfile->LastSync()< now && profile.iLastSync > now))
+			{
+			param.iProfileId = asProfileId;
+			}
+		CleanupStack::PopAndDestroy(asProfile);
+		}
+	
+	CleanupStack::PopAndDestroy(schedule);
+		
+#endif   
+	
+
+    CAspLogDialog* dialog = CAspLogDialog::NewL(param);
+    CleanupStack::PushL(dialog);
+        
+    dialog->ShowDialogL();
+        
+    CleanupStack::PopAndDestroy(dialog);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::ShowAutoSyncDialogL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::ShowAutoSyncDialogL()
+    {
+    
+    CAspSchedule* schedule = CAspSchedule::NewLC();
+	if (schedule->IsAutoSyncEnabled())
+		{
+		TInt profileId = schedule->ProfileId();
+		if(profileId != iCurrentProfileId && profileId != KErrNotFound)
+			{
+			if(!TDialogUtil::ShowConfirmationQueryL(R_ASP_QUERY_AUTO_SYNC_ON))
+				{
+				CleanupStack::PopAndDestroy(schedule);
+				return ;
+				}
+			}
+		}
+    CleanupStack::PopAndDestroy(schedule);
+	
+	TAspParam param(iApplicationId, iSyncSession);
+    param.iProfileList = iProfileList;
+	param.iProfile = NULL;
+	param.iContentList = iContentList;
+	iAutoSyncDialog = ETrue;
+ 	CAspScheduleDialog::ShowDialogL(param);
+ 	iAutoSyncDialog = EFalse;
+ 	
+#ifdef RD_DSUI_TIMEDSYNC 
+	UpdateTabsL();
+#endif
+	
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::ChangeProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::ChangeProfileL()
+    {
+    if (iProfileList->Count() == 0)
+    	{
+    	return;
+    	}
+    	
+	TInt profileId = KErrNotFound;
+	if (TDialogUtil::ShowProfileQueryL(iProfileList, profileId, 
+	                                   R_ASP_QUERY_TITLE_CHANGE_PROFILE))
+		{
+		if (profileId == iCurrentProfileId)
+			{
+			return;
+			}
+			
+		SetCurrentProfile(profileId);
+		//ShowCurrentProfileInfo();
+		UpdateListBoxL();
+		
+#ifdef RD_DSUI_TIMEDSYNC //RD_DSUI_NO_TIMEDSYNC
+
+		UpdateTabsL();
+#else
+		UpdateNavipaneL(iCurrentProfileName);
+#endif
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::CopyFromServerL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::CopyFromServerL()
+	{
+	if (!TDialogUtil::ShowConfirmationQueryL(R_ASP_COPY_FROM_SERVER))
+		{
+		return;
+		}
+
+	TRAPD(err, DoSyncProfileL(ESyncDirectionRefreshFromServer));
+	
+	if (err == KErrLocked)
+		{
+		TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+		}
+	User::LeaveIfError(err);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::SyncProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::SyncProfileL()
+	{
+		
+	if (IsProfileLockedL(iCurrentProfileId))
+		{
+		TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+		return;
+		}
+	
+	TRAPD(err, DoSyncProfileL(KErrNotFound));
+	User::LeaveIfError(err);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::DoSyncProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::DoSyncProfileL(TInt aSyncType)
+	{
+    __ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrGeneral));
+    	
+	if (iProfileList->Count() == 0)
+		{
+	    if (TDialogUtil::ShowConfirmationQueryL(R_ASP_QUERY_NO_PROFILES))
+		    {
+		    CreateProfileL();
+		    }
+		    
+		return;
+    	}
+    
+    //check PS key
+    TInt keyVal = 0;//EDataSyncNotRunning
+    TInt err = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
+                                 KDataSyncStatus,
+                                 keyVal );
+    if(err == KErrNone && keyVal)
+    	{
+    	TDialogUtil::ShowInformationNoteL(R_ASP_SYNC_ALREADY_RUNNING);
+		return;
+    	}
+    
+	
+	if (CAspProfile::OtherSyncRunning(iSyncSession))
+		{
+		TDialogUtil::ShowInformationNoteL(R_ASP_SYNC_ALREADY_RUNNING);
+		return;
+		}
+
+     // check that valid current profile exists
+    TInt mandatoryCheck = CheckMandatoryDataL();
+    
+ 	if (mandatoryCheck == EMandatoryNoContent)
+		{
+		TDialogUtil::ShowErrorNoteL(R_ASP_ERR_NOCONTENT);
+		return;
+        }
+	else if (mandatoryCheck != EMandatoryOk)
+		{
+        if (iSettingEnforcement)
+    	    {
+    	    TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_TARM_MANDATORY_MISSING);
+    	    }    	
+		else if (TDialogUtil::ShowConfirmationQueryL(R_ASP_QUERY_MANDATORY_MISSING))
+			{
+			TInt contentCount = 0;
+			TInt incompleteContent = KErrNotFound;
+			TInt taskIndex = KErrNotFound;
+			if (iContentList->CheckMandatoryDataL(contentCount))
+				{
+				TInt count = iContentList->ProviderCount();
+				for (TInt i=0; i<count; i++)
+					{
+					//data provider ids are sorted before task list creation ,so provider id has to be used
+					//to get the correct position of item
+					TAspProviderItem& providerItem = iContentList->ProviderItem(i);
+					taskIndex = iContentList->FindTaskIndexForProvider(providerItem.iDataProviderId);
+					if (taskIndex == KErrNotFound)
+						{
+						//task is not created
+						continue;	
+						}
+					TAspTaskItem& task = iContentList->TaskItem(taskIndex);
+					if (!task.iEnabled)
+						{
+						continue; // task not part of sync - no need to check remote data base
+						}
+					if (!task.iRemoteDatabaseDefined)
+						{
+						incompleteContent = task.iDataProviderId;
+						break;
+						}
+					}
+				}
+			EditProfileL(EDialogModeEditMandatory ,incompleteContent);
+			}
+			
+		return;
+        }
+
+
+	if (!iSyncHandler)
+		{
+    	TAspParam param(iApplicationId, NULL);
+		iSyncHandler = CAspSyncHandler::NewL(param);
+		}
+	else
+		{
+		if (SyncRunning())
+			{
+			TDialogUtil::ShowInformationNoteL(R_ASP_SYNC_ALREADY_RUNNING);
+    		return;
+			}
+		}
+    	
+    iSyncHandler->SetObserver(this);
+
+   	TAspSyncParam param(iApplicationId);
+	param.iProfileId = iCurrentProfileId;
+	if (aSyncType == ESyncDirectionRefreshFromServer)
+		{
+		param.iSyncDirection = aSyncType;
+		}
+
+#ifdef RD_DSUI_TIMEDSYNC 
+	DeleteAutoSyncHistory();
+#endif
+
+	iSyncHandler->SynchronizeL(param);
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::DeleteAutoSyncHistory
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::DeleteAutoSyncHistory()
+	{
+	TAspParam param(iApplicationId, iSyncSession);
+	CAspSchedule* schedule = CAspSchedule::NewLC();
+	if (schedule->IsAutoSyncEnabled() && iCurrentProfileId == schedule->ProfileId())
+		{
+		TInt asProfileId = schedule->AutoSyncProfileId();
+		CAspProfile* asProfile = CAspProfile::NewLC(param);
+		asProfile->OpenL(asProfileId, CAspProfile::EOpenReadWrite, CAspProfile::EAllProperties);
+		asProfile->DeleteHistory();
+		CleanupStack::PopAndDestroy(asProfile);
+		}
+	CleanupStack::PopAndDestroy(schedule);
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::CreateProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::CreateProfileL()
+	{
+	TAspParam param(iApplicationId, iSyncSession);
+	param.iProfileList = iProfileList;
+	
+	CAspProfileWizardDialog::ShowDialogL(param);
+
+#ifdef RD_DSUI_TIMEDSYNC 
+	iUpdateTabGroup = ETrue;
+#endif
+
+	if (param.iReturnValue == KErrNone && param.iProfileId != KErrNotFound)
+		{
+		SetCurrentProfile(param.iProfileId);
+		UpdateListBoxL();
+#ifdef RD_DSUI_TIMEDSYNC 
+	
+		UpdateTabsL();
+#else
+		UpdateNavipaneL(iCurrentProfileName);
+#endif
+		}
+	else
+	    {
+#ifdef RD_DSUI_TIMEDSYNC 
+    
+        UpdateTabsL();
+#endif
+	    }
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::IconL
+// 
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CAspSettingDialog::IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex)
+	{
+    return TDialogUtil::CreateIconL(aId, aFileName, aFileIndex, aFileMaskIndex);
+	}
+
+	
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::UpdateListBoxL
+//	
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::UpdateListBoxL()
+	{
+	SetCurrentIndex();
+	
+	CAknDoubleLargeStyleListBox* listBox = ListBox();
+	CDesCArray* items = (CDesCArray*) listBox->Model()->ItemTextArray();
+	items->Reset();
+    listBox->ItemDrawer()->ClearAllPropertiesL();
+   
+	TInt count = iContentList->ProviderCount();
+
+	for (TInt i=0; i<count; i++)
+		{
+		HBufC* firstLine = NULL;
+		HBufC* secondLine = NULL;
+				
+		TAspProviderItem& providerItem = iContentList->ProviderItem(i);
+		
+		firstLine = CAspResHandler::GetContentNameLC(
+		            providerItem.iDataProviderId, providerItem.iDisplayName);
+		
+		TInt index = iContentList->FindTaskIndexForProvider(providerItem.iDataProviderId);
+		if (providerItem.iDataProviderId == KUidNSmlAdapterEMail.iUid )
+		{
+		
+			if(!providerItem.iHasDefaultDataStore)
+			{
+			TInt providerListIndex = iContentList->FindProviderIndex(providerItem.iDataProviderId);
+			
+			CListBoxView* view = iSettingListBox->View();
+
+			view->DeselectItem(providerListIndex);
+			}
+		}
+		if (index != KErrNotFound)
+			{
+			TAspTaskItem& task = iContentList->TaskItem(index);
+	
+		    if (task.iLastSync != 0) // task has been synchronised
+			    {
+			    secondLine = TUtil::SyncTimeLC(task.iLastSync);
+			    }
+		    else
+			    {
+			    secondLine = CAspResHandler::ReadLC(R_ASP_NOT_SYNCED);
+			    }
+			}
+		else
+			{
+			secondLine = CAspResHandler::ReadLC(R_ASP_NOT_SYNCED);
+			}
+		
+		
+		TPtr ptr1 = firstLine->Des();
+		AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr1);
+		TPtr ptr2 = secondLine->Des();
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion(ptr2);
+
+		HBufC* hBuf = NULL;
+		hBuf = TDialogUtil::ConstructListBoxItemLC(firstLine->Des(), secondLine->Des(), 0);
+
+		items->AppendL(hBuf->Des());
+		
+		CleanupStack::PopAndDestroy(hBuf);
+		CleanupStack::PopAndDestroy(secondLine);
+		CleanupStack::PopAndDestroy(firstLine);
+		}
+
+	listBox->HandleItemAdditionL();
+	
+	if (listBox->Model()->NumberOfItems() == 0)
+		{
+	    iStatusPaneHandler->SetNaviPaneTitle(KNullDesC);
+		}
+	else
+		{
+		UpdateContentSelectionL();
+		
+		TInt current = CurrentIndex();
+		if (current != KErrNotFound)
+			{
+			ListBox()->SetCurrentItemIndexAndDraw(current);
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::UpdateContentSelectionL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::UpdateContentSelectionL()
+    {
+    // update selected task check boxes from current profile content list
+    CListBoxView::CSelectionIndexArray* arrayOfSelectionIndexes = NULL;
+    arrayOfSelectionIndexes = new (ELeave) CArrayFixFlat<TInt>(KDefaultArraySize);
+    CleanupStack::PushL(arrayOfSelectionIndexes);
+
+	if (HasCurrentProfile())
+		{
+		iContentList->GetIncludedProviders(arrayOfSelectionIndexes);
+		}
+        
+    iSettingListBox->SetSelectionIndexesL(arrayOfSelectionIndexes);
+
+    CleanupStack::PopAndDestroy(arrayOfSelectionIndexes);
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::UpdateNavipaneL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::UpdateNavipaneL(const TDesC& aText)
+	{
+	if (iCurrentProfileName.Compare(aText) != 0)
+		{
+		TUtil::StrCopy(iCurrentProfileName, aText);
+		}
+		
+	iStatusPaneHandler->SetNaviPaneTitleL(iCurrentProfileName);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::HandleSyncEventL (from MAspSyncObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::HandleSyncEventL(TInt /*aError*/, TInt aInfo1)
+	{
+    iDbNotifier->CreateUpdateEventL(aInfo1, KErrNone);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::HandleDbEventL (from MAspDbEventHandler)
+//
+// This function updates UI when it receives sync profile database
+// events (see AspDbNotifier).
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::HandleDbEventL(TAspDbEvent aEvent)
+	{
+	FLOG( _L("CAspSettingDialog::HandleDbEventL START") );
+
+    switch (aEvent.iType)
+		{
+		case CAspDbNotifier::EClose:
+			{
+			
+#ifdef _DEBUG			
+			LogDatabaseEvent(aEvent);
+#endif		
+	
+			TDialogUtil::ShowErrorNoteL(R_ASP_LOG_ERR_SERVERERROR);
+            iAvkonAppUi->ProcessCommandL(EAknCmdExit); //  close sync app
+			break;
+			}
+		
+		case CAspDbNotifier::EUpdate:
+			{
+			iProfileList->ReadProfileL(aEvent.iProfileId);
+			iProfileList->Sort();
+      	    if (IsCurrentProfile(aEvent.iProfileId))
+            	{
+            	if (!iContentList->IsLocked())
+            		{
+            		SetCurrentProfile(aEvent.iProfileId);
+                    UpdateListBoxL();
+#ifdef RD_DSUI_TIMEDSYNC 
+					UpdateTabsL();
+#else
+                    UpdateNavipaneL(iCurrentProfileName);
+#endif               
+            		}
+            	}
+			
+#ifdef _DEBUG
+            LogDatabaseEvent(aEvent);
+#endif
+			
+			break;
+			}
+
+		case CAspDbNotifier::EDelete:
+			{
+
+#ifdef _DEBUG
+            LogDatabaseEvent(aEvent);
+#endif
+
+            TInt index = iProfileList->ListIndex(aEvent.iProfileId);
+            if (index != KErrNotFound)
+            	{
+            	iProfileList->Remove(aEvent.iProfileId);
+            	if (IsCurrentProfile(aEvent.iProfileId))
+            		{
+            		if (!iContentList->IsLocked())
+            		    {
+            		    SetCurrentProfileL(); // set new current profile
+                        UpdateListBoxL();
+#ifdef RD_DSUI_TIMEDSYNC 
+					UpdateTabsL();
+#else
+                    UpdateNavipaneL(iCurrentProfileName);
+#endif            		 
+						}
+            		}
+            	}
+			break;
+			}
+
+		case CAspDbNotifier::EUpdateAll:
+			{
+
+#ifdef _DEBUG			
+			LogDatabaseEvent(aEvent);
+#endif
+
+			iProfileList->ReadAllProfilesL(CAspProfileList::ENoMandatoryCheck);
+			iProfileList->Sort();
+           	if (!iContentList->IsLocked())
+            	{
+            	SetCurrentProfile(iCurrentProfileId); // set new current profile
+                UpdateListBoxL();
+#ifdef RD_DSUI_TIMEDSYNC 
+					UpdateTabsL();
+#else
+                    UpdateNavipaneL(iCurrentProfileName);
+#endif         	
+				}
+
+			break;
+			}
+
+		default:
+			break;
+		}
+		
+	FLOG( _L("CAspSettingDialog::HandleDbEventL END") );
+	}
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::HandleOKL()
+// 
+// -----------------------------------------------------------------------------
+//
+
+void CAspSettingDialog::HandleOKL()
+{
+	
+	if (iProfileList->Count() == 0)
+			{
+			return;
+			}
+        
+        if (IsProfileLockedL(iCurrentProfileId))
+        	{
+        	TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+			CancelCheckboxEvent();
+			return;
+			}
+        
+        if (iSettingEnforcement)
+			{
+			CancelCheckboxEvent();
+			TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_MAIN_LOCKED);
+			return ;  // leave dialog open;
+			}
+        
+        if (!CheckEmailSelection())
+        	{
+        	return ;  // leave dialog open;
+        	}
+				
+		TInt ret =  SaveCurrentProfile();
+		if (ret != KErrNone)
+			{
+			CancelCheckboxEvent();
+			}
+			
+		return ;
+}
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::HandleListBoxEventL (from MEikListBoxObserver)
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+	{
+	   if( AknLayoutUtils::PenEnabled() )  
+	   {
+	   	 switch(aEventType)
+		{
+			case EEventItemSingleClicked :
+			     HandleOKL();
+			     break;
+			default:
+			     break;
+		}
+	   }
+	  
+    }
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::HandleActiveCallL (from MAspActiveCallerObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::HandleActiveCallL(TInt /*aCallId*/)
+	{
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::SetCurrentIndex
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::SetCurrentIndex()
+	{
+	TInt count = ListBox()->Model()->NumberOfItems();
+
+	if (count == 0)
+		{
+		iCurrentListBoxIndex = KErrNotFound;  // empty list
+		}
+	else
+		{
+		iCurrentListBoxIndex = ListBox()->CurrentItemIndex();
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::CurrentIndex
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSettingDialog::CurrentIndex()
+	{
+	TInt count = ListBox()->Model()->NumberOfItems();
+	
+	if (count == 0)
+		{
+		iCurrentListBoxIndex = KErrNotFound;
+		}
+	else if (iCurrentListBoxIndex >= count)
+		{
+		iCurrentListBoxIndex = count-1; // last listbox item
+		}
+	else if (iCurrentListBoxIndex < 0)
+		{
+		iCurrentListBoxIndex = 0; // first listbox item
+		}
+		
+	return iCurrentListBoxIndex;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::ShowCurrentProfileInfoL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::ShowCurrentProfileInfoL()
+	{
+	TAspProfileItem& item = CurrentProfileL();
+	TBuf<KBufSize> buf;
+    iBearerHandler->GetBearerName(buf, item.iBearer);
+    HBufC* hBuf = CAspResHandler::ReadProfileInfoTextLC(item.iProfileName, buf);
+    ShowPopupNoteL(hBuf->Des());
+    CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::ShowCurrentProfileInfo
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::ShowCurrentProfileInfo()
+	{
+	TRAP_IGNORE(ShowCurrentProfileInfoL());
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::ShowAutoSyncProfileInfoL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSettingDialog::ShowAutoSyncProfileInfo()
+	{
+	TBool ret = EFalse;
+	
+	TRAPD(err, ret = ShowAutoSyncProfileInfoL());
+
+#ifdef RD_DSUI_TIMEDSYNC
+	UpdateTabsL();	
+#endif
+	
+	if (err != KErrNone)
+		{
+		return EFalse;
+		}
+	return ret;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::ShowAutoSyncProfileInfoL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSettingDialog::ShowAutoSyncProfileInfoL()
+	{
+	CAspSchedule* schedule = CAspSchedule::NewLC();
+	
+	if (!schedule->CanSynchronizeL())
+    	{
+   	    CleanupStack::PopAndDestroy(schedule);
+	    return EFalse;
+    	}
+	
+	TInt autoSyncError = schedule->Error();
+	if (autoSyncError != KErrNone)
+		{
+
+		TInt profileId = schedule->ProfileId();
+		TInt asProfileId = schedule->AutoSyncProfileId();
+		TAspParam param(iApplicationId, iSyncSession);
+		CAspProfile* asProfile = CAspProfile::NewLC(param);
+		asProfile->OpenL(asProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+		CAspProfile* profile = CAspProfile::NewLC(param);
+		profile->OpenL(profileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+
+		//display auto sync error query only if profile hasn't been manually synced after last auto sync
+		if (asProfile->LastSync() >= profile->LastSync())
+			{
+			if (autoSyncError == CAspAutoSyncHandler::EOtherSyncRunning)
+				{
+				HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_MANUAL_SYNC_OVERRIDE);
+				_LIT(KEmpty, " ");
+				TDialogUtil::ShowMessageQueryL(KEmpty, hBuf->Des());
+   	   			CleanupStack::PopAndDestroy(hBuf);
+				}
+			else
+				{
+				HBufC* hBuf = CAspResHandler::ReadLC(R_ASP_POPUP_AUTO_SYNC_ERROR);
+				_LIT(KNewLine ,"\n");
+				TBuf<KBufSize> buf(hBuf->Des());
+				buf.Append(KNewLine);
+				CAspResHandler::ReadL(iBuf, R_ASP_MAIN_AUTO_ERROR_LOG_LINK);
+				buf.Append(iBuf);
+				CleanupStack::PopAndDestroy(hBuf);
+				hBuf = HBufC::NewLC(buf.Size());
+				TPtr ptr(hBuf->Des());
+				ptr = buf;
+
+			   	TDialogUtil::ShowAutoSyncMessageQueryL(hBuf->Des());
+	   	   		CleanupStack::PopAndDestroy(hBuf);
+				}
+	  	    
+   	    	schedule->SetError(KErrNone);
+   	    	schedule->SaveL();
+
+			CleanupStack::PopAndDestroy(profile);
+			CleanupStack::PopAndDestroy(asProfile);
+			CleanupStack::PopAndDestroy(schedule);
+   	    	return ETrue;
+			}
+		
+		CleanupStack::PopAndDestroy(profile);
+		CleanupStack::PopAndDestroy(asProfile);
+		
+		schedule->SetError(KErrNone);
+   	    schedule->SaveL();
+		}
+
+    
+    TTime nextSync;
+    schedule->GetStartTimeL(nextSync ,ETrue);
+
+    TInt profileIndex = iProfileList->ListIndex(schedule->ProfileId());
+    TAspProfileItem& item = iProfileList->Item(profileIndex); 
+    
+	HBufC* hBuf1 = CAspResHandler::ReadAutoSyncInfoTextLC( item.iProfileName, nextSync);
+	
+	TDialogUtil::ShowInformationNoteL(hBuf1->Des());
+   	CleanupStack::PopAndDestroy(hBuf1);
+    CleanupStack::PopAndDestroy(schedule);
+	return ETrue;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::ShowPopupNote
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::ShowPopupNoteL(const TDesC& aText) 
+    {
+    iPopupNote->SetTextL(aText);
+    iPopupNote->SetTimePopupInView(KSettingDialogPopupDisplayTime);    
+    iPopupNote->ShowInfoPopupNote();    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::Listbox
+//
+// -----------------------------------------------------------------------------
+//
+CAknDoubleLargeStyleListBox* CAspSettingDialog::ListBox()
+	{
+	__ASSERT_DEBUG(iSettingListBox, TUtil::Panic(KErrGeneral));
+
+	return iSettingListBox;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::SyncRunning
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSettingDialog::SyncRunning()
+	{
+    if (!iSyncHandler)
+		{
+		return EFalse;
+		}
+
+	if (iSyncHandler->SyncRunning())
+		{
+		return ETrue;
+		}
+
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingDialog::UpdateCbaL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::UpdateCbaL(TInt aResourceId)
+    {
+    CEikButtonGroupContainer& cba = ButtonGroupContainer();
+    cba.SetCommandSetL(aResourceId);
+    cba.DrawDeferred();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingDialog::CancelCheckboxEvent
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspSettingDialog::CancelCheckboxEventL()
+	{
+	CListBoxView* view = iSettingListBox->View();
+    
+    TInt index = view->CurrentItemIndex();
+    TBool selected = view->ItemIsSelected(index);
+    if (selected)
+       	{
+        view->DeselectItem(index);
+       	}
+    else
+    	{
+    	view->SelectItemL(index);
+    	}
+    	
+    iSettingListBox->SetCurrentItemIndex(index);
+    //view->SetCurrentItemIndex(index);
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingDialog::CancelCheckboxEvent
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspSettingDialog::CancelCheckboxEvent()
+	{
+	TRAP_IGNORE(CancelCheckboxEventL());
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingDialog::CheckEmailSelection
+// 
+// ----------------------------------------------------------------------------
+//
+TBool CAspSettingDialog::CheckEmailSelection()
+	{
+	TBool ret = ETrue;
+	
+	TRAPD(err, ret = CheckEmailSelectionL());
+	
+	if (err != KErrNone)
+		{
+		return ETrue;
+		}
+	
+	return ret;
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingDialog::CheckEmailSelectionL
+// 
+// ----------------------------------------------------------------------------
+//
+TBool CAspSettingDialog::CheckEmailSelectionL()
+	{
+	CListBoxView* view = iSettingListBox->View();
+	
+    TInt index = view->CurrentItemIndex();
+    TAspProviderItem& item = iContentList->ProviderItem(index);
+    TBool selected = view->ItemIsSelected(index);
+    
+    if (item.iDataProviderId != KUidNSmlAdapterEMail.iUid)
+    	{
+    	return ETrue;
+    	}
+        
+    if (!selected)
+    	{
+    	return ETrue;
+    	}
+    
+    iContentList->UpdateDataProviderL(item.iDataProviderId);
+    if (!item.iHasDefaultDataStore)
+    	{
+    	CancelCheckboxEvent();
+    	TDialogUtil::ShowErrorNoteL(R_ASP_NO_MAILBOXES);
+    	return EFalse;
+    	}
+    	
+    if (HasCurrentProfile())
+    	{
+    	TAspParam param(iApplicationId, iSyncSession);
+	    CAspProfile* profile = CAspProfile::NewLC(param);
+        profile->OpenL(iCurrentProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+      
+	    TInt num = profile->ProtocolVersion();
+	    CleanupStack::PopAndDestroy(profile);
+
+    	}
+    
+    	
+    
+    return ETrue;
+	}
+
+// ----------------------------------------------------------------------------
+// CAspSettingDialog::IsProfileLockedL
+// Checks if a particular profile is already opened
+// ----------------------------------------------------------------------------
+//
+TBool CAspSettingDialog::IsProfileLockedL(TInt aProfileId)
+{
+	
+	TAspParam param(iApplicationId, iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+	
+	
+	TRAPD(err, profile->OpenL(aProfileId, CAspProfile::EOpenReadWrite,
+                                         CAspProfile::EAllProperties));
+                                         
+    
+	if (err == KErrLocked)
+		{
+		CleanupStack::PopAndDestroy(profile);
+		return ETrue;
+		}
+	else
+		{
+		CleanupStack::PopAndDestroy(profile);
+		return EFalse;
+		}
+	
+}
+// ----------------------------------------------------------------------------
+// CAspSettingDialog::UpdateMiddleSoftKeyLabelL
+// Update the MSK Label
+// ----------------------------------------------------------------------------
+//
+void CAspSettingDialog::UpdateMiddleSoftKeyLabelL(TInt aCommandId,TInt aResourceId)
+{
+	ButtonGroupContainer().RemoveCommandFromStack(KMSKControlId,aCommandId );
+	HBufC* middleSKText = StringLoader::LoadLC( aResourceId );
+
+	ButtonGroupContainer().AddCommandToStackL(
+	KMSKControlId,
+	aCommandId,
+	*middleSKText );
+	CleanupStack::PopAndDestroy( middleSKText );
+}
+
+#ifdef _DEBUG
+
+
+// -----------------------------------------------------------------------------
+// LogDatabaseEvent
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::LogDatabaseEvent(TAspDbEvent aEvent)
+	{
+	TBuf<KBufSize> buf;
+	
+    if (aEvent.iType == CAspDbNotifier::EClose)
+    	{
+    	FLOG( _L("### EClose: close setting dialog ###") );
+    	}
+    else if (aEvent.iType == CAspDbNotifier::EUpdate)
+    	{
+        TInt index = iProfileList->ListIndex(aEvent.iProfileId);
+        if (index != KErrNotFound)
+           	{
+           	TAspProfileItem& item = iProfileList->Item(index);
+            FTRACE( RDebug::Print(_L("EUpdate: %S (%d)"), &item.iProfileName, aEvent.iProfileId) );
+               
+            buf.Format(_L("EUpdate: %S"), &item.iProfileName);
+		    TUtil::Print(buf);
+           	}
+        else
+          	{
+           	FTRACE( RDebug::Print(_L("### EUpdate: profile not found (%d) ###"), aEvent.iProfileId) );
+           	TUtil::Print(_L("EUpdate: profile not found"));
+           	}
+    	}
+    else if (aEvent.iType == CAspDbNotifier::EDelete)
+    	{
+        TInt index = iProfileList->ListIndex(aEvent.iProfileId);
+        if (index != KErrNotFound)
+           	{
+           	TAspProfileItem& item = iProfileList->Item(index);
+		    FTRACE( RDebug::Print(_L("EDelete: %S (%d)"), &item.iProfileName, aEvent.iProfileId) );
+
+            buf.Format(_L("EDelete: %S"), &item.iProfileName);
+		    TUtil::Print(buf);
+           	}
+        else
+           	{
+           	FTRACE( RDebug::Print(_L("EDelete: profile not found (%d)"), aEvent.iProfileId) );
+           	TUtil::Print(_L("EDelete: profile not found"));
+           	}
+    	
+    	}
+    else if (aEvent.iType == CAspDbNotifier::EUpdateAll)
+    	{
+     	FLOG( _L("EUpdateAll: read all profiles") );
+     	TUtil::Print(_L("EUpdateAll: read all profiles"));
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// TestL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingDialog::TestL()
+    {
+    TAspParam param(iApplicationId, iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+    profile->OpenL(iCurrentProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
+      
+	TBuf<128> buf; TBuf<128> buf2;
+	profile->GetPassword(buf);
+	TInt len = buf.Length();
+	buf2.Format(_L("len = %d  text = %S"), len, &buf);
+	TDialogUtil::ShowMessageQueryL(_L("huu"), buf2);
+    CleanupStack::PopAndDestroy(profile);
+    
+    /*
+    CListBoxView* view = iSettingListBox->View();
+    const CListBoxView::CSelectionIndexArray* arr = view->SelectionIndexes();
+    TBuf<128> buf; TBuf<128> buf2;
+    TInt count = arr->Count();
+    for (TInt i=0; i<count; i++)
+     	{
+       	buf2.Format(_L("%d "), (*arr)[i]);
+       	buf.Append(buf2);
+       	}
+    TDialogUtil::ShowMessageQueryL(_L("huu"), buf);
+    */
+    
+    /*
+    HBufC* hBuf = iResHandler->ReadProgressTextLC(_L("qwerty ggggggggggggggggggggggg"), CAspState::EPhaseSending);
+    TDialogUtil::ShowMessageQueryL(_L("huu"), hBuf->Des());
+    CleanupStack::PopAndDestroy(hBuf);
+    
+    hBuf = iResHandler->ReadProgressTextLC(_L("qwerty ggggggggggggggggggggggg"), CAspState::EPhaseReceiving);
+    TDialogUtil::ShowMessageQueryL(_L("huu"), hBuf->Des());
+    CleanupStack::PopAndDestroy(hBuf);
+
+    hBuf = iResHandler->ReadProgressTextLC(_L("qwerty ggggggggggggggggggggggg"), 34);
+    TDialogUtil::ShowMessageQueryL(_L("huu"), hBuf->Des());
+    CleanupStack::PopAndDestroy(hBuf);
+    */
+    }
+
+
+#endif
+
+
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspSettingViewDialog.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,756 @@
+/*
+* 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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "AspSettingViewDialog.h"
+#include "AspProfileDialog.h"
+#include "AspContentDialog.h"
+#include "AspScheduleDialog.h"
+
+#include "AspSyncUtil.rh"
+#include "AspDebug.h"
+#include <csxhelp/ds.hlp.hrh>
+
+#include <aspsyncutil.mbg>  // for bitmap enumerations
+#include <AknIconArray.h>   // for GulArray
+
+#include "AspSchedule.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingViewDialog::ShowDialogL
+// 
+// -----------------------------------------------------------------------------
+TBool CAspSettingViewDialog::ShowDialogL(const TAspParam& aParam)
+	{
+    CAspSettingViewDialog* dialog = CAspSettingViewDialog::NewL(aParam);
+
+	TBool ret = dialog->ExecuteLD(R_ASP_SETTING_VIEW_DIALOG);
+
+    return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingViewDialog::NewL
+//
+// -----------------------------------------------------------------------------
+CAspSettingViewDialog* CAspSettingViewDialog::NewL(const TAspParam& aParam)
+    {
+    FLOG( _L("CAspSettingViewDialog::NewL START") );
+
+    CAspSettingViewDialog* self = new ( ELeave )CAspSettingViewDialog (aParam);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    FLOG( _L("CAspSettingViewDialog::NewL END") );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingViewDialog::CAspSettingViewDialog
+// 
+// -----------------------------------------------------------------------------
+//
+CAspSettingViewDialog::CAspSettingViewDialog(const TAspParam& aParam)
+	{
+    iSyncSession = aParam.iSyncSession;
+    iApplicationId = aParam.iApplicationId;
+    iProfile = aParam.iProfile;
+    iContentList = aParam.iContentList;
+    iProfileList = aParam.iProfileList;
+    iEditMode = aParam.iMode;
+	iDataProviderId =aParam.iDataProviderId;
+	iSchedule = aParam.iSchedule;
+    
+       
+	__ASSERT_ALWAYS(iProfile, TUtil::Panic(KErrGeneral));
+	__ASSERT_ALWAYS(iContentList, TUtil::Panic(KErrGeneral));
+	__ASSERT_ALWAYS(iSyncSession, TUtil::Panic(KErrGeneral));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingViewDialog::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::ConstructL()
+    {
+    FLOG( _L("CAspSettingViewDialog::ConstructL START") );
+	
+	// contruct menu for our dialog
+	CAknDialog::ConstructL(R_ASP_SETTING_VIEW_DIALOG_MENU);
+
+	iSettingList = new (ELeave) CArrayPtrFlat<CAspListItemData>(1);
+
+	TAspParam param(KErrNotFound, iSyncSession);
+		
+	// get previous title so it can be restored
+	iStatusPaneHandler = CStatusPaneHandler::NewL(iAvkonAppUi);
+	iStatusPaneHandler->StoreOriginalTitleL();
+	
+	FLOG( _L("CAspSettingViewDialog::ConstructL END") );
+    } 
+
+
+// ----------------------------------------------------------------------------
+// Destructor
+//
+// ----------------------------------------------------------------------------
+//
+CAspSettingViewDialog::~CAspSettingViewDialog()
+    {
+    FLOG( _L("CAspSettingViewDialog::~CAspSettingViewDialog START") );
+
+	if (iSettingList)
+		{
+		iSettingList->ResetAndDestroy();
+	    delete iSettingList;
+		}
+
+	delete iStatusPaneHandler;
+	
+	
+    if (iAvkonAppUi)
+    	{
+    	iAvkonAppUi->RemoveFromStack(this);
+    	}
+
+	FLOG( _L("~CAspSettingViewDialog::~~CAspSettingViewDialog END") );
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspSettingViewDialog::ActivateL
+//
+// Called by system when dialog is activated.
+//------------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::ActivateL()
+	{
+    CAknDialog::ActivateL();
+
+	// this cannot be in ConstructL which is executed before dialog is launched
+	iAvkonAppUi->AddToStackL(this);
+    }
+
+
+//------------------------------------------------------------------------------
+// CAspContentListDialog::GetHelpContext
+//
+//------------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::GetHelpContext(TCoeHelpContext& aContext) const
+	{
+	aContext.iMajor = KUidSmlSyncApp;
+	aContext.iContext = KDS_HLP_SETTINGS;    
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingViewDialog::HandleListBoxEventL
+// 
+// -----------------------------------------------------------------------------
+void CAspSettingViewDialog::HandleListBoxEventL(CEikListBox* /*aListBox*/,
+                                            TListBoxEvent aEventType)
+	{
+    switch ( aEventType )
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemSingleClicked:
+            HandleOKL();
+            break;
+        default:
+           break;
+        }
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingViewDialog::PreLayoutDynInitL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::PreLayoutDynInitL()
+    {
+    iSettingListBox = (CAknSettingStyleListBox*) ControlOrNull (EAspSettingViewDialogList);
+    
+   	__ASSERT_ALWAYS(iSettingListBox, TUtil::Panic(KErrGeneral));
+    
+	iSettingListBox->SetListBoxObserver(this);
+	iSettingListBox->CreateScrollBarFrameL(ETrue);
+	iSettingListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+	                 CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto);
+	
+	SetIconsL();
+	
+	// create array of setting items (iSettingList)
+	CreateSettingsListL();
+
+	// add setting headers into listbox
+	UpdateListBoxL(iSettingListBox, iSettingList);
+
+	if (iDataProviderId)
+		{
+		iSettingListBox->SetCurrentItemIndex(GetIndexFromProvider(iDataProviderId));
+		}
+    iProfile->GetName(iBuf);
+	iStatusPaneHandler->SetTitleL(iBuf);
+	iStatusPaneHandler->SetNaviPaneTitleL(KNullDesC);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingViewDialog::SetIconsL
+//
+// ----------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::SetIconsL()
+    {
+    if (!iSettingListBox)
+    	{
+    	return;
+    	}
+ 
+ 	TFileName bitmapName;
+	CAspResHandler::GetBitmapFileName(bitmapName);
+	CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray(KDefaultArraySize);
+	CleanupStack::PushL(icons);
+	
+	icons->AppendL(IconL(KAknsIIDQgnIndiSettProtectedAdd, bitmapName,
+	                     EMbmAspsyncutilQgn_indi_sett_protected_add,
+	                     EMbmAspsyncutilQgn_indi_sett_protected_add_mask));
+	
+    // delete old icons
+    CArrayPtr<CGulIcon>* arr =
+    iSettingListBox->ItemDrawer()->FormattedCellData()->IconArray();
+    
+    if (arr)
+    	{
+    	arr->ResetAndDestroy();
+	    delete arr;
+	    arr = NULL;
+    	}
+
+	iSettingListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
+	CleanupStack::Pop(icons);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingViewDialog::IconL
+// 
+// -----------------------------------------------------------------------------
+//
+CGulIcon* CAspSettingViewDialog::IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, TInt aFileMaskIndex)
+	{
+    return TDialogUtil::CreateIconL(aId, aFileName, aFileIndex, aFileMaskIndex);
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspSettingViewDialog::ProcessCommandL
+//
+// Handle commands from menu.
+//------------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::ProcessCommandL(TInt aCommandId)
+	{
+	HideMenu();
+
+	switch (aCommandId)
+		{
+		case EAknCmdHelp:
+			{
+			TUtil::LaunchHelpAppL(iEikonEnv);
+            break;
+			}
+
+		case EAspMenuCmdChange:
+		case EAspMenuCmdOpen:
+			{				
+			HandleOKL();
+			break;
+			}
+		    
+        case EAspMenuCmdExit:
+        case EAknCmdExit:
+        case EEikCmdExit:
+			{
+			// close dialog and exit calling application
+			iAvkonAppUi->ProcessCommandL(EAknCmdExit);
+			break;
+			}
+
+		default:			
+		    break;
+		}
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspSettingViewDialog::OkToExitL
+//
+//------------------------------------------------------------------------------
+//
+TBool CAspSettingViewDialog::OkToExitL(TInt aButtonId)
+	{
+	if (aButtonId == EEikBidCancel || aButtonId == EAknSoftkeyBack)
+		{
+		return ETrue; // close dialog
+		}
+
+	if (aButtonId == EAknSoftkeyOpen)  // MSK
+        {
+	    HandleOKL();
+		return EFalse;  // leave dialog open
+		}
+
+	return CAknDialog::OkToExitL(aButtonId);
+	}
+
+
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingViewDialog::OfferKeyEventL
+// 
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CAspSettingViewDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+	{
+	if (aType == EEventKey)
+		{
+		switch (aKeyEvent.iCode)
+			{
+			case EKeyEscape:  // framework calls this when dialog must shut down
+				{
+				return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+        		}
+
+			default:
+				{
+			    break;
+				}
+			}
+		}
+
+	return CAknDialog::OfferKeyEventL( aKeyEvent, aType);
+	}
+
+// ----------------------------------------------------------------------------
+// CAspSettingViewDialog::HandleResourceChange
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::HandleResourceChange(TInt aType)
+    {   
+    if (aType == KEikDynamicLayoutVariantSwitch) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        iSettingListBox->SetSize(mainPaneRect.Size());
+        CCoeControl::HandleResourceChange(aType);
+		DrawDeferred();
+	    return;
+		}
+		
+    if (aType == KAknsMessageSkinChange)
+        {
+        TRAP_IGNORE(SetIconsL());
+        }
+		
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+//------------------------------------------------------------------------------
+// CAspSettingViewDialog::HandleOKL
+//
+//------------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::HandleOKL()
+	{
+	CAspListItemData* item = GetItemForIndex(ListBox()->CurrentItemIndex());
+
+	EditSettingItemL(*item);
+	SetVisibility();
+	UpdateListBoxL(iSettingListBox, iSettingList);
+	
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingViewDialog::CreateSettingsListL
+// 
+// Function creates setting list array (iSettingsList).
+// ----------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::CreateSettingsListL()
+	{
+	
+	AddProfileSettingItemL();
+#ifdef RD_DSUI_TIMEDSYNC
+
+	AddSchedulingSettingItemL();
+	
+#endif
+	AddContentItemsL();
+	SetVisibility();
+	UpdateListBoxL(iSettingListBox, iSettingList);
+	
+	}
+
+// ----------------------------------------------------------------------------
+// CAspSettingViewDialog::AddProfileSettingItemL
+// 
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::AddProfileSettingItemL()
+	{
+	
+	CAspListItemData* item = CAspListItemData::NewLC();
+	item->SetHeaderL(R_ASP_SETTING_FOLDER_PROFILE);
+	item->iItemId = EAspProfileSetting;
+	item->iItemType = CAspListItemData::ETypeProfileSetting;
+	item->iNumberData = KErrNotFound;
+	iSettingList->AppendL(item);
+	CleanupStack::Pop(item);
+		
+	}
+
+// ----------------------------------------------------------------------------
+// CAspSettingViewDialog::AddSchedulingSettingItemL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::AddSchedulingSettingItemL()
+	{
+    CAspListItemData* item = CAspListItemData::NewLC();
+	item->SetHeaderL(R_ASP_SETTING_FOLDER_SCHEDULE);
+	item->iItemId = EAspSchedulingSetting;
+	item->iItemType = CAspListItemData::ETypeSchedulingSetting;
+	item->iNumberData = KErrNotFound;
+	iSettingList->AppendL(item);
+	CleanupStack::Pop(item);
+	}
+
+	
+// ----------------------------------------------------------------------------
+// CAspSettingViewDialog::AddContentItemsL
+// 
+// ----------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::AddContentItemsL()
+	{
+   	TInt count = iContentList->ProviderCount();
+
+	for (TInt i=0; i<count; i++)
+		{
+		TAspProviderItem& providerItem = iContentList->ProviderItem(i);
+		TInt appId = TUtil::AppIdFromProviderId(providerItem.iDataProviderId);
+		if (iApplicationId != EApplicationIdSync && iApplicationId != appId)
+			{
+			continue;
+			}
+				
+		HBufC* firstLine = CAspResHandler::GetContentSettingLC(
+		                                   providerItem.iDataProviderId,
+		                                   providerItem.iDisplayName);
+		
+	    CAspListItemData* item = CAspListItemData::NewLC();
+    
+    	item->SetHeaderL(firstLine->Des());
+	    item->iItemId = EAspSyncContent;
+	    item->iItemType = CAspListItemData::ETypeSyncContent;
+	    item->iNumberData = providerItem.iDataProviderId;
+	    iSettingList->AppendL(item);
+	    CleanupStack::Pop(item);
+	    
+	    CleanupStack::PopAndDestroy(firstLine);
+    	}
+	}
+
+
+// ----------------------------------------------------------------------------
+// CAspSettingViewDialog::UpdateListBoxL
+// 
+// Add settings headers into listbox.
+// ----------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::UpdateListBoxL(CEikTextListBox* aListBox,
+                                       CAspSettingList* aItemList)
+	{
+		
+	CDesCArray* arr = (CDesCArray*)aListBox->Model()->ItemTextArray();
+	arr->Reset();
+
+	TInt count = aItemList->Count();
+	for (TInt i=0; i<count; i++ )
+		{	
+		CAspListItemData* item = (*aItemList)[i];
+			
+		TBool convert = ETrue;
+		if (item->iHidden != EVisibilityHidden)
+			{
+			HBufC* hBuf = item->ListItemTextL(convert);
+			CleanupStack::PushL(hBuf);
+			
+			arr->AppendL(hBuf->Des());
+			
+			// store listbox index (from zero up) into setting item 
+			item->iIndex = arr->Count() - 1;
+
+			CleanupStack::PopAndDestroy(hBuf);
+			}
+		else
+			{
+			item->iIndex = KErrNotFound;
+			}
+		}
+
+	ListBox()->HandleItemAdditionL();
+	}
+
+
+//------------------------------------------------------------------------------
+// CAspSettingViewDialog::EditSettingItemL
+//
+// Calls setting editing functions. 
+//------------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::EditSettingItemL(CAspListItemData& aItem)
+	{
+	TBool ret = KErrNone;
+	switch (aItem.iItemType)
+		{
+    	case CAspListItemData::ETypeProfileSetting:
+    	ret = EditSettingItemProfileSettingL();
+			break;
+
+		case CAspListItemData::ETypeSchedulingSetting:
+    	ret = EditSettingItemSchedulingSettingL();
+			break;
+
+		case CAspListItemData::ETypeSyncContent:
+			ret = EditSettingItemSyncContentL(aItem);
+			break;
+
+		default:
+		    break;
+		}
+	
+		User::LeaveIfError(ret);
+	
+	
+	}
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::EditSettingItemProfileSettingL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSettingViewDialog::EditSettingItemProfileSettingL()
+	{
+ 	TAspParam param(iApplicationId, iSyncSession);
+    param.iProfile = iProfile;
+    param.iProfileList = iProfileList;
+    param.iMode = iEditMode;
+    param.iContentList = iContentList;
+    
+    CAspProfileDialog::ShowDialogL(param);
+    
+    //Update profile name in navi pane ,to reflect any name change during profile editing
+    iProfile->GetName(iBuf);
+	iStatusPaneHandler->SetTitleL(iBuf);
+	iStatusPaneHandler->SetNaviPaneTitleL(KNullDesC);
+     
+    return KErrNone;
+	}
+	
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::EditSettingItemSchedulingSettingL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSettingViewDialog::EditSettingItemSchedulingSettingL()
+	{
+ 	TAspParam param(iApplicationId, iSyncSession);
+    param.iProfileList = iProfileList;
+    param.iProfile = iProfile;
+	param.iContentList = iContentList;
+	param.iSchedule = iSchedule;
+
+	TBool settingEnforcement = TUtil::SettingEnforcementState();
+	
+	CAspSchedule* schedule = CAspSchedule::NewLC();
+	if (schedule->IsAutoSyncEnabled() && !settingEnforcement)
+		{
+		TInt profileId = schedule->ProfileId();
+		if(profileId != iProfile->ProfileId() && profileId != KErrNotFound)
+			{
+			if(!TDialogUtil::ShowConfirmationQueryL(R_ASP_QUERY_AUTO_SYNC_ON))
+				{
+				CleanupStack::PopAndDestroy(schedule);
+				return KErrNone;
+				}
+			}
+		}
+    CleanupStack::PopAndDestroy(schedule);
+
+    CAspScheduleDialog::ShowDialogL(param);
+
+    return KErrNone;
+	}
+
+// -----------------------------------------------------------------------------
+// CAspContentListDialog::EditSettingItemSyncContentL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspSettingViewDialog::EditSettingItemSyncContentL(CAspListItemData& aItem)
+	{
+
+	TAspParam param(iApplicationId, iSyncSession);
+    param.iProfile = iProfile;
+    param.iDataProviderId = aItem.iNumberData;
+    param.iSyncTaskId = KErrNotFound;
+    param.iContentList = iContentList;
+
+    CAspContentDialog::ShowDialogL(param);
+
+	    
+    return KErrNone;
+	}
+
+   
+//-----------------------------------------------------------------------------
+// CAspSettingViewDialog::GetItemForIndex
+// 
+// Find item in list position aIndex.
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspSettingViewDialog::GetItemForIndex(TInt aIndex)
+	{
+	CAspListItemData* item = NULL;
+	
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iIndex == aIndex)
+			{
+			item = temp;
+			break;
+			}
+		}
+
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+//-----------------------------------------------------------------------------
+// CAspSettingViewDialog::SetVisibility
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspSettingViewDialog::SetVisibility()
+	{
+	
+	if (iProfile->BearerType() == EAspBearerInternet)
+		{
+		Item(EAspSchedulingSetting)->iHidden = EVisibilityNormal;
+		}
+	else
+		{
+		Item(EAspSchedulingSetting)->iHidden = EVisibilityHidden;
+		}
+	}
+//-----------------------------------------------------------------------------
+// CAspSettingViewDialog::GetIndexFromProvider
+// 
+// Find index for a provider
+//-----------------------------------------------------------------------------
+//
+TInt CAspSettingViewDialog::GetIndexFromProvider(TInt aDataProvider)
+	{
+	
+	TInt count = iSettingList->Count();
+	TInt index;
+	for (index=0; index<count; index++)
+		{
+		CAspListItemData* temp = (*iSettingList)[index];
+		if (temp->iNumberData == aDataProvider)
+			{
+			break;
+			}
+		}
+	return index;
+	}
+	
+
+//-----------------------------------------------------------------------------
+// CAspSettingViewDialog::Item
+// 
+// Find item with aItemId.
+//-----------------------------------------------------------------------------
+//
+CAspListItemData* CAspSettingViewDialog::Item(TInt aItemId)
+	{
+	CAspListItemData* item = NULL;
+
+	TInt count = iSettingList->Count();
+	for (TInt i=0; i<count; i++)
+		{
+		CAspListItemData* temp = (*iSettingList)[i];
+		if (temp->iItemId == aItemId)
+			{
+			item = temp;
+			break;
+			}
+		}
+	
+	__ASSERT_ALWAYS(item, TUtil::Panic(KErrGeneral));
+
+    return item;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSettingViewDialog::ListBox
+// 
+// -----------------------------------------------------------------------------
+//
+CAknSettingStyleListBox* CAspSettingViewDialog::ListBox()
+	{
+	return iSettingListBox;
+	}
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspState.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,271 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "AspState.h"
+#include "AspUtil.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CAspState::NewL
+//
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CAspState* CAspState::NewL()
+    {
+    CAspState* self = new (ELeave) CAspState();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspState::~CAspState()
+    {
+    delete iSyncContent;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspState::CAspState
+//
+// -----------------------------------------------------------------------------
+//
+CAspState::CAspState()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspState::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspState::ConstructL()
+    {
+	Reset();
+	
+	iSyncContent = HBufC::NewL(0);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspState::Reset
+//
+// -----------------------------------------------------------------------------
+//
+void CAspState::Reset()
+    {
+	iSyncPhase = EPhaseNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspState::SetSyncPhase
+//
+// -----------------------------------------------------------------------------
+//
+void CAspState::SetSyncPhase(TInt aPhase)
+	{
+	if (aPhase != iSyncPhase)
+		{
+		iSyncPhase = aPhase;
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspState::SyncPhase
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspState::SyncPhase()
+	{
+	return iSyncPhase;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspState::IncreaseProgress
+//
+// -----------------------------------------------------------------------------
+//
+void CAspState::IncreaseProgress()
+	{
+	iProgressCount++;
+	iProgressCount2++;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspState::IncreaseProgress
+//
+// -----------------------------------------------------------------------------
+//
+void CAspState::IncreaseProgress(TInt aCount)
+	{
+	if (aCount > 0)
+		{
+		iProgressCount = iProgressCount + aCount;
+		iProgressCount2++;
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspState::Progress
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspState::Progress()
+	{
+	return iProgressCount;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspState::SetProgress
+//
+// -----------------------------------------------------------------------------
+//
+/*
+void CAspState::SetProgress(TInt aCount)
+	{
+	if (aCount >= 0 && aCount <= KTotalProgress)
+		{
+		iProgressCount = aCount;
+		iProgressCount2++;
+		}
+	}
+*/
+
+// -----------------------------------------------------------------------------
+// CAspState::SetTotalProgress
+//
+// -----------------------------------------------------------------------------
+//
+void CAspState::SetTotalProgress(TInt aCount)
+	{
+	if (aCount < 0)
+		{
+		iTotalProgressCount = KTotalProgressUnknown;
+		return;
+		}
+		
+	iTotalProgressCount = aCount;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspState::TotalProgress
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspState::TotalProgress()
+	{
+	return iTotalProgressCount;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspState::FirstProgress
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspState::FirstProgress()
+	{
+	if (iProgressCount2 == 1)
+		{
+		return ETrue;
+		}
+		
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspState::SetContentL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspState::SetContentL(const TDesC& aText)
+	{
+	delete iSyncContent;
+	iSyncContent = NULL;
+	iSyncContent = aText.AllocL();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspState::Content
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC& CAspState::Content()
+	{
+	__ASSERT_ALWAYS(iSyncContent, TUtil::Panic(KErrGeneral));
+		
+	return *iSyncContent;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspState::ResetProgress
+//
+// -----------------------------------------------------------------------------
+//
+void CAspState::ResetProgress()
+	{
+	iProgressCount = 0;
+	iProgressCount2 = 0;
+	iTotalProgressCount = 0;
+	
+	TRAP_IGNORE(SetContentL(KNullDesC));
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspState::ProgressKnown
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspState::ProgressKnown()
+	{
+	if (iTotalProgressCount == KTotalProgressUnknown)
+		{
+		return EFalse;
+		}
+
+	return ETrue;
+	}
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspSyncHandler.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,1470 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDES
+#include "AspSyncHandler.h"
+#include "AspDebug.h"
+#include "AspSettingDialog.h"
+
+#include <aspsyncutil.mbg>  // for progress dialog bitmap enumerations
+
+#include <SyncMLErr.h>  // sync error codes
+
+#include <ecom/ecom.h>
+#include <ecom/implementationinformation.h>
+#include <rconnmon.h>
+#include <e32std.h> //For TRequestStatus
+#include <e32property.h>
+#include "CPreSyncPlugin.h"
+#include "AspPreSyncPluginInterface.h"
+
+#include <DataSyncInternalPSKeys.h>
+#include <featmgr.h>
+
+/******************************************************************************
+ * class TAspSyncParam
+ ******************************************************************************/
+
+
+// -------------------------------------------------------------------------------
+// TAspSyncParam::TAspSyncParam
+//
+// -------------------------------------------------------------------------------
+//
+TAspSyncParam::TAspSyncParam(TInt aApplicationId)
+ : iApplicationId(aApplicationId), iProfileId(KErrNotFound), iJobId(KErrNotFound),
+   iTaskId(KErrNotFound), iSyncDirection(KErrNotFound), iDialogMode(EModeDialogNoWait)
+	 {
+	 }
+
+
+
+/******************************************************************************
+ * class CAspSyncHandler
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspSyncHandler* CAspSyncHandler::NewL(const TAspParam& aParam)
+    {
+    FLOG( _L("CAspSyncHandler::NewL START") );
+
+    CAspSyncHandler* self = new (ELeave) CAspSyncHandler(aParam);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+    FLOG( _L("CAspSyncHandler::NewL END") );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspSyncHandler::~CAspSyncHandler()
+    {
+    FLOG( _L("CAspSyncHandler::~CAspSyncHandler START") );
+    
+    delete iProgressDialog;
+	delete iState;
+	delete iResHandler;
+	delete iActiveCaller;
+	delete iTextResolver;
+	
+	delete iContentList;
+	
+    if (iWait && iWait->IsStarted())
+        {
+        iWait->AsyncStop();
+        }
+	delete iWait;
+	
+	RProperty::Delete(KPSUidNSmlDSSyncApp, KDsJobCancel);
+	
+	CloseSyncSession();
+	
+	FLOG( _L("CAspSyncHandler::~CAspSyncHandler END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::ConstructL()
+    {
+	FLOG( _L("CAspSyncHandler::ConstructL START") );
+	
+	iState = CAspState::NewL();
+
+	iActiveCaller = CAspActiveCaller::NewL(this);
+	iTextResolver = CTextResolver::NewL();
+	
+	iServerAlertSync = EFalse;
+	iSyncRunning = EFalse;
+	iSyncError = KErrNone;
+	iCurrentSyncJobId = KErrNotFound;
+	iSyncSessionOpen = EFalse;
+	
+	iWait = new (ELeave) CActiveSchedulerWait();
+	//Define property for cancel operation.
+    static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
+    static _LIT_SECURITY_POLICY_C1(KAllowWriteDeviceDataPolicy, ECapabilityWriteDeviceData);
+	RProperty::Define( KPSUidNSmlDSSyncApp,KDsJobCancel,RProperty::EInt,
+	        KAllowAllPolicy,KAllowWriteDeviceDataPolicy); 
+	RProperty::Set( KPSUidNSmlDSSyncApp,
+	            KDsJobCancel, KErrNone );   
+	FLOG( _L("CAspSyncHandler::ConstructL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::CAspSyncHandler
+//
+// -----------------------------------------------------------------------------
+//
+CAspSyncHandler::CAspSyncHandler(const TAspParam& /*aParam*/)
+	{
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::SetObserver
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::SetObserver(MAspSyncObserver* aObserver)
+	{
+	iSyncObserver = aObserver;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::HandleDialogEventL (from MAspProgressDialogObserver)
+//
+// 
+// Canceling sequence after user presses "Cancel":
+//
+// 1. framework calls CAspProgressDialog2::OkToExitL
+// 2. OkToExitL calls CAspProgressDialog::DialogDismissedL
+// 3. DialogDismissedL calls CAspSyncHandler::HandleDialogEventL
+// 4. HandleDialogEventL cancels sync (RSyncMLDataSyncJob::StopL)
+//    and updates progress dialog text ("Cancelling")
+// 5. MSyncMLEventObserver::EJobStop arrives (asynchronously)
+//    and CAspProgressDialog is closed
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::HandleDialogEventL(TInt aButtonId)
+    {
+    FLOG( _L("CAspSyncHandler::HandleDialogEventL START") );
+    
+    TBool syncRunning = SyncRunning();
+    
+	//  close handling (eg. end key)
+	if (aButtonId == EKeyPhoneEnd && syncRunning)
+		{
+        //Set Cancel  property when user cancel the Caopy All from Server. 
+		RProperty::Set( KPSUidNSmlDSSyncApp,
+		                KDsJobCancel, KErrCancel );
+		TRAPD(err, iSyncJob.StopL());
+
+		if (err != KErrNone)
+			{
+			FLOG( _L("### RSyncMLDataSyncJob::StopL failed (%d) ###"), err );
+			}
+
+	    iSyncJob.Close(); // this can be done when job has not been opened
+
+	    CloseSyncSession();
+
+		iSyncRunning = EFalse;
+		
+	 	if (iIsSynchronousOperation && iWait->IsStarted())
+		    {
+	        iWait->AsyncStop();
+		    }
+
+		
+		FLOG( _L("CAspSyncHandler::HandleDialogEventL: end key handling done") );
+		FLOG( _L("CAspSyncHandler::HandleDialogEventL END") );
+		return;
+		}
+		
+	// cancel key handling
+	if (aButtonId == EEikBidCancel && syncRunning)
+		{
+        RProperty::Set( KPSUidNSmlDSSyncApp,
+                KDsJobCancel, KErrCancel );
+    
+		if (iStopEventReceived)
+			{
+			CompleteWithDelay(KErrNone);
+        	FLOG( _L("### EJobStop already received ###") );
+        	FLOG( _L("CAspSyncHandler::HandleDialogEventL END") );
+	        return;
+			}
+			
+		TInt jobId = CAspProfile::CurrentJob(&iSyncSession);
+       	if (jobId != iCurrentSyncJobId)
+	        {
+	        CompleteWithDelay(KErrNotFound);
+
+	        FLOG( _L("### job conflict (%d/%d) ###"), iCurrentSyncJobId, jobId );
+        	FLOG( _L("CAspSyncHandler::HandleDialogEventL END") );
+	        return;
+	        }
+
+		TRAPD(err, iSyncJob.StopL());
+       	if (err != KErrNone)
+	        {
+	        CompleteWithDelay(err);
+
+	        FLOG( _L("### RSyncMLDataSyncJob::StopL failed (%d) ###"), err );
+        	FLOG( _L("CAspSyncHandler::HandleDialogEventL END") );
+	        return;
+	        }
+		    
+	    State()->SetSyncPhase(CAspState::EPhaseCanceling);
+        UpdateDialog();
+        
+        FLOG( _L("CAspSyncHandler::HandleDialogEventL: cancel key handling done") );
+		}
+		
+	FLOG( _L("CAspSyncHandler::HandleDialogEventL END") );
+    }
+
+
+TBool CAspSyncHandler::IsRoamingL()
+    {
+    RConnectionMonitor conMon;
+    
+    conMon.ConnectL();
+
+    TRequestStatus status;
+    TInt registrationStatus(0);
+
+    //check network status
+    conMon.GetIntAttribute(EBearerIdGSM, 0, KNetworkRegistration, 
+                            registrationStatus, status);
+
+    User::WaitForRequest(status);
+    conMon.Close();
+    
+    if (registrationStatus == ENetworkRegistrationRoaming)
+        {
+        return ETrue;   
+        }
+        
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::ReadRepositoryL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::ReadRepositoryL(TInt aKey, TInt& aValue)
+    {
+    CRepository* rep = CRepository::NewLC(KCRUidNSmlDSApp);
+    TInt err = rep->Get(aKey, aValue);
+    User::LeaveIfError(err);
+    
+    CleanupStack::PopAndDestroy(rep);
+    }
+
+TInt CAspSyncHandler::BearerTypeL(TInt aProfileId)
+    {    
+    TInt BearerType = KErrNotFound;
+    
+    // sync session
+    RSyncMLSession syncSession;
+    syncSession.OpenL();
+    CleanupClosePushL( syncSession );
+
+    RSyncMLDataSyncProfile syncProfile;
+    syncProfile.OpenL( syncSession, aProfileId, ESmlOpenRead );
+    CleanupClosePushL( syncProfile );
+    
+    // Check if always ask is selected as accesspoint
+    RSyncMLConnection connection;
+
+    TInt err = KErrNone;
+    RArray<TSmlTransportId> arr;
+    
+    TRAP(err, syncProfile.ListConnectionsL(arr));
+    if (err != KErrNone)
+        {
+        syncProfile.Close();
+        CleanupStack::Pop( &syncProfile );
+        return KErrNotFound; 
+        }
+    if (arr.Count() == 0)
+        {
+        syncProfile.Close();
+        CleanupStack::Pop( &syncProfile );
+        arr.Close();  
+        return KErrNotFound; // no connection
+        }
+            
+    TInt transportId = arr[0];
+    arr.Close();
+        
+    TRAP(err, connection.OpenL( syncProfile, transportId ) );
+    CleanupClosePushL( connection );
+
+    if ( err == KErrNone )
+        {
+        TInt id = connection.Identifier();
+        if (id == KUidNSmlMediumTypeInternet.iUid)
+            {
+            BearerType = EAspBearerInternet;
+            }
+        else if (id == KUidNSmlMediumTypeBluetooth.iUid)
+            {
+            BearerType = EAspBearerBlueTooth;
+            }
+        else if (id == KUidNSmlMediumTypeUSB.iUid)
+            {
+            BearerType = EAspBearerUsb;
+            }
+        else if (id == KUidNSmlMediumTypeIrDA.iUid)
+            {
+            BearerType = EAspBearerIrda;
+            }
+        }
+
+    connection.Close();
+    CleanupStack::Pop( &connection );
+    
+    syncProfile.Close();
+    CleanupStack::Pop( &syncProfile );
+            
+    syncSession.Close();
+    CleanupStack::Pop( &syncSession );
+    return BearerType;
+    }
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::SynchronizeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::SynchronizeL(TAspSyncParam& aSyncParam)
+	{
+	iServerAlertSync = EFalse;
+	iSyncRunning = EFalse;
+	iCurrentSyncJobId = KErrNotFound;
+	iSyncError = KErrNone;
+	iCompleteEventReceived = EFalse;
+	iStopEventReceived = EFalse;
+	iIsSynchronousOperation = EFalse;
+	TBool bCanSync = ETrue;
+	
+    TInt aValue = 0;
+    ReadRepositoryL(KNSmlDSRoamingFeature, aValue);
+    if(( IsRoamingL() ) && (aValue == EAspRoamingSettingFeatureEnabled))
+        {
+           TInt bearerType = BearerTypeL(aSyncParam.iProfileId);
+           if (bearerType == EAspBearerInternet)           
+            {
+            CPreSyncPluginInterface* syncPluginInterface = CPreSyncPluginInterface::NewL();
+            CPreSyncPlugin* syncPlugin = 
+                syncPluginInterface->InstantiateRoamingPluginLC(aSyncParam.iProfileId);
+
+            if(syncPlugin->IsSupported())
+                {
+                bCanSync = syncPlugin->CanSyncL();
+                }
+
+            CleanupStack::PopAndDestroy(syncPlugin);
+            //syncPluginInterface->UnloadPlugIns();
+            delete  syncPluginInterface;   
+
+            if(!bCanSync)
+                {
+                return;
+                }
+            }        
+        }	
+	
+	State()->SetSyncPhase(CAspState::EPhaseConnecting);
+	State()->ResetProgress();
+	//State()->SetTotalProgress(KTotalProgress);
+	
+	TRAPD(err, DoSynchronizeL(aSyncParam));
+	
+	if (err != KErrNone)
+		{
+		SynchronizeCompleted(err);
+     	return;
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::DoSynchronizeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::DoSynchronizeL(TAspSyncParam& aSyncParam)
+	{
+	FLOG( _L("CAspSyncHandler::DoSynchronizeL START") );
+    
+	 //set the cancel Pub sub key to none
+	if(aSyncParam.iSyncDirection == ESyncDirectionRefreshFromServer)
+	    {
+	    RProperty::Set( KPSUidNSmlDSSyncApp,
+	            KDsJobCancel, KErrNone );
+	    }
+	iApplicationId = aSyncParam.iApplicationId;
+	iProfileId = aSyncParam.iProfileId;
+	if (aSyncParam.iDialogMode == EModeDialogWait)
+		{
+		iIsSynchronousOperation = ETrue; // email 3.2 needs synchronous syncing
+		}
+
+	
+	ShowProgressDialogL();
+    OpenSyncSessionL();
+    CreateContentListL();
+    
+    iSyncSession.RequestEventL(*this);     // for MSyncMLEventObserver events
+    iSyncSession.RequestProgressL(*this);  // for MSyncMLProgressObserver events
+    
+ 	if (aSyncParam.iTaskId != KErrNotFound && iProfileId != KErrNotFound)
+		{
+		RArray<TSmlTaskId> arr(1);
+		CleanupClosePushL(arr);
+		User::LeaveIfError(arr.Append(aSyncParam.iTaskId));
+		if (aSyncParam.iSyncDirection != KErrNotFound)
+			{
+			TSmlSyncType syncDirection = TAspTask::SmlSyncDirection(aSyncParam.iSyncDirection);
+			iSyncJob.CreateL(iSyncSession, iProfileId, syncDirection, arr);
+			}
+		else
+			{
+			iSyncJob.CreateL(iSyncSession, iProfileId, arr);
+			}
+			
+		CleanupStack::PopAndDestroy(&arr);
+		}
+	else if (iProfileId != KErrNotFound)
+		{
+		if (aSyncParam.iSyncDirection != KErrNotFound)
+			{
+		    TSmlSyncType syncDirection = TAspTask::SmlSyncDirection(aSyncParam.iSyncDirection);
+			iSyncJob.CreateL(iSyncSession, iProfileId, syncDirection);
+			}
+		else
+			{
+		    iSyncJob.CreateL(iSyncSession, iProfileId);
+			}
+		}
+	else
+		{
+		User::Leave(KErrArgument);
+		}
+		
+	iCurrentSyncJobId = iSyncJob.Identifier();
+	iSyncRunning = ETrue;
+	
+	if (iIsSynchronousOperation)
+		{
+		iWait->Start();  // stop here until sync has completed
+		}
+   
+    FLOG( _L("sync job created: app=%d, profile=%d, job=%d, task=%d"), iApplicationId, iProfileId, aSyncParam.iJobId, aSyncParam.iTaskId );
+    FLOG( _L("CAspSyncHandler::DoSynchronizeL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::SynchronizeCompleted
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::SynchronizeCompleted(TInt aError)
+	{
+	FLOG( _L("CAspSyncHandler::SynchronizeCompleted START") );
+	
+	iSyncRunning = EFalse;
+	RProperty::Set( KPSUidNSmlDSSyncApp,
+	                           KDsJobCancel, KErrNone ); 
+	if (aError != KErrNone)
+		{
+		iSyncError = aError;
+		}
+   	
+   	iSyncJob.Close(); // this can be done when job has not been opened
+   	
+    TRAP_IGNORE(Dialog()->CancelProgressDialogL());
+	
+	if (iSyncError != KErrNone)
+		{
+	   	CloseSyncSession();
+   		ShowErrorNote();
+      	
+      	FLOG( _L("### sync failed (%d) ###"), iSyncError );
+		}
+	else
+	    {
+      	CloseSyncSession();
+      	TRAP_IGNORE(TDialogUtil::ShowInformationNoteL(R_ASP_SYNC_COMPLETED));
+	    }
+	    
+    if (iSyncObserver)
+    	{
+        TRAP_IGNORE(iSyncObserver->HandleSyncEventL(iSyncError, iProfileId));
+    	}
+    	
+ 	if (iIsSynchronousOperation && iWait->IsStarted())
+		{
+	    iWait->AsyncStop();
+		}
+	    	
+	FLOG( _L("CAspSyncHandler::SynchronizeCompleted END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::OnSyncMLSessionEvent (from MSyncMLEventObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier, TInt aError, TInt /*aAdditionalData*/)
+	{
+	FLOG( _L("CAspSyncHandler::OnSyncMLSessionEvent START") );
+
+#ifdef _DEBUG
+    LogSessionEvent(aEvent, aIdentifier, aError);
+#endif
+
+    if (iCurrentSyncJobId != aIdentifier)
+    	{
+    	FLOG( _L("### job conflict (%d/%d) ###"), iCurrentSyncJobId, aIdentifier );
+    	FLOG( _L("CAspSyncHandler::OnSyncMLSessionEvent END") );
+    	return; // not our sync job
+    	}
+	
+	if (aEvent == EJobStop)
+		{
+		RProperty::Set( KPSUidNSmlDSSyncApp,
+		                            KDsJobCancel, KErrNone );   
+		
+		iStopEventReceived = ETrue;
+		if (aError != KErrNone)
+			{
+			iSyncError = aError;
+			}
+	
+	    if (State()->SyncPhase() == CAspState::EPhaseCanceling)
+		    {
+		    CompleteWithDelay(aError);
+		    }
+        else if (iCompleteEventReceived || iSyncError != KErrNone)
+		    {
+		    CompleteWithDelay(aError);
+		    }
+		}
+    	
+	if (aEvent == EJobStartFailed || aEvent == EJobRejected)
+		{
+		RProperty::Set( KPSUidNSmlDSSyncApp,
+		                            KDsJobCancel, KErrNone );   
+		CompleteWithDelay(aError);
+		}
+		
+	FLOG( _L("CAspSyncHandler::OnSyncMLSessionEvent END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::CompleteWithDelay
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::CompleteWithDelay(TInt aError)
+	{
+	iActiveCaller->Start(aError, 0); // call SynchronizeCompleted with delay
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::OnSyncMLSyncError (from MSyncMLProgressObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::OnSyncMLSyncError(TErrorLevel aErrorLevel, TInt aError, TInt /*aTaskId*/, TInt /*aInfo1*/, TInt /*aInfo2*/)
+	{
+	FLOG( _L("CAspSyncHandler::OnSyncMLSyncError START") );
+	
+	// just store error code - sync is terminated only in function OnSyncMLSessionEvent
+	if (aErrorLevel == ESmlFatalError || aErrorLevel == ESmlWarning)
+		{
+		iSyncError = aError;
+		}
+		
+#ifdef _DEBUG
+    LogErrorEvent(aErrorLevel, aError);
+#endif
+
+	FLOG( _L("CAspSyncHandler::OnSyncMLSyncError END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::OnSyncMLSyncProgress (from MSyncMLProgressObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::OnSyncMLSyncProgress(TStatus aStatus, TInt aInfo1, TInt /*aInfo2*/)
+	{
+	FLOG( _L("CAspSyncHandler::OnSyncMLSyncProgress START") );
+	
+	if (State()->SyncPhase() == CAspState::EPhaseCanceling)
+		{
+		return; // no progress dialog updating while canceling
+		}
+
+#ifdef _DEBUG
+    LogProgressEvent(aStatus, aInfo1);
+#endif
+	
+	switch (aStatus)
+		{
+		case ESmlConnecting:
+		    State()->SetSyncPhase(CAspState::EPhaseConnecting);
+	        UpdateDialog();
+		    break;
+		case ESmlConnected:
+		    break;
+		case ESmlLoggingOn:
+		    break;
+		case ESmlLoggedOn:
+		    State()->SetSyncPhase(CAspState::EPhaseSynchronizing);
+		    UpdateDialog();
+		    break;
+		case ESmlDisconnected:
+		    State()->SetSyncPhase(CAspState::EPhaseDisconnecting);
+		    UpdateDialog();
+		    break;
+		case ESmlCompleted:
+		    iCompleteEventReceived = ETrue;
+		    
+			if (iStopEventReceived)
+			    {
+			    FLOG( _L("### EJobStop already received ###") );
+			    CompleteWithDelay(iSyncError);
+			    }
+            else
+            	{
+            	State()->SetSyncPhase(CAspState::EPhaseDisconnecting);
+		        UpdateDialog();
+            	}
+		    break;
+
+		case ESmlSendingModificationsToServer:
+		    State()->SetSyncPhase(CAspState::EPhaseSending);
+   		    State()->ResetProgress();
+		    State()->SetTotalProgress(aInfo1); // set total sync event count
+
+     	    UpdateDialog();
+		    break;
+		case ESmlReceivingModificationsFromServer:
+		    State()->SetSyncPhase(CAspState::EPhaseReceiving);
+   		    State()->ResetProgress();
+		    State()->SetTotalProgress(aInfo1); // set total sync event count
+
+	        UpdateDialog();
+		    break;
+		    
+		case ESmlSendingMappingsToServer:
+		    State()->SetSyncPhase(CAspState::EPhaseSynchronizing);
+		    UpdateDialog();
+		    break;
+		
+		default:
+		    break;
+		}
+		
+	FLOG( _L("CAspSyncHandler::OnSyncMLSyncProgress END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::OnSyncMLDataSyncModifications (from MSyncMLProgressObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::OnSyncMLDataSyncModifications(TInt aTaskId, 
+                      const TSyncMLDataSyncModifications& aClientModifications,
+                      const TSyncMLDataSyncModifications& aServerModifications)
+	{
+	
+    if (!Dialog()->ProgressDialog())
+    	{
+    	//it is observed that some times this call back comes 
+    	//just after deleting progress dialog.
+    	return;
+    	}
+	
+	TRAPD(err, OnSyncMLDataSyncModificationsL(aTaskId, aClientModifications, aServerModifications));
+	if (err != KErrNone)
+		{
+		FLOG( _L("### CAspSyncHandler::OnSyncMLDataSyncModificationsL failed (%d) ###"), err );
+		FLOG( _L("### CAspSyncHandler::OnSyncMLDataSyncModificationsL failed (%d) ###"), err );
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::OnSyncMLDataSyncModificationsL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::OnSyncMLDataSyncModificationsL(TInt aTaskId,
+                      const TSyncMLDataSyncModifications& aClientModifications,
+                      const TSyncMLDataSyncModifications& aServerModifications)
+	{
+	FLOG( _L("CAspSyncHandler::OnSyncMLDataSyncModificationsL START") );
+	
+
+	if (State()->Progress() == 0)
+		{
+	    TInt index = iContentList->FindProviderIndexForTask(aTaskId);
+	
+	    if (index != KErrNotFound)
+		    {
+		    TAspProviderItem& item = iContentList->ProviderItem(index);
+		    HBufC* hBuf = CAspResHandler::GetContentNameLC(item.iDataProviderId,
+		                                                   item.iDisplayName);
+	        State()->SetContentL(hBuf->Des());
+
+#ifdef _DEBUG
+            LogModificationEvent(aTaskId, hBuf->Des());
+#endif
+
+	        CleanupStack::PopAndDestroy(hBuf);
+		    }
+	    else
+		    {
+		    State()->SetContentL(KNullDesC);
+		    FLOG( _L("### task not found (%d) ###"), aTaskId );
+		    }
+		}
+	
+	// Set sync event count. On last OnSyncMLDataSyncModifications call it 
+	// must match total sync event count (set in OnSyncMLSyncProgress). 
+	TInt count = ProgressCount(aClientModifications, aServerModifications);
+	State()->IncreaseProgress(count);
+	
+	UpdateDialog();
+
+	
+#ifdef _DEBUG
+    LogModificationEvent(aTaskId, aClientModifications, aServerModifications);
+#endif
+
+
+	FLOG( _L("CAspSyncHandler::OnSyncMLDataSyncModificationsL END") );
+	FLOG( _L(" ") );
+	}
+
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::UpdateDialog
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::UpdateDialog()
+	{
+	TRAPD(err, UpdateDialogL());
+	
+	if (err != KErrNone)
+		{
+		FLOG( _L("### CAspSyncHandler::UpdateDialogL failed (%d) ###"), err );
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::UpdateDialogL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::UpdateDialogL()
+	{
+	if (!SyncRunning())
+		{
+		FLOG( _L("### CAspSyncHandler::UpdateDialogL: Sync not running ###") );
+		return;
+		}
+
+	TInt phase = State()->SyncPhase();
+	
+	if (phase == CAspState::EPhaseConnecting)
+		{
+		Dialog()->StartAnimationL();
+		HBufC* hBuf = ResHandlerL()->ReadLC(R_SYNCSTATUS_SYNC_CONN);  // "Connecting"
+		Dialog()->UpdateTextL(hBuf->Des());
+		CleanupStack::PopAndDestroy(hBuf);
+		}
+
+	if (phase == CAspState::EPhaseSynchronizing)
+		{
+		Dialog()->StartAnimationL();
+		HBufC* hBuf = ResHandlerL()->ReadLC(R_SYNCSTATUS_SYNC_SYNC); // "Synchronizing"
+		Dialog()->UpdateTextL(hBuf->Des());
+		CleanupStack::PopAndDestroy(hBuf);
+		}
+
+	if (phase == CAspState::EPhaseDisconnecting)
+		{
+		Dialog()->StartAnimationL();
+		HBufC* hBuf = ResHandlerL()->ReadLC(R_SYNCSTATUS_SYNC_DISC);  // "Disconnecting"
+		Dialog()->UpdateTextL(hBuf->Des());
+		CleanupStack::PopAndDestroy(hBuf);
+		}
+
+	if (phase == CAspState::EPhaseCanceling)
+		{
+		Dialog()->StartAnimationL();
+		HBufC* hBuf = ResHandlerL()->ReadLC(R_SYNCSTATUS_CANC);  // "Canceling"
+		Dialog()->UpdateTextL(hBuf->Des());
+		CleanupStack::PopAndDestroy(hBuf);
+		Dialog()->HideButtonL();
+		}
+
+//The number of Emails-Synced NOT printed if Sync is started from Sync E-mail Application
+	if (iApplicationId == EApplicationIdEmail)
+	     return;
+	
+	if (phase == CAspState::EPhaseSending || phase == CAspState::EPhaseReceiving)
+		{
+		if (State()->Progress() == 0 || State()->TotalProgress() == 0)
+			{
+			return; 
+			}
+			
+		if (State()->FirstProgress())
+			{
+			if (State()->ProgressKnown())
+				{
+    			Dialog()->CancelAnimation();
+	    		Dialog()->SetFinalProgress(State()->TotalProgress());
+     	    	Dialog()->SetProgress(State()->Progress());
+				}
+			else
+				{
+    			Dialog()->SetFinalProgress(0);
+	    	    Dialog()->StartAnimationL();
+				}
+			}
+		else if (State()->ProgressKnown())
+			{
+			Dialog()->SetProgress(State()->Progress());
+			}
+			
+		/* Implementation of CMCC PIM v3 begins*/
+		HBufC* hBuf = NULL;
+		if ( FeatureManager::FeatureSupported(KFeatureIdFfTdCmccpimsynchronizationprogressindicatorui) )
+		    {
+            // CMCC sync progress indicator enabled
+            hBuf = ResHandlerL()->ReadProgressTextLC(State()->Content(), State()->Progress(), State()->TotalProgress(), phase);
+            }
+		else
+		    {
+            hBuf = ResHandlerL()->ReadProgressTextLC(State()->Content(), phase);
+		    }
+		/* Implementation of CMCC PIM v3 ends*/
+		
+
+#ifdef _DEBUG
+		TBuf<KBufSize> buf1; TBuf<KBufSize> buf2;
+		buf1 = hBuf->Des();
+		buf2.Format(_L("%S\n (%d/%d)"), &buf1, State()->Progress(), State()->TotalProgress());
+		CleanupStack::PopAndDestroy(hBuf);
+		hBuf = NULL;
+		hBuf = buf2.AllocLC();
+#endif
+		
+   	
+    	Dialog()->UpdateTextL(hBuf->Des());
+		CleanupStack::PopAndDestroy(hBuf);
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::UpdateRequired
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSyncHandler::UpdateRequired()
+	{
+    const TInt KProgressLevel_1 = 10;
+    const TInt KProgressLevel_2 = 20;
+    const TInt KProgressLevel_3 = 50;
+    
+    const TInt KProgressStep_1 = 5;
+    const TInt KProgressStep_2 = 10;
+    const TInt KProgressStep_3 = 20;
+    
+    TInt total = State()->TotalProgress();
+    TInt current = State()->Progress();
+    TBool firstProgress = State()->FirstProgress();
+    TBool progressKnown = State()->ProgressKnown();
+    
+    // always show first progress
+    if (firstProgress)
+    	{
+    	return ETrue;
+    	}
+    
+    // handle case where total progress count is not known
+    if (!progressKnown)
+    	{
+    	if (current <= KProgressStep_2)
+    		{
+    		return ETrue;
+    		}
+    	else if (current % KProgressStep_1 == 0)
+    		{
+    		return ETrue;
+    		}
+    		
+    	return EFalse;
+    	}
+    
+    // handle case where total progress count is known
+    if (current == total)
+    	{
+    	return ETrue; // always show last progress
+    	}
+    else if (total <= KProgressLevel_1)
+    	{
+    	return ETrue;
+    	}
+    else if (total > KProgressLevel_1 && total <= KProgressLevel_2)
+		{
+    	if (current % KProgressStep_1 == 0)
+			{
+			return ETrue;
+			}
+		}
+    else if (total > KProgressLevel_2 && total <= KProgressLevel_3)
+		{
+    	if (current % KProgressStep_2 == 0)
+			{
+			return ETrue;
+			}
+		}
+    else if (total > KProgressLevel_3)
+		{
+    	if (current % KProgressStep_3 == 0)
+			{
+			return ETrue;
+			}
+		}
+
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::HandleActiveCallL (from MAspActiveCallerObserver)
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::HandleActiveCallL(TInt aCallId)
+	{
+    SynchronizeCompleted(aCallId);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::ShowErrorNote
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::ShowErrorNote()
+	{
+	if (iSyncError == KErrNone || iSyncError == KErrCancel)
+		{
+		return; // nothing to show
+		}
+
+	// show sync engine error
+	if (iSyncError <= SyncMLError::KErrSyncEngineErrorBase)
+		{
+		HBufC* hBuf = NULL;
+		hBuf = TAspSyncError::GetSmlErrorText(iSyncError, 0);
+		if (hBuf)  // hBuf can be NULL
+ 			{
+     	   	TRAP_IGNORE(TDialogUtil::ShowErrorQueryL(hBuf->Des()));
+	     	delete hBuf;
+			}
+			
+		return;
+		}
+
+    // show system error
+    TPtrC errorMsg;
+    
+    errorMsg.Set(iTextResolver->ResolveErrorString(iSyncError, CTextResolver::ECtxNoCtxNoSeparator));
+	
+	TRAP_IGNORE(TDialogUtil::ShowErrorQueryL(errorMsg));
+    }
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::ShowProgressDialogL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::ShowProgressDialogL()
+	{
+	delete iProgressDialog;
+	iProgressDialog = NULL;
+	iProgressDialog = CAspProgressDialog::NewL(this);
+	
+	TInt resId = R_SYNCSTATUS_SYNC_CONN;
+	if (iApplicationId == EApplicationIdEmail)
+		{
+		resId = R_SYNCSTATUS_SYNC_SYNC;
+		}
+	
+	HBufC* hBuf = CAspResHandler::ReadLC(resId);
+	
+	iProgressDialog->SetApplicationId(iApplicationId);
+	
+   	TFileName bitmapName;
+	CAspResHandler::GetBitmapFileName(bitmapName);
+	
+	iProgressDialog->LaunchProgressDialogL(hBuf->Des(),
+	                                       KAknsIIDQgnNoteSml, 
+	                                       bitmapName,
+	                                       EMbmAspsyncutilQgn_note_sml,
+	                                       EMbmAspsyncutilQgn_note_sml_mask);
+	CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::CreateContentListL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::CreateContentListL()
+    {
+    TAspParam param(iApplicationId, &iSyncSession);
+
+    CAspProfile* profile = CAspProfile::NewLC(param);
+    profile->OpenL(iProfileId, CAspProfile::EOpenRead, CAspProfile::EBaseProperties);
+    
+	param.iProfile = profile;
+	param.iMode = CAspContentList::EInitAll;
+	
+	delete iContentList;
+	iContentList = NULL;
+	iContentList = CAspContentList::NewL(param);
+	
+    CleanupStack::PopAndDestroy(profile);	
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::CheckLocalDatabaseL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::CheckLocalDatabaseL(TInt aProfileId)
+    {
+    TAspParam param(iApplicationId, &iSyncSession);
+
+    CAspProfile* profile = CAspProfile::NewLC(param);
+    profile->OpenL(aProfileId, CAspProfile::EOpenRead, CAspProfile::EBaseProperties);
+    
+	TInt dataProviderId = KErrNotFound;
+	TBool databaseFound = TAspTask::CheckLocalDatabase(profile, dataProviderId);
+	CleanupStack::PopAndDestroy(profile);
+	
+	if (!databaseFound)
+		{
+		User::Leave(SyncMLError::KErrClientDatabaseNotFound);
+		}
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::Dialog
+//
+// -----------------------------------------------------------------------------
+//
+CAspProgressDialog* CAspSyncHandler::Dialog()
+	{
+	__ASSERT_DEBUG(iProgressDialog, TUtil::Panic(KErrGeneral));
+
+	return iProgressDialog;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::State
+//
+// -----------------------------------------------------------------------------
+//
+CAspState* CAspSyncHandler::State()
+	{
+	__ASSERT_DEBUG(iState, TUtil::Panic(KErrGeneral));
+
+	return iState;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncHandler::ResHandlerL
+//
+// -----------------------------------------------------------------------------
+//
+CAspResHandler* CAspSyncHandler::ResHandlerL()
+	{
+	if (!iResHandler)
+		{
+		iResHandler = CAspResHandler::NewL();
+		}
+
+	return iResHandler;
+	}
+
+
+// -----------------------------------------------------------------------------
+// SyncRunning
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspSyncHandler::SyncRunning()
+	{
+	return iSyncRunning;
+	}
+
+// -----------------------------------------------------------------------------
+// IsServerAlertSync
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CAspSyncHandler::IsServerAlertSync()
+	{
+	return iServerAlertSync;
+	}
+
+
+// -----------------------------------------------------------------------------
+// OpenSyncSessionL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::OpenSyncSessionL()
+	{
+	if (!iSyncSessionOpen)
+		{
+        TRAPD(err, iSyncSession.OpenL());
+        
+        if (err != KErrNone)
+        	{
+        	FLOG( _L("### CAspSyncHandler: RSyncMLSession::OpenL failed (%d) ###"), err );
+        	User::Leave(err);
+        	}
+
+		iSyncSessionOpen = ETrue;
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CloseSyncSession
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::CloseSyncSession()
+	{
+	if (iSyncSessionOpen)
+		{
+		iSyncSession.Close();
+		iSyncSessionOpen = EFalse;
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// ProgressCount
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspSyncHandler::ProgressCount(const TSyncMLDataSyncModifications& aC, 
+                                    const TSyncMLDataSyncModifications& aS)
+	{
+	TInt num1 = aC.iNumAdded + aC.iNumReplaced + aC.iNumMoved + aC.iNumDeleted + aC.iNumFailed;
+	TInt num2 = aS.iNumAdded + aS.iNumReplaced + aS.iNumMoved + aS.iNumDeleted + aS.iNumFailed;
+	
+	return num1 + num2;
+	}
+	
+	
+
+#ifdef _DEBUG
+
+
+// -----------------------------------------------------------------------------
+// LogModificationEvent
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::LogModificationEvent(TInt aTaskId, const TSyncMLDataSyncModifications& aC, const TSyncMLDataSyncModifications& aS)
+	{
+	TInt num1 = State()->Progress();
+	TInt num2 = State()->TotalProgress();
+	
+	if (num1 > num2 && num2 != -1)
+		{
+		FTRACE( RDebug::Print(_L("### syncui: task=%d, progress=%d, totalprogress=%d ###"), aTaskId, num1, num2) );
+		FLOG(_L("### syncui: task=%d, progress=%d, totalprogress=%d ###"), aTaskId, num1, num2);
+		}
+	else
+		{
+		FTRACE( RDebug::Print(_L("syncui: task=%d, progress=%d, totalprogress=%d"), aTaskId, num1, num2) );
+		FLOG(_L("syncui: task=%d, progress=%d, totalprogress=%d"), aTaskId, num1, num2);
+		}
+		
+	num1 = aC.iNumAdded + aC.iNumReplaced + aC.iNumMoved + aC.iNumDeleted + aC.iNumFailed;
+	num2 = aS.iNumAdded + aS.iNumReplaced + aS.iNumMoved + aS.iNumDeleted + aS.iNumFailed;
+	
+	if ( (num1>0 && num2>0) || (num1<0 || num2<0) || (num1==0 && num2==0) )
+		{
+		FLOG( _L("### parameter error ###") );
+		}
+		
+    FTRACE( RDebug::Print(_L("client: add=%d, rep=%d, mov=%d del=%d fai=%d"), aC.iNumAdded, aC.iNumReplaced, aC.iNumMoved, aC.iNumDeleted, aC.iNumFailed) );
+    FTRACE( RDebug::Print(_L("server: add=%d, rep=%d, mov=%d del=%d fai=%d"), aS.iNumAdded, aS.iNumReplaced, aS.iNumMoved, aS.iNumDeleted, aS.iNumFailed) );
+    
+    FLOG(_L("client: add=%d, rep=%d, mov=%d del=%d fai=%d"), aC.iNumAdded, aC.iNumReplaced, aC.iNumMoved, aC.iNumDeleted, aC.iNumFailed);
+    FLOG(_L("server: add=%d, rep=%d, mov=%d del=%d fai=%d"), aS.iNumAdded, aS.iNumReplaced, aS.iNumMoved, aS.iNumDeleted, aS.iNumFailed);
+	}
+
+
+// -----------------------------------------------------------------------------
+// LogModificationEvent
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::LogModificationEvent(TInt aTaskId, const TDesC& aText)
+	{
+	FTRACE( RDebug::Print(_L("progress = 0, task id = %d, task name ='%S'"), aTaskId, &aText) );
+	FLOG(_L("progress = 0, task id = %d, task name ='%S'"), aTaskId, &aText);
+	}
+
+
+// -----------------------------------------------------------------------------
+// LogSessionEvent
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::LogSessionEvent(TEvent& aEvent, TInt aIdentifier, TInt aError)
+	{
+    TBuf<KBufSize> eventStr;
+    GetSyncEventText(eventStr, aEvent);
+
+    TBuf<KBufSize> errStr;
+    TAspSyncError::GetSyncMLErrorText(errStr, aError);
+
+	if (aError == KErrNone)
+		{
+		FTRACE( RDebug::Print(_L("event='%S' err='%S' job= %d curjob= %d"), &eventStr, &errStr, aIdentifier, iCurrentSyncJobId) );
+		FLOG(_L("event='%S' err='%S' job= %d curjob= %d"), &eventStr, &errStr, aIdentifier, iCurrentSyncJobId);
+		}
+	else
+		{
+		FTRACE( RDebug::Print(_L("### event='%S' err='%S' job= %d curjob= %d ###"), &eventStr, &errStr, aIdentifier, iCurrentSyncJobId) );
+		FLOG(_L("### event='%S' err='%S' job= %d curjob= %d ###"), &eventStr, &errStr, aIdentifier, iCurrentSyncJobId);
+		}
+	}
+	
+
+// -----------------------------------------------------------------------------
+// LogProgressEvent
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::LogProgressEvent(TStatus& aStatus, TInt aInfo1)
+	{
+    TBuf<KBufSize> statusStr;
+    GetSyncStatusText(statusStr, aStatus);
+    FTRACE( RDebug::Print(_L("OnSyncMLSyncProgress: status = '%S' info1 = %d"), &statusStr, aInfo1) );
+    FLOG(_L("OnSyncMLSyncProgress: status = '%S' info1 = %d"), &statusStr, aInfo1);
+    
+   	TInt num1 = State()->Progress();
+   	TInt num2 = State()->TotalProgress();
+   	if (num1 != num2 && num2 != -1)
+   		{
+   		FTRACE( RDebug::Print(_L("### progress count error (%d/%d) ###"), num1, num2) );
+   		FLOG(_L("### progress count error (%d/%d) ###"), num1, num2);
+   		}
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// LogErrorEvent
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::LogErrorEvent(TErrorLevel aErrorLevel, TInt aError)
+	{
+    TBuf<KBufSize> errStr;
+    TAspSyncError::GetSyncMLErrorText(errStr, aError);
+    
+    if (aErrorLevel == ESmlFatalError)
+    	{
+    	FTRACE( RDebug::Print(_L("### OnSyncMLSyncError: fatalerror = %S ###"), &errStr) );
+    	FLOG(_L("### OnSyncMLSyncError: fatalerror = %S ###"), &errStr);
+    	}
+    else
+    	{
+    	FTRACE( RDebug::Print(_L("### OnSyncMLSyncError: error = %S ###"), &errStr) );
+    	FLOG(_L("### OnSyncMLSyncError: error = %S ###"), &errStr);
+    	}
+	}
+
+
+
+// -----------------------------------------------------------------------------
+// GetSyncStatusText
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::GetSyncStatusText(TDes& aText, MSyncMLProgressObserver::TStatus aStatus)
+	{
+    aText = _L("Unknown");
+    		
+	if (aStatus == MSyncMLProgressObserver::ESmlConnecting)
+		{
+		aText = _L("ESmlConnecting");
+		}
+	if (aStatus == MSyncMLProgressObserver::ESmlConnected)
+		{
+		aText = _L("ESmlConnected");
+		}
+	if (aStatus == MSyncMLProgressObserver::ESmlLoggingOn)
+		{
+		aText = _L("ESmlLoggingOn");
+		}
+	if (aStatus == MSyncMLProgressObserver::ESmlLoggedOn)
+		{
+		aText = _L("ESmlLoggedOn");
+		}
+	if (aStatus == MSyncMLProgressObserver::ESmlDisconnected)
+		{
+		aText = _L("ESmlDisconnected");
+		}
+	if (aStatus == MSyncMLProgressObserver::ESmlCompleted)
+		{
+		aText = _L("ESmlCompleted");
+		}
+	if (aStatus == MSyncMLProgressObserver::ESmlSendingModificationsToServer)
+		{
+		aText = _L("ESmlSendingModificationsToServer");
+		}
+	if (aStatus == MSyncMLProgressObserver::ESmlReceivingModificationsFromServer)
+		{
+		aText = _L("ESmlReceivingModificationsFromServer");
+		}
+	if (aStatus == MSyncMLProgressObserver::ESmlSendingMappingsToServer)
+		{
+		aText = _L("ESmlSendingMappingsToServer");
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// GetSyncEventText
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncHandler::GetSyncEventText(TDes& aText, MSyncMLEventObserver::TEvent aEvent)
+	{
+    aText = _L("Unknown");
+    		
+	if (aEvent == MSyncMLEventObserver::EJobStart)
+		{
+		aText = _L("EJobStart");
+		}
+	if (aEvent == MSyncMLEventObserver::EJobStartFailed)
+		{
+		aText = _L("EJobStartFailed");
+		}
+	if (aEvent == MSyncMLEventObserver::EJobStop)
+		{
+		aText = _L("EJobStop");
+		}
+	if (aEvent == MSyncMLEventObserver::EJobRejected)
+		{
+		aText = _L("EJobRejected");
+		}
+	if (aEvent == MSyncMLEventObserver::EProfileCreated)
+		{
+		aText = _L("EProfileCreated");
+		}
+	if (aEvent == MSyncMLEventObserver::EProfileChanged)
+		{
+		aText = _L("EProfileChanged");
+		}
+	if (aEvent == MSyncMLEventObserver::EProfileDeleted)
+		{
+		aText = _L("EProfileDeleted");
+		}
+	if (aEvent == MSyncMLEventObserver::ETransportTimeout)
+		{
+		aText = _L("ETransportTimeout");
+		}
+	if (aEvent == MSyncMLEventObserver::EServerSuspended)
+		{
+		aText = _L("EServerSuspended");
+		}
+	if (aEvent == MSyncMLEventObserver::EServerTerminated)
+		{
+		aText = _L("EServerTerminated");
+		}
+	}
+
+#endif
+
+
+
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspSyncUtil.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,811 @@
+/*
+* 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:  
+*
+*/
+
+
+
+// INCLUDES
+#include "AspSyncUtil.h"
+#include "AspDialogUtil.h"
+#include "AspProfileDialog.h"
+#include "AspProfileWizardDialog.h"
+#include "AspAutoSyncHandler.h"
+
+#include "AspSyncUtil.rh"
+#include "AspDebug.h"
+
+#include <AiwCommon.hrh> // for application ids 
+#include <DataSyncInternalPSKeys.h>
+
+#ifdef RD_DSUI_TIMEDSYNC 
+#include "AspSettingViewDialog.h"
+#endif
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CAspSyncUtil* CAspSyncUtil::NewL()
+    {
+	FLOG( _L("CAspSyncUtil::NewL START") );
+
+    CAspSyncUtil* self = new (ELeave) CAspSyncUtil();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+	FLOG( _L("CAspSyncUtil::NewL END") );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspSyncUtil::~CAspSyncUtil()
+    {
+   	FLOG( _L("CAspSyncUtil::~CAspSyncUtil START") );
+   	
+	delete iResHandler;
+	delete iSyncHandler;
+ 	delete iContentList;
+	
+	CloseSyncSession();
+	
+	FLOG( _L("CAspSyncUtil::~CAspSyncUtil END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::ConstructL(void)
+    {
+   	FLOG( _L("CAspSyncUtil::ConstructL START") );
+ 	
+    iSettingEnforcement = TUtil::SettingEnforcementState();
+   	    
+   	TAspParam param(iApplicationId, NULL);  // param not used in CAspSyncHandler
+	iSyncHandler = CAspSyncHandler::NewL(param);
+
+	iSyncSessionOpen = EFalse;
+	
+   	FLOG( _L("CAspSyncUtil::ConstructL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::CAspSyncUtil
+//
+// -----------------------------------------------------------------------------
+//
+CAspSyncUtil::CAspSyncUtil()
+	{
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::SynchronizeL
+//
+// Called by CSyncUtilApi::SynchronizeL.
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::SynchronizeL(RFile& aTaskFile)
+	{
+	CAspAutoSyncHandler* autoSyncHandler = CAspAutoSyncHandler::NewL();
+	CleanupStack::PushL(autoSyncHandler);
+	
+	autoSyncHandler->SynchronizeL(aTaskFile);
+	
+	CleanupStack::PopAndDestroy(autoSyncHandler);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::SynchronizeL
+//
+// Called by CSyncUtilApi::SynchronizeL. 
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::SynchronizeL(TInt aApplicationId, TInt aJobId, TInt aInfo1, TDes& aInfo2)
+	{
+	FLOG( _L("CAspSyncUtil::SynchronizeL START") );
+	
+	if (!iResHandler)
+		{
+		iResHandler = CAspResHandler::NewL();
+		}
+		
+	iApplicationId = aApplicationId;
+	
+	OpenSyncSessionL();
+	
+	TRAPD(err, DoSynchronizeL(aApplicationId, aJobId, aInfo1, aInfo2));
+	
+	CloseSyncSession();
+	
+	User::LeaveIfError(err);
+		
+	FLOG( _L("CAspSyncUtil::SynchronizeL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::ShowSettingsL
+//
+// Called by CSyncUtilApi::ShowSettingsL.
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::ShowSettingsL(TInt aApplicationId, TInt aInfo1, TDes& /*aInfo2*/)
+	{
+    FLOG( _L("CAspSyncUtil::ShowSettingsL START") );
+
+	if (!iResHandler)
+		{
+		iResHandler = CAspResHandler::NewL();
+		}
+
+    iApplicationId = aApplicationId;
+    
+    if (aApplicationId != EApplicationIdSync)
+    	{
+    	// other apps only show profile dialog
+    	ShowProfileDialogL(aApplicationId);
+    	return;
+    	}
+    	
+    
+    TInt dialogMode = EModeDialogWait;
+    if (aInfo1 == EModeDialogNoWait)
+    	{
+    	dialogMode = EModeDialogNoWait;
+    	}
+    
+    OpenSyncSessionL();
+        
+    TRAPD(err, ShowSettingsDialogL(aApplicationId, KErrNotFound, dialogMode));
+            
+    if (dialogMode == EModeDialogWait)
+    	{
+    	iSettingDialog = NULL;
+    	CloseSyncSession();
+    	}
+    
+    User::LeaveIfError(err);
+    
+    FLOG( _L("CAspSyncUtil::ShowSettingsL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::ShowSettingsDialog
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::ShowSettingsDialogL(TInt aApplicationId, 
+                                       TInt aProfileId, TInt aDialogMode)
+	{
+	if (aApplicationId != EApplicationIdSync)
+		{
+		CreateContentListL();
+	    CheckAppAndProviderL(aApplicationId);
+		}
+	
+	TAspParam param(aApplicationId, &iSyncSession);
+	param.iMode = aDialogMode;
+	param.iProfileId = aProfileId;
+
+    iSettingDialog = CAspSettingDialog::NewL(param);
+ 
+    if (aDialogMode == EModeDialogWait)
+    	{
+    	iSettingDialog->ExecuteLD(R_ASP_SETTING_DIALOG);
+    	}
+    else
+    	{
+    	iSettingDialog->ExecuteLD(R_ASP_SETTING_DIALOG_2);
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::ShowProfileDialog
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::ShowProfileDialogL(TInt aApplicationId)
+	{
+    FLOG( _L("CAspSyncUtil::ShowProfileDialogL START") );
+    
+	OpenSyncSessionL();
+	
+	TRAPD(err, EditProfileL(aApplicationId));
+	
+	CloseSyncSession();
+		
+    User::LeaveIfError(err);
+		
+	FLOG( _L("CAspSyncUtil::ShowProfileDialogL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::EditProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::EditProfileL(TInt aAplicationId)
+	{
+	CreateContentListL();
+    CheckAppAndProviderL(aAplicationId);
+	
+	TInt profileId = KErrNotFound;
+	TInt taskId = KErrNotFound;
+	TInt resourceId = R_ASP_PROFILE_QUERY_TITLE;
+	
+	TBool ret = SelectProfileL(profileId, taskId, resourceId, KNullDesC,ETrue);
+	if (!ret || profileId == KErrNotFound)
+		{
+		return;  // no sync profile
+		}
+
+    if (iSettingEnforcement)
+    	{
+    	DoEditReadOnlyProfileL(aAplicationId, profileId, 
+    	                       EDialogModeSettingEnforcement);
+    	}
+    else
+    	{
+    	DoEditProfileL(aAplicationId, profileId, EDialogModeEdit);
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::DoEditProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::DoEditProfileL(TInt aApplicationId, TInt aProfileId,
+                                                      TInt aDialogMode)
+	{
+	TAspParam param(EApplicationIdSync, &iSyncSession);
+	CAspProfileList* profileList = CAspProfileList::NewLC(param);
+	profileList->ReadAllProfilesL(CAspProfileList::ENoMandatoryCheck);
+	
+	
+    param.iApplicationId = aApplicationId;
+	CAspProfile* profile = CAspProfile::NewLC(param);
+    
+    TInt err = KErrNone;
+    TRAP(err, profile->OpenL(aProfileId, CAspProfile::EOpenReadWrite,
+                                         CAspProfile::EAllProperties));
+
+	if (err == KErrLocked)
+		{
+		TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+		}
+	User::LeaveIfError(err);
+
+	iContentList->SetProfile(profile);
+	TRAP(err, iContentList->InitAllTasksL());
+	
+	if (err != KErrNone)
+		{
+		iContentList->SetProfile(NULL);
+		}
+	User::LeaveIfError(err);
+		
+	TAspParam param2(aApplicationId, &iSyncSession);
+	param2.iProfile = profile;
+	param2.iMode = aDialogMode;
+    param2.iContentList = iContentList;
+    param2.iProfileList = profileList;  // needed for unique server id check
+ 
+#ifdef RD_DSUI_TIMEDSYNC 
+	CAspSettingViewDialog::ShowDialogL(param2);
+#else
+	TRAP(err, CAspProfileDialog::ShowDialogL(param2));
+#endif
+	
+	iContentList->SetProfile(NULL);
+	User::LeaveIfError(err);
+
+	CleanupStack::PopAndDestroy(profile);
+	CleanupStack::PopAndDestroy(profileList);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::DoEditReadOnlyProfileL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::DoEditReadOnlyProfileL(TInt aApplicationId, TInt aProfileId,
+                                                      TInt aDialogMode)
+	{
+	TAspParam param(aApplicationId, &iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+    
+    profile->OpenL(aProfileId, CAspProfile::EOpenRead,
+                                         CAspProfile::EAllProperties);
+
+	iContentList->SetProfile(profile);
+	TInt err = KErrNone;
+	TRAP(err, iContentList->InitAllTasksL());
+	
+	if (err != KErrNone)
+		{
+		iContentList->SetProfile(NULL);
+		}
+	User::LeaveIfError(err);
+		
+	TAspParam param2(aApplicationId, &iSyncSession);
+	param2.iProfile = profile;
+	param2.iMode = aDialogMode;
+    param2.iContentList = iContentList;
+ 
+	TRAP(err, CAspProfileDialog::ShowDialogL(param2));
+	
+	iContentList->SetProfile(NULL);
+	User::LeaveIfError(err);
+
+	CleanupStack::PopAndDestroy(profile);
+	}
+
+
+// -----------------------------------------------------------------------------------------------------
+// CAspSyncUtil::SelectProfileL
+// aCheckId currently will be always set to ETrue
+// this Check can be used in future to differentiate if its called from DoSynchronizeL() or EditProfileL()
+// ------------------------------------------------------------------------------------------------------
+//
+TBool CAspSyncUtil::SelectProfileL(TInt& aProfileId, TInt& aTaskId, 
+                                   TInt aResourceId, const TDesC& aLocalDatabase,TBool aCheckId)
+	{
+	aProfileId = KErrNotFound;
+	aTaskId = KErrNotFound;
+	TBool ret = EFalse;
+	TInt index=KErrNotFound;
+	
+	TAspParam param(iApplicationId, &iSyncSession);
+	CAspProfileList* profileList = CAspProfileList::NewLC(param);
+	
+	if (aLocalDatabase.Length() > 0)
+		{
+		profileList->ReadEMailProfilesL(aLocalDatabase, KErrNotFound);
+		if(profileList->Count() == 0)
+		{
+		 profileList->ReadAllProfilesL(CAspProfileList::EBasePropertiesOnly);
+		}
+		}
+	else
+		{
+		profileList->ReadAllProfilesL(CAspProfileList::EBasePropertiesOnly);
+		}
+	
+	profileList->Sort();
+   	
+	if (profileList->Count() == 0)
+		{
+	    if (!iSettingEnforcement)
+	    	{
+	    	if (TDialogUtil::ShowConfirmationQueryL(R_ASP_QUERY_NO_PROFILES))
+		        {
+	    	    TAspParam param(iApplicationId, &iSyncSession);
+         	    CAspProfileWizardDialog::ShowDialogL(param);
+    	        }
+	    	}
+
+    	ret = EFalse;
+		}
+		
+			
+	else
+		{
+		if(aCheckId)
+		{
+			
+	
+			if (iSettingEnforcement)
+				{
+					ret = TDialogUtil::ShowProfileQueryL(profileList, aProfileId, aResourceId);
+						
+				}
+			else
+				{
+		  			ret = TDialogUtil::ShowProfileQueryAppL(profileList, aProfileId, aResourceId,index);	
+				}
+		
+		
+			if (ret)
+				{
+		   			 index = profileList->ListIndex(aProfileId);
+	    	
+	        		__ASSERT_DEBUG(index != KErrNotFound, TUtil::Panic(KErrGeneral));
+	              
+	         		TAspProfileItem& item = profileList->Item(index);
+	         		
+		   			aTaskId = item.iTaskId;
+	       
+				}
+			
+		 	else
+	 			 {
+	 		    		if(index==1)
+			     		CAspProfileWizardDialog::ShowDialogL(param);
+	        	 		//ret=EFalse;
+		 	
+		 		 }	
+		}
+		
+		else
+		{
+		
+		   
+			ret = TDialogUtil::ShowProfileQueryL(profileList, aProfileId, aResourceId);	
+		  	
+	 		if (ret)
+				{
+					TInt index = profileList->ListIndex(aProfileId);
+	    	
+	        		__ASSERT_DEBUG(index != KErrNotFound, TUtil::Panic(KErrGeneral));
+	                
+	          		TAspProfileItem& item = profileList->Item(index);
+		      		aTaskId = item.iTaskId;
+	        
+			
+		 
+		 		}
+				
+		
+	   		}
+		}
+		
+	CleanupStack::PopAndDestroy(profileList);
+
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::DoSynchronizeL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::DoSynchronizeL(TInt aApplicationId, TInt /*aJobId*/, 
+                                  TInt aInfo1, TDes& aInfo2)
+	{
+	FLOG( _L("CAspSyncUtil::DoSynchronizeL START") );
+	
+	CreateContentListL();
+	CheckAppAndProviderL(aApplicationId);
+
+	//check PS key
+    TInt keyVal = 0;//EDataSyncNotRunning
+    TInt err = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
+                                 KDataSyncStatus,
+                                 keyVal );
+    if(err == KErrNone && keyVal)
+    	{
+    	TDialogUtil::ShowInformationNoteL(R_ASP_SYNC_ALREADY_RUNNING);
+		return;
+    	}
+	
+	if (CAspProfile::OtherSyncRunning(&iSyncSession))
+		{
+		TDialogUtil::ShowInformationNoteL(R_ASP_SYNC_ALREADY_RUNNING);
+		FLOG( _L("CAspSyncUtil::DoSynchronizeL END") );
+   		return;
+		}
+		
+	if (iApplicationId == EApplicationIdEmail && TUtil::IsEmpty(aInfo2))
+		{
+		FLOG( _L("### mailbox name not defined ###") );
+		FLOG( _L("CAspSyncUtil::DoSynchronizeL END") );
+		User::Leave(KErrNotFound);
+		}
+	
+
+	TInt profileId = KErrNotFound;
+	TInt taskId = KErrNotFound;
+	TBool ret = EFalse;
+	TInt resourceId = R_ASP_PROFILE_QUERY_TITLE;
+
+	if (aApplicationId == EApplicationIdEmail)
+		{
+		ret = SelectProfileL(profileId, taskId, resourceId, aInfo2,ETrue);
+		}
+	else
+		{
+		ret = SelectProfileL(profileId, taskId, resourceId, KNullDesC,ETrue);
+		}
+		
+	if (!ret || profileId == KErrNotFound)
+		{
+		FLOG( _L("CAspSyncUtil::DoSynchronizeL END") );
+		return; // no sync profile
+		}
+	
+	TAspParam aspParam(iApplicationId, &iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(aspParam);
+	TRAPD (err1, profile->OpenL(profileId, CAspProfile::EOpenRead, 
+	                           CAspProfile::EAllProperties));
+	User::LeaveIfError(err1);
+	if (aApplicationId != EApplicationIdEmail)
+		{
+		aInfo2 = KNullDesC;
+		}
+	//create task for content type ,if it is not created yet
+	ret = CheckTaskAndProtocolL(profileId, aInfo2);
+	
+	TInt dataProviderId = TUtil::ProviderIdFromAppId(aApplicationId);
+	taskId = TAspTask::FindTaskIdL(profile, dataProviderId, aInfo2);
+	
+	CleanupStack::PopAndDestroy(profile);
+	    		
+	if (!ret)
+		{
+		    FLOG( _L("CAspSyncUtil::DoSynchronizeL END") );
+			return; // some mandatory data missing
+		}
+	
+	if (!CheckMandatoryL(profileId))
+		{
+	    FLOG( _L("CAspSyncUtil::DoSynchronizeL END") );
+		return; // some mandatory data missing
+		}
+
+#ifdef _DEBUG
+        TBuf<KBufSize> buf;
+        TUtil::GetApplicationName(buf, aApplicationId);
+        FTRACE(RDebug::Print(_L("statrting sync (%S)"), &buf));
+#endif
+
+	TAspSyncParam param(aApplicationId);
+	param.iProfileId = profileId;
+	param.iTaskId = taskId;
+
+    if (aInfo1 == EApplicationIdEmail)
+    	{
+    	// email sync 3.2 needs synchronous syncing
+    	param.iDialogMode = EModeDialogWait;
+    	}
+
+	iSyncHandler->SynchronizeL(param);
+
+	FLOG( _L("CAspSyncUtil::DoSynchronizeL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::CheckMandatoryL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSyncUtil::CheckMandatoryL(TInt aProfileId)
+	{
+	TAspParam param(iApplicationId, &iSyncSession);
+	CAspProfile* profile = CAspProfile::NewLC(param);
+	profile->OpenL(aProfileId, CAspProfile::EOpenRead, 
+	                           CAspProfile::EAllProperties);
+	
+	TInt contentCount = 0;
+	TInt ret = CAspProfile::CheckMandatoryData(profile, contentCount);
+	CleanupStack::PopAndDestroy(profile);
+	
+	if (ret != EMandatoryOk)
+		{
+        if (iSettingEnforcement)
+    	    {
+    	    TDialogUtil::ShowInformationNoteL(R_ASP_NOTE_TARM_MANDATORY_MISSING);
+    	    }    	
+    	else if (TDialogUtil::ShowConfirmationQueryL(R_ASP_QUERY_MANDATORY_MISSING))
+			{
+   	        DoEditProfileL(iApplicationId, aProfileId, EDialogModeEditMandatory);
+ 			}
+		
+		return EFalse;
+    	}
+	
+	return ETrue;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::DataProviderExist
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSyncUtil::DataProviderExist(TInt aApplicationId)
+	{
+	if (iContentList == NULL)
+		{
+		return ETrue;
+		}
+	
+	TInt providerId = TUtil::ProviderIdFromAppId(aApplicationId);
+	TInt index = iContentList->FindProviderIndex(providerId);
+	
+	if (index == KErrNotFound)
+		{
+		return EFalse;
+		}
+	return ETrue;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::CreateContentListL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::CreateContentListL()
+	{
+	if (iContentList)
+		{
+		return;
+		}
+
+	TAspParam param(KErrNotFound, &iSyncSession);
+    param.iMode = CAspContentList::EInitDataProviders;
+    iContentList = CAspContentList::NewL(param);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::CheckAppAndProvider
+//
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::CheckAppAndProviderL(TInt aApplicationId)
+	{
+	TInt sid = RProcess().SecureId().iId;
+	
+	if (!TUtil::IsValidSID(sid))
+		{
+		FLOG( _L("### CAspSyncUtil::CheckAppAndProviderL: wrong SID (%xd) ###"), sid);
+		User::Leave(KErrNotSupported);  // unknown caller app
+		}
+
+	if (!TUtil::IsValidAppId(aApplicationId))
+		{
+		FLOG( _L("### CAspSyncUtil::CheckAppAndProviderL: wrong app id (%d) ###"), aApplicationId);
+		User::Leave(KErrNotSupported);  // unknown caller app
+		}
+		
+	if (aApplicationId != EApplicationIdSync && !DataProviderExist(aApplicationId))
+		{
+		FLOG( _L("### CAspSyncUtil::CheckAppAndProviderL: no data provider (%d) ###"), aApplicationId);
+		User::Leave(KErrNotFound);  // sync data provider not found
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::CheckTaskAndProtocolL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspSyncUtil::CheckTaskAndProtocolL(TInt aProfileId ,const TDesC& aLocalDatabase)
+	{
+	
+	TAspParam param(iApplicationId, &iSyncSession);
+	
+	CAspProfile* profile = CAspProfile::NewLC(param);
+	TRAPD (err, profile->OpenL(aProfileId, CAspProfile::EOpenReadWrite, 
+	                           CAspProfile::EAllProperties));
+	if (err == KErrLocked)
+		{
+			TDialogUtil::ShowErrorNoteL(R_ASP_LOCKED_PROFILE);
+			CleanupStack::PopAndDestroy(profile);                           
+			return EFalse;
+		}
+	
+	TInt dataProviderId = TUtil::ProviderIdFromAppId(iApplicationId, CAspProfile::IsOperatorProfileL(profile));
+	iContentList->RemoveAllTasks();
+	iContentList->SetProfile(profile);
+	iContentList->InitAllTasksL();
+	
+	if (iApplicationId == EApplicationIdEmail)
+		{
+			    
+	    TInt protocol = profile->ProtocolVersion();
+		if (protocol == EAspProtocol_1_1)
+			{
+
+      		CleanupStack::PopAndDestroy(profile);
+      		iContentList->SetProfile(NULL);
+      		return EFalse;	 
+			}
+        
+        TInt taskId = TAspTask::FindTaskIdL(profile, dataProviderId, aLocalDatabase);
+        if (taskId == KErrNotFound)
+			{
+	  		
+      	  iContentList->ModifyTaskIncludedL(dataProviderId, ETrue, aLocalDatabase);
+      		
+      		}
+	
+		}
+    else
+		{
+		TInt taskId = TAspTask::FindTaskIdL(profile, dataProviderId, KNullDesC);
+        if (taskId == KErrNotFound)
+			{
+	  		    		
+      		iContentList->ModifyTaskIncludedL(dataProviderId, ETrue, KNullDesC);
+      		
+			}
+		}
+	
+	iContentList->SetProfile(NULL);
+	CleanupStack::PopAndDestroy(profile);
+	return ETrue;
+	}
+
+// -----------------------------------------------------------------------------
+// OpenSyncSessionL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::OpenSyncSessionL()
+	{
+	if (!iSyncSessionOpen)
+		{
+        TRAPD(err, iSyncSession.OpenL());
+        
+        if (err != KErrNone)
+        	{
+        	FLOG( _L("### CAspSyncUtil::OpenSyncSessionL: RSyncMLSession::OpenL failed (%d) ###"), err);
+        	
+            iSyncSession.Close();  // can be done always
+        	User::Leave(err);
+        	}
+        else
+        	{
+        	FLOG( _L("CAspSyncUtil::OpenSyncSessionL: RSyncMLSession::OpenL ok") );
+        	}
+        
+		iSyncSessionOpen = ETrue;
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CloseSyncSession
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspSyncUtil::CloseSyncSession()
+	{
+	if (iSyncSessionOpen)
+		{
+		iSyncSession.Close();
+		iSyncSessionOpen = EFalse;
+		}
+    }
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspSyncUtil.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,2023 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+//  INCLUDES
+
+
+#include <eikon.rh>
+#include "registryinfov2.rh" 
+#include "AspSyncUtil.rh"
+
+// aspsyncutil uses sync app .loc file
+#include<nsmldssync.loc>
+
+// For profiles sync application brings
+#include<nsmlsyncprofiles.loc>
+
+// common avkon strings
+#include<avkon.loc>
+
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <AvkonIcons.hrh>
+
+
+
+//  RESOURCE IDENTIFIER
+NAME ASPU
+
+
+RESOURCE RSS_SIGNATURE { }
+
+
+//
+// STRINGS
+//
+
+STRUCT STRING
+	{
+	LTEXT text;
+	}
+
+// info note for sync protocol change
+RESOURCE TBUF r_asp_protocol_change { buf = qtn_sml_info_proc_change; }
+
+// shown when syncing and mandatory setting is missing and profile cannot be edited
+RESOURCE TBUF r_asp_note_tarm_mandatory_missing { buf=qtn_sml_note_tarm_mandatory_missing; }
+
+// shown when syncing and no profles exist
+RESOURCE TBUF r_asp_note_main_locked { buf=qtn_sml_note_main_locked; }
+
+// shown when settings enforcement is done
+RESOURCE TBUF r_asp_protected_setting { buf=qtn_selec_protected_setting; }
+
+// shown when syncing and no profles exist
+RESOURCE TBUF r_asp_query_no_profiles { buf=qtn_sml_query_no_profiles; }
+
+// shown when syncing and no profles exist
+RESOURCE TBUF r_asp_query_mandatory_missing { buf=qtn_sml_query_mandatory_missing; }
+
+// shown when syncing and no profles exist
+RESOURCE TBUF r_asp_query_title_delete_profile { buf=qtn_sml_query_title_delete_profile; }
+
+// shown when syncing and no profles exist
+RESOURCE TBUF r_asp_query_title_change_profile { buf=qtn_sml_query_title_change_profile; }
+
+// synced profile has no content
+RESOURCE TBUF r_asp_err_nocontent         	{ buf = qtn_sml_err_nocontent; }
+
+// profile wizard navipane text
+RESOURCE TBUF r_asp_wizard_page_counter    	{ buf = qtn_sml_wizard_page_counter; }
+
+// confirms copy all from server command
+RESOURCE TBUF r_asp_copy_from_server { buf = qtn_sml_query_slow_sync_conf; }
+
+// shown when user has given profile server id that already exists
+RESOURCE TBUF r_asp_server_id_exists { buf = qtn_sml_query_serverid_exists; }
+
+// informs user that sync cannot be synced because sync is already running
+RESOURCE TBUF r_asp_sync_already_running { buf = qtn_ds_note_hidden_ongoing; }
+
+// setting dialog (main dialog) title
+RESOURCE TBUF r_asp_setting_dialog_title { buf=qtn_apps_syncml_title; }
+
+// profile query dialog title
+RESOURCE TBUF r_asp_profile_query_title { buf=qtn_sml_apps_select_set; }
+
+// text shown in setting dialog when set has no name (not used)
+RESOURCE TBUF r_asp_unnamed_set { buf = qtn_apps_emptyprofile; }
+
+// confirms profile deletion
+RESOURCE TBUF r_asp_confirm_delete { buf = qtn_query_common_conf_delete; }
+
+// confirms closing dialog when some mandatory data is missing
+RESOURCE TBUF r_asp_exit_anyway { buf = qtn_ds_conf_mandatory_missing; }
+
+// confirms closing dialog when some mandatory data is missing (not used)
+//RESOURCE TBUF r_asp_exit_anyway_apps { buf = qtn_ds_conf_mandatory_missing_apps; }
+
+// compulsory setting item text setting value is not defined
+RESOURCE TBUF r_asp_must_be_defined { buf = qtn_selec_setting_compulsory; }
+
+// normal (not compulsory) setting item text setting value is not defined
+RESOURCE TBUF r_asp_setting_value_none{ buf = qtn_selec_sett_val_field_none; }
+
+// shown under profile name - indicates that profile has not been synced
+RESOURCE TBUF r_asp_not_synced { buf = qtn_sml_main_sync_no_last; }
+
+// default profile name when new profile is created
+RESOURCE TBUF r_asp_profilename_phonebook { buf = qtn_sml_apps_content_pb; }
+
+// default profile name when new profile is created
+RESOURCE TBUF r_asp_profilename_calendar { buf = qtn_sml_apps_content_cal; }
+
+// default profile name when new profile is created
+RESOURCE TBUF r_asp_profilename_email { buf = qtn_sml_apps_content_syncml; }
+
+// default profile name when new profile is created
+RESOURCE TBUF r_asp_profilename_note { buf = qtn_sml_apps_content_notes; }
+
+// content name
+RESOURCE TBUF r_asp_content_name_phonebook { buf = qtn_nsml_cnt_display_name; }
+
+// content name
+RESOURCE TBUF r_asp_content_name_calendar { buf = qtn_nsml_agn_display_name; }
+
+// content name
+RESOURCE TBUF r_asp_content_name_note { buf = qtn_nsml_npd_display_name; }
+
+// content name 
+RESOURCE TBUF r_asp_content_name_mms { buf = qtn_nsml_mms_display_name; }
+
+// content name 
+RESOURCE TBUF r_asp_content_name_bkm { buf = qtn_nsml_bkm_display_name; }
+
+
+// content name
+RESOURCE TBUF r_asp_content_name_email { buf = qtn_nsml_eml_display_name; }
+
+// content name
+RESOURCE TBUF r_asp_content_name_sms { buf = qtn_nsml_sms_display_name; }
+
+// content name
+RESOURCE TBUF r_asp_content_title_phonebook { buf = qtn_sml_title_contacts; }
+
+// content name
+RESOURCE TBUF r_asp_content_title_calendar { buf = qtn_sml_title_calendar; }
+
+// content name
+RESOURCE TBUF r_asp_content_title_note { buf = qtn_sml_title_notes; }
+
+// content name
+RESOURCE TBUF r_asp_content_title_email { buf = qtn_sml_title_email; }
+
+// content name
+RESOURCE TBUF r_asp_content_title_sms { buf = qtn_sml_title_sms; }
+
+// content name 
+RESOURCE TBUF r_asp_content_title_mms { buf = qtn_sml_title_mms; }
+
+// content name 
+RESOURCE TBUF r_asp_content_title_bkm { buf = qtn_sml_title_bookmarks; }
+
+// info note for missing mailboxes
+RESOURCE TBUF r_asp_no_mailboxes { buf = qtn_sml_info_no_mailboxes; }
+
+// used in connection dialog as setting value
+RESOURCE TBUF r_asp_always_ask { buf = qtn_ds_sett_always_ask; }
+RESOURCE TBUF r_asp_default_connection { buf = qtn_netw_conset_sett_default_connection; }
+RESOURCE TBUF r_asp_network_destination { buf = qtn_netw_conset_sett_destination; }
+
+// shown when user tries to edit read-only setting
+RESOURCE TBUF r_asp_note_read_only { buf = qtn_ds_note_read_only; }
+
+// shown when user tries to simultaneously edit one sync set
+RESOURCE TBUF r_asp_locked_profile { buf = qtn_nsml_locked_profile; }
+
+// shown in profile dialog setting list
+RESOURCE TBUF r_asp_content_setting_phonebook { buf = qtn_sml_content_settings_pb; }
+
+// shown in profile dialog setting list
+RESOURCE TBUF r_asp_content_setting_calendar { buf = qtn_sml_content_settings_cal; }
+
+// shown in profile dialog setting list
+RESOURCE TBUF r_asp_content_setting_notes { buf = qtn_sml_content_settings_notes; }
+
+// shown in profile dialog setting list
+RESOURCE TBUF r_asp_content_setting_email { buf = qtn_sml_content_settings_email; }
+
+// shown in profile dialog setting list
+RESOURCE TBUF r_asp_content_setting_sms { buf = qtn_sml_content_settings_sms; }
+
+// shown in profile dialog setting list
+RESOURCE TBUF r_asp_content_setting_mms { buf = qtn_sml_content_settings_mms; }
+
+// shown in profile dialog setting list
+RESOURCE TBUF r_asp_content_setting_bkm { buf = qtn_sml_content_settings_bkm; }
+
+
+RESOURCE TBUF r_qtn_apps_newprofile  	    	{ buf = qtn_apps_newprofile; }
+RESOURCE TBUF r_qtn_sml_settingrowitem_mand     { buf = "\t%0U\t\t%1U\t*"; }
+RESOURCE TBUF r_qtn_sml_settingrowitem          { buf = "\t%0U\t\t%1U\t"; }
+RESOURCE TBUF r_asp_sync_completed              { buf = qtn_sml_sync_end_done; }
+RESOURCE TBUF r_asp_popup_profile_info          { buf = qtn_sml_main_info; }
+
+
+// sync progress dialog strings
+RESOURCE TBUF r_syncstatus_sync_conn		    { buf = qtn_sml_sync_conn; }
+RESOURCE TBUF r_syncstatus_sync_disc		    { buf = qtn_sml_sync_disconn; }
+RESOURCE TBUF r_syncstatus_sync_sync		    { buf = qtn_sml_sync_sync; }
+RESOURCE TBUF r_syncstatus_canc		    	    { buf = qtn_sml_sync_cancel; }
+//RESOURCE TBUF r_qtn_nsml_sync_send_unknown      { buf = qtn_nsml_sync_send_unknown; }
+//RESOURCE TBUF r_qtn_nsml_updating  			    { buf = qtn_sml_sync_send; }
+//RESOURCE TBUF r_qtn_nsml_sync_recv_unknown      { buf = qtn_nsml_sync_recv_unknown; }
+//RESOURCE TBUF r_qtn_nsml_receving			    { buf = qtn_sml_sync_recv; }
+RESOURCE TBUF r_qtn_sml_sync_receiving		    { buf = qtn_sml_sync_receiving; }
+RESOURCE TBUF r_qtn_sml_sync_sending		    { buf = qtn_sml_sync_sending; }
+/* Implementation of CMCC PIM v3 begins*/ 
+RESOURCE TBUF r_qtn_sml_sync_receiving_xofy     { buf = qtn_sml_sync_receiving_xofy_tdscdma; }
+RESOURCE TBUF r_qtn_sml_sync_sending_xofy       { buf = qtn_sml_sync_sending_xofy_tdscdma; }
+RESOURCE TBUF r_qtn_sml_sync_receiving_xofy_cal { buf = qtn_sml_sync_receiving_xofy_cal_tdscdma; } 
+RESOURCE TBUF r_qtn_sml_sync_sending_xofy_cal   { buf = qtn_sml_sync_sending_xofy_cal_tdscdma; }
+RESOURCE TBUF r_qtn_nsml_log_err_serverfull     { buf = qtn_nsml_log_err_serverfull_tdscdma; }
+/* Implementation of CMCC PIM v3 ends*/
+
+// log dialog strings
+RESOURCE TBUF r_sml_log_synclog_title  		{ buf = qtn_sml_log_synclog_title; }
+RESOURCE TBUF r_qtn_sml_log_ok			    { buf = qtn_sml_log_ok; }
+RESOURCE TBUF r_qtn_sml_log_cancelled	   	{ buf = qtn_sml_log_cancelled; }
+RESOURCE TBUF r_qtn_sml_log_err				{ buf = qtn_sml_log_err; }
+
+RESOURCE TBUF r_qtn_sml_log_server	    	{ buf = qtn_sml_log_server; }
+RESOURCE TBUF r_qtn_sml_log_remote      	{ buf = qtn_sml_log_remote; }
+RESOURCE TBUF r_qtn_sml_log_phone		    { buf = qtn_sml_log_phone; }
+RESOURCE TBUF r_qtn_sml_log_error		    { buf = qtn_sml_log_error; }
+
+
+RESOURCE TBUF r_qtn_sml_log_profile		    { buf=qtn_sml_log_profile; }
+RESOURCE TBUF r_qtn_sml_log_date		    { buf=qtn_sml_log_date; }
+RESOURCE TBUF r_qtn_sml_log_time		    { buf=qtn_sml_log_time; }
+RESOURCE TBUF r_qtn_sml_log_status		    { buf=qtn_sml_log_status; }
+
+RESOURCE TBUF r_qtn_sml_log_added_content      { buf=qtn_sml_log_added_content; }
+RESOURCE TBUF r_qtn_sml_log_updated_content	   { buf=qtn_sml_log_updated_content; }
+RESOURCE TBUF r_qtn_sml_log_deleted_content	   { buf=qtn_sml_log_deleted_content; }
+RESOURCE TBUF r_qtn_sml_log_discarded_content  { buf=qtn_sml_log_discarded_content; }
+RESOURCE TBUF r_qtn_sml_log_moved_content	   { buf=qtn_sml_log_moved_content; }
+
+RESOURCE TBUF r_qtn_sml_log_added_contacts     { buf=qtn_sml_log_added_contacts; }
+RESOURCE TBUF r_qtn_sml_log_updated_contacts   { buf=qtn_sml_log_updated_contacts; }
+RESOURCE TBUF r_qtn_sml_log_deleted_contacts   { buf=qtn_sml_log_deleted_contacts; }
+RESOURCE TBUF r_qtn_sml_log_discarded_contacts { buf=qtn_sml_log_discarded_contacts; }
+RESOURCE TBUF r_qtn_sml_log_moved_contacts	   { buf=qtn_sml_log_moved_contacts; }
+
+RESOURCE TBUF r_qtn_sml_log_added_calendar     { buf=qtn_sml_log_added_calendar; }
+RESOURCE TBUF r_qtn_sml_log_updated_calendar   { buf=qtn_sml_log_updated_calendar; }
+RESOURCE TBUF r_qtn_sml_log_deleted_calendar   { buf=qtn_sml_log_deleted_calendar; }
+RESOURCE TBUF r_qtn_sml_log_discarded_calendar { buf=qtn_sml_log_discarded_calendar; }
+RESOURCE TBUF r_qtn_sml_log_moved_calendar	   { buf=qtn_sml_log_moved_calendar; }
+
+RESOURCE TBUF r_qtn_sml_log_added_notes        { buf=qtn_sml_log_added_notes; }
+RESOURCE TBUF r_qtn_sml_log_updated_notes	   { buf=qtn_sml_log_updated_notes; }
+RESOURCE TBUF r_qtn_sml_log_deleted_notes	   { buf=qtn_sml_log_deleted_notes; }
+RESOURCE TBUF r_qtn_sml_log_discarded_notes    { buf=qtn_sml_log_discarded_notes; }
+RESOURCE TBUF r_qtn_sml_log_moved_notes  	   { buf=qtn_sml_log_moved_notes; }
+
+RESOURCE TBUF r_qtn_sml_log_added_email        { buf=qtn_sml_log_added_email; }
+RESOURCE TBUF r_qtn_sml_log_updated_email	   { buf=qtn_sml_log_updated_email; }
+RESOURCE TBUF r_qtn_sml_log_deleted_email	   { buf=qtn_sml_log_deleted_email; }
+RESOURCE TBUF r_qtn_sml_log_discarded_email    { buf=qtn_sml_log_discarded_email; }
+RESOURCE TBUF r_qtn_sml_log_moved_email  	   { buf=qtn_sml_log_moved_email; }
+
+RESOURCE TBUF r_qtn_sml_log_added_sms          { buf=qtn_sml_log_added_sms; }
+RESOURCE TBUF r_qtn_sml_log_updated_sms	       { buf=qtn_sml_log_updated_sms; }
+RESOURCE TBUF r_qtn_sml_log_deleted_sms	       { buf=qtn_sml_log_deleted_sms; }
+RESOURCE TBUF r_qtn_sml_log_discarded_sms      { buf=qtn_sml_log_discarded_sms; }
+RESOURCE TBUF r_qtn_sml_log_moved_sms  	       { buf=qtn_sml_log_moved_sms; }
+
+RESOURCE TBUF r_qtn_sml_log_added_mms         { buf=qtn_sml_log_added_mms; }
+RESOURCE TBUF r_qtn_sml_log_updated_mms	       { buf=qtn_sml_log_updated_mms; }
+RESOURCE TBUF r_qtn_sml_log_deleted_mms	       { buf=qtn_sml_log_deleted_mms; }
+RESOURCE TBUF r_qtn_sml_log_discarded_mms      { buf=qtn_sml_log_discarded_mms; }
+RESOURCE TBUF r_qtn_sml_log_moved_mms  	       { buf=qtn_sml_log_moved_mms; }
+
+RESOURCE TBUF r_qtn_sml_log_added_bkm          { buf=qtn_sml_log_added_bkm; }
+RESOURCE TBUF r_qtn_sml_log_updated_bkm	       { buf=qtn_sml_log_updated_bkm; }
+RESOURCE TBUF r_qtn_sml_log_deleted_bkm	       { buf=qtn_sml_log_deleted_bkm; }
+RESOURCE TBUF r_qtn_sml_log_discarded_bkm      { buf=qtn_sml_log_discarded_bkm; }
+RESOURCE TBUF r_qtn_sml_log_moved_bkm  	       { buf=qtn_sml_log_moved_bkm; }
+
+//
+// profile wizard strings
+//
+RESOURCE TBUF r_asp_set_wizard_start            { buf = qtn_ds_conf_profile_wizard_start; }
+RESOURCE TBUF r_asp_set_protocol_version        { buf = qtn_sml_set_list_protocol_version; }
+RESOURCE TBUF r_asp_set_destination_name        { buf = qtn_sml_set_list_destination_name; }
+RESOURCE TBUF r_asp_set_host_address    	    { buf = qtn_sml_set_list_host; }
+RESOURCE TBUF r_asp_set_server_id        	    { buf = qtn_sml_set_list_server_id; }
+RESOURCE TBUF r_asp_set_bearer_type             { buf = qtn_sml_set_bearertype; }
+RESOURCE TBUF r_asp_set_username        	    { buf = qtn_sml_set_list_username; }
+RESOURCE TBUF r_asp_set_password    	        { buf = qtn_sml_set_list_password; }
+RESOURCE TBUF r_asp_set_content_selection       { buf = qtn_sml_set_list_content_selection; }
+RESOURCE TBUF r_asp_set_wizard_end              { buf = qtn_ds_conf_profile_wizard_end; }
+RESOURCE TBUF r_asp_set_wizard_end_app          { buf = qtn_ds_conf_profile_wizard_end_app; }
+RESOURCE TBUF r_asp_set_wizard_end_email        { buf = qtn_ds_conf_profile_wizard_end_email; }
+
+RESOURCE TBUF r_asp_remote_database             { buf = qtn_sml_remote_database; }
+RESOURCE TBUF r_asp_remote_database_cnt         { buf = qtn_sml_remote_database_cnt; }
+RESOURCE TBUF r_asp_remote_database_agn         { buf = qtn_sml_remote_database_agn; }
+RESOURCE TBUF r_asp_remote_database_npd         { buf = qtn_sml_remote_database_npd; }
+RESOURCE TBUF r_asp_remote_database_eml         { buf = qtn_sml_remote_database_eml; }
+RESOURCE TBUF r_asp_remote_database_sms         { buf = qtn_sml_remote_database_sms; }
+RESOURCE TBUF r_asp_local_database_eml          { buf = qtn_sml_local_database_eml; }
+RESOURCE TBUF r_asp_remote_database_mms          { buf = qtn_sml_remote_database_mms; }
+RESOURCE TBUF r_asp_remote_database_bkm          { buf = qtn_sml_remote_database_bkm; }
+
+//Advance Setting String
+RESOURCE TBUF r_asp_wizard_popup_roaming_setting       { buf = qtn_ds_set_roaming; }
+// r_asp_remote_database_mms not used
+//RESOURCE TBUF r_asp_remote_database_mms         { buf = qtn_sml_remote_database_mms; }
+
+
+
+RESOURCE TBUF r_asp_wizard_popup_profile_name        { buf = qtn_ds_wizard_popup_profile_name; }
+RESOURCE TBUF r_asp_wizard_popup_protocol_version    { buf = qtn_ds_wizard_popup_protocol_version; }
+RESOURCE TBUF r_asp_wizard_popup_content_selection   { buf = qtn_ds_wizard_popup_content_selection; }
+RESOURCE TBUF r_asp_wizard_popup_contacts_db         { buf = qtn_ds_wizard_popup_contacts_db; }
+RESOURCE TBUF r_asp_wizard_popup_calendar_db         { buf = qtn_ds_wizard_popup_calendar_db; }
+RESOURCE TBUF r_asp_wizard_popup_notes_db            { buf = qtn_ds_wizard_popup_notes_db; }
+RESOURCE TBUF r_asp_wizard_popup_email_db            { buf = qtn_ds_wizard_popup_email_db; }
+RESOURCE TBUF r_asp_wizard_popup_email_local_db      { buf = qtn_ds_wizard_popup_mailbox; }
+RESOURCE TBUF r_asp_wizard_popup_sms_db              { buf = qtn_ds_wizard_popup_sms_db; }
+RESOURCE TBUF r_asp_wizard_popup_mms_db              { buf = qtn_ds_wizard_popup_mms_db; }
+RESOURCE TBUF r_asp_wizard_popup_bkm_db              { buf = qtn_ds_wizard_popup_bkm_db; }
+RESOURCE TBUF r_asp_wizard_popup_remote_db           { buf = qtn_ds_wizard_popup_remote_db; }
+RESOURCE TBUF r_asp_wizard_popup_connection_type     { buf = qtn_ds_wizard_popup_connection_type; }
+RESOURCE TBUF r_asp_wizard_popup_host_address        { buf = qtn_ds_wizard_popup_host_address; }
+RESOURCE TBUF r_asp_wizard_popup_server_id           { buf = qtn_ds_wizard_popup_server_id; }
+RESOURCE TBUF r_asp_wizard_popup_username            { buf = qtn_ds_wizard_popup_username; }
+RESOURCE TBUF r_asp_wizard_popup_password            { buf = qtn_ds_wizard_popup_password; }
+
+RESOURCE TBUF r_asp_note_profile_name_missing  	     { buf = qtn_sml_note_profile_name_missing; }
+RESOURCE TBUF r_asp_note_host_address_missing  	     { buf = qtn_sml_note_host_address_missing; }
+RESOURCE TBUF r_asp_note_incorrect_host_address	     { buf = qtn_sml_note_incorrect_host_address; }
+RESOURCE TBUF r_asp_note_remote_database_missing     { buf = qtn_sml_note_remote_database_missing; }
+RESOURCE TBUF r_asp_note_mms_database_missing     { buf = qtn_sml_note_mms_db_missing; }
+RESOURCE TBUF r_asp_note_sms_database_missing     { buf = qtn_sml_note_sms_db_missing; }
+RESOURCE TBUF r_asp_note_bkm_database_missing     { buf = qtn_sml_note_bkm_db_missing; }
+RESOURCE TBUF r_asp_note_contacts_db_missing     { buf = qtn_sml_note_contacts_db_missing; }
+RESOURCE TBUF r_asp_note_calendar_db_missing     { buf = qtn_sml_note_calendar_db_missing; }
+RESOURCE TBUF r_asp_note_notes_db_missing     { buf = qtn_sml_note_notes_db_missing; }
+RESOURCE TBUF r_asp_note_email_db_missing     { buf = qtn_sml_note_email_db_missing; }
+RESOURCE TBUF r_asp_note_username_missing            { buf = qtn_sml_note_username_missing; }
+RESOURCE TBUF r_asp_note_password_missing            { buf = qtn_sml_note_password_missing; }
+RESOURCE TBUF r_asp_note_incorrect_server_id         { buf = qtn_sml_note_incorrect_server_id; }
+
+RESOURCE TBUF r_asp_log_err_profile_wizard           { buf = qtn_sml_log_err_profile_wizard; }
+
+
+// automatic sync strings
+
+//RESOURCE TBUF r_asp_sett_auto_sync_status    	  { buf = qtn_sml_sett_auto_sync_status; }
+RESOURCE TBUF r_asp_sett_auto_sync_all_days       { buf = qtn_sml_sett_auto_sync_all_days; }
+RESOURCE TBUF r_asp_sett_auto_sync_sel_days       { buf = qtn_sml_sett_auto_sync_sel_days; }
+RESOURCE TBUF r_asp_sett_auto_sync_roaming    	  { buf = qtn_sml_sett_auto_sync_roaming; }
+//RESOURCE TBUF r_asp_title_automatic_sync_profile_selection 	  { buf = qtn_sml_title_profile_selection; }
+RESOURCE TBUF r_asp_title_automatic_sync_content_list   	  { buf = qtn_sml_auto_sync_view_contents_head; }
+RESOURCE TBUF r_asp_popup_auto_sync_profile   	  { buf = qtn_sml_main_info_auto_on; }
+RESOURCE TBUF r_asp_popup_auto_sync_error   	  { buf = qtn_sml_main_info_error; }
+RESOURCE TBUF r_asp_popup_auto_sync_done     	  { buf = qtn_sml_sett_auto_sync_done; }
+RESOURCE TBUF r_asp_note_peak_interval_days  	  { buf = qtn_sml_note_peak_interval_days; }
+RESOURCE TBUF r_asp_note_offpeak_interval_days  	  { buf = qtn_sml_note_offpeak_interval_days; }
+
+//auto sync setting
+RESOURCE TBUF r_asp_sett_auto_sync_profile   	  { buf = qtn_sml_sett_auto_sync_profile; }
+RESOURCE TBUF r_asp_sett_value_not_defined   	  { buf = qtn_sml_sett_value_not_defined; }
+RESOURCE TBUF r_asp_sett_auto_sync_contents   	  { buf = qtn_sml_sett_auto_sync_contents; }
+RESOURCE TBUF r_asp_sett_auto_peak_schedule   	  { buf = qtn_sml_sett_auto_peak_schedule; }
+RESOURCE TBUF r_asp_sett_auto_off_peak_schedule   	  { buf = qtn_sml_sett_auto_offpeak_schedule; }
+RESOURCE TBUF r_asp_sett_auto_sync_time   	  { buf = qtn_sml_sett_auto_sync_time; }
+RESOURCE TBUF r_asp_sett_auto_peak_start   	  { buf = qtn_sml_sett_auto_peak_start; }
+RESOURCE TBUF r_asp_sett_auto_peak_end   	  { buf = qtn_sml_sett_auto_peak_end; }
+RESOURCE TBUF r_asp_sett_auto_sync_days   	  { buf = qtn_sml_sett_auto_sync_days; }
+//RESOURCE TBUF r_asp_setting_auto_sync_roaming_status   	  { buf = qtn_sml_auto_sync_roaming_status; }
+RESOURCE TBUF r_asp_note_auto_contents_missing_settings   	  { buf = qtn_sml_note_auto_contents_missing_settings; }
+
+RESOURCE TBUF r_asp_sett_value_all_contents       { buf = qtn_sml_sett_value_all_contents; }
+RESOURCE TBUF r_asp_sett_value_selected_contents       { buf = qtn_sml_sett_value_selected_contents; }
+RESOURCE TBUF r_asp_main_auto_error_log_link       { buf = qtn_sml_main_auto_error_log_link; }
+
+RESOURCE TBUF r_asp_incorrect_peak_time       { buf = qtn_sml_incorrect_peak_time; }
+RESOURCE TBUF r_asp_manual_sync_override       { buf = qtn_sml_manual_sync_override; }
+
+//sync frequency
+RESOURCE TBUF r_asp_sett_auto_sync_freq      { buf = qtn_sml_sett_auto_sync_freq; }
+RESOURCE TBUF r_asp_sett_auto_sync_freq_value_manual      { buf = qtn_sml_sett_auto_sync_freq_value_manual; }
+RESOURCE TBUF r_asp_sett_auto_sync_freq_many_a_day      { buf = qtn_sml_sett_auto_sync_freq_many_a_day; }
+RESOURCE TBUF r_asp_sett_auto_value_24_hours      { buf = qtn_sml_sett_auto_value_24_hours; }
+RESOURCE TBUF r_asp_sett_auto_value_2_days      { buf = qtn_sml_sett_auto_value_2_days; }
+RESOURCE TBUF r_asp_sett_auto_value_4_days      { buf = qtn_sml_sett_auto_value_4_days; }
+RESOURCE TBUF r_asp_sett_auto_value_7_days      { buf = qtn_sml_sett_auto_value_7_days; }
+RESOURCE TBUF r_asp_sett_auto_value_14_days      { buf = qtn_sml_sett_auto_value_14_days; }
+RESOURCE TBUF r_asp_sett_auto_value_30_days      { buf = qtn_sml_sett_auto_value_30_days; }
+
+
+//peak intervals
+RESOURCE TBUF r_asp_sett_auto_value_manual      { buf = qtn_sml_sett_auto_value_manual; }
+RESOURCE TBUF r_asp_sett_auto_value_15_mins      { buf = qtn_sml_sett_auto_value_15_mins; }
+RESOURCE TBUF r_asp_sett_auto_value_30_mins      { buf = qtn_sml_sett_auto_value_30_mins; }
+RESOURCE TBUF r_asp_sett_auto_value_1_hour      { buf = qtn_sml_sett_auto_value_1_hour; }
+RESOURCE TBUF r_asp_sett_auto_value_2_hours      { buf = qtn_sml_sett_auto_value_2_hours; }
+RESOURCE TBUF r_asp_sett_auto_value_4_hours      { buf = qtn_sml_sett_auto_value_4_hours; }
+RESOURCE TBUF r_asp_sett_auto_value_8_hours      { buf = qtn_sml_sett_auto_value_8_hours; }
+RESOURCE TBUF r_asp_sett_auto_value_12_hours      { buf = qtn_sml_sett_auto_value_12_hours; }
+
+//off-peak intervals
+RESOURCE TBUF r_asp_sett_auto_value_off_manual      { buf = qtn_sml_sett_auto_value_off_manual; }
+RESOURCE TBUF r_asp_sett_auto_value_off_15_mins      { buf = qtn_sml_sett_auto_value_off_15_mins; }
+RESOURCE TBUF r_asp_sett_auto_value_off_30_mins      { buf = qtn_sml_sett_auto_value_off_30_mins; }
+RESOURCE TBUF r_asp_sett_auto_value_off_1_hour      { buf = qtn_sml_sett_auto_value_off_1_hour; }
+RESOURCE TBUF r_asp_sett_auto_value_off_2_hours      { buf = qtn_sml_sett_auto_value_off_2_hours; }
+RESOURCE TBUF r_asp_sett_auto_value_off_4_hours      { buf = qtn_sml_sett_auto_value_off_4_hours; }
+RESOURCE TBUF r_asp_sett_auto_value_off_8_hours      { buf = qtn_sml_sett_auto_value_off_8_hours; }
+RESOURCE TBUF r_asp_sett_auto_value_off_12_hours      { buf = qtn_sml_sett_auto_value_off_12_hours; }
+
+
+RESOURCE TBUF r_asp_main_note_auto_on      { buf = qtn_sml_main_note_auto_on; }
+RESOURCE TBUF r_asp_sett_auto_sync_done      { buf = qtn_sml_sett_auto_sync_done; }
+
+
+RESOURCE TBUF r_asp_title_profile_settings      { buf = qtn_sml_title_profile_settings; }
+RESOURCE TBUF r_asp_title_automatic_sync_settings { buf = qtn_sml_title_automatic_sync_settings; }
+
+RESOURCE TBUF r_asp_setting_folder_profile     { buf = qtn_sml_setting_folder_profile; }
+RESOURCE TBUF r_asp_setting_folder_schedule      { buf = qtn_sml_setting_folder_schedule; }
+RESOURCE TBUF r_asp_query_common_conf_delete      { buf = qtn_query_common_conf_delete; }
+RESOURCE TBUF r_asp_ds_conf_query_delete_auto_sync_profile      { buf = qtn_ds_conf_query_delete_auto_sync_profile; }
+RESOURCE TBUF r_asp_note_modify_auto_sync_settings      { buf = qtn_sml_note_modify_auto_sync_settings; }
+RESOURCE TBUF r_asp_query_iap_no_ask_always      { buf = qtn_sml_query_iap_no_ask_always; }
+
+
+
+RESOURCE TBUF r_asp_query_auto_sync_on      { buf = qtn_sml_query_auto_sync_on; }
+
+
+RESOURCE ARRAY r_asp_auto_sync_roaming_yesno
+	{
+	items=
+		{
+		STRING { text = qtn_sml_sett_auto_sync_roaming_off ; },
+		STRING { text = qtn_sml_sett_auto_sync_roaming_on ; }
+		};
+	}
+
+
+RESOURCE ARRAY r_asp_auto_sync_days_list
+	{
+	items=
+		{
+		STRING { text = qtn_sml_sett_auto_sync_mon ; },
+		STRING { text = qtn_sml_sett_auto_sync_tue ; },
+		STRING { text = qtn_sml_sett_auto_sync_wed ; },
+		STRING { text = qtn_sml_sett_auto_sync_thu ; },
+		STRING { text = qtn_sml_sett_auto_sync_fri ; },
+		STRING { text = qtn_sml_sett_auto_sync_sat ; },
+		STRING { text = qtn_sml_sett_auto_sync_sun ; }
+		};
+	}
+
+// error strings
+RESOURCE TBUF r_asp_log_err_systemerror    		   { buf = qtn_nsml_log_err_systemerror; }
+RESOURCE TBUF r_asp_log_err_servererror    		   { buf = qtn_nsml_log_err_servererror; }
+RESOURCE TBUF r_asp_log_err_protocol    	       { buf = qtn_nsml_log_err_protocol; }
+RESOURCE TBUF r_asp_log_err_cmdnotsupported    	   { buf = qtn_nsml_log_err_cmdnotsupported; }
+RESOURCE TBUF r_asp_log_err_versionnotsupported    { buf = qtn_nsml_log_err_versionnotsupported; }
+RESOURCE TBUF r_asp_log_err_contentnotsupported    { buf = qtn_nsml_log_err_contentnotsupported; }
+RESOURCE TBUF r_asp_log_err_clientauth    		   { buf = qtn_nsml_log_err_clientauth; }
+RESOURCE TBUF r_asp_log_err_serverbusy    		   { buf = qtn_nsml_log_err_serverbusy; }
+RESOURCE TBUF r_asp_log_err_servernotresponding    { buf = qtn_nsml_log_err_servernotresponding; }
+RESOURCE TBUF r_asp_log_err_uriinvalid    		   { buf = qtn_nsml_log_err_uriinvalid; }
+RESOURCE TBUF r_asp_log_err_comm    		       { buf = qtn_nsml_log_err_comm; }
+RESOURCE TBUF r_asp_log_err_invalidsynctype    	   { buf = qtn_nsml_log_err_invalidsynctype; }
+RESOURCE TBUF r_asp_log_err_localdatabase    	   { buf = qtn_nsml_log_err_localdatabase; }
+RESOURCE TBUF r_asp_log_err_remotedatabase    	   { buf = qtn_nsml_log_err_remotedatabase; }
+RESOURCE TBUF r_asp_log_err_invaliddatabase    	   { buf = qtn_nsml_log_err_invaliddatabase; }
+RESOURCE TBUF r_asp_log_err_httpauth    	       { buf = qtn_nsml_log_err_httpauth; }
+RESOURCE TBUF r_asp_log_err_localdbchanged    	   { buf = qtn_nsml_log_err_localdbchanged; }
+RESOURCE TBUF r_asp_log_err_offline         	   { buf = qtn_offline_not_possible; }
+RESOURCE TBUF r_asp_log_err_untrusted_certificate  { buf = qtn_sml_log_err_untrusted_certificate; }
+
+// Roaming settings resources
+RESOURCE TBUF r_asp_note_network_confirmation      { buf = qtn_sml_note_network_confirmation; }
+RESOURCE TBUF r_asp_note_network_not_allowed       { buf = qtn_sml_note_network_not_allowed; }
+RESOURCE TBUF r_asp_note_not_home_network          { buf = qtn_sml_note_not_home_network; }
+
+RESOURCE TBUF r_asp_title_advanced_settings        { buf = qtn_sml_title_adv_settings; }
+//------------------------------------------------------------------------------
+// connection dialog setting list item name resource
+//------------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_asp_connection_dialog_setting_items
+	{
+	items=
+		{
+		STRING		{ text = qtn_sml_set_list_profile; },
+		STRING		{ text = qtn_sml_set_list_server_id; },
+		STRING 		{ text = qtn_sml_set_bearertype; },
+		STRING 		{ text = qtn_netw_conset_sett_destination; },
+		STRING		{ text = qtn_sml_set_list_host; },
+		STRING 		{ text = qtn_sml_set_list_port; },
+		STRING 		{ text = qtn_sml_set_list_username; },
+		STRING 		{ text = qtn_sml_set_list_password; },
+		STRING 		{ text = qtn_ds_set_lbl_active; },
+		STRING		{ text = qtn_sml_set_list_https_username; },
+		STRING		{ text = qtn_sml_set_list_https_password; },
+		STRING 		{ text = qtn_sml_sync_type; },
+		STRING		{ text = qtn_sml_set_list_protocol_version; }		
+		};
+	}
+
+RESOURCE ARRAY r_advance_settings_dialog_items
+    {
+    items=
+        {
+        STRING      { text = qtn_ds_set_roaming; }       
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// content dialog setting items
+//------------------------------------------------------------------------------
+//
+RESOURCE TBUF r_asp_sett_local_database  { buf = qtn_sml_local_database; }
+RESOURCE TBUF r_asp_sett_remote_database { buf = qtn_sml_remote_database; }
+RESOURCE TBUF r_asp_sett_use_filters     { buf = qtn_nsml_eml_use_filters; }
+
+
+
+
+//------------------------------------------------------------------------------
+// Editor for secret setting page
+//------------------------------------------------------------------------------
+//
+RESOURCE SECRETED r_setting_pwd_editor
+	{
+ 	num_letters=EAspMaxPasswordLength;
+	}
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_activate_later_activate
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOk;
+            txt = qtn_sml_cba_activate;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = qtn_sml_cba_later;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOk;
+            txt = qtn_sml_cba_activate;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_start_cancel_start
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOk;
+            txt = qtn_sml_cba_start;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = qtn_sml_cba_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOk;
+            txt = qtn_sml_cba_start;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_next_back_next
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOk;
+            txt = qtn_sml_cba_next;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyDone;
+            txt = qtn_sml_cba_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOk;
+            txt = qtn_sml_cba_next;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_next_back_mark
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOk;
+            txt = qtn_sml_cba_next;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyDone;
+            txt = qtn_sml_cba_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyMark;
+            txt = qtn_msk_mark;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_next_back_select
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOk;
+            txt = qtn_sml_cba_next;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyDone;
+            txt = qtn_sml_cba_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeySelect;
+            txt = qtn_msk_select;
+            }
+        };
+    }
+
+
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_ok_cancel_mark
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOk;
+            txt = text_softkey_ok;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyMark;
+            txt = qtn_msk_mark;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_options_back_change
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOpen;
+            txt = qtn_msk_change;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_options_select_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOpen;
+            txt = qtn_msk_select;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_options_view_content_back
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOpen;
+            txt = qtn_msk_view_contents;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_options_exit_mark
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyExit;
+            txt = text_softkey_exit;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyMark;
+            txt = qtn_msk_mark;
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_options_back_mark
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyMark;
+            txt = qtn_msk_mark;
+            }
+        };
+    }
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+
+RESOURCE CBA r_asp_cba_options_back_open
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyBack;
+            txt = text_softkey_back;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyOpen;
+            txt = qtn_msk_open;
+            }
+        };
+    }
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_mark_cancel
+    {
+    buttons =
+        {
+         CBA_BUTTON
+            {
+            id = EAknSoftkeyMark;
+            txt = qtn_msk_mark;
+            },       
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_cancel;
+            }       
+        };
+    }
+
+//------------------------------------------------------------------------------
+// Softkey resource
+//------------------------------------------------------------------------------
+//
+RESOURCE CBA r_asp_cba_empty_cancel_mark
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyMark;
+            txt = qtn_msk_mark;
+            }
+        };
+    }
+
+//------------------------------------------------------------------------------
+// Setting page for check box settings
+//------------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_asp_setting_check_next_back
+	{
+	number = EAknSettingPageNoOrdinalDisplayed;
+	softkey_resource = r_asp_cba_next_back_mark;
+	type =  EAknSetListBox;
+	editor_resource_id= r_setting_app_listbox;
+	}
+
+
+//------------------------------------------------------------------------------
+// Setting page for radio button settings
+//------------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_asp_setting_radio_next_back
+	{
+	number = EAknSettingPageNoOrdinalDisplayed;
+	softkey_resource = r_asp_cba_next_back_select;
+	type =  EAknSetListBox;
+	editor_resource_id= r_setting_app_listbox;
+	}
+
+
+//------------------------------------------------------------------------------
+// Setting page for text settings
+//------------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_asp_setting_text_next_back
+	{
+	number = EAknSettingPageNoOrdinalDisplayed;
+	type=EEikCtEdwin;
+	softkey_resource = r_asp_cba_next_back_next;
+	editor_resource_id = r_nsml_settings_text_editor;
+	}
+
+
+//------------------------------------------------------------------------------
+// Setting page for secret text editor
+//------------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_asp_setting_password_next_back
+	{	
+	number = EAknSettingPageNoOrdinalDisplayed;
+	type = EEikCtSecretEd;
+	softkey_resource = r_asp_cba_next_back_next;
+	editor_resource_id = r_setting_pwd_editor;
+	}
+
+
+
+
+//------------------------------------------------------------------------------
+// Listbox resourcee
+//------------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_setting_app_listbox 
+	{
+	flags = 0x0001;
+	}
+
+
+//------------------------------------------------------------------------------
+// Date editor
+//------------------------------------------------------------------------------
+//
+RESOURCE DATE_EDITOR r_asp_date_time_date_editor
+    {
+    minDate = DATE {day = 0; month = 0; year = 1980;};
+    maxDate = DATE {day = 30; month = 11; year = 2060;};
+    }
+
+RESOURCE AVKON_SETTING_PAGE r_asp_setting_date
+    {
+    type = EEikCtDateEditor;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    menubar = R_AVKON_MENUPANE_EMPTY;
+    editor_resource_id = r_asp_date_time_date_editor;
+    }
+
+
+//------------------------------------------------------------------------------
+// Time editor
+//------------------------------------------------------------------------------
+//
+RESOURCE TIME_EDITOR r_asp_date_time_time_editor
+    {
+    minTime = TIME {second = 0; minute = 0; hour = 0;};
+    maxTime = TIME {second = 59; minute = 59; hour = 23;};
+    flags = EEikTimeWithoutSecondsField;
+    }
+
+
+RESOURCE AVKON_SETTING_PAGE r_asp_setting_time
+    {
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    menubar = R_AVKON_MENUPANE_EMPTY;
+    type = EEikCtTimeEditor;
+    editor_resource_id = r_asp_date_time_time_editor;
+    }
+
+
+//------------------------------------------------------------------------------
+// Setting page for radio button settings
+//------------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_asp_setting_radio
+	{ 
+	number = EAknSettingPageNoOrdinalDisplayed;
+	softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+	type =  EAknSetListBox;
+	editor_resource_id= r_setting_app_listbox;
+	}
+
+//------------------------------------------------------------------------------
+// Setting page for multi selection list
+//------------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_asp_multi_selection_list
+	{ 
+	number = EAknSettingPageNoOrdinalDisplayed;
+	softkey_resource = r_asp_cba_ok_cancel_mark;
+	type =  EAknSetListBox;
+	editor_resource_id= r_setting_app_listbox;
+	}
+
+//------------------------------------------------------------------------------
+// Editor for number setting page
+//------------------------------------------------------------------------------
+//
+RESOURCE AVKON_INTEGER_EDWIN r_asp_setting_integer
+	{
+	maxlength = 5;
+	min =	1;
+	max =	65535;
+	}
+
+
+//------------------------------------------------------------------------------
+// Setting page for number settings
+//------------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_asp_setting_number
+	{
+	number = EAknSettingPageNoOrdinalDisplayed;
+	type=EAknCtIntegerEdwin;
+	softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+	editor_resource_id = r_asp_setting_integer;
+	}
+
+
+//------------------------------------------------------------------------------
+// Setting page for secret text editor
+//------------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_asp_setting_password
+	{	
+	number = EAknSettingPageNoOrdinalDisplayed;
+	type = EEikCtSecretEd;
+	softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+	editor_resource_id = r_setting_pwd_editor;
+	}
+
+
+//------------------------------------------------------------------------------
+// Editor for text setting page
+//------------------------------------------------------------------------------
+//
+RESOURCE EDWIN r_nsml_settings_text_editor
+	{
+	flags=0;
+	width=9;
+	lines=5;
+	maxlength=EAspMaxProfileNameLength;
+	default_input_mode=EAknEditorAlphaInputMode;
+	flags = EEikEdwinNoLineOrParaBreaks;
+	avkon_flags=0;
+	}
+
+
+//------------------------------------------------------------------------------
+// Setting page for text settings
+//------------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_asp_setting_text
+	{
+	number = EAknSettingPageNoOrdinalDisplayed;
+	type=EEikCtEdwin;
+	softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+	editor_resource_id = r_nsml_settings_text_editor;
+	}
+
+
+//------------------------------------------------------------------------------
+// yes/no selection resource
+//------------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_asp_filters_used_yesno
+	{
+	items=
+		{
+		STRING { text = qtn_nsml_eml_use_filters_no ; },
+		STRING { text = qtn_nsml_eml_use_filters_yes ; }
+		};
+	}
+
+
+//------------------------------------------------------------------------------
+// content dialog sync type resource.
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_asp_sync_type
+	{
+	items =
+		{
+		STRING { text = qtn_sml_sync_type_normal; },
+		STRING { text = qtn_sml_sync_type_one_way_dev_to_srv; },
+		STRING { text = qtn_sml_sync_type_one_way_srv_to_dev; }
+		};
+	}
+
+
+//------------------------------------------------------------------------------
+// content dialog sync type resource.
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_asp_server_alert_type
+	{
+	items =
+		{
+		STRING { text = qtn_sml_set_sync_req_auto; },
+		STRING { text = qtn_sml_set_sync_req_ask_always; },
+		STRING { text = qtn_sml_set_sync_req_never; }
+		};
+	}
+
+
+//------------------------------------------------------------------------------
+// connection dialog proticol version resource.
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_asp_protocol_version
+	{
+	items =
+		{
+		STRING { text = qtn_sml_syncml_1_1 ; },
+		STRING { text = qtn_sml_syncml_1_2 ; }
+		};
+	}
+
+//------------------------------------------------------------------------------
+// Roaming Settings resource.
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_asp_roaming_settings
+    {
+    items =
+        {
+        STRING { text = qtn_sml_always_ask ; },
+        STRING { text = qtn_sml_always_allow ; },
+        STRING { text = qtn_sml_never_allow ; }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// connection dialog network connection resource.
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_asp_network_connection
+	{
+	items =
+		{
+		STRING { text = qtn_netw_conset_sett_default_connection ; },
+		STRING { text = qtn_netw_conset_sett_user_defined ; }
+		};
+	}
+
+//------------------------------------------------------------------------------
+// text query resource
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_text_query
+	{ 
+	flags=EGeneralQueryFlags;
+	buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+	items=
+		{
+		DLG_LINE
+			{
+			type=EAknCtQuery;
+			id=EGeneralQuery;
+			control=AVKON_DATA_QUERY
+				{
+				layout=EDataLayout;
+				control = EDWIN;
+				};
+			}
+		};
+	} 
+
+
+//------------------------------------------------------------------------------
+// confirmation query resource
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_confirmation_query
+	{ 
+	flags=EGeneralQueryFlags;
+	buttons=R_AVKON_SOFTKEYS_YES_NO__YES;
+	items=
+		{
+		DLG_LINE
+			{
+			type=EAknCtQuery;
+			id=EGeneralQuery;
+			control=AVKON_CONFIRMATION_QUERY
+				{
+				layout=EConfirmationLayout;
+				};
+			}
+		};
+	} 
+
+//------------------------------------------------------------------------------
+// Roaming confirmation query resource
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_roaming_confirmation_query
+    { 
+    flags=EGeneralQueryFlags;
+    buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control=AVKON_CONFIRMATION_QUERY
+                {
+                layout=EConfirmationLayout;
+                };
+            }
+        };
+    } 
+
+
+//------------------------------------------------------------------------------
+// information query resource
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_information_query
+    {
+    flags=EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control= AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationQueryLayout;
+                animation = R_QGN_NOTE_INFO_ANIM;
+                };
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// information query resource
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_error_query
+    {
+    flags=EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control= AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationQueryLayout;
+                animation = R_QGN_NOTE_ERROR_ANIM;
+                };
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// message query resource
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_message_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK;
+    items=
+        {
+        DLG_LINE 
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                };
+            }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// progress dialog resource (shows sync progress)
+//------------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_progress_note
+	{ 
+	flags=EAknProgressNoteFlags | EEikDialogFlagNotifyEsc;
+	buttons=R_AVKON_SOFTKEYS_CANCEL;
+	items= 
+		{
+		DLG_LINE
+			{
+			type=EAknCtNote;
+			id=EAspSyncProgressNote;
+			control=AVKON_NOTE 
+				{
+                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
+				layout=EProgressLayout;
+				singular_label= "\n \n \n";
+				};
+			}
+		};
+	} 
+
+
+// -----------------------------------------------------------------------------
+// general list query resource.
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_list_query
+    {
+    flags=EEikDialogFlagWait | EGeneralQueryFlags;
+
+    buttons=R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT;
+
+	items=
+        {
+		AVKON_LIST_QUERY_DLG_LINE
+            {
+            control = AVKON_LIST_QUERY_CONTROL
+    	        {
+			    listtype = EAknCtSinglePopupMenuListBox;
+				heading = qtn_profile_dialog_title;
+			    
+			    listbox = AVKON_LIST_QUERY_LIST
+			        {
+				    // items added dynamically
+				    };
+			    };
+		    }
+		};
+    }
+
+
+// -----------------------------------------------------------------------------
+// filter dialog resource (shows sync connection settings).
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_filter_dialog
+    {
+    flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc;
+    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
+
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtSettingListBox;
+			itemflags=EEikDlgItemTakesEnterKey;
+			id=EAspFilterDialog;
+			control=LISTBOX
+				{
+				flags=0;
+				height=11;
+				width=80;
+				};            
+            }
+		};
+    }
+
+
+RESOURCE MENU_BAR r_asp_filter_dialog_menu
+	{
+	titles= 
+		{ 
+		MENU_TITLE 
+			{ 
+			menu_pane=r_asp_filter_dialog_menu_pane;
+			}
+		};
+	}
+
+
+RESOURCE MENU_PANE r_asp_filter_dialog_menu_pane
+    {
+    items=
+        {
+		MENU_ITEM { command=EAspMenuCmdChange; txt=qtn_options_change; flags = EEikMenuItemAction;},
+		
+#ifdef __SERIES60_HELP				
+    	MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; },
+#endif
+    	
+		MENU_ITEM { command=EAspMenuCmdExit; txt=qtn_options_exit; }        
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+// profile dialog resource.
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_profile_dialog
+    {
+    flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc;
+    
+    buttons = r_asp_cba_options_back_change;
+    
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtSettingListBox;
+			itemflags=EEikDlgItemTakesEnterKey;
+			id=EAspProfileDialogList;
+			control=LISTBOX
+				{
+				flags=0;
+				height=11;
+				width=80;
+				};            
+            }
+		};
+    }
+
+
+
+
+RESOURCE MENU_BAR r_asp_profile_dialog_menu
+	{
+	titles= 
+		{ 
+		MENU_TITLE 
+			{ 
+			menu_pane=r_asp_profile_dialog_menu_pane;
+			}
+		};
+	}
+
+RESOURCE MENU_BAR r_advance_settings_dialog_menu
+    {
+    titles= 
+        { 
+        MENU_TITLE 
+            { 
+            menu_pane=r_advance_settings_dialog_menu_pane;
+            }
+        };
+    }
+
+RESOURCE MENU_PANE r_asp_profile_dialog_menu_pane
+    {
+    items=
+        {
+		MENU_ITEM { command=EAspMenuCmdChange; txt=qtn_options_change; flags = EEikMenuItemAction;},
+		
+#ifdef __SERIES60_HELP		
+    	MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; },
+#endif
+    	
+		MENU_ITEM { command=EAspMenuCmdExit; txt=qtn_options_exit; }        
+        };
+    }
+
+RESOURCE MENU_PANE r_advance_settings_dialog_menu_pane
+    {
+    items=
+        {
+        MENU_ITEM { command=EAspMenuCmdChange; txt=qtn_options_change; flags = EEikMenuItemAction; },
+        
+#ifdef __SERIES60_HELP      
+        MENU_ITEM { command=EAspMenuCmdHelp; txt=qtn_options_help; },
+#endif
+        
+        MENU_ITEM { command=EAspMenuCmdExit; txt=qtn_options_exit; }        
+        };
+    }
+
+RESOURCE MENU_BAR r_asp_roaming_settings_context_menu
+    {
+    titles= 
+        { 
+        MENU_TITLE 
+            { 
+            menu_pane=r_advance_settings_dialog_menu_pane;
+            }
+        };
+    } 
+
+RESOURCE MENU_BAR r_asp_profile_context_menu
+	{
+	titles= 
+		{ 
+		MENU_TITLE 
+			{ 
+			menu_pane=r_asp_profile_context_menu_pane;
+			}
+		};
+	} 
+    
+RESOURCE MENU_PANE r_asp_profile_context_menu_pane
+    {
+    items=
+        {
+		MENU_ITEM { command=EAspMenuCmdOpen; txt=qtn_options_open; },
+		
+#ifdef __SERIES60_HELP		
+    	MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; },
+#endif
+    	
+		MENU_ITEM { command=EAspMenuCmdExit; txt=qtn_options_exit; }        
+        };
+    }
+
+// -----------------------------------------------------------------------------
+// auto sync dialog resource.
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_auto_sync_dialog
+    {
+    flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc;
+    buttons = r_asp_cba_options_back_change;
+
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtSettingListBox;
+			itemflags=EEikDlgItemTakesEnterKey;
+			id=EAspAutoSyncDialogList;
+			control=LISTBOX
+				{
+				flags=0;
+				height=11;
+				width=80;
+				};   
+            }
+		};
+    }
+
+
+RESOURCE MENU_BAR r_asp_auto_sync_dialog_menu
+	{
+	titles= 
+		{ 
+		MENU_TITLE 
+			{ 
+			menu_pane=r_asp_auto_sync_dialog_menu_pane;
+			}
+		};
+	}
+
+RESOURCE MENU_PANE r_asp_auto_sync_dialog_menu_pane
+    {
+    items=
+        {
+		MENU_ITEM { command=EAspMenuCmdChange; txt=qtn_options_change; flags = EEikMenuItemAction; },
+		
+#ifdef __SERIES60_HELP		
+    	MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; },
+#endif
+    	
+		MENU_ITEM { command=EAspMenuCmdExit; txt=qtn_options_exit; }        
+        };
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// auto sync profile dialog resource.
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_auto_sync_profile_dialog
+    {
+    flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc;
+    buttons = r_asp_cba_options_select_back;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtSingleGraphicListBox;
+            itemflags=EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+			id=EAspAutoSyncProfileDialogList;
+			control=LISTBOX
+				{
+				flags = EAknListBoxSelectionList;
+				};   
+            }
+		};
+    }
+
+
+
+RESOURCE MENU_BAR r_asp_auto_sync_profile_dialog_menu
+	{
+	titles= 
+		{ 
+		MENU_TITLE 
+			{ 
+			menu_pane=r_asp_auto_sync_profile_dialog_menu_pane;
+			}
+		};
+	}
+
+RESOURCE MENU_PANE r_asp_auto_sync_profile_dialog_menu_pane
+    {
+    items=
+        {
+		MENU_ITEM { command=EAspMenuCmdSelect; txt=qtn_sml_cmd_select; flags = EEikMenuItemAction;},
+		MENU_ITEM { command=EAspMenuCmdView; txt=qtn_sml_cmd_view_contents; },
+		
+#ifdef __SERIES60_HELP		
+    	MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; },
+#endif
+    	
+		MENU_ITEM { command=EAspMenuCmdExit; txt=qtn_options_exit; }        
+        };
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// content dialog resource (shows sync content settings).
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_content_dialog
+    {
+    flags=EEikDialogFlagWait | EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |EEikDialogFlagFillAppClientRect | 
+          EEikDialogFlagCbaButtons | EEikDialogFlagNotifyEsc;
+
+	buttons=r_asp_cba_options_back_change;
+	
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtSettingListBox;
+			itemflags=EEikDlgItemTakesEnterKey;
+			id=EAspContentDialog;
+			control=LISTBOX
+				{
+				flags=0;
+				height=11;
+				width=80;
+				};            
+            }
+		};
+    }
+
+
+RESOURCE MENU_BAR r_asp_content_dialog_menu
+	{
+	titles= 
+		{ 
+		MENU_TITLE 
+			{ 
+			menu_pane=r_asp_content_dialog_menu_pane;
+			}
+		};
+	}
+
+RESOURCE MENU_PANE r_asp_content_dialog_menu_pane
+    {
+    items=
+        {
+		MENU_ITEM { command=EAspMenuCmdChange; txt=qtn_options_change;flags = EEikMenuItemAction; },
+		
+#ifdef __SERIES60_HELP		
+    	MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; },
+#endif    	
+    	
+		MENU_ITEM { command=EAspMenuCmdExit; txt=qtn_options_exit; }        
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+// Settings view dialog resource.
+// -----------------------------------------------------------------------------
+//
+
+RESOURCE DIALOG r_asp_setting_view_dialog
+    {
+    flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc;
+    
+    buttons = r_asp_cba_options_back_open;
+    
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtSettingListBox;
+			itemflags=EEikDlgItemTakesEnterKey;
+			id=EAspSettingViewDialogList;
+			control=LISTBOX
+				{
+				flags=0;
+				height=11;
+				width=80;
+				};            
+            }
+		};
+    }
+
+RESOURCE MENU_BAR r_asp_setting_view_dialog_menu
+	{
+	titles= 
+		{ 
+		MENU_TITLE 
+			{ 
+			menu_pane=r_asp_setting_view_dialog_menu_pane;
+			}
+		};
+	}
+
+RESOURCE MENU_PANE r_asp_setting_view_dialog_menu_pane
+    {
+    items=
+        {
+		MENU_ITEM { command=EAspMenuCmdOpen; txt=qtn_options_open; flags = EEikMenuItemAction; },
+		
+#ifdef __SERIES60_HELP		
+    	MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; },
+#endif
+    	
+		MENU_ITEM { command=EAspMenuCmdExit; txt=qtn_options_exit; }        
+        };
+    }
+
+// -----------------------------------------------------------------------------
+// profile wizard dialog resource.
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_profile_wizard_dialog
+    {
+    flags =
+        EEikDialogFlagWait | EEikDialogFlagNotifyEsc |
+        EEikDialogFlagCbaButtons | EEikDialogFlagNoDrag |
+        EEikDialogFlagNoTitleBar | EEikDialogFlagNoShadow |
+        EEikDialogFlagNoBorder | EEikDialogFlagFillAppClientRect;
+        
+    buttons = r_asp_cba_start_cancel_start;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EEikCtRichTextEditor;
+            id = EAspProfileWizardDialogList;
+            control = RTXTED
+                {
+                numlines = 10;
+                avkon_flags = EAknEditorFlagEnableScrollBars;
+                flags = EEikEdwinReadOnly |
+                        EEikEdwinNoAutoSelection |
+                        EEikEdwinAvkonDisableCursor;
+                };
+            }
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+// setting dialog resource (main dialog).
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_setting_dialog
+    {
+	flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc;
+
+    //buttons=R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+    buttons=r_asp_cba_options_back_mark;
+    items=
+        {
+        DLG_LINE
+            {
+            //type=EAknCtDoubleLargeListBox;
+            //type=EAknCtDoubleListBox;
+            type=EAknCtDoubleGraphicListBox;
+			itemflags=EEikDlgItemTakesEnterKey;
+			id=EAspSettingDialogList;
+			control=LISTBOX
+				{
+				//flags = EAknListBoxPointerMultiselectionList | EAknListBoxLoopScrolling;
+				//flags = EAknListBoxMultiselectionList | EAknListBoxLoopScrolling;
+				flags = EAknListBoxMultiselectionList | EAknListBoxPointerMultiselectionList | EAknListBoxLoopScrolling;
+				};            
+            }
+		};
+    }
+
+
+// -----------------------------------------------------------------------------
+// setting dialog resource (main dialog).
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_asp_setting_dialog_2
+    {
+	flags= EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc;
+
+    //buttons=R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+    buttons=r_asp_cba_options_exit_mark;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtDoubleGraphicListBox;
+			itemflags=EEikDlgItemTakesEnterKey;
+			id=EAspSettingDialogList;
+			control=LISTBOX
+				{
+				//flags = EAknListBoxPointerMultiselectionList | EAknListBoxLoopScrolling;
+				//flags = EAknListBoxMultiselectionList | EAknListBoxLoopScrolling;
+				flags = EAknListBoxMultiselectionList | EAknListBoxPointerMultiselectionList | EAknListBoxLoopScrolling;
+				height=2;
+				width=80;
+				};            
+            }
+		};
+    }
+
+
+
+RESOURCE MENU_BAR r_asp_setting_dialog_menu
+	{
+	titles= 
+		{ 
+		MENU_TITLE 
+			{ 
+			menu_pane=r_asp_setting_dialog_menu_pane;
+			}
+		};
+	}
+
+
+RESOURCE MENU_BAR r_asp_setting_dialog_context_menu
+	{
+	titles= 
+		{ 
+		MENU_TITLE 
+			{ 
+			menu_pane=r_asp_setting_dialog_context_menu_pane;
+			}
+		};
+	}
+
+
+RESOURCE MENU_PANE r_asp_setting_dialog_menu_pane
+	{
+	items =
+		{
+		MENU_ITEM { command=EAspMenuCmdMark; 			txt=qtn_sml_cmd_mark; flags = EEikMenuItemAction;  },
+		MENU_ITEM { command=EAspMenuCmdUnmark; 			txt=qtn_sml_cmd_unmark; flags = EEikMenuItemAction; },
+		MENU_ITEM { command=EAspMenuCmdSync;           txt=qtn_sml_cmd_sync; },
+		MENU_ITEM { command=EAspMenuCmdNewSet;         txt=qtn_sml_cmd_create_new; },
+		MENU_ITEM { command=EAspMenuCmdEdit;           txt=qtn_sml_cmd_edit; },
+		//MENU_ITEM { command=EAspMenuCmdAdvanceSettings; txt=qtn_sml_cmd_advanced_settings; },
+		MENU_ITEM { command=EAspMenuCmdChangeProfile;  txt=qtn_sml_cmd_change_profile; },
+    	MENU_ITEM { command=EAspMenuCmdDelete;         txt=qtn_sml_cmd_delete; },
+    	MENU_ITEM { command=EAspMenuCmdAutoSync;       txt=qtn_sml_cmd_automatic_sync; },
+		MENU_ITEM { command=EAspMenuCmdViewLog;        txt=qtn_sml_cmd_view_log; },
+		MENU_ITEM { command=EAspMenuCmdCopyFromServer; txt=qtn_sml_cmd_slow_sync; },
+		
+#ifdef __SERIES60_HELP		
+		MENU_ITEM { command=EAknCmdHelp;	     txt=qtn_options_help; },
+#endif		
+    	
+    	MENU_ITEM { command=EAspMenuCmdExit;	     txt=qtn_options_exit; }
+		};
+	}
+
+RESOURCE DIALOG r_asp_advance_settings_dialog
+    {
+    flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc;
+    
+    buttons = r_asp_cba_options_back_change;
+    
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtSettingListBox;
+            itemflags=EEikDlgItemTakesEnterKey;
+            id=EAdvanceSettingsDialogList;
+            control=LISTBOX
+                {
+                flags=0;
+                height=11;
+                width=80;
+                };            
+            }
+        };
+    }
+
+RESOURCE MENU_PANE r_asp_setting_dialog_context_menu_pane
+	{
+	items =
+		{
+		MENU_ITEM { command=EAspMenuCmdSync;         txt=qtn_sml_cmd_sync; },
+		MENU_ITEM { command=EAspMenuCmdEdit;         txt=qtn_sml_cmd_edit; },
+		MENU_ITEM { command=EAspMenuCmdDelete;       txt=qtn_sml_cmd_delete; },
+		MENU_ITEM { command=EAspMenuCmdViewLog;      txt=qtn_sml_cmd_view_log; },
+		MENU_ITEM { command=EAspMenuCmdNewSet;       txt=qtn_sml_cmd_create_new; }
+		};
+	}
+
+RESOURCE TBUF r_asp_select_profile_create_new { buf = qtn_sml_apps_select_profile_create_new; }
+
+RESOURCE DIALOG r_asp_list_app_query
+    {
+    flags=EEikDialogFlagWait | EGeneralQueryFlags;
+
+    buttons=R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT;
+
+	items=
+        {
+		AVKON_LIST_QUERY_DLG_LINE
+            {
+            control = AVKON_LIST_QUERY_CONTROL
+    	        {
+			    listtype = EAknCtSingleGraphicPopupMenuListBox;
+				heading = qtn_profile_dialog_title;
+			    
+			    listbox = AVKON_LIST_QUERY_LIST
+			        {
+				    // items added dynamically
+				    };
+			    };
+		    }
+		};
+    }
+
+RESOURCE ARRAY r_asp_sync_pcsuite_type
+	{
+	items =
+		{
+		STRING { text = qtn_sml_sync_type_normal; }		
+		};
+	}
+
+// Display name for PC Suite profile
+RESOURCE TBUF r_asp_pc_suite_profile { buf = qtn_sml_pc_suite_profile; }
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspSyncUtilApi.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2002-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:  Contains functions that are exported from AspSyncUtil for
+*                performing data synchronization.
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "AspSyncUtilApi.h"
+#include "AspSyncUtil.h"
+#include "AspDebug.h"
+
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// CSyncUtilApi::NewL
+//
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CSyncUtilApi* CSyncUtilApi::NewL()
+    {
+    FLOG( _L("CSyncUtilApi::NewL START") );
+    
+    CSyncUtilApi* self = new (ELeave) CSyncUtilApi();
+    CleanupStack::PushL(self);
+	self->ConstructL();
+    CleanupStack::Pop(self);
+
+	FLOG( _L("CSyncUtilApi::NewL END") );
+	
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CSyncUtilApi::~CSyncUtilApi()
+    {
+    FLOG( _L("CSyncUtilApi::~CSyncUtilApi START") );
+    
+	delete iSyncUtil;
+	
+	FLOG( _L("CSyncUtilApi::~CSyncUtilApi END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSyncUtilApi::ConstructL
+//
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSyncUtilApi::ConstructL()
+    {
+	iSyncUtil = CAspSyncUtil::NewL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSyncUtilApi::CSyncUtilApi
+//
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSyncUtilApi::CSyncUtilApi()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSyncUtilApi::SynchronizeL
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CSyncUtilApi::SynchronizeL(TInt aApplicationId, TInt aJobId, TInt aInfo1, TDes& aInfo2)
+    {
+	iSyncUtil->SynchronizeL(aApplicationId, aJobId, aInfo1, aInfo2); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSyncUtilApi::ShowSettingsL
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CSyncUtilApi::ShowSettingsL(TInt aApplicationId, TInt aInfo1, TDes& aInfo2)
+    {
+    iSyncUtil->ShowSettingsL(aApplicationId, aInfo1, aInfo2);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspSyncUtil::SynchronizeL
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CSyncUtilApi::SynchronizeL(RFile& aScheduleTaskFile)
+	{
+	iSyncUtil->SynchronizeL(aScheduleTaskFile);
+	}
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/AspSyncUtil/src/AspUtil.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,2864 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+
+// INCLUDES
+
+#include <SyncMLTransportProperties.h>
+#include <flogger.h>
+#include <eikenv.h>
+#include <bautils.h>  // BaflUtils
+#include <AiwGenericParam.hrh>  // for application ids
+#include <collate.h>   // for TCollationMethod
+
+#include <featmgr.h>   // FeatureManager
+#include <ApUtils.h>   // CApUtils
+#include <avkon.rsg>
+#include <hlplch.h>    // HlpLauncher
+
+#include <MuiuMsvUiServiceUtilities.h> // for MsvUiServiceUtilities
+#include <NsmlOperatorDataCRKeys.h> // KCRUidOperatorDatasyncInternalKeys
+
+
+#include "AspUtil.h"
+#include "AspDialogUtil.h"
+#include "AspResHandler.h"
+#include "AspDebug.h"
+#include <AspSyncUtil.rsg>
+
+#include <SyncMLErr.h>  // sync error codes
+#include <cmapplicationsettingsui.h>
+
+//#ifdef __SAP_POLICY_MANAGEMENT
+#include <SettingEnforcementInfo.h> // VSettingEnforcementInfo
+//#endif
+
+
+
+
+
+/******************************************************************************
+ * class TAspParam
+ ******************************************************************************/
+
+
+// -------------------------------------------------------------------------------
+// TAspParam::TAspParam
+//
+// -------------------------------------------------------------------------------
+//
+TAspParam::TAspParam(TInt aApplicationId)
+ : iApplicationId(aApplicationId), iProfileId(KErrNotFound), iMode(KErrNotFound),
+   iId(KErrNotFound), iReturnValue(KErrNotFound), iDataProviderId(KErrNotFound),
+   iSyncTaskId(KErrNotFound), iProfile(NULL), 
+   iSyncTask(NULL), iSyncFilter(NULL), iSyncSession(NULL),
+   iProfileList(NULL), iContentList(NULL), iSchedule(NULL)
+	 {
+	 }
+
+
+// -------------------------------------------------------------------------------
+// TAspParam::TAspParam
+//
+// -------------------------------------------------------------------------------
+//
+TAspParam::TAspParam(TInt aApplicationId, RSyncMLSession* aSyncSession)
+ : iApplicationId(aApplicationId), iProfileId(KErrNotFound), iMode(KErrNotFound),
+   iId(KErrNotFound), iReturnValue(KErrNotFound), iDataProviderId(KErrNotFound),
+   iSyncTaskId(KErrNotFound), iProfile(NULL),
+   iSyncTask(NULL), iSyncFilter(NULL), iSyncSession(aSyncSession),
+   iProfileList(NULL), iContentList(NULL), iSchedule(NULL)
+  	 {
+	 }
+
+
+
+/******************************************************************************
+ * class TAspUtil
+ ******************************************************************************/
+
+
+// -------------------------------------------------------------------------------
+// TUtil::Panic
+//
+// -------------------------------------------------------------------------------
+//
+void TUtil::Panic(TInt aReason)
+    {
+	_LIT(KPanicCategory,"AspSyncUtil");
+
+	User::Panic(KPanicCategory, aReason); 
+    }
+
+
+// -------------------------------------------------------------------------------
+// TUtil::StrCopy
+//
+// String copy with lenght check.
+// -------------------------------------------------------------------------------
+//
+void TUtil::StrCopy(TDes8& aTarget, const TDesC& aSource)
+    {
+	TInt len = aTarget.MaxLength();
+    if(len < aSource.Length()) 
+	    {
+		aTarget.Copy(aSource.Left(len));
+		return;
+	    }
+	aTarget.Copy(aSource);
+    }
+
+// -------------------------------------------------------------------------------
+// TUtil::StrCopy
+//
+// String copy with lenght check.
+// -------------------------------------------------------------------------------
+//
+void TUtil::StrCopy(TDes& aTarget, const TDesC8& aSource)
+    {
+	TInt len = aTarget.MaxLength();
+    if(len < aSource.Length()) 
+	    {
+		aTarget.Copy(aSource.Left(len));
+		return;
+	    }
+	aTarget.Copy(aSource);
+    }
+
+
+// -------------------------------------------------------------------------------
+// TUtil::StrCopy
+//
+// String copy with lenght check.
+// -------------------------------------------------------------------------------
+//
+void TUtil::StrCopy(TDes& aTarget, const TDesC& aSource)
+    {
+	TInt len = aTarget.MaxLength();
+    if(len < aSource.Length()) 
+	    {
+		aTarget.Copy(aSource.Left(len));
+		return;
+	    }
+	aTarget.Copy(aSource);
+    }
+
+//--------------------------------------------------------------------------------
+//TUtil::StrConversion
+//
+//Convert TBuf to HBuf
+//--------------------------------------------------------------------------------
+//
+HBufC* TUtil::StrConversion(const TDesC& aDefaultText)
+{
+	return aDefaultText.AllocLC();
+    }
+
+
+// -------------------------------------------------------------------------------
+// TUtil::StrAppend
+//
+// -------------------------------------------------------------------------------
+//
+void TUtil::StrAppend(TDes& aTarget, const TDesC& aSource)
+{
+    if (aSource.Length() == 0)
+    	{
+    	return;
+    	}
+    	
+	TInt free = aTarget.MaxLength() - aTarget.Length();
+	if (aSource.Length() < free)
+		{
+		aTarget.Append(aSource);
+		}
+}
+
+
+// -------------------------------------------------------------------------------
+// TUtil::StrInsert
+//
+// -------------------------------------------------------------------------------
+//
+void TUtil::StrInsert(TDes& aTarget, const TDesC& aSource)
+{
+	TInt free = aTarget.MaxLength() - aTarget.Length();
+	if (aSource.Length() < free)
+		{
+		aTarget.Insert(0, aSource);
+		}
+}
+
+
+// -------------------------------------------------------------------------------
+// TUtil::StrToInt
+//
+// -------------------------------------------------------------------------------
+//
+TInt TUtil::StrToInt(const TDesC& aText, TInt& aNum)
+	{
+    TLex lex(aText);
+
+    TInt err=lex.Val(aNum); 
+	return err;
+	}
+
+
+// -------------------------------------------------------------------------------
+// TUtil::IsEmpty
+//
+// Function returns ETrue if string only contains white space or has no characters.
+// -------------------------------------------------------------------------------
+//
+TBool TUtil::IsEmpty(const TDesC& aText)
+	{
+	TInt len=aText.Length();
+	for (TInt i=0; i<len; i++)
+		{
+		TChar c=aText[i];
+		if (!c.IsSpace())
+			{
+			return EFalse;
+			}
+		}
+	return ETrue;
+	}
+
+
+// -------------------------------------------------------------------------------
+// TUtil::Fill
+//
+// -------------------------------------------------------------------------------
+//
+void TUtil::Fill(TDes& aTarget, const TDesC& aOneCharStr, TInt aLength)
+	{
+	TInt len = aTarget.MaxLength();
+    if(len > aLength)
+    	{
+    	TBuf<KBufSize16> buf(aOneCharStr);
+	    aTarget.Fill(buf[0], aLength);
+    	}
+	}
+
+
+// -----------------------------------------------------------------------------
+// TUtil::AddResFileL
+//
+// -----------------------------------------------------------------------------
+//
+TInt TUtil::AddResFileL(const TDesC& aFile)
+	{
+	CEikonEnv* env = CEikonEnv::Static();
+
+	TFileName fileName(aFile);
+
+	BaflUtils::NearestLanguageFile(env->FsSession(), fileName);
+
+    return env->AddResourceFileL(fileName);
+	}
+
+
+// -----------------------------------------------------------------------------
+// TUtil::IsValidAppId
+//
+// -----------------------------------------------------------------------------
+//
+TBool TUtil::IsValidAppId(TInt aApplicationId)
+	{
+	TInt id = aApplicationId;
+	
+	if (id == EApplicationIdSync || id == EApplicationIdContact || 
+	    id == EApplicationIdCalendar || id == EApplicationIdEmail ||
+	    id == EApplicationIdNote || id == EApplicationIdMms)
+		{
+		return ETrue;
+		}
+		
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TUtil::IsValidSID
+//
+// -----------------------------------------------------------------------------
+//
+TBool TUtil::IsValidSID(TInt aSid)
+	{
+	TInt id = aSid;
+	
+	if (id == KUidAppSync.iUid || id == KUidAppPhonebook.iUid || 
+	    id == KUidAppCalendar.iUid || id == KUidAppMessages.iUid ||
+	    id == KUidAppNotepad.iUid || id == KUidAppTest.iUid || 
+	    id == KUidAppMailEditor.iUid)
+		{
+		return ETrue;
+		}
+		
+	return EFalse;
+	}
+
+
+// -----------------------------------------------------------------------------
+// TUtil::ProviderIdFromAppId
+//
+// -----------------------------------------------------------------------------
+//
+TInt TUtil::ProviderIdFromAppId(TInt aApplicationId)
+	{
+	TInt id=KErrNotFound;
+
+	switch (aApplicationId)
+		{
+		case EApplicationIdContact:
+			id = KUidNSmlAdapterContact.iUid;
+			break;
+		case EApplicationIdCalendar:
+			id = KUidNSmlAdapterCalendar.iUid;
+			break;
+		case EApplicationIdEmail:
+     		id = KUidNSmlAdapterEMail.iUid;
+			break;
+		case EApplicationIdNote:
+			id = KUidNSmlAdapterNote.iUid;
+			break;
+		default:
+            id = KErrNotFound;
+			break;
+		}
+
+	return id;
+	}
+
+// -----------------------------------------------------------------------------
+// TUtil::ProviderIdFromAppId
+//
+// -----------------------------------------------------------------------------
+//
+TInt TUtil::ProviderIdFromAppId(TInt aApplicationId, TBool aOperatorProfile)
+    {
+    TInt id=KErrNotFound;
+
+    if (aOperatorProfile)
+        {
+        id = OperatorProviderIdFromAppId( aApplicationId );
+        }
+    else
+        {
+        id = ProviderIdFromAppId( aApplicationId );
+        }
+    return id;
+    }
+
+// -----------------------------------------------------------------------------
+// TUtil::OperatorProviderIdFromAppId
+//
+// -----------------------------------------------------------------------------
+//
+TInt TUtil::OperatorProviderIdFromAppId(TInt aApplicationId)
+    {
+    TInt id = KErrNotFound;
+    CRepository* repository = NULL;
+    
+    TInt err = KErrNotFound;
+    TRAP(err, repository = CRepository::NewL(KCRUidOperatorDatasyncInternalKeys));
+    if (err == KErrNone)
+        {
+        switch (aApplicationId)
+            {
+             // Operator specific version of Contacts adapter is supported
+            case EApplicationIdContact:
+                {
+                err = repository->Get(KNsmlOpDsOperatorAdapterUid, id);
+                break;
+                }
+            default:
+                {
+                id = ProviderIdFromAppId(aApplicationId);
+                break;
+                }
+            }
+         delete repository;
+        }
+
+    if ( (id == KErrNotFound) || (err != KErrNone) || (id == 0) )
+        {
+        // Use default adapter
+        id = ProviderIdFromAppId(aApplicationId);        
+        }
+    return id;
+    }
+        
+// -----------------------------------------------------------------------------
+// TUtil::AppIdFromProviderId
+//
+// -----------------------------------------------------------------------------
+//
+TInt TUtil::AppIdFromProviderId(TInt aAdapterId)
+	{
+	TInt id=KErrNotFound;
+
+	if (aAdapterId == KUidNSmlAdapterContact.iUid)
+		{
+		id = EApplicationIdContact;
+		}
+	if (aAdapterId == KUidNSmlAdapterCalendar.iUid)
+		{
+		id = EApplicationIdCalendar;
+		}
+	if (aAdapterId == KUidNSmlAdapterEMail.iUid)
+		{
+		id = EApplicationIdEmail;
+		}
+	if (aAdapterId == KUidNSmlAdapterNote.iUid)
+		{
+		id = EApplicationIdNote;
+		}
+	if (id == KErrNotFound) // Check if this operator specific adapter
+	    {
+	    id = AppIdFromOperatorSpecificProviderId( aAdapterId );
+	    }
+	return id;
+	}
+
+// -----------------------------------------------------------------------------
+// TUtil::AppIdFromOperatorSpecificProviderId
+//
+// -----------------------------------------------------------------------------
+//
+TInt TUtil::AppIdFromOperatorSpecificProviderId(TInt aAdapterId)
+    {
+    TInt id=KErrNotFound;
+    CRepository* repository = NULL;
+    
+    TRAPD(err, repository = CRepository::NewL(KCRUidOperatorDatasyncInternalKeys));
+    if (err == KErrNone)
+        {
+        TInt operatorContactsProvider = KErrNotFound;
+        err = repository->Get(KNsmlOpDsOperatorAdapterUid, operatorContactsProvider);
+        
+        if ( err == KErrNone && aAdapterId == operatorContactsProvider )
+            {
+            id = EApplicationIdContact;
+            }
+        delete repository;
+        }
+    return id;
+    }
+
+
+// -----------------------------------------------------------------------------
+// TUtil::IsToDay
+//
+// -----------------------------------------------------------------------------
+//
+TBool TUtil::IsToday(TTime aTime)
+	{
+	TTime now;
+	now.HomeTime();
+	
+	TInt day1 = now.DayNoInYear();
+	TInt day2 = aTime.DayNoInYear();
+	
+	TDateTime date1 = now.DateTime();
+	TDateTime date2 = aTime.DateTime();
+	
+	
+	TTimeIntervalDays daysBetween = now.DaysFrom(aTime);
+	
+	if (day1 != day2 || date1.Year() != date2.Year())
+		{
+		return EFalse;
+		}
+		
+	if (daysBetween.Int() > 0)
+		{
+		return EFalse;
+		}
+		
+	return ETrue; 
+	}
+
+
+// -----------------------------------------------------------------------------
+// TUtil::SyncTimeLC
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* TUtil::SyncTimeLC(TTime aLastSync)
+	{
+	TTime homeTime = ConvertUniversalToHomeTime(aLastSync);
+	
+	HBufC* hBuf = HBufC::NewLC(KBufSize255);
+	TPtr ptr = hBuf->Des();
+
+	if (IsToday(homeTime))
+		{
+		TBuf<KBufSize> timeFormat;
+		CAspResHandler::ReadL(timeFormat, R_QTN_TIME_USUAL_WITH_ZERO);
+		homeTime.FormatL(ptr, timeFormat);
+		}
+	else
+		{
+		TBuf<KBufSize> dateFormat;
+		CAspResHandler::ReadL(dateFormat, R_QTN_DATE_USUAL_WITH_ZERO);
+		homeTime.FormatL(ptr, dateFormat);
+		}
+   
+	return hBuf;
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// TUtil::ConvertUniversalToHomeTime
+//
+// -----------------------------------------------------------------------------
+//
+TTime TUtil::ConvertUniversalToHomeTime(const TTime& aUniversalTime)
+    {
+    TTime time(aUniversalTime);   // time stores UTC time.
+
+    TLocale locale;
+    TTimeIntervalSeconds universalTimeOffset(locale.UniversalTimeOffset());
+    
+    // Add locale's universal time offset to universal time.
+    time += universalTimeOffset;    // time stores Local Time.
+
+    // If home daylight saving in effect, add one hour offset.
+    if (locale.QueryHomeHasDaylightSavingOn())
+        {
+        TTimeIntervalHours daylightSaving(1);
+        time += daylightSaving;
+        }
+
+    return time;
+    }
+	
+
+// -----------------------------------------------------------------------------
+// TUtil::GetDateTextL
+//
+// -----------------------------------------------------------------------------
+//
+void TUtil::GetDateTextL(TDes& aText, TTime aDateTime)
+	{
+	TTime homeTime = ConvertUniversalToHomeTime(aDateTime);
+	
+	HBufC* hBuf = CAspResHandler::ReadLC(R_QTN_DATE_USUAL_WITH_ZERO);
+    homeTime.FormatL(aText, *hBuf);
+    CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// -----------------------------------------------------------------------------
+// TUtil::GetTimeTextL
+//
+// -----------------------------------------------------------------------------
+//
+void TUtil::GetTimeTextL(TDes& aText, TTime aDateTime)
+	{
+	TTime homeTime = ConvertUniversalToHomeTime(aDateTime);
+	
+	HBufC* hBuf = CAspResHandler::ReadLC(R_QTN_TIME_USUAL_WITH_ZERO);
+    homeTime.FormatL(aText, *hBuf);
+    CleanupStack::PopAndDestroy(hBuf);
+	}
+
+
+// -----------------------------------------------------------------------------
+// TUtil::GetDateTimeTextL
+//
+// -----------------------------------------------------------------------------
+//
+void TUtil::GetDateTimeTextL(TDes& aText, TTime aDateTime)
+	{
+	TDateTime dt = aDateTime.DateTime();
+	aText.Format(_L("%02d.%02d.%04d %02d:%02d:%02d"), dt.Day()+1, dt.Month()+1, dt.Year(),  dt.Hour(), dt.Minute(), dt.Second());
+	}
+
+
+// -----------------------------------------------------------------------------
+// TUtil::LaunchHelpAppL
+//
+// -----------------------------------------------------------------------------
+//
+void TUtil::LaunchHelpAppL()
+	{
+	if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
+		{
+		return;
+		}
+		
+	CEikonEnv* eikEnv = CEikonEnv::Static();
+	HlpLauncher::LaunchHelpApplicationL(eikEnv->WsSession(), eikEnv->EikAppUi()->AppHelpContextL());
+	}
+
+
+// -----------------------------------------------------------------------------
+// TUtil::LaunchHelpAppL
+//
+// -----------------------------------------------------------------------------
+//
+void TUtil::LaunchHelpAppL(CEikonEnv* aEikonkEnv)
+	{
+	if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
+		{
+		return;
+		}
+		
+	CEikonEnv* eikEnv = CEikonEnv::Static();
+	HlpLauncher::LaunchHelpApplicationL(aEikonkEnv->WsSession(), 
+	                                    aEikonkEnv->EikAppUi()->AppHelpContextL());
+	}
+
+
+// ---------------------------------------------------------
+// TUtil::SettingEnforcementStateL
+// 
+// Checks if setting enforcement is activated.
+// ---------------------------------------------------------
+TBool TUtil::SettingEnforcementStateL()
+    {
+    
+ FeatureManager::InitializeLibL();
+ if(!FeatureManager::FeatureSupported(KFeatureIdSapPolicyManagement))
+ {
+		//#ifndef __SAP_POLICY_MANAGEMENT
+		FeatureManager::UnInitializeLib();
+		    return EFalse;
+		//#else
+}
+else
+{
+	FeatureManager::UnInitializeLib();
+	CSettingEnforcementInfo* info = CSettingEnforcementInfo::NewL();
+	CleanupStack::PushL(info);
+
+	TBool active = EFalse;
+	User::LeaveIfError(info->EnforcementActive(EDataSyncEnforcement, active));
+	CleanupStack::PopAndDestroy(info);
+
+	return active;
+ //#endif
+}
+
+
+    }
+
+
+// ---------------------------------------------------------
+// TUtil::SettingEnforcementState
+// 
+// Checks if setting enforcement is activated.
+// ---------------------------------------------------------
+TBool TUtil::SettingEnforcementState()
+    {
+    TBool ret = EFalse;
+    
+    TRAP_IGNORE(ret = SettingEnforcementStateL());
+    
+    return ret;
+    }
+
+
+// ---------------------------------------------------------
+// TUtil::NumberConversionLC
+// 
+// ---------------------------------------------------------
+CDesCArray* TUtil::NumberConversionLC(CDesCArray* aList)
+    {
+    CDesCArrayFlat* arr = new (ELeave) CDesCArrayFlat(KDefaultArraySize);
+    CleanupStack::PushL(arr);
+    
+    TInt count = aList->Count();
+    
+    for (TInt i=0; i<count; i++)
+    	{
+    	TBuf<KBufSize> buf((*aList)[i]);
+     	AknTextUtils::DisplayTextLanguageSpecificNumberConversion(buf);
+     	arr->AppendL(buf);
+    	}
+    	
+    return arr;
+    }
+
+
+
+#ifdef _DEBUG
+
+// -------------------------------------------------------------------------------
+// TUtil::Print
+//
+// -------------------------------------------------------------------------------
+//
+void TUtil::Print(const TDesC& aText)
+    {
+	CEikonEnv::Static()->InfoMsg(aText);
+	}
+
+
+// -------------------------------------------------------------------------------
+// TUtil::Print
+//
+// -------------------------------------------------------------------------------
+//
+void TUtil::Print(const TDesC& aText, TInt aNum)
+    {
+	_LIT(KFormat, "%S (%d)");
+
+	TBuf<KBufSize> buf;
+	buf.Format(KFormat, &aText, aNum);
+	CEikonEnv::Static()->InfoMsg(buf);
+	}
+
+
+// -------------------------------------------------------------------------------
+// TUtil::GetMandatoryFieldText
+//
+// -------------------------------------------------------------------------------
+//
+void TUtil::GetMandatoryFieldText(TDes& aText, TInt aStatus)
+    {
+	switch (aStatus)
+		{
+		case EMandatoryNoProfileName:
+            aText = _L("no profile name");
+			break;
+		case EMandatoryNoHostAddress:
+			aText = _L("no host address");
+			break;
+		case EMandatoryNoContent:
+			aText = _L("no content");
+			break;
+		case EMandatoryNoLocalDatabase:
+			aText = _L("no local database");
+			break;
+		case EMandatoryNoRemoteDatabase:
+			aText = _L("no remote database");
+			break;
+		default:
+			aText = _L("profile ok");
+			break;
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// TUtil::TimeBefore
+//
+// Function returns TTime of the current time (needed with function TimeAfter).
+// -----------------------------------------------------------------------------
+//
+TTime TUtil::TimeBefore()
+{
+    TTime now;
+	now.UniversalTime();
+	return now;
+}
+
+
+// -----------------------------------------------------------------------------
+// TUtil::TimeAfter
+//
+// Function returns milliseconds passed since aBefore.
+// -----------------------------------------------------------------------------
+//
+TInt TUtil::TimeAfter(TTime aBefore)
+{
+	TTime after;
+	after.UniversalTime();
+	TTimeIntervalMicroSeconds microSeconds = after.MicroSecondsFrom(aBefore); 
+	TInt seconds = microSeconds.Int64()/1000;
+	return seconds;
+}
+
+
+// -----------------------------------------------------------------------------
+// TUtil::TimeAfter
+//
+// -----------------------------------------------------------------------------
+//
+void TUtil::TimeAfter(TTime aBefore, const TDesC& aText)
+    {
+	TTime after;
+	after.UniversalTime();
+	TTimeIntervalMicroSeconds microSeconds = after.MicroSecondsFrom(aBefore); 
+	
+	FTRACE( RDebug::Print(_L("%S %d ms"), &aText, microSeconds.Int64()/1000) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// TUtil::GetApplicationNameL
+//
+// -----------------------------------------------------------------------------
+//
+void TUtil::GetApplicationName(TDes& aText, TInt aApplicationId)
+    {
+	switch (aApplicationId)
+		{
+		case EApplicationIdSync:
+			aText = _L("EApplicationIdSync");
+			break;
+		case EApplicationIdContact:
+			aText = _L("EApplicationIdContact");
+			break;
+		case EApplicationIdCalendar:
+			aText = _L("EApplicationIdCalendar");
+			break;
+		case EApplicationIdEmail:
+			aText = _L("EApplicationIdEmail");
+			break;
+		case EApplicationIdMms:
+			aText = _L("EApplicationIdMms");
+			break;
+		case EApplicationIdNote:
+			aText = _L("EApplicationIdNote");
+			break;
+		default:
+			aText = _L("unknown app");
+			break;
+		}
+    }
+
+#endif
+
+
+
+/******************************************************************************
+ * class TURIParser
+ ******************************************************************************/
+
+
+// ---------------------------------------------------------
+// TURIParser::TURIParser
+// 
+// ---------------------------------------------------------
+TURIParser::TURIParser(const TDesC& aStr) : iOriginalStr(aStr)
+    {
+    SkipHttp();
+    }
+
+
+// ---------------------------------------------------------
+// TURIParser::GetUriWithoutPort
+// 
+// URI format: "http://serveraddress/documentname/"
+// ---------------------------------------------------------
+void TURIParser::GetUriWithoutPort(TDes& aText)
+	{
+	_LIT(KSlash, "/");
+	
+	aText = KNullDesC;
+	
+	TPtrC http = ParseHttp();
+	TPtrC address = ParseAddress();
+	TPtrC document = ParseDocument();
+	
+	TUtil::StrAppend(aText, http);
+	TUtil::StrAppend(aText, address);
+	
+	if (document.Length() > 0)
+		{
+		TUtil::StrAppend(aText, KSlash);
+		TUtil::StrAppend(aText, document);
+		}
+	//else if (aText.Length() > 0)
+	//	{
+	//	TUtil::StrAppend(aText, KSlash);
+	//	}
+	}
+	
+
+// ---------------------------------------------------------
+// TURIParser::GetUriWithPort
+// 
+// URI format: "http://serveraddress:port/documentname/"
+// ---------------------------------------------------------
+void TURIParser::GetUriWithPort(TDes& aText, const TInt aPort)
+	{
+	_LIT(KColon, ":");
+	_LIT(KSlash, "/");
+	
+	aText = KNullDesC;
+	
+	TPtrC http = ParseHttp();
+	
+	TPtrC address = ParseAddress();
+	
+	TPtrC document = ParseDocument();
+	
+	TUtil::StrAppend(aText, http);
+	TUtil::StrAppend(aText, address);
+	
+	TBuf<KBufSize32> buf;
+	buf.Num(aPort);
+	TUtil::StrAppend(aText, KColon);
+	TUtil::StrAppend(aText, buf);
+	
+	if (document.Length() > 0)
+		{
+		TUtil::StrAppend(aText, KSlash);
+		TUtil::StrAppend(aText, document);
+		}
+	//else if (aText.Length() > 0)
+	//	{
+	//	TUtil::StrAppend(aText, KSlash);
+	//	}
+	}
+
+
+// ---------------------------------------------------------
+// TURIParser::Port
+// 
+// ---------------------------------------------------------
+TInt TURIParser::Port()
+	{
+	TInt port = KErrNotFound;
+	
+	TInt err = ParsePort(port);
+	if (err != KErrNone)
+		{
+		return KErrNotFound;
+		}
+		
+	return port;
+	}
+
+
+// ---------------------------------------------------------
+// TURIParser::DefaultPort
+// 
+// ---------------------------------------------------------
+TInt TURIParser::DefaultPort()
+	{
+	_LIT(KHttpsHeader, "https://");
+	
+	TInt pos = iOriginalStr.FindF(KHttpsHeader);
+	if (pos != KErrNotFound)
+		{
+		return EDefaultHttpsPort;
+		}
+
+	return EDefaultHttpPort;
+	}
+
+
+// ---------------------------------------------------------
+// TURIParser::IsValidUri
+// 
+// ---------------------------------------------------------
+TBool TURIParser::IsValidUri(const TDesC& aText)
+	{
+	_LIT(KHttpHeader, "http://");
+	_LIT(KHttpsHeader, "https://");
+
+	const TInt KHttpLength = 7;
+	const TInt KHttpsLength = 8;
+	
+	// IsValidDomainL this does not accept comma ("http://" fails)
+	//return MsvUiServiceUtilities::IsValidDomainL(aText);
+	
+	if (TUtil::IsEmpty(aText))
+		{
+		return EFalse;
+		}
+		
+    if (aText.Compare(KHttpHeader) == 0)
+    	{
+    	return EFalse;
+    	}
+	
+    if (aText.Compare(KHttpsHeader) == 0)
+    	{
+    	return EFalse;
+    	}
+    
+    if (aText.Left(KHttpLength).Compare(KHttpHeader) != 0
+    				&& aText.Left(KHttpsLength).Compare(KHttpsHeader) != 0)
+    	{
+    	return EFalse;
+    	}
+	
+	return ETrue;
+	}
+
+// ---------------------------------------------------------
+// TURIParser::IsValidBluetoothHostAddress
+// 
+// ---------------------------------------------------------
+TBool TURIParser::IsValidBluetoothHostAddress(const TDesC& aText)
+	{
+	_LIT(KHttpHeader, "http://");
+	_LIT(KHttpsHeader, "https://");
+
+	const TInt KHttpLength = 7;
+	const TInt KHttpsLength = 8;
+	
+	// IsValidDomainL this does not accept comma ("http://" fails)
+	//return MsvUiServiceUtilities::IsValidDomainL(aText);
+	
+	if (TUtil::IsEmpty(aText))
+		{
+		return EFalse;
+		}
+		
+    if (aText.Compare(KHttpHeader) == 0)
+    	{
+    	return EFalse;
+    	}
+	
+    if (aText.Compare(KHttpsHeader) == 0)
+    	{
+    	return EFalse;
+    	}
+    
+    if (aText.Left(KHttpLength).Compare(KHttpHeader) == 0
+    				|| aText.Left(KHttpsLength).Compare(KHttpsHeader) == 0)
+    	{
+    	return EFalse;
+    	}
+	
+	return ETrue;
+	}
+// ---------------------------------------------------------
+// TURIParser::IsValidPort
+// 
+// ---------------------------------------------------------
+TBool TURIParser::IsValidPort(const TInt aPort)
+	{
+	if (aPort < TURIParser::EMinURIPortNumber || 
+	    aPort > TURIParser::EMaxURIPortNumber)
+		{
+		return EFalse;
+		}
+		
+	return ETrue;
+	}
+
+
+// ---------------------------------------------------------
+// TURIParser::SkipHttp
+// 
+// Set pointer to the end of "http://".
+// ---------------------------------------------------------
+void TURIParser::SkipHttp()
+	{
+    TInt start = KErrNotFound;
+    TInt end   = KErrNotFound;
+    TStr str(iOriginalStr);
+    
+    GetHttpPos(start, end);
+    
+    if (start != KErrNotFound)
+    	{
+    	iPtr.Set(str.Right(end+1));
+    	}
+    else
+    	{
+    	iPtr.Set(str.Right(0));
+    	}
+	}
+
+
+// ---------------------------------------------------------
+// TURIParser::ParseHttp
+// 
+// ---------------------------------------------------------
+TPtrC TURIParser::ParseHttp()
+	{
+    TInt start = KErrNotFound;
+    TInt end   = KErrNotFound;
+    
+    GetHttpPos(start, end);
+    
+    if (start == KErrNotFound)
+    	{
+    	return TPtrC();
+    	}
+    
+   	TStr str(iOriginalStr);
+    return str.SubStr(start, end);
+	}
+
+
+// ---------------------------------------------------------
+// TURIParser::GetHttpPos
+// 
+// ---------------------------------------------------------
+void TURIParser::GetHttpPos(TInt& aStartPos, TInt& aEndPos)
+	{
+	_LIT(KHttpHeader, "http://");
+    _LIT(KHttpsHeader, "https://");
+
+	aEndPos = KErrNotFound;
+	
+	aStartPos = iOriginalStr.FindF(KHttpHeader);
+	if (aStartPos != KErrNotFound)
+		{
+		aEndPos = aStartPos + KHttpHeader().Length() - 1;
+		return;
+		}
+	
+	aStartPos = iOriginalStr.FindF(KHttpsHeader);
+	if (aStartPos != KErrNotFound)
+		{
+		aEndPos = aStartPos + KHttpsHeader().Length() - 1;
+		return;
+		}
+	}
+
+
+// ---------------------------------------------------------
+// TURIParser::ParseAddress
+// 
+// ---------------------------------------------------------
+TPtrC TURIParser::ParseAddress()
+	{
+	const TChar KSlash('/');
+	const TChar KColon(':');
+	
+	TStr str(iPtr);
+	
+    TInt firstSlash = str.Find(0, KSlash);
+	TInt firstcolon = str.Find(0, KColon);
+	
+	TBool portFound = EFalse;
+	if (firstcolon != KErrNotFound)
+		{
+		if (firstSlash == KErrNotFound)
+			{
+			portFound = ETrue;
+			}
+		else if (firstcolon < firstSlash)
+			{
+			portFound = ETrue;
+			}
+		}
+    
+	if (portFound)
+		{
+		// address is text before first colon
+		return str.Left(firstcolon-1);
+		}
+	else if (firstSlash != KErrNotFound)
+		{
+		// address is text before first slash
+		return str.Left(firstSlash-1);
+		}
+	else
+		{
+		// address is all text
+		return str.Right(0);
+		}
+	}
+
+
+// ---------------------------------------------------------
+// TURIParser::ParseDocument
+// 
+// ---------------------------------------------------------
+TPtrC TURIParser::ParseDocument()
+	{
+	const TChar KSlash('/');
+	
+	TStr str(iPtr);
+    TInt firstSlash = str.Find(0, KSlash);
+    
+	if (firstSlash != KErrNotFound)
+		{
+		// document is all text after first slash
+		return str.Right(firstSlash+1);
+		}
+		
+	return TPtrC();
+	
+	}
+
+
+// ---------------------------------------------------------
+// TURIParser::ParsePort
+// 
+// ---------------------------------------------------------
+TInt TURIParser::ParsePort(TInt& aNumber)
+	{
+	TPtrC port = ParsePort();
+	if (port.Length() == 0)
+		{
+		return KErrNotFound;
+		}
+		
+	return TUtil::StrToInt(port, aNumber);
+	}
+
+
+// ---------------------------------------------------------
+// TURIParser::ParsePort
+// 
+// ---------------------------------------------------------
+TPtrC TURIParser::ParsePort()
+	{
+	const TChar KSlash('/');
+	const TChar KColon(':');
+	
+	TStr str(iPtr);
+    TInt firstSlash = str.Find(0, KSlash);
+	TInt firstColon = str.Find(0, KColon);
+    
+	if (firstSlash != KErrNotFound)
+		{
+		if (firstColon != KErrNotFound && firstColon < firstSlash)
+			{
+		    // port number is text between colon and slash 
+		    return str.SubStrEx(firstColon, firstSlash);
+			}
+		}
+	else 
+		{
+		if (firstColon != KErrNotFound)
+			{
+		    // port number is all text after colon 
+		    return str.Right(firstColon+1);
+			}
+		}
+		
+	return TPtrC();
+	}
+
+
+
+
+/******************************************************************************
+ * class TStr
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// TStr::TStr
+//
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+TStr::TStr(const TDesC& aStr) : iStr(aStr)
+    {
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::Mid
+//
+// -------------------------------------------------------------------------------
+//
+TPtrC TStr::Mid(TInt aPos)
+    {
+	TInt len = iStr.Length();
+	if ( (aPos < 0) || (aPos >= len) )
+	    {
+		return TPtrC();  // return empty descriptor
+	    }
+
+	return iStr.Mid(aPos);
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::Mid
+//
+// -------------------------------------------------------------------------------
+//
+TPtrC TStr::Mid(TInt aPos, TInt aLen)
+    {
+	TInt len = iStr.Length();
+	if ( (aPos < 0) || (aPos >= len) )
+	    {
+		return TPtrC();
+	    }
+	if ( (aLen <= 0) || (aPos + aLen > len) )
+	    {
+		return TPtrC();
+	    }
+
+	return iStr.Mid(aPos, aLen);
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::Right
+//
+// -------------------------------------------------------------------------------
+//
+TPtrC TStr::Right(TInt aPos)
+    {
+	return Mid(aPos);
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::Left
+//
+// -------------------------------------------------------------------------------
+//
+TPtrC TStr::Left(TInt aPos)
+    {
+	TInt len = iStr.Length();
+
+	if ( (aPos < 0) || (len == 0) )
+	    {
+		return TPtrC();
+	    }
+
+	TInt pos = len;
+	if ( (aPos + 1) < len )
+	    {
+		pos = aPos + 1;
+	    }
+
+	return iStr.Left(pos);
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::SubStr
+//
+// -------------------------------------------------------------------------------
+//
+TPtrC TStr::SubStr(TInt aStartPos, TInt aEndPos)
+    {
+	return Mid(aStartPos, aEndPos - aStartPos + 1);
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::SubStrEx
+//
+// -------------------------------------------------------------------------------
+//
+TPtrC TStr::SubStrEx(TInt aStartPos, TInt aEndPos)
+    {
+	return Mid(aStartPos + 1, aEndPos - aStartPos - 1);
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::LastPos
+//
+// -------------------------------------------------------------------------------
+//
+TInt TStr::LastPos()
+    {
+	return iStr.Length() - 1;
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::Len
+//
+// -------------------------------------------------------------------------------
+//
+TInt TStr::Len()
+    {
+    return iStr.Length();
+    }
+
+// -------------------------------------------------------------------------------
+// TStr::Compare
+//
+// -------------------------------------------------------------------------------
+//
+TBool TStr::Compare(TInt aPos, TChar aChar)
+    {
+	TInt len = iStr.Length();
+	if ( (aPos < 0) || (aPos >= len) )
+	    {
+		return EFalse;
+	    }
+	TChar ch = iStr[aPos];
+	if (ch == aChar)
+	    {
+		return ETrue;
+	    }
+	return EFalse;
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::Find
+//
+// -------------------------------------------------------------------------------
+//
+TInt TStr::Find(TInt aPos, TChar aChar)
+    {
+	TInt len = iStr.Length();
+	if ( (aPos < 0) || (aPos >= len) )
+	    {
+		return KErrNotFound;
+	    }
+	    
+	TPtrC ptr(iStr.Mid(aPos)); // move to possition aPos
+	return ptr.Locate(aChar);
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::Trim
+//
+// -------------------------------------------------------------------------------
+//
+TPtrC TStr::Trim()
+    {
+	TInt first = FirstNonSpace();
+	TInt last = LastNonSpace();
+
+	return Mid(first, last - first + 1);
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::FirstNonSpace
+//
+// -------------------------------------------------------------------------------
+//
+TInt TStr::FirstNonSpace()
+    {
+	TInt len = Len();
+	for (TInt i = 0; i < len; i++)
+	    {
+		TChar c = iStr[i];
+        if (!c.IsSpace())
+		    {
+		    return i;
+		    }
+	    }
+	return KErrNotFound;
+    }
+
+
+// -------------------------------------------------------------------------------
+// TStr::LastNonSpace
+//
+// -------------------------------------------------------------------------------
+//
+TInt TStr::LastNonSpace()
+    {
+	TInt last = LastPos();
+	for (TInt i = last; i >= 0; i--)
+	    {
+		TChar c = iStr[i];
+        if (!c.IsSpace())
+		    {
+		    return i;
+		    }
+	    }
+	return KErrNotFound;
+    }
+
+
+
+/******************************************************************************
+ * class TFlag
+ ******************************************************************************/
+
+// -----------------------------------------------------------------------------
+// TFlag::TFlag
+//
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+TFlag::TFlag(TUint32& aFlag) : iFlag(aFlag)
+    {
+    }
+
+// -------------------------------------------------------------------------------
+// TFlag::SetOn
+//
+// -------------------------------------------------------------------------------
+//
+void TFlag::SetOn(const TUint32 aValue)
+    {
+    iFlag |= aValue;
+    }
+
+// -------------------------------------------------------------------------------
+// TFlag::SetOff
+//
+// -------------------------------------------------------------------------------
+//
+void TFlag::SetOff(const TUint32 aValue)
+    {
+    iFlag &= ~aValue;
+    }
+
+// -------------------------------------------------------------------------------
+// TFlag::IsOn
+//
+// -------------------------------------------------------------------------------
+//
+TBool TFlag::IsOn(const TUint32 aValue) const
+    {
+    return iFlag & aValue;
+    }
+
+
+
+/*******************************************************************************
+ * class CAspIdleWait
+ *******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspIdleWait::WaitL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspIdleWait::WaitL()
+	{
+    CAspIdleWait* waiter = CAspIdleWait::NewL();
+    CleanupStack::PushL(waiter);
+    
+    CIdle* idle = CIdle::NewL(CActive::EPriorityIdle);
+	CleanupStack::PushL(idle);
+	
+	idle->Start(TCallBack(IdleCallback, waiter));
+	if (!waiter->iWait.IsStarted())
+		{
+		waiter->iWait.Start();
+		}
+
+    CleanupStack::PopAndDestroy(idle);
+    CleanupStack::PopAndDestroy(waiter);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspIdleWait::NewLC
+//
+// -----------------------------------------------------------------------------
+//
+CAspIdleWait* CAspIdleWait::NewL()
+    {
+    CAspIdleWait* self = new (ELeave) CAspIdleWait();
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspIdleWait::CAspIdleWait
+// 
+// -----------------------------------------------------------------------------
+//
+CAspIdleWait::CAspIdleWait() 
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspIdleWait::~CAspIdleWait()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspIdleWait::IdleCallback
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CAspIdleWait::IdleCallback(TAny* aThisPtr)
+    {
+    static_cast<CAspIdleWait*>(aThisPtr)->iWait.AsyncStop();
+    return KErrNone;
+    }
+
+
+
+/******************************************************************************
+ * class CAspActiveCaller
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspActiveCaller::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CAspActiveCaller* CAspActiveCaller::NewL(MAspActiveCallerObserver* aObserver)
+    {
+    FLOG( _L("CAspActiveCaller::NewL START") );
+    
+    CAspActiveCaller* self = new (ELeave) CAspActiveCaller(aObserver);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+    FLOG( _L("CAspActiveCaller::NewL END") );
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------------------------
+//
+CAspActiveCaller::~CAspActiveCaller()
+    {
+    FLOG( _L("CAspActiveCaller::~CAspActiveCaller START") );
+    
+	Cancel();
+	iTimer.Close();
+	
+    FLOG( _L("CAspActiveCaller::~CAspActiveCaller END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspActiveCaller::CAspActiveCaller
+// 
+// -----------------------------------------------------------------------------
+//
+CAspActiveCaller::CAspActiveCaller(MAspActiveCallerObserver* aObserver) : CActive(CActive::EPriorityStandard)
+    {
+	iObserver = aObserver;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspActiveCaller::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAspActiveCaller::ConstructL()
+    {
+	User::LeaveIfError(iTimer.CreateLocal());
+	CActiveScheduler::Add(this);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspActiveCaller::DoCancel
+//
+// -----------------------------------------------------------------------------
+//
+void CAspActiveCaller::DoCancel()
+    {
+    FLOG( _L("CAspActiveCaller::DoCancel START") );
+    
+	iTimer.Cancel();
+	
+    FLOG( _L( "CAspActiveCaller::DoCancel END" ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspActiveCaller::RunL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspActiveCaller::RunL()
+    {
+    FLOG( _L("CAspActiveCaller::RunL START") );
+
+	TRAP_IGNORE(iObserver->HandleActiveCallL(iCallId));
+
+    FLOG( _L("CAspActiveCaller::RunL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspActiveCaller::Request
+//
+// This function calls this class RunL.
+// -----------------------------------------------------------------------------
+//
+void CAspActiveCaller::Request()
+    {
+    FLOG( _L("CAspActiveCaller::Request START") );
+    
+	Cancel();
+	SetActive();
+	TRequestStatus* status = &iStatus;
+	User::RequestComplete(status, KErrNone);
+    
+    FLOG( _L("CAspActiveCaller::Request END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspActiveCaller::Start
+//
+// -----------------------------------------------------------------------------
+//
+void CAspActiveCaller::Start(TInt aCallId, TInt aMilliseconds)
+    {
+    FLOG( _L("CAspActiveCaller::Start START") );
+    
+	if (IsActive())
+		{
+		return;
+		}
+	
+	iCallId = aCallId;
+
+	if (aMilliseconds <= 0)
+		{
+		Request();  // no delay - complete right away
+		}
+	else
+		{
+	    iTimer.After(iStatus, aMilliseconds*1000);
+	    SetActive();
+		}
+    
+    FLOG( _L("CAspActiveCaller::Start END") );
+    }
+
+
+
+
+/******************************************************************************
+ * class CAspBearerHandler
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::NewLC
+//
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CAspBearerHandler* CAspBearerHandler::NewL(const TAspParam& aParam)
+    {
+    CAspBearerHandler* self = new (ELeave) CAspBearerHandler(aParam);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspBearerHandler::~CAspBearerHandler()
+	{
+	iList.Close();
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::CAspBearerHandler
+// -----------------------------------------------------------------------------
+//
+CAspBearerHandler::CAspBearerHandler(const TAspParam& aParam)
+	{
+	__ASSERT_ALWAYS(aParam.iSyncSession, TUtil::Panic(KErrGeneral));
+
+	iSyncSession = aParam.iSyncSession;	
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::ConstructL
+//
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CAspBearerHandler::ConstructL(void)
+    {
+	CreateSupportedBearerListL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::IsSupported
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAspBearerHandler::IsSupported(TInt aBearer)
+	{
+	TInt count = iList.Count();
+
+    for (TInt i=0; i<count; i++)
+		{
+		TAspBearerItem& item = iList[i];
+		if (item.iBearerType == aBearer)
+			{
+			return ETrue;
+			}
+		}
+	
+	return EFalse; // unknown bearer
+}
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::BearerForListIndex
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspBearerHandler::BearerForListIndex(TInt aIndex)
+	{
+	TInt count = iList.Count();
+	if (aIndex < 0 || aIndex >= count)
+	    {
+		TUtil::Panic(KErrArgument);
+	    }
+
+	TAspBearerItem& item = iList[aIndex];
+	return item.iBearerType;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::ListIndexForBearer
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspBearerHandler::ListIndexForBearer(TInt aBearer)
+	{
+	TInt count = iList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		TAspBearerItem& item = iList[i];
+		if (item.iBearerType == aBearer)
+			{
+			return i;
+			}
+		}
+
+	return KErrNotFound;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::CreateSupportedBearerListL
+//
+// -----------------------------------------------------------------------------
+//
+void CAspBearerHandler::CreateSupportedBearerListL()
+	{
+	RSyncMLTransport transport;
+	
+	RArray<TSmlTransportId> arr(8);
+	CleanupClosePushL(arr);
+	
+	//
+	// ListTransportsL returns transports that can be used in current phone.
+	// RSyncMLSession uses FeatureManager to construct this list.
+	//
+	iSyncSession->ListTransportsL(arr);
+	TInt count = arr.Count();
+	
+	for (TInt i=0; i<count; i++)
+		{
+		TInt id = arr[i];
+		transport.OpenL(*iSyncSession, id);
+		CleanupClosePushL(transport);
+		
+		TAspBearerItem item;
+		TInt smlBearerId = transport.Identifier();
+		item.iBearerType = AspBearerId(smlBearerId);  // convert bearer type
+		TUtil::StrCopy(item.iBearerName, transport.DisplayName());
+		
+
+#ifndef __SYNCML_DS_OVER_HTTP   // KFeatureIdDsOverHttp
+        
+   		if (item.iBearerType == EAspBearerInternet)
+			{
+			CleanupStack::PopAndDestroy(&transport);
+			continue;
+			}
+#endif
+
+   		if (item.iBearerType != EAspBearerInternet && 
+   		    item.iBearerType != EAspBearerBlueTooth)
+			{
+			CleanupStack::PopAndDestroy(&transport);
+			continue; // only internet and bluetooth are supported
+			}
+
+		if (item.iBearerType != KErrNotFound)
+			{
+			User::LeaveIfError(iList.Append(item));
+			}
+		
+		CleanupStack::PopAndDestroy(&transport);
+		}
+		
+	CleanupStack::PopAndDestroy(&arr);
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::AspBearerId
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspBearerHandler::AspBearerId(const TInt aId)
+	{
+	if (aId == KUidNSmlMediumTypeInternet.iUid)
+		{
+		return EAspBearerInternet;
+		}
+	else if (aId == KUidNSmlMediumTypeBluetooth.iUid)
+		{
+		return EAspBearerBlueTooth;
+		}
+	else if (aId == KUidNSmlMediumTypeUSB.iUid)
+		{
+		return EAspBearerUsb;
+		}
+	else if (aId == KUidNSmlMediumTypeIrDA.iUid)
+		{
+		return EAspBearerIrda;
+		}
+	//else if (aId == KUidNSmlMediumTypeWSP.iUid)
+	//	{
+	//	return EAspBearerWsp;
+	//	}
+	//else if (aId == KUidNSmlMediumTypeNSmlUSB.iUid)
+	//	{
+	//	return EAspBearerSmlUsb;
+	//	}
+
+	else
+		{
+		return KErrNotFound;
+		}
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::SmlBearerId
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspBearerHandler::SmlBearerId(const TInt aId)
+	{
+	if (aId == EAspBearerInternet)
+		{
+		return KUidNSmlMediumTypeInternet.iUid;
+		}
+	else if (aId == EAspBearerBlueTooth)
+		{
+		return KUidNSmlMediumTypeBluetooth.iUid;
+    	}
+	else if (aId == EAspBearerUsb)
+		{
+		return KUidNSmlMediumTypeUSB.iUid;		
+		}
+	else if (aId == EAspBearerIrda)
+		{
+		return KUidNSmlMediumTypeIrDA.iUid;		
+		}
+	//else if (aId == EAspBearerWsp)
+	//	{
+	//	return KUidNSmlMediumTypeWSP.iUid;		
+	//	}
+	//else if (aId == EAspBearerSmlUsb)
+	//	{
+	//	return KUidNSmlMediumTypeNSmlUSB.iUid;		
+	//	}
+	else
+		{
+		return KErrNotFound;
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::DefaultBearer
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspBearerHandler::DefaultBearer()
+	{
+	if (IsSupported(EAspBearerInternet))
+		{
+		return EAspBearerInternet;
+		}
+	if (IsSupported(EAspBearerBlueTooth))
+		{
+		return EAspBearerBlueTooth;
+		}
+    if (IsSupported(EAspBearerUsb))
+		{
+		return EAspBearerUsb;
+		}
+	if (IsSupported(EAspBearerIrda))
+		{
+		return EAspBearerIrda;
+		}
+
+	return KErrNotFound; // something is wrong
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::GetBearerName
+//
+// -----------------------------------------------------------------------------
+//
+void CAspBearerHandler::GetBearerName(TDes& aText, TInt aBearerType)
+	{
+    aText = KNullDesC;
+	TInt count = iList.Count();
+
+	for (TInt i=0; i<count; i++)
+		{
+		TAspBearerItem& item = iList[i];
+		if (item.iBearerType == aBearerType)
+			{
+			TUtil::StrCopy(aText, item.iBearerName);
+			break;
+			}
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::BuildBearerListLC
+//
+// -----------------------------------------------------------------------------
+//
+CDesCArray* CAspBearerHandler::BuildBearerListLC()
+	{	
+	CDesCArray* arr = new (ELeave) CDesCArrayFlat(1);
+	CleanupStack::PushL(arr);
+
+	TInt count = iList.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		TAspBearerItem& item = iList[i];
+		arr->AppendL(item.iBearerName);
+		}
+
+	return arr;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspBearerHandler::SupportedBearerCount
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspBearerHandler::SupportedBearerCount()
+	{
+	return iList.Count();
+	}
+
+
+
+
+
+/******************************************************************************
+ * class CAspAccessPointHandler
+ ******************************************************************************/
+
+
+
+// -----------------------------------------------------------------------------
+// CAspAccessPointHandler::NewLC
+//
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CAspAccessPointHandler* CAspAccessPointHandler::NewL(const TAspParam& aParam)
+    {
+    CAspAccessPointHandler* self = new(ELeave) CAspAccessPointHandler(aParam);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+
+	return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Destructor
+//
+// -----------------------------------------------------------------------------
+//
+CAspAccessPointHandler::~CAspAccessPointHandler()
+	{
+	delete iCommDb;
+	delete iApUtil;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAccessPointHandler::CAspAccessPointHandler
+//
+// -----------------------------------------------------------------------------
+//
+CAspAccessPointHandler::CAspAccessPointHandler(const TAspParam& /*aParam*/)
+	{
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAccessPointHandler::ConstructL
+//
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CAspAccessPointHandler::ConstructL(void)
+    {
+	iCommDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
+	
+	iApUtil = CApUtils::NewLC(*iCommDb);
+	CleanupStack::Pop(iApUtil);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAspAccessPointHandler::ShowApSelectDialogL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspAccessPointHandler::ShowApSelectDialogL(TAspAccessPointItem& aItem)
+	{
+	FLOG( _L("CAspAccessPointHandler::ShowApSelectDialogL START") );
+
+	aItem.iUid = KErrNotFound;
+	aItem.iName = KNullDesC;
+
+	TInt err(KErrNone);
+	TInt retVal( KErrNone );
+	TCmSettingSelection selection;
+	TBearerFilterArray filterArray;
+
+	TUint32 currentAp = 0;
+	if (aItem.iUid2 != KAskAlways && aItem.iUid2 != KDefaultConnection)
+		{
+		FLOG( _L("ShowApSelectDialogL aItem.iUid2 = %d"), aItem.iUid2 );        
+		// convert internet ap to Wap ap (CApSettingsHandler requires this)
+		TRAP_IGNORE(currentAp = iApUtil->WapIdFromIapIdL(aItem.iUid2));
+		}
+	else
+		{
+		FLOG( _L("ShowApSelectDialogL KAskAlways or KDefaultConnection"));
+		}
+
+	// Mark the current selection
+	selection.iResult = CMManager::EConnectionMethod;
+	selection.iId = currentAp;
+	FLOG( _L("ShowApSelectDialogL selection.iId = %d"), selection.iId );        
+	
+	// Start the connection dialog
+	CCmApplicationSettingsUi* settings = CCmApplicationSettingsUi::NewL();
+	CleanupStack::PushL( settings );
+
+	TRAP ( err, retVal = settings->RunApplicationSettingsL( selection, 
+		CMManager::EShowConnectionMethods, // Show only access points
+		filterArray ) );
+    	
+	CleanupStack::PopAndDestroy(); // settings
+
+	if (err != KErrNone)
+	{
+		// Error showing dialogue, return
+		FLOG( _L("ShowApSelectDialogL err = %d"), err );
+		return EAspDialogCancel;
+	}
+
+	if (retVal)
+		{
+		TAspAccessPointItem item;
+		item.iUid = selection.iId;
+		FLOG( _L("ShowApSelectDialogL Uid (%d)"), item.iUid );
+
+		GetApInfo(item);
+
+		// convert Wap ap to internet ap
+		aItem.iUid = iApUtil->IapIdFromWapIdL(selection.iId);
+		FLOG( _L("ShowApSelectDialogL Uid Conv (%d)"), item.iUid );
+	    
+		aItem.iName = item.iName;
+
+		FLOG( _L("ShowApSelectDialogL RETURNING EAspDialogSelect") );
+		return EAspDialogSelect;
+		}
+	else
+		{
+		FLOG( _L("ShowApSelectDialogL RETURNING EAspDialogCancel") );
+		return EAspDialogCancel;
+		}
+	FLOG( _L("CAspAccessPointHandler::ShowApSelectDialogL END") );
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAccessPointHandler::GetApInfoL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspAccessPointHandler::GetApInfoL(TAspAccessPointItem& aItem)
+	{
+	if (aItem.iUid == KAskAlways || aItem.iUid == KErrNotFound || aItem.iUid == KDefaultConnection)
+		{
+		return KErrNotFound;
+		}
+
+	CApSelect* selector = CApSelect::NewLC(*iCommDb,
+	                             KEApIspTypeAll,
+		                         BearerFlags(),
+		                         KEApSortUidAscending);
+	
+	TInt ret = KErrNone;
+	TBool found = EFalse;
+	
+	// find access point with id aId
+	if (selector->MoveToFirst())
+		{
+		if (aItem.iUid == (TInt)selector->Uid())
+			{
+			found = ETrue;		
+			}
+		while (!found && selector->MoveNext())
+			{
+			if (aItem.iUid == (TInt)selector->Uid())
+				{
+				found = ETrue;
+				}
+			}
+		}
+
+	if (found) 
+		{
+		TUtil::StrCopy(aItem.iName, selector->Name());
+		}
+	else
+		{
+		aItem.iName = KNullDesC;
+		ret = KErrNotFound;
+		}
+		
+    CleanupStack::PopAndDestroy(selector);
+	return ret;
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAspAccessPointHandler::GetApInfo
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspAccessPointHandler::GetApInfo(TAspAccessPointItem& aItem)
+	{
+	aItem.iName = KNullDesC;
+	
+	TInt ret = KErrNone;
+	TRAPD(err, ret = GetApInfoL(aItem));
+	
+	if (err != KErrNone)
+		{
+		return KErrNotFound;
+		}
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAccessPointHandler::GetInternetApInfo
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspAccessPointHandler::GetInternetApInfo(TAspAccessPointItem& aItem)
+	{
+	if (aItem.iUid == KAskAlways || aItem.iUid == KErrNotFound || aItem.iUid == KDefaultConnection)
+		{
+		return KErrNotFound;
+		}
+
+	TAspAccessPointItem item;
+	
+	// convert internet ap to Wap ap
+	TRAPD(err, item.iUid = iApUtil->WapIdFromIapIdL(aItem.iUid));
+	if (err != KErrNone)
+		{
+		return KErrNotFound;
+		}
+	
+	TInt ret = GetApInfo(item);
+	
+	TUtil::StrCopy(aItem.iName, item.iName);
+	return ret;
+	}
+
+
+// -----------------------------------------------------------------------------
+// CAspAccessPointHandler::BearerFlags
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAspAccessPointHandler::BearerFlags()
+	{
+	TInt flags;
+	if (FeatureManager::FeatureSupported(KFeatureIdAppCsdSupport))
+		{
+		//flags = EApBearerTypeGPRS | EApBearerTypeCDMA | EApBearerTypeWLAN | EApBearerTypeHSCSD | EApBearerTypeCSD;
+		flags = EApBearerTypeAllBearers;
+		}
+	else
+		{
+		flags = EApBearerTypeGPRS | EApBearerTypeCDMA | EApBearerTypeWLAN;
+		}
+		
+	return flags;
+	}
+
+
+
+
+/******************************************************************************
+ * class TAspSyncError
+ ******************************************************************************/
+
+
+
+
+// -----------------------------------------------------------------------------
+// TAspSyncError::GetSmlErrorText
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* TAspSyncError::GetSmlErrorText(TInt aErrorCode, TInt aTransport)
+	{
+	HBufC* hBuf = NULL;
+	
+	TRAPD(err, hBuf = GetSmlErrorTextL(aErrorCode, aTransport));
+	
+	if (err == KErrNone)
+		{
+		return hBuf;
+		}
+	else
+		{
+		return NULL;
+		}
+	}
+
+
+// -----------------------------------------------------------------------------
+// TAspSyncError::GetSmlErrorTextL
+//
+// -----------------------------------------------------------------------------
+//
+HBufC* TAspSyncError::GetSmlErrorTextL(TInt aErrorCode, TInt /*aTransport*/)
+	{
+    TInt id = R_ASP_LOG_ERR_SYSTEMERROR;  // "System Error"
+   
+	switch (aErrorCode)
+		{
+		case SyncMLError::KErrTransportAuthenticationFailure:
+			{
+			id = R_ASP_LOG_ERR_HTTPAUTH;  // "Http authentication failed"
+		    break;
+			}
+	
+		case SyncMLError::KErrAuthenticationFailure:
+			{
+			id = R_ASP_LOG_ERR_CLIENTAUTH;  // "Invalid user name or password"
+		    break;
+			}
+
+		case KErrServerBusy:
+		    id = R_ASP_LOG_ERR_SERVERBUSY;  // "Synchronisation server was busy"
+		    break;
+		    
+		case SyncMLError::KErrServerDatabaseNotFound:
+		    id = R_ASP_LOG_ERR_REMOTEDATABASE;  // "Invalid remote database"
+		    break;
+
+		case SyncMLError::KErrClientDatabaseNotFound:
+		    id = R_ASP_LOG_ERR_LOCALDATABASE;  // "Unable to open database"
+		    break;
+
+		case SyncMLError::KErrConnectionError:
+		    id = R_ASP_LOG_ERR_SERVERNOTRESPONDING; // "Server is not responding"
+		    break;
+		    
+		case SyncMLError::KErrTransportSvrNoUri:
+		    id = R_ASP_LOG_ERR_URIINVALID; // "Invalid host address"
+		    break;
+		
+		case SyncMLError::KErrPhoneOnOfflineMode:
+		    id = R_ASP_LOG_ERR_OFFLINE; // "Operation not possible in Off-line mode"
+		    break;
+		    
+		case SyncMLError::KErrTransportRequest:
+		case SyncMLError::KErrTransportHeader:
+		case SyncMLError::KErrTransportSvrError:
+		case SyncMLError::KErrTransportDisconnected:
+		case SyncMLError::KErrCannotCommunicateWithServer:
+		    id = R_ASP_LOG_ERR_COMM;  // "Error in communication"
+		    break;
+		    
+		case SyncMLError::KErrVerDTDMissing:
+		case SyncMLError::KErrProtoMissing:
+		case SyncMLError::KErrVersionDTDNotSupported:
+		case SyncMLError::KErrProtoNotSupported:
+		    id = R_ASP_LOG_ERR_VERSIONNOTSUPPORTED;  // "Unsupported SyncML software version in server"
+		    break;
+       
+		case SyncMLError::KErrSessionIdNotValid:
+		case SyncMLError::KErrMappingInfoMissing:
+		case SyncMLError::KErrMappingInfoNotAcked:
+		case SyncMLError::KErrStatusCommandForCommandNotSent:
+		case SyncMLError::KErrStatusCommandNotTheSame:
+		case SyncMLError::KErrMissingStatusCommands:
+		case SyncMLError::KErrFailedToAddRecord:
+		case SyncMLError::KErrFailedToReplaceRecord:
+		case SyncMLError::KErrFailedToDeleteRecord:
+		case SyncMLError::KErrXmlParsingError:
+		case SyncMLError::KErrReferenceToolkitError:
+		case SyncMLError::KErrObjectTooLargeToSendToServer:
+		case SyncMLError::KErrFailedToGetRecord:
+		case SyncMLError::KErrUserInteractionFailed:
+		case SyncMLError::KErrStatusSizeMismatch:
+		case SyncMLError::KErrFailedToCloseDatabase:
+		case SyncMLError::KErrDatabaseAdapterIndexError:
+	   	    id = R_ASP_LOG_ERR_SERVERERROR;  // "Error in sync server"
+		    break;
+	        
+		/* Implementation of CMCC PIM v3 begins*/
+		case SyncMLError::KErrServerFull:
+		    if ( FeatureManager::FeatureSupported(KFeatureIdFfTdCmccpimpromptserverfullwhenreceive420statuscodefromserver) )
+		        {
+                id = R_QTN_NSML_LOG_ERR_SERVERFULL;
+		        }
+		    break;
+		/* Implementation of CMCC PIM v3 ends*/
+		    
+        default:
+            id = R_ASP_LOG_ERR_SYSTEMERROR;  // "System Error"
+		    break;
+		}
+		
+	HBufC* hBuf = CAspResHandler::ReadLC(id);
+	
+#ifdef _DEBUG
+	TBuf<KBufSize> buf2(hBuf->Des());
+	TBuf<KBufSize> buf1;
+	CleanupStack::PopAndDestroy(hBuf);
+		
+	hBuf = HBufC::NewLC(256);
+	TPtr ptr = hBuf->Des();
+		
+	GetSyncMLErrorText(buf1, aErrorCode);
+	ptr.Format(_L("%S (%S)"), &buf2, &buf1);
+#endif		
+		
+	CleanupStack::Pop(hBuf);
+	return hBuf;
+	}
+	
+
+// -----------------------------------------------------------------------------
+// TAspSyncError::GetSmlErrorValue
+// 
+// -----------------------------------------------------------------------------
+TInt TAspSyncError::GetSmlErrorValue(TInt aErrorCode)
+	{
+    TInt id = R_ASP_LOG_ERR_SYSTEMERROR;  // "System Error"
+   
+	switch (aErrorCode)
+		{
+		case SyncMLError::KErrTransportAuthenticationFailure:
+			{
+			id = R_ASP_LOG_ERR_HTTPAUTH;  // "Http authentication failed"
+		    break;
+			}
+	
+		case SyncMLError::KErrAuthenticationFailure:
+			{
+			id = R_ASP_LOG_ERR_CLIENTAUTH;  // "Invalid user name or password"
+		    break;
+			}
+
+		case KErrServerBusy:
+		    id = R_ASP_LOG_ERR_SERVERBUSY;  // "Synchronisation server was busy"
+		    break;
+		    
+		case SyncMLError::KErrServerDatabaseNotFound:
+		    id = R_ASP_LOG_ERR_REMOTEDATABASE;  // "Invalid remote database"
+		    break;
+
+		case SyncMLError::KErrClientDatabaseNotFound:
+		    id = R_ASP_LOG_ERR_LOCALDATABASE;  // "Unable to open database"
+		    break;
+
+		case SyncMLError::KErrConnectionError:
+		    id = R_ASP_LOG_ERR_SERVERNOTRESPONDING; // "Server is not responding"
+		    break;
+		    
+		case SyncMLError::KErrTransportSvrNoUri:
+		    id = R_ASP_LOG_ERR_URIINVALID; // "Invalid host address"
+		    break;
+		
+		case SyncMLError::KErrPhoneOnOfflineMode:
+		    id = R_ASP_LOG_ERR_OFFLINE; // "Operation not possible in Off-line mode"
+		    break;
+		    
+		case SyncMLError::KErrTransportRequest:
+		case SyncMLError::KErrTransportHeader:
+		case SyncMLError::KErrTransportSvrError:
+		case SyncMLError::KErrTransportDisconnected:
+		case SyncMLError::KErrCannotCommunicateWithServer:
+		    id = R_ASP_LOG_ERR_COMM;  // "Error in communication"
+		    break;
+		    
+		case SyncMLError::KErrVerDTDMissing:
+		case SyncMLError::KErrProtoMissing:
+		case SyncMLError::KErrVersionDTDNotSupported:
+		case SyncMLError::KErrProtoNotSupported:
+		    id = R_ASP_LOG_ERR_VERSIONNOTSUPPORTED;  // "Unsupported SyncML software version in server"
+		    break;
+       
+		case SyncMLError::KErrSessionIdNotValid:
+		case SyncMLError::KErrMappingInfoMissing:
+		case SyncMLError::KErrMappingInfoNotAcked:
+		case SyncMLError::KErrStatusCommandForCommandNotSent:
+		case SyncMLError::KErrStatusCommandNotTheSame:
+		case SyncMLError::KErrMissingStatusCommands:
+		case SyncMLError::KErrFailedToAddRecord:
+		case SyncMLError::KErrFailedToReplaceRecord:
+		case SyncMLError::KErrFailedToDeleteRecord:
+		case SyncMLError::KErrXmlParsingError:
+		case SyncMLError::KErrReferenceToolkitError:
+		case SyncMLError::KErrObjectTooLargeToSendToServer:
+		case SyncMLError::KErrFailedToGetRecord:
+		case SyncMLError::KErrUserInteractionFailed:
+		case SyncMLError::KErrStatusSizeMismatch:
+		case SyncMLError::KErrFailedToCloseDatabase:
+		case SyncMLError::KErrDatabaseAdapterIndexError:
+	   	    id = R_ASP_LOG_ERR_SERVERERROR;  // "Error in sync server"
+		    break;
+	        
+        default:
+            id = R_ASP_LOG_ERR_SYSTEMERROR;  // "System Error"
+		    break;
+		}
+		
+		return id ;
+	}
+	
+
+#ifdef _DEBUG
+
+// -----------------------------------------------------------------------------
+// TAspSyncError::GetSyncMLErrorText
+//
+// -----------------------------------------------------------------------------
+//
+void TAspSyncError::GetSyncMLErrorText(TDes& aText, TInt aError)
+	{
+    aText = KNullDesC();
+  
+   
+	switch (aError)
+		{
+		case SyncMLError::KErrTransportRequest:
+		    aText = _L("KErrTransportRequest");
+		    break;
+		case SyncMLError::KErrTransportHeader:
+		    aText = _L("KErrTransportHeader");
+		    break;
+		case SyncMLError::KErrTransportSvrNoUri:
+		    aText = _L("KErrTransportSvrNoUri");
+		    break;
+		case SyncMLError::KErrTransportSvrError:
+		    aText = _L("KErrTransportSvrError");
+		    break;
+		case SyncMLError::KErrTransportAuthenticationFailure:
+		    aText = _L("KErrTransportAuthenticationFailure");
+		    break;
+		case SyncMLError::KErrTransportDisconnected:
+		    aText = _L("KErrTransportDisconnected");
+		    break;
+		case SyncMLError::KErrConnectionError:
+		    aText = _L("KErrConnectionError");
+		    break;
+		case SyncMLError::KErrCannotCommunicateWithServer:
+		    aText = _L("KErrCannotCommunicateWithServer");
+		    break;
+		case SyncMLError::KErrDatabaseAdapterIndexError:
+		    aText = _L("KErrDatabaseAdapterIndexError");
+		    break;
+		case SyncMLError::KErrParseCallbackError:
+		    aText = _L("KErrParseCallbackError");
+		    break;
+		case SyncMLError::KErrCommandInvalid:
+		    aText = _L("KErrCommandInvalid");
+		    break;
+		case SyncMLError::KErrSessionIdNotValid:
+		    aText = _L("KErrSessionIdNotValid");
+		    break;
+		case SyncMLError::KErrVerDTDMissing:
+		    aText = _L("KErrVerDTDMissing");
+		    break;
+		case SyncMLError::KErrProtoMissing:
+		    aText = _L("KErrProtoMissing");
+		    break;
+		case SyncMLError::KErrSyncHdrMissing:
+		    aText = _L("KErrSyncHdrMissing");
+		    break;
+		case SyncMLError::KErrTargetLocMissing:
+		    aText = _L("KErrTargetLocMissing");
+		    break;
+		case SyncMLError::KErrSourceLocMissing:
+		    aText = _L("KErrSourceLocMissing");
+		    break;
+		case SyncMLError::KErrTargetLocNameMissing:
+		    aText = _L("KErrTargetLocNameMissing");
+		    break;
+		case SyncMLError::KErrSourceLocNameMissing:
+		    aText = _L("KErrSourceLocNameMissing");
+		    break;
+		case SyncMLError::KErrMappingInfoMissing:
+		    aText = _L("KErrMappingInfoMissing");
+		    break;
+		case SyncMLError::KErrMappingInfoNotAcked:
+		    aText = _L("KErrMappingInfoNotAcked");
+		    break;
+		case SyncMLError::KErrVersionDTDNotSupported:
+		    aText = _L("KErrVersionDTDNotSupported");
+		    break;
+		case SyncMLError::KErrProtoNotSupported:
+		    aText = _L("KErrProtoNotSupported");
+		    break;
+		case SyncMLError::KErrStatusCommandForCommandNotSent:
+		    aText = _L("KErrStatusCommandForCommandNotSent");
+		    break;
+		case SyncMLError::KErrStatusCommandNotTheSame:
+		    aText = _L("KErrStatusCommandNotTheSame");
+		    break;
+		case SyncMLError::KErrMissingStatusCommands:
+		    aText = _L("KErrMissingStatusCommands");
+		    break;
+		case SyncMLError::KErrFailedToAddRecord:
+		    aText = _L("KErrFailedToAddRecord");
+		    break;
+		case SyncMLError::KErrFailedToReplaceRecord:
+		    aText = _L("KErrFailedToReplaceRecord");
+		    break;
+		case SyncMLError::KErrFailedToDeleteRecord:
+		    aText = _L("KErrFailedToDeleteRecord");
+		    break;
+		case SyncMLError::KErrXmlParsingError:
+		    aText = _L("KErrXmlParsingError");
+		    break;
+		case SyncMLError::KErrReferenceToolkitError:
+		    aText = _L("KErrReferenceToolkitError");
+		    break;
+		case SyncMLError::KErrClientDatabaseNotFound:
+		    aText = _L("KErrClientDatabaseNotFound");
+		    break;
+		case SyncMLError::KErrServerDatabaseNotFound:
+		    aText = _L("KErrServerDatabaseNotFound");
+		    break;
+		case SyncMLError::KErrDevInfFileNotFound:
+		    aText = _L("KErrDevInfFileNotFound");
+		    break;
+		case SyncMLError::KErrObjectTooLargeToSendToServer:
+		    aText = _L("KErrObjectTooLargeToSendToServer");
+		    break;
+		case SyncMLError::KErrSlowSync:
+		    aText = _L("KErrSlowSync");
+		    break;
+		case SyncMLError::KErrFailedToGetRecord:
+		    aText = _L("KErrFailedToGetRecord");
+		    break;
+		case SyncMLError::KErrUserInteractionFailed:
+		    aText = _L("KErrUserInteractionFailed");
+		    break;
+		case SyncMLError::KErrStatusSizeMismatch:
+		    aText = _L("KErrStatusSizeMismatch");
+		    break;
+		case SyncMLError::KErrFailedToCloseDatabase:
+		    aText = _L("KErrFailedToCloseDatabase");
+		    break;
+	
+    	case SyncMLError::KErrPhoneOnOfflineMode:
+		    aText = _L("KErrPhoneOnOfflineMode");
+		    break;
+		
+	    case SyncMLError::KErrAuthenticationFailure:
+		    aText = _L("KErrAuthenticationFailure");
+		    break;
+		
+		case SyncMLError::KErrGeneral:
+		    aText = _L("KErrGeneral");
+		    break;
+		
+		case SyncMLError::KErrMessageTooShort:
+		    aText = _L("KErrMessageTooShort");
+		    break;
+		case SyncMLError::KErrMessageIsCorrupt:
+		    aText = _L("KErrMessageIsCorrupt");
+		    break;
+		case SyncMLError::KErrBadTransportId:
+		    aText = _L("KErrBadTransportId");
+		    break;
+		case SyncMLError::KErrNoNotificationBody:
+		    aText = _L("KErrNoNotificationBody");
+		    break;
+		case SyncMLError::KErrWrongVersion:
+		    aText = _L("KErrWrongVersion");
+		    break;
+		case SyncMLError::KErrUnsupportedMimeType:
+		    aText = _L("KErrUnsupportedMimeType");
+		    break;
+		case SyncMLError::KErrNoSuchTask:
+		    aText = _L("KErrNoSuchTask");
+		    break;
+		case SyncMLError::KErrUnknownSyncType:
+		    aText = _L("KErrUnknownSyncType");
+		    break;
+		case SyncMLError::KErrUnknownProfile:
+		    aText = _L("KErrUnknownProfile");
+		    break;
+		case SyncMLError::KErrInvalidProfile:
+		    aText = _L("KErrInvalidProfile");
+		    break;
+		case SyncMLError::KErrInvalidCredentials:
+		    aText = _L("KErrInvalidCredentials");
+		    break;
+		case SyncMLError::KErrNoCredentials:
+		    aText = _L("KErrNoCredentials");
+		    break;
+		case SyncMLError::KErrIntegrityFailureHMAC:
+		    aText = _L("KErrIntegrityFailureHMAC");
+		    break;
+		case SyncMLError::KErrMustUsageUriNotComplete:
+		    aText = _L("KErrMustUsageUriNotComplete");
+		    break;
+		case SyncMLError::KErrDMAccUriIsCorrupt:
+		    aText = _L("KErrDMAccUriIsCorrupt");
+		    break;
+		case SyncMLError::KErrDMConUriIsCorrupt:
+		    aText = _L("KErrDMConUriIsCorrupt");
+		    break;
+		case SyncMLError::KErrParmNameNotInProvDoc:
+		    aText = _L("KErrParmNameNotInProvDoc");
+		    break;
+		case SyncMLError::KErrInvalidAppIdValue:
+		    aText = _L("KErrInvalidAppIdValue");
+		    break;
+		case SyncMLError::KErrInvalidToNapIdValue:
+		    aText = _L("KErrInvalidToNapIdValue");
+		    break;
+		case SyncMLError::KErrInvalidProviderIdValue:
+		    aText = _L("KErrInvalidProviderIdValue");
+		    break;
+		case SyncMLError::KErrEmptyAauthLevelValue:
+		    aText = _L("KErrEmptyAauthLevelValue");
+		    break;
+		case SyncMLError::KErrAppSrvAAuthLevelNotFound:
+		    aText = _L("KErrAppSrvAAuthLevelNotFound");
+		    break;
+		case SyncMLError::KErrClientAAuthLevelNotFound:
+		    aText = _L("KErrClientAAuthLevelNotFound");
+		    break;
+		case SyncMLError::KErrInvalidAppAuth:
+		    aText = _L("KErrInvalidAppAuth");
+		    break;
+		case SyncMLError::KErrNoApplicationCharac:
+		    aText = _L("KErrNoApplicationCharac");
+		    break;
+		case SyncMLError::KErrNoAppAuthCharac:
+		    aText = _L("KErrNoAppAuthCharac");
+		    break;
+		case SyncMLError::KErrMissingRequiredParmInSvr:
+		    aText = _L("KErrMissingRequiredParmInSvr");
+		    break;
+		case SyncMLError::KErrMissingRequiredParmInClient:
+		    aText = _L("KErrMissingRequiredParmInClient");
+		    break;
+		case SyncMLError::KErrAppAddrCharacNotFound:
+		    aText = _L("KErrAppAddrCharacNotFound");
+		    break;
+		case SyncMLError::KErrUnsupportedVersion:
+		    aText = _L("KErrUnsupportedVersion");
+		    break;
+		case SyncMLError::KErrWrongProvPublicDocId:
+		    aText = _L("KErrWrongProvPublicDocId");
+		    break;
+		case SyncMLError::KErrProfileNotFound:
+		    aText = _L("KErrProfileNotFound");
+		    break;
+		case SyncMLError::KErrConnectionNotFound:
+		    aText = _L("KErrConnectionNotFound");
+		    break;
+		case SyncMLError::KErrTaskNotFound:
+		    aText = _L("KErrTaskNotFound");
+		    break;
+		case SyncMLError::KErrTransportNotFound:
+		    aText = _L("KErrTransportNotFound");
+		    break;
+		case SyncMLError::KErrDataProviderNotFound:
+		    aText = _L("KErrDataProviderNotFound");
+		    break;
+		case SyncMLError::KErrJobNotFound:
+		    aText = _L("KErrJobNotFound");
+		    break;
+		case SyncMLError::KErrObjectPendingDelete:
+		    aText = _L("KErrObjectPendingDelete");
+		    break;
+		case SyncMLError::KErrObjectInUse:
+		    aText = _L("KErrObjectInUse");
+		    break;
+		case SyncMLError::KErrProfileAccessDenied:
+		    aText = _L("KErrProfileAccessDenied");
+		    break;
+		case SyncMLError::KErrSuspended:
+		    aText = _L("KErrSuspended");
+		    break;
+		case SyncMLError::KErrDataDepotStreamNotFound:
+		    aText = _L("KErrDataDepotStreamNotFound");
+		    break;
+		
+		case SyncMLError::KErrServerIdNotMatching:
+		    aText = _L("KErrServerIdNotMatching");
+		    break;
+	        
+        default:
+            aText.Format(_L("%d"), aError);
+		    break;
+		}
+	}
+
+#endif
+
+
+
+
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/OmaDsAppUiPlugin/BWinscw/OmaDsAppUiPluginu.def	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/OmaDsAppUiPlugin/data/102833A1.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 1028 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 rss file which contains the 
+				 interface implementation information.
+*
+*/
+
+
+#include <ecom/registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+{
+dll_uid = 0x102833A1;   //DSGS Plugin dll UID3 (security UID)  
+interfaces = 
+    {
+    INTERFACE_INFO
+        {
+        interface_uid               = 0x10207236;  // CGSPluginInterface UID   
+        implementations = 
+            {
+            IMPLEMENTATION_INFO
+                {
+                implementation_uid  = 0x102833A2; // DSGS Plugin implementation UID for CGSPluginInterface
+                version_no          = 1;
+                display_name        = "Data syncronization plugin";
+                default_data        = "0x10283319"; // Parent UID (DSGS is under "Connection UI")
+                opaque_data         = "10";         // Order number 
+                }
+            };
+        }
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/OmaDsAppUiPlugin/data/NsmlDSGSPluginResource.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* 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:  DS General Settings resource file
+*
+*/
+
+
+NAME DSGS
+
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <avkon.loc>
+#include <data_caging_paths_strings.hrh>
+
+#include<nsmldssync.loc>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=qtn_cp_folder_data_sync; }
+
+RESOURCE TBUF r_ds_gs_title  { buf=qtn_cp_folder_data_sync; }
+
+// END FILE dsapp.rss
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/OmaDsAppUiPlugin/eabi/OmaDsAppUiPluginu.def	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,5 @@
+EXPORTS
+	_Z24ImplementationGroupProxyRi @ 1 NONAME
+	_ZTI26COmaDsAppUiPluginInterface @ 2 NONAME ; #<TI>#
+	_ZTV26COmaDsAppUiPluginInterface @ 3 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/OmaDsAppUiPlugin/group/OmaDsAppUiPlugin.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,84 @@
+/*
+* 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:  Project specification file.
+*
+*/
+
+
+#include <defaultcaps.hrh>
+#include <data_caging_paths.hrh>
+
+#include <platform_paths.hrh>
+CAPABILITY 	CAP_ECOM_PLUGIN
+
+TARGET          OmaDsAppUiPlugin.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x102833A1
+VENDORID	    VID_DEFAULT
+
+#if defined(ARMCC)
+DEFFILE		../eabi/OmaDsAppUiPlugin.def
+#elif defined(WINSCW)
+DEFFILE		../BWinscw/OmaDsAppUiPlugin.def
+#endif
+
+SOURCEPATH      ../src
+// SOURCE tags needs to be here.
+SOURCE OmaDsAppUiPluginInterface.cpp
+SOURCE OmaDsAppUiPluginProxy.cpp
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 		/epoc32/include/ecom
+
+USERINCLUDE     ../inc 
+
+// for AspSyncUtilApi.h
+USERINCLUDE     ../../AspSyncUtil/inc
+
+// for nsmldssync.loc
+USERINCLUDE     ../../AspSyncUtil/src
+
+
+SOURCEPATH      ../data
+START RESOURCE  102833A1.rss					//Plugin registration data
+TARGET          OmaDsAppUiPlugin.rsc			
+END
+
+SOURCEPATH      ../data
+START RESOURCE  NsmlDSGSPluginResource.rss       
+TARGET          NsmlDSGSPluginResource.rsc
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+HEADER
+END
+
+
+LIBRARY    GSEcomPlugin.lib
+LIBRARY    GSFramework.lib 
+LIBRARY    aknskins.lib
+LIBRARY    aknicon.lib
+LIBRARY    Egul.lib
+LIBRARY    euser.lib
+LIBRARY    cone.lib
+LIBRARY    eikcore.lib
+LIBRARY    eikcoctl.lib
+LIBRARY	   avkon.lib
+LIBRARY    aspsyncutil.lib
+LIBRARY    CommonEngine.lib
+LIBRARY    bafl.lib
+
+// Required only for embedded app
+LIBRARY    apgrfx.lib
+LIBRARY    ws32.lib
+LIBRARY    apparc.lib
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/OmaDsAppUiPlugin/group/OmaDsAppUiPlugin_icons_dc.mk	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,71 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+#
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\OmaDsAppUiPlugin.mif
+
+HEADERDIR=\epoc32\include
+HEADERFILENAME=$(HEADERDIR)\OmaDsAppUiPlugin.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+#
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_prop_cp_conn_datasync.bmp \
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/OmaDsAppUiPlugin/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -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:
+*
+*/
+
+//
+// Platforms
+//
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+//#ifdef RD_DSUI_CP_INTEGRATION
+
+//gnumakefile OmaDsAppUiPlugin_icons_dc.mk
+
+OmaDsAppUiPlugin.mmp
+//#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/OmaDsAppUiPlugin/inc/OmaDsAppUiPluginInterface.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,130 @@
+/*
+* 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:  This class implements ECom interface for COmaDsAppUiPlugin.dll
+*
+*/
+
+
+#ifndef _NSML_DS_GS_PLUGIN_H_
+#define _NSML_DS_GS_PLUGIN_H_
+
+// System includes
+#include <gsplugininterface.h>
+#include "AspSyncUtilApi.h"
+
+#include <AknServerApp.h> 
+
+#define KUidNsmlDSGSPluginDll   0x102833A1
+#define KUidNsmlDSGSPluginImpl  0x102833A2
+
+// Use this UID in registry file as well.
+// UID belongs omadsapp.exe
+#define KDsAppUid 0x101F6DE4
+    
+class CAknNullService;
+
+/**
+* DsGS ECom Plugin
+*/
+class COmaDsAppUiPluginInterface : public CGSPluginInterface, 
+								   public MAknServerAppExitObserver
+    {    
+	public: // Constructors & destructors
+
+	    /**
+	    * Two-Phased constructor
+	    * Creates new DsUi plugin.
+	    * Uses Leave code KErrNotFound if implementation is not found.
+	    */                                                 
+	    static CGSPluginInterface* NewL();
+	    
+	    /**
+	    * From CAknView Returns this view Id.
+	    */
+		TUid Id() const;
+	    
+	    /**
+	    * returns the caption to be displayed in GS view
+	    *
+	    * @param aCaption - The caption to be displayed is to be copied here.
+	    */
+	    void GetCaptionL( TDes& aCaption ) const;
+		
+		/**
+		* returns the icon to be displayed in GS view
+		* 
+		* @param aIconType - type of icon to be displayed
+		*/
+	    CGulIcon* CreateIconL( const TUid aIconType );
+	    
+	    /**
+	    * Destructor
+	    */
+	    ~COmaDsAppUiPluginInterface();   
+
+    	/**
+        * From CGSPluginInterface.
+        * @return this plugin's provider category.
+        */
+        TInt PluginProviderCategory() const;
+
+        /**
+        * From CGSPluginInterface.
+        * @return this plugin's item type.
+        */
+        TGSListboxItemTypes ItemType();
+         
+	    /**
+        * From CGSPluginInterface.
+        * @param aSelectionType selection type.
+        */
+        void HandleSelection( const TGSSelectionTypes aSelectionType );
+	
+	protected:        
+	    
+	    /**
+	    * From CAknView Activates this view.
+	    */
+		void DoActivateL(const TVwsViewId& aPrevViewId,
+		    			 TUid aCustomMessageId, 
+		    			 const TDesC8& aCustomMessage);		
+		/**
+	    * From CAknView Deactivates this view.
+	    */
+		void DoDeactivate();		
+
+	private:
+	  	void ConstructL();
+		
+		/**
+		* Constructor
+		*/
+	    COmaDsAppUiPluginInterface();
+	
+        void LaunchDsAppL() ;
+
+	private:
+			
+		CEikonEnv* env;
+		TInt       iResId;
+		/**
+        * AVKON NULL Service.
+        * Own.
+        */
+        CAknNullService* iNullService;
+};
+
+#endif //_NSML_DS_GS_PLUGIN_H_
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/OmaDsAppUiPlugin/src/OmaDsAppUiPluginInterface.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,225 @@
+/*
+* 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:  Nsml DS settings Ecom plugin Impln.
+*
+*/
+
+
+//System Includes
+#include <e32std.h>
+#include <implementationproxy.h>
+#include <StringLoader.h>
+#include <bautils.h>
+#include <AknsUtils.h>
+#include <gulicon.h>
+#include <akntitle.h>
+
+// Required only for embedded app
+#include <AknNullService.h>
+#include <apgtask.h>
+
+// User includes
+#include "OmaDsAppUiPluginInterface.h"
+#include "gsprivatepluginproviderids.h"
+#include <nsmldssync.mbg>
+#include "NsmlDSGSPluginResource.rsg"
+
+
+_LIT(KNsmlDsIconFileName, "Z:\\resource\\apps\\nsmldssync.mif");
+_LIT(KNsmlDsResFileName,  "Z:\\resource\\NsmlDSGSPluginResource.rsc" );
+
+// ---------------------------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::NewLC
+// returns an object of COmaDsAppUiPluginInterface
+// ---------------------------------------------------------------------------------------------
+//
+CGSPluginInterface* COmaDsAppUiPluginInterface::NewL()
+    {
+	COmaDsAppUiPluginInterface* self = new(ELeave) COmaDsAppUiPluginInterface();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+	CleanupStack::Pop(self);
+	return (CGSPluginInterface*) self;
+	}
+
+// ---------------------------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::Id()
+// returns the view id
+// ---------------------------------------------------------------------------------------------
+//
+TUid COmaDsAppUiPluginInterface::Id() const
+	{
+	return TUid::Uid( KUidNsmlDSGSPluginDll );	
+	}
+
+// ---------------------------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::ConstructL
+// ---------------------------------------------------------------------------------------------
+//	
+void COmaDsAppUiPluginInterface::ConstructL()
+	{
+	BaseConstructL(); 
+	
+    env = CEikonEnv::Static();
+
+	TFileName fileName(KNsmlDsResFileName);
+	
+	BaflUtils::NearestLanguageFile(env->FsSession(), fileName);
+
+	iResId = env->AddResourceFileL(fileName);
+	}
+
+
+// ---------------------------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::COmaDsAppUiPluginInterface
+// ---------------------------------------------------------------------------------------------
+//    
+COmaDsAppUiPluginInterface::COmaDsAppUiPluginInterface() : iNullService( NULL )
+	{
+	// Nothing
+	}
+
+// ---------------------------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::~COmaDsAppUiPluginInterface
+// ---------------------------------------------------------------------------------------------
+//
+COmaDsAppUiPluginInterface::~COmaDsAppUiPluginInterface()
+	{
+	if (iResId)
+		{
+    	env->DeleteResourceFile(iResId);
+		}	
+	if ( iNullService )
+        {
+            delete iNullService;
+            iNullService = NULL;
+        }
+	}
+
+// ---------------------------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::GetCaptionL
+// returns the caption to be shown in GS view
+// ---------------------------------------------------------------------------------------------
+//
+void COmaDsAppUiPluginInterface::GetCaptionL( TDes& aCaption ) const
+    {
+    StringLoader::Load( aCaption, R_DS_GS_TITLE);
+    }
+
+// ---------------------------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::CreateIconL
+// returns the icon to be shown in GS view
+// ---------------------------------------------------------------------------------------------
+//
+CGulIcon* COmaDsAppUiPluginInterface::CreateIconL( const TUid /*aIconType*/ )
+	{
+	CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* mask = NULL;                                               
+ 
+    MAknsSkinInstance* instance = AknsUtils::SkinInstance();    
+    AknsUtils::CreateIconL(instance, KAknsIIDQgnPropCpConnDatasync, bitmap, mask,
+    					KNsmlDsIconFileName,
+    					EMbmNsmldssyncQgn_prop_cp_conn_datasync,
+    					EMbmNsmldssyncQgn_prop_cp_conn_datasync_mask);
+
+    CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
+    icon->SetBitmapsOwnedExternally( EFalse );
+    bitmap = NULL;
+    mask = NULL;      
+    return icon;    
+	}
+	
+// -----------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::HandleSelection()
+// -----------------------------------------------------------------------------
+//
+void COmaDsAppUiPluginInterface::HandleSelection(
+    	const TGSSelectionTypes /*aSelectionType*/ )
+	{
+		TRAP_IGNORE(LaunchDsAppL());
+	}
+    
+// ---------------------------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::LaunchDsAppL
+// ---------------------------------------------------------------------------------------------
+//
+void COmaDsAppUiPluginInterface::LaunchDsAppL()
+	{
+	TUid KAppUid( TUid::Uid( KDsAppUid ) );
+
+	RWsSession ws;
+    User::LeaveIfError( ws.Connect() );
+    CleanupClosePushL( ws );
+    
+	TApaTaskList taskList( ws );
+    TApaTask task = taskList.FindApp( KAppUid );
+
+    if ( task.Exists() )
+   		{
+    	task.BringToForeground();
+    	}
+    else
+    	{
+        // Launch application as embedded.
+        if ( iNullService )
+        	{
+            delete iNullService;
+            iNullService = NULL;
+        	}
+        iNullService = CAknNullService::NewL( KAppUid, this );
+    	}
+    
+	CleanupStack::PopAndDestroy();
+  	}
+	
+// ---------------------------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::DoActivateL
+// ---------------------------------------------------------------------------------------------
+//
+void COmaDsAppUiPluginInterface::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
+											 TUid /*aCustomMessageId*/,
+											 const TDesC8& /*aCustomMessage*/)
+	{
+	// Nothing
+	}
+
+
+// -----------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::PluginProviderCategory
+// -----------------------------------------------------------------------------
+//
+TInt COmaDsAppUiPluginInterface::PluginProviderCategory() const
+	{
+    return KGSPluginProviderInternal;
+	}
+
+// -----------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::ItemType()
+// -----------------------------------------------------------------------------
+//
+TGSListboxItemTypes COmaDsAppUiPluginInterface::ItemType()
+	{
+    return EGSItemTypeSettingDialog;
+	}
+
+// ---------------------------------------------------------------------------------------------
+// COmaDsAppUiPluginInterface::DoDeactivate
+// ---------------------------------------------------------------------------------------------
+//	
+void COmaDsAppUiPluginInterface::DoDeactivate()
+	{
+	// Nothing
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/OmaDsAppUiPlugin/src/OmaDsAppUiPluginProxy.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* 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:  Nsml DS settings Ecom plugin Impln.
+*
+*/
+
+
+#include <e32std.h>
+#include <implementationproxy.h>
+#include "OmaDsAppUiPluginInterface.h"
+
+
+
+// Constants
+const TImplementationProxy KOmaDsViewImplementationTable[] = 
+	{
+    IMPLEMENTATION_PROXY_ENTRY( KUidNsmlDSGSPluginImpl,	COmaDsAppUiPluginInterface::NewL ) // used by GS plugin
+	};
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(  TInt& aTableCount )
+	{
+	aTableCount = sizeof( KOmaDsViewImplementationTable ) 
+                / sizeof( TImplementationProxy );
+	return KOmaDsViewImplementationTable;
+	}
+// End of File
Binary file omads/omadsappui/cenrep/keys_omadsui.xls has changed
Binary file omads/omadsappui/conf/omadsui.confml has changed
Binary file omads/omadsappui/conf/omadsui_101F9A1D.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* 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:  Provides information for building omadsappui.
+*
+*/
+
+
+#include <platform_paths.hrh>
+//
+// Platforms
+//
+PRJ_PLATFORMS
+DEFAULT
+
+
+//
+// OmaDSAppUi exports
+//
+PRJ_EXPORTS
+
+../conf/omadsui.confml				APP_LAYER_CONFML(omadsui.confml)
+../conf/omadsui_101F9A1D.crml		APP_LAYER_CRML(omadsui_101F9A1D.crml)
+
+
+../rom/AspSyncProvider.iby	CORE_APP_LAYER_IBY_EXPORT_PATH(AspSyncProvider.iby)
+../rom/AspSyncUtil.iby		CORE_APP_LAYER_IBY_EXPORT_PATH(AspSyncUtil.iby)
+../rom/OmaDsAppUi.iby		CORE_APP_LAYER_IBY_EXPORT_PATH(OmaDsAppUi.iby)
+
+../rom/AspSyncProvider_Resources.iby	LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(AspSyncProvider_Resources.iby)
+../rom/AspSyncUtil_Resources.iby		LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(AspSyncUtil_Resources.iby)
+../rom/OmaDsAppUiResources.iby			LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(OmaDsAppUiResources.iby)
+
+//
+// OmaDSAppUi components
+//
+PRJ_MMPFILES
+
+#include "../AspSyncUtil/group/bld.inf"
+#include "../ui/group/bld.inf"
+#include "../AspPreSyncPlugin/group/bld.inf"
+
+#ifdef __SYNCML_DS_AIW_PROVIDER
+#include  "../AiwSyncProvider/group/bld.inf"
+#endif // __SYNCML_DS_AIW_PROVIDER
+
+#include  "../AspScheduleHandler/group/bld.inf"
+
+//  Help exports
+#include "../help/group/bld.inf"
+
+//#ifdef RD_DSUI_CP_INTEGRATION
+#include  "../OmaDsAppUiPlugin/group/bld.inf"
+//#endif // RD_DSUI_CP_INTEGRATION
Binary file omads/omadsappui/help/data/xhtml.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/help/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -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:
+* Export help related files.
+*
+*/
+
+#include <platform_paths.hrh>				
+PRJ_EXPORTS
+:zip ../data/xhtml.zip   /epoc32/data/z/resource/ overwrite
+:zip ../data/xhtml.zip   /epoc32/winscw/c/resource/ overwrite
+
+../inc/ds.hlp.hrh	MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/ds.hlp.hrh)
+../rom/omadsappuihelps_variant.iby		CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(omadsappuihelps_variant.iby)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/help/inc/ds.hlp.hrh	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Declarations used for help text.
+*
+*/
+	
+//
+// ds.hlp.hrh generated by CSXHelp Utilities.
+//           
+
+#ifndef __DS_HLP_HRH__
+#define __DS_HLP_HRH__
+
+_LIT(KDS_HLP_MAIN_VIEW, "DS_HLP_MAIN_VIEW"); // 
+_LIT(KDS_HLP_SETTINGS, "DS_HLP_SETTINGS"); // 
+_LIT(KDS_HLP_SETTINGS_CAL, "DS_HLP_SETTINGS_CAL"); // 
+_LIT(KDS_HLP_SETTINGS_CNT, "DS_HLP_SETTINGS_CNT"); // 
+_LIT(KDS_HLP_SETTINGS_NOTES, "DS_HLP_SETTINGS_NOTES"); // 
+_LIT(KDS_HLP_SETTINGS_SMS, "DS_HLP_SETTINGS_SMS"); // 
+_LIT(KDS_HLP_SETTINGS_SYNCML, "DS_HLP_SETTINGS_SYNCML"); // 
+_LIT(KDS_HLP_SETTINGS_BOOKMARKS, "DS_HLP_SETTINGS_BOOKMARKS"); // 
+_LIT(KDS_HLP_AUTO_SYNC_SETTINGS, "DS_HLP_AUTO_SYNC_SETTINGS"); // 
+_LIT(KDS_HLP_SETTINGS_MMS, "DS_HLP_SETTINGS_MMS"); // 
+_LIT(KDS_HLP_PROFILE_SETTINGS, "DS_HLP_PROFILE_SETTINGS"); // 
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/help/rom/omadsappuihelps_variant.iby	Wed Sep 01 12:30:02 2010 +0100
@@ -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: This iby file is to include all the components
+* 						needed for help text to be displayed.
+*
+*/
+
+#ifndef __SYNCML_DSHELPS_VARIANT_IBY__
+#define __SYNCML_DSHELPS_VARIANT_IBY__
+
+#if defined(FF_S60_HELPS_IN_USE) && defined(__SYNCML_DS)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F6DE4\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x101F6DE4\contents.zip)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F6DE4\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101F6DE4\index.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F6DE4\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101F6DE4\keywords.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F6DE4\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101F6DE4\meta.xml)
+#endif
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/rom/AspSyncProvider.iby	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __ASPSYNCPROVIDER_IBY__
+#define __ASPSYNCPROVIDER_IBY__
+
+#ifdef __SYNCML_DS // nothing should be installed from this .iby file if __SYNCML_DS feature is not selected
+
+#ifdef __SYNCML_DS_AIW_PROVIDER
+
+//Resource file(s) for AspSyncProvider
+//data=DATAZ_\RESOURCE_FILES_DIR\AiwSyncProvider.RSC          RESOURCE_FILES_DIR\AiwSyncProvider.rsc
+
+
+ECOM_PLUGIN(AiwSyncProvider.dll,101F871F.RSC)
+
+
+#endif // __SYNCML_DS_AIW_PROVIDER
+
+#endif // __SYNCML_DS
+
+
+#endif //__ASPSYNCPROVIDER_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/rom/AspSyncProvider_Resources.iby	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ASPSYNCPROVIDER_RESOURCES_IBY__
+#define __ASPSYNCPROVIDER_RESOURCES_IBY__
+
+#ifdef __SYNCML_DS // nothing should be installed from this .iby file if __SYNCML_DS feature is not selected
+
+#ifdef __SYNCML_DS_AIW_PROVIDER
+
+//Resource file(s) for AspSyncProvider
+data=DATAZ_\RESOURCE_FILES_DIR\AiwSyncProvider.RSC          RESOURCE_FILES_DIR\AiwSyncProvider.rsc
+
+#endif // __SYNCML_DS_AIW_PROVIDER
+
+#endif // __SYNCML_DS
+
+
+#endif //__ASPSYNCPROVIDER_RESOURCES_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/rom/AspSyncUtil.iby	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ASPSYNCUTIL_IBY__
+#define __ASPSYNCUTIL_IBY__
+
+#ifdef __SYNCML_DS // nothing should be installed from this .iby file if __SYNCML_DS feature is not selected
+
+
+file=ABI_DIR\BUILD_DIR\AspSyncUtil.dll   		SHARED_LIB_DIR\AspSyncutil.dll
+//file=ABI_DIR\UDEB\AspSyncUtil.dll        		SHARED_LIB_DIR\AspSyncutil.dll
+//file=ABI_DIR\DEBUG_DIR\AspSyncUtil.dll   		SHARED_LIB_DIR\AspSyncutil.dll
+
+file=ABI_DIR\BUILD_DIR\aspschedulehandler.exe    PROGRAMS_DIR\aspschedulehandler.exe
+
+ECOM_PLUGIN(AspPreSyncDefault.dll,AspPreSyncDefault.rsc)
+
+//
+// Normal icons
+//
+data=DATAZ_\BITMAP_DIR\AspSyncUtil.MIF               BITMAP_DIR\AspSyncUtil.mif
+AUTO-BITMAP=DATAZ_\BITMAP_DIR\AspSyncUtil.mbm               BITMAP_DIR\AspSyncUtil.mbm
+
+//Resource file(s) for AspSyncUtil
+//data=DATAZ_\RESOURCE_FILES_DIR\AspSyncUtil.RSC          RESOURCE_FILES_DIR\AspSyncUtil.rsc
+
+
+#endif // __SYNCML_DS
+
+#endif //__ASPSYNCUTIL_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/rom/AspSyncUtil_Resources.iby	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __ASPSYNCUTIL_RESOURCES_IBY__
+#define __ASPSYNCUTIL_RESOURCES_IBY__
+
+#ifdef __SYNCML_DS // nothing should be installed from this .iby file if __SYNCML_DS feature is not selected
+
+//Resource file(s) for AspSyncUtil
+data=DATAZ_\RESOURCE_FILES_DIR\AspSyncUtil.RSC          RESOURCE_FILES_DIR\AspSyncUtil.rsc
+
+#endif // __SYNCML_DS
+
+#endif //__ASPSYNCUTIL_RESOURCES_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/rom/OmaDsAppUi.iby	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+REM OMA Data Synchronisation Application UI
+
+#include <bldvariant.hrh>
+
+#ifndef __OMADSAPPUI_IBY__
+#define __OMADSAPPUI_IBY__
+
+#ifdef __SYNCML_DS // nothing should be installed from this .iby file if __SYNCML_DS feature is not selected
+
+REM S60_APP_EXE_UDEB(NSmlDSSync)
+REM file=ABI_DIR\UDEB\NSmlDSSync.exe                   PROGRAMS_DIR\NSmlDSSync.exe
+S60_APP_EXE(NSmlDSSync)
+
+REM S60_APP_BITMAP(NSmlDSSync)
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,NSmlDSSync)
+S60_APP_AIF_ICONS(NSmlDSSync)
+S60_APP_AIF_RSC(NSmlDSSync)
+
+
+//#ifdef RD_DSUI_CP_INTEGRATION
+ECOM_PLUGIN(OmaDsAppUiPlugin.dll, OmaDsAppUiPlugin.rsc)
+//#endif
+
+#endif // __SYNCML_DS
+
+#endif //__OMADSAPPUI_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/rom/OmaDsAppUiResources.iby	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 OMA Data Synchronization Application UI IBY-file for localizable elements
+
+#ifndef __OMADSAPPUIRESOURCES_IBY__
+#define __OMADSAPPUIRESOURCES_IBY__
+
+#ifdef __SYNCML_DS
+
+S60_APP_RESOURCE(NSmlDSSync)
+S60_APP_CAPTION(NSmlDSSync)
+
+//#ifdef RD_DSUI_CP_INTEGRATION
+data=DATAZ_\RESOURCE_FILES_DIR\NsmlDSGSPluginResource.RSC            RESOURCE_FILES_DIR\NsmlDSGSPluginResource.RSC
+//#endif
+
+#endif
+
+#endif //__OMADSAPPUIRESOURCES_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/aif/NSmlDSSyncaif.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <aiftool.rh>
+
+RESOURCE AIF_DATA
+    {
+    app_uid=0x0995CDE9;
+    num_icons=2;
+    embeddability=KAppNotEmbeddable;
+    newfile=KAppDoesNotSupportNewFile;
+    }
+
+// End of File
Binary file omads/omadsappui/ui/aif/context_pane_icon.bmp has changed
Binary file omads/omadsappui/ui/aif/context_pane_icon_mask.bmp has changed
Binary file omads/omadsappui/ui/aif/list_icon.bmp has changed
Binary file omads/omadsappui/ui/aif/list_icon_mask.bmp has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/group/NSmlDSSync.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET      NSmlDSSync.exe
+TARGETTYPE  exe
+UID  0x100039CE 0x101F6DE4 
+
+EPOCSTACKSIZE 	0x5000
+
+VENDORID VID_DEFAULT
+
+CAPABILITY  CAP_APPLICATION
+
+SOURCEPATH ../src
+
+START RESOURCE ../src/NSmlDSSync.rss
+HEADER
+TARGETPATH APP_RESOURCE_DIR
+LANGUAGE_IDS
+END  // RESOURCE
+
+
+START RESOURCE ../src/NSmlDSSync_reg.rss
+DEPENDS nsmldssync.rsg
+// Do not change the UID below.
+TARGETPATH /private/10003a3f/apps
+END
+
+
+SOURCE  NSmlDSSyncApp.cpp 
+SOURCE  NSmlDSSyncAppUi.cpp
+SOURCE  NSmlDSSyncDocument.cpp
+SOURCE  NSmlDSSyncContainer.cpp
+//SOURCE  NSmlDSSyncAppServer.cpp
+
+USERINCLUDE . 
+USERINCLUDE ../inc
+
+// for AspSyncUtilApi.h
+USERINCLUDE     ../../../omadsappui/AspSyncUtil/inc
+
+// for nsmldssync.loc
+USERINCLUDE     ../../../omadsappui/AspSyncUtil/src
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY euser.lib apparc.lib cone.lib eikcore.lib 
+LIBRARY eikcoctl.lib avkon.lib
+LIBRARY bafl.lib
+LIBRARY	aknskins.lib
+LIBRARY aspsyncutil.lib
+LIBRARY apgrfx.lib
+
+LIBRARY     estor.lib
+//LIBRARY     syncservice.lib
+
+DEBUGLIBRARY flogger.lib
\ No newline at end of file
Binary file omads/omadsappui/ui/group/aiwtestapp.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE nsmldssync.mif
+  OPTION HEADERFILE nsmldssync.mbg
+  OPTION SOURCES -c8,8 qgn_prop_sml_http -c8,8 qgn_prop_sml_http_off -c8,8 qgn_prop_cp_conn_datasync
+END
+
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE nsmldssync_aif.mif
+  OPTION SOURCES -c8,8 qgn_menu_sml
+END
+
+PRJ_MMPFILES
+
+//gnumakefile omadsappui_icons_dc.mk
+/*
+#ifdef __SCALABLE_ICONS
+gnumakefile omadsappui_icons_aif_scalable_dc.mk
+#else
+gnumakefile omadsappui_icons_aif_bitmaps_dc.mk
+#endif
+*/
+
+
+./NSmlDSSync.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/group/omadsappui_icons.mk	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,74 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+#
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\SYSTEM\APPS\nsmldssync
+HEADERDIR=\epoc32\include
+ICONTARGETFILENAME=$(TARGETDIR)\nsmldssync.mif
+HEADERFILENAME=$(HEADERDIR)\nsmldssync.mbg
+
+
+do_nothing : 
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+#
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_prop_sml_http.bmp \
+	/c8,8 qgn_prop_sml_http_off.bmp \
+
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/group/omadsappui_icons_aif_bitmaps.mk	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+#
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\SYSTEM\APPS\nsmldssync
+ICONTARGETFILENAME=$(TARGETDIR)\nsmldssync.mbm
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+#
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_sml_lst.bmp \
+		/c8,8 qgn_menu_sml_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
+  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/group/omadsappui_icons_aif_bitmaps_dc.mk	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,70 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+#
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\nsmldssync_aif.mbm
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+#
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_sml_lst.bmp \
+		/c8,8 qgn_menu_sml_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
+
+ 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/group/omadsappui_icons_aif_scalable.mk	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+#
+# ----------------------------------------------------------------------------
+
+#TARGETDIR=$(ZDIR)\SYSTEM\APPS\nsmldssync
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\nsmldssync_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+#
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_sml.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
+  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/group/omadsappui_icons_aif_scalable_dc.mk	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,68 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+#
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+#TARGETDIR=$(ZDIR)\RESOURCE\APPS\LOCALISABLEFILES
+ICONTARGETFILENAME=$(TARGETDIR)\nsmldssync_aif.mif
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+#
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 qgn_menu_sml.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/group/omadsappui_icons_dc.mk	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,74 @@
+#
+# Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+#
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\nsmldssync.mif
+
+HEADERDIR=\epoc32\include
+HEADERFILENAME=$(HEADERDIR)\nsmldssync.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+#
+#
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	/c8,8 qgn_prop_sml_http.bmp \
+	/c8,8 qgn_prop_sml_http_off.bmp \
+	/c8,8 qgn_prop_cp_conn_datasync.bmp \
+
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/inc/NSmlDSSync.hrh	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* 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:  
+*
+*/
+
+
+#ifndef NSMLDSSYNC_HRH
+#define NSMLDSSYNC_HRH
+
+
+enum TSmlMenuCommands
+    {
+	ENSmlMenuTest1 = 1,
+        ENSmlMenuTest2 = 2
+    };
+
+
+enum TAIWTestAppCommandIds
+    {
+    EAIWTestAppCmdTest = 1,
+    EAIWTestAppCmdAiwPlaceholder = 10,
+    EAIWTestAppCmdExit = 2,
+    EAiwTestAppCmdLast = 11
+    };
+
+
+
+#endif      // NSMLDSSYNC_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/inc/NSmlDSSyncApp.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* 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: A sync ui application class 
+*
+*/
+
+
+
+#ifndef NSMLDSSYNC_APP_H
+#define NSMLDSSYNC_APP_H
+
+// INCLUDES
+#include <aknapp.h>
+#include <eikapp.h>
+
+// CONSTANTS
+
+// UID of the application
+const TUid KUidSmlSyncApp = { 0x101F6DE4 };
+
+
+// CLASS DECLARATION
+
+
+/**
+* Class CNSmlDSSyncApp.
+* 
+*/
+class CNSmlDSSyncApp : public CAknApplication
+    {
+    
+    private:
+
+        /**
+        * From CApaApplication, creates application document object.
+        * @param None.
+        * @return A pointer to the created document object.
+        */
+        CApaDocument* CreateDocumentL();
+        
+        /**
+        * From CApaApplication, returns application's UID.
+        * @param None.
+        * @return App uid.
+        */
+        TUid AppDllUid() const;
+    };
+
+
+#endif  // NSMLDSSYNC_APP_H
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/inc/NSmlDSSyncAppServer.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* 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: server derivation
+*
+*/
+
+
+#ifndef NSMLDSSYNCAPPSERVER_H
+#define NSMLDSSYNCAPPSERVER_H
+
+// INCLUDES
+
+#include <akndoc.h>
+#include <aknapp.h>
+#include <AknServerApp.h>
+
+
+// CLASS DECLARATION
+
+/**
+* Data synchronization Aplication Server
+*
+*/
+class CNSmlDSSyncAppServer :  public CAknAppServer
+	{
+	public:
+
+        /**
+        * C++ default constructor.
+        */
+		CNSmlDSSyncAppServer();
+        
+        /**
+        * Destructor.
+        */		
+		virtual ~CNSmlDSSyncAppServer();
+		
+    public: //from CAknServerApp
+    
+        /**
+        * CreateServiceL.
+        * @param aServiceType
+        * @return CApaAppServiceBase.
+        */
+        CApaAppServiceBase* CreateServiceL( TUid aServiceType ) const;
+        
+        /**
+        * From the base class.
+        * @param None.
+        * @return None.
+        */
+        void HandleAllClientsClosed();
+	};
+
+#endif  // NSMLDSSYNCAPPSERVER_H
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/inc/NSmlDSSyncAppUi.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,96 @@
+/*
+* 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: Datasync app UI
+*
+*/
+
+
+
+#ifndef NSMLDSSYNC_APPUI_H
+#define NSMLDSSYNC_APPUI_H
+
+// INCLUDES
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <e32std.h>
+#include <coeccntx.h>
+#include <aknappui.h>
+
+
+// FORWARD DECLARATIONS
+class CNSmlDSSyncContainer;
+
+
+
+// CLASS DECLARATION
+
+/**
+*  Class CNSmlDSSyncAppUi.
+*/
+class CNSmlDSSyncAppUi : public CAknAppUi
+    {
+    public: 
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */      
+        ~CNSmlDSSyncAppUi();
+//#ifdef RD_DSUI_CP_INTEGRATION        
+        static TInt OpenDialog( TAny* aThis) ;
+//#endif
+    private:
+ 
+		/**
+        * From the base class.
+		* Called by framework before menu is shown.
+        * @param aResourceId Menu resource id.
+		* @param aMenuPane Pointer to the menu.
+        * @return None.
+        */
+        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+
+    private:
+        /**
+        * From CEikAppUi, takes care of command handling.
+        * @param aCommand command to be handled
+        * @return None.
+        */
+        void HandleCommandL(TInt aCommand);
+
+        /**
+        * From CEikAppUi, handles key events.
+        * @param aKeyEvent Event to handled.
+        * @param aType Type of the key event. 
+        * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). 
+        */
+        virtual TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+
+    private:
+        // container 
+//#ifdef RD_DSUI_CP_INTEGRATION      
+        CIdle *iIdle;
+//#endif
+        CNSmlDSSyncContainer* iAppContainer; 
+    };
+
+
+#endif  // NSMLDSSYNC_APPUI_H
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/inc/NSmlDSSyncContainer.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,100 @@
+/*
+* 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: Datasync app view container
+*
+*/
+
+
+#ifndef NSMLDSSYNC_CONTAINER_H
+#define NSMLDSSYNC_CONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+
+
+// CLASS DECLARATION
+
+
+/**
+*  Class CNSmlDSSyncContainer.
+*  
+*/
+class CNSmlDSSyncContainer : public CCoeControl, MCoeControlObserver
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL(const TRect& aRect);
+
+        /**
+        * Destructor.
+        */
+        ~CNSmlDSSyncContainer();
+        
+    private: // Functions from base classes
+
+       /**
+        * From CoeControl,SizeChanged.
+		* @param None. 
+    	* @return None.
+        */
+        void SizeChanged();
+
+       /**
+        * From CoeControl,CountComponentControls.
+		* @param None. 
+    	* @return Component count.
+        */
+        TInt CountComponentControls() const;
+
+       /**
+        * From CCoeControl,ComponentControl.
+		* @param aIndex. 
+    	* @return CCoeControl.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+       /**
+        * From CCoeControl,Draw.
+		* @param aEventType	The type of control event 
+    	* @return None
+        */
+        void Draw(const TRect& aRect) const;
+       	
+		/**
+		* From MCoeControlObserver
+		* Acts upon changes in the hosted control's state. 
+		* @param aControl The control changing its state
+		* @param aEventType	The type of control event 
+    	* @return None
+		*/
+        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
+        
+		/**
+		* From base class.
+		* Called when UI layout changes. 
+		* @param aType.
+    	* @return None.
+		*/
+        void HandleResourceChange(TInt aType);
+    };
+
+
+#endif  // NSMLDSSYNC_CONTAINER_H
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/inc/NSmlDSSyncDocument.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* 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: Datasync app document 
+*
+*/
+
+
+
+#ifndef NSMLDSSYNC_DOCUMENT_H
+#define NSMLDSSYNC_DOCUMENT_H
+
+
+
+// INCLUDES
+#include <AknDoc.h>
+#include "AspSyncUtilApi.h"
+#include <eikenv.h>
+
+
+// FORWARD DECLARATIONS
+class  CEikAppUi;
+
+
+// CLASS DECLARATION
+
+
+/**
+* CNSmlDSSyncDocument class.
+*/
+class CNSmlDSSyncDocument : public CAknDocument
+    {
+    public:
+    
+        /**
+        * Two-phased constructor.
+        */
+        static CNSmlDSSyncDocument* NewL(CEikApplication& aApp);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CNSmlDSSyncDocument();
+        
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CNSmlDSSyncDocument(CEikApplication& aApp);
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+    public:
+
+        /**
+        * Returns application model.
+        * @param None
+		* @return Application model.
+        */
+        CSyncUtilApi* Model();
+
+    private:
+
+        /**
+        * From CEikDocument, create CAIWTestAppAppUi "App UI" object.
+        * @param None.
+		* @return App ui object.
+        */
+        CEikAppUi* CreateAppUiL();
+        
+        /**
+        * Panics application.
+        * @param aReason.
+		* @return None.
+        */
+        void Panic(TInt aReason);
+   
+    private:
+    
+        // CSyncUtilApi handles synchronize operations. 
+		CSyncUtilApi* iSyncUtilApi;
+		
+		// Eikon environment
+		CEikonEnv*                          iEikEnv;
+		
+    };
+
+#endif  // NSMLDSSYNC_DOCUMENT_H
+
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/src/NSmlDSSync.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    SYNC // 4 letter ID
+
+
+//  INCLUDES
+
+#include "NSmlDSSync.hrh"
+#include<nsmldssync.loc>
+
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <avkon.loc>
+
+
+//
+// AIF icons/files
+//
+#include <appinfo.rh>
+#include <data_caging_paths_strings.hrh>
+
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf = "NSmlDSSync"; }
+
+RESOURCE EIK_APP_INFO
+	{
+    menubar=r_smlsync_menubar;
+	status_pane=r_smlsync_status_pane;
+    hotkeys=r_smlsync_hotkeys;
+    cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
+	}
+
+
+//
+// AIF icons/files
+//
+RESOURCE LOCALISABLE_APP_INFO r_nsmldssync_localisable_app_info
+    {
+    short_caption = qtn_apps_sml_grid;
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+        caption = qtn_apps_sml_list;
+
+#ifdef __SCALABLE_ICONS
+        number_of_icons = 1;
+        icon_file = APP_BITMAP_DIR"\\NSmlDSSync_aif.mif";
+#else
+        number_of_icons = 2;
+        icon_file = APP_BITMAP_DIR"\\NSmlDSSync_aif.mbm";
+#endif
+
+        };
+    }
+
+
+
+//------------------------------------------------------------------------------
+// r_smlsync_hotkeys.
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE HOTKEYS r_smlsync_hotkeys
+	{
+    control=
+		{
+        HOTKEY { command=EAknCmdExit; key='e'; }
+		};
+	}
+
+
+//------------------------------------------------------------------------------
+// r_smlsync_menubar.
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_smlsync_menubar
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_smlsync_mainmenu; txt=""; }
+        };
+    }
+
+
+//------------------------------------------------------------------------------
+// r_smlsync_status_pane.
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE STATUS_PANE_APP_MODEL r_smlsync_status_pane
+	{
+	panes=
+		{
+		SPANE_PANE
+			{	
+			id = EEikStatusPaneUidTitle;
+			type = EAknCtTitlePane;
+			resource = r_overridden_smlsync;
+			}
+		};
+	}
+
+
+//------------------------------------------------------------------------------
+// r_overridden_smlsync.
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_overridden_smlsync
+	{
+	txt = qtn_apps_syncml_title;
+	}	
+
+
+//------------------------------------------------------------------------------
+// r_smlsync_mainmenu.
+//
+//------------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_smlsync_mainmenu	
+	{
+	items =
+		{
+        MENU_ITEM { command=EEikCmdExit; txt=qtn_options_exit; }
+		};
+	}
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/src/NSmlDSSyncApp.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "NSmlDSSyncApp.h"
+#include    "NSmlDSSyncDocument.h"
+#include    "AspDebug.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncApp::AppDllUid
+//
+// Returns application UID.
+// -----------------------------------------------------------------------------
+//
+TUid CNSmlDSSyncApp::AppDllUid() const
+    {
+    FLOG( _L("CNSmlDSSyncApp::AppDllUid") );
+    
+    return KUidSmlSyncApp;
+    }
+
+   
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncApp::CreateDocumentL
+//
+// Creates CAIWTestAppDocument object.
+// -----------------------------------------------------------------------------
+//
+CApaDocument* CNSmlDSSyncApp::CreateDocumentL()
+    {
+    FLOG( _L("CNSmlDSSyncApp::CreateDocumentL") );
+    
+    return CNSmlDSSyncDocument::NewL( *this );
+    }
+
+
+
+
+// ======================== OTHER EXPORTED FUNCTIONS ===========================
+
+
+
+#include <eikstart.h>
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CNSmlDSSyncApp;
+    }
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
+
+
+
+
+// End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/src/NSmlDSSyncAppServer.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "NSmlDSSyncAppServer.h"
+#include    "aspdebug.h"
+
+#include    <SyncServiceSession.h>
+#include    <syncserviceconst.h>
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// ------------------------------------------------------------------------------
+// CNSmlDMSyncAppServer::CNSmlDMSyncAppServer
+//
+// ------------------------------------------------------------------------------
+//
+CNSmlDSSyncAppServer::CNSmlDSSyncAppServer()   
+	{
+	FLOG( _L("CNSmlDSSyncAppServer::CNSmlDSSyncAppServer") );	
+	}
+
+
+// ------------------------------------------------------------------------------
+// CNSmlDMSyncAppServer::~CNSmlDMSyncAppServer
+//
+// ------------------------------------------------------------------------------
+//        
+CNSmlDSSyncAppServer::~CNSmlDSSyncAppServer()
+	{
+    FLOG( _L("CNSmlDSSyncAppServer::~CNSmlDSSyncAppServer") );
+	}
+
+
+// ------------------------------------------------------------------------------
+// CNSmlDMSyncAppServer::CreateServiceL
+//
+// ------------------------------------------------------------------------------
+//
+CApaAppServiceBase* CNSmlDSSyncAppServer::CreateServiceL( TUid aServiceType ) const
+	{	
+	FLOG( _L("CNSmlDSSyncAppServer::CreateServiceL") );
+	
+	if (aServiceType == TUid::Uid(KSyncServiceUid))   
+		{
+		return new (ELeave) CSyncServiceSession;
+		}
+	else
+		{
+		return CAknAppServer::CreateServiceL(aServiceType);
+		}
+	}
+
+
+// ------------------------------------------------------------------------------
+// CNSmlDMSyncAppServer::CreateServiceL
+//
+// ------------------------------------------------------------------------------
+//
+void CNSmlDSSyncAppServer::HandleAllClientsClosed()
+    {
+   	FLOG( _L("CNSmlDMSyncAppServer::HandleAllClientsClosed") );
+        
+    // NOTE: HandleAllClientsClosed needs overriding to avoid RunAppShutter
+    }
+
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/src/NSmlDSSyncAppUi.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,213 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "NSmlDSSyncAppUi.h"
+#include "NSmlDSSyncContainer.h" 
+#include "NSmlDSSyncDocument.h"
+
+#include <NSmlDSSync.rsg>
+#include "NSmlDSSync.hrh"
+#include "AspDebug.h"
+
+#include <eikmenup.h> 
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+//#ifdef RD_DSUI_CP_INTEGRATION
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncAppUi::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CNSmlDSSyncAppUi::ConstructL()
+    {
+    FLOG( _L("CNSmlDSSyncAppUi::ConstructL START") );
+    
+    const TInt KBufSize128 = 128;
+    const TInt KModeDialogNoWait = 4;
+    
+    BaseConstructL(EAknEnableSkin | EAknDisableHighlightAnimation | EAknEnableMSK | EAknSingleClickCompatible);
+
+	TBool flag = CEikonEnv::Static()->StartedAsServerApp() ;
+	if (flag)
+		{
+		TRAP_IGNORE(iIdle = CIdle::NewL( CActive::EPriorityHigh ));
+	
+    	if ( !iIdle->IsActive() ) 
+    		{
+       		iIdle->Start( TCallBack( OpenDialog, this ) );
+    		}
+		}
+	else
+		{
+		iAppContainer = new (ELeave) CNSmlDSSyncContainer;
+	    iAppContainer->SetMopParent(this);
+	    iAppContainer->ConstructL(ClientRect());
+	    AddToStackL(iAppContainer);
+
+	    TBuf<KBufSize128> buf;
+	    CNSmlDSSyncDocument* document= STATIC_CAST(CNSmlDSSyncDocument*, Document());
+	    TRAPD(err, document->Model()->ShowSettingsL(0, KModeDialogNoWait, buf));
+	    if(err != KErrNone)
+	        {
+            iAvkonAppUi->Exit();
+	        }
+		}
+
+    FLOG( _L("CNSmlDSSyncAppUi::ConstructL END") );
+    }
+    
+// ==========================================================================
+// METHOD:  OpenDialog
+//
+// DESIGN:  CIdle Callback function
+// ==========================================================================
+TInt CNSmlDSSyncAppUi::OpenDialog( TAny* /*aThis*/ )
+{
+    const TInt KBufSize128 = 128;
+         
+	// Launch the settings dialog
+ 	TBuf<KBufSize128> buf;
+    CSyncUtilApi* utilApi = CSyncUtilApi::NewL();
+	CleanupStack::PushL( utilApi );
+
+	TRAP_IGNORE( utilApi->ShowSettingsL( 0, 0, buf ) );
+
+	CleanupStack::PopAndDestroy( utilApi );
+
+	// We're done; exit
+	iAvkonAppUi->Exit();
+	
+	return KErrNone;
+} 
+
+//#else
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncAppUi::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+/*void CNSmlDSSyncAppUi::ConstructL()
+    {
+    FLOG( _L("CNSmlDSSyncAppUi::ConstructL START") );
+    
+    const TInt KBufSize128 = 128;
+    const TInt KModeDialogNoWait = 4;
+    
+    BaseConstructL(EAknEnableSkin | EAknDisableHighlightAnimation | EAknEnableMSK);
+
+    iAppContainer = new (ELeave) CNSmlDSSyncContainer;
+    iAppContainer->SetMopParent(this);
+    iAppContainer->ConstructL(ClientRect());
+    AddToStackL(iAppContainer);
+
+    TBuf<KBufSize128> buf;
+    CNSmlDSSyncDocument* document= STATIC_CAST(CNSmlDSSyncDocument*, Document());
+    document->Model()->ShowSettingsL(0, KModeDialogNoWait, buf);
+    
+    FLOG( _L("CNSmlDSSyncAppUi::ConstructL END") );
+    }*/
+
+//#endif
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncAppUi::~CNSmlDSSyncAppUi
+//
+// -----------------------------------------------------------------------------
+//
+CNSmlDSSyncAppUi::~CNSmlDSSyncAppUi()
+    {
+    FLOG( _L("CNSmlDSSyncAppUi::~CNSmlDSSyncAppUi START") );
+//#ifdef RD_DSUI_CP_INTEGRATION    
+	if ( iIdle )
+    	{
+    	delete iIdle;
+     	iIdle = NULL;
+    	}
+//#endif    	
+    if (iAppContainer)
+        {
+        RemoveFromStack( iAppContainer );
+        delete iAppContainer;
+        }
+        
+    FLOG( _L("CNSmlDSSyncAppUi::~CNSmlDSSyncAppUi END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncAppUi::DynInitMenuPaneL
+//
+// -----------------------------------------------------------------------------
+//
+void CNSmlDSSyncAppUi::DynInitMenuPaneL(TInt /*aResourceId*/, CEikMenuPane* /*aMenuPane*/)
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncAppUi::HandleKeyEventL
+//
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CNSmlDSSyncAppUi::HandleKeyEventL(const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
+    {
+    return EKeyWasNotConsumed;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncAppUi::HandleCommandL
+//
+// -----------------------------------------------------------------------------
+//
+void CNSmlDSSyncAppUi::HandleCommandL(TInt aCommand)
+    {
+    FLOG( _L("CNSmlDSSyncAppUi::HandleCommandL START") );
+    
+    switch (aCommand)
+        {
+		case EAknCmdExit:
+        case EEikCmdExit:
+        case EAknSoftkeyBack:
+			{
+     		FLOG( _L("before Exit") );
+     		
+     		Exit();
+     		
+     		FLOG( _L("after Exit") );
+			break;			
+			}
+
+        default:
+			{
+            break;      
+			}
+        }
+        
+    FLOG( _L("CNSmlDSSyncAppUi::HandleCommandL END") );
+	}
+
+
+
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/src/NSmlDSSyncContainer.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "NSmlDSSyncContainer.h"
+
+#include <AknUtils.h>
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncContainer::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CNSmlDSSyncContainer::ConstructL(const TRect& aRect)
+    {
+    CreateWindowL();
+    SetRect(aRect);
+    ActivateL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncContainer::~CNSmlDSSyncContainer
+//
+// -----------------------------------------------------------------------------
+//
+CNSmlDSSyncContainer::~CNSmlDSSyncContainer()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncContainer::SizeChanged
+//
+// Called by framework when the view size is changed.
+// -----------------------------------------------------------------------------
+//
+void CNSmlDSSyncContainer::SizeChanged()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncContainer::CountComponentControls
+//
+// Returns number of controls inside this container.
+// -----------------------------------------------------------------------------
+//
+TInt CNSmlDSSyncContainer::CountComponentControls() const
+    {
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncContainer::ComponentControl
+//
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CNSmlDSSyncContainer::ComponentControl(TInt /*aIndex*/) const
+    {
+    return NULL;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncContainer::Draw
+//
+// -----------------------------------------------------------------------------
+//
+void CNSmlDSSyncContainer::Draw(const TRect& aRect) const
+    {
+    CWindowGc& gc = SystemGc();
+    gc.SetPenStyle(CGraphicsContext::ENullPen);
+    gc.SetBrushColor(KRgbGray);
+    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
+    gc.DrawRect(aRect);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncContainer::HandleControlEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CNSmlDSSyncContainer::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncContainer::HandleResourceChange
+//
+// -----------------------------------------------------------------------------
+//
+void CNSmlDSSyncContainer::HandleResourceChange(TInt aType)
+    {
+    if (aType == KEikDynamicLayoutVariantSwitch) //Handle change in layout orientation
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+		DrawNow();
+		return;
+		}
+
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/src/NSmlDSSyncDocument.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2002-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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "NSmlDSSyncDocument.h"
+#include "NSmlDSSyncAppUi.h"
+#include "AspDebug.h"
+
+
+//const TUid KUidAppSync       = { 0x101F6DE4 };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncDocument::Constructor
+//
+// -----------------------------------------------------------------------------
+//
+CNSmlDSSyncDocument::CNSmlDSSyncDocument(CEikApplication& aApp)
+: CAknDocument(aApp)    
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncDocument::~CNSmlDSSyncDocument
+//
+// -----------------------------------------------------------------------------
+//
+CNSmlDSSyncDocument::~CNSmlDSSyncDocument()
+    {
+    FLOG( _L("CNSmlDSSyncDocument::~CNSmlDSSyncDocument START") );
+    
+    delete iSyncUtilApi;
+    
+    FLOG( _L("CNSmlDSSyncDocument::~CNSmlDSSyncDocument END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncDocument::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CNSmlDSSyncDocument::ConstructL()
+    {
+    FLOG( _L("CNSmlDSSyncDocument::ConstructL START") );
+    
+    iSyncUtilApi = CSyncUtilApi::NewL();
+    
+    iEikEnv = CEikonEnv::Static();
+    
+    FLOG( _L("CNSmlDSSyncDocument::ConstructL END") );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncDocument::NewL
+//
+// -----------------------------------------------------------------------------
+//
+CNSmlDSSyncDocument* CNSmlDSSyncDocument::NewL(CEikApplication& aApp)
+    {
+    FLOG( _L("CNSmlDSSyncDocument::NewL START") );
+    
+    CNSmlDSSyncDocument* self = new (ELeave) CNSmlDSSyncDocument( aApp );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    FLOG( _L("CNSmlDSSyncDocument::NewL END") );
+    
+    return self;
+    }
+
+    
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncDocument::CreateAppUiL
+//
+// -----------------------------------------------------------------------------
+//
+CEikAppUi* CNSmlDSSyncDocument::CreateAppUiL()
+    {
+    return new (ELeave) CNSmlDSSyncAppUi;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDSSyncDocument::Model
+//
+// -----------------------------------------------------------------------------
+//
+CSyncUtilApi* CNSmlDSSyncDocument::Model()
+    {
+    __ASSERT_ALWAYS(iSyncUtilApi, Panic(KErrGeneral));
+    
+    return iSyncUtilApi;
+    }
+
+
+// -------------------------------------------------------------------------------
+// CNSmlDSSyncDocument::Panic
+//
+// -------------------------------------------------------------------------------
+//
+void CNSmlDSSyncDocument::Panic(TInt aReason)
+    {
+	_LIT(KPanicCategory,"CNSmlDSSync");
+
+	User::Panic(KPanicCategory, aReason); 
+    }
+
+
+
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/src/NSmlDSSync_caption.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* 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:  Application titles
+*
+*/
+
+
+
+#include <apcaptionfile.rh>
+#include<NSmlDSSync.loc>
+
+RESOURCE CAPTION_DATA
+{
+caption = qtn_apps_sml_list;
+shortcaption = qtn_apps_sml_grid;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/src/NSmlDSSync_reg.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <appinfo.rh>
+#include <NSmlDSSync.rsg>
+#include <data_caging_paths_strings.hrh>
+
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x101F6DE4 // Define your application UID here
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "NSmlDSSync";
+    //num_icons=1;
+    //attributes = KAppBuiltAsDll;
+    //embeddability=KAppNotEmbeddable;
+    //newfile=KAppDoesNotSupportNewFile;
+
+    localisable_resource_file = APP_RESOURCE_DIR"\\NSmlDSSync";
+    localisable_resource_id   = R_NSMLDSSYNC_LOCALISABLE_APP_INFO;
+    }
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsappui/ui/src/NSmlDSSyncaif.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* 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:  RSS for creating the aif file for NSmlDSSyncApp.
+*
+*/
+
+
+#include <aiftool.rh>
+
+RESOURCE AIF_DATA
+{
+    app_uid=0x101F6DE4;
+    num_icons=1;
+    embeddability=KAppNotEmbeddable;
+    newfile=KAppDoesNotSupportNewFile;
+}
+
+// End of File
--- a/omads/omadsextensions/adapters/agenda/bld/nsmlagendadataprovider.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/agenda/bld/nsmlagendadataprovider.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -26,7 +26,7 @@
 CAPABILITY	CAP_ECOM_PLUGIN
 VENDORID	VID_DEFAULT
 
-#if defined(EABI)
+#if defined(ARMCC)
 DEFFILE		./def/eabinsmlagendadataprovider
 #elif defined(WINSCW)
 DEFFILE		./def/bwinscwnsmlagendadataprovider
@@ -57,14 +57,14 @@
 LANGUAGE_IDS
 END 
 
-START RESOURCE NSmlAgendaDataStore_1_2.rss
-HEADER
-TARGETPATH	RESOURCE_FILES_DIR
-LANGUAGE_IDS
-END 
-
+//RD_MULTICAL
+LIBRARY 	gdi.lib
+//RD_MULTICAL
 LIBRARY		ECom.lib euser.lib efsrv.lib estor.lib smlstoreformat.lib
 LIBRARY		nsmldebug.lib smldataprovider.lib nsmldatamod.lib
 LIBRARY		nsmlchangefinder.lib wbxmllib.lib bafl.lib sysutil.lib
-LIBRARY		CalInterimAPI.lib msgs.lib CalenImp.lib CalenInterimUtils2.lib
+LIBRARY		CalInterimAPI.lib msgs.lib CalenImp.lib CalenInterimUtils2.lib calencommonutils.lib
 LIBRARY 	versit.lib
+LIBRARY 	charconv.lib 
+LIBRARY 	flogger.lib
+LIBRARY 	centralrepository.lib
--- a/omads/omadsextensions/adapters/agenda/inc/nsmlagendadataprovider.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/agenda/inc/nsmlagendadataprovider.h	Wed Sep 01 12:30:02 2010 +0100
@@ -20,8 +20,8 @@
 #define __NSMLAGENDADATAPROVIDER_H__
 
 //  INCLUDES
+#include <SmlDataFormat.h>
 #include "nsmlagendadatastore.h"
-#include <SmlDataFormat.h>
 
 // CONSTANTS
 _LIT( KNSmlDSAgendaDataStoreRsc_1_1_2,"z:NSMLAGENDADATASTORE_1_1_2.RSC" );
@@ -133,21 +133,12 @@
         * By default Symbian 2nd phase constructor is private.
         */
 	    void ConstructL();
-	    
-        /**
-        * Returns data providers own supported features in a store format class.
-        */
-	    CSmlDataStoreFormat* DoOwnStoreFormatL();
 
     private:
         // Agenda data store
 	    CNSmlAgendaDataStore* iAgnDataStore;
-        // String ool
-	    RStringPool iStringPool;
         // Data store format
 	    CSmlDataStoreFormat* iDSFormat;
-        // A handle to a file server session
-	    RFs iSession;
 	    // Filter array
 	    RPointerArray<CSyncMLFilter> iFilterArray;
 	};
--- a/omads/omadsextensions/adapters/agenda/inc/nsmlagendadatastore.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/agenda/inc/nsmlagendadatastore.h	Wed Sep 01 12:30:02 2010 +0100
@@ -21,10 +21,6 @@
 
 
 //  INCLUDES
-#include "nsmlconstants.h"
-#include "nsmlchangefinder.h"
-#include "NSmlDataModBase.h"
-#include "nsmlagendadefines.hrh"
 #include <calentry.h>
 #include <calsession.h> 
 #include <caldataexchange.h> 
@@ -36,9 +32,13 @@
 #include <msvapi.h>
 #include <CalenImporter.h>
 #include <CalenExporter.h>
-#include <calinstanceview.h>
 #include <CalenInterimUtils2.h>
 #include <versittls.h>
+#include <nsmlagendaadapterhandler.h>
+#include "nsmlconstants.h"
+#include "nsmlchangefinder.h"
+#include "NSmlDataModBase.h"
+#include "nsmlagendadefines.hrh"
 
 // CONSTANTS
 const TInt KNSmlAgendaCompressLimit        = 20;
@@ -49,15 +49,36 @@
 const TInt KNSmlCompactAfterChanges        = 30;
 const TInt KNSmlDefaultStoreNameMaxSize    = 256;
 const TInt KNSmlItemDataExpandSize         = 1024;
+const TInt KDbPersonal                     = 100000;
+const TUid KRepositoryId                   = { 0x2000CF7E };   
+const TInt KNsmlDsOrphanEvent              = 0xB ;
+const TUint KNSmlAgendaAdapterUid    	   = 0x101F6DDD;
+const TUint KNSmlAgendaAdapterStreamUid    = 0x101F6DDD+0x10009d8d;
 _LIT( KNSmlDriveC, "C" );
-_LIT( KNSmlAgendaStoreNameForDefaultDB, "C:Calendar" );
-_LIT8( KNSmlMRUtilitiesEComPlugInUID,   "AgnEntryUi" );
+_LIT( KNSmlAgendaStoreNameForDefaultDB, "Calendar" );
+_LIT( KNSmlAgendaFileNameForDefaultDB, "c:calendar" );
 _LIT8( KNSmlVersitTokenRecurrenceID, 	"RECURRENCE-ID");
 _LIT8( KNSmlVersitTokenXRecurrenceID, 	"X-RECURRENCE-ID");
 _LIT8(KNSmlVersitTokenGeoID,"GEO");
 
+//RD_MULTICAL
+// MIME content type for folder item
+_LIT8( KNSmlContentTypeFolder, "application/vnd.omads-folder+xml" );
+// Email folder item type version
+_LIT8( KNSmlContentTypeFolderVersion, "1.2" );
+_LIT8( KNSmlDefaultOpaqueData, "Default" );
+
+const TInt KArrayGranularity    = 30;
+const TInt KBuffLength = 128;
 
 // DATA TYPES
+enum TNSmlDataMimeType
+    {
+    ENSmlNone = 0,
+    ENSmlCalendar,
+    ENSmlFolder
+    };
+//RD_MULTICAL
 enum TNSmlDataStoreStatus
 	{
 	ENSmlClosed = 0,
@@ -73,6 +94,8 @@
 	ENSmlICal,
 	ENSmlNotSet
 	};
+// FORWARD CLASS DECLARATIONS
+class CNSmlAgendaAdapterLog;
 
 // CLASS DECLARATIONS
 // ----------------------------------------------------------------------------
@@ -175,6 +198,20 @@
         */
 	    const TDesC& DoGetDefaultFileNameL() const;
 	    
+	    /**
+	    * Providing DataStore access to CNSmlDataProvider Class
+	    */
+	    CSmlDataStoreFormat* StoreFormatL();
+	    
+	    /**
+        * Check existance of CalFile with the given ProfileID associativity
+        */
+	    TBool IsCalFileAvailableL( TInt aProfileId, CDesCArray* aCalFileArr );
+	    
+	    /**
+        * Create CalFile with the attributes provided
+        */
+	    HBufC* CreateCalFileL( HBufC* aProfileName, TInt aProfileId );	    
     private:
 
         /**
@@ -474,12 +511,21 @@
 	    /**
 		* Completes an item operation started in DoCreateItemL().
 		*/
-	    void DoCommitCreateItemL();
+	    void DoCommitCreateCalItemL();
 	    
 	    /**
 		* Completes an item operation started in DoReplaceItemL().
 		*/
-	    void DoCommitReplaceItemL();
+	    void DoCommitReplaceCalItemL();
+	    /**
+       * Completes an Folder item operation started in DoCreateItemL().
+       */
+       void DoCommitCreateFolderItemL();
+       
+       /**
+       * Completes an Folder item operation started in DoReplaceItemL().
+       */
+       void DoCommitReplaceFolderItemL();
 	    
 	    /**
 		* Gets property from old item.
@@ -499,7 +545,51 @@
 		*/
 	    void SetPropertiesToDataL( HBufC8*& aValue,
 	                               const TDesC8& aProperty );
+	    
+		/**
+        * Method to determine the MIME type, provided the UID
+        */
+		void DataMimeType( TSmlDbItemUid aUid );
+		
+		/**
+        * Get All the AdapterHandler instance
+        */
+	    void ListAllAgendaPluginAdaptersL();
+	    
+	    /**
+        * Get the AdapterHandler instance
+        */
+	    void AgendaAdapterHandlerL();
+	    
+	    /**
+        * Retrieve the CalendarFile and associated entries ID
+        */
+	    void SynchronizableCalEntryIdsL( RArray<TCalLocalUid>& aUidArray );	    
+
+        /**
+        * Method to retrieve the Id of the Calendar Entry
+        */
+        void GetCalendarEntryIdL( TCalLocalUid& aParentId, TCalLocalUid& aCalId ) const;
         
+        /**
+        * Open the Store if present else create one to work upon
+        */
+        void OpenStoreL();
+        
+        /**
+        * Filters out the non-active items from the given array
+        */
+        CNSmlDataItemUidSet* ActiveItemsL( CNSmlDataItemUidSet& aUids ) const;
+        
+        /**
+        * Populate iCommittedUidArr from the Stream
+        */
+        void ExternalizeCommittedUidL() const;
+        
+        /**
+        * Write the contents of iCommittedUidArr to the Stream
+        */
+        void InternalizeCommittedUidL() const;
 
     private: // Data
         // Key
@@ -534,8 +624,10 @@
 	    TInt iServerMaxObjectSize;
         // Name of the opened database
 	    HBufC* iOpenedStoreName;
+	    // Name of the received storename
+	    HBufC* iReceivedStoreName;
         // Default name of the database
-	    HBufC* iDefaultStoreName;
+	    HBufC* iDefaultStoreFileName;
         // Opened database ID
 	    TInt64 iOpenedStoreId;
         // Item's ID that is to be added
@@ -556,26 +648,113 @@
 	    CNSmlDataItemUidSet* iReplacedUids;
         // Uids of moved items
 	    CNSmlDataItemUidSet* iMovedUids;
-        // Session to calendar server
+        /*// Session to calendar server
 	    CCalSession* iVCalSession;
         // Internal progress notifier
-	    CNSmlAgendaProgressview* iAgendaProgressview;
+	    CNSmlAgendaProgressview* iAgendaProgressview;*/
 	    // Interim Utility
 	    CCalenInterimUtils2* iInterimUtils;
 	    
-        // Importer
+        /*// Importer
 	    CCalenImporter* iImporter;
 	    // Exporter
 	    CCalenExporter* iExporter;
 	    
-	    //Instance View
-	    CCalInstanceView*   iInstanceView;
-	    
 	    // Entry view
         CCalEntryView* iEntryView;
-        CVersitTlsData *iVersitTlsData; // for better performance
+        CVersitTlsData *iVersitTlsData; // for better performance*/
+        // Flag is Hierarchical Sync is supported
+		TBool iIsHierarchicalSyncSupported;
+		// Mime Type of Calendar Item
+		TNSmlDataMimeType iDataMimeType;
+		// Parent Id of the Calendar Item
+		TInt iParentItemId;
+		// Offset value
+		TUint iCalOffsetVal;
+		// Offset memory values of the Calendar DB
+		CArrayFixFlat<TUint>* iCalOffsetArr;
+		// List of committed UIDs
+		CNSmlDataItemUidSet* iCommittedUidArr;
+		// Agenda Adapter Handler Instance
+		RPointerArray<CNSmlAgendaAdapterHandler>  iAgendaPluginAdapters;  
+		// Agenda Adapter Handler Instance
+        CNSmlAgendaAdapterHandler* iAgendaAdapterHandler;
+        // SyncRelationship instance
+        CNSmlAgendaAdapterLog* iAgendaAdapterLog;
+        // Flag indicating a Orphan Event
+        TBool iOrphanEvent;
 	};
 
+// ----------------------------------------------------------------------------
+// CNSmlAgendaDataStoreUtil provides services to cope with maintaining calendar 
+// API's used for database access
+// @lib nsmlagendadataprovider.dll
+// ----------------------------------------------------------------------------
+NONSHARABLE_CLASS(CNSmlAgendaDataStoreUtil) : public CBase
+    {
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CNSmlAgendaDataStoreUtil* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CNSmlAgendaDataStoreUtil();
+      
+    private:
+        /**
+        * C++ default constructor.
+        */
+        CNSmlAgendaDataStoreUtil();
+        
+    public: // New Functions
+        /**
+        * Initialize Calendar APIs for database access using the provided name and id
+        */
+        void InitializeCalAPIsL( HBufC* aFileName, TSmlDbItemUid aUid = NULL );
+       
+    
+    public: // Data
+        CCalSession* iCalSession;
+        CCalenExporter* iExporter;
+        CCalenImporter* iImporter;
+        CNSmlAgendaProgressview* iProgressView;
+        CCalEntryView* iEntryView;
+        CCalEntry* iEntry;
+        HBufC8* iFileName;
+        TSmlDbItemUid iUid;
+    };
+
+// ----------------------------------------------------------------------------
+// CNSmlAgendaAdapterLog provides services know active Sync 
+// API's used for database access
+// @lib nsmlagendadataprovider.dll
+// ----------------------------------------------------------------------------
+NONSHARABLE_CLASS(CNSmlAgendaAdapterLog) : public CBase
+    {
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CNSmlAgendaAdapterLog* NewL( MSmlSyncRelationship& aSyncRelationship );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CNSmlAgendaAdapterLog();
+      
+    private:
+        /**
+        * C++ default constructor.
+        */
+        CNSmlAgendaAdapterLog( MSmlSyncRelationship& aSyncRelationship );
+    
+    public: // Data
+        MSmlSyncRelationship& iSyncRelationship;
+        
+    };
 #endif // __NSMLAGENDADATASTORE_H__
             
 // End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/inc/nsmlagendadebug.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* 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: Debug macros definition and constant declaration 
+*
+*/
+
+
+
+#ifndef NSMLDSAGENDASYNC__DEBUG_H
+#define NSMLDSAGENDASYNC__DEBUG_H
+
+#include <e32svr.h>
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT(KLogFile,"Agenda.txt");
+_LIT(KLogDirFullName,"c:\\logs\\");
+_LIT(KLogDir,"MultiCalDB");
+
+// Declare the FPrint function
+inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
+    {
+    VA_LIST list;
+    VA_START(list,aFmt);
+    RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
+    }
+
+// ===========================================================================
+#ifdef __WINS__     // File logging for WINS
+// ===========================================================================
+#define FLOG(arg...)   { FPrint(arg); }
+//#define FLOG(a) { RDebug::Print(a);  }
+#define FTRACE(a) { a; }
+// ===========================================================================
+#else               // RDebug logging for target HW
+// ===========================================================================
+//#define FLOG(arg...) { RDebug::Print(arg);  }
+#define FLOG(arg...)   { FPrint(arg); }
+#define FTRACE(a) { a; }
+#endif //__WINS__
+
+// ===========================================================================
+#else // // No loggings --> Reduced binary size
+// ===========================================================================
+#define FLOG(arg...)
+#define FTRACE(a)
+
+#endif // NSMLDSSYNC__DEBUG_H
+
+// End of File
--- a/omads/omadsextensions/adapters/agenda/src/101F6DD7.rss	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/agenda/src/101F6DD7.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -16,7 +16,7 @@
 */
 
 
-#include <101F6DD7.loc>
+#include<101f6dd7.loc>
 
 #include <registryinfo.rh>
 #include <nsmldsconstants.h>
--- a/omads/omadsextensions/adapters/agenda/src/NSmlAgendaDataStore_1_2.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,866 +0,0 @@
-CHARACTER_SET UTF8/*
-* 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:  Resource data for DS agenda adapter
-*
-*/
-
-
-#include <bldvariant.hrh>
-#include "SmlDataFormat.rh"
-#include "SmlDataFormat.hrh"
-#include "nsmlagendadefines.hrh"
-
-RESOURCE SML_DATA_STORE_FORMAT nsml_agenda_data_store
-	{
-	version=1;
-	display_name="Calendar";
-	sync_types=KSmlSyncType_TwoWay+KSmlSyncType_OneWayFromSvr+
-	           KSmlSyncType_OneWayFromClnt+KSmlSyncType_SlowSync+
-	           KSmlSyncType_RefreshFromSvr+KSmlSyncType_RefreshFromClnt;
-	mime_format=
-		{
-		SML_MIME_FORMAT
-			{
-			version=1;
-			mime_type="text/x-vcalendar";
-			mime_ver="1.0";
-			properties=
-				{
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Begin";
-					name="BEGIN";
-					data_type="";
-					enum_values={"VCALENDAR","VEVENT","VTODO"};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="End";
-					name="END";
-					data_type="";
-					enum_values={"VCALENDAR","VEVENT","VTODO"};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Version";
-					name="VERSION";	
-					data_type="";
-					enum_values={"1.0"};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Uid";
-					name="UID";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Summary";
-					name="SUMMARY";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Description";
-					name="DESCRIPTION";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Dstart";
-					name="DTSTART";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Dtend";
-					name="DTEND";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Aalarm";
-					name="AALARM";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params= {
-							SML_DATA_PROPERTY_PARAM
-								{
-								version=1;
-								display_name="Alarm type";
-								name="TYPE";
-								data_type="";
-								enum_values={};
-								}
-							};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Class";
-					name="CLASS";
-					data_type="";
-					enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Location";
-					name="LOCATION";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Last Modified";
-					name="LAST-MODIFIED";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Priority";
-					name="PRIORITY";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Status";
-					name="STATUS";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Rrule";
-					name="RRULE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Completed";
-					name="COMPLETED";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Dcreated";
-					name="DCREATED";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Due";
-					name="DUE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="ExDate";
-					name="EXDATE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Categories";
-					name="CATEGORIES";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Sequence";
-					name="SEQUENCE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-		                SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="TZ";
-					name="TZ";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-         		       SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Daylight";
-					name="DAYLIGHT";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="RDate";
-					name="RDATE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Attendee";
-					name="ATTENDEE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params= {
-							SML_DATA_PROPERTY_PARAM
-								{
-								version=1;
-								display_name="Type";
-								name="TYPE";
-								data_type="";
-								enum_values={"ROLE", "STATUS", "X-CN", "X-ROLE", "X-SENTBY", "X-STATUS"};
-								}
-							};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Recurrence";
-					name="X-RECURRENCE-ID";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Method";
-					name="X-METHOD";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-                		SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Local UID";
-					name="X-SYMBIAN-LUID";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-                		SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Time stamp";
-					name="X-SYMBIAN-DTSTAMP";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="X-Epoc Agenda Entry Type";
-					name="X-EPOCAGENDAENTRYTYPE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="GEO Address";
-					name="GEO";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					}
-				};
-			field_level=0;
-			}
-#ifdef __NSML_USE_ICAL_FEATURE
-			,
-		SML_MIME_FORMAT
-			{
-			version=1;
-			mime_type="text/calendar";
-			mime_ver="2.0";
-			properties=
-				{
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Begin";
-					name="BEGIN";
-					data_type="";
-					enum_values={"VCALENDAR","VEVENT","VTODO","STANDARD","DAYLIGHT","VTIMEZONE","VALARM"};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="End";
-					name="END";
-					data_type="";
-					enum_values={"VCALENDAR","VEVENT","VTODO","STANDARD","DAYLIGHT","VTIMEZONE","VALARM"};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Version";
-					name="VERSION";	
-					data_type="";
-					enum_values={"2.0"};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Uid";
-					name="UID";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Summary";
-					name="SUMMARY";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Description";
-					name="DESCRIPTION";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Dstart";
-					name="DTSTART";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Dtend";
-					name="DTEND";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Aalarm";
-					name="AALARM";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params= {
-							SML_DATA_PROPERTY_PARAM
-								{
-								version=1;
-								display_name="Alarm type";
-								name="TYPE";
-								data_type="";
-								enum_values={};
-								}
-							};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Class";
-					name="CLASS";
-					data_type="";
-					enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Location";
-					name="LOCATION";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Last Modified";
-					name="LAST-MODIFIED";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Priority";
-					name="PRIORITY";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Status";
-					name="STATUS";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Recurrence-Id";
-					name="RECURRENCE-ID";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Rrule";
-					name="RRULE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Sequence";
-					name="SEQUENCE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Method";
-					name="METHOD";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="ATTENDEE";
-					name="ATTENDEE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Categories";
-					name="CATEGORIES";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Organizer";
-					name="ORGANIZER";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Time stamp";
-					name="DTSTAMP";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Completed";
-					name="COMPLETED";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Created";
-					name="CREATED";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="ExDate";
-					name="EXDATE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="RDate";
-					name="RDATE";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Product ID";
-					name="PRODID";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Timezone ID";
-					name="TZID";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Timezone OFFSET from";
-					name="TZOFFSETFROM";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Timezone OFFSET to";
-					name="TZOFFSETTO";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Alarm action";
-					name="ACTION";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="Alarm trigger";
-					name="TRIGGER";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
-					display_name="GEO Address";
-					name="GEO";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					}
-				};
-			field_level=0;
-			}
-#endif // __NSML_USE_ICAL_FEATURE
-		};
-#ifdef __NSML_USE_ICAL_FEATURE
-	mime_format_tx_pref=1;     // Preferred index for tx
-	mime_format_rx_pref=1;     // Preferred index for rx
-#else // __NSML_USE_ICAL_FEATURE
-  mime_format_tx_pref=0;     // Preferred index for tx
-	mime_format_rx_pref=0;     // Preferred index for rx
-#endif // __NSML_USE_ICAL_FEATURE
-	folder_properties={};
-	filter_capabilities={};
-	max_size=0; 	// no limit
-	max_items=0; 	// no limit
-	flags=0;
-	}
-            
-// End of File
--- a/omads/omadsextensions/adapters/agenda/src/nsmlagendadataprovider.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/agenda/src/nsmlagendadataprovider.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -17,21 +17,21 @@
 
 
 // INCLUDE FILES
-#include "nsmlagendadataprovider.h"
-#include "nsmlagendadatastore.h"
-#include "nsmldebug.h"
-#include "nsmldsimpluids.h"
 #include <SmlDataProvider.h>
 #include <ecom.h>
 #include <barsc.h>
 #include <bautils.h>
 #include <NSmlAgendaDataStore_1_1_2.rsg>
-#include <NSmlAgendaDataStore_1_2.rsg>
 #include <SmlDataFormat.h>
 #include <implementationproxy.h>
 #include <data_caging_path_literals.hrh>
 #include <e32property.h>
 #include <DataSyncInternalPSKeys.h>
+#include <nsmldebug.h>
+#include "nsmlagendadataprovider.h"
+#include "nsmlagendadatastore.h"
+#include "nsmlagendadebug.h"
+#include "nsmldsimpluids.h"
 
 // ====================================== MEMBER FUNCTIONS ========================================
 
@@ -43,8 +43,8 @@
 //
 CNSmlAgendaDataProvider::CNSmlAgendaDataProvider()
 	{
-	_DBG_FILE("CNSmlAgendaDataProvider::CNSmlAgendaDataProvider(): BEGIN");
-	_DBG_FILE("CNSmlAgendaDataProvider::CNSmlAgendaDataProvider(): END");
+	FLOG(_L("CNSmlAgendaDataProvider::CNSmlAgendaDataProvider(): BEGIN"));
+	FLOG(_L("CNSmlAgendaDataProvider::CNSmlAgendaDataProvider(): END"));
 	}
 
 // ------------------------------------------------------------------------------------------------
@@ -54,11 +54,9 @@
 //
 void CNSmlAgendaDataProvider::ConstructL( )
 	{
-	_DBG_FILE("CNSmlAgendaDataProvider::NewL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::NewL: BEGIN"));
 	iAgnDataStore = CNSmlAgendaDataStore::NewL();
-	iStringPool.OpenL();
-	User::LeaveIfError( iSession.Connect() );
-	_DBG_FILE("CNSmlAgendaDataProvider::NewL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::NewL: END"));
 	}
 
 // ------------------------------------------------------------------------------------------------
@@ -68,12 +66,12 @@
 //
 CNSmlAgendaDataProvider* CNSmlAgendaDataProvider::NewL()
 	{
-	_DBG_FILE("CNSmlAgendaDataProvider::NewL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::NewL: BEGIN"));
 	CNSmlAgendaDataProvider* self = new ( ELeave ) CNSmlAgendaDataProvider();
 	CleanupStack::PushL( self );
 	self->ConstructL();
 	CleanupStack::Pop( self );
-	_DBG_FILE("CNSmlAgendaDataProvider::NewL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::NewL: END"));
 	return self;
 	}
 
@@ -84,14 +82,12 @@
 //
 CNSmlAgendaDataProvider::~CNSmlAgendaDataProvider()
 	{
-	_DBG_FILE("CNSmlAgendaDataProvider::~CNSmlAgendaDataProvider(): BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::~CNSmlAgendaDataProvider(): BEGIN"));
+	delete iDSFormat;
 	delete iAgnDataStore;
-	iSession.Close();
-	delete iDSFormat;
-	iStringPool.Close();
 	iFilterArray.ResetAndDestroy();
 	iFilterArray.Close();
-	_DBG_FILE("CNSmlAgendaDataProvider::~CNSmlAgendaDataProvider(): END");
+	FLOG(_L("CNSmlAgendaDataProvider::~CNSmlAgendaDataProvider(): END"));
 	}
 
 // ------------------------------------------------------------------------------------------------
@@ -101,8 +97,8 @@
 //
 void CNSmlAgendaDataProvider::DoOnFrameworkEvent( TSmlFrameworkEvent /*aEvent*/, TInt /*aParam1*/, TInt /*aParam2*/ )
     {
-	_DBG_FILE("CNSmlAgendaDataProvider::DoOnFrameworkEvent: BEGIN");
-	_DBG_FILE("CNSmlAgendaDataProvider::DoOnFrameworkEvent: END");
+	FLOG(_L("CNSmlAgendaDataProvider::DoOnFrameworkEvent: BEGIN"));
+	FLOG(_L("CNSmlAgendaDataProvider::DoOnFrameworkEvent: END"));
     }
 
 // ------------------------------------------------------------------------------------------------
@@ -112,13 +108,13 @@
 //
 TBool CNSmlAgendaDataProvider::DoSupportsOperation( TUid aOpId ) const
     {
-	_DBG_FILE("CNSmlAgendaDataProvider::DoSupportsOperation: BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::DoSupportsOperation: BEGIN"));
 	if ( aOpId == KUidSmlSupportMultipleStores )
 		{
-		_DBG_FILE("CNSmlAgendaDataProvider::DoSupportsOperation: END");
+		FLOG(_L("CNSmlAgendaDataProvider::DoSupportsOperation: END"));
 		return ETrue;
 		}
-	_DBG_FILE("CNSmlAgendaDataProvider::DoSupportsOperation: END");
+	FLOG(_L("CNSmlAgendaDataProvider::DoSupportsOperation: END"));
 	return EFalse;
     }
 
@@ -129,16 +125,17 @@
 //
 const CSmlDataStoreFormat& CNSmlAgendaDataProvider::DoStoreFormatL()
     {
-	_DBG_FILE("CNSmlAgendaDataProvider::DoStoreFormatL(): BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::DoStoreFormatL(): BEGIN"));
 	
 	if ( iDSFormat )
 		{
        	delete iDSFormat;
        	iDSFormat = NULL;
 		}
-	iDSFormat = DoOwnStoreFormatL();
-	
-    return *iDSFormat;
+	// RD_MULTICAL
+	iDSFormat = iAgnDataStore->StoreFormatL();
+	// RD_MULTICAL
+	return *iDSFormat;
     }
 
 // ------------------------------------------------------------------------------------------------
@@ -148,8 +145,8 @@
 //
 CDesCArray* CNSmlAgendaDataProvider::DoListStoresLC()
     {
-	_DBG_FILE("CNSmlAgendaDataProvider::DoListStoresLC(): BEGIN");
-	_DBG_FILE("CNSmlAgendaDataProvider::DoListStoresLC(): END");
+	FLOG(_L("CNSmlAgendaDataProvider::DoListStoresLC(): BEGIN"));
+	FLOG(_L("CNSmlAgendaDataProvider::DoListStoresLC(): END"));
 	return iAgnDataStore->DoListAgendaFilesLC();
     }
 
@@ -160,8 +157,8 @@
 //
 const TDesC& CNSmlAgendaDataProvider::DoDefaultStoreL()
     {
-	_DBG_FILE("CNSmlAgendaDataProvider::DoDefaultStoreL(): BEGIN");
-	_DBG_FILE("CNSmlAgendaDataProvider::DoDefaultStoreL(): END");
+	FLOG(_L("CNSmlAgendaDataProvider::DoDefaultStoreL(): BEGIN"));
+	FLOG(_L("CNSmlAgendaDataProvider::DoDefaultStoreL(): END"));
 	return iAgnDataStore->DoGetDefaultFileNameL();
     }
 
@@ -172,10 +169,10 @@
 //
 CSmlDataStore* CNSmlAgendaDataProvider::DoNewStoreInstanceLC()
     {
-	_DBG_FILE("CNSmlAgendaDataProvider::DoNewStoreInstanceLC(): BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::DoNewStoreInstanceLC(): BEGIN"));
 	CNSmlAgendaDataStore* newStore = CNSmlAgendaDataStore::NewL();
 	CleanupStack::PushL( newStore );
-	_DBG_FILE("CNSmlAgendaDataProvider::DoNewStoreInstanceLC(): END");
+	FLOG(_L("CNSmlAgendaDataProvider::DoNewStoreInstanceLC(): END"));
 	return newStore;
     } 
 
@@ -186,8 +183,8 @@
 const RPointerArray<CSyncMLFilter>& CNSmlAgendaDataProvider::DoSupportedServerFiltersL()
 	{
 	// This method returns empty array. It means that this Data Provider does not support filtering
-	_DBG_FILE("CNSmlAgendaDataProvider::DoSupportedServerFiltersL(): BEGIN");
-	_DBG_FILE("CNSmlAgendaDataProvider::DoSupportedServerFiltersL(): END");
+	FLOG(_L("CNSmlAgendaDataProvider::DoSupportedServerFiltersL(): BEGIN"));
+	FLOG(_L("CNSmlAgendaDataProvider::DoSupportedServerFiltersL(): END"));
 	return iFilterArray;
 	}
 
@@ -197,9 +194,9 @@
 // ------------------------------------------------------------------------------------------------
 void CNSmlAgendaDataProvider::DoCheckSupportedServerFiltersL( const CSmlDataStoreFormat& /*aServerDataStoreFormat*/, RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
 	{
-	_DBG_FILE("CNSmlAgendaDataProvider::DoCheckSupportedServerFiltersL(): BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::DoCheckSupportedServerFiltersL(): BEGIN"));
+	FLOG(_L("CNSmlAgendaDataProvider::DoCheckSupportedServerFiltersL(): END"));
 	User::Leave( KErrNotSupported );
-	_DBG_FILE("CNSmlAgendaDataProvider::DoCheckSupportedServerFiltersL(): END");
 	}
 
 // ------------------------------------------------------------------------------------------------
@@ -208,9 +205,9 @@
 // ------------------------------------------------------------------------------------------------
 void CNSmlAgendaDataProvider::DoCheckServerFiltersL( RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
 	{
-	_DBG_FILE("CNSmlAgendaDataProvider::DoCheckServerFiltersL(): BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::DoCheckServerFiltersL(): BEGIN"));
+	FLOG(_L("CNSmlAgendaDataProvider::DoCheckServerFiltersL(): END"));
 	User::Leave( KErrNotSupported );
-	_DBG_FILE("CNSmlAgendaDataProvider::DoCheckServerFiltersL(): END");
 	}
 
 // ------------------------------------------------------------------------------------------------
@@ -219,9 +216,9 @@
 // ------------------------------------------------------------------------------------------------
 HBufC* CNSmlAgendaDataProvider::DoGenerateRecordFilterQueryLC( const RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterMatchType /*aMatch*/, TDes& /*aFilterMimeType*/, TSyncMLFilterType& /*aFilterType*/, TDesC& /*aStoreName*/ )
 	{
-	_DBG_FILE("CNSmlAgendaDataProvider::DoGenerateRecordFilterQueryLC(): BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::DoGenerateRecordFilterQueryLC(): BEGIN"));
+	FLOG(_L("CNSmlAgendaDataProvider::DoGenerateRecordFilterQueryLC(): END"));
 	User::Leave( KErrNotSupported );
-	_DBG_FILE("CNSmlAgendaDataProvider::DoGenerateRecordFilterQueryLC(): END");
 	return NULL;
 	}
 	
@@ -231,53 +228,9 @@
 // ------------------------------------------------------------------------------------------------
 void CNSmlAgendaDataProvider::DoGenerateFieldFilterQueryL( const RPointerArray<CSyncMLFilter>& /*aFilters*/, TDes& /*aFilterMimeType*/, RPointerArray<CSmlDataProperty>& /*aProperties*/, TDesC& /*aStoreName*/ )
 	{
-	_DBG_FILE("CNSmlAgendaDataProvider::DoGenerateFieldFilterQueryL(): BEGIN");
+	FLOG(_L("CNSmlAgendaDataProvider::DoGenerateFieldFilterQueryL(): BEGIN"));
+	FLOG(_L("CNSmlAgendaDataProvider::DoGenerateFieldFilterQueryL(): END"));
 	User::Leave( KErrNotSupported );
-	_DBG_FILE("CNSmlAgendaDataProvider::DoGenerateFieldFilterQueryL(): END");
-	}
-
-// ------------------------------------------------------------------------------------------------
-// CNSmlAgendaDataProvider::DoOwnStoreFormatL
-// Read own store format from own resource file.
-// ------------------------------------------------------------------------------------------------
-//
-CSmlDataStoreFormat* CNSmlAgendaDataProvider::DoOwnStoreFormatL()
-	{
-	_DBG_FILE("CNSmlAgendaDataProvider::DoOwnStoreFormatL(): BEGIN");
-	TFileName fileName;
-	TParse parse;
-
-    // Check correct Data Sync protocol
-	TInt value( EDataSyncNotRunning );
-	TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
-                                 KDataSyncStatus,
-                                 value );
-	if ( error == KErrNone &&
-	     value == EDataSyncRunning )
-	    {
-	    parse.Set( KNSmlDSAgendaDataStoreRsc_1_1_2, &KDC_RESOURCE_FILES_DIR, NULL );
-	    }
-	else // error or protocol version 1.2 
-	    {
-	    parse.Set( KNSmlDSAgendaDataStoreRsc_1_2, &KDC_RESOURCE_FILES_DIR, NULL );
-	    }		
-	
-	fileName = parse.FullName();
-	RResourceFile resourceFile;
-	BaflUtils::NearestLanguageFile( iSession, fileName );
-
-	resourceFile.OpenL( iSession, fileName );
-	CleanupClosePushL( resourceFile );
-
-	HBufC8* profileRes = resourceFile.AllocReadLC( NSML_AGENDA_DATA_STORE );
-	TResourceReader reader;
-	reader.SetBuffer( profileRes );
-
-	CSmlDataStoreFormat* dsFormat = CSmlDataStoreFormat::NewLC( iStringPool, reader );
-	CleanupStack::Pop(); // dsFormat
-	CleanupStack::PopAndDestroy( 2 ); // profileRes, resourceFile
-	_DBG_FILE("CNSmlAgendaDataProvider::DoOwnStoreFormatL(): END");
-	return dsFormat;
 	}
 
 // =================================== OTHER EXPORTED FUNCTIONS ===================================
@@ -297,9 +250,9 @@
 //
 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
     {
-	_DBG_FILE("ImplementationGroupProxy() for CNSmlAgendaDataProvider: begin");
+	FLOG(_L("ImplementationGroupProxy() for CNSmlAgendaDataProvider: begin"));
     aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
-	_DBG_FILE("ImplementationGroupProxy() for CNSmlAgendaDataProvider: end");
+	FLOG(_L("ImplementationGroupProxy() for CNSmlAgendaDataProvider: end"));
     return ImplementationTable;
 	}
 
--- a/omads/omadsextensions/adapters/agenda/src/nsmlagendadatastore.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/agenda/src/nsmlagendadatastore.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -18,12 +18,6 @@
 
 
 // INCLUDES
-#include "nsmldebug.h"
-#include "nsmlagendadatastore.h"
-#include "nsmlagendadataprovider.h"
-#include "nsmlchangefinder.h"
-#include "NSmlDataModBase.h"
-#include "nsmlagendadefines.hrh"
 #include <ecom.h>
 #include <barsc.h>
 #include <bautils.h>
@@ -41,11 +35,23 @@
 #include <SmlDataSyncDefs.h>
 #include <data_caging_path_literals.hrh>
 #include <NSmlAgendaDataStore_1_1_2.rsg>
-#include <NSmlAgendaDataStore_1_2.rsg>
 #include <e32property.h>
 #include <DataSyncInternalPSKeys.h>
 #include <CalenImporter.h>
 #include <CalenInterimUtils2.h>
+#include <utf.h>
+#include <nsmldebug.h>
+#include <nsmlagendaadapterhandler.h>
+#include <calenmulticaluids.hrh>
+#include <calenmulticalutil.h>
+#include <nsmlconstants.h>
+#include <centralrepository.h> 
+#include "nsmlagendadebug.h"
+#include "nsmlagendadatastore.h"
+#include "nsmlagendadataprovider.h"
+#include "nsmlchangefinder.h"
+#include "NSmlDataModBase.h"
+#include "nsmlagendadefines.hrh"
 
 #ifndef __WINS__
 // This lowers the unnecessary compiler warning (armv5) to remark.
@@ -70,10 +76,17 @@
 	iDrive( -1 ),
 	iReplaceItemId( -1 ),
 	iRXEntryType( ENSmlNotSet ),
-	iTXEntryType( ENSmlNotSet )
+	iTXEntryType( ENSmlNotSet ),
+	iIsHierarchicalSyncSupported( EFalse ),
+	iParentItemId( 0 ),
+    iOrphanEvent( EFalse )
 	{
-	_DBG_FILE("CNSmlAgendaDataStore::CNSmlAgendaDataStore(): BEGIN");
-	_DBG_FILE("CNSmlAgendaDataStore::CNSmlAgendaDataStore(): END");
+	FLOG(_L("CNSmlAgendaDataStore::CNSmlAgendaDataStore(): BEGIN"));
+	// RD_MULTICAL
+	iDataMimeType = ENSmlNone;
+	iAgendaAdapterHandler = NULL;
+	// RD_MULTICAL
+	FLOG(_L("CNSmlAgendaDataStore::CNSmlAgendaDataStore(): END"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -83,7 +96,7 @@
 //
 void CNSmlAgendaDataStore::ConstructL()
 	{
-	_DBG_FILE("CNSmlAgendaDataStore::ConstructL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::ConstructL: BEGIN"));
 
 	iStringPool.OpenL();
 	User::LeaveIfError( iRfs.Connect() );
@@ -96,21 +109,32 @@
 	iMovedUids = new ( ELeave ) CNSmlDataItemUidSet();
 	iReplacedUids = new ( ELeave ) CNSmlDataItemUidSet();
 	
-	iDefaultStoreName = HBufC::NewL( KNSmlDefaultStoreNameMaxSize );
+	iDefaultStoreFileName = HBufC::NewL( KNSmlDefaultStoreNameMaxSize );
+	*iDefaultStoreFileName = KNSmlAgendaFileNameForDefaultDB; 
 	
-	iVersitTlsData = &CVersitTlsData::VersitTlsDataL();
-	// Create CalSession and CalEntryView instances
-	iVCalSession = CCalSession::NewL();
 	
-	TPtr obptr = iDefaultStoreName->Des();
-	obptr = iVCalSession->DefaultFileNameL(); 
-
+	// RD_MULTICAL
+	iAgendaAdapterLog = NULL;
+	iCalOffsetArr = new (ELeave) CArrayFixFlat<TUint>( KArrayGranularity );
+	iCommittedUidArr = new ( ELeave ) CNSmlDataItemUidSet();
+	//iCalOffsetVal = CCalenMultiCalUtil::GetOffsetL();
+	// TODO: Tweak code: BEGIN
+	iCalOffsetVal = 100000;	
+	ListAllAgendaPluginAdaptersL();
+	// END  
+		
 	iOwnFormat = DoOwnStoreFormatL();
-	iDataMod->SetOwnStoreFormat( *iOwnFormat );
-	
+	// RD_MULTICAL
+	iDataMod->SetOwnStoreFormat( *iOwnFormat );	
     iInterimUtils = CCalenInterimUtils2::NewL();
-	
-	_DBG_FILE("CNSmlAgendaDataStore::ConstructL: END");
+    
+    // Initialize the FieldId to a default value [UID3 of the application]
+    // This value will be rewritten once the exact single CalendarDB is determined
+    // In case of HF synchronization involving multiple CalendarDB's the below value 
+    // will be retained.
+    iOpenedStoreId = KNSmlAgendaAdapterUid;
+    
+	FLOG(_L("CNSmlAgendaDataStore::ConstructL: END"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -120,7 +144,7 @@
 //
 CNSmlAgendaDataStore* CNSmlAgendaDataStore::NewL()
 	{
-	_DBG_FILE("CNSmlAgendaDataStore::NewL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::NewL: BEGIN"));
 	
 	CNSmlAgendaDataStore* self = new ( ELeave ) CNSmlAgendaDataStore();
 	CleanupStack::PushL( self );
@@ -128,7 +152,7 @@
 	self->ConstructL();
 	CleanupStack::Pop(); // self
 	
-	_DBG_FILE("CNSmlAgendaDataStore::NewL: END");
+	FLOG(_L("CNSmlAgendaDataStore::NewL: END"));
 	return self;
 	}
 
@@ -139,53 +163,61 @@
 //
 CNSmlAgendaDataStore::~CNSmlAgendaDataStore()
 	{
-	_DBG_FILE("CNSmlAgendaDataStore::~CNSmlAgendaDataStore(): BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::~CNSmlAgendaDataStore(): BEGIN"));
 
     // Enable notifications
     TInt error( KErrNone );
-    if ( iVCalSession )
+   
+    // TODO:
+    /*if ( iVCalSession )
         {
         TRAP_IGNORE( iVCalSession->EnablePubSubNotificationsL() );
         TRAP_IGNORE( iVCalSession->EnableChangeBroadcast() );
-        }
-
-	delete iOwnFormat;
-	iRfs.Close();
-	iStringPool.Close();
+        }*/  
 	
     if ( iChangeFinder )
 		{
 		TRAP( error, iChangeFinder->CloseL() );
 		}
-	if (iVersitTlsData)
-			{
-			iVersitTlsData->VersitTlsDataClose();
-			}
-	delete iChangeFinder;
+
+    delete iChangeFinder;
 	delete iNewUids;
 	delete iDeletedUids;
 	delete iSoftDeletedUids;
 	delete iMovedUids;
 	delete iReplacedUids;
 
-    delete iDefaultStoreName;
+    delete iDefaultStoreFileName;
     delete iOpenedStoreName;
+    delete iReceivedStoreName;
 	delete iDataMod;
 	delete iItemData;
-
-    delete iAgendaProgressview;
-    
-	delete iImporter;
-    delete iExporter;
-    delete iInstanceView;
-    delete iEntryView;
-    delete iVCalSession;
+	
     delete iInterimUtils;
     
+    iAgendaPluginAdapters.ResetAndDestroy();    
     
-    // REComSession::FinalClose();
-	
-	_DBG_FILE("CNSmlAgendaDataStore::~CNSmlAgendaDataStore(): END");
+    if( iOwnFormat )
+       {
+       delete iOwnFormat;
+       iOwnFormat = NULL;
+       }
+   
+    iRfs.Close();
+    iStringPool.Close();
+    
+    if ( iCalOffsetArr )
+       {
+       iCalOffsetArr->Reset();
+       delete iCalOffsetArr;
+       }
+    
+    if ( iCommittedUidArr )
+       {
+       iCommittedUidArr->Reset();
+       delete iCommittedUidArr;
+       }
+	FLOG(_L("CNSmlAgendaDataStore::~CNSmlAgendaDataStore(): END"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -196,7 +228,8 @@
 void CNSmlAgendaDataStore::DoOpenL( const TDesC& aStoreName,
                 MSmlSyncRelationship& aContext, TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoOpenL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoOpenL: BEGIN"));
+	
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 	if ( iState != ENSmlClosed )
@@ -209,82 +242,41 @@
 		{
 		RFs::CharToDrive( KNSmlDriveC()[0], iDrive );
 		}
-    
+	
+	if ( iReceivedStoreName )
+        {
+        delete iReceivedStoreName;
+        iReceivedStoreName = NULL;
+        } 
+	iReceivedStoreName = aStoreName.AllocL();
     // Open database
 	TInt err( KErrNone );	
-	TRAP( err, iVCalSession->OpenL( aStoreName ) );
-	DBG_ARGS(_S("CNSmlAgendaDataStore::DoOpenL: error while opening '%d'"), err );
-	if( err == KErrNotFound )
-        {
-        err = KErrNone;
-        TRAP( err, iVCalSession->CreateCalFileL( aStoreName ));
-        DBG_ARGS(_S("CNSmlAgendaDataStore::DoOpenL: creating the new calfile '%d'"), err );
-        if( err == KErrNone )
-            {
-            TRAP( err, iVCalSession->OpenL( aStoreName ));
-            }       
-        }
+	if ( aStoreName == KNSmlAgendaFileNameForDefaultDB )
+		{
+		FLOG(_L("CNSmlAgendaDataStore::DoOpenL: Calling the OpenStoreL: '%S'"), &aStoreName);
+		TRAP( err, OpenStoreL() );
+		}    
+		
 	if ( err )
 	    {
-        DBG_ARGS(_S("CNSmlAgendaDataStore::DoOpenL: end with error '%d'"), err );
 	    User::RequestComplete( iCallerStatus, err );
 	    return;
 	    }
 	
-	// Disable notifications
-	TRAP_IGNORE( iVCalSession->DisablePubSubNotificationsL() );
-	TRAP_IGNORE( iVCalSession->DisableChangeBroadcast() );
-	    
-	if ( iOpenedStoreName )
-		{
-		delete iOpenedStoreName;
-		iOpenedStoreName = NULL;
-		}
-	iOpenedStoreName = aStoreName.AllocL();
-	
-	// Initialize some member variables
-	// Create importer and exporter
-    iImporter = CCalenImporter::NewL( *iVCalSession );
-	iExporter = CCalenExporter::NewL( *iVCalSession );
-
-    // Progress view
-	iAgendaProgressview = CNSmlAgendaProgressview::NewL();
-
-	// Entry View
-    iEntryView = CCalEntryView::NewL( *iVCalSession, *iAgendaProgressview );
-    
-    // Instance View
-    iInstanceView = CCalInstanceView::NewL(*iVCalSession);
-    
-    CActiveScheduler::Start();
-    TInt completedStatus = iAgendaProgressview->GetCompletedStatus();
-    if ( completedStatus != KErrNone )
-        {
-        User::RequestComplete( iCallerStatus, completedStatus );
-        return;
-        }
-
 	if ( iChangeFinder )
 		{
 		iChangeFinder->CloseL();
 		delete iChangeFinder;
 		iChangeFinder = NULL;
 		}
+	
 	iChangeFinder = CNSmlChangeFinder::NewL( aContext, iKey, iHasHistory,
 	                                         KNSmlAgendaAdapterImplUid );
-    
-    // Get ID of database
-	iVCalSession->FileIdL( iOpenedStoreId );
-	
-	if( !iSnapshotRegistered )
-		{
-		RegisterSnapshotL();
-		}
-     	
+	iAgendaAdapterLog = CNSmlAgendaAdapterLog::NewL( aContext );
 	iState = ENSmlOpenAndWaiting;
     User::RequestComplete( iCallerStatus, err );
 	    
-	_DBG_FILE("CNSmlAgendaDataStore::DoOpenL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoOpenL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -294,7 +286,7 @@
 //
 void CNSmlAgendaDataStore::DoCancelRequest()
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoCancelRequest: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoCancelRequest: BEGIN"));
     if ( iState == ENSmlOpenAndWaiting )
         {
     	iState = ENSmlClosed;
@@ -303,7 +295,7 @@
         {
 	    iState = ENSmlOpenAndWaiting;
         }
-	_DBG_FILE("CNSmlAgendaDataStore::DoCancelRequest: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoCancelRequest: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -313,9 +305,9 @@
 //
 const TDesC& CNSmlAgendaDataStore::DoStoreName() const
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoStoreName: BEGIN");
-	_DBG_FILE("CNSmlAgendaDataStore::DoStoreName: END");
-	return *iOpenedStoreName;
+	FLOG(_L("CNSmlAgendaDataStore::DoStoreName: BEGIN"));
+	FLOG(_L("CNSmlAgendaDataStore::DoStoreName: END"));
+	return *iReceivedStoreName;
     }
 
 // -----------------------------------------------------------------------------
@@ -325,9 +317,9 @@
 //
 void CNSmlAgendaDataStore::DoBeginTransactionL()
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoBeginTransactionL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoBeginTransactionL: BEGIN"));
 	User::Leave( KErrNotSupported );
-	_DBG_FILE("CNSmlAgendaDataStore::DoBeginTransactionL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoBeginTransactionL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -337,11 +329,11 @@
 //
 void CNSmlAgendaDataStore::DoCommitTransactionL( TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitTransactionL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoCommitTransactionL: BEGIN"));
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 	User::RequestComplete( iCallerStatus, KErrNotSupported );
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitTransactionL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoCommitTransactionL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -351,11 +343,11 @@
 //
 void CNSmlAgendaDataStore::DoRevertTransaction( TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoRevertTransaction: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoRevertTransaction: BEGIN"));
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 	User::RequestComplete( iCallerStatus, KErrNotSupported );
-	_DBG_FILE("CNSmlAgendaDataStore::DoRevertTransaction: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoRevertTransaction: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -365,9 +357,9 @@
 //
 void CNSmlAgendaDataStore::DoBeginBatchL()
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoBeginBatchL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoBeginBatchL: BEGIN"));
 	User::Leave( KErrNotSupported );
-	_DBG_FILE("CNSmlAgendaDataStore::DoBeginBatchL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoBeginBatchL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -378,11 +370,11 @@
 void CNSmlAgendaDataStore::DoCommitBatchL( RArray<TInt>& /*aResultArray*/,
                 TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitBatchL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoCommitBatchL: BEGIN"));
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 	User::RequestComplete( iCallerStatus, KErrNotSupported );
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitBatchL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoCommitBatchL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -392,9 +384,9 @@
 //
 void CNSmlAgendaDataStore::DoCancelBatch()
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoCancelBatch: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoCancelBatch: BEGIN"));
 	// Nothing to do
-	_DBG_FILE("CNSmlAgendaDataStore::DoCancelBatch: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoCancelBatch: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -405,7 +397,7 @@
 void CNSmlAgendaDataStore::DoSetRemoteStoreFormatL(
                 const CSmlDataStoreFormat& aServerDataStoreFormat )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: BEGIN"));
 	
 	if ( iOwnFormat )
 	    {
@@ -414,6 +406,24 @@
 	    }
 	
 	iOwnFormat = DoOwnStoreFormatL();
+	// RD_MULTICAL
+	if ( aServerDataStoreFormat.IsSupported( 
+	                                CSmlDataStoreFormat::EOptionHierarchial ) )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Supports HIERARCHIAL"));
+       
+		
+        iIsHierarchicalSyncSupported = ETrue;
+	
+		// Check what properties are supported for folders
+        iAgendaAdapterHandler->CheckServerSupportForFolder( aServerDataStoreFormat );
+        }
+	else
+	    {
+	    FLOG(_L("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Do not support HIERARCHIAL"));	           
+	    iIsHierarchicalSyncSupported = EFalse;
+	    }
+	// RD_MULTICAL       
 	iDataMod->SetOwnStoreFormat( *iOwnFormat );
 	
     iDataMod->SetPartnerStoreFormat( ( CSmlDataStoreFormat& )
@@ -426,7 +436,7 @@
 
 #ifdef __NSML_USE_ICAL_FEATURE
 
-    _DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Support iCal");
+    FLOG(_L("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Support iCal"));
    	returnValue = iDataMod->SetUsedMimeType(
        	    iOwnFormat->MimeFormat( 1 ).MimeType(),
            	iOwnFormat->MimeFormat( 1 ).MimeVersion() );
@@ -435,19 +445,19 @@
 
     if ( returnValue == KErrNone )
         {
-        _DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Sets iCal");
+        FLOG(_L("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Sets iCal"));
         iRXEntryType = ENSmlICal;
         iTXEntryType = ENSmlICal;
         }
     else
         {
-        _DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Support vCal");
+        FLOG(_L("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Support vCal"));
         returnValue = iDataMod->SetUsedMimeType(
             iOwnFormat->MimeFormat( 0 ).MimeType(),
             iOwnFormat->MimeFormat( 0 ).MimeVersion() );
         if ( returnValue == KErrNone )
             {
-            _DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Sets vCal");
+            FLOG(_L("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Sets vCal"));
             iRXEntryType = ENSmlVCal;
             iTXEntryType = ENSmlVCal;
             }
@@ -455,11 +465,18 @@
     if ( iRXEntryType == ENSmlNotSet || iTXEntryType == ENSmlNotSet )
         {
         // Leave if server does not support either vCal or iCal
-        _DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: MimeType Not supported");
+        FLOG(_L("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: MimeType Not supported"));
         User::Leave( KErrNotFound );        
         }
     
-	_DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: END");
+    // RD_MULTICAL
+    if( !iSnapshotRegistered )
+        {
+        RegisterSnapshotL();
+        }
+    // RD_MULTICAL
+    
+	FLOG(_L("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -469,9 +486,9 @@
 //
 void CNSmlAgendaDataStore::DoSetRemoteMaxObjectSize( TInt aServerMaxObjectSize )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteMaxObjectSize: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoSetRemoteMaxObjectSize: BEGIN"));
 	iServerMaxObjectSize = aServerMaxObjectSize;
-	_DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteMaxObjectSize: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoSetRemoteMaxObjectSize: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -481,8 +498,8 @@
 //
 TInt CNSmlAgendaDataStore::DoMaxObjectSize() const
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoMaxObjectSize: BEGIN");
-	_DBG_FILE("CNSmlAgendaDataStore::DoMaxObjectSize - Default: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoMaxObjectSize: BEGIN"));
+	FLOG(_L("CNSmlAgendaDataStore::DoMaxObjectSize - Default: END"));
 	return KNSmlAgendaOwnMaxObjectSize;
     }
 
@@ -491,104 +508,190 @@
 // Open calendar item for reading.
 // -----------------------------------------------------------------------------
 //
-void CNSmlAgendaDataStore::DoOpenItemL( TSmlDbItemUid aUid, TBool& aFieldChange,
-                TInt& aSize, TSmlDbItemUid& /*aParent*/, TDes8& aMimeType,
-                TDes8& aMimeVer, TRequestStatus& aStatus )
+void CNSmlAgendaDataStore::DoOpenItemL( TSmlDbItemUid aUid,
+                                        TBool& aFieldChange,
+                                        TInt& aSize,
+                                        TSmlDbItemUid& aParent,
+                                        TDes8& aMimeType,
+                                        TDes8& aMimeVer,
+                                        TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoOpenItemL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: BEGIN"));
     iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
+	// Leave if Data Store is in wrong state
 	if ( iState != ENSmlOpenAndWaiting )
 		{
+		FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL:Returing due to invalid state"));
 		User::RequestComplete( iCallerStatus, KErrNotReady );
 		return;
 		}
 		
- 	iReplaceItemId = aUid;
- 	
-	CCalEntry* entry = NULL;
-	TInt err( KErrNone );
-    TRAP( err, entry = iEntryView->FetchL( aUid ) );
-	CleanupStack::PushL( entry );
+	// Add field change info
+	aFieldChange = EFalse;
 	
-	if ( err || !entry )
-		{
-		CleanupStack::PopAndDestroy( entry ); // entry
-		User::RequestComplete( iCallerStatus, KErrNotFound );
-		return;
-		}
-		
+	// Update the SnapShots
 	if ( !iSnapshotRegistered )
-		{
-		RegisterSnapshotL();
-		}
-	delete iItemData;
-	iItemData = NULL;
-	iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
+        {
+        RegisterSnapshotL();
+        }
+        
+	// Initialize the Buffer
+    delete iItemData;
+    iItemData = NULL;
+    iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
 
-	RBufWriteStream writeStream( *iItemData );
-	writeStream.PushL();
-	
-	// Export item from database
-	if ( iTXEntryType == ENSmlICal )
-	    {
-	    _DBG_FILE("CNSmlAgendaDataStore::DoOpenItemL: Export - iCal DB");
-	    iExporter->ExportICalL( *entry, writeStream );
-	    aMimeType = iOwnFormat->MimeFormat( 1 ).MimeType().DesC();
-	    aMimeVer = iOwnFormat->MimeFormat( 1 ).MimeVersion().DesC();
-	    }
-    else if ( iTXEntryType == ENSmlVCal )
+    RBufWriteStream writeStream( *iItemData );
+    writeStream.PushL();
+
+	// RD_MULTICAL
+  	//Determine the Mime Type
+    DataMimeType( aUid );
+	TInt fetchError( KErrNone );
+	switch( iDataMimeType )
 	    {
-	    _DBG_FILE("CNSmlAgendaDataStore::DoOpenItemL: Export - vCal DB");
-	    iExporter->ExportVCalL( *entry, writeStream );
-	    aMimeType = iOwnFormat->MimeFormat( 0 ).MimeType().DesC();
-	    aMimeVer = iOwnFormat->MimeFormat( 0 ).MimeVersion().DesC();
+	    case ENSmlFolder:
+    	    {
+    	    //Set the Parent UID
+    	    aParent = KDbItemUidRoot; // parent is root
+    	    FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: calling fetch"));
+	        FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL:writestream before size: '%d'"), writeStream.Sink()->SizeL());
+	        TRAP( fetchError, iAgendaAdapterHandler->FetchFolderL( aUid, writeStream ) );
+	        FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL:writestream size: '%d'"), writeStream.Sink()->SizeL());
+    	
+	        if(fetchError != KErrNone)
+    	        {
+    	        FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: fetch error: '%d'"), fetchError);
+    	        CleanupStack::PopAndDestroy( ); // writeStream
+    	        User::RequestComplete( iCallerStatus, fetchError );
+    	        return;
+    	        }
+    	    
+            aMimeType.Append( KNSmlContentTypeFolder );
+            aMimeVer.Append( KNSmlContentTypeFolderVersion );
+            
+            writeStream.CommitL();
+            iItemData->Compress();
+            iPos = 0;
+            }
+    	    break;
+	    case ENSmlCalendar:
+    	    {
+    	    FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: calendar item"));
+            CNSmlAgendaDataStoreUtil* agendautil = NULL;
+            HBufC* calfilename = NULL;
+            TCalLocalUid parentid(NULL);
+            TCalLocalUid entryid(aUid);
+            TInt err( KErrNone );
+            
+            if( iIsHierarchicalSyncSupported )
+                {
+                TRAP( err, GetCalendarEntryIdL( parentid, entryid ));
+                if ( err )
+                    {
+                    FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL:Parent Id is not Valid one"));
+                    CleanupStack::PopAndDestroy( ); // writeStream
+                    User::RequestComplete( iCallerStatus, KErrNotFound );
+                    return;
+                    }
+                aParent = parentid;
+                //Get the Folder Name
+                TRAP(err, calfilename = iAgendaAdapterHandler->FolderNameL( parentid ));  
+                }
+            else
+                {
+                calfilename = iOpenedStoreName->AllocL();
+                }
+            
+            if( err != KErrNone || NULL == calfilename )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL:Invalid CalendarInfo"));
+                CleanupStack::PopAndDestroy( ); // writeStream
+                User::RequestComplete( iCallerStatus, KErrNotFound );
+                return;
+                }     
+            
+            iReplaceItemId = entryid;            
+            agendautil = CNSmlAgendaDataStoreUtil::NewL();
+            if( agendautil )
+                {
+                CleanupStack::PushL(agendautil);
+                TRAP(err, agendautil->InitializeCalAPIsL( calfilename, entryid ));
+                CleanupStack::Pop(agendautil);
+                }
+            if ( err || !agendautil )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: entry is not valid"));
+                delete agendautil; 
+                delete calfilename;
+                CleanupStack::PopAndDestroy( ); // writeStream
+                User::RequestComplete( iCallerStatus, KErrNotFound );
+                return;
+                }    
+            // Export item from database
+            if ( iTXEntryType == ENSmlICal )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: Export - iCal DB"));
+                agendautil->iExporter->ExportICalL( *agendautil->iEntry, writeStream );
+                aMimeType = iOwnFormat->MimeFormat( 1 ).MimeType().DesC();
+                aMimeVer = iOwnFormat->MimeFormat( 1 ).MimeVersion().DesC();
+                }
+            else if ( iTXEntryType == ENSmlVCal )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: Export - vCal DB"));
+                agendautil->iExporter->ExportVCalL( *agendautil->iEntry, writeStream );
+                aMimeType = iOwnFormat->MimeFormat( 0 ).MimeType().DesC();
+                aMimeVer = iOwnFormat->MimeFormat( 0 ).MimeVersion().DesC();
+                }
+            else
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: Export - DB Not Supported"));
+                delete agendautil;
+                delete calfilename;
+                CleanupStack::PopAndDestroy( &writeStream ); 
+                User::RequestComplete( iCallerStatus, KErrNotSupported );
+                return;
+                }
+            writeStream.CommitL();
+            iItemData->Compress();
+            iPos = 0;
+     
+            iDataMod->StripTxL( *iItemData );
+            delete agendautil;
+            delete calfilename;
+            }
+    	    break;
+	    default:
+    	    {
+    	    iDataMimeType = ENSmlNone;
+    	    CleanupStack::PopAndDestroy( ); // writeStream
+    	    User::RequestComplete( iCallerStatus, KErrNotFound );
+    	    return;
+    	    }
 	    }
-	else
-	    {
-	    _DBG_FILE("CNSmlAgendaDataStore::DoOpenItemL: Export - DB Not Supported");
-	    CleanupStack::PopAndDestroy( 2 ); // writeStream, entry
-	    User::RequestComplete( iCallerStatus, KErrNotSupported );
-		return;
-	    }
-	
-	writeStream.CommitL();
-	iItemData->Compress();
-	iPos = 0;
+    
+	CleanupStack::PopAndDestroy( ); // writeStream
 	
-#ifdef __NSML_MORE_DEBUG_FOR_ITEMS__
-
-	DBG_DUMP( ( void* )iItemData->Ptr( 0 ).Ptr(), iItemData->Size(),
-	         _S8( "Item from database:" ) );
-
-#endif // __NSML_MORE_DEBUG_FOR_ITEMS__
-
+	FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: destroying the stream"));
 	
-	iDataMod->StripTxL( *iItemData );
-	CleanupStack::PopAndDestroy( 2 ); // writeStream, entry
-	
-#ifdef __NSML_MORE_DEBUG_FOR_ITEMS__
-
-	DBG_DUMP( ( void* )iItemData->Ptr( 0 ).Ptr(), iItemData->Size(),
-	         _S8( "Item from database after strip:" ) );
-
-#endif // __NSML_MORE_DEBUG_FOR_ITEMS__
-	
-	aFieldChange = EFalse;
+	// Set the Size
 	aSize = iItemData->Size();
 	
 	iState = ENSmlItemOpen;
 	
+	FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: user complete"));
+	
 	if ( iServerMaxObjectSize == 0 || aSize <= iServerMaxObjectSize )
 		{
+		FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: error none"));
 		User::RequestComplete( iCallerStatus, KErrNone );
 		}
 	else
 		{
+		FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: error too big"));
 		User::RequestComplete( iCallerStatus, KErrTooBig );
 		}
-		
-	_DBG_FILE("CNSmlAgendaDataStore::DoOpenItemL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -597,87 +700,159 @@
 // buffered.
 // -----------------------------------------------------------------------------
 //
-void CNSmlAgendaDataStore::DoCreateItemL( TSmlDbItemUid& aUid, TInt aSize,
-                TSmlDbItemUid /*aParent*/, const TDesC8& aMimeType,
-                const TDesC8& /*aMimeVer*/, TRequestStatus& aStatus )
+void CNSmlAgendaDataStore::DoCreateItemL( TSmlDbItemUid& aUid,
+                                          TInt aSize,
+                                          TSmlDbItemUid aParent,
+                                          const TDesC8& aMimeType,
+                                          const TDesC8& /*aMimeVer*/,
+                                          TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL: BEGIN"));
+	FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL: Parent id: '%d'"), aParent);
+	FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL: UID: '%d'"), aUid);
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 	iAddItemId = &aUid;
 	
-	if ( iState != ENSmlOpenAndWaiting )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotReady );
-		_DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL - KErrNotReady: END");
-		return;
-		}
-		
-	if ( KNSmlAgendaOwnMaxObjectSize < aSize )
-		{
-		User::RequestComplete( iCallerStatus, KErrTooBig );
-		_DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL - KErrTooBig: END");
-		return;
-		}
-		
-	if( SysUtil::DiskSpaceBelowCriticalLevelL( &iRfs, aSize, iDrive ) )
-		{
-		User::RequestComplete( iCallerStatus, KErrDiskFull );
-		_DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL - KErrDiskFull: END");
-		return;
-		}
-
-    // Check if MIME type of new item is supported
-	TBool mimeFound( EFalse );
-	// vCal
-    if ( iOwnFormat->MimeFormat( 0 ).MimeType().DesC().Compare( aMimeType )
-         == 0 )
-	    {
-	    _DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL: received vCal");
-	    mimeFound = ETrue;
-	    iRXEntryType = ENSmlVCal;
-	    }
-	        
-#ifdef __NSML_USE_ICAL_FEATURE
-
-     // iCal
-    else if ( iOwnFormat->MimeFormat( 1 ).MimeType().DesC().Compare( aMimeType )
-              == 0 ) 
+    //Leave if Data Store is in wrong state
+    if ( iState != ENSmlOpenAndWaiting )
         {
-        _DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL: received iCal");
-        mimeFound = ETrue;
-	    iRXEntryType = ENSmlICal;
+        User::RequestComplete( iCallerStatus, KErrNotReady );
+        FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL - KErrNotReady: END"));
+        return;
         }
 
+    // Leave if item is larger than we support
+    if ( KNSmlAgendaOwnMaxObjectSize < aSize )
+        {
+        User::RequestComplete( iCallerStatus, KErrTooBig );
+        FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL - KErrTooBig: END"));
+        return;
+        }
+        
+    // Check the drive free space
+    if( SysUtil::DiskSpaceBelowCriticalLevelL( &iRfs, aSize, iDrive ) )
+        {
+        User::RequestComplete( iCallerStatus, KErrDiskFull );
+        FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL - KErrDiskFull: END"));
+        return;
+        }
+    
+    // Check the MIME type
+    if ( 0 == iOwnFormat->MimeFormat( 0 ).MimeType().DesC().Compare( aMimeType ) )
+        {
+        // vcal
+        FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL: received vCal"));
+        iRXEntryType = ENSmlVCal;
+        iDataMimeType = ENSmlCalendar;
+        
+        TInt err( KErrNone );
+        // Check the Sync Status
+        if( iIsHierarchicalSyncSupported )
+            {   
+            FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL Supports Hierarchichal"));
+            // Check that parent exists
+            iParentItemId = aParent;
+            if ( iParentItemId == KDbItemUidRoot 
+                 && iDataMimeType == ENSmlCalendar )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL: ParentId is NULL"));
+                iParentItemId = NULL;
+                iOrphanEvent = ETrue;
+                iParentItemId = KDbPersonal;
+                }
+          
+            TInt index = KErrNotFound;
+            TInt err = KErrNone;
+            TKeyArrayFix key( 0, ECmpTInt ); // Find key for Ids.
+            
+            err = iCalOffsetArr->Find( iParentItemId, key, index );
+         
+            if( err != KErrNone && iDataMimeType == ENSmlCalendar )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL: ParentId is NotFound"));
+                iParentItemId = NULL;
+                iOrphanEvent = EFalse;
+                User::RequestComplete( iCallerStatus, KErrNotFound );
+                return;
+                }           
+            // Check the Sync Status    
+			TBool syncstatus( EFalse );   
+            TRAP( err, syncstatus = iAgendaAdapterHandler->FolderSyncStatusL( iParentItemId ) );
+            if( err || !syncstatus  )
+                {
+                iOrphanEvent = EFalse;
+                User::RequestComplete( iCallerStatus, err );
+                FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL - Sync Disabled: END"));
+                return;
+                }
+            }
+        else
+            {
+            TBool syncstatus( EFalse );
+            HBufC* calfilename = iOpenedStoreName->AllocL();
+            TRAP( err, syncstatus = iAgendaAdapterHandler->FolderSyncStatusL( calfilename ) );
+            if( err || !syncstatus )
+                {
+                delete calfilename;
+                User::RequestComplete( iCallerStatus, KErrGeneral );
+                FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL - Sync Disabled: END"));
+                return;
+                }
+            delete calfilename;            
+            }
+        }
+#ifdef __NSML_USE_ICAL_FEATURE     
+    else if ( 0 == iOwnFormat->MimeFormat( 1 ).MimeType().DesC().Compare( aMimeType ) ) 
+        {
+        //ical
+        FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL: received iCal"));
+        iRXEntryType = ENSmlICal;
+        iDataMimeType = ENSmlCalendar;
+        }
 #endif // __NSML_USE_ICAL_FEATURE
-
-    // Else use original iRXEntryType
+    // RD_MULTICAL
+    else if( aMimeType == KNSmlContentTypeFolder() && iIsHierarchicalSyncSupported )
+        {
+        // Check the validity 
+        /*if ( aUid <= 0 || aParent <= 0 )
+          {
+          FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL: Corrupt ids"));
+          User::RequestComplete( iCallerStatus, KErrCorrupt );
+          return;
+          }*/
+        iDataMimeType = ENSmlFolder;
+        }
+    // RD_MULTICAL
     else
         {
-        _DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL: \
-                   mime type not received");
+        FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL: \
+                               mime type not received"));
         iRXEntryType = iTXEntryType;
+        iDataMimeType = ENSmlNone;
+        User::RequestComplete( iCallerStatus, KErrNotSupported );
+        FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL: end with leave"));
+        return;
         }
-
-	if ( !mimeFound )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotSupported );
-		_DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL -KErrNotSupported: END");
-		return;
-		}
+    
+    // TODO: Any other validation is required ?  
+    
+    // Register snapshots if needed
+    if( !iSnapshotRegistered )
+        {
+        RegisterSnapshotL();
+        }
+    
+    // Buffer is reinitialized
+    delete iItemData;
+    iItemData = NULL;
+    iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
+    iPos = 0;
+    
+    iState = ENSmlItemCreating;
+    User::RequestComplete( iCallerStatus, KErrNone );
 
-	if( !iSnapshotRegistered )
-		{
-		RegisterSnapshotL();
-		}
-	delete iItemData;
-	iItemData = NULL;
-	iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
-	iPos = 0;
-	
-	iState = ENSmlItemCreating;
-	User::RequestComplete( iCallerStatus, KErrNone );
-	_DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoCreateItemL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -686,80 +861,171 @@
 // writes item's data as buffered.
 // -----------------------------------------------------------------------------
 //
-void CNSmlAgendaDataStore::DoReplaceItemL( TSmlDbItemUid aUid, TInt aSize,
-                TSmlDbItemUid /*aParent*/, TBool aFieldChange,
-                TRequestStatus& aStatus )
+void CNSmlAgendaDataStore::DoReplaceItemL( TSmlDbItemUid aUid,
+                                           TInt aSize,
+                                           TSmlDbItemUid aParent,
+                                           TBool aFieldChange,
+                                           TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoReplaceItemL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL: BEGIN"));
+	FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL: Parent id: '%d'"), aParent);
+	FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL: UID: '%d'"), aUid);
+	
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
+	TInt err( KErrNone );
 	
-	if ( iState != ENSmlOpenAndWaiting )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotReady );
-		_DBG_FILE("CNSmlAgendaDataStore::DoReplaceItemL - KErrNotReady: END");
-		return;
-		}
-
-	if ( KNSmlAgendaOwnMaxObjectSize < aSize )
-		{
-		User::RequestComplete( iCallerStatus, KErrTooBig );
-		_DBG_FILE("CNSmlAgendaDataStore::DoReplaceItemL - KErrTooBig: END");
-		return;
-		}
+    // Leave if Data Store is in wrong state
+    if ( iState != ENSmlOpenAndWaiting )
+        {
+        User::RequestComplete( iCallerStatus, KErrNotReady );
+        FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL - KErrNotReady: END"));
+        return;
+        }
 
-	if ( aFieldChange )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotSupported );
-		_DBG_FILE("CNSmlAgendaDataStore::DoReplaceItemL \
-		           - KErrNotSupported: END");
-		return;
-		}
-	if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iRfs, aSize, iDrive ) )
-		{
-		User::RequestComplete( iCallerStatus, KErrDiskFull );
-		_DBG_FILE("CNSmlAgendaDataStore::DoReplaceItemL - KErrDiskFull: END");
-		return;
-		}
-	
- 	iReplaceItemId = aUid;
-
- 	CCalEntry* entry = NULL;
- 	TInt err( KErrNone );
-    TRAP( err, entry = iEntryView->FetchL( aUid ) );
-	CleanupStack::PushL( entry );
- 		
-	if ( !entry || err == KErrNotFound )
-		{
-		CleanupStack::PopAndDestroy( entry ); // entry
-		User::RequestComplete( iCallerStatus, KErrNotFound );
-		_DBG_FILE("CNSmlAgendaDataStore::DoReplaceItemL - KErrNotFound: END");
-		return;
-		}
-    else if ( err )
+    // Leave if item is larger than we support
+    if ( KNSmlAgendaOwnMaxObjectSize < aSize )
         {
-		CleanupStack::PopAndDestroy( entry ); // entry
-		User::RequestComplete( iCallerStatus, err );
-		_DBG_FILE("CNSmlAgendaDataStore::DoReplaceItemL - Error: END");
-		return;
+        User::RequestComplete( iCallerStatus, KErrTooBig );
+        FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL - KErrTooBig: END"));
+        return;
         }
 
-	CleanupStack::PopAndDestroy( entry ); // entry
-		
-	if ( !iSnapshotRegistered )
-		{
-		RegisterSnapshotL();
-		}
-		
-	delete iItemData;
-	iItemData = NULL;
-	iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
-	iPos = 0;
-	iReplaceItemId = aUid;
+    // This adapter does not support Field Level sync
+    if ( aFieldChange )
+        {
+        User::RequestComplete( iCallerStatus, KErrNotSupported );
+        FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL \
+                   - KErrNotSupported: END"));
+        return;
+        }
+    
+    // Check the drive free space
+    if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iRfs, aSize, iDrive ) )
+        {
+        User::RequestComplete( iCallerStatus, KErrDiskFull );
+        FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL - KErrDiskFull: END"));
+        return;
+        }
+    
+    // Check the Sync Status
+    if( iIsHierarchicalSyncSupported )
+        {
+        TCalLocalUid parentid( aParent );
+        TCalLocalUid entryid( aUid );
+        
+        TRAP( err, GetCalendarEntryIdL( parentid, entryid ));
+        if ( err )
+            {
+            FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL: Invalid UID"));
+            User::RequestComplete( iCallerStatus, KErrGeneral );
+            FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL - Sync Disabled: END"));
+            return;
+            }         
+        TBool syncstatus( EFalse );
+        TRAP( err, syncstatus = iAgendaAdapterHandler->FolderSyncStatusL( parentid ) );
+        if( err || !syncstatus  )
+            {
+            User::RequestComplete( iCallerStatus, err );
+            FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL - Sync Disabled: END"));
+            return;
+            }
+        }
+    else
+        {
+        TBool syncstatus( EFalse );
+        HBufC* calfilename = iOpenedStoreName->AllocL();
+        TRAP( err, syncstatus = iAgendaAdapterHandler->FolderSyncStatusL( calfilename ) );
+        if( err || !syncstatus )
+            {
+            delete calfilename;
+            User::RequestComplete( iCallerStatus, KErrGeneral );
+            FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL - Sync Disabled: END"));
+            return;
+            }
+        delete calfilename;            
+        }
+    
+    // Determine the Mime Type
+    DataMimeType( aUid ); 
+    switch( iDataMimeType )
+        {
+        case ENSmlFolder:
+            {
+            iReplaceItemId = aUid;
+            }
+            break;
+        case ENSmlCalendar:
+            {
+            CNSmlAgendaDataStoreUtil* agendautil = NULL;
+            HBufC* calfilename = NULL;
+            iParentItemId = aParent;
+            
+            if( iIsHierarchicalSyncSupported )
+                {
+                iReplaceItemId = aUid - aParent;
+                //Get the Folder Information
+                TRAP(err, calfilename = iAgendaAdapterHandler->FolderNameL( aParent ));
+                }
+            else
+                {
+                iReplaceItemId = aUid;
+                calfilename = iOpenedStoreName->AllocL();
+                }
+                
+            if( err != KErrNone || NULL == calfilename )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL:Invalid CalendarInfo"));
+                User::RequestComplete( iCallerStatus, KErrNotFound );
+                return;
+                }
+            
+            FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL: entry id to be fetched: '%d'"), iReplaceItemId);             
+            agendautil = CNSmlAgendaDataStoreUtil::NewL();
+            if( agendautil )
+                {
+                CleanupStack::PushL(agendautil);
+                TRAP(err, agendautil->InitializeCalAPIsL( calfilename, iReplaceItemId ));
+                CleanupStack::Pop(agendautil);
+                }
+                
+            if ( err || !agendautil )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL: entry is not valid"));  
+                delete agendautil;
+                delete calfilename;             
+                User::RequestComplete( iCallerStatus, KErrNotFound );               
+                return;
+                }
+            delete agendautil;
+            delete calfilename;  
+            }
+            break;
+        default:
+            {
+            iDataMimeType = ENSmlNone;
+            User::RequestComplete( iCallerStatus, KErrNotSupported );
+            FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL \
+                       - KErrNotSupported: END"));
+            return;
+            }
+        }
+    
+    if ( !iSnapshotRegistered )
+        {
+        RegisterSnapshotL();
+        }
+   
+    //Reinitialize the Buffer
+    delete iItemData;
+    iItemData = NULL;
+    iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
+    iPos = 0;
+    
+    iState = ENSmlItemUpdating;
+    User::RequestComplete( iCallerStatus, KErrNone );
 	
-	iState = ENSmlItemUpdating;
-	User::RequestComplete( iCallerStatus, KErrNone );
-	_DBG_FILE("CNSmlAgendaDataStore::DoReplaceItemL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -769,7 +1035,7 @@
 //
 void CNSmlAgendaDataStore::DoReadItemL( TDes8& aBuffer )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoReadItemL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoReadItemL: BEGIN"));
     if ( iState != ENSmlItemOpen || !iItemData )
         {
         iPos = -1;
@@ -791,7 +1057,7 @@
         iItemData->Read( iPos, aBuffer, iItemData->Size() - iPos );
         iPos = -1;
         }
-	_DBG_FILE("CNSmlAgendaDataStore::DoReadItemL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoReadItemL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -801,7 +1067,7 @@
 //
 void CNSmlAgendaDataStore::DoWriteItemL( const TDesC8& aData )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoWriteItemL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoWriteItemL: BEGIN"));
 	if ( iState == ENSmlItemCreating || iState == ENSmlItemUpdating )
 		{
 		if ( iItemData )
@@ -816,7 +1082,7 @@
 			}
 		}
 	User::Leave( KErrNotReady );
-	_DBG_FILE("CNSmlAgendaDataStore::DoWriteItemL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoWriteItemL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -826,34 +1092,63 @@
 //
 void CNSmlAgendaDataStore::DoCommitItemL( TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitItemL: BEGIN");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	
-	if ( iState != ENSmlItemCreating && iState != ENSmlItemUpdating )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotReady );
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitItemL - KErrNotReady: END");
-		return;
-		}
-	
-	iItemData->Compress();
-	TInt error( KErrNone );
-	
-	if ( iState == ENSmlItemCreating )
-		{
-		TRAP( error, DoCommitCreateItemL() );
-		}
-	else // ENSmlItemUpdating
-		{
-        TRAP( error, DoCommitReplaceItemL() );
-		}
-	iReplaceItemId = -1;
-	iPos = -1;
-	iState = ENSmlOpenAndWaiting;
-	iRXEntryType = iTXEntryType;
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitItemL: BEGIN"));
+    iCallerStatus = &aStatus;
+    *iCallerStatus = KRequestPending;
+    
+    // Leave if Data Store is in wrong state
+    if ( iState != ENSmlItemCreating && iState != ENSmlItemUpdating )
+        {
+        User::RequestComplete( iCallerStatus, KErrNotReady );
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitItemL - KErrNotReady: END"));
+        return;
+        }
+    
+    iItemData->Compress();
+    TInt error( KErrNone );
+    
+    // RD_MULTICAL
+    switch(iDataMimeType)
+        {
+        case ENSmlCalendar:
+            {
+            if( iState == ENSmlItemCreating )
+                {
+                TRAP( error, DoCommitCreateCalItemL() );
+                }
+            else
+                {
+                TRAP( error, DoCommitReplaceCalItemL() );
+                }
+            }
+            break;
+        case ENSmlFolder:
+            {
+            if( iState == ENSmlItemCreating )
+                {
+                TRAP( error, DoCommitCreateFolderItemL() );
+                }
+            else
+                {
+                TRAP( error, DoCommitReplaceFolderItemL() );
+                }
+            }
+            break;
+        default:
+            {
+            FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateItemL - \
+                                           KErrNotSupported: END"));
+            User::Leave( KErrNotSupported );
+            }                
+        }
+    // RD_MULTICAL
+    
+    iReplaceItemId = -1;
+    iPos = -1;
+    iState = ENSmlOpenAndWaiting;
+    iRXEntryType = iTXEntryType;
     User::RequestComplete( iCallerStatus, error );    
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitItemL: END");
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitItemL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -863,13 +1158,13 @@
 //
 void CNSmlAgendaDataStore::DoCloseItem()
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoCloseItem: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoCloseItem: BEGIN"));
 	if ( iState == ENSmlItemOpen )
 		{
 		iPos = -1;
 		iState = ENSmlOpenAndWaiting;
 		}
-	_DBG_FILE("CNSmlAgendaDataStore::DoCloseItem: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoCloseItem: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -878,18 +1173,16 @@
 // -----------------------------------------------------------------------------
 //
 void CNSmlAgendaDataStore::DoMoveItemL( TSmlDbItemUid /*aUid*/,
-            TSmlDbItemUid /*aNewParent*/, TRequestStatus& aStatus )
+                                        TSmlDbItemUid /*aNewParent*/,
+                                        TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoMoveItemL: BEGIN");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if ( iState != ENSmlOpenAndWaiting )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotReady );
-		return;
-		}
-	User::RequestComplete( iCallerStatus, KErrNotSupported );
-	_DBG_FILE("CNSmlAgendaDataStore::DoMoveItemL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoMoveItemL: BEGIN"));
+	
+    iCallerStatus = &aStatus;
+    *iCallerStatus = KRequestPending;
+    User::RequestComplete( iCallerStatus, KErrNotSupported );
+	    
+	FLOG(_L("CNSmlAgendaDataStore::DoMoveItemL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -898,46 +1191,234 @@
 // -----------------------------------------------------------------------------
 //
 void CNSmlAgendaDataStore::DoDeleteItemL( TSmlDbItemUid aUid,
-                TRequestStatus& aStatus )
+                                          TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoDeleteItemL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL: BEGIN"));
+	FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL: aUid: '%d'"), aUid);
+	
+	TInt err(KErrNone);
 	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if ( iState != ENSmlOpenAndWaiting )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotReady );
-		return;
-		}
-
-    CCalEntry* entry = NULL;
-    TInt err( KErrNone );
-    TRAP( err, entry = iEntryView->FetchL( aUid ) );
-    CleanupStack::PushL( entry );	
+    *iCallerStatus = KRequestPending;
+    
+    // Leave is Data Store is in wrong state
+    if ( iState != ENSmlOpenAndWaiting )
+        {
+        User::RequestComplete( iCallerStatus, KErrNotReady );
+        return;
+        }
+    
+    //Check validity of UID
+    if ( aUid <= 0 )
+        {
+        User::RequestComplete( iCallerStatus, KErrCorrupt );
+        return;
+        }
 
-	if ( !entry || err == KErrNotFound )
-		{
-		CleanupStack::PopAndDestroy( entry ); // entry
-		User::RequestComplete( iCallerStatus, KErrNotFound );
-		return;
-		}
-	else if ( err )
-	    {
-	    CleanupStack::PopAndDestroy( entry ); // entry
-		User::RequestComplete( iCallerStatus, err );
-		return;
-	    }
+    // Check the Sync Status
+    if( iIsHierarchicalSyncSupported )
+        {
+        TCalLocalUid parentid( NULL );
+        TCalLocalUid entryid( aUid );
+       
+        TRAP( err, GetCalendarEntryIdL( parentid, entryid ));
+        if ( err )
+            {
+            FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL: Invalid UID"));
+            User::RequestComplete( iCallerStatus, KErrGeneral );
+            FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL - Sync Disabled: END"));
+            return;
+            }    
+        TBool syncstatus( EFalse );
+        TRAP( err, syncstatus = iAgendaAdapterHandler->FolderSyncStatusL( parentid ) );
+        if( err || !syncstatus )
+            {
+            User::RequestComplete( iCallerStatus, err );
+            FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL - Sync Disabled: END"));
+            return;
+            }
+        }
+     else
+        {
+        TBool syncstatus( EFalse );
+        HBufC* calfilename = iOpenedStoreName->AllocL();
+        TRAP( err, syncstatus = iAgendaAdapterHandler->FolderSyncStatusL( calfilename ) );
+        if( err || !syncstatus )
+            {
+            delete calfilename;
+            User::RequestComplete( iCallerStatus, KErrGeneral );
+            FLOG(_L("CNSmlAgendaDataStore::DoReplaceItemL - Sync Disabled: END"));
+            return;
+            }
+        delete calfilename;            
+        }
+     
+    //Determine the Mime Type
+    DataMimeType( aUid );
+    switch( iDataMimeType )
+        {
+        case ENSmlFolder:
+            {        
+            HBufC* calfilename = NULL;
+            //Get the Calendar information
+            TRAP(err, calfilename = iAgendaAdapterHandler->FolderNameL(aUid) );
+            if( err != KErrNone || NULL == calfilename )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL:Invalid CalendarInfo"));
+                User::RequestComplete( iCallerStatus, KErrNotFound );
+                return;
+                }
+            
+            FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL: name exists"));
+            CCalSession* vCalSession = CCalSession::NewL();
+            CleanupStack::PushL(vCalSession);
+            vCalSession->OpenL(calfilename->Des());
+            FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL: before deleting"));
+            TRAP(err, vCalSession->DeleteCalFileL(calfilename->Des()));
+            FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL: after deleting err: '%d'"), err);
+            if( err == KErrInUse )
+                {
+                // Delete all the entries associated with this CalFile
+                CNSmlAgendaDataStoreUtil* agendautil = NULL;
+                TBuf8<KBuffLength> keyBuff;
+                TInt aNumSuccessfulDeleted( 0 );
+                RArray<TCalLocalUid> uidArray;
+                CleanupClosePushL( uidArray );
+                TCalTime zeroTime;
+                zeroTime.SetTimeUtcL( Time::NullTTime() );
+                
+                agendautil = CNSmlAgendaDataStoreUtil::NewL();
+                if( agendautil )
+                    {
+                    CleanupStack::PushL(agendautil);
+                    TRAP(err, agendautil->InitializeCalAPIsL( calfilename ));
+                    CleanupStack::Pop(agendautil);
+                    }                      
+                if ( err || !agendautil )
+                    {
+                    FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL:Invalid CalendarInfo"));
+                    delete calfilename;
+                    User::RequestComplete( iCallerStatus, KErrNotFound );
+                    return;
+                    }            
+                agendautil->iEntryView->GetIdsModifiedSinceDateL( zeroTime, uidArray );
+                // ... and then delete them
+                agendautil->iEntryView->DeleteL( uidArray, aNumSuccessfulDeleted );
+                CleanupStack::PopAndDestroy( &uidArray ); // uidArray
+                delete agendautil;    
+                
+                // Get the CalFile
+                CCalCalendarInfo* caleninfo = vCalSession->CalendarInfoL();
+                CleanupStack::PushL(caleninfo);
+                
+                // Mark the CalFile as Hidden
+                caleninfo->SetEnabled( EFalse );
+                            
+                // Set the SyncStatus to False
+                keyBuff.Zero();
+                keyBuff.AppendNum( ESyncStatus );
+                TBool syncstatus( EFalse );
+                TPckgC<TBool> pckgSyncStatusValue( syncstatus );
+                caleninfo->SetPropertyL( keyBuff, pckgSyncStatusValue );
+                
+                // Mark the meta property as SoftDeleted
+                keyBuff.Zero();
+                keyBuff.AppendNum(EMarkAsDelete);
+                TPckgC<TBool> pkgSoftDelete( ETrue );
+                caleninfo->SetPropertyL(keyBuff, pkgSoftDelete);
+                
+                vCalSession->SetCalendarInfoL( *caleninfo );
+                CleanupStack::PopAndDestroy(caleninfo);            
+                }
+            else if( err != KErrNone )
+                {
+                CleanupStack::PopAndDestroy(vCalSession);
+                delete calfilename;
+                User::RequestComplete( iCallerStatus, KErrGeneral );
+                return;
+                }
+            CleanupStack::PopAndDestroy(vCalSession);            
+            delete calfilename;  
+            
+            //Update the array
+            TInt index = KErrNotFound;
+            TInt err = KErrNone;
+            TKeyArrayFix key( 0, ECmpTInt ); // Find key for Ids.
+       
+            err = iCalOffsetArr->Find( aUid, key, index );
+                  
+            if( err == KErrNone )
+                {
+                iCalOffsetArr->Delete(index);
+                FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL: updated the array"));
+                }
+            }
+            break;
+        case ENSmlCalendar:
+            {
+            CNSmlAgendaDataStoreUtil* agendautil = NULL;
+            HBufC* calfilename = NULL;
+            TCalLocalUid parentid(NULL);
+            TCalLocalUid entryid(aUid);
+            TInt err( KErrNone );
+            
+            if( iIsHierarchicalSyncSupported )
+                {
+                TRAP( err, GetCalendarEntryIdL( parentid, entryid ));
+                if ( err )
+                    {
+                    FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL:Parent Id is not Valid one"));
+                    User::RequestComplete( iCallerStatus, KErrNotFound );
+                    return;
+                    }
+                //Get the Folder Information
+                TRAP(err, calfilename = iAgendaAdapterHandler->FolderNameL(parentid) );
+                }
+            else
+                {
+                calfilename = iOpenedStoreName->AllocL();
+                }
+                
+            if( err != KErrNone || NULL == calfilename )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL:Invalid CalendarInfo"));
+                User::RequestComplete( iCallerStatus, KErrNotFound );
+                return;
+                }
+            
+            agendautil = CNSmlAgendaDataStoreUtil::NewL();
+            if( agendautil )
+                {
+                CleanupStack::PushL(agendautil);
+                TRAP(err, agendautil->InitializeCalAPIsL( calfilename, entryid ));
+                CleanupStack::Pop(agendautil);
+                }                      
+            if ( err || !agendautil )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::DoOpenItemL: entry is not valid"));
+                delete agendautil;
+                delete calfilename;
+                User::RequestComplete( iCallerStatus, KErrNotFound );
+                return;
+                }                
+            agendautil->iEntryView->DeleteL( *agendautil->iEntry );
+            delete agendautil;
+            delete calfilename;
+            }
+            break;
+        default:
+            break;
+        }
+    
+    //Update the Snapshots
+    if ( iChangeFinder )
+        {
+        TNSmlSnapshotItem item( aUid );
+        iChangeFinder->ItemDeleted( item );        
+        }
+        
+    User::RequestComplete( iCallerStatus, KErrNone );
 	    
-    iEntryView->DeleteL( *entry );
-	CleanupStack::PopAndDestroy( entry ); // entry
-	
-	if ( iChangeFinder )
-		{
-		TNSmlSnapshotItem item( aUid );
-		iChangeFinder->ItemDeleted( item );
-		}
-		
-	User::RequestComplete( iCallerStatus, KErrNone );
-	_DBG_FILE("CNSmlAgendaDataStore::DoDeleteItemL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoDeleteItemL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -946,13 +1427,13 @@
 // -----------------------------------------------------------------------------
 //
 void CNSmlAgendaDataStore::DoSoftDeleteItemL( TSmlDbItemUid /*aUid*/,
-                TRequestStatus& aStatus )
+                                              TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoSoftDeleteItemL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoSoftDeleteItemL: BEGIN"));
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 	User::RequestComplete( iCallerStatus, KErrNotSupported );
-	_DBG_FILE("CNSmlAgendaDataStore::DoSoftDeleteItemL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoSoftDeleteItemL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -962,40 +1443,62 @@
 //
 void CNSmlAgendaDataStore::DoDeleteAllItemsL( TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoDeleteAllItemsL: BEGIN");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if ( iState != ENSmlOpenAndWaiting ) 
-		{
-		User::RequestComplete( iCallerStatus, KErrNotReady );
-		return;
-		}
-
-	// Delete all items
-	// First searh every UIDs ...
-	TInt aNumSuccessfulDeleted( 0 );
-	RArray<TCalLocalUid> uidArray;
-	CleanupClosePushL( uidArray );
-	TCalTime zeroTime;
-	zeroTime.SetTimeUtcL( Time::NullTTime() );
-	iEntryView->GetIdsModifiedSinceDateL( zeroTime, uidArray );
-	
-	
-	// ... and then delete them
-    iEntryView->DeleteL( uidArray, aNumSuccessfulDeleted );
-	CleanupStack::PopAndDestroy( &uidArray ); // uidArray
-
-	iSnapshotRegistered = EFalse;
+    FLOG(_L("CNSmlAgendaDataStore::DoDeleteAllItemsL: BEGIN"));
+    iCallerStatus = &aStatus;
+    *iCallerStatus = KRequestPending;
+    if ( iState != ENSmlOpenAndWaiting ) 
+        {
+        User::RequestComplete( iCallerStatus, KErrNotReady );
+        return;
+        }
+    
+    if( iIsHierarchicalSyncSupported )
+        {
+        // TODO: Have to enable once the delete issue is fixed by Organizer
+        FLOG(_L("CNSmlAgendaDataStore::DoDeleteAllItemsL: Temporarily doesnot support"));
+        User::RequestComplete( iCallerStatus, KErrNotSupported );
+        return;
+        }
+    else
+        {
+        CNSmlAgendaDataStoreUtil* agendautil = NULL;
+        HBufC* calfilename = NULL;
+        
+        agendautil = CNSmlAgendaDataStoreUtil::NewL();
+        calfilename = iOpenedStoreName->AllocL();
+        if( agendautil )
+            {
+            CleanupStack::PushL(agendautil);
+            agendautil->InitializeCalAPIsL( calfilename ); 
+            CleanupStack::Pop(agendautil);
+            // Delete all items
+            // First searh every UIDs ...
+            TInt aNumSuccessfulDeleted( 0 );
+            RArray<TCalLocalUid> uidArray;
+            CleanupClosePushL( uidArray );
+            TCalTime zeroTime;
+            zeroTime.SetTimeUtcL( Time::NullTTime() );
+            agendautil->iEntryView->GetIdsModifiedSinceDateL( zeroTime, uidArray );
+            
+            // ... and then delete them
+            agendautil->iEntryView->DeleteL( uidArray, aNumSuccessfulDeleted );
+            CleanupStack::PopAndDestroy( &uidArray ); // uidArray            
+            }
+        delete agendautil;
+        delete calfilename;
+        }
+        
+    iSnapshotRegistered = EFalse;
+    
     // Update changefinder
-	if ( iChangeFinder )
-		{
-		iChangeFinder->ResetL();
-		RegisterSnapshotL();
-		}
-	
-	User::RequestComplete( iCallerStatus, KErrNone );
-	
-	_DBG_FILE("CNSmlAgendaDataStore::DoDeleteAllItemsL: END");
+    if ( iChangeFinder )
+        {
+        iChangeFinder->ResetL();
+        RegisterSnapshotL();
+        }
+    User::RequestComplete( iCallerStatus, KErrNone );
+    
+    FLOG(_L("CNSmlAgendaDataStore::DoDeleteAllItemsL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -1005,7 +1508,7 @@
 //
 TBool CNSmlAgendaDataStore::DoHasSyncHistory() const
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoHasSyncHistory: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoHasSyncHistory: BEGIN"));
 	TBool ret = EFalse;
 	if ( iHasHistory )
 		{
@@ -1022,7 +1525,7 @@
 		{
 		iChangeFinder->SetDataStoreUid( iOpenedStoreId );
 		}
-	_DBG_FILE("CNSmlAgendaDataStore::DoHasSyncHistory: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoHasSyncHistory: END"));
 	return ret;
     }
 
@@ -1033,13 +1536,40 @@
 //
 const MSmlDataItemUidSet& CNSmlAgendaDataStore::DoAddedItems() const
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoAddedItems: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoAddedItems: BEGIN"));
 	if ( iState == ENSmlOpenAndWaiting )
 		{
 		iNewUids->Reset();
 		TRAP_IGNORE( iChangeFinder->FindNewItemsL( *iNewUids ) );
+		
+		// RD_MULTICAL		
+        if( iIsHierarchicalSyncSupported )
+            {
+            CNSmlDataItemUidSet* inactiveuids = NULL;
+            TRAP_IGNORE(inactiveuids = ActiveItemsL( *iNewUids ));
+            delete inactiveuids;
+            }
+        else
+            {
+            TBool syncstatus( EFalse );
+            HBufC* calfilename = NULL;
+            TRAP_IGNORE( calfilename = iOpenedStoreName->AllocL() );
+            TRAP_IGNORE( syncstatus = iAgendaAdapterHandler->FolderSyncStatusL( calfilename ) );
+            if( !syncstatus )
+                {
+                iNewUids->Reset();
+                }
+            delete calfilename;
+            }
+        // RD_MULTICAL		
 		}
-	_DBG_FILE("CNSmlAgendaDataStore::DoAddedItems: END");
+	
+	for( TInt count = 0; count < iNewUids->ItemCount(); count++ )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoAddedItems: list '%d'"), iNewUids->ItemAt(count) );
+        }
+	
+	FLOG(_L("CNSmlAgendaDataStore::DoAddedItems: END"));
 	return *iNewUids;
     }
 
@@ -1050,13 +1580,93 @@
 //
 const MSmlDataItemUidSet& CNSmlAgendaDataStore::DoDeletedItems() const
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoDeletedItems: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoDeletedItems: BEGIN"));
 	if ( iState == ENSmlOpenAndWaiting )
 		{
 		iDeletedUids->Reset();
-		TRAP_IGNORE( iChangeFinder->FindDeletedItemsL( *iDeletedUids ) );
+		TRAP_IGNORE( iChangeFinder->FindDeletedItemsL( *iDeletedUids ) );		
+	
+    	// RD_MULTICAL
+    	if( iIsHierarchicalSyncSupported )
+    	    {
+        	CArrayFixFlat<TInt>* folderuidarr; 
+        	CNSmlDataItemUidSet* tempdeleteuids; 
+        	TSmlDbItemUid uid(0);
+        	
+        	folderuidarr = new CArrayFixFlat<TInt>( KArrayGranularity );
+        	tempdeleteuids= new CNSmlDataItemUidSet();
+        	
+        	// Get the list of Folder ids
+        	for( TInt count =0; count < iDeletedUids->ItemCount(); count++ )
+                {
+                uid = iDeletedUids->ItemAt(count);
+                
+                if( 0 == (uid % iCalOffsetVal) )
+                    {
+                    TRAP_IGNORE( folderuidarr->AppendL(uid) );
+                    FLOG(_L("CNSmlAgendaDataStore::DoDeletedItems: Folderuid: '%d'"), uid);
+                    }        
+                }
+        	
+        	CNSmlDataItemUidSet* inactiveuids = NULL;
+        	TRAP_IGNORE( inactiveuids = ActiveItemsL( *iDeletedUids ) );
+            delete inactiveuids;
+        	
+        	if( folderuidarr->Count() > 0 )
+        	    {
+        	    TInt index = KErrNotFound;
+                TInt err = KErrNone;
+                TKeyArrayFix key( 0, ECmpTInt ); // Find key for Ids.
+                
+                // Fill the temp uid array
+                for (TInt folderidcount = 0; folderidcount< folderuidarr->Count(); folderidcount++)
+                    {
+                    tempdeleteuids->AddItem(folderuidarr->At(folderidcount));
+                    }
+                
+        	    // Filter out ID's of entries for Folder deletion
+                for( TInt count =0; count < iDeletedUids->ItemCount(); count++ )
+                    {
+                    uid = iDeletedUids->ItemAt(count);
+                    uid = (uid/iCalOffsetVal)*iCalOffsetVal;
+                    err = folderuidarr->Find( uid, key, index );
+                    if (err == KErrNone)
+                        {
+                        break;
+                        }
+                    tempdeleteuids->AddItem(uid);
+                    }
+                // Store the proper UID values
+                iDeletedUids->Reset();
+                for( TInt count =0; count < tempdeleteuids->ItemCount(); count++ )
+                    {
+                    iDeletedUids->AddItem(tempdeleteuids->ItemAt(count));
+                    }
+        	    }	
+        	delete tempdeleteuids;
+        	delete folderuidarr;
+    	    }
+    	else
+    	    {
+    	    TBool syncstatus( EFalse );
+    	    HBufC* calfilename = NULL;
+    	    TRAP_IGNORE( calfilename = iOpenedStoreName->AllocL() );
+    	    TRAP_IGNORE( syncstatus = iAgendaAdapterHandler->FolderSyncStatusL( calfilename ) );
+            if( !syncstatus )
+                {
+                iDeletedUids->Reset();
+                }
+            delete calfilename;
+    	    }	    
+    	// RD_MULTICAL
 		}
-	_DBG_FILE("CNSmlAgendaDataStore::DoDeletedItems: END");
+	
+	for( TInt count = 0; count < iDeletedUids->ItemCount(); count++ )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoDeletedItems: list '%d'"), iDeletedUids->ItemAt(count) );
+        }
+	
+	FLOG(_L("CNSmlAgendaDataStore::DoDeletedItems: END"));	
 	return *iDeletedUids;
     }
 
@@ -1067,14 +1677,14 @@
 //
 const MSmlDataItemUidSet& CNSmlAgendaDataStore::DoSoftDeletedItems() const
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoSoftDeletedItems: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoSoftDeletedItems: BEGIN"));
 	if ( iState == ENSmlOpenAndWaiting )
 		{
 		iSoftDeletedUids->Reset();
 		TRAP_IGNORE(
 		    iChangeFinder->FindSoftDeletedItemsL( *iSoftDeletedUids ) );
 		}
-	_DBG_FILE("CNSmlAgendaDataStore::DoSoftDeletedItems: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoSoftDeletedItems: END"));
 	return *iSoftDeletedUids;
     }
 
@@ -1085,13 +1695,58 @@
 //
 const MSmlDataItemUidSet& CNSmlAgendaDataStore::DoModifiedItems() const
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoModifiedItems: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoModifiedItems: BEGIN"));
 	if ( iState == ENSmlOpenAndWaiting )
 		{
 		iReplacedUids->Reset();
 		TRAP_IGNORE( iChangeFinder->FindChangedItemsL( *iReplacedUids ) );
+		
+		// RD_MULTICAL
+	    if( iIsHierarchicalSyncSupported )
+            {
+            CNSmlDataItemUidSet* inactiveuids = NULL;
+            TRAP_IGNORE( inactiveuids = ActiveItemsL( *iReplacedUids ) );
+            
+            if( inactiveuids )
+                {
+                TRAP_IGNORE( InternalizeCommittedUidL() );
+                for( TInt count = 0; count < inactiveuids->ItemCount(); count++ )
+                    {
+                    TSmlDbItemUid inactiveuid = inactiveuids->ItemAt(count);
+                    FLOG(_L("CNSmlAgendaDataStore::DoModifiedItems: inactive '%d'"), inactiveuid );
+                    for( TInt uidcount = 0; uidcount < iCommittedUidArr->ItemCount(); uidcount++ )
+                        {
+                        if( inactiveuid == iCommittedUidArr->ItemAt( uidcount ) )
+                            {
+                            FLOG(_L("CNSmlAgendaDataStore::DoModifiedItems: '%d'"), inactiveuid );
+                            iReplacedUids->AddItem( inactiveuid );
+                            }
+                        }
+                    }            
+                delete inactiveuids;
+                }
+            }
+        else
+            {
+            TBool syncstatus( EFalse );
+            HBufC* calfilename = NULL;
+            TRAP_IGNORE( calfilename= iOpenedStoreName->AllocL() );
+            TRAP_IGNORE( syncstatus = iAgendaAdapterHandler->FolderSyncStatusL( calfilename ) );
+            if( !syncstatus )
+                {
+                iReplacedUids->Reset();
+                }
+            delete calfilename;
+            }	    
+        // RD_MULTICAL
 		}
-	_DBG_FILE("CNSmlAgendaDataStore::DoModifiedItems: END");
+	
+	 for( TInt count = 0; count < iReplacedUids->ItemCount(); count++ )
+	     {
+	     FLOG(_L("CNSmlAgendaDataStore::DoModifiedItems: list '%d'"), iReplacedUids->ItemAt(count) );
+	     }
+	
+	FLOG(_L("CNSmlAgendaDataStore::DoModifiedItems: END"));
 	return *iReplacedUids;
     }
 
@@ -1102,13 +1757,19 @@
 //
 const MSmlDataItemUidSet& CNSmlAgendaDataStore::DoMovedItems() const
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoMovedItems: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoMovedItems: BEGIN"));
 	if ( iState == ENSmlOpenAndWaiting )
 		{
 		iMovedUids->Reset();
 		TRAP_IGNORE( iChangeFinder->FindMovedItemsL( *iMovedUids ) );
 		}
-	_DBG_FILE("CNSmlAgendaDataStore::DoMovedItems: END");
+	
+	for( TInt count = 0; count < iMovedUids->ItemCount(); count++ )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoMovedItems: list '%d'"), iMovedUids->ItemAt(count) );
+        }
+	
+	FLOG(_L("CNSmlAgendaDataStore::DoMovedItems: END"));
 	return *iMovedUids;
     }
 
@@ -1119,7 +1780,7 @@
 //
 void CNSmlAgendaDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoResetChangeInfoL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoResetChangeInfoL: BEGIN"));
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 	if ( iState != ENSmlOpenAndWaiting ) 
@@ -1134,7 +1795,7 @@
 		RegisterSnapshotL();
 		}
 	User::RequestComplete( iCallerStatus, KErrNone );
-	_DBG_FILE("CNSmlAgendaDataStore::DoResetChangeInfoL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoResetChangeInfoL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -1145,7 +1806,7 @@
 void CNSmlAgendaDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus,
                 const MSmlDataItemUidSet& aItems )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitChangeInfoL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoCommitChangeInfoL: BEGIN"));
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 	if ( iState != ENSmlOpenAndWaiting ) 
@@ -1154,8 +1815,28 @@
 		return;
 		}
 	iChangeFinder->CommitChangesL( aItems );
+	
+	// Save the UIDs to the list
+	iCommittedUidArr->Reset();
+	for ( TInt count = 0; count < aItems.ItemCount(); count++ )
+        {
+        iCommittedUidArr->AddItem( aItems.ItemAt( count ) );
+        }
+	CNSmlDataItemUidSet* inactiveuids = NULL;
+	TRAP_IGNORE( inactiveuids = ActiveItemsL( *iCommittedUidArr ) ); 
+	delete inactiveuids;
+	
+	// Print the iCommittedUidArr array
+	FLOG(_L("CNSmlAgendaAdapter::DoCommitChangeInfoL(): CommittedUidArr"));
+    for( TInt count = 0; count < iCommittedUidArr->ItemCount(); count++ )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::iCommittedUidArr: list '%d'"), iCommittedUidArr->ItemAt(count) );
+        }   
+    
+    // Store the array in the stream
+    ExternalizeCommittedUidL();
 	User::RequestComplete( iCallerStatus, KErrNone );
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitChangeInfoL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoCommitChangeInfoL: END"));
     }
 
 // -----------------------------------------------------------------------------
@@ -1165,7 +1846,7 @@
 //
 void CNSmlAgendaDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus )
     {
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitChangeInfoL: BEGIN");
+	FLOG(_L("CNSmlAgendaDataStore::DoCommitChangeInfoL: BEGIN"));
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 	if ( iState != ENSmlOpenAndWaiting ) 
@@ -1174,8 +1855,17 @@
 		return;
 		}
 	iChangeFinder->CommitChangesL();
+    // Print the iInterCommittedUidArr array
+    FLOG(_L("CNSmlAgendaAdapter::DoCommitChangeInfoL() Without Param: CommittedUidArr"));
+    for( TInt count = 0; count < iCommittedUidArr->ItemCount(); count++ )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::iCommittedUidArr: list '%d'"), iCommittedUidArr->ItemAt(count) );
+        }
+    
+    // Store the array in the stream
+    ExternalizeCommittedUidL();
 	User::RequestComplete( iCallerStatus, KErrNone );
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitChangeInfoL: END");
+	FLOG(_L("CNSmlAgendaDataStore::DoCommitChangeInfoL: END"));
     }
     
 // -----------------------------------------------------------------------------
@@ -1185,50 +1875,82 @@
 //
 void CNSmlAgendaDataStore::RegisterSnapshotL()
     {
-	_DBG_FILE("CNSmlAgendaAdapter::RegisterSnapshotL(): begin");
+	FLOG(_L("CNSmlAgendaAdapter::RegisterSnapshotL(): begin"));
 	CArrayFixSeg<TNSmlSnapshotItem>* snapshot =
 	                new ( ELeave ) CArrayFixSeg<TNSmlSnapshotItem>( 64 );
 	CleanupStack::PushL( snapshot );
+	RArray<TCalLocalUid> uidArray;
+	CleanupClosePushL( uidArray );
 	
-    // First find all entries ...
-    RPointerArray<CCalInstance> array;
-    CleanupRPtrArrayPushL(array);
-
-    TCalTime startDate;
-    startDate.SetTimeLocalL(TDateTime(1900, EJanuary, 1, 0, 0, 0, 0));
-    TCalTime endDate;
-    endDate.SetTimeLocalL(TDateTime(2100, EJanuary, 30, 0, 0, 0, 0));
-    CalCommon::TCalTimeRange timeRange(startDate, endDate);
-
-    iInstanceView->FindInstanceL(array,
-                                 CalCommon::EIncludeAppts|
-                                 CalCommon::EIncludeReminder|
-                                 CalCommon::EIncludeEvents|
-                                 CalCommon::EIncludeAnnivs|
-                                 CalCommon::EIncludeCompletedTodos|
-                                 CalCommon::EIncludeIncompletedTodos|
-                                 CalCommon::EIncludeRptsNextInstanceOnly,
-                                 timeRange);
-    TInt i = 0;
-
-    while (i < array.Count())
+	// RD_MULTICAL
+	if( iIsHierarchicalSyncSupported )
+	    {
+    	// First find all entries ...
+	    iAgendaAdapterHandler->SynchronizableCalendarIdsL( iCalOffsetArr );  
+	    // Populate the Entry ID's associated with the CalFile
+	    SynchronizableCalEntryIdsL( uidArray );
+        }
+	else
+	    {
+	    HBufC* calfilename = iOpenedStoreName->AllocL();
+	    CNSmlAgendaDataStoreUtil* agendautil = CNSmlAgendaDataStoreUtil::NewL();
+        if( agendautil )
+            {
+            CleanupStack::PushL(agendautil);
+            agendautil->InitializeCalAPIsL( calfilename );
+            CleanupStack::Pop(agendautil);
+            }	   
+	    // First find all entries ...
+        TCalTime zeroTime;
+        zeroTime.SetTimeUtcL( Time::NullTTime() );
+        agendautil->iEntryView->GetIdsModifiedSinceDateL( zeroTime, uidArray );
+        delete agendautil;
+        delete calfilename;
+	    }
+	// RD_MULTICAL
+    
+	// ... and then create snapshot items
+	for ( TInt i = 0; i < uidArray.Count(); i++ )
+	    {
+	    TNSmlSnapshotItem newItem = CreateSnapshotItemL( uidArray[i] );
+	    if ( newItem.ItemId() != 0 )
+	        {
+	        snapshot->InsertIsqL( newItem, iKey );
+	        }
+	    }
+	
+	CleanupStack::PopAndDestroy( &uidArray );	
+	
+    for ( TInt i = 0; i < snapshot->Count(); i++ )
         {
-        TNSmlSnapshotItem newItem = CreateSnapshotItemL( array[i]->Entry().LocalUidL() );
-        if ( newItem.ItemId() != 0 )
-            {
-            snapshot->InsertIsqL( newItem, iKey );
-            }
-        i++;
+        TNSmlSnapshotItem item = snapshot->At(i);
+        FLOG(_L("CNSmlAgendaAdapter::RegisterSnapshotL(): id: '%d'"), item.ItemId());
         }
-    CleanupStack::PopAndDestroy(&array);
 		
 	iChangeFinder->SetNewSnapshot( snapshot );
 	
+	// Save the UIDs to the list
+	iCommittedUidArr->Reset();
+	for ( TInt count = 0; count < snapshot->Count(); count++ )
+        {
+        iCommittedUidArr->AddItem( snapshot->At( count ).ItemId() );
+        }
+	CNSmlDataItemUidSet* inactiveuids = NULL;
+	TRAP_IGNORE( inactiveuids = ActiveItemsL( *iCommittedUidArr ) );
+	delete inactiveuids;
+	// Print the iCommittedUidArr array
+	FLOG(_L("CNSmlAgendaAdapter::RegisterSnapshotL(): CommittedUidArr"));
+	for( TInt count = 0; count < iCommittedUidArr->ItemCount(); count++ )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::RegisterSnapshotL: list '%d'"), iCommittedUidArr->ItemAt(count) );
+        }
+	
 	// iChangeFinder takes ownership of items
 	CleanupStack::Pop( snapshot );
+	    
 	iSnapshotRegistered = ETrue;
 	
-	_DBG_FILE("CNSmlAgendaAdapter::RegisterSnapshotL(): end");
+	FLOG(_L("CNSmlAgendaAdapter::RegisterSnapshotL(): end"));
     }
 
 // -----------------------------------------------------------------------------
@@ -1238,25 +1960,85 @@
 TNSmlSnapshotItem CNSmlAgendaDataStore::CreateSnapshotItemL(
                 const TCalLocalUid& aUid )
     {
+    FLOG(_L("CNSmlAgendaAdapter::CreateSnapshotItemL(): Begin"));
+    
     TNSmlSnapshotItem item( 0 );
-    CCalEntry* entry = iEntryView->FetchL( aUid );
-    CleanupStack::PushL( entry );
-
-    if( entry )
-		{
-		CCalEntry::TReplicationStatus replicationStatus =
-		                    entry->ReplicationStatusL();
-		if ( CanBeSynchronized( replicationStatus ) )
-			{
-			TUint intUid = entry->LocalUidL();
-			item.SetItemId( intUid );
-			item.SetLastChangedDate(
-			                entry->LastModifiedDateL().TimeUtcL() );
-			item.SetSoftDelete( EFalse );
-			}
-		}
-		
-    CleanupStack::PopAndDestroy( entry ); // entry
+    DataMimeType( aUid );
+    
+    switch( iDataMimeType )
+        {
+        case ENSmlFolder:
+            {
+            item = iAgendaAdapterHandler->CreateFolderSnapShotItemL( aUid );
+            }
+            break;
+        case ENSmlCalendar:
+            {
+            CNSmlAgendaDataStoreUtil* agendautil = NULL;
+            HBufC* calfilename = NULL;
+            TCalLocalUid parentid(NULL);
+            TCalLocalUid entryid(aUid);
+            TInt err( KErrNone );
+            
+            if( iIsHierarchicalSyncSupported )
+                {
+                TRAP( err, GetCalendarEntryIdL( parentid, entryid ));
+                if ( err )
+                    {
+                    FLOG(_L("CNSmlAgendaDataStore::CreateSnapshotItemL:Parent Id is not Valid one"));
+                    return item;
+                    }
+                //Get the Folder Information
+                TRAP(err, calfilename = iAgendaAdapterHandler->FolderNameL(parentid) );
+                }  
+            else
+                {
+                calfilename = iOpenedStoreName->AllocL();
+                }
+                
+             if( err != KErrNone || NULL == calfilename )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::CreateSnapshotItemL:Invalid CalendarInfo"));
+                return item;
+                }
+            
+            FLOG(_L("CNSmlAgendaDataStore::CreateSnapshotItemL:Parent Id: '%d'"), parentid);
+            FLOG(_L("CNSmlAgendaDataStore::CreateSnapshotItemL:Entry Id: '%d'"), entryid);
+            
+            agendautil = CNSmlAgendaDataStoreUtil::NewL();
+            if( agendautil )
+                {
+                CleanupStack::PushL(agendautil);
+                TRAP(err, agendautil->InitializeCalAPIsL( calfilename, entryid ));
+                CleanupStack::Pop(agendautil);
+                }            
+            if ( err || !agendautil )
+                {
+                FLOG(_L("CNSmlAgendaDataStore::CreateSnapshotItemL: entry is not valid"));  
+                delete agendautil;
+                delete calfilename; 
+                return item;
+                }
+         
+            CCalEntry::TReplicationStatus replicationStatus =
+                                            agendautil->iEntry->ReplicationStatusL();
+            if ( CanBeSynchronized( replicationStatus ) )
+                {
+                TUint intUid = agendautil->iEntry->LocalUidL() + parentid;
+                item.SetItemId( intUid );
+                item.SetLastChangedDate(
+                        agendautil->iEntry->LastModifiedDateL().TimeUtcL() );
+                item.SetSoftDelete( EFalse );
+                }
+            delete agendautil;
+            delete calfilename;
+            }
+            break;
+        default:
+            break;
+        }
+    FLOG(_L("CNSmlAgendaAdapter::CreateSnapshotItemL(): end"));
+    
 	return item;
     }
 
@@ -1267,9 +2049,10 @@
 //
 CDesCArray* CNSmlAgendaDataStore::DoListAgendaFilesLC() const
     {
-    CDesCArray* array = iVCalSession->ListCalFilesL();    
-	CleanupStack::PushL( array );
-	return array;
+    CDesCArray* array = new (ELeave) CDesCArrayFlat(1);
+    array->AppendL(*iDefaultStoreFileName);
+    CleanupStack::PushL( array );
+    return array;
     }
 
 // -----------------------------------------------------------------------------
@@ -1279,11 +2062,11 @@
 //
 const TDesC& CNSmlAgendaDataStore::DoGetDefaultFileNameL() const
     {
-	if ( !iDefaultStoreName )
+	if ( !iDefaultStoreFileName )
 		{
         User::Leave( KErrGeneral );
 		}
-	return *iDefaultStoreName;
+	return *iDefaultStoreFileName;
     }
 
 // -----------------------------------------------------------------------------
@@ -1306,337 +2089,556 @@
 //
 CSmlDataStoreFormat* CNSmlAgendaDataStore::DoOwnStoreFormatL()
 	{
-	_DBG_FILE("CNSmlAgendaDataStore:::DoOwnStoreFormatL(): BEGIN");
-	TFileName fileName;
-	TParse parse;
+	FLOG(_L("CNSmlAgendaDataStore:::DoOwnStoreFormatL(): BEGIN"));
+	
+	AgendaAdapterHandlerL();
 	
-	// Check correct Data Sync protocol
-	TInt value( EDataSyncNotRunning );
-	TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
-                                 KDataSyncStatus,
-                                 value );
-	if ( error == KErrNone &&
-	     value == EDataSyncRunning )
+	if( NULL == iAgendaAdapterHandler )
 	    {
-	    parse.Set( KNSmlDSAgendaDataStoreRsc_1_1_2,
-	               &KDC_RESOURCE_FILES_DIR, NULL );
-	    }
-	else // error or protocol version 1.2 
-	    {
-	    parse.Set( KNSmlDSAgendaDataStoreRsc_1_2,
-	               &KDC_RESOURCE_FILES_DIR, NULL );
+        FLOG(_L("CNSmlAgendaDataStore:::DoOwnStoreFormatL(): Invalid AgendaAdapterHandler Error END"));
+        User::Leave( KErrGeneral );
 	    }
 	
-	fileName = parse.FullName();
-	RResourceFile resourceFile;
-	BaflUtils::NearestLanguageFile( iRfs, fileName );
+    TFileName fileName;
+    TParse* parse = NULL;
+    parse = new(ELeave) TParse();
+    CleanupStack::PushL( parse );
+    
+    // Check correct Data Sync protocol
+    TInt value( EDataSyncNotRunning );
+    TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
+                                 KDataSyncStatus,
+                                 value );
+    
+    FLOG(_L("CNSmlAgendaDataStore:::DoOwnStoreFormatL(): SyncStatus: '%d'"), KDataSyncStatus);
+    FLOG(_L("CNSmlAgendaDataStore:::DoOwnStoreFormatL(): value: '%d'"), value);
+    
+    if ( error == KErrNone &&
+         value == EDataSyncRunning )
+        {
+        parse->Set( KNSmlDSAgendaDataStoreRsc_1_1_2,
+                          &KDC_RESOURCE_FILES_DIR, NULL );
+        }
+    else
+        { 
+        FLOG(_L("CNSmlAgendaDataStore:::DoOwnStoreFormatL(): Invoking AdapterHandler Implementation"));
+        CleanupStack::PopAndDestroy( parse );
+        return iAgendaAdapterHandler->StoreFormatL( iStringPool );
+        }
+    
+    fileName = parse->FullName();
+    RResourceFile resourceFile;
+    BaflUtils::NearestLanguageFile( iRfs, fileName );
 
-	TRAPD( leavecode, resourceFile.OpenL( iRfs,fileName ) );
-	if ( leavecode != 0 )
-		{
-		CleanupStack::PopAndDestroy(); // parse
-		_DBG_FILE("CNSmlAgendaDataProvider::DoStoreFormatL(): Resource.OpenL has problem");
-		User::Leave( leavecode );
-		}
-	CleanupClosePushL( resourceFile );
-	HBufC8* profileRes = resourceFile.AllocReadLC( NSML_AGENDA_DATA_STORE );
-	TResourceReader reader;
-	reader.SetBuffer( profileRes );
+    TRAPD( leavecode, resourceFile.OpenL( iRfs,fileName ) );
+    if ( leavecode != 0 )
+        {
+        CleanupStack::PopAndDestroy(); // parse
+        FLOG(_L("CNSmlAgendaDataStore:::StoreFormatL(): Error END"));
+        User::Leave( leavecode );
+        }
+    
+    CleanupClosePushL( resourceFile );
+    HBufC8* buffer = resourceFile.AllocReadLC( NSML_AGENDA_DATA_STORE );
+    TResourceReader reader;
+    reader.SetBuffer( buffer );
 
-	CSmlDataStoreFormat* dsFormat = CSmlDataStoreFormat::NewLC( iStringPool,
-	                                                            reader );
-	CleanupStack::Pop();
-	CleanupStack::PopAndDestroy( 2 ); // resourceFile, profileRes
-	_DBG_FILE("CNSmlAgendaDataStore:::DoOwnStoreFormatL(): END");
-	return dsFormat;
+    CSmlDataStoreFormat* dsFormat = NULL;
+    dsFormat = CSmlDataStoreFormat::NewLC( iStringPool, reader );
+    CleanupStack::Pop(); // dsFormat
+    CleanupStack::PopAndDestroy( 3 ); // buffer, resourceFile, parse
+    
+    FLOG(_L("CNSmlAgendaDataStore::DoOwnStoreFormatL: END"));
+    return dsFormat;
 	}
 
 // -----------------------------------------------------------------------------
-// CNSmlAgendaDataStore::DoCommitCreateItemL
-// Commit item data to database when adding item.
+// CNSmlAgendaDataStore::DoCommitCreateCalItemL
+// Commit Calendar item data to database when adding item.
 // -----------------------------------------------------------------------------
 //
-void CNSmlAgendaDataStore::DoCommitCreateItemL()
+void CNSmlAgendaDataStore::DoCommitCreateCalItemL()
     {
-    _DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL: BEGIN");
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL: BEGIN"));
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL: Parentid: '%d'"), iParentItemId);
     iState = ENSmlOpenAndWaiting; // iState set to closed to handle leave
 	CCalEntry::TReplicationStatus  replicationStatus;
-	
+	TInt err(KErrNone);
+	CNSmlAgendaDataStoreUtil* agendautil = NULL;
+	HBufC* calfilename = NULL;
 	RBufReadStream readStream;
 	readStream.Open( *iItemData );
 	readStream.PushL();
 
     RPointerArray<CCalEntry> rdArray;
 	CleanupStack::PushL( PtrArrCleanupItemRArr ( CCalEntry, &rdArray ) );
-	if ( iRXEntryType == ENSmlICal )
-	    {
-	    _DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL: ImportICalendarL");
-	    iImporter->ImportICalendarL( readStream, rdArray );
-	    }
+	
+    if( iIsHierarchicalSyncSupported )
+        {
+        //Get the Folder Information
+        TRAP(err, calfilename = iAgendaAdapterHandler->FolderNameL(iParentItemId) );
+        }
+    else
+        {
+        calfilename = iOpenedStoreName->AllocL();
+        }
+        
+    if( err != KErrNone || NULL == calfilename )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL:Invalid CalendarInfo"));
+        CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
+        iOrphanEvent = EFalse;
+        User::Leave( KErrNotFound );
+        }
+        
+    agendautil = CNSmlAgendaDataStoreUtil::NewL();
+    if( agendautil )
+        {
+        CleanupStack::PushL(agendautil);
+        TRAP(err, agendautil->InitializeCalAPIsL( calfilename ));
+        CleanupStack::Pop(agendautil);
+        }   
+        
+    if ( err || !agendautil )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL:Invalid CalendarInfo"));
+        CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
+        delete calfilename;
+        iOrphanEvent = EFalse;
+        User::Leave( KErrNotFound );
+        }
+        
+    if ( iRXEntryType == ENSmlICal )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL: ImportICalendarL"));           
+        agendautil->iImporter->ImportICalendarL( readStream, rdArray );
+        }
     else if ( iRXEntryType == ENSmlVCal )
         {
-        _DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL: ImportVCalendarL");
-        iImporter->ImportVCalendarL( readStream, rdArray );
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL: ImportVCalendarL"));
+        agendautil->iImporter->ImportVCalendarL( readStream, rdArray );
         }
     else
         {
         CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL - \
-		           KErrNotSupported: END");
+        delete agendautil;
+        delete calfilename; 
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL - \
+                   KErrNotSupported: END"));
+        iOrphanEvent = EFalse;
         User::Leave( KErrNotSupported );
         }
     
     // If rdArray is empty or there is multiple items then return error
-	// Multiple items are not supported
-	if ( rdArray.Count() != 1 )
-	    {
-	    CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL - \
-		           Multiple items are not supported: END");
+    // Multiple items are not supported
+    if ( rdArray.Count() != 1 )
+        {
+        CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
+        delete agendautil;
+        delete calfilename; 
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL - \
+                   Multiple items are not supported: END"));
+        iOrphanEvent = EFalse;
         User::Leave( KErrNotSupported );
-	    }
-	    
-    TInt err( KErrNone );
-
-    _DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL: before StoreL");
-    TRAP( err, iInterimUtils->StoreL( *iEntryView, *rdArray[0], ETrue ) );
-    DBG_ARGS(_S("CNSmlAgendaDataStore::DoCommitCreateItemL: after StoreL '%d'"), err );
+        }           
+        
+    err = KErrNone;    
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL: before StoreL"));
+    TRAP( err, iInterimUtils->StoreL( *agendautil->iEntryView, *rdArray[0], ETrue ) );
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL: after StoreL '%d'"), err );
     if ( err )
         {
         CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL - \
-		           Error at storing item to database: END");
+        delete agendautil;
+        delete calfilename; 
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL - \
+                   Error at storing item to database: END"));
+        iOrphanEvent = EFalse;
         User::Leave( KErrGeneral );
         }
 
-    *iAddItemId = rdArray[0]->LocalUidL();
+    *iAddItemId = rdArray[0]->LocalUidL();        
+    CCalEntry* newEntry = agendautil->iEntryView->FetchL( *iAddItemId );
     
-    CCalEntry* newEntry = iEntryView->FetchL( *iAddItemId );
+    // RD_MULTICAL
+    if( iIsHierarchicalSyncSupported )
+        {
+        *iAddItemId = *iAddItemId + iParentItemId;
+        }
+    // RD_MULTICAL
     
     if( newEntry )
-    	{
-	    CleanupStack::PushL( newEntry );
+        {
+        CleanupStack::PushL( newEntry );
         
-		replicationStatus = newEntry->ReplicationStatusL();
-	
-    	if ( CanBeSynchronized( replicationStatus ) )
-			{
-			if ( iChangeFinder )
-				{
-				TNSmlSnapshotItem item( *iAddItemId );
-        			item.SetLastChangedDate(
-                   	newEntry->LastModifiedDateL().TimeUtcL() );
-            	item.SetSoftDelete( EFalse );
-				TRAPD( changeFinderError, iChangeFinder->ItemAddedL( item ) );
-				if ( changeFinderError == KErrAlreadyExists )
-			    	{
-			    	iChangeFinder->ItemUpdatedL( item );
-			    	}
-				else
-			    	{
-			    	User::LeaveIfError( changeFinderError );    
-			    	}
-				}
-			}
-    	CleanupStack::PopAndDestroy();// newEntry,
-    	}
-    CleanupStack::PopAndDestroy( 2 ); //  rdArray, readStream   
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL: END");
+        replicationStatus = newEntry->ReplicationStatusL();
+    
+        if ( CanBeSynchronized( replicationStatus ) )
+            {
+            if ( iChangeFinder )
+                {
+                TNSmlSnapshotItem item( *iAddItemId );
+                    item.SetLastChangedDate(
+                    newEntry->LastModifiedDateL().TimeUtcL() );
+                item.SetSoftDelete( EFalse );
+                TRAPD( changeFinderError, iChangeFinder->ItemAddedL( item ) );
+                if ( changeFinderError == KErrAlreadyExists )
+                    {
+                    iChangeFinder->ItemUpdatedL( item );
+                    }
+                else
+                    {
+                    User::LeaveIfError( changeFinderError );    
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy();// newEntry,
+        }
+	CleanupStack::PopAndDestroy( 2 ); //  rdArray, readStream 
+    delete agendautil;
+	delete calfilename;     	
+    
+	if( iOrphanEvent )
+	    {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL: Exiting with invalidparent"));
+        // Set the Orphan Event ID to the cenrep
+        CRepository* rep = CRepository::NewLC(KRepositoryId);
+        TInt err = rep->Set( KNsmlDsOrphanEvent, *iAddItemId );
+        DBG_ARGS(_S("set the cenrep %d "), err);
+        User::LeaveIfError(err);
+        CleanupStack::PopAndDestroy(rep);
+        iOrphanEvent = EFalse;
+        User::Leave( KErrPathNotFound );        
+	    }	
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateCalItemL: END"));
     }
     
 // -----------------------------------------------------------------------------
-// CNSmlAgendaDataStore::DoCommitReplaceItemL
-// Commit item data to database when replacing item.
+// CNSmlAgendaDataStore::DoCommitReplaceCalItemL
+// Commit Calendar item data to database when replacing item.
 // -----------------------------------------------------------------------------
 //
-void CNSmlAgendaDataStore::DoCommitReplaceItemL()
+void CNSmlAgendaDataStore::DoCommitReplaceCalItemL()
     {
-    _DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: BEGIN");
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: BEGIN"));
     iState = ENSmlOpenAndWaiting; // iState set to closed to handle leave
 	CBufFlat* oldItem = CBufFlat::NewL( KNSmlItemDataExpandSize );
 	CleanupStack::PushL( oldItem );
 	RBufWriteStream writeStream( *oldItem );
 	writeStream.PushL();
-	
-	CCalEntry* entry = NULL;
-	TInt error( KErrNone );
-    TRAP( error, entry = iEntryView->FetchL( iReplaceItemId ) );
-	if ( error || !entry )
-	{
-    	CleanupStack::PopAndDestroy( 2 ); // writeStream, oldItem
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL - \
-		           Error in fetching the item: END");
-    	User::Leave( KErrGeneral );
-    }
-    CleanupStack::PushL( entry );
+	CNSmlAgendaDataStoreUtil* agendautil = NULL;
+	HBufC* calfilename = NULL;
+	TInt err( KErrNone );
 	
-	// Export item from database depending on transmitted item entry type
-	if ( iTXEntryType == ENSmlVCal )
-	    {
-	    _DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: ExportVCalL");
-    	iExporter->ExportVCalL( *entry, writeStream );        
-    	}
+    
+    if( iIsHierarchicalSyncSupported )
+        {
+        TRAP(err, calfilename = iAgendaAdapterHandler->FolderNameL(iParentItemId) );
+        }
+    else
+        {
+        calfilename = iOpenedStoreName->AllocL();
+        }
+    
+    if( err != KErrNone || NULL == calfilename )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL:Invalid CalendarInfo"));
+        CleanupStack::PopAndDestroy( 2 ); // olditem, writeStream
+        User::Leave( KErrNotFound );
+        }
+    
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: entry id: '%d'"), iReplaceItemId);
+    
+    agendautil = CNSmlAgendaDataStoreUtil::NewL();
+    if( agendautil )
+        {
+        CleanupStack::PushL(agendautil);
+        TRAP(err, agendautil->InitializeCalAPIsL( calfilename, iReplaceItemId ));
+        CleanupStack::Pop(agendautil);
+        }
+        
+    if ( err || !agendautil )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: entry is not valid"));
+        CleanupStack::PopAndDestroy( 2 ); // olditem, writeStream
+        delete agendautil;
+        delete calfilename;
+        User::Leave( KErrGeneral );
+        }  
+        
+    // Export item from database depending on transmitted item entry type
+    if ( iTXEntryType == ENSmlVCal )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: ExportVCalL"));
+        agendautil->iExporter->ExportVCalL( *agendautil->iEntry, writeStream );        
+        }
 #ifdef __NSML_USE_ICAL_FEATURE
-	else if ( iTXEntryType == ENSmlICal )
-	    {
-	    _DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: ExportICalL");
-    	iExporter->ExportICalL( *entry, writeStream );
-	    }
+    else if ( iTXEntryType == ENSmlICal )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: ExportICalL"));
+        agendautil->iExporter->ExportICalL( *agendautil->iEntry, writeStream );
+        }
 #endif // __NSML_USE_ICAL_FEATURE
-	else
+    else
         {
-        CleanupStack::PopAndDestroy( 2 ); // entry, writeStream
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL - \
-		           KErrNotSupported: END");
+        CleanupStack::PopAndDestroy( 2 ); // olditem, writeStream
+        delete agendautil;
+        delete calfilename;
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL - \
+                   KErrNotSupported: END"));
         User::Leave( KErrNotSupported );
         }
         
-	writeStream.CommitL();
-	oldItem->Compress();
-
-	CleanupStack::PopAndDestroy( 2 ); // entry, writeStream
-	
-	// Get original UID, geoId and Recurrence-ID properties
-	HBufC8* uid = NULL;
-	HBufC8* recurrenceId = NULL;
-	HBufC8* xRecurrenceId = NULL;
-	HBufC8* geoId = NULL;
-	GetPropertiesFromDataL( oldItem, uid, KVersitTokenUID()  );
-	GetPropertiesFromDataL( oldItem, recurrenceId, KNSmlVersitTokenRecurrenceID() );
-	GetPropertiesFromDataL( oldItem, xRecurrenceId, KNSmlVersitTokenXRecurrenceID() );
-	GetPropertiesFromDataL( oldItem, geoId, KNSmlVersitTokenGeoID() );
-	CleanupStack::PushL( uid );
-	CleanupStack::PushL( recurrenceId );
-	CleanupStack::PushL( xRecurrenceId );
-	CleanupStack::PushL( geoId );
+    writeStream.CommitL();
+    oldItem->Compress();
 
-#ifdef __NSML_MORE_DEBUG_FOR_ITEMS__
-
-	DBG_DUMP( ( void* )oldItem->Ptr( 0 ).Ptr(), oldItem->Size(),
-	          _S8( "Old item from database:" ) );
-
-#endif // __NSML_MORE_DEBUG_FOR_ITEMS__
+    CleanupStack::PopAndDestroy( 1 ); 
+    
+    // Get original UID, geoId and Recurrence-ID properties
+    HBufC8* uid = NULL;
+    HBufC8* recurrenceId = NULL;
+    HBufC8* xRecurrenceId = NULL;
+    HBufC8* geoId = NULL;
+    GetPropertiesFromDataL( oldItem, uid, KVersitTokenUID()  );
+    GetPropertiesFromDataL( oldItem, recurrenceId, KNSmlVersitTokenRecurrenceID() );
+    GetPropertiesFromDataL( oldItem, xRecurrenceId, KNSmlVersitTokenXRecurrenceID() );
+    GetPropertiesFromDataL( oldItem, geoId, KNSmlVersitTokenGeoID() );
+    CleanupStack::PushL( uid );
+    CleanupStack::PushL( recurrenceId );
+    CleanupStack::PushL( xRecurrenceId );
+    CleanupStack::PushL( geoId );
 
-   	if ( iDataMod->NeedsMerge() )
-		{
-    	// Merge data
-    	iDataMod->MergeRxL( *iItemData, *oldItem );
-		}
-	
-	// Add original UID and Recurrence-ID to merged data
-	// This first removes UID and Recurrence-ID from merged data
-	// and then adds original ones
-	if ( uid )
-	    {
-	    SetPropertiesToDataL( uid, KVersitTokenUID() );    
-	    }
+    if ( iDataMod->NeedsMerge() )
+        {
+        // Merge data
+        iDataMod->MergeRxL( *iItemData, *oldItem );
+        }
+    
+    // Add original UID and Recurrence-ID to merged data
+    // This first removes UID and Recurrence-ID from merged data
+    // and then adds original ones
+    if ( uid )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: SetPropertiesToDataL :uid"));
+        SetPropertiesToDataL( uid, KVersitTokenUID() );    
+        }
     else
         {
+        CleanupStack::PopAndDestroy( 5 ); // xRecurrenceId, recurrenceId,
+                                              // uid, oldItem, geoId
+        delete agendautil;
+        delete calfilename;
+        
         User::Leave( KErrNotSupported );
         }
-	if ( recurrenceId )
-	    {
-	    SetPropertiesToDataL( recurrenceId, KNSmlVersitTokenRecurrenceID() );    
-	    }
-	if ( xRecurrenceId )
-	    {
-	    SetPropertiesToDataL( xRecurrenceId, KNSmlVersitTokenXRecurrenceID() );    
-	    }
-	if ( geoId )
-	    {
-	    SetPropertiesToDataL( geoId, KNSmlVersitTokenGeoID() );    
-	    }
-
-#ifdef __NSML_MORE_DEBUG_FOR_ITEMS__
-
-	DBG_DUMP( ( void* )iItemData->Ptr( 0 ).Ptr(), iItemData->Size(),
-	          _S8( "New item to database:" ) );
+    if ( recurrenceId )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: SetPropertiesToDataL :recurrenceId"));
+        SetPropertiesToDataL( recurrenceId, KNSmlVersitTokenRecurrenceID() );    
+        }
+    if ( xRecurrenceId )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: SetPropertiesToDataL :xRecurrenceId"));
+        SetPropertiesToDataL( xRecurrenceId, KNSmlVersitTokenXRecurrenceID() );    
+        }
+    if ( geoId )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: SetPropertiesToDataL :geoId"));
+        SetPropertiesToDataL( geoId, KNSmlVersitTokenGeoID() );    
+        }
+    
+    CleanupStack::PopAndDestroy( 5 ); // xRecurrenceId, recurrenceId,
+                                      // uid, oldItem, geoId
+    
+    // Replace item to database
+    RBufReadStream readStream;
+    readStream.Open( *iItemData );
+    readStream.PushL();
 
-#endif // __NSML_MORE_DEBUG_FOR_ITEMS__
-	
-	CleanupStack::PopAndDestroy( 5 ); // xRecurrenceId, recurrenceId,
-	                                  // uid, oldItem, geoId
-    
-	// Replace item to database
-	RBufReadStream readStream;
-	readStream.Open( *iItemData );
-	readStream.PushL();
+    RPointerArray<CCalEntry> rdArray;
+    CleanupStack::PushL( PtrArrCleanupItemRArr ( CCalEntry, &rdArray ) );
 
-	RPointerArray<CCalEntry> rdArray;
-	CleanupStack::PushL( PtrArrCleanupItemRArr ( CCalEntry, &rdArray ) );
-
-	// Import item to database depending on received item entry type
-	if ( iRXEntryType == ENSmlVCal )
+    // Import item to database depending on received item entry type
+    if ( iRXEntryType == ENSmlVCal )
         {
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: ImportVCalendarL");
-    	iImporter->ImportVCalendarL( readStream, rdArray );
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: ImportVCalendarL"));
+        TRAP( err, agendautil->iImporter->ImportVCalendarL( readStream, rdArray ));
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: ImportVCalendarL error: '%d'"), err);
+        if( err != KErrNone)
+            {
+            User::Leave(err);
+            }
         }
 #ifdef __NSML_USE_ICAL_FEATURE
-	else if ( iRXEntryType == ENSmlICal )
-		{
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: ImportICalendarL");
-		iImporter->ImportICalendarL( readStream, rdArray );
-		}
+    else if ( iRXEntryType == ENSmlICal )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: ImportICalendarL"));
+        agendautil->iImporter->ImportICalendarL( readStream, rdArray );
+        }
 #endif // __NSML_USE_ICAL_FEATURE
     else
         {
         CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL - \
-		           KErrNotSupported: END");
+        delete agendautil;
+        delete calfilename;
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceItemL - \
+                   KErrNotSupported: END"));
         User::Leave( KErrNotSupported );
         }
 
     // If rdArray is empty or there is multiple items then return error
-	// Multiple items are not supported
-	if ( rdArray.Count() != 1 )
-	    {
-	    CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL - \
-		           Multiple items are not supported: END");
+    // Multiple items are not supported
+    if ( rdArray.Count() != 1 )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: Multiple items are not supported "));
+        CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
+        delete agendautil;
+        delete calfilename;
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceItemL - \
+                   Multiple items are not supported: END"));
         User::Leave( KErrNotSupported );
-	    }
-	    
-	TInt err( KErrNone );
+        }
+        
+    err = KErrNone;
 
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: before StoreL");
-    TRAP( err, iInterimUtils->StoreL( *iEntryView, *rdArray[0], ETrue ) );
-    DBG_ARGS(_S("CNSmlAgendaDataStore::DoCommitCreateItemL: after StoreL '%d'"), err );
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: before StoreL"));
+    TRAP( err, iInterimUtils->StoreL( *agendautil->iEntryView, *rdArray[0], ETrue ) );
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: after StoreL '%d'"), err );
+    
     if ( err )
         {
         CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
-		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL - \
-		           Error at storing item to database: END");
+        delete agendautil;
+        delete calfilename;
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL - \
+                   Error at storing item to database: END"));
         User::Leave( KErrGeneral );
         }
 
-	CCalEntry::TReplicationStatus  replicationStatus;
-	
-	CCalEntry* replacedEntry = iEntryView->FetchL( iReplaceItemId );
-	if( replacedEntry )
-	{
+    CCalEntry::TReplicationStatus  replicationStatus;
+    
+    CCalEntry* replacedEntry = agendautil->iEntryView->FetchL( iReplaceItemId );
+    if( replacedEntry )
+    {
     CleanupStack::PushL( replacedEntry );
-	
+    
     replicationStatus = replacedEntry->ReplicationStatusL();
-	            
-	if ( CanBeSynchronized( replicationStatus ) )
-		{
-		if ( iChangeFinder )
-			{
-			TNSmlSnapshotItem item( iReplaceItemId );
-			item.SetLastChangedDate(
-			            replacedEntry->LastModifiedDateL().TimeUtcL());
-			item.SetSoftDelete( EFalse );
-			iChangeFinder->ItemUpdatedL( item );
-			}
-		}
-	CleanupStack::PopAndDestroy(); // replacedEntry
-	}
-	
-	CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
-
-	_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: END");
+    
+    // RD_MULTICAL
+    if( !iIsHierarchicalSyncSupported )
+        {
+        iParentItemId = 0;
+        }
+    // RD_MULTICAL
+                
+    if ( CanBeSynchronized( replicationStatus ) )
+        {
+        if ( iChangeFinder )
+            {
+            TNSmlSnapshotItem item( iReplaceItemId + iParentItemId );
+            item.SetLastChangedDate(
+                        replacedEntry->LastModifiedDateL().TimeUtcL());
+            item.SetSoftDelete( EFalse );
+            iChangeFinder->ItemUpdatedL( item );
+            }
+        }
+    CleanupStack::PopAndDestroy(); // replacedEntry
     }
     
+	CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
+    delete agendautil;
+	delete calfilename;	
+	FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceCalItemL: END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCommitCreateFolderItemL
+// Commit Folder item data to database when adding item.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCommitCreateFolderItemL()
+    {
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateFolderItemL: BEGIN"));
+    
+    TInt err(KErrNone);
+    RBufReadStream readStream;
+    readStream.Open( *iItemData );
+    readStream.PushL();
+    
+    TRAP(err, *iAddItemId = iAgendaAdapterHandler->CreateFolderL( readStream ));
+    if( err != KErrNone )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateFolderItemL: Error in Create Folder"));
+        CleanupStack::PopAndDestroy( &readStream );
+        User::Leave( err );    
+        }
+   
+    // Add snapshotitem
+    if ( iChangeFinder )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateFolderItemL: item id: '%d'"), *iAddItemId );
+        TNSmlSnapshotItem item( *iAddItemId );
+        TTime time;
+        time.HomeTime();
+        item.SetLastChangedDate( time );
+        item.SetSoftDelete( EFalse );
+        TRAPD( changeFinderError, iChangeFinder->ItemAddedL( item ) );
+        if ( changeFinderError == KErrAlreadyExists )
+            {
+            iChangeFinder->ItemUpdatedL( item );
+            }
+        else
+            {
+            User::LeaveIfError( changeFinderError );    
+            }
+        
+        iCalOffsetArr->AppendL(*iAddItemId);
+            
+        }
+    
+    CleanupStack::PopAndDestroy( &readStream );
+    
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitCreateFolderItemL: END"));
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCommitReplaceFolderItemL
+// Commit Folder item data to database when replacing item.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCommitReplaceFolderItemL()
+    {
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceFolderItemL: BEGIN"));
+    
+    TBool syncstatus(ETrue);
+    TInt err(KErrNone);
+    RBufReadStream readStream;
+    readStream.Open( *iItemData );
+    readStream.PushL();
+    
+    TRAP(err, iAgendaAdapterHandler->ReplaceFolderL( iReplaceItemId, readStream, syncstatus ));
+    if(err != KErrNone)
+        {
+        FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceFolderItemL: Error while replacing Folder"));
+        CleanupStack::PopAndDestroy( &readStream );
+        User::Leave(err);
+        }
+   
+    // Update snapshotitem
+    if ( iChangeFinder && syncstatus )
+        {
+        TNSmlSnapshotItem item( iReplaceItemId );
+        TTime time;
+        time.HomeTime();
+        item.SetLastChangedDate(time);
+        item.SetSoftDelete( EFalse );
+        iChangeFinder->ItemUpdatedL( item );
+        }
+        
+    CleanupStack::PopAndDestroy( &readStream );    
+    FLOG(_L("CNSmlAgendaDataStore::DoCommitReplaceFolderItemL: END"));
+    }
 // -----------------------------------------------------------------------------
 // CNSmlAgendaDataStore::GetPropertiesFromDataL
 // Gets property from old item.
@@ -1646,7 +2648,7 @@
                                                    HBufC8*& aValue,
 	                                               const TDesC8& aProperty )
     {
-    _DBG_FILE("CNSmlAgendaDataStore::GetPropertiesFromDataL(): begin");
+    FLOG(_L("CNSmlAgendaDataStore::GetPropertiesFromDataL(): begin"));
     
     // Gemerate property that is searched (Linebreak + property + tokencolon)
     HBufC8* startBuffer = HBufC8::NewLC( KVersitTokenCRLF().Size() +
@@ -1692,7 +2694,7 @@
 	    }
     CleanupStack::PopAndDestroy( startBuffer ); // startBuffer
     
-    _DBG_FILE("CNSmlAgendaDataStore::GetPropertiesFromDataL(): end");
+    FLOG(_L("CNSmlAgendaDataStore::GetPropertiesFromDataL(): end"));
     }
   
 // -----------------------------------------------------------------------------
@@ -1703,7 +2705,7 @@
 void CNSmlAgendaDataStore::SetPropertiesToDataL( HBufC8*& aValue,
 	                                             const TDesC8& aProperty )
     {
-    _DBG_FILE("CNSmlAgendaDataStore::SetPropertiesToDataL(): begin");
+    FLOG(_L("CNSmlAgendaDataStore::SetPropertiesToDataL(): begin"));
     
     // Gemerate property that is searched (Linebreak + property + tokencolon)
     HBufC8* startBuffer = HBufC8::NewLC( KVersitTokenCRLF().Size() +
@@ -1787,7 +2789,769 @@
     
     CleanupStack::PopAndDestroy( 3 ); // endVTodo, endVEvent, startBuffer
     
-    _DBG_FILE("CNSmlAgendaDataStore::SetPropertiesToDataL(): end");
+    FLOG(_L("CNSmlAgendaDataStore::SetPropertiesToDataL(): end"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::GetCalendarEntryIdL
+// Method to retrieve the Id of the Calendar Entry
+// -----------------------------------------------------------------------------
+void CNSmlAgendaDataStore::GetCalendarEntryIdL( TCalLocalUid& aParentId, TCalLocalUid& aCalId ) const
+    {
+    FLOG(_L("CNSmlAgendaDataStore::GetCalendarEntryIdL: BEGIN"));
+    
+    FLOG(_L("CNSmlAgendaDataStore::GetCalendarEntryIdL: parentid: '%d'"), aParentId);
+    FLOG(_L("CNSmlAgendaDataStore::GetCalendarEntryIdL: aCalId: '%d'"), aCalId);
+    
+    TInt uidcalentry = aCalId;
+    
+    if( uidcalentry < iCalOffsetVal )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::GetCalendarEntryIdL: Invalid CalendarId: '%d'"), aCalId);
+        User::Leave( KErrGeneral );
+        }
+    else if( uidcalentry == iCalOffsetVal ||
+             0 == (uidcalentry % iCalOffsetVal) )
+        {
+        aParentId = uidcalentry;
+        }
+    else
+        {
+        while( uidcalentry > iCalOffsetVal )
+            {
+            uidcalentry = uidcalentry - iCalOffsetVal;
+            }    
+        aParentId = aCalId - uidcalentry;
+        aCalId = uidcalentry;
+        }
+    
+    TInt err(KErrNone);
+    TInt index = KErrNotFound;
+    TKeyArrayFix key( 0, ECmpTInt ); // Find key for Ids.
+    
+    err = iCalOffsetArr->Find( aParentId, key, index );
+    
+    if( err != KErrNone )
+        {
+        User::Leave(err);
+        }   
+    FLOG(_L("CNSmlAgendaDataStore::GetCalendarEntryIdL: END"));    
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DataMimeType
+// Method to determine the MIME type, provided the UID
+// -----------------------------------------------------------------------------
+void CNSmlAgendaDataStore::DataMimeType( TSmlDbItemUid aUid )
+    {
+    FLOG(_L("CNSmlAgendaDataStore::DataMimeType: BEGIN"));    
+    
+    FLOG(_L("CNSmlAgendaDataStore::DataMimeType: LUID '%d'"), aUid );
+    
+    if( iIsHierarchicalSyncSupported )
+        {
+        // Find a match with the list of Offset values available
+        TInt index = KErrNotFound;
+        TInt err = KErrNone;
+        TKeyArrayFix key( 0, ECmpTInt ); // Find key for Ids.
+        
+        err = iCalOffsetArr->Find( aUid, key, index );
+                   
+        // Determine the Data Mime Type
+        if( err == KErrNone )
+            {
+            iDataMimeType = ENSmlFolder;
+            }
+        else
+            {
+            iDataMimeType = ENSmlCalendar;
+            }
+        }
+    else
+        {
+        iDataMimeType = ENSmlCalendar;
+        }
+    
+    FLOG(_L("CNSmlAgendaDataStore::DataMimeType: END, DataMimeType '%d' "), iDataMimeType);    
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::ListAllAgendaPluginAdaptersL
+// Get All the AdapterHandler instance
+// -----------------------------------------------------------------------------
+void CNSmlAgendaDataStore::ListAllAgendaPluginAdaptersL()
+    {
+    FLOG(_L("CNSmlAgendaDataStore::ListAllAgendaPluginAdaptersL BEGIN"));
+    
+    RImplInfoPtrArray adapterInfoArray;        
+    CNSmlAgendaAdapterHandler* adapterInstance(NULL);
+    
+    REComSession::ListImplementationsL( KAgendaAdapterHandlerInterfaceUid, adapterInfoArray );
+    TInt adapterCount = adapterInfoArray.Count();
+    FLOG(_L("adaptercount:'%d'"),adapterCount); 
+    CImplementationInformation* adapterInfo = NULL;
+    
+    for (TInt adapterIndex = 0 ; adapterIndex < adapterCount; adapterIndex++)
+        {
+        adapterInfo = adapterInfoArray[ adapterIndex ];
+        TUid adapterUid = { adapterInfo->ImplementationUid().iUid  };
+        FLOG(_L("CNSmlAgendaDataStore::ListAllAgendaPluginAdaptersL before newl"));
+        adapterInstance = CNSmlAgendaAdapterHandler::NewL(adapterUid); 
+        FLOG(_L("CNSmlAgendaDataStore::ListAllAgendaPluginAdaptersL after newl"));
+        if( adapterInstance )
+            {
+            adapterInstance->iOpaqueData = adapterInfo->OpaqueData().Alloc();
+            iAgendaPluginAdapters.AppendL( adapterInstance );
+            }
+        }
+    adapterInfoArray.ResetAndDestroy();
+    FLOG(_L("CNSmlAgendaDataStore::ListAllAgendaPluginAdaptersL END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::AgendaAdapterHandlerL
+// Get the AdapterHandler instance
+// -----------------------------------------------------------------------------
+void CNSmlAgendaDataStore::AgendaAdapterHandlerL()
+    {
+    FLOG(_L("CNSmlAgendaDataStore::AgendaAdapterHandlerL BEGIN"));
+    
+    // Get the Opaque data / server id from the cenrep
+    TBuf<KBuffLength> serverid;
+    HBufC8* opaquedata;
+    CRepository* rep = CRepository::NewLC( KNsmlDsSessionInfoKey );
+    TInt err = rep->Get(EDSSessionServerId, serverid );
+    FLOG(_L("CNSmlAgendaDataStore:::AgendaAdapterHandlerL():serverid '%S'"), &serverid );
+    User::LeaveIfError(err);
+    CleanupStack::PopAndDestroy(rep);
+    
+    if( 0 == serverid.Length() )
+        {
+        FLOG(_L("CNSmlAgendaDataStore:::AgendaAdapterHandlerL():serverid length is zero"));
+        opaquedata = KNSmlDefaultOpaqueData().AllocL();
+        }
+    else
+        {
+        opaquedata = HBufC8::NewL( serverid.Length() );
+        TPtr8 name( opaquedata->Des() );
+        CnvUtfConverter::ConvertFromUnicodeToUtf8(name , serverid );
+        }
+    iAgendaAdapterHandler = NULL;
+    for( TInt adaptercount = 0; adaptercount < iAgendaPluginAdapters.Count(); adaptercount++ )
+        {
+        if( 0 == opaquedata->Compare(iAgendaPluginAdapters[adaptercount]->iOpaqueData->Des()) )
+            {
+            iAgendaAdapterHandler = iAgendaPluginAdapters[adaptercount];
+            break;
+            }        
+        }
+    
+    delete opaquedata;
+    
+    if( NULL == iAgendaAdapterHandler )
+        {
+        opaquedata = KNSmlDefaultOpaqueData().AllocL();
+        for( TInt adaptercount = 0; adaptercount < iAgendaPluginAdapters.Count(); adaptercount++ )
+            {
+            if( 0 == opaquedata->Compare(iAgendaPluginAdapters[adaptercount]->iOpaqueData->Des()) )
+                {
+                iAgendaAdapterHandler = iAgendaPluginAdapters[adaptercount];
+                break;
+                }        
+            }
+        delete opaquedata;
+        }
+    
+    FLOG(_L("CNSmlAgendaDataStore::AgendaAdapterHandlerL END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::SynchronizableCalEntryIdsL
+// Retrieve the CalendarFile and associated entries ID
+// -----------------------------------------------------------------------------
+void CNSmlAgendaDataStore::SynchronizableCalEntryIdsL( RArray<TCalLocalUid>& aUidArray )
+    {
+    FLOG(_L("CNSmlAgendaDataStore::SynchronizableCalEntryIdsL BEGIN"));
+    
+    TInt err(KErrNone);
+    
+    for( TInt calfilecount = 0; calfilecount < iCalOffsetArr->Count(); calfilecount++ )
+        {
+        TUint calfileid = iCalOffsetArr->At(calfilecount);
+        CNSmlAgendaDataStoreUtil* agendautil = NULL;
+        HBufC* calfilename = NULL;
+        
+        TRAP(err, calfilename = iAgendaAdapterHandler->FolderNameL(calfileid) );
+        FLOG(_L("CNSmlAgendaDataStore::SynchronizableCalEntryIdsL calfilename: '%S'"), calfilename);
+           
+        if( err!= KErrNone || NULL == calfilename)
+            {
+            FLOG(_L("CNSmlAgendaDataStore::SynchronizableCalEntryIdsL Invalid FileName"));
+            User::Leave(KErrGeneral);
+            }
+        FLOG(_L("CNSmlAgendaDataStore::SynchronizableCalEntryIdsL Initialize"));
+       
+        agendautil = CNSmlAgendaDataStoreUtil::NewL();
+        if( agendautil )
+            {
+            CleanupStack::PushL(agendautil);
+            TRAP(err, agendautil->InitializeCalAPIsL( calfilename ));
+            CleanupStack::Pop(agendautil);
+            }
+        if ( err || !agendautil )
+            {
+            FLOG(_L("CNSmlAgendaDataStore::SynchronizableCalEntryIdsL Initialization failed"));
+            delete calfilename;
+            User::Leave(KErrGeneral);
+            }
+        
+        TCalTime zeroTime;
+        RArray<TCalLocalUid> entryarray;
+        CleanupClosePushL( entryarray );
+       
+        aUidArray.AppendL(calfileid);            
+    
+        zeroTime.SetTimeUtcL( Time::NullTTime() );
+        agendautil->iEntryView->GetIdsModifiedSinceDateL( zeroTime, entryarray );  
+        
+        for( TInt i=0; i<entryarray.Count(); i++)
+            {
+            aUidArray.AppendL(calfileid + entryarray[i]);
+            FLOG(_L("CNSmlAgendaDataStore::SynchronizableCalEntryIdsL, Entry ID: '%d'"), (calfileid + entryarray[i]));
+            }    
+        FLOG(_L("CNSmlAgendaDataStore::SynchronizableCalEntryIdsL Clean up start"));
+        CleanupStack::PopAndDestroy( &entryarray );
+        delete agendautil;
+        delete calfilename;
+        FLOG(_L("CNSmlAgendaDataStore::SynchronizableCalEntryIdsL Cleanup end"));
+        }    
+    FLOG(_L("CNSmlAgendaDataStore::SynchronizableCalEntryIdsL END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::StoreFormatL
+// Providing DataStore access to CNSmlDataProvider Class
+// -----------------------------------------------------------------------------
+CSmlDataStoreFormat* CNSmlAgendaDataStore::StoreFormatL()
+    {
+    return DoOwnStoreFormatL();
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::OpenStoreL
+// Open the Store if present else create one to work upon
+// -----------------------------------------------------------------------------
+void CNSmlAgendaDataStore::OpenStoreL()
+    {
+    FLOG(_L("CNSmlAgendaDataStore::OpenStoreL BEGIN"));
+
+    TInt profileid = NULL;
+    TBuf<KBuffLength> serverid;
+    TBuf<KBuffLength> profilename;
+	TBool isHandlerAvailable( EFalse );
+    
+    // Get the ServerId, ProfileId and ProfileName from the cenrep
+    CRepository* rep = CRepository::NewLC( KNsmlDsSessionInfoKey );
+    TInt err = rep->Get( EDSSessionProfileId, profileid );
+    err = rep->Get( EDSSessionProfileName, profilename );
+    err = rep->Get(EDSSessionServerId, serverid );
+    User::LeaveIfError(err);
+    CleanupStack::PopAndDestroy(rep);
+    
+    // Reintialize the StoreName
+    if ( iOpenedStoreName )
+        {
+        delete iOpenedStoreName;
+        iOpenedStoreName = NULL;
+        }
+    
+    // Find the CalendarFile having the given ProfileID
+    CDesCArray* calfilearr = new (ELeave) CDesCArrayFlat(1);
+    CleanupStack::PushL(calfilearr);
+    FLOG(_L("CNSmlAgendaDataStore:::OpenStoreL():Profilename '%S'"), &profilename );
+    FLOG(_L("CNSmlAgendaDataStore:::OpenStoreL():serverid '%S'"), &serverid );
+	
+	if( 0 != serverid.Length() )
+        {   
+		HBufC8* opaquedata = HBufC8::NewL( serverid.Length() );
+        TPtr8 name( opaquedata->Des() );
+        CnvUtfConverter::ConvertFromUnicodeToUtf8(name , serverid );
+		
+		for( TInt adaptercount = 0; adaptercount < iAgendaPluginAdapters.Count(); adaptercount++ )
+	        {
+	        if( 0 == opaquedata->Compare(iAgendaPluginAdapters[adaptercount]->iOpaqueData->Des()) )
+	            {
+	            FLOG(_L("CNSmlAgendaDataStore::Handler available"));			
+				isHandlerAvailable = ETrue;
+	            break;
+	            }        
+	        }
+			delete opaquedata;
+        }	
+    
+	if( isHandlerAvailable )
+		{
+		iOpenedStoreName = iDefaultStoreFileName->AllocL();
+		}	
+    else if( IsCalFileAvailableL( profileid, calfilearr ) )
+        {
+        FLOG(_L("CNSmlAgendaDataStore::OpenStoreL Found the assoicated calfile"));
+        
+        // TODO: Yet to get clarification for enable/disable the notification
+        iOpenedStoreName = calfilearr->MdcaPoint(0).AllocL();
+        }
+    else
+        {
+        FLOG(_L("CNSmlAgendaDataStore::OpenStoreL CouldNot Find the Calfile"));
+        
+        // No association found thus creating a CalendarFile
+        HBufC* name = profilename.AllocL();
+        HBufC* calfilename = CreateCalFileL( name, profileid );
+        delete name;
+        iOpenedStoreName = calfilename;
+        }
+        
+    CCalSession* calsession = CCalSession::NewL();
+    CleanupStack::PushL(calsession);
+    TRAP( err, calsession->OpenL( iOpenedStoreName->Des() ) );
+    // Disable notifications
+    TRAP_IGNORE( calsession->DisablePubSubNotificationsL() );
+    TRAP_IGNORE( calsession->DisableChangeBroadcast() );        
+    // Get ID of database
+    calsession->FileIdL( iOpenedStoreId );
+    CleanupStack::PopAndDestroy( calsession );    
+      
+    CleanupStack::PopAndDestroy(calfilearr);
+    FLOG(_L("CNSmlAgendaDataStore::OpenStoreL END"));    
     }
-	
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::IsCalFileAvailableL    
+// Check existance of CalFile with the given ProfileID associativity
+// -----------------------------------------------------------------------------
+TBool CNSmlAgendaDataStore::IsCalFileAvailableL( TInt aProfileId, CDesCArray* aCalFileArr )
+    {
+    FLOG(_L("CNSmlAgendaDataStore::IsCalFileAvailable: BEGIN"));   
+    
+    TBool calfilestatus(EFalse);
+    TBuf8<KBuffLength> keyBuff;
+    CCalSession* vCalSession = NULL;
+    CCalSession* vCalSubSession = NULL;   
+    
+    vCalSession = CCalSession::NewL();
+    CleanupStack::PushL(vCalSession);
+    
+    CDesCArray* calfilearr = vCalSession->ListCalFilesL();            
+    CleanupStack::PushL(calfilearr);
+    
+    for(TInt i = 0; i < calfilearr->Count(); i++)
+        {
+		TInt err = KErrNone;
+        vCalSubSession = CCalSession::NewL(*vCalSession);
+        CleanupStack::PushL(vCalSubSession);
+        vCalSubSession->OpenL(calfilearr->MdcaPoint(i));
+        
+        CCalCalendarInfo* caleninfo = vCalSubSession->CalendarInfoL();
+        CleanupStack::PushL(caleninfo);
+        
+		//Get MARKASDELETE MetaData property
+		keyBuff.Zero();
+		TBool markAsdelete = EFalse;
+		keyBuff.AppendNum( EMarkAsDelete );
+		TPckgC<TBool> pckMarkAsDelete(markAsdelete);
+		TRAP(err,pckMarkAsDelete.Set(caleninfo->PropertyValueL(keyBuff)));
+		if ( err == KErrNone )
+			{
+			markAsdelete = pckMarkAsDelete();
+			if( markAsdelete )
+				{
+				FLOG(_L("CNSmlAgendaDataStore::IsCalFileAvailableL: Dead Calendar"));
+				CleanupStack::PopAndDestroy(caleninfo);
+				CleanupStack::PopAndDestroy(vCalSubSession);  	  	 
+				continue;
+				}
+			}
+		
+		//Get the ProfileId MetaData property 
+        TInt ProfileId;
+        keyBuff.Zero();
+        keyBuff.AppendNum( EDeviceSyncProfileID );
+        TPckgC<TInt> intBuf(ProfileId);
+        TRAP(err,intBuf.Set(caleninfo->PropertyValueL(keyBuff)));
+                    
+        if( err != KErrNone )
+            {
+            FLOG(_L("CNSmlAgendaDataStore::IsCalFileAvailable: Error while retrieving CalFile Property"));
+            CleanupStack::PopAndDestroy(caleninfo);   
+            CleanupStack::PopAndDestroy(vCalSubSession);             
+            continue;
+            }
+        
+        ProfileId = intBuf();
+        
+        if(aProfileId == ProfileId)
+            {
+            aCalFileArr->AppendL(calfilearr->MdcaPoint(i));
+            }
+        CleanupStack::PopAndDestroy(caleninfo);    
+        CleanupStack::PopAndDestroy(vCalSubSession); 
+        }
+    
+    if( aCalFileArr->Count() > 0 )
+        {
+        calfilestatus = ETrue;
+        }
+    else
+        {
+        calfilestatus = EFalse;
+        }
+    CleanupStack::PopAndDestroy(calfilearr);     
+    CleanupStack::PopAndDestroy(vCalSession);
+    
+    FLOG(_L("CNSmlAgendaDataStore::IsCalFileAvailable: END"));    
+    return calfilestatus;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::OpenStoreL
+// Create CalFile with the attributes provided
+// -----------------------------------------------------------------------------
+HBufC* CNSmlAgendaDataStore::CreateCalFileL( HBufC* aProfileName, TInt aProfileId )
+    {
+    FLOG(_L("CNSmlAgendaDataStore::CreateCalFileL: BEGIN"));
+    
+    TBuf8<KBuffLength> keyBuff;
+    TUint calValue = 0;
+    CCalSession* calSession = CCalSession::NewL();
+    CleanupStack::PushL(calSession);
+    CCalCalendarInfo* calinfo = CCalCalendarInfo::NewL();
+    CleanupStack::PushL(calinfo);   
+    
+    //Visibility
+    calinfo->SetEnabled(ETrue);
+    calinfo->SetNameL(aProfileName->Des());
+    // TODO
+    calinfo->SetColor(Math::Random());
+    
+    // Set Meta Data Properties
+    // LUID Meta Property
+    keyBuff.Zero();
+    keyBuff.AppendNum( EFolderLUID );
+    calValue = CCalenMultiCalUtil::GetNextAvailableOffsetL();
+    FLOG(_L("CNSmlAgendaDataStore::CreateCalFileL: nextoffset: '%d'"), calValue);
+    TPckgC<TUint> pckgUidValue( calValue );
+    calinfo->SetPropertyL( keyBuff, pckgUidValue );
+    
+    // Create & Modified Time Meta Property
+    keyBuff.Zero();
+    keyBuff.AppendNum( ECreationTime );
+    TTime time;
+    time.HomeTime();
+    TPckgC<TTime> pckgCreateTimeValue( time );
+    calinfo->SetPropertyL( keyBuff, pckgCreateTimeValue );
+    keyBuff.Zero();
+    keyBuff.AppendNum( EModificationTime );
+    calinfo->SetPropertyL( keyBuff, pckgCreateTimeValue );
+    
+    // Sync Status
+    keyBuff.Zero();
+    keyBuff.AppendNum( ESyncStatus );
+    TBool syncstatus( ETrue );
+    TPckgC<TBool> pckgSyncStatusValue( syncstatus );
+    calinfo->SetPropertyL( keyBuff, pckgSyncStatusValue );
+    
+    // Global UID MetaDataProperty 
+    keyBuff.Zero();
+    keyBuff.AppendNum( EGlobalUUID );
+    HBufC8* guuid = iInterimUtils->GlobalUidL();
+    TPtr8 guuidPtr = guuid->Des();
+    CleanupStack::PushL( guuid );
+    calinfo->SetPropertyL( keyBuff, guuidPtr );
+    CleanupStack::PopAndDestroy( guuid );
+    
+    // Owner
+    keyBuff.Zero();
+    TInt syncowner = iAgendaAdapterHandler->DeviceSyncOwner(); 
+    keyBuff.AppendNum( EDeviceSyncServiceOwner );
+    TPckgC<TInt> pckgAppUIDValue( syncowner );    
+    calinfo->SetPropertyL( keyBuff, pckgAppUIDValue );
+    
+    // Profile ID Meta Property
+    keyBuff.Zero();
+    keyBuff.AppendNum( EDeviceSyncProfileID );
+    TPckgC<TInt> pckgProfileIdValue( aProfileId );    
+    calinfo->SetPropertyL( keyBuff, pckgProfileIdValue );
+    
+    // Lock the SYNC option
+    keyBuff.Zero();
+    keyBuff.AppendNum( ESyncConfigEnabled );
+    TBool synclockstatus( ETrue );
+    TPckgC<TBool> pckgSyncLockValue( synclockstatus );
+    calinfo->SetPropertyL( keyBuff, pckgSyncLockValue );
+       
+    // Create the CalFile
+    HBufC* calfilename = CCalenMultiCalUtil::GetNextAvailableCalFileL();
+    calSession->CreateCalFileL( calfilename->Des(), *calinfo );
+    CleanupStack::PopAndDestroy(calinfo);
+    CleanupStack::PopAndDestroy(calSession);
+    
+    FLOG(_L("CNSmlAgendaDataStore::CreateCalFileL: END"));
+    
+    return calfilename;    
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::ActiveItemsL
+// Filters out the non-active items from the given array
+// -----------------------------------------------------------------------------
+CNSmlDataItemUidSet* CNSmlAgendaDataStore::ActiveItemsL( CNSmlDataItemUidSet& aUids ) const
+    {
+    FLOG(_L("CNSmlAgendaDataStore::ActiveItemsL: BEGIN"));
+    
+    TInt err(KErrNone);
+    TCalLocalUid uid(0);
+    TCalLocalUid parentid(0);
+    CNSmlDataItemUidSet* tempuids = new ( ELeave ) CNSmlDataItemUidSet();
+    CNSmlDataItemUidSet* inactiveuids = new ( ELeave ) CNSmlDataItemUidSet();
+    for( TInt count =0; count < aUids.ItemCount(); count++ )
+        {
+        parentid = 0;
+        uid = aUids.ItemAt(count);
+        TRAP( err, GetCalendarEntryIdL( parentid, uid ));
+        if ( err && iIsHierarchicalSyncSupported )
+            {
+            FLOG(_L("CNSmlAgendaDataStore::ActiveItemsL: Invalid UID"));
+            delete tempuids;
+            delete inactiveuids;
+            User::Leave( KErrGeneral );
+            }                
+        if( iAgendaAdapterHandler->FolderSyncStatusL( parentid ) )
+            {
+            FLOG(_L("CNSmlAgendaDataStore::ActiveItemsL: ActiveItem: '%d'"), aUids.ItemAt(count));
+            tempuids->AddItem( aUids.ItemAt(count) );
+            }
+        else
+            {
+            FLOG(_L("CNSmlAgendaDataStore::ActiveItemsL: InActiveItem: '%d'"), aUids.ItemAt(count));
+            inactiveuids->AddItem( aUids.ItemAt(count) );
+            }
+        }
+    if( inactiveuids->ItemCount() > 0 )
+        {
+        aUids.Reset();
+        for( TInt count =0; count < tempuids->ItemCount(); count++ )
+            {
+            aUids.AddItem( tempuids->ItemAt(count) );
+            }
+        delete tempuids;
+        FLOG(_L("CNSmlAgendaDataStore::ActiveItemsL: END"));
+        return inactiveuids;
+        }
+    else
+        {
+        delete tempuids;
+        delete inactiveuids;
+        FLOG(_L("CNSmlAgendaDataStore::ActiveItemsL: END"));
+        return NULL;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::ExternalizeCommittedUidL
+// Populate iCommittedUidArr from the Stream
+// -----------------------------------------------------------------------------
+void CNSmlAgendaDataStore::ExternalizeCommittedUidL() const
+    {
+    FLOG(_L("CNSmlAgendaDataStore::ExternalizeCommittedUidL: BEGIN"));
+    
+    TUid uid = {KNSmlAgendaAdapterStreamUid};
+    RWriteStream writeStream;
+    
+    // Open stream for writing
+    iAgendaAdapterLog->iSyncRelationship.OpenWriteStreamLC(writeStream, uid);
+      
+    // Write the snapshot to the stream
+    TInt itemCount = iCommittedUidArr->ItemCount();
+    FLOG(_L("CNSmlAgendaDataStore::ExternalizeCommittedUidL: count '%d'"), itemCount);
+    writeStream.WriteInt32L(itemCount);
+    
+    if( itemCount > 0 )
+        {    
+        for (TInt i = 0; i < itemCount; ++i)
+            {
+            writeStream.WriteInt32L(iCommittedUidArr->ItemAt(i));
+            FLOG(_L("CNSmlAgendaDataStore::ExternalizeCommittedUidL: item '%d'"), iCommittedUidArr->ItemAt(i));
+            }        
+        }
+    writeStream.CommitL();
+    CleanupStack::PopAndDestroy(); // writeStream
+    FLOG(_L("CNSmlAgendaDataStore::ExternalizeCommittedUidL: END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::InternalizeCommittedUidL
+// Write the contents of iCommittedUidArr to the Stream
+// -----------------------------------------------------------------------------
+void CNSmlAgendaDataStore::InternalizeCommittedUidL() const
+    {
+    FLOG(_L("CNSmlAgendaDataStore::InternalizeCommittedUidL: BEGIN"));
+  
+    TUid uid = {KNSmlAgendaAdapterStreamUid};        
+    TBool hashistory = iAgendaAdapterLog->iSyncRelationship.IsStreamPresentL(uid);
+    
+    if (hashistory)
+        {
+        FLOG(_L("CNSmlAgendaDataStore::InternalizeCommittedUidL: HasHistory"));
+        
+        // Open stream for reading
+        RReadStream readStream;
+        iAgendaAdapterLog->iSyncRelationship.OpenReadStreamLC(readStream, uid);
+        
+        // Read snapshot from the stream
+        TSmlDbItemUid item;
+        TInt itemCount(readStream.ReadInt32L());
+        FLOG(_L("CNSmlAgendaDataStore::InternalizeCommittedUidL: count '%d'"), itemCount);
+        iCommittedUidArr->Reset();
+        for (TInt i = 0; i < itemCount; ++i)
+            {
+            item = readStream.ReadInt32L();
+            FLOG(_L("CNSmlAgendaDataStore::InternalizeCommittedUidL: item '%d'"), item);
+            iCommittedUidArr->AddItem(item);
+            }        
+        CleanupStack::PopAndDestroy(); // readStream
+        }
+
+    FLOG(_L("CNSmlAgendaDataStore::InternalizeCommittedUidL: END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStoreUtil::CNSmlAgendaDataStoreUtil
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CNSmlAgendaDataStoreUtil::CNSmlAgendaDataStoreUtil() :
+    iCalSession( NULL ),
+    iExporter( NULL ),
+    iImporter( NULL ),
+    iProgressView( NULL ),
+    iEntryView( NULL ),
+    iEntry( NULL ),
+    iFileName( NULL )
+    {
+    FLOG(_L("CNSmlAgendaDataStoreUtil::CNSmlAgendaDataStoreUtil(): BEGIN"));
+    
+    FLOG(_L("CNSmlAgendaDataStoreUtil::CNSmlAgendaDataStoreUtil(): END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStoreUtil::InitializeCalAPIsL
+// Initialize Calendar APIs for database access using the provided name and id
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStoreUtil::InitializeCalAPIsL( HBufC* aFileName, TSmlDbItemUid aUid )
+    {
+    FLOG(_L("CNSmlAgendaDataStoreUtil::InitializeCalAPIsL: BEGIN"));
+    
+    iCalSession = CCalSession::NewL();
+    iCalSession->OpenL(aFileName->Des());        
+    iExporter = CCalenExporter::NewL( *iCalSession );
+    iImporter = CCalenImporter::NewL( *iCalSession );
+    iProgressView = CNSmlAgendaProgressview::NewL();
+    iEntryView = CCalEntryView::NewL( *iCalSession, *iProgressView );
+    CActiveScheduler::Start();
+    TInt completedStatus = iProgressView->GetCompletedStatus();
+    if ( completedStatus != KErrNone )
+        {
+        FLOG(_L("CNSmlAgendaDataStoreUtil::ConstructL: ERROR in Progressview"));
+        }
+    if( aUid != NULL )
+        {
+        iEntry = iEntryView->FetchL( aUid );
+        if( NULL == iEntry )
+            {
+            User::Leave( KErrNotFound );
+            }
+        
+        }    
+    FLOG(_L("CNSmlAgendaDataStoreUtil::InitializeCalAPIsL: END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStoreUtil::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlAgendaDataStoreUtil* CNSmlAgendaDataStoreUtil::NewL()
+    {
+    FLOG(_L("CNSmlAgendaDataStoreUtil::NewL: BEGIN"));
+    
+    CNSmlAgendaDataStoreUtil* self = new ( ELeave ) CNSmlAgendaDataStoreUtil();
+    
+    FLOG(_L("CNSmlAgendaDataStoreUtil::NewL: END"));
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStoreUtil::~CNSmlAgendaDataStoreUtil
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlAgendaDataStoreUtil::~CNSmlAgendaDataStoreUtil()
+    {
+    FLOG(_L("CNSmlAgendaDataStoreUtil::~CNSmlAgendaDataStoreUtil(): BEGIN"));
+
+    delete iEntry;
+    delete iEntryView;
+    delete iExporter;
+    delete iImporter;
+    delete iCalSession;
+    delete iProgressView;
+    
+    FLOG(_L("CNSmlAgendaDataStoreUtil::~CNSmlAgendaDataStoreUtil(): END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaAdapterLog::CNSmlAgendaAdapterLog
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CNSmlAgendaAdapterLog::CNSmlAgendaAdapterLog( MSmlSyncRelationship& aSyncRelationship ) :
+    iSyncRelationship( aSyncRelationship )
+    {
+    FLOG(_L("CNSmlAgendaAdapterLog::CNSmlAgendaAdapterLog(): BEGIN"));
+    
+    FLOG(_L("CNSmlAgendaAdapterLog::CNSmlAgendaAdapterLog(): END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaAdapterLog::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlAgendaAdapterLog* CNSmlAgendaAdapterLog::NewL( MSmlSyncRelationship& aSyncRelationship )
+    {
+    FLOG(_L("CNSmlAgendaAdapterLog::NewL: BEGIN"));
+    
+    CNSmlAgendaAdapterLog* self = new ( ELeave ) CNSmlAgendaAdapterLog(aSyncRelationship);
+    
+    FLOG(_L("CNSmlAgendaAdapterLog::NewL: END"));
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaAdapterLog::~CNSmlAgendaAdapterLog
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlAgendaAdapterLog::~CNSmlAgendaAdapterLog()
+    {
+    FLOG(_L("CNSmlAgendaAdapterLog::~CNSmlAgendaAdapterLog(): BEGIN"));
+    
+    FLOG(_L("CNSmlAgendaAdapterLog::~CNSmlAgendaAdapterLog(): END"));
+    }
+
+   
 //  End of File  
--- a/omads/omadsextensions/adapters/agenda/src/nsmlagendaprogressview.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/agenda/src/nsmlagendaprogressview.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -18,8 +18,9 @@
 
 
 // INCLUDES
-#include "nsmldebug.h"
+#include "nsmlagendadebug.h"
 #include "nsmlagendadatastore.h"
+#include <nsmldebug.h>
 
 // ===================================== MEMBER FUNCTIONS ======================
 // -----------------------------------------------------------------------------
@@ -28,10 +29,10 @@
 // -----------------------------------------------------------------------------
 CNSmlAgendaProgressview* CNSmlAgendaProgressview::NewL()
 	{
-	_DBG_FILE("CNSmlAgendaProgressview::NewL(): BEGIN");
+	FLOG(_L("CNSmlAgendaProgressview::NewL(): BEGIN"));
 	CNSmlAgendaProgressview* self = new (ELeave) CNSmlAgendaProgressview();
 	self->ConstructL();
-	_DBG_FILE("CNSmlAgendaProgressview::NewL(): END");
+	FLOG(_L("CNSmlAgendaProgressview::NewL(): END"));
 	return self;
 	}
 	
@@ -41,9 +42,9 @@
 // -----------------------------------------------------------------------------
 CNSmlAgendaProgressview::~CNSmlAgendaProgressview()
 	{
-	_DBG_FILE("CNSmlAgendaProgressview::~CNSmlAgendaProgressview(): BEGIN");
+	FLOG(_L("CNSmlAgendaProgressview::~CNSmlAgendaProgressview(): BEGIN"));
 	// Nothing to do
-	_DBG_FILE("CNSmlAgendaProgressview::~CNSmlAgendaProgressview(): END");
+	FLOG(_L("CNSmlAgendaProgressview::~CNSmlAgendaProgressview(): END"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -53,8 +54,8 @@
 // -----------------------------------------------------------------------------
 void CNSmlAgendaProgressview::Progress( TInt /*aPercentageCompleted*/ )
 	{
-	_DBG_FILE("CNSmlAgendaProgressview::Progress(): BEGIN");
-	_DBG_FILE("CNSmlAgendaProgressview::Progress(): END");
+	FLOG(_L("CNSmlAgendaProgressview::Progress(): BEGIN"));
+	FLOG(_L("CNSmlAgendaProgressview::Progress(): END"));
 	}
 	
 // -----------------------------------------------------------------------------
@@ -63,12 +64,12 @@
 // -----------------------------------------------------------------------------
 void CNSmlAgendaProgressview::Completed( TInt aError )
 	{
-	_DBG_FILE("CNSmlAgendaProgressview::Completed(): BEGIN");
+	FLOG(_L("CNSmlAgendaProgressview::Completed(): BEGIN"));
 
     iCompletedStatus = aError;
 	CActiveScheduler::Stop();
 
-    _DBG_FILE("CNSmlAgendaProgressview::Completed(): END");
+    FLOG(_L("CNSmlAgendaProgressview::Completed(): END"));
 	}
 
 // -----------------------------------------------------------------------------
@@ -86,8 +87,8 @@
 // -----------------------------------------------------------------------------
 TBool CNSmlAgendaProgressview::NotifyProgress()
 	{
-	_DBG_FILE("CNSmlAgendaProgressview::NotifyProgress(): BEGIN");
-	_DBG_FILE("CNSmlAgendaProgressview::NotifyProgress(): END");
+	FLOG(_L("CNSmlAgendaProgressview::NotifyProgress(): BEGIN"));
+	FLOG(_L("CNSmlAgendaProgressview::NotifyProgress(): END"));
 	return EFalse;
 	}
 
@@ -98,9 +99,9 @@
 CNSmlAgendaProgressview::CNSmlAgendaProgressview() :
 	iCompletedStatus( KErrNotReady )
 	{
-	_DBG_FILE("CNSmlAgendaProgressview::CNSmlAgendaProgressview(): BEGIN");
+	FLOG(_L("CNSmlAgendaProgressview::CNSmlAgendaProgressview(): BEGIN"));
 	// Nothing to do
-	_DBG_FILE("CNSmlAgendaProgressview::CNSmlAgendaProgressview(): END");
+	FLOG(_L("CNSmlAgendaProgressview::CNSmlAgendaProgressview(): END"));
 	}
 	
 // -----------------------------------------------------------------------------
@@ -109,9 +110,9 @@
 // -----------------------------------------------------------------------------
 void CNSmlAgendaProgressview::ConstructL()
     {
-    _DBG_FILE("CNSmlAgendaProgressview::ConstructL(): BEGIN");
+    FLOG(_L("CNSmlAgendaProgressview::ConstructL(): BEGIN"));
     // Nothing to do
-    _DBG_FILE("CNSmlAgendaProgressview::ConstructL(): END");
+    FLOG(_L("CNSmlAgendaProgressview::ConstructL(): END"));
     }
 
 //  End of File  
--- a/omads/omadsextensions/adapters/bld/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/bld/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2004-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"
@@ -17,7 +17,6 @@
 
 
 PRJ_EXPORTS
-
 #ifdef __SYNCML_DS_CON
 #include "../contacts/bld/bld.inf"
 #endif
@@ -26,16 +25,14 @@
 #include "../agenda/bld/bld.inf"
 #endif
 
-#ifdef  __SYNCML_DS_NOTEPAD
-#include "../notes/group/bld.inf"
+#ifdef __SYNCML_DS_SMS
+#include "../sms/group/bld.inf"
 #endif
 
-#include "../contactsgroup/group/bld.inf"
-
-#include "../mediads/group/bld.inf"
+#ifdef __SYNCML_DS_BOOKMARK
+#include "../bookmark/group/bld.inf"
+#endif
 
-// #include "../bookmark/group/bld.inf"
-
+#ifdef __SYNCML_DS_MMS
 #include "../mms/group/bld.inf"
-
-#include "../sms/group/bld.inf"
\ No newline at end of file
+#endif
Binary file omads/omadsextensions/adapters/bookmark/group/102751BA.XML has changed
--- a/omads/omadsextensions/adapters/bookmark/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/bookmark/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -21,7 +21,8 @@
 DEFAULT
 
 PRJ_EXPORTS
-./102751ba.xml              Z:/private/101F99F6/capability/102751ba.xml
+./102751BA.XML              /epoc32/data/Z/private/101F99F6/capability/102751BA.XML
+./102751BA.XML              /epoc32/release/winscw/udeb/z/private/101F99F6/capability/102751BA.XML
 ./bookmarkdsa_stub.sis      /epoc32/data/z/system/install/bookmarkdsa_stub.sis
 ../rom/bookmarkdsa.iby      CORE_APP_LAYER_IBY_EXPORT_PATH(bookmarkdsa.iby)
 ../loc/bookmarkdsa.loc      APP_LAYER_LOC_EXPORT_PATH(bookmarkdsa.loc)
--- a/omads/omadsextensions/adapters/bookmark/group/bookmarkdsa_stub.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/bookmark/group/bookmarkdsa_stub.pkg	Wed Sep 01 12:30:02 2010 +0100
@@ -1,5 +1,5 @@
 ;
-; Copyright (c) 2009-2010 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"
@@ -11,14 +11,13 @@
 ;
 ; Contributors:
 ;
-; Description: Stub sis file for Bookmark datasync adapter
+; Description:
 ;
-
 ; Languages
 &EN
 
 ; Header
-#{"Bookmark DS Plugin"},(0x102751BA),2,0,0, TYPE=SA
+#{"Bookmark DS Plugin"},(0x102751BA),1,0,0, TYPE=SA
 
 ; Localised Vendor name
 %{"Nokia"}
Binary file omads/omadsextensions/adapters/bookmark/group/bookmarkdsa_stub.sis has changed
--- a/omads/omadsextensions/adapters/bookmark/group/createstub.bat	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-rem
-rem Copyright (c) 2010 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: Batch file for creating needed stub files.
-rem
-
-makesis -s bookmarkdsa_stub.pkg
\ No newline at end of file
--- a/omads/omadsextensions/adapters/bookmark/inc/logger.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/bookmark/inc/logger.h	Wed Sep 01 12:30:02 2010 +0100
@@ -21,8 +21,10 @@
 
 #ifdef _DEBUG
     
-    // Define this to enable file logging
-    #define __FLOGGING__
+    #ifdef __WINS__
+        // File logging for WINS
+        #define __FLOGGING__
+    #endif //__WINS__
     
     #include <e32svr.h>
     #ifdef __FLOGGING__
--- a/omads/omadsextensions/adapters/bookmark/sis/backup_registration.xml	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<?xml version="1.0" standalone="yes"?> 
-<backup_registration>
-    <system_backup />
-    <restore requires_reboot = "no"/>
-</backup_registration> 
\ No newline at end of file
--- a/omads/omadsextensions/adapters/bookmark/sis/bookmarkdsa.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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: Sis file for Bookmark datasync adapter
-;
-
-;*Unique (Non-Localised) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade ofa a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localised vendor name(s) correspodning to language(s).
-%{"Nokia"}
-
-;Language - standard language definitions
-&EN
-
-;package-header
-#{"Bookmark DS Plugin"},(0x102751BA),2,0,0, TYPE=SA, RU
-
-; S60 v5.2
-[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
-
-"\epoc32\data\z\resource\bookmarkdsa.rsc"             -"c:\resource\bookmarkdsa.rsc"
-"\epoc32\data\z\resource\bookmarkdatastore.rsc"             -"c:\resource\bookmarkdatastore.rsc"
-"\epoc32\data\z\resource\plugins\bookmarkdataprovider.rsc"  -"c:\resource\plugins\bookmarkdataprovider.rsc"
-"\epoc32\release\armv5\urel\bookmarkdataprovider.dll"       -"c:\sys\bin\bookmarkdataprovider.dll"
-
-"\epoc32\data\Z\private\101F99F6\capability\102751ba.xml"   -"c:\private\101F99F6\import\102751ba.xml"
-"backup_registration.xml"                                   -"c:\private\10202D56\import\packages\101FF972\backup_registration.xml"
--- a/omads/omadsextensions/adapters/bookmark/sis/bookmarkdsa_debug.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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: 
-;
-
-;*Unique (Non-Localised) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade ofa a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localised vendor name(s) correspodning to language(s).
-%{"Nokia"}
-
-;Language - standard language definitions
-&EN
-
-;package-header
-#{"Contacts Group DS Plugin"},(0x101FF972),1,23,0,TYPE=SA, RU
-
-; S60 v5.2
-[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
-
-"\epoc32\data\z\resource\contactsgrpdatastore.rsc"             -"c:\resource\contactsgrpdatastore.rsc"
-"\epoc32\data\z\resource\plugins\contactsgrpdataprovider.rsc"  -"c:\resource\plugins\contactsgrpdataprovider.rsc"
-"\epoc32\release\ARMV5\UDEB\contactsgrpdataprovider.dll"       -"c:\sys\bin\contactsgrpdataprovider.dll"
-
-"\epoc32\data\Z\private\101F99F6\capability\101ff972.xml"   -"c:\private\101F99F6\import\101ff972.xml"
-"backup_registration.xml"                                   -"c:\private\10202D56\import\packages\101FF972\backup_registration.xml"
--- a/omads/omadsextensions/adapters/contacts/bld/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/contacts/bld/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -15,6 +15,7 @@
 *
 */
 
+
 #include <platform_paths.hrh>
 PRJ_EXPORTS
 ../loc/101F6DD6.loc		APP_LAYER_LOC_EXPORT_PATH(101F6DD6.loc)
--- a/omads/omadsextensions/adapters/contacts/bld/def/bwinscwcontactsdataprovideru.def	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/contacts/bld/def/bwinscwcontactsdataprovideru.def	Wed Sep 01 12:30:02 2010 +0100
@@ -8,70 +8,92 @@
 	?ConstructL@CNSmlContactsDataStore@@IAEXXZ @ 7 NONAME ; void CNSmlContactsDataStore::ConstructL(void)
 	?NewL@CNSmlContactsDataStore@@SAPAV1@XZ @ 8 NONAME ; class CNSmlContactsDataStore * CNSmlContactsDataStore::NewL(void)
 	?DoGenerateFieldFilterQueryL@CNSmlContactsDataProvider@@MAEXABV?$RPointerArray@VCSyncMLFilter@@@@AAVTDes16@@AAV?$RPointerArray@VCSmlDataProperty@@@@AAVTDesC16@@@Z @ 9 NONAME ; void CNSmlContactsDataProvider::DoGenerateFieldFilterQueryL(class RPointerArray<class CSyncMLFilter> const &, class TDes16 &, class RPointerArray<class CSmlDataProperty> &, class TDesC16 &)
-	??0CNSmlContactsDataStore@@IAE@XZ @ 10 NONAME ; CNSmlContactsDataStore::CNSmlContactsDataStore(void)
-	?DoResetChangeInfoL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 11 NONAME ; void CNSmlContactsDataStore::DoResetChangeInfoL(class TRequestStatus &)
-	?DoBeginBatchL@CNSmlContactsDataStore@@MAEXXZ @ 12 NONAME ; void CNSmlContactsDataStore::DoBeginBatchL(void)
-	?DoSoftDeletedItems@CNSmlContactsDataStore@@MBEABVMSmlDataItemUidSet@@XZ @ 13 NONAME ; class MSmlDataItemUidSet const & CNSmlContactsDataStore::DoSoftDeletedItems(void) const
-	??1CNSmlContactsDataStore@@UAE@XZ @ 14 NONAME ; CNSmlContactsDataStore::~CNSmlContactsDataStore(void)
-	?GetStoreFormatResourceFileL@CNSmlContactsDataProvider@@MBEABVTDesC16@@XZ @ 15 NONAME ; class TDesC16 const & CNSmlContactsDataProvider::GetStoreFormatResourceFileL(void) const
-	?SetOwnStoreFormatL@CNSmlContactsDataStore@@IAEXXZ @ 16 NONAME ; void CNSmlContactsDataStore::SetOwnStoreFormatL(void)
-	?AddBufferListL@CNSmlContactsDataStore@@IAEPAVCBufBase@@AAHHH@Z @ 17 NONAME ; class CBufBase * CNSmlContactsDataStore::AddBufferListL(int &, int, int)
-	?LdoMergeLC@CNSmlContactsDataStore@@IAEPAVCBufBase@@AAHABVTDesC8@@@Z @ 18 NONAME ; class CBufBase * CNSmlContactsDataStore::LdoMergeLC(int &, class TDesC8 const &)
-	?DoListStoresLC@CNSmlContactsDataStore@@QAEPAVCDesC16Array@@XZ @ 19 NONAME ; class CDesC16Array * CNSmlContactsDataStore::DoListStoresLC(void)
-	?StripPropertyL@CNSmlContactsDataStore@@IBEXAAPAVCBufBase@@ABVTDesC8@@@Z @ 20 NONAME ; void CNSmlContactsDataStore::StripPropertyL(class CBufBase * &, class TDesC8 const &) const
-	??0CNSmlContactsDataProvider@@IAE@XZ @ 21 NONAME ; CNSmlContactsDataProvider::CNSmlContactsDataProvider(void)
-	?ConstructL@CNSmlContactsDataProvider@@IAEXXZ @ 22 NONAME ; void CNSmlContactsDataProvider::ConstructL(void)
-	?DoCommitChangeInfoL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@ABVMSmlDataItemUidSet@@@Z @ 23 NONAME ; void CNSmlContactsDataStore::DoCommitChangeInfoL(class TRequestStatus &, class MSmlDataItemUidSet const &)
-	?DoOnFrameworkEvent@CNSmlContactsDataProvider@@MAEXW4TSmlFrameworkEvent@@HH@Z @ 24 NONAME ; void CNSmlContactsDataProvider::DoOnFrameworkEvent(enum TSmlFrameworkEvent, int, int)
-	?DoDeleteAllItemsL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 25 NONAME ; void CNSmlContactsDataStore::DoDeleteAllItemsL(class TRequestStatus &)
-	?LdoAddItemL@CNSmlContactsDataStore@@IAEHAAHABVTDesC8@@HAAVTTime@@@Z @ 26 NONAME ; int CNSmlContactsDataStore::LdoAddItemL(int &, class TDesC8 const &, int, class TTime &)
-	??1CNSmlContactsDataProvider@@UAE@XZ @ 27 NONAME ; CNSmlContactsDataProvider::~CNSmlContactsDataProvider(void)
-	?DefaultStoreNameL@CNSmlContactsDataStore@@QBEABVTDesC16@@XZ @ 28 NONAME ; class TDesC16 const & CNSmlContactsDataStore::DefaultStoreNameL(void) const
-	?DoSetRemoteStoreFormatL@CNSmlContactsDataStore@@MAEXABVCSmlDataStoreFormat@@@Z @ 29 NONAME ; void CNSmlContactsDataStore::DoSetRemoteStoreFormatL(class CSmlDataStoreFormat const &)
-	?DriveBelowCriticalLevelL@CNSmlContactsDataStore@@IAEHH@Z @ 30 NONAME ; int CNSmlContactsDataStore::DriveBelowCriticalLevelL(int)
-	?ExecuteBufferL@CNSmlContactsDataStore@@IAEHAAV?$RArray@H@@@Z @ 31 NONAME ; int CNSmlContactsDataStore::ExecuteBufferL(class RArray<int> &)
-	?GetDataMod@CNSmlContactsDataStore@@MAEAAVCNSmlDataModBase@@XZ @ 32 NONAME ; class CNSmlDataModBase & CNSmlContactsDataStore::GetDataMod(void)
-	?DoSoftDeleteItemL@CNSmlContactsDataStore@@MAEXHAAVTRequestStatus@@@Z @ 33 NONAME ; void CNSmlContactsDataStore::DoSoftDeleteItemL(int, class TRequestStatus &)
-	?DoMoveItemL@CNSmlContactsDataStore@@MAEXHHAAVTRequestStatus@@@Z @ 34 NONAME ; void CNSmlContactsDataStore::DoMoveItemL(int, int, class TRequestStatus &)
-	?DoDefaultStoreL@CNSmlContactsDataProvider@@MAEABVTDesC16@@XZ @ 35 NONAME ; class TDesC16 const & CNSmlContactsDataProvider::DoDefaultStoreL(void)
-	?LdoUpdateItemL@CNSmlContactsDataStore@@IAEHHABVTDesC8@@HAAVTTime@@@Z @ 36 NONAME ; int CNSmlContactsDataStore::LdoUpdateItemL(int, class TDesC8 const &, int, class TTime &)
-	?DoStoreName@CNSmlContactsDataStore@@MBEABVTDesC16@@XZ @ 37 NONAME ; class TDesC16 const & CNSmlContactsDataStore::DoStoreName(void) const
-	?DoCreateItemL@CNSmlContactsDataStore@@MAEXAAHHHABVTDesC8@@1AAVTRequestStatus@@@Z @ 38 NONAME ; void CNSmlContactsDataStore::DoCreateItemL(int &, int, int, class TDesC8 const &, class TDesC8 const &, class TRequestStatus &)
-	??1CNSmlContactsBufferItem@CNSmlContactsDataStore@@UAE@XZ @ 39 NONAME ; CNSmlContactsDataStore::CNSmlContactsBufferItem::~CNSmlContactsBufferItem(void)
-	?DoListStoresLC@CNSmlContactsDataProvider@@MAEPAVCDesC16Array@@XZ @ 40 NONAME ; class CDesC16Array * CNSmlContactsDataProvider::DoListStoresLC(void)
-	?DoSupportsOperation@CNSmlContactsDataProvider@@MBEHVTUid@@@Z @ 41 NONAME ; int CNSmlContactsDataProvider::DoSupportsOperation(class TUid) const
-	?DoCommitChangeInfoL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 42 NONAME ; void CNSmlContactsDataStore::DoCommitChangeInfoL(class TRequestStatus &)
-	?NewL@CNSmlContactsDataProvider@@SAPAV1@XZ @ 43 NONAME ; class CNSmlContactsDataProvider * CNSmlContactsDataProvider::NewL(void)
-	?DoGenerateRecordFilterQueryLC@CNSmlContactsDataProvider@@MAEPAVHBufC16@@ABV?$RPointerArray@VCSyncMLFilter@@@@W4TSyncMLFilterMatchType@@AAVTDes16@@AAW4TSyncMLFilterType@@AAVTDesC16@@@Z @ 44 NONAME ; class HBufC16 * CNSmlContactsDataProvider::DoGenerateRecordFilterQueryLC(class RPointerArray<class CSyncMLFilter> const &, enum TSyncMLFilterMatchType, class TDes16 &, enum TSyncMLFilterType &, class TDesC16 &)
-	?DoExecuteBufferL@CNSmlContactsDataStore@@MAEHAAV?$RArray@H@@@Z @ 45 NONAME ; int CNSmlContactsDataStore::DoExecuteBufferL(class RArray<int> &)
-	?DoCheckSupportedServerFiltersL@CNSmlContactsDataProvider@@MAEXABVCSmlDataStoreFormat@@AAV?$RPointerArray@VCSyncMLFilter@@@@AAW4TSyncMLFilterChangeInfo@@@Z @ 46 NONAME ; void CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL(class CSmlDataStoreFormat const &, class RPointerArray<class CSyncMLFilter> &, enum TSyncMLFilterChangeInfo &)
-	?DoRevertTransaction@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 47 NONAME ; void CNSmlContactsDataStore::DoRevertTransaction(class TRequestStatus &)
-	?DoCommitItemL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 48 NONAME ; void CNSmlContactsDataStore::DoCommitItemL(class TRequestStatus &)
-	?DoDeleteItemL@CNSmlContactsDataStore@@MAEXHAAVTRequestStatus@@@Z @ 49 NONAME ; void CNSmlContactsDataStore::DoDeleteItemL(int, class TRequestStatus &)
-	?CreateDataStoreLC@CNSmlContactsDataProvider@@MBEPAVCNSmlContactsDataStore@@XZ @ 50 NONAME ; class CNSmlContactsDataStore * CNSmlContactsDataProvider::CreateDataStoreLC(void) const
-	?DoHasSyncHistory@CNSmlContactsDataStore@@MBEHXZ @ 51 NONAME ; int CNSmlContactsDataStore::DoHasSyncHistory(void) const
-	?DoCommitBatchL@CNSmlContactsDataStore@@MAEXAAV?$RArray@H@@AAVTRequestStatus@@@Z @ 52 NONAME ; void CNSmlContactsDataStore::DoCommitBatchL(class RArray<int> &, class TRequestStatus &)
-	?DoMaxObjectSize@CNSmlContactsDataStore@@MBEHXZ @ 53 NONAME ; int CNSmlContactsDataStore::DoMaxObjectSize(void) const
-	?DoReplaceItemL@CNSmlContactsDataStore@@MAEXHHHHAAVTRequestStatus@@@Z @ 54 NONAME ; void CNSmlContactsDataStore::DoReplaceItemL(int, int, int, int, class TRequestStatus &)
-	?DoCloseItem@CNSmlContactsDataStore@@MAEXXZ @ 55 NONAME ; void CNSmlContactsDataStore::DoCloseItem(void)
-	?DoCommitTransactionL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 56 NONAME ; void CNSmlContactsDataStore::DoCommitTransactionL(class TRequestStatus &)
-	?LdoAddItemsL@CNSmlContactsDataStore@@IAEHAAV?$RArray@H@@AAPAVCBufBase@@HAAVTTime@@@Z @ 57 NONAME ; int CNSmlContactsDataStore::LdoAddItemsL(class RArray<int> &, class CBufBase * &, int, class TTime &)
-	?LdoFetchItemL@CNSmlContactsDataStore@@IAEHAAHAAVCBufBase@@@Z @ 58 NONAME ; int CNSmlContactsDataStore::LdoFetchItemL(int &, class CBufBase &)
-	?DoStoreFormatL@CNSmlContactsDataProvider@@MAEABVCSmlDataStoreFormat@@XZ @ 59 NONAME ; class CSmlDataStoreFormat const & CNSmlContactsDataProvider::DoStoreFormatL(void)
-	?GetStoreFormatResourceFileL@CNSmlContactsDataStore@@MBEABVTDesC16@@XZ @ 60 NONAME ; class TDesC16 const & CNSmlContactsDataStore::GetStoreFormatResourceFileL(void) const
-	?DoCancelBatch@CNSmlContactsDataStore@@MAEXXZ @ 61 NONAME ; void CNSmlContactsDataStore::DoCancelBatch(void)
-	?NewLC@CNSmlContactsDataProvider@@KAPAV1@XZ @ 62 NONAME ; class CNSmlContactsDataProvider * CNSmlContactsDataProvider::NewLC(void)
-	?ConstructL@CNSmlContactsDataStore@@IAEXABVTDesC16@@@Z @ 63 NONAME ; void CNSmlContactsDataStore::ConstructL(class TDesC16 const &)
-	?DoCheckServerFiltersL@CNSmlContactsDataProvider@@MAEXAAV?$RPointerArray@VCSyncMLFilter@@@@AAW4TSyncMLFilterChangeInfo@@@Z @ 64 NONAME ; void CNSmlContactsDataProvider::DoCheckServerFiltersL(class RPointerArray<class CSyncMLFilter> &, enum TSyncMLFilterChangeInfo &)
-	?DoCancelRequest@CNSmlContactsDataStore@@MAEXXZ @ 65 NONAME ; void CNSmlContactsDataStore::DoCancelRequest(void)
-	?DoOpenItemL@CNSmlContactsDataStore@@MAEXHAAH00AAVTDes8@@1AAVTRequestStatus@@@Z @ 66 NONAME ; void CNSmlContactsDataStore::DoOpenItemL(int, int &, int &, int &, class TDes8 &, class TDes8 &, class TRequestStatus &)
-	?DoBeginTransactionL@CNSmlContactsDataStore@@MAEXXZ @ 67 NONAME ; void CNSmlContactsDataStore::DoBeginTransactionL(void)
-	?DoAddedItems@CNSmlContactsDataStore@@MBEABVMSmlDataItemUidSet@@XZ @ 68 NONAME ; class MSmlDataItemUidSet const & CNSmlContactsDataStore::DoAddedItems(void) const
-	?DoSetRemoteMaxObjectSize@CNSmlContactsDataStore@@MAEXH@Z @ 69 NONAME ; void CNSmlContactsDataStore::DoSetRemoteMaxObjectSize(int)
-	?StripPropertyL@CNSmlContactsDataStore@@IBEXAAPAVHBufC8@@ABVTDesC8@@@Z @ 70 NONAME ; void CNSmlContactsDataStore::StripPropertyL(class HBufC8 * &, class TDesC8 const &) const
-	?DoOpenL@CNSmlContactsDataStore@@MAEXABVTDesC16@@AAVMSmlSyncRelationship@@AAVTRequestStatus@@@Z @ 71 NONAME ; void CNSmlContactsDataStore::DoOpenL(class TDesC16 const &, class MSmlSyncRelationship &, class TRequestStatus &)
-	?DoMovedItems@CNSmlContactsDataStore@@MBEABVMSmlDataItemUidSet@@XZ @ 72 NONAME ; class MSmlDataItemUidSet const & CNSmlContactsDataStore::DoMovedItems(void) const
-	?DoNewStoreInstanceLC@CNSmlContactsDataProvider@@MAEPAVCSmlDataStore@@XZ @ 73 NONAME ; class CSmlDataStore * CNSmlContactsDataProvider::DoNewStoreInstanceLC(void)
-	?ExportContactsL@CNSmlContactsDataStore@@MAEHABVTUid@@AAVCBufBase@@@Z @ 74 NONAME ; int CNSmlContactsDataStore::ExportContactsL(class TUid const &, class CBufBase &)
-	?ImportContactsL@CNSmlContactsDataStore@@MAEPAV?$CArrayFixFlat@VTUid@@@@ABVTDesC8@@@Z @ 75 NONAME ; class CArrayFixFlat<class TUid> * CNSmlContactsDataStore::ImportContactsL(class TDesC8 const &)
+	?ContactRemovedFromView@CNSmlContactsDataStore@@MAEXAAVMVPbkContactViewBase@@HABVMVPbkContactLink@@@Z @ 10 NONAME ; void CNSmlContactsDataStore::ContactRemovedFromView(class MVPbkContactViewBase &, int, class MVPbkContactLink const &)
+	??0CNSmlContactsDataStore@@IAE@XZ @ 11 NONAME ; CNSmlContactsDataStore::CNSmlContactsDataStore(void)
+	?OperationComplete@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@@Z @ 12 NONAME ; void CNSmlContactsDataStore::OperationComplete(class MVPbkContactOperationBase &)
+	?ExecuteDeleteL@CNSmlContactsDataStore@@MAEXXZ @ 13 NONAME ; void CNSmlContactsDataStore::ExecuteDeleteL(void)
+	?DoResetChangeInfoL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 14 NONAME ; void CNSmlContactsDataStore::DoResetChangeInfoL(class TRequestStatus &)
+	?DoBeginBatchL@CNSmlContactsDataStore@@MAEXXZ @ 15 NONAME ; void CNSmlContactsDataStore::DoBeginBatchL(void)
+	?DoSoftDeletedItems@CNSmlContactsDataStore@@MBEABVMSmlDataItemUidSet@@XZ @ 16 NONAME ; class MSmlDataItemUidSet const & CNSmlContactsDataStore::DoSoftDeletedItems(void) const
+	?StoreReady@CNSmlContactsDataStore@@MAEXAAVMVPbkContactStore@@@Z @ 17 NONAME ; void CNSmlContactsDataStore::StoreReady(class MVPbkContactStore &)
+	??1CNSmlContactsDataStore@@UAE@XZ @ 18 NONAME ; CNSmlContactsDataStore::~CNSmlContactsDataStore(void)
+	?GetStoreFormatResourceFileL@CNSmlContactsDataProvider@@MBEABVTDesC16@@XZ @ 19 NONAME ; class TDesC16 const & CNSmlContactsDataProvider::GetStoreFormatResourceFileL(void) const
+	?SetOwnStoreFormatL@CNSmlContactsDataStore@@IAEXXZ @ 20 NONAME ; void CNSmlContactsDataStore::SetOwnStoreFormatL(void)
+	?AddBufferListL@CNSmlContactsDataStore@@IAEPAVCBufBase@@AAHHH@Z @ 21 NONAME ; class CBufBase * CNSmlContactsDataStore::AddBufferListL(int &, int, int)
+	?DoListStoresLC@CNSmlContactsDataStore@@QAEPAVCDesC16Array@@XZ @ 22 NONAME ; class CDesC16Array * CNSmlContactsDataStore::DoListStoresLC(void)
+	?StripPropertyL@CNSmlContactsDataStore@@IBEXAAPAVCBufBase@@ABVTDesC8@@@Z @ 23 NONAME ; void CNSmlContactsDataStore::StripPropertyL(class CBufBase * &, class TDesC8 const &) const
+	?ContactAddedToView@CNSmlContactsDataStore@@MAEXAAVMVPbkContactViewBase@@HABVMVPbkContactLink@@@Z @ 24 NONAME ; void CNSmlContactsDataStore::ContactAddedToView(class MVPbkContactViewBase &, int, class MVPbkContactLink const &)
+	?ContactsSaved@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@PAVMVPbkContactLinkArray@@@Z @ 25 NONAME ; void CNSmlContactsDataStore::ContactsSaved(class MVPbkContactOperationBase &, class MVPbkContactLinkArray *)
+	?ExecuteUpdateL@CNSmlContactsDataStore@@MAEXXZ @ 26 NONAME ; void CNSmlContactsDataStore::ExecuteUpdateL(void)
+	??0CNSmlContactsDataProvider@@IAE@XZ @ 27 NONAME ; CNSmlContactsDataProvider::CNSmlContactsDataProvider(void)
+	?ConstructL@CNSmlContactsDataProvider@@IAEXXZ @ 28 NONAME ; void CNSmlContactsDataProvider::ConstructL(void)
+	?LdoAddItemsL@CNSmlContactsDataStore@@MAEXAAPAVCBufBase@@H@Z @ 29 NONAME ; void CNSmlContactsDataStore::LdoAddItemsL(class CBufBase * &, int)
+	?StepFailed@CNSmlContactsDataStore@@MAEHAAVMVPbkContactOperationBase@@HH@Z @ 30 NONAME ; int CNSmlContactsDataStore::StepFailed(class MVPbkContactOperationBase &, int, int)
+	?HandleStoreEventL@CNSmlContactsDataStore@@MAEXAAVMVPbkContactStore@@VTVPbkContactStoreEvent@@@Z @ 31 NONAME ; void CNSmlContactsDataStore::HandleStoreEventL(class MVPbkContactStore &, class TVPbkContactStoreEvent)
+	?DoCommitChangeInfoL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@ABVMSmlDataItemUidSet@@@Z @ 32 NONAME ; void CNSmlContactsDataStore::DoCommitChangeInfoL(class TRequestStatus &, class MSmlDataItemUidSet const &)
+	?DoOnFrameworkEvent@CNSmlContactsDataProvider@@MAEXW4TSmlFrameworkEvent@@HH@Z @ 33 NONAME ; void CNSmlContactsDataProvider::DoOnFrameworkEvent(enum TSmlFrameworkEvent, int, int)
+	?DoDeleteAllItemsL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 34 NONAME ; void CNSmlContactsDataStore::DoDeleteAllItemsL(class TRequestStatus &)
+	??1CNSmlContactsDataProvider@@UAE@XZ @ 35 NONAME ; CNSmlContactsDataProvider::~CNSmlContactsDataProvider(void)
+	?IsConfidentialL@CNSmlContactsDataStore@@IAEHAAVMVPbkStoreContact@@@Z @ 36 NONAME ; int CNSmlContactsDataStore::IsConfidentialL(class MVPbkStoreContact &)
+	?DefaultStoreNameL@CNSmlContactsDataStore@@QBEABVTDesC16@@XZ @ 37 NONAME ; class TDesC16 const & CNSmlContactsDataStore::DefaultStoreNameL(void) const
+	?DoSetRemoteStoreFormatL@CNSmlContactsDataStore@@MAEXABVCSmlDataStoreFormat@@@Z @ 38 NONAME ; void CNSmlContactsDataStore::DoSetRemoteStoreFormatL(class CSmlDataStoreFormat const &)
+	?DriveBelowCriticalLevelL@CNSmlContactsDataStore@@IAEHH@Z @ 39 NONAME ; int CNSmlContactsDataStore::DriveBelowCriticalLevelL(int)
+	?CreateViewL@CNSmlContactsDataStore@@IAEXXZ @ 40 NONAME ; void CNSmlContactsDataStore::CreateViewL(void)
+	?GetDataMod@CNSmlContactsDataStore@@MAEAAVCNSmlDataModBase@@XZ @ 41 NONAME ; class CNSmlDataModBase & CNSmlContactsDataStore::GetDataMod(void)
+	?ResetBuffer@CNSmlContactsDataStore@@IAEXXZ @ 42 NONAME ; void CNSmlContactsDataStore::ResetBuffer(void)
+	?DoSoftDeleteItemL@CNSmlContactsDataStore@@MAEXHAAVTRequestStatus@@@Z @ 43 NONAME ; void CNSmlContactsDataStore::DoSoftDeleteItemL(int, class TRequestStatus &)
+	?DoMoveItemL@CNSmlContactsDataStore@@MAEXHHAAVTRequestStatus@@@Z @ 44 NONAME ; void CNSmlContactsDataStore::DoMoveItemL(int, int, class TRequestStatus &)
+	?DoDefaultStoreL@CNSmlContactsDataProvider@@MAEABVTDesC16@@XZ @ 45 NONAME ; class TDesC16 const & CNSmlContactsDataProvider::DoDefaultStoreL(void)
+	?ExecuteMoveL@CNSmlContactsDataStore@@MAEXXZ @ 46 NONAME ; void CNSmlContactsDataStore::ExecuteMoveL(void)
+	?SingleContactOperationCompleteL@CNSmlContactsDataStore@@IAEXPAVMVPbkStoreContact@@@Z @ 47 NONAME ; void CNSmlContactsDataStore::SingleContactOperationCompleteL(class MVPbkStoreContact *)
+	?DoStoreName@CNSmlContactsDataStore@@MBEABVTDesC16@@XZ @ 48 NONAME ; class TDesC16 const & CNSmlContactsDataStore::DoStoreName(void) const
+	?DoDeleteAllContactsL@CNSmlContactsDataStore@@MAEXXZ @ 49 NONAME ; void CNSmlContactsDataStore::DoDeleteAllContactsL(void)
+	?DoCreateItemL@CNSmlContactsDataStore@@MAEXAAHHHABVTDesC8@@1AAVTRequestStatus@@@Z @ 50 NONAME ; void CNSmlContactsDataStore::DoCreateItemL(int &, int, int, class TDesC8 const &, class TDesC8 const &, class TRequestStatus &)
+	??1CNSmlContactsBufferItem@CNSmlContactsDataStore@@UAE@XZ @ 51 NONAME ; CNSmlContactsDataStore::CNSmlContactsBufferItem::~CNSmlContactsBufferItem(void)
+	?DoListStoresLC@CNSmlContactsDataProvider@@MAEPAVCDesC16Array@@XZ @ 52 NONAME ; class CDesC16Array * CNSmlContactsDataProvider::DoListStoresLC(void)
+	?DoSupportsOperation@CNSmlContactsDataProvider@@MBEHVTUid@@@Z @ 53 NONAME ; int CNSmlContactsDataProvider::DoSupportsOperation(class TUid) const
+	?ContactViewError@CNSmlContactsDataStore@@MAEXAAVMVPbkContactViewBase@@HH@Z @ 54 NONAME ; void CNSmlContactsDataStore::ContactViewError(class MVPbkContactViewBase &, int, int)
+	?ContactViewReady@CNSmlContactsDataStore@@MAEXAAVMVPbkContactViewBase@@@Z @ 55 NONAME ; void CNSmlContactsDataStore::ContactViewReady(class MVPbkContactViewBase &)
+	?DoCommitChangeInfoL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 56 NONAME ; void CNSmlContactsDataStore::DoCommitChangeInfoL(class TRequestStatus &)
+	?ConstructL@CNSmlContactsDataStore@@IAEXABVTDesC16@@0@Z @ 57 NONAME ; void CNSmlContactsDataStore::ConstructL(class TDesC16 const &, class TDesC16 const &)
+	?NewL@CNSmlContactsDataProvider@@SAPAV1@XZ @ 58 NONAME ; class CNSmlContactsDataProvider * CNSmlContactsDataProvider::NewL(void)
+	?ExecuteBufferL@CNSmlContactsDataStore@@MAEXXZ @ 59 NONAME ; void CNSmlContactsDataStore::ExecuteBufferL(void)
+	?DoGenerateRecordFilterQueryLC@CNSmlContactsDataProvider@@MAEPAVHBufC16@@ABV?$RPointerArray@VCSyncMLFilter@@@@W4TSyncMLFilterMatchType@@AAVTDes16@@AAW4TSyncMLFilterType@@AAVTDesC16@@@Z @ 60 NONAME ; class HBufC16 * CNSmlContactsDataProvider::DoGenerateRecordFilterQueryLC(class RPointerArray<class CSyncMLFilter> const &, enum TSyncMLFilterMatchType, class TDes16 &, enum TSyncMLFilterType &, class TDesC16 &)
+	?ExecuteAddL@CNSmlContactsDataStore@@MAEHXZ @ 61 NONAME ; int CNSmlContactsDataStore::ExecuteAddL(void)
+	?VPbkSingleContactOperationComplete@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@PAVMVPbkStoreContact@@@Z @ 62 NONAME ; void CNSmlContactsDataStore::VPbkSingleContactOperationComplete(class MVPbkContactOperationBase &, class MVPbkStoreContact *)
+	?LdoAddItemL@CNSmlContactsDataStore@@MAEXABVTDesC8@@H@Z @ 63 NONAME ; void CNSmlContactsDataStore::LdoAddItemL(class TDesC8 const &, int)
+	?DoCheckSupportedServerFiltersL@CNSmlContactsDataProvider@@MAEXABVCSmlDataStoreFormat@@AAV?$RPointerArray@VCSyncMLFilter@@@@AAW4TSyncMLFilterChangeInfo@@@Z @ 64 NONAME ; void CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL(class CSmlDataStoreFormat const &, class RPointerArray<class CSyncMLFilter> &, enum TSyncMLFilterChangeInfo &)
+	?GetStoreFormatResourceFileL@CNSmlContactsDataStore@@MAEABVTDesC16@@XZ @ 65 NONAME ; class TDesC16 const & CNSmlContactsDataStore::GetStoreFormatResourceFileL(void)
+	?DoRevertTransaction@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 66 NONAME ; void CNSmlContactsDataStore::DoRevertTransaction(class TRequestStatus &)
+	?DoCommitItemL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 67 NONAME ; void CNSmlContactsDataStore::DoCommitItemL(class TRequestStatus &)
+	?LdoUpdateItemL@CNSmlContactsDataStore@@MAEXXZ @ 68 NONAME ; void CNSmlContactsDataStore::LdoUpdateItemL(void)
+	?DoDeleteItemL@CNSmlContactsDataStore@@MAEXHAAVTRequestStatus@@@Z @ 69 NONAME ; void CNSmlContactsDataStore::DoDeleteItemL(int, class TRequestStatus &)
+	?CreateDataStoreLC@CNSmlContactsDataProvider@@MBEPAVCNSmlContactsDataStore@@XZ @ 70 NONAME ; class CNSmlContactsDataStore * CNSmlContactsDataProvider::CreateDataStoreLC(void) const
+	?DoHasSyncHistory@CNSmlContactsDataStore@@MBEHXZ @ 71 NONAME ; int CNSmlContactsDataStore::DoHasSyncHistory(void) const
+	?DoCommitBatchL@CNSmlContactsDataStore@@MAEXAAV?$RArray@H@@AAVTRequestStatus@@@Z @ 72 NONAME ; void CNSmlContactsDataStore::DoCommitBatchL(class RArray<int> &, class TRequestStatus &)
+	?DoMaxObjectSize@CNSmlContactsDataStore@@MBEHXZ @ 73 NONAME ; int CNSmlContactsDataStore::DoMaxObjectSize(void) const
+	?DoReplaceItemL@CNSmlContactsDataStore@@MAEXHHHHAAVTRequestStatus@@@Z @ 74 NONAME ; void CNSmlContactsDataStore::DoReplaceItemL(int, int, int, int, class TRequestStatus &)
+	?DoCloseItem@CNSmlContactsDataStore@@MAEXXZ @ 75 NONAME ; void CNSmlContactsDataStore::DoCloseItem(void)
+	?ContactViewUnavailable@CNSmlContactsDataStore@@MAEXAAVMVPbkContactViewBase@@@Z @ 76 NONAME ; void CNSmlContactsDataStore::ContactViewUnavailable(class MVPbkContactViewBase &)
+	?DoCommitTransactionL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 77 NONAME ; void CNSmlContactsDataStore::DoCommitTransactionL(class TRequestStatus &)
+	?DoStoreFormatL@CNSmlContactsDataProvider@@MAEABVCSmlDataStoreFormat@@XZ @ 78 NONAME ; class CSmlDataStoreFormat const & CNSmlContactsDataProvider::DoStoreFormatL(void)
+	?DoCancelBatch@CNSmlContactsDataStore@@MAEXXZ @ 79 NONAME ; void CNSmlContactsDataStore::DoCancelBatch(void)
+	?CreateModsFetcherL@CNSmlContactsDataStore@@MAEPAVMContactsModsFetcher@@XZ @ 80 NONAME ; class MContactsModsFetcher * CNSmlContactsDataStore::CreateModsFetcherL(void)
+	?NewLC@CNSmlContactsDataProvider@@KAPAV1@XZ @ 81 NONAME ; class CNSmlContactsDataProvider * CNSmlContactsDataProvider::NewLC(void)
+	?StoreUnavailable@CNSmlContactsDataStore@@MAEXAAVMVPbkContactStore@@H@Z @ 82 NONAME ; void CNSmlContactsDataStore::StoreUnavailable(class MVPbkContactStore &, int)
+	?LdoFetchItemL@CNSmlContactsDataStore@@MAEXAAHAAVCBufBase@@@Z @ 83 NONAME ; void CNSmlContactsDataStore::LdoFetchItemL(int &, class CBufBase &)
+	?DoCheckServerFiltersL@CNSmlContactsDataProvider@@MAEXAAV?$RPointerArray@VCSyncMLFilter@@@@AAW4TSyncMLFilterChangeInfo@@@Z @ 84 NONAME ; void CNSmlContactsDataProvider::DoCheckServerFiltersL(class RPointerArray<class CSyncMLFilter> &, enum TSyncMLFilterChangeInfo &)
+	?DoCancelRequest@CNSmlContactsDataStore@@MAEXXZ @ 85 NONAME ; void CNSmlContactsDataStore::DoCancelRequest(void)
+	?DoOpenItemL@CNSmlContactsDataStore@@MAEXHAAH00AAVTDes8@@1AAVTRequestStatus@@@Z @ 86 NONAME ; void CNSmlContactsDataStore::DoOpenItemL(int, int &, int &, int &, class TDes8 &, class TDes8 &, class TRequestStatus &)
+	?DoBeginTransactionL@CNSmlContactsDataStore@@MAEXXZ @ 87 NONAME ; void CNSmlContactsDataStore::DoBeginTransactionL(void)
+	?OperationCompleteL@CNSmlContactsDataStore@@IAEXXZ @ 88 NONAME ; void CNSmlContactsDataStore::OperationCompleteL(void)
+	?StepComplete@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@H@Z @ 89 NONAME ; void CNSmlContactsDataStore::StepComplete(class MVPbkContactOperationBase &, int)
+	?DoAddedItems@CNSmlContactsDataStore@@MBEABVMSmlDataItemUidSet@@XZ @ 90 NONAME ; class MSmlDataItemUidSet const & CNSmlContactsDataStore::DoAddedItems(void) const
+	?DoSetRemoteMaxObjectSize@CNSmlContactsDataStore@@MAEXH@Z @ 91 NONAME ; void CNSmlContactsDataStore::DoSetRemoteMaxObjectSize(int)
+	?StripPropertyL@CNSmlContactsDataStore@@IBEXAAPAVHBufC8@@ABVTDesC8@@@Z @ 92 NONAME ; void CNSmlContactsDataStore::StripPropertyL(class HBufC8 * &, class TDesC8 const &) const
+	?DoOpenL@CNSmlContactsDataStore@@MAEXABVTDesC16@@AAVMSmlSyncRelationship@@AAVTRequestStatus@@@Z @ 93 NONAME ; void CNSmlContactsDataStore::DoOpenL(class TDesC16 const &, class MSmlSyncRelationship &, class TRequestStatus &)
+	?VPbkSingleContactOperationFailed@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@H@Z @ 94 NONAME ; void CNSmlContactsDataStore::VPbkSingleContactOperationFailed(class MVPbkContactOperationBase &, int)
+	?ContactsSavingFailed@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@H@Z @ 95 NONAME ; void CNSmlContactsDataStore::ContactsSavingFailed(class MVPbkContactOperationBase &, int)
+	?DoMovedItems@CNSmlContactsDataStore@@MBEABVMSmlDataItemUidSet@@XZ @ 96 NONAME ; class MSmlDataItemUidSet const & CNSmlContactsDataStore::DoMovedItems(void) const
+	?DoNewStoreInstanceLC@CNSmlContactsDataProvider@@MAEPAVCSmlDataStore@@XZ @ 97 NONAME ; class CSmlDataStore * CNSmlContactsDataProvider::DoNewStoreInstanceLC(void)
 
--- a/omads/omadsextensions/adapters/contacts/bld/def/eabicontactsdataprovideru.def	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/contacts/bld/def/eabicontactsdataprovideru.def	Wed Sep 01 12:30:02 2010 +0100
@@ -1,91 +1,142 @@
 EXPORTS
 	_Z24ImplementationGroupProxyRi @ 1 NONAME
-	_ZN22CNSmlContactsDataStore10ConstructLERK7TDesC16 @ 2 NONAME
-	_ZN22CNSmlContactsDataStore10ConstructLEv @ 3 NONAME
-	_ZN22CNSmlContactsDataStore10GetDataModEv @ 4 NONAME
-	_ZN22CNSmlContactsDataStore10LdoMergeLCERiRK6TDesC8 @ 5 NONAME
-	_ZN22CNSmlContactsDataStore11DoCloseItemEv @ 6 NONAME
-	_ZN22CNSmlContactsDataStore11DoMoveItemLEiiR14TRequestStatus @ 7 NONAME
-	_ZN22CNSmlContactsDataStore11DoOpenItemLEiRiS0_S0_R5TDes8S2_R14TRequestStatus @ 8 NONAME
-	_ZN22CNSmlContactsDataStore11DoReadItemLER5TDes8 @ 9 NONAME
-	_ZN22CNSmlContactsDataStore11LdoAddItemLERiRK6TDesC8iR5TTime @ 10 NONAME
-	_ZN22CNSmlContactsDataStore12DoWriteItemLERK6TDesC8 @ 11 NONAME
-	_ZN22CNSmlContactsDataStore12LdoAddItemsLER6RArrayIiERP8CBufBaseiR5TTime @ 12 NONAME
-	_ZN22CNSmlContactsDataStore13DoBeginBatchLEv @ 13 NONAME
-	_ZN22CNSmlContactsDataStore13DoCancelBatchEv @ 14 NONAME
-	_ZN22CNSmlContactsDataStore13DoCommitItemLER14TRequestStatus @ 15 NONAME
-	_ZN22CNSmlContactsDataStore13DoCreateItemLERiiiRK6TDesC8S3_R14TRequestStatus @ 16 NONAME
-	_ZN22CNSmlContactsDataStore13DoDeleteItemLEiR14TRequestStatus @ 17 NONAME
-	_ZN22CNSmlContactsDataStore13LdoFetchItemLERiR8CBufBase @ 18 NONAME
-	_ZN22CNSmlContactsDataStore14AddBufferListLERiii @ 19 NONAME
-	_ZN22CNSmlContactsDataStore14DoCommitBatchLER6RArrayIiER14TRequestStatus @ 20 NONAME
-	_ZN22CNSmlContactsDataStore14DoListStoresLCEv @ 21 NONAME
-	_ZN22CNSmlContactsDataStore14DoReplaceItemLEiiiiR14TRequestStatus @ 22 NONAME
-	_ZN22CNSmlContactsDataStore14ExecuteBufferLER6RArrayIiE @ 23 NONAME
-	_ZN22CNSmlContactsDataStore14LdoUpdateItemLEiRK6TDesC8iR5TTime @ 24 NONAME
-	_ZN22CNSmlContactsDataStore15DoCancelRequestEv @ 25 NONAME
-	_ZN22CNSmlContactsDataStore16DoExecuteBufferLER6RArrayIiE @ 26 NONAME
-	_ZN22CNSmlContactsDataStore17DoDeleteAllItemsLER14TRequestStatus @ 27 NONAME
-	_ZN22CNSmlContactsDataStore17DoSoftDeleteItemLEiR14TRequestStatus @ 28 NONAME
-	_ZN22CNSmlContactsDataStore18DoResetChangeInfoLER14TRequestStatus @ 29 NONAME
-	_ZN22CNSmlContactsDataStore18SetOwnStoreFormatLEv @ 30 NONAME
-	_ZN22CNSmlContactsDataStore19DoBeginTransactionLEv @ 31 NONAME
-	_ZN22CNSmlContactsDataStore19DoCommitChangeInfoLER14TRequestStatus @ 32 NONAME
-	_ZN22CNSmlContactsDataStore19DoCommitChangeInfoLER14TRequestStatusRK18MSmlDataItemUidSet @ 33 NONAME
-	_ZN22CNSmlContactsDataStore19DoRevertTransactionER14TRequestStatus @ 34 NONAME
-	_ZN22CNSmlContactsDataStore20DoCommitTransactionLER14TRequestStatus @ 35 NONAME
-	_ZN22CNSmlContactsDataStore23CNSmlContactsBufferItemD0Ev @ 36 NONAME
-	_ZN22CNSmlContactsDataStore23CNSmlContactsBufferItemD1Ev @ 37 NONAME
-	_ZN22CNSmlContactsDataStore23CNSmlContactsBufferItemD2Ev @ 38 NONAME
-	_ZN22CNSmlContactsDataStore23DoSetRemoteStoreFormatLERK19CSmlDataStoreFormat @ 39 NONAME
-	_ZN22CNSmlContactsDataStore24DoSetRemoteMaxObjectSizeEi @ 40 NONAME
-	_ZN22CNSmlContactsDataStore24DriveBelowCriticalLevelLEi @ 41 NONAME
-	_ZN22CNSmlContactsDataStore4NewLEv @ 42 NONAME
-	_ZN22CNSmlContactsDataStore7DoOpenLERK7TDesC16R20MSmlSyncRelationshipR14TRequestStatus @ 43 NONAME
-	_ZN22CNSmlContactsDataStoreC1Ev @ 44 NONAME
-	_ZN22CNSmlContactsDataStoreC2Ev @ 45 NONAME
-	_ZN22CNSmlContactsDataStoreD0Ev @ 46 NONAME
-	_ZN22CNSmlContactsDataStoreD1Ev @ 47 NONAME
-	_ZN22CNSmlContactsDataStoreD2Ev @ 48 NONAME
-	_ZN25CNSmlContactsDataProvider10ConstructLEv @ 49 NONAME
-	_ZN25CNSmlContactsDataProvider14DoListStoresLCEv @ 50 NONAME
-	_ZN25CNSmlContactsDataProvider14DoStoreFormatLEv @ 51 NONAME
-	_ZN25CNSmlContactsDataProvider15DoDefaultStoreLEv @ 52 NONAME
-	_ZN25CNSmlContactsDataProvider18DoOnFrameworkEventE18TSmlFrameworkEventii @ 53 NONAME
-	_ZN25CNSmlContactsDataProvider20DoNewStoreInstanceLCEv @ 54 NONAME
-	_ZN25CNSmlContactsDataProvider21DoCheckServerFiltersLER13RPointerArrayI13CSyncMLFilterER23TSyncMLFilterChangeInfo @ 55 NONAME
-	_ZN25CNSmlContactsDataProvider25DoSupportedServerFiltersLEv @ 56 NONAME
-	_ZN25CNSmlContactsDataProvider27DoGenerateFieldFilterQueryLERK13RPointerArrayI13CSyncMLFilterER6TDes16RS0_I16CSmlDataPropertyER7TDesC16 @ 57 NONAME
-	_ZN25CNSmlContactsDataProvider29DoGenerateRecordFilterQueryLCERK13RPointerArrayI13CSyncMLFilterE22TSyncMLFilterMatchTypeR6TDes16R17TSyncMLFilterTypeR7TDesC16 @ 58 NONAME
-	_ZN25CNSmlContactsDataProvider30DoCheckSupportedServerFiltersLERK19CSmlDataStoreFormatR13RPointerArrayI13CSyncMLFilterER23TSyncMLFilterChangeInfo @ 59 NONAME
-	_ZN25CNSmlContactsDataProvider4NewLEv @ 60 NONAME
-	_ZN25CNSmlContactsDataProvider5NewLCEv @ 61 NONAME
-	_ZN25CNSmlContactsDataProviderC1Ev @ 62 NONAME
-	_ZN25CNSmlContactsDataProviderC2Ev @ 63 NONAME
-	_ZN25CNSmlContactsDataProviderD0Ev @ 64 NONAME
-	_ZN25CNSmlContactsDataProviderD1Ev @ 65 NONAME
-	_ZN25CNSmlContactsDataProviderD2Ev @ 66 NONAME
-	_ZNK22CNSmlContactsDataStore11DoStoreNameEv @ 67 NONAME
-	_ZNK22CNSmlContactsDataStore12DoAddedItemsEv @ 68 NONAME
-	_ZNK22CNSmlContactsDataStore12DoMovedItemsEv @ 69 NONAME
-	_ZNK22CNSmlContactsDataStore14DoDeletedItemsEv @ 70 NONAME
-	_ZNK22CNSmlContactsDataStore14StripPropertyLERP6HBufC8RK6TDesC8 @ 71 NONAME
-	_ZNK22CNSmlContactsDataStore14StripPropertyLERP8CBufBaseRK6TDesC8 @ 72 NONAME
-	_ZNK22CNSmlContactsDataStore15DoMaxObjectSizeEv @ 73 NONAME
-	_ZNK22CNSmlContactsDataStore15DoModifiedItemsEv @ 74 NONAME
-	_ZNK22CNSmlContactsDataStore16DoHasSyncHistoryEv @ 75 NONAME
-	_ZNK22CNSmlContactsDataStore17DefaultStoreNameLEv @ 76 NONAME
-	_ZNK22CNSmlContactsDataStore18DoSoftDeletedItemsEv @ 77 NONAME
-	_ZNK22CNSmlContactsDataStore27GetStoreFormatResourceFileLEv @ 78 NONAME
-	_ZNK25CNSmlContactsDataProvider17CreateDataStoreLCEv @ 79 NONAME
-	_ZNK25CNSmlContactsDataProvider19DoSupportsOperationE4TUid @ 80 NONAME
-	_ZNK25CNSmlContactsDataProvider27GetStoreFormatResourceFileLEv @ 81 NONAME
-	_ZTI22CNSmlContactsDataStore @ 82 NONAME
-	_ZTI25CNSmlContactsDataProvider @ 83 NONAME
-	_ZTIN22CNSmlContactsDataStore23CNSmlContactsBufferItemE @ 84 NONAME
-	_ZTV22CNSmlContactsDataStore @ 85 NONAME
-	_ZTV25CNSmlContactsDataProvider @ 86 NONAME
-	_ZTVN22CNSmlContactsDataStore23CNSmlContactsBufferItemE @ 87 NONAME
-	_ZN22CNSmlContactsDataStore15ExportContactsLERK4TUidR8CBufBase @ 88 NONAME
-	_ZN22CNSmlContactsDataStore15ImportContactsLERK6TDesC8 @ 89 NONAME
+	_ZTI22CNSmlContactsDataStore @ 2 NONAME ; #<TI>#
+	_ZTI24CNSmlContactsModsFetcher @ 3 NONAME ; #<TI>#
+	_ZTI25CNSmlContactsDataProvider @ 4 NONAME ; #<TI>#
+	_ZTIN22CNSmlContactsDataStore23CNSmlContactsBufferItemE @ 5 NONAME ; #<TI>#
+	_ZTV22CNSmlContactsDataStore @ 6 NONAME ; #<VT>#
+	_ZTV24CNSmlContactsModsFetcher @ 7 NONAME ; #<VT>#
+	_ZTV25CNSmlContactsDataProvider @ 8 NONAME ; #<VT>#
+	_ZTVN22CNSmlContactsDataStore23CNSmlContactsBufferItemE @ 9 NONAME ; #<VT>#
+	_ZN22CNSmlContactsDataStore10ConstructLERK7TDesC16S2_ @ 10 NONAME
+	_ZN22CNSmlContactsDataStore10ConstructLEv @ 11 NONAME
+	_ZN22CNSmlContactsDataStore10GetDataModEv @ 12 NONAME
+	_ZN22CNSmlContactsDataStore10StepFailedER25MVPbkContactOperationBaseii @ 13 NONAME
+	_ZN22CNSmlContactsDataStore10StoreReadyER17MVPbkContactStore @ 14 NONAME
+	_ZN22CNSmlContactsDataStore11CreateViewLEv @ 15 NONAME
+	_ZN22CNSmlContactsDataStore11DoCloseItemEv @ 16 NONAME
+	_ZN22CNSmlContactsDataStore11DoMoveItemLEiiR14TRequestStatus @ 17 NONAME
+	_ZN22CNSmlContactsDataStore11DoOpenItemLEiRiS0_S0_R5TDes8S2_R14TRequestStatus @ 18 NONAME
+	_ZN22CNSmlContactsDataStore11DoReadItemLER5TDes8 @ 19 NONAME
+	_ZN22CNSmlContactsDataStore11ExecuteAddLEv @ 20 NONAME
+	_ZN22CNSmlContactsDataStore11LdoAddItemLERK6TDesC8i @ 21 NONAME
+	_ZN22CNSmlContactsDataStore11ResetBufferEv @ 22 NONAME
+	_ZN22CNSmlContactsDataStore12DoWriteItemLERK6TDesC8 @ 23 NONAME
+	_ZN22CNSmlContactsDataStore12ExecuteMoveLEv @ 24 NONAME
+	_ZN22CNSmlContactsDataStore12LdoAddItemsLERP8CBufBasei @ 25 NONAME
+	_ZN22CNSmlContactsDataStore12StepCompleteER25MVPbkContactOperationBasei @ 26 NONAME
+	_ZN22CNSmlContactsDataStore13ContactsSavedER25MVPbkContactOperationBaseP21MVPbkContactLinkArray @ 27 NONAME
+	_ZN22CNSmlContactsDataStore13DoBeginBatchLEv @ 28 NONAME
+	_ZN22CNSmlContactsDataStore13DoCancelBatchEv @ 29 NONAME
+	_ZN22CNSmlContactsDataStore13DoCommitItemLER14TRequestStatus @ 30 NONAME
+	_ZN22CNSmlContactsDataStore13DoCreateItemLERiiiRK6TDesC8S3_R14TRequestStatus @ 31 NONAME
+	_ZN22CNSmlContactsDataStore13DoDeleteItemLEiR14TRequestStatus @ 32 NONAME
+	_ZN22CNSmlContactsDataStore13LdoFetchItemLERiR8CBufBase @ 33 NONAME
+	_ZN22CNSmlContactsDataStore14AddBufferListLERiii @ 34 NONAME
+	_ZN22CNSmlContactsDataStore14DoCommitBatchLER6RArrayIiER14TRequestStatus @ 35 NONAME
+	_ZN22CNSmlContactsDataStore14DoListStoresLCEv @ 36 NONAME
+	_ZN22CNSmlContactsDataStore14DoReplaceItemLEiiiiR14TRequestStatus @ 37 NONAME
+	_ZN22CNSmlContactsDataStore14ExecuteBufferLEv @ 38 NONAME
+	_ZN22CNSmlContactsDataStore14ExecuteDeleteLEv @ 39 NONAME
+	_ZN22CNSmlContactsDataStore14ExecuteUpdateLEv @ 40 NONAME
+	_ZN22CNSmlContactsDataStore14LdoUpdateItemLEv @ 41 NONAME
+	_ZN22CNSmlContactsDataStore15DoCancelRequestEv @ 42 NONAME
+	_ZN22CNSmlContactsDataStore15IsConfidentialLER17MVPbkStoreContact @ 43 NONAME
+	_ZN22CNSmlContactsDataStore16ContactViewErrorER20MVPbkContactViewBaseii @ 44 NONAME
+	_ZN22CNSmlContactsDataStore16ContactViewReadyER20MVPbkContactViewBase @ 45 NONAME
+	_ZN22CNSmlContactsDataStore16StoreUnavailableER17MVPbkContactStorei @ 46 NONAME
+	_ZN22CNSmlContactsDataStore17DoDeleteAllItemsLER14TRequestStatus @ 47 NONAME
+	_ZN22CNSmlContactsDataStore17DoSoftDeleteItemLEiR14TRequestStatus @ 48 NONAME
+	_ZN22CNSmlContactsDataStore17HandleStoreEventLER17MVPbkContactStore22TVPbkContactStoreEvent @ 49 NONAME
+	_ZN22CNSmlContactsDataStore17OperationCompleteER25MVPbkContactOperationBase @ 50 NONAME
+	_ZN22CNSmlContactsDataStore18ContactAddedToViewER20MVPbkContactViewBaseiRK16MVPbkContactLink @ 51 NONAME
+	_ZN22CNSmlContactsDataStore18CreateModsFetcherLEv @ 52 NONAME
+	_ZN22CNSmlContactsDataStore18DoResetChangeInfoLER14TRequestStatus @ 53 NONAME
+	_ZN22CNSmlContactsDataStore18OperationCompleteLEv @ 54 NONAME
+	_ZN22CNSmlContactsDataStore18SetOwnStoreFormatLEv @ 55 NONAME
+	_ZN22CNSmlContactsDataStore19DoBeginTransactionLEv @ 56 NONAME
+	_ZN22CNSmlContactsDataStore19DoCommitChangeInfoLER14TRequestStatus @ 57 NONAME
+	_ZN22CNSmlContactsDataStore19DoCommitChangeInfoLER14TRequestStatusRK18MSmlDataItemUidSet @ 58 NONAME
+	_ZN22CNSmlContactsDataStore19DoRevertTransactionER14TRequestStatus @ 59 NONAME
+	_ZN22CNSmlContactsDataStore20ContactsSavingFailedER25MVPbkContactOperationBasei @ 60 NONAME
+	_ZN22CNSmlContactsDataStore20DoCommitTransactionLER14TRequestStatus @ 61 NONAME
+	_ZN22CNSmlContactsDataStore20DoDeleteAllContactsLEv @ 62 NONAME
+	_ZN22CNSmlContactsDataStore22ContactRemovedFromViewER20MVPbkContactViewBaseiRK16MVPbkContactLink @ 63 NONAME
+	_ZN22CNSmlContactsDataStore22ContactViewUnavailableER20MVPbkContactViewBase @ 64 NONAME
+	_ZN22CNSmlContactsDataStore23CNSmlContactsBufferItemD0Ev @ 65 NONAME
+	_ZN22CNSmlContactsDataStore23CNSmlContactsBufferItemD1Ev @ 66 NONAME
+	_ZN22CNSmlContactsDataStore23CNSmlContactsBufferItemD2Ev @ 67 NONAME
+	_ZN22CNSmlContactsDataStore23DoSetRemoteStoreFormatLERK19CSmlDataStoreFormat @ 68 NONAME
+	_ZN22CNSmlContactsDataStore24DoSetRemoteMaxObjectSizeEi @ 69 NONAME
+	_ZN22CNSmlContactsDataStore24DriveBelowCriticalLevelLEi @ 70 NONAME
+	_ZN22CNSmlContactsDataStore27GetStoreFormatResourceFileLEv @ 71 NONAME
+	_ZN22CNSmlContactsDataStore31SingleContactOperationCompleteLEP17MVPbkStoreContact @ 72 NONAME
+	_ZN22CNSmlContactsDataStore32VPbkSingleContactOperationFailedER25MVPbkContactOperationBasei @ 73 NONAME
+	_ZN22CNSmlContactsDataStore34VPbkSingleContactOperationCompleteER25MVPbkContactOperationBaseP17MVPbkStoreContact @ 74 NONAME
+	_ZN22CNSmlContactsDataStore4NewLEv @ 75 NONAME
+	_ZN22CNSmlContactsDataStore7DoOpenLERK7TDesC16R20MSmlSyncRelationshipR14TRequestStatus @ 76 NONAME
+	_ZN22CNSmlContactsDataStoreC1Ev @ 77 NONAME
+	_ZN22CNSmlContactsDataStoreC2Ev @ 78 NONAME
+	_ZN22CNSmlContactsDataStoreD0Ev @ 79 NONAME
+	_ZN22CNSmlContactsDataStoreD1Ev @ 80 NONAME
+	_ZN22CNSmlContactsDataStoreD2Ev @ 81 NONAME
+	_ZN25CNSmlContactsDataProvider10ConstructLEv @ 82 NONAME
+	_ZN25CNSmlContactsDataProvider14DoListStoresLCEv @ 83 NONAME
+	_ZN25CNSmlContactsDataProvider14DoStoreFormatLEv @ 84 NONAME
+	_ZN25CNSmlContactsDataProvider15DoDefaultStoreLEv @ 85 NONAME
+	_ZN25CNSmlContactsDataProvider18DoOnFrameworkEventE18TSmlFrameworkEventii @ 86 NONAME
+	_ZN25CNSmlContactsDataProvider20DoNewStoreInstanceLCEv @ 87 NONAME
+	_ZN25CNSmlContactsDataProvider21DoCheckServerFiltersLER13RPointerArrayI13CSyncMLFilterER23TSyncMLFilterChangeInfo @ 88 NONAME
+	_ZN25CNSmlContactsDataProvider25DoSupportedServerFiltersLEv @ 89 NONAME
+	_ZN25CNSmlContactsDataProvider27DoGenerateFieldFilterQueryLERK13RPointerArrayI13CSyncMLFilterER6TDes16RS0_I16CSmlDataPropertyER7TDesC16 @ 90 NONAME
+	_ZN25CNSmlContactsDataProvider29DoGenerateRecordFilterQueryLCERK13RPointerArrayI13CSyncMLFilterE22TSyncMLFilterMatchTypeR6TDes16R17TSyncMLFilterTypeR7TDesC16 @ 91 NONAME
+	_ZN25CNSmlContactsDataProvider30DoCheckSupportedServerFiltersLERK19CSmlDataStoreFormatR13RPointerArrayI13CSyncMLFilterER23TSyncMLFilterChangeInfo @ 92 NONAME
+	_ZN25CNSmlContactsDataProvider4NewLEv @ 93 NONAME
+	_ZN25CNSmlContactsDataProvider5NewLCEv @ 94 NONAME
+	_ZN25CNSmlContactsDataProviderC1Ev @ 95 NONAME
+	_ZN25CNSmlContactsDataProviderC2Ev @ 96 NONAME
+	_ZN25CNSmlContactsDataProviderD0Ev @ 97 NONAME
+	_ZN25CNSmlContactsDataProviderD1Ev @ 98 NONAME
+	_ZN25CNSmlContactsDataProviderD2Ev @ 99 NONAME
+	_ZNK22CNSmlContactsDataStore11DoStoreNameEv @ 100 NONAME
+	_ZNK22CNSmlContactsDataStore12DoAddedItemsEv @ 101 NONAME
+	_ZNK22CNSmlContactsDataStore12DoMovedItemsEv @ 102 NONAME
+	_ZNK22CNSmlContactsDataStore14DoDeletedItemsEv @ 103 NONAME
+	_ZNK22CNSmlContactsDataStore14StripPropertyLERP6HBufC8RK6TDesC8 @ 104 NONAME
+	_ZNK22CNSmlContactsDataStore14StripPropertyLERP8CBufBaseRK6TDesC8 @ 105 NONAME
+	_ZNK22CNSmlContactsDataStore15DoMaxObjectSizeEv @ 106 NONAME
+	_ZNK22CNSmlContactsDataStore15DoModifiedItemsEv @ 107 NONAME
+	_ZNK22CNSmlContactsDataStore16DoHasSyncHistoryEv @ 108 NONAME
+	_ZNK22CNSmlContactsDataStore17DefaultStoreNameLEv @ 109 NONAME
+	_ZNK22CNSmlContactsDataStore18DoSoftDeletedItemsEv @ 110 NONAME
+	_ZNK25CNSmlContactsDataProvider17CreateDataStoreLCEv @ 111 NONAME
+	_ZNK25CNSmlContactsDataProvider19DoSupportsOperationE4TUid @ 112 NONAME
+	_ZNK25CNSmlContactsDataProvider27GetStoreFormatResourceFileLEv @ 113 NONAME
+	_ZThn12_N22CNSmlContactsDataStore13ContactsSavedER25MVPbkContactOperationBaseP21MVPbkContactLinkArray @ 114 NONAME
+	_ZThn12_N22CNSmlContactsDataStore20ContactsSavingFailedER25MVPbkContactOperationBasei @ 115 NONAME
+	_ZThn12_N22CNSmlContactsDataStoreD0Ev @ 116 NONAME
+	_ZThn12_N22CNSmlContactsDataStoreD1Ev @ 117 NONAME
+	_ZThn16_N22CNSmlContactsDataStore10StepFailedER25MVPbkContactOperationBaseii @ 118 NONAME
+	_ZThn16_N22CNSmlContactsDataStore12StepCompleteER25MVPbkContactOperationBasei @ 119 NONAME
+	_ZThn16_N22CNSmlContactsDataStore17OperationCompleteER25MVPbkContactOperationBase @ 120 NONAME
+	_ZThn16_N22CNSmlContactsDataStoreD0Ev @ 121 NONAME
+	_ZThn16_N22CNSmlContactsDataStoreD1Ev @ 122 NONAME
+	_ZThn20_N22CNSmlContactsDataStore16ContactViewErrorER20MVPbkContactViewBaseii @ 123 NONAME
+	_ZThn20_N22CNSmlContactsDataStore16ContactViewReadyER20MVPbkContactViewBase @ 124 NONAME
+	_ZThn20_N22CNSmlContactsDataStore18ContactAddedToViewER20MVPbkContactViewBaseiRK16MVPbkContactLink @ 125 NONAME
+	_ZThn20_N22CNSmlContactsDataStore22ContactRemovedFromViewER20MVPbkContactViewBaseiRK16MVPbkContactLink @ 126 NONAME
+	_ZThn20_N22CNSmlContactsDataStore22ContactViewUnavailableER20MVPbkContactViewBase @ 127 NONAME
+	_ZThn20_N22CNSmlContactsDataStoreD0Ev @ 128 NONAME
+	_ZThn20_N22CNSmlContactsDataStoreD1Ev @ 129 NONAME
+	_ZThn24_N22CNSmlContactsDataStoreD0Ev @ 130 NONAME
+	_ZThn24_N22CNSmlContactsDataStoreD1Ev @ 131 NONAME
+	_ZThn4_N22CNSmlContactsDataStore10StoreReadyER17MVPbkContactStore @ 132 NONAME
+	_ZThn4_N22CNSmlContactsDataStore16StoreUnavailableER17MVPbkContactStorei @ 133 NONAME
+	_ZThn4_N22CNSmlContactsDataStore17HandleStoreEventLER17MVPbkContactStore22TVPbkContactStoreEvent @ 134 NONAME
+	_ZThn4_N22CNSmlContactsDataStoreD0Ev @ 135 NONAME
+	_ZThn4_N22CNSmlContactsDataStoreD1Ev @ 136 NONAME
+	_ZThn8_N22CNSmlContactsDataStore32VPbkSingleContactOperationFailedER25MVPbkContactOperationBasei @ 137 NONAME
+	_ZThn8_N22CNSmlContactsDataStore34VPbkSingleContactOperationCompleteER25MVPbkContactOperationBaseP17MVPbkStoreContact @ 138 NONAME
+	_ZThn8_N22CNSmlContactsDataStoreD0Ev @ 139 NONAME
+	_ZThn8_N22CNSmlContactsDataStoreD1Ev @ 140 NONAME
 
--- a/omads/omadsextensions/adapters/contacts/bld/nsmldscontactsdataprovider.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/contacts/bld/nsmldscontactsdataprovider.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -15,6 +15,7 @@
 *
 */
 
+
 #include <platform_paths.hrh>
 #include <defaultcaps.hrh>
 #include <data_caging_paths.hrh>
@@ -27,7 +28,7 @@
 UID             0x10009D8D 0x101F6DDD
 VENDORID		VID_DEFAULT
 
-#if defined(EABI)
+#if defined(ARMCC)
 DEFFILE		./def/eabicontactsdataprovider
 #elif defined(WINSCW)
 DEFFILE		./def/bwinscwcontactsdataprovider
@@ -36,13 +37,14 @@
 SOURCEPATH      ../src
 SOURCE          NSmlContactsDataProvider.cpp
 SOURCE          NSmlContactsDataStore.cpp
+SOURCE          NSmlContactsModsFetcher.cpp
 
 APP_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE 	/epoc32/include/ecom
 SYSTEMINCLUDE 	/epoc32/include/syncml
 
 USERINCLUDE     ../inc ../../inc
-
+USERINCLUDE     ../../../datamod/inc
 
 START RESOURCE 101F6DD6.rss
 HEADER
@@ -68,5 +70,6 @@
 LIBRARY		nsmlchangefinder.lib cntmodel.lib wbxmllib.lib
 LIBRARY		nsmldatamod.lib smlstoreformat.lib smldataprovider.lib
 LIBRARY		nsmldshostclient.lib
-LIBRARY		nsmlcontactsdatastoreextension.lib
+LIBRARY		VPbkEng.lib
+LIBRARY     vpbkvcardEng.lib
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/inc/NSmlContactsModsFetcher.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 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:  DS contacts datastore.
+*
+*/
+
+
+#ifndef __NSMLCONTACTSMODSFETCHER_H__
+#define __NSMLCONTACTSMODSFETCHER_H__
+
+// INCLUDES
+#include <SmlDataProvider.h>
+#include <SmlDataFormat.h>
+#include <f32file.h>
+#include <cntdb.h>
+#include <cntitem.h>
+#include <MContactsModsFetcher.h>
+
+#include <CVPbkContactManager.h>
+#include <MVPbkContactStore.h>
+#include <MVPbkContactViewObserver.h>
+#include <CVPbkSortOrder.h>
+#include <MVPbkContactViewBase.h>
+#include <MVPbkSingleContactOperationObserver.h>
+#include <MVPbkContactOperationBase.h>
+
+// CONSTANTS
+const TInt KNSmlSnapshotSize = 56;
+const TInt KNSmlSnapshotSmallSize = 8;
+_LIT( KNSmlContactSyncNoSync, "none" ); // Taken from phonebook
+
+// CLASS DECLARATION
+class CNSmlChangeFinder;
+class TNSmlSnapshotItem;
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsModsFetcher
+//
+// @lib nsmlcontactsdataprovider.lib
+// ------------------------------------------------------------------------------------------------
+class CNSmlContactsModsFetcher : public CActive, public MContactsModsFetcher,
+								MVPbkContactViewObserver,
+								MVPbkSingleContactOperationObserver,
+								MVPbkContactOperationBase
+								
+	{
+	public:
+		/**
+		* C++ constructor.
+		* @param		aSnapshotRegistered	Is snapshot registered.
+		* @param		aCntDb				Pointer to opened database.
+		* @param		aKey				Key array.
+		* @param		aChangeFinder		Pointer to Changefinder.
+		*/
+		CNSmlContactsModsFetcher( TBool& aSnapshotRegistered,CVPbkContactManager& aContactManager,MVPbkContactStore& aStore,TKeyArrayFix& aKey, CNSmlChangeFinder& aChangeFinder );
+		/**
+		* Second phase constructor.
+		*/
+		void ConstructL();
+
+		/**
+		* ~CNSmlContactsModsFetcher() desctructor.
+		*/
+		virtual ~CNSmlContactsModsFetcher();
+		
+	private:
+	
+		/**
+		* From MVPbkContactViewObserver  
+		* Called when a view is ready for use. 
+		*/
+
+		void ContactViewReady(
+		            MVPbkContactViewBase& aView ) ;
+		/**
+		* From MVPbkContactViewObserver  
+		* Called when a view is unavailable for a while. 
+		*/            
+		void ContactViewUnavailable(
+		            MVPbkContactViewBase& aView ) ;
+		/**
+		* From MVPbkContactViewObserver  
+		* Called when a contact has been added to the view.
+		*/            
+		void ContactAddedToView(
+		            MVPbkContactViewBase& aView, 
+		            TInt aIndex, 
+		            const MVPbkContactLink& aContactLink );
+		/**
+		* From MVPbkContactViewObserver  
+		* Called when a contact has been removed from a view.
+		*/            
+		void ContactRemovedFromView(
+		            MVPbkContactViewBase& aView, 
+		            TInt aIndex, 
+		            const MVPbkContactLink& aContactLink ) ;
+		/**
+		* From MVPbkContactViewObserver  
+		* Called when an error occurs in the view.
+		*/            
+		void ContactViewError(
+		            MVPbkContactViewBase& aView, 
+		            TInt aError, 
+		            TBool aErrorNotified ) ;
+		            /**
+		* From MVPbkSingleContactOperationObserver  
+		* Called when the operation is completed.
+		*/
+         void VPbkSingleContactOperationComplete(MVPbkContactOperationBase& aOperation,MVPbkStoreContact* aContact ); 
+         
+		/**
+		* From MVPbkSingleContactOperationObserver  
+		*  Called if the operation fails.
+		*/
+ 		void VPbkSingleContactOperationFailed(
+ 					MVPbkContactOperationBase& aOperation, 
+ 					TInt aError );
+
+	private:
+		/**
+		* Fetches next chunk of data (client contacts data changes).
+		*/
+		void FetchNextContactL();
+
+		/**
+		* From CActive. Called when asynchronous operation completes.
+		*/
+		void RunL();
+		
+		/**
+		* From CActive. Called when RunL leaves.
+		*/    
+		TInt RunError( TInt aError );
+
+		/**
+		* From CActive. Cancels operation.
+		*/
+		void DoCancel();
+		
+		/**
+		* Checks if aItem is confidential or not.
+		* @param    aItem   Item that is checked.
+		* @return   TBool   ETrue if item is confidential.
+		*                   Otherwise EFalse is returned.
+		*/
+        TBool IsConfidentialL( MVPbkStoreContact& aItem );
+        /**
+		* Create a contact view of the store which is opened
+		*/
+        void CreateViewL();
+        /**
+		* Add the fetched contacts id and timestamp 
+		* to the snapshot.
+		* @param    aContact   Fetched contact to be 
+		*						added to snapshot
+		*/
+        void UpdateSnapshotL( MVPbkStoreContact* aContact );
+
+    private: // from MContactsModsFetcher
+
+        /**
+        * Cancels the current asynchronous request
+        */
+        void CancelRequest( );
+
+        /**
+        * Reads all modifications from clients contacts databse.
+        * @param    aStatus   On completion of the operation, contains the result code.
+        */    
+        void FetchModificationsL( TRequestStatus& aStatus );
+
+	private: // data
+		TRequestStatus* iCallerStatus;
+		TTime iFromTime;
+		
+		
+		CArrayFixSeg<TNSmlSnapshotItem>* iSnapshot;
+		
+		TBool& iSnapshotRegistered;
+
+
+		TKeyArrayFix& iKey;
+
+		CNSmlChangeFinder& iChangeFinder;
+		TInt iCurrentSnapshotCounter;
+
+		CVPbkContactManager& iContactManager;
+        MVPbkContactStore& iStore;
+        MVPbkContactViewBase* iContactViewBase;
+        TInt iContactCount;
+
+	};
+
+#endif // __NSMLCONTACTSMODSFETCHER_H__
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/inc/nsmlcontactsdefs.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* 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:  DS Contacts adapter definition file.
+*
+*/
+
+
+#ifndef __NSMLCONTACTSDEFS_H__ 
+#define __NSMLCONTACTSDEFS_H__ 
+
+// DEFINES
+//#define __NSML_MODULETEST__		// Comment/uncomment to activate/deactivate moduletest
+
+// INCLUDES
+#include <e32std.h>
+
+// CONSTANTS
+_LIT( KNSmlDefaultLocalDbName, "C:\\System\\Data\\Contacts.cdb" );
+_LIT( KNSmlDefaultRemoteDbName, "" );
+
+#endif // __NSMLCONTACTSDEFS_H__ 
+
+// End of File
--- a/omads/omadsextensions/adapters/contacts/sis/cnt_adapter.pkg	Tue Aug 31 15:05:37 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: 
-;
-; Languages
-&EN
-
-; Package header
-#{"DataSync Contact Adapter"}, (0x2002E6D9), 1, 2, 0, TYPE=SP
-
-; Vendor names
-%{"Nokia"}
-:"Nokia"
-
-"\epoc32\release\armv5\urel\nsmlcontactsdataprovider.dll"-"c:\sys\bin\nsmlcontactsdataprovider.dll"
-"\epoc32\data\z\resource\plugins\nsmlcontactsdataprovider.rsc"-"c:\resource\plugins\nsmlcontactsdataprovider.rsc"
-"\epoc32\data\z\resource\NSmlContactsDataStoreFormat_1_1_2.rsc"-"c:\resource\NSmlContactsDataStoreFormat_1_1_2.rsc"
-"\epoc32\data\z\resource\NSmlContactsDataStoreFormat_1_2.rsc"-"c:\resource\NSmlContactsDataStoreFormat_1_2.rsc"
-
-
-
--- a/omads/omadsextensions/adapters/contacts/src/101F6DD6.rss	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/contacts/src/101F6DD6.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -16,7 +16,7 @@
 */
 
 
-#include <101F6DD6.loc>
+#include<101f6dd6.loc>
 
 #include <registryinfo.rh>
 #include <nsmldsconstants.h>
--- a/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataProvider.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataProvider.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -15,36 +15,32 @@
 *
 */
 
+
 // INCLUDE FILES
 #include <utf.h>
 #include <e32base.h>
 #include <s32strm.h>
+#include <cntdb.h>
 #include <e32cmn.h>
+#include <cntitem.h>
 #include <sysutil.h>
 #include <barsc.h>
 #include <bautils.h>
 #include <SmlDataProvider.h>
+#include <implementationproxy.h>
 #include <NSmlContactsDataStoreFormat_1_1_2.rsg>
 #include <NSmlContactsDataStoreFormat_1_2.rsg>
 #include <data_caging_path_literals.hrh>
 #include <vtoken.h>
 #include <e32property.h>
 #include <DataSyncInternalPSKeys.h>
-#include <implementationproxy.h>
-#include <NSmlDataModBase.h>
-#include <nsmlcontactsdataprovider.h>
+#include <NSmlContactsDataProvider.h>
 #include "nsmldebug.h"
 #include "nsmlconstants.h"
+#include <NSmlDataModBase.h>
 #include "nsmldsimpluids.h"
 #include "nsmlchangefinder.h"
 
-#ifndef __WINS__
-// This lowers the unnecessary compiler warning (armv5) to remark.
-// "Warning:  #174-D: expression has no effect..." is caused by 
-// DBG_ARGS8 macro in no-debug builds.
-#pragma diag_remark 174
-#endif
-
 // ============================ MEMBER FUNCTIONS ===============================
 
 // -----------------------------------------------------------------------------
@@ -95,8 +91,9 @@
 	
 	User::LeaveIfError( iRfs.Connect() );
 
-	iContactsDataStore = CreateDataStoreLC(); 
+	iContactsDataStore = CreateDataStoreLC();
 	CleanupStack::Pop( iContactsDataStore );
+	
 	iStringPool.OpenL();
 	
 	_DBG_FILE("CNSmlContactsDataProvider::ConstructL(): end");
@@ -171,14 +168,10 @@
     
 	TFileName resourceFileName;
 	resourceFileName.Copy( TParsePtrC( dllFileName ).Drive() );  
-	
-	resourceFileName.Append( GetStoreFormatResourceFileL() );
 
-	parse.Set( resourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+	parse.Set( GetStoreFormatResourceFileL(), &KDC_RESOURCE_FILES_DIR, NULL );
 
 	fileName = parse.FullName();
-	
-	DBG_ARGS(_S("CNSmlContactsDataProvider::SetOwnStoreFormatL(): '%S'"), &parse.FullName());
 
 	RResourceFile resourceFile; 
 	BaflUtils::NearestLanguageFile( iRfs, fileName );
@@ -302,24 +295,24 @@
 // 
 // ------------------------------------------------------------------------------------------------
 EXPORT_C const TDesC& CNSmlContactsDataProvider::GetStoreFormatResourceFileL() const
-	{
+    {
     _DBG_FILE("CNSmlContactsDataProvider::GetStoreFormatResourceFileL(): BEGIN");
 
-	// Check correct Data Sync protocol
-	TInt value( EDataSyncNotRunning );
-	TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
-	                                 KDataSyncStatus,
-	                                 value );
-	if ( error == KErrNone && value == EDataSyncRunning )
-	    {
-        _DBG_FILE("CNSmlContactsDataProvider::GetStoreFormatResourceFileL() 1.1.2 : END");
-	    return KNSmlContactsStoreFormatRsc_1_1_2;
-	    }
-	else // error or protocol version 1.2 
-	    {
-        _DBG_FILE("CNSmlContactsDataProvider::GetStoreFormatResourceFileL() 1.2 : END");
-	    return KNSmlContactsStoreFormatRsc_1_2;
-	    }
+    // Check correct Data Sync protocol
+    TInt value( EDataSyncNotRunning );
+    TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
+                                 KDataSyncStatus,
+                                 value );
+    if ( error == KErrNone &&
+         value == EDataSyncRunning )
+        {
+        return KNSmlContactsStoreFormatRsc_1_1_2;
+        }
+    else // error or protocol version 1.2 
+        {
+        return KNSmlContactsStoreFormatRsc_1_2;
+        }
+    _DBG_FILE("CNSmlContactsDataProvider::GetStoreFormatResourceFileL(): END");
     }
 
 // ------------------------------------------------------------------------------------------------
@@ -359,4 +352,5 @@
 	_DBG_FILE("ImplementationGroupProxy() for CNSmlContactsDataProvider: end");
     return ImplementationTable;
 	}
+
 // End of File  
--- a/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStore.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStore.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -34,15 +34,35 @@
 #include <SmlDataProvider.h>
 #include <e32property.h>
 #include <DataSyncInternalPSKeys.h>
-#include <nsmlcontactsdatastoreextension.h>
-#include <NSmlDataModBase.h>
-#include <nsmlcontactsdatastore.h>
+#include <e32hashtab.h>
+
+#include <CVPbkContactStoreUriArray.h>
+#include <VPbkContactStoreUris.h>
+#include <TVPbkContactStoreUriPtr.h>
+#include <MVPbkContactStoreList.h>
+#include <MVPbkContactStoreProperties.h>
+#include <MVPbkStoreContactProperties.h>
+#include <MVPbkViewContact.h>
+#include <MVPbkStoreContact.h>
+#include <MVPbkStoreContact2.h>
+#include <MVPbkFieldType.h>
+#include <MVPbkContactFieldTextData.h>
+#include <CVPbkContactFieldIterator.h>
+#include <CVPbkContactViewDefinition.h>
+
+#include <MVPbkContactLink.h>
+#include <s32mem.h>
+
+#include <NSmlContactsDataStore.h>
+#include "NSmlContactsModsFetcher.h"
 #include "nsmldebug.h"
 #include "nsmlconstants.h"
+#include <NSmlDataModBase.h>
+#include "nsmlcontactsdefs.h"
 #include "nsmldsimpluids.h"
 #include "nsmlsnapshotitem.h"
 #include "nsmlchangefinder.h"
-
+#include <VPbkEng.rsg>
 
 #ifndef __WINS__
 // This lowers the unnecessary compiler warning (armv5) to remark.
@@ -72,7 +92,7 @@
 	CleanupStack::PushL(self);
 		
 	self->ConstructL();
-	CleanupStack::Pop(); // self
+	CleanupStack::Pop(self); // self
 		
 	_DBG_FILE("CNSmlContactsDataStore::NewL: END");
 	return self;
@@ -81,21 +101,35 @@
 // ----------------------------------------------------------------------------
 // CNSmlContactsDataStore::CNSmlContactsDataStore() 
 // ----------------------------------------------------------------------------
-EXPORT_C CNSmlContactsDataStore::CNSmlContactsDataStore() : iKey( TKeyArrayFix( _FOFF( TNSmlSnapshotItem,ItemId() ),ECmpTInt ))
+EXPORT_C CNSmlContactsDataStore::CNSmlContactsDataStore() : 
+	iKey( TKeyArrayFix( _FOFF( TNSmlSnapshotItem,ItemId() ),ECmpTInt )),
+	iContactManager(NULL),
+	iStore(NULL),
+	iIdConverter(NULL),
+	iContactViewBase(NULL),
+	iSize(NULL),	
+	iBuf(NULL),
+	iVCardEngine(NULL),
+	iContactLnks(NULL)
 	{
 	_DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): begin");
+
 	iSyncHistory = EFalse;
 	iSnapshotRegistered = EFalse;
 
-	iServerMaxObjectSize = 0; // Maximum size default value
+	iServerMaxObjectSize = 0; // Maximum size default value 
 	iItemPos = -1;
 	iModificationCount = KNSmlCompactAfterChanges;
 	
 	iState = ENSmlClosed;
 	iStoreName = NULL;
-	
-	iDrive = -1;
-	
+	iRetCommand = KErrNone;
+	iLastOperation = ENSmlNone;
+	if(iDeleteAllOperation)
+	    {
+	    delete iDeleteAllOperation;
+	    iDeleteAllOperation = NULL;
+	    }
 	_DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): end");
 	}
 	
@@ -104,22 +138,23 @@
 // ----------------------------------------------------------------------------
 EXPORT_C void CNSmlContactsDataStore::ConstructL()
 	{
-	_DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): begin");
-	ConstructL( KNSmlContactStoreNameForDefaultDB );		
+	_DBG_FILE("CNSmlContactsDataStore::ConstructL(): begin");
+	
+	ConstructL( ( VPbkContactStoreUris::DefaultCntDbUri() ), KLegacySymbianDatabase );
+		
 	_DBG_FILE("CNSmlContactsDataStore::ConstructL(): end");
 	}
 
 // ----------------------------------------------------------------------------
 // CNSmlContactsDataStore::ConstructL()
 // ----------------------------------------------------------------------------
-EXPORT_C void CNSmlContactsDataStore::ConstructL( const TDesC& aStoreName )
+EXPORT_C void CNSmlContactsDataStore::ConstructL(
+    const TDesC& aStoreName, const TDesC& aLegacyStore )
     {
-    _DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): begin");
-    
-    //TODO: NOT RESPECTING THE aStoreName VALUE FOR 10.1
+    _DBG_FILE("CNSmlContactsDataStore::ConstructL(): begin");
     
     User::LeaveIfError( iRfs.Connect() );
-    
+
     iStringPool.OpenL();
     
     // Uid Sets
@@ -132,18 +167,25 @@
     // Create iDataMod
     // This should be done after OpenL if there are more than one database
     iDataMod = new (ELeave) CNSmlVCardMod();
-    iContactsDataStoreExtension = NULL;
 
     SetOwnStoreFormatL();
+    // open  contact database
+    CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
+    uriArray->AppendL( TVPbkContactStoreUriPtr( aStoreName ));
     
-    // TODO: Determine the Default StoreName
-    iDefaultStoreName = HBufC::NewL(KNSmlDefaultStoreNameMaxSize);
-    *iDefaultStoreName = KNSmlContactStoreNameForDefaultDB;
+    iContactManager = CVPbkContactManager::NewL(*uriArray);
+    CleanupStack::PopAndDestroy(uriArray);
+    //Default store name
+    iDefaultStoreName = aStoreName.AllocL();
     
-    iSnapshot = new (ELeave) CArrayFixSeg<TNSmlSnapshotItem>(KNSmlContactsGranularity);
-    iCntUidList = new(ELeave) CArrayFixFlat<TUid>(KNSmlContactsGranularity);
+    //Fill iPacketStoreName buffer with legacy store name
+    TBuf<KOldSymbianDBLength> dataBase(aLegacyStore);
+    iPacketStoreName = HBufC::NewL(dataBase.Length());
+    TPtr pktStorePtr(iPacketStoreName->Des());
+    pktStorePtr.Copy(dataBase);
+    iDeleteAllOperation = NULL;
         
-    _DBG_FILE("CNSmlContactsDataStore::ConstructL(): end");
+    _DBG_FILE("CNSmlContactsDataStore::ConstructL(): end");    
     }
 
 // ----------------------------------------------------------------------------
@@ -157,40 +199,73 @@
 	iStringPool.Close();
 
 	iRfs.Close();
+	iWriteStream.Close();
+	iReadStream.Close();
+	delete iBuf;
+	
 	if ( iChangeFinder )
 		{
 		TRAP_IGNORE( iChangeFinder->CloseL() );
 		delete iChangeFinder;
+		iChangeFinder = NULL;
 		}
 	
-	if( iContactsDataStoreExtension )
+	if(iIdConverter)
+		{
+		delete iIdConverter;
+		iIdConverter = NULL;
+		}
+	if(iContactLnks)
+		{
+        delete iContactLnks;
+		iContactLnks = NULL;
+		}
+
+	if(iContactViewBase)
 	    {
-        delete iContactsDataStoreExtension;
-        iContactsDataStoreExtension = NULL;
+	    delete iContactViewBase;
+	    iContactViewBase = NULL;
 	    }
+	if ( iContactsModsFetcher )
+		{
+		iContactsModsFetcher->CancelRequest(); 
+		delete iContactsModsFetcher;
+		iContactsModsFetcher = NULL;
+		}
+	if ( iContactManager )
+		{
+			if(iStore)
+			{
+			iStore->Close( *this );	
+			}
+	    delete iContactManager;
+	    iContactManager = NULL;
+		}
 	
+	
+	delete iVCardEngine;
+	//  Delete UidSets		
+	//
 	delete iNewUids;
 	delete iDeletedUids;
 	delete iSoftDeletedUids;
 	delete iMovedUids;
 	delete iReplacedUids;
 	
-	delete iSnapshot;
-    delete iCntUidList;
-//
-//	Empty BufferItemList if any
-//
-  if ( iContactsBufferItemList.Count() > 0 )
-  {
-    if ( iContactsBufferItemList[iContactsBufferItemList.Count() - 1]->iItemData == iItemData )
-      {
-      iItemData = NULL;
-      }
-  }
+	//
+	//	Empty BufferItemList if any
+	//
+	if ( iContactsBufferItemList.Count() > 0 )
+		{
+		if ( iContactsBufferItemList[iContactsBufferItemList.Count() - 1]->iItemData == iItemData )
+			{
+			iItemData = NULL;
+			}
+		}
 	iContactsBufferItemList.ResetAndDestroy();
-	
 	delete iDataMod;
-	
+	delete iMergeItem;
+
 	if(iItemData)
     	{
 	    if(iItemData->Size() > 0 )
@@ -205,10 +280,18 @@
 		}
 		
 	delete iDefaultStoreName;
+	delete iPacketStoreName;
 
 	delete iStoreName;
 
 	iAddResultArray.Close();
+	
+	if(iDeleteAllOperation)
+	    {
+	    delete iDeleteAllOperation;
+	    iDeleteAllOperation = NULL;
+	    }
+	
 	}
 
 // ----------------------------------------------------------------------------
@@ -217,8 +300,8 @@
 //									    TRequestStatus& 	  aStatus)
 // ----------------------------------------------------------------------------
 EXPORT_C void CNSmlContactsDataStore::DoOpenL( const TDesC& aStoreName, 
-                                               MSmlSyncRelationship& aContext, 
-                                               TRequestStatus& aStatus )
+									MSmlSyncRelationship& aContext, 
+									TRequestStatus& aStatus )
 	{
 	DBG_ARGS(_S("CNSmlContactsDataStore::DoOpenL(): '%S' begin"), &aStoreName);
 
@@ -231,12 +314,10 @@
 		return;	
 		}
 
-	RFs::CharToDrive( KNSmlDriveC()[0], iDrive );
-
-	/*if( RFs::CharToDrive(aStoreName[0], iDrive) != KErrNone )
+	if( RFs::CharToDrive(aStoreName[0], iDrive) != KErrNone )
 		{
 		RFs::CharToDrive( KNSmlDriveC()[0], iDrive );
-		}*/
+		}
 	iOpened = EFalse;
 	
 	if( iStoreName )
@@ -245,50 +326,47 @@
 		iStoreName = NULL;
 		}
 		
-	if ( iContactsDataStoreExtension )
-		{
-		delete iContactsDataStoreExtension;
-		iContactsDataStoreExtension = NULL;
-		}
-		
-	TInt err( KErrNone );
-	
-	// TODO:Change the storename later	
-	TRAP( err, iContactsDataStoreExtension = CNsmlContactsDataStoreExtension::NewL( KNSmlContactStoreNameForDefaultDB() ) );
-	
-	if( err == KErrNone )
-		{
-		iOpened = ETrue;
-		iStoreName = aStoreName.AllocL();
-		iOpenedStoreId = iContactsDataStoreExtension->MachineIdL();
-		}
-	else
-		{
-		DBG_ARGS(_S("CNSmlContactsDataStore::DoOpenL(): result = %d"), err); // Cnt open = err
-		iOpened = EFalse;
-		delete iStoreName;
-		iStoreName = NULL;
-		iOpenedStoreId = 0;
-		User::RequestComplete( iCallerStatus, err );
-		_DBG_FILE("CNSmlContactsDataStore::DoOpenL(): CONTACTS FILE NOTFOUND end");
-		return;
-		}
-		
-	if ( iChangeFinder )
+		if ( iChangeFinder )
 		{
 		iChangeFinder->CloseL();
 		delete iChangeFinder;
 		iChangeFinder = NULL;
 		}
-	iChangeFinder = CNSmlChangeFinder::NewL( aContext, iKey, iSyncHistory, KNSmlContactsAdapterImplUid );
-
-	iState = ENSmlOpenAndWaiting;		
+	// The Change finder maintains a list of all changes to the database.
+	iChangeFinder = CNSmlChangeFinder::NewL(
+					 aContext, iKey, iSyncHistory, KNSmlContactsAdapterImplUid );
+	
+	iState = ENSmlOpenAndWaiting;			
 	
-	err = FetchModificationsL();
+	//find and open the store
+	if ( aStoreName == KNSmlContactStoreNameForDefaultDB )
+	    {
+	iStore = iContactManager->ContactStoresL().Find(
+	TVPbkContactStoreUriPtr(*iDefaultStoreName));
+	    }
+	else
+	   {
+	    iStore = iContactManager->ContactStoresL().Find(
+	TVPbkContactStoreUriPtr(aStoreName));
+	    }
+	iStore->OpenL(*this);
+
+	iStoreName = aStoreName.AllocL();
 	
-	DBG_ARGS(_S("CNSmlContactsDataStore::DoOpenL(): Error: %d"), err);
+	iVCardEngine = CVPbkVCardEng::NewL( *iContactManager );
+	iIdConverter = CVPbkContactIdConverter::NewL(*iStore );
+	if ( iContactsModsFetcher )
+		{
+		iContactsModsFetcher->CancelRequest();
+		delete iContactsModsFetcher;
+		iContactsModsFetcher = NULL;
+		}
+		
+	iContactsModsFetcher = CreateModsFetcherL();
 	
-	User::RequestComplete( iCallerStatus, err );
+#ifdef __NSML_MODULETEST__
+	CActiveScheduler::Start();
+#endif
 	
 	_DBG_FILE("CNSmlContactsDataStore::DoOpenL(): end");
 	}
@@ -299,6 +377,38 @@
 EXPORT_C void CNSmlContactsDataStore::DoCancelRequest()
 	{
 	_DBG_FILE("CNSmlContactsDataStore::DoCancelRequest(): begin");
+	if(iLastOperation == ENSMLDeleteAllOp)
+	    {   
+	    if(iDeleteAllOperation)
+	        {
+	        delete iDeleteAllOperation;
+	        iDeleteAllOperation = NULL;
+	        }
+
+	    if( iChangeFinder )
+	        {
+            TRAP_IGNORE(iChangeFinder->ResetL());
+	        }
+	    iSnapshotRegistered = EFalse;
+
+	    if(iContactLnks)
+	        {
+	        delete iContactLnks;
+	        iContactLnks = NULL;
+			iContactLink = NULL;
+	        }
+
+	    if(iContactViewBase)
+	        {
+	        delete iContactViewBase;
+	        iContactViewBase = NULL;
+	        }
+	    User::RequestComplete( iCallerStatus, KErrCancel );  
+	    }
+		if(iContactsModsFetcher)
+		{
+		iContactsModsFetcher->CancelRequest();
+		}
 	
 	_DBG_FILE("CNSmlContactsDataStore::DoCancelRequest(): NOT NEEDED end");
 	}
@@ -319,14 +429,15 @@
 EXPORT_C const TDesC& CNSmlContactsDataStore::DefaultStoreNameL() const
 	{
 	_DBG_FILE("CNSmlContactsDataStore::DefaultStoreNameL(): begin");
-
+	
 	if ( !iDefaultStoreName )
 		{
 		return KNullDesC;
 		}
 
 	_DBG_FILE("CNSmlContactsDataStore::DefaultStoreNameL(): end");
-	return *iDefaultStoreName;
+	//The engine methods that create syncml packet, use this information in Database fields
+	return *iPacketStoreName;
 	}
 	
 // ----------------------------------------------------------------------------
@@ -375,20 +486,14 @@
 	_DBG_FILE("CNSmlContactsDataStore::DoBeginBatchL(): begin");
 	
 	iBatchMode = ETrue;			// SUPPORTED on Contacts
-	
-	if( iItemDataAddBatch )
-		{
-		iItemDataAddBatch->Reset();
-		}
-	
+
 	_DBG_FILE("CNSmlContactsDataStore::DoBeginBatchL(): end");
 	}
 
 // ----------------------------------------------------------------------------
 // void CNSmlContactsDataStore::DoCommitBatchL()
 // ----------------------------------------------------------------------------
-EXPORT_C void CNSmlContactsDataStore::DoCommitBatchL( RArray<TInt>& aResultArray, 
-                                                      TRequestStatus& aStatus )
+EXPORT_C void CNSmlContactsDataStore::DoCommitBatchL( RArray<TInt>& aResultArray, TRequestStatus& aStatus )
 	{
 	_DBG_FILE("CNSmlContactsDataStore::DoCommitBatchL(): begin");
 
@@ -403,41 +508,235 @@
 		}
 //		
 // Go through Buffer and execute all commands return aResultArray
-// If none of commands succeeds KErrGeneral returned as status otherwise KErrNone returned
 //
-	TInt err = KErrNone;
-
-	TRAPD( leavecode, err = ExecuteBufferL(aResultArray) );
+	
+	iResultArray = &aResultArray;
+	
+	iIndex = 0;
+	TRAPD( leavecode,ExecuteBufferL() );
 	
 	if( leavecode != KErrNone )
 		{
-		err = leavecode;
+		User::RequestComplete( iCallerStatus, leavecode );
 		}
-//
-// Empty Buffer
-//	
-	iContactsBufferItemList.ResetAndDestroy();
-	
-	if( iItemDataAddBatch )
-		{
-		iItemDataAddBatch->Reset();
-		}
-	
-	iBatchMode = EFalse; // All data handled
-	User::RequestComplete( iCallerStatus, err );
-		
+
 	_DBG_FILE("CNSmlContactsDataStore::DoCommitBatchL(): end");
 	}
 	
 // ----------------------------------------------------------------------------
 // void CNSmlContactsDataStore::ExecuteBufferL()
 // ----------------------------------------------------------------------------
-EXPORT_C TInt CNSmlContactsDataStore::ExecuteBufferL(RArray<TInt>& aResultArray) 
-    {
-    _DBG_FILE("CNSmlContactsDataStore::ExecuteBufferL()");
-    return DoExecuteBufferL( aResultArray );
-    }
+EXPORT_C void CNSmlContactsDataStore::ExecuteBufferL() 
+	{
+	_DBG_FILE("CNSmlContactsDataStore::ExecuteBufferL(): begin");
+	
+	TInt  retCommand( KErrNone );
+	
+	//
+	// Loop through buffered commands
+	//
+		if( iIndex < iContactsBufferItemList.Count())
+		{
+		
+		if( iContactsBufferItemList[iIndex]->iStatus!= KNSmlNoError )
+			{
+			retCommand = iContactsBufferItemList[iIndex]->iStatus;
+			}
+		else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemAdd )
+			{
+			retCommand = ExecuteAddL();
+			}
+		else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemReplace ||
+            iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemFieldLevelReplace )
+			{
+			ExecuteUpdateL();		
+			}
+		else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemMove )
+			{
+			ExecuteMoveL();
+			}
+		else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemDelete ||
+				 iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemSoftDelete )
+			{
+			ExecuteDeleteL();
+			}
+		//
+		//	Set allready set commands from iContactsBufferItemList
+		//
+		if( ( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemAdd     ||
+		      iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemReplace ||
+		      iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemFieldLevelReplace ||
+		      iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemDelete  ||
+		      iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemSoftDelete ) &&
+		      iContactsBufferItemList[iIndex]->iStatus  != KNSmlNoError )
+			{
+			retCommand = iContactsBufferItemList[iIndex]->iStatus;
+			}
+			
+		
+		//if an error occurs when performing any operation
+		//return the error status 
+			else if(retCommand!=KErrNone)
+			{
+			User::RequestComplete( iCallerStatus, retCommand );	
+			}
+			
+			iRetCommand = retCommand;
+		}
+	}
+	
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::ExecuteAddL()
+// ----------------------------------------------------------------------------
+	
+EXPORT_C TInt CNSmlContactsDataStore::ExecuteAddL()
+	{
+	TInt  retCommand( KErrNone );
+	StripPropertyL( iItemDataAddBatch, KVersitTokenUID() ); // Remove UID's from data
 
+	TInt err( KErrNone );
+	if(iBatchMode)			
+		{
+		TRAP( err,LdoAddItemsL( iItemDataAddBatch,
+		                   iItemDataAddBatch->Ptr(0).Length()) );
+		if(err!=KErrNone)			
+			{
+			retCommand = err;
+			TInt j = iIndex;
+			while( j < iContactsBufferItemList.Count() )
+				{
+				if( iContactsBufferItemList[j]->iModType == ENSmlCntItemAdd &&
+				iContactsBufferItemList[j]->iStatus  == KNSmlNoError )
+					{
+					iContactsBufferItemList[j]->iStatus = KErrNotSupported;
+					iResultArray->AppendL(KErrNotSupported);
+					}
+				j++;
+				}
+			}			                          
+		}
+	else
+		{
+		const TPtr8 dataPtr = iItemDataAddBatch->Ptr(0);
+		TRAP( err, LdoAddItemL( dataPtr,
+					iContactsBufferItemList[iIndex]->iSize));
+		if(err!=KErrNone)			
+			{
+			retCommand = err;
+			}	
+		}
+	return retCommand; 
+	}
+	
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::ExecuteDeleteL()
+// ----------------------------------------------------------------------------
+	
+EXPORT_C void CNSmlContactsDataStore:: ExecuteDeleteL()
+	{
+	
+	if(iBatchMode)			
+		{
+		iContactLnks = CVPbkContactLinkArray::NewL();
+		
+		TInt j=iIndex;
+		while( j < iContactsBufferItemList.Count() )
+			{
+			if( (iContactsBufferItemList[j]->iModType == ENSmlCntItemDelete ||
+			iContactsBufferItemList[j]->iModType == ENSmlCntItemSoftDelete) &&
+			iContactsBufferItemList[j]->iStatus  == KNSmlNoError )
+				{
+				TContactItemId id = iContactsBufferItemList[j]->iUid; 
+
+				if( id != 0 )
+					{
+					MVPbkContactLink* contactLink = iIdConverter->IdentifierToLinkLC(id);
+					//check if the contact link is valid
+					TInt index = iContactViewBase->IndexOfLinkL(*contactLink);
+					if(index != KErrNotFound)
+						{
+						iContactLnks->AppendL(contactLink);	
+						}
+						else
+						{
+						iContactsBufferItemList[j]->iStatus  = KErrNotFound;
+						}
+
+					CleanupStack::Pop();//contactLink				
+					}
+					else 
+					{
+					iContactsBufferItemList[j]->iStatus  = KErrNotFound;
+					}
+				}
+			j++;
+			}
+
+		delete iContactViewBase;
+		iContactViewBase = NULL;
+
+		iContactManager->DeleteContactsL( *iContactLnks, *this );
+		iLastOperation = ENSmlDeleteOp;
+		}
+
+	}
+	
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::ExecuteUpdateL()
+// ----------------------------------------------------------------------------
+	
+EXPORT_C void CNSmlContactsDataStore::ExecuteUpdateL()
+	{
+	iUid  = iContactsBufferItemList[iIndex]->iUid;
+
+	iDataMod->SetUsedMimeType( iServerMimeType, iServerMimeVersion );
+
+	// Check whether merging is needed or not.
+	if( iDataMod->NeedsMerge() )
+		{
+		iMergeItem = CBufFlat::NewL(64);
+		iWriteStream.Open(*iMergeItem);
+
+		MVPbkContactLink* contactLink = iIdConverter->IdentifierToLinkLC(iUid);
+
+		iVCardEngine->ExportVCardForSyncL(iWriteStream,*contactLink,*this);
+		CleanupStack::PopAndDestroy();
+
+		iLastOperation = ENSMLUpdateExportOp;
+		}
+	else
+		{
+			LdoUpdateItemL();
+		}
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::ExecuteMoveL
+// ----------------------------------------------------------------------------
+
+EXPORT_C void CNSmlContactsDataStore::ExecuteMoveL()
+	{
+	// move command is not supported
+	if(!iBatchMode)
+		{
+		ResetBuffer();
+		User::RequestComplete( iCallerStatus, KErrNotSupported );	
+		}
+	else
+		{
+		iResultArray->AppendL(KErrNotSupported);
+		iIndex++;
+		if(iIndex == iContactsBufferItemList.Count() )
+			{
+			ResetBuffer();
+			User::RequestComplete( iCallerStatus, KErrNone );	
+			}
+		else
+			{
+				ExecuteBufferL();
+			}		
+		}
+	}
 // ----------------------------------------------------------------------------
 // void CNSmlContactsDataStore::DoCancelBatch()
 // ----------------------------------------------------------------------------
@@ -512,21 +811,10 @@
 		{
 		TFileName fileName;
 		TParse parse;
-		
-		// Locate the resource file
-        TFileName dllFileName;
-        Dll::FileName( dllFileName );
-        
-        TFileName resourceFileName;
-        resourceFileName.Copy( TParsePtrC( dllFileName ).Drive() );  
-        
-        resourceFileName.Append( GetStoreFormatResourceFileL() );
 
-        parse.Set( resourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+		parse.Set( GetStoreFormatResourceFileL(), &KDC_RESOURCE_FILES_DIR, NULL  );
 
 		fileName = parse.FullName();
-		
-		DBG_ARGS(_S("CNSmlContactsDataStore::SetOwnStoreFormatL(): '%S'"), &parse.FullName());
 
 		RResourceFile resourceFile; 
 		BaflUtils::NearestLanguageFile( iRfs, fileName );
@@ -540,7 +828,7 @@
 		reader.SetBuffer( contactsDataFormat );
 
 		iStoreFormat = CSmlDataStoreFormat::NewLC( iStringPool, reader );
-		CleanupStack::Pop(); // iStoreFormat
+		CleanupStack::Pop(iStoreFormat); // iStoreFormat
 		
 		CleanupStack::PopAndDestroy(2); // contactsDataFormat, resourceFile  
 		}
@@ -548,10 +836,10 @@
 	iDataMod->SetOwnStoreFormat( *iStoreFormat );
 
 	// Set own MIME type based on store format resource definition. Allows inherited classes to 
-	// use non-standard MIME type by recource change. E.g. Operator specific MIME types can be used.
+    // use non-standard MIME type by recource change. E.g. Operator specific MIME types can be used.
     iUsedMimeType.Set( iStoreFormat->MimeFormat(0).MimeType().DesC() );
     iUsedMimeVersion.Set( iStoreFormat->MimeFormat(0).MimeVersion().DesC() );
-	
+
 	_DBG_FILE("CNSmlContactsDataStore::SetOwnStoreFormatL(): end");
 	return;
 	}
@@ -618,33 +906,10 @@
 		{
 		iItemData->Reset();
 		}
-
-	TInt err = LdoFetchItemL( aUid, *iItemData );
-	
-	if( !err )
-		{
-		iItemData->Compress();
-		
-		iDataMod->StripTxL( *iItemData );
 	
-//  	Get Item size from database after stripping
-		aSize = iItemData->Size();
-		iState = ENSmlItemOpen;
-		
-		if ( iServerMaxObjectSize == 0 || aSize <= iServerMaxObjectSize )
-			{
-			User::RequestComplete( iCallerStatus, KErrNone );
-			}
-		else
-			{
-			User::RequestComplete( iCallerStatus, KErrTooBig );
-			}
-		}
-	else
-		{
-		User::RequestComplete( iCallerStatus, err );
-		}
-
+	 LdoFetchItemL( aUid, *iItemData );
+	 iSize = &aSize;
+	
 	_DBG_FILE("CNSmlContactsDataStore::DoOpenItemL(): end");
 	}
 
@@ -667,8 +932,8 @@
 	
 	if ( iState != ENSmlOpenAndWaiting )
 		{
-        _DBG_FILE("CNSmlContactsDataStore::DoCreateItemL - KErrNotReady: END");
 		User::RequestComplete( iCallerStatus, KErrNotReady );
+		_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL - KErrNotReady: END");
 		return;
 		}
 		
@@ -700,12 +965,12 @@
 	    // Allow using custom MIME type defined in store format resource file
 	    ( aMimeType.MatchF( iUsedMimeType ) < 0 ) )
 		{
-        _DBG_FILE("CNSmlContactsDataStore::DoCreateItemL - KErrNotSupported: END");
 		User::RequestComplete( iCallerStatus, KErrNotSupported );
+		_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL - KErrNotSupported: END");
 		return;
 		}
     
-    // Is there enough space on drive ?
+    // Is there enough space on drive 
 	if( DriveBelowCriticalLevelL( aSize ) )
 		{
 		err = KErrDiskFull;
@@ -736,7 +1001,7 @@
 // ----------------------------------------------------------------------------
 EXPORT_C void CNSmlContactsDataStore::DoReplaceItemL( TSmlDbItemUid aUid, 
 											 TInt aSize, 
-											 TSmlDbItemUid /*aParent*/, 
+											 TSmlDbItemUid /*aParent*/,
 											 TBool aFieldChange, 
 											 TRequestStatus& aStatus )
 	{
@@ -749,7 +1014,7 @@
 			
 	iUid      = aUid;
 	iItemSize = aSize;
-	iModType  = aFieldChange ? ENSmlCntItemFieldLevelReplace : ENSmlCntItemReplace;
+	iModType  =  aFieldChange ? ENSmlCntItemFieldLevelReplace : ENSmlCntItemReplace;
 	
 	if ( iItemPos == -1 || !iBatchMode )
 		{
@@ -760,9 +1025,9 @@
 		{
 		iItemData->Reset();
 		}
-		
+
 	iFieldLevelReplace = aFieldChange;
-	
+
 	iItemData = AddBufferListL( aUid, aSize, err );
 	
 	if( iBatchMode )
@@ -772,34 +1037,6 @@
 		User::RequestComplete( iCallerStatus, KErrNone );
 		return;
 		}
-	
-	CBufBase* tempData = CBufFlat::NewL( KNSmlItemDataExpandSize );
-	CleanupStack::PushL( tempData );
-
-	_DBG_FILE("CNSmlContactsDataStore::DoReplaceItemL(): CContactDatabase::ExportSelectedContactsL() begin");
-	
-	TInt ret = KErrNone;
-	TRAP( err, ret = ExportContactsL( TUid::Uid(aUid), *tempData ) );
-	
-	_DBG_FILE("CNSmlContactsDataStore::DoReplaceItemL(): CContactDatabase::ExportSelectedContactsL() end");
-	CleanupStack::PopAndDestroy( tempData );
-	
-	if ( err || ret )
-	    {
-	    _DBG_FILE("CNSmlContactsDataStore::DoReplaceItemL(): CContactDatabase::ExportSelectedContactsL() ERROR");
-	    if ( err == KErrNone )
-	        {
-            err = ret;
-	        }
-	    User::RequestComplete( iCallerStatus, err );
-		return;
-	    }
-	
-	if( !err && DriveBelowCriticalLevelL( aSize ) ) // Is drive getting full?
-		{
-		err = KErrDiskFull;
-		}
-	
 	if ( err == KErrNone )
 	    {
 	    iState = ENSmlItemUpdating;
@@ -816,6 +1053,7 @@
 EXPORT_C void CNSmlContactsDataStore::DoReadItemL( TDes8& aBuffer )
 	{
 	_DBG_FILE("CNSmlContactsDataStore::DoReadItemL(): begin");
+
     if ( iState != ENSmlItemOpen || !iItemData )
         {
         iItemPos = -1;
@@ -836,7 +1074,8 @@
         {
         iItemData->Read( iItemPos, aBuffer, iItemData->Size() - iItemPos );
         iItemPos = -1;
-        }	
+        }
+
 	_DBG_FILE("CNSmlContactsDataStore::DoReadItemL(): end");
 	}
 
@@ -920,14 +1159,14 @@
       	    }
 	    }
 	 else if ((iModType   == ENSmlCntItemAdd ||         // If some write problems
-      	       iModType   == ENSmlCntItemReplace ||
-      	       iModType   == ENSmlCntItemFieldLevelReplace ) && 
-      	       iStateItem != KErrNone &&
-      	       iContactsBufferItemList.Count() > 0) 
+         iModType   == ENSmlCntItemReplace ||
+         iModType   == ENSmlCntItemFieldLevelReplace ) &&  
+      	 iStateItem != KErrNone &&
+      	 iContactsBufferItemList.Count() > 0) 
 	    {
         iContactsBufferItemList[iContactsBufferItemList.Count()-1]->iStatus  = iStateItem; 
 	    }
-	
+
 	if( iBatchMode )
 		{
 		iItemData = NULL;
@@ -936,39 +1175,13 @@
 		return;
 		}
 		
-	RArray<TInt> noResultArray;
-	CleanupClosePushL( noResultArray );
-	
-	TRAPD(err, ExecuteBufferL( noResultArray ));
-	if( noResultArray.Count() == 1 )	// Should be a single item commit
-		{
-		err = noResultArray[0];
-		}
-	CleanupStack::PopAndDestroy(); // noResultArray
-	
-	//
-	// Empty Buffer if not batch mode
-	//	
-	if ( !iBatchMode )
-		{
-		if(iItemData)
-		    {
-		    iItemData->Reset();    
-		    }
-		    
-		if(iItemDataAddBatch)
-		    {
-		    iItemDataAddBatch->Reset();    
-		    }
-		
-		iContactsBufferItemList.ResetAndDestroy();
-		}
+
+	iIndex = 0;
+	ExecuteBufferL();
 	
 	iItemData = NULL;
 	iState = ENSmlOpenAndWaiting;
 	
-	User::RequestComplete( iCallerStatus, err );
-	
 	_DBG_FILE("CNSmlContactsDataStore::DoCommitItemL(): end");
 	}
 
@@ -1022,33 +1235,36 @@
 EXPORT_C void CNSmlContactsDataStore::DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus )
 	{
 	_DBG_FILE("CNSmlContactsDataStore::DoDeleteItemL(): begin");
-	TInt err = KErrNone;
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 		
 	if( iBatchMode )
 		{
-		if( iModType != ENSmlCntItemSoftDelete ) // Treated like deletes
-			{
-			iModType  = ENSmlCntItemDelete;	
-			}
-			
-		TInt fSize = 0;
-		AddBufferListL( aUid, fSize, KErrNone );
-		User::RequestComplete( iCallerStatus, KErrNone );
-		return;
+		if(iContactViewBase ==NULL)
+		{
+		CreateViewL();	
+		}
+	if( iModType != ENSmlCntItemSoftDelete ) // Treated like deletes
+		{
+		iModType  = ENSmlCntItemDelete;	
 		}
-
-	if( iContactsDataStoreExtension->DeleteContactL( TUid::Uid(aUid) ) )
-		{
-        iChangeFinder->ItemDeleted( TNSmlSnapshotItem( aUid ) );
-		}
-	else
-	    {
-        err = KErrGeneral;
-	    }
-		
-	User::RequestComplete( iCallerStatus, err );
+			
+	TInt fSize = 0;
+	AddBufferListL( aUid, fSize, KErrNone );
+	User::RequestComplete( iCallerStatus, KErrNone );
+	return;
+	}
+	iUid = aUid;
+	
+	//add the contactlink to CVPbkContactLinkArray
+	MVPbkContactLink* contactLink  = iIdConverter->IdentifierToLinkLC(aUid);
+	CleanupStack::Pop();
+	CVPbkContactLinkArray* contactLnks = CVPbkContactLinkArray::NewLC();
+	contactLnks->AppendL( contactLink );
+	
+ 	iContactManager->DeleteContactsL( *contactLnks, *this );
+	CleanupStack::PopAndDestroy(); 
+	iLastOperation = ENSmlDeleteOp;
 	
 	_DBG_FILE("CNSmlContactsDataStore::DoDeleteItemL(): end");
 	}
@@ -1071,23 +1287,17 @@
 EXPORT_C void CNSmlContactsDataStore::DoDeleteAllItemsL( TRequestStatus& aStatus )
 	{
 	_DBG_FILE("CNSmlContactsDataStore::DoDeleteAllItemsL(): begin");
+	
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
-
-	if( iContactsDataStoreExtension->DeleteAllContactsL() )
-	    {
-        if( iChangeFinder )
-            {
-            iChangeFinder->ResetL();		
-            }
-        iSnapshotRegistered = EFalse;
-        User::RequestComplete( iCallerStatus, KErrNone );
-	    }
-	else
-	    {
-         DBG_ARGS(_S("CNSmlContactsDataStore::DoDeleteAllItemsL(): Error"));
-         User::RequestComplete( iCallerStatus, KErrGeneral );
-	    }
+	
+	//create view to get all the contactlinks to delete
+	if(iContactViewBase ==NULL)
+		{
+		CreateViewL();	
+		}
+		
+	iLastOperation = ENSMLDeleteAllOp;
 	
 	_DBG_FILE("CNSmlContactsDataStore::DoDeleteAllItemsL(): end");
 	}
@@ -1258,15 +1468,24 @@
 	iCallerStatus = &aStatus;
 	*iCallerStatus = KRequestPending;
 	
-	iSnapshotRegistered = EFalse;
-	
 	if( iChangeFinder )
 		{
 		iChangeFinder->ResetL();
-		FetchModificationsL();
 		}
+		
+	iSnapshotRegistered = EFalse;
 	
-    User::RequestComplete( iCallerStatus, KErrNone );
+		if ( iContactsModsFetcher )
+		{
+		iContactsModsFetcher->FetchModificationsL( aStatus );
+#ifdef __NSML_MODULETEST__
+		CActiveScheduler::Start();
+#endif
+		}
+	else
+		{
+		User::RequestComplete( iCallerStatus, KErrNone );
+		}
 	
 	_DBG_FILE("CNSmlContactsDataStore::DoResetChangeInfoL(): end");
 	}
@@ -1321,311 +1540,142 @@
 	{
 	_DBG_FILE("CNSmlContactsDataStore::DoListStoresLC(): begin");
 	
-	 /*CDesCArray* cntStores = new (ELeave) CDesCArrayFlat(1);
-	 iContactsDataStoreExtension->ListStoresL( cntStores );
-     CleanupStack::PushL( cntStores );*/
+	MVPbkContactStoreList& storeList = iContactManager->ContactStoresL();
+	CDesCArrayFlat* stores = new (ELeave) CDesCArrayFlat(storeList.Count());
+	CleanupStack::PushL( stores );
+	
+  TBuf<KVPbhkPrefixLength> phoneDataBasePrefix(KVPbhkSymbianDBPrefix);
 	
-	 CDesCArray* array = new (ELeave) CDesCArrayFlat(1);
-	 array->AppendL(*iDefaultStoreName);
-	 CleanupStack::PushL( array );
-     
-     _DBG_FILE("CNSmlContactsDataStore::DoListStoresLC(): end");
-     
-     return array;
+	for(TInt i=0 ; i< storeList.Count(); i++)
+	{
+	    TBuf<KNSmlDefaultStoreNameMaxSize>  currentStore(storeList.At(i).StoreProperties().Uri().UriDes());	    	   
+	    
+	    if(currentStore.Find(phoneDataBasePrefix) == 0)//Check if Symbian Database
+	    {	    
+	    		//For backward compatability with local and remote servers
+        	    //The Symbian Db name remains unchanged	   
+        	    //The engine methods that create syncml packet, use this information in Database fields
+	            stores->AppendL(*iPacketStoreName);
+	    }
+	    else//End Symbian Database check
+	    {
+		     stores->AppendL(storeList.At(i).StoreProperties().Uri().UriDes());
+	    }
+	}
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoListStoresLC(): end");
+
+	return stores;
 	}
 	
 // ------------------------------------------------------------------------------------------------
 // TInt CNSmlContactsDataStore::LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem )
 // ------------------------------------------------------------------------------------------------
-EXPORT_C TInt CNSmlContactsDataStore::LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem )
+EXPORT_C void CNSmlContactsDataStore::LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem )
 	{
 	_DBG_FILE("CNSmlContactsDataStore::LdoFetchItemL(): begin");
 	
-	_DBG_FILE("CNSmlContactsDataStore::FetchItemL(): CContactDatabase::ExportSelectedContactsL() begin");
-	
-	TInt err = KErrNone;	
-	TInt ret = KErrNone;
-	
-	TRAP( err, ret = ExportContactsL( TUid::Uid(aUid), aItem ) );
-	
-	if( ret != KErrNone )
-	    {
-        DBG_ARGS(_S("CNSmlContactsDataStore::FetchItemL(): Error = %d"), ret);
-        err = ret;
-	    }
-	
-	_DBG_FILE("CNSmlContactsDataStore::FetchItemL(): CContactDatabase::ExportSelectedContactsL() end");
+	 iWriteStream.Open(aItem);
+		
+	 MVPbkContactLink* contactLink  = iIdConverter->IdentifierToLinkLC(aUid);
+	 iVCardEngine->ExportVCardForSyncL(iWriteStream,*contactLink,*this);
+	 CleanupStack::PopAndDestroy();
+	 
+	 iLastOperation = ENSMLFetchOp;
 	
 	_DBG_FILE("CNSmlContactsDataStore::LdoFetchItemL(): end");
-	return err;
+
 	}
 
 // ------------------------------------------------------------------------------------------------
 // TInt CNSmlContactsDataStore::LdoAddItemL( TSmlDbItemUid& aUid,
 //                                           const TDesC8& aItem,
 //                                           TInt aSize,
-//                                           TTime& aLastModified )
+//                                           TTime& aLastModified,
+//                                           TBool& aConfidential )
 // ------------------------------------------------------------------------------------------------
-EXPORT_C TInt CNSmlContactsDataStore::LdoAddItemL( TSmlDbItemUid& aUid,
-                                                   const TDesC8& aItem,
-                                                   TInt aSize,
-                                                   TTime& aLastModified )
+EXPORT_C void CNSmlContactsDataStore::LdoAddItemL( const TDesC8& aItem,
+                                          TInt aSize)
 	{
 	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): begin");
-	
-	TInt ret( KErrNone );
-	
+
 	if( !iOpened )
 		{
 		User::Leave( KErrNotReady );
 		}
 		
-	// Is there enough space on drive ?
+	// Is there enough space on drive 
 	if( DriveBelowCriticalLevelL( aSize ) )
 		{
-		return KErrDiskFull;
+		User::Leave( KErrDiskFull );
 		}
 
-	HBufC8* buf = aItem.AllocLC();
-	StripPropertyL( buf, KVersitTokenUID() );
-
-	CArrayFixFlat<TUid>* entryArray = NULL;
-	TRAP( ret, entryArray = ImportContactsL( *buf ) );
-
-    DBG_ARGS(_S("New item to database with return value: '%d'"), ret );
+	 iBuf = aItem.AllocLC();
+	StripPropertyL( iBuf, KVersitTokenUID() );
 
-	if( ret == KErrNone && entryArray != NULL )
-		{
-		CleanupStack::PushL( entryArray );
-		if( entryArray->Count() )
-			{
-            TInt err(KErrNone);
-			TUid tId = entryArray->At( 0 );	
-			CNsmlContactItem* contactitem = CNsmlContactItem::NewL();
-			CleanupStack::PushL( contactitem );
-			err = iContactsDataStoreExtension->ReadContactL( tId, contactitem );
-			if( err == KErrNone)
-			    {
-                aLastModified = contactitem->iLastModified;
-                aUid = tId.iUid;
-			    }			
-			CleanupStack::PopAndDestroy( contactitem );
-			}
-		else
-			{
-			ret = KErrNotSupported;
-			}
-		CleanupStack::PopAndDestroy( entryArray );
-		CleanupStack::PopAndDestroy( buf );
-		} 
-	else
-		{
-		ret = KErrNotSupported;
-        CleanupStack::PopAndDestroy( buf );
-		}
+	 iReadStream.Open( *iBuf );
+	// import a vcard without checking for duplicates
+	iVCardEngine->ImportVCardForSyncL(*iStore,iReadStream,*this);
+	iLastOperation = ENSmlAddOp;
+	CleanupStack::Pop(iBuf);
 
 	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): end");
-	return ret;
+	
 	}
-
 // ------------------------------------------------------------------------------------------------
-// TInt CNSmlContactsDataStore::LdoAddItemsL( RArray<TInt>& aUids,CBufBase*& aItems,
-//                                            TInt aSize, TTime& aLastModified )
+// TInt CNSmlContactsDataStore::LdoAddItemsL( CBufBase*& aItems,
+//                                           TInt aSize)
 // ------------------------------------------------------------------------------------------------
-EXPORT_C TInt CNSmlContactsDataStore::LdoAddItemsL( RArray<TInt>& aUids,
-                                                    CBufBase*& aItems,
-                                                    TInt aSize,
-                                                    TTime& aLastModified  )
+EXPORT_C void CNSmlContactsDataStore::LdoAddItemsL( CBufBase*& aItems,
+                                          TInt aSize)
 	{
-	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemsL(): begin");
-	
-	TInt ret( KErrNone );
-	
+	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): begin");
+
 	if( !iOpened )
 		{
 		User::Leave( KErrNotReady );
 		}
 		
-	// Is there enough space on drive ?
+	// Is there enough space on drive 
 	if( DriveBelowCriticalLevelL( aSize ) )
 		{
-		return KErrDiskFull;
+		User::Leave( KErrDiskFull );
 		}
 
-	CArrayFixFlat<TUid>* entryArray = NULL;
-    TRAP( ret, entryArray = ImportContactsL( aItems->Ptr( 0 ) ) );
+	iReadStream.Open( aItems->Ptr(0) );
+	 // import vcards without checking for duplicates
+	iVCardEngine->ImportVCardForSyncL(*iStore,iReadStream,*this);
+	iLastOperation = ENSmlAddOp;
+	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): end");
 	
-    DBG_ARGS(_S("New items to database with return value: '%d'"), ret );
-
-	if( ret == KErrNone && entryArray != NULL)
-		{
-		CleanupStack::PushL( entryArray );
-		if( entryArray->Count() )
-			{
-			TInt i = 0;
-			while( i < entryArray->Count() )
-				{
-				TUid tId = entryArray->At(i);
-				if (i == (entryArray->Count()-1) ) // Get last Modified date
-					{
-                    TInt err(KErrNone);
-                    CNsmlContactItem* contactitem = CNsmlContactItem::NewL();
-                    CleanupStack::PushL( contactitem );
-                    err = iContactsDataStoreExtension->ReadContactL( tId, contactitem );    
-				    if( err == KErrNone )
-                        {
-                        aLastModified = contactitem->iLastModified;
-                        }
-					CleanupStack::PopAndDestroy( contactitem );
-					}
-				aUids.Append( tId.iUid );
-				i++;
-				}
-			}
-		else
-			{
-			ret = KErrNotSupported;
-			}
-		CleanupStack::PopAndDestroy( entryArray );
-		} 
-	else
-		{
-	    ret = KErrNotSupported;
-		}
-
-	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemsL(): end");
-	return ret;
 	}
-	
+		
 // ------------------------------------------------------------------------------------------------
 // TInt CNSmlContactsDataStore::LdoUpdateItemL(TSmlDbItemUid aUid,
 //                                             const TDesC8& aItem,
 //                                             TInt aSize,
 //                                             TTime& aLastModified )
 // ------------------------------------------------------------------------------------------------
-EXPORT_C TInt CNSmlContactsDataStore::LdoUpdateItemL( TSmlDbItemUid aUid,
-                                             const TDesC8& aItem,
-                                             TInt aSize,
-                                             TTime& aLastModified )
+EXPORT_C void CNSmlContactsDataStore::LdoUpdateItemL()
 	{
 	_DBG_FILE("CNSmlContactsDataStore::LdoUpdateItemL(): begin");
-	TInt ret(KErrNone);
-		
-	// Is there enough space on drive ?
-	if( DriveBelowCriticalLevelL( aSize) )
-		{
-		return KErrDiskFull;
-		}
-	
-	CNsmlContactItem* contactitem = CNsmlContactItem::NewL();
-	CleanupStack::PushL( contactitem );
-    ret = iContactsDataStoreExtension->ReadContactL( TUid::Uid( aUid ), contactitem );
-    
-    if( ret != KErrNone )
-        {
-        CleanupStack::PopAndDestroy( contactitem );
-        DBG_ARGS(_S("CNSmlContactsDataStore::LdoUpdateItemL(): Error = %d"), ret);
-        return ret;
-        }
-    
-    // Set mimetype + version
-	iDataMod->SetUsedMimeType( iServerMimeType, iServerMimeVersion );
-
-	DBG_DUMP((void*)aItem.Ptr(), aItem.Length(),
-	        _S8("CNSmlContactsDataStore::LdoUpdateItemL(): ReceivedItem:"));    
-	
-	CBufBase* bItem = LdoMergeLC( aUid, aItem );
-	HBufC8* hItemBuf = HBufC8::NewL( bItem->Size() + 80 );
-	*hItemBuf = bItem->Ptr(0);
-	CleanupStack::PopAndDestroy(); // bItem
-	CleanupStack::PushL( hItemBuf );
-	StripPropertyL( hItemBuf, KVersitTokenUID() );
 	
-	TPtr8 hItemPtr( hItemBuf->Des() );
-	HBufC8* endPropBuf = HBufC8::NewLC( KVersitTokenEND().Length() + KVersitTokenCRLF().Length() + KVersitTokenColon().Length() );
-	TPtr8 endPropPtr( endPropBuf->Des() );
-	endPropPtr.Append( KVersitTokenCRLF() );
-	endPropPtr.Append( KVersitTokenEND() ); 
-	endPropPtr.Append( KVersitTokenColon() ); 
-	TInt endPos = hItemPtr.Find( endPropPtr );
-	if( endPos == KErrNotFound )
-		{
-		User::Leave( KErrNotSupported );
-		}
-	hItemPtr.Insert( endPos, KVersitTokenCRLF() );
-	endPos += KVersitTokenCRLF().Length();
-	hItemPtr.Insert( endPos, KVersitTokenUID() );
-	endPos += KVersitTokenUID().Length();
-	hItemPtr.Insert( endPos, KVersitTokenColon() );
-	endPos += KVersitTokenColon().Length();
-	hItemPtr.Insert( endPos, *contactitem->iGuid );
-	
-	DBG_DUMP((void*)hItemPtr.Ptr(), hItemPtr.Length(),
-	            _S8("CNSmlContactsDataStore::LdoUpdateItemL(): MergedItem:"));
-	
-	CleanupStack::PopAndDestroy( endPropBuf );
+	iBuf = iContactsBufferItemList[iIndex]->iItemData->Ptr(0).AllocLC();
+	// Remove UID's from data
+	StripPropertyL( iBuf, KVersitTokenUID() );
 
-	// TODO: Get it reviewed
-	CArrayFixFlat<TUid>* entryArray = NULL;
-    TRAP( ret, entryArray = ImportContactsL( hItemPtr ) );
+	iReadStream.Open( *iBuf );
+	iContactLink = iIdConverter->IdentifierToLinkLC(iUid);
+	iVCardEngine->ImportVCardMergeL(*iContactLink, *iStore, iReadStream, *this);
+
+	CleanupStack::Pop();
+	iLastOperation = ENSMLUpdateImportOp;
+	CleanupStack::Pop(iBuf);
 	
-    if( ret == KErrNone && entryArray != NULL)
-		{
-        CleanupStack::PushL( entryArray );
-		if( !entryArray->Count() )
-			{
-			ret = KErrNotSupported;								
-			}
-		else
-			{
-            TInt err(KErrNone);
-			TUid tId = TUid::Uid( aUid );
-			CNsmlContactItem* updatedContactitem = CNsmlContactItem::NewL();
-			CleanupStack::PushL( updatedContactitem );
-			err = iContactsDataStoreExtension->ReadContactL( tId, contactitem );
-            if( err == KErrNone)
-                {
-                aLastModified = updatedContactitem->iLastModified;
-                }
-			CleanupStack::PopAndDestroy( updatedContactitem ); // updatedContact
-			}
-		CleanupStack::PopAndDestroy(3); // contactitem,  hItemBuf, entryArray
-		}
-	else
-		{
-		ret = KErrNotSupported;
-		CleanupStack::PopAndDestroy(2); // contactitem,  hItemBuf
-		}
-	
-	iFieldLevelReplace = EFalse;
 	_DBG_FILE("CNSmlContactsDataStore::LdoUpdateItemL(): end");
-	return ret;
+
 	}
 
-// ------------------------------------------------------------------------------------------------
-//  CBufBase* CNSmlContactsDataStore::LdoMergeLC( TSmlDbItemUid& aUid, const TDesC8& aItem )
-// ------------------------------------------------------------------------------------------------
-EXPORT_C CBufBase* CNSmlContactsDataStore::LdoMergeLC( TSmlDbItemUid& aUid, const TDesC8& aItem )
-	{
-	_DBG_FILE("CNSmlContactsDataStore::LdoMergeLC(): begin");
-	CBufFlat* b = CBufFlat::NewL(64);
-	CleanupStack::PushL( b );
-	b->InsertL( 0, aItem );
-
-	if( iDataMod->NeedsMerge() )
-		{
-		CBufFlat* mergeItem = CBufFlat::NewL(64);
-		CleanupStack::PushL( mergeItem );
-		if( LdoFetchItemL( aUid, *mergeItem) == KErrNone )
-			{
-            iDataMod->MergeRxL( *b, *mergeItem, iFieldLevelReplace );
-			}
-		CleanupStack::PopAndDestroy(); // mergeItem
-		}
-	
-	_DBG_FILE("CNSmlContactsDataStore::LdoMergeLC(): end");
-	return b;
-	}
 
 // ------------------------------------------------------------------------------------------------
 // CNSmlContactsDataStore::DriveBelowCriticalLevelL()
@@ -1674,7 +1724,6 @@
 	iMimeTypeItem.Set( KNullDesC8 ); 
 	iMimeVersionItem.Set( KNullDesC8 );
 	
-	iLastItem = ETrue;
 	
 	CleanupStack::Pop();	
 	
@@ -1758,399 +1807,756 @@
 	CleanupStack::PopAndDestroy(); // propBuf
 	_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): end");
 	}
+	
+// ----------------------------------------------------------------------------
+// CNSmlContactsDataStore::IsConfidentialL
+// ----------------------------------------------------------------------------
+//	
+EXPORT_C TBool CNSmlContactsDataStore::IsConfidentialL(  MVPbkStoreContact& aItem )
+    {
+    _DBG_FILE("CNSmlContactsDataStore::IsConfidentialL(): begin");
+    TBool ret( EFalse );
+    
+    //find X-CLASS field type
+	const MVPbkFieldType* syncclass = 
+        iContactManager->FieldTypes().Find(R_VPBK_FIELD_TYPE_SYNCCLASS );
+	CVPbkBaseContactFieldTypeIterator* itr = 
+        CVPbkBaseContactFieldTypeIterator::NewLC( *syncclass, 
+            aItem.Fields() );
+	while ( itr->HasNext() )
+        {
+        const MVPbkBaseContactField* field = itr->Next();
+        const MVPbkContactFieldTextData& data = MVPbkContactFieldTextData::Cast(field->FieldData());
+        TPtrC ptr = data.Text();
+        //compare the sync type
+        if ( ptr.Compare( KNSmlContactSyncNoSync ) == 0 )
+            {
+            _DBG_FILE("CNSmlContactsDataStore::IsConfidentialL(): \
+                       find confidential");
+            ret = ETrue;
+            }
+         
+        }
+	CleanupStack::PopAndDestroy( itr );
+    
+    _DBG_FILE("CNSmlContactsDataStore::IsConfidentialL(): end");
+    return ret;
+    }
+    
+ // ----------------------------------------------------------------------------
+// CNSmlContactsDataStore::ResetBuffer
+// ----------------------------------------------------------------------------
+//	
+EXPORT_C void CNSmlContactsDataStore:: ResetBuffer()
+	{
+	if( iItemDataAddBatch )
+		{
+		iItemDataAddBatch->Reset();
+		}
+	iContactsBufferItemList.ResetAndDestroy();
+	}
+// -----------------------------------------------------------------------------
+// From MVPbkContactStoreListObserver  
+// Called when a contact store is ready to use.
+// -----------------------------------------------------------------------------
+ 
+EXPORT_C void CNSmlContactsDataStore::StoreReady( MVPbkContactStore& /*aContactStore*/ )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::StoreReady(): begin");
+	//The contact data base opened successfully
+	iOpened = ETrue;
+	//id to uniquely identify the opened store 
+	iOpenedStoreId = DefaultHash::Des16(
+						iStore->StoreProperties().Uri().UriDes());
+	
+	TRAPD(error, iContactsModsFetcher->FetchModificationsL( *iCallerStatus ));
+	if(error != KErrNone)
+		{
+		User::RequestComplete( iCallerStatus, error );
+		}
+	_DBG_FILE("CNSmlContactsDataStore::StoreReady(): end");
+	}
+
+
+// ---------------------------------------------------------------------------
+//  From MVPbkContactStoreListObserver  
+//	Called when a contact store becomes unavailable.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlContactsDataStore::StoreUnavailable(
+        MVPbkContactStore& /*aContactStore*/,
+        TInt aReason )
+    {
+    _DBG_FILE("CNSmlContactsDataStore::StoreUnavailable(): begin");
+
+    //Unable open the default contact data base
+	iOpened = EFalse;
+	delete iStoreName;
+	iStoreName = NULL;
+	iOpenedStoreId = 0;
+	User::RequestComplete( iCallerStatus, aReason );
+	_DBG_FILE("CNSmlContactsDataStore::StoreUnavailable(): end");		
+	return;
+	
+    }
+
+// ---------------------------------------------------------------------------
+// From MVPbkContactStoreListObserver  
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlContactsDataStore::HandleStoreEventL(
+        MVPbkContactStore& /*aContactStore*/,
+        TVPbkContactStoreEvent /*aStoreEvent*/ )
+	{
+	//Indication not needed.
+	}
+    
+// ---------------------------------------------------------------------------
+//  CNSmlContactsDataStore::VPbkSingleContactOperationComplete
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlContactsDataStore::VPbkSingleContactOperationComplete(
+		MVPbkContactOperationBase& aOperation,
+		MVPbkStoreContact* aContact )
+	{
+	MVPbkContactOperationBase* operation = &aOperation;
+	if ( operation )
+	{
+		delete operation;
+		operation = NULL;
+	}
+	TRAPD(error ,SingleContactOperationCompleteL(aContact));
+	delete aContact;
+	if(error!= KErrNone)
+		{
+			User::RequestComplete( iCallerStatus, error );
+		}
+	}
+
+// ---------------------------------------------------------------------------
+//  CNSmlContactsDataStore::VPbkSingleContactOperationFailed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlContactsDataStore::VPbkSingleContactOperationFailed(
+    MVPbkContactOperationBase& aOperation,
+    TInt aError )
+    {
+	MVPbkContactOperationBase* operation = &aOperation;
+	if ( operation )
+	    {
+		delete operation;
+		operation = NULL;
+	    }
+	
+	 if(iLastOperation == ENSMLFetchOp)
+		{
+	 	iWriteStream.Close();
+	 	User::RequestComplete( iCallerStatus, aError );
+	 	}
+	else if (iLastOperation == ENSMLUpdateExportOp)
+        {
+        iWriteStream.Close();
+        delete iMergeItem;
+        iMergeItem = NULL;
+        User::RequestComplete( iCallerStatus, aError );
+        }
+	else if (iLastOperation == ENSMLUpdateImportOp)
+        {
+        if(iBatchMode)
+            {
+            iResultArray->Append( aError ); 
+            } 
+		delete iContactLink;
+        iContactLink = NULL;	
+        delete iBuf;
+        iBuf = NULL;
+        iReadStream.Close();
+        iIndex++;
+        if(iIndex == iContactsBufferItemList.Count() )
+            {
+            ResetBuffer();
+            User::RequestComplete( iCallerStatus, aError );    
+            }
+        else
+            {
+            _DBG_FILE("VPbkSingleContactOperationFailed, Continuing to complete the Batch Operation");
+            ExecuteBufferL();
+            }
+        }
+	else if(iLastOperation == ENSmlRetrieveOp)
+	    {
+        iRetrieveCount--;	        
+        if(iBatchMode)
+            {
+            iResultArray->AppendL( aError ); 
+            }        
+        iIndex++;
+        if(iIndex == iContactsBufferItemList.Count() )
+            {
+            ResetBuffer();
+            User::RequestComplete( iCallerStatus, aError );    
+            }
+        else if(!iRetrieveCount)
+            {
+            _DBG_FILE("VPbkSingleContactOperationFailed, Continuing to complete the Batch Operation");
+            ExecuteBufferL();
+            }
+	    }
+    else
+        {
+        _DBG_FILE("VPbkSingleContactOperationFailed, No Matching LastOperation Completing the Operation");
+        User::RequestComplete( iCallerStatus, aError );    
+        }	
+	_DBG_FILE("CNSmlContactsDataStore::VPbkSingleContactOperationFailed(): end");
+	}
+ // ---------------------------------------------------------------------------
+//  CNSmlContactsDataStore::VPbkSingleContactOperationFailed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlContactsDataStore::SingleContactOperationCompleteL(
+ 		MVPbkStoreContact* aContact)
+	{
+	if(iLastOperation == ENSMLFetchOp)
+		{
+		iWriteStream.Close();
+
+		iItemData->Compress();
+		//strip the fields not supported by server
+		iDataMod->StripTxL( *iItemData );
+		*iSize = iItemData->Size();
+		iState = ENSmlItemOpen;
+		if ( iServerMaxObjectSize == 0 || *iSize <= iServerMaxObjectSize )
+			{
+			User::RequestComplete( iCallerStatus, KErrNone );
+			}
+		else
+			{
+			User::RequestComplete( iCallerStatus, KErrTooBig );
+			}
+		}
+	else if (iLastOperation == ENSMLUpdateExportOp)
+		{
+		iDataMod->MergeRxL( *iContactsBufferItemList[iIndex]->iItemData, 
+		    *iMergeItem, iFieldLevelReplace );
+		iWriteStream.Close();
+		delete iMergeItem;
+		iMergeItem = NULL;
+		LdoUpdateItemL();
+		}
+	else if (iLastOperation == ENSMLUpdateImportOp)
+		{
+		iFieldLevelReplace = EFalse;
+		
+		if(!IsConfidentialL(*aContact))
+			{
+			TInt32 id = iIdConverter->LinkToIdentifier(*aContact->CreateLinkLC());
+			
+			TNSmlSnapshotItem item(id);
+			
+			MVPbkStoreContact2* tempContact = 
+					reinterpret_cast<MVPbkStoreContact2*> (aContact->StoreContactExtension (KMVPbkStoreContactExtension2Uid));
+       		
+			MVPbkStoreContactProperties *contactProterties 
+										= tempContact ->PropertiesL();;
+			CleanupDeletePushL(contactProterties);				
+			item.SetLastChangedDate(contactProterties->LastModifiedL());
+			CleanupStack::PopAndDestroy();
+			
+			item.SetSoftDelete( EFalse );
+			
+			TRAP_IGNORE(iChangeFinder->ItemUpdatedL( item ));
+			
+			CleanupStack::PopAndDestroy();
+			if(iBatchMode)
+				{
+				iResultArray->Append(KErrNone);	
+				}
+			
+	        delete iContactLink;
+	        iContactLink = NULL;
+			
+			delete iBuf;
+			iBuf = NULL;
+			iReadStream.Close();
+			
+			iIndex++;
+			if(iIndex == iContactsBufferItemList.Count() )
+				{
+				ResetBuffer();
+				User::RequestComplete( iCallerStatus, iRetCommand );	
+				}
+			else
+				{
+					ExecuteBufferL();
+				}
+			}
+		
+		}
+	else if(iLastOperation == ENSmlRetrieveOp)
+		{
+		iRetrieveCount--;	
+		if(!IsConfidentialL(*aContact))
+			{
+			TInt32 id = iIdConverter->LinkToIdentifier(*aContact->CreateLinkLC());
+			*iContactsBufferItemList[iIndex]->iPUid = id;
+			
+			TNSmlSnapshotItem item(id);
+			
+       		MVPbkStoreContact2* tempContact = 
+       		    reinterpret_cast<MVPbkStoreContact2*> (aContact->StoreContactExtension (KMVPbkStoreContactExtension2Uid));  
+       		       			
+			MVPbkStoreContactProperties *contactProterties 
+										= tempContact ->PropertiesL();;
+			CleanupDeletePushL(contactProterties);				
+			item.SetLastChangedDate(contactProterties->LastModifiedL());
+			CleanupStack::PopAndDestroy();
+			
+			item.SetSoftDelete( EFalse );
+			// Add the snapshot item to the Change Finder.
+			TRAP_IGNORE(iChangeFinder->ItemAddedL( item ));
+			
+			CleanupStack::PopAndDestroy();
+			}
+			if(iBatchMode)
+			{
+			iResultArray->AppendL(iRetCommand);	
+			}
+			
+			iIndex++;
+			if(iIndex == iContactsBufferItemList.Count() )
+				{
+				ResetBuffer();
+				User::RequestComplete( iCallerStatus, iRetCommand );	
+				}
+			else if(!iRetrieveCount)
+				{
+					ExecuteBufferL();
+				}
+			
+			}
+ }
+ // ---------------------------------------------------------------------------
+//  CNSmlContactsDataStore::ContactsSaved.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlContactsDataStore::ContactsSaved( 
+		MVPbkContactOperationBase& aOperation,
+        MVPbkContactLinkArray* aResults ) 
+	{
+	MVPbkContactOperationBase* operation = &aOperation;
+	if ( operation )
+	{
+		delete operation;
+		operation = NULL;
+	}
+
+	if(iLastOperation == ENSmlAddOp)
+		{
+		//Count of contacts to be added from server to client 
+		TInt  cntAddCount( 0 );
+		TInt i(iIndex);
+		while( i<iContactsBufferItemList.Count() )
+			{
+			if ( iContactsBufferItemList[i]->iModType == ENSmlCntItemAdd &&
+			     iContactsBufferItemList[i]->iStatus  == KNSmlNoError )
+				{
+				cntAddCount++;
+				}
+			i++;
+			}
+		
+		//Count of contacts successfully added to client	
+		iRetrieveCount = aResults->Count();
+		
+		//Count of contacts which could not be added
+		TInt cntAddFailedCount(0);
+		cntAddFailedCount = cntAddCount-iRetrieveCount;
+		while(cntAddFailedCount > 0)
+		{
+			iContactsBufferItemList[iIndex++]->iStatus  = KErrGeneral;
+			iResultArray->Append(KErrGeneral);
+			cntAddFailedCount--;
+		}
+		
+		if ( aResults->Count() > 0 )
+			{
+			for(TInt i=0;i<aResults->Count();i++)
+				{
+				//retrieve the contact
+				TRAPD(error,iContactManager->RetrieveContactL( aResults->At(i), *this ));
+				if(error != KErrNone)
+					{
+					User::RequestComplete( iCallerStatus, error );	
+					}
+			iLastOperation = ENSmlRetrieveOp;				 	
+				}
+			}
+		delete iBuf;
+		delete aResults;
+		iBuf = NULL;
+		iReadStream.Close();	
+		}
+	
+	}
+        
+ // ---------------------------------------------------------------------------
+//  CNSmlContactsDataStore::ContactsSavingFailed
+// ---------------------------------------------------------------------------
+//       
+EXPORT_C void CNSmlContactsDataStore::ContactsSavingFailed( 
+        MVPbkContactOperationBase& aOperation, TInt aError )
+	{
+	MVPbkContactOperationBase* operation = &aOperation;
+	if ( operation )
+	{
+		delete operation;
+		operation = NULL;
+	}
+	
+	if(iLastOperation == ENSmlAddOp)
+	{
+	if(iBatchMode)
+		{
+		while( iIndex < iContactsBufferItemList.Count() &&
+		iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemAdd )
+			{
+			iContactsBufferItemList[iIndex++]->iStatus  = KErrGeneral;
+			iResultArray->Append(KErrGeneral);
+			}	
+		}
+	else
+		{
+		iIndex++;			
+		}
+
+	if(iIndex == iContactsBufferItemList.Count())
+		{
+		User::RequestComplete( iCallerStatus, aError );
+		ResetBuffer();
+		delete iBuf;
+	 	iBuf = NULL;
+	 	iReadStream.Close();	
+		}
+		//Execute the remaining commands in batch
+		else
+		{
+			TRAPD(error,ExecuteBufferL());
+			if(error != KErrNone)
+			{
+			User::RequestComplete( iCallerStatus, error );	
+			}
+		}
+		}
+	}
+// ---------------------------------------------------------------------------
+//  CNSmlContactsDataStore::StepComplete
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlContactsDataStore::StepComplete(
+		 MVPbkContactOperationBase& /*aOperation*/, 
+        TInt aStepSize )
+	{
+	if(iLastOperation == ENSmlDeleteOp)
+		{
+		if(iBatchMode)
+			{
+			for(TInt i = 0 ; i<aStepSize && iIndex < iContactsBufferItemList.Count() ;i++)
+				{
+				iResultArray->Append(KErrNone);
+				if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemDelete &&
+			    iContactsBufferItemList[iIndex]->iStatus  == KNSmlNoError )
+					{
+					iContactsBufferItemList[iIndex]->iStatus  = KErrNone;
+					iUid  = iContactsBufferItemList[iIndex]->iUid;
+					iChangeFinder->ItemDeleted( TNSmlSnapshotItem( iUid ));
+					}						
+					else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemSoftDelete &&
+				   		 iContactsBufferItemList[iIndex]->iStatus  == KNSmlNoError )
+					{
+					
+					iContactsBufferItemList[iIndex]->iStatus  = KErrNone;
+					iUid  = iContactsBufferItemList[iIndex]->iUid;
+					TRAP_IGNORE(iChangeFinder->ItemSoftDeletedL( TNSmlSnapshotItem( iUid ) ));
+					}
+					iIndex++;
+				}
+			}
+			else
+			{
+			iChangeFinder->ItemDeleted( TNSmlSnapshotItem( iUid ) );	
+			User::RequestComplete( iCallerStatus, KErrNone );
+			}
+		}
+	}
+ // ---------------------------------------------------------------------------
+//  CNSmlContactsDataStore::StepFailed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CNSmlContactsDataStore::StepFailed(
+        MVPbkContactOperationBase& /*aOperation*/,
+        TInt /*aStepSize*/,
+        TInt aError )
+ {
+ if(iLastOperation == ENSmlDeleteOp)
+	{
+	 	if(iBatchMode)
+	 	{
+			if( iIndex < iContactsBufferItemList.Count() &&
+			iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemDelete )
+			{
+			iContactsBufferItemList[iIndex++]->iStatus  = KErrGeneral;
+			iResultArray->Append(KErrGeneral);
+			}
+		 	
+	 	}
+	 	else
+	 	{
+	 		User::RequestComplete( iCallerStatus, aError );	
+	 	}
+	}
+	return ETrue;
+ }
+// ---------------------------------------------------------------------------
+//  CNSmlContactsDataStore::OperationComplete
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlContactsDataStore::OperationComplete
+		( MVPbkContactOperationBase& aOperation )
+	{
+	MVPbkContactOperationBase* operation = &aOperation;
+	if ( operation )
+	{
+		delete operation;
+		operation = NULL;
+	}
+
+	TRAPD(error ,OperationCompleteL());	
+	if(error != KErrNone)
+		{
+		User::RequestComplete( iCallerStatus, error );
+		}
+	}
+
+// ---------------------------------------------------------------------------
+//  CNSmlContactsDataStore::OperationCompleteL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlContactsDataStore::OperationCompleteL()
+	{
+	if(iLastOperation == ENSmlDeleteOp)
+		{
+		if(iBatchMode )
+			{
+			if(iResultArray->Count() != iContactsBufferItemList.Count())
+				{
+				while( iIndex < iContactsBufferItemList.Count() && 
+				iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemDelete 
+				&& iContactsBufferItemList[iIndex]->iStatus  == KErrNotFound )
+					{
+					iResultArray->Append(KErrNotFound);
+					iIndex++;
+					}
+				}
+			
+			if(iIndex == iContactsBufferItemList.Count())
+				{
+				if(iItemData)
+					{
+					iItemData->Reset();    
+					}
+
+				ResetBuffer();
+				User::RequestComplete( iCallerStatus, KErrNone );
+				}
+				else
+				{
+				ExecuteBufferL();
+				}	
+			}
+			else
+			{
+			
+			if(iItemData)
+				{
+				iItemData->Reset();    
+				}
+
+			ResetBuffer();
+			}
+		}
+		else
+		{
+		if(iLastOperation == ENSMLDeleteAllOp)
+	        {
+	        iDeleteAllOperation = NULL;
+	        }
+		if( iChangeFinder )
+			{
+			iChangeFinder->ResetL();		
+			}
+		iSnapshotRegistered = EFalse;
+		
+		delete iContactLnks;
+		iContactLnks = NULL;
+		iContactLink = NULL;
+		
+		delete iContactViewBase;
+		iContactViewBase = NULL;
+		User::RequestComplete( iCallerStatus, KErrNone );	
+		
+		}
+		
+	}
+
+// ---------------------------------------------------------------------------
+// CNSmlContactsDataStore::ContactViewReady
+// Implements the view ready function of MVPbkContactViewObserver
+// --------------------------------------------------------------------------- 
+EXPORT_C void CNSmlContactsDataStore::ContactViewReady(
+                MVPbkContactViewBase& /*aView*/ ) 
+	{
+	if(iLastOperation == ENSMLDeleteAllOp)
+		{
+		TRAPD(error,DoDeleteAllContactsL());
+		if(error != KErrNone)
+			{
+			User::RequestComplete( iCallerStatus, error );
+			}
+		}
+	}
+// ---------------------------------------------------------------------------
+// CNSmlContactsDataStore::PrepareForContactsDeleteL()
+// Delete all the contacts at client
+// ---------------------------------------------------------------------------	
+EXPORT_C void CNSmlContactsDataStore::DoDeleteAllContactsL()
+	{
+	iContactLnks = CVPbkContactLinkArray::NewL();
+	TInt contactCount = iContactViewBase->ContactCountL();
+	//add all the contact links to  ContactLinkArray
+	for( TInt i = 0; i < contactCount; i++ )
+		{
+			const MVPbkViewContact& contact = 
+						iContactViewBase->ContactAtL(i);
+			iContactLink = contact.CreateLinkLC();
+			iContactLnks->AppendL(iContactLink);
+			CleanupStack::Pop();
+		}
+	
+	iDeleteAllOperation = iContactManager->DeleteContactsL( *iContactLnks, *this );
+	
+	}
+
+// ---------------------------------------------------------------------------
+// CNSmlContactsDataStore::ContactViewUnavailable
+// Implements the view unavailable function of MVPbkContactViewObserver
+// --------------------------------------------------------------------------- 
+EXPORT_C void CNSmlContactsDataStore::ContactViewUnavailable(
+                MVPbkContactViewBase& /*aView*/ )  
+	{
+	   
+	}
+
+// ---------------------------------------------------------------------------
+// CNSmlContactsDataStore::ContactAddedToView
+// Implements the add contact function of MVPbkContactViewObserver
+// --------------------------------------------------------------------------- 
+EXPORT_C void CNSmlContactsDataStore::ContactAddedToView(
+            MVPbkContactViewBase& /*aView*/, 
+            TInt /*aIndex*/, 
+            const MVPbkContactLink& /*aContactLink*/ ) 
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// CNSmlContactsDataStore::ContactRemovedFromView
+// Implements the remove contact function of MVPbkContactViewObserver
+// --------------------------------------------------------------------------- 
+EXPORT_C void CNSmlContactsDataStore::ContactRemovedFromView(
+                MVPbkContactViewBase& /*aView*/, 
+                TInt /*aIndex*/, 
+                const MVPbkContactLink& /*aContactLink*/ )  
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// CNSmlContactsDataStore::ContactViewError
+// Implements the view error function of MVPbkContactViewObserver
+// --------------------------------------------------------------------------- 
+EXPORT_C void CNSmlContactsDataStore::ContactViewError(
+            MVPbkContactViewBase& /*aView*/, 
+            TInt /*aError*/, 
+            TBool /*aErrorNotified*/ )  
+	{
+
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataStore::CreateViewL()
+// Create a contact view 
+// -----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::CreateViewL()
+	{
+	
+	CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
+	CleanupStack::PushL( viewDef );
+	viewDef->SetType( EVPbkContactsView );
+
+	viewDef->SetUriL(iStore->StoreProperties().Uri().UriDes());
+
+	 iContactViewBase = iContactManager->CreateContactViewLC( 
+				                         *this, 
+				                         *viewDef, 
+				                         iContactManager->FieldTypes()  );
+	CleanupStack::Pop();
+	CleanupStack::PopAndDestroy(viewDef);	
+	}
 
 // ------------------------------------------------------------------------------------------------
 // CNSmlContactsDataStore::GetStoreFormatResourceFileL
 // ------------------------------------------------------------------------------------------------
-EXPORT_C const TDesC& CNSmlContactsDataStore::GetStoreFormatResourceFileL() const
+EXPORT_C const TDesC& CNSmlContactsDataStore::GetStoreFormatResourceFileL()
     {
-    _DBG_FILE("CNSmlContactsDataStore::GetStoreFormatResourceFileL(): BEGIN");
-
+    _DBG_FILE("CNSmlContactsDataStore::GetStoreFormatResourceFileL(): begin");
+    
     // Check correct Data Sync protocol
     TInt value( EDataSyncNotRunning );
     TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
-                                     KDataSyncStatus,
-                                     value );
-    if ( error == KErrNone && value == EDataSyncRunning )
+        KDataSyncStatus, value );
+    if ( error == KErrNone &&
+         value == EDataSyncRunning )
         {
-        _DBG_FILE("CNSmlContactsDataStore::GetStoreFormatResourceFileL() 1.1.2: END");
         return KNSmlContactsStoreFormatRsc_1_1_2;
         }
     else // error or protocol version 1.2 
         {
-        _DBG_FILE("CNSmlContactsDataStore::GetStoreFormatResourceFileL() 1.2: END");
         return KNSmlContactsStoreFormatRsc_1_2;
         }
-    }
-
-
-// ----------------------------------------------------------------------------
-// CNSmlContactsDataStore::DoExecuteBufferL
-// ----------------------------------------------------------------------------
-EXPORT_C TInt CNSmlContactsDataStore::DoExecuteBufferL(RArray<TInt>& aResultArray)
-    {
-    _DBG_FILE("CNSmlContactsDataStore::DoExecuteBufferL(): begin");
-
-    TBool batchOK = EFalse;
-    TInt  ret( KErrNone );
-    TInt  retCommand( KErrNone );
-    TInt  itemAdds( 0 );
-
-    aResultArray.Reset();
-
-    if( iContactsBufferItemList.Count() == 0 )
-        {
-        return retCommand;
-        }
-
-    TInt i = 0;
-    //
-    // ResultArray initialized
-    //
-    while( i<iContactsBufferItemList.Count() )
-        {
-        if ( iContactsBufferItemList[i]->iModType == ENSmlCntItemAdd &&
-             iContactsBufferItemList[i]->iStatus  == KNSmlNoError )
-            {
-            itemAdds++;
-            }
-        aResultArray.Append( KErrGeneral ); 
-        i++;
-        }
-
-    i = 0;
-    //
-    // Loop through buffered commands
-    //
-    while( i<iContactsBufferItemList.Count() )
-        {       
-        if( iContactsBufferItemList[i]->iStatus!= KNSmlNoError )
-            {
-            retCommand = iContactsBufferItemList[i]->iStatus;
-            }
-        else if( iContactsBufferItemList[i]->iModType == ENSmlCntItemAdd )
-            {
-            ret =0 ;
-            iPUid  = 0;
-
-            StripPropertyL( iItemDataAddBatch, KVersitTokenUID() ); // Remove UID's from data
-
-            TInt err( KErrNone );
-            TTime lastModified;
-            if( iBatchMode )    // All adds handled when first add on iContactsBufferItemList
-                {
-                iAddResultArray.Reset();
-                
-                TRAP( err, ret = LdoAddItemsL( iAddResultArray, iItemDataAddBatch,
-                                               iItemDataAddBatch->Ptr(0).Length(),
-                                               lastModified ) );
-                if( err == KErrNone && ret == KErrNone &&
-                    itemAdds == iAddResultArray.Count() )
-                    {
-                    TInt j = i;
-                    TInt k = 0;
-                    while( j < iContactsBufferItemList.Count() )
-                        {
-                        if( iContactsBufferItemList[j]->iModType == ENSmlCntItemAdd &&
-                            iContactsBufferItemList[j]->iStatus  == KNSmlNoError &&
-                            k < iAddResultArray.Count() )
-                            {
-                            iContactsBufferItemList[j]->iStatus = KErrNone;
-                            *iContactsBufferItemList[j]->iPUid = iAddResultArray[k];
-
-                            TNSmlSnapshotItem item( iAddResultArray[k]);
-                            item.SetLastChangedDate( lastModified );
-                            item.SetSoftDelete( EFalse );
-                            iChangeFinder->ItemAddedL( item );
-                           
-                            k++;
-                            }
-                        j++;
-                        }
-                    }
-                else
-                    {
-                    TInt j = i;
-                    while( j < iContactsBufferItemList.Count() )
-                        {
-                        if( iContactsBufferItemList[j]->iModType == ENSmlCntItemAdd &&
-                            iContactsBufferItemList[j]->iStatus  == KNSmlNoError )
-                            {
-                            iContactsBufferItemList[j]->iStatus = KErrNotSupported;
-                            }
-                        j++;
-                        }
-                    }
-                }
-            else
-                {
-                TTime lastModified;
-                iPUid  =iContactsBufferItemList[i]->iPUid;
-                const TPtr8 dataPtr = iItemDataAddBatch->Ptr(0);
-                TRAP( err, ret = LdoAddItemL(*iPUid, dataPtr,
-                                             iContactsBufferItemList[i]->iSize,
-                                             lastModified));
-                if( (err == KErrNone) && (ret == KErrNone))
-                    {
-                    // Add the snapshot item to the Change Finder.
-                    // The Change finder maintains a list of all changes to the database.
-
-                    TNSmlSnapshotItem item( *iPUid );
-                    item.SetLastChangedDate( lastModified );
-                    item.SetSoftDelete( EFalse );
-
-                    iChangeFinder->ItemAddedL( item );
-                    retCommand = KErrNone;
-                    }
-                else if( err == KErrNone )
-                    {
-                    retCommand = ret;
-                    }
-                else
-                    {
-                    retCommand = err;
-                    }
-                }
-            }
-        else if( iContactsBufferItemList[i]->iModType == ENSmlCntItemReplace  ||
-            iContactsBufferItemList[i]->iModType == ENSmlCntItemFieldLevelReplace )
-            {
-            iItemData = iContactsBufferItemList[i]->iItemData;
-            iUid  = iContactsBufferItemList[i]->iUid;
-            const TPtr8 dataPtr = iItemData->Ptr(0);
-            ret = 0;
-            TTime lastModified;
-           
-            TRAPD( err, ret = LdoUpdateItemL(iUid, dataPtr,
-                                             iContactsBufferItemList[i]->iSize,
-                                             lastModified ));
-            if( (err == KErrNone) && (ret == KErrNone) )
-                {
-                retCommand = KErrNone;
-                iContactsBufferItemList[i]->iStatus = KErrNone;
-
-                TNSmlSnapshotItem item( iUid );
-                item.SetLastChangedDate( lastModified );
-                item.SetSoftDelete( EFalse );
-
-                iChangeFinder->ItemUpdatedL( item );
-                }
-            else if( err == KErrNone )
-                {
-                retCommand = ret;
-                iContactsBufferItemList[i]->iStatus = ret;
-                }
-            else
-                {
-                retCommand = err;
-                iContactsBufferItemList[i]->iStatus = err;
-                }
-            iItemData = NULL;
-            }
-        else if( iContactsBufferItemList[i]->iModType == ENSmlCntItemMove )
-            {
-            retCommand = KErrNotSupported;
-            }
-        else if( iContactsBufferItemList[i]->iModType == ENSmlCntItemDelete ||
-                 iContactsBufferItemList[i]->iModType == ENSmlCntItemSoftDelete )
-            {
-            if( iBatchMode )    // All deletes handled when 1'st occurrence on list
-                {
-                CArrayFixFlat<TUid>* arrDelete = new(ELeave) CArrayFixFlat<TUid>(4);
-                CleanupStack::PushL( arrDelete );
-                TInt j=i;
-                while( j < iContactsBufferItemList.Count() )
-                    {
-                    if( (iContactsBufferItemList[j]->iModType == ENSmlCntItemDelete ||
-                         iContactsBufferItemList[j]->iModType == ENSmlCntItemSoftDelete) &&
-                         iContactsBufferItemList[j]->iStatus  == KNSmlNoError )
-                        {
-                        TUid id = TUid::Uid( iContactsBufferItemList[j]->iUid ); 
-                        CNsmlContactItem* contactitem = CNsmlContactItem::NewL();
-                        CleanupStack::PushL( contactitem );
-                        TInt err = KErrNone;
-                        TInt ret = KErrNone;
-                        TRAP( err, ret = iContactsDataStoreExtension->ReadContactL( id, contactitem ) ); 
-                        if( err == KErrNone && ret == KErrNone && id.iUid != 0 )
-                            {
-                            arrDelete->AppendL( id );
-                            }
-                        else if( err == KErrNone && ret == KErrNone )
-                            {
-                            iContactsBufferItemList[j]->iStatus  = KErrNotFound;
-                            }
-                        else
-                            {
-                            iContactsBufferItemList[j]->iStatus  = err;
-                            }
-                        CleanupStack::PopAndDestroy( contactitem ); // item
-                        }
-                    j++;
-                    }
-                if( arrDelete->Count() > 0 )
-                    {
-                    TInt err2 = KErrInUse;
-                    TRAP( err2, iContactsDataStoreExtension->DeleteContactsL( arrDelete ) );
-                    CleanupStack::PopAndDestroy( arrDelete );
-
-                    if( err2 == KErrInUse )
-                        {
-                        err2 = KErrGeneral;
-                        }
-
-                    j= i;
-                    while( j < iContactsBufferItemList.Count() ) // Mark deleted items
-                        {
-                        if( iContactsBufferItemList[j]->iModType == ENSmlCntItemDelete &&
-                            iContactsBufferItemList[j]->iStatus  == KNSmlNoError )
-                            {
-
-                            iContactsBufferItemList[j]->iStatus  = err2;
-                            if( err2 == KErrNone )
-                                {
-                                iUid  = iContactsBufferItemList[j]->iUid;
-                                iChangeFinder->ItemDeleted( TNSmlSnapshotItem( iUid ));
-                                }
-                            }
-                        else if( iContactsBufferItemList[j]->iModType == ENSmlCntItemSoftDelete &&
-                                 iContactsBufferItemList[j]->iStatus  == KNSmlNoError )
-                            {
-
-                            iContactsBufferItemList[j]->iStatus  = err2;
-                            if( err2 == KErrNone )
-                                {
-                                iUid  = iContactsBufferItemList[j]->iUid;
-                                iChangeFinder->ItemSoftDeletedL( TNSmlSnapshotItem( iUid ) );
-                                }
-                            }
-                        j++;
-                        }
-                    }
-                else
-                    {
-                    CleanupStack::PopAndDestroy( arrDelete );
-                    }
-                }
-            else
-                {
-                iUid  = iContactsBufferItemList[i]->iUid;
-                TInt err = KErrNone;
-                TRAP( err, iContactsDataStoreExtension->DeleteContactL( TUid::Uid( iUid ) ) );
-                if( err == KErrNone )
-                    {
-                    iChangeFinder->ItemDeleted( TNSmlSnapshotItem( iUid ) );
-                    }
-
-                iContactsBufferItemList[i]->iStatus  = err;
-                retCommand = err;
-                }
-            }
-        //
-        //  Set allready set commands from iContactsBufferItemList
-        //
-        if( ( iContactsBufferItemList[i]->iModType == ENSmlCntItemAdd     ||
-              iContactsBufferItemList[i]->iModType == ENSmlCntItemReplace ||
-              iContactsBufferItemList[i]->iModType == ENSmlCntItemFieldLevelReplace ||
-              iContactsBufferItemList[i]->iModType == ENSmlCntItemDelete  ||
-              iContactsBufferItemList[i]->iModType == ENSmlCntItemSoftDelete ) &&
-              iContactsBufferItemList[i]->iStatus  != KNSmlNoError )
-            {
-            retCommand = iContactsBufferItemList[i]->iStatus;
-            }
-
-        
-        if( !batchOK && retCommand == KErrNone ) // If one command is OK => batchOK
-            {
-            batchOK = ETrue;
-            }
-
-        aResultArray[i++] = retCommand;
-        }
-
-    if ( batchOK )
-        {
-        _DBG_FILE("CNSmlContactsDataStore::DoExecuteBufferL(): end");
-        return KErrNone;
-        }
-
-    _DBG_FILE("CNSmlContactsDataStore::DoExecuteBufferL(): ERROR end");
-    return KErrGeneral; // All commands failed    
+    _DBG_FILE("CNSmlContactsDataStore::GetStoreFormatResourceFileL(): end");
     }
 
 // ------------------------------------------------------------------------------------------------
-// CNSmlContactsDataStore::FetchModificationsL
+// CNSmlContactsDataStore::CreateModsFetcherL
 // ------------------------------------------------------------------------------------------------
-//
-TInt CNSmlContactsDataStore::FetchModificationsL()
+EXPORT_C MContactsModsFetcher* CNSmlContactsDataStore::CreateModsFetcherL()
     {
-    _DBG_FILE("CNSmlContactsDataStore::FetchModificationsL(): begin");
-  
-    TInt error = KErrNone;
-    
-    if( !iSnapshot )
-        {
-        iSnapshot = new (ELeave) CArrayFixSeg<TNSmlSnapshotItem>( KNSmlContactsGranularity );
-        }
-    
-    iCntUidList->Reset();
-    iContactsDataStoreExtension->ListContactsL( iCntUidList );
-    
-    if( !iSnapshotRegistered )
-        {
-        DBG_ARGS(_S("CNSmlContactsDataStore::FetchModificationsL(): Count = %d"), iCntUidList->Count());
-        for ( TInt i = 0; i < iCntUidList->Count(); i++ )
-            {
-            CNsmlContactItem* contactitem = CNsmlContactItem::NewL();
-            CleanupStack::PushL( contactitem );
-            error = iContactsDataStoreExtension->ReadContactL( iCntUidList->At(i), contactitem ); 
-            if(error != KErrNone)
-                {
-                DBG_ARGS(_S("CNSmlContactsDataStore::FetchModificationsL(): Error = %d"), error);
-                CleanupStack::PopAndDestroy(contactitem); // item
-                return error;
-                }           
-            TNSmlSnapshotItem snap( iCntUidList->At(i).iUid  );
-            snap.SetLastChangedDate( contactitem->iLastModified );
-            iSnapshot->InsertIsqL( snap, iKey );       
-                
-            CleanupStack::PopAndDestroy(contactitem); // item
-            }
-        iSnapshot->Compress();
-          
-        iChangeFinder->SetNewSnapshot( iSnapshot ); // changefinder takes ownership
-        iSnapshot = NULL;
-        iSnapshotRegistered = ETrue;
-        }
-    
-    _DBG_FILE("CNSmlContactsDataStore::FetchModificationsL(): end");
-    return KErrNone;
+    _DBG_FILE("CNSmlContactsDataStore::CreateModsFetcherL(): begin");
+    CNSmlContactsModsFetcher* modsFetcher = 
+        new ( ELeave ) CNSmlContactsModsFetcher( iSnapshotRegistered, 
+        *iContactManager,*iStore, iKey, *iChangeFinder );
+    CleanupStack::PushL( modsFetcher );
+    modsFetcher->ConstructL();
+    CleanupStack::Pop( modsFetcher );
+    _DBG_FILE("CNSmlContactsDataStore::CreateModsFetcherL(): end");
+    return modsFetcher;
     }
 
-// ----------------------------------------------------------------------------»
+// ------------------------------------------------------------------------------------------------
 // CNSmlContactsDataStore::GetDataMod
-// return reference to datamod instance.
-// ----------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
 EXPORT_C CNSmlDataModBase& CNSmlContactsDataStore::GetDataMod()
     {
+    _DBG_FILE("CNSmlContactsDataStore::GetDataMod()");
     return *iDataMod;
     }
 
-// ----------------------------------------------------------------------------
-// CNSmlContactsDataStore::ExportContactsL
-// ----------------------------------------------------------------------------
-EXPORT_C TInt CNSmlContactsDataStore::ExportContactsL( 
-    const TUid& aUid, CBufBase& aContactBufBase )
-    {
-    return iContactsDataStoreExtension->ExportContactsL( aUid, aContactBufBase ); 
-    }
-
-// ----------------------------------------------------------------------------
-// CNSmlContactsDataStore::ImportContactsL
-// ----------------------------------------------------------------------------
-EXPORT_C CArrayFixFlat<TUid>* CNSmlContactsDataStore::ImportContactsL( 
-    const TDesC8& aContactBufBase )
-    {
-    return iContactsDataStoreExtension->ImportContactsL( aContactBufBase ); 
-    }
-
 // End of File  
--- a/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStoreFormat_1_1_2.rss	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStoreFormat_1_1_2.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -15,6 +15,7 @@
 *
 */
 
+
 #include "SmlDataFormat.rh"
 #include "SmlDataFormat.hrh"
 
@@ -85,18 +86,6 @@
 				SML_DATA_PROPERTY
 					{
 					version=1;
-					display_name="Uid";
-					name="UID";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
 					display_name="Name";
 					name="N";
 					data_type="";
@@ -199,6 +188,14 @@
 						SML_DATA_PROPERTY_PARAM
 							{
 							version=1;
+							display_name="Default number";
+							name="PREF";
+							data_type="";
+							enum_values={};
+							},	
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
 							display_name="Car telephone";
 							name="CAR";
 							data_type="";
@@ -233,6 +230,14 @@
 						SML_DATA_PROPERTY_PARAM
 							{
 							version=1;
+							display_name="";
+							name="INTERNET";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
 							display_name="Home email";
 							name="HOME";
 							data_type="";
@@ -316,7 +321,7 @@
 					data_type="";
 					enum_values={};
 					flags= 0;
-					max_size=256;
+					max_size=1000;
 					max_occur=0;
 					params={};
 					},
@@ -383,6 +388,19 @@
 				SML_DATA_PROPERTY
 					{
 					version=1;
+					display_name="Wireless Village Id";
+					name="X-WV-ID";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+					
+				SML_DATA_PROPERTY
+					{
+					version=1;
 					display_name="Assistant name";
 					name="X-ASSISTANT";
 					data_type="";
@@ -458,6 +476,104 @@
 				SML_DATA_PROPERTY
 					{
 					version=1;
+					display_name="Class";
+					name="X-CLASS";
+					data_type="";
+					enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="IMPP";
+					name="X-IMPP";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="PERSONAL";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="HOME";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="WORK";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="BUSINESS";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="MOBILE";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name=""; 
+							name="PREF";
+							data_type="";
+							enum_values={};
+							}
+						};
+					},
+					SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Top contact";
+					name="X-FAVORITE";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				      SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="My Card";
+					name="X-SELF";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
 					display_name="SIP protocol";
 					name="X-SIP";
 					data_type="";
@@ -470,6 +586,14 @@
 						SML_DATA_PROPERTY_PARAM
 							{
 							version=1;
+							display_name="POC";
+							name="POC";
+							data_type="";
+							enum_values={};
+							},
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
 							display_name="SWIS";
 							name="SWIS";
 							data_type="";
@@ -484,7 +608,19 @@
 							enum_values={};
 							}
 						};
-					}
+					},
+                    SML_DATA_PROPERTY
+                              {
+                              version=1;
+                              display_name="Categories";
+                              name="X-CATEGORIES";
+                              data_type="";
+                              enum_values={};
+                              flags= 0;
+                              max_size=256;
+                              max_occur=0;
+                              params={};
+                              }
 				};
 				field_level=0;
 				}
--- a/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStoreFormat_1_2.rss	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStoreFormat_1_2.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -15,6 +15,7 @@
 *
 */
 
+
 #include "SmlDataFormat.rh"
 #include "SmlDataFormat.hrh"
 
@@ -85,18 +86,6 @@
 				SML_DATA_PROPERTY
 					{
 					version=1;
-					display_name="Uid";
-					name="UID";
-					data_type="";
-					enum_values={};
-					flags=0;
-					max_size=256;
-					max_occur=0;
-					params={};
-					},
-				SML_DATA_PROPERTY
-					{
-					version=1;
 					display_name="Name";
 					name="N";
 					data_type="";
@@ -146,7 +135,7 @@
 							display_name="Type";
 							name="TYPE";
 							data_type="";
-							enum_values={"HOME", "WORK", "CELL", "PAGER", "FAX", "VIDEO", "CAR"};
+							enum_values={"HOME", "WORK", "VOICE", "CELL", "PAGER", "FAX", "VIDEO", "PREF", "CAR"};
 							}
 						};
 					},
@@ -180,7 +169,7 @@
 							display_name="Type";
 							name="TYPE";
 							data_type="";
-							enum_values={"HOME", "WORK"};
+							enum_values={"INTERNET", "HOME", "WORK", "PREF"};
 							}
 						};
 					},
@@ -224,7 +213,7 @@
 							display_name="Type";
 							name="TYPE";
 							data_type="";
-							enum_values={"HOME", "WORK"};
+							enum_values={"HOME", "WORK", "PREF"};
 							}
 						};
 					},
@@ -236,7 +225,7 @@
 					data_type="";
 					enum_values={};
 					flags= 0;
-					max_size=256;
+					max_size=1000;
 					max_occur=0;
 					params={};
 					},
@@ -303,6 +292,18 @@
 				SML_DATA_PROPERTY
 					{
 					version=1;
+					display_name="Wireless Village Id";
+					name="X-WV-ID";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
 					display_name="Assistant name";
 					name="X-ASSISTANT";
 					data_type="";
@@ -375,6 +376,65 @@
 				SML_DATA_PROPERTY
 					{
 					version=1;
+					display_name="Class";
+					name="X-CLASS";
+					data_type="";
+					enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="IMPP";
+					name="X-IMPP";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params=
+						{
+						SML_DATA_PROPERTY_PARAM
+							{
+							version=1;
+							display_name="Type";
+							name="TYPE";
+							data_type="";
+							enum_values={"PERSONAL", "HOME", "WORK","BUSINESS", "MOBILE", "PREF"};
+							}
+						};
+					},	
+					SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Top Contact";
+					name="X-FAVORITE";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+					
+					SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="My Card";
+					name="X-SELF";
+					data_type="";
+					enum_values={};
+					flags= 0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
 					display_name="SIP protocol";
 					name="X-SIP";
 					data_type="";
@@ -390,10 +450,22 @@
 							display_name="Type";
 							name="TYPE";
 							data_type="";
-							enum_values={"SWIS", "VOIP"};
+							enum_values={"POC", "SWIS", "VOIP", "WORK", "HOME"};
 							}
 						};
-					}
+					},
+	                   SML_DATA_PROPERTY
+	                        {
+	                        version=1;
+	                        display_name="Categories";
+	                        name="X-CATEGORIES";
+	                        data_type="";
+	                        enum_values={};
+	                        flags= 0;
+	                        max_size=256;
+	                        max_occur=0;
+	                        params={};
+	                        }
 				};
 				field_level=0;
 				}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsModsFetcher.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,412 @@
+/*
+* Copyright (c) 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:  DS contacts adapters 
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <s32strm.h>
+#include <cntdb.h>
+#include <e32cmn.h>
+#include <e32des16.h>
+#include <cntitem.h>
+#include <cntfield.h>
+#include <cntfldst.h>
+
+#include "nsmlcontactsdefs.h"
+#include "NSmlContactsModsFetcher.h"
+#include "nsmldebug.h"
+#include "nsmlsnapshotitem.h"
+#include "nsmlchangefinder.h"
+
+#include <CVPbkContactViewDefinition.h>
+#include <CVPbkContactIdConverter.h>
+#include <CVPbkContactFieldIterator.h>
+#include <MVPbkContactStoreProperties.h>
+#include <MVPbkStoreContactProperties.h>
+#include <MVPbkViewContact.h>
+#include <MVPbkFieldType.h>
+#include <MVPbkContactFieldTextData.h>
+#include <MVPbkStoreContact.h>
+#include <MVPbkStoreContact2.h>
+#include <MVPbkContactLink.h>
+#include <VPbkEng.rsg>
+
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::CNSmlContactsModsFetcher
+// ------------------------------------------------------------------------------------------------
+//
+CNSmlContactsModsFetcher::CNSmlContactsModsFetcher( TBool& aSnapshotRegistered,CVPbkContactManager& aContactManager,MVPbkContactStore& aStore,TKeyArrayFix& aKey, CNSmlChangeFinder& aChangeFinder ) :
+	CActive( EPriorityLow ), 
+	iSnapshotRegistered( aSnapshotRegistered ), 
+	iKey( aKey ), 
+	iChangeFinder( aChangeFinder ),
+	iContactManager(aContactManager) ,
+	iStore(aStore) ,
+	iContactViewBase(NULL)
+	{
+	_DBG_FILE("CNSmlContactsModsFetcher::CNSmlContactsModsFetcher(): begin");
+	CActiveScheduler::Add( this );
+	_DBG_FILE("CNSmlContactsModsFetcher::CNSmlContactsModsFetcher(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::~CNSmlContactsModsFetcher
+// ------------------------------------------------------------------------------------------------
+//
+CNSmlContactsModsFetcher::~CNSmlContactsModsFetcher()
+	{
+	_DBG_FILE("CNSmlContactsModsFetcher::~CNSmlContactsModsFetcher(): begin");
+	
+	Cancel();	
+	delete iSnapshot;
+	delete iContactViewBase;
+	
+	
+	_DBG_FILE("CNSmlContactsModsFetcher::~CNSmlContactsModsFetcher(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::CancelRequest
+// ----------------------------------------------------------------------------
+void CNSmlContactsModsFetcher::CancelRequest()
+     {
+     Cancel();
+     }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::FetchModificationsL
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlContactsModsFetcher::FetchModificationsL( TRequestStatus& aStatus )
+	{
+	_DBG_FILE("CNSmlContactsModsFetcher::FetchModificationsL(): begin");
+	
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	iContactCount = 0;
+	if( !iSnapshot )
+		{
+		iSnapshot = new (ELeave) CArrayFixSeg<TNSmlSnapshotItem>( KNSmlSnapshotSize );
+		}
+		
+	if(iContactViewBase)
+	{
+	delete iContactViewBase;
+	iContactViewBase = NULL;	
+	}
+	
+	CreateViewL();
+	
+	_DBG_FILE("CNSmlContactsModsFetcher::FetchModificationsL(): end");
+	
+	}
+	
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::ConstructL
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlContactsModsFetcher::ConstructL()
+	{
+	iSnapshot = new (ELeave) CArrayFixSeg<TNSmlSnapshotItem>(KNSmlSnapshotSmallSize);
+	
+	}
+	
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::RunL
+// ------------------------------------------------------------------------------------------------	
+//
+void CNSmlContactsModsFetcher::RunL()
+	{
+	_DBG_FILE("CNSmlContactsModsFetcher::RunL(): begin");
+	
+	if ( !iSnapshotRegistered )
+		{
+		FetchNextContactL();
+		}
+#ifdef __NSML_MODULETEST__
+	else
+		{
+		CActiveScheduler::Stop();
+		}
+#endif
+	
+	_DBG_FILE("CNSmlContactsModsFetcher::RunL(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::FetchNextContactL
+// ------------------------------------------------------------------------------------------------	
+//
+void CNSmlContactsModsFetcher::FetchNextContactL()
+	{
+	_DBG_FILE("CNSmlContactsModsFetcher::FetchNextContactL(): begin");
+	if(iContactViewBase->ContactCountL() == 0)
+		{
+		User::RequestComplete( iCallerStatus, KErrNone );
+		return;	
+		}
+	if ( !iSnapshotRegistered )
+		{
+		const MVPbkViewContact& contact = iContactViewBase->ContactAtL(iContactCount);
+
+		MVPbkContactLink* contactLink = contact.CreateLinkLC();
+		iContactManager.RetrieveContactL( *contactLink, *this );
+		CleanupStack::PopAndDestroy();	
+		}
+
+	_DBG_FILE("CNSmlContactsModsFetcher::FetchNextContactL(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::DoCancel
+// ------------------------------------------------------------------------------------------------	
+//
+void CNSmlContactsModsFetcher::DoCancel()
+	{
+	_DBG_FILE("CNSmlContactsModsFetcher::DoCancel(): begin");
+
+	User::RequestComplete( iCallerStatus, KErrCancel );
+	
+	_DBG_FILE("CNSmlContactsModsFetcher::DoCancel(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::IsConfidentialL
+// ----------------------------------------------------------------------------
+//	
+TBool CNSmlContactsModsFetcher::IsConfidentialL( MVPbkStoreContact& aItem )
+    {
+    _DBG_FILE("CNSmlContactsModsFetcher::IsConfidentialL(): begin");
+    TBool ret( EFalse );
+    
+    //find X-CLASS field type
+	const MVPbkFieldType* syncclass = 
+        iContactManager.FieldTypes().Find(R_VPBK_FIELD_TYPE_SYNCCLASS );
+	CVPbkBaseContactFieldTypeIterator* itr = 
+        CVPbkBaseContactFieldTypeIterator::NewLC( *syncclass, 
+            aItem.Fields() );
+	while ( itr->HasNext() )
+        {
+        const MVPbkBaseContactField* field = itr->Next();
+        const MVPbkContactFieldTextData& data = 
+        	MVPbkContactFieldTextData::Cast(field->FieldData());
+        TPtrC ptr = data.Text();
+        //compare the sync type
+        if ( ptr.Compare( KNSmlContactSyncNoSync ) == 0 )
+            {
+            _DBG_FILE("CNSmlContactsModsFetcher::IsConfidentialL(): \
+                       find confidential");
+            ret = ETrue;
+            }
+         
+        }
+	CleanupStack::PopAndDestroy( itr );
+    
+    _DBG_FILE("CNSmlContactsModsFetcher::IsConfidentialL(): end");
+    return ret;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::RunError
+// ----------------------------------------------------------------------------
+ TInt CNSmlContactsModsFetcher::RunError( TInt aError )
+	{
+	DBG_FILE_CODE(aError, _S8("CNSmlContactsModsFetcher::RunError() : error code received "));
+	User::RequestComplete( iCallerStatus, aError );
+	return KErrNone;
+	}
+	
+// -----------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::CreateViewL()
+// Create a contact view of the store which is opened
+// -----------------------------------------------------------------------------
+ 
+void CNSmlContactsModsFetcher::CreateViewL()
+	{
+	CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
+	CleanupStack::PushL( viewDef );
+	viewDef->SetType( EVPbkContactsView );
+
+	viewDef->SetUriL(iStore.StoreProperties().Uri().UriDes());
+
+	 iContactViewBase = iContactManager.CreateContactViewLC( 
+				                         *this, 
+				                         *viewDef, 
+				                         iContactManager.FieldTypes()  );
+	CleanupStack::Pop();
+	CleanupStack::PopAndDestroy(viewDef);
+
+	}
+// ---------------------------------------------------------------------------
+//  CNSmlContactsModsFetcher::UpdateSnapshotL
+//  Add the fetched contacts id and timestamp 
+//  to the snapshot.
+// ---------------------------------------------------------------------------
+//
+ 
+ void CNSmlContactsModsFetcher::UpdateSnapshotL(MVPbkStoreContact* aContact)
+{
+	if(!IsConfidentialL(*aContact))
+		{
+		CVPbkContactIdConverter* idConverter = CVPbkContactIdConverter::NewL(iStore );
+		CleanupStack::PushL( idConverter );
+
+		TInt32 id = idConverter->LinkToIdentifier(
+			*iContactViewBase->ContactAtL(iContactCount).CreateLinkLC());
+		TNSmlSnapshotItem snap( id);
+		
+		MVPbkStoreContact2* tempContact = 
+		reinterpret_cast<MVPbkStoreContact2*> (aContact->StoreContactExtension (KMVPbkStoreContactExtension2Uid));  
+              
+		MVPbkStoreContactProperties *contactProterties 
+									= tempContact ->PropertiesL();
+		CleanupDeletePushL(contactProterties);				
+		snap.SetLastChangedDate(contactProterties->LastModifiedL());
+		CleanupStack::PopAndDestroy();
+				
+		iSnapshot->InsertIsqL( snap, iKey );
+		iCurrentSnapshotCounter++;
+		if ( iCurrentSnapshotCounter > 20 )
+			{
+			iSnapshot->Compress();
+			iCurrentSnapshotCounter = 0;
+			}
+		CleanupStack::PopAndDestroy();
+		CleanupStack::PopAndDestroy(idConverter);	
+		}
+	
+	iContactCount++;
+	
+	if ( iContactCount == iContactViewBase->ContactCountL() )
+		{
+		iChangeFinder.SetNewSnapshot( iSnapshot ); // changefinder takes ownership
+		iSnapshot = NULL;
+		iSnapshotRegistered = ETrue;
+		User::RequestComplete( iCallerStatus, KErrNone );
+		}
+
+}	
+// ---------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::ContactViewReady
+// Implements the view ready function of MVPbkContactViewObserver
+// --------------------------------------------------------------------------- 
+void CNSmlContactsModsFetcher::ContactViewReady(
+                MVPbkContactViewBase& /*aView*/ ) 
+	{
+    _DBG_FILE("CNSmlContactsModsFetcher::ContactViewReady(): begin");
+	
+	SetActive();
+	TRequestStatus* status = &iStatus;
+	User::RequestComplete( status, KErrNone );	
+	
+	_DBG_FILE("CNSmlContactsModsFetcher::ContactViewReady(): end");
+	}
+
+// ---------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::ContactViewUnavailable
+// Implements the view unavailable function of MVPbkContactViewObserver
+// --------------------------------------------------------------------------- 
+void CNSmlContactsModsFetcher::ContactViewUnavailable(
+                MVPbkContactViewBase& /*aView*/ )  
+{
+   
+
+}
+
+// ---------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::ContactAddedToView
+// Implements the add contact function of MVPbkContactViewObserver
+// --------------------------------------------------------------------------- 
+void CNSmlContactsModsFetcher::ContactAddedToView(
+            MVPbkContactViewBase& /*aView*/, 
+            TInt /*aIndex*/, 
+            const MVPbkContactLink& /*aContactLink*/ ) 
+{
+}
+
+// ---------------------------------------------------------------------------
+// Implements the remove contact function of MVPbkContactViewObserver
+// --------------------------------------------------------------------------- 
+void CNSmlContactsModsFetcher::ContactRemovedFromView(
+                MVPbkContactViewBase& /*aView*/, 
+                TInt /*aIndex*/, 
+                const MVPbkContactLink& /*aContactLink*/ )  
+{
+}
+
+// ---------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::ContactViewError
+// Implements the view error function of MVPbkContactViewObserver
+// --------------------------------------------------------------------------- 
+void CNSmlContactsModsFetcher::ContactViewError(
+            MVPbkContactViewBase& /*aView*/, 
+            TInt aError, 
+            TBool /*aErrorNotified*/ )  
+{
+User::RequestComplete( iCallerStatus, aError );
+}
+
+// ---------------------------------------------------------------------------
+//  CNSmlContactsModsFetcher::VPbkSingleContactOperationComplete
+//  Called when the contact operation is completed.
+// ---------------------------------------------------------------------------
+//
+ void CNSmlContactsModsFetcher::VPbkSingleContactOperationComplete(
+		MVPbkContactOperationBase& aOperation,
+		MVPbkStoreContact* aContact )
+{
+	MVPbkContactOperationBase* operation = &aOperation;
+	if ( operation )
+	{
+		delete operation;
+		operation = NULL;
+	}
+	
+	TRAPD(error,UpdateSnapshotL(aContact));
+	delete aContact;
+	if(error!= KErrNone)
+	{
+	User::RequestComplete( iCallerStatus, error );	
+	}
+	else
+	{
+	SetActive();
+	TRequestStatus* status = &iStatus;
+	User::RequestComplete( status, KErrNone );		
+	}
+	
+}
+
+// ---------------------------------------------------------------------------
+//  CNSmlContactsModsFetcher::VPbkSingleContactOperationFailed
+//  Called when the contact operation fails
+// ---------------------------------------------------------------------------
+//
+void CNSmlContactsModsFetcher::VPbkSingleContactOperationFailed(
+		MVPbkContactOperationBase& aOperation,
+		 TInt /*aError*/ )
+ {
+ 	MVPbkContactOperationBase* operation = &aOperation;
+	if ( operation )
+	{
+		delete operation;
+		operation = NULL;
+	}
+ }
+// End of File  
Binary file omads/omadsextensions/adapters/contactsgroup/group/101ff972.xml has changed
--- a/omads/omadsextensions/adapters/contactsgroup/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  bld file for Contacts Group DS adapter
-*
-*/
-
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-./101ff972.xml              Z:/private/101f99f6/capability/101ff972.xml
-./contactsgrpdsa_stub.sis   /epoc32/data/z/system/install/contactsgrpdsa_stub.sis
-../rom/contactsgrpdsa.iby   CORE_APP_LAYER_IBY_EXPORT_PATH(contactsgrpdsa.iby)
-
-PRJ_MMPFILES
-./contactsgrpdataprovider.mmp
-
--- a/omads/omadsextensions/adapters/contactsgroup/group/contactsgrpdataprovider.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Project definition file for project Contacts Group DS adapter
-*
-*/
-
-
-#include <platform_paths.hrh>
-#include <defaultcaps.hrh>
-#include <data_caging_paths.hrh>
-
-TARGET          contactsgrpdataprovider.dll
-TARGETTYPE      PLUGIN
-UID             0x10009d8d 0x101FF972
-
-CAPABILITY      CAP_ECOM_PLUGIN
-VENDORID        VID_DEFAULT
-
-SOURCEPATH      ..\src
-SOURCE          contactsgrpdataprovider.cpp
-SOURCE          contactsgrpdatastore.cpp
-SOURCE          contactsgrpconverter.cpp
-SOURCE          changefinder.cpp
-SOURCE          snapshotitem.cpp
-
-USERINCLUDE     ..\inc
-
-APP_LAYER_SYSTEMINCLUDE
-
-SOURCEPATH      ..\src
-
-START RESOURCE  contactsgrpdataprovider.rss
-HEADER
-TARGET          contactsgrpdataprovider.rsc
-TARGETPATH      ECOM_RESOURCE_DIR
-END
-
-START RESOURCE  contactsgrpdatastore.rss
-HEADER
-TARGET          contactsgrpdatastore.rsc  
-TARGETPATH      RESOURCE_FILES_DIR
-END
-
-
-DEBUGLIBRARY    flogger.lib
-LIBRARY         euser.lib
-LIBRARY         estor.lib
-LIBRARY         ecom.lib
-LIBRARY         smldataprovider.lib
-LIBRARY         bafl.lib
-LIBRARY         nsmlchangefinder.lib
-LIBRARY         efsrv.lib
-LIBRARY         smlstoreformat.lib
-LIBRARY         SenXml.lib 
-LIBRARY         charconv.lib 
-LIBRARY         sysutil.lib
-LIBRARY         hash.lib
-LIBRARY         cntmodel.lib
-LIBRARY         vcard.lib
-LIBRARY         versit.lib
--- a/omads/omadsextensions/adapters/contactsgroup/group/contactsgrpdsa_stub.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-;
-; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: 
-;
-; Languages
-&EN
-
-; Header
-#{"Contacts Group DS Plugin"},(0x101FF972),1,23,0, TYPE=SA
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Files to install
-""-"z:\resource\contactsgrpdatastore.rsc"
-""-"z:\resource\plugins\contactsgrpdataprovider.rsc"
-""-"z:\sys\bin\contactsgrpdataprovider.dll"
Binary file omads/omadsextensions/adapters/contactsgroup/group/contactsgrpdsa_stub.sis has changed
--- a/omads/omadsextensions/adapters/contactsgroup/group/createstub.bat	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-rem
-rem Copyright (c) 2010 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: Batch file for creating needed stub files.
-rem
-
-makesis -s contactsgrpdsa_stub.pkg
\ No newline at end of file
--- a/omads/omadsextensions/adapters/contactsgroup/inc/changefinder.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Part of ContactGroup DS adapter
-*
-*/
-
-
-#ifndef __CHANGEFINDER_H__
-#define __CHANGEFINDER_H__
-
-// INCLUDES
-#include <nsmlchangefinder.h>
-#include "snapshotitem.h"
-
-// DATATYPES
-typedef CArrayFixSeg<TSnapshotItem> CSnapshotArray;
-
-// Granularity used with dynamic array
-const TInt KSnapshotGranularity = 32;
-// CLASS DECLARATION
-
-/**
-* @brief CChangeFinder Class
-* This is a ChangeFinder class, which can be used to track down changes in the contacts group store.
-* It's functionality is equal to CSmlChangeFinder. Because neither of these classes contained virtual
-* functionality, the functionality of this class couldn't be inherited from the CSmlChangeFinder
-*/
-class CChangeFinder : public CBase
-	{ 
-public:
-	
-	/**
-    * Class constructor, Creates a new class instance.
-    *
-    * @param aSyncRelationship  IN: Reference to MSmlSyncRelationship interface.
-    * @param aKey               IN: Key that is used in sorting snapshot.
-    * @param aStreamUid         IN: Snapshot stream UID.
-    * @return CChangeFinder*, New ChangeFinder instance.
-    */
-    static CChangeFinder* NewL( MSmlSyncRelationship& aSyncRelationship, 
-                               TKeyArrayFix aKey,
-                               TBool& aHasHistory, 
-                               TInt aStreamUid = KNSmlDefaultSnapshotStreamUID );
-
-    /**
-    * Class destructor.
-    */
-	~CChangeFinder();
-	
-    /**
-    * Close ChangeFinder object, stores snapshot.
-    */
-	void CloseL();
-
-    /**
-    * Reset change information, makes all content new from ChangeFinder point of view.
-    */
-	void ResetL();
-
-    /**
-    * Find changed items by comparing snapshots.
-    * 
-    * @param aChangedUids   IN: Array for results.
-    */
-	void FindChangedItemsL( CNSmlDataItemUidSet& aChangedUids );
-
-    /**
-    * Find deleteed items by comparing snapshots.
-    * 
-    * @param aDeletedUids   IN: Array for results.
-    */
-	void FindDeletedItemsL( CNSmlDataItemUidSet& aDeletedUids );
-	
-    /**
-    * Find new items by comparing snapshots.
-    * 
-    * @param aNewUids   IN: Array for results.
-    */	
-	void FindNewItemsL(CNSmlDataItemUidSet& aNewUids);
-	
-    /**
-    * Add item to snapshot, it is no loger reported.
-    * 
-    * @param aItem   IN: item to add.
-    */
-	void ItemAddedL( const TSnapshotItem& aItem );
-
-    /**
-    * Delete item from snapshot, it is no loger reported.
-    * 
-    * @param aItem   IN: item to delete.
-    */
-	void ItemDeleted( const TSnapshotItem& aItem );
-	
-    /**
-    * Update item to snapshot, it is no loger reported.
-    * 
-    * @param aItem   IN: item to update.
-    */
-	void ItemUpdatedL( const TSnapshotItem& aItem );
-	
-    /**
-    * Commit all changes to snapshot, there's nothing to report anymore.
-    */
-	void CommitChangesL();
-
-    /**
-    * Commit a set of items to snapshot, these items won't be reported anymore.
-    * 
-    * @param aUids   IN: a set of items to commit.
-    */
-	void CommitChangesL( const MSmlDataItemUidSet& aUids );
-	
-	/**
-    * Sets new snapshot to compare against.
-    * 
-    * @param aNewSnapshot   IN: a new snapshot.
-    */
-	void SetNewSnapshot( CSnapshotArray* aNewSnapshot );
-	
-protected:
-	
-    /**
-    * C++ Constructor
-    *
-    * @param aSyncRelationship  IN: Reference to MSmlSyncRelationship interface.
-    * @param aKey               IN: Key that is used in sorting snapshot.
-    * @param aStreamUid         IN: Snapshot stream UID.
-    */    
-	CChangeFinder( MSmlSyncRelationship& aSyncRelationship, 
-	              TKeyArrayFix aKey, 
-	              TInt aStreamUid );
-    
-    /**
-    * 2nd-phase Constructor
-    *
-    * @param aHasHistory   IN: ETrue, if there was synchronization history.
-    */    
-    void ConstructL( TBool& aHasHistory );
-
-private:
-
-    /**
-    * Allows access to streams.
-    */
-	MSmlSyncRelationship& iSyncRelationship;
-	
-    /**
-    * New snapshot to compare against.
-    */	
-	CSnapshotArray* iCurrentSnapshot;
-
-    /**
-    * Current snapshot.
-    */
-	CSnapshotArray* iOldSnapshot;
-	
-    /**
-    * Key that is used in sorting snapshot.
-    */
-	TKeyArrayFix iKey;
-	
-    /**
-    * Stream id number to access sync relationship.
-    */	
-	TInt iStreamUid;
-	
-    };
-
-#endif // __CHANGEFINDER_H__
--- a/omads/omadsextensions/adapters/contactsgroup/inc/contactsgrpconverter.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +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:  Group vCard object conversion routines
-*
-*/
-
-
-#ifndef __CONTACTSGRPCONVERTER_H__
-#define __CONTACTSGRPCONVERTER_H__
-
-#include <e32base.h>
-
-#include <cntitem.h>
-
-class CContactIdArray;
-
-/* @brief CContactsGrpConverter Class
- * This class is used to convert Contact Group items to vCard presentation and vice versa.
- */
-
-NONSHARABLE_CLASS( CContactsGrpConverter ): public CBase
-	{
-public:
-
-	static CContactsGrpConverter* NewL();
-	static CContactsGrpConverter* NewLC();
-	~CContactsGrpConverter();
-
-	// returns group label
-	const TDesC& GroupLabel() const;
-	// returns contact items beloging to group
-	const CContactIdArray& ItemsContained() const;
-	
-	// Import group item
-	void ImportDbItemL( CContactGroup& aItem );
-	
-	// Export / Import vCard info from/to this object
-	void ExportVCardL( CBufBase& aBuffer );
-	void ExportVCardL( RWriteStream& aWriteStream );
-	void ImportVCardL( const TDesC8& aBuffer );
-	
-	// Reset all data
-	void ResetL();
-	
-private:
-    
-    CContactsGrpConverter();	
-	void ConstructL();
-	
-    void SetContactItemsL( const TDesC& aValue );
-        
-    void SplitL( const TDesC& aText, const TChar aSeparator, RArray<TPtrC>& aArray );
-    void TrimAll( TPtrC& aValue );
-private:
-    HBufC*           iGroupLabel;
-    CContactIdArray* iContactsIdArray;
-    
-	};
-
-#endif // __CONTACTSGRPCONVERTER_H__
--- a/omads/omadsextensions/adapters/contactsgroup/inc/contactsgrpdataprovider.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Part of ContactGroup DS adapter
-*
-*/
-
-
-#ifndef __CONTACTSGRPDATAPROVIDER_H__
-#define __CONTACTSGRPDATAPROVIDER_H__
-
-#include <SmlDataProvider.h>
-#include <f32file.h>
-
-class CContactsGrpDataProvider : public CSmlDataProvider
-	{
-private:
-	// Default C++ constructor
-	CContactsGrpDataProvider();
-
-	// 2nd phase of constructor
-	void ConstructL();
-
-public:	
-	
-	// Two-phased constructor
-	static CContactsGrpDataProvider* NewL();
-	
-	// Destructor
-	virtual ~CContactsGrpDataProvider();
-
-protected:
-
-	virtual void DoOnFrameworkEvent( TSmlFrameworkEvent, TInt aParam1, TInt aParam2 );
-	
-	virtual TBool DoSupportsOperation( TUid aOpId ) const;
-	
-	virtual const CSmlDataStoreFormat& DoStoreFormatL();
-	
-	virtual CDesCArray* DoListStoresLC();
-	
-	virtual const TDesC& DoDefaultStoreL();
-	
-	virtual CSmlDataStore* DoNewStoreInstanceLC();
-
-	virtual const RPointerArray<CSyncMLFilter>& DoSupportedServerFiltersL();
-	
-	virtual void DoCheckSupportedServerFiltersL( const CSmlDataStoreFormat& aServerDataStoreFormat,
-	    RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo );
-	
-	virtual void DoCheckServerFiltersL( RPointerArray<CSyncMLFilter>& aFilters,
-	    TSyncMLFilterChangeInfo& aChangeInfo );
-	
-	virtual HBufC* DoGenerateRecordFilterQueryLC( const RPointerArray<CSyncMLFilter>& aFilters,
-	    TSyncMLFilterMatchType aMatch, TDes& aFilterMimeType,
-	    TSyncMLFilterType& aFilterType, TDesC& aStoreName );
-	
-	virtual void DoGenerateFieldFilterQueryL( const RPointerArray<CSyncMLFilter>& aFilters,
-	    TDes& aFilterMimeType, RPointerArray<CSmlDataProperty>& aProperties, TDesC& aStoreName );
-
-private:
-
-	CSmlDataStoreFormat* DoOwnStoreFormatL();
-
-private:
-	
-	CSmlDataStoreFormat*            iOwnStoreFormat;
-	RStringPool                     iStringPool;
-	RPointerArray<CSyncMLFilter>    iFilters;
-	RFs	                            iFs;
-	
-	};
-
-#endif // __CONTACTSGRPDATAPROVIDER_H__
--- a/omads/omadsextensions/adapters/contactsgroup/inc/contactsgrpdataproviderdefs.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +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:  Part of ContactGroup DS adapter
-*
-*/
-
-
-#ifndef __CONTACTSGRPDATAPROVIDERDEFS_H__
-#define __CONTACTSGRPDATAPROVIDERDEFS_H__
-
-#include <e32def.h> 
-// ------------------------------------------------------------------------------------------------
-// Constants
-// ------------------------------------------------------------------------------------------------
-_LIT8( KContactsGrpItemMimeType, "text/x-vCard" );
-_LIT8( KContactsGrpItemMimeVersion, "2.1" );
-
-_LIT(KContactsGrpStoreName, "Gallery");
-
-#endif // __CONTACTSGRPDATAPROVIDERDEFS_H__ 
--- a/omads/omadsextensions/adapters/contactsgroup/inc/contactsgrpdatastore.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Part of ContactGroup DS adapter
-*
-*/
-
-
-#ifndef __CONTACTSGRPDATASTORE_H__
-#define __CONTACTSGRPDATASTORE_H__
-
-#include <SmlDataProvider.h>
-#include <f32file.h>
-#include <cntdef.h>
-
-class CNSmlDataItemUidSet;
-class CContactsGrpConverter;
-class CChangeFinder;
-class TSnapshotItem;
-class CContactDatabase;
-
-class CContactsGrpDataStore : public CSmlDataStore
-	{
-private:
-
-	CContactsGrpDataStore();
-	~CContactsGrpDataStore();	
-	
-public:
-
-	static CContactsGrpDataStore* NewL();
-	static CContactsGrpDataStore* NewLC();
-	void ConstructL();	
-	
-	// Transactions (optional)
-	void DoBeginTransactionL();
-	void DoCommitTransactionL(TRequestStatus& aStatus);
-	void DoRevertTransaction(TRequestStatus& aStatus);
-
-	// Batching (optional)
-	void DoBeginBatchL();
-	void DoCommitBatchL(RArray<TInt>& aResultArray, TRequestStatus& aStatus);
-	void DoCancelBatch();
-
-	// Opens data store asynchronously	
-	void DoOpenL(const TDesC& aStoreName, MSmlSyncRelationship& aContext, TRequestStatus& aStatus);
-	// Cancels current asynchronous request
-	void DoCancelRequest();
-	// Returns the name of open database, empty if OpenL hasn't been called
-	const TDesC& DoStoreName() const;
-	// Sets remote server data format
-	void DoSetRemoteStoreFormatL(const CSmlDataStoreFormat& aServerDataStoreFormat);
-	// Sets the remote server maximum object size
-	void DoSetRemoteMaxObjectSize(TInt aServerMaxObjectSize);
-	// Returns maximum object size, reported by remote server
-	TInt DoMaxObjectSize() const;
-
-	// Opens item for reading
-	void DoOpenItemL(TSmlDbItemUid aUid, TBool& aFieldChange, TInt& aSize,
-	    TSmlDbItemUid& aParent, TDes8& aMimeType, TDes8& aMimeVer, TRequestStatus& aStatus);
-	// Initializes new item to data store
-	void DoCreateItemL(TSmlDbItemUid& aUid, TInt aSize, TSmlDbItemUid aParent,
-	    const TDesC8& aMimeType, const TDesC8& aMimeVer, TRequestStatus& aStatus);
-	// Initializes replace of item in data store
-	void DoReplaceItemL(TSmlDbItemUid aUid, TInt aSize, TSmlDbItemUid aParent,
-	    TBool aFieldChange, TRequestStatus& aStatus);
-	// Reads data from opened item
-	void DoReadItemL(TDes8& aBuffer);
-	// Writes data to created or replaced item
-	void DoWriteItemL(const TDesC8& aData);
-	// Commits the created or replaced item to database
-	void DoCommitItemL(TRequestStatus& aStatus);
-	// Closes the opened item
-	void DoCloseItem();
-	// Moves item in the database
-	void DoMoveItemL(TSmlDbItemUid aUid, TSmlDbItemUid aNewParent, TRequestStatus& aStatus);
-	// Deletes item from the database
-	void DoDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus);
-	// Soft deletes item (if supported by plugin adapter), can be equal to DoDeleteItemL
-	void DoSoftDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus);
-	// Deletes all items from the database
-	void DoDeleteAllItemsL(TRequestStatus& aStatus);
-
-	// Returns, whether data store has history info. EFalse means slow sync
-	TBool DoHasSyncHistory() const;
-	// Returns ids of items, which are added after previous synchronization
-	const MSmlDataItemUidSet& DoAddedItems() const;
-	// Returns ids of items, which are deleted after previous synchronization
-	const MSmlDataItemUidSet& DoDeletedItems() const;
-	// Returns ids of items, which are soft-deleted after previous synchronization
-	const MSmlDataItemUidSet& DoSoftDeletedItems() const;
-	// Returns ids of items, which are modified after previous synchronization
-	const MSmlDataItemUidSet& DoModifiedItems() const;
-	// Returns ids of items, which are moved after previous synchronization
-	const MSmlDataItemUidSet& DoMovedItems() const;
-	// Resets change information of items (makes all items new from DS point of view)
-	void DoResetChangeInfoL(TRequestStatus& aStatus);
-	// Commits the changes, that are sent into the remote server
-	void DoCommitChangeInfoL(TRequestStatus& aStatus, const MSmlDataItemUidSet& aItems);
-	// Commits the changes, that are sent into the remote server
-	void DoCommitChangeInfoL(TRequestStatus& aStatus);
-	
-
-private:
-    TContactItemId CreateNewGroupL( const TDesC& aLabel,
-            const CContactIdArray& aContactArray/*, const TDesC& aRingtone*/ );
-    
-    void ReplaceGroupL( TContactItemId aGroupId, const TDesC& aLabel,
-            const CContactIdArray& aContactArray/*, const TDesC& aRingtone*/ );
-    
-    // Create and save snapshot from items on database
-    void RegisterSnapshotL();
-    
-    void AssignString( TDes8& aDestination, const TDesC8& aSource );
-    
-    // Updates contacts last modified time.
-    void UpdateContactLastMod( TContactItemId aContactId, const TTime& aLastModified );
-    
-    // Checks does group name already exists.
-    TBool GroupNameExistsL( const TDesC& aLabel );
-    
-    // Data store states
-    enum TState
-        {
-        EClosed = 0,
-        EOpenAndWaiting,
-        EContactGrpOpening,
-        EContactGrpCreating,
-        EContactGrpUpdating
-        }; 	
-        
-    TState iCurrentState;    
-
-    RFs                 iFs;
-	
-	CContactDatabase*   iContactsDb;
-	
-	TRequestStatus*     iCallerStatus;
-
-    /**
-	* Key that is used in sorting snapshot.
-	*/
-    const TKeyArrayFix  iKey;
-    
-    /**
-	* Change finder, used to determine db modifications.
-	*/
-    CChangeFinder*      iChangeFinder;
-
-    /**
-	* VCard item converter
-	*/
-    CContactsGrpConverter* iConverter;
-	
-    TSmlDbItemUid* iCurrentItem;
-    TSmlDbItemUid  iItemToBeReplaced;
-	
-	CBufFlat*  iDataBuffer;
-	TInt       iWriterPosition;
-	TInt       iReaderPosition;
-	
-	TBool      iHasHistory;
-	
-	CNSmlDataItemUidSet* iNewItems;
-    CNSmlDataItemUidSet* iDeletedItems;
-    CNSmlDataItemUidSet* iUpdatedItems;
-    CNSmlDataItemUidSet* iEmptyList;
-	};
-
-#endif // __CONTACTSGRPDATASTORE_H__
\ No newline at end of file
--- a/omads/omadsextensions/adapters/contactsgroup/inc/logger.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +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:  Debug utility for Contact Groups
-*
-*/
-
-
-#ifndef _LOGGER_H
-#define _LOGGER_H
-
-#ifdef _DEBUG
-    
-    // Define this to enable file logging
-    #define __FLOGGING__
-    
-    #include <e32svr.h>
-    #ifdef __FLOGGING__
-        #include <f32file.h>
-        #include <flogger.h>
-    #endif
-    
-    NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow
-        {
-    public:
-        void Overflow(TDes16& /*aDes*/) {}
-        };
-    
-    NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow
-        {
-    public:
-        void Overflow(TDes8& /*aDes*/) {}
-        };
-    
-    _LIT( KLogDir, "CNTGRP" );
-    _LIT( KLogFile, "ContactsGroupLog.txt" );
-    
-    _LIT(KTracePrefix16, "[CNTGRP] ");
-    _LIT8(KTracePrefix8, "[CNTGRP] ");
-    _LIT8(KFuncEntryFormat8, "%S : Begin");
-    _LIT8(KFuncExitFormat8, "%S : End");
-    _LIT8(KFuncFormat8, "><%S");
-    
-    const TInt KMaxLogLineLength = 512;
-    
-    #define LOGGER_WRITE( text )                    {_LIT( KTemp, text ); FPrint( KTemp );}
-    #define LOGGER_WRITE_1( text,par1 )             {_LIT( KTemp, text ); FPrint( KTemp, par1 );}
-    #define LOGGER_WRITE8_1( text,par1 )             {_LIT8( KTemp, text ); FPrint( KTemp, par1 );}
-    #define LOGGER_WRITE_2( text,par1,par2 )        {_LIT( KTemp, text ); FPrint( KTemp, par1, par2 );}
-    #define LOGGER_WRITE_3( text,par1,par2,par3 )   {_LIT( KTemp, text ); FPrint( KTemp, par1, par2, par3 );}
-    #define LOGGER_WRITE_IFERR_2( text, err )       {if (err) {_LIT( KTemp, text ); FPrint( KTemp, err );}}
-    
-    // New function logging macros
-    #define TRACE_FUNC_ENTRY {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncEntryFormat8, &ptr8);}
-    #define TRACE_FUNC_EXIT {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncExitFormat8, &ptr8);}
-    #define TRACE_FUNC {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncFormat8, &ptr8);}
-    
-    // Declare the FPrint function
-    inline void FPrint( TRefByValue<const TDesC16> aFmt, ...)
-        {
-        VA_LIST list;
-        VA_START(list,aFmt);
-    #ifdef __FLOGGING__
-        RFileLogger::WriteFormat( KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list );
-    #endif
-        TBuf16<KMaxLogLineLength> theFinalString;
-        theFinalString.Append(KTracePrefix16);
-        TOverflowTruncate16 overflow;
-        theFinalString.AppendFormatList(aFmt,list,&overflow);
-        RDebug::Print(theFinalString);
-        }
-    
-    // Declare the FPrint function
-    inline void FPrint(TRefByValue<const TDesC8> aFmt, ...)
-        {
-        VA_LIST list;
-        VA_START(list, aFmt);
-    #ifdef __FLOGGING__
-        RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
-    #endif
-        TOverflowTruncate8 overflow;
-        TBuf8<KMaxLogLineLength> buf8;
-        buf8.Append(KTracePrefix8);
-        buf8.AppendFormatList(aFmt, list, &overflow);
-        TBuf16<KMaxLogLineLength> buf16(buf8.Length());
-        buf16.Copy(buf8);
-        TRefByValue<const TDesC> tmpFmt(_L("%S"));
-        RDebug::Print(tmpFmt, &buf16);
-        }
-#else
-    
-    // No loggings --> reduced code size
-    #define LOGGER_WRITE( text )
-    #define LOGGER_WRITE_1( text, par1 )
-    #define LOGGER_WRITE8_1( text,par1 )
-    #define LOGGER_WRITE_2( text, par1, par2 )
-    #define LOGGER_WRITE_3( text, par1, par2, par3 )
-    #define TRACE_FUNC_ENTRY
-    #define TRACE_FUNC_EXIT
-    #define TRACE_FUNC
-
-#endif //_DEBUG
-
-#endif // SECON_DEBUG_H
-
-// End of file
-
--- a/omads/omadsextensions/adapters/contactsgroup/inc/snapshotitem.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +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:  Private snapshot item header
-*
-*/
-
-
-#ifndef __SNAPSHOTITEM_H__
-#define __SNAPSHOTITEM_H__
-
-// INCLUDES
-
-#include <s32strm.h>
-#include <nsmlsnapshotitem.h>
-
-
-// CLASS DECLARATION
-class CContactGroup;
-
-// Defines the maximum length of a hash.
-const TInt KMaxHashLength = 20;
-typedef TBuf8<KMaxHashLength> THashValue;
-
-/**
-* @brief TSnapshotItem
-* This class represents a single item in the ChangeFinder snapshot.
-* It's derived from the generic snapshot item and extended
-* to contain the hash (name and url) information.
-*/
-class TSnapshotItem : public TNSmlSnapshotItem
-	{ 
-public:
-	
-	/**
-    * Constructor
-    */
-	TSnapshotItem();
-
-	/**
-    * Constructor
-    * 
-    * @param aItemId   IN: id of the item.
-    * @param aParent   IN: parent item, 0 as default.
-    */
-	TSnapshotItem( const TSmlDbItemUid& aItemId,
-	    const TSmlDbItemUid& aParent = 0 );
-	
-	/**
-    * Writes the item to a stream.
-    * 
-    * @param aStream   IN: a reference to a stream, where this item is to be written.
-    */
-	void ExternalizeL( RWriteStream& aStream ) const;
-
-	/**
-    * Reads item from a stream.
-    * 
-    * @param aStream   IN: a reference to a stream, where this item is read from.
-    */
-	void InternalizeL( RReadStream& aStream );	
-	
-	/**
-    * Creates hash from name and url
-    *
-    * @param aName, name to used
-    * @param aUrl, url to used
-    * @return none.
-    */
-	void CreateHashL( const TDesC& aName, const TDesC& aUrl );
-	void CreateHashL( CContactGroup& aGroup );
-	
-	/**
-    * Reads hash
-    * 
-    * @return TDesC8& hash.
-    */
-	const TDesC8& Hash() const;
-	
-private:
-    
-    THashValue       iHash;
-    };
-
-#endif
--- a/omads/omadsextensions/adapters/contactsgroup/rom/contactsgrpdsa.iby	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  iby file for Contacts Group DS adapter
-*
-*/
-
-
-#ifndef __CONTACTSGRPDSA_IBY__
-#define __CONTACTSGRPDSA_IBY__
-
-ECOM_PLUGIN(contactsgrpdataprovider.dll,contactsgrpdataprovider.rsc)
-data=DATAZ_\RESOURCE_FILES_DIR\contactsgrpdatastore.rsc     RESOURCE_FILES_DIR\contactsgrpdatastore.rsc
-data=DATAZ_\private\101F99F6\capability\101ff972.xml        private\101F99F6\capability\101ff972.xml
-data=ZSYSTEM\install\contactsgrpdsa_stub.sis             	system\install\contactsgrpdsa_stub.sis
-
-#endif //__CONTACTSGRPDSA_IBY__
--- a/omads/omadsextensions/adapters/contactsgroup/sis/backup_registration.xml	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<?xml version="1.0" standalone="yes"?> 
-<backup_registration>
-    <system_backup />
-    <restore requires_reboot = "no"/>
-</backup_registration> 
\ No newline at end of file
--- a/omads/omadsextensions/adapters/contactsgroup/sis/contactsgrp.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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: PKG file for Contacts Group DS adapter
-
-
-;*Unique (Non-Localised) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade ofa a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localised vendor name(s) correspodning to language(s).
-%{"Nokia"}
-
-;Language - standard language definitions
-&EN
-
-;package-header
-#{"Contacts Group DS Plugin"},(0x101FF972),1,23,0,TYPE=SA, RU
-
-; S60 v5.2
-[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
-
-"\epoc32\data\z\resource\contactsgrpdatastore.rsc"             -"c:\resource\contactsgrpdatastore.rsc"
-"\epoc32\data\z\resource\plugins\contactsgrpdataprovider.rsc"  -"c:\resource\plugins\contactsgrpdataprovider.rsc"
-"\epoc32\release\armv5\urel\contactsgrpdataprovider.dll"       -"c:\sys\bin\contactsgrpdataprovider.dll"
-
-"\epoc32\data\Z\private\101F99F6\capability\101ff972.xml"   -"c:\private\101F99F6\import\101ff972.xml"
-"backup_registration.xml"                                   -"c:\private\10202D56\import\packages\101FF972\backup_registration.xml"
--- a/omads/omadsextensions/adapters/contactsgroup/sis/contactsgrp_debug.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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: 
-;
-
-;*Unique (Non-Localised) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade ofa a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localised vendor name(s) correspodning to language(s).
-%{"Nokia"}
-
-;Language - standard language definitions
-&EN
-
-;package-header
-#{"Contacts Group DS Plugin"},(0x101FF972),1,23,0,TYPE=SA, RU
-
-; S60 v5.2
-[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
-
-"\epoc32\data\z\resource\contactsgrpdatastore.rsc"             -"c:\resource\contactsgrpdatastore.rsc"
-"\epoc32\data\z\resource\plugins\contactsgrpdataprovider.rsc"  -"c:\resource\plugins\contactsgrpdataprovider.rsc"
-"\epoc32\release\ARMV5\UDEB\contactsgrpdataprovider.dll"       -"c:\sys\bin\contactsgrpdataprovider.dll"
-
-"\epoc32\data\Z\private\101F99F6\capability\101ff972.xml"   -"c:\private\101F99F6\import\101ff972.xml"
-"backup_registration.xml"                                   -"c:\private\10202D56\import\packages\101FF972\backup_registration.xml"
--- a/omads/omadsextensions/adapters/contactsgroup/src/changefinder.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,410 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Part of ContactsGroup Plug In Adapter
-*
-*/
-
-
-#include "changefinder.h"
-#include "logger.h"
-
-const TUint KSnapshotFormatVersion ( 0xf0000001 ); // format version
-// -----------------------------------------------------------------------------
-// CChangeFinder::NewL
-// Static function to create CChangeFider object(s)
-// -----------------------------------------------------------------------------
-CChangeFinder* CChangeFinder::NewL( MSmlSyncRelationship& aSyncRelationship, TKeyArrayFix aKey,
-        TBool& aHasHistory, TInt aStreamUid )
-    {
-    CChangeFinder* self = new (ELeave) CChangeFinder( aSyncRelationship, aKey, aStreamUid );
-    CleanupStack::PushL( self );
-    self->ConstructL( aHasHistory );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::CChangeFinder
-// Constructor for the class
-// -----------------------------------------------------------------------------
-CChangeFinder::CChangeFinder( MSmlSyncRelationship& aSyncRelationship,
-        TKeyArrayFix aKey, TInt aStreamUid ) :
-iSyncRelationship( aSyncRelationship ),
-iKey( aKey ),
-iStreamUid( aStreamUid )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::~CChangeFinder
-// Destructor for the class, closes the ChangeFinder and writes snapshot to stream
-// -----------------------------------------------------------------------------
-CChangeFinder::~CChangeFinder()
-    {
-    TRACE_FUNC_ENTRY;
-    delete iOldSnapshot;
-	delete iCurrentSnapshot;
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::ConstructL
-// 2nd phase constructor for the class, reads snapshot from stream
-// -----------------------------------------------------------------------------
-void CChangeFinder::ConstructL( TBool& aHasHistory )
-    {
-    TRACE_FUNC_ENTRY;
-    iOldSnapshot = new (ELeave) CSnapshotArray( KSnapshotGranularity );
-	iCurrentSnapshot = new (ELeave) CSnapshotArray( KSnapshotGranularity );
-    LOGGER_WRITE("CChangeFinder::ConstructL, CSnapshotArray:s created");
-    TUid uid = {iStreamUid};
-    
-    aHasHistory = iSyncRelationship.IsStreamPresentL( uid );
-    
-    if ( aHasHistory )
-        {
-        LOGGER_WRITE("CChangeFinder::ConstructL, HasHistory");
-        // Open stream for reading
-        RReadStream readStream;
-        iSyncRelationship.OpenReadStreamLC( readStream, uid );
-        
-        // Read used format version
-        TUint formatVer = readStream.ReadUint32L();
-        if ( formatVer != KSnapshotFormatVersion )
-            {
-            // Wrong version, do not try to import data
-            LOGGER_WRITE("CChangeFinder::ConstructL, Wrong format version -> no history");
-            aHasHistory = EFalse;
-            CleanupStack::PopAndDestroy( &readStream );
-            TRACE_FUNC_EXIT;
-            return;
-            }
-        else
-            {
-            LOGGER_WRITE("CChangeFinder::ConstructL, format is OK");
-            }
-        
-        // Read item count
-        TInt count = readStream.ReadUint32L();
-        
-        // Read items
-        for ( TInt i=0; i<count; i++ )
-            {
-            TSnapshotItem item;
-            item.InternalizeL( readStream );
-            iOldSnapshot->InsertIsqL( item, iKey );
-            }
-        iOldSnapshot->Compress();
-        
-        LOGGER_WRITE_1("iOldSnapshot done, iOldSnapshot->Count: %d", iOldSnapshot->Count() );
-        CleanupStack::PopAndDestroy( &readStream ); // readStream
-        }
-    else
-        {
-        LOGGER_WRITE("CChangeFinder::ConstructL, no sync history.");
-        }
-        
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::CloseL
-// Closes ChangeFinder object and writes snapshot to stream
-// -----------------------------------------------------------------------------
-void CChangeFinder::CloseL()
-    {
-    TRACE_FUNC_ENTRY;
-     
-    RWriteStream writeStream;
-    
-    TUid uid = {iStreamUid};
-    
-    // Open write stream
-    iSyncRelationship.OpenWriteStreamLC( writeStream, uid );
-    
-    // Write used format version
-    writeStream.WriteUint32L( KSnapshotFormatVersion );
-    
-    // Write item count
-    TInt count = iOldSnapshot->Count();
-    writeStream.WriteUint32L( count );
-    
-    // Write items
-    for ( TInt i = 0; i < count; i++ )
-        {
-        const TSnapshotItem& item = iOldSnapshot->At( i );
-        item.ExternalizeL( writeStream );
-        }
-    
-    writeStream.CommitL();
-    CleanupStack::PopAndDestroy( &writeStream ); // writeStream
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::ResetL
-// Resets synchronization history, all contetn is considered new after this call
-// -----------------------------------------------------------------------------
-void CChangeFinder::ResetL()
-    {
-    TRACE_FUNC_ENTRY;
-    iOldSnapshot->Reset();
-    
-    // Write 'null' data to file, 
-    // this removes change history from the file
-    CloseL();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::FindChangedItemsL
-// Compares snapshots, finds changed items
-// -----------------------------------------------------------------------------
-void CChangeFinder::FindChangedItemsL( CNSmlDataItemUidSet& aChangedUids )
-    {   
-    TRACE_FUNC_ENTRY;
-    aChangedUids.Reset();
-    
-    TInt index;
-    TInt count = iCurrentSnapshot->Count();
-    LOGGER_WRITE_1( "CChangeFinder::FindChangedItemsL items on iCurrentSnapshot: %d", count );
-    for ( TInt i=0; i < count; i++ )
-        {
-        const TSnapshotItem& currentItem = iCurrentSnapshot->At( i );
-        
-        // Find this entry from the old snapshot
-        if ( iOldSnapshot->FindIsq( currentItem, iKey, index ) == KErrNone)
-            {
-            // This is the old item
-            TSnapshotItem& oldItem = iOldSnapshot->At( index );
-            if ( currentItem.Hash().Compare( oldItem.Hash() ) != 0 )
-                {
-                // add to list
-				User::LeaveIfError( aChangedUids.AddItem( currentItem.ItemId() ) );
-                }
-            }
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::FindDeletedItemsL
-// Compares snapshots, finds deleted items
-// -----------------------------------------------------------------------------
-void CChangeFinder::FindDeletedItemsL( CNSmlDataItemUidSet& aDeletedUids )
-    {
-    TRACE_FUNC_ENTRY;
-    aDeletedUids.Reset();
-        
-    TInt index;
-    TInt count = iOldSnapshot->Count();
-    for ( TInt i=0; i < count; i++ )
-        {
-        const TSnapshotItem& currentItem = iOldSnapshot->At( i );
-        
-        // If there's no current snapshot, this definately is deleted item
-        if ( !iCurrentSnapshot )
-            {
-            User::LeaveIfError( aDeletedUids.AddItem( currentItem.ItemId() ) );
-            LOGGER_WRITE_1( "Item %d was deleted.", currentItem.ItemId() );
-            }
-        // It is also new if it doesn't exist int the current snapshot.
-        else if ( iCurrentSnapshot->FindIsq( currentItem, iKey, index ) != KErrNone )
-            {
-            User::LeaveIfError( aDeletedUids.AddItem( currentItem.ItemId() ) );
-            LOGGER_WRITE_1( "Item %d was deleted.", currentItem.ItemId() );
-            }       
-        }
-        
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::FindNewItemsL
-// Compares snapshots, finds new items
-// -----------------------------------------------------------------------------
-void CChangeFinder::FindNewItemsL( CNSmlDataItemUidSet& aNewUids )
-    {
-    TRACE_FUNC_ENTRY;
-    aNewUids.Reset();
-    
-    TInt index;
-    TInt count = iCurrentSnapshot->Count();
-    LOGGER_WRITE_1( "iCurrentSnapshot->Count(): %d", count );
-    LOGGER_WRITE_1( "iOldSnapshot->Count(): %d", iOldSnapshot->Count() );
-    for ( TInt i=0; i < count; i++ )
-        {
-        const TSnapshotItem& currentItem = iCurrentSnapshot->At( i );
-        
-        // If there's no old snapshot, all items are new
-        if ( !iOldSnapshot )
-            {
-            User::LeaveIfError( aNewUids.AddItem( currentItem.ItemId() ) );
-            LOGGER_WRITE_1( "!iOldSnapshot, Item %d was new.", currentItem.ItemId() );
-            }
-        // It is also new if it doesn't exist int the old snapshot.
-        else if ( iOldSnapshot->FindIsq( currentItem, iKey, index ) != KErrNone )
-            {
-            User::LeaveIfError( aNewUids.AddItem( currentItem.ItemId() ) );
-            LOGGER_WRITE_1( "Item %d was new.", currentItem.ItemId() );
-            }       
-        }
-        
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::ItemAddedL
-// Adds item to snapshot, this item is no longer considered new
-// -----------------------------------------------------------------------------
-void CChangeFinder::ItemAddedL( const TSnapshotItem& aItem )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "Adding item %d.", aItem.ItemId() );
-    
-    iOldSnapshot->InsertIsqL( aItem, iKey );
-    iOldSnapshot->Compress();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::ItemDeleted
-// Removes item from snapshot, this item is no longer considered deleted
-// -----------------------------------------------------------------------------
-void CChangeFinder::ItemDeleted( const TSnapshotItem& aItem )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "deleting item %d.", aItem.ItemId() );
-    
-    // Delete item from the old snapshot
-    TInt index;
-    if ( iOldSnapshot->FindIsq( aItem, iKey, index ) == KErrNone )
-        {
-        iOldSnapshot->Delete( index );
-        }
-    else // Skip, there wasn't such entry
-        {
-        LOGGER_WRITE( "iOldSnapshot->FindIsq, item was not found." );
-        }  
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::ItemUpdatedL
-// Updates item to snapshot, this item is no longer considered changed
-// -----------------------------------------------------------------------------
-void CChangeFinder::ItemUpdatedL( const TSnapshotItem& aItem )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "Updating item %d.", aItem.ItemId() );
-    
-    // Update item in the old snapshot
-    TInt index;
-    if ( iOldSnapshot->FindIsq( aItem, iKey, index ) == KErrNone )
-        {
-        iOldSnapshot->At( index ) = aItem;
-        }
-    else 
-        {
-        // There was no such item. Let's add it
-        ItemAddedL( aItem );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::CommitChangesL
-// Commits current changes to snapshot
-// -----------------------------------------------------------------------------
-void CChangeFinder::CommitChangesL()
-    {
-    TRACE_FUNC_ENTRY;
-     
-    // Delete everything from the old snapshot
-    iOldSnapshot->Reset();
-    
-    // Loop through all the items in current snapshot
-    TInt count = iCurrentSnapshot->Count();
-    
-    // Copy everything from current to old snapshot
-    for ( TInt i = 0; i < count; i++ )
-        {
-        // Commit it to the old array.
-        iOldSnapshot->InsertIsqL( iCurrentSnapshot->At( i ), iKey );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::CommitChangesL
-// Commits current changes to snapshot, affects only a specified group of items
-// -----------------------------------------------------------------------------
-void CChangeFinder::CommitChangesL( const MSmlDataItemUidSet& aUids )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // This function commits changes from current snapshot to old snapshot
-    // But commits only the entries in the parameter array
-    
-    for ( TInt i = 0; i < aUids.ItemCount(); i++ )
-		{
-		TSmlDbItemUid itemId = aUids.ItemAt( i );
-		TSnapshotItem temp( itemId );
-		TInt indexOld( -1 );
-		TInt indexNew( -1 );
-		if ( !iOldSnapshot->FindIsq( temp, iKey, indexOld) )
-			{
-			if ( !iCurrentSnapshot->FindIsq(temp, iKey, indexNew) )
-				{
-				// Replace, moved or softdeleted
-				iOldSnapshot->At( indexOld ) = iCurrentSnapshot->At( indexNew );
-				}
-			else
-				{
-				// Delete
-				iOldSnapshot->Delete( indexOld );
-				}
-			}
-		else
-			{
-			// Add
-			if ( !iCurrentSnapshot->FindIsq( temp, iKey, indexNew ) )
-			    {
-			    iOldSnapshot->InsertIsqL( iCurrentSnapshot->At( indexNew ), iKey );
-			    }
-			}
-		}
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::SetNewSnapshot
-// Sets new snapshot (to be compared against), ChangeFinder takes ownership
-// -----------------------------------------------------------------------------
-void CChangeFinder::SetNewSnapshot( CSnapshotArray* aNewSnapshot )
-    {
-    TRACE_FUNC;
-    
-    // Delete existing snapshot
-    delete iCurrentSnapshot;
-    
-    // Set submitted snapshot as active
-    iCurrentSnapshot = aNewSnapshot;
-    TRACE_FUNC_EXIT;
-    }
--- a/omads/omadsextensions/adapters/contactsgroup/src/contactsgrpconverter.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,400 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Contacts Group object conversion routines
-*
-*/
-
-
-// INCLUDES
-#include <utf.h>
-#include <cntdef.h>
-#include <cntitem.h>
-#include <cntfldst.h>
-#include <vcard.h>
-#include <vprop.h> 
-#include <vutil.h>
-#include <s32mem.h>
-
-#include "contactsgrpconverter.h"
-#include "logger.h"
-
-// CONSTANTS
-/*
-vCard format example:
-BEGIN:VCARD
-VERSION:2.1
-FN:GroupName
-X-CNTGRP:4;14;54
-END:VCARD
-*/
-
-// Group label property
-_LIT8(KCntGrpFN, "FN");
-// Group contacts propetry
-_LIT8(KCntGrpXCntGrp, "X-CNTGRP");
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CContactsGrpConverter* CContactsGrpConverter::NewL()
-    {
-    CContactsGrpConverter* self = CContactsGrpConverter::NewLC();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::NewLC
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CContactsGrpConverter* CContactsGrpConverter::NewLC()
-    {
-    TRACE_FUNC_ENTRY;
-    CContactsGrpConverter* self = new (ELeave) CContactsGrpConverter();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::CContactsGrpConverter
-// C++ default constructor can NOT contain any code, that might leave
-// -----------------------------------------------------------------------------
-CContactsGrpConverter::CContactsGrpConverter()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-void CContactsGrpConverter::ConstructL()
-    {
-    ResetL();
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::~CContactsGrpConverter
-// Destructor.
-// -----------------------------------------------------------------------------
-CContactsGrpConverter::~CContactsGrpConverter()
-    {
-    TRACE_FUNC_ENTRY;
-    delete iContactsIdArray;
-    delete iGroupLabel;
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::GroupLabel
-// returns group label
-// -----------------------------------------------------------------------------
-const TDesC& CContactsGrpConverter::GroupLabel() const
-    {
-    return *iGroupLabel;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::ItemsContained
-// returns contact items belonging to this group
-// -----------------------------------------------------------------------------
-const CContactIdArray& CContactsGrpConverter::ItemsContained() const
-    {
-    return *iContactsIdArray;
-    }
-    
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::ImportDbItemL
-// Imports group item
-// -----------------------------------------------------------------------------
-void CContactsGrpConverter::ImportDbItemL( CContactGroup& aItem )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( aItem.Type() != KUidContactGroup )
-        {
-        User::Leave( KErrNotSupported );
-        }
-    ResetL();
-    
-    if ( aItem.HasItemLabelField() )
-        {
-        TPtrC label = aItem.GetGroupLabelL();
-        delete iGroupLabel;
-        iGroupLabel = NULL;
-        iGroupLabel = label.AllocL();
-        }
-    else
-        {
-        delete iGroupLabel;
-        iGroupLabel = NULL;
-        iGroupLabel = KNullDesC().AllocL();
-        }
-    
-    // this is NULL, if no items
-    CContactIdArray* tempIdArray = aItem.ItemsContainedLC();
-    if ( tempIdArray )
-        {
-        delete iContactsIdArray;
-        iContactsIdArray = tempIdArray;
-        CleanupStack::Pop( tempIdArray );
-        }
-    
-    LOGGER_WRITE_1("GroupName: %S", iGroupLabel);
-    if ( iContactsIdArray )
-        {
-        LOGGER_WRITE_1("contacts count: %d", iContactsIdArray->Count() );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::ExportVCardL
-// Export contact group as vCard
-// -----------------------------------------------------------------------------
-void CContactsGrpConverter::ExportVCardL( CBufBase& aBuffer )
-    {
-    TRACE_FUNC_ENTRY;
-    RBufWriteStream stream( aBuffer, 0);
-    CleanupClosePushL( stream );
-    ExportVCardL( stream );
-    CleanupStack::PopAndDestroy( &stream );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::ExportL
-// Exports contact group as to vCard
-// -----------------------------------------------------------------------------
-void CContactsGrpConverter::ExportVCardL( RWriteStream& aWriteStream )
-    {
-    TRACE_FUNC_ENTRY;
-    CParserVCard* vCardParser = CParserVCard::NewL();
-    CleanupStack::PushL( vCardParser );
-    
-    // add group name
-    CParserPropertyValue* FNvalue = CParserPropertyValueHBufC::NewL( *iGroupLabel );
-    // Associate the property params and property value with the FN property
-    CParserProperty* FNproperty=CParserProperty::NewL( *FNvalue, KCntGrpFN, NULL );
-    // Finally add the FN property to the vCard using the parser object.
-    vCardParser->AddPropertyL( FNproperty );
-    
-    // add group contacts
-    const TInt KDefaultGranularity = 5;
-    CDesCArrayFlat* flatArray = new (ELeave) CDesCArrayFlat(KDefaultGranularity);
-    CleanupStack::PushL( flatArray );
-    TInt count = iContactsIdArray->Count();
-    const TInt KMaxIdLength = 10;
-    TBuf<KMaxIdLength> idnum;
-    for ( TInt i=0; i<count; i++ )
-        {
-        const TContactItemId id = (*iContactsIdArray)[i];
-        idnum.Zero();
-        idnum.AppendNum( id );
-        flatArray->AppendL( idnum );
-        }
-    CParserPropertyValueCDesCArray* grPropertyValueArray =
-        new (ELeave) CParserPropertyValueCDesCArray( flatArray );
-    CleanupStack::Pop( flatArray );
-    
-    CParserProperty* grProperty = 
-        CParserProperty::NewL( *grPropertyValueArray, KCntGrpXCntGrp, NULL );
-    vCardParser->AddPropertyL( grProperty );
-    
-    // Set default sharacterset
-    vCardParser->SetDefaultCharSet( Versit::EUTF8CharSet );
-    
-    vCardParser->ExternalizeL( aWriteStream );
-    
-    CleanupStack::PopAndDestroy( vCardParser );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::ImportVCardL
-// Import vCard item
-// -----------------------------------------------------------------------------
-void CContactsGrpConverter::ImportVCardL( const TDesC8& aBuffer )
-    {
-    TRACE_FUNC_ENTRY;
-    ResetL();
-    CParserVCard* vCardParser = CParserVCard::NewL();
-    vCardParser->SetDefaultCharSet( Versit::EUTF8CharSet );
-    CleanupStack::PushL( vCardParser );
-    
-    RDesReadStream stream( aBuffer );
-    vCardParser->InternalizeL( stream ); // To import a vCard.
-    stream.Close(); // Close the file stream once the import is done.
-    
-    CArrayPtr<CParserProperty>* properties = vCardParser->ArrayOfProperties( EFalse );
-    LOGGER_WRITE_1("properties count: %d", properties->Count());
-    for (TInt i=0; i<properties->Count(); i++)
-        {
-        const CParserProperty* property = properties->At(i);
-        // FN
-        if ( property->Name() == KCntGrpFN )
-            {
-            LOGGER_WRITE("group name found");
-            delete iGroupLabel;
-            iGroupLabel = NULL;
-            CParserPropertyValue* pvalue = property->Value();
-            TPtrC val = (static_cast<CParserPropertyValueHBufC*> (pvalue))->Value();
-            iGroupLabel = val.AllocL();
-            LOGGER_WRITE_1("iGroupLabel: %S", iGroupLabel);
-            }
-        // X-CNTGRP
-        else if ( property->Name() == KCntGrpXCntGrp )
-            {
-            LOGGER_WRITE("group contacts found");
-            CParserPropertyValue* pvalue = property->Value();
-            TPtrC val = (static_cast<CParserPropertyValueHBufC*> (pvalue))->Value();
-            SetContactItemsL( val );
-            }
-        else
-            {
-            // skip other properties
-            }
-        }
-    CleanupStack::PopAndDestroy( vCardParser );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::ResetL
-// Reset all data
-// -----------------------------------------------------------------------------
-void CContactsGrpConverter::ResetL()
-    {
-    delete iGroupLabel;
-    iGroupLabel = NULL;
-    iGroupLabel = KNullDesC().AllocL();
-    if ( iContactsIdArray )
-        {
-        iContactsIdArray->Reset();
-        }
-    else
-        {
-        iContactsIdArray = CContactIdArray::NewL();
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::SetContactItemsL
-// Parses contact items from aValue
-// -----------------------------------------------------------------------------
-void CContactsGrpConverter::SetContactItemsL( const TDesC& aValue )
-    {
-    TRACE_FUNC_ENTRY;
-    const TInt KDefaultGranularity = 5;
-    RArray<TPtrC> arr(KDefaultGranularity);
-    CleanupClosePushL( arr );
-    const TChar separator(';');
-    SplitL( aValue, separator, arr );
-    if ( iContactsIdArray )
-        {
-        iContactsIdArray->Reset();
-        }
-    else
-        {
-        iContactsIdArray = CContactIdArray::NewL();
-        }
-    for (TInt i=0; i<arr.Count(); i++ )
-        {
-        TLex lex( arr[i] );
-        TInt32 id;
-        TInt err = lex.Val( id );
-        if ( err )
-            {
-            LOGGER_WRITE_1("lex.val returned err: %d, leaving with KErrCorrupt", err);
-            iContactsIdArray->Reset();
-            User::Leave( KErrCorrupt );
-            }
-        LOGGER_WRITE_1("add: %d", id);
-        iContactsIdArray->AddL( id );
-        }
-    CleanupStack::PopAndDestroy( &arr );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::SplitL
-// Function splits string (eg "name1, name2, name3") into substrings.
-// -----------------------------------------------------------------------------
-void CContactsGrpConverter::SplitL(const TDesC& aText, const TChar aSeparator, 
-                    RArray<TPtrC>& aArray)
-    {
-    TRACE_FUNC_ENTRY;
-    TPtrC ptr;
-    ptr.Set(aText);
-
-    for (;;)
-        {
-        TInt pos=ptr.Locate(aSeparator);
-        if (pos==KErrNotFound)
-            {
-            TrimAll( ptr );
-            if ( ptr.Length() > 0 )
-                {
-                aArray.AppendL(ptr);
-                }
-            break;
-            }
-
-        TPtrC subStr=ptr.Left(pos); // get pos characters starting from position 0
-        TrimAll( subStr );
-        if ( subStr.Length() > 0 )
-            {
-            aArray.AppendL(subStr);
-            }
-
-        if ( !(ptr.Length()>pos+1) )
-            {
-            break;
-            }
-            
-        ptr.Set( ptr.Mid(pos+1) ); // get all characters starting from position pos+1
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpConverter::TrimAll
-// Trims all whitespaces from beginning and end of string
-// -----------------------------------------------------------------------------
-void CContactsGrpConverter::TrimAll( TPtrC& aValue )
-    {
-    TRACE_FUNC_ENTRY;
-    TInt valueStart(0);
-    while ( valueStart < aValue.Length() 
-            && (aValue[valueStart] == ' '
-            || aValue[valueStart] == '\r'
-            || aValue[valueStart] == '\n') )
-        {
-        valueStart++;
-        }
-    TInt valueEnd(aValue.Length()-1);
-    while ( valueEnd > 0 
-            && (aValue[valueEnd] == ' '
-            || aValue[valueEnd] == '\r'
-            || aValue[valueEnd] == '\n') )
-        {
-        valueEnd--;
-        }
-    valueEnd++;
-    aValue.Set( aValue.Mid(valueStart, valueEnd - valueStart));
-    TRACE_FUNC_EXIT;
-    }
-
--- a/omads/omadsextensions/adapters/contactsgroup/src/contactsgrpdataprovider.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Part ContactsGroup Plug In Adapter
-*
-*/
-
-
-#include <ecom/implementationproxy.h>
-#include <data_caging_path_literals.hrh>
-#include <bautils.h>
-#include <barsc.h> 
-#include <contactsgrpdatastore.rsg>
-
-#include "contactsgrpdataprovider.h"
-#include "contactsgrpdatastore.h"
-#include "contactsgrpdataproviderdefs.h"
-#include "logger.h"
-
-const TUint KContactsGrpDataProviderImplUid = 0x101FF972;
-
-// Resource file for CSmlDataStoreFormat
-
-// The following works with DS plugin added into ROM image 
-_LIT(KContactsGrpStoreFormatRscRom,"z:contactsgrpdatastore.rsc");
-
-// The following works with DS plugin installed from SIS
-_LIT(KContactsGrpStoreFormatRsc,"contactsgrpdatastore.rsc");
-
-
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::CContactsGrpDataProvider
-// C++ default constructor can NOT contain any code, that might leave
-// -----------------------------------------------------------------------------
-CContactsGrpDataProvider::CContactsGrpDataProvider(): iFilters( 1 )
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataProvider::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    User::LeaveIfError( iFs.Connect() );
-    iStringPool.OpenL();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CContactsGrpDataProvider* CContactsGrpDataProvider::NewL()
-    {
-    TRACE_FUNC_ENTRY;
-    CContactsGrpDataProvider* self = new ( ELeave ) CContactsGrpDataProvider();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::~CContactsGrpDataProvider
-// Destructor.
-// -----------------------------------------------------------------------------
-CContactsGrpDataProvider::~CContactsGrpDataProvider()
-    {
-    TRACE_FUNC_ENTRY;
-    delete iOwnStoreFormat;
-    iStringPool.Close();
-    iFilters.Close();
-    iFs.Close();
-
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoOnFrameworkEvent
-// Not used
-// -----------------------------------------------------------------------------
-void CContactsGrpDataProvider::DoOnFrameworkEvent( TSmlFrameworkEvent, TInt /*aParam1*/, TInt /*aParam2*/ )
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoSupportsOperation
-// Checks whether data provider supports specific operation
-// -----------------------------------------------------------------------------
-TBool CContactsGrpDataProvider::DoSupportsOperation( TUid /*aOpId*/ ) const
-    {
-    TRACE_FUNC;
-    return EFalse; // optional operations are not supported
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoStoreFormatL
-// Creates data store format
-// -----------------------------------------------------------------------------
-const CSmlDataStoreFormat& CContactsGrpDataProvider::DoStoreFormatL()
-    {
-    TRACE_FUNC_ENTRY;
-
-    if (!iOwnStoreFormat)
-        {
-        iOwnStoreFormat = DoOwnStoreFormatL();
-        }
-    	
-    TRACE_FUNC_EXIT;
-    	
-    return *iOwnStoreFormat;	
-    }
-	
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoListStoresLC
-// Returns array fo data stores that can be opened
-// -----------------------------------------------------------------------------
-CDesCArray* CContactsGrpDataProvider::DoListStoresLC()
-    {
-    TRACE_FUNC_ENTRY;
-
-    CDesCArrayFlat* stores = new ( ELeave ) CDesCArrayFlat( 1 );
-    CleanupStack::PushL( stores );
-    
-    stores->AppendL( KContactsGrpStoreName );
-
-    TRACE_FUNC_EXIT;
-
-    return stores;	
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoDefaultStoreL
-// Returns the name of the default data store
-// -----------------------------------------------------------------------------
-const TDesC& CContactsGrpDataProvider::DoDefaultStoreL()
-    {
-    TRACE_FUNC;
-    return KContactsGrpStoreName;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoNewStoreInstanceLC
-// Creates a new data store object, which can be used for synchronization
-// ----------------------------------------------------------------------------- 
-CSmlDataStore* CContactsGrpDataProvider::DoNewStoreInstanceLC()
-    {
-    TRACE_FUNC_ENTRY;
-    CContactsGrpDataStore* newStore = CContactsGrpDataStore::NewLC();
-    TRACE_FUNC_EXIT;
-    return newStore;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoSupportedServerFiltersL
-// Filters are not supported
-// ----------------------------------------------------------------------------- 
-const RPointerArray<CSyncMLFilter>& CContactsGrpDataProvider::DoSupportedServerFiltersL()
-    {
-    TRACE_FUNC;
-    return iFilters; // empty array
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoCheckSupportedServerFiltersL
-// Filters are not supported
-// ----------------------------------------------------------------------------- 
-void CContactsGrpDataProvider::DoCheckSupportedServerFiltersL(
-    const CSmlDataStoreFormat& /*aServerDataStoreFormat*/,
-    RPointerArray<CSyncMLFilter>& /*aFilters*/,
-    TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoCheckServerFiltersL
-// Filters are not supported
-// ----------------------------------------------------------------------------- 
-void CContactsGrpDataProvider::DoCheckServerFiltersL( RPointerArray<CSyncMLFilter>& /*aFilters*/,
-    TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoGenerateRecordFilterQueryLC
-// Filters are not supported
-// ----------------------------------------------------------------------------- 
-HBufC* CContactsGrpDataProvider::DoGenerateRecordFilterQueryLC(
-    const RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterMatchType /*aMatch*/,
-    TDes& /*aFilterMimeType*/, TSyncMLFilterType& /*aFilterType*/, TDesC& /*aStoreName*/ )
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    return NULL;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoGenerateFieldFilterQueryL
-// Filters are not supported
-// ----------------------------------------------------------------------------- 
-void CContactsGrpDataProvider::DoGenerateFieldFilterQueryL(
-    const RPointerArray<CSyncMLFilter>& /*aFilters*/, TDes& /*aFilterMimeType*/,
-    RPointerArray<CSmlDataProperty>& /*aProperties*/, TDesC& /*aStoreName*/ )
-    {	
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataProvider::DoOwnStoreFormatL
-// Creates data store format
-// -----------------------------------------------------------------------------
-CSmlDataStoreFormat* CContactsGrpDataProvider::DoOwnStoreFormatL()
-    {
-    TRACE_FUNC_ENTRY;
-
-    TParse* parse = new ( ELeave ) TParse();
-    CleanupStack::PushL(parse);
-    TFileName fileName;
-    RResourceFile resourceFile;
-    
-    parse->Set( KContactsGrpStoreFormatRsc, &KDC_RESOURCE_FILES_DIR, NULL );
-    fileName = parse->FullName();
-    BaflUtils::NearestLanguageFile( iFs, fileName );
-    LOGGER_WRITE_1( "file: %S", &fileName );
-    
-    TRAPD( error, resourceFile.OpenL( iFs, fileName ) );
-    if ( error )
-        {
-        LOGGER_WRITE_1( "RResourceFile::OpenL leaved with %d - try again", error );
-        parse->Set( KContactsGrpStoreFormatRscRom, &KDC_RESOURCE_FILES_DIR, NULL );
-        fileName = parse->FullName();
-        BaflUtils::NearestLanguageFile( iFs, fileName );
-        LOGGER_WRITE_1( "file: %S", &fileName );
-        resourceFile.OpenL( iFs, fileName );
-        }
-    CleanupClosePushL( resourceFile );
-    HBufC8* buffer = resourceFile.AllocReadLC( CONTACTSGROUP_DATA_STORE );
-
-    TResourceReader reader;
-    reader.SetBuffer( buffer );
-    
-    CSmlDataStoreFormat* dsFormat = NULL;
-    dsFormat = CSmlDataStoreFormat::NewLC( iStringPool, reader );
-
-    CleanupStack::Pop( dsFormat );
-    CleanupStack::PopAndDestroy( buffer );
-    CleanupStack::PopAndDestroy( &resourceFile );
-    CleanupStack::PopAndDestroy( parse );
-    
-    TRACE_FUNC_EXIT;
-
-    return dsFormat;
-    }
-	
-// -----------------------------------------------------------------------------
-// ImplementationTable
-// Required by ECom plugin interface, tells the entry point of the library
-// -----------------------------------------------------------------------------
-const TImplementationProxy ImplementationTable[] = 
-    {
-    IMPLEMENTATION_PROXY_ENTRY( KContactsGrpDataProviderImplUid, CContactsGrpDataProvider::NewL )
-    };
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy
-// Returns the implementation table, required by the ECom plugin interface
-// -----------------------------------------------------------------------------
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
-    {
-    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
-    return ImplementationTable;
-    }	
--- a/omads/omadsextensions/adapters/contactsgroup/src/contactsgrpdataprovider.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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:  Resource definitions for ContactsGroup DS ECOM plug-in
-*
-*/
-
-
-#include <ecom/registryinfo.rh> 
-
-RESOURCE REGISTRY_INFO theRegistryInfo
-  {
-  dll_uid = 0x101FF972; //The DLL's 3rd UID.
-  interfaces = 
-      {
-      INTERFACE_INFO
-          {
-          interface_uid = 0x101F4D3A; // Constant for all DS plug ins
-          implementations = 
-            {
-            IMPLEMENTATION_INFO
-                {
-                implementation_uid = 0x101FF972; // DS interface implementation UID
-                version_no = 1; 
-                display_name = "Contacts Group" ; // shown in UI
-                }
-            };
-          }
-      };
-    }
--- a/omads/omadsextensions/adapters/contactsgroup/src/contactsgrpdatastore.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1268 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-
-#include <sysutil.h> 
-#include <cntfldst.h>
-
-#include "contactsgrpdatastore.h"
-#include "contactsgrpconverter.h"
-#include "changefinder.h"
-#include "contactsgrpdataproviderdefs.h"
-#include "logger.h"
-
-const TInt KDefaultBufferSize = 1024;
-const TInt KDataBufferNotReady = -1;
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::CContactsGrpDataStore
-// C++ default constructor can NOT contain any code, that might leave.
-// -----------------------------------------------------------------------------
-CContactsGrpDataStore::CContactsGrpDataStore() :
-    iKey( TKeyArrayFix( _FOFF( TNSmlSnapshotItem, ItemId() ), ECmpTInt ) )
-    {
-    TRACE_FUNC;
-    }
-    
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::ConstructL
-// Symbian 2nd phase constructor, can leave.
-// -----------------------------------------------------------------------------    
-void CContactsGrpDataStore::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    User::LeaveIfError( iFs.Connect() );
-    
-    iNewItems       = new ( ELeave ) CNSmlDataItemUidSet;
-    iDeletedItems   = new ( ELeave ) CNSmlDataItemUidSet;
-    iUpdatedItems   = new ( ELeave ) CNSmlDataItemUidSet;
-    iEmptyList      = new ( ELeave ) CNSmlDataItemUidSet;
-    
-    iConverter = CContactsGrpConverter::NewL();
-    
-    TRACE_FUNC_EXIT;
-    }
-    
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::~CContactsGrpDataStore
-// Destructor
-// -----------------------------------------------------------------------------    
-CContactsGrpDataStore::~CContactsGrpDataStore()
-    {
-    TRACE_FUNC_ENTRY;
-
-    delete iDataBuffer;
-    delete iNewItems;
-    delete iDeletedItems;
-    delete iUpdatedItems;
-    delete iEmptyList;
-    
-    if ( iChangeFinder )
-        {
-        TRAPD( error, iChangeFinder->CloseL() );
-        if ( error != KErrNone )
-            {
-            LOGGER_WRITE_1( "iChangeFinder->CloseL() leaved with %d", error );
-            }
-        }
-    delete iChangeFinder;
-    
-    delete iConverter;
-    
-    delete iContactsDb;
-    
-    iFs.Close();
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CContactsGrpDataStore* CContactsGrpDataStore::NewL()
-    {
-    TRACE_FUNC_ENTRY;
-    CContactsGrpDataStore* self = CContactsGrpDataStore::NewLC();
-    CleanupStack::Pop( self );
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::NewLC
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CContactsGrpDataStore* CContactsGrpDataStore::NewLC()
-    {
-    TRACE_FUNC_ENTRY;
-    CContactsGrpDataStore* self = new ( ELeave ) CContactsGrpDataStore();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    TRACE_FUNC_EXIT;
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoOpenL
-// Opens database.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoOpenL( const TDesC& /*aStoreName*/,
-    MSmlSyncRelationship& aContext, TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iCallerStatus = &aStatus;           
-    *iCallerStatus = KRequestPending;
-    
-    if ( iContactsDb )
-        {
-        // already opened
-        User::RequestComplete( iCallerStatus, KErrInUse );
-        LOGGER_WRITE( "CContactsGrpDataStore::DoOpenL failed with KErrInUse." );
-        return;
-        }
-    
-    // Create ChangeFinder
-    if ( iChangeFinder )
-        {
-        delete iChangeFinder;
-        iChangeFinder = NULL;
-        }
-    iChangeFinder = CChangeFinder::NewL( aContext, iKey, iHasHistory );
-    
-    iContactsDb = CContactDatabase::OpenL();
-    
-    RegisterSnapshotL();
-    
-    User::RequestComplete( iCallerStatus, KErrNone );
-    TRACE_FUNC_EXIT;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoCancelRequest
-// Not supported, does nothing.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoCancelRequest()
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoStoreName
-// Returns the name of the DataStore
-// -----------------------------------------------------------------------------
-const TDesC& CContactsGrpDataStore::DoStoreName() const
-    {
-    TRACE_FUNC;
-    
-    if ( iContactsDb )
-        {
-        return KContactsGrpStoreName;
-        }
-    else
-        {
-        return KNullDesC;
-        }
-    }
-    
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoBeginTransactionL
-// Transactions are not supported.
-// -----------------------------------------------------------------------------    
-void CContactsGrpDataStore::DoBeginTransactionL()
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoCommitTransactionL
-// Transactions are not supported.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoCommitTransactionL( TRequestStatus& aStatus )
-    {
-    TRACE_FUNC;
-    iCallerStatus = &aStatus;
-    User::RequestComplete( iCallerStatus, KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoRevertTransaction
-// Transactions are not supported.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoRevertTransaction( TRequestStatus& aStatus )
-    {
-    TRACE_FUNC;
-    iCallerStatus = &aStatus;
-    User::RequestComplete( iCallerStatus, KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoBeginBatchL
-// Batching is not supported.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoBeginBatchL()
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoCommitBatchL
-// Batching is not supported
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoCommitBatchL( RArray<TInt>& /*aResultArray*/, TRequestStatus& aStatus )
-    {
-    TRACE_FUNC;
-    iCallerStatus = &aStatus;
-    User::RequestComplete( iCallerStatus, KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoCancelBatch
-// Batching is not supported
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoCancelBatch()
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoSetRemoteStoreFormatL
-// Not supported
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoSetRemoteStoreFormatL( const CSmlDataStoreFormat& /*aServerDataStoreFormat*/ )
-    {
-    TRACE_FUNC;
-    }
-    
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoSetRemoteMaxObjectSize
-// Not supported
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoSetRemoteMaxObjectSize( TInt /*aServerMaxObjectSize*/ )
-    {
-    TRACE_FUNC;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoMaxObjectSize
-// Reads the maximum object size from the central repository
-// -----------------------------------------------------------------------------
-TInt CContactsGrpDataStore::DoMaxObjectSize() const
-    {
-    TRACE_FUNC;
-    return 0; // no limit
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoOpenItemL
-// Opens item in the DataStore, reads it (either completely or partially) 
-// to the temporary buffer where it can be later read to the remote database.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoOpenItemL(
-    TSmlDbItemUid aUid, 
-    TBool& aFieldChange, 
-    TInt& aSize, 
-    TSmlDbItemUid& aParent, 
-    TDes8& aMimeType, 
-    TDes8& aMimeVer, 
-    TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aUid: %d", aUid );
-    
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    aFieldChange = EFalse;
-    aParent = KErrNotFound;
-    
-    delete iDataBuffer;
-    iDataBuffer = NULL;
-    
-    if ( !iContactsDb )
-        {
-        User::Leave( KErrNotReady );
-        }
-    
-    iDataBuffer = CBufFlat::NewL( KDefaultBufferSize ); 
-    iReaderPosition = 0;
-    
-    CContactItem* item = iContactsDb->ReadContactLC( aUid );
-    if ( item->Type() != KUidContactGroup )
-        {
-        CleanupStack::PopAndDestroy( item );
-        User::Leave( KErrNotFound );
-        }
-
-    iConverter->ImportDbItemL( *static_cast<CContactGroup*>(item) );
-    
-    CleanupStack::PopAndDestroy( item );
-    
-    iConverter->ExportVCardL( *iDataBuffer );
-    iConverter->ResetL();
-    aSize = iDataBuffer->Size();
-    
-    // Set mime type to correct one
-    AssignString( aMimeType, KContactsGrpItemMimeType );
-    AssignString( aMimeVer, KContactsGrpItemMimeVersion );
-    
-    User::RequestComplete( iCallerStatus, KErrNone );   
-    iCurrentState = EContactGrpOpening;
-    
-    TRACE_FUNC_EXIT;   
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoCreateItemL
-// Create new item to the message store.
-// Return the id number of the newly created item
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoCreateItemL(
-    TSmlDbItemUid& aUid, 
-    TInt aSize, 
-    TSmlDbItemUid /*aParent*/, 
-    const TDesC8& /*aMimeType*/, 
-    const TDesC8& /*aMimeVer*/, 
-    TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Ensure that we're in a proper state
-    if ( iCurrentState != EOpenAndWaiting )
-        {
-        LOGGER_WRITE_1( "Warning: Unexpected current state: %d", iCurrentState );
-        }
-        
-    if ( !iContactsDb )
-        {
-        LOGGER_WRITE( "iContactsDb not ready" );
-        User::Leave( KErrNotReady );
-        }
-    
-    // Ensure that we've got enough disk space for the item
-    if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, aSize, EDriveC ) )
-        {
-        User::RequestComplete( iCallerStatus, KErrDiskFull );
-        LOGGER_WRITE( "SysUtil::DiskSpaceBelowCriticalLevelL failed with KErrDiskFull." );
-        return;
-        }
-    
-    // item uid is updated when groups is saved to db.
-    iCurrentItem = &aUid; 
-    // Save current operation-state so we know what operation
-    // is needed to do on DoCommitItemL
-    iCurrentState = EContactGrpCreating;
-                
-    delete iDataBuffer;
-    iDataBuffer = NULL;
-    iDataBuffer = CBufFlat::NewL( KDefaultBufferSize );
-    iWriterPosition = 0;
-    
-    User::RequestComplete( iCallerStatus, KErrNone );  
-    TRACE_FUNC_EXIT;    
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoReplaceItemL
-// Begin the replace operation, ensure that the item really exists
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoReplaceItemL(
-    TSmlDbItemUid aUid, 
-    TInt aSize, 
-    TSmlDbItemUid /*aParent*/,
-    TBool /*aFieldChange*/, 
-    TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aUid: %d", aUid);
-    
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    if ( !iContactsDb )
-        {
-        LOGGER_WRITE( "iContactsDb not ready" );
-        User::Leave( KErrNotReady );
-        }
-        
-    // Ensure that we've got enough disk space for the item
-    if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, aSize, EDriveC ) )
-        {
-        User::RequestComplete( iCallerStatus, KErrDiskFull );
-        LOGGER_WRITE( "SysUtil::DiskSpaceBelowCriticalLevelL failed with KErrDiskFull." );
-        return;
-        }
-    
-    // check that item exist and is Group-type
-    CContactItem* item = iContactsDb->ReadContactLC( aUid );
-    if ( item->Type() != KUidContactGroup )
-        {
-        CleanupStack::PopAndDestroy( item );
-        User::Leave( KErrNotFound );
-        }
-    CleanupStack::PopAndDestroy( item );
-    
-    // init databuffer
-    delete iDataBuffer;
-    iDataBuffer = NULL;
-    iDataBuffer = CBufFlat::NewL( KDefaultBufferSize );
-    iWriterPosition = 0;
-    
-    // Save current item, so we know what item needs to be replaced
-    iItemToBeReplaced = aUid;
-    // Save current operation-state so we know what operation
-    // is needed to do on DoCommitItemL
-    iCurrentState = EContactGrpUpdating;
-    
-    User::RequestComplete( iCallerStatus, KErrNone );   
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoReadItemL
-// Read specified amount of data from the temporary buffer
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoReadItemL( TDes8& aBuffer )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    if ( iCurrentState != EContactGrpOpening || !iDataBuffer )
-        {
-        LOGGER_WRITE_1( "Unexpected state %d", iCurrentState );
-        User::Leave( KErrNotReady );
-        }
-        
-    if ( iReaderPosition == KDataBufferNotReady )
-        {
-        LOGGER_WRITE( "No data to read" );
-        User::Leave( KErrEof );
-        }
-    
-    // Thiw is how much data there is left in the buffer    
-    TInt left = iDataBuffer->Size() - iReaderPosition;
-    
-    if ( left > 0 )
-        {
-        // This is how much there's space in the destination buffer
-        TInt destSize = aBuffer.MaxSize();
-        
-        // This is how much we can read
-        TInt toRead = destSize < left ? destSize : left;
-        
-        // Read the data from the buffer, then update the position      
-        iDataBuffer->Read( iReaderPosition, aBuffer, toRead );
-        iReaderPosition += toRead;
-        }
-    else
-        {
-        iReaderPosition = KDataBufferNotReady;
-        LOGGER_WRITE( "No data to read" );
-        User::Leave( KErrEof );
-        }   
-        
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoWriteItemL
-// Write specified amount of data to the temporary buffer
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoWriteItemL( const TDesC8& aData )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    if ( iCurrentState != EContactGrpCreating && iCurrentState != EContactGrpUpdating )
-        {
-        LOGGER_WRITE_1( "Unexpected current state: %d", iCurrentState );
-        User::Leave( KErrNotReady );
-        }
-    
-    // Calculate total size
-    TInt totalSize = aData.Size() + iDataBuffer->Size();
-
-    // Ensure that we've got enough disk space for the item
-    if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, totalSize, EDriveC ) )
-        {
-        User::RequestComplete( iCallerStatus, KErrDiskFull );
-        LOGGER_WRITE("SysUtil::DiskSpaceBelowCriticalLevelL failed with KErrDiskFull.");
-        return;
-        }
-        
-    // Add data to buffer       
-    iDataBuffer->InsertL( iWriterPosition, aData );
-    iWriterPosition += aData.Size();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoCommitItemL
-// Commits item from temporary buffer to the message store
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoCommitItemL( TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Check that we're in proper state
-    if ( iCurrentState != EContactGrpCreating && iCurrentState != EContactGrpUpdating )
-        {
-        User::RequestComplete( iCallerStatus, KErrNotReady );
-        LOGGER_WRITE_1( "Unexpected current state: %d", iCurrentState );
-        return;
-        }
-        
-    if ( iDataBuffer->Size() <= 0 )
-        {
-        User::RequestComplete( iCallerStatus, KErrNotReady );
-        LOGGER_WRITE_1( "Data buffer has no data (%d)", iDataBuffer->Size() );
-        return; 
-        }
-    
-    if ( !iContactsDb )
-        {
-        LOGGER_WRITE( "iContactsDb not ready" );
-        User::Leave( KErrNotReady );
-        }
-
-    iDataBuffer->Compress();
-    iConverter->ImportVCardL( iDataBuffer->Ptr(0) );
-    
-    const CContactIdArray& contactArr = iConverter->ItemsContained();
-    
-    if ( iCurrentState == EContactGrpCreating )
-        {
-        *iCurrentItem = CreateNewGroupL( iConverter->GroupLabel(), contactArr );
-        }
-    else
-        {
-        ReplaceGroupL( iItemToBeReplaced, iConverter->GroupLabel(), contactArr);
-        }
-    iConverter->ResetL();
-    
-    // Destroy buffer
-    delete iDataBuffer;
-    iDataBuffer = NULL;
-    iWriterPosition = 0;
-    
-    // Restore state and signal we're done
-    iCurrentState = EOpenAndWaiting;
-    User::RequestComplete( iCallerStatus, KErrNone );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::CreateNewGroupL
-// Creates new groupd to db.
-// -----------------------------------------------------------------------------
-TContactItemId CContactsGrpDataStore::CreateNewGroupL( const TDesC& aLabel,
-        const CContactIdArray& aContactArray )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aLabel: %S", &aLabel );
-    
-    // Check for duplicates
-    if ( GroupNameExistsL( aLabel ) )
-        {
-        LOGGER_WRITE("Duplicate group name found, leave KErrAlreadyExists");
-        User::Leave( KErrAlreadyExists );
-        }
-    
-    CContactGroup* group =
-        static_cast<CContactGroup*>
-        (iContactsDb->CreateContactGroupLC( aLabel ));
-    
-    // Create new contact group
-    
-    TContactItemId groupId = group->Id();
-    LOGGER_WRITE_1("new group id: %d", groupId);
-    
-    TBool partiallyUpdated(EFalse);
-    TTime lastMod;
-    lastMod.UniversalTime();
-    TInt err(KErrNone);
-    for ( TInt i=0; i<aContactArray.Count(); i++ )
-        {
-        LOGGER_WRITE_1("Add contact: %d", aContactArray[i] );
-        TRAP( err, iContactsDb->AddContactToGroupL( aContactArray[i], groupId ));
-        if ( err )
-            {
-            LOGGER_WRITE_2("Warning: AddContactToGroupL, contact: %d, err: %d", aContactArray[i], err);
-            partiallyUpdated = ETrue;
-            }
-        else
-            {
-            // If succesfully added, update contact timestamp so contact sync sees those
-            // contacts as changed ones.
-            UpdateContactLastMod( aContactArray[i], lastMod );
-            }
-        }
-    
-    CleanupStack::PopAndDestroy( group );
-    group = NULL;
-    
-    // if item was only partially updated, do not register to snapshot
-    //   --> on next sync item is marked as updated
-    if ( !partiallyUpdated )
-        {
-        // reload group
-        group = static_cast<CContactGroup*>
-            (iContactsDb->ReadContactLC( groupId ));
-        // Inform ChangeFinder of new item
-        TSnapshotItem snapshotItem( groupId );
-        snapshotItem.CreateHashL( *group );
-        iChangeFinder->ItemAddedL( snapshotItem );
-        
-        CleanupStack::PopAndDestroy( group );
-        }
-    
-    
-    
-    TRACE_FUNC_EXIT;
-    return groupId;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::ReplaceGroupL
-// Replaces existing group on db
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::ReplaceGroupL( TContactItemId aGroupId, const TDesC& aLabel,
-            const CContactIdArray& aContactArray )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aGroupId: %d", aGroupId);
-    LOGGER_WRITE_1("aLabel: %S", &aLabel);
-    TBool partiallyUpdated(EFalse);
-    // check that item exist and is Group-type
-    // The LX suffix means that the lock record of the contact item is left on the cleanup stack.
-    CContactItem* item = iContactsDb->OpenContactLX( aGroupId );
-    CleanupStack::PushL( item );
-    if ( item->Type() != KUidContactGroup )
-        {
-        LOGGER_WRITE("Type was not KUidContactGroup, leaving KErrNotFound");
-        User::Leave( KErrNotFound );
-        }
-    
-    // cast item to CContactGroup type
-    CContactGroup* groupItem = static_cast<CContactGroup*>(item);
-    TContactItemId groupId = groupItem->Id();
-    
-    TBool labelUpdated(EFalse);
-    // Check is group label changed
-    if ( groupItem->HasItemLabelField() )
-        {
-        TPtrC dbLabel = groupItem->GetGroupLabelL();
-        if ( aLabel.Compare( dbLabel ) != 0 )
-            {
-            // didn't match, update label.
-            // Check that new name does not already exist
-            if ( GroupNameExistsL( aLabel ) )
-                {
-                LOGGER_WRITE("Name already exists, leave KErrAlreadyExists");
-                User::Leave( KErrAlreadyExists );
-                }
-            LOGGER_WRITE("Update label" );
-            groupItem->SetGroupLabelL( aLabel );
-            iContactsDb->CommitContactL( *item );
-            labelUpdated = ETrue;
-            }
-        }
-    TTime lastMod;
-    lastMod.UniversalTime();
-    // Update joined contacts
-    TInt err(KErrNone);
-    // add new items to current group
-    for ( TInt i=0; i<aContactArray.Count(); i++ )
-        {
-        TContactItemId newItem = aContactArray[i];
-        TBool founded = groupItem->ContainsItem( newItem );
-        if ( !founded )
-            {
-            // item does not exist on current group, add it.
-            LOGGER_WRITE_1("Add contact: %d", newItem)
-            TRAP( err, iContactsDb->AddContactToGroupL( newItem, groupId ));
-            if ( err )
-                {
-                LOGGER_WRITE_2("Warning: Could not add contact: %d, err: %d", newItem, err);
-                partiallyUpdated = ETrue;
-                }
-            else
-                {
-                // Update contact timestamp
-                UpdateContactLastMod( newItem, lastMod );
-                }
-            }
-        else
-            {
-            LOGGER_WRITE_1("contact( %d ) already exist on group, no need to update", newItem)
-            }
-        }
-    
-    // remove all missing items from group
-    CContactIdArray* oldIdArr = groupItem->ItemsContainedLC();
-    if ( oldIdArr )
-        {
-        for ( TInt i=0; i<oldIdArr->Count(); i++ )
-            {
-            TContactItemId oldItem = (*oldIdArr)[i];
-            TInt err = aContactArray.Find( oldItem );
-            if ( err == KErrNotFound )
-                {
-                LOGGER_WRITE_1("Remove contact: %d", oldItem );
-                // old item was not found from new item list, remove it.
-                TRAP( err, iContactsDb->RemoveContactFromGroupL(oldItem, groupId));
-                if ( err )
-                    {
-                    LOGGER_WRITE_2("Warning: Could not remove contact: %d, err: ",oldItem, err );
-                    partiallyUpdated = ETrue;
-                    }
-                else
-                    {
-                    UpdateContactLastMod( oldItem, lastMod );
-                    }
-                }
-            // Update all contacts in group if label is changed
-            else if ( labelUpdated )
-                {
-                UpdateContactLastMod( oldItem, lastMod );
-                }
-            }
-        }
-    CleanupStack::PopAndDestroy( oldIdArr );
-    CleanupStack::PopAndDestroy( 2 ); // item, lock object 
-    
-    // if item was only partially updated, do not register to snapshot
-    //   --> on next sync item is marked as updated
-    if ( !partiallyUpdated )
-        {
-        // reload group
-        groupItem = NULL;
-        groupItem = static_cast<CContactGroup*>
-            (iContactsDb->ReadContactLC( groupId ));
-        // Inform ChangeFinder of updated item
-        TSnapshotItem snapshotItem( groupId );
-        snapshotItem.CreateHashL( *groupItem );
-        iChangeFinder->ItemUpdatedL( snapshotItem );
-        
-        CleanupStack::PopAndDestroy( groupItem );
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoCloseItem
-// Closes open item in the data store
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoCloseItem()
-    {
-    TRACE_FUNC_ENTRY;
-    // Reset read buffer 
-    iReaderPosition = KDataBufferNotReady;
-    delete iDataBuffer;
-    iDataBuffer = NULL;
-    
-    // Make sure that we're opened an item
-    if ( iCurrentState != EContactGrpOpening )
-        {
-        LOGGER_WRITE_1( "WARNING: Invalid state %d.", iCurrentState );
-        }
-    // Start to wait for the next operation     
-   iCurrentState = EOpenAndWaiting;
-    
-    TRACE_FUNC_EXIT;   
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoMoveItemL
-// Not supported.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoMoveItemL( TSmlDbItemUid /*aUid*/,
-    TSmlDbItemUid /*aNewParent*/, TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Restore state and signal we're done
-    User::RequestComplete( iCallerStatus, KErrNotSupported );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoDeleteItemL
-// Removes item from the message store
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aUid: %d", aUid );
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Check that we're in proper state
-    if ( iCurrentState != EOpenAndWaiting ) 
-        {
-        LOGGER_WRITE_1("CContactsGrpDataStore::DoDeleteItemL, Incorrect state: %d", iCurrentState);
-        }
-    
-    if ( !iContactsDb )
-        {
-        LOGGER_WRITE( "iContactsDb not ready" );
-        User::Leave( KErrNotReady );
-        }
-    
-    // check that item type is ContactGroup
-    CContactItem* item = iContactsDb->ReadContactLC( aUid );
-    if ( item->Type() != KUidContactGroup )
-        {
-        LOGGER_WRITE("Item was not ContactGroup");
-        CleanupStack::PopAndDestroy( item );
-        User::Leave( KErrNotFound );
-        }
-    
-    // Update all contacts in group
-    CContactGroup* groupItem = static_cast<CContactGroup*>(item);
-    CContactIdArray* contactArr = groupItem->ItemsContainedLC();
-    if ( contactArr )
-        {
-        TTime lastMod;
-        lastMod.UniversalTime();
-        for ( TInt i=0; i<contactArr->Count(); i++ )
-            {
-            TContactItemId contactId = (*contactArr)[i];
-            UpdateContactLastMod( contactId, lastMod );
-            }
-        }
-    CleanupStack::PopAndDestroy( contactArr );
-    CleanupStack::PopAndDestroy( item );
-    
-    // delete group
-    iContactsDb->DeleteContactL( aUid );
-    
-    TSnapshotItem snapshotItem( aUid );     
-    iChangeFinder->ItemDeleted( snapshotItem );
-    
-    User::RequestComplete( iCallerStatus, KErrNone );
-        
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoSoftDeleteItemL
-// Soft delete isn't supported.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoSoftDeleteItemL(TSmlDbItemUid /*aUid*/, TRequestStatus& aStatus)
-    {
-    TRACE_FUNC_ENTRY;
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    User::RequestComplete(iCallerStatus, KErrNotSupported); 
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoDeleteAllItemsL
-// Deletes all items in the standard folders of bookmark store
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoDeleteAllItemsL( TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    if ( !iContactsDb )
-        {
-        LOGGER_WRITE( "iContactsDb is not opened, Leaving KErrNotReady");
-        User::Leave( KErrNotReady );
-        }
-    
-    CContactIdArray* groups = iContactsDb->GetGroupIdListL();
-    if ( groups )
-        {
-        CleanupStack::PushL( groups );
-        TTime lastMod;
-        lastMod.UniversalTime();
-        
-        // update all contacts in all groups
-        for ( TInt i=0; i<groups->Count(); i++ )
-            {
-            // check that item type is ContactGroup
-            CContactItem* item = iContactsDb->ReadContactLC( (*groups)[i] );
-            
-            // Update all contacts in group
-            CContactGroup* groupItem = static_cast<CContactGroup*>(item);
-            CContactIdArray* contactArr = groupItem->ItemsContainedLC();
-            if ( contactArr )
-                {
-                for ( TInt i=0; i<contactArr->Count(); i++ )
-                    {
-                    TContactItemId contactId = (*contactArr)[i];
-                    UpdateContactLastMod( contactId, lastMod );
-                    }
-                }
-            CleanupStack::PopAndDestroy( contactArr );
-            CleanupStack::PopAndDestroy( item );
-            }
-        
-        // delete all groups
-        iContactsDb->DeleteContactsL( *groups );
-        CleanupStack::PopAndDestroy( groups );
-        }
-    
-    // Reset the whole change finder
-    iChangeFinder->ResetL();
-    
-    User::RequestComplete( iCallerStatus, KErrNone );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoHasSyncHistory
-// This method returns ETrue if Data Store has history information. 
-// Slow-sync will be used if Data Store does not have history information.
-// -----------------------------------------------------------------------------
-TBool CContactsGrpDataStore::DoHasSyncHistory() const
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "iHasHistory: %d", iHasHistory );
-    TRACE_FUNC_EXIT;  
-    return iHasHistory;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoAddedItems
-// This method returns UIDs of added items. Those items are added after previous
-// synchronization with current synchronization relationship. 
-// -----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CContactsGrpDataStore::DoAddedItems() const
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Clear new-items array
-    iNewItems->Reset();
-    if ( !iChangeFinder )
-        {
-        LOGGER_WRITE( "WARNING: Not ready, returns empty item list" );
-        return *iNewItems;      
-        }
-    
-    // Search for new items
-    TRAPD( error, iChangeFinder->FindNewItemsL( *iNewItems ) )
-    if ( error != KErrNone )
-        {
-        LOGGER_WRITE_1( "CContactsGrpDataStore::DoAddedItems, iChangeFinder->FindNewItemsL leaved with %d.", error );
-        } 
-    
-    LOGGER_WRITE_1( "New item count: %d.", iNewItems->ItemCount() );    
-    TRACE_FUNC_EXIT;
-    
-    return *iNewItems;  
-    }
-    
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoDeletedItems
-// Returns ids of items, which are deleted after previous synchronization
-// -----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CContactsGrpDataStore::DoDeletedItems() const
-    {
-    TRACE_FUNC_ENTRY;    
-    
-    // Clear deleted-items array
-    iDeletedItems->Reset();
-    if ( !iChangeFinder )
-        {
-        LOGGER_WRITE( "WARNING: Not ready, returns empty item list" );
-        return *iDeletedItems;      
-        }
-    
-    // Search for deleted items
-    TRAPD( error, iChangeFinder->FindDeletedItemsL( *iDeletedItems ) );
-    if ( error != KErrNone )
-        {
-        LOGGER_WRITE_1( "CContactsGrpDataStore::DoDeletedItems, iChangeFinder->FindDeletedItemsL leaved with %d.", error );
-        }
-    
-    LOGGER_WRITE_1( "Deleted item count: %d.", iDeletedItems->ItemCount() );
-    TRACE_FUNC_EXIT;
-    return *iDeletedItems;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoSoftDeletedItems
-// Not directly supported, empty list returned
-// -----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CContactsGrpDataStore::DoSoftDeletedItems() const
-    {
-    TRACE_FUNC;
-    // Return empty array as a result
-    return *iEmptyList;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoModifiedItems
-// Finds all modified items in the data store
-// -----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CContactsGrpDataStore::DoModifiedItems() const
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Clear updated-items array
-    iUpdatedItems->Reset();
-    if ( !iChangeFinder )
-        {
-        LOGGER_WRITE( "WARNING: Not ready, returns empty item list" );
-        return *iUpdatedItems;      
-        }
-    
-    // Search for updated items
-    TRAPD( error, iChangeFinder->FindChangedItemsL( *iUpdatedItems ) )
-    if ( error != KErrNone )
-        {
-        LOGGER_WRITE_1( "CContactsGrpDataStore::DoModifiedItems, iChangeFinder->FindChangedItemsL leaved with %d.", error );
-        }
-    
-    LOGGER_WRITE_1( "Modified item count: %d.", iUpdatedItems->ItemCount() );
-    TRACE_FUNC_EXIT;     
-    return *iUpdatedItems;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoMovedItems
-// Finds all moved items in the data store
-// -----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CContactsGrpDataStore::DoMovedItems() const
-    {
-    TRACE_FUNC;
-    // Moved items are not supported
-    // Return empty array as a result
-    return *iEmptyList;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoResetChangeInfoL
-// Resets change history in the data store. All content is considered
-// new in the data store point of view.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Check that we're in proper state
-    if ( iCurrentState != EOpenAndWaiting ) 
-        {
-        LOGGER_WRITE_1( "CContactsGrpDataStore::DoResetChangeInfoL, invalid state %d.", iCurrentState );
-        }   
-            
-    // Reset change info in ChangeFinder
-    iChangeFinder->ResetL();
-    iHasHistory = EFalse;
-    
-    // Signal we're done
-    User::RequestComplete( iCallerStatus, KErrNone );   
-        
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoCommitChangeInfoL
-// Commits change info. These items are no longer reported, when change
-// information is being queried.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus,
-    const MSmlDataItemUidSet& aItems )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Ensure that we're in a proper state
-    if ( iCurrentState != EOpenAndWaiting ) 
-        {
-        LOGGER_WRITE_1( "CContactsGrpDataStore::DoCommitChangeInfoL, invalid state %d.", iCurrentState );
-        }
-
-    // Notify ChangeFinder
-    LOGGER_WRITE_1( "CContactsGrpDataStore::DoCommitChangeInfoL, item count %d.", aItems.ItemCount() );
-    iChangeFinder->CommitChangesL( aItems );
-    iHasHistory = ETrue;
-        
-    // Signal we're done
-    User::RequestComplete( iCallerStatus, KErrNone );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::DoCommitChangeInfoL
-// Commits change info. There is no more nothing to report when change
-// information is being queried. 
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Ensure that we're in a proper state
-    if ( iCurrentState != EOpenAndWaiting ) 
-        {
-        LOGGER_WRITE_1( "CContactsGrpDataStore::DoCommitChangeInfoL, invalid state %d.", iCurrentState );
-        }
-    
-    // Notify ChangeFinder
-    iChangeFinder->CommitChangesL();
-    iHasHistory = ETrue;
-        
-    // Signal we're done
-    User::RequestComplete( iCallerStatus, KErrNone );
-        
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::RegisterSnapshotL
-// Sets Changefinder to compare against current message store content
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::RegisterSnapshotL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    CArrayFixSeg<TSnapshotItem>* snapshot = 
-        new ( ELeave ) CArrayFixSeg<TSnapshotItem>( KSnapshotGranularity );
-    CleanupStack::PushL( snapshot );
-    
-    // Add everything to snapshot
-    
-    // GetGroupIdListL returns NULL if there are no groups in the database.
-    CContactIdArray* groups = iContactsDb->GetGroupIdListL();
-    if ( groups )
-        {
-        TKeyArrayFix key( iKey );
-        CleanupStack::PushL( groups );
-        for ( TInt i=0; i<groups->Count(); i++ )
-            {
-            CContactItem* item = iContactsDb->ReadContactLC((*groups)[i]);
-            CContactGroup* groupItem = static_cast<CContactGroup*>(item);
-            
-            LOGGER_WRITE_1( "Add group to snatshot, group id: %d",groupItem->Id() );
-            
-            TSnapshotItem snapshotItem( groupItem->Id() );
-            snapshotItem.CreateHashL( *groupItem );
-            
-            snapshot->InsertIsqL( snapshotItem, key );
-            
-            CleanupStack::PopAndDestroy( item );
-            }
-        CleanupStack::PopAndDestroy( groups );
-        }
-    
-    // Set new snapshot to compare against
-    iChangeFinder->SetNewSnapshot( snapshot );
-    
-    // Changefinder takes ownership of the snapshot
-    CleanupStack::Pop( snapshot );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::AssignString
-// Assigns data from one descriptor into another, truncates if too long 
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::AssignString( TDes8& aDestination, const TDesC8& aSource )
-    {
-    TInt targetLength = aSource.Length();
-    if ( aDestination.MaxLength() < targetLength )
-        {
-        targetLength = aDestination.MaxLength();
-        }
-        
-    aDestination.Copy( aSource.Ptr(), targetLength );
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::UpdateContactLastMod
-// Updates contact item last modified time. Contact sync will see item as changed one.
-// -----------------------------------------------------------------------------
-void CContactsGrpDataStore::UpdateContactLastMod( TContactItemId aContactId,
-        const TTime& aLastModified )
-    {
-    // Ignore errors.
-    // Cannot update timestamp if contact is already open. However modified time
-    // is most likely still updated by UI.
-    TRAP_IGNORE(
-        // OpenContactLX() places the edit lock on the cleanup stack
-        CContactItem* contact = iContactsDb->OpenContactLX( aContactId );
-        CleanupStack::PushL( contact );
-        contact->SetLastModified( aLastModified );
-        iContactsDb->CommitContactL( *contact );
-        CleanupStack::PopAndDestroy( contact );
-        CleanupStack::PopAndDestroy( 1 ); // lock object
-        );
-    }
-
-// -----------------------------------------------------------------------------
-// CContactsGrpDataStore::GroupNameExistsL
-// Checks does group name already exists.
-// -----------------------------------------------------------------------------
-TBool CContactsGrpDataStore::GroupNameExistsL( const TDesC& aLabel )
-    {
-    TBool duplicateFound( EFalse );
-    // GetGroupIdListL returns NULL if there are no groups in the database.
-    CContactIdArray* groups = iContactsDb->GetGroupIdListL();
-    if ( groups )
-        {
-        CleanupStack::PushL( groups );
-        for ( TInt i=0; i<groups->Count() && !duplicateFound; i++ )
-            {
-            CContactItem* item = iContactsDb->ReadContactLC((*groups)[i]);
-            CContactGroup* groupItem = static_cast<CContactGroup*>(item);
-            
-            if ( groupItem->HasItemLabelField() )
-                {
-                TPtrC label = groupItem->GetGroupLabelL();
-                if ( aLabel.Compare( label ) == 0 )
-                    {
-                    duplicateFound = ETrue;
-                    }
-                }
-            CleanupStack::PopAndDestroy( item );
-            }
-        CleanupStack::PopAndDestroy( groups );
-        }
-    
-    return duplicateFound;
-    }
--- a/omads/omadsextensions/adapters/contactsgroup/src/contactsgrpdatastore.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Resource data for ContactsGroup DS Plug In Adapter
-*
-*/
-
-
-#include <SmlDataFormat.rh>
-#include <SmlDataFormat.hrh>
-
-RESOURCE SML_DATA_STORE_FORMAT CONTACTSGROUP_DATA_STORE
-    {
-    version = 1;
-    display_name = "Gallery";
-    sync_types = KSmlSyncType_TwoWay
-                + KSmlSyncType_OneWayFromSvr
-                + KSmlSyncType_OneWayFromClnt
-                + KSmlSyncType_SlowSync
-                + KSmlSyncType_RefreshFromSvr
-                + KSmlSyncType_RefreshFromClnt;
-    mime_format=
-        {
-        SML_MIME_FORMAT
-            {
-            version = 1;
-            mime_type = "text/x-vCard";
-            mime_ver = "2.1";
-            properties= 
-                {
-                SML_DATA_PROPERTY
-                    {
-                    version = 1;
-                    display_name = "Read";
-                    name = "read";
-                    data_type = "bool";
-                    enum_values = {};
-                    flags = 0;
-                    max_size = 0;
-                    max_occur = 1;
-                    params = {};
-                    }
-                };
-            field_level = 0;
-            }        
-        };
-    mime_format_tx_pref = 0;    // Preferred index for tx
-    mime_format_rx_pref = 0;    // Preferred index for rx
-    folder_properties = {};     // No folder properties
-    filter_capabilities = {};   // No filter capabilities
-    max_size = 0;               // No limit
-    max_items = 0;              // No limit
-    flags = 0x00000010;         // Hierarchical sync supported
-    }
--- a/omads/omadsextensions/adapters/contactsgroup/src/snapshotitem.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +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:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-#include <hash.h>
-#include <utf.h>
-#include <cntitem.h>
-
-#include "snapshotitem.h"
-#include "logger.h"
-
-
-// -----------------------------------------------------------------------------
-// TSnapshotItem::TSnapshotItem
-// C++ default constructor can NOT contain any code, that might leave
-// -----------------------------------------------------------------------------
-TSnapshotItem::TSnapshotItem() : TNSmlSnapshotItem()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// TSnapshotItem::TSnapshotItem
-// Constructor, takes item id as a parameter
-// -----------------------------------------------------------------------------
-TSnapshotItem::TSnapshotItem( const TSmlDbItemUid& aItemId,
-    const TSmlDbItemUid& aParent )
-: TNSmlSnapshotItem( aItemId )
-    {
-    SetParentId( aParent );
-    }
-
-// -----------------------------------------------------------------------------
-// TSnapshotItem::ExternalizeL
-// Writes the contents of this class and it's base to stream
-// -----------------------------------------------------------------------------
-void TSnapshotItem::ExternalizeL( RWriteStream& aStream ) const
-    {
-    TNSmlSnapshotItem::ExternalizeL( aStream );
-    TPckgBuf<THashValue> nameBuf(iHash);
-	aStream << nameBuf;
-    }
-
-// -----------------------------------------------------------------------------
-// TSnapshotItem::InternalizeL
-// Reads the contents of this class and it's base from stream
-// -----------------------------------------------------------------------------
-void TSnapshotItem::InternalizeL( RReadStream& aStream )
-    {
-    TNSmlSnapshotItem::InternalizeL( aStream );
-    TPckgBuf<THashValue> nameBuf;
-	aStream >> nameBuf;
-	iHash = nameBuf();
-    }
-
-// -----------------------------------------------------------------------------
-// TSnapshotItem::CreateHashL
-// Create hash value from group content
-// -----------------------------------------------------------------------------
-void TSnapshotItem::CreateHashL( CContactGroup& aGroup )
-    {
-    CMessageDigest* hash = CMessageDigestFactory::NewDigestLC( CMessageDigest::EMD5 );
-    
-    if ( aGroup.HasItemLabelField() )
-        {
-        TPtrC label = aGroup.GetGroupLabelL();
-        HBufC8* tempBuf = CnvUtfConverter::ConvertFromUnicodeToUtf8L( label );
-        CleanupStack::PushL( tempBuf );
-        hash->Update( tempBuf->Des() );
-        CleanupStack::PopAndDestroy( tempBuf );
-        }
-    
-    // Create text field from items on group
-    CContactIdArray* contactsIdArray = aGroup.ItemsContainedLC();
-    const TInt idBufferMaxSize( 400 );
-    HBufC8* tempIdBuf = HBufC8::NewLC( idBufferMaxSize );
-    TPtr8 tempId = tempIdBuf->Des();
-    const TInt KMaxNumLength(5);
-    if ( contactsIdArray ) // this is NULL if there are no objects
-        {
-        tempId.AppendNum( contactsIdArray->Count(), EHex );
-        for (TInt i=0; i< contactsIdArray->Count(); i++ )
-            {
-            if ( tempId.Length()+KMaxNumLength > tempId.MaxLength() )
-                {
-                // buffer is almost full, don't add any new items
-                LOGGER_WRITE("buffer full");
-                break;
-                }
-            // add item id
-            tempId.AppendNum( (*contactsIdArray)[i] , EHex );
-            }
-        }
-    else
-        {
-        tempId.AppendNum( 0 );
-        }
-    // update hash
-    hash->Update( tempId );
-    
-    iHash.Copy( hash->Final() );
-    
-    CleanupStack::PopAndDestroy( tempIdBuf );
-    CleanupStack::PopAndDestroy( contactsIdArray );
-    CleanupStack::PopAndDestroy( hash );
-    }
-
-// -----------------------------------------------------------------------------
-// TSnapshotItem::Hash
-// Gets Hash
-// -----------------------------------------------------------------------------
-const TDesC8& TSnapshotItem::Hash() const
-    {
-    return iHash;
-    }
Binary file omads/omadsextensions/adapters/mediads/group/2001a9a1.xml has changed
--- a/omads/omadsextensions/adapters/mediads/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  bld file for Media DS adapter
-*
-*/
-
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-./2001a9a1.xml          Z:/private/101f99f6/capability/2001a9a1.xml
-./mediads_stub.sis      /epoc32/data/z/system/install/mediads_stub.sis
-../rom/mediads.iby     CORE_APP_LAYER_IBY_EXPORT_PATH(mediads.iby)
-
-PRJ_MMPFILES
-./mediads.mmp
--- a/omads/omadsextensions/adapters/mediads/group/createstub.bat	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-rem
-rem Copyright (c) 2010 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: Batch file for creating needed stub files.
-rem
-
-makesis -s mediads_stub.pkg
\ No newline at end of file
--- a/omads/omadsextensions/adapters/mediads/group/mediads.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Project definition file for project Media DS adapter
-*
-*/
-
-
-#include <platform_paths.hrh>
-#include <defaultcaps.hrh>
-#include <data_caging_paths.hrh>
-
-TARGET          mediadsprovider.dll
-TARGETTYPE      PLUGIN
-UID             0x10009d8d 0x2001A9A1
-
-CAPABILITY      CAP_ECOM_PLUGIN
-VENDORID        VID_DEFAULT
-
-SOURCEPATH      ../src
-SOURCE          snapshotitem.cpp
-SOURCE          changefinder.cpp
-SOURCE          mediadsprovider.cpp
-SOURCE          mediadsstore.cpp
-SOURCE          mediamanager.cpp
-SOURCE          playlistitem.cpp
-SOURCE          songitem.cpp
-SOURCE          omadsfolderobject.cpp
-SOURCE          cmdemanager.cpp
-
-USERINCLUDE     ../inc
-
-APP_LAYER_SYSTEMINCLUDE
-
-
-START RESOURCE  mediadsprovider.rss
-HEADER
-TARGET          mediadsprovider.rsc
-TARGETPATH      ECOM_RESOURCE_DIR
-END
-
-START RESOURCE  mediadsstore.rss
-HEADER
-TARGET          mediadsstore.rsc
-TARGETPATH      RESOURCE_FILES_DIR
-END
-
-DEBUGLIBRARY    flogger.lib
-LIBRARY         ecom.lib
-LIBRARY         euser.lib
-LIBRARY         efsrv.lib
-LIBRARY         estor.lib
-LIBRARY         smldataprovider.lib
-LIBRARY         smlstoreformat.lib
-LIBRARY         bafl.lib
-LIBRARY         nsmlchangefinder.lib
-LIBRARY         mpxcollectionhelper.lib
-LIBRARY         mpxcommon.lib
-LIBRARY         charconv.lib
-LIBRARY         hash.lib
-LIBRARY         mpxharvesterutility.lib
-LIBRARY         mpxcollectionutility.lib
-LIBRARY         mpxcollectionmediator.lib
-LIBRARY         fbscli.lib
-LIBRARY         metadatautility.lib
-LIBRARY         platformenv.lib
-LIBRARY         mdccommon.lib
-LIBRARY         mdeclient.lib
--- a/omads/omadsextensions/adapters/mediads/group/mediads_stub.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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: 
-;
-
-; Languages
-&EN
-
-; Header
-#{"Media DS Plugin"},(0x2001A9A1),1,20,0, TYPE=SA
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Files to install
-""-"z:\resource\mediadsstore.rsc"
-""-"z:\resource\plugins\mediadsprovider.rsc"
-""-"z:\sys\bin\mediadsprovider.dll"
Binary file omads/omadsextensions/adapters/mediads/group/mediads_stub.sis has changed
--- a/omads/omadsextensions/adapters/mediads/inc/changefinder.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +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:  CChangeFinder class header
-*
-*/
-
-
-
-#ifndef __CHANGEFINDER_H__
-#define __CHANGEFINDER_H__
-
-// INCLUDES
-#include <msvids.h>
-#include <nsmlchangefinder.h>
-#include "snapshotitem.h"
-
-// DATATYPES
-typedef CArrayFixSeg<TSnapshotItem> CSnapshotArray;
-
-// Granularity used with dynamic array
-const TInt KSnapshotGranularity = 32;
-
-// CLASS DECLARATION
-
-/**
- * @brief CChangeFinder Class
- * This is a ChangeFinder class, which can be used to track down changes in the media store.
- * It's functionality is equal to CSmlChangeFinder. Because neither of these classes contained virtual
- * functionality, the functionality of this class couldn't be inherited from the CSmlChangeFinder
- */
-class CChangeFinder : public CBase
-	{ 
-public:
-	
-	/**
-    * Class constructor, Creates a new class instance.
-    *
-    * @param aSyncRelationship  IN: Reference to MSmlSyncRelationship interface.
-    * @param aKey               IN: Key that is used in sorting snapshot.
-    * @param aStreamUid         IN: Snapshot stream UID.
-    * @return CChangeFinder*, New ChangeFinder instance.
-    */
-    static CChangeFinder* NewL( MSmlSyncRelationship& aSyncRelationship, 
-                               TKeyArrayFix aKey,
-                               TBool& aHasHistory, 
-                               TInt aStreamUid = KNSmlDefaultSnapshotStreamUID );
-
-    /**
-    * Class destructor.
-    */
-	~CChangeFinder();
-	
-    /**
-    * Close ChangeFinder object, stores snapshot.
-    */
-	void CloseL();
-
-    /**
-    * Reset change information, makes all content new from ChangeFinder point of view.
-    */
-	void ResetL();
-
-    /**
-    * Find changed items by comparing snapshots.
-    * 
-    * @param aChangedUids   IN: Array for results.
-    */
-	void FindChangedItemsL( CNSmlDataItemUidSet& aChangedUids );
-
-    /**
-    * Find deleteed items by comparing snapshots.
-    * 
-    * @param aDeletedUids   IN: Array for results.
-    */
-	void FindDeletedItemsL( CNSmlDataItemUidSet& aDeletedUids );
-	
-    /**
-    * Find new items by comparing snapshots.
-    * 
-    * @param aNewUids   IN: Array for results.
-    */	
-	void FindNewItemsL(CNSmlDataItemUidSet& aNewUids);
-	
-    /**
-    * Add item to snapshot, it is no loger reported.
-    * 
-    * @param aItem   IN: item to add.
-    */
-	void ItemAddedL( const TSnapshotItem& aItem );
-
-    /**
-    * Delete item from snapshot, it is no loger reported.
-    * 
-    * @param aItem   IN: item to delete.
-    */
-	void ItemDeletedL( const TSnapshotItem& aItem );
-	
-    /**
-    * Update item to snapshot, it is no loger reported.
-    * 
-    * @param aItem   IN: item to update.
-    */
-	void ItemUpdatedL( const TSnapshotItem& aItem );
-
-    /**
-    * Commit all changes to snapshot, there's nothing to report anymore.
-    */
-	void CommitChangesL();
-
-    /**
-    * Commit a set of items to snapshot, these items won't be reported anymore.
-    * 
-    * @param aUids   IN: a set of items to commit.
-    */
-	void CommitChangesL( const MSmlDataItemUidSet& aUids );
-	
-	/**
-    * Sets new snapshot to compare against.
-    * 
-    * @param aNewSnapshot   IN: a new snapshot.
-    */
-	void SetNewSnapshot( CSnapshotArray* aNewSnapshot );
-	
-	/**
-    * Retrieves DataStore id number.
-    *
-    * @return TInt64, DataStore id.
-    */
-	TInt64 DataStoreUid() const;
-
-	/**
-    * Sets DataStore id number.
-    * 
-    * @param aUid   IN: a new datastore id.
-    */
-	void SetDataStoreUid( TInt64 aUid );
-	
-private:
-	
-    /**
-    * C++ Constructor
-    *
-    * @param aSyncRelationship  IN: Reference to MSmlSyncRelationship interface.
-    * @param aKey               IN: Key that is used in sorting snapshot.
-    * @param aStreamUid         IN: Snapshot stream UID.
-    */    
-	CChangeFinder( MSmlSyncRelationship& aSyncRelationship, 
-	              TKeyArrayFix aKey,
-	              TInt aStreamUid );
-    
-    /**
-    * 2nd-phase Constructor
-    *
-    * @param aHasHistory   IN: ETrue, if there was synchronization history.
-    */    
-    void ConstructL( TBool& aHasHistory );
-    
-private:
-
-    /**
-    * Allows access to streams.
-    */
-	MSmlSyncRelationship& iSyncRelationship;
-	
-    /**
-    * New snapshot to compare against.
-    */	
-	CSnapshotArray* iCurrentSnapshot;
-
-    /**
-    * Current snapshot.
-    */
-	CSnapshotArray* iOldSnapshot;
-	
-    /**
-    * Key that is used in sorting snapshot.
-    */
-	TKeyArrayFix iKey;
-	
-    /**
-    * Stream id number to access sync relationship.
-    */	
-	TInt iStreamUid;
-	
-    /**
-    * Data store id number.
-    */	
-	TInt64 iDataStoreUid;
-    };
-
-#endif // __CHANGEFINDER_H__
--- a/omads/omadsextensions/adapters/mediads/inc/cmdemanager.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +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:  CMdEManager declaration
-*
-*/
-
-
-#ifndef CMDEMANAGER_H
-#define CMDEMANAGER_H
-
-#include <e32base.h>
-#include <mdesession.h>
-#include <mdequery.h>
-
-#include "playlistitem.h"
-
-class MMdEManagerObserver
-    {
-public:
-    virtual void AlbumsReaded( TInt aError ) = 0;
-    virtual void AlbumReplaced( TInt aError ) = 0;
-    };
-
-class CMdEManager : public CBase,
-                        MMdESessionObserver,
-                        MMdEQueryObserver
-    {
-public:
-    // Cancel and destroy
-    ~CMdEManager();
-
-    // Two-phased constructor.
-    static CMdEManager* NewL( MMdEManagerObserver& aObserver );
-
-public:
-    
-    /**
-	 * Start enumerating albums. Calls MMdEManagerObserver::AlbumsReaded when ready.
-	 * This needs to be called before any other operations.
-	 */ 
-    void GetAlbumsL();
-    
-
-    RPointerArray<CPlaylistItem>& AlbumsArray(){ return iAlbums; };
-    const CPlaylistItem& AlbumL( TInt aAlbumId ) const;
-    
-    void CreateAlbumL( CPlaylistItem& aAlbum );
-    void ReplaceAlbumL( TInt aAlbumId, CPlaylistItem& aAlbum );
-    void DeleteAlbumL( TInt aAlbumId );
-    
-	/**
-	 * Cancels any outstanding request if any.
-	 */
-    void Cancel();
-    
-private:
-    void StartProcessingAlbumsL();
-    void ProcessNextAlbumL();
-    void FindItemsOnAlbumL( TItemId aAlbumObjectId );
-    
-private: // from MMdESessionObserver
-    /**
-     * Called to notify the observer that opening the session has been 
-     * completed and, if the opening succeeded, the session is ready for use.
-     *
-     * @param aSession session
-     * @param aError   <code>KErrNone</code>, if opening the session succeeded;
-     *                 or one of the system-wide error codes, if opening the 
-     *                 session failed
-     */
-    void HandleSessionOpened(CMdESession& aSession, TInt aError);
-
-    /**
-     * Called to notify the observer about errors, which are not a direct 
-     * consequence of the operations initiated by the client but caused by 
-     * some external source (e.g., other clients). The error cannot be 
-     * recovered and all on-going operations initiated by the client have been 
-     * aborted. Any attempts to continue using the session will cause a panic. 
-     * The client should close the session immediately and try to open a new 
-     * session, if it needs to continue using the metadata engine.
-     *
-     * @param aSession session
-     * @param aError one of the system-wide error codes
-     */
-    void HandleSessionError(CMdESession& aSession, TInt aError);
-
-private: // from MMdEQueryObserver
-    /**
-     * Called to notify the observer that new results have been received 
-     * in the query.
-     *
-     * @param aQuery              Query instance that received new results.
-     * @param aFirstNewItemIndex  Index of the first new item that was added
-     *                            to the result item array.
-     * @param aNewItemCount       Number of items added to the result item 
-     *                            array.
-     */
-    void HandleQueryNewResults(CMdEQuery& aQuery,
-                                       TInt aFirstNewItemIndex,
-                                       TInt aNewItemCount);
-
-
-            
-    /**
-     * Called to notify the observer that the query has been completed,
-     * or that an error has occured.
-     *
-     * @param aQuery  Query instance.
-     * @param aError  <code>KErrNone</code>, if the query was completed
-     *                successfully. Otherwise one of the system-wide error 
-     *                codes.
-     */
-    void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError);
-private:
-    
-    CMdEManager( MMdEManagerObserver& aObserver );
-    
-    void ConstructL();
-    
-    void HandleAlbumQueryCompletedL( CMdEObjectQuery& aQuery );
-    void HandleObjectQueryCompletedL( CMdEObjectQuery& aQuery );
-    void HandleRelationQueryCompletedL( CMdERelationQuery& aQuery );
-    
-private:
-    enum TCMdEManagerState
-        {
-        EUninitialized,             // Uninitialized / initialization is ongoing
-        EWaitingToEnumerateAlbums,  // Initializing and starting collecting albums info
-        EEnumeratingAlbums,         // Album enumeration is ongoing
-        EReplacingAlbum,            // Replacing album (searching removed relation id:s)
-        EIdle                       // Ready for next operation
-        };
-
-private:
-    MMdEManagerObserver& iObserver;
-    TCMdEManagerState   iState;
-    
-    CMdESession*        iMde;
-    CMdEObjectQuery*    iAlbumQuery;
-    CMdEObjectQuery*    iObjectQuery;
-    CMdERelationQuery*  iContainmentQuery;
-    
-    RPointerArray<CPlaylistItem> iAlbumsInProgress;
-    RPointerArray<CPlaylistItem> iAlbums;
-    
-    };
-
-#endif // CMDEMANAGER_H
--- a/omads/omadsextensions/adapters/mediads/inc/logger.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +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:  Logging macros used by Media DS Plugin
-*
-*/
-
-
-#ifndef __LOGGER_H__
-#define __LOGGER_H__
-
-#ifdef _DEBUG
-    #ifdef __WINS__
-        // File logging for WINS
-        #define __FLOGGING__
-    #else
-        #define __FLOGGING__ // enable to log file on target HW
-    #endif //__WINS__
-    
-    #include <e32svr.h>
-    #ifdef __FLOGGING__
-        #include <f32file.h>
-        #include <flogger.h>
-    #endif
-    
-    NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow
-        {
-    public:
-        void Overflow(TDes16& /*aDes*/) {}
-        };
-    
-    NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow
-        {
-    public:
-        void Overflow(TDes8& /*aDes*/) {}
-        };
-    
-    _LIT( KLogDir, "MediaDS" );
-    _LIT( KLogFile, "MediaDS.txt" );
-    
-    _LIT(KTracePrefix16, "[MediaDs] ");
-    _LIT8(KTracePrefix8, "[MediaDs] ");
-    _LIT8(KFuncEntryFormat8, "%S : Begin");
-    _LIT8(KFuncExitFormat8, "%S : End");
-    _LIT8(KFuncReturnFormat8, "%S : End, return: %d");
-    _LIT8(KFuncFormat8, "><%S");
-    
-    const TInt KMaxLogLineLength = 512;
-    
-    /**
-    * logging macros, for public use
-    */
-
-    #define LOGGER_WRITE( text )                    {_LIT( KTemp, text ); FPrint( KTemp );}
-    #define LOGGER_WRITE_1( text,par1 )             {_LIT( KTemp, text ); FPrint( KTemp, par1 );}
-    #define LOGGER_WRITE8_1( text,par1 )            {_LIT8( KTemp, text ); FPrint( KTemp, par1 );}
-    #define LOGGER_WRITE_2( text,par1,par2 )        {_LIT( KTemp, text ); FPrint( KTemp, par1, par2 );}
-    #define LOGGER_WRITE_3( text,par1,par2,par3 )   {_LIT( KTemp, text ); FPrint( KTemp, par1, par2, par3 );}
-    
-    // New function logging macros
-    #define TRACE_FUNC_ENTRY {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncEntryFormat8, &ptr8);}
-    #define TRACE_FUNC_EXIT {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncExitFormat8, &ptr8);}
-    #define TRACE_FUNC {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncFormat8, &ptr8);}
-    
-    #define TRACE_FUNC_RET( number )  {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncReturnFormat8, &ptr8, number);}
-    // Declare the FPrint function
-    inline void FPrint( TRefByValue<const TDesC16> aFmt, ...)
-        {
-        VA_LIST list;
-        VA_START(list,aFmt);
-    #ifdef __FLOGGING__
-        RFileLogger::WriteFormat( KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list );
-    #endif
-        TBuf16<KMaxLogLineLength> theFinalString;
-        theFinalString.Append(KTracePrefix16);
-        TOverflowTruncate16 overflow;
-        theFinalString.AppendFormatList(aFmt,list,&overflow);
-        RDebug::Print(theFinalString);
-        }
-    
-    // Declare the FPrint function
-    inline void FPrint(TRefByValue<const TDesC8> aFmt, ...)
-        {
-        VA_LIST list;
-        VA_START(list, aFmt);
-    #ifdef __FLOGGING__
-        RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
-    #endif
-        TOverflowTruncate8 overflow;
-        TBuf8<KMaxLogLineLength> buf8;
-        buf8.Append(KTracePrefix8);
-        buf8.AppendFormatList(aFmt, list, &overflow);
-        TBuf16<KMaxLogLineLength> buf16(buf8.Length());
-        buf16.Copy(buf8);
-        TRefByValue<const TDesC> tmpFmt(_L("%S"));
-        RDebug::Print(tmpFmt, &buf16);
-        }
-#else // no _DEBUG defined
-    
-    // No loggings --> reduced code size
-    #define LOGGER_WRITE( text )
-    #define LOGGER_WRITE_1( text, par1 )
-    #define LOGGER_WRITE8_1( text, par1 )
-    #define LOGGER_WRITE_2( text, par1, par2 )
-    #define LOGGER_WRITE_3( text, par1, par2, par3 )
-    #define TRACE_FUNC_ENTRY
-    #define TRACE_FUNC_EXIT
-    #define TRACE_FUNC
-    #define TRACE_FUNC_RET( number )
-
-#endif // _DEBUG
-
-#endif // __LOGGER_H__
-
--- a/omads/omadsextensions/adapters/mediads/inc/mediadsprovider.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +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:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-
-
-#ifndef __MEDIADSPROVIDER_H__
-#define __MEDIADSPROVIDER_H__
-
-// INCLUDES
-#include <smldataprovider.h>
-
-// FORWARD DECLARATIONS
-class CMediaDsDataStore;
-class CSmlDataStoreFormat;
-
-/**
- * This class is derived from ECom Data Provider plugin-interface (CSmlDataProvider).
- * 
- */
-class CMediaDataProvider : public CSmlDataProvider
-    {
-
-public:
-    
-    /**
-    * Constructor.
-	*
-	* @return CMediaDataProvider*, a new CMediaDataProvider instance.
-    */
-    static CMediaDataProvider* NewL();
-    
-	/**
-    * Destructor.
-    */
-    virtual ~CMediaDataProvider();
-
-    
-protected: // Inherited from CSmlDataProvider
-
-	virtual void DoOnFrameworkEvent( TSmlFrameworkEvent, TInt aParam1, TInt aParam2 );
-	
-	virtual TBool DoSupportsOperation( TUid aOpId ) const;
-	
-	virtual const CSmlDataStoreFormat& DoStoreFormatL();
-	
-	virtual CDesCArray* DoListStoresLC();
-	
-	virtual const TDesC& DoDefaultStoreL();
-	
-	virtual CSmlDataStore* DoNewStoreInstanceLC();
-	
-    virtual void DoCheckSupportedServerFiltersL( const CSmlDataStoreFormat& aServerDataStoreFormat,
-        RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo );
-        
-    virtual void DoCheckServerFiltersL( RPointerArray<CSyncMLFilter>& aFilters,
-        TSyncMLFilterChangeInfo& aChangeInfo ); 
-        
-	virtual const RPointerArray<CSyncMLFilter>& DoSupportedServerFiltersL();
-	
-	virtual TBool DoSupportsUserSelectableMatchType() const;
-	
-	virtual HBufC* DoGenerateRecordFilterQueryLC( const RPointerArray<CSyncMLFilter>& aFilters,
-	    TSyncMLFilterMatchType aMatch, TDes& aFilterMimeType,
-	    TSyncMLFilterType& aFilterType, TDesC& aStoreName );
-	    
-	virtual void DoGenerateFieldFilterQueryL( const RPointerArray<CSyncMLFilter>& aFilters,
-	    TDes& aFilterMimeType, RPointerArray<CSmlDataProperty>& aProperties, TDesC& aStoreName );
-
-private:
-	
-	/**
-    * C++ Constructor.
-    */
-    CMediaDataProvider();
-    
-	/**
-    * 2nd-phase Constructor.
-    */
-    void ConstructL();
-   
-	/**
-    * Creates new DataStore format.
-    */
-    CSmlDataStoreFormat* DoOwnStoreFormatL();
-
-private:
-
-	/**
-    * String pool, used in store format creation.
-    */
-    RStringPool iStringPool;
-
-	/**
-    * Data store format.
-    */
-    CSmlDataStoreFormat* iOwnStoreFormat;
-
-	/**
-    * Supported filters (none supported at the moment).
-    */
-    RPointerArray<CSyncMLFilter> iFilters;
-    
-	/**
-    * File system handle.
-    */
-    RFs iFs;
-    
-    };
-
-#endif // __MEDIADSPROVIDER_H__  
--- a/omads/omadsextensions/adapters/mediads/inc/mediadsproviderdefs.h	Tue Aug 31 15:05:37 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:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-
-#ifndef __MEDIADSPROVIDERDEFS_H__ 
-#define __MEDIADSPROVIDERDEFS_H__ 
-
-#include <e32def.h>
-#include <e32cmn.h>
-
-// Database name
-
-_LIT( KMediaDsDbName, "mediads" ); // Default db
-_LIT( KMediaDsRefreshDbName, "mediadsrefresh" ); // Used to refresh db, before opening
-
-// Resource file for CSmlDataStoreFormat in SIS installation
-_LIT(KMediaDsStoreFormatRsc,"mediadsstore.rsc");
-
-// max foldername
-const TInt KMaxFolderNameLength = 50;
-
-// Implementation uid
-const TUint KMediaDataProviderImplUid = 0x2001A9A1;
-
-// Folders
-_LIT( KAllSongs, "All songs" );
-_LIT( KPlaylists, "Playlists" );
-_LIT( KAlbums, "Albums" );
-const TInt KAllSongsFolderId( 1 );
-const TInt KPlaylistsFolderId( 2 );
-const TInt KAlbumsFolderId( 3 );
-
-const TInt KLastFolderId( KAlbumsFolderId );
-
-#endif // __MEDIADSPROVIDERDEFS_H__ 
--- a/omads/omadsextensions/adapters/mediads/inc/mediadsstore.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +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:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-
-
-#ifndef __MEDIADATASTORE_H__
-#define __MEDIADATASTORE_H__
-
-// INCLUDES
-#include <smldataprovider.h>
-#include <mpxcollectionobserver.h>
-
-#include "mediadsproviderdefs.h" 
-#include "changefinder.h"
-#include "mediamanager.h"
-#include "cmdemanager.h"
-
-// FORWARD DECLARATIONS
-class CNSmlDataItemUidSet;
-class MMPXHarvesterUtility;
-class MMPXCollectionUtility;  
-class CMPXCollectionMediator;
-
-
-/**
-* @brief This class is derived from ECom Data Store plugin-interface (CSmlDataStore).
-* It performs the actual synchronization commands, which are received from
-* the DS engine.
-*/
-class CMediaDsDataStore : public CSmlDataStore,
-                          public MMediaManagerObserver,
-                          public MMdEManagerObserver
-    {
-public:  
-    
-    /**
-    * Constructor
-	*
-	* @return CMediaDsDataStore* instance.
-    */
-    static CMediaDsDataStore* NewLC( RFs& aFs );
-    
-	/**
-    * Destructor
-    */
-    virtual ~CMediaDsDataStore();
-
-protected:
-   
-   	// Virtual functionality from CSmlDataStore, for comments see the CSmlDataStore header file
-	virtual void DoOpenL(const TDesC& aStoreName, MSmlSyncRelationship& aContext, TRequestStatus& aStatus);
-	virtual void DoCancelRequest();
-	virtual const TDesC& DoStoreName() const;
-	virtual void DoBeginTransactionL();
-	virtual void DoCommitTransactionL(TRequestStatus& aStatus);
-	virtual void DoRevertTransaction(TRequestStatus& aStatus);
-	virtual void DoBeginBatchL();
-	virtual void DoCommitBatchL(RArray<TInt>& aResultArray, TRequestStatus& aStatus);
-	virtual void DoCancelBatch();
-	virtual void DoSetRemoteStoreFormatL(const CSmlDataStoreFormat& aServerDataStoreFormat);
-	virtual void DoSetRemoteMaxObjectSize(TInt aServerMaxObjectSize);
-	virtual TInt DoMaxObjectSize() const;
-	virtual void DoOpenItemL(TSmlDbItemUid aUid, TBool& aFieldChange, TInt& aSize,
-	    TSmlDbItemUid& aParent, TDes8& aMimeType, TDes8& aMimeVer, TRequestStatus& aStatus);
-	virtual void DoCreateItemL(TSmlDbItemUid& aUid, TInt aSize, TSmlDbItemUid aParent,
-	    const TDesC8& aMimeType, const TDesC8& aMimeVer, TRequestStatus& aStatus);
-	virtual void DoReplaceItemL(TSmlDbItemUid aUid, TInt aSize, TSmlDbItemUid aParent,
-	    TBool aFieldChange, TRequestStatus& aStatus);
-	virtual void DoReadItemL(TDes8& aBuffer);
-	virtual void DoWriteItemL(const TDesC8& aData);
-	virtual void DoCommitItemL(TRequestStatus& aStatus);
-	virtual void DoCloseItem();
-	virtual void DoMoveItemL(TSmlDbItemUid aUid, TSmlDbItemUid aNewParent, TRequestStatus& aStatus);
-	virtual void DoDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus);
-	virtual void DoSoftDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus);
-	virtual void DoDeleteAllItemsL(TRequestStatus& aStatus);
-	virtual TBool DoHasSyncHistory() const;
-	virtual const MSmlDataItemUidSet& DoAddedItems() const;
-	virtual const MSmlDataItemUidSet& DoDeletedItems() const;
-	virtual const MSmlDataItemUidSet& DoSoftDeletedItems() const;
-	virtual const MSmlDataItemUidSet& DoModifiedItems() const;
-	virtual const MSmlDataItemUidSet& DoMovedItems() const;
-	virtual void DoResetChangeInfoL(TRequestStatus& aStatus);
-	virtual void DoCommitChangeInfoL(TRequestStatus& aStatus, const MSmlDataItemUidSet& aItems);
-	virtual void DoCommitChangeInfoL(TRequestStatus& aStatus);
-
-protected: // from MMPXCollectionObserver
-    void HandleCollectionMessage(CMPXMessage* aMsg, TInt /*aErr*/) ;
-    void HandleOpenL(const CMPXMedia& aEntries,
-          TInt aIndex,TBool aComplete,TInt aError);
-    void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError);
-    void HandleCommandComplete(CMPXCommand* /*aCommandResult*/, 
-                                           TInt /*aError*/);
-    void HandleCollectionMediaL(const CMPXMedia& aMedia, 
-                                            TInt aError);
-    // from MMediaManagerObserver
-    void RegisterAllPlayListsCompleted( TInt aError );
-    void RegisterAllSongsCompleted( TInt aError );
-    
-protected: // from MMdEManagerObserver
-    void AlbumsReaded( TInt aError );
-    void AlbumReplaced( TInt aError );
-
-private: 
-
-	/**
-    * C++ Constructor.
-    */
-    CMediaDsDataStore( RFs& aFs );
-    
-	/**
-    * 2nd-phase Constructor.
-    *
-    * @param aMsvSession	IN: a session handle to message store
-    */    
-    void ConstructL();
-	
-	/**
-    * Registers snapshot to ChangeFinder.
-    */
-	void RegisterSnapshotL();
-
-	void RegisterFoldersL( CSnapshotArray& aItemArray );
-	
-	void FinalizeOpenStore();
-	
-	inline TInt MapSyncIdToAlbumId( TSmlDbItemUid aSyncId );
-	inline TSmlDbItemUid MapAlbumIdToSyncId( TInt aAlbumId );
-	
-private: // Data members
-
-	
-    enum TState
-        {
-        EClosed = 0,
-        EOpening,
-        EOpenAndWaiting,
-        EReplace,
-        ECreatePlaylist
-        };
-    
-    /**
-    * The state of the plugin.
-    */
-    TState iCurrentState;   
-    
-    /**
-	* A flag indicating the existence of synchronization history.
-	*/
-    TBool iHasHistory;
-    
-    /**
-	* Key that is used in sorting snapshot.
-	*/
-    const TKeyArrayFix iKey;
-
-    /**
-	* Change finder, used to determine db modifications.
-	*/
-    CChangeFinder* iChangeFinder;
-    
-    /**
-	* The location for temporary data
-	*/
-    CBufFlat* iDataBuffer;
-    
-    /**
-	* Current read position at the data chunk from MMS engine
-	*/      
-    TInt iReadPosition;
-    
-    /**
-	* Indicates wheter this was only status update
-	*/      
-    TInt iWrittenDataLength;
-
-    /**
-	* Stores the currently active message id.
-	*/
-    TSmlDbItemUid iCurrentId;
-    
-    /**
-	* Pointer to the variable, receiving the created Uid.
-	*/
-	TSmlDbItemUid* iCreatedUid;  
-
-    /**
-	* Stores the parent id of currently active message.
-	*/
-	TSmlDbItemUid iParentId;
-
-    /**
-	* Used to get asynchronous return values.
-	*/
-    TRequestStatus*  iCallerStatus;
-    
-    /**
-	* Used to store new items.
-	*/
-	CNSmlDataItemUidSet* iNewItems;
-
-    /**
-	* Used to store deleted items.
-	*/
-    CNSmlDataItemUidSet* iDeletedItems;
-
-    /**
-	* Used to store updated items.
-	*/
-    CNSmlDataItemUidSet* iUpdatedItems;
-
-    /**
-	* Used to store moved items.
-	*/
-    CNSmlDataItemUidSet* iMovedItems;
-
-    /**
-	* Used to store soft-deleted items (not supported).
-	*/
-    CNSmlDataItemUidSet* iSoftDeletedItems;
-    
-    /**
-     * Used to manage playlists and songs.
-     */
-    CMediaManager*  iMediaManager;
-    TBool           iMediaManagerReady;
-    
-    /**
-     * Used to manage photo albums.
-     */
-    CMdEManager*    iMdEManager;
-    TBool           iMdEManagerReady;
-    
-    TInt            iError;
-    
-    CMD5* iHasher;
-    
-    RFs&    iFs;
-    
-    CSnapshotArray* iSnapshot;
-    TSnapshotItem   iItemInReplacement;
-    };
-
-#endif // __MEDIADATASTORE_H__
--- a/omads/omadsextensions/adapters/mediads/inc/mediamanager.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-
-
-#ifndef _CMEDIAMANAGER_H
-#define _CMEDIAMANAGER_H
-
-#include <e32base.h>
-#include <mpxmediageneraldefs.h>
-#include <mpxcollectionutility.h>
-#include <mpxcollectionmediator.h>
-#include <mpxcollectionobserver.h>
-#include <mpxharvesterutilityobserver.h>
-#include <mpxharvesterutility.h>
-#include <mpxcollectionhelperobserver.h>
- 
-#include "changefinder.h"
-#include "songitem.h"
-
-class CMPXMedia;
-class MMPXCollectionHelper;
-
-class MMediaManagerObserver : public MMPXCollectionObserver
-    {
-public:
-    virtual void RegisterAllPlayListsCompleted( TInt aError ) = 0;
-    virtual void RegisterAllSongsCompleted( TInt aError ) = 0;
-    };
-
-/**
- * @brief This class manages playlist's on media library. Also songs metadata can be queried.
- * 
- */
-class CMediaManager : public CActive, private MMPXCollectionHelperObserver
-    {
-public:
-
-    static CMediaManager* NewL( RFs& aFs, MMediaManagerObserver* aObserver, TKeyArrayFix aKey, CMD5& aHasher );
-    
-    ~CMediaManager();
-    
-    /**
-     * Starts scanning music library.
-     * Calls MMPXCollectionObserver::HandleCollectionMessage when completed.
-     */
-    void ScanL();
-    
-    /**
-     * Cancel scan
-     */
-    void CancelScanL();
-    
-    /**
-     * Set current snapshot.
-     * @param aSnapshot
-     */
-    void SetSnapshot( CSnapshotArray* aSnapshot ){iSnapshotArray=aSnapshot;};
-    
-    /**
-     * Starts registering all playlists.
-     * Snapshot must be set before calling this.
-     * Calls MMediaManagerObserver::RegisterAllPlayListsCompleted when ready
-     * @return KErrNone if operation succesfully started.
-     */
-    TInt RegisterAllPlayLists();
-    
-    /**
-     * Starts registering all songs.
-     * Snapshot must be set before calling this.
-     * Calls MMediaManagerObserver::RegisterAllSongsCompleted when ready
-     * @return KErrNone if operation succesfully started.
-     */
-    TInt RegisterAllSongs();
-    
-    /**
-     * Gets CPlaylistItem
-     * @param aPlaylistId playlist id to get.
-     * @param aPlaylist returned playlist.
-     */
-    void GetPlayListL( TInt aPlaylistId, CPlaylistItem& aPlaylist );
-    
-    /**
-     * Gets CSongItem
-     * @param aSongId song id to get.
-     * @param aSongItem returned song.
-     */
-    void GetSongL( TInt aSongId, CSongItem& aSongItem );
-    
-    /**
-     * Creates new playlist to music library
-     * @param aNewUid returns new playlist id, if succesfully added.
-     * @param aPlaylist playlist to be added. Uri is updated to aPlaylist.
-     */
-    void CreateNewPlaylistL( TInt& aNewUid, CPlaylistItem& aPlaylist );
-    
-    /**
-     * Replaces existing playlist in music library
-     * @param aPlaylistId playlist id to be replaced. Uri is read to aPlaylist.
-     * @param aPlaylist new content.
-     */
-    void ReplacePlaylistL( TInt aPlaylistId, CPlaylistItem& aPlaylist );
-    
-    /**
-     * Deletes playlist from music library
-     * @param aPlaylistId playlist id to be deleted.
-     */
-    void DeletePlaylistL( TInt aPlaylistId );
-    
-private: // From MMPXCollectionHelperObserver
-    void HandleAddFileCompleteL( TInt aErr );
-    
-private:
-    CMediaManager( RFs& aFs, MMediaManagerObserver* aObserver, TKeyArrayFix aKey, CMD5& aHasher );
-    
-    void ConstructL();
-    
-    void RegisterPlaylistL( const CMPXMedia& aMedia );
-    
-    void RegisterSongL( const CMPXMedia& aMedia );
-    
-    CMPXMedia* FetchPlaylistContentL( TInt aId );
-    
-    CMPXMedia* FindPlaylistL( TInt aUid );
-    
-    void AddPlaylistL( CMPXMedia* aMedia );
-    
-    void ReadSongAttributesL( const CMPXMedia& aMedia, CSongItem& aSongItem, TBool aReadFileDetails );
-    
-    CMPXMedia* CreatePlaylistMediaL( const CPlaylistItem& aPlaylist );
-    
-    CMPXMediaArray* CreateMediaArrayLC( const CPlaylistItem& aPlaylist );
-    
-    void ReadPlaylistCountL();
-    void ReadPlaylistItemsL();
-    
-    void ReadSongCountL();
-    void ReadSongItemsL();
-private: // from CActive
-    
-    void DoCancel();
-    void RunL();
-    TInt RunError( TInt aError );
-    
-private:
-    
-    enum TState
-        {
-        EIdle = 0,
-        EReadingPlaylistCount,
-        EEnumeratingPlaylists,
-        EReadingSongCount,
-        EEnumeratingSongs
-        };
-    TState iCurrentState;
-    
-    CMPXMedia*              iFoundedMedia;
-    TInt                    iReadedItems;
-    TInt                    iItemsFound;
-    CSnapshotArray*         iSnapshotArray; // not owned
-    
-    MMediaManagerObserver*  iObserver;
-    const TKeyArrayFix      iKey;
-    MMPXCollectionHelper*   iCollectionHelper;
-    
-    CMD5&                   iHasher;
-    
-    MMPXHarvesterUtility*   iHarvester;
-    CMPXCollectionMediator* iMediator;
-    MMPXCollectionUtility*  iCollection;
-    RFs&                    iFs;
-    
-    bool                    iWaitOngoing;
-    CActiveSchedulerWait    iWait;
-    };
-
-
-#endif // _CMEDIAMANAGER_H
--- a/omads/omadsextensions/adapters/mediads/inc/omadsfolderobject.h	Tue Aug 31 15:05:37 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:  COMADSFolderObject class implementation
-*
-*/
-
-
-
-#ifndef __OMADSFOLDEROBJECT_H__
-#define __OMADSFOLDEROBJECT_H__
-
-#include <e32base.h>
-
-const TInt KMaxElementLength = 255;
-const TInt KMaxXmlLineLength = 1024;
-
-class COMADSFolderObject : public CBase
-    {
-public:
-
-    static COMADSFolderObject* NewLC();
-    ~COMADSFolderObject();
-
-    // Set methods
-    inline void SetName( const TDesC& aName ) {iName.Copy(aName);};
-    inline void SetCreatedDate( const TDateTime& aDateTime ) {iCreatedDate = aDateTime;};
-    inline void SetModifiedDate( const TDateTime& aDateTime ) {iModifiedDate = aDateTime;};
-    
-    void ExportFolderXmlL( CBufBase& aBuffer );
-    
-private:
-    void ExportL(); 
-    void WriteL( const TDesC &aData );
-    
-private:
-    
-    TBuf8<KMaxXmlLineLength>    iTemp;
-    TPath                       iName;
-    TDateTime                   iCreatedDate;
-    TDateTime                   iModifiedDate;
-    CBufBase*                   iBuffer; // Not owned
-    TInt                        iWriteBufPosition;
-    TInt                        iWriteBufSize;
-    };
-
-#endif
--- a/omads/omadsextensions/adapters/mediads/inc/playlistitem.h	Tue Aug 31 15:05:37 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:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-
-#ifndef PLAYLISTITEM_H_
-#define PLAYLISTITEM_H_
-
-#include <e32base.h>
-#include <s32mem.h>
-#include <BADESCA.H>
-
-class CPlaylistItem : public CBase
-    {
-public:
-    static CPlaylistItem* NewLC();
-    ~CPlaylistItem();
-    
-    void SetId( TInt aId );
-    TInt Id() const;
-    
-    void SetTitleL( const TDesC& aTitle );
-    const TDesC& Title() const;
-    
-    void SetUrlL( const TDesC& aUrl );
-    const TDesC& Url() const;
-    
-    void AddItemL( const TDesC& aSongUri );
-    TInt ItemCount() const;
-    TPtrC16 ItemAt( TInt aIndex ) const;
-    TInt FindItem( const TDesC16& aPtr, TInt& aPos, TKeyCmpText aTextComparisonType=ECmpFolded ) const;
-    
-    void ExportL( RBufWriteStream& aStream ) const;
-    void ImportL( const TDesC& aBuffer );
-    
-private:
-    CPlaylistItem();
-    void ConstructL();
-    
-private:
-    
-    TInt ReadNextLine( const TDesC& aBuffer, TPtrC& aLine );
-    
-private:
-    TInt iId;
-    HBufC* iTitle;
-    HBufC* iUrl;
-
-    CDesCArrayFlat* iDescArray;
-    };
-
-#endif /* PLAYLISTITEM_H_ */
--- a/omads/omadsextensions/adapters/mediads/inc/sconmetadatafielddefs.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +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:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-
-#ifndef _SCONMETADATAFIELDDEFS_H_
-#define _SCONMETADATAFIELDDEFS_H_
-
-// Content type header
-const TUint8 KSconMetadataHeaderAudio( 0x01 );
-const TUint8 KSconMetadataHeaderExif ( 0x02 );
-const TUint8 KSconMetadataHeaderVideo( 0x03 );
-
-const TUint8 KSconMetadataHeaderVersion ( 0x03 ); // format version = 3
-
-// fields for audio
-const TUint8 KSconAudioID3Version   ( 0x01 );
-const TUint8 KSconAudioTitle        ( 0x02 );
-const TUint8 KSconAudioArtist       ( 0x03 );
-const TUint8 KSconAudioAlbum        ( 0x04 );
-const TUint8 KSconAudioYear         ( 0x05 );
-const TUint8 KSconAudioComment      ( 0x06 );
-const TUint8 KSconAudioAlbumTrack   ( 0x07 );
-const TUint8 KSconAudioGenre        ( 0x08 );
-const TUint8 KSconAudioComposer     ( 0x09 );
-const TUint8 KSconAudioCopyright    ( 0x0a );
-const TUint8 KSconAudioOriginalArtist( 0x0b );
-const TUint8 KSconAudioUrl          ( 0x0c );
-const TUint8 KSconAudioUserUrl      ( 0x0d );
-const TUint8 KSconAudioJpeg         ( 0x0e );
-const TUint8 KSconAudioVendor       ( 0x0f );
-const TUint8 KSconAudioRating       ( 0x10 );
-const TUint8 KSconAudioUniqueFileIdentifier( 0x11 );
-const TUint8 KSconAudioDuration     ( 0x12 );
-const TUint8 KSconAudioDate         ( 0x13 );
-const TUint8 KSconAudioMimeType     ( 0x14 );
-const TUint8 KSconAudioFilename     ( 0x15 );
-const TUint8 KSconAudioFileSize     ( 0x16 );
-
-// fields for exif
-const TUint8 KSconExifThumbnail         ( 0x01 );
-const TUint8 KSconExifDescription       ( 0x02 );
-const TUint8 KSconExifMake              ( 0x03 );
-const TUint8 KSconExifModel             ( 0x04 );
-const TUint8 KSconExifDateTime          ( 0x05 );
-const TUint8 KSconExifSoftware          ( 0x06 );
-const TUint8 KSconExifCopyright         ( 0x07 );
-const TUint8 KSconExifOrientation       ( 0x08 );
-const TUint8 KSconExifXResolution1      ( 0x09 );
-const TUint8 KSconExifXResolution2      ( 0x0a );
-const TUint8 KSconExifYResolution1      ( 0x0b );
-const TUint8 KSconExifYResolution2      ( 0x0c );
-const TUint8 KSconExifResolutionUnit    ( 0x0d );
-const TUint8 KSconExifYCbCrPositioning  ( 0x0e );
-const TUint8 KSconExifIsoSpeedRatings   ( 0x0f );
-const TUint8 KSconExifDateTimeOriginal  ( 0x10 );
-const TUint8 KSconExifDateTimeDigitized ( 0x11 );
-const TUint8 KSconExifMakerNote         ( 0x12 );
-const TUint8 KSconExifUserComment       ( 0x13 );
-const TUint8 KSconExifRelatedSoundFile  ( 0x14 );
-const TUint8 KSconExifExposureTime1     ( 0x15 );
-const TUint8 KSconExifExposureTime2     ( 0x16 );
-const TUint8 KSconExifComponentsConfiguration ( 0x17 );
-const TUint8 KSconExifFlash             ( 0x18 );
-const TUint8 KSconExifColorSpace        ( 0x19 );
-const TUint8 KSconExifPixelXDimension   ( 0x1a );
-const TUint8 KSconExifPixelYDimension   ( 0x1b );
-const TUint8 KSconExifExposureMode      ( 0x1c );
-const TUint8 KSconExifWhiteBalance      ( 0x1d );
-const TUint8 KSconExifSceneCaptureType  ( 0x1e );
-const TUint8 KSconExifExposureProgram   ( 0x1f );
-const TUint8 KSconExifApertureValue1    ( 0x20 );
-const TUint8 KSconExifApertureValue2    ( 0x21 );
-const TUint8 KSconExifExposureBiasValue1 ( 0x22 );
-const TUint8 KSconExifExposureBiasValue2 ( 0x23 );
-const TUint8 KSconExifMeteringMode      ( 0x24 );
-const TUint8 KSconExifLightSource       ( 0x25 );
-const TUint8 KSconExifFileSource        ( 0x26 );
-const TUint8 KSconExifDigitalZoomRatio1 ( 0x27 );
-const TUint8 KSconExifDigitalZoomRatio2 ( 0x28 );
-const TUint8 KSconExifContrast          ( 0x29 );
-const TUint8 KSconExifSaturation        ( 0x2a );
-const TUint8 KSconExifSharpness         ( 0x2b );
-const TUint8 KSconExifExifVersion       ( 0x2c );
-const TUint8 KSconExifFlashPixVersion   ( 0x2d );
-const TUint8 KSconExifThumbXResolution1 ( 0x2e );
-const TUint8 KSconExifThumbXResolution2 ( 0x2f );
-const TUint8 KSconExifThumbYResolution1 ( 0x30 );
-const TUint8 KSconExifThumbYResolution2 ( 0x31 );
-const TUint8 KSconExifThumbResolutionUnit   ( 0x32 );
-const TUint8 KSconExifThumbCompression      ( 0x33 );
-const TUint8 KSconExifThumbJpegInterchangeFormat        ( 0x34 );
-const TUint8 KSconExifThumbJpegInterchangeFormatLength  ( 0x35 );
-const TUint8 KSconExifShutterSpeedValue1 ( 0x36 );
-const TUint8 KSconExifShutterSpeedValue2 ( 0x37 );
-const TUint8 KSconExifBrightnessValue1  ( 0x38 );
-const TUint8 KSconExifBrightnessValue2  ( 0x39 );
-const TUint8 KSconExifCustomRendered    ( 0x3a );
-const TUint8 KSconExifGainControl       ( 0x3b );
-const TUint8 KSconExifGpsVersion        ( 0x3c );
-const TUint8 KSconExifGPSLatitude    	( 0x3d );
-const TUint8 KSconExifGPSLongitude      ( 0x3e );
-const TUint8 KSconExifGPSAltitude       ( 0x3f );
-const TUint8 KSconExifBitDepth	        ( 0x40 );
-
-// fields for video
-const TUint8 KSconVideoFormat			( 0x01 );
-const TUint8 KSconVideoFrameRate		( 0x02 );
-const TUint8 KSconVideoFrameSizeWidth	( 0x03 );
-const TUint8 KSconVideoFrameSizeHeight	( 0x04 );
-const TUint8 KSconVideoVideoBitRate		( 0x05 );
-const TUint8 KSconVideoAudioBitRate		( 0x06 );
-const TUint8 KSconVideoDuration			( 0x07 );
-const TUint8 KSconVideoThumbnail		( 0x08 );
-const TUint8 KSconVideoAudioStreamMimetype	( 0x09 );
-const TUint8 KSconVideoVideoStreamMimetype	( 0x0a );
-
-#endif // _SCONMETADATAFIELDDEFS_H_
--- a/omads/omadsextensions/adapters/mediads/inc/snapshotitem.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +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 snapshot item header
-*
-*/
-
-
-#ifndef __SNAPSHOTITEM_H__
-#define __SNAPSHOTITEM_H__
-
-// INCLUDES
-#include <syncml/SmlDataSyncDefs.h>
-#include <hash.h>
-#include "mediadsproviderdefs.h"
-#include "songitem.h"
-#include "playlistitem.h"
-
-typedef TBuf<KMaxFolderNameLength> TFolderName;
-
-// CLASS DECLARATION
-
-/**
- * @brief TSnapshotItem
- * This class represents a single item in the ChangeFinder snapshot.
- * 
- */
-
-// Defines the maximum length of a hash.
-const TInt KMaxHashLength = 16;
-typedef TBuf8<KMaxHashLength> THashValue;
-
-class TSnapshotItem
-	{ 
-public:
-	
-	/**
-    * Constructor
-    */
-	TSnapshotItem();
-
-	/**
-    * Constructor
-    * 
-    * @param aItemId   IN: id of the item.
-    * @param aParent   IN: parent item, 0 as default.
-    * @param aUnread   IN: read/unread information, the default is read.
-    */
-	TSnapshotItem( const TSmlDbItemUid& aItemId,
-	    const TSmlDbItemUid& aParent = 0 );
-	
-	/**
-    * Writes the item to a stream.
-    * 
-    * @param aStream   IN: a reference to a stream, where this item is to be written.
-    */
-	void ExternalizeL( RWriteStream& aStream ) const;
-
-	/**
-    * Reads item from a stream.
-    * 
-    * @param aStream   IN: a reference to a stream, where this item is read from.
-    */
-	void InternalizeL( RReadStream& aStream );	
-	
-	/**
-    * Getter for item UID value.
-    * @return const TSmlDbItemUid& item UID.
-    */
-    const TSmlDbItemUid& ItemId() const;
-
-    /**
-    * Setter for item UID value.
-    * @param aItemId item UID.
-    */
-    void SetItemId( const TSmlDbItemUid& aItemId );
-
-    /**
-    * Getter for parent UID value.
-    * @return const TSmlDbItemUid& parent UID.
-    */
-    const TSmlDbItemUid& ParentId() const;
-
-    /**
-    * Setter for parent UID value.
-    * @param aParentId parent UID.
-    */
-    void SetParentId( const TSmlDbItemUid& aParentId );
-	
-    /**
-     * Generate hash value from foldername
-     * @param aFolderName foldername
-     * @param CMD5& aHasher MD5 hasher
-     */
-	void SetItemHash( const TDesC& aFolderName, CMD5& aHasher );
-	
-	/**
-     * Generate hash value from aSongItem content
-     * @param aSongItem song item
-     * @param CMD5& aHasher MD5 hasher
-     */
-	void SetItemHash( const CSongItem& aSongItem, CMD5& aHasher );
-	
-	/**
-     * Generate hash value from aPlaylist content
-     * @param aPlaylist aPlaylist
-     * @param CMD5& aHasher MD5 hasher
-     */
-	void SetItemHash( const CPlaylistItem& aPlaylist, CMD5& aHasher );
-	
-	/**
-	 * Getter for generated hash value.
-	 * @return const TDesC8& hash value
-	 */
-	const TDesC8& Hash() const;
-	
-private:
-	TSmlDbItemUid iItemId;
-	TSmlDbItemUid iParentId;
-    THashValue    iHash;
-    };
-
-#endif
--- a/omads/omadsextensions/adapters/mediads/inc/songitem.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +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:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-
-
-#ifndef TSONGITEM_H_
-#define TSONGITEM_H_
-
-#include <e32base.h>
-#include <s32strm.H>
-
-
-class CSongItem : public CBase
-    {
-public:
-    
-    static CSongItem* NewLC();
-    ~CSongItem();
-    
-    void SetId( TInt aId );
-    TInt Id() const;
-    
-    void SetUriL( const TDesC& aUri );
-    const TDesC& Uri() const;
-    
-    void SetTitleL( const TDesC& aTitle );
-    const TDesC& Title() const;
-    
-    void SetMimeTypeL( const TDesC& aMimeType );
-    const TDesC& MimeType() const;
-    
-    void SetDuration( TInt aDuration );
-    TInt Duration() const;
-    
-    void SetArtistL( const TDesC& aArtist );
-    const TDesC& Artist() const;
-    
-    void SetAlbumL( const TDesC& aAlbum );
-    const TDesC& Album() const;
-    
-    void SetYear( TInt aYear );
-    TInt Year() const;
-    
-    void SetAlbumTrack( TInt aId );
-    TInt AlbumTrack() const;
-    
-    void SetGenreL( const TDesC& aGenre );
-    const TDesC& Genre() const;
-    
-    void SetCommentL( const TDesC& aComment );
-    const TDesC& Comment() const;
-    
-    void SetComposerL( const TDesC& aComposer );
-    const TDesC& Composer() const;
-    
-    void SetRating( TInt aRating );
-    TInt Rating() const;
-    
-    void SetModifiedTime( TTime& aTime );
-    const TTime& ModifiedTime() const;
-    
-    void SetFileSize( TInt32 aSize );
-    TInt32 FileSize() const;
-    
-    /**
-     * Export item.
-     * @param aStream stream where to export.
-     */
-    void ExportL( RWriteStream& aStream );
-    
-private:
-    CSongItem();
-    void ConstructL();
-    
-    inline void WriteUnicodeL( RWriteStream& aStream, const TDesC& aData, const TUint8 aFieldId );
-    
-    inline void WriteDataFieldL( RWriteStream& aStream, const TDesC8& aData, const TUint8 aFieldId );
-    
-    inline void WriteUInt16FieldL( RWriteStream& aStream, TUint16 aData, const TUint8 aFieldId );
-    
-    inline void WriteUInt32FieldL( RWriteStream& aStream, TUint32 aData, const TUint8 aFieldId );
-    
-private:
-    TInt      iId;
-    HBufC*    iUri;
-    HBufC*    iTitle;
-    HBufC*    iMimeType;
-    TInt      iDuration;
-    HBufC*    iArtist;
-    HBufC*    iAlbum;
-    TInt      iYear;
-    TInt      iAlbumTrack;
-    HBufC*    iGenre;
-    HBufC*    iComment;
-    HBufC*    iComposer;
-    TInt      iRating;
-    TTime     iModifiedTime;
-    TInt      iSize;
-    };
-
-#endif /* TSONGITEM_H_ */
--- a/omads/omadsextensions/adapters/mediads/rom/mediads.iby	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  IBY file for Media DS plugin
-*
-*/
-
-
-#ifndef __MEDIADS_IBY__
-#define __MEDIADS_IBY__
-
-ECOM_PLUGIN(mediadsprovider.dll,mediadsprovider.rsc)
-data=DATAZ_\RESOURCE_FILES_DIR\mediadsstore.rsc         RESOURCE_FILES_DIR\mediadsstore.rsc
-data=DATAZ_\private\101F99F6\capability\2001A9A1.XML    private\101F99F6\capability\2001A9A1.XML
-
-data=ZSYSTEM\install\mediads_stub.sis             	    system\install\mediads_stub.sis
-
-#endif //__MEDIADS_IBY__
--- a/omads/omadsextensions/adapters/mediads/sis/backup_registration.xml	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<?xml version="1.0" standalone="yes"?> 
-<backup_registration>
-    <system_backup />
-    <restore requires_reboot = "no"/>
-</backup_registration> 
\ No newline at end of file
--- a/omads/omadsextensions/adapters/mediads/sis/mediads.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +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: PKG file for Media DS adapter
-;
-
-;*Unique (Non-Localised) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade ofa a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localised vendor name(s) correspodning to language(s).
-%{"Nokia"}
-
-;Language - standard language definitions
-&EN
-
-;package-header
-#{"Media DS Plugin"},(0x2001A9A1),1,20,0,TYPE=SA, RU
-;
-
-; S60 v5.2
-[0x20022E6D ], 0, 0, 0, {"Series60ProductID"}
-
-
-"\epoc32\data\z\resource\mediadsstore.rsc"                  -"c:\resource\mediadsstore.rsc"
-"\epoc32\data\z\resource\plugins\mediadsprovider.rsc"       -"c:\resource\plugins\mediadsprovider.rsc"
-"\epoc32\release\ARMV5\UREL\mediadsprovider.dll"            -"c:\sys\bin\mediadsprovider.dll"
-"\epoc32\data\Z\private\101F99F6\capability\2001a9a1.xml"   -"c:\private\101F99F6\import\2001a9a1.xml"
-
-"backup_registration.xml"   -"c:\private\10202D56\import\packages\2001A9A1\backup_registration.xml"
--- a/omads/omadsextensions/adapters/mediads/sis/mediads_debug.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +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: PKG file for Media DS adapter (debug)
-;
-
-;*Unique (Non-Localised) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade ofa a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localised vendor name(s) correspodning to language(s).
-%{"Nokia"}
-
-;Language - standard language definitions
-&EN
-
-;package-header
-#{"Media DS Plugin"},(0x2001A9A1),1,20,0,TYPE=SA, RU
-;
-
-; S60 v5.2
-[0x20022E6D ], 0, 0, 0, {"Series60ProductID"}
-
-
-"\epoc32\data\z\resource\mediadsstore.rsc"                  -"c:\resource\mediadsstore.rsc"
-"\epoc32\data\z\resource\plugins\mediadsprovider.rsc"       -"c:\resource\plugins\mediadsprovider.rsc"
-"\epoc32\release\ARMV5\UDEB\mediadsprovider.dll"            -"c:\sys\bin\mediadsprovider.dll"
-"\epoc32\data\Z\private\101F99F6\capability\2001a9a1.xml"   -"c:\private\101F99F6\import\2001a9a1.xml"
-
-"backup_registration.xml"   -"c:\private\10202D56\import\packages\2001A9A1\backup_registration.xml"
--- a/omads/omadsextensions/adapters/mediads/src/changefinder.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,537 +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:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-
-#include "changefinder.h"
-#include "logger.h"
-
-const TUint KSnapshotFormatVersion ( 0xf0000001 ); // format version
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::NewL
-// Static function to create CChangeFider object(s)
-// -----------------------------------------------------------------------------
-CChangeFinder* CChangeFinder::NewL( MSmlSyncRelationship& aSyncRelationship, TKeyArrayFix aKey,
-        TBool& aHasHistory, TInt aStreamUid )
-    {
-    CChangeFinder* self = new (ELeave) CChangeFinder( aSyncRelationship, aKey, aStreamUid );
-    CleanupStack::PushL( self );
-    self->ConstructL( aHasHistory );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::CChangeFinder
-// Constructor for the class
-// -----------------------------------------------------------------------------
-CChangeFinder::CChangeFinder( MSmlSyncRelationship& aSyncRelationship, TKeyArrayFix aKey, TInt aStreamUid ) :
-iSyncRelationship( aSyncRelationship ),
-iKey(aKey),
-iStreamUid( aStreamUid ),
-iDataStoreUid( KErrNotFound )
-    {
-        
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::~CChangeFinder
-// Destructor for the class, closes the ChangeFinder and writes snapshot to stream
-// -----------------------------------------------------------------------------
-CChangeFinder::~CChangeFinder()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt error;
-    TRAP( error, CloseL() );
-    if ( error != KErrNone )
-        {
-        LOGGER_WRITE( "CChangeFinder::~CChangeFinder, CloseL failed." );
-        }
-    
-    delete iCurrentSnapshot;
-    iCurrentSnapshot = NULL;
-    delete iOldSnapshot;
-    iOldSnapshot = NULL;
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::ConstructL
-// 2nd phase constructor for the class, reads snapshot from stream
-// -----------------------------------------------------------------------------
-void CChangeFinder::ConstructL( TBool& aHasHistory )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TUid streamId;
-    streamId.iUid = iStreamUid;
-    
-    aHasHistory = iSyncRelationship.IsStreamPresentL(streamId);
-    
-    if ( aHasHistory )
-        {
-        LOGGER_WRITE("CChangeFinder::ConstructL, history exists.");
-        RReadStream readStream;
-        iSyncRelationship.OpenReadStreamLC(readStream, streamId);
-        
-        // Read the index, first create snapshot array
-        iOldSnapshot = new (ELeave) CSnapshotArray( KSnapshotGranularity );
-        
-        // Read used format version
-        TUint formatVer = readStream.ReadUint32L();
-        if ( formatVer != KSnapshotFormatVersion )
-            {
-            // Wrong version, do not try to import data
-            LOGGER_WRITE("CChangeFinder::ConstructL, Wrong format version -> no history");
-            aHasHistory = EFalse;
-            CleanupStack::PopAndDestroy( &readStream );
-            TRACE_FUNC_EXIT;
-            return;
-            }
-        
-        // Read item count
-        TInt count = readStream.ReadUint32L();
-        // Read items
-        for ( TInt i=0; i<count; i++ )
-            {
-            TSnapshotItem item;
-            item.InternalizeL( readStream );
-            iOldSnapshot->InsertIsqL( item, iKey );
-            }
-
-        CleanupStack::PopAndDestroy( &readStream );
-        }
-    else
-        {
-        LOGGER_WRITE("CChangeFinder::ConstructL, no sync history.");
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::CloseL
-// Closes ChangeFinder object and writes snapshot to stream
-// -----------------------------------------------------------------------------
-void CChangeFinder::CloseL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Write to stream
-    RWriteStream writeStream;
-    
-    TUid streamId;
-    streamId.iUid = iStreamUid; 
-
-    // Open write stream
-    iSyncRelationship.OpenWriteStreamLC( writeStream, streamId );
-    
-    // Write used format version
-    writeStream.WriteUint32L( KSnapshotFormatVersion );
-
-    // Write item count
-    TInt count(0);
-    if ( iOldSnapshot )
-        {
-        count = iOldSnapshot->Count();
-        }
-    writeStream.WriteUint32L(count);
-    
-    // Write items
-    for (TInt i=0; i<count; i++)
-        {
-        const TSnapshotItem& item = iOldSnapshot->At( i );
-        item.ExternalizeL( writeStream );
-        }
-
-    writeStream.CommitL();
-    CleanupStack::PopAndDestroy( &writeStream );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::ResetL
-// Resets synchronization history, all contetn is considered new after this call
-// -----------------------------------------------------------------------------
-void CChangeFinder::ResetL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Delete old change information
-    if ( iOldSnapshot )
-        {
-        LOGGER_WRITE("iOldSnapshot->Reset()");
-        iOldSnapshot->Reset();
-        }
-    
-    // Write 'null' data to file, 
-    // this removes change history from the file
-    CloseL();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::FindChangedItemsL
-// Compares snapshots, finds changed items
-// -----------------------------------------------------------------------------
-void CChangeFinder::FindChangedItemsL( CNSmlDataItemUidSet& aChangedUids )
-    {   
-    TRACE_FUNC_ENTRY;
-    
-    if ( !iCurrentSnapshot )
-        {
-        LOGGER_WRITE( "CChangeFinder::FindChangedItemsL leaved, no current snapshot." );
-        User::Leave( KErrNotFound );
-        }
-
-    if ( !iOldSnapshot )
-        {
-        LOGGER_WRITE( "CChangeFinder::FindChangedItemsL leaved, no old snapshot." );
-        User::Leave( KErrNotFound );
-        }
-        
-    TInt index;
-    TInt count = iCurrentSnapshot->Count();
-    LOGGER_WRITE_1( "CChangeFinder::FindChangedItemsL count: %d", count );
-    for ( TInt i=0; i < count; i++ )
-        {
-        const TSnapshotItem& currentItem = iCurrentSnapshot->At( i );
-        // Find this entry from the old snapshot
-        if ( iOldSnapshot->FindIsq( currentItem, iKey, index ) == KErrNone)
-            {
-            // This is the old item
-            TSnapshotItem& oldItem = iOldSnapshot->At( index );
-            // Compare hash to see whether this was changed
-            if ( oldItem.Hash().Compare( currentItem.Hash() ) != 0
-                    || oldItem.ParentId() != currentItem.ParentId() )
-                {
-                aChangedUids.AddItem( currentItem.ItemId() );
-                //LOGGER_WRITE_1( "Item %d was changed.", currentItem.ItemId() );  
-                }
-            }
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::FindDeletedItemsL
-// Compares snapshots, finds deleted items
-// -----------------------------------------------------------------------------
-void CChangeFinder::FindDeletedItemsL( CNSmlDataItemUidSet& aDeletedUids )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    if ( !iOldSnapshot )
-        {
-        LOGGER_WRITE( "CChangeFinder::FindDeletedItemsL leaved, no old snapshot." );
-        User::Leave( KErrNotFound );
-        }
-    
-    TInt index;
-    TInt count = iOldSnapshot->Count();
-    for ( TInt i=0; i < count; i++ )
-        {
-        const TSnapshotItem& currentItem = iOldSnapshot->At( i );
-        
-        // If there's no current snapshot, this definately is deleted item
-        if ( !iCurrentSnapshot )
-            {
-            aDeletedUids.AddItem( currentItem.ItemId() );
-            //LOGGER_WRITE_1( "Item %d was deleted.", currentItem.ItemId() );
-            }
-        // It is also new if it doesn't exist int the current snapshot.
-        else if ( iCurrentSnapshot->FindIsq( currentItem, iKey, index ) != KErrNone )
-            {
-            aDeletedUids.AddItem( currentItem.ItemId() );
-            //LOGGER_WRITE_1( "Item %d was deleted.", currentItem.ItemId() );
-            }       
-        }
-        
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::FindNewItemsL
-// Compares snapshots, finds new items
-// -----------------------------------------------------------------------------
-void CChangeFinder::FindNewItemsL( CNSmlDataItemUidSet& aNewUids )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    if ( !iCurrentSnapshot )
-        {
-        LOGGER_WRITE( "CChangeFinder::FindNewItemsL leaved, no current snapshot." );
-        User::Leave( KErrNotFound );
-        }
-
-    TInt index;
-    TInt count = iCurrentSnapshot->Count();
-    for ( TInt i=0; i < count; i++ )
-        {
-        const TSnapshotItem& currentItem = iCurrentSnapshot->At( i );
-        
-        // If there's no old snapshot, all items are new
-        if ( !iOldSnapshot )
-            {
-            aNewUids.AddItem( currentItem.ItemId() );
-            //LOGGER_WRITE_1( "Item %d was new.", currentItem.ItemId() );
-            }
-        // It is also new if it doesn't exist int the old snapshot.
-        else if ( iOldSnapshot->FindIsq( currentItem, iKey, index ) != KErrNone )
-            {
-            aNewUids.AddItem( currentItem.ItemId() );
-            //LOGGER_WRITE_1( "Item %d was new.", currentItem.ItemId() );
-            }       
-        }
-        
-    TRACE_FUNC_EXIT;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::ItemAddedL
-// Adds item to snapshot, this item is no longer considered new
-// -----------------------------------------------------------------------------
-void CChangeFinder::ItemAddedL( const TSnapshotItem& aItem )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Add this to old snapshot, if there's no old snapshot it must be created
-    if ( !iOldSnapshot )
-        {
-        iOldSnapshot = new (ELeave) CSnapshotArray( KSnapshotGranularity );
-        }
-        
-    LOGGER_WRITE_1( "Adding item %d.", aItem.ItemId() );
-    
-    TRAPD( error, iOldSnapshot->InsertIsqL( aItem, iKey ) );
-    if ( error == KErrAlreadyExists )
-        {
-        // It was already committed, no actions required
-        LOGGER_WRITE( "iOldSnapshot->InsertIsqL leaved with KErrAlreadyExists" );
-        }
-    else if ( error != KErrNone )
-        {
-        LOGGER_WRITE_1( "iOldSnapshot->InsertIsqL leaved with %d.", error );
-        User::Leave( error );
-        }
-    iOldSnapshot->Compress();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::ItemDeletedL
-// Removes item to snapshot, this item is no longer considered deleted
-// -----------------------------------------------------------------------------
-void CChangeFinder::ItemDeletedL( const TSnapshotItem& aItem )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    LOGGER_WRITE_1( "deleting item %d.", aItem.ItemId() );
-    
-    if ( !iOldSnapshot )
-        {
-        LOGGER_WRITE( "CChangeFinder::ItemDeleted leaved, no old snapshot." );
-        User::Leave( KErrNotFound );
-        }
-
-    // Delete item from the old snapshot
-    TInt index;
-    if ( iOldSnapshot->FindIsq( aItem, iKey, index ) == KErrNone )
-        {
-        iOldSnapshot->Delete( index );
-        }
-    else // Skip, there wasn't such entry
-        {
-        LOGGER_WRITE( "iOldSnapshot->FindIsq, item was not found." );
-        }
-    iOldSnapshot->Compress();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::ItemUpdatedL
-// Updates item to snapshot, this item is no longer considered changed
-// -----------------------------------------------------------------------------
-void CChangeFinder::ItemUpdatedL( const TSnapshotItem& aItem )
-    {
-    TRACE_FUNC_ENTRY;
-
-    LOGGER_WRITE_1( "Updating item %d.", aItem.ItemId() );
-    
-    // There must be such entry in the snapshot after this
-    // If there isn't old snapshot, we'll create it and add the item
-    if ( !iOldSnapshot )
-        {
-        iOldSnapshot = new (ELeave) CSnapshotArray( KSnapshotGranularity );
-        ItemAddedL( aItem );
-        }
-    else
-        {
-        // Update item in the old snapshot
-        TInt index;
-        if ( iOldSnapshot->FindIsq( aItem, iKey, index ) == KErrNone )
-            {
-            TSnapshotItem& oldItem = iOldSnapshot->At( index );
-            oldItem = aItem;
-            }
-        else 
-            {
-            // There was old snapshot but no such item. Let's add it
-            ItemAddedL( aItem );
-            }
-        
-        }
-    iOldSnapshot->Compress();
-    TRACE_FUNC_EXIT;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::CommitChangesL
-// Commits current changes to snapshot
-// -----------------------------------------------------------------------------
-void CChangeFinder::CommitChangesL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    if ( !iCurrentSnapshot )
-        {
-        LOGGER_WRITE( "CChangeFinder::CommitChangesL leaved, current snapshot missing." );
-        User::Leave( KErrNotFound );
-        }
-        
-    if ( !iOldSnapshot )
-        {
-        iOldSnapshot = new (ELeave) CSnapshotArray( KSnapshotGranularity );
-        }
-        
-    // Delete everything from the old snapshot
-    iOldSnapshot->Reset();
-    
-    // Loop through all the items in current snapshot
-    TInt count = iCurrentSnapshot->Count();
-    
-    // Copy everything from current to old snapshot
-    for ( TInt i = 0; i < count; i++ )
-        {
-        // Commit it to the old array.
-        iOldSnapshot->InsertIsqL( iCurrentSnapshot->At( i ), iKey );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::CommitChangesL
-// Commits current changes to snapshot, affects only a specified group of items
-// -----------------------------------------------------------------------------
-void CChangeFinder::CommitChangesL( const MSmlDataItemUidSet& aUids )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    
-    // This function commits changes from current snapshot to old snapshot
-    // But commits only the entries in the parameter array
-    if ( !iCurrentSnapshot )
-        {
-        LOGGER_WRITE( "CChangeFinder::CommitChangesL leaved, current snapshot missing." );
-        User::Leave( KErrNotFound );
-        }
-        
-    if ( !iOldSnapshot )
-        {
-        iOldSnapshot = new (ELeave) CSnapshotArray( KSnapshotGranularity );
-        }
-    
-    for ( TInt i = 0; i < aUids.ItemCount(); i++ )
-        {
-        TSmlDbItemUid itemId = aUids.ItemAt( i );
-        TSnapshotItem temp( itemId );
-        TInt indexOld( -1 );
-        TInt indexNew( -1 );
-        TInt err = iOldSnapshot->FindIsq( temp, iKey, indexOld);
-        if ( !err )
-            {
-            // founded from old snapshot
-            if ( !iCurrentSnapshot->FindIsq(temp, iKey, indexNew) )
-                {
-                // Replace
-                iOldSnapshot->At( indexOld ) = iCurrentSnapshot->At( indexNew );
-                }
-            else
-                {
-                // not found from current snapshot, delete from old also.
-                iOldSnapshot->Delete( indexOld );
-                }
-            }
-        else
-            {
-            // not found from old snapshot, add it.
-            if ( !iCurrentSnapshot->FindIsq( temp, iKey, indexNew ) )
-                {
-                iOldSnapshot->InsertIsqL( iCurrentSnapshot->At( indexNew ), iKey );
-                }
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::SetNewSnapshot
-// Sets new snapshot (to be compared against), ChangeFinder takes ownership
-// -----------------------------------------------------------------------------
-void CChangeFinder::SetNewSnapshot( CSnapshotArray* aNewSnapshot )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Delete existing snapshot
-    delete iCurrentSnapshot;
-    
-    // Set submitted snapshot as active
-    iCurrentSnapshot = aNewSnapshot;
-    iCurrentSnapshot->Compress();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::DataStoreUid
-// returns stored data store id number
-// -----------------------------------------------------------------------------
-TInt64 CChangeFinder::DataStoreUid() const
-    {
-    TRACE_FUNC;
-    return iDataStoreUid;
-    }
-
-// -----------------------------------------------------------------------------
-// CChangeFinder::SetDataStoreUid
-// Sets data store id number
-// -----------------------------------------------------------------------------
-void CChangeFinder::SetDataStoreUid( TInt64 aUid )
-    {
-    TRACE_FUNC;
-    iDataStoreUid = aUid;
-    }
-
--- a/omads/omadsextensions/adapters/mediads/src/cmdemanager.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,741 +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:  CMdEManager implementation
-*
-*/
-
-
-#include "cmdemanager.h"
-#include <mdeconstants.h>
-
-#include <mmf\common\mmfcontrollerpluginresolver.h>
-
-#include "logger.h"
-
-// Warning:  #940-D: missing return statement at end of non-void function
-#pragma  diag_remark 940
-
-CMdEManager::CMdEManager( MMdEManagerObserver& aObserver ) :
-    iObserver(aObserver)
-    {
-    }
-
-
-CMdEManager* CMdEManager::NewL( MMdEManagerObserver& aObserver )
-    {
-    CMdEManager* self = new (ELeave) CMdEManager( aObserver );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-void CMdEManager::ConstructL()
-    {
-    TRACE_FUNC;
-    iMde = CMdESession::NewL( *this );
-    }
-
-
-CMdEManager::~CMdEManager()
-    {
-    TRACE_FUNC;
-    Cancel(); // Cancel any request, if outstanding
-    delete iAlbumQuery;
-    delete iObjectQuery;
-    delete iContainmentQuery;
-    delete iMde;
-    
-    iAlbumsInProgress.ResetAndDestroy();
-    iAlbums.ResetAndDestroy();
-    }
-
-void CMdEManager::GetAlbumsL()
-    {
-    TRACE_FUNC_ENTRY;
-    iAlbumsInProgress.ResetAndDestroy();
-    iAlbums.ResetAndDestroy();
-    if ( !iMde )
-        {
-        LOGGER_WRITE("Session was not ready!");
-        iState = EUninitialized;
-        iMde = CMdESession::NewL( *this );
-        }
-    
-    if ( iState == EUninitialized)
-        {
-        LOGGER_WRITE("Starting processing albums after session is ready");
-        iState = EWaitingToEnumerateAlbums;
-        }
-    else if ( iState == EIdle )
-        {
-        StartProcessingAlbumsL();
-        }
-    else
-        {
-        LOGGER_WRITE_1("Wrong state: %d", iState);
-        User::Leave( KErrGeneral );
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-const CPlaylistItem& CMdEManager::AlbumL( TInt aAlbumId ) const
-    {
-    for ( TInt i=0; i<iAlbums.Count(); i++ )
-        {
-        if ( iAlbums[i]->Id() == aAlbumId )
-            {
-            LOGGER_WRITE("Album found");
-            return *iAlbums[i];
-            }
-        }
-    LOGGER_WRITE_1("CMdEManager::AlbumL - aAlbumId %d does not exist - Leaving KErrNotFound", aAlbumId);
-    User::Leave( KErrNotFound );
-    }
-
-void CMdEManager::CreateAlbumL( CPlaylistItem& aAlbum )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !iMde || iState != EIdle )
-        {
-        LOGGER_WRITE("Not ready!");
-        User::Leave( KErrNotReady );
-        }
-    CMdENamespaceDef& defaultNamespaceDef = iMde->GetDefaultNamespaceDefL();
-    CMdEObjectDef& albumObjDef = defaultNamespaceDef.GetObjectDefL( MdeConstants::Album::KAlbumObject );
-    
-    CMdEPropertyDef& titlePropDef = albumObjDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );   
-    
-    // Validate album name
-    TInt albumLength = aAlbum.Title().Length();
-    if ( albumLength < titlePropDef.MinTextLengthL() || 
-         albumLength > titlePropDef.MaxTextLengthL() )
-        {
-        LOGGER_WRITE("Album length is not on valid range!");
-        User::Leave( KErrBadName );
-        }
-    
-    CMdEObject* albumObject = iMde->NewObjectLC( albumObjDef, KNullDesC );
-    
-    CMdEPropertyDef& sizePropDef = albumObjDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty );
-    albumObject->AddUint32PropertyL(sizePropDef, 0);
-    CMdEPropertyDef& creationDatePropDef = albumObjDef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty );
-    CMdEPropertyDef& lastModifiedDatePropDef = albumObjDef.GetPropertyDefL( MdeConstants::Object::KLastModifiedDateProperty );
-    
-    TTime timeDate;
-    timeDate.UniversalTime();
-    
-    albumObject->AddTimePropertyL( creationDatePropDef, timeDate );
-    albumObject->AddTimePropertyL( lastModifiedDatePropDef, timeDate );
-    
-    CMdEPropertyDef& typePropDef = albumObjDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
-    albumObject->AddTextPropertyL( typePropDef,MdeConstants::Album::KAlbumItemType );
-    
-    albumObject->AddTextPropertyL( titlePropDef, aAlbum.Title() );
-    TItemId newAlbumId = iMde->AddObjectL( *albumObject );
-    
-    CleanupStack::PopAndDestroy( albumObject );
-    
-    if ( newAlbumId == KNoId )
-        {
-        LOGGER_WRITE("Adding album failed!");
-        User::Leave( KErrGeneral );
-        }
-    LOGGER_WRITE_1("New almbum created, id: %d", newAlbumId);
-    
-    CMdERelationDef& relationDef = defaultNamespaceDef.GetRelationDefL( MdeConstants::Relations::KContains );
-    TMdEObject mediaObject;
-    RPointerArray<CMdEInstanceItem> relations;
-    CleanupResetAndDestroyPushL( relations);
-    for ( TInt i=0; i<aAlbum.ItemCount(); i++ )
-        {
-        TRAPD(err, iMde->CheckObjectL( mediaObject, aAlbum.ItemAt(i) ));
-        LOGGER_WRITE_1("url: %S", &aAlbum.ItemAt(i));
-        LOGGER_WRITE_1("CheckObjectL err: %d", err);
-        if ( !err )
-            {
-            LOGGER_WRITE_1("object def: %S", &mediaObject.DefL().Name());
-            if ( mediaObject.DefL().Name().Compare( MdeConstants::Image::KImageObject ) == 0 
-                    || mediaObject.DefL().Name().Compare( MdeConstants::Video::KVideoObject ) == 0 )
-                {
-                CMdERelation* relation = iMde->NewRelationL( relationDef, newAlbumId, mediaObject.Id() );
-                relations.AppendL( relation );
-                }
-            else
-                {
-                LOGGER_WRITE("type not supported");
-                }
-            }
-        }
-    
-    if ( relations.Count() > 0 )
-        {
-        TInt err = iMde->AddItemsL( relations );
-        LOGGER_WRITE_1("AddItemsL first err: %d", err);
-        }
-    
-    CleanupStack::PopAndDestroy( &relations );
-    
-    aAlbum.SetId( newAlbumId );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CMdEManager::ReplaceAlbumL( TInt aAlbumId, CPlaylistItem& aAlbum )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !iMde || iState != EIdle )
-        {
-        LOGGER_WRITE("Not ready!");
-        User::Leave( KErrNotReady );
-        }
-    // get old album from local cache and check do we need to change album title
-    const CPlaylistItem& oldAlbum = AlbumL( aAlbumId );
-    CMdENamespaceDef& defaultNamespaceDef = iMde->GetDefaultNamespaceDefL();
-    if ( oldAlbum.Title().Compare( aAlbum.Title() ) != 0 )
-        {
-        // Title changed, open item from MdE and update it
-        
-        CMdEObjectDef& albumObjDef = defaultNamespaceDef.GetObjectDefL( MdeConstants::Album::KAlbumObject );
-        
-        CMdEPropertyDef& titlePropDef = albumObjDef.GetPropertyDefL( 
-                MdeConstants::Object::KTitleProperty );
-        
-        // Validate album name
-        TInt albumLength = aAlbum.Title().Length();
-        if ( albumLength < titlePropDef.MinTextLengthL() || 
-             albumLength > titlePropDef.MaxTextLengthL() )
-            {
-            LOGGER_WRITE("Album length is not on valid range!");
-            User::Leave( KErrBadName );
-            }
-        
-        CMdEObject* albumObject = iMde->OpenObjectL( aAlbumId, albumObjDef );
-        
-        CMdEProperty* titleProp = NULL;
-        TInt index = albumObject->Property( titlePropDef, titleProp );
-        if ( index == KErrNotFound )
-            {
-            LOGGER_WRITE("Cannot find title property");
-            User::Leave( KErrCorrupt );
-            }
-        
-        LOGGER_WRITE("Change title property");
-        titleProp->SetTextValueL( aAlbum.Title() );
-        
-        CMdEPropertyDef& lastModDatePropDef = albumObjDef.GetPropertyDefL(
-                MdeConstants::Object::KLastModifiedDateProperty );
-        CMdEProperty* lastModDateProp = NULL;
-        index = albumObject->Property( lastModDatePropDef, lastModDateProp );
-        
-        if ( index == KErrNotFound )
-            {
-            LOGGER_WRITE("Cannot find lastModDateProp property");
-            User::Leave( KErrCorrupt );
-            }
-        
-        TTime now;
-        now.UniversalTime();
-        lastModDateProp->SetTimeValueL( now );
-        
-        iMde->CommitObjectL( *albumObject );
-        }
-    
-    // Update album and content relations
-    // Search added relations
-    CMdERelationDef& containsRelationDef = defaultNamespaceDef.GetRelationDefL( MdeConstants::Relations::KContains );
-    TMdEObject mediaObject;
-    RPointerArray<CMdEInstanceItem> addedRelations;
-    CleanupResetAndDestroyPushL( addedRelations);
-    for ( TInt i=0; i< aAlbum.ItemCount(); i++)
-        {
-        TInt index(KErrNotFound);
-        TInt foundRes = oldAlbum.FindItem( aAlbum.ItemAt(i) ,index );
-        if ( foundRes != 0 )
-            {
-            // Item not found for old album -> Added relation
-            // Find object by uri
-            TRAPD( err, iMde->CheckObjectL( mediaObject, aAlbum.ItemAt(i) ));
-            LOGGER_WRITE_1("url: %S", &aAlbum.ItemAt(i));
-            LOGGER_WRITE_1("CheckObjectL err: %d", err);
-            if ( !err )
-                {
-                LOGGER_WRITE_1("object def: %S", &mediaObject.DefL().Name());
-                if ( mediaObject.DefL().Name().Compare( MdeConstants::Image::KImageObject ) == 0 
-                        || mediaObject.DefL().Name().Compare( MdeConstants::Video::KVideoObject ) == 0 )
-                    {
-                    CMdERelation* relation = iMde->NewRelationL( containsRelationDef, aAlbumId, mediaObject.Id() );
-                    addedRelations.AppendL( relation );
-                    }
-                else
-                    {
-                    LOGGER_WRITE("type not supported");
-                    }
-                }
-            
-            }
-        }
-    if ( addedRelations.Count() > 0 )
-        {
-        TInt err = iMde->AddItemsL( addedRelations );
-        LOGGER_WRITE_1("AddItemsL first err: %d", err);
-        }
-    
-    CleanupStack::PopAndDestroy( &addedRelations );
-    
-    // search removed relations
-    if ( iContainmentQuery )
-        {
-        delete iContainmentQuery;
-        iContainmentQuery = NULL;
-        }
-    iContainmentQuery = iMde->NewRelationQueryL( defaultNamespaceDef, this );
-    
-    CMdELogicCondition& rootCondition = iContainmentQuery->Conditions();
-    CMdERelationCondition& relationCondition =
-        rootCondition.AddRelationConditionL(containsRelationDef,
-                                            ERelationConditionSideLeft); // "AND"
-    
-    CMdELogicCondition& leftCondition = relationCondition.LeftL();
-    CMdELogicCondition& rightCondition = relationCondition.RightL();
-    
-    leftCondition.AddObjectConditionL( aAlbumId );
-    
-    CMdELogicCondition& objectDefLogicCond = 
-            rightCondition.AddLogicConditionL( ELogicConditionOperatorOr);
-    
-    TBool removingRelationsNeeded( EFalse );
-    for ( TInt i=0; i< oldAlbum.ItemCount(); i++)
-        {
-        TInt index(KErrNotFound);
-        TInt foundRes = aAlbum.FindItem( oldAlbum.ItemAt(i) ,index );
-        if ( foundRes != 0 )
-            {
-            removingRelationsNeeded = ETrue;
-            // Item not found from new album -> Removed relation (add uri to search condition)
-            LOGGER_WRITE_1("relation to be removed, uri: %S", &oldAlbum.ItemAt(i) );
-            objectDefLogicCond.AddObjectConditionL( EObjectConditionCompareUri, oldAlbum.ItemAt(i) );
-            }
-        }
-    
-    if ( removingRelationsNeeded )
-        {
-        // find all removed relation ID:s. HandleRelationQueryCompleted will be called when ready.
-        iContainmentQuery->SetResultMode( EQueryResultModeId );
-        iContainmentQuery->FindL();
-        iState = EReplacingAlbum;
-        }
-    else
-        {
-        // All done
-        iState = EIdle;
-        iObserver.AlbumReplaced( KErrNone );
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CMdEManager::DeleteAlbumL( TInt aAlbumId )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !iMde || iState != EIdle )
-        {
-        LOGGER_WRITE("Not ready!");
-        User::Leave( KErrNotReady );
-        }
-    
-    CMdENamespaceDef& defaultNamespaceDef = iMde->GetDefaultNamespaceDefL();
-    CMdEObjectDef& albumObjDef = defaultNamespaceDef.GetObjectDefL( MdeConstants::Album::KAlbumObject );
-    
-    CMdEObject* albumObject = iMde->GetObjectL( aAlbumId, albumObjDef );
-    
-    CMdEPropertyDef& typePropDef = albumObjDef.GetPropertyDefL( 
-           MdeConstants::Album::KTypeProperty );
-    
-    CMdEProperty* typeProp = NULL;
-    TInt index = albumObject->Property( typePropDef, typeProp );
-    if ( index != KErrNotFound )
-        {
-        TUint16 typeVal = typeProp->Uint16ValueL();
-        if ( typeVal == MdeConstants::Album::EAlbumSystemFavourite )
-            {
-            LOGGER_WRITE("Item type is EAlbumSystemFavourite, deletion not allowed!");
-            User::Leave( KErrPermissionDenied );
-            }
-        }
-    
-    TItemId removedId(KNoId);
-    removedId = iMde->RemoveObjectL( aAlbumId );
-    if ( removedId == KNoId )
-        {
-        LOGGER_WRITE("Deletion failed!");
-        User::Leave( KErrNotFound );
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CMdEManager::StartProcessingAlbumsL()
-    {
-    TRACE_FUNC_ENTRY;
-    CMdENamespaceDef& defaultNamespaceDef = iMde->GetDefaultNamespaceDefL();
-    CMdEObjectDef& albumObjDef = defaultNamespaceDef.GetObjectDefL( MdeConstants::Album::KAlbumObject );
-    if ( iAlbumQuery )
-        {
-        delete iAlbumQuery;
-        iAlbumQuery = NULL;
-        }
-    // query objects with object definition "Album"
-    iAlbumQuery = iMde->NewObjectQueryL( defaultNamespaceDef, albumObjDef, this );
-    
-    // Add order
-    CMdEObjectDef& objdef = defaultNamespaceDef.GetObjectDefL( MdeConstants::Object::KBaseObject );
-    CMdEPropertyDef& propDef = objdef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
-    TMdEOrderRule rule( propDef, ETrue );
-    iAlbumQuery->AppendOrderRuleL( rule );
-    
-    iAlbumQuery->FindL();
-    
-    iState = EEnumeratingAlbums;
-
-    TRACE_FUNC_EXIT;
-    }
-    
-
-void CMdEManager::FindItemsOnAlbumL( TItemId aAlbumObjectId )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !iMde )
-        {
-        LOGGER_WRITE("Session was not ready!");
-        User::Leave( KErrNotReady );
-        }
-    CMdENamespaceDef& defaultNamespaceDef = iMde->GetDefaultNamespaceDefL();
-    CMdEObjectDef& objDef = defaultNamespaceDef.GetObjectDefL(  MdeConstants::Object::KBaseObject );
-    
-    CMdEPropertyDef& titlePropDef = objDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
-    
-    if ( iObjectQuery )
-        {
-        delete iObjectQuery;
-        iObjectQuery = NULL;
-        }
-    iObjectQuery = iMde->NewObjectQueryL( defaultNamespaceDef, objDef, this );
-    
-    // get only "Title" property
-    iObjectQuery->AddPropertyFilterL( &titlePropDef );
-    
-    CMdEObjectDef& objdef = defaultNamespaceDef.GetObjectDefL( MdeConstants::Object::KBaseObject );
-    CMdEPropertyDef& propDef = objdef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
-
-    CMdELogicCondition& rootCond = iObjectQuery->Conditions();
-
-    CMdERelationDef& containsRelDef = defaultNamespaceDef.GetRelationDefL( 
-        MdeConstants::Relations::KContains );
-
-    // query right side objects from relations
-    CMdERelationCondition& relCond = rootCond.AddRelationConditionL( 
-        containsRelDef, ERelationConditionSideRight );
-
-    // left side object of relation must be defined album object
-    CMdELogicCondition& leftRelCond = relCond.LeftL();
-    leftRelCond.AddObjectConditionL( aAlbumObjectId );
-    
-    iObjectQuery->FindL();
-
-    TRACE_FUNC_EXIT;
-    }
-
-/**
- * Called to notify the observer that opening the session has been 
- * completed and, if the opening succeeded, the session is ready for use.
- *
- * @param aSession session
- * @param aError   <code>KErrNone</code>, if opening the session succeeded;
- *                 or one of the system-wide error codes, if opening the 
- *                 session failed
- */
-void CMdEManager::HandleSessionOpened(CMdESession& /*aSession*/, TInt aError)
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !aError )
-        {
-        LOGGER_WRITE("Session opened");
-        if ( iState == EWaitingToEnumerateAlbums )
-            {
-            iState = EIdle;
-            TRAPD(err, StartProcessingAlbumsL());
-            if ( err )
-                {
-                iObserver.AlbumsReaded( err );
-                }
-            }
-        else
-            {
-            iState = EIdle;
-            }
-        }
-    else
-        {
-        LOGGER_WRITE_1("Error happened on opening session, aError: %d", aError);
-        if ( iState == EWaitingToEnumerateAlbums )
-            {
-            iObserver.AlbumsReaded( aError );
-            }
-        iState = EUninitialized;
-        delete iMde;
-        iMde = NULL;
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-/**
- * Called to notify the observer about errors, which are not a direct 
- * consequence of the operations initiated by the client but caused by 
- * some external source (e.g., other clients). The error cannot be 
- * recovered and all on-going operations initiated by the client have been 
- * aborted. Any attempts to continue using the session will cause a panic. 
- * The client should close the session immediately and try to open a new 
- * session, if it needs to continue using the metadata engine.
- *
- * @param aSession session
- * @param aError one of the system-wide error codes
- */
-void CMdEManager::HandleSessionError(CMdESession& /*aSession*/, TInt aError)
-    {
-    // Something went wrong. Handle the error and delete the old session.
-    LOGGER_WRITE_1("CMdEManager::HandleSessionError - aError: %d", aError)
-    iState = EUninitialized;
-    delete iMde;
-    iMde = NULL;
-    }
-
-/**
- * Called to notify the observer that new results have been received 
- * in the query.
- *
- * @param aQuery              Query instance that received new results.
- * @param aFirstNewItemIndex  Index of the first new item that was added
- *                            to the result item array.
- * @param aNewItemCount       Number of items added to the result item 
- *                            array.
- */
-void CMdEManager::HandleQueryNewResults(CMdEQuery& /*aQuery*/,
-                                   TInt /*aFirstNewItemIndex*/,
-                                   TInt /*aNewItemCount*/)
-    {
-    }
-
-void CMdEManager::ProcessNextAlbumL()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iAlbumsInProgress.Count() == 0 )
-        {
-        LOGGER_WRITE("All ready");
-        // all ready
-        return;
-        }
-    
-    FindItemsOnAlbumL( iAlbumsInProgress[0]->Id() );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-        
-/**
- * Called to notify the observer that the query has been completed,
- * or that an error has occured.
- *
- * @param aQuery  Query instance.
- * @param aError  <code>KErrNone</code>, if the query was completed
- *                successfully. Otherwise one of the system-wide error 
- *                codes.
- */
-void CMdEManager::HandleQueryCompleted(CMdEQuery& aQuery, TInt aError)
-    {
-    TRACE_FUNC_ENTRY;
-    TInt err( aError );
-    
-    if ( iState == EEnumeratingAlbums )
-        {
-        CMdEObjectQuery& query = (CMdEObjectQuery&)aQuery;
-        if ( !err && &aQuery == iAlbumQuery )
-            {
-            LOGGER_WRITE("Album query");
-            TRAP( err, HandleAlbumQueryCompletedL( query ));
-            }
-        else if ( !err && &aQuery == iObjectQuery )
-            {
-            LOGGER_WRITE("Object query");
-            TRAP( err, HandleObjectQueryCompletedL( query ));
-            }
-        else
-            {
-            LOGGER_WRITE("unknown query or error happened");
-            }
-        
-        if ( err )
-            {
-            LOGGER_WRITE_1("Error happened: %d", err);
-            iState = EIdle;
-            iAlbumsInProgress.ResetAndDestroy();
-            iAlbums.ResetAndDestroy();
-            iObserver.AlbumsReaded( err );
-            }
-        }
-    else if ( iState == EReplacingAlbum )
-        {
-        if ( !err && &aQuery == iContainmentQuery )
-            {
-            LOGGER_WRITE("relation query");
-            CMdERelationQuery& query = (CMdERelationQuery&)aQuery;
-            TRAP( err, HandleRelationQueryCompletedL( query ));
-            }
-        
-        iState = EIdle;
-        iObserver.AlbumReplaced( err );
-        
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CMdEManager::HandleAlbumQueryCompletedL
-// Callback function for find all albums. Save albums to iAlbumsInProgress array 
-// and start collecting objects on each album.
-// -----------------------------------------------------------------------------
-void CMdEManager::HandleAlbumQueryCompletedL( CMdEObjectQuery& aQuery )
-    {
-    TRACE_FUNC_ENTRY;
-    // clear old items
-    iAlbumsInProgress.ResetAndDestroy();
-    iAlbums.ResetAndDestroy();
-    
-    for ( TInt i = 0; i < aQuery.Count(); i++ )
-        {
-        CPlaylistItem* albumItem = CPlaylistItem::NewLC();
-        CMdEObject& object = aQuery.Result(i);
-        LOGGER_WRITE_1("Id: %d", object.Id());
-        albumItem->SetId( object.Id() );
-        
-        CMdEPropertyDef& titlePropDef = object.Def().GetPropertyDefL( MdeConstants::Object::KTitleProperty );
-              
-        CMdEProperty* titleProp = NULL;
-        TInt index = object.Property( titlePropDef, titleProp );
-        if ( index != KErrNotFound )
-            {
-            const TDesC& title = titleProp->TextValueL();
-            LOGGER_WRITE_1("Title: %S", &title);
-            albumItem->SetTitleL( title );
-            }
-        else
-            {
-            // not found, might be default album
-            albumItem->SetTitleL( object.Uri() );
-            }
-        
-        LOGGER_WRITE("");
-        iAlbumsInProgress.AppendL( albumItem );
-        CleanupStack::Pop( albumItem );
-        }
-    
-    if ( aQuery.Count() > 0 )
-        {
-        // Start processing albums
-        ProcessNextAlbumL();
-        }
-    else
-        {
-        // no albums
-        iObserver.AlbumsReaded( KErrNone );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CMdEManager::HandleObjectQueryCompletedL( CMdEObjectQuery& aQuery )
-    {
-    if ( !iAlbumsInProgress.Count() )
-        {
-        LOGGER_WRITE("Error! No items on iAlbumsInProgress");
-        User::Leave( KErrGeneral );
-        }
-    for ( TInt i = 0; i < aQuery.Count(); i++ )
-        {
-        CMdEObject& object = aQuery.Result(i);
-        iAlbumsInProgress[0]->AddItemL( object.Uri() );
-        }
-    iAlbums.AppendL( iAlbumsInProgress[0] );
-    iAlbumsInProgress.Remove( 0 );
-    if ( iAlbumsInProgress.Count() > 0)
-        {
-        ProcessNextAlbumL();
-        }
-    else
-        {
-        // all albums processed
-        iState = EIdle;
-        iObserver.AlbumsReaded( KErrNone );
-        }
-    }
-
-void CMdEManager::HandleRelationQueryCompletedL( CMdERelationQuery& aQuery )
-    {
-    TRACE_FUNC_ENTRY;
-    const RArray<TItemId>& res = aQuery.ResultIds();
-    LOGGER_WRITE_1("founded relations count: %d", res.Count())
-    for (TInt i=0; i<res.Count(); i++ )
-        {
-        LOGGER_WRITE_1(" %d", res[i]);
-        }
-    LOGGER_WRITE_1("q count: %d", aQuery.Count() );
-    RArray<TItemId> removed;
-    CMdENamespaceDef& defaultNameSpace = iMde->GetDefaultNamespaceDefL();
-    iMde->RemoveRelationsL( aQuery.ResultIds(),removed, &defaultNameSpace);
-    LOGGER_WRITE_1("Removed relations count: %d", removed.Count())
-    for (TInt i=0; i<removed.Count(); i++)
-        {
-        LOGGER_WRITE_1(" %d", removed[i]);
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CMdEManager::Cancel()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iState == EWaitingToEnumerateAlbums )
-        {
-        // Cancel enumeration before it even begins
-        iState = EUninitialized;
-        iObserver.AlbumsReaded( KErrCancel );
-        }
-    
-    if ( iAlbumQuery )
-        {
-        LOGGER_WRITE("iAlbumQuery->Cancel()");
-        iAlbumQuery->Cancel();
-        }
-    if ( iObjectQuery )
-        {
-        LOGGER_WRITE("iObjectQuery->Cancel()");
-        iObjectQuery->Cancel();
-        }
-    if ( iContainmentQuery )
-        {
-        LOGGER_WRITE("iContainmentQuery->Cancel()");
-        iContainmentQuery->Cancel();
-        }
-    TRACE_FUNC_EXIT;
-    }
--- a/omads/omadsextensions/adapters/mediads/src/mediadsprovider.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,305 +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:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-  
-#include <f32file.h>
-#include <bautils.h>
-#include <barsc.h> 
-#include <stringpool.h> 
-#include <data_caging_path_literals.hrh>
-
-#include <smldataformat.h>
-#include <ecom/implementationproxy.h>
-#include "mediadsprovider.h"
-#include "mediadsproviderdefs.h"
-#include "mediadsstore.h"
-#include <mediadsstore.rsg>
-#include "logger.h"
-
-
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::CMediaDataProvider
-// C++ default constructor can NOT contain any code, that might leave
-// -----------------------------------------------------------------------------
-CMediaDataProvider::CMediaDataProvider() :
-    iOwnStoreFormat(NULL),
-    iFilters(1)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-void CMediaDataProvider::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iStringPool.OpenL();
-    User::LeaveIfError( iFs.Connect() );
-
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CMediaDataProvider* CMediaDataProvider::NewL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    CMediaDataProvider* self = new (ELeave) CMediaDataProvider;
-   
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-
-    TRACE_FUNC_EXIT;
-    return self;  
-    }
-
-    
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::~CMediaDataProvider
-// Destructor.
-// -----------------------------------------------------------------------------
-CMediaDataProvider::~CMediaDataProvider()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    delete iOwnStoreFormat; 
-    iStringPool.Close();
-    
-    iFilters.ResetAndDestroy();
-    iFilters.Close();
-    
-    iFs.Close();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoOnFrameworkEvent
-// Not used
-// -----------------------------------------------------------------------------
-void CMediaDataProvider::DoOnFrameworkEvent(TSmlFrameworkEvent, TInt /*aParam1*/, TInt /*aParam2*/)
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoSupportsOperation
-// Checks whether data provider supports specific operation
-// -----------------------------------------------------------------------------
-TBool CMediaDataProvider::DoSupportsOperation(TUid /*aOpId*/) const 
-    {
-    TRACE_FUNC;
-    
-    // Optional operations are not supported
-    return EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoStoreFormatL
-// Creates data store format
-// -----------------------------------------------------------------------------
-const CSmlDataStoreFormat& CMediaDataProvider::DoStoreFormatL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    if ( !iOwnStoreFormat )
-        {
-        iOwnStoreFormat = DoOwnStoreFormatL();
-        }
-    
-    TRACE_FUNC_EXIT;
-    
-    return *iOwnStoreFormat;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoListStoresLC
-// Returns array fo data stores, not implemented because only single data store
-// is supported
-// -----------------------------------------------------------------------------
-CDesCArray* CMediaDataProvider::DoListStoresLC()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    CDesCArrayFlat* stores = new (ELeave) CDesCArrayFlat(1);
-    CleanupStack::PushL( stores );
-    stores->AppendL( KMediaDsDbName );
-    stores->AppendL( KMediaDsRefreshDbName );
-    
-    TRACE_FUNC_EXIT;
-    
-    return stores;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoDefaultStoreL
-// Returns the name of the default data store
-// -----------------------------------------------------------------------------
-const TDesC& CMediaDataProvider::DoDefaultStoreL()
-    {
-    TRACE_FUNC;
-    return KMediaDsDbName;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoNewStoreInstanceLC
-// Creates a new data store object, which can be used for synchronization
-// ----------------------------------------------------------------------------- 
-CSmlDataStore* CMediaDataProvider::DoNewStoreInstanceLC()
-    {
-    TRACE_FUNC_ENTRY;
-    CMediaDsDataStore* newStore = CMediaDsDataStore::NewLC( iFs );
-    TRACE_FUNC_EXIT;
-    return newStore;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoCheckSupportedServerFiltersL
-// Filters are not supported
-// ----------------------------------------------------------------------------- 
-void CMediaDataProvider::DoCheckSupportedServerFiltersL(
-    const CSmlDataStoreFormat& /*aServerDataStoreFormat*/,
-    RPointerArray<CSyncMLFilter>& /*aFilters*/,
-    TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoCheckServerFiltersL
-// Filters are not supported
-// ----------------------------------------------------------------------------- 
-void CMediaDataProvider::DoCheckServerFiltersL(
-    RPointerArray<CSyncMLFilter>& /*aFilters*/,
-    TSyncMLFilterChangeInfo& /*aChangeInfo*/)
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoSupportedServerFiltersL
-// Filters are not supported
-// ----------------------------------------------------------------------------- 
-const RPointerArray<CSyncMLFilter>& CMediaDataProvider::DoSupportedServerFiltersL()
-    {
-    TRACE_FUNC;
-    return iFilters; // empty array
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoSupportsUserSelectableMatchType
-// Not supported
-// -----------------------------------------------------------------------------        
-TBool CMediaDataProvider::DoSupportsUserSelectableMatchType() const
-    {
-    TRACE_FUNC;
-    return EFalse;
-    }           
-    
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoGenerateRecordFilterQueryLC
-// Filters are not supported
-// ----------------------------------------------------------------------------- 
-HBufC* CMediaDataProvider::DoGenerateRecordFilterQueryLC(
-    const RPointerArray<CSyncMLFilter>& /*aFilters*/,
-    TSyncMLFilterMatchType /*aMatch*/, TDes& /*aFilterMimeType*/,
-    TSyncMLFilterType& /*aFilterType*/, TDesC& /*aStoreName*/ )
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    return NULL;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoGenerateFieldFilterQueryL
-// Filters are not supported
-// ----------------------------------------------------------------------------- 
-void CMediaDataProvider::DoGenerateFieldFilterQueryL(
-    const RPointerArray<CSyncMLFilter>& /*aFilters*/, TDes& /*aFilterMimeType*/,
-    RPointerArray<CSmlDataProperty>& /*aProperties*/, TDesC& /*aStoreName*/)
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDataProvider::DoOwnStoreFormatL
-// Creates data store format
-// -----------------------------------------------------------------------------
-CSmlDataStoreFormat* CMediaDataProvider::DoOwnStoreFormatL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TParse* parse = new ( ELeave ) TParse();
-    CleanupStack::PushL(parse);
-    TFileName fileName;
-    RResourceFile resourceFile;
-    
-    parse->Set( KMediaDsStoreFormatRsc, &KDC_RESOURCE_FILES_DIR, NULL );
-    fileName = parse->FullName();
-    LOGGER_WRITE_1("filename: %S", &fileName);
-    BaflUtils::NearestLanguageFile( iFs, fileName );
-    
-    resourceFile.OpenL( iFs, fileName );
-    CleanupClosePushL( resourceFile );
-    
-    HBufC8* buffer = resourceFile.AllocReadLC( MEDIADS_DATA_STORE );
-    
-    TResourceReader reader;
-    reader.SetBuffer( buffer );
-    
-    CSmlDataStoreFormat* dsFormat = NULL;
-    dsFormat = CSmlDataStoreFormat::NewLC( iStringPool, reader );
-    
-    CleanupStack::Pop( dsFormat );
-    CleanupStack::PopAndDestroy( buffer );
-    CleanupStack::PopAndDestroy( &resourceFile );
-    CleanupStack::PopAndDestroy( parse );
-    
-    TRACE_FUNC_EXIT;
-    
-    return dsFormat;
-    }
-
-
-// -----------------------------------------------------------------------------
-// ImplementationTable
-// Required by ECom plugin interface, tells the entry point of the library
-// -----------------------------------------------------------------------------
-const TImplementationProxy ImplementationTable[] = 
-    {
-    IMPLEMENTATION_PROXY_ENTRY(KMediaDataProviderImplUid, CMediaDataProvider::NewL)
-    };
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy
-// Returns the implementation table, required by the ECom plugin interface
-// -----------------------------------------------------------------------------
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-    {
-    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
-    return ImplementationTable;
-    }
--- a/omads/omadsextensions/adapters/mediads/src/mediadsprovider.rss	Tue Aug 31 15:05:37 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:  Resource definitions for Media DS ECOM plug-in
-*
-*/
-
-
-#include <ecom/registryinfo.rh> 
-
-RESOURCE REGISTRY_INFO theRegistryInfo
-  {
-  dll_uid = 0x2001A9A1; //The DLL's 3rd UID.
-  interfaces = 
-      {
-      INTERFACE_INFO
-          {
-          interface_uid = 0x101F4D3A; // Constant for all DS plug ins
-          implementations = 
-            {
-            IMPLEMENTATION_INFO
-                {
-                implementation_uid = 0x2001A9A1; // DS interface implementation UID
-                version_no = 1; 
-                display_name = "Media"; // shown in UI
-                }
-            };
-          }
-      };
-    }
--- a/omads/omadsextensions/adapters/mediads/src/mediadsstore.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1210 +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:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-
-#include "mediadsstore.h"
-#include <mpxmessagegeneraldefs.h>
-#include <mpxcollectionmessage.h>
-
-#include "mediadsproviderdefs.h"
-#include "mediamanager.h"
-#include "cmdemanager.h"
-#include "playlistitem.h"
-#include "omadsfolderobject.h"
-#include "snapshotitem.h"
-#include "logger.h"
-
-_LIT8( KFolderMimeType, "application/vnd.omads-folder+xml" );
-_LIT8( KFolderMimeVersion, "1.2" );
-
-_LIT8( KPlaylistMimeType, "audio/x-mpegurl");
-_LIT8( KPlaylistMimeVersion, "1.0");
-
-_LIT8( KSongMimeType, "application/x-song");
-_LIT8( KSongMimeVersion, "1.0");
-
-
-const TInt KDataBufferSize = 1024;
-
-const TInt KAlbumsOffSet = 0x0000f000;
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::CMediaDsDataStore
-// C++ default constructor can NOT contain any code, that might leave.
-// -----------------------------------------------------------------------------
-CMediaDsDataStore::CMediaDsDataStore( RFs& aFs):
-    iKey(TKeyArrayFix(_FOFF(TSnapshotItem, ItemId()), ECmpTInt)),
-    iFs( aFs )
-    { 
-    TRACE_FUNC;
-    }
-  
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::ConstructL
-// Symbian 2nd phase constructor, can leave.
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Item UID sets, used to transfer change info
-    iNewItems = new (ELeave) CNSmlDataItemUidSet;
-    iDeletedItems = new (ELeave) CNSmlDataItemUidSet;
-    iUpdatedItems = new (ELeave) CNSmlDataItemUidSet;
-    iMovedItems = new (ELeave) CNSmlDataItemUidSet;
-    iSoftDeletedItems = new (ELeave) CNSmlDataItemUidSet;
-    
-    iHasher = CMD5::NewL();
-    
-    iMediaManager = CMediaManager::NewL( iFs, this, iKey, *iHasher );
-    
-    iMdEManager = CMdEManager::NewL( *this );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::NewLC
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CMediaDsDataStore* CMediaDsDataStore::NewLC( RFs& aFs)
-    {
-    TRACE_FUNC_ENTRY;
-    CMediaDsDataStore* self = new (ELeave) CMediaDsDataStore( aFs );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    TRACE_FUNC_EXIT;
-    return self;    
-    }
-
-    
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::~CMediaDsDataStore
-// Destructor
-// -----------------------------------------------------------------------------
-CMediaDsDataStore::~CMediaDsDataStore()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    delete iDataBuffer;
-    
-    delete iChangeFinder;
-    
-    delete iNewItems;
-    delete iDeletedItems;
-    delete iUpdatedItems;
-    delete iMovedItems;
-    delete iSoftDeletedItems;
-    
-    delete iMediaManager;
-    LOGGER_WRITE("iMediaManager deleted");
-    
-    delete iMdEManager;
-    LOGGER_WRITE("iMdEManager deleted");
-    
-    delete iHasher;
-    LOGGER_WRITE("iHasher deleted");
-    // normally iSnapshot is NULL, but if error has occured we need to delete it.
-    delete iSnapshot;
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoOpenL
-// Opens database. This operation is performed SYNCHRONOUSLY
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoOpenL( const TDesC& aStoreName,
-    MSmlSyncRelationship& aContext, TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    if ( iCurrentState != EClosed )
-        {
-        User::RequestComplete( iCallerStatus, KErrInUse );
-        LOGGER_WRITE("CMmsDataStore::DoOpenL failed with KErrInUse.");
-        return;
-        }
-    
-    // Create ChangeFinder object
-    if ( iChangeFinder )
-        {
-        delete iChangeFinder;
-        iChangeFinder = NULL;
-        }
-    iChangeFinder = CChangeFinder::NewL( aContext, iKey, iHasHistory, KMediaDataProviderImplUid );
-    
-    if ( aStoreName.CompareF( KMediaDsRefreshDbName ) == 0 )
-        {
-        LOGGER_WRITE("Refresh library and open database");
-        // just kick off scanner, don't wait ready status
-        // Async. func. HandleCollectionMessage is called when ready
-        iMediaManager->ScanL();
-        
-        }
-    else if ( aStoreName.CompareF( KMediaDsDbName ) == 0 )
-        {
-        LOGGER_WRITE("Open database");
-        
-        if ( !iHasHistory )
-            {
-            LOGGER_WRITE("No history, scan library");
-            // just kick off scanner, don't wait ready status
-            // Async. func. HandleCollectionMessage is called when ready
-            iMediaManager->ScanL();
-            }
-        
-        }
-    else
-        {
-        LOGGER_WRITE("Unknown database");
-        User::Leave( KErrNotSupported );
-        }
-    
-    // Set current snapshot, this will be compared against the old one   
-    RegisterSnapshotL();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoCancelRequest
-// Not supported, does nothing.
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoCancelRequest()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iCurrentState == EOpening )
-        {
-        LOGGER_WRITE("Cancel Open command");
-        iMediaManager->Cancel();
-        iMdEManager->Cancel();
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoStoreName
-// Returns the name of the DataStore
-// -----------------------------------------------------------------------------
-const TDesC& CMediaDsDataStore::DoStoreName() const
-    {
-    TRACE_FUNC;
-    return KNullDesC;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoBeginTransactionL
-// Transactions are not supported.
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoBeginTransactionL()
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoCommitTransactionL
-// Transactions are not supported.
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoCommitTransactionL( TRequestStatus& /*aStatus*/ )
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoRevertTransaction
-// Transactions are not supported.
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoRevertTransaction( TRequestStatus& aStatus )
-    {
-    TRACE_FUNC;
-    iCallerStatus = &aStatus;
-    User::RequestComplete( iCallerStatus, KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoBeginBatchL
-// Batching is not supported.
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoBeginBatchL()
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoCommitBatchL
-// Batching is not supported
-// -----------------------------------------------------------------------------
-//
-void CMediaDsDataStore::DoCommitBatchL( RArray<TInt>& /*aResultArray*/, TRequestStatus& /*aStatus*/ )
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoCancelBatch
-// Batching is not supported
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoCancelBatch()
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoSetRemoteStoreFormatL
-// Not supported
-// -----------------------------------------------------------------------------
-//
-void CMediaDsDataStore::DoSetRemoteStoreFormatL( const CSmlDataStoreFormat& /*aServerDataStoreFormat*/ )
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoSetRemoteMaxObjectSize
-// Not supported
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoSetRemoteMaxObjectSize( TInt /*aServerMaxObjectSize*/ )
-    {
-    TRACE_FUNC;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoMaxObjectSize
-// Reads the maximum MMS Message size from the central repository
-// -----------------------------------------------------------------------------
-TInt CMediaDsDataStore::DoMaxObjectSize() const
-    {
-    TRACE_FUNC;
-    return 0;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoOpenItemL
-// Opens item in the DataStore, reads it (either completely or partially) 
-// to the temporary buffer where it can be later read to the remote database.
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoOpenItemL( TSmlDbItemUid aUid, TBool& /*aFieldChange*/, 
-    TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType, 
-    TDes8& aMimeVer, TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-
-    LOGGER_WRITE_1( "Opening item %d.", aUid );
-    
-    // Store these for later use
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    iReadPosition=0;
-    
-    // Check that we're in a proper state
-    if ( iCurrentState != EOpenAndWaiting )
-        {
-        LOGGER_WRITE_1( "CMediaDsDataStore::DoOpenItemL, invalid state %d.", iCurrentState );
-        User::RequestComplete( iCallerStatus, KErrNotReady );
-        return;
-        }
-    
-    if ( !iDataBuffer )
-        {
-        iDataBuffer = CBufFlat::NewL( KDataBufferSize );
-        }
-    iDataBuffer->Reset();
-
-    
-    if ( aUid <= KLastFolderId )
-        {
-        COMADSFolderObject* folderObject = COMADSFolderObject::NewLC();
-        
-        switch ( aUid )
-            {
-            case KAllSongsFolderId:
-                folderObject->SetName( KAllSongs );
-                break;
-            case KPlaylistsFolderId:
-                folderObject->SetName( KPlaylists );
-                break;
-            case KAlbumsFolderId:
-                folderObject->SetName( KAlbums );
-                break;
-            default:
-                User::Leave( KErrNotFound );
-                break;
-            }
-        folderObject->ExportFolderXmlL( *iDataBuffer );
-        CleanupStack::PopAndDestroy( folderObject );
-        aMimeType.Copy( KFolderMimeType );
-        aMimeVer.Copy( KFolderMimeVersion );
-        aParent = KErrNotFound;
-        }
-    else
-        {
-        CSongItem* song = CSongItem::NewLC();
-        LOGGER_WRITE("Try to read song");
-        TRAPD( err, iMediaManager->GetSongL( aUid, *song ));
-        if ( !err )
-            {
-            RBufWriteStream stream( *iDataBuffer );
-            CleanupClosePushL( stream );
-            song->ExportL( stream );
-            CleanupStack::PopAndDestroy( &stream );
-            CleanupStack::PopAndDestroy( song );
-            
-            aMimeType.Copy( KSongMimeType );
-            aMimeVer.Copy( KSongMimeVersion );
-            aParent = KAllSongsFolderId;
-            }
-        else // could not read song, maybe it is playlist
-            {
-            CleanupStack::PopAndDestroy( song );
-            CPlaylistItem* playList = CPlaylistItem::NewLC();
-            LOGGER_WRITE("Try to read playlist");
-            TRAP(err, iMediaManager->GetPlayListL( aUid, *playList ));
-            if ( !err )
-                {
-                RBufWriteStream stream( *iDataBuffer );
-                CleanupClosePushL( stream );
-                
-                playList->ExportL( stream );
-                CleanupStack::PopAndDestroy( &stream );
-                CleanupStack::PopAndDestroy( playList );
-                
-                aMimeType.Copy( KPlaylistMimeType );
-                aMimeVer.Copy( KPlaylistMimeVersion );
-                aParent = KPlaylistsFolderId;
-                }
-            else
-                {
-                CleanupStack::PopAndDestroy( playList );
-                LOGGER_WRITE("Try to read album");
-                // Could not read song, maybe it's a Album
-                const CPlaylistItem& album = iMdEManager->AlbumL( MapSyncIdToAlbumId(aUid) );
-                RBufWriteStream stream( *iDataBuffer );
-                CleanupClosePushL( stream );
-                
-                album.ExportL( stream );
-                CleanupStack::PopAndDestroy( &stream );
-                
-                aMimeType.Copy( KPlaylistMimeType );
-                aMimeVer.Copy( KPlaylistMimeVersion );
-                aParent = KAlbumsFolderId;
-                }
-            }
-        
-        }
-    
-    aSize = iDataBuffer->Size();
-    
-    LOGGER_WRITE_1("aSize: %d", aSize);
-    
-    // Signal we're complete
-    User::RequestComplete( iCallerStatus, KErrNone ); 
-
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoCreateItemL
-// Create new item to the message store.
-// Return the id number of the newly created item
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoCreateItemL( TSmlDbItemUid& aUid, TInt aSize, TSmlDbItemUid aParent, 
-    const TDesC8& aMimeType, const TDesC8& /*aMimeVer*/, TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "Parent folder: %d.", aParent );
-    
-    // Store some variables for further use
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Ensure that we're in proper state
-    if ( iCurrentState != EOpenAndWaiting )
-        {
-        LOGGER_WRITE_1( "Invalid state %d.", iCurrentState );
-        }
-    
-    iWrittenDataLength = 0;
-    iCreatedUid = &aUid;
-    LOGGER_WRITE8_1( "aMimeType: %S", &aMimeType );
-    
-    if ( aMimeType.Compare( KPlaylistMimeType() ) == 0 )
-        {
-        LOGGER_WRITE("Add Playlist");
-        iCurrentState = ECreatePlaylist;
-        }
-    else if ( aMimeType.Compare( KSongMimeType() ) == 0 )
-        {
-        LOGGER_WRITE("Add Song not supported");
-        User::Leave( KErrNotSupported );
-        }
-    else
-        {
-        User::RequestComplete( iCallerStatus, KErrNotSupported );
-        LOGGER_WRITE("Bad MIME type");
-        return;
-        }
-    
-    if ( iDataBuffer )
-        {
-        iDataBuffer->ResizeL( aSize );
-        }
-    else
-        {
-        iDataBuffer = CBufFlat::NewL( KDataBufferSize );
-        iDataBuffer->ResizeL( aSize );
-        }
-    LOGGER_WRITE_1("iDataBuffer->Size: %d", iDataBuffer->Size());
-    
-    LOGGER_WRITE_1("aSize: %d", aSize);
-    iParentId = aParent;
-    
-    // Signal we're complete
-    User::RequestComplete( iCallerStatus, KErrNone );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoReplaceItemL
-// Begin the replace operation, ensure that the item really exists
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoReplaceItemL( TSmlDbItemUid aUid, TInt aSize, TSmlDbItemUid aParent, 
-    TBool /*aFieldChange*/, TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("Replacing item %d.", aUid);
-    LOGGER_WRITE_1("Parent folder: %d.", aParent);
-    
-    // Store some variables for further use
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Ensure proper state
-    if ( iCurrentState != EOpenAndWaiting )
-        {
-        LOGGER_WRITE_1("Invalid state %d.", iCurrentState);
-        }
-    
-    iCurrentState = EReplace;
-    
-    iParentId = aParent;
-    iCurrentId = aUid;
-    
-    if ( iDataBuffer )
-        {
-        iDataBuffer->ResizeL( aSize );
-        }
-    else
-        {
-        iDataBuffer = CBufFlat::NewL( KDataBufferSize );
-        iDataBuffer->ResizeL( aSize );
-        }
-    
-    // Signal we're complete
-    User::RequestComplete( iCallerStatus, KErrNone );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoReadItemL
-// Read specified amount of data from the temporary buffer
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoReadItemL( TDes8& aBuffer )
-    {
-    TRACE_FUNC_ENTRY;
-    // Thiw is how much data there is left in the buffer    
-    TInt left = iDataBuffer->Size() - iReadPosition;
-    
-    if ( left > 0 )
-        {
-        // This is how much there's space in the destination buffer
-        TInt destSize = aBuffer.MaxSize();
-        
-        // This is how much we can read
-        TInt toRead = destSize < left ? destSize : left;
-        
-        // Read the data from the buffer, then update the position      
-        iDataBuffer->Read( iReadPosition, aBuffer, toRead );
-        iReadPosition += toRead;
-        }
-    else
-        {
-        LOGGER_WRITE( "No data to read" );
-        User::Leave( KErrEof );
-        }   
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoWriteItemL
-// Write specified amount of data to the temporary buffer
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoWriteItemL( const TDesC8& aData )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iDataBuffer->Write( iWrittenDataLength, aData );
-    iWrittenDataLength += aData.Size();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoCommitItemL
-// Commits item from temporary buffer to the message store
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoCommitItemL( TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Store some variables
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    iDataBuffer->Compress();
-    
-    // Read the playlist item
-    CPlaylistItem* newItem = CPlaylistItem::NewLC();
-    
-    const TUint8* ptr8 = iDataBuffer->Ptr(0).Ptr();
-    const TUint16* ptr16 = reinterpret_cast<const TUint16*>( ptr8 );
-    TPtrC dataPtr;
-    dataPtr.Set( ptr16, iDataBuffer->Size()/2 );
-    newItem->ImportL( dataPtr );
-    
-    iDataBuffer->Reset();
-    
-#ifdef _DEBUG
-    LOGGER_WRITE_1("Name: %S", &newItem->Title());
-    LOGGER_WRITE_1("Items count: %d", newItem->ItemCount());
-    for ( TInt i=0; i<newItem->ItemCount(); i++ )
-        {
-        TPtrC16 ptr = newItem->ItemAt(i);
-        LOGGER_WRITE_1("item: %S", &ptr);
-        }
-#endif
-    
-    
-    TInt error(KErrNone);
-    if ( iCurrentState == ECreatePlaylist )
-        {
-        if ( iParentId == KPlaylistsFolderId )
-            {
-            iMediaManager->CreateNewPlaylistL( *iCreatedUid, *newItem );
-            }
-        else if ( iParentId == KAlbumsFolderId )
-            {
-            iMdEManager->CreateAlbumL( *newItem );
-            *iCreatedUid = MapAlbumIdToSyncId( newItem->Id() );
-            }
-        else
-            {
-            LOGGER_WRITE("Not supported");
-            User::Leave( KErrNotSupported);
-            }
-        
-        // Inform ChangeFinder of the added item
-        TSnapshotItem snapshotItem( *iCreatedUid );
-        snapshotItem.SetParentId( iParentId );
-        snapshotItem.SetItemHash( *newItem, *iHasher );
-        iChangeFinder->ItemAddedL( snapshotItem );
-        
-        }
-    else if ( iCurrentState == EReplace )
-        {
-        if ( iParentId == KPlaylistsFolderId )
-            {
-            iMediaManager->ReplacePlaylistL( iCurrentId, *newItem );
-            }
-        else if ( iParentId == KAlbumsFolderId )
-            {
-            iItemInReplacement.SetItemId( iCurrentId );
-            iItemInReplacement.SetParentId( iParentId );
-            iItemInReplacement.SetItemHash( *newItem, *iHasher );
-            // Async function, calls AlbumReplaced when completed
-            iMdEManager->ReplaceAlbumL( MapSyncIdToAlbumId(iCurrentId), *newItem );
-            
-            CleanupStack::PopAndDestroy( newItem );
-            return;
-            }
-        else
-            {
-            LOGGER_WRITE("Not supported");
-            User::Leave( KErrNotSupported);
-            }
-        
-        // Inform ChangeFinder of the replaced item
-        TSnapshotItem snapshotItem( iCurrentId );
-        snapshotItem.SetParentId( iParentId );
-        snapshotItem.SetItemHash( *newItem, *iHasher );
-        iChangeFinder->ItemUpdatedL( snapshotItem );
-        }
-    else
-        {
-        LOGGER_WRITE_1("Wrong state: %d", iCurrentState);
-        User::Leave( KErrNotSupported );
-        }
-    CleanupStack::PopAndDestroy( newItem );
-    
-    
-    
-    LOGGER_WRITE_1("error: %d", error);
-    // We'll be waiting for next event, signal we're done
-    iCurrentState = EOpenAndWaiting;
-    User::RequestComplete( iCallerStatus, error );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoCloseItem
-// Closes open item in the data store
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoCloseItem()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iDataBuffer )
-        {
-        iDataBuffer->Reset();
-        }
-    iCurrentState = EOpenAndWaiting;
-    iReadPosition = 0;
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoMoveItemL
-// Moves item from one folder to another in the message store
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoMoveItemL( TSmlDbItemUid /*aUid*/,
-    TSmlDbItemUid /*aNewParent*/, TRequestStatus& /*aStatus*/ )
-    {
-    TRACE_FUNC;
-    User::Leave( KErrNotSupported );
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoDeleteItemL
-// Removes item from the message store
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus  )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("Deleting item %d.", aUid);
-    
-    // Store some variables for further use
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    TInt error(KErrNone);
-    
-    // Check that we're in proper state
-    if ( iCurrentState != EOpenAndWaiting ) 
-        {
-        LOGGER_WRITE_1("CMmsDataStore::DoDeleteItemL, invalid state %d.", iCurrentState);        
-        }
-    
-    TRAP( error,  iMediaManager->DeletePlaylistL( aUid ) );
-    if ( error )
-        {
-        error = KErrNone;
-        iMdEManager->DeleteAlbumL( MapSyncIdToAlbumId( aUid ) );
-        }
-    
-    if ( !error )
-        {
-        // Inform ChangeFinder of the deleted item
-        TSnapshotItem snapshotItem( aUid );
-        iChangeFinder->ItemDeletedL( snapshotItem );
-        }
-    
-    LOGGER_WRITE_1("complete error: %d", error);
-    // Signal we're done
-    User::RequestComplete( iCallerStatus, error );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoSoftDeleteItemL
-// Soft delete isn't supported.
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoSoftDeleteItemL( TSmlDbItemUid /*aUid*/, TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Store some variables for further use
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-
-    // Signal we're done
-    User::RequestComplete( iCallerStatus, KErrNotSupported );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoDeleteAllItemsL
-// Deletes all items in the standard folders of message store
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoDeleteAllItemsL( TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // Store some variables for further use 
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    User::RequestComplete( iCallerStatus, KErrNotSupported );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoHasSyncHistory
-// This method returns ETrue if Data Store has history information. 
-// Slow-sync will be used if Data Store does not have history information.
-// -----------------------------------------------------------------------------
-TBool CMediaDsDataStore::DoHasSyncHistory() const
-    {
-    TRACE_FUNC_RET( (TInt)iHasHistory );      
-    
-    // iHasHistory is initialized in DoOpenL method
-    return iHasHistory;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoAddedItems
-// This method returns UIDs of added items. Those items are added after previous
-// synchronization with current synchronization relationship. 
-// -----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CMediaDsDataStore::DoAddedItems() const
-    {
-    TRACE_FUNC;
-    
-    // Ensure that we're in a proper state
-    if ( iCurrentState != EOpenAndWaiting )
-        {
-        LOGGER_WRITE_1("CMmsDataStore::DoAddedItems, invalid state %d.", iCurrentState);
-        }
-    
-    TInt error(KErrNone);
-
-    // Clear new-items array
-    iNewItems->Reset();
-
-    // Set current snapshot, this will be compared against the old one      
-    // Search for new items
-    TRAP( error, iChangeFinder->FindNewItemsL(*iNewItems) )
-    if ( error != KErrNone )
-        {
-        LOGGER_WRITE_1("CMmsDataStore::DoAddedItems, iChangeFinder->FindNewItemsL leaved with %d.", error);
-        }
-    
-    LOGGER_WRITE_1("New item count: %d.", iNewItems->ItemCount());
-    
-    return *iNewItems;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoDeletedItems
-//
-// -----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CMediaDsDataStore::DoDeletedItems() const
-    {
-    TRACE_FUNC;
-    
-    // Ensure that we're in a proper state
-    if ( iCurrentState != EOpenAndWaiting )
-        {
-        LOGGER_WRITE_1("CMmsDataStore::DoDeletedItems, invalid state %d.", iCurrentState);
-        }
-    
-    TInt error(KErrNone);
-    
-    // Clear deleted-items array
-    iDeletedItems->Reset();
-    
-    // Search for deleted items
-    TRAP( error, iChangeFinder->FindDeletedItemsL( *iDeletedItems ) );
-    if ( error != KErrNone )
-        {
-        LOGGER_WRITE_1("CMmsDataStore::DoDeletedItems, iChangeFinder->FindDeletedItemsL leaved with %d.", error);
-        }           
-    
-    LOGGER_WRITE_1("Deleted item count: %d.", iDeletedItems->ItemCount());
-    return *iDeletedItems;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoSoftDeletedItems
-// Not directly supported, equals to "hard" delete
-// -----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CMediaDsDataStore::DoSoftDeletedItems() const
-    {
-    TRACE_FUNC;
-
-    iSoftDeletedItems->Reset();
-    return *iSoftDeletedItems;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoModifiedItems
-// Finds all modified items in the data store
-// -----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CMediaDsDataStore::DoModifiedItems() const
-    {
-    TRACE_FUNC;
-    
-    // Ensure that we're in a proper state
-    if ( iCurrentState != EOpenAndWaiting )
-        {
-        LOGGER_WRITE_1("CMmsDataStore::DoModifiedItems, invalid state %d.", iCurrentState);
-        }
-    
-    TInt error(KErrNone);
-    
-    // Clear updated-items array
-    iUpdatedItems->Reset();
-    
-    // Search for updated items
-    TRAP( error, iChangeFinder->FindChangedItemsL( *iUpdatedItems ) )
-    if ( error != KErrNone )
-        {
-        LOGGER_WRITE_1("CMmsDataStore::DoModifiedItems, iChangeFinder->FindChangedItemsL leaved with %d.", error);
-        }
-    
-    LOGGER_WRITE_1("Modified item count: %d.", iUpdatedItems->ItemCount()); 
-    return *iUpdatedItems;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoMovedItems
-// Finds all moved items in the data store
-// -----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CMediaDsDataStore::DoMovedItems() const
-    {
-    TRACE_FUNC;
-    // return empty array
-    return *iMovedItems;    
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoResetChangeInfoL
-// Resets change history in the data store. All content is considered
-// new in the data store point of view.
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Check that we're in proper state
-    if ( iCurrentState != EOpenAndWaiting ) 
-        {
-        LOGGER_WRITE_1("CMmsDataStore::DoResetChangeInfoL, invalid state %d.", iCurrentState);
-        }   
-            
-    // Reset change info in ChangeFinder
-    iChangeFinder->ResetL();
-    iHasHistory = EFalse;
-    
-    // Signal we're done
-    User::RequestComplete( iCallerStatus, KErrNone ); 
-    
-    TRACE_FUNC_EXIT;
-    }
-        
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoCommitChangeInfoL
-// Commits change info. These items are no longer reported, when change
-// information is being queried.
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus, const MSmlDataItemUidSet& aItems )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Ensure that we're in a proper state
-    if ( iCurrentState != EOpenAndWaiting ) 
-        {
-        LOGGER_WRITE_1("CMmsDataStore::DoCommitChangeInfoL, invalid state %d.", iCurrentState);
-        }
-
-    // Notify ChangeFinder
-    iChangeFinder->CommitChangesL(aItems);
-    iHasHistory = ETrue;
-        
-    // Signal we're done
-    User::RequestComplete(iCallerStatus, KErrNone);
-        
-    TRACE_FUNC_EXIT;
-    }
-        
-    
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::DoCommitChangeInfoL
-// Commits change info. There is no more nothing to report when change
-// information is being queried. 
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::DoCommitChangeInfoL(TRequestStatus& aStatus)
-    {
-    TRACE_FUNC_ENTRY;
-    
-    iCallerStatus = &aStatus;
-    *iCallerStatus = KRequestPending;
-    
-    // Ensure that we're in a proper state
-    if ( iCurrentState != EOpenAndWaiting ) 
-        {
-        LOGGER_WRITE_1("CMmsDataStore::DoCommitChangeInfoL, invalid state %d.", iCurrentState);
-        }
-    
-    // Notify ChangeFinder
-    iChangeFinder->CommitChangesL();
-    iHasHistory = ETrue;
-        
-    // Signal we're done
-    User::RequestComplete( iCallerStatus, KErrNone );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-
-void CMediaDsDataStore::HandleCollectionMessage(CMPXMessage* /*aMsg*/, TInt /*aErr*/) 
-    {
-    TRACE_FUNC;
-    }
-
-void CMediaDsDataStore::HandleOpenL(const CMPXMedia& /*aEntries*/,
-        TInt /*aIndex*/,TBool /*aComplete*/,TInt /*aError*/)
-    {
-    TRACE_FUNC;
-    }
-
-void CMediaDsDataStore::HandleOpenL(const CMPXCollectionPlaylist& /*aPlaylist*/,
-        TInt /*aError*/)
-    {
-    TRACE_FUNC;
-    }
-    
-void CMediaDsDataStore::HandleCommandComplete(CMPXCommand* /*aCommandResult*/, 
-         TInt /*aError*/)
-    {
-    TRACE_FUNC;
-    }
-
-void CMediaDsDataStore::HandleCollectionMediaL(const CMPXMedia& /*aMedia*/, 
-        TInt /*aError*/)
-    {
-    TRACE_FUNC;
-    }
-
-void CMediaDsDataStore::AlbumsReaded( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    iMdEManagerReady = ETrue;
-    LOGGER_WRITE_1("aError: %d", aError );
-    
-    if ( aError )
-        {
-        iError = aError;
-        }
-    
-    FinalizeOpenStore();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaDsDataStore::AlbumReplaced( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aError: %d", aError);
-    if ( !aError )
-        {
-        // Inform ChangeFinder of the replaced item
-        iChangeFinder->ItemUpdatedL( iItemInReplacement );
-        }
-    
-    iCurrentState = EOpenAndWaiting;
-    User::RequestComplete( iCallerStatus, aError );
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::RegisterSnapshotL
-// Sets Changefinder to compare against current message store content
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::RegisterSnapshotL()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iSnapshot )
-        {
-        delete iSnapshot;
-        iSnapshot = NULL;
-        }
-    iSnapshot = new (ELeave) CSnapshotArray( KSnapshotGranularity );
-    RegisterFoldersL( *iSnapshot );
-    iMediaManager->SetSnapshot( iSnapshot );
-    
-    iCurrentState = EOpening;
-    TInt err = iMediaManager->RegisterAllPlayLists();
-    if ( err )
-        {
-        LOGGER_WRITE_1("Could not start, err: %d", err);
-        iCurrentState = EClosed;
-        User::RequestComplete( iCallerStatus, err );
-        }
-    else
-        {
-        iMdEManager->GetAlbumsL();
-        }
-
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaDsDataStore::RegisterAllPlayListsCompleted( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !aError )
-        {
-        TInt err = iMediaManager->RegisterAllSongs();
-        if ( err )
-            {
-            LOGGER_WRITE_1("Could not start, err: %d", err);
-            iMediaManagerReady = ETrue;
-            iError = err;
-            }
-        }
-    else
-        {
-        // Error happened or cancelled.
-        iMediaManagerReady = ETrue;
-        iError = aError;
-        }
-    
-    FinalizeOpenStore();
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaDsDataStore::RegisterAllSongsCompleted( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    iMediaManagerReady = ETrue;
-    if ( aError )
-        {
-        // Error happened or cancelled, save error code
-        iError = aError;
-        }
-    
-    FinalizeOpenStore();
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// -----------------------------------------------------------------------------
-// CMediaDsDataStore::RegisterFoldersL
-// 
-// -----------------------------------------------------------------------------
-void CMediaDsDataStore::RegisterFoldersL( CSnapshotArray& aItemArray )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TKeyArrayFix key( iKey );
-    TSnapshotItem folder;
-    folder.SetItemId( KAllSongsFolderId );
-    folder.SetItemHash( KAllSongs, *iHasher );
-    aItemArray.InsertIsqL( folder, key );
-    
-    folder.SetItemId( KPlaylistsFolderId );
-    folder.SetItemHash( KPlaylists, *iHasher );
-    aItemArray.InsertIsqL( folder, key );
-    
-    folder.SetItemId( KAlbumsFolderId );
-    folder.SetItemHash( KAlbums, *iHasher );
-    aItemArray.InsertIsqL( folder, key );
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaDsDataStore::FinalizeOpenStore()
-    {
-    TRACE_FUNC_ENTRY;
-    // Signal client if all ready
-    if ( iMediaManagerReady && iMdEManagerReady )
-        {
-        if ( !iError )
-            {
-            RPointerArray<CPlaylistItem> albums = iMdEManager->AlbumsArray();
-            TKeyArrayFix key( iKey );
-            LOGGER_WRITE("Album snapshots:")
-            for (TInt i=0; i<albums.Count(); i++)
-                {
-                TSnapshotItem playlistItem( MapAlbumIdToSyncId( albums[i]->Id() ) );
-                playlistItem.SetItemHash( *albums[i], *iHasher );
-                playlistItem.SetParentId( KAlbumsFolderId );
-                TRAP(iError, iSnapshot->InsertIsqL( playlistItem, key ));
-                if ( iError )
-                    {
-                    LOGGER_WRITE_1("iSnapshot->InsertIsqL err: %d", iError);
-                    iError = KErrGeneral;
-                    }
-                }
-            
-            if ( !iError )
-                {
-                // Set new snapshot to compare against
-                iChangeFinder->SetNewSnapshot(iSnapshot);
-                
-                // Changefinder takes ownership of the snapshot
-                iSnapshot = NULL;
-                iCurrentState = EOpenAndWaiting;
-                }
-            }
-        
-        if ( iError )
-            {
-            iCurrentState = EClosed;
-            }
-        
-        LOGGER_WRITE_1("Signal client with %d", iError);
-        User::RequestComplete( iCallerStatus, iError );
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-inline TInt CMediaDsDataStore::MapSyncIdToAlbumId( TSmlDbItemUid aSyncId )
-    {
-    return aSyncId - KAlbumsOffSet;
-    }
-
-inline TSmlDbItemUid CMediaDsDataStore::MapAlbumIdToSyncId( TInt aAlbumId )
-    {
-    return KAlbumsOffSet + aAlbumId;
-    }
--- a/omads/omadsextensions/adapters/mediads/src/mediadsstore.rss	Tue Aug 31 15:05:37 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:  Resource data for Media DS adapter
-*
-*/
-
-
-#include <smldataformat.rh>
-#include <smldataformat.hrh>
-
-RESOURCE SML_DATA_STORE_FORMAT MEDIADS_DATA_STORE
-	{
-	version = 1;
-	display_name = "Media";
-	sync_types = KSmlSyncType_TwoWay + KSmlSyncType_OneWayFromSvr + KSmlSyncType_OneWayFromClnt
-        + KSmlSyncType_SlowSync + KSmlSyncType_RefreshFromSvr + KSmlSyncType_RefreshFromClnt;
-	
-	mime_format=
-		{
-		SML_MIME_FORMAT
-			{
-			version = 1;
-			mime_type = "application/vnd.omads-folder+xml";
-			mime_ver = "1.2";
-			properties= 
-				{
-				SML_DATA_PROPERTY
-					{
-					version = 1;
-					display_name = "Read";
-					name = "read";
-					data_type = "bool";
-					enum_values = {};
-					flags = 0;
-					max_size = 0;
-					max_occur = 1;
-					params = {};
-					}
-				};
-			field_level = 0;
-			},
-		SML_MIME_FORMAT
-			{
-			version = 1;
-			mime_type = "audio/x-mpegurl";
-			mime_ver = "1.0";
-			properties= 
-				{
-				SML_DATA_PROPERTY
-					{
-					version = 1;
-					display_name = "Read";
-					name = "read";
-					data_type = "bool";
-					enum_values = {};
-					flags = 0;
-					max_size = 0;
-					max_occur = 1;
-					params = {};
-					}
-				};
-			field_level = 0;
-			},
-	    SML_MIME_FORMAT
-			{
-			version = 1;
-			mime_type = "application/x-song";
-			mime_ver = "1.0";
-			properties= 
-				{
-				SML_DATA_PROPERTY
-					{
-					version = 1;
-					display_name = "Read";
-					name = "read";
-					data_type = "bool";
-					enum_values = {};
-					flags = 0;
-					max_size = 0;
-					max_occur = 1;
-					params = {};
-					}
-				};
-			field_level = 0;
-			}
-		};
-	mime_format_tx_pref = 0;    	// Preferred index for tx
-	mime_format_rx_pref = 0;	// Preferred index for rx
-	folder_properties = {};		// No folder properties
-	filter_capabilities = {};	// No filter capabilities
-	max_size = 0;				// No limit
-	max_items = 0;	 			// No limit
-	flags = 0x00000010;
-	}
--- a/omads/omadsextensions/adapters/mediads/src/mediamanager.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1254 +0,0 @@
-/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  CMediaManager class implementation
-*
-*/
-
-
-
-#include "mediamanager.h"
-
-#include <mpxmedia.h>
-#include <mpxmediageneraldefs.h>
-#include <mpxcollectionhelper.h>
-#include <mpxmediacontainerdefs.h>
-#include <mpxmediaarray.h>
-#include <mpxcollectionhelperfactory.h>
-#include <mpxcollectionhelper.h>
-#include <utf.h>
-#include <mpxplaylistenginedefs.h> // for EMPXPlaylistTypeM3U
-#include <mpxcollectiontype.h>
-#include <mpxmediamusicdefs.h>
-#include <mpxcollectionplugin.hrh>
-#include <PathInfo.h>
-#include <mpxmediaaudiodefs.h>
-#include <mpxmediamtpdefs.h>
-#include <driveinfo.h>
-
-#include "mediadsproviderdefs.h"
-#include "playlistitem.h"
-#include "logger.h"
-
-
-const TUid KMpxLocalCollectionUid = { 0x101FFC3A };
-
-_LIT( KPlaylistPath, "playlists\\" );
-_LIT( KMPXVirtualPlaylistExt, ".vir" );
-
-// Maximum amount of song items to be enumerated on one RunL.
-const TInt iMaxSongItemsToEnumerate(100);
-// Maximum amount of playlist items to be enumerated on one RunL.
-const TInt iMaxPlaylistItemsToEnumerate(15);
-
-
-CMediaManager::CMediaManager( RFs& aFs, MMediaManagerObserver* aObserver,
-        TKeyArrayFix aKey, CMD5& aHasher  )
-: CActive( EPriorityStandard ),
-iObserver( aObserver ),
-iKey( aKey ),
-iHasher( aHasher ),
-iFs( aFs )
-    {
-    TRACE_FUNC;
-    CActiveScheduler::Add(this);
-    }
-
-
-void CMediaManager::ConstructL()
-    {
-    TRACE_FUNC_ENTRY;
-    iHarvester = CMPXHarvesterFactory::NewL();
-    LOGGER_WRITE("1");
-    iCollection = MMPXCollectionUtility::NewL( iObserver );
-    LOGGER_WRITE("2");
-    iMediator = CMPXCollectionMediator::NewL( iCollection->Collection() );
-    LOGGER_WRITE("3");
-    iCollectionHelper = CMPXCollectionHelperFactory::NewCollectionCachedHelperL();   
-    
-    TRACE_FUNC_EXIT;
-    }
-
-
-CMediaManager* CMediaManager::NewL( RFs& aFs, MMediaManagerObserver* aObserver, TKeyArrayFix aKey, CMD5& aHasher )
-    {
-    CMediaManager* self = new( ELeave ) CMediaManager( aFs, aObserver, aKey, aHasher );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
-CMediaManager::~CMediaManager()
-    {
-    TRACE_FUNC_ENTRY;
-    Cancel();
-    delete iFoundedMedia;
-    if ( iCollectionHelper )
-        {
-        iCollectionHelper->Close();
-        iCollectionHelper = NULL;
-        }
-    
-    delete iMediator;
-    
-    if ( iCollection )
-        {
-        iCollection->Close();
-        iCollection = NULL;
-        }
-    
-    if ( iHarvester )
-        {
-        // For some unknown reason this may sometimes leave with error code -38
-        TRAP_IGNORE( iHarvester->Close() );
-        iHarvester = NULL;
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaManager::ScanL()
-    {
-    TRACE_FUNC_ENTRY;
-    iHarvester->ScanL();
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaManager::CancelScanL()
-    {
-    TRACE_FUNC_ENTRY;
-    iHarvester->CancelScanL();
-    TRACE_FUNC_EXIT;
-    }
-
-// --------------------------------------------------------------------------
-// Starts registering all playlists. Calls RegisterAllPlayListsCompleted when ready
-// --------------------------------------------------------------------------
-// 
-TInt CMediaManager::RegisterAllPlayLists()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iCurrentState != EIdle || !iSnapshotArray)
-        {
-        LOGGER_WRITE("Not Idle or iSnapshotArray is NULL");
-        return KErrNotReady;
-        }
-    iCurrentState = EReadingPlaylistCount;
-    SetActive();
-    TRequestStatus* status = &iStatus;
-    User::RequestComplete( status, KErrNone );
-    TRACE_FUNC_EXIT;
-    return KErrNone;
-    }
-
-// --------------------------------------------------------------------------
-// Starts registering all song items. Calls RegisterAllSongsCompleted when ready
-// --------------------------------------------------------------------------
-// 
-TInt CMediaManager::RegisterAllSongs()
-    {
-    TRACE_FUNC_ENTRY;
-    if ( iCurrentState != EIdle || !iSnapshotArray)
-        {
-        LOGGER_WRITE("Not Idle or iSnapshotArray is NULL");
-        return KErrNotReady;
-        }
-    iCurrentState = EReadingSongCount;
-    SetActive();
-    TRequestStatus* status = &iStatus;
-    User::RequestComplete( status, KErrNone );
-    TRACE_FUNC_EXIT;
-    return KErrNone;
-    }
-
-// --------------------------------------------------------------------------
-// Registers playlist.
-// --------------------------------------------------------------------------
-// 
-void CMediaManager::RegisterPlaylistL( const CMPXMedia& aMedia )
-    {
-    TRACE_FUNC_ENTRY;
-    if ( !iSnapshotArray )
-        {
-        User::Leave( KErrGeneral );
-        }
-    
-    if ( !aMedia.IsSupported(KMPXMediaGeneralId) )
-        {
-        LOGGER_WRITE("KMPXMediaGeneralId not supported");
-        User::Leave(KErrNotSupported);
-        }
-     
-     // Extract the playlist id from the found object
-     TUint32 playlistId = *aMedia.Value<TMPXItemId>(KMPXMediaGeneralId);
-     LOGGER_WRITE_1("KMPXMediaGeneralId: %d", playlistId);
-     
-     if ( !aMedia.IsSupported( KMPXMediaGeneralTitle ) )
-          {
-          LOGGER_WRITE("KMPXMediaGeneralTitle not supported");
-          User::Leave(KErrNotSupported);
-          }
-     
-     CPlaylistItem* playlist = CPlaylistItem::NewLC();
-     // find the media object that contains a list of songs in the playlist
-     
-     RArray<TInt> contentIDs;
-     CleanupClosePushL( contentIDs );
-     contentIDs.AppendL(KMPXMediaIdGeneral);
-     
-     CMPXMedia* searchMedia = CMPXMedia::NewL(contentIDs.Array());
-     CleanupStack::PopAndDestroy( &contentIDs );
-     CleanupStack::PushL(searchMedia);
-     
-     searchMedia->SetTObjectValueL(KMPXMediaGeneralType, EMPXGroup);    
-     searchMedia->SetTObjectValueL(KMPXMediaGeneralCategory, EMPXSong);
-     searchMedia->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, playlistId);
-     
-     RArray<TMPXAttribute> songAttributes;
-     CleanupClosePushL(songAttributes);
-     songAttributes.AppendL(KMPXMediaGeneralId);
-     songAttributes.AppendL(KMPXMediaGeneralUri);
-     
-     CMPXMedia* foundMedia = iCollectionHelper->FindAllL(*searchMedia, 
-                                                         songAttributes.Array());
-     CleanupStack::PopAndDestroy(&songAttributes);
-     CleanupStack::PopAndDestroy(searchMedia);
-     
-     CleanupStack::PushL(foundMedia);
-     
-     
-     if ( !foundMedia->IsSupported(KMPXMediaArrayCount) )
-         {
-         User::Leave(KErrNotSupported);
-         }
-     
-     // Number of references
-     TInt numOfRefs = *foundMedia->Value<TInt>(KMPXMediaArrayCount);
-     if ( numOfRefs )
-         {
-         if (!foundMedia->IsSupported(KMPXMediaArrayContents))
-             {
-             User::Leave(KErrNotSupported);
-             }
-         
-         const CMPXMediaArray* refArray =
-             foundMedia->Value<CMPXMediaArray>(KMPXMediaArrayContents);
-         
-         // Import the references
-         for (TInt i=0;i<numOfRefs;i++)
-             {
-             const CMPXMedia* refMedia = (*refArray)[i];
-             
-             if ( refMedia->IsSupported(KMPXMediaGeneralUri) )
-                 {
-                 const TDesC& uri = refMedia->ValueText(KMPXMediaGeneralUri);
-                 playlist->AddItemL( uri );
-                 }
-             
-             }
-         }
-    
-    TSnapshotItem playlistItem(playlistId);
-    
-    const TDesC& title = aMedia.ValueText( KMPXMediaGeneralTitle );
-    playlist->SetTitleL( title );
-    
-    const TDesC& uri = aMedia.ValueText( KMPXMediaGeneralUri );
-    playlist->SetUrlL( uri );
-    
-    playlistItem.SetItemHash( *playlist, iHasher );
-    
-    playlistItem.SetParentId( KPlaylistsFolderId );
-    TKeyArrayFix key( iKey );
-    iSnapshotArray->InsertIsqL( playlistItem, key );
-    
-    CleanupStack::PopAndDestroy( foundMedia );
-    CleanupStack::PopAndDestroy( playlist );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// --------------------------------------------------------------------------
-// Populates CPlaylistItem
-// --------------------------------------------------------------------------
-// 
-void CMediaManager::GetPlayListL( TInt aPlaylistId, CPlaylistItem& aList )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    LOGGER_WRITE_1("aPlaylistId: %d", aPlaylistId);
-    
-    CMPXMedia* playlistItem = FindPlaylistL( aPlaylistId );
-    CleanupStack::PushL( playlistItem );
-    if ( !playlistItem->IsSupported(KMPXMediaGeneralId) )
-        {
-        LOGGER_WRITE("KMPXMediaGeneralId not supported");
-        User::Leave(KErrNotSupported);
-        }
-    
-    // Extract the playlist id from the found object
-    TUint32 playlistId = *playlistItem->Value<TMPXItemId>(KMPXMediaGeneralId);
-    LOGGER_WRITE_1("KMPXMediaGeneralId: %d", playlistId);
-    aList.SetId( playlistId );
-    
-    if ( !playlistItem->IsSupported(KMPXMediaGeneralTitle) )
-        {
-        LOGGER_WRITE("KMPXMediaGeneralTitle not supported");
-        User::Leave( KErrNotSupported );
-        }
-    else
-        {
-        const TDesC& title = playlistItem->ValueText(KMPXMediaGeneralTitle);
-        LOGGER_WRITE_1("KMPXMediaGeneralTitle: %S", &title);
-        aList.SetTitleL( title );
-        }
-    
-    if ( playlistItem->IsSupported( KMPXMediaGeneralUri ) )
-        {
-        const TDesC& uri = playlistItem->ValueText( KMPXMediaGeneralUri );
-        aList.SetUrlL( uri );
-        }
-    
-    CleanupStack::PopAndDestroy( playlistItem );
-    
-    CMPXMedia* playlist = FetchPlaylistContentL( aPlaylistId );
-    CleanupStack::PushL( playlist );
-    
-    if ( !playlist->IsSupported(KMPXMediaArrayCount) )
-         {
-         User::Leave(KErrNotSupported);
-         }
-     
-    // Number of references
-    TInt numOfRefs = *playlist->Value<TInt>(KMPXMediaArrayCount);
-    LOGGER_WRITE_1("numOfRefs: %d", numOfRefs);
-    if ( numOfRefs )
-        {
-        if (!playlist->IsSupported(KMPXMediaArrayContents))
-            {
-            User::Leave(KErrNotSupported);
-            }
-        
-        const CMPXMediaArray* refArray =
-        playlist->Value<CMPXMediaArray>(KMPXMediaArrayContents);
-        
-        // Import the references
-        for (TInt i=0;i<numOfRefs;i++)
-            {
-            const CMPXMedia* refMedia = (*refArray)[i];
-            
-            if ( refMedia->IsSupported(KMPXMediaGeneralUri) )
-                {
-                aList.AddItemL( refMedia->ValueText(KMPXMediaGeneralUri) );
-                }
-            }
-        }
- 
-    CleanupStack::PopAndDestroy( playlist );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-// --------------------------------------------------------------------------
-// Fetch a playlist content
-// --------------------------------------------------------------------------
-// 
-CMPXMedia* CMediaManager::FetchPlaylistContentL( TInt aId )
-    {
-    TRACE_FUNC_ENTRY;
-    TMPXItemId id(aId);
-
-    CMPXMedia* criteria = CMPXMedia::NewL();
-    CleanupStack::PushL( criteria );
-    criteria->SetTObjectValueL<TUid>(
-            KMPXMediaGeneralCollectionId, KMpxLocalCollectionUid );
-    criteria->SetTObjectValueL<TMPXGeneralType>(
-            KMPXMediaGeneralType, EMPXGroup );
-    
-    // set search keys
-    criteria->SetTObjectValueL<TMPXGeneralCategory>(
-            KMPXMediaGeneralCategory, EMPXSong );    
-    criteria->SetTObjectValueL<TMPXItemId>(
-            KMPXMediaGeneralId, id );
-    
-    // define attributes fetched
-    RArray<TMPXAttribute> songAttributes;
-    CleanupClosePushL(songAttributes);
-    songAttributes.AppendL(KMPXMediaGeneralId);
-    songAttributes.AppendL(KMPXMediaGeneralUri);
-    
-    // now find
-    CMPXMedia* result = iCollectionHelper->FindAllL( *criteria , songAttributes.Array() );
-    CleanupStack::PopAndDestroy( &songAttributes );
-    CleanupStack::PopAndDestroy( criteria );
-    
-    TRACE_FUNC_EXIT;
-    return result;
-    }
-
-
- // --------------------------------------------------------------------------
- // Find a playlist
- // --------------------------------------------------------------------------
- //
- CMPXMedia* CMediaManager::FindPlaylistL( TInt aUid )
-     {
-     TRACE_FUNC_ENTRY;
-     CMPXMedia* criteria = CMPXMedia::NewL();
-     CleanupStack::PushL( criteria );
-     
-     criteria->SetTObjectValueL<TMPXGeneralType>(
-                 KMPXMediaGeneralType, EMPXItem );
-     criteria->SetTObjectValueL<TMPXGeneralCategory>(
-                 KMPXMediaGeneralCategory, EMPXPlaylist );
-     criteria->SetTObjectValueL<TMPXItemId>(
-                 KMPXMediaGeneralId, aUid );
-         
-     // define attributes fetched
-     RArray<TMPXAttribute> playlistAttributes;
-     CleanupClosePushL(playlistAttributes);
-     playlistAttributes.AppendL(KMPXMediaGeneralId);
-     playlistAttributes.AppendL(KMPXMediaGeneralCollectionId); //test
-     playlistAttributes.AppendL(KMPXMediaGeneralTitle);
-     playlistAttributes.AppendL(KMPXMediaGeneralUri);
-     
-     // now find
-     CMPXMedia* foundList = 0;
-     foundList = iCollectionHelper->FindAllL( *criteria , playlistAttributes.Array() );
-     CleanupStack::PopAndDestroy( &playlistAttributes );
-     CleanupStack::PopAndDestroy( criteria );
-     
-     CleanupStack::PushL( foundList );
-     
-     if ( !foundList->IsSupported(KMPXMediaArrayCount) )
-         {
-         LOGGER_WRITE("KMPXMediaArrayCount not supported");
-         User::Leave( KErrNotSupported );
-         }
-     
-     TInt foundItemCount = *foundList->Value<TInt>(KMPXMediaArrayCount);
-     
-     CMPXMedia* playlist(NULL);
-     if ( foundItemCount )
-         {
-         if ( !foundList->IsSupported(KMPXMediaArrayContents) )
-             {
-             LOGGER_WRITE("KMPXMediaArrayContents not supported");
-             User::Leave(KErrNotSupported);
-             }
-             
-         const CMPXMediaArray* foundArray = foundList->Value<CMPXMediaArray>(KMPXMediaArrayContents);
-         
-         // get the first founded item
-         playlist = CMPXMedia::NewL(*(*foundArray)[0]);
-         }
-     else
-         {
-         User::Leave( KErrGeneral );
-         }
-     
-     CleanupStack::PopAndDestroy( foundList );
-     
-     TRACE_FUNC_EXIT;
-     return playlist;
-     }
-
-void CMediaManager::GetSongL( TInt aSongId, CSongItem& aSongItem )
-    {
-    TRACE_FUNC_ENTRY;
-    TMPXItemId id(aSongId);
-
-    RArray<TInt> contentIDs;
-    CleanupClosePushL( contentIDs );
-    contentIDs.AppendL( KMPXMediaIdMusic );
-    contentIDs.AppendL( KMPXMediaIdGeneral );
-    
-    CMPXMedia* criteria = CMPXMedia::NewL(contentIDs.Array());
-    CleanupStack::PopAndDestroy( &contentIDs );
-    CleanupStack::PushL(criteria);
-    
-    // set search keys
-    criteria->SetTObjectValueL<TMPXGeneralType>(
-            KMPXMediaGeneralType, EMPXItem );
-    criteria->SetTObjectValueL<TMPXGeneralCategory>(
-            KMPXMediaGeneralCategory, EMPXSong );   
-    criteria->SetTObjectValueL<TMPXItemId>(
-            KMPXMediaGeneralId, id );
-    
-    // define attributes fetched
-    RArray<TMPXAttribute> songAttributes;
-    CleanupClosePushL(songAttributes);
-    
-    songAttributes.AppendL( KMPXMediaGeneralType );
-    songAttributes.AppendL( KMPXMediaGeneralCategory );
-    songAttributes.AppendL( KMPXMediaGeneralUri );
-    songAttributes.AppendL( KMPXMediaGeneralId );
-    songAttributes.AppendL( KMPXMediaGeneralTitle );
-    songAttributes.AppendL( KMPXMediaGeneralMimeType );
-    songAttributes.AppendL( KMPXMediaGeneralDuration );
-    songAttributes.AppendL( KMPXMediaGeneralComment );
-    
-    songAttributes.AppendL( KMPXMediaMusicArtist );
-    songAttributes.AppendL( KMPXMediaMusicAlbum );
-    songAttributes.AppendL( KMPXMediaMusicYear );
-    songAttributes.AppendL( KMPXMediaMusicAlbumTrack );
-    songAttributes.AppendL( KMPXMediaMusicGenre );
-    songAttributes.AppendL( KMPXMediaMusicComposer );
-    
-    // now find
-    CMPXMedia* result = 0;
-    TRAPD(err, result = iCollectionHelper->FindAllL( *criteria , songAttributes.Array() ));
-    CleanupStack::PopAndDestroy( &songAttributes );
-    CleanupStack::PopAndDestroy( criteria );
-    
-    if ( err )
-        {
-        LOGGER_WRITE_1("FindAllL err: %d", err);
-        User::Leave( err );
-        }
-    
-    CleanupStack::PushL( result );
-
-    if ( !result->IsSupported(KMPXMediaArrayCount) )
-         {
-         LOGGER_WRITE("KMPXMediaArrayCount not supported");
-         User::Leave(KErrNotSupported);
-         }
-    
-    if ( !result->IsSupported( KMPXMediaArrayContents ) )
-        {
-        User::Leave(KErrNotSupported);
-        }
-    
-    const CMPXMediaArray* songsArray =
-    result->Value<CMPXMediaArray>(KMPXMediaArrayContents);
-    if ( songsArray->Count() == 0 )
-        {
-        User::Leave( KErrNotFound );
-        }
-    const CMPXMedia* songMedia = (*songsArray)[0];
-    
-    ReadSongAttributesL( *songMedia, aSongItem, ETrue );
-    
-    CleanupStack::PopAndDestroy( result );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-CMPXMedia* CMediaManager::CreatePlaylistMediaL( const CPlaylistItem& aPlaylist )
-    {
-    TRACE_FUNC_ENTRY;
-    RArray<TInt> contentIDs;
-    contentIDs.AppendL(KMPXMediaIdGeneral);
-    
-    CMPXMedia* playlist = CMPXMedia::NewL( contentIDs.Array() );
-    CleanupStack::PushL( playlist );
-    contentIDs.Close();
-    // add playlist info into the playlist media
-    playlist->SetTObjectValueL<TUid>(
-        KMPXMediaGeneralCollectionId, KMpxLocalCollectionUid );
-    
-    // set playlist title
-    playlist->SetTextValueL( KMPXMediaGeneralTitle, aPlaylist.Title() );
-    
-    // set type
-    playlist->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem );
-     
-    // set category
-    playlist->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXPlaylist ); 
-    
-    
-    TFileName playlistfile;
-    
-    TInt drive;
-    User::LeaveIfError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive) );
-    TUint driveStatus( 0 );
-    TInt err = DriveInfo::GetDriveStatus( iFs, drive, driveStatus );
-    if ( !err && (driveStatus & DriveInfo::EDrivePresent) )
-        {
-        User::LeaveIfError( PathInfo::GetRootPath( playlistfile, drive ) );
-        LOGGER_WRITE_1("mmc playlistfile: %S", &playlistfile);
-        }
-    else
-        {
-        playlistfile = PathInfo::PhoneMemoryRootPath();
-        LOGGER_WRITE_1("phone playlistfile: %S", &playlistfile);
-        }
-    
-    playlistfile.Append( KPlaylistPath );
-    
-    // set location drive
-    TDriveUnit driveUnit( playlistfile );
-    TPtrC driveName = driveUnit.Name();
-    playlist->SetTextValueL( KMPXMediaGeneralDrive, driveName );
-    
-    
-    TTime time;
-    time.HomeTime();
-    playlistfile.AppendNum(time.Int64());
-    playlistfile.Append(KMPXVirtualPlaylistExt);
-    
-    LOGGER_WRITE_1("playlistfile: %S", &playlistfile);
-    playlist->SetTextValueL(
-             KMPXMediaGeneralUri, playlistfile );
-    
-    // set DbFlags to indicate that this is a virtual playlist
-    playlist->SetTObjectValueL<TUint>(KMPXMediaGeneralFlags,
-       KMPXMediaGeneralFlagsSetOrUnsetBit | KMPXMediaGeneralFlagsIsVirtual);
-
-    // create songs
-    CMPXMediaArray* medias = CreateMediaArrayLC( aPlaylist );
-    // set medias
-    playlist->SetCObjectValueL( KMPXMediaArrayContents, medias );
-    /// set media count        
-    playlist->SetTObjectValueL( KMPXMediaArrayCount, medias->Count() );
-    
-    CleanupStack::PopAndDestroy(medias);
-    CleanupStack::Pop(playlist);
-    
-    
-    TRACE_FUNC_EXIT;
-    return playlist;
-    }
-
-CMPXMediaArray* CMediaManager::CreateMediaArrayLC( const CPlaylistItem& aList )
-    {
-    CMPXMediaArray* medias = CMPXMediaArray::NewL();
-    CleanupStack::PushL( medias );
-    //
-    // create entries
-    //
-    TInt itemCount = aList.ItemCount();
-    for ( TInt i=0; i<itemCount; i++)
-        {
-        TPtrC16 ptrUri = aList.ItemAt(i);
-        LOGGER_WRITE_1("add uri: %S", &ptrUri);
-        iCollectionHelper->AddL( ptrUri, this );
-        iWaitOngoing = ETrue;
-        LOGGER_WRITE("iWait.Start");
-        iWait.Start();
-        LOGGER_WRITE("continue..");
-    
-        RArray<TInt> contentIDs;
-        contentIDs.AppendL(KMPXMediaIdGeneral);
-        contentIDs.AppendL(KMPXMediaIdAudio);
-        contentIDs.AppendL(KMPXMediaIdMusic);
-        contentIDs.AppendL(KMPXMediaIdMTP); 
-        
-        CMPXMedia* entry = CMPXMedia::NewL( contentIDs.Array() );
-        CleanupStack::PushL( entry );
-        contentIDs.Close();
-        
-        entry->SetTObjectValueL<TUid>(
-                KMPXMediaGeneralCollectionId, KMpxLocalCollectionUid );
-        
-        entry->SetTObjectValueL<TMPXGeneralType>(
-                     KMPXMediaGeneralType, EMPXItem );
-        
-        entry->SetTObjectValueL<TMPXGeneralCategory>(
-                     KMPXMediaGeneralCategory, EMPXSong );
-        
-        
-        entry->SetTextValueL( KMPXMediaGeneralUri, ptrUri );
-        
-        // set location drive
-        TDriveUnit driveUnit( ptrUri );
-        TPtrC driveName = driveUnit.Name();
-        entry->SetTextValueL( KMPXMediaGeneralDrive, driveName );
-        
-        medias->AppendL(entry);
-        CleanupStack::Pop(entry);
-        }
-    return medias;
-    }
-
-void CMediaManager::CreateNewPlaylistL( TInt& aNewUid, CPlaylistItem& aList )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    CMPXMedia* playlist = CreatePlaylistMediaL( aList );
-    CleanupStack::PushL( playlist );
-    iMediator->AddItemL( playlist );
-    
-    if ( !playlist->IsSupported(KMPXMediaGeneralId) )
-        {
-        LOGGER_WRITE("KMPXMediaGeneralId not supported");
-        User::Leave( KErrNotSupported );
-        }
-    else
-        {
-        // Extract the playlist id from the found object
-        TUint32 playlistId = *playlist->Value<TMPXItemId>(KMPXMediaGeneralId);
-        LOGGER_WRITE_1("KMPXMediaGeneralId: %d", playlistId);
-        aNewUid = playlistId;
-        
-        if ( !playlist->IsSupported( KMPXMediaGeneralUri ) )
-            {
-            // get url
-            const TDesC& uri = playlist->ValueText( KMPXMediaGeneralUri );
-            aList.SetUrlL( uri );
-            }
-        }
-    
-    CleanupStack::PopAndDestroy(playlist);
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaManager::ReplacePlaylistL( TInt aPlaylistId, CPlaylistItem& aPlaylist )
-    {
-    TRACE_FUNC_ENTRY;
-    CMPXMedia* playlist = CMPXMedia::NewL();
-    CleanupStack::PushL( playlist );
-    
-    // add playlist info into the playlist media
-    playlist->SetTObjectValueL<TUid>(
-        KMPXMediaGeneralCollectionId, KMpxLocalCollectionUid );
-    
-    // set type
-    playlist->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem );
-     
-    // set category
-    playlist->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXPlaylist ); 
-    
-    
-    
-    // find playlist uri
-    CMPXMedia* oldPlaylist = FindPlaylistL( aPlaylistId );
-    CleanupStack::PushL( oldPlaylist );
-    if ( !oldPlaylist->IsSupported(KMPXMediaGeneralUri) )
-        {
-        User::Leave( KErrNotSupported );
-        }
-    const TDesC& uri = oldPlaylist->ValueText( KMPXMediaGeneralUri );
-    LOGGER_WRITE_1("uri: %S", &uri);
-    
-    playlist->SetTextValueL(
-            KMPXMediaGeneralUri, uri );
-    
-	aPlaylist.SetUrlL( uri );
-    
-    const TDesC& title = oldPlaylist->ValueText( KMPXMediaGeneralTitle );
-    if ( title.Compare( aPlaylist.Title() ) != 0 )
-        {
-        LOGGER_WRITE_1("title changed old: %S", &title);
-        LOGGER_WRITE_1("new title: %S", &aPlaylist.Title());
-        // set playlist title
-        playlist->SetTextValueL( KMPXMediaGeneralTitle, aPlaylist.Title() );
-        
-        // update title first
-        iMediator->SetItemL( playlist );
-        }
-    
-    
-    CleanupStack::PopAndDestroy( oldPlaylist );
-    
-    // update songs
-    CMPXMediaArray* songArray = CreateMediaArrayLC( aPlaylist );
-    // set medias
-    playlist->SetCObjectValueL( KMPXMediaArrayContents, songArray );
-    /// set media count        
-    playlist->SetTObjectValueL( KMPXMediaArrayCount, songArray->Count() );
-    
-    iMediator->SetItemL( playlist );
-    
-    CleanupStack::PopAndDestroy( songArray );
-    CleanupStack::PopAndDestroy( playlist );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-
-void CMediaManager::DeletePlaylistL( TInt aPlaylistId )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    CMPXMedia* playlist = FindPlaylistL( aPlaylistId );
-    CleanupStack::PushL( playlist );
-    iCollection->Collection().RemoveL( *playlist );
-    CleanupStack::PopAndDestroy( playlist );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaManager::HandleAddFileCompleteL( TInt aErr )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aErr: %d", aErr);
-    if ( iWaitOngoing )
-        {
-        LOGGER_WRITE("AsyncStop");
-        iWaitOngoing = EFalse;
-        iWait.AsyncStop();
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaManager::ReadSongAttributesL( const CMPXMedia& aMedia, CSongItem& aSongItem,
-        TBool aReadFileDetails )
-    {
-    if ( !aMedia.IsSupported(KMPXMediaGeneralUri) )
-        {
-        LOGGER_WRITE("KMPXMediaGeneralUri not supported");
-        User::Leave(KErrNotSupported);
-        }    
-    
-    if ( !aMedia.IsSupported(KMPXMediaGeneralId) )
-        {
-        LOGGER_WRITE("KMPXMediaGeneralId not supported");
-        User::Leave(KErrNotSupported);
-        }
-    
-    aSongItem.SetId( *aMedia.Value<TMPXItemId>(KMPXMediaGeneralId) );
-    
-    const TDesC& uri = aMedia.ValueText(KMPXMediaGeneralUri);
-    aSongItem.SetUriL( uri );
-    
-    if ( aMedia.IsSupported(KMPXMediaGeneralTitle) )
-        {
-        aSongItem.SetTitleL( aMedia.ValueText(KMPXMediaGeneralTitle) );
-        }
-    
-    if ( aMedia.IsSupported(KMPXMediaGeneralMimeType) )
-        {
-        aSongItem.SetMimeTypeL( aMedia.ValueText(KMPXMediaGeneralMimeType) );
-        }
-    
-    if ( aMedia.IsSupported(KMPXMediaGeneralDuration) )
-        {
-        aSongItem.SetDuration( aMedia.ValueTObjectL<TInt>(KMPXMediaGeneralDuration) );
-        }
-    
-    if ( aMedia.IsSupported(KMPXMediaMusicArtist) )
-        {
-        aSongItem.SetArtistL( aMedia.ValueText(KMPXMediaMusicArtist) );
-        }
-    
-    if ( aMedia.IsSupported(KMPXMediaMusicAlbum) )
-        {
-        aSongItem.SetAlbumL( aMedia.ValueText(KMPXMediaMusicAlbum) );
-        }
-    
-    if ( aMedia.IsSupported(KMPXMediaMusicYear) )
-        {
-        TInt64 year = aMedia.ValueTObjectL<TInt64>( KMPXMediaMusicYear );
-        TTime yearTime( year);
-        aSongItem.SetYear( yearTime.DateTime().Year() );
-        }
-    
-    if ( aMedia.IsSupported(KMPXMediaMusicAlbumTrack) )
-        {
-        aSongItem.SetAlbumTrack( *aMedia.Value<TInt>(KMPXMediaMusicAlbumTrack) );
-        }
-    
-    if ( aMedia.IsSupported(KMPXMediaMusicGenre) )
-        {
-        const TDesC& genre = aMedia.ValueText(KMPXMediaMusicGenre);
-        aSongItem.SetGenreL( genre );
-        }
-    
-    if ( aMedia.IsSupported(KMPXMediaMusicComposer) )
-        {
-        aSongItem.SetComposerL( aMedia.ValueText(KMPXMediaMusicComposer) );
-        }
-    
-    if ( aMedia.IsSupported(KMPXMediaGeneralComment) )
-        {
-        aSongItem.SetCommentL( aMedia.ValueText(KMPXMediaGeneralComment) );
-        }
-    
-    // Reading file timestamp and size is slow, read only if needed
-    if ( aReadFileDetails )
-        {
-        TEntry fileEntry;
-        TInt err = iFs.Entry(uri,fileEntry);
-        if ( !err )
-            {
-            aSongItem.SetModifiedTime( fileEntry.iModified );
-            aSongItem.SetFileSize( fileEntry.iSize );
-            }
-        }
-    
-    }
-
-
-void CMediaManager::DoCancel()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    delete iFoundedMedia;
-    iFoundedMedia = NULL;
-    iReadedItems = 0;
-    iItemsFound = 0;      
-    TState state = iCurrentState;
-    iCurrentState = EIdle;
-    
-    switch (state)
-        {
-        case EReadingPlaylistCount:
-        case EEnumeratingPlaylists:
-            iObserver->RegisterAllPlayListsCompleted( KErrCancel );
-            break;
-            
-        case EReadingSongCount:
-        case EEnumeratingSongs:
-            iObserver->RegisterAllSongsCompleted( KErrCancel );
-            break;
-        default:
-            break;
-        }
-    
-    LOGGER_WRITE("signal cancel");
-    TRequestStatus* status = &iStatus;
-    User::RequestComplete( status, KErrCancel );
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaManager::RunL()
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("iStatus.Int(): %d", iStatus.Int())
-    TRequestStatus* status = &iStatus;
-    switch (iCurrentState)
-        {
-        case EReadingPlaylistCount:
-            //if ( !iCancel )
-            //    {
-                ReadPlaylistCountL();
-                iReadedItems=0;
-                // next state
-                iCurrentState = EEnumeratingPlaylists;
-                SetActive();
-                User::RequestComplete( status, KErrNone );
-            /*    }
-            else
-                {
-                LOGGER_WRITE("cancel");
-                iCancel = EFalse;
-                delete iFoundedMedia; iFoundedMedia = NULL;
-                iReadedItems = 0;
-                iItemsFound = 0;
-                iCurrentState = EIdle;
-                iObserver->RegisterAllPlayListsCompleted( KErrCancel );
-                }*/
-            break;
-            
-        case EEnumeratingPlaylists:
-            //if ( !iCancel )
-            //    {
-                ReadPlaylistItemsL();
-                if ( iReadedItems == iItemsFound )
-                    {
-                    // all items readed
-                    delete iFoundedMedia;
-                    iFoundedMedia = NULL;
-                    // next state
-                    iCurrentState = EIdle;
-                    iObserver->RegisterAllPlayListsCompleted( KErrNone );
-                    }
-                else
-                    {
-                    // not ready yet, continue same operation
-                    SetActive();
-                    User::RequestComplete( status, KErrNone );
-                    }
-             /*   }
-            else
-                {
-                // cancel
-                LOGGER_WRITE("cancel");
-                iCancel = EFalse;
-                delete iFoundedMedia; iFoundedMedia = NULL;
-                iReadedItems = 0;
-                iItemsFound = 0;
-                iCurrentState = EIdle;
-                iObserver->RegisterAllPlayListsCompleted( KErrCancel );
-                }*/
-            break;
-            
-        case EReadingSongCount:
-            //if ( !iCancel )
-            //    {
-                ReadSongCountL();
-                iReadedItems=0;
-                // next state
-                iCurrentState = EEnumeratingSongs;
-                SetActive();
-                User::RequestComplete( status, KErrNone );
-            /*    }
-            else
-                {
-                LOGGER_WRITE("cancel");
-                iCancel = EFalse;
-                delete iFoundedMedia; iFoundedMedia = NULL;
-                iReadedItems = 0;
-                iItemsFound = 0;
-                iCurrentState = EIdle;
-                iObserver->RegisterAllSongsCompleted( KErrCancel );
-                }*/
-            break;
-            
-        case EEnumeratingSongs:
-//            if ( !iCancel )
-              //  {
-                ReadSongItemsL();
-                if ( iReadedItems == iItemsFound )
-                    {
-                    // all items readed
-                    delete iFoundedMedia;
-                    iFoundedMedia = NULL;
-                    // next state
-                    iCurrentState = EIdle;
-                    iObserver->RegisterAllSongsCompleted( KErrNone );
-                    }
-                else
-                    {
-                    // not ready yet, continue same operation
-                    SetActive();
-                    User::RequestComplete( status, KErrNone );
-                    }
-              /*  }
-            else
-                {
-                LOGGER_WRITE("cancel");
-                iCancel = EFalse;
-                delete iFoundedMedia; iFoundedMedia = NULL;
-                iReadedItems = 0;
-                iItemsFound = 0;
-                iCurrentState = EIdle;
-                iObserver->RegisterAllSongsCompleted( KErrCancel );
-                }*/
-            break;
-        default:
-            break;
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-
-TInt CMediaManager::RunError( TInt aError )
-    {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1("aError: %d", aError)
-    switch (iCurrentState)
-        {
-        case EReadingPlaylistCount:
-        case EEnumeratingPlaylists:
-            iObserver->RegisterAllPlayListsCompleted( aError );
-            break;
-        case EReadingSongCount:
-        case EEnumeratingSongs:
-            iObserver->RegisterAllSongsCompleted( aError );
-            break;
-        default:
-            LOGGER_WRITE("Unknown state!");
-            break;
-        }
-    
-    TRACE_FUNC_EXIT;
-    return KErrNone;
-    }
-
-void CMediaManager::ReadPlaylistCountL()
-    {
-    TRACE_FUNC_ENTRY;
-    // Find all playlist files in the playlist DB
-    RArray<TInt> contentIDs;
-    CleanupClosePushL( contentIDs );
-    contentIDs.AppendL(KMPXMediaIdGeneral);
-    
-    CMPXMedia* searchMedia = CMPXMedia::NewL(contentIDs.Array());
-    CleanupStack::PopAndDestroy( &contentIDs );
-    CleanupStack::PushL(searchMedia);
-    
-    searchMedia->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem);    
-    searchMedia->SetTObjectValueL(KMPXMediaGeneralCategory, EMPXPlaylist);
-    
-    RArray<TMPXAttribute> playlistAttributes;
-    CleanupClosePushL(playlistAttributes);
-    playlistAttributes.AppendL( KMPXMediaGeneralId );
-    playlistAttributes.AppendL( KMPXMediaGeneralTitle );
-    playlistAttributes.AppendL( KMPXMediaGeneralUri );
-    
-    LOGGER_WRITE("find all");
-    delete iFoundedMedia; iFoundedMedia=NULL;
-    iFoundedMedia = iCollectionHelper->FindAllL(*searchMedia, playlistAttributes.Array());
-    CleanupStack::PopAndDestroy(&playlistAttributes);
-    CleanupStack::PopAndDestroy(searchMedia);
-
-    if ( !iFoundedMedia->IsSupported(KMPXMediaArrayCount) )
-        {
-        delete iFoundedMedia; iFoundedMedia=NULL;
-        User::Leave( KErrNotSupported );
-        }
-    
-    iItemsFound = *iFoundedMedia->Value<TInt>(KMPXMediaArrayCount);
-    
-    LOGGER_WRITE_1("playlists: %d", iItemsFound);
-
-    if ( iItemsFound )
-        {
-        if ( !iFoundedMedia->IsSupported(KMPXMediaArrayContents) )
-            {
-            delete iFoundedMedia; iFoundedMedia=NULL;
-            iItemsFound = 0;
-            User::Leave(KErrNotSupported);
-            }
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaManager::ReadPlaylistItemsL()
-    {
-    TRACE_FUNC_ENTRY;
-    TInt start = iReadedItems;
-    TInt end = start+iMaxPlaylistItemsToEnumerate;
-    if ( end >iItemsFound )
-        {
-        end = iItemsFound;
-        }
-    
-    const CMPXMediaArray* foundArray = iFoundedMedia->Value<CMPXMediaArray>(KMPXMediaArrayContents);
-            
-    for (TInt i = start; i < end; i++)
-        {
-        LOGGER_WRITE_1("read playlistItem: %d", i);
-        CMPXMedia* playlistMedia = CMPXMedia::NewL(*(*foundArray)[i]);
-        CleanupStack::PushL( playlistMedia );
-        
-        // Append playlist to item array
-        RegisterPlaylistL( *playlistMedia );
-               
-        CleanupStack::PopAndDestroy( playlistMedia );
-        iReadedItems++;
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-    
-
-void CMediaManager::ReadSongCountL()
-    {
-    TRACE_FUNC_ENTRY;
-
-    RArray<TInt> contentIDs;
-    CleanupClosePushL( contentIDs );
-    contentIDs.AppendL( KMPXMediaIdGeneral );
-    contentIDs.AppendL( KMPXMediaIdMusic );
-    
-    CMPXMedia* criteria = CMPXMedia::NewL(contentIDs.Array());
-    CleanupStack::PopAndDestroy( &contentIDs );
-    CleanupStack::PushL(criteria);
-    
-    criteria->SetTObjectValueL( KMPXMediaGeneralType, EMPXItem );
-    criteria->SetTObjectValueL( KMPXMediaGeneralCategory, EMPXSong );
-    
-    // define attributes fetched
-    RArray<TMPXAttribute> songAttributes;
-    CleanupClosePushL(songAttributes);
-    
-    songAttributes.AppendL( KMPXMediaGeneralType );
-    songAttributes.AppendL( KMPXMediaGeneralCategory );
-    songAttributes.AppendL( KMPXMediaGeneralUri );
-    songAttributes.AppendL( KMPXMediaGeneralId );
-    songAttributes.AppendL( KMPXMediaGeneralTitle );
-    songAttributes.AppendL( KMPXMediaGeneralMimeType );
-    songAttributes.AppendL( KMPXMediaGeneralDuration );
-    songAttributes.AppendL( KMPXMediaGeneralComment );
-    
-    songAttributes.AppendL( KMPXMediaMusicArtist );
-    songAttributes.AppendL( KMPXMediaMusicAlbum );
-    songAttributes.AppendL( KMPXMediaMusicYear );
-    songAttributes.AppendL( KMPXMediaMusicAlbumTrack );
-    songAttributes.AppendL( KMPXMediaMusicGenre );
-    songAttributes.AppendL( KMPXMediaMusicComposer );
-    
-    delete iFoundedMedia;
-    iFoundedMedia = NULL;
-    // now find
-    LOGGER_WRITE("FindAllL");
-    iFoundedMedia = iCollectionHelper->FindAllL( *criteria , songAttributes.Array() );
-        
-    LOGGER_WRITE("FindAllL ok");
-    CleanupStack::PopAndDestroy( &songAttributes );
-    CleanupStack::PopAndDestroy( criteria );
-    
-
-    if ( !iFoundedMedia->IsSupported(KMPXMediaArrayCount) )
-         {
-         LOGGER_WRITE("KMPXMediaArrayCount not supported");
-         delete iFoundedMedia;
-         iFoundedMedia = NULL;
-         iItemsFound = 0;
-         User::Leave(KErrNotSupported);
-         }
-     
-    // Number of references
-    iItemsFound = *iFoundedMedia->Value<TInt>(KMPXMediaArrayCount);
-    LOGGER_WRITE_1("songs: %d", iItemsFound);
-    if ( iItemsFound )
-        {
-        if (!iFoundedMedia->IsSupported(KMPXMediaArrayContents))
-            {
-            delete iFoundedMedia;
-            iFoundedMedia = NULL;
-            iItemsFound = 0;
-            User::Leave(KErrNotSupported);
-            }
-        }
-    
-    TRACE_FUNC_EXIT;
-    }
-
-void CMediaManager::ReadSongItemsL()
-    {
-    TRACE_FUNC_ENTRY;
-    
-    TInt start = iReadedItems;
-    TInt end = start+iMaxSongItemsToEnumerate;
-    if ( end >iItemsFound )
-        {
-        end = iItemsFound;
-        }
-    
-    const CMPXMediaArray* foundArray = iFoundedMedia->Value<CMPXMediaArray>(KMPXMediaArrayContents);
-    
-    TKeyArrayFix key( iKey );
-    // Import the references
-    for (TInt i = start; i < end; i++)
-        {
-        //LOGGER_WRITE_1("read songitem: %d",i);
-        const CMPXMedia* refMedia = (*foundArray)[i];
-        
-        CSongItem* song = CSongItem::NewLC();
-        
-        ReadSongAttributesL( *refMedia, *song, EFalse );
-        TSnapshotItem snapshotItem( song->Id(), KAllSongsFolderId );
-        snapshotItem.SetItemHash( *song, iHasher );
-        
-        iSnapshotArray->InsertIsqL( snapshotItem, key );
-        
-        CleanupStack::PopAndDestroy( song );
-        iReadedItems++;
-        }
-    TRACE_FUNC_EXIT;
-    }
--- a/omads/omadsextensions/adapters/mediads/src/omadsfolderobject.cpp	Tue Aug 31 15:05:37 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:  COMADSFolderObject class implementation.
-*
-*/
-
-
-#include <utf.h>
-#include "omadsfolderobject.h"
-#include "logger.h"
-
-_LIT(KFolderBeginTag, "<Folder>");
-_LIT(KFolderEndTag, "</Folder>");
-_LIT(KNameBeginTag, "<name>");
-_LIT(KNameEndTag, "</name>");
-_LIT(KCreatedBeginTag, "<created>");
-_LIT(KCreatedEndTag, "</created>");
-_LIT(KModifiedBeginTag, "<modified>");
-_LIT(KModifiedEndTag, "</modified>");
-_LIT(KDateFormat, "%04d%02d%02dT%02d%02d%02d");
-const TInt KDateFormatLength( 15 );
-
-
-COMADSFolderObject* COMADSFolderObject::NewLC()
-    {
-    COMADSFolderObject* self = new (ELeave) COMADSFolderObject;
-    CleanupStack::PushL( self );
-    return self;
-    }
-
-COMADSFolderObject::~COMADSFolderObject()
-    {
-    }
-
-void COMADSFolderObject::ExportFolderXmlL( CBufBase& aBuffer )
-    {
-    iBuffer = &aBuffer;
-    iWriteBufPosition = 0;
-    iWriteBufSize = aBuffer.Size();     
-
-    ExportL();
-    }
-    
-void COMADSFolderObject::ExportL()
-    {
-    // Folder
-    WriteL( KFolderBeginTag );
-    
-    // Name
-    WriteL( KNameBeginTag );
-    WriteL( iName );
-    WriteL( KNameEndTag );
-    
-    // Created Date
-    TBuf<KDateFormatLength> tempdate;
-    tempdate.Format( KDateFormat, iCreatedDate.Year(), iCreatedDate.Month() + 1,
-        iCreatedDate.Day(), iCreatedDate.Hour(), iCreatedDate.Minute(), iCreatedDate.Second() );
-    
-    WriteL( KCreatedBeginTag );
-    WriteL( tempdate );
-    WriteL( KCreatedEndTag );
-    
-    // Modified Date
-    tempdate.Format( KDateFormat, iModifiedDate.Year(), iModifiedDate.Month() + 1,
-        iModifiedDate.Day(), iModifiedDate.Hour(), iModifiedDate.Minute(), iModifiedDate.Second() );
-    
-    WriteL( KModifiedBeginTag );
-    WriteL( tempdate );
-    WriteL( KModifiedEndTag );
-    
-    // Folder end
-    WriteL(KFolderEndTag);
-    }
-    
-void COMADSFolderObject::WriteL( const TDesC& aData )
-    {   
-    User::LeaveIfError( CnvUtfConverter::ConvertFromUnicodeToUtf8( iTemp, aData ) );
-    
-    TInt newPosition = iWriteBufPosition + iTemp.Length();
-
-    if ( newPosition > iWriteBufSize )
-        {
-        TInt expand = newPosition - iWriteBufSize;
-        iBuffer->ExpandL( iWriteBufSize, expand );
-        iWriteBufSize += expand;
-        }
-
-    iBuffer->Write( iWriteBufPosition, iTemp );
-    iWriteBufPosition = newPosition;
-    }
--- a/omads/omadsextensions/adapters/mediads/src/playlistitem.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,204 +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:  CPlaylistItem class implementation
-*
-*/
-
-
-
-#include "playlistitem.h"
-
-#include "logger.h"
-
-_LIT( KLineFeed, "\r\n" );
-_LIT( KUrl, "#EXTURL:" );
-_LIT( KTitle, "#EXTTITLE:" );
-
-_LIT( KCommentChar, "#" );
-
-const TInt KDefaultGranularity( 5 );
-
-CPlaylistItem* CPlaylistItem::NewLC()
-    {
-    CPlaylistItem* self = new (ELeave) CPlaylistItem();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-CPlaylistItem::~CPlaylistItem()
-    {
-    TRACE_FUNC;
-    delete iTitle;
-    delete iUrl;
-    delete iDescArray;
-    }
-
-CPlaylistItem::CPlaylistItem()
-    {
-    }
-
-void CPlaylistItem::ConstructL()
-    {
-    TRACE_FUNC;
-    iTitle = KNullDesC().AllocL();
-    iUrl = KNullDesC().AllocL();
-    iDescArray = new (ELeave) CDesCArrayFlat(KDefaultGranularity);
-    }
-
-void CPlaylistItem::SetId( TInt aId )
-    {
-    iId = aId;
-    }
-
-TInt CPlaylistItem::Id() const
-    {
-    return iId;
-    }
-
-void CPlaylistItem::SetTitleL( const TDesC& aTitle )
-    {
-    delete iTitle;
-    iTitle = NULL;
-    iTitle = aTitle.AllocL();
-    }
-
-const TDesC& CPlaylistItem::Title() const
-    {
-    return *iTitle;
-    }
-
-void CPlaylistItem::SetUrlL( const TDesC& aUrl )
-    {
-    delete iUrl;
-    iUrl = NULL;
-    iUrl = aUrl.AllocL();
-    }
-
-const TDesC& CPlaylistItem::Url() const
-    {
-    return *iUrl;
-    }
-
-TInt CPlaylistItem::ItemCount() const
-    {
-    return iDescArray->MdcaCount();
-    }
-
-TPtrC16 CPlaylistItem::ItemAt( TInt aIndex ) const
-    {
-    return iDescArray->MdcaPoint( aIndex );
-    }
-
-TInt CPlaylistItem::FindItem( const TDesC16& aPtr, TInt& aPos, TKeyCmpText aTextComparisonType ) const
-    {
-    return iDescArray->Find( aPtr, aPos, aTextComparisonType );
-    }
-
-void CPlaylistItem::ExportL( RBufWriteStream& aStream ) const
-    {
-    TRACE_FUNC_ENTRY;
-    
-    aStream.WriteL( KUrl );
-    aStream.WriteL( *iUrl, iUrl->Length() );
-    aStream.WriteL( KLineFeed );
-    
-    aStream.WriteL( KTitle );
-    aStream.WriteL( *iTitle, iTitle->Length() );
-    aStream.WriteL( KLineFeed );
-    
-    TInt count = iDescArray->MdcaCount();
-    for ( TInt i=0; i<count; i++ )
-        {
-        TPtrC16 ptr16 = iDescArray->MdcaPoint( i );
-        aStream.WriteL( ptr16, ptr16.Length() );
-        aStream.WriteL( KLineFeed );
-        }
-    
-    aStream.CommitL();
-    TRACE_FUNC_EXIT;
-    }
-
-void CPlaylistItem::ImportL( const TDesC& aBuffer )
-    {
-    TRACE_FUNC_ENTRY;
-    iDescArray->Reset();
-    TPtrC tag;
-    TPtrC data;
-    TInt currentPos(0);
-    TInt lineLen(0);
-    TBool eof(EFalse);
-    while( !eof )
-        {
-        lineLen = ReadNextLine( aBuffer.Mid(currentPos), data );
-        if ( lineLen >= 0)
-            {
-            if ( data.FindF( KTitle ) == 0 )
-                {
-                TPtrC title = data.Mid( KTitle().Length() );
-                SetTitleL( title );
-                }
-            else if ( data.FindF( KCommentChar ) == 0 )
-                {
-                // ignore comment
-                }
-            else if ( data.Length() > 0 )
-                {
-                // must be song url
-                AddItemL( data );
-                }
-            }
-        else
-            {
-            eof = ETrue;
-            }
-        currentPos += lineLen;
-        if ( currentPos >= aBuffer.Length() )
-            {
-            eof = ETrue;
-            }
-        }
-    TRACE_FUNC_EXIT;
-    }
-
-void CPlaylistItem::AddItemL( const TDesC& aSongUri )
-    {
-    //LOGGER_WRITE_1("AddItem: %S", &aSongUri);
-    TFileName uri(aSongUri);
-    uri.LowerCase();
-    uri.TrimAll();
-    iDescArray->InsertIsqAllowDuplicatesL( uri );
-    }
-
-TInt CPlaylistItem::ReadNextLine( const TDesC& aBuffer, TPtrC& aLine )
-    {
-    //TRACE_FUNC_ENTRY;
-    TInt lineLen = aBuffer.FindF( KLineFeed );
-    
-    if ( lineLen == KErrNotFound )
-        {
-        lineLen = aBuffer.Length();
-        if ( lineLen == 0 )
-            {
-            //TRACE_FUNC_RET( lineLen );
-            return KErrNotFound;
-            }
-        }
-    
-    aLine.Set( aBuffer.Mid( 0, lineLen ));
-    //LOGGER_WRITE_1("aLine: %S", &aLine);
-    lineLen += 2;
-    //TRACE_FUNC_RET( lineLen );
-    return lineLen;
-    }
--- a/omads/omadsextensions/adapters/mediads/src/snapshotitem.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +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:  Part of SyncML Data Synchronization Plug In Adapter
-*
-*/
-
-
-
-#include <S32STRM.h>
-
-#include "snapshotitem.h"
-
-
-// -----------------------------------------------------------------------------
-// TSnapshotItem::TSnapshotItem
-// C++ default constructor can NOT contain any code, that might leave
-// -----------------------------------------------------------------------------
-TSnapshotItem::TSnapshotItem()
-    {
-    SetItemId( 0 );
-    SetParentId( 0 );
-    }
-
-// -----------------------------------------------------------------------------
-// TSnapshotItem::TSnapshotItem
-// Constructor, takes item id as a parameter
-// -----------------------------------------------------------------------------
-TSnapshotItem::TSnapshotItem( const TSmlDbItemUid& aItemId,
-    const TSmlDbItemUid& aParent )
-    {
-    SetItemId( aItemId );
-    SetParentId( aParent );
-    }
-
-// -----------------------------------------------------------------------------
-// TSnapshotItem::ExternalizeL
-// Writes the contents of this class to stream
-// -----------------------------------------------------------------------------
-void TSnapshotItem::ExternalizeL( RWriteStream& aStream ) const
-    {
-    aStream.WriteInt32L( iItemId );
-    aStream.WriteInt32L( iParentId );
-    
-    TPckgBuf<THashValue> nameBuf(iHash);
-    
-    aStream << nameBuf;
-    }
-
-// -----------------------------------------------------------------------------
-// TSnapshotItem::InternalizeL
-// Reads the contents of this class from stream
-// -----------------------------------------------------------------------------
-void TSnapshotItem::InternalizeL( RReadStream& aStream )
-    {
-    iItemId = aStream.ReadInt32L();
-    iParentId = aStream.ReadInt32L();
-    
-    TPckgBuf<THashValue> nameBuf;
-	aStream >> nameBuf;
-	iHash = nameBuf();
-    }
-
-const TSmlDbItemUid& TSnapshotItem::ItemId() const
-    {
-    return iItemId;
-    }
-
-void TSnapshotItem::SetItemId( const TSmlDbItemUid& aItemId )
-    {
-    iItemId = aItemId;
-    }
-
-
-const TSmlDbItemUid& TSnapshotItem::ParentId() const
-    {
-    return iParentId;
-    }
-
-void TSnapshotItem::SetParentId( const TSmlDbItemUid& aParentId )
-    {
-    iParentId = aParentId;
-    }
-
-
-void TSnapshotItem::SetItemHash( const TDesC& aFolderName, CMD5& aHasher )
-    {
-    TPtrC8 narrowFolder;
-    TInt narrowFolderLen = 0;
-
-    narrowFolderLen = aFolderName.Length()*2;
-    narrowFolder.Set((TUint8*)aFolderName.Ptr(), narrowFolderLen);
-    
-    aHasher.Reset();
-    aHasher.Update( narrowFolder );
-    
-    iHash = aHasher.Final();
-    
-    }
-
-void TSnapshotItem::SetItemHash( const CSongItem& aSongItem, CMD5& aHasher )
-    {
-    TPtrC8 narrowData;
-    TInt narrowDataLen = 0;
-
-    
-    aHasher.Reset();
-    
-    narrowDataLen = aSongItem.Uri().Length()*2;
-    narrowData.Set((TUint8*)aSongItem.Uri().Ptr(), narrowDataLen);
-    aHasher.Update( narrowData );
-    
-    narrowDataLen = aSongItem.Title().Length()*2;
-    narrowData.Set((TUint8*)aSongItem.Title().Ptr(), narrowDataLen);
-    aHasher.Update( narrowData );
-    
-    narrowDataLen = aSongItem.MimeType().Length()*2;
-    narrowData.Set((TUint8*)aSongItem.MimeType().Ptr(), narrowDataLen);
-    aHasher.Update( narrowData );
-    
-    narrowDataLen = aSongItem.Artist().Length()*2;
-    narrowData.Set((TUint8*)aSongItem.Artist().Ptr(), narrowDataLen);
-    aHasher.Update( narrowData );
-    
-    narrowDataLen = aSongItem.Album().Length()*2;
-    narrowData.Set((TUint8*)aSongItem.Album().Ptr(), narrowDataLen);
-    aHasher.Update( narrowData );
-    
-    narrowDataLen = aSongItem.Genre().Length()*2;
-    narrowData.Set((TUint8*)aSongItem.Genre().Ptr(), narrowDataLen);
-    aHasher.Update( narrowData );
-    
-    narrowDataLen = aSongItem.Comment().Length()*2;
-    narrowData.Set((TUint8*)aSongItem.Comment().Ptr(), narrowDataLen);
-    aHasher.Update( narrowData );
-    
-    narrowDataLen = aSongItem.Composer().Length()*2;
-    narrowData.Set((TUint8*)aSongItem.Composer().Ptr(), narrowDataLen);
-    aHasher.Update( narrowData );
-    
-    narrowDataLen = aSongItem.MimeType().Length()*2;
-    narrowData.Set((TUint8*)aSongItem.MimeType().Ptr(), narrowDataLen);
-    aHasher.Update( narrowData );
-    
-    const TInt KNumberMaxLength(11);
-    TBuf8<KNumberMaxLength> temp;
-    temp.Num( aSongItem.Year() );
-    aHasher.Update( temp );
-    
-    temp.Num( aSongItem.AlbumTrack() );
-    aHasher.Update( temp );
-    
-    temp.Num( aSongItem.Rating() );
-    aHasher.Update( temp );   
-    
-    temp.Num( aSongItem.Duration() );
-    aHasher.Update( temp );
-    
-    iHash.Copy( aHasher.Final() );
-    
-    }
-
-void TSnapshotItem::SetItemHash( const CPlaylistItem& aPlaylist, CMD5& aHasher )
-    {
-    TPtrC8 narrowData;
-    TInt narrowDataLen = 0;
-    
-    aHasher.Reset();
-    narrowDataLen = aPlaylist.Title().Length()*2;
-    narrowData.Set((TUint8*)aPlaylist.Title().Ptr(), narrowDataLen);
-    aHasher.Update( narrowData );
-    
-    narrowDataLen = aPlaylist.Url().Length()*2;
-    narrowData.Set((TUint8*)aPlaylist.Url().Ptr(), narrowDataLen);
-    aHasher.Update( narrowData );
-    
-    for (TInt i=0; i<aPlaylist.ItemCount(); i++ )
-        {
-        TPtrC16 song = aPlaylist.ItemAt(i);
-        narrowDataLen = song.Length()*2;
-        narrowData.Set((TUint8*)song.Ptr(), narrowDataLen);
-        aHasher.Update( narrowData );
-        }
-    iHash.Copy( aHasher.Final() );
-    }
-
-const TDesC8& TSnapshotItem::Hash() const
-    {
-    return iHash;
-    }
--- a/omads/omadsextensions/adapters/mediads/src/songitem.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,351 +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:  CSongItem class implementation
-*
-*/
-
-
-
-#include "songitem.h"
-
-#include <metadatautility.h>
-#include <metadatafieldcontainer.h>
-#include <metadatafield.hrh>
-
-#include "logger.h"
-#include "sconmetadatafielddefs.h"
-
-
-CSongItem::CSongItem()
-    {
-    }
-
-CSongItem* CSongItem::NewLC()
-    {
-    CSongItem* self = new (ELeave) CSongItem();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-void CSongItem::ConstructL()
-    {
-    iUri = KNullDesC().AllocL();
-    iTitle = KNullDesC().AllocL();
-    iMimeType = KNullDesC().AllocL();
-    iArtist = KNullDesC().AllocL();
-    iAlbum = KNullDesC().AllocL();
-    iGenre = KNullDesC().AllocL();
-    iComment = KNullDesC().AllocL();
-    iComposer = KNullDesC().AllocL();
-    
-    iDuration = -1;
-    iYear = -1;
-    iAlbumTrack = -1;
-    iRating = -1;
-    iSize = 0;
-    }
-
-CSongItem::~CSongItem()
-    {
-    delete iUri;
-    delete iTitle;
-    delete iMimeType;
-    delete iArtist;
-    delete iAlbum;
-    delete iGenre;
-    delete iComment;
-    delete iComposer;
-    }
-
-void CSongItem::SetId( TInt aId )
-    {
-    iId = aId;
-    }
-
-TInt CSongItem::Id() const
-    {
-    return iId;
-    }
-
-void CSongItem::SetUriL( const TDesC& aUri )
-    {
-    delete iUri;
-    iUri = NULL;
-    iUri = aUri.AllocL();
-    }
-
-const TDesC& CSongItem::Uri() const
-    {
-    return *iUri;
-    }
-
-void CSongItem::SetTitleL( const TDesC& aTitle )
-    {
-    delete iTitle;
-    iTitle = NULL;
-    iTitle = aTitle.AllocL();
-    }
-
-const TDesC& CSongItem::Title() const
-    {
-    return *iTitle;
-    }
-
-void CSongItem::SetMimeTypeL( const TDesC& aMimeType )
-    {
-    delete iMimeType;
-    iMimeType = NULL;
-    iMimeType = aMimeType.AllocL();
-    }
-
-const TDesC& CSongItem::MimeType() const
-    {
-    return *iMimeType;
-    }
-
-void CSongItem::SetDuration( TInt aDuration )
-    {
-    iDuration = aDuration;
-    }
-
-TInt CSongItem::Duration() const
-    {
-    return iDuration;
-    }
-
-void CSongItem::SetArtistL( const TDesC& aArtist )
-    {
-    delete iArtist;
-    iArtist = NULL;
-    iArtist = aArtist.AllocL();
-    }
-
-const TDesC& CSongItem::Artist() const
-    {
-    return *iArtist;
-    }
-
-void CSongItem::SetAlbumL( const TDesC& aAlbum )
-    {
-    delete iAlbum;
-    iAlbum = NULL;
-    iAlbum = aAlbum.AllocL();
-    }
-
-const TDesC& CSongItem::Album() const
-    {
-    return *iAlbum;
-    }
-
-void CSongItem::SetYear( TInt aYear )
-    {
-    iYear = aYear;
-    }
-
-TInt CSongItem::Year() const
-    {
-    return iYear;
-    }
-
-void CSongItem::SetAlbumTrack( TInt aAlbumTrack )
-    {
-    iAlbumTrack = aAlbumTrack;
-    }
-
-TInt CSongItem::AlbumTrack() const
-    {
-    return iAlbumTrack;
-    }
-
-void CSongItem::SetGenreL( const TDesC& aGenre )
-    {
-    delete iGenre;
-    iGenre = NULL;
-    iGenre = aGenre.AllocL();
-    }
-
-const TDesC& CSongItem::Genre() const
-    {
-    return *iGenre;
-    }
-
-void CSongItem::SetCommentL( const TDesC& aComment )
-    {
-    delete iComment;
-    iComment = NULL;
-    iComment = aComment.AllocL();
-    }
-
-const TDesC& CSongItem::Comment() const
-    {
-    return *iComment;
-    }
-    
-void CSongItem::SetComposerL( const TDesC& aComposer )
-    {
-    delete iComposer;
-    iComposer = NULL;
-    iComposer = aComposer.AllocL();
-    }
-
-const TDesC& CSongItem::Composer() const
-    {
-    return *iComposer;
-    }
-
-void CSongItem::SetRating( TInt aRating )
-    {
-    iRating = aRating;
-    }
-
-TInt CSongItem::Rating() const
-    {
-    return iRating;
-    }
-
-void CSongItem::SetModifiedTime( TTime& aTime )
-    {
-    iModifiedTime = aTime;
-    }
-
-const TTime& CSongItem::ModifiedTime() const
-    {
-    return iModifiedTime;
-    }
-
-void CSongItem::SetFileSize( TInt32 aSize )
-    {
-    iSize = aSize;
-    }
-
-TInt32 CSongItem::FileSize() const
-    {
-    return iSize;
-    }
-
-// -----------------------------------------------------------------------------
-// CSongItem::ExportL
-// Exports item as specified in "Metadata format description v3.doc" document.
-// -----------------------------------------------------------------------------
-void CSongItem::ExportL( RWriteStream& aStream )
-    {
-    TRACE_FUNC_ENTRY;
-    
-    // write object header
-
-    // header id
-    aStream.WriteUint8L( KSconMetadataHeaderAudio );
-    
-    // header version
-    aStream.WriteUint8L( KSconMetadataHeaderVersion );
-    
-    WriteUnicodeL( aStream, iTitle->Des(), KSconAudioTitle );
-    WriteUnicodeL( aStream, iUri->Des(), KSconAudioFilename );
-    
-    if ( iDuration > -1 )
-        {
-        WriteUInt32FieldL( aStream, iDuration, KSconAudioDuration );
-        }
-    
-    WriteUnicodeL( aStream, iArtist->Des(), KSconAudioArtist );
-    if ( iYear > -1 )
-        {
-        WriteUInt16FieldL( aStream, iYear, KSconAudioYear);
-        }
-    if ( iAlbumTrack > -1 )
-        {
-        WriteUInt16FieldL( aStream, iAlbumTrack, KSconAudioAlbumTrack );
-        }
-    WriteUnicodeL( aStream, iAlbum->Des(), KSconAudioAlbum );
-    WriteUnicodeL( aStream, iGenre->Des(), KSconAudioGenre );
-    WriteUnicodeL( aStream, iComposer->Des(), KSconAudioComposer );
-    WriteUnicodeL( aStream, iComment->Des(), KSconAudioComment );
-
-    if ( iRating > -1 )
-        {
-        WriteUInt16FieldL( aStream, iRating, KSconAudioRating );
-        }
-    WriteUnicodeL( aStream, iMimeType->Des(), KSconAudioMimeType );
-    
-    aStream.WriteUint8L( KSconAudioDate );
-    const TUint KDateTimeSize = 7; // Int16 + 5*Int8 = 2 + 5*1 = 7 bytes
-    aStream.WriteUint32L( KDateTimeSize ); //size
-    
-    TDateTime time = iModifiedTime.DateTime();
-    aStream.WriteInt16L( time.Year() );
-    aStream.WriteInt8L( time.Month()+1 ); // range 1...12
-    aStream.WriteInt8L( time.Day()+1 );
-    aStream.WriteInt8L( time.Hour() );
-    aStream.WriteInt8L( time.Minute() );
-    aStream.WriteInt8L( time.Second() );
-    
-    // filesize
-    WriteUInt32FieldL( aStream, iSize, KSconAudioFileSize );
-    
-    // read album art
-    CMetaDataUtility* metaDataUtil = CMetaDataUtility::NewL();
-    CleanupStack::PushL( metaDataUtil );
-    
-    RArray<TMetaDataFieldId> wantedFields;
-    CleanupClosePushL(wantedFields);
-    wantedFields.AppendL(EMetaDataJpeg);
-    
-    metaDataUtil->OpenFileL(iUri->Des(), wantedFields);
-    
-    const CMetaDataFieldContainer& metaCont = 
-                                    metaDataUtil->MetaDataFieldsL();
-    TPtrC8 data = metaCont.Field8( EMetaDataJpeg );
-    if ( data.Length() > 0 )
-        {
-        WriteDataFieldL( aStream, data, KSconAudioJpeg );
-        }
-    
-    CleanupStack::PopAndDestroy(&wantedFields);
-    CleanupStack::PopAndDestroy(metaDataUtil);
-    
-    aStream.CommitL();
-    TRACE_FUNC_EXIT;
-    }
-
-
-void CSongItem::WriteUnicodeL( RWriteStream& aStream, const TDesC& aData, const TUint8 aFieldId )
-    {
-    aStream.WriteUint8L( aFieldId );
-    aStream.WriteUint32L( aData.Size() );
-    aStream.WriteL( aData, aData.Length() );
-    }
-
-void CSongItem::WriteDataFieldL( RWriteStream& aStream, const TDesC8& aData, const TUint8 aFieldId )
-    {
-    aStream.WriteUint8L( aFieldId );
-    aStream.WriteUint32L( aData.Size() );
-    aStream.WriteL( aData, aData.Length() );
-    }
-
-void CSongItem::WriteUInt16FieldL( RWriteStream& aStream, TUint16 aData, const TUint8 aFieldId )
-    {
-    aStream.WriteUint8L( aFieldId );
-    const TUint KSizeOfUint16 = 2; // =sizeof(TUint16), hardcoded for performance reasons.
-    aStream.WriteUint32L( KSizeOfUint16 );
-    aStream.WriteUint16L( aData );
-    }
-
-void CSongItem::WriteUInt32FieldL( RWriteStream& aStream, TUint32 aData, const TUint8 aFieldId )
-    {
-    aStream.WriteUint8L( aFieldId );
-    const TUint KSizeOfUint32 = 4; // =sizeof(TUint32), hardcoded for performance reasons.
-    aStream.WriteUint32L( KSizeOfUint32 );
-    aStream.WriteUint32L( aData );
-    }
Binary file omads/omadsextensions/adapters/mms/group/101FB0E9.XML has changed
--- a/omads/omadsextensions/adapters/mms/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -21,7 +21,8 @@
 DEFAULT
 
 PRJ_EXPORTS
-./101fb0e9.xml      Z:/private/101F99F6/capability/101fb0e9.xml
+./101FB0E9.XML      /epoc32/data/Z/private/101F99F6/capability/101FB0E9.XML
+./101FB0E9.XML      /epoc32/RELEASE/winscw/udeb/Z/private/101F99F6/capability/101FB0E9.XML
 ./mmsdsa_stub.sis   /epoc32/data/z/system/install/mmsdsa_stub.sis
 ../rom/mmsdsa.iby   CORE_APP_LAYER_IBY_EXPORT_PATH(mmsdsa.iby)
 
--- a/omads/omadsextensions/adapters/mms/group/createstub.bat	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-rem
-rem Copyright (c) 2010 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: Batch file for creating needed stub files.
-rem
-
-makesis -s mmsdsa_stub.pkg
\ No newline at end of file
--- a/omads/omadsextensions/adapters/mms/group/mmsdataprovider.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/group/mmsdataprovider.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* 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"
--- a/omads/omadsextensions/adapters/mms/group/mmsdsa_stub.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/group/mmsdsa_stub.pkg	Wed Sep 01 12:30:02 2010 +0100
@@ -17,7 +17,7 @@
 &EN
 
 ; Header
-#{"MMS DS Plugin"},(0x101FB0E9),1,35,0, TYPE=SA
+#{"MMS DS Plugin"},(0x101FB0E9),1,0,0, TYPE=SA
 
 ; Localised Vendor name
 %{"Nokia"}
Binary file omads/omadsextensions/adapters/mms/group/mmsdsa_stub.sis has changed
--- a/omads/omadsextensions/adapters/mms/inc/logger.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/inc/logger.h	Wed Sep 01 12:30:02 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005-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"
@@ -20,109 +20,74 @@
 #define __LOGGER_H__
 
 #ifdef _DEBUG
-    
-    // Define this to enable file logging
-    #define __FLOGGING__
+    #ifdef __WINS__
+        // File logging for WINS
+        #define __FLOGGING__
+    #else
+        // Logging with RDebug for target HW
+        #define __CLOGGING__
+        //#define __FLOGGING__ // enable to log file on target HW
+    #endif //__WINS__
     
     #include <f32file.h>
     #include <flogger.h>
     #include <e32std.h>
     #include <e32def.h>
-
-    NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow
-        {
-    public:
-        void Overflow(TDes16& /*aDes*/) {}
-        };
-    
-    NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow
-        {
-    public:
-        void Overflow(TDes8& /*aDes*/) {}
-        };
     
     _LIT(KLogDir,"MMS");
     _LIT(KLogFile,"MMSDataproviderLog.txt");
     _LIT( KLogFormat, "[MMSDS] %S");
     
-    _LIT(KTracePrefix16, "[MMSDS] ");
-    _LIT8(KTracePrefix8, "[MMSDS] ");
-    _LIT8(KFuncEntryFormat8, "%S : Begin");
-    _LIT8(KFuncExitFormat8, "%S : End");
-    _LIT8(KFuncFormat8, "><%S");
-    
-    const TInt KMaxLogLineLength = 512;
+    _LIT(KLogEnterFn, "%S : Begin");
+    _LIT(KLogLeaveFn, "%S : End");
     
     /**
-    * Old logging macros
+    * Old logging macros, for public use
     */
     #ifdef __FLOGGING__
         #define LOG( AAA )      RFileLogger::Write( KLogDir,KLogFile,EFileLoggingModeAppend,AAA )
     #else
         #define LOG( AAA )
     #endif
+    #define LOG2( text, par1 )       { FPrint( text, par1 ); }
     
     
-    // old function loggin macros
-    #define LOGGER_ENTERFN( name )      {TRACE_FUNC_ENTRY;}
-    #define LOGGER_LEAVEFN( name )      {TRACE_FUNC_EXIT;}
+    /**
+    * new logging macros, for public use
+    */
+    #define LOGGER_ENTERFN( name )      {_LIT( temp, name ); FPrint( KLogEnterFn, &temp );}
+    #define LOGGER_LEAVEFN( name )      {_LIT( temp, name ); FPrint( KLogLeaveFn, &temp );}
     
-    #define LOGGER_WRITE( text )             {_LIT( KTemp, text ); FPrint( KTemp );}
-    #define LOGGER_WRITE_1( text,par1 )      {_LIT( KTemp, text ); FPrint( KTemp, par1 );}
-    #define LOGGER_WRITE_2( text,par1,par2 ) {_LIT( KTemp, text ); FPrint( KTemp, par1, par2 );}
-    
-    // New function logging macros
-    #define TRACE_FUNC_ENTRY {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncEntryFormat8, &ptr8);}
-    #define TRACE_FUNC_EXIT {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncExitFormat8, &ptr8);}
-    #define TRACE_FUNC {TPtrC8 ptr8((TUint8*)__PRETTY_FUNCTION__); FPrint(KFuncFormat8, &ptr8);}
+    #define LOGGER_WRITE( text )                    {_LIT( KTemp, text ); FPrint( KTemp );}
+    #define LOGGER_WRITE_1( text,par1 )             {_LIT( KTemp, text ); FPrint( KTemp, par1 );}
+    #define LOGGER_MSG_EC( text,par1 )	                {_LIT( KTemp, text ); FPrint( KTemp, par1 );}
     
     
     // Declare the FPrint function
-    inline void FPrint( TRefByValue<const TDesC16> aFmt, ...)
+    inline void FPrint( TRefByValue<const TDesC> aFmt, ...)
         {
         VA_LIST list;
         VA_START(list,aFmt);
-    #if defined ( __FLOGGING__ )
+        #if defined ( __FLOGGING__ )
             RFileLogger::WriteFormat( KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list );
-    #endif
-        
-        TBuf16<KMaxLogLineLength> theFinalString;
-        theFinalString.Append(KTracePrefix16);
-        TOverflowTruncate16 overflow;
-        theFinalString.AppendFormatList(aFmt,list,&overflow);
-        RDebug::Print(theFinalString);
-        }
-    
-    inline void FPrint(TRefByValue<const TDesC8> aFmt, ...)
-        {
-        VA_LIST list;
-        VA_START(list, aFmt);
-    #ifdef __FLOGGING__
-        RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
-    #endif
-        TOverflowTruncate8 overflow;
-        TBuf8<KMaxLogLineLength> buf8;
-        buf8.Append(KTracePrefix8);
-        buf8.AppendFormatList(aFmt, list, &overflow);
-        TBuf16<KMaxLogLineLength> buf16(buf8.Length());
-        buf16.Copy(buf8);
-        TRefByValue<const TDesC> tmpFmt(_L("%S"));
-        RDebug::Print(tmpFmt, &buf16);
+        #endif
+        #if defined ( __CLOGGING__ )
+            const TInt KMaxLogData = 0x200;
+    	    TBuf< KMaxLogData > buf;
+    	    buf.FormatList( aFmt, list );
+    	    
+    	    RDebug::Print( KLogFormat, &buf );
+        #endif
         }
 #else // no _DEBUG defined
     
-    #define LOG( A )
+    #define LOG( AAA )
     
     #define LOGGER_ENTERFN( name )
     #define LOGGER_LEAVEFN( name )
     #define LOGGER_WRITE( text )
     #define LOGGER_WRITE_1( text,par1 )
-    #define LOGGER_WRITE_2( text,par1,par2 )
-    
-    #define TRACE_FUNC_ENTRY
-    #define TRACE_FUNC_EXIT 
-    #define TRACE_FUNC
-    
+    #define LOGGER_MSG_EC( text,par1 )
 
 #endif // _DEBUG
 
--- a/omads/omadsextensions/adapters/mms/inc/mmsdataprovider.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/inc/mmsdataprovider.h	Wed Sep 01 12:30:02 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005-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"
--- a/omads/omadsextensions/adapters/mms/inc/mmsdatastore.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/inc/mmsdatastore.h	Wed Sep 01 12:30:02 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005-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"
@@ -21,6 +21,7 @@
 #define __MMSDATASTORE_H__
 
 // INCLUDES
+#include <SmlDataProvider.h>
 #include "mmsdataproviderdefs.h" 
 #include "changefinder.h"
 
--- a/omads/omadsextensions/adapters/mms/inc/omadsfolderobject.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/inc/omadsfolderobject.h	Wed Sep 01 12:30:02 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005-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"
--- a/omads/omadsextensions/adapters/mms/rom/mmsdsa.iby	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/rom/mmsdsa.iby	Wed Sep 01 12:30:02 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -21,7 +21,7 @@
 
 ECOM_PLUGIN(mmsdataprovider.dll,mmsdataprovider.rsc)
 data=DATAZ_\RESOURCE_FILES_DIR\mmsdatastore.rsc         RESOURCE_FILES_DIR\mmsdatastore.rsc
-data=DATAZ_\private\101F99F6\capability\101fb0e9.xml    private\101F99F6\capability\101fb0e9.xml
+data=DATAZ_\private\101F99F6\capability\101FB0E9.XML    private\101F99F6\capability\101FB0E9.XML
 
 data=ZSYSTEM\install\mmsdsa_stub.sis             	    system\install\mmsdsa_stub.sis
 
--- a/omads/omadsextensions/adapters/mms/sis/backup_registration.xml	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<?xml version="1.0" standalone="yes"?> 
-<backup_registration>
-    <system_backup />
-    <restore requires_reboot = "no"/>
-</backup_registration> 
\ No newline at end of file
--- a/omads/omadsextensions/adapters/mms/sis/mms.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +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: PKG file for MMS DS adapter
-
-
-;*Unique (Non-Localised) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade ofa a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localised vendor name(s) correspodning to language(s).
-%{"Nokia"}
-
-;Language - standard language definitions
-&EN
-
-;package-header
-#{"MMS DS Plugin"},(0x101FB0E9),1,35,0,TYPE=SA, RU
-;
-
-
-; S60 v5.2
-[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
-
-
-"\epoc32\data\z\resource\mmsdatastore.rsc"             -"c:\resource\mmsdatastore.rsc"
-"\epoc32\data\z\resource\plugins\mmsdataprovider.rsc"  -"c:\resource\plugins\mmsdataprovider.rsc"
-"\epoc32\release\ARMV5\UREL\mmsdataprovider.dll"       -"c:\sys\bin\mmsdataprovider.dll"
-
-"\epoc32\data\Z\private\101F99F6\capability\101fb0e9.xml"   -"c:\private\101F99F6\import\101fb0e9.xml"
-"backup_registration.xml"                                   -"c:\private\10202D56\import\packages\101FB0E9\backup_registration.xml"
\ No newline at end of file
--- a/omads/omadsextensions/adapters/mms/sis/mms_debug.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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: PKG file for MMS DS adapter
-
-
-;*Unique (Non-Localised) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade ofa a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localised vendor name(s) correspodning to language(s).
-%{"Nokia"}
-
-;Language - standard language definitions
-&EN
-
-;package-header
-#{"MMS DS Plugin"},(0x101FB0E9),1,35,0,TYPE=SA, RU
-;
-
-; S60 v5.2
-[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
-
-"\epoc32\data\z\resource\mmsdatastore.rsc"             -"c:\resource\mmsdatastore.rsc"
-"\epoc32\data\z\resource\plugins\mmsdataprovider.rsc"  -"c:\resource\plugins\mmsdataprovider.rsc"
-"\epoc32\release\armv5\udeb\mmsdataprovider.dll"       -"c:\sys\bin\mmsdataprovider.dll"
-
-"\epoc32\data\Z\private\101F99F6\capability\101fb0e9.xml"   -"c:\private\101F99F6\import\101fb0e9.xml"
-"backup_registration.xml"                                   -"c:\private\10202D56\import\packages\101FB0E9\backup_registration.xml"
\ No newline at end of file
--- a/omads/omadsextensions/adapters/mms/src/mmsadaptermsvapi.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/src/mmsadaptermsvapi.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -46,7 +46,8 @@
 //
 CMmsAdapterMsvApi::~CMmsAdapterMsvApi()
     {
-    TRACE_FUNC;
+    LOGGER_ENTERFN( "CMmsAdapterMsvApi::~CMmsAdapterMsvApi" );
+    LOGGER_LEAVEFN( "CMmsAdapterMsvApi::~CMmsAdapterMsvApi" );
     }
        
 // -----------------------------------------------------------------------------
@@ -64,6 +65,8 @@
 //
 void CMmsAdapterMsvApi::ConstructL()
     {
+    LOGGER_ENTERFN( "CMmsAdapterMsvApi::ConstructL" );
+    LOGGER_LEAVEFN( "CMmsAdapterMsvApi::ConstructL" );
     }
 
 
@@ -73,7 +76,7 @@
 //
  TInt CMmsAdapterMsvApi::DeleteUserFolderL( TMsvId aUid )
     {
-    TRACE_FUNC_ENTRY;
+    LOGGER_ENTERFN( "MsvApi::DeleteUserFolderL" );
     
     CMsvEntry* entry = iSession.GetEntryL(aUid);
     CleanupStack::PushL(entry);
@@ -108,7 +111,7 @@
     entry->DeleteL( aUid );
     
     CleanupStack::PopAndDestroy( entry );
-    TRACE_FUNC_EXIT;
+    LOGGER_LEAVEFN( "MsvApi::DeleteUserFolderL" );
     return KErrNone;
     }   
     
@@ -236,8 +239,8 @@
 // -----------------------------------------------------------------------------        
 TInt CMmsAdapterMsvApi::AddUserFolderL( TMsvId& aFolder, const TDesC& aName )
     {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aName: %S", &aName );
+    LOGGER_ENTERFN( "CMmsAdapterMsvApi::AddUserFolderL" );
+    LOG(aName);
         
     // Make sure that we are not going to add same folder twise
     TBool found( EFalse );
@@ -273,7 +276,7 @@
     
     aFolder = folderEntry.Id();
     
-    TRACE_FUNC_EXIT;
+    LOGGER_LEAVEFN( "CMmsAdapterMsvApi::AddUserFolderL" );
     return KErrNone;
     }
     
@@ -283,8 +286,8 @@
 // -----------------------------------------------------------------------------    
 TInt CMmsAdapterMsvApi::UpdateUserFolderL( TMsvId aFolder, const TDesC& aName )
     {
-    TRACE_FUNC_ENTRY;
-    LOGGER_WRITE_1( "aName: %S", &aName );
+    LOGGER_ENTERFN( "CMmsAdapterMsvApi::UpdateUserFolderL" );
+    LOG( aName );
     
     CMsvEntry* entry = iSession.GetEntryL( aFolder );
     CleanupStack::PushL( entry );
@@ -295,7 +298,7 @@
         {
         CleanupStack::PopAndDestroy( entry );
         LOGGER_WRITE( "No message folder" );
-        TRACE_FUNC_EXIT;
+        LOGGER_LEAVEFN( "CMmsAdapterMsvApi::UpdateUserFolderL" );
         return KErrNotSupported;
         }
        
@@ -306,7 +309,7 @@
     
     CleanupStack::PopAndDestroy( entry );
     
-    TRACE_FUNC_EXIT;
+    LOGGER_LEAVEFN( "CMmsAdapterMsvApi::UpdateUserFolderL" );
     return KErrNone;
     } 
     
--- a/omads/omadsextensions/adapters/mms/src/mmsdataprovider.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/src/mmsdataprovider.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -284,7 +284,7 @@
     TRAPD( error, resourceFile.OpenL( iRFs, fileName ) );
     if ( error )
         {
-        LOGGER_WRITE_1( "RResourceFile::OpenL leaved with %d - try again", error );
+        LOGGER_MSG_EC( "RResourceFile::OpenL leaved with %d - try again", error );
         parse->Set( KMmsStoreFormatRsc, &KDC_RESOURCE_FILES_DIR, NULL );
         fileName = parse->FullName();
         BaflUtils::NearestLanguageFile( iRFs, fileName );
--- a/omads/omadsextensions/adapters/mms/src/mmsdatastore.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/src/mmsdatastore.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -16,9 +16,9 @@
 */
 
 
-#include <e32base.h>
-#include <msvstd.h>
-#include <msvapi.h>
+#include <e32base.h>      
+#include <msvstd.h>       
+#include <msvapi.h>       
 #include <msvids.h>
 #include <mtclreg.h> 
 #include <mmsconst.h>
@@ -182,7 +182,7 @@
     if ( iDataBaseOpened )
         {
         LOGGER_LEAVEFN( "CMmsDataStore::DoStoreName" );
-        LOGGER_WRITE_1( "Database name: %S", &KNSmlDefaultLocalDbName );
+        LOGGER_MSG_EC( "Database name: %S", &KNSmlDefaultLocalDbName );
         return KNSmlDefaultLocalDbName;
         }
 
@@ -309,7 +309,7 @@
         }
     else
         {
-        LOGGER_WRITE_1( "CRepository::NewL leaved with %d", error );
+        LOGGER_MSG_EC( "CRepository::NewL leaved with %d", error );
         }       
         
     LOGGER_LEAVEFN( "CMmsDataStore::DoMaxObjectSize" );
@@ -327,7 +327,7 @@
     {
     LOGGER_ENTERFN( "CMmsDataStore::DoOpenItemL" );
 
-    LOGGER_WRITE_1( "Opening item %d.", aUid );
+    LOGGER_MSG_EC( "Opening item %d.", aUid );
     
     // Store these for later use
     iCallerStatus = &aStatus;
@@ -336,7 +336,7 @@
     // Check that we're in a proper state
     if ( iCurrentState != EMmsOpenAndWaiting )
         {
-        LOGGER_WRITE_1( "CMmsDataStore::DoOpenItemL, invalid state %d.", iCurrentState );
+        LOGGER_MSG_EC( "CMmsDataStore::DoOpenItemL, invalid state %d.", iCurrentState );
         User::RequestComplete( iCallerStatus, KErrNotReady );
         return;
         }
@@ -373,7 +373,7 @@
         if ( error != KErrNone )
             {
             User::RequestComplete( iCallerStatus, KErrNotFound ); 
-            LOGGER_WRITE_1("iMsvSession->GetEntryL failed with %d.", error);
+            LOGGER_MSG_EC("iMsvSession->GetEntryL failed with %d.", error);
             return;
             }
         
@@ -406,7 +406,7 @@
             if ( error != KErrNone ) 
                 {
                 User::RequestComplete( iCallerStatus, error );
-                LOGGER_WRITE_1("iCodecClient->InitializeChunkedRetrievingL failed with %d.", error); 
+                LOGGER_MSG_EC("iCodecClient->InitializeChunkedRetrievingL failed with %d.", error); 
                 return;         
                 }
             
@@ -416,11 +416,10 @@
             if ( iMsvWait->iStatus != KErrNone )
                 {
                 User::RequestComplete( iCallerStatus, iMsvWait->iStatus.Int() );
-                LOGGER_WRITE_1( "iCodecClient->InitializeChunkedRetrievingL failed with %d",
+                LOGGER_MSG_EC( "iCodecClient->InitializeChunkedRetrievingL failed with %d",
                     iMsvWait->iStatus.Int() ); 
                 return;
-                }
-            LOGGER_WRITE_1("iUnread: %d", (TInt)iUnread);
+                }   
             aSize++; // Status byte will be added also, reserve one additional byte for that.
             iCurrentState = EMmsItemOpen;
             }
@@ -482,7 +481,7 @@
     const TDesC8& aMimeType, const TDesC8& /*aMimeVer*/, TRequestStatus& aStatus )
     {
     LOGGER_ENTERFN( "CMmsDataStore::DoCreateItemL" );
-    LOGGER_WRITE_1( "Parent folder: %d.", aParent );
+    LOGGER_MSG_EC( "Parent folder: %d.", aParent );
     
     // Store some variables for further use
     iCallerStatus = &aStatus;
@@ -491,7 +490,7 @@
     // Ensure that we're in proper state
     if ( iCurrentState != EMmsOpenAndWaiting )
         {
-        LOGGER_WRITE_1( "Invalid state %d.", iCurrentState );
+        LOGGER_MSG_EC( "Invalid state %d.", iCurrentState );
         }
         
     TBool createFolder( EFalse );
@@ -563,8 +562,8 @@
     TBool /*aFieldChange*/, TRequestStatus& aStatus )
     {
     LOGGER_ENTERFN("CMmsDataStore::DoReplaceItemL");
-    LOGGER_WRITE_1("Replacing item %d.", aUid);
-    LOGGER_WRITE_1("Parent folder: %d.", aParent);
+    LOGGER_MSG_EC("Replacing item %d.", aUid);
+    LOGGER_MSG_EC("Parent folder: %d.", aParent);
     
     // Store some variables for further use
     iCallerStatus = &aStatus;
@@ -573,7 +572,7 @@
     // Ensure proper state
     if ( iCurrentState != EMmsOpenAndWaiting )
         {
-        LOGGER_WRITE_1("Invalid state %d.", iCurrentState);
+        LOGGER_MSG_EC("Invalid state %d.", iCurrentState);
         }
 
     // Ensure that we've got enough disk space for the item
@@ -590,7 +589,7 @@
     if ( err != KErrNone )
         {
         User::RequestComplete( iCallerStatus, KErrNotFound );
-        LOGGER_WRITE_1("CMsvSession::GetEntryL failed with %d.", err)
+        LOGGER_MSG_EC("CMsvSession::GetEntryL failed with %d.", err)
         return;
         }
 
@@ -610,7 +609,7 @@
         || ( aParent != tEntry.Parent() ) ) )
         {
         User::RequestComplete( iCallerStatus, KErrNotSupported );
-        LOGGER_WRITE_1("Bad parent folder, message entry parent is %d", tEntry.Parent());
+        LOGGER_MSG_EC("Bad parent folder, message entry parent is %d", tEntry.Parent());
         return;    
         }           
     
@@ -685,7 +684,6 @@
         if ( iReadCounter++ == 0 )
             {
             TUint8 status = ResolveStatusBits( iUnread );
-            LOGGER_WRITE_1("WriteStatusBits: %d", status);
             aBuffer.Append( &status, 1 );
             }
         else
@@ -700,7 +698,6 @@
         if ( iReadCounter++ == 0 )
             {
             TUint8 status = ResolveStatusBits( iUnread );
-            LOGGER_WRITE_1("WriteStatusBits: %d", status);
             aBuffer.Append( &status, 1 );
             iReadPosition = 0;
             iLastDataChunk = EFalse;
@@ -720,7 +717,7 @@
     
     else
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoReadItemL: bad state %d", iCurrentState);
+        LOGGER_MSG_EC("CMmsDataStore::DoReadItemL: bad state %d", iCurrentState);
         User::Leave( KErrNotReady );
         }   
 
@@ -734,10 +731,10 @@
 void CMmsDataStore::DoWriteItemL( const TDesC8& aData )
     {
     LOGGER_ENTERFN("CMmsDataStore::DoWriteItemL");
-    LOGGER_WRITE_1("%d",iWriteCounter);
+    LOGGER_MSG_EC("%d",iWriteCounter);
     
     TInt dataLength = aData.Length();
-    LOGGER_WRITE_1("Data length: %d", dataLength);
+    LOGGER_MSG_EC("Data length: %d", dataLength);
     
     if ( !( dataLength > 0 ) ) // Should never happen...
         {
@@ -794,7 +791,7 @@
             else // just status update
                 {
                 UpdateMmsStatusL( iCurrentId, iUnread );
-                LOGGER_WRITE_1("Message status updated, iUnread: %d", iUnread);
+                LOGGER_MSG_EC("Message status updated: %d", iUnread);
                 }    
             }
         else
@@ -807,13 +804,13 @@
         
     else
         {
-        LOGGER_WRITE_1("Wrong state %d", iCurrentState);
+        LOGGER_MSG_EC("Wrong state %d", iCurrentState);
         User::Leave( KErrNotReady );
         }
         
     if ( error != KErrNone )
         {
-        LOGGER_WRITE_1("iCodecClient->NextDataPart() failed with %d", error);
+        LOGGER_MSG_EC("iCodecClient->NextDataPart() failed with %d", error);
         User::Leave( error );
         }  
 
@@ -840,7 +837,7 @@
         if ( error != KErrNone )
             {
             User::RequestComplete( iCallerStatus, error );
-            LOGGER_WRITE_1("ImportFolderXml failed with %d", error);
+            LOGGER_MSG_EC("ImportFolderXml failed with %d", error);
             return;
             }
          
@@ -863,7 +860,7 @@
                 }
             else
                 {
-                LOGGER_WRITE_1("iMsvApi->AddFolderL failed with %d", error);
+                LOGGER_MSG_EC("iMsvApi->AddFolderL failed with %d", error);
                 }    
             }
          else
@@ -871,7 +868,7 @@
             error = iMsvApi->UpdateUserFolderL( iCurrentId, name );
             if ( error != KErrNone )
                 {
-                LOGGER_WRITE_1("iMsvApi->UpdateFolderL failed with %d", error);
+                LOGGER_MSG_EC("iMsvApi->UpdateFolderL failed with %d", error);
                 }
             }
         }
@@ -911,7 +908,7 @@
     else
         {
         User::RequestComplete( iCallerStatus, KErrNotSupported );
-        LOGGER_WRITE_1("Bad state: %d", iCurrentState);
+        LOGGER_MSG_EC("Bad state: %d", iCurrentState);
         return;
         }
     
@@ -946,7 +943,7 @@
             }
         else
             {
-            LOGGER_WRITE_1( "CMsvSession::GetEntry failed with %d", error );
+            LOGGER_MSG_EC( "CMsvSession::GetEntry failed with %d", error );
             }
         }
     
@@ -992,7 +989,7 @@
         }
     else 
         {
-        LOGGER_WRITE_1("Invalid state %d.", iCurrentState);
+        LOGGER_MSG_EC("Invalid state %d.", iCurrentState);
         }
     
     LOGGER_LEAVEFN("CMmsDataStore::DoCloseItem");
@@ -1007,7 +1004,7 @@
     {
     LOGGER_ENTERFN("CMmsDataStore::DoMoveItemL");
     
-    LOGGER_WRITE_1("Moving item %d.", aUid);
+    LOGGER_MSG_EC("Moving item %d.", aUid);
     
     // Store some variables for further use
     iCallerStatus = &aStatus;
@@ -1016,7 +1013,7 @@
     // Check that we're in proper state
     if ( iCurrentState != EMmsOpenAndWaiting ) 
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoMoveItemL, invalid state %d.", iCurrentState);
+        LOGGER_MSG_EC("CMmsDataStore::DoMoveItemL, invalid state %d.", iCurrentState);
         }
 
     // Ensure that we have this item in the message store   
@@ -1051,7 +1048,7 @@
 void CMmsDataStore::DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus  )
     {
     LOGGER_ENTERFN("CMmsDataStore::DoDeleteItemL");
-    LOGGER_WRITE_1("Deleting item %d.", aUid);
+    LOGGER_MSG_EC("Deleting item %d.", aUid);
     
     // Store some variables for further use
     iCallerStatus = &aStatus;
@@ -1062,7 +1059,7 @@
     // Check that we're in proper state
     if ( iCurrentState != EMmsOpenAndWaiting ) 
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoDeleteItemL, invalid state %d.", iCurrentState);        
+        LOGGER_MSG_EC("CMmsDataStore::DoDeleteItemL, invalid state %d.", iCurrentState);        
         }
         
     // Check if this is a user folder
@@ -1073,7 +1070,7 @@
         if ( error != KErrNone )
             {
             User::RequestComplete( iCallerStatus, error );    
-            LOGGER_WRITE_1("Deleting MMS messages in folder failed with %d", error); 
+            LOGGER_MSG_EC("Deleting MMS messages in folder failed with %d", error); 
             return;
             }
         error = iMsvApi->DeleteUserFolderL(aUid);  
@@ -1081,7 +1078,7 @@
             {
             // Note: folder is not deleted if contains other message items (like MMS)
             // In this case DeleteUserFolderL returns KErrInUse.    
-            LOGGER_WRITE_1("Deleting folder failed with %d", error); 
+            LOGGER_MSG_EC("Deleting folder failed with %d", error); 
             }       
         }
     else if ( MmsItemExists( aUid ) )
@@ -1091,7 +1088,7 @@
         if ( error != KErrNone )
             {
             User::RequestComplete( iCallerStatus, error );    
-            LOGGER_WRITE_1("CMmsCodecClient::DeleteMM failed with %d", error);   
+            LOGGER_MSG_EC("CMmsCodecClient::DeleteMM failed with %d", error);   
             return;
             }
         // Inform ChangeFinder of the removed item
@@ -1100,7 +1097,7 @@
     else
         {
         User::RequestComplete( iCallerStatus, KErrNotFound ); 
-        LOGGER_WRITE_1("Item %d is not folder or MMS message", aUid);
+        LOGGER_MSG_EC("Item %d is not folder or MMS message", aUid);
         return;
         }
     
@@ -1143,7 +1140,7 @@
    // Check that we're in proper state
     if ( iCurrentState != EMmsOpenAndWaiting ) 
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoDeleteAllItemsL, invalid state %d.", iCurrentState);
+        LOGGER_MSG_EC("CMmsDataStore::DoDeleteAllItemsL, invalid state %d.", iCurrentState);
         }
         
     TInt error(KErrNone);
@@ -1188,7 +1185,7 @@
 TInt CMmsDataStore::DeleteAllMessagesInFolderL( TMsvId aId )
     {
     LOGGER_ENTERFN("CMmsDataStore::DeleteAllMessagesInFolderL");
-    LOGGER_WRITE_1("Folder: %d", aId);
+    LOGGER_MSG_EC("Folder: %d", aId);
     
     TInt error(KErrNone);
     
@@ -1209,12 +1206,12 @@
     for ( TInt index=0; index < messages->Count(); index++ )
         {
         id = messages->At( index );
-        LOGGER_WRITE_1("Message item %d:", id);
+        LOGGER_MSG_EC("Message item %d:", id);
         
         error = iMsvSession->GetEntry( id, service, msg );
         if ( error != KErrNone )
             {
-            LOGGER_WRITE_1("GetEntry failed with %d", error);
+            LOGGER_MSG_EC("GetEntry failed with %d", error);
             break;
             }
         
@@ -1223,7 +1220,7 @@
             error = iCodecClient->DeleteMM( id );
             if ( error != KErrNone )
                 {
-                LOGGER_WRITE_1("DeleteMM failed with %d", error);
+                LOGGER_MSG_EC("DeleteMM failed with %d", error);
                 break;
                 }
             // Update Change Finder
@@ -1265,23 +1262,22 @@
     // Ensure that we're in a proper state
     if ( iCurrentState != EMmsOpenAndWaiting )
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoAddedItems, invalid state %d.", iCurrentState);
+        LOGGER_MSG_EC("CMmsDataStore::DoAddedItems, invalid state %d.", iCurrentState);
         }
     
     TInt error(KErrNone);
 
     // Clear new-items array
     iNewItems->Reset();
-
-    // Set current snapshot, this will be compared against the old one      
+  
     // Search for new items
     TRAP( error, iChangeFinder->FindNewItemsL(*iNewItems) )
     if ( error != KErrNone )
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoAddedItems, iChangeFinder->FindNewItemsL leaved with %d.", error);
+        LOGGER_MSG_EC("CMmsDataStore::DoAddedItems, iChangeFinder->FindNewItemsL leaved with %d.", error);
         }
     
-    LOGGER_WRITE_1("New item count: %d.", iNewItems->ItemCount());
+    LOGGER_MSG_EC("New item count: %d.", iNewItems->ItemCount());
     LOGGER_LEAVEFN("CMmsDataStore::DoAddedItems");      
     
     return *iNewItems;
@@ -1298,7 +1294,7 @@
     // Ensure that we're in a proper state
     if ( iCurrentState != EMmsOpenAndWaiting )
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoDeletedItems, invalid state %d.", iCurrentState);
+        LOGGER_MSG_EC("CMmsDataStore::DoDeletedItems, invalid state %d.", iCurrentState);
         }
     
     TInt error(KErrNone);
@@ -1310,10 +1306,10 @@
     TRAP( error, iChangeFinder->FindDeletedItemsL( *iDeletedItems ) );
     if ( error != KErrNone )
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoDeletedItems, iChangeFinder->FindDeletedItemsL leaved with %d.", error);
+        LOGGER_MSG_EC("CMmsDataStore::DoDeletedItems, iChangeFinder->FindDeletedItemsL leaved with %d.", error);
         }           
     
-    LOGGER_WRITE_1("Deleted item count: %d.", iDeletedItems->ItemCount());
+    LOGGER_MSG_EC("Deleted item count: %d.", iDeletedItems->ItemCount());
     LOGGER_LEAVEFN("CMmsDataStore::DoDeletedItemsL");
     return *iDeletedItems;
     }
@@ -1342,7 +1338,7 @@
     // Ensure that we're in a proper state
     if ( iCurrentState != EMmsOpenAndWaiting )
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoModifiedItems, invalid state %d.", iCurrentState);
+        LOGGER_MSG_EC("CMmsDataStore::DoModifiedItems, invalid state %d.", iCurrentState);
         }
     
     TInt error(KErrNone);
@@ -1354,10 +1350,10 @@
     TRAP( error, iChangeFinder->FindChangedItemsL( *iUpdatedItems ) )
     if ( error != KErrNone )
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoModifiedItems, iChangeFinder->FindChangedItemsL leaved with %d.", error);
+        LOGGER_MSG_EC("CMmsDataStore::DoModifiedItems, iChangeFinder->FindChangedItemsL leaved with %d.", error);
         }
     
-    LOGGER_WRITE_1("Modified item count: %d.", iUpdatedItems->ItemCount());
+    LOGGER_MSG_EC("Modified item count: %d.", iUpdatedItems->ItemCount());
     LOGGER_LEAVEFN("CMmsDataStore::DoModifiedItems");       
     return *iUpdatedItems;
     }
@@ -1373,7 +1369,7 @@
     // Ensure that we're in a proper state
     if ( iCurrentState != EMmsOpenAndWaiting )
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoMovedItems, invalid state %d.", iCurrentState);
+        LOGGER_MSG_EC("CMmsDataStore::DoMovedItems, invalid state %d.", iCurrentState);
         }
     
     TInt error(KErrNone);
@@ -1385,10 +1381,10 @@
     TRAP( error, iChangeFinder->FindMovedItemsL( *iMovedItems ) );
     if ( error != KErrNone )
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoMovedItems, iChangeFinder->FindMovedItemsL leaved with %d.", error);
+        LOGGER_MSG_EC("CMmsDataStore::DoMovedItems, iChangeFinder->FindMovedItemsL leaved with %d.", error);
         }
     
-    LOGGER_WRITE_1("Moved item count: %d.", iMovedItems->ItemCount());
+    LOGGER_MSG_EC("Moved item count: %d.", iMovedItems->ItemCount());
     LOGGER_LEAVEFN("CMmsDataStore::DoMovedItems");
     return *iMovedItems;    
     }
@@ -1408,7 +1404,7 @@
     // Check that we're in proper state
     if ( iCurrentState != EMmsOpenAndWaiting ) 
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoResetChangeInfoL, invalid state %d.", iCurrentState);
+        LOGGER_MSG_EC("CMmsDataStore::DoResetChangeInfoL, invalid state %d.", iCurrentState);
         }   
             
     // Reset change info in ChangeFinder
@@ -1436,7 +1432,7 @@
     // Ensure that we're in a proper state
     if ( iCurrentState != EMmsOpenAndWaiting ) 
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoCommitChangeInfoL, invalid state %d.", iCurrentState);
+        LOGGER_MSG_EC("CMmsDataStore::DoCommitChangeInfoL, invalid state %d.", iCurrentState);
         }
 
     // Notify ChangeFinder
@@ -1465,7 +1461,7 @@
     // Ensure that we're in a proper state
     if ( iCurrentState != EMmsOpenAndWaiting ) 
         {
-        LOGGER_WRITE_1("CMmsDataStore::DoCommitChangeInfoL, invalid state %d.", iCurrentState);
+        LOGGER_MSG_EC("CMmsDataStore::DoCommitChangeInfoL, invalid state %d.", iCurrentState);
         }
     
     // Notify ChangeFinder
@@ -1629,12 +1625,12 @@
             error = iCodecClient->GetNextDataPart( iReadDataChunk, iLastDataChunk );
             if ( error != KErrNone )
                 {
-                LOGGER_WRITE_1("iCodecClient->GetNextDataPart failed with %d", error);
+                LOGGER_MSG_EC("iCodecClient->GetNextDataPart failed with %d", error);
                 return error;
                 }
             else
                 {
-                LOGGER_WRITE_1("iCodecClient->GetNextDataPart succeeded, length %d", iReadDataChunk.Length());
+                LOGGER_MSG_EC("iCodecClient->GetNextDataPart succeeded, length %d", iReadDataChunk.Length());
                 }   
             }   
         }
@@ -1761,7 +1757,7 @@
             error = DeleteAllMessagesInFolderL(folderId);
             if ( error != KErrNone )
                 {
-                LOGGER_WRITE_1("Deleting messages in folder failed with %d", error); 
+                LOGGER_MSG_EC("Deleting messages in folder failed with %d", error); 
                 result = error;
                 }
             error = iMsvApi->DeleteUserFolderL( folderId );
@@ -1769,7 +1765,7 @@
                 {
                 // Note: folder is not deleted if contains other message items (like MMS)
                 // In this case DeleteUserFolderL returns KErrInUse.
-                LOGGER_WRITE_1("iMsvApi->DeleteUserFolderL failed with %d", error);
+                LOGGER_MSG_EC("iMsvApi->DeleteUserFolderL failed with %d", error);
                 result = error;
                 }
             }
--- a/omads/omadsextensions/adapters/mms/src/omadsfolderobject.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/mms/src/omadsfolderobject.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -256,16 +256,16 @@
         
         if ( error > 0 )
             {
-            LOGGER_WRITE_1("Too long name, number of uncorverted bytes: %d", error);
+            LOGGER_MSG_EC("Too long name, number of uncorverted bytes: %d", error);
             }
         else if ( error != KErrNone )
             {
-            LOGGER_WRITE_1("ConvertToUnicodeFromUtf8 failed with %d", error);
+            LOGGER_MSG_EC("ConvertToUnicodeFromUtf8 failed with %d", error);
             iError = error;
             }
         else if ( length > iName.MaxLength() )
             {
-            LOGGER_WRITE_1("Too long name total: %d", length);
+            LOGGER_MSG_EC("Too long name total: %d", length);
             }
         else
             {
--- a/omads/omadsextensions/adapters/notes/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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:  build info file for Notepad DS adapter
-*
-*/
-
-#include <platform_paths.hrh>
-PRJ_EXPORTS
-../loc/101F85F8.loc		APP_LAYER_LOC_EXPORT_PATH(101F85F8.loc)
-
-PRJ_MMPFILES
-nsmldsnotepaddataprovider.mmp
-
-
-
-
--- a/omads/omadsextensions/adapters/notes/group/def/bwinscwnotepaddataprovideru.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
-
--- a/omads/omadsextensions/adapters/notes/group/def/eabinotepaddataprovideru.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-EXPORTS
-	_Z24ImplementationGroupProxyRi @ 1 NONAME
-	_ZTI20CNSmlNotepadDatabase @ 2 NONAME
-	_ZTI21CNSmlNotepadDataStore @ 3 NONAME
-	_ZTI24CNSmlNotepadDataProvider @ 4 NONAME
-	_ZTI8CNpdItem @ 5 NONAME
-	_ZTV20CNSmlNotepadDatabase @ 6 NONAME
-	_ZTV21CNSmlNotepadDataStore @ 7 NONAME
-	_ZTV24CNSmlNotepadDataProvider @ 8 NONAME
-	_ZTV8CNpdItem @ 9 NONAME
-
--- a/omads/omadsextensions/adapters/notes/group/nsmldsnotepaddataprovider.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +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:  mmp file for Notepad DS adapter
-*
-*/
-
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-CAPABILITY CAP_ECOM_PLUGIN
-
-TARGET          nsmlnotepaddataprovider.dll
-TARGETPATH		PLUGINS_1_DIR
-TARGETTYPE      PLUGIN
-UID             0x10009D8D 0x101F8612
-VENDORID		VID_DEFAULT
-
-#if defined(EABI)
-DEFFILE		./def/eabinotepaddataprovider
-#elif defined(WINSCW)
-DEFFILE		./def/bwinscwnotepaddataprovider
-#endif
-
-//MACRO _DEBUG_
-
-SOURCEPATH      ../src
-SOURCE          NSmlNotepadDataProvider.cpp
-SOURCE          NSmlNotepadDataStore.cpp
-SOURCE			nsmlnotepadDatabase.cpp
-
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE 	/epoc32/include/ecom
-SYSTEMINCLUDE 	/epoc32/include/syncml
-
-MW_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE     ../inc 
-
-START RESOURCE nsmlnotepaddataprovider.rss
-HEADER
-TARGET 		nsmlnotepaddataprovider.rsc       
-TARGETPATH	ECOM_RESOURCE_DIR
-END 
-
-START RESOURCE NSmlNotepadDataStoreFormat.rss
-HEADER
-TARGET 		nsmlnotepaddatastoreformat.rsc       
-TARGETPATH  RESOURCE_FILES_DIR 
-END 
-
-
-LIBRARY		ecom.lib bafl.lib euser.lib efsrv.lib estor.lib sysutil.lib
-LIBRARY		nsmlchangefinder.lib etext.lib wbxmllib.lib
-LIBRARY		smlstoreformat.lib smldataprovider.lib
-LIBRARY		nsmldshostclient.lib
-LIBRARY		calinterimapi.lib caleninterimutils2.lib
-LIBRARY		nsmldebug.lib
-
--- a/omads/omadsextensions/adapters/notes/inc/NSmlNotepadDataProvider.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +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:  DS notepad dataprovider.
-*
-*/
-
-
-#ifndef __NSMLNOTEPADDATAPROVIDER_H__
-#define __NSMLNOTEPADDATAPROVIDER_H__
-
-
-//FORWARD DECLARATION
-class CNSmlNotepadDataStore;
-
-
-// CLASS DECLARATION
-
-// ------------------------------------------------------------------------------------------------
-//  CNSmlNotepadDataProvider
-//
-//  @lib nsmlnotepaddataprovider.lib
-// ------------------------------------------------------------------------------------------------
-class CNSmlNotepadDataProvider : public CSmlDataProvider 
-	{
-	public:
-		/**
-		* Two-phased constructor.
-		*/
-		static CNSmlNotepadDataProvider* NewL();
-
-		/**
-		* Destructor.
-		*/
-		virtual ~CNSmlNotepadDataProvider();
-
-	private:
-		/**
-		* Two-phased constructor.
-		*/
-		static CNSmlNotepadDataProvider* NewLC();
-		
-		/**
-		* C++ constructor.
-		*/
-		CNSmlNotepadDataProvider();
-
-		/**
-		* 2nd phase constructor.
-		*/
-		void ConstructL();
-
-		/**
-		* This method handles framework events.
-		* @param					Frameworks event.
-		* @param	aParam1			First parameter.
-		* @param	aParam2			Second parameter.
-		*/
-		void DoOnFrameworkEvent(TSmlFrameworkEvent, 
-								TInt aParam1, 
-								TInt aParam2);
-
-		/**
-		* Check if operation is supported by dataprovider.
-		* @param	aOpId			Operations type.
-		* @return	ETrue if the operation is supported.
-		*/
-		TBool DoSupportsOperation(TUid aOpId) const;
-
-		/**
-		* Gets dataproviders own StoreFormat.
-		*/
-		const CSmlDataStoreFormat& DoStoreFormatL();
-
-		/**
-		* Lists all notepad databases on client.
-		* @return List of notepad databases.
-		*/
-		CDesCArray* DoListStoresLC();
-
-		/**
-		* Gets default storename on client.
-		* @return Default storename.
-		*/
-		const TDesC& DoDefaultStoreL();
-
-		/**
-		* Constructs new instance of datastore.
-		* @return Newly created instance.
-		*/
-		CSmlDataStore* DoNewStoreInstanceLC();
-
-		/**
-		This method returns the set of filters that can be used to send to the SyncML server.
-		* @return New filters.
-		*/
-		const RPointerArray<CSyncMLFilter>& DoSupportedServerFiltersL();
-		
-		/**
-		This method checks what filters are supported by server.
-		@param	aServerDataStoreFormat	The store format of server
-		@param	aFilters				The array that includes filters
-		@param	aChangeInfo				The change information about changes that data provider did
-		*/
-		void DoCheckSupportedServerFiltersL(const CSmlDataStoreFormat& aServerDataStoreFormat, 
-											RPointerArray<CSyncMLFilter>& aFilters, 
-											TSyncMLFilterChangeInfo& aChangeInfo);
-		
-		/**
-		This method updates dynamic filters up-to-date.
-		@param	aFilters				The array that includes filters
-		@param	aChangeInfo				The change information about changes that data provider did
-		*/
-		void DoCheckServerFiltersL(RPointerArray<CSyncMLFilter>& aFilters, 
-									TSyncMLFilterChangeInfo& aChangeInfo);
-		
-		/**
-		This method generates a record filter query to be sent to the SyncML server for the provided filters.
-		@param	aFilters			The filters to be used for the query generation
-		@param	aMatch				The filter match type to be used
-		@param	aFilterMimeType		The mime type of the returned filter query
-		@param	TSyncMLFilterType 	The filter type of the returned filter query
-		@param	aStoreName			The name of used store
-		@return						The record filter query to be sent to the SyncML server - empty if no record filter involved
-									for this specific filter
-		*/
-		HBufC* DoGenerateRecordFilterQueryLC(const RPointerArray<CSyncMLFilter>& aFilters, 
-												TSyncMLFilterMatchType aMatch, 
-												TDes& aFilterMimeType, 
-												TSyncMLFilterType& aFilterType, 
-												TDesC& aStoreName);
-		
-		/**
-		This method generates a field filter query to be sent to the SyncML server for the provided filters.
-		@param	aFilters		The filters to be used for the query generation
-		@param	aFilterMimeType		The mime type of the returned filter query
-		@param	aProperties		The field filter query to be sent to the SyncML server - empty if no field filter involved
-								for this specific filter
-		@param  aStoreName		The name of used store
-		*/
-		void DoGenerateFieldFilterQueryL(const RPointerArray<CSyncMLFilter>& aFilters, 
-										TDes& aFilterMimeType, 
-										RPointerArray<CSmlDataProperty>& aProperties, 
-										TDesC& aStoreName);
-
-		
-
-	private: // data
-		CNSmlNotepadDataStore* iNotepadDataStore; 
-		RPointerArray<CSyncMLFilter> iFilterArray;
-		RFs iRfs;
-		RStringPool iStringPool;
-		CSmlDataStoreFormat* iStoreFormat;
-
-	
-	};
-	
-#endif // __NSMLNOTEPADDATAPROVIDER_H__
-
-// End of File  
--- a/omads/omadsextensions/adapters/notes/inc/NSmlNotepadDatastore.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,456 +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:  DS notepad datastore.
-*
-*/
-
-
-#ifndef __NSMLNOTEPADDATASTORE_H__
-#define __NSMLNOTEPADDATASTORE_H__
-
-//CONSTANTS
-const TInt KNSmlCompactAfterChanges = 16;
-const TInt KNSmlDataStoreMaxSize = 102400;		// 100 k
-const TInt KNSmlDefaultStoreNameMaxSize = 256;
-const TInt KNSmlItemDataExpandSize = 1024;
-const TInt KUTF8Lenght = 4;
-const TInt KNullCharLen = 1;
-const TInt KUnicodeSize = 2;
-const TInt KSnapshotGranularity = 8;
-
-
-_LIT(KNSmlNotepadStoreFormatRsc,"NSmlNotepadDataStoreFormat.rsc");
-_LIT(KNSmlNotepadStoreName, "C:Note" );
-_LIT(KNSmlNotepadDefaultStoreName, "C:Calendar" );
-_LIT(  KNSmlDriveC, "C" );
-_LIT8( KMimePlainText, "text/plain" );
-_LIT8( KMimePlainTextVersion, "1.0" );
-
-// FORWARD DECLARATIONS
-class CNSmlChangeFinder;
-class CNSmlNotepadDatabase;
-class CNpdItem;
-class CNSmlDataItemUidSet;
-class TNSmlSnapshotItem;
-
-// CLASS DECLARATION
-
-// ------------------------------------------------------------------------------------------------
-// CNSmlNotepadDataStore
-//
-// @lib nsmlnotepaddataprovider.lib
-// ------------------------------------------------------------------------------------------------
-class CNSmlNotepadDataStore : public CSmlDataStore
-	{
-	public:	
-		/**
-		* Two-phased constructor.
-		*/
-		static CNSmlNotepadDataStore* NewL();
-
-		/**
-		* Destructor.
-		*/
-		virtual ~CNSmlNotepadDataStore();
-	
-	private:
-	
-		/**
-		* Default constructor.
-		*/
-		CNSmlNotepadDataStore();
-		
-		/**
-		* 2nd phase constructor.
-		*/
-		void ConstructL();
-	
-	
-		
-	public:
-		/**
-		* Default store name of client.
-		* @return Default store name.
-		*/
-		const TDesC& DefaultStoreNameL() const;
-
-		/**
-		* Gets a list of all notepad databases on client.
-		* @return List of databases.
-		*/
-		CDesCArray* DoListStoresLC();
-
-	
-		/**
-		* DoOpenL() opens the data store specified by aStoreName asynchronously.
-		* @param		aStoreName			The name of the data store to open.
-		* @param		aContext			Identifies the specific synchronisation relationship to use for the synchronisation.
-		* @param		aStatus				On completion of the open, contains the result code.
-		*/
-
-		void DoOpenL(const TDesC& aStoreName, MSmlSyncRelationship& aContext, TRequestStatus& aStatus);
-
-		/**
-		* DoCancelRequest() cancels the current asynchronous request, including open. Only one asynchronous request may be outstanding at any one time.
-		*/
-		void DoCancelRequest();
-
-		/**
-		* DoStoreName() returns the name of the open data store.
-		* @return The name of the currently opened data store.
-		*/
-		const TDesC& DoStoreName() const;
-
-		/**
-		* DoBeginTransactionL() starts the transaction mode. During this mode calls to CreateItemL, ReplaceItemL,
-		* WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this transaction.
-		* Their RequestStatus must be completed, even if the change is not yet really executed in the Data Store.
-		* If a RequestStatus is completed with an error code, the transaction has failed and a rollback must be
-		* done. In this case RevertTransaction will be called.
-		*/
-		void DoBeginTransactionL();
-
-		/**
-		* DoCommitTransactionL() will be called at the end of a successful transaction. At this point in time the
-		* operations within the transaction are applied to the Data Store in an atomic way. If all operations
-		* succeed, the RequestStatus must be completed with KErrNone. If an operation fails, a rollback must be
-		* done and the RequestStatus must be completed with an appropriate error code.
-		*/
-		void DoCommitTransactionL(TRequestStatus& aStatus);
-
-		/**
-		* DoRevertTransaction() will be called to abort an ongoing transaction. None of the operations already
-		* submitted may be applied to the Data Store. The RequestStatus must be completed with KErrNone as a revert
-		* cannot fail.
-		*/
-		void DoRevertTransaction(TRequestStatus& aStatus);
-
-		/**
-		* DoBeginBatchL() starts the batch mode. During this mode calls to CreateItemL, ReplaceItemL,
-		* WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this batch.
-		* Their RequestStatus must be completed with KErrNone, which only signals acceptance of the operation
-		* for batch processing.
-		*/
-		void DoBeginBatchL();
-
-		/**
-		* DoCommitBatchL() will be called at the end of the batch mode. This tells the Data Store to
-		* process the batched operations (in the order they were submitted), and to append the error code
-		* for each operation to aResultArray.
-		* The error codes in aResultArray are only valid if the RequestStatus is completed with KErrNone.
-		* If the RequestStatus is completed with an error code none of the operations in the batch mode
-		* were applied to the Data Store.
-		*/
-		void DoCommitBatchL(RArray<TInt>& aResultArray, 
-							TRequestStatus& aStatus);
-
-		/**
-		* DoCancelBatch() will be called to abort an ongoing batch mode. None of the operations already
-		* submitted may be applied to the Data Store.
-		*/
-		void DoCancelBatch();
-
-		/**
-		* DoSetRemoteStoreFormatL() sets the SyncML server Data Format - this may optionally be used by the Data 
-		* Provider to filter out properties that the server does not support, and should be used to avoid deleting 
-		* these properties in case the server sends a changed item to the Data Provider
-		*/
-		void DoSetRemoteStoreFormatL(const CSmlDataStoreFormat& aServerDataStoreFormat);
-
-		/**
-		* DoSetRemoteMaxObjectSize() sets the SyncML server maximum object size - this may optionally be used by the 
-		* Data Provider to not send items to the server exceeding its maximum size. 0 means there is no limit.
-		*/
-		void DoSetRemoteMaxObjectSize(TInt aServerMaxObjectSize);
-
-		/**
-		* DoMaxObjectSize() gets the Data Store maximum object size which is reported to the SyncML server. 0 means 
-		* there is no limit.
-		* @return The maximum object size.
-		*/
-		TInt DoMaxObjectSize() const;
-
-		/**
-		* DoOpenItemL() opens the data item specified by aUid asynchronously for reading.
-		* @param		aUid				Item UID which going to be read.
-		* @param		aFieldChange		Accept field changes.
-		* @param		aParent				Parent of the item.
-		* @param		aSize				Size of the item data.
-		* @param		aMimeType			MIME type of the item.
-		* @param		aMimeVer			MIME version used on item.
-		* @param		aStatus				On completion of the opening of item, contains the result code.
-		*/
-		void DoOpenItemL(TSmlDbItemUid aUid, 
-						TBool& aFieldChange, 
-						TInt& aSize, 
-						TSmlDbItemUid& aParent, 
-						TDes8& aMimeType, 
-						TDes8& aMimeVer, 
-						TRequestStatus& aStatus);
-
-		/**
-		* DoCreateItemL() sets the item properties and reference to aUid which will be created.
-		* @param		aUid				Reference to item UID which going to be created.
-		* @param		aSize				Size of the item to be created.
-		* @param		aParent				Parent of the item.
-		* @param		aMimeType			MIME type of the item.
-		* @param		aMimeVer			MIME version used on item.
-		* @param		aStatus				On completion of the creating an item, contains the result code.
-		*/
-		void DoCreateItemL(TSmlDbItemUid& aUid, 
-							TInt aSize, 
-							TSmlDbItemUid aParent,
-							const TDesC8& aMimeType, 
-							const TDesC8& aMimeVer, 
-							TRequestStatus& aStatus);
-
-		/**
-		* DoReplaceItemL() opens the data item specified by aUid asynchronously to be updated.
-		* @param		aUid				Item UID which going to be updated.
-		* @param		aSize				Size of the item data.
-		* @param		aParent				Parent of the item.
-		* @param		aFieldChange		Accept field changes.
-		* @param		aStatus				On completion of the updating of item, contains the result code.
-		*/
-		void DoReplaceItemL(TSmlDbItemUid aUid, 
-							TInt aSize, 
-							TSmlDbItemUid aParent, 
-							TBool aFieldChange, 
-							TRequestStatus& aStatus);
-
-		/**
-		* DoReadItemL() reads data(or size of aBuffer) of an item opened in DoOpenItemL() to given aBuffer.
-		* @param		aBuffer				Buffer to item data.
-		*/
-		void DoReadItemL(TDes8& aBuffer);
-
-		/**
-		* DoWriteItemL() writes aData of an item opened in DoCreateItemL() or DoReplaceItemL() to be saved on database.
-		* @param		aData				Item data (or part of data).
-		*/
-		void DoWriteItemL(const TDesC8& aData);
-
-		/**
-		* DoCommitItemL() completes an item operation started in DoCreateItemL() or DoReplaceItemL().
-		* @param		aStatus				On completion of the operation, contains the result code.
-		*/
-		void DoCommitItemL(TRequestStatus& aStatus);
-
-		/**
-		* DoCloseItem() completes an item operation started in DoOpenItemL().
-		*/
-		void DoCloseItem();
-
-		/**
-		* DoMoveItemL() moves item specified by aUid asynchronously.
-		* @param		aUid				Item UID which going to be moved.
-		* @param		aNewParent			A new parent of the item.
-		* @param		aStatus				On completion of the moving an item, contains the result code.
-		*/
-		void DoMoveItemL(TSmlDbItemUid aUid, 
-						TSmlDbItemUid aNewParent, 
-						TRequestStatus& aStatus);
-
-		/**
-		* DoDeleteItemL() deletes item specified by aUid asynchronously.
-		* @param		aUid				Item UID which going to be deleted.
-		* @param		aStatus				On completion of the deleting an item, contains the result code.
-		*/
-		void DoDeleteItemL(TSmlDbItemUid aUid, 
-							TRequestStatus& aStatus);
-
-		/**
-		* DoSoftDeleteItemL() soft deletes item specified by aUid asynchronously.
-		* @param		aUid				Item UID which going to be softdeleted.
-		* @param		aStatus				On completion of the softdeleting an item, contains the result code.
-		*/
-		void DoSoftDeleteItemL(TSmlDbItemUid aUid, 
-								TRequestStatus& aStatus);
-
-		/**
-		* DoDeleteAllItemsL() deletes all items from opened database asynchronously.
-		* @param		aStatus				On completion of delete, contains the result code.
-		*/
-		void DoDeleteAllItemsL(TRequestStatus& aStatus);
-
-		/**
-		* DoHasSyncHistory() checks if previous sync with opened server and context.
-		* @return ETrue if there is synchonization history.
-		*/
-		TBool DoHasSyncHistory() const;
-
-		/**
-		* DoAddedItems() gets all added items on client since previous synchronization.
-		* @return Added items.
-		*/
-		const MSmlDataItemUidSet& DoAddedItems() const;
-
-		/**
-		* DoDeletedItems() gets all deleted items on client since previous synchronization.
-		* @return Deleted items.
-		*/
-		const MSmlDataItemUidSet& DoDeletedItems() const;
-
-		/**
-		* DoSoftDeletedItems() gets all softdeleted items on client since previous synchronization.
-		* @return Soft deleted items.
-		*/
-		const MSmlDataItemUidSet& DoSoftDeletedItems() const;
-
-		/**
-		* DoModifiedItems() gets all modified items on client since previous synchronization.
-		* @return Modified items.
-		*/
-		const MSmlDataItemUidSet& DoModifiedItems() const;
-
-		/**
-		* DoMovedItems() gets all moved items on client since previous synchronization.
-		* @return Moved items.
-		*/
-		const MSmlDataItemUidSet& DoMovedItems() const;
-
-		/**
-		* DoResetChangeInfoL() resets client synchronization data => next time will be slow sync.
-		* @param		aStatus				On completion of reset, contains the result code.
-		*/
-		void DoResetChangeInfoL(TRequestStatus& aStatus);
-
-		/**
-		* DoCommitChangeInfoL() commits client synchronization changes for given aItems list.
-		* @param		aStatus				On completion of given items, contains the result code.
-		* @param		aItems				Item ids to be commited.
-		*/
-		void DoCommitChangeInfoL(TRequestStatus& aStatus, 
-								const MSmlDataItemUidSet& aItems);
-
-		/**
-		* DoCommitChangeInfoL() commits all client synchronization changes.
-		* @param		aStatus				On completion of all items, contains the result code.
-		*/
-		void DoCommitChangeInfoL(TRequestStatus& aStatus);
-
-
-	private:
-		/**
-		* DoOwnStoreFormatL() gets the data storeformat from resource file.
-		* @return CSmlDataStoreFormat object
-		*/
-		CSmlDataStoreFormat* DoOwnStoreFormatL();
-		/**
-		* OpenItemL() opens the the specified item from notepad database.
-		* @param aUid, uid of the memo.
-		* @param aItem, content of the memo.
-		* @return KErrNone on success, system wide error on failure
-		*/
-		TInt OpenItemL(TSmlDbItemUid& aUid,CBufBase& aItem);
-		/**
-		* ConvertSyncItemToNoteL() converst teh sync item(text) to notepad memo item(CNpdItem).
-		* @param aSyncItem, descriptor that represents content of the memo
-		* @param aNote, content of the memo.
-		* @returns KErrNone on success, system wide error on failure.
-		*/
-		TInt ConvertSyncItemToNoteL(const TDesC8& aSyncItem, CNpdItem& aNote);
-		
-		/**
-		* ConvertNoteToSyncItemL() converst the notepad memo item(CNpdItem) to descriptor item(TDesC)
-		* @param aNote, content of the memo.
-		* @returns descriptor of that represents content of the memo.
-		*/
-		HBufC8* ConvertNoteToSyncItemL(CNpdItem& aNote);
-		/**
-		* DoAddItemToDataBaseL() add the the item to the notepad database
-		* @param aItem, represents content of the notepad memo
-		* @returns id the of memo.
-		*/
-		TInt DoAddItemToDataBaseL(CBufBase& aItem,TInt& aUid);
-		
-		/**
-		* DoReplaceItemAtDataBaseL() replaces the tem in notepad database for given uid
-		* @param aItem, represents content of the notepad memo
-		* @param aUid, uid of the memo.
-		*/
-		TInt DoReplaceItemAtDataBaseL(CBufBase& aItem, TInt& aUid);
-		/**
-		* DriveBelowCriticalLevelL() checks the available size of the drive C
-		* @param aSize, size to be check
-		* @returns ETrue if size available else EFalse.
-		*/
-		TBool DriveBelowCriticalLevelL( TInt aSize );
-		
-		/**
-        * FetchModificationsL() constucts the snapshot
-        * @returns system wide error
-        */
-		TInt FetchModificationsL();
-	
-	private: // data
-	
-		// MODULE DATA STRUCTURES
-		enum TNSmlDataStoreStatus  // DataStore status
-			{
-			ENSmlClosed = 1,
-			ENSmlOpenAndWaiting,
-			ENSmlItemOverflow,
-			ENSmlItemOpen,
-			ENSmlItemCreating,
-			ENSmlItemUpdating
-			};
-		
-		CNSmlNotepadDatabase* iNpdDb;
-		CNSmlChangeFinder* iChangeFinder;
-              
-	    TRequestStatus* iCallerStatus;
-        
-       	TPtrC8 iMimeTypeItem;
-		TPtrC8 iMimeVersionItem;
-		
-		TPtrC8 iUsedMimeType;
-		TPtrC8 iUsedMimeVersion;
-
-		RStringF iServerMimeType;
-		RStringF iServerMimeVersion;
-        
-        
-	    TInt iServerMaxObjectSize;
-        TBool iSnapshotRegistered;
-        TBool iSyncHistory;
-        HBufC* iOpenedStoreName;
-        HBufC* iDefaultStoreName;
-        TInt64 iOpenedStoreId;
-        TInt iReaderPosition;
-	    TInt iWriterPosition;
-        TInt* iAddItemId;
-        TInt iReplaceItemId;
-        CBufBase* iItemData;
-	    TInt iItemSize;
-	    TInt iUid;
-        TKeyArrayFix iKey;
-        CSmlDataStoreFormat* iOwnStoreFormat;
-	    TInt iModificationCount;
-        TInt iDrive;
-	    RFs iRfs;
-        RStringPool iStringPool;
-        CNSmlDataItemUidSet* iNewUids;
-        CNSmlDataItemUidSet* iDeletedUids;
-        CNSmlDataItemUidSet* iSoftDeletedUids;
-        CNSmlDataItemUidSet* iReplacedUids;
-        CNSmlDataItemUidSet* iMovedUids;
-        TNSmlDataStoreStatus iState;
-        CArrayFixSeg<TNSmlSnapshotItem>* iSnapshot;
-	    TBool iDataBaseOpened;
-	};
-
-#endif // __NSMLNOTEPADDATASTORE_H__
-
-// End of File  
--- a/omads/omadsextensions/adapters/notes/inc/nsmlnotepadDatabase.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +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:  calss which directly deal with notepad database.
-*
-*/
-
-
-#ifndef NSMLNOTEPADDATABASE_H
-#define NSMLNOTEPADDATABASE_H
-
-
-//INCLUDES
-#include <d32dbms.h>
-#include <badesca.h>
-
-//CLASS Forward declarations
-class CNpdItem;
-class CCalSession;
-class CCalInstanceView;
-class CCalEntryView;
-
-const TInt KMaxFileLength(255);
-
-//Class declarations
-
-// ------------------------------------------------------------------------------------------------
-// CNSmlNotepadDatabase
-// ------------------------------------------------------------------------------------------------
-
-class CNSmlNotepadDatabase : public CBase
-    {
-    public:
-        /**
-        * Creates new instance of CNpdSmlDbModel based class.
-        * @return CNpdSmlDbModel* Newly created instance.
-        */
-        static CNSmlNotepadDatabase* NewL();
-
-        virtual ~CNSmlNotepadDatabase();
-
-    private:        
-		// Constructor
-        CNSmlNotepadDatabase();
-
-        /**
-        * 2-phase constructor
-        */
-        void ConstructL();
-
-    public: 
-
-       	/**
-        * Opens notepad database file. If file does not exist, or is corrupted,
-        * a new, empty file is created.
-        * @param aStoreName, name of the notepad database file name
-        */
-        void OpenL(const TDesC& aStoreName);
-		
-        /**
-        * Adds a note to the database.
-        * @param aNote the note to be added.
-        * @param aKey database index of the newly added note.
-        */
-        void AddNoteL(CNpdItem& aNote, TInt &aKey);
-
-        /**
-        * Deletes a note from the database.
-        * @param aKey database index of the note to be deleted.
-        */
-        void DeleteNoteL(const TInt aKey);
-
-	
-        /**
-        * Closes the database.
-        */
-        void Close();
-
-        /**
-        * Reads a note from the database.
-        * @param aKey database index of the desired note.
-        * @param aNote reference to note object, used to return note data.
-        */
-        void GetNoteL(const TInt aKey, CNpdItem& aNote);
-
-        /**
-        * Updates a note in the database.
-        * @param aKey database index of the note to be updated.
-        * @param aItem note data. This data overrides existing note.
-        */
-        void UpdateNoteL(const TInt aKey, CNpdItem& aItem);
-
-        
-        /**
-        * Empties the database. All notes are deleted.
-        * @return KErrNone if successful, a system wide error code otherwise.
-        */
-        TInt ResetL();
-
-        /**
-        * Checks if the database has been succesfully openend
-        * @return ETrue if database has been succesfully opened, EFalse otherwise
-        */
-        TBool IsOpen();
-        
-            
-        /**
-        * Fetch all the note items if aKey is not present. Else item with the aKey.
-        * @returns array of NpdItem.
-        */
-        CArrayPtr<CNpdItem>* FetchItemsLC(TBool aIncludeText = EFalse, TInt* aKey = 0);
-        
-        /**
-        * Close all the CalSession related sessions 
-        * viz., instance view, entry view and calsession itself
-        */
-        void CloseAgendaSessions();
-
-   private: // Data
-        
-        // Flag for whether database has been opened
-        TBool iOpened;       
-        CCalSession*        iSession;
-        CCalInstanceView*   iInstanceView;
-        CCalEntryView*      iEntryView;
- 
-    enum TNotepadColumnType
-        {
-        ENotepadKey = 1, // this must be 1 (DBMS/SQL restriction)
-        ENotepadUpdateTime,
-        ENotepadMemo
-        };
-    };
-
-class CNpdItem : public CBase
-    {
-    public:
-        // Destructor
-        virtual ~CNpdItem();
-
-        /**
-        * Creates new instance of CNpdItem based class.
-        * @return CNpdItem* Newly created instance.
-        */
-        static CNpdItem* NewLC();
-
-        /**
-        * Creates new instance of CNpdItem based class.
-        * @param aKey database index key
-        * @param aLastModified timestamp
-        * @param aContent content (text) of the note
-        * @return CNpdItem* Newly created instance.
-        */
-        static CNpdItem* NewLC(TInt aKey, const TTime& aLastModified, HBufC* aContent);
-
-    private:
-		// Constructor
-        CNpdItem();
-    
-        //Overloaded Constructor
-        CNpdItem(TInt aKey, const TTime& aLastModified, HBufC *content);
-        
-	public:
-        /**
-        * Returns database key.
-        * @return key value.
-        */
-        TInt Key() const;
-
-        /**
-        * Returns the time stamp of the note.
-        * @return when note was last modified.
-        */
-        TTime LastModified() const;
-
-        /**
-        * Returns content of the note
-        * @return text of the note.
-        */
-        HBufC* Content();
-
-        /**
-        * Set note data.
-        * @param aKey database index
-        * @param aModTime time note was last modified
-        * @param aContent content of the note
-        */
-        void Set(TInt aKey, const TTime& aModTime, HBufC* aContent);
-
-        /**
-        * Set key of the note
-        * @param aKey key of the note.
-        */
-        void SetKey(TInt aKey);
-        
-        /**
-        * Set content of the note
-        * @param aContent text of the note.
-        */
-        void SetContent(HBufC* aContent);
-
-        /**
-        * Returns timestamp of the note
-        * @param aLastModified time note was last modified.
-        */
-        void SetModified(const TTime& aLastModified);
-
-   private:
-        TInt iKey;
-        TTime  iLastModified;
-        HBufC* iContent; // owned
-    };
-
-#endif // NSMLNOTEPADDATABASE_H
--- a/omads/omadsextensions/adapters/notes/inc/nsmlnotepaddefs.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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:  DS notepad definitions.
-*
-*/
-
-
-#ifndef __NSMLNOTEPADDEFS_H__ 
-#define __NSMLNOTEPADDEFS_H__ 
-
-#include <e32std.h>
-
-static const TUint KNSmlNotepadAdapterImplUid = 0x101F8612;
-
-#endif // __NSMLNOTEPADDEFS_H__
--- a/omads/omadsextensions/adapters/notes/inc/nsmlnotepadlogging.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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:  calss which directly deal with notepad database.
-*
-*/
-
-
-#ifndef __NSMLNOTEPADLOGGING_H__
-#define __NSMLNOTEPADLOGGING_H__
-
-#define _NOTEPAD_DBG_FILE(p)
-
-#ifdef _DEBUG_
-#include "nsmldebug.h"
-
-#define _NOTEPAD_DBG_FILE(p) _DBG_FILE(p)
-
-#endif
-
-
-#endif //__NSMLNOTEPADLOGGING_H__
--- a/omads/omadsextensions/adapters/notes/loc/101F85F8.loc	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +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: 
-*       Registery info for Notepad sync 
-*
-*/
-
-
-//d:Display name for registry info 
-//l:list_setting_pane_t1
-//
-#define qtn_nsml_npd_display_name "Notes"
--- a/omads/omadsextensions/adapters/notes/src/NSmlNotepadDataProvider.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +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:  DS notepad dataprovider
-*
-*/
-
-
-// INCLUDE FILES
-
-#include <barsc.h>
-#include <bautils.h>
-#include <SmlDataProvider.h>
-#include <implementationproxy.h>
-#include <nsmlnotepaddatastoreformat.rsg>
-#include <data_caging_path_literals.hrh>
-#include "NSmlNotepadDataProvider.h"
-#include "NSmlNotepadDatastore.h"
-#include "nsmlnotepaddefs.h"
-
-#include "nsmlnotepadlogging.h"
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::NewL
-// -----------------------------------------------------------------------------
-//
-CNSmlNotepadDataProvider* CNSmlNotepadDataProvider::NewL()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::NewL(): begin");
-	CNSmlNotepadDataProvider* self = NewLC();
-	CleanupStack::Pop(self);
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::NewL(): end");
-	return self;
-	}
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::NewLC
-// -----------------------------------------------------------------------------
-//
-CNSmlNotepadDataProvider* CNSmlNotepadDataProvider::NewLC()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::NewLC(): begin");
-	CNSmlNotepadDataProvider* self = new (ELeave) CNSmlNotepadDataProvider();
-	CleanupStack::PushL( self );
-	self->ConstructL();
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::NewLC(): end");
-	return self;
-	}
-	
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::CNSmlNotepadDataProvider
-// -----------------------------------------------------------------------------
-//
-CNSmlNotepadDataProvider::CNSmlNotepadDataProvider()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::CNSmlNotepadDataProvider(): begin");
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::CNSmlNotepadDataProvider(): end");
-	}
-	
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::ConstructL
-// -----------------------------------------------------------------------------
-//
-void CNSmlNotepadDataProvider::ConstructL()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::ConstructL(): begin");
-	User::LeaveIfError( iRfs.Connect() );
-	iNotepadDataStore = CNSmlNotepadDataStore::NewL();	
-	iStringPool.OpenL();
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::ConstructL(): end");
-	}
-	
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::CNSmlNotepadDataProvider
-// -----------------------------------------------------------------------------
-//
-CNSmlNotepadDataProvider::~CNSmlNotepadDataProvider()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::~CNSmlNotepadDataProvider(): begin");
-	iRfs.Close();
-	if(iNotepadDataStore)
-	{
-		delete iNotepadDataStore;
-		iNotepadDataStore = NULL;
-	}
-	if(iStoreFormat)
-	{
-		delete iStoreFormat;
-		iStoreFormat = NULL;	
-	}
-	iFilterArray.ResetAndDestroy();
-	iFilterArray.Close();
-	iStringPool.Close();
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::~CNSmlNotepadDataProvider(): end");
-	}
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::DoOnFrameworkEvent
-// -----------------------------------------------------------------------------
-//
-void CNSmlNotepadDataProvider::DoOnFrameworkEvent( TSmlFrameworkEvent /*aFrameworkEvent*/, 
-													TInt /*aParam1*/, 
-													TInt /*aParam2*/ )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoOnFrameworkEvent(): begin");
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoOnFrameworkEvent(): end");
-	}
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::DoSupportsOperation
-// -----------------------------------------------------------------------------
-//
-TBool CNSmlNotepadDataProvider::DoSupportsOperation( TUid aOpId ) const
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoSupportsOperation(): begin");
-	if (  aOpId == KUidSmlSupportMultipleStores )
-		{
-		_NOTEPAD_DBG_FILE("CNSmlAgendaDataProvider::DoSupportsOperation: true end");
-		return ETrue;
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoSupportsOperation(): end");
-	return EFalse; // KUidSmlSupportTransaction ,KUidSmlSupportSuspendResume, KUidSmlSupportUserSelectableMatchType
-	}
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::DoStoreFormatL
-// -----------------------------------------------------------------------------
-//
- const CSmlDataStoreFormat& CNSmlNotepadDataProvider::DoStoreFormatL() 
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoStoreFormatL(): begin");
-	if( !iStoreFormat )
-		{
-		TFileName fileName;
-		TParse parse;
-		
-		// Locate the resource file
-        TFileName dllFileName;
-        Dll::FileName( dllFileName );
-        
-        TFileName resourceFileName;
-        resourceFileName.Copy( TParsePtrC( dllFileName ).Drive() );  
-        resourceFileName.Append(KNSmlNotepadStoreFormatRsc);
-		
-		parse.Set( resourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
-		fileName = parse.FullName();
-		RResourceFile resourceFile; 
-		BaflUtils::NearestLanguageFile( iRfs, fileName );
-		resourceFile.OpenL( iRfs,fileName );
-		CleanupClosePushL( resourceFile );
-		HBufC8* notepadDataFormat = resourceFile.AllocReadLC( NSML_NOTEPAD_DATA_STORE_FORMAT );
-		TResourceReader reader;
-		reader.SetBuffer( notepadDataFormat );
-		iStoreFormat = CSmlDataStoreFormat::NewLC( iStringPool, reader );
-		CleanupStack::Pop(iStoreFormat); // iStoreFormat
-		CleanupStack::PopAndDestroy( 2 ); // notepadDataFormat,resourceFile  
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoStoreFormatL(): end");
-	return *iStoreFormat;
-	}
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::DoListStoresLC
-// -----------------------------------------------------------------------------
-//
-
-CDesCArray* CNSmlNotepadDataProvider::DoListStoresLC()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoListStoresLC(): begin");
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoListStoresLC(): end");
-	return iNotepadDataStore->DoListStoresLC();
-	}
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::DoDefaultStoreL
-// -----------------------------------------------------------------------------
-//
-const TDesC& CNSmlNotepadDataProvider::DoDefaultStoreL()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoDefaultStoreL(): begin");
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoDefaultStoreL(): end");
-	return iNotepadDataStore->DefaultStoreNameL();
-	}
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::DoNewStoreInstanceLC
-// -----------------------------------------------------------------------------
-//
-CSmlDataStore* CNSmlNotepadDataProvider::DoNewStoreInstanceLC()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoNewStoreInstanceLC(): begin");
-	CNSmlNotepadDataStore* newDataStore = CNSmlNotepadDataStore::NewL();
-	CleanupStack::PushL( newDataStore );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoNewStoreInstanceLC(): end");
-	return newDataStore;
-	}
-
-// ------------------------------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::DoSupportedServerFiltersL
-// 
-// ------------------------------------------------------------------------------------------------
-const RPointerArray<CSyncMLFilter>& CNSmlNotepadDataProvider::DoSupportedServerFiltersL()
-	{
-	// This method returns empty array. It means that this Data Provider does not support filtering
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoSupportedServerFiltersL(): BEGIN");
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoSupportedServerFiltersL(): END");
-	return iFilterArray;
-	}
-
-// ------------------------------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::DoCheckSupportedServerFiltersL
-// 
-// ------------------------------------------------------------------------------------------------
-void CNSmlNotepadDataProvider::DoCheckSupportedServerFiltersL( const CSmlDataStoreFormat& /*aServerDataStoreFormat*/, 
-																RPointerArray<CSyncMLFilter>& /*aFilters*/, 
-																TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoCheckSupportedServerFiltersL(): BEGIN");
-	User::Leave( KErrNotSupported );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoCheckSupportedServerFiltersL(): END");
-	}
-
-// ------------------------------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::CheckServerFiltersL
-// 
-// ------------------------------------------------------------------------------------------------
-void CNSmlNotepadDataProvider::DoCheckServerFiltersL( RPointerArray<CSyncMLFilter>& /*aFilters*/, 
-														TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoCheckServerFiltersL(): BEGIN");
-	User::Leave( KErrNotSupported );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoCheckServerFiltersL(): END");
-	}
-
-// ------------------------------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::DoGenerateRecordFilterQueryLC
-// 
-// ------------------------------------------------------------------------------------------------
-HBufC* CNSmlNotepadDataProvider::DoGenerateRecordFilterQueryLC( const RPointerArray<CSyncMLFilter>& /*aFilters*/, 
-																TSyncMLFilterMatchType /*aMatch*/, 
-																TDes& /*aFilterMimeType*/, 
-																TSyncMLFilterType& /*aFilterType*/, 
-																TDesC& /*aStoreName*/ )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoGenerateRecordFilterQueryLC(): BEGIN");
-	User::Leave( KErrNotSupported );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoGenerateRecordFilterQueryLC(): END");
-	return NULL;
-	}
-	
-// ------------------------------------------------------------------------------------------------
-// CNSmlNotepadDataProvider::DoGenerateFieldFilterQueryL
-// 
-// ------------------------------------------------------------------------------------------------
-void CNSmlNotepadDataProvider::DoGenerateFieldFilterQueryL( const RPointerArray<CSyncMLFilter>& /*aFilters*/, 
-															TDes& /*aFilterMimeType*/, 
-															RPointerArray<CSmlDataProperty>& /*aProperties*/, 
-															TDesC& /*aStoreName*/ )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoGenerateFieldFilterQueryL(): BEGIN");
-	User::Leave( KErrNotSupported );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataProvider::DoGenerateFieldFilterQueryL(): END");
-	}
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy array
-// -----------------------------------------------------------------------------
-//
-#ifndef IMPLEMENTATION_PROXY_ENTRY
-#define IMPLEMENTATION_PROXY_ENTRY( aUid, aFuncPtr ) {{aUid},(aFuncPtr)}
-#endif
-
-const TImplementationProxy ImplementationTable[] = 
-    {
-	IMPLEMENTATION_PROXY_ENTRY( KNSmlNotepadAdapterImplUid, CNSmlNotepadDataProvider::NewL )
-    };
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy
-// -----------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
-    {
-	_NOTEPAD_DBG_FILE("ImplementationGroupProxy() for CNSmlNotepadDataProvider: begin");
-    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
-	_NOTEPAD_DBG_FILE("ImplementationGroupProxy() for CNSmlNotepadDataProvider: end");
-    return ImplementationTable;
-	}
-
-// -----------------------------------------------------------------------------
-// E32Dll
-// DLL entry point.
-// -----------------------------------------------------------------------------
-//
-#ifndef EKA2
-GLDEF_C TInt E32Dll( TDllReason /*aReason*/ )
-	{
-	return KErrNone;
-	}
-#endif
-
-// End of File  
--- a/omads/omadsextensions/adapters/notes/src/NSmlNotepadDataStore.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1357 +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:  DS notepad data store
-*
-*/
-
-
-// INCLUDE FILES
-#include <barsc.h>
-#include <bautils.h>
-#include <s32mem.h>
-#include <sysutil.h>
-#include <nsmlnotepaddatastoreformat.rsg>
-#include <data_caging_path_literals.hrh>
-#include <SmlDataProvider.h>
-#include <txtetext.h>
-#include <charconv.h>
-#include <nsmlchangefinder.h>
-
-#include "NSmlNotepadDatastore.h"
-#include "nsmlnotepaddefs.h"
-#include "nsmlnotepadDatabase.h"
-#include "nsmlsnapshotitem.h"
-#include "nsmlnotepadlogging.h"
-	
-// ----------------------------------------------------------------------------
-// CNSmlNotepadDataStore::NewL
-// ----------------------------------------------------------------------------
-CNSmlNotepadDataStore* CNSmlNotepadDataStore::NewL()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::NewL: BEGIN");
-	CNSmlNotepadDataStore* self = new ( ELeave ) CNSmlNotepadDataStore();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self); // self
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::NewL: END");
-	return self;
-	}
-
-// ----------------------------------------------------------------------------
-// CNSmlNotepadDataStore::~CNSmlNotepadDataStore()
-// ----------------------------------------------------------------------------
-CNSmlNotepadDataStore::~CNSmlNotepadDataStore()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::~CNSmlNotepadDataStore(): begin");
-	if(iOwnStoreFormat)
-	    {
-		delete iOwnStoreFormat;
-		iOwnStoreFormat = NULL;
-	    }
-	if(iDefaultStoreName)
-	    {
-		delete iDefaultStoreName;
-		iDefaultStoreName = NULL;
-	    }
-	if(iNpdDb)
-	    {
-		delete iNpdDb;
-		iNpdDb = NULL;
-	    }
-	if(iReplacedUids)
-	    {
-		delete iReplacedUids;
-		iReplacedUids = NULL;
-	    }
-	if(iMovedUids)
-	    {
-		delete iMovedUids;
-		iMovedUids = NULL;
-	    }
-	if(iSoftDeletedUids)
-	    {
-		delete iSoftDeletedUids;
-		iSoftDeletedUids = NULL;
-	    }
-	if(iDeletedUids)
-	    {
-		delete iDeletedUids;
-		iDeletedUids = NULL;
-	    }
-	if(iNewUids)
-	    {
-		delete iNewUids;
-		iNewUids = NULL;
-	    }
-	iRfs.Close();
-	iStringPool.Close();
-	if(iOpenedStoreName)
-	    {
-		delete iOpenedStoreName;
-		iOpenedStoreName = NULL;
-	    }
-	if(iItemData)
-	    {
-		delete iItemData;
-		iItemData = NULL;	
-	    }
-	if ( iChangeFinder )
-		{
-		TRAP_IGNORE( iChangeFinder->CloseL() );
-		delete iChangeFinder;
-		iChangeFinder = NULL;
-		}
-	
-	if( iSnapshot )
-	    {
-        delete iSnapshot;
-        iSnapshot = NULL;
-	    }
-	
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::~CNSmlNotepadDataStore(): end");		
-	}
-
-
-// ----------------------------------------------------------------------------
-// CNSmlNotepadDataStore::CNSmlNotepadDataStore() 
-// ----------------------------------------------------------------------------
-CNSmlNotepadDataStore::CNSmlNotepadDataStore() : iOpenedStoreId(KNSmlNotepadAdapterImplUid),iKey( TKeyArrayFix( _FOFF( TNSmlSnapshotItem,ItemId() ),ECmpTInt ))
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::CNSmlNotepadDataStore(): begin");
-	iSyncHistory = EFalse;
-	iDataBaseOpened = EFalse;
-	iReaderPosition = -1;
-	iWriterPosition = -1;
-	iModificationCount = KNSmlCompactAfterChanges;
-	iState = ENSmlClosed;
-	iSnapshotRegistered = EFalse;
-	iDrive = -1;
-	iReplaceItemId =  -1;
-	iServerMaxObjectSize = 0; // Maximum size default value
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::CNSmlNotepadDataStore(): end");
-	}
-	
-// ----------------------------------------------------------------------------
-// CNSmlNotepadDataStore::ConstructL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::ConstructL()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::ConstructL(): begin");
-	User::LeaveIfError(iRfs.Connect());
-	iStringPool.OpenL();
-	iUsedMimeType.Set( KMimePlainText() );
-	iUsedMimeVersion.Set( KMimePlainTextVersion() );
-	// Uid Sets
-	if(iNewUids)
-	    {
-		delete iNewUids;
-		iNewUids = NULL;
-	    }
-	iNewUids = new (ELeave) CNSmlDataItemUidSet();
-	if(iDeletedUids)
-	    {
-		delete iDeletedUids;
-		iDeletedUids = NULL;
-	    }
-	iDeletedUids = new (ELeave) CNSmlDataItemUidSet();
-	if(iSoftDeletedUids)
-	    {
-		delete iSoftDeletedUids;
-		iSoftDeletedUids = NULL;
-	    }
-	iSoftDeletedUids = new (ELeave) CNSmlDataItemUidSet();
-	if(iMovedUids)
-	    {
-		delete iMovedUids;
-		iMovedUids = NULL;
-	    }
-	iMovedUids = new (ELeave) CNSmlDataItemUidSet();
-	if(iReplacedUids)
-	    {
-		delete iReplacedUids;
-		iReplacedUids = NULL;
-	    }
-	iReplacedUids = new (ELeave) CNSmlDataItemUidSet();
-	if(iNpdDb)
-	    {
-		delete iNpdDb;
-		iNpdDb = NULL;
-	    }
-	iNpdDb = CNSmlNotepadDatabase::NewL();
-	if(iDefaultStoreName)
-	    {
-		delete iDefaultStoreName;
-		iDefaultStoreName = NULL;
-	    }
-	iDefaultStoreName = HBufC::NewL( KNSmlDefaultStoreNameMaxSize );
-	*iDefaultStoreName = KNSmlNotepadStoreName; 
-	
-	if(iOwnStoreFormat)
-	    {
-		delete iOwnStoreFormat;
-		iOwnStoreFormat = NULL;
-	    }
-	iOwnStoreFormat = DoOwnStoreFormatL();
-	
-	iSnapshot = new (ELeave) CArrayFixSeg<TNSmlSnapshotItem>(KSnapshotGranularity);
-	
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::ConstructL(): end");
-	}
-
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DefaultStoreNameL()
-// ----------------------------------------------------------------------------
-const TDesC& CNSmlNotepadDataStore::DefaultStoreNameL() const
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DefaultStoreNameL(): begin");
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DefaultStoreNameL(): end");
-	if ( iDefaultStoreName )
-        {
-        return *iDefaultStoreName;
-        }
-	return KNullDesC;
-	}
-
-
-// ----------------------------------------------------------------------------
-// CDesCArray* CNSmlNotepadDataStore::DoListStoresLC();
-// ----------------------------------------------------------------------------
-CDesCArray* CNSmlNotepadDataStore::DoListStoresLC()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoListStoresLC(): begin");
-	CDesCArrayFlat *npdStores = new (ELeave)CDesCArrayFlat(1);
-    CleanupStack::PushL(npdStores);
-    npdStores->AppendL(KNSmlNotepadStoreName);
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoListStoresLC(): end");
-	return npdStores;
-	}
-	
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoOpenL(const TDesC& 		  aStoreName, 
-//									    MSmlSyncRelationship& aContext,
-//									    TRequestStatus& 	  aStatus)
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoOpenL( const TDesC& aStoreName, 
-									MSmlSyncRelationship& aContext, 
-									TRequestStatus& aStatus )
-    {
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoOpenL(): begin");	
-    iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if( iState != ENSmlClosed || iDataBaseOpened )
-	    {
-        
-		User::RequestComplete( iCallerStatus, KErrInUse );	
-		return;	
-	    }
-	if(aStoreName.Length()>0)
-	    {
-		if( RFs::CharToDrive(aStoreName[0], iDrive) != KErrNone )
-            {
-            RFs::CharToDrive( KNSmlDriveC()[0], iDrive );
-            }	
-	    }
-		
-	// Open the Database
-	TInt err( KErrNone );
-	TRAP(err,iNpdDb->OpenL( KNSmlNotepadDefaultStoreName ));
-	if ( err )
-        {
-        User::RequestComplete( iCallerStatus, err );
-        return;
-        }
-	
-    if ( iOpenedStoreName )
-        {
-        delete iOpenedStoreName;
-        iOpenedStoreName = NULL;
-        }
-    iOpenedStoreName = HBufC::NewL( KNSmlDefaultStoreNameMaxSize );
-    *iOpenedStoreName = KNSmlNotepadStoreName;
-    
-    iDataBaseOpened = ETrue;
-		
-	if ( iChangeFinder )
-		{
-		iChangeFinder->CloseL();
-		delete iChangeFinder;
-		iChangeFinder = NULL;
-		}
-	iChangeFinder = CNSmlChangeFinder::NewL( aContext, iKey, iSyncHistory, KNSmlNotepadAdapterImplUid );
-	
-	err = FetchModificationsL();
-	
-	
-	iState = ENSmlOpenAndWaiting;	
-	User::RequestComplete( iCallerStatus, err );
-	
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoOpenL(): end");
-}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoCancelRequest()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoCancelRequest()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCancelRequest(): begin");
-	if ( iState == ENSmlOpenAndWaiting )
-        {
-        iState = ENSmlClosed;
-        }
-    else
-        {
-        iState = ENSmlOpenAndWaiting;
-        }
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCancelRequest(): NOT NEEDED end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoStoreName()
-// ----------------------------------------------------------------------------
-const TDesC& CNSmlNotepadDataStore::DoStoreName() const
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoStoreName(): begin");
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoStoreName(): end");
-	if ( iOpenedStoreName )
-		{
-        return *iOpenedStoreName;
-		}
-	return KNullDesC;
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoBeginTransactionL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoBeginTransactionL()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoBeginTransactionL(): begin");
-	User::Leave( KErrNotSupported );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoBeginTransactionL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoCommitTransactionL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoCommitTransactionL(TRequestStatus& aStatus)
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitTransactionL(): begin");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	User::RequestComplete( iCallerStatus, KErrNotSupported );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitTransactionL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoRevertTransaction()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoRevertTransaction(TRequestStatus& aStatus)
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoRevertTransaction(): begin");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	User::RequestComplete( iCallerStatus, KErrNotSupported );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoRevertTransaction(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoBeginBatchL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoBeginBatchL()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoBeginBatchL(): begin");
-	User::Leave( KErrNotSupported );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoBeginBatchL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoCommitBatchL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoCommitBatchL( RArray<TInt>& /*aResultArray*/, TRequestStatus& aStatus )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitBatchL(): begin");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	User::RequestComplete( iCallerStatus, KErrNotSupported );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitBatchL(): end");
-	}
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoCancelBatch()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoCancelBatch()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCancelBatch(): begin");
-	// Nothing to do
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCancelBatch(): end");
-	}
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoSetRemoteStoreFormatL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoSetRemoteStoreFormatL( const CSmlDataStoreFormat& aServerDataStoreFormat )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoSetRemoteStoreFormatL(): begin");
-	TBool foundMime = EFalse;
-	// KErrNotSupported is returned if server does not support same mime type 
-	// and same mime type version as Data Provider.
-	TInt i=0;
-	while( i< aServerDataStoreFormat.MimeFormatCount() && !foundMime )
-		{
-		if( iUsedMimeType.MatchF(aServerDataStoreFormat.MimeFormat(i).MimeType().DesC())      ==0 &&
-		    iUsedMimeVersion.MatchF(aServerDataStoreFormat.MimeFormat(i).MimeVersion().DesC())==0 )
-			{
-			foundMime = ETrue;
-			iServerMimeType    = aServerDataStoreFormat.MimeFormat(i).MimeType();
-			iServerMimeVersion = aServerDataStoreFormat.MimeFormat(i).MimeVersion();
-			}
-		i++;
-		}
-	if( !foundMime )
-		{
-		_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoSetRemoteStoreFormatL(): SERVER MIMETYPE NOTSUPPORTED end");
-		
-		User::Leave( KErrNotSupported );
-		}
-	if( !iOwnStoreFormat )
-		{
-        iOwnStoreFormat = DoOwnStoreFormatL();
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoSetRemoteStoreFormatL(): end");
-	return;
-	}
-	
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoSetRemoteMaxObjectSize()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoSetRemoteMaxObjectSize( TInt aServerMaxObjectSize )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoSetRemoteMaxObjectSize(): begin");
-	iServerMaxObjectSize = aServerMaxObjectSize;
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoSetRemoteMaxObjectSize(): end");
-	}	
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoMaxObjectSize()
-// ----------------------------------------------------------------------------
-TInt CNSmlNotepadDataStore::DoMaxObjectSize() const
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoMaxObjectSize(): begin");
-	if ( iOwnStoreFormat )
-		{
-		if ( iOwnStoreFormat->HasMaxSize() )
-			{
-			_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoMaxObjectSize - From resource: END");
-			
-			return iOwnStoreFormat->MaxSize();
-			}
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoMaxObjectSize() 100 k: end");
-	return KNSmlDataStoreMaxSize;  // 100 k
-	}
-		
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoOpenItemL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoOpenItemL( TSmlDbItemUid aUid, 
-										  TBool& aFieldChange, 
-										  TInt& aSize, 
-										  TSmlDbItemUid& aParent, 
-										  TDes8& aMimeType, 
-										  TDes8& aMimeVer, 
-										  TRequestStatus& aStatus )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoOpenItemL(): begin");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if ( iState != ENSmlOpenAndWaiting )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotReady );
-		return;
-		}
-	aFieldChange = EFalse; // Whole item sent NOT SUPPORT ON FIELDCHANGE
-	aMimeType    = iOwnStoreFormat->MimeFormat( 0 ).MimeType().DesC();
-	aMimeVer	 = iOwnStoreFormat->MimeFormat( 0 ).MimeVersion().DesC();
-	aParent      = KNullDataItemId;
-	if( !iItemData )
-		{
-		iItemData= CBufFlat::NewL( KNSmlItemDataExpandSize );
-		}
-	else
-		{
-		iItemData->Reset();
-		}
-	TInt err = OpenItemL( aUid, *iItemData );
-	if( !err )
-		{
-		
-		iItemData->Compress();
-		iReaderPosition  = 0;
-		aSize = iItemData->Size();
-		iState = ENSmlItemOpen;
-		if ( iServerMaxObjectSize == 0 || aSize <= iServerMaxObjectSize )
-			{
-			User::RequestComplete( iCallerStatus, KErrNone );
-			}
-		else
-			{
-			User::RequestComplete( iCallerStatus, KErrTooBig );
-			}
-		}
-	else
-		{
-		User::RequestComplete( iCallerStatus, err );
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoOpenItemL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoCreateItemL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoCreateItemL( TSmlDbItemUid& aUid, 
-											TInt aSize, 
-											TSmlDbItemUid /*aParent*/, 
-											const TDesC8& aMimeType, 
-											const TDesC8& aMimeVer, 
-											TRequestStatus& aStatus )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCreateItemL(): begin");
-	TBuf8<255> lMimeType;
-	lMimeType.Copy(aMimeType);
-	TBuf8<255> lMimeVer;
-	lMimeVer.Copy(aMimeVer);
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	iAddItemId = &aUid;
-	if ( iState != ENSmlOpenAndWaiting )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotReady );
-		return;
-		}
-	if ( iOwnStoreFormat->HasMaxSize() )
-		{
-		if ( iOwnStoreFormat->MaxSize() < aSize )
-			{
-			User::RequestComplete( iCallerStatus, KErrTooBig );
-			return;
-			}
-		}
-	if( SysUtil::DiskSpaceBelowCriticalLevelL( &iRfs, aSize, iDrive ) )
-		{
-		User::RequestComplete( iCallerStatus, KErrDiskFull );
-		return;
-		}
-	TBuf8<255> lOwnMimeType;
-	lOwnMimeType.Copy(iOwnStoreFormat->MimeFormat( 0 ).MimeType().DesC());
-	TBuf8<255> lOwnMimeVer;
-	lOwnMimeVer.Copy(iOwnStoreFormat->MimeFormat( 0 ).MimeVersion().DesC());	
-	if ( 	(iOwnStoreFormat->MimeFormat( 0 ).MimeType().DesC().Compare( aMimeType ) != 0 ) )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotSupported );
-		_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCreateItemL - KErrNotSupported: END");
-		return;
-		}	
-	if ( iItemData )
-		{
-		delete iItemData;
-		iItemData = NULL;
-		}
-	iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
-	iWriterPosition  = 0;
-	iItemSize = aSize; // Size sent from server
-	iState = ENSmlItemCreating;
-	User::RequestComplete( iCallerStatus, KErrNone );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCreateItemL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoReplaceItemL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoReplaceItemL( TSmlDbItemUid aUid, 
-											 TInt aSize, 
-											 TSmlDbItemUid /*aParent*/, 
-											 TBool aFieldChange, 
-											 TRequestStatus& aStatus )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoReplaceItemL(): begin");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if ( iState != ENSmlOpenAndWaiting )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotReady );
-		return;
-		}
-	if ( iOwnStoreFormat->HasMaxSize() )
-		{
-		if ( iOwnStoreFormat->MaxSize() < aSize )
-			{
-			User::RequestComplete( iCallerStatus, KErrTooBig );
-			return;
-			}
-		}
-	if( aFieldChange )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotSupported );
-		return;
-		}
-	if( SysUtil::DiskSpaceBelowCriticalLevelL( &iRfs, aSize, iDrive ) )
-		{
-		User::RequestComplete(iCallerStatus, KErrDiskFull);
-		return;
-		}
-	TInt err = KErrNone;
-	iUid      = aUid;
-	iItemSize = aSize;
-	iWriterPosition  = 0;
-	if ( iItemData )
-		{
-		delete iItemData;
-		iItemData = NULL;
-		}
-	iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );	
-	CNpdItem *note;
-    note = CNpdItem::NewLC();
-    TInt itemFound;
-    TRAP(itemFound,iNpdDb->GetNoteL(aUid, *note));	
-	CleanupStack::PopAndDestroy(note);//for note
-	if ( itemFound != KErrNone)
-		{
-		delete iItemData;
-		iItemData = NULL;
-		
-		User::RequestComplete( iCallerStatus, KErrNotFound );
-		return;
-		}
-	iReplaceItemId = aUid;
-	iState = ENSmlItemUpdating;
-	User::RequestComplete( iCallerStatus, err );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoReplaceItemL(): end");
-	}
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoReadItemL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoReadItemL( TDes8& aBuffer )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoReadItemL(): begin");
-    if ( iState != ENSmlItemOpen || !iItemData )
-        {
-        iReaderPosition  = -1;
-        User::Leave( KErrNotReady );
-        }
-    if ( iReaderPosition  == -1 )
-        {
-        User::Leave( KErrEof );
-        }
-
-	if ( aBuffer.MaxSize() <= iItemData->Size() )
-		{
-		//iItemData->Read( 0, aBuffer );
-		//iReaderPosition  = -1;
-		if (iReaderPosition < (iItemData->Size() - iReaderPosition))
-		    {
-			iItemData->Read( iReaderPosition , aBuffer);
-			iReaderPosition  = iReaderPosition  + aBuffer.Size();
-		    }
-		else
-		    {
-			if (aBuffer.MaxLength() <= (iItemData->Size() - iReaderPosition))
-			{
-            iItemData->Read( iReaderPosition , aBuffer, aBuffer.MaxLength() );
-			}
-			else
-			{
-            iItemData->Read( iReaderPosition , aBuffer, (iItemData->Size() - iReaderPosition) );
-			}
-			iReaderPosition  = -1;
-		    }
-		}
-	else
-		{
-		TInt length = iItemData->Size() - iReaderPosition;
-		if ( aBuffer.Size() <= length )
-			{
-			iItemData->Read( iReaderPosition , aBuffer );
-			iReaderPosition  = -1;
-			}
-		else
-			{
-			iItemData->Read( iReaderPosition , aBuffer, aBuffer.Size() );
-			iReaderPosition  = iReaderPosition  + aBuffer.Size();
-			}
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoReadItemL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoWriteItemL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoWriteItemL( const TDesC8& aData )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoWriteItemL(): begin");
-	if ( iState == ENSmlItemCreating || iState == ENSmlItemUpdating )
-		{
-		TInt totalSize = aData.Size() + iItemData->Size();
-		if( SysUtil::DiskSpaceBelowCriticalLevelL( &iRfs, totalSize, iDrive ) )
-			{
-			User::RequestComplete(iCallerStatus, KErrDiskFull);
-			return;
-			}
-		if ( iItemData )
-			{
-			if ( iWriterPosition  == -1 )
-				{
-				User::Leave( KErrEof );
-				}
-			iItemData->InsertL( iWriterPosition , aData );
-			iWriterPosition  = aData.Size();
-			return;
-			}
-		}
-	User::Leave( KErrNotReady );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoWriteItemL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoCommitItemL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoCommitItemL( TRequestStatus& aStatus )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitItemL(): begin");	
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if ( iState == ENSmlItemCreating || iState == ENSmlItemUpdating )
-		{
-		if ( !iItemData )
-			{
-			User::RequestComplete( iCallerStatus, KErrNotReady );
-			return;
-			}
-		}
-	else
-		{
-		User::RequestComplete(iCallerStatus, KErrNotReady );
-		return;
-		}
-	iItemData->Compress();
-	TInt err(KErrNone);
-	if ( iState == ENSmlItemCreating )
-		{
-		iState = ENSmlClosed; 
-		TSmlDbItemUid newUid; 
-		err = DoAddItemToDataBaseL( *iItemData,newUid);
-		*iAddItemId = newUid;
-		}
-	else // ENSmlItemUpdating
-		{
-		iState = ENSmlClosed; 
-		err = DoReplaceItemAtDataBaseL( *iItemData, iReplaceItemId );
-		}
-	iReplaceItemId = -1;
-	iWriterPosition  = -1;
-	iState = ENSmlOpenAndWaiting;
-	if ( iItemData )
-		{
-		delete iItemData;
-		iItemData = NULL;
-		}
-	User::RequestComplete( iCallerStatus, err);
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitItemL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoCloseItem()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoCloseItem()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCloseItem(): begin");
-	if ( iState == ENSmlItemOpen )
-		{
-		iReaderPosition  = -1;
-		if ( iItemData )
-			{
-			delete iItemData;
-			iItemData = NULL;
-			}
-		iState = ENSmlOpenAndWaiting;
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCloseItem(): end");
-	}
-
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoMoveItemL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoMoveItemL( TSmlDbItemUid /*aUid*/, 
-										TSmlDbItemUid /*aNewParent*/, 
-										TRequestStatus& aStatus )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoMoveItemL(): begin");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if ( iState != ENSmlOpenAndWaiting )
-		{
-		User::RequestComplete( iCallerStatus, KErrNotReady );
-		return;
-		}
-	User::RequestComplete( iCallerStatus, KErrNotSupported );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoMoveItemL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoDeleteItemL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoDeleteItemL(): begin");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if ( iState != ENSmlOpenAndWaiting ) 
-		{
-		// Items cannot be deleted if some of them is opened
-		User::RequestComplete( iCallerStatus, KErrNotReady );
-		return;
-		}
-	iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
-	CNpdItem *note;
-    note = CNpdItem::NewLC();
-    TInt itemFound;
-    TRAP(itemFound,iNpdDb->GetNoteL(aUid, *note));	
-    CleanupStack::PopAndDestroy(note); // for note
-	if( itemFound != KErrNone)
-		{
-		delete iItemData;
-		iItemData = NULL;
-		
-		User::RequestComplete( iCallerStatus, KErrNotFound );
-		return;
-		}
-	TRAPD( err, iNpdDb->DeleteNoteL( aUid ) );
-	if( err == KErrNone )
-		{
-			if(iChangeFinder)
-			{
-            iChangeFinder->ItemDeleted( TNSmlSnapshotItem( aUid ) );
-			}
-		}
-	User::RequestComplete(iCallerStatus, err);
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoDeleteItemL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoSoftDeleteItemL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoSoftDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoSoftDeleteItemL(): begin");
-	DoDeleteItemL( aUid,aStatus );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoSoftDeleteItemL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoDeleteAllItemsL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoDeleteAllItemsL( TRequestStatus& aStatus )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoDeleteAllItemsL(): begin");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if ( iState != ENSmlOpenAndWaiting ) 
-		{
-		// Items cannot be deleted if they are opened.
-		User::RequestComplete(iCallerStatus, KErrNotReady);
-		return;
-		}
-	iNpdDb->ResetL();
-	if( iChangeFinder )
-		{
-		iChangeFinder->ResetL();		
-		}
-	iSnapshotRegistered = EFalse;
-	User::RequestComplete(iCallerStatus, KErrNone);
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoDeleteAllItemsL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// TBool CNSmlNotepadDataStore::DoHasSyncHistory()
-// ----------------------------------------------------------------------------
-TBool CNSmlNotepadDataStore::DoHasSyncHistory() const
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoHasSyncHistory(): begin");
-	TBool doHasSyncHistory = EFalse;
-	if( !iDataBaseOpened ) 
-		{
-		_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoHasSyncHistory(): NOT OPEN end");
-		return doHasSyncHistory;
-		}
-
-	if( iSyncHistory )
-		{
-		if ( iOpenedStoreId != iChangeFinder->DataStoreUid() )
-			{
-			iChangeFinder->SetDataStoreUid( iOpenedStoreId );
-			doHasSyncHistory = EFalse;
-			}
-		else
-			{
-            doHasSyncHistory = ETrue;
-			}
-		}
-	else
-		{
-		iChangeFinder->SetDataStoreUid( iOpenedStoreId );
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoHasSyncHistory(): end");
-	return doHasSyncHistory;
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoAddedItems()
-// ----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CNSmlNotepadDataStore::DoAddedItems() const
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoAddedItems(): begin");
-	if ( iState == ENSmlOpenAndWaiting )
-		{
-		iNewUids->Reset();
-		if( iChangeFinder )
-			{
-			TRAPD( err,iChangeFinder->FindNewItemsL( *iNewUids ) );
-			if( err != KErrNone )
-				{
-				_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoAddedItems(): LEAVE end");				
-				}
-			}
-		}	
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoAddedItems(): end");
-	return *iNewUids;
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoDeletedItems()
-// ----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CNSmlNotepadDataStore::DoDeletedItems() const
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoDeletedItems(): begin");	
-	if ( iState == ENSmlOpenAndWaiting )
-		{
-		iDeletedUids->Reset();
-		if( iChangeFinder )
-			{
-			TRAPD(err,iChangeFinder->FindDeletedItemsL( *iDeletedUids ) );
-			if( err != KErrNone )
-				{
-				_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoDeletedItems(): LEAVE end");				
-				}
-			}
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoDeletedItems(): end");
-	return *iDeletedUids;
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoSoftDeletedItems()
-// ----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CNSmlNotepadDataStore::DoSoftDeletedItems() const
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoSoftDeletedItems(): begin");
-	if ( iState == ENSmlOpenAndWaiting )
-		{
-		iSoftDeletedUids->Reset();
-		if( iChangeFinder )
-			{
-			TRAPD( err, iChangeFinder->FindSoftDeletedItemsL( *iSoftDeletedUids ) );
-			if( err != KErrNone )
-				{
-				_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoSoftDeletedItems(): LEAVE end");				
-				}
-			}
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoSoftDeletedItems: END");
-	return *iSoftDeletedUids;
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoModifiedItems()
-// ----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CNSmlNotepadDataStore::DoModifiedItems() const
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoModifiedItems(): begin");
-	if ( iState == ENSmlOpenAndWaiting )
-		{
-		iReplacedUids->Reset();
-		if( iChangeFinder )
-			{
-			TRAPD( err, iChangeFinder->FindChangedItemsL( *iReplacedUids ) );
-			if( err != KErrNone )
-				{
-                _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoModifiedItems(): LEAVE end");				
-				}
-			}
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoModifiedItems: END");
-	return *iReplacedUids;
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoMovedItems()
-// ----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CNSmlNotepadDataStore::DoMovedItems() const
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoMovedItems(): begin");
-	if ( iState == ENSmlOpenAndWaiting )
-		{
-		iMovedUids->Reset();
-		if( iChangeFinder )
-			{
-			TRAPD( err, iChangeFinder->FindMovedItemsL( *iMovedUids ) );	
-			if( err != KErrNone )
-				{
-                _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoMovedItems(): LEAVE end");				
-				}
-			}
-		}
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoMovedItems: END");
-	return *iMovedUids;
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoResetChangeInfoL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoResetChangeInfoL(): begin");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if( iChangeFinder )
-		{
-		iChangeFinder->ResetL();
-		}
-	iSnapshotRegistered = EFalse;
-	TInt err  = FetchModificationsL();
-    User::RequestComplete( iCallerStatus, err );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoResetChangeInfoL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoCommitChangeInfoL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus, 
-												  const MSmlDataItemUidSet& aItems )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitChangeInfoL(aItems): begin");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if( iChangeFinder )
-		{
-		iChangeFinder->CommitChangesL( aItems );
-		User::RequestComplete( iCallerStatus, KErrNone );
-		_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitChangeInfoL(aItems):success end");
-		return;
-		}
-	User::RequestComplete( iCallerStatus, KErrNotReady );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitChangeInfoL(aItems): end");
-	}
-
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoCommitChangeInfoL()
-// ----------------------------------------------------------------------------
-void CNSmlNotepadDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus )
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitChangeInfoL(): begin");
-	iCallerStatus = &aStatus;
-	*iCallerStatus = KRequestPending;
-	if( iChangeFinder )
-		{
-		iChangeFinder->CommitChangesL();
-		User::RequestComplete( iCallerStatus, KErrNone );
-		_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitChangeInfoL(): success end");
-		return;
-		}
-	User::RequestComplete( iCallerStatus, KErrNotReady );
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoCommitChangeInfoL(): end");
-	}
-
-// ----------------------------------------------------------------------------
-// CSmlDataStoreFormat* CNSmlNotepadDataStore::DoOwnStoreFormatL()
-// ----------------------------------------------------------------------------
-CSmlDataStoreFormat* CNSmlNotepadDataStore::DoOwnStoreFormatL()
-    {
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoOwnStoreFormatL(): begin");
-	TFileName fileName;
-	TParse parse;
-	
-	// Locate the resource file
-    TFileName dllFileName;
-    Dll::FileName( dllFileName );
-    
-    TFileName resourceFileName;
-    resourceFileName.Copy( TParsePtrC( dllFileName ).Drive() );  
-    resourceFileName.Append(KNSmlNotepadStoreFormatRsc);
-    
-    parse.Set( resourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
-	fileName = parse.FullName();
-	RResourceFile resourceFile; 
-	BaflUtils::NearestLanguageFile( iRfs, fileName );
-	resourceFile.OpenL( iRfs, fileName );
-	CleanupClosePushL( resourceFile );
-	HBufC8* notepadDataFormat = resourceFile.AllocReadLC( NSML_NOTEPAD_DATA_STORE_FORMAT );
-	TResourceReader reader;
-	reader.SetBuffer( notepadDataFormat );
-	CSmlDataStoreFormat* lDsFormat = CSmlDataStoreFormat::NewLC( iStringPool, reader );
-	CleanupStack::Pop(lDsFormat); // lDsFormat
-	CleanupStack::PopAndDestroy(notepadDataFormat); // notepadDataFormat
-	CleanupStack::PopAndDestroy();// resourceFile 
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoOwnStoreFormatL(): end");	
-	return lDsFormat; 
-	}
-
-// ----------------------------------------------------------------------------
-// TInt CNSmlNotepadDataStore::OpenItemL(TSmlDbItemUid& aUid,CBufBase& aItem)
-// ----------------------------------------------------------------------------
-TInt CNSmlNotepadDataStore::OpenItemL(TSmlDbItemUid& aUid,CBufBase& aItem)
-    {
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::OpenItemL(): begin");
-	TInt err = KErrNone;
-	if(iNpdDb->IsOpen())
-        {
-        CNpdItem *note;
-        note = CNpdItem::NewLC();
-        TRAP(err,iNpdDb->GetNoteL(aUid, *note));
-        if(err == KErrNone)
-            {
-            _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore:: FetchItemL():  begin");
-            
-            HBufC8* buf = ConvertNoteToSyncItemL(*note);
-            CleanupStack::PushL(buf);
-            aItem.Reset();
-            // Write the buffer to the passed writeStream (aItem)
-            TBufBuf bufBuf;
-            bufBuf.Set(aItem, 0, TBufBuf::EWrite);
-            RWriteStream writeStream( &bufBuf);
-            writeStream.PushL();
-            writeStream.WriteL(buf->Des().Ptr(), buf->Des().Length());
-            writeStream.CommitL();
-            CleanupStack::PopAndDestroy(1);//writeStream
-            CleanupStack::PopAndDestroy(buf);//buf
-            _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::FetchItemL(): end");
-            }
-        CleanupStack::PopAndDestroy(note); // note
-        }
-    else
-        {
-        err = KErrNotReady;
-        }
-        
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::OpenItemL(): end");
-	return err;
-}
-
-// ----------------------------------------------------------------------------
-// TInt CNSmlNotepadDataStore::ConvertSyncItemToNoteL(const TDesC8& aSyncItem, CNpdItem& aNote)
-// ----------------------------------------------------------------------------
-TInt CNSmlNotepadDataStore::ConvertSyncItemToNoteL(const TDesC8& aSyncItem, CNpdItem& aNote)
-    {
-    TInt err(KErrNone);
-    TTime gmt;
-    gmt.UniversalTime();
-    gmt.RoundUpToNextMinute();
-    gmt -= TTimeIntervalMinutes(1);
-    HBufC *note = NULL;
-    if(&aSyncItem)
-        {
-        RDesReadStream stream(aSyncItem);
-        CPlainText *text;
-        text = CPlainText::NewL();
-        CleanupStack::PushL(text);
-        CPlainText::TImportExportParam param;
-        param.iForeignEncoding = KCharacterSetIdentifierUtf8;
-        param.iOrganisation = CPlainText::EOrganiseByParagraph;
-        param.iGuessForeignEncoding = EFalse;
-        CPlainText::TImportExportResult result;
-        text->ImportTextL(0,stream,param,result);
-        stream.Close();
-        note = HBufC::NewL(result.iOutputChars);
-        CleanupStack::PushL(note);
-        TPtr tmpdes = note->Des();
-        text->Extract(tmpdes,0);
-        CleanupStack::Pop(note); 
-        CleanupStack::PopAndDestroy(text); 
-        }
-    aNote.SetContent(note); 
-    aNote.SetModified(gmt);
-    return err;
-    }
-
-// ----------------------------------------------------------------------------
-// HBufC8* CNSmlNotepadDataStore::ConvertNoteToSyncItemL(CNpdItem& aNote)
-// ----------------------------------------------------------------------------
-HBufC8* CNSmlNotepadDataStore::ConvertNoteToSyncItemL(CNpdItem& aNote)
-    {
-    if (!aNote.Content())
-        {
-        HBufC8* tempHBuf = HBufC8::NewL(KNullCharLen);//room for null character
-        return tempHBuf;
-        }
-    // Note: a single unicode character can be 4 bytes long in UTF8 format,
-    // hence the long length for 8-bit buffer.
-    TInt length = (aNote.Content()->Length()) * KUTF8Lenght;
-    HBufC8* tempHBuf = HBufC8::NewLC(length + KNullCharLen);
-    CPlainText *text = CPlainText::NewL();
-    CleanupStack::PushL(text);
-    text->InsertL(0,aNote.Content()->Des());
-    CPlainText::TImportExportResult result;
-    CPlainText::TImportExportParam param;
-    param.iForeignEncoding = KCharacterSetIdentifierUtf8;
-    param.iOrganisation = CPlainText::EOrganiseByParagraph;
-    param.iGuessForeignEncoding = EFalse;
-    param.iMaxOutputChars = length;
-    TPtr8 ptr = tempHBuf->Des();
-    RDesWriteStream stream(ptr);
-    text->ExportTextL(0,stream,param,result);
-    stream.Close();
-    CleanupStack::PopAndDestroy(text);
-    CleanupStack::Pop(tempHBuf);//pop the HBufC8 temp 
-    return (tempHBuf);
-    }
-
-// ----------------------------------------------------------------------------
-// TInt CNSmlNotepadDataStore::DoAddItemToDataBaseL(CBufBase& aItem)
-// ----------------------------------------------------------------------------
-TInt CNSmlNotepadDataStore::DoAddItemToDataBaseL(CBufBase& aItem,TInt& aUid)
-{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoAddItemToDataBaseL: begin");
-	TInt lKey = -1;
-	TInt length = aItem.Size();
-    HBufC8* buf = HBufC8::NewLC(length*KUnicodeSize + KNullCharLen);
-    buf->Des().Copy(aItem.Ptr(0));
-    TPtr8 lPtr(buf->Des());
-    CNpdItem *note;
-    note = CNpdItem::NewLC();
-    TInt err(KErrNone);
-   	err = ConvertSyncItemToNoteL(*buf, *note);       
-    if(err != KErrNone)
-    {
-    	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoAddItemToDataBaseL: conversion error");
-    }
-    else
-    {
-	    _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoAddItemToDataBaseL: before adding to notepad db");
-	    TRAP(err,iNpdDb->AddNoteL(*note,lKey));
-		if(err!=KErrNone)
-            {
-            _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoAddItemToDataBaseL: Addnote error");	
-            }
-		else
-            {
-            TNSmlSnapshotItem item( lKey );
-            TTime lLastModified = note->LastModified();
-            item.SetLastChangedDate(lLastModified);
-            item.SetSoftDelete( EFalse );
-            iChangeFinder->ItemAddedL( item ); 
-            }
-    }
-    aUid = lKey;
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoAddItemToDataBaseL: after adding to notepad db");
-	CleanupStack::PopAndDestroy(note);//note
-	CleanupStack::PopAndDestroy(buf);//buf
-	return err;
-}
-// ----------------------------------------------------------------------------
-// void CNSmlNotepadDataStore::DoReplaceItemAtDataBaseL(CBufBase& aItem, TInt& aUid)
-// ----------------------------------------------------------------------------
-TInt CNSmlNotepadDataStore::DoReplaceItemAtDataBaseL(CBufBase& aItem, TInt& aUid)
-{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoReplaceItemAtDataBaseL: begin");
-	TInt length = aItem.Size();
-    HBufC8* buf = HBufC8::NewLC(length*KUnicodeSize + KNullCharLen);
-    buf->Des().Copy(aItem.Ptr(0));
-    TPtr8 lPtr(buf->Des());
-    CNpdItem *note;
-    note = CNpdItem::NewLC();
-    TInt err(KErrNone);
-    err = ConvertSyncItemToNoteL(*buf, *note);       
-    if(err != KErrNone)
-    {
-    	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoReplaceItemAtDataBaseL: conversion error");
-    }
-    else
-    {
-    	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoReplaceItemAtDataBaseL: before updating into notepad db");
-    	TRAP(err,iNpdDb->UpdateNoteL(aUid,*note));
-    	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoReplaceItemAtDataBaseL: after updating into notepad db");
-		if(err!=KErrNone)
-		{
-    		_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoReplaceItemAtDataBaseL: updating error");	
-    	}
-    	else
-    	{
-    		TNSmlSnapshotItem item( aUid );
-			item.SetLastChangedDate( note->LastModified() );
-			item.SetSoftDelete( EFalse );
-			iChangeFinder->ItemUpdatedL( item );
-		}
-    }
-    CleanupStack::PopAndDestroy(note);//note
-    CleanupStack::PopAndDestroy(buf); //buf
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::DoReplaceItemAtDataBaseL: end");
-	return err;
-}
-
-// ------------------------------------------------------------------------------------------------
-// CNSmlNotepadDataStore::DriveBelowCriticalLevelL()
-// ------------------------------------------------------------------------------------------------
-TBool CNSmlNotepadDataStore::DriveBelowCriticalLevelL( TInt aSize )
-	{
-		return SysUtil::DiskSpaceBelowCriticalLevelL( &iRfs, aSize, iDrive );
-	}
-
-// ----------------------------------------------------------------------------
-// TInt CNSmlNotepadDataStore::FetchModificationsL()
-// ----------------------------------------------------------------------------
-TInt CNSmlNotepadDataStore::FetchModificationsL()
-    {
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::FetchModificationsL: begin");
-    TInt err( KErrNone );
-    CArrayPtr<CNpdItem>* arrNpdItem = NULL;
-    arrNpdItem = iNpdDb->FetchItemsLC();
-    
-    if( !iSnapshot )
-        {
-        _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::FetchModificationsL: inside if(!isnapshot)");
-        iSnapshot = new (ELeave) CArrayFixSeg<TNSmlSnapshotItem>( 8 );
-        }
-    
-    if( !iSnapshotRegistered )
-        {
-        _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::FetchModificationsL: inside if(!iSnapshotRegistered)");
-        for( TInt count = 0; count < arrNpdItem->Count(); count++ )
-            {
-            _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::FetchModificationsL: inside for before snap");
-            TNSmlSnapshotItem snap( arrNpdItem->At( count )->Key() );
-            snap.SetLastChangedDate( arrNpdItem->At( count )->LastModified() );
-            _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::FetchModificationsL: inside for before insertisql");
-            iSnapshot->InsertIsqL( snap, iKey );       
-            _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::FetchModificationsL: inside for after insertisql");
-            }
-        _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::FetchModificationsL: for loop ends");
-        iSnapshot->Compress();
-        iChangeFinder->SetNewSnapshot( iSnapshot ); // changefinder takes ownership
-        iSnapshot = NULL;
-        iSnapshotRegistered = ETrue;
-        }
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::FetchModificationsL: before popanddestroy arrnpditem");
-    CleanupStack::PopAndDestroy(arrNpdItem);
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDataStore::FetchModificationsL: end");
-    return err;
-    }
-
-// End of File  
--- a/omads/omadsextensions/adapters/notes/src/NSmlNotepadDataStoreFormat.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-CHARACTER_SET UTF8/*
-* 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:  Resource data for notepadDataProvider
-*
-*/
-
-#include <eikon.rh>
-#include <avkon.rh>
-#include "SmlDataFormat.rh"
-#include "SmlDataFormat.hrh"
-#include <data_caging_paths_strings.hrh>
-
-
-
-RESOURCE TBUF r_notepad_datafile_name
-    {
-    buf = NOTEPAD_DATABASE;
-    }
-
-RESOURCE SML_DATA_STORE_FORMAT NSML_NOTEPAD_DATA_STORE_FORMAT
-	{
-	version=1;
-	display_name="Notes";
-	sync_types=KSmlSyncType_TwoWay+KSmlSyncType_OneWayFromSvr+KSmlSyncType_OneWayFromClnt+KSmlSyncType_RefreshFromSvr+KSmlSyncType_RefreshFromClnt+KSmlSyncType_SlowSync;
-	mime_format=
-		{
-		SML_MIME_FORMAT
-			{
-			version=1;
-			mime_type="text/plain";
-			mime_ver="1.0";
-			field_level=0;
-			}
-		};
-		mime_format_tx_pref=0;     // Preferred index for tx
-		mime_format_rx_pref=0;     // Preferred index for rx
-		folder_properties={};
-		filter_capabilities={};
-		max_size=0; 	// no limit
-		max_items=0; 	// no limit
-		flags=0;
-	}
-	
-// End of File  
--- a/omads/omadsextensions/adapters/notes/src/nsmlnotepadDatabase.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,606 +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:  notepad database
-*
-*/
-
-
-#include <sysutil.h>
-
-#include <txtetext.h>
-#include "nsmlnotepadDatabase.h"
-#include <nsmlnotepaddatastoreformat.rsg>
-#include <nsmlconstants.h>
-
-#include <calentryview.h>
-#include <calentry.h>
-#include <calinstance.h>
-#include <calinstanceview.h>
-#include <calsession.h>
-#include <CalenInterimUtils2.h>
-
-#include "nsmlnotepadlogging.h"
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::NewL
-// -----------------------------------------------------------------------------
-//
-CNSmlNotepadDatabase* CNSmlNotepadDatabase::NewL()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::NewL(): begin");
-	
-	CNSmlNotepadDatabase *instance = new(ELeave) CNSmlNotepadDatabase();
-	CleanupStack::PushL(instance);
-	instance->ConstructL();
-	CleanupStack::Pop(instance);
-	
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::NewL(): end");
-	return instance;
-	}
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::~CNSmlNotepadDatabase()
-// -----------------------------------------------------------------------------
-//
-CNSmlNotepadDatabase::~CNSmlNotepadDatabase()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::~CNSmlNotepadDatabase(): begin");
-	
-	CloseAgendaSessions();
-
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::~CNSmlNotepadDatabase(): end");
-	}
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::CNSmlNotepadDatabase()
-// -----------------------------------------------------------------------------
-//
-CNSmlNotepadDatabase::CNSmlNotepadDatabase()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::CNSmlNotepadDatabase(): begin");
-	
-	iOpened = EFalse;
-	
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::CNSmlNotepadDatabase(): end");
-	}	
-	
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::ConstructL
-// -----------------------------------------------------------------------------
-//
-void CNSmlNotepadDatabase::ConstructL()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::ConstructL: begin");
-	
-	// Instantiate the Session variable
-	iSession = CCalSession::NewL();
-	
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::ConstructL: end");
-	}
-
-// -----------------------------------------------------------------------------
-// TInt CNSmlNotepadDatabase::OpenL(const TDesC& aStoreName)
-// -----------------------------------------------------------------------------
-//
-void CNSmlNotepadDatabase::OpenL(const TDesC& aStoreName)
-    {
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::OpenL(): begin");
-    CloseAgendaSessions();
-        
-    TInt err = KErrNone;    
-    iSession = CCalSession::NewL();
-    
-    TRAP( err,iSession->OpenL( aStoreName ) );
-    if(err == KErrNotFound)
-        {
-        iSession->CreateCalFileL( aStoreName );
-        iSession->OpenL( aStoreName );
-        }
-    else if( err != KErrNone )
-        {
-        CloseAgendaSessions();
-        User::Leave(err);
-        }
-
-    iEntryView = CCalEntryView::NewL(*iSession);
-    iInstanceView = CCalInstanceView::NewL(*iSession);
-
-    if(iEntryView && iInstanceView)
-        {
-        iOpened = ETrue;
-        }
-    else
-        {
-        CloseAgendaSessions();
-        User::LeaveIfError(KErrNotFound);
-        }
-    
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::OpenL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::AddNoteL
-// -----------------------------------------------------------------------------
-//
-void CNSmlNotepadDatabase::AddNoteL(CNpdItem& aNote, TInt &aKey)
-    {
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::AddNoteL(): begin");   
-   
-    TInt successCount = 0;
-
-    CCalenInterimUtils2* interimUtils = CCalenInterimUtils2::NewL();
-    CleanupStack::PushL(interimUtils);
-    
-    HBufC8* guid = interimUtils->GlobalUidL();
-    CleanupStack::PopAndDestroy(interimUtils);
-    
-    CleanupStack::PushL(guid);
-    CCalEntry* entry = CCalEntry::NewL(CCalEntry::ENote, guid,
-            CCalEntry::EMethodNone, 0);
-    CleanupStack::Pop(guid);
-    
-    CleanupStack::PushL(entry);
-
-    // set the description
-    TDesC* noteContent(aNote.Content());
-    entry->SetDescriptionL(*noteContent);
-
-    // store the entry in to calendar file
-    RPointerArray<CCalEntry> array;
-    CleanupRPtrArrayPushL(array); 
-
-    array.AppendL(entry);
-    CleanupStack::Pop(entry);
-    iEntryView->StoreL(array, successCount);
-    
-    if(successCount)
-        {
-        HBufC* content = HBufC::NewL(entry->DescriptionL().Length());
-        content->Des().Copy(entry->DescriptionL());
-        aNote.Set(entry->LocalUidL(),entry->LastModifiedDateL().TimeUtcL(), content);
-        aKey = entry->LocalUidL();
-        CleanupStack::PopAndDestroy(&array);
-        _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::AddNoteL(): inside if(successCount) after array");
-        }
-    else
-        {
-        User::Leave(KErrGeneral);
-        }
-	
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::AddNoteL(): end");
-	
-	User::Leave(KErrNone);
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::DeleteNoteL
-// -----------------------------------------------------------------------------
-//
-void CNSmlNotepadDatabase::DeleteNoteL(const TInt aKey)
-    {
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::DeleteNoteL(): begin");
-    
-    CCalEntry* entryTobeDeleted(NULL);
-    entryTobeDeleted = iEntryView->FetchL(aKey);
-    if(entryTobeDeleted)
-        {
-        CleanupStack::PushL(entryTobeDeleted);
-        iEntryView->DeleteL(*entryTobeDeleted);
-        CleanupStack::Pop(entryTobeDeleted);
-        }
-    
-    delete entryTobeDeleted;
-    entryTobeDeleted = NULL;
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::DeleteNoteL(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::Close
-// -----------------------------------------------------------------------------
-//
-void CNSmlNotepadDatabase::Close()  // can be deprecated ????
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::Close(): begin");
-	iOpened = EFalse;
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::Close(): end");        
-	}
-	
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::GetNoteL
-// -----------------------------------------------------------------------------
-//
-void CNSmlNotepadDatabase::GetNoteL(const TInt aKey, CNpdItem& aItem)
-    {
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::GetNoteL(): begin");
-	TInt err(KErrNone);
-	if(!iOpened)
-		{
-		_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::GetNoteL(): not opened");
-		User::Leave(KErrNotReady);
-		}
-	
-    if(aKey)
-        {
-        CCalEntry* entryTobeFetched(NULL);
-        entryTobeFetched = iEntryView->FetchL(aKey);
-        if(entryTobeFetched)
-            {
-            CleanupStack::PushL(entryTobeFetched); 
-            HBufC* content = HBufC::NewL(entryTobeFetched->DescriptionL().Length());
-            content->Des().Copy(entryTobeFetched->DescriptionL());
-            
-            aItem.Set(aKey, entryTobeFetched->LastModifiedDateL().TimeUtcL(), content);
-            
-            //CleanupStack::Pop(aItem);
-            CleanupStack::PopAndDestroy(entryTobeFetched);
-            }
-        else
-            {
-            delete entryTobeFetched;
-            entryTobeFetched = NULL;
-            }
-        }   
-    
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::GetNoteL(): end");
-    User::Leave(err);
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::UpdateNoteL
-// -----------------------------------------------------------------------------
-//
-void CNSmlNotepadDatabase::UpdateNoteL(const TInt aKey, CNpdItem& aItem)
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::UpdateNoteL(): begin");
-
-	if(!iOpened)
-		{
-		_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::UpdateNoteL(): not ready");
-		User::Leave(KErrNotReady);
-		}
-
-	RPointerArray<CCalEntry> array;
-    CleanupRPtrArrayPushL(array);
-
-    // fetch the created note using the localuid
-    CCalEntry* entryTobeUpdated(NULL);
-    entryTobeUpdated = iEntryView->FetchL(aKey);
-    if(entryTobeUpdated)
-        {
-    	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::UpdateNoteL(): entry found");
-        }
-    else
-        {
-    	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::UpdateNoteL(): entry not found");
-        User::Leave(KErrNotFound);
-        }
-    CleanupStack::PushL(entryTobeUpdated);
-
-    // update the description
-    HBufC* content = HBufC::NewL(aItem.Content()->Length());
-    content = aItem.Content();
-
-    entryTobeUpdated->SetDescriptionL(*content);
-
-    array.AppendL(entryTobeUpdated);
-    CleanupStack::Pop(entryTobeUpdated);
-    TBool success(EFalse);
-    // update the entry
-    iEntryView->UpdateL(array, success);
-
-    if(success)
-        {
-        aItem.SetModified(entryTobeUpdated->LastModifiedDateL().TimeUtcL());
-        CleanupStack::PopAndDestroy(&array);
-        }
-    else
-        {
-        User::Leave(KErrGeneral);
-        }
-	
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::UpdateNoteL(): end");	
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::ResetL
-// -----------------------------------------------------------------------------
-//
-TInt CNSmlNotepadDatabase::ResetL()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::ResetL(): begin");
-	
-    TInt err(KErrNone);
-    CArrayPtr<CNpdItem>* arrNpdItem = NULL;
-    
-    // Fetch all the available notes from the db
-    arrNpdItem = FetchItemsLC();
-      
-    // Delete the Notes
-    for( TInt count = 0; count < arrNpdItem->Count(); count++ )
-        {
-        CCalEntry* entryTobeDeleted(NULL);
-        entryTobeDeleted = iEntryView->FetchL( arrNpdItem->At(count)->Key() );
-        if(entryTobeDeleted)
-            {
-            CleanupStack::PushL(entryTobeDeleted);
-            iEntryView->DeleteL(*entryTobeDeleted);
-            CleanupStack::Pop(entryTobeDeleted);
-            }        
-        delete entryTobeDeleted;
-        entryTobeDeleted = NULL;
-        }
-    CleanupStack::PopAndDestroy(arrNpdItem);
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::ResetL(): begin");
-    return err;
-	}
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::IsOpen
-// -----------------------------------------------------------------------------
-//
-TBool CNSmlNotepadDatabase::IsOpen()
-	{
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::IsOpen(): begin");
-	_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::IsOpen(): end");
-    return iOpened;
-    }
-
-
-// ------------------------------------------------------------------------------------------------
-// CArrayPtr<CNpdItem>* CNSmlNotepadDatabase::FetchItemsLC(TBool aIncludeText,
-// ------------------------------------------------------------------------------------------------
-CArrayPtr<CNpdItem>* CNSmlNotepadDatabase::FetchItemsLC(TBool aIncludeText,
-                                                    TInt* aKey)
-    {
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::FetchItemsLC(): begin") ;
-
-    CArrayPtr<CNpdItem>* res = new (ELeave) CArrayPtrFlat<CNpdItem> (8);
-    CleanupPtrArrayPushL(res);
-        
-    if(!aKey)
-        {
-        _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::FetchItemsLC(): In aKey case");
-        RPointerArray<CCalInstance> array;
-        CleanupRPtrArrayPushL(array);
-        _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::FetchItemsLC(): After cleaupstack");
-        
-        TCalTime startDate;
-        startDate.SetTimeLocalL(TDateTime(1900, EJanuary, 1, 0, 0, 0, 0));
-        TCalTime endDate;
-        endDate.SetTimeLocalL(TDateTime(2100, EJanuary, 30, 0, 0, 0, 0));
-        CalCommon::TCalTimeRange timeRange(startDate, endDate);
-    
-        iInstanceView->FindInstanceL(array,CalCommon::EIncludeNotes, timeRange);
-        CNpdItem* entry = NULL;
-        TInt i = 0;
-
-        while (i < array.Count())
-            {
-            entry = CNpdItem::NewLC();
-            entry->SetKey( array[i]->Entry().LocalUidL() );
-            entry->SetModified( array[i]->Entry().LastModifiedDateL().TimeUtcL());
-            if(aIncludeText)
-                {
-                _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::FetchItemsLC(): aIncludeText true");
-                HBufC* content = HBufC::NewL( array[i]->Entry().DescriptionL().Length() );
-                content->Des().Copy( array[i]->Entry().DescriptionL() );                
-                entry->SetContent( content );
-                }
-            res->AppendL(entry);
-            _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::FetchItemsLC(): After res->AppendL(entry)");
-            CleanupStack::Pop(entry);
-            _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::FetchItemsLC(): After popping (entry)");
-            i++;
-            }
-        _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::FetchItemsLC(): before pop and destroy");
-        CleanupStack::PopAndDestroy(&array);
-        _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::FetchItemsLC(): After While Loop");
-        }
-    else
-        {
-        _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::FetchItemsLC(): In else case");
-        CCalEntry* entryTobeFetched(NULL);
-        entryTobeFetched = iEntryView->FetchL(*aKey);
-        _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::FetchItemsLC(): After Fetching entry");
-        if(entryTobeFetched)
-            {
-            CleanupStack::PushL(entryTobeFetched); 
-            CNpdItem* entry = CNpdItem::NewLC();
-            entry->SetKey( entryTobeFetched->LocalUidL() );
-            entry->SetModified( entryTobeFetched->LastModifiedDateL().TimeUtcL() );
-            if(aIncludeText)
-                {
-                HBufC* content = HBufC::NewL( entryTobeFetched->DescriptionL().Length() );
-                content->Des().Copy( entryTobeFetched->DescriptionL() );                
-                entry->SetContent( content );
-                }
-            res->AppendL(entry);
-            CleanupStack::Pop(entry);
-            CleanupStack::PopAndDestroy(entryTobeFetched);
-            }
-        }
-    _NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::FetchItemLC(): end");
-    return res;
-    }
-
-// -----------------------------------------------------------------------------
-// CNSmlNotepadDatabase::CloseAgendaSessions
-// -----------------------------------------------------------------------------
-//
-void CNSmlNotepadDatabase::CloseAgendaSessions()
-    {
-    if(iInstanceView)
-        {
-        delete iInstanceView;
-        iInstanceView = NULL;
-        }
-    if(iEntryView)
-        {
-        delete iEntryView;
-        iEntryView = NULL;
-        }
-    if(iSession)
-        {
-        delete iSession;
-        iSession = NULL;
-        }
-    }
-
-
-
-// -----------------------------------------------------------------------------
-// CNpdItem class implementations
-// -----------------------------------------------------------------------------
-
-
-// -----------------------------------------------------------------------------
-// CNpdItem::~CNpdItem
-// -----------------------------------------------------------------------------
-//
-CNpdItem::~CNpdItem()
-	{
-	_NOTEPAD_DBG_FILE("CNpdItem::~CNpdItem: begin");
-	delete iContent;
-	_NOTEPAD_DBG_FILE("CNpdItem::~CNpdItem: end");
-	}
-// -----------------------------------------------------------------------------
-// CNpdItem::NewL
-// -----------------------------------------------------------------------------
-//
-CNpdItem* CNpdItem::NewLC()
-	{
-	_NOTEPAD_DBG_FILE("CNpdItem::NewLC: begin");
-	CNpdItem* tmp = new (ELeave) CNpdItem();
-	CleanupStack::PushL(tmp);
-	//tmp->ConstructL(0, TTime(), NULL);
-	_NOTEPAD_DBG_FILE("CNpdItem::NewLC: end");
-	return tmp;
-	}
-
-// -----------------------------------------------------------------------------
-// CNpdItem::NewL
-// -----------------------------------------------------------------------------
-//
-CNpdItem* CNpdItem::NewLC(TInt aKey, const TTime& aLastModified, HBufC *aContent)
-	{
-	_NOTEPAD_DBG_FILE("CNpdItem::NewLC(TInt aKey, const TTime& aLastModified, HBufC *aContent): begin");
-	CNpdItem* tmp = new (ELeave) CNpdItem(aKey,aLastModified,aContent);
-	CleanupStack::PushL(tmp);
-	//tmp->ConstructL(aKey, aLastModified, aContent);
-	_NOTEPAD_DBG_FILE("CNpdItem::NewLC(TInt aKey, const TTime& aLastModified, HBufC *aContent): end");
-	return tmp;
-	}
-
-// -----------------------------------------------------------------------------
-// CNpdItem::CNpdItem()
-// -----------------------------------------------------------------------------
-//
-CNpdItem::CNpdItem() : iKey(0), iLastModified(Time::MinTTime()), iContent(NULL)
-	{
-	_NOTEPAD_DBG_FILE("NpdItem::CNpdItem(): begin");
-	_NOTEPAD_DBG_FILE("NpdItem::CNpdItem(): end");
-	}
-
-// -----------------------------------------------------------------------------
-// CNpdItem::CNpdItem(TInt aKey,const TTime& aLastModified, HBufC *aContent)
-// -----------------------------------------------------------------------------
-//
-CNpdItem::CNpdItem(TInt aKey, 
-					const TTime& aLastModified, 
-					HBufC *aContent) : iKey(aKey), 
-										iLastModified(aLastModified), 
-										iContent(aContent)
-	{
-	_NOTEPAD_DBG_FILE("NpdItem::CNpdItem(): begin");
-	_NOTEPAD_DBG_FILE("NpdItem::CNpdItem(): end");
-	}
-	
-
-// -----------------------------------------------------------------------------
-// CNpdItem::Key
-// -----------------------------------------------------------------------------
-//
-TInt CNpdItem::Key() const
-	{
-	_NOTEPAD_DBG_FILE("CNpdItem::Key(): begin");
-	_NOTEPAD_DBG_FILE("CNpdItem::Key(): end");
-	return iKey;
-	}
-// -----------------------------------------------------------------------------
-// CNpdItem::LastModified
-// -----------------------------------------------------------------------------
-//
-TTime CNpdItem::LastModified() const
-	{
-	_NOTEPAD_DBG_FILE("CNpdItem::LastModified(): begin");
-	_NOTEPAD_DBG_FILE("CNpdItem::LastModified(): end");
-	return iLastModified;
-	}
-// -----------------------------------------------------------------------------
-// CNpdItem::Content
-// -----------------------------------------------------------------------------
-//
-HBufC* CNpdItem::Content()
-	{
-	_NOTEPAD_DBG_FILE("NpdItem::Content(): begin");
-	_NOTEPAD_DBG_FILE("NpdItem::Content(): end");
-	return iContent;
-	}
-// -----------------------------------------------------------------------------
-// CNpdItem::Set
-// -----------------------------------------------------------------------------
-//
-void CNpdItem::Set(TInt aKey, const TTime& aLastModified, HBufC *aContent)
-	{
-	_NOTEPAD_DBG_FILE("CNpdItem::Set(): begin");
-	iKey = aKey;
-	iLastModified = aLastModified;
-    SetContent(aContent);
-    _NOTEPAD_DBG_FILE("CNpdItem::Set(): end");
-	}
-
-// -----------------------------------------------------------------------------
-// CNpdItem::Set
-// -----------------------------------------------------------------------------
-//
-void CNpdItem::SetKey(TInt aKey)
-    {
-    _NOTEPAD_DBG_FILE("CNpdItem::SetKey(): begin");
-     iKey = aKey;
-    _NOTEPAD_DBG_FILE("CNpdItem::SetKey(): end");
-    }
-
-// -----------------------------------------------------------------------------
-// CNpdItem::SetContent
-// -----------------------------------------------------------------------------
-//
-void CNpdItem::SetContent(HBufC *aContent)
-	{
-	_NOTEPAD_DBG_FILE("CNpdItem::SetContent(): begin");
-    iContent = aContent;
-    _NOTEPAD_DBG_FILE("CNpdItem::SetContent(): end");
-	}
-
-// -----------------------------------------------------------------------------
-// CNpdItem::SetModified
-// -----------------------------------------------------------------------------
-//
-void CNpdItem::SetModified(const TTime& aLastModified)
-	{
-	_NOTEPAD_DBG_FILE("CNpdItem::SetModified(): begin");
-	iLastModified = aLastModified;
-	_NOTEPAD_DBG_FILE("CNpdItem::SetModified(): end");
-	}
-
-// End of File
--- a/omads/omadsextensions/adapters/notes/src/nsmlnotepaddataprovider.rss	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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:  Registery info for DS notepad
-*
-*/
-
-
-
-#include <101F85F8.loc>
-#include <registryinfo.rh>
-
-#define KNSMLDSINTERFACEUID 0x101F4D3A
-
-RESOURCE REGISTRY_INFO theRegistryInfo
-  {
-  //dll_uid = 0x101F85F8; // DS interface implementation UID
-  dll_uid = 0x101F8612;
-  interfaces = 
-      {
-      INTERFACE_INFO
-          {
-          interface_uid = KNSMLDSINTERFACEUID; //DS interface UID
-          implementations = 
-            {
-            IMPLEMENTATION_INFO
-                {
-                //implementation_uid = 0x101F85F8; // DS interface implementation UID
-                implementation_uid = 0x101F8612;
-                version_no = 1; 
-                display_name = qtn_nsml_npd_display_name; 
-                default_data = ""; 
-                opaque_data = "";
-                }
-            };
-          }
-      };
-    }
Binary file omads/omadsextensions/adapters/sms/group/10206B5C.XML has changed
--- a/omads/omadsextensions/adapters/sms/group/SmsDataProvider.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/group/SmsDataProvider.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -27,13 +27,13 @@
 VENDORID        VID_DEFAULT
 
 SOURCEPATH      ../src
-SOURCE          smsdataprovider.cpp
-SOURCE          smsdatastore.cpp
-SOURCE          smsadaptermsvapi.cpp
-SOURCE          vmessageparser.cpp
-SOURCE          changefinder.cpp
-SOURCE          snapshotitem.cpp
-SOURCE          omadsfolderobject.cpp
+SOURCE          SmsDataProvider.cpp
+SOURCE          SmsDataStore.cpp
+SOURCE          SMSAdapterMsvApi.cpp
+SOURCE          VMessageParser.cpp
+SOURCE          ChangeFinder.cpp
+SOURCE          SnapshotItem.cpp
+SOURCE          OMADSFolderObject.cpp
 
 USERINCLUDE     ../inc
 
@@ -41,13 +41,13 @@
 
 
 SOURCEPATH      ../src
-START RESOURCE  smsdataprovider.rss
+START RESOURCE  SmsDataProvider.rss
 HEADER
 TARGET          smsdataprovider.rsc
 TARGETPATH      ECOM_RESOURCE_DIR
 END
 
-START RESOURCE  smsdatastore.rss
+START RESOURCE  SmsDataStore.rss
 HEADER
 TARGET          smsdatastore.rsc  
 TARGETPATH      RESOURCE_FILES_DIR
--- a/omads/omadsextensions/adapters/sms/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -23,7 +23,8 @@
 DEFAULT
 
 PRJ_EXPORTS
-./10206b5c.xml      Z:/private/101F99F6/capability/10206b5c.xml
+./10206B5C.XML      /epoc32/data/Z/private/101F99F6/capability/10206B5C.xml
+./10206B5C.XML      /epoc32/release/winscw/udeb/z/private/101F99F6/capability/10206B5C.xml
 ./smsdsa_stub.sis   /epoc32/data/z/system/install/smsdsa_stub.sis
 ../rom/smsdsa.iby   CORE_APP_LAYER_IBY_EXPORT_PATH(smsdsa.iby)
 
--- a/omads/omadsextensions/adapters/sms/group/createstub.bat	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-rem
-rem Copyright (c) 2010 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: Batch file for creating needed stub files.
-rem
-
-makesis -s smsdsa_stub.pkg
\ No newline at end of file
--- a/omads/omadsextensions/adapters/sms/group/smsdsa_stub.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/group/smsdsa_stub.pkg	Wed Sep 01 12:30:02 2010 +0100
@@ -1,5 +1,5 @@
 ;
-; Copyright (c) 2009-2010 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"
@@ -11,13 +11,13 @@
 ;
 ; Contributors:
 ;
-; Description:  SMS plugin pkg-stub file
+; Description:
 ;
 ; Languages
 &EN
 
 ; Header
-#{"SMS DS Plugin"},(0x10206B5C),1,14,0, TYPE=SA
+#{"SMS DS Plugin"},(0x10206B5C),1,0,0, TYPE=SA
 
 ; Localised Vendor name
 %{"Nokia"}
Binary file omads/omadsextensions/adapters/sms/group/smsdsa_stub.sis has changed
--- a/omads/omadsextensions/adapters/sms/inc/ChangeFinder.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/inc/ChangeFinder.h	Wed Sep 01 12:30:02 2010 +0100
@@ -22,7 +22,7 @@
 // INCLUDES
 #include <msvids.h>
 #include <nsmlchangefinder.h>
-#include "snapshotitem.h"
+#include "SnapshotItem.h"
 
 // DATATYPES
 typedef CArrayFixSeg<TSnapshotItem> CSnapshotArray;
--- a/omads/omadsextensions/adapters/sms/inc/Logger.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/inc/Logger.h	Wed Sep 01 12:30:02 2010 +0100
@@ -20,9 +20,14 @@
 #define __LOGGER_H__
 
 #ifdef _DEBUG
-    
-    // Define this to enable file logging
-    #define __FLOGGING__
+    #ifdef __WINS__
+        // File logging for WINS
+        #define __FLOGGING__
+    #else
+        // Logging with RDebug for target HW
+        #define __CLOGGING__
+        //#define __FLOGGING__ // enable to log file on target HW
+    #endif //__WINS__
     
     #include <f32file.h>
     #include <flogger.h>
--- a/omads/omadsextensions/adapters/sms/inc/OMADSFolderObject.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/inc/OMADSFolderObject.h	Wed Sep 01 12:30:02 2010 +0100
@@ -21,7 +21,7 @@
 
 #include <SenXmlReader.h>
 #include <MSenContentHandlerClient.h>
-#include "smsdataproviderdefs.h"
+#include "SmsDataProviderDefs.h"
 
 const TInt KMaxElementLength = 255;
 const TInt KMaxXmlLineLength = 1024;
--- a/omads/omadsextensions/adapters/sms/inc/SmsDataStore.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/inc/SmsDataStore.h	Wed Sep 01 12:30:02 2010 +0100
@@ -21,8 +21,8 @@
 
 // INCLUDES
 #include <SmlDataProvider.h>
-#include "snapshotitem.h"
-#include "changefinder.h"
+#include "SnapshotItem.h"
+#include "ChangeFinder.h"
 
 // FORWARD DECLARATIONS
 class CSmsAdapterMsvApi; 
--- a/omads/omadsextensions/adapters/sms/inc/SnapshotItem.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/inc/SnapshotItem.h	Wed Sep 01 12:30:02 2010 +0100
@@ -22,7 +22,7 @@
 // INCLUDES
 #include <msvids.h>
 #include <nsmlsnapshotitem.h>
-#include "smsdataproviderdefs.h"
+#include "SmsDataProviderDefs.h"
 
 typedef TBuf<KMaxFolderNameLength> TFolderName;
 
--- a/omads/omadsextensions/adapters/sms/inc/VMessageParser.h	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/inc/VMessageParser.h	Wed Sep 01 12:30:02 2010 +0100
@@ -19,7 +19,7 @@
 #ifndef VMESSAGEPARSER_H
 #define VMESSAGEPARSER_H
 
-#include "omadsfolderobject.h"
+#include "OMADSFolderObject.h"
 
 
 // CONSTANTS
--- a/omads/omadsextensions/adapters/sms/rom/smsdsa.iby	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/rom/smsdsa.iby	Wed Sep 01 12:30:02 2010 +0100
@@ -21,9 +21,9 @@
 
 #ifdef __SYNCML_DS_SMS
 
-ECOM_PLUGIN(smsdataprovider.dll,smsdataprovider.rsc)
-data=DATAZ_\RESOURCE_FILES_DIR\smsdatastore.rsc         RESOURCE_FILES_DIR\smsdatastore.rsc
-data=DATAZ_\private\101F99F6\capability\10206b5c.xml    private\101F99F6\capability\10206b5c.xml
+ECOM_PLUGIN(smsdataprovider.dll,smsdataprovider.RSC)
+data=DATAZ_\RESOURCE_FILES_DIR\smsdatastore.RSC         RESOURCE_FILES_DIR\smsdatastore.RSC
+data=DATAZ_\private\101F99F6\capability\10206B5C.XML    private\101F99F6\capability\10206B5C.XML
 data=ZSYSTEM\install\smsdsa_stub.sis                    system\install\smsdsa_stub.sis
 
 #endif
--- a/omads/omadsextensions/adapters/sms/sis/backup_registration.xml	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<?xml version="1.0" standalone="yes"?> 
-<backup_registration>
-    <system_backup />
-    <restore requires_reboot = "no"/>
-</backup_registration> 
\ No newline at end of file
--- a/omads/omadsextensions/adapters/sms/sis/sms.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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: SMS plugin pkg file
-;
-
-
-;*Unique (Non-Localised) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade ofa a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localised vendor name(s) correspodning to language(s).
-%{"Nokia"}
-
-;Language - standard language definitions
-&EN
-
-;package-header
-#{"SMS DS Plugin"},(0x10206B5C),1,14,0,TYPE=SA, RU
-
-; S60 v5.2
-[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
-
-"\epoc32\data\z\resource\smsdatastore.rsc"             -"c:\resource\smsdatastore.rsc"
-"\epoc32\data\z\resource\plugins\smsdataprovider.rsc"  -"c:\resource\plugins\smsdataprovider.rsc"
-"\epoc32\release\armv5\urel\smsdataprovider.dll"       -"c:\sys\bin\smsdataprovider.dll"
-
-"\epoc32\data\Z\private\101F99F6\capability\10206b5c.xml"   -"c:\private\101F99F6\import\10206b5c.xml"
-"backup_registration.xml"                                   -"c:\private\10202D56\import\packages\10206B5C\backup_registration.xml"
--- a/omads/omadsextensions/adapters/sms/sis/sms_debug.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-;
-; Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: SMS debug plugin pkg file
-;
-
-
-;*Unique (Non-Localised) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade ofa a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localised vendor name(s) correspodning to language(s).
-%{"Nokia"}
-
-;Language - standard language definitions
-&EN
-
-;package-header
-#{"SMS DS Plugin"},(0x10206B5C),1,14,0,TYPE=SA, RU
-
-; S60 v5.2
-[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
-
-"\epoc32\data\z\resource\smsdatastore.rsc"             -"c:\resource\smsdatastore.rsc"
-"\epoc32\data\z\resource\plugins\smsdataprovider.rsc"  -"c:\resource\plugins\smsdataprovider.rsc"
-"\epoc32\release\armv5\udeb\smsdataprovider.dll"       -"c:\sys\bin\smsdataprovider.dll"
-
-"\epoc32\data\Z\private\101F99F6\capability\10206b5c.xml"   -"c:\private\101F99F6\import\10206b5c.xml"
-"backup_registration.xml"                                   -"c:\private\10202D56\import\packages\10206B5C\backup_registration.xml"
--- a/omads/omadsextensions/adapters/sms/src/ChangeFinder.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/src/ChangeFinder.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -16,8 +16,8 @@
 */
 
 
-#include "changefinder.h"
-#include "logger.h"
+#include "ChangeFinder.h"
+#include "Logger.h"
 
 const TUint KSnapshotFormatVersion ( 0xf0000001 ); // format version
 
--- a/omads/omadsextensions/adapters/sms/src/OMADSFolderObject.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/src/OMADSFolderObject.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -17,9 +17,9 @@
 
 
 #include <SenXmlUtils.h>
-#include "omadsfolderobject.h"
+#include "OMADSFolderObject.h"
 #include "utf.h"
-#include "logger.h"
+#include "Logger.h"
 
 _LIT8(KOMADSFolderElement, "Folder");
 _LIT8(KOMADSNameElement, "name");
--- a/omads/omadsextensions/adapters/sms/src/SMSAdapterMsvApi.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/src/SMSAdapterMsvApi.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -28,10 +28,10 @@
 #include <cntdb.h>
 #include <cntitem.h>
 #include <cntfldst.h>
-#include "smsadaptermsvapi.h"
-#include "logger.h" 
-#include "vmessageparser.h"
-#include "smsdataproviderdefs.h"
+#include "SMSAdapterMsvApi.h"
+#include "Logger.h" 
+#include "VMessageParser.h"
+#include "SmsDataProviderDefs.h"
 
 
 // CONSTANTS
--- a/omads/omadsextensions/adapters/sms/src/SmsDataProvider.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/src/SmsDataProvider.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -26,10 +26,10 @@
 #include <smsdatastore.rsg>
 #include <SmlDataFormat.h>
 #include <ecom/implementationproxy.h>
-#include "smsdataprovider.h"
-#include "smsdataproviderdefs.h"
-#include "logger.h" 
-#include "smsdatastore.h"
+#include "SmsDataProvider.h"
+#include "SmsDataProviderDefs.h"
+#include "Logger.h" 
+#include "SmsDataStore.h"
 
 // -----------------------------------------------------------------------------
 // CSmsDataProvider::CSmsDataProvider
--- a/omads/omadsextensions/adapters/sms/src/SmsDataStore.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/src/SmsDataStore.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -22,12 +22,12 @@
 #include <msvids.h>
 #include <mtclreg.h>
 #include <centralrepository.h>
-#include "smsdatastore.h"
-#include "smsdataproviderdefs.h"
-#include "logger.h"
-#include "smsadaptermsvapi.h"
-#include "vmessageparser.h"
-#include "omadsfolderobject.h"
+#include "SmsDataStore.h"
+#include "SmsDataProviderDefs.h"
+#include "Logger.h"
+#include "SMSAdapterMsvApi.h"
+#include "VMessageParser.h"
+#include "OMADSFolderObject.h"
 
 // This is used, when databuffer is not initialized
 const TInt KDataBufferNotReady = -1;
--- a/omads/omadsextensions/adapters/sms/src/SnapshotItem.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/src/SnapshotItem.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -17,7 +17,7 @@
 
 
 #include <msvuids.h>
-#include "snapshotitem.h"
+#include "SnapshotItem.h"
 
 
 // -----------------------------------------------------------------------------
--- a/omads/omadsextensions/adapters/sms/src/VMessageParser.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/adapters/sms/src/VMessageParser.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -20,8 +20,8 @@
 #include <e32std.h>
 #include <msvids.h>
 #include <txtrich.h>
-#include "vmessageparser.h"
-#include "logger.h"
+#include "VMessageParser.h"
+#include "Logger.h"
 
 
 const TInt KVersionMaxLength = 4;
--- a/omads/omadsextensions/datamod/bld/nsmldatamod.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/datamod/bld/nsmldatamod.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -9,7 +9,7 @@
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
 *
-* Contributors:	
+* Contributors:
 *
 * Description:  mmp file for DS Data Modification
 *
@@ -25,7 +25,7 @@
 CAPABILITY 		CAP_GENERAL_DLL
 VENDORID		VID_DEFAULT
 
-#if defined(EABI)
+#if defined(ARMCC)
 DEFFILE			./def/eabidatamod
 #elif defined(WINSCW)
 DEFFILE			./def/bwinscwdatamod
--- a/omads/omadsextensions/dsutils/cgiscriptutils/bld/nsmlCGIScriptParser.mmp	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/dsutils/cgiscriptutils/bld/nsmlCGIScriptParser.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -26,7 +26,7 @@
 VENDORID 	VID_DEFAULT
 
 
-#if defined(EABI)
+#if defined(ARMCC)
 DEFFILE		./def/eabicgiscriptparser
 #elif defined(WINSCW)
 DEFFILE		./def/bwinscwcgiscriptparser
--- a/omads/omadsextensions/dsutils/contactsdatastoreextension/contactsdatastoreextension.pro	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#
-# ============================================================================
-#  Name        : contactsdatastoreextension.pro
-#  Part of     : contactsdatastoreextension    
-#  Description : Project file
-#
-#  Copyright © 2009 Nokia.  All rights reserved.
-#  This material, including documentation and any related computer
-#  programs, is protected by copyright controlled by Nokia.  All
-#  rights are reserved.  Copying, including reproducing, storing,
-#  adapting or translating, any or all of this material requires the
-#  prior written consent of Nokia.  This material also contains
-#  confidential information which may not be disclosed to others
-#  without the prior written consent of Nokia.
-# ============================================================================
-# 
-
-
-TEMPLATE = lib
-TARGET = nsmlcontactsdatastoreextension
-DEPENDPATH += ../../contactsdatastoreextension ../inc ../src
-INCLUDEPATH += .
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-
-
-DEFINES += BUILD_CONTACTSDATASTOREEXTENSION
-
-PRIVATE_HEADERS += ./inc/nsmlcontactsdatastoreextension_p.h
-
-# Implementation
-SOURCES += ./src/nsmlcontactsdatastoreextension.cpp \
-		   ./src/nsmlcontactsdatastoreextension_p.cpp
-		   
-HEADERS += \
-       $$PRIVATE_HEADERS
-
-qtAddLibrary(QtContacts)
-qtAddLibrary(QtVersit)
-qtAddLibrary(XQUtils)
-LIBS += -lestor.dll \
-		-lbafl.dll  \
-		-lnsmldebug.dll \
-		
-		
-defBlock = \
- "$${LITERAL_HASH}if defined(EABI)" \
- "DEFFILE ./def/eabicontactsdatastoreextension" \
- "$${LITERAL_HASH}elif defined(WINSCW)" \
- "DEFFILE ./def/bwinscwcontactsdatastoreextension" \
- "$${LITERAL_HASH}endif"
- 
-MMP_RULES += defBlock
-
-symbian { 
-	TARGET.UID3 = 0x2002DC83
-	TARGET.EPOCSTACKSIZE = 0x14000
-	TARGET.EPOCHEAPSIZE = "0x020000 0x800000"
-	TARGET.EPOCALLOWDLLDATA = 1
-    TARGET.CAPABILITY = CAP_GENERAL_DLL    
-}
\ No newline at end of file
--- a/omads/omadsextensions/dsutils/contactsdatastoreextension/def/bwinscwcontactsdatastoreextensionu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-EXPORTS
-	?MachineIdL@CNsmlContactsDataStoreExtension@@QAE_JXZ @ 1 NONAME ; long long CNsmlContactsDataStoreExtension::MachineIdL(void)
-	?NewLC@CNsmlContactItem@@KAPAV1@XZ @ 2 NONAME ; class CNsmlContactItem * CNsmlContactItem::NewLC(void)
-	?ListStoresL@CNsmlContactsDataStoreExtension@@QAEXPAVCDesC16Array@@@Z @ 3 NONAME ; void CNsmlContactsDataStoreExtension::ListStoresL(class CDesC16Array *)
-	?NewL@CNsmlContactsDataStoreExtension@@SAPAV1@ABVTDesC16@@@Z @ 4 NONAME ; class CNsmlContactsDataStoreExtension * CNsmlContactsDataStoreExtension::NewL(class TDesC16 const &)
-	?ListContactsL@CNsmlContactsDataStoreExtension@@QAEXPAV?$CArrayFixFlat@VTUid@@@@@Z @ 5 NONAME ; void CNsmlContactsDataStoreExtension::ListContactsL(class CArrayFixFlat<class TUid> *)
-	?ReadContactL@CNsmlContactsDataStoreExtension@@QAEHABVTUid@@PAVCNsmlContactItem@@@Z @ 6 NONAME ; int CNsmlContactsDataStoreExtension::ReadContactL(class TUid const &, class CNsmlContactItem *)
-	?DeleteContactL@CNsmlContactsDataStoreExtension@@QAEHABVTUid@@@Z @ 7 NONAME ; int CNsmlContactsDataStoreExtension::DeleteContactL(class TUid const &)
-	?ConstructL@CNsmlContactsDataStoreExtension@@IAEXABVTDesC16@@@Z @ 8 NONAME ; void CNsmlContactsDataStoreExtension::ConstructL(class TDesC16 const &)
-	?ImportContactsL@CNsmlContactsDataStoreExtension@@QAEPAV?$CArrayFixFlat@VTUid@@@@ABVTDesC8@@@Z @ 9 NONAME ; class CArrayFixFlat<class TUid> * CNsmlContactsDataStoreExtension::ImportContactsL(class TDesC8 const &)
-	??0CNsmlContactsDataStoreExtension@@IAE@XZ @ 10 NONAME ; CNsmlContactsDataStoreExtension::CNsmlContactsDataStoreExtension(void)
-	??1CNsmlContactsDataStoreExtension@@UAE@XZ @ 11 NONAME ; CNsmlContactsDataStoreExtension::~CNsmlContactsDataStoreExtension(void)
-	?ExportContactsL@CNsmlContactsDataStoreExtension@@QAEHABVTUid@@AAVCBufBase@@@Z @ 12 NONAME ; int CNsmlContactsDataStoreExtension::ExportContactsL(class TUid const &, class CBufBase &)
-	??0CNsmlContactItem@@IAE@XZ @ 13 NONAME ; CNsmlContactItem::CNsmlContactItem(void)
-	?NewLC@CNsmlContactsDataStoreExtension@@KAPAV1@ABVTDesC16@@@Z @ 14 NONAME ; class CNsmlContactsDataStoreExtension * CNsmlContactsDataStoreExtension::NewLC(class TDesC16 const &)
-	??1CNsmlContactItem@@UAE@XZ @ 15 NONAME ; CNsmlContactItem::~CNsmlContactItem(void)
-	?DeleteContactsL@CNsmlContactsDataStoreExtension@@QAEHPAV?$CArrayFixFlat@VTUid@@@@@Z @ 16 NONAME ; int CNsmlContactsDataStoreExtension::DeleteContactsL(class CArrayFixFlat<class TUid> *)
-	?NewL@CNsmlContactItem@@SAPAV1@XZ @ 17 NONAME ; class CNsmlContactItem * CNsmlContactItem::NewL(void)
-	?DeleteAllContactsL@CNsmlContactsDataStoreExtension@@QAEHXZ @ 18 NONAME ; int CNsmlContactsDataStoreExtension::DeleteAllContactsL(void)
-
--- a/omads/omadsextensions/dsutils/contactsdatastoreextension/def/eabicontactsdatastoreextensionu.def	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-EXPORTS
-	_ZN16CNsmlContactItem4NewLEv @ 1 NONAME
-	_ZN16CNsmlContactItem5NewLCEv @ 2 NONAME
-	_ZN16CNsmlContactItemC1Ev @ 3 NONAME
-	_ZN16CNsmlContactItemC2Ev @ 4 NONAME
-	_ZN16CNsmlContactItemD0Ev @ 5 NONAME
-	_ZN16CNsmlContactItemD1Ev @ 6 NONAME
-	_ZN16CNsmlContactItemD2Ev @ 7 NONAME
-	_ZN31CNsmlContactsDataStoreExtension10ConstructLERK7TDesC16 @ 8 NONAME
-	_ZN31CNsmlContactsDataStoreExtension10MachineIdLEv @ 9 NONAME
-	_ZN31CNsmlContactsDataStoreExtension11ListStoresLEP12CDesC16Array @ 10 NONAME
-	_ZN31CNsmlContactsDataStoreExtension12ReadContactLERK4TUidP16CNsmlContactItem @ 11 NONAME
-	_ZN31CNsmlContactsDataStoreExtension13ListContactsLEP13CArrayFixFlatI4TUidE @ 12 NONAME
-	_ZN31CNsmlContactsDataStoreExtension14DeleteContactLERK4TUid @ 13 NONAME
-	_ZN31CNsmlContactsDataStoreExtension15DeleteContactsLEP13CArrayFixFlatI4TUidE @ 14 NONAME
-	_ZN31CNsmlContactsDataStoreExtension15ExportContactsLERK4TUidR8CBufBase @ 15 NONAME
-	_ZN31CNsmlContactsDataStoreExtension15ImportContactsLERK6TDesC8 @ 16 NONAME
-	_ZN31CNsmlContactsDataStoreExtension18DeleteAllContactsLEv @ 17 NONAME
-	_ZN31CNsmlContactsDataStoreExtension4NewLERK7TDesC16 @ 18 NONAME
-	_ZN31CNsmlContactsDataStoreExtension5NewLCERK7TDesC16 @ 19 NONAME
-	_ZN31CNsmlContactsDataStoreExtensionC1Ev @ 20 NONAME
-	_ZN31CNsmlContactsDataStoreExtensionC2Ev @ 21 NONAME
-	_ZN31CNsmlContactsDataStoreExtensionD0Ev @ 22 NONAME
-	_ZN31CNsmlContactsDataStoreExtensionD1Ev @ 23 NONAME
-	_ZN31CNsmlContactsDataStoreExtensionD2Ev @ 24 NONAME
-
--- a/omads/omadsextensions/dsutils/contactsdatastoreextension/inc/nsmlcontactsdatastoreextension_p.h	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +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:  Private header file for extended Contacts API
-*
-*/
-
-
-#ifndef NSMLCONTACTSDATASTOREEXTENSIONPRIVATE_H_
-#define NSMLCONTACTSDATASTOREEXTENSIONPRIVATE_H_
-
-#include <QObject>
-#include <qmobilityglobal.h>
-
-QTM_BEGIN_NAMESPACE
-class QVersitWriter;
-class QVersitReader;
-class QVersitContactExporter;
-class QVersitContactImporter;
-class QContactManager;
-QTM_END_NAMESPACE
-class QBuffer;
-class QDateTime;
-class QTime;
-class CNsmlContactsStoreUtil;
-class CNsmlContactItem;
-class RDesReadStream;
-
-QTM_USE_NAMESPACE
-class CNsmlContactsDataStoreExtensionPrivate: public CBase
-{
-public:
-    /**
-    * C++ constructor.
-    */
-    CNsmlContactsDataStoreExtensionPrivate( const TDesC &manager );
-    
-    /**
-    * Destructor.
-    */
-    ~CNsmlContactsDataStoreExtensionPrivate();
-    
-public: // Methods
-    /**
-    * Fetch the Contact Item from the DB 
-    * @param uid UID of the desired item to be fetched
-    * @param contactbufbase on return will have the fetched Contact details
-    */
-    TInt ExportContactsL( const TUid &uid, CBufBase &contactbufbase );
-    
-    /**
-    * Store the Contact Item to the DB
-    * @param contactbufbase Contact item to be saved to the DB
-    * @return A pointer to list of newly saved Contact UIDs'
-    */
-    CArrayFixFlat<TUid>* ImportContactsL( const TDesC8 &contactbufbase );
-    
-    /**
-    * Fetch Contact details
-    * @param uid UID of the desired Contact item
-    * @param contactitem on return will have pointer class containing contact details
-    */
-    TInt ReadContactL( const TUid &uid, CNsmlContactItem *contactitem );
-    
-    /**
-    * Delete a Contact
-    * @param uid UID of the desired Contact item
-    * @return status of the operation
-    */
-    TBool DeleteContactL( const TUid &uid );
-    
-    /**
-    * Delete List of Contacts
-    * @param arrDelete List of Contact UIDs' to be deleted
-    * @return status of the operation
-    */
-    TBool DeleteContactsL( CArrayFixFlat<TUid> *arrDelete );
-    
-    /**
-    * Delete All Contacts
-    * @return status of the operation
-    */
-    TBool DeleteAllContactsL();
-    
-    /**
-    * List Supported Stores
-    * @param contactuidlist on return will have list of stores
-    */
-    void ListStoresL( CDesCArray *contactuidlist );
-    
-    /**
-    * Unique ID for a Store
-    * @return unique id represented as integer  
-    */
-    TInt64 MachineIdL();
-    
-    /**
-    * Fetch all available Contacts from the DB
-    * @param contactuidlist on return will have list of all Contact UIDs'
-    */
-    void ListContactsL( CArrayFixFlat<TUid> *contactuidlist );
-private:
-    /**
-    * Convert the given QDateTime to S60 TTime
-    * @param datetime variable to be converted
-    */
-    TTime qTimeToS60TTime(const QDateTime &datetime);
-    
-   
-private: // Data
-    QString mManagerName;
-	QContactManager *mContactManager;
- 	QVersitWriter *mWriter;
- 	QVersitReader *mReader;
-	QVersitContactExporter *mExporter;
-	QVersitContactImporter *mImporter;
-};
-
-#endif /* NSMLCONTACTSDATASTOREEXTENSIONPRIVATE_H_*/
--- a/omads/omadsextensions/dsutils/contactsdatastoreextension/sis/contactsdatastoreextension.pkg	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-;
-; Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:  Stub Package file for nsmlcontactsdatastoreextension.dll
-;
-; Language
-&EN
-
-; SIS header: name, uid, version
-#{"contactsdatastoreextension"},(0x2002E6D9),1,0,0, TYPE=SP
-
-
-; Localised Vendor name
-%{"Vendor"}
-
-; Unique Vendor name
-:"Vendor"
-
-; Manual PKG pre-rules from PRO files
-; Default HW/platform dependencies
-[0x101F7961],0,0,0,{"S60ProductID"}
-[0x102032BE],0,0,0,{"S60ProductID"}
-[0x102752AE],0,0,0,{"S60ProductID"}
-[0x1028315F],0,0,0,{"S60ProductID"}
- 
-; Default dependency to Qt libraries
-(0x2001E61C),0 ,0 ,0 , {"QtLibs pre-release"}
-
-; Executable and default resource files
-"/epoc32/release/armv5/urel/nsmlcontactsdatastoreextension.dll"    - "!:\sys\bin\nsmlcontactsdatastoreextension.dll"
-
-; Manual PKG post-rules from PRO files
--- a/omads/omadsextensions/dsutils/contactsdatastoreextension/src/nsmlcontactsdatastoreextension.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,276 +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:  DS contacts data store extension api
-*
-*/
-
-#include <e32base.h>
-#include <s32strm.h>
-#include <badesca.h>
-#include <nsmlcontactsdatastoreextension.h>
-#include "nsmldebug.h"
-#include "nsmlcontactsdatastoreextension_p.h"
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::NewL()
-// ----------------------------------------------------------------------------
-EXPORT_C CNsmlContactsDataStoreExtension* CNsmlContactsDataStoreExtension::NewL( const TDesC& aManager )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::NewL: BEGIN");
-    CNsmlContactsDataStoreExtension* self = NewLC( aManager );
-    CleanupStack::Pop();
-    _DBG_FILE("CNsmlContactsDataStoreExtension::NewL: END");
-    return self;
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::NewLC()
-// ----------------------------------------------------------------------------
-EXPORT_C CNsmlContactsDataStoreExtension* CNsmlContactsDataStoreExtension::NewLC( const TDesC& aManager )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::NewLC: BEGIN");
-    CNsmlContactsDataStoreExtension* self = new (ELeave) CNsmlContactsDataStoreExtension();
-    CleanupStack::PushL( self );
-    self->ConstructL( aManager );
-    _DBG_FILE("CNsmlContactsDataStoreExtension::NewLC: END");
-    return self;
-    }
-    
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::CNsmlContactsDataStoreExtension()
-// ----------------------------------------------------------------------------
-EXPORT_C CNsmlContactsDataStoreExtension::CNsmlContactsDataStoreExtension()
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::CNsmlContactsDataStoreExtension: BEGIN");
-    _DBG_FILE("CNsmlContactsDataStoreExtension::CNsmlContactsDataStoreExtension: END");
-    }
-    
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::ConstructL()
-// ----------------------------------------------------------------------------
-EXPORT_C void CNsmlContactsDataStoreExtension::ConstructL( const TDesC& aManager )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ConstructL: BEGIN");
-    d_ptr = new CNsmlContactsDataStoreExtensionPrivate( aManager );    
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ConstructL: END");
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::~CNsmlContactsDataStoreExtension()
-// ----------------------------------------------------------------------------
-EXPORT_C CNsmlContactsDataStoreExtension::~CNsmlContactsDataStoreExtension()
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::~CNsmlContactsDataStoreExtension: BEGIN");
-    if( d_ptr)
-        {
-        delete d_ptr;
-        d_ptr = NULL;
-        }
-    _DBG_FILE("CNsmlContactsDataStoreExtension::~CNsmlContactsDataStoreExtension: END");
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::ExportContactsL()
-// ----------------------------------------------------------------------------
-EXPORT_C TInt CNsmlContactsDataStoreExtension::ExportContactsL( const TUid& aUid, 
-                                                                CBufBase& aContactbufbase )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ExportContactsL: BEGIN");
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ExportContactsL: END");
-    if( d_ptr )
-        {
-        return d_ptr->ExportContactsL( aUid, aContactbufbase );
-        }
-    else
-        {
-        return KErrGeneral;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::ImportContactsL()
-// ----------------------------------------------------------------------------
-EXPORT_C CArrayFixFlat<TUid>* CNsmlContactsDataStoreExtension::ImportContactsL( const TDesC8& aContactbufbase )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ImportContactsL: BEGIN");
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ImportContactsL: END");
-    if( d_ptr )
-        {
-        return d_ptr->ImportContactsL( aContactbufbase );
-        }
-    else
-        {
-        return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::ReadContactL()
-// ----------------------------------------------------------------------------
-EXPORT_C TInt CNsmlContactsDataStoreExtension::ReadContactL( const TUid& aUid,
-                                                             CNsmlContactItem* aContactitem )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ReadContactL: BEGIN");
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ReadContactL: END");
-    if( d_ptr )
-        {
-        return d_ptr->ReadContactL( aUid, aContactitem );
-        }
-    else
-        {
-        return KErrGeneral;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::DeleteContactL()
-// ----------------------------------------------------------------------------
-EXPORT_C TBool CNsmlContactsDataStoreExtension::DeleteContactL( const TUid& aUid )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::DeleteContactL: BEGIN");
-    _DBG_FILE("CNsmlContactsDataStoreExtension::DeleteContactL: END");
-    if( d_ptr )
-        {
-        return d_ptr->DeleteContactL( aUid );
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::DeleteContactsL()
-// ----------------------------------------------------------------------------
-EXPORT_C  TBool CNsmlContactsDataStoreExtension::DeleteContactsL( CArrayFixFlat<TUid>* aArrDelete )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::DeleteContactsL: BEGIN");
-    _DBG_FILE("CNsmlContactsDataStoreExtension::DeleteContactsL: END");
-    if( d_ptr )
-        {
-        return d_ptr->DeleteContactsL( aArrDelete );
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::DeleteAllContactsL()
-// ----------------------------------------------------------------------------
-EXPORT_C TBool CNsmlContactsDataStoreExtension::DeleteAllContactsL()
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::DeleteAllContactsL: BEGIN");
-    _DBG_FILE("CNsmlContactsDataStoreExtension::DeleteAllContactsL: END");
-    if( d_ptr )
-        {
-        return d_ptr->DeleteAllContactsL();
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::ListStoresL()
-// ----------------------------------------------------------------------------
-EXPORT_C void CNsmlContactsDataStoreExtension::ListStoresL( CDesCArray* aCntstores )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ListStoresL: BEGIN");
-    if( d_ptr )
-        {
-        d_ptr->ListStoresL( aCntstores );
-        }
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ListStoresL: END");
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::MachineIdL()
-// ----------------------------------------------------------------------------
-EXPORT_C TInt64 CNsmlContactsDataStoreExtension::MachineIdL()
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::MachineIdL: BEGIN");
-    _DBG_FILE("CNsmlContactsDataStoreExtension::MachineIdL: END");
-    if( d_ptr )
-        {
-        return d_ptr->MachineIdL();
-        }
-    else
-        {
-        return KErrGeneral;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactsDataStoreExtension::ListContactsL()
-// ----------------------------------------------------------------------------
-EXPORT_C void CNsmlContactsDataStoreExtension::ListContactsL( CArrayFixFlat<TUid>* aContactuidlist )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ListContactsL: BEGIN");
-    if( d_ptr )
-        {
-        d_ptr->ListContactsL( aContactuidlist );
-        }
-    _DBG_FILE("CNsmlContactsDataStoreExtension::ListContactsL: END");
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactItem::NewL()
-// ----------------------------------------------------------------------------
-EXPORT_C CNsmlContactItem* CNsmlContactItem::NewL()
-    {
-    _DBG_FILE("CNsmlContactItem::NewL: BEGIN");
-    CNsmlContactItem* self = NewLC();
-    CleanupStack::Pop();
-    _DBG_FILE("CNsmlContactItem::NewL: END");
-    return self;
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactItem::NewLC()
-// ----------------------------------------------------------------------------
-EXPORT_C CNsmlContactItem* CNsmlContactItem::NewLC()
-    {
-    _DBG_FILE("CNsmlContactItem::NewLC: BEGIN");
-    CNsmlContactItem* self = new (ELeave) CNsmlContactItem();
-    CleanupStack::PushL( self );
-    _DBG_FILE("CNsmlContactItem::NewLC: END");
-    return self;
-    }
-    
-// ----------------------------------------------------------------------------
-// CNsmlContactItem::CNsmlContactItem()
-// ----------------------------------------------------------------------------
-EXPORT_C CNsmlContactItem::CNsmlContactItem()
-    {
-    _DBG_FILE("CNsmlContactItem::CNsmlContactItem: BEGIN");
-    _DBG_FILE("CNsmlContactItem::CNsmlContactItem: END");
-    }
-
-// ----------------------------------------------------------------------------
-// CNsmlContactItem::~CNsmlContactItem()
-// ----------------------------------------------------------------------------
-EXPORT_C CNsmlContactItem::~CNsmlContactItem()
-    {
-    _DBG_FILE("CNsmlContactItem::~CNsmlContactItem: BEGIN");
-    delete iGuid;
-    _DBG_FILE("CNsmlContactItem::~CNsmlContactItem: END");
-    }
-
-
-// End of File
-
-
--- a/omads/omadsextensions/dsutils/contactsdatastoreextension/src/nsmlcontactsdatastoreextension_p.cpp	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,415 +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:  Private implementation file for extended contacts adapter
-*
-*/
-
-#include <s32strm.h>
-#include <s32mem.h>
-#include <e32base.h> 
-#include <badesca.h>
-#include <utf.h>
-#include <e32hashtab.h>
-#include <qcontactmanager.h>
-#include <qcontact.h>
-#include <qcontactname.h>
-#include <qcontactphonenumber.h>
-#include <qcontactsynctarget.h>
-#include <qcontacttimestamp.h>
-#include <qcontactguid.h>
-#include <qcontacttype.h>
-#include <qversitwriter.h>
-#include <qversitreader.h>
-#include <qversitcontactexporter.h>
-#include <qversitcontactimporter.h>
-#include <xqconversions.h> 
-#include <QBuffer>
-#include <QMap>
-#include <nsmlcontactsdatastoreextension.h>
-#include "nsmlcontactsdatastoreextension_p.h"
-#include "nsmldebug.h"
-
-
-#ifndef __WINS__
-// This lowers the unnecessary compiler warning (armv5) to remark.
-// "Warning:  #174-D: expression has no effect..." is caused by 
-// DBG_ARGS8 macro in no-debug builds.
-#pragma diag_remark 174
-#endif
-
-
-/*!
-  \class CNsmlContactsDataStoreExtensionPrivate
-  \brief The CNsmlContactsDataStoreExtensionPrivate class provides interface
-  to access the qtmobility Contacts APIs'
-
-  \sa CNsmlContactsDataStoreExtensionPrivate
- */
-
-
-/*!
- * Constructor
- */
-CNsmlContactsDataStoreExtensionPrivate::CNsmlContactsDataStoreExtensionPrivate(const TDesC &manager )
-{
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::CNsmlContactsDataStoreExtensionPrivate: BEGIN");
-    
-    // Get the QString manager
-    mManagerName = QString::fromUtf16(manager.Ptr(),manager.Length());
-    
-    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::Manager: %S"), &manager );
-    
-    mWriter = new QVersitWriter;
-    mReader = new QVersitReader;
-    mExporter = new QVersitContactExporter;
-    mImporter = new QVersitContactImporter;
-    
-    // Instantiate the Contact Manager
-    mContactManager = NULL;
-    QStringList availableManagers = QContactManager::availableManagers();  
-    
-    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::Manager Count: %d"), availableManagers.count());
-    
-    foreach (const QString manager, availableManagers)
-    {
-        if( mManagerName == manager )
-        {
-            _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::Got a Match");
-            mContactManager = QContactManager::fromUri(QContactManager::buildUri(manager, QMap<QString, QString>()));
-        }
-    }
-    if( mContactManager == NULL )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::Did Not Find a Match");
-        mContactManager = new QContactManager( mManagerName );
-    }
-   
-   _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::CNsmlContactsDataStoreExtensionPrivate: END");
-}
-
-/*!
- * Destructor
- */
-CNsmlContactsDataStoreExtensionPrivate::~CNsmlContactsDataStoreExtensionPrivate()
-{
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::~CNsmlContactsDataStoreExtensionPrivate: BEGIN");
-   
-    
-    if( mContactManager )
-        {
-        delete mContactManager;
-        mContactManager = NULL;
-        }
-    
-    if( mWriter )
-        {
-        delete mWriter;
-        mWriter = NULL;
-        }
-    if( mReader )
-        {
-        delete mReader;
-        mReader = NULL;
-        }
-    if( mExporter )
-        {
-        delete mExporter;
-        mExporter = NULL;
-        }
-    if( mImporter )
-        {
-        delete mImporter;
-        mImporter = NULL;
-        }
-    
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::~CNsmlContactsDataStoreExtensionPrivate: END");
-}
-
-/*!
- * Fetch contact
- */
-TInt CNsmlContactsDataStoreExtensionPrivate::ExportContactsL( const TUid &uid, CBufBase &contactbufbase )
-{
-    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ExportContactsL: BEGIN: UID: %d"), uid);
-   
-    TInt error(KErrNone);
-    QList<QContact> contacts;
-    QBuffer contactsbuf;
-    contactsbuf.open(QBuffer::ReadWrite);    
-    mWriter->setDevice( &contactsbuf );  
-    QContact contact = mContactManager->contact( uid.iUid );
-    error = mContactManager->error();
-    if( error != QContactManager::NoError )
-        {
-        DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ExportContactsL:Error %d"), error );
-        return error; 
-        }
-	contacts.append( contact );    
-    
-    if( mExporter->exportContacts( contacts, QVersitDocument::VCard21Type ) )
-        {
-        QList<QVersitDocument> documents = mExporter->documents();        
-        mWriter->startWriting( documents );
-        bool status = mWriter->waitForFinished();  
-        DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ExportContactsL:status %d"), status);  
-        HBufC8* buf = XQConversions::qStringToS60Desc8( contactsbuf.data() );
-        contactbufbase.InsertL( contactbufbase.Size(), *buf );
-        delete buf;
-        }
-    else
-        {
-        error = KErrGeneral;
-        DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ExportContactsL:Error in exporting %d"), error );
-        }
-    
-    TPtr8 ptrbuf(contactbufbase.Ptr(0));
-    DBG_DUMP( (void*)ptrbuf.Ptr(), ptrbuf.Length(),
-           _S8("CNsmlContactsDataStoreExtensionPrivate::ExportContactsL: From DB:"));  
-    
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::ExportContactsL: END");
-    
-    return error;
-}
-
-/*!
- * Store contact
- */
-CArrayFixFlat<TUid>* CNsmlContactsDataStoreExtensionPrivate::ImportContactsL( const TDesC8 &contactbufbase )
-{
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::ImportContactsL: BEGIN");    
-
-    DBG_DUMP((void*)contactbufbase.Ptr(), contactbufbase.Length(),
-        _S8("CNsmlContactsDataStoreExtensionPrivate::ImportContactsL: To DB :"));      
-    
-    TBool ret( ETrue );
-    CArrayFixFlat<TUid>* contactItems = new(ELeave) CArrayFixFlat<TUid>(4);
-    QBuffer contactsbuf;
-    contactsbuf.open(QBuffer::ReadWrite);
-    QByteArray bytearray((char*)contactbufbase.Ptr());
-    
-    contactsbuf.write(bytearray);
-    contactsbuf.seek(0);
-    
-    mReader->setDevice(&contactsbuf);
-    if (mReader->startReading() && mReader->waitForFinished()) 
-        {
-        DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::Buffer Count: %d"), mReader->results().count() );
-        
-        QList<QContact> contacts;
-        if ( mImporter->importDocuments( mReader->results() ) )
-            {
-            contacts = mImporter->contacts();
-            QMap<int, QContactManager::Error> errorMap;
-            ret = mContactManager->saveContacts( &contacts, &errorMap );           
-            DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::Import Status: %d"), ret );
-            }
-        if( ret )
-            {
-            foreach (QContact contact, contacts ) 
-                {
-                TUint contactid = contact.id().localId();
-                
-                DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::Contact ID: %d"), contactid );
-                
-                contactItems->AppendL( TUid::Uid( contactid ) );
-                }
-            }
-            
-        if( contactItems->Count() <= 0 )
-            {
-            delete contactItems;
-            contactItems = NULL;
-            }
-        }
-    
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::ImportContactsL: END");
-    
-    return contactItems;
-}
-
-/*!
- * Reads a Contact Details
- */
-TInt CNsmlContactsDataStoreExtensionPrivate::ReadContactL( const TUid &uid, CNsmlContactItem *contactitem )
-    {
-    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ReadContactL: BEGIN ID: %d"), uid);
-    
-    TInt error(KErrNone);
-    
-    QContact contact = mContactManager->contact( uid.iUid );
-    error = mContactManager->error();
-    if( error != QContactManager::NoError )
-        {
-        DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ReadContactL:Error %d"), error );
-        return error;
-        }
-        
-    // Fetch the contact details
-    QContactTimestamp timestamp = contact.detail( QContactTimestamp::DefinitionName );
-    // Created Time
-    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::created: %d"), timestamp.created().toTime_t () );
-    
-    // Last Modified Time
-    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::modified: %d"), timestamp.lastModified().toTime_t () );
-    contactitem->iLastModified = qTimeToS60TTime( timestamp.lastModified() );
-       
-    // Contact Type
-    QContactType contacttype = contact.detail( QContactType::DefinitionName );
-    contacttype.type();
-    
-    // GUID
-    QContactGuid contactguid = contact.detail( QContactGuid::DefinitionName );
-    contactitem->iGuid = XQConversions::qStringToS60Desc8( contactguid.guid() );
-    
-    // UID
-    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ReadContactL:LUID %d"), contact.localId() );
-    contactitem->iUid = TUid::Uid(contact.localId());
-    
-    // SyncTarget
-    QContactSyncTarget contactsynctarget = contact.detail( QContactSyncTarget::DefinitionName );
-    contactsynctarget.syncTarget();
-    
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::ReadContactL: END");
-    
-    return error;
-    }
-
-/*!
- * Delete a contact
- */
-TBool CNsmlContactsDataStoreExtensionPrivate::DeleteContactL( const TUid &uid )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::DeleteContactL: BEGIN");
-    
-    TBool ret = mContactManager->removeContact( uid.iUid );
-    
-    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::DeleteContactL: END %d"), ret );
-    
-    return ret;
-    }
-
-/*!
- * Delete array of contacts
- */
-TBool CNsmlContactsDataStoreExtensionPrivate::DeleteContactsL( CArrayFixFlat<TUid> *arrDelete )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::DeleteContactsL: BEGIN");
-    
-    QList<QContactLocalId> contacts;
-    for( TInt count = 0; count < arrDelete->Count(); count++ )
-        {
-        contacts.append( arrDelete->At( count ).iUid );
-        }
-    
-    QMap<int, QContactManager::Error> errorMap;
-    TBool ret = mContactManager->removeContacts( contacts, &errorMap );
-    
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::DeleteContactsL: END");
-    
-    return ret;
-    }
-
-/*!
- * Delete all contacts except selfcontact
- */
-TBool CNsmlContactsDataStoreExtensionPrivate::DeleteAllContactsL()
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::DeleteAllContactsL: BEGIN");
-    
-    QContactLocalId selfcontactid = mContactManager->selfContactId();
-    QList<QContactLocalId> contactIds = mContactManager->contactIds();
-    int index = contactIds.indexOf( selfcontactid );   
-    contactIds.removeAt( index );
-    
-    QMap<int, QContactManager::Error> errorMap;
-    TBool ret = mContactManager->removeContacts( contactIds, &errorMap );
-    
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::DeleteAllContactsL: END");
-    
-    return ret;
-    }
-
-/*!
- * List the available managers
- */
-void CNsmlContactsDataStoreExtensionPrivate::ListStoresL( CDesCArray *cntstores )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::ListStoresL: BEGIN");
-    
-    QStringList availableManagers = QContactManager::availableManagers();    
-    foreach (const QString manager, availableManagers)
-    {
-        HBufC* buf = XQConversions::qStringToS60Desc( manager );
-        cntstores->AppendL( buf->Des() );
-        delete buf;
-    }
-    
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::ListStoresL: END");
-    }
-
-
-/*!
- * Fetch Manager URI
- */
-TInt64 CNsmlContactsDataStoreExtensionPrivate::MachineIdL()
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::MachineIdL: BEGIN");
-   
-    HBufC* buf = XQConversions::qStringToS60Desc( mContactManager->managerUri() );
-    TInt64 machineid = DefaultHash::Des16( buf->Des() );
-    delete buf;
-    
-    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::MachineIdL: %ld"), machineid );
-    
-    return machineid;
-    }
-
-/*!
- * List all contacts
- */
-void CNsmlContactsDataStoreExtensionPrivate::ListContactsL( CArrayFixFlat<TUid> *contactuidlist )
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::ListContactsL: BEGIN");
-    
-    QList<QContactLocalId> contactIds = mContactManager->contactIds();    
-     
-    foreach (QContactLocalId id, contactIds )
-        {
-        DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ListContactsL: %d"), id );
-        contactuidlist->AppendL( TUid::Uid(id) );
-        }    
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::ListContactsL: END");
-    }
-
-/*!
- * Convert QTime to S60 TTime
- */
-TTime CNsmlContactsDataStoreExtensionPrivate::qTimeToS60TTime(const QDateTime &datetime)
-    {
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::qTimeToS60TTime: BEGIN");
-    
-    //Symbian month & day are zero based, so -1 from Qt's
-    TDateTime dt(datetime.date().year(), 
-    TMonth(datetime.date().month() - 1),
-    datetime.date().day() - 1,
-    datetime.time().hour(),
-    datetime.time().minute(),
-    datetime.time().second(),
-    datetime.time().msec() * 1000);
-    
-    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::qTimeToS60TTime: END");
-    return TTime(dt);
-    }
-
-// End of File
--- a/omads/omadsextensions/dsutils/dsutils.pro	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#
-#   Name        : dsutils.pro
-#   Part of     : contentcontrol  
-#   Description : This is the project specification file for the contentcontrol project.
-#   Version     : 1
-#
-#   Copyright © 2009 Nokia.  All rights reserved.
-#   This material, including documentation and any related computer
-#   programs, is protected by copyright controlled by Nokia.  All
-#   rights are reserved.  Copying, including reproducing, storing,
-#   adapting or translating, any or all of this material requires the
-#   prior written consent of Nokia.  This material also contains
-#   confidential information which may not be disclosed to others
-#   without the prior written consent of Nokia.
-#
-
-TEMPLATE = subdirs
-CONFIG += ordered
-SUBDIRS += contactsdatastoreextension
-
-# End of file	--Don't remove this.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/bld/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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_MMPFILES
+nsmldefaultagendahandler.mmp
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/bld/def/bwinscwnsmldefaultagendahandleru.DEF	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,4 @@
+EXPORTS
+	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
+	?NewL@CNSmlDefaultAgendaHandlerPlugin@@SAPAV1@XZ @ 2 NONAME ; class CNSmlDefaultAgendaHandlerPlugin * CNSmlDefaultAgendaHandlerPlugin::NewL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/bld/def/eabinsmldefaultagendahandleru.DEF	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,8 @@
+EXPORTS
+	_Z24ImplementationGroupProxyRi @ 1 NONAME
+	_ZN31CNSmlDefaultAgendaHandlerPlugin4NewLEv @ 2 NONAME
+	_ZTI29CNSmlDefaultAgendaHandlerUtil @ 3 NONAME
+	_ZTI31CNSmlDefaultAgendaHandlerPlugin @ 4 NONAME
+	_ZTV29CNSmlDefaultAgendaHandlerUtil @ 5 NONAME
+	_ZTV31CNSmlDefaultAgendaHandlerPlugin @ 6 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/bld/nsmldefaultagendahandler.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,71 @@
+/*
+* 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:   
+*
+*/
+
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+CAPABILITY      CAP_ECOM_PLUGIN
+VENDORID        VID_DEFAULT
+TARGET          nsmldefaultagendahandler.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x20029F16
+
+START  RESOURCE ../data/nsmldefaultagendahandler.rss
+TARGET           nsmldefaultagendahandler.rsc
+END
+
+START RESOURCE ../data/nsmldefaultagendahandler_1_2.rss
+HEADER
+TARGETPATH	RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END 
+
+SOURCEPATH      ../src
+SOURCE          nsmldefaultagendahandlerutil.cpp
+SOURCE          nsmldefaultagendahandlerplugin.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../loc
+
+SYSTEMINCLUDE /epoc32/include/ecom
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         eCom.lib
+LIBRARY         efsrv.lib 
+LIBRARY         estor.lib
+LIBRARY         flogger.lib
+LIBRARY         bafl.lib
+LIBRARY         charconv.lib 
+LIBRARY         centralrepository.lib
+LIBRARY         eikcore.lib 
+LIBRARY         cone.lib 
+LIBRARY         CommonEngine.lib 
+LIBRARY		    calinterimapi.lib 
+LIBRARY     	calencommonutils.lib
+LIBRARY     	nsmlfolderparser.lib
+LIBRARY 		gdi.lib
+LIBRARY			smlstoreformat.lib
+LIBRARY 		nsmlchangefinder.lib
+
+#if defined(ARMCC)
+DEFFILE		./def/eabinsmldefaultagendahandler.DEF
+#elif defined(WINSCW)
+DEFFILE		./def/bwinscwnsmldefaultagendahandler.DEF
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/data/nsmldefaultagendahandler.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* 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:    
+*
+*/
+
+#include <registryinfo.rh>
+#include "nsmldefaultagendahandler.loc"
+
+RESOURCE REGISTRY_INFO theInfo
+{
+	// UID for the DLL
+	dll_uid = 0x20029F16;
+	
+	// Declare array of interface info
+	interfaces = 
+		{
+		INTERFACE_INFO
+			{
+			
+			// UID of interface that is implemented
+			interface_uid = 0x20029F14;
+			
+			implementations = 
+				{
+				
+				// Info for all implementations					
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x20029F16;
+					version_no         = 1;
+					display_name       = "";
+					default_data       = "";
+					opaque_data        = qtn_nsml_default_agenda_handler_opaque_name; 
+					}
+					
+				};
+			}
+		};
+}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/data/nsmldefaultagendahandler_1_2.rss	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,902 @@
+CHARACTER_SET UTF8/*
+* 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:  Resource data for DS agenda adapter
+*
+*/
+
+
+#include <bldvariant.hrh>
+#include <SmlDataFormat.rh>
+#include <SmlDataFormat.hrh>
+
+RESOURCE SML_DATA_STORE_FORMAT nsml_default_agenda_handler
+	{
+	version=1;
+	display_name="Calendar";
+	sync_types=KSmlSyncType_TwoWay+KSmlSyncType_OneWayFromSvr+
+	           KSmlSyncType_OneWayFromClnt+KSmlSyncType_SlowSync+
+	           KSmlSyncType_RefreshFromSvr+KSmlSyncType_RefreshFromClnt;
+	mime_format=
+		{
+		SML_MIME_FORMAT
+			{
+			version=1;
+			mime_type="text/x-vcalendar";
+			mime_ver="1.0";
+			properties=
+				{
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Begin";
+					name="BEGIN";
+					data_type="";
+					enum_values={"VCALENDAR","VEVENT","VTODO"};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="End";
+					name="END";
+					data_type="";
+					enum_values={"VCALENDAR","VEVENT","VTODO"};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Version";
+					name="VERSION";	
+					data_type="";
+					enum_values={"1.0"};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Uid";
+					name="UID";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Summary";
+					name="SUMMARY";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Description";
+					name="DESCRIPTION";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Dstart";
+					name="DTSTART";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Dtend";
+					name="DTEND";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Aalarm";
+					name="AALARM";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params= {
+							SML_DATA_PROPERTY_PARAM
+								{
+								version=1;
+								display_name="Alarm type";
+								name="TYPE";
+								data_type="";
+								enum_values={};
+								}
+							};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Class";
+					name="CLASS";
+					data_type="";
+					enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Location";
+					name="LOCATION";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Last Modified";
+					name="LAST-MODIFIED";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Priority";
+					name="PRIORITY";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Status";
+					name="STATUS";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Rrule";
+					name="RRULE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Completed";
+					name="COMPLETED";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Dcreated";
+					name="DCREATED";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Due";
+					name="DUE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="ExDate";
+					name="EXDATE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Categories";
+					name="CATEGORIES";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Sequence";
+					name="SEQUENCE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+		                SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="TZ";
+					name="TZ";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+         		       SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Daylight";
+					name="DAYLIGHT";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="RDate";
+					name="RDATE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Attendee";
+					name="ATTENDEE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params= {
+							SML_DATA_PROPERTY_PARAM
+								{
+								version=1;
+								display_name="Type";
+								name="TYPE";
+								data_type="";
+								enum_values={"ROLE", "STATUS", "X-CN", "X-ROLE", "X-SENTBY", "X-STATUS"};
+								}
+							};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Recurrence";
+					name="X-RECURRENCE-ID";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Method";
+					name="X-METHOD";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+                		SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Local UID";
+					name="X-SYMBIAN-LUID";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+                		SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Time stamp";
+					name="X-SYMBIAN-DTSTAMP";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="X-Epoc Agenda Entry Type";
+					name="X-EPOCAGENDAENTRYTYPE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="GEO Address";
+					name="GEO";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					}
+				};
+			field_level=0;
+			}
+#ifdef __NSML_USE_ICAL_FEATURE
+			,
+		SML_MIME_FORMAT
+			{
+			version=1;
+			mime_type="text/calendar";
+			mime_ver="2.0";
+			properties=
+				{
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Begin";
+					name="BEGIN";
+					data_type="";
+					enum_values={"VCALENDAR","VEVENT","VTODO","STANDARD","DAYLIGHT","VTIMEZONE","VALARM"};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="End";
+					name="END";
+					data_type="";
+					enum_values={"VCALENDAR","VEVENT","VTODO","STANDARD","DAYLIGHT","VTIMEZONE","VALARM"};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Version";
+					name="VERSION";	
+					data_type="";
+					enum_values={"2.0"};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Uid";
+					name="UID";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Summary";
+					name="SUMMARY";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Description";
+					name="DESCRIPTION";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Dstart";
+					name="DTSTART";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Dtend";
+					name="DTEND";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Aalarm";
+					name="AALARM";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params= {
+							SML_DATA_PROPERTY_PARAM
+								{
+								version=1;
+								display_name="Alarm type";
+								name="TYPE";
+								data_type="";
+								enum_values={};
+								}
+							};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Class";
+					name="CLASS";
+					data_type="";
+					enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Location";
+					name="LOCATION";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Last Modified";
+					name="LAST-MODIFIED";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Priority";
+					name="PRIORITY";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Status";
+					name="STATUS";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Recurrence-Id";
+					name="RECURRENCE-ID";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Rrule";
+					name="RRULE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Sequence";
+					name="SEQUENCE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Method";
+					name="METHOD";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="ATTENDEE";
+					name="ATTENDEE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Categories";
+					name="CATEGORIES";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Organizer";
+					name="ORGANIZER";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Time stamp";
+					name="DTSTAMP";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Completed";
+					name="COMPLETED";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Created";
+					name="CREATED";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="ExDate";
+					name="EXDATE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="RDate";
+					name="RDATE";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Product ID";
+					name="PRODID";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Timezone ID";
+					name="TZID";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Timezone OFFSET from";
+					name="TZOFFSETFROM";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Timezone OFFSET to";
+					name="TZOFFSETTO";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Alarm action";
+					name="ACTION";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="Alarm trigger";
+					name="TRIGGER";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					},
+				SML_DATA_PROPERTY
+					{
+					version=1;
+					display_name="GEO Address";
+					name="GEO";
+					data_type="";
+					enum_values={};
+					flags=0;
+					max_size=256;
+					max_occur=0;
+					params={};
+					}
+				};
+			field_level=0;
+			}
+#endif // __NSML_USE_ICAL_FEATURE
+		};
+#ifdef __NSML_USE_ICAL_FEATURE
+	mime_format_tx_pref=1;     // Preferred index for tx
+	mime_format_rx_pref=1;     // Preferred index for rx
+#else // __NSML_USE_ICAL_FEATURE
+  mime_format_tx_pref=0;     // Preferred index for tx
+	mime_format_rx_pref=0;     // Preferred index for rx
+#endif // __NSML_USE_ICAL_FEATURE
+	folder_properties={
+	        SML_DATA_PROPERTY
+	                        {
+	                        version = 1;
+	                        display_name = "Name";
+	                        name = "NAME";
+	                        data_type = "text";
+	                        enum_values = {};
+	                        flags = 0;
+	                        max_size = 256;
+	                        max_occur = 1;
+	                        params = {};
+	                        },
+	                SML_DATA_PROPERTY
+	                        {
+	                        version = 1;
+	                        display_name = "Created";
+	                        name = "CREATED";
+	                        data_type = "datetime";
+	                        enum_values = {};
+	                        flags = 0;
+	                        max_size = 256;
+	                        max_occur = 1;
+	                        params = {};
+	                        },
+	                SML_DATA_PROPERTY
+                           {
+                           version = 1;
+                           display_name = "Modified";
+                           name = "MODIFIED";
+                           data_type = "datetime";
+                           enum_values = {};
+                           flags = 0;
+                           max_size = 256;
+                           max_occur = 1;
+                           params = {};
+                           }                  
+	};
+	filter_capabilities={};
+	max_size=0; 	// no limit
+	max_items=0; 	// no limit
+	flags = KSmlDataStore_Hierarchical;        // Hierarchical
+	}
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/inc/nsmldefaultagendahandlerdebug.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* 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: Debug macros definition and constant declaration 
+*
+*/
+
+
+
+#ifndef NSML_DEFAULTAGENDAHANDLER_DEBUG_H
+#define NSML_DEFAULTAGENDAHANDLER_DEBUG_H
+
+#include <e32svr.h>
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+
+_LIT(KLogFile,"DefaultAgendaHandler.txt");
+_LIT(KLogDirFullName,"c:\\logs\\");
+_LIT(KLogDir,"MultiCalDB");
+
+// Declare the FPrint function
+inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
+    {
+    VA_LIST list;
+    VA_START(list,aFmt);
+    RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
+    }
+
+// ===========================================================================
+#ifdef __WINS__     // File logging for WINS
+// ===========================================================================
+#define FLOG(arg...)   { FPrint(arg); }
+//#define FLOG(a) { RDebug::Print(a);  }
+#define FTRACE(a) { a; }
+// ===========================================================================
+#else               // RDebug logging for target HW
+// ===========================================================================
+//#define FLOG(arg...) { RDebug::Print(arg);  }
+#define FLOG(arg...)   { FPrint(arg); }
+#define FTRACE(a) { a; }
+#endif //__WINS__
+
+// ===========================================================================
+#else // // No loggings --> Reduced binary size
+// ===========================================================================
+#define FLOG(arg...)
+#define FTRACE(a)
+
+#endif // NSML_DEFAULTAGENDAHANDLER_DEBUG_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/inc/nsmldefaultagendahandlerplugin.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description:  
+*
+*/
+ 
+#ifndef C_NSML_DEFAULTAGENDAHANDLER_PLUGIN_H
+#define C_NSML_DEFAULTAGENDAHANDLER_PLUGIN_H
+
+#include <s32mem.h>
+#include <e32def.h>
+#include <nsmlagendaadapterhandler.h>
+#include <data_caging_path_literals.hrh>
+
+// CONSTANTS
+_LIT( KNSmlDefaultAgendaHandlerRsc_1_2,"z:NSMLDEFAULTAGENDAHANDLER_1_2.RSC" );
+const TUid KCRUidNSmlDSApp       = { 0x101F9A1D };
+const TInt KArrayGranularity    = 30;
+
+_LIT8( KNSmlDataObjectCREATED,          "CREATED" );
+_LIT8( KNSmlDataObjectNAME,             "NAME" );
+_LIT8( KNSmlDataObjectMODIFIED,         "MODIFIED" );
+
+struct TNSmlServerSupportsForFolder
+    {
+    TBool iSSName;
+    TBool iSSCreated;
+    TBool iSSModified;
+    };  
+
+// FORWARD DECLARATIONS
+class CNSmlDefaultAgendaHandlerUtil;
+class CCalSession;
+
+/**
+ *  This class represents the Adapter Object plugin
+ *  It is used by ECoM client to initialize calendar notifier
+ *
+ *  @lib nsmloviagendaadapter.lib
+ */
+class CNSmlDefaultAgendaHandlerPlugin: public CNSmlAgendaAdapterHandler
+  	{
+public:
+    /**
+	 * Two phase construction
+	 */
+	IMPORT_C static CNSmlDefaultAgendaHandlerPlugin* NewL();
+	
+    /**
+	 * Destructor
+	 */
+	~CNSmlDefaultAgendaHandlerPlugin();
+
+private:    
+    /**
+	* C++ constructor - not exported;
+	* implicitly called from NewLC()	
+	*/
+	CNSmlDefaultAgendaHandlerPlugin::CNSmlDefaultAgendaHandlerPlugin();	
+	
+	void ConstructL(); 
+	
+	/**
+     * Inherited from CAgendaAdapterHandler
+     *
+     * @param 
+    */
+	void CheckServerSupportForFolder( const CSmlDataStoreFormat& aServerDataStoreFormat );
+	     
+    void FetchFolderL( const TSmlDbItemUid aUid, RBufWriteStream& aStream );
+ 
+    void SynchronizableCalendarIdsL( CArrayFixFlat<TUint>* aFolderUidArray );
+ 
+    TCalLocalUid CreateFolderL( RBufReadStream& aStream );
+ 
+    void ReplaceFolderL( const TCalLocalUid& aUid, RBufReadStream& aStream, TBool& aSyncStatus );   
+ 
+    HBufC* FolderNameL( TSmlDbItemUid aUid );
+ 
+    CSmlDataStoreFormat* StoreFormatL( RStringPool& aStringPool );
+    
+    TInt DeviceSyncOwner();
+    
+    TBool FolderSyncStatusL( TSmlDbItemUid aUid );
+    
+    TBool FolderSyncStatusL( HBufC* aFolderName );
+ 
+    TNSmlSnapshotItem CreateFolderSnapShotItemL( const TCalLocalUid& aUid );      
+    
+public:
+    
+    void SynchronizableCalEntryIdsL( CCalSession* aCalSession, TCalLocalUid aUId, RArray<TCalLocalUid>& aUidArray );
+    
+     
+    CNSmlDefaultAgendaHandlerUtil* CalendarInfoL( TSmlDbItemUid aUid );
+    
+    CNSmlDefaultAgendaHandlerUtil* ParseFolderDataL( RBufReadStream& aStream );
+    
+public:
+                  
+private: 
+    
+    TNSmlServerSupportsForFolder    iServerSupportsForFolder;
+     
+	};
+
+# endif // C_NSML_DEFAULTAGENDAHANDLER_PLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/inc/nsmldefaultagendahandlerutil.h	Wed Sep 01 12:30:02 2010 +0100
@@ -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:    
+*
+*/
+
+#ifndef C_NSML_DEFAULTAGENDAHANDLER_UTIL_H
+#define C_NSML_DEFAULTAGENDAHANDLER_UTIL_H
+
+#include <e32cons.h>
+#include <calcommon.h>
+#include <gdi.h>
+
+/**
+ * 
+ * 
+ *
+ * @lib NSmlDefaultAgendaHandler.lib
+ */
+class CNSmlDefaultAgendaHandlerUtil : public CBase
+  	{
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CNSmlDefaultAgendaHandlerUtil* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CNSmlDefaultAgendaHandlerUtil();
+    
+    public: // New Functions
+    
+    private:
+       /**
+       * C++ default constructor.
+       */
+        CNSmlDefaultAgendaHandlerUtil();
+    
+    public: // Data
+        HBufC* iFileName;
+        HBufC* iName;
+        TBool iEnabled;    
+        TBool iSyncStatus;
+        TTime iCreated;
+        TTime iModified;
+	};
+
+#endif // C_NSML_DEFAULTAGENDAHANDLER_UTIL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/loc/nsmldefaultagendahandler.loc	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,24 @@
+/*
+* 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:  loc file for DS agenda adapter
+*
+*/
+
+
+//d:Display name for registry info 
+//l:list_setting_pane_t1
+//
+#define qtn_nsml_default_agenda_handler_opaque_name "Default"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/src/nsmldefaultagendahandlerplugin.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,817 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <gdi.h>
+#include <utf.h>
+#include <barsc.h>
+#include <e32std.h>
+#include <bautils.h>
+#include <implementationproxy.h>
+#include <calsession.h>
+#include <calenmulticalutil.h>
+#include <calenmulticaluids.hrh>
+#include <calcalendarinfo.h>
+#include <nsmlfolderparser.h>
+#include <nsmldefaultagendahandler_1_2.rsg>
+#include "nsmldefaultagendahandlerplugin.h"
+#include "nsmldefaultagendahandlerutil.h"
+#include "nsmldefaultagendahandlerdebug.h"
+
+
+
+// CONSTANTS
+const TInt KBuffLength = 128;
+
+// ----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::NewL
+// Two Phase Construction
+// ----------------------------------------------------------------------------
+EXPORT_C CNSmlDefaultAgendaHandlerPlugin* CNSmlDefaultAgendaHandlerPlugin::NewL()
+	{
+	FLOG( _L("CNSmlDefaultAgendaHandlerPlugin::NewL, BEGIN"));
+
+	CNSmlDefaultAgendaHandlerPlugin* self = new ( ELeave ) CNSmlDefaultAgendaHandlerPlugin();	
+	self->ConstructL();
+	
+	FLOG( _L("CNSmlDefaultAgendaHandlerPlugin::NewL, END"));
+	return self;
+	}
+
+// ----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::~CNSmlDefaultAgendaHandlerPlugin
+// Destructor
+// ----------------------------------------------------------------------------
+CNSmlDefaultAgendaHandlerPlugin::~CNSmlDefaultAgendaHandlerPlugin()
+	{
+	FLOG( _L("CNSmlDefaultAgendaHandlerPlugin::~CNSmlDefaultAgendaHandlerPlugin, BEGIN"));	 
+  
+	FLOG( _L("CNSmlDefaultAgendaHandlerPlugin::~CNSmlDefaultAgendaHandlerPlugin, END"));
+	}
+
+// ----------------------------------------------------------------------------  
+// C++ constructor - not exported;
+// implicitly called from NewL()
+// ----------------------------------------------------------------------------  
+CNSmlDefaultAgendaHandlerPlugin::CNSmlDefaultAgendaHandlerPlugin() 
+	{
+	FLOG( _L("CNSmlDefaultAgendaHandlerPlugin::CNSmlDefaultAgendaHandlerPlugin, BEGIN"));  
+	FLOG( _L("CNSmlDefaultAgendaHandlerPlugin::CNSmlDefaultAgendaHandlerPlugin, END"));
+	}
+
+// ----------------------------------------------------------------------------  
+// 2nd phase constructor
+// ----------------------------------------------------------------------------       
+void CNSmlDefaultAgendaHandlerPlugin::ConstructL()
+    {
+    FLOG( _L("CNSmlDefaultAgendaHandlerPlugin::ConstructL, BEGIN"));
+    
+    // Initialize server supports for folder
+    iServerSupportsForFolder.iSSName = EFalse;
+    iServerSupportsForFolder.iSSCreated = EFalse;
+    iServerSupportsForFolder.iSSModified = EFalse;
+        
+    FLOG( _L("CNSmlDefaultAgendaHandlerPlugin::ConstructL, END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::CheckServerSupportForFolder
+// Method to check if needed properties are supported by remote server.
+// -----------------------------------------------------------------------------
+void CNSmlDefaultAgendaHandlerPlugin::CheckServerSupportForFolder( const CSmlDataStoreFormat& aServerDataStoreFormat )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CheckServerSupportForFolder: BEGIN"));
+        
+    iServerSupportsForFolder.iSSName = EFalse;
+    iServerSupportsForFolder.iSSCreated = EFalse;
+    iServerSupportsForFolder.iSSModified = EFalse;
+    
+    if ( aServerDataStoreFormat.FolderPropertyCount() == 0 )
+        {
+        // Server has no restricition on folder property
+        iServerSupportsForFolder.iSSName = ETrue;
+        iServerSupportsForFolder.iSSCreated = ETrue;
+        iServerSupportsForFolder.iSSModified = ETrue;
+        return;
+        }
+    else
+        {
+        for ( TInt i = 0; 
+                   i < aServerDataStoreFormat.FolderPropertyCount(); 
+                   i++ )
+            {
+            if ( aServerDataStoreFormat.FolderProperty( i ).Field().Name().DesC().Compare( KNSmlDataObjectNAME ) == 0 )
+                {
+                FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CheckServerSupportForFolder: Supports NAME Property"));
+                iServerSupportsForFolder.iSSName = ETrue;
+                }
+            else if ( aServerDataStoreFormat.FolderProperty( i ).Field().Name().DesC().Compare( KNSmlDataObjectCREATED ) == 0 )
+                {
+                FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CheckServerSupportForFolder: Supports CREATED Property"));
+                iServerSupportsForFolder.iSSCreated = ETrue;
+                }
+            else if ( aServerDataStoreFormat.FolderProperty( i ).Field().Name().DesC().Compare( KNSmlDataObjectMODIFIED ) == 0 )
+                {
+                FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CheckServerSupportForFolder: Supports MODIFIED Property"));
+                iServerSupportsForFolder.iSSModified = ETrue;
+                }
+            }
+        }
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CheckServerSupportForFolder: END"));
+    }
+         
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::FetchFolderL
+// Method to read folder item from database.
+// -----------------------------------------------------------------------------
+void CNSmlDefaultAgendaHandlerPlugin::FetchFolderL( const TSmlDbItemUid aUid, RBufWriteStream& aStream )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FetchFolderL: begin"));
+            
+    // Create parser and set properties
+    CNSmlFolderParser* parser = CNSmlFolderParser::NewLC();
+    TNSmlParserGeneratorError parseError = EErrorNone;
+    HBufC8* generatedBuf = NULL;
+    HBufC8* nameBuf = NULL;
+    
+    //Get the Folder Information
+    CNSmlDefaultAgendaHandlerUtil* agendautil = CalendarInfoL(aUid);
+    if( NULL == agendautil )
+        {
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FetchFolderL:Invalid CalendarInfo"));
+        CleanupStack::PopAndDestroy( parser );
+        User::Leave( KErrNotFound );
+        }
+        
+    if ( iServerSupportsForFolder.iSSCreated )
+        {
+        parser->iCreated = agendautil->iCreated;
+        }
+    else
+        {
+        parser->iCreated = Time::NullTTime();
+        }
+    
+    if ( iServerSupportsForFolder.iSSName )
+        {
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FetchFolderL: retrieving name"));
+        nameBuf = HBufC8::NewL( agendautil->iName->Length() );
+        TPtr8 name( nameBuf->Des() );
+        CnvUtfConverter::ConvertFromUnicodeToUtf8(name , agendautil->iName->Des());
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FetchFolderL: name converted"));
+        parser->iName = nameBuf;        
+        }    
+
+    // Generate data and write it to buffer   
+    generatedBuf = HBufC8::NewLC( 1 );
+    generatedBuf->Des() = KNullDesC8;
+    CleanupStack::Pop(); // generatedBuf
+    parseError = parser->GenerateXml( generatedBuf );
+    CleanupStack::PushL( generatedBuf );
+    
+    aStream.WriteL( generatedBuf->Des() );
+    
+    delete agendautil;
+    CleanupStack::PopAndDestroy( generatedBuf ); 
+    CleanupStack::PopAndDestroy( parser );
+    
+    if ( parseError != EErrorNone )
+        {       
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FetchFolderL(): end with leave"));
+        User::Leave( KErrGeneral );
+        }
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FetchFolderL: end"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::SynchronizableCalendarIdsL
+// Retrieve the CalendarFile ID
+// -----------------------------------------------------------------------------
+void CNSmlDefaultAgendaHandlerPlugin::SynchronizableCalendarIdsL( CArrayFixFlat<TUint>* aFolderUidArray )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::SynchronizableCalendarIdsL BEGIN"));
+        
+    CCalSession* vCalSession = NULL;
+    CCalSession* vCalSubSession = NULL;   
+    TBuf8<KBuffLength> keyBuff;
+    
+    aFolderUidArray->Reset();
+            
+    vCalSession = CCalSession::NewL();
+    CleanupStack::PushL(vCalSession);
+    
+    CDesCArray* calfilearr = vCalSession->ListCalFilesL();            
+    CleanupStack::PushL(calfilearr);
+    
+    for(TInt i = 0; i < calfilearr->Count(); i++)
+        {
+        TInt err = KErrNone;
+        vCalSubSession = CCalSession::NewL();
+        CleanupStack::PushL(vCalSubSession);
+        vCalSubSession->OpenL(calfilearr->MdcaPoint(i));
+        
+        CCalCalendarInfo* caleninfo = vCalSubSession->CalendarInfoL(); 
+        CleanupStack::PushL(caleninfo);
+        
+        //Get UID value associated with the CalFile
+        keyBuff.Zero();
+        TUint UidVal;
+        keyBuff.AppendNum( EFolderLUID );
+        TPckgC<TUint> pckUidValue(UidVal);
+        TRAP(err,pckUidValue.Set(caleninfo->PropertyValueL( keyBuff )));
+        UidVal = pckUidValue();
+                    
+        if( err != KErrNone )
+            {
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::SynchronizableCalendarIdsL: Error while retrieving CalFile Property: '%d'"), err);
+			CleanupStack::PopAndDestroy(caleninfo);
+            CleanupStack::PopAndDestroy(vCalSubSession);  	  	 
+            continue;
+            }
+			
+		//Get MARKASDELETE MetaData property
+		keyBuff.Zero();
+		TBool markAsdelete = EFalse;
+		keyBuff.AppendNum( EMarkAsDelete );
+		TPckgC<TBool> pckMarkAsDelete(markAsdelete);
+		TRAP(err,pckMarkAsDelete.Set(caleninfo->PropertyValueL(keyBuff)));
+		if ( err == KErrNone )
+			{
+			markAsdelete = pckMarkAsDelete();
+			if( markAsdelete )
+				{
+				FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::SynchronizableCalendarIdsL: Dead Calendar, not including in the snapshot"));
+				CleanupStack::PopAndDestroy(caleninfo);
+				CleanupStack::PopAndDestroy(vCalSubSession);  	  	 
+				continue;
+				}
+			}
+        
+        //Get OWNER value associated with the CalFile
+        keyBuff.Zero();
+        TInt SyncServiceOwnerVal;
+        keyBuff.AppendNum( EDeviceSyncServiceOwner );
+        TPckgC<TInt> pckOwnerValue(SyncServiceOwnerVal);
+        TRAP(err,pckOwnerValue.Set(caleninfo->PropertyValueL( keyBuff )));
+        SyncServiceOwnerVal = pckOwnerValue();
+                    
+        if( err == KErrNotFound )
+            {
+            // Set DS Application as owner
+            SyncServiceOwnerVal = KCRUidNSmlDSApp.iUid;
+            TPckgC<TInt> pckOwnerValue(SyncServiceOwnerVal);
+            caleninfo->SetPropertyL( keyBuff, pckOwnerValue );
+            vCalSubSession->SetCalendarInfoL( *caleninfo );
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::SynchronizableCalendarIdsL: Empty Owner LUID '%d'"), UidVal );
+            aFolderUidArray->AppendL(UidVal);
+            }
+        else if( err == KErrNone )
+            {
+            if( KCRUidNSmlDSApp.iUid == SyncServiceOwnerVal )
+                {
+                FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::SynchronizableCalendarIdsL: DS Owner LUID '%d'"), UidVal );
+                aFolderUidArray->AppendL(UidVal);
+                }
+            }
+        else
+            {
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::SynchronizableCalendarIdsL: Error while retrieving Owner Property: '%d'"), err);
+            }
+        CleanupStack::PopAndDestroy(caleninfo);
+        CleanupStack::PopAndDestroy(vCalSubSession); 
+        }
+    CleanupStack::PopAndDestroy(calfilearr);
+    CleanupStack::PopAndDestroy(vCalSession);
+    
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::SynchronizableCalendarIdsL END"));
+    }
+ 
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::CreateFolderItemL
+// Creates the Folder item with the stream provided 
+// -----------------------------------------------------------------------------
+TCalLocalUid CNSmlDefaultAgendaHandlerPlugin::CreateFolderL( RBufReadStream& aStream )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CreateFolderItemL BEGIN"));
+   
+    TBuf8<KBuffLength> keyBuff;
+    TUint calValue = 0;
+    CNSmlDefaultAgendaHandlerUtil* agendautil = NULL;
+    CCalCalendarInfo* calinfo = CCalCalendarInfo::NewL();
+    CleanupStack::PushL(calinfo);    
+    
+    // Parse the buffer for the folder data and construct the calendar info   
+    agendautil = ParseFolderDataL( aStream );
+    
+    if( agendautil )
+        {
+        // Visibility
+        calinfo->SetEnabled( agendautil->iEnabled );
+        
+        // LUID Meta Property
+        keyBuff.Zero();
+        keyBuff.AppendNum( EFolderLUID );
+        calValue = CCalenMultiCalUtil::GetNextAvailableOffsetL();
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CreateFolderItemL: nextoffset: '%d'"), calValue);
+        TPckgC<TUint> pckgUidValue( calValue );
+        calinfo->SetPropertyL( keyBuff, pckgUidValue );      
+      
+        // Create & Modified Time Meta Property
+        keyBuff.Zero();
+        keyBuff.AppendNum( ECreationTime );
+        TTime time;
+        time.HomeTime();
+        TPckgC<TTime> pckgCreateTimeValue( time );
+        calinfo->SetPropertyL( keyBuff, pckgCreateTimeValue );
+        keyBuff.Zero();
+        keyBuff.AppendNum( EModificationTime );
+        calinfo->SetPropertyL( keyBuff, pckgCreateTimeValue );
+        
+        // Sync Status Meta Property
+        keyBuff.Zero();
+        keyBuff.AppendNum( ESyncStatus );
+        TBool syncstatus( ETrue );
+        TPckgC<TBool> pckgSyncStatusValue( syncstatus );
+        calinfo->SetPropertyL( keyBuff, pckgSyncStatusValue );
+        
+        // Add
+        CCalSession* calsession = CCalSession::NewL();
+        TInt err(KErrNone);
+        if( agendautil->iName != NULL )
+            {
+            calinfo->SetNameL( agendautil->iName->Des() );
+			HBufC* calfilename = CCalenMultiCalUtil::GetNextAvailableCalFileL();
+            TRAP( err, calsession->CreateCalFileL( *calfilename, *calinfo ) );
+			delete calfilename;
+			}
+        else
+            {
+            err = KErrNotFound;
+            }
+        
+        delete calsession;
+        delete agendautil;
+        CleanupStack::PopAndDestroy(calinfo);
+        
+        if( err != KErrNone )
+            {
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CreateFolderItemL: Error while Creating Calfile"));
+            User::Leave( KErrGeneral );
+            }
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy(calinfo);
+        User::Leave( KErrGeneral );
+        }
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CreateFolderItemL END"));
+    return calValue;   
+    }
+ 
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL
+// Replaces the Folder item with the ID provided 
+// -----------------------------------------------------------------------------
+void CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderL( const TCalLocalUid& aUid, 
+                                                      RBufReadStream& aStream, TBool& aSyncStatus )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL: BEGIN"));
+    
+    TBuf8<KBuffLength> keyBuff;
+    CNSmlDefaultAgendaHandlerUtil* agendautil = NULL;
+    
+    // Parse the buffer for the folder data and construct the calendar info   
+    agendautil = ParseFolderDataL( aStream );
+    
+    if( agendautil )
+        {
+        //Get the associated Calendar File 
+        CNSmlDefaultAgendaHandlerUtil* updateagendautil = CalendarInfoL( aUid );
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL: After CalendarInfoL '%d'"), updateagendautil);
+        
+        if( NULL == updateagendautil )
+            {
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL:Invalid Updatable CalendarInfo"));
+            delete agendautil;
+            User::Leave( KErrNotFound );
+            }
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL:valid CalendarInfo"));
+        if( updateagendautil->iFileName != NULL )            
+            {            
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL:valid name '%S'"), updateagendautil->iFileName);
+            CCalSession* vCalSession = CCalSession::NewL();
+            CleanupStack::PushL(vCalSession);
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL:Open the session")); 
+            vCalSession->OpenL(updateagendautil->iFileName->Des());          
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL:Get the Calendar Info")); 
+            CCalCalendarInfo* caleninfo = vCalSession->CalendarInfoL();  
+            CleanupStack::PushL(caleninfo);
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL:Set the status"));
+            caleninfo->SetEnabled(agendautil->iEnabled);            
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL:Set the name"));
+            caleninfo->SetNameL(agendautil->iName->Des());
+            
+            // Modified Time Meta Property
+            keyBuff.Zero();
+            keyBuff.AppendNum( EModificationTime );
+            TTime time;
+            time.HomeTime();
+            TPckgC<TTime> pckgCreateTimeValue( time );
+            caleninfo->SetPropertyL( keyBuff, pckgCreateTimeValue );
+            
+            aSyncStatus = updateagendautil->iSyncStatus;
+            
+            // Update
+            vCalSession->SetCalendarInfoL(*caleninfo);
+            
+            CleanupStack::PopAndDestroy(caleninfo);
+            CleanupStack::PopAndDestroy( vCalSession );
+            }
+        else
+            {
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL:Invalid Updatable CalendarInfo Name"));
+            delete agendautil;
+            delete updateagendautil;
+            User::Leave( KErrNotFound );
+            }
+        }
+    else
+        {
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL:Invalid Parsed CalendarInfo"));
+        User::Leave( KErrNotFound );
+        }
+    
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ReplaceFolderItemL: END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::FolderNameL
+// Returns the FolderName for the given ID
+// -----------------------------------------------------------------------------
+HBufC* CNSmlDefaultAgendaHandlerPlugin::FolderNameL( TSmlDbItemUid aUid )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FolderNameL: BEGIN"));
+    
+    HBufC* calfilename = NULL;
+    CNSmlDefaultAgendaHandlerUtil* agendautil = CalendarInfoL( aUid );
+    
+    if( agendautil != NULL )
+        {
+        calfilename = agendautil->iFileName->Alloc();
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::foldername: '%S'"), calfilename);
+        }    
+    delete agendautil;
+    
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FolderNameL: END"));
+    
+    return calfilename;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::StoreFormatL
+// Returns adapters supported store format which is read from Calendar Plug
+// In Adapter own resource file.
+// -----------------------------------------------------------------------------
+CSmlDataStoreFormat* CNSmlDefaultAgendaHandlerPlugin::StoreFormatL( RStringPool& aStringPool )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::StoreFormatL: BEGIN"));
+    
+    TFileName fileName;
+    TParse* parse = new(ELeave) TParse();
+    CleanupStack::PushL( parse );
+    
+    parse->Set( KNSmlDefaultAgendaHandlerRsc_1_2,
+                &KDC_RESOURCE_FILES_DIR, NULL );
+    
+    fileName = parse->FullName();
+    RResourceFile resourceFile;
+    RFs rfs;
+    User::LeaveIfError(rfs.Connect());
+    
+    BaflUtils::NearestLanguageFile( rfs, fileName );
+
+    TRAPD( leavecode, resourceFile.OpenL( rfs,fileName ) );
+    if ( leavecode != 0 )
+        {
+        CleanupStack::PopAndDestroy(); // parse
+        rfs.Close();
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin:::StoreFormatL(): Error END"));
+        User::Leave( leavecode );
+        }
+    
+    CleanupClosePushL( resourceFile );
+    HBufC8* buffer = resourceFile.AllocReadLC( NSML_DEFAULT_AGENDA_HANDLER );
+    TResourceReader reader;
+    reader.SetBuffer( buffer );
+
+    CSmlDataStoreFormat* dsFormat = NULL;
+    dsFormat = CSmlDataStoreFormat::NewLC( aStringPool, reader );
+    CleanupStack::Pop(); // dsFormat
+    CleanupStack::PopAndDestroy( 3 ); // buffer, resourceFile, parse
+    rfs.Close();
+    
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::StoreFormatL: END"));
+    return dsFormat;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::DeviceSyncOwner
+// Returns the DS Application UID
+// -----------------------------------------------------------------------------
+TInt CNSmlDefaultAgendaHandlerPlugin::DeviceSyncOwner()
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::DeviceSyncOwner: BEGIN"));
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::DeviceSyncOwner: '%d' END"), KCRUidNSmlDSApp.iUid );
+    return KCRUidNSmlDSApp.iUid;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::FolderSyncStatusL
+// Returns the Sync Status for the given UID
+// -----------------------------------------------------------------------------
+TBool CNSmlDefaultAgendaHandlerPlugin::FolderSyncStatusL( TSmlDbItemUid aUid )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FolderSyncStatusL: BEGIN"));
+    
+    TBool syncstatus( EFalse );
+    CNSmlDefaultAgendaHandlerUtil* agendautil = CalendarInfoL( aUid );        
+    if( agendautil != NULL )
+        {
+        syncstatus = agendautil->iSyncStatus;
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::syncstatus: '%d'"), syncstatus );
+        }    
+    delete agendautil;
+        
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FolderSyncStatusL: END"));
+    
+    return syncstatus;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::FolderSyncStatusL
+// Returns the Sync Status for the given FolderName
+// -----------------------------------------------------------------------------
+TBool CNSmlDefaultAgendaHandlerPlugin::FolderSyncStatusL( HBufC* aFolderName )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FolderSyncStatusL: BEGIN"));
+    
+    TBool syncstatus( EFalse );
+    TBuf8<KBuffLength> keyBuff;    
+    CCalSession *calsession = CCalSession::NewL();
+    CleanupStack::PushL(calsession);
+    calsession->OpenL(aFolderName->Des());    
+    CCalCalendarInfo* caleninfo = calsession->CalendarInfoL();
+    CleanupStack::PushL(caleninfo);
+    // Sync Status
+    keyBuff.Zero();
+    keyBuff.AppendNum( ESyncStatus ); 
+    TPckgC<TBool> pckgSyncStatusValue(syncstatus);
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FolderSyncStatusL: Get sync status"));
+    TRAPD(err,pckgSyncStatusValue.Set(caleninfo->PropertyValueL( keyBuff )));
+                
+    syncstatus = pckgSyncStatusValue();
+    if( err != KErrNone )
+        {
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FolderSyncStatusL: Error while retrieving CalFile SYNC Property"));
+        }
+    CleanupStack::PopAndDestroy(caleninfo);
+    CleanupStack::PopAndDestroy(calsession);
+        
+    
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::FolderSyncStatusL: END"));
+    
+    return syncstatus;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::CreateFolderSnapShotItemL
+// Create the Folder SnapShot Item
+// -----------------------------------------------------------------------------
+TNSmlSnapshotItem CNSmlDefaultAgendaHandlerPlugin::CreateFolderSnapShotItemL( const TCalLocalUid& aUid )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CreateFolderSnapShotItemL: BEGIN"));
+    
+    TNSmlSnapshotItem item( 0 );
+    
+    CNSmlDefaultAgendaHandlerUtil* agendautil = CalendarInfoL( aUid );
+    if( NULL == agendautil )
+        {
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CreateFolderSnapShotItemL:Invalid CalendarInfo"));
+        return item;
+        }
+    item.SetItemId( aUid );   
+    item.SetLastChangedDate(agendautil->iModified);
+    item.SetSoftDelete(EFalse);
+    delete agendautil; 
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CreateFolderSnapShotItemL: END"));
+    
+    return item; 
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::ParseFolderDataL
+// Method to Parse the Folder Data Obtained
+// -----------------------------------------------------------------------------
+CNSmlDefaultAgendaHandlerUtil* CNSmlDefaultAgendaHandlerPlugin::ParseFolderDataL( RBufReadStream& aStream )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ParseFolderDataL: BEGIN"));
+        
+    CNSmlDefaultAgendaHandlerUtil* agendautil = CNSmlDefaultAgendaHandlerUtil::NewL();
+    
+    // Create parser and parse data from Buffer
+    CNSmlFolderParser* folderparser = CNSmlFolderParser::NewLC();
+    TParse name;
+         
+    TInt size = aStream.Source()->SizeL();
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ParseFolderDataL: size:'%d'"), size);
+    CBufFlat* buffer = CBufFlat::NewL( 64 );
+    CleanupStack::PushL( buffer );
+    buffer->ResizeL( size );
+    TPtr8 ptr = buffer->Ptr( 0 );
+    aStream.ReadL( ptr, size );
+    HBufC8* dataBuffer = HBufC8::NewLC( buffer->Size() );
+    TPtr8 dataBufferPtr = dataBuffer->Des();
+    buffer->Read( 0, dataBufferPtr, buffer->Size() );
+        
+    TNSmlParserGeneratorError parseError = 
+                                    folderparser->ParseXml( dataBuffer );
+    CleanupStack::PopAndDestroy( 2 ); // dataBuffer, buffer
+    
+    if ( parseError != EErrorNone )
+        {
+        delete agendautil;
+        CleanupStack::PopAndDestroy( ); // folderparser
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ParseFolderDataL: end with leave"));
+        User::Leave( KErrGeneral );
+        return NULL;
+        }
+    
+    // Every folder item must have NAME property. Even replace because this 
+    // Plug In does not support field level update for folders.
+    if ( !folderparser->iName )
+        {
+        delete agendautil;
+        CleanupStack::PopAndDestroy( ); // folderparser
+        FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ParseFolderDataL: end with leave"));
+        User::Leave( KErrArgument );
+        return NULL;
+        }
+    
+    // Create Calendar info
+    agendautil->iName = CnvUtfConverter::ConvertToUnicodeFromUtf8L(folderparser->iName->Des());
+    CleanupStack::PopAndDestroy( ); // folderparser;    
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::ParseFolderDataL: END"));
+    return agendautil;
+    }   
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL
+// Retrieve the CalendarFile Info using the aUid value
+// -----------------------------------------------------------------------------
+CNSmlDefaultAgendaHandlerUtil* CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL( TSmlDbItemUid aUid )
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL: BEGIN"));   
+        
+    TBuf8<KBuffLength> keyBuff;
+    CNSmlDefaultAgendaHandlerUtil* agendautil = NULL;
+    CCalSession* vCalSession = NULL;
+    CCalSession* vCalSubSession = NULL;   
+    
+    vCalSession = CCalSession::NewL();
+    CleanupStack::PushL(vCalSession);
+    
+    CDesCArray* calfilearr = vCalSession->ListCalFilesL();            
+    CleanupStack::PushL(calfilearr);
+    
+    for(TInt i = 0; i < calfilearr->Count(); i++)
+        {
+        vCalSubSession = CCalSession::NewL(*vCalSession);
+        CleanupStack::PushL(vCalSubSession);
+        vCalSubSession->OpenL(calfilearr->MdcaPoint(i));
+        
+        CCalCalendarInfo* caleninfo = vCalSubSession->CalendarInfoL();
+        CleanupStack::PushL(caleninfo);
+        
+        TUint UidVal;
+        keyBuff.Zero();
+        keyBuff.AppendNum( EFolderLUID );
+        TPckgC<TUint> intBuf(UidVal);
+        TRAPD(err,intBuf.Set(caleninfo->PropertyValueL(keyBuff)));
+                    
+        if( err != KErrNone )
+            {
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL: Error while retrieving CalFile Property"));
+            CleanupStack::PopAndDestroy(caleninfo); 
+            CleanupStack::PopAndDestroy(vCalSubSession); 
+            CleanupStack::PopAndDestroy(calfilearr); 
+            CleanupStack::PopAndDestroy(vCalSession); 
+            return agendautil;
+            }
+        
+        UidVal = intBuf();
+        
+        if(aUid == UidVal)
+            {
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL: Found a match"));
+            agendautil = CNSmlDefaultAgendaHandlerUtil::NewL();
+            agendautil->iEnabled  = caleninfo->Enabled();
+            agendautil->iName     = caleninfo->NameL().AllocL();
+            agendautil->iFileName = caleninfo->FileNameL().AllocL();
+            
+            TInt err(KErrNone);
+            
+            // Created Time
+            TTime timeval;
+            keyBuff.Zero();
+            keyBuff.AppendNum( ECreationTime );     
+            TPckgC<TTime> pckgCreateTimeValue( timeval );
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL: Get Creation date"));
+            TRAP(err,pckgCreateTimeValue.Set(caleninfo->PropertyValueL( keyBuff )));
+                        
+            if( err != KErrNone )
+                {
+                FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL: Error while retrieving CalFile CREATED Property"));
+                }
+            agendautil->iCreated = pckgCreateTimeValue();
+            
+            // Modified Time
+            keyBuff.Zero();
+            keyBuff.AppendNum( EModificationTime );      
+            TPckgC<TTime> pckgModifyTimeValue( timeval );
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL: Get Modified date"));
+            TRAP(err,pckgModifyTimeValue.Set(caleninfo->PropertyValueL( keyBuff )));
+                        
+            if( err != KErrNone )
+                {
+                FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL: Error while retrieving CalFile MODIFIED Property"));
+                }
+            agendautil->iModified = pckgModifyTimeValue();
+            
+            // Sync Status
+            TBool syncstatus;
+            keyBuff.Zero();
+            keyBuff.AppendNum( ESyncStatus ); 
+            TPckgC<TBool> pckgSyncStatusValue(syncstatus);
+            FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL(): Get sync status"));
+            TRAP(err,pckgSyncStatusValue.Set(caleninfo->PropertyValueL( keyBuff )));
+                        
+            if( err != KErrNone )
+                {
+                FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL: Error while retrieving CalFile SYNC Property"));
+                }
+            agendautil->iSyncStatus = pckgSyncStatusValue();
+            }        
+        CleanupStack::PopAndDestroy(caleninfo);
+        CleanupStack::PopAndDestroy(vCalSubSession); 
+        }  
+    CleanupStack::PopAndDestroy(calfilearr);
+    CleanupStack::PopAndDestroy(vCalSession); 
+    
+    FLOG(_L("CNSmlDefaultAgendaHandlerPlugin::CalendarInfoL: END"));   
+    
+    return agendautil;
+    }
+
+/** 
+ *  Provides a key value pair table, this is used to identify
+ *  the correct construction function for the requested interface.
+ */
+const TImplementationProxy ImplementationTable[] =
+{
+        IMPLEMENTATION_PROXY_ENTRY(0x20029F16, CNSmlDefaultAgendaHandlerPlugin::NewL )
+};
+    
+/** 
+ * Function used to return an instance of the proxy table.+
+ */
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+{
+        aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+        return ImplementationTable;
+}
+
+#ifdef EKA2 
+GLDEF_C TInt E32Dll() 
+#else 
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/) 
+#endif 
+// DLL entry point
+    {
+    return(KErrNone);
+    }
+
+//End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmldefaultagendahandler/src/nsmldefaultagendahandlerutil.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "nsmldefaultagendahandlerutil.h"
+#include "nsmldefaultagendahandlerdebug.h"
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerUtil::CNSmlDefaultAgendaHandlerUtil
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CNSmlDefaultAgendaHandlerUtil::CNSmlDefaultAgendaHandlerUtil()
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerUtil::CNSmlDefaultAgendaHandlerUtil(): BEGIN"));
+    
+    iFileName = NULL;
+    iName = NULL;
+    iEnabled = ETrue;
+    iSyncStatus = ETrue;
+    
+    FLOG(_L("CNSmlDefaultAgendaHandlerUtil::CNSmlDefaultAgendaHandlerUtil(): END"));
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerUtil::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlDefaultAgendaHandlerUtil* CNSmlDefaultAgendaHandlerUtil::NewL()
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerUtil::NewL: BEGIN"));
+    
+    CNSmlDefaultAgendaHandlerUtil* self = new ( ELeave ) CNSmlDefaultAgendaHandlerUtil();
+    
+    FLOG(_L("CNSmlDefaultAgendaHandlerUtil::NewL: END"));
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlDefaultAgendaHandlerUtil::~CNSmlDefaultAgendaHandlerUtil
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlDefaultAgendaHandlerUtil::~CNSmlDefaultAgendaHandlerUtil()
+    {
+    FLOG(_L("CNSmlDefaultAgendaHandlerUtil::~CNSmlDefaultAgendaHandlerUtil(): BEGIN"));
+    if(iFileName)
+        {
+        delete iFileName;
+        iFileName = NULL;
+        }
+    if(iName)
+        {
+        delete iName;
+        iName = NULL;
+        }
+    FLOG(_L("CNSmlDefaultAgendaHandlerUtil::~CNSmlDefaultAgendaHandlerUtil(): END"));
+    }
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmlfolderutils/bld/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Folder XML Utils build file.
+*
+*/
+
+PRJ_MMPFILES
+./nsmlfolderparser.mmp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmlfolderutils/bld/def/bwinscwfolderparseru.def	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,22 @@
+EXPORTS
+	?NewL@CNSmlExtData@@SAPAV1@XZ @ 1 NONAME ; class CNSmlExtData * CNSmlExtData::NewL(void)
+	?NewLC@CNSmlExtData@@SAPAV1@XZ @ 2 NONAME ; class CNSmlExtData * CNSmlExtData::NewLC(void)
+	?AddXValL@CNSmlExtData@@QAEXPAVHBufC8@@@Z @ 3 NONAME ; void CNSmlExtData::AddXValL(class HBufC8 *)
+	?GenerateXmlL@CNSmlExtData@@QBEXAAVTPtr8@@PBVCNSmlXmlParser@@@Z @ 4 NONAME ; void CNSmlExtData::GenerateXmlL(class TPtr8 &, class CNSmlXmlParser const *) const
+	??0CNSmlXmlParser@@QAE@XZ @ 5 NONAME ; CNSmlXmlParser::CNSmlXmlParser(void)
+	?NewLC@CNSmlFolderParser@@SAPAV1@XZ @ 6 NONAME ; class CNSmlFolderParser * CNSmlFolderParser::NewLC(void)
+	?AddExtL@CNSmlFolderParser@@QAEXPAVCNSmlExtData@@@Z @ 7 NONAME ; void CNSmlFolderParser::AddExtL(class CNSmlExtData *)
+	?AttributeCount@TNSmlFolderAttributeData@@QBEHXZ @ 8 NONAME ; int TNSmlFolderAttributeData::AttributeCount(void) const
+	?ConvertIntoEntitiesL@CNSmlExtData@@QAEXPBVCNSmlXmlParser@@@Z @ 9 NONAME ; void CNSmlExtData::ConvertIntoEntitiesL(class CNSmlXmlParser const *)
+	?CountXmlSize@CNSmlExtData@@QBEHPBVCNSmlXmlParser@@@Z @ 10 NONAME ; int CNSmlExtData::CountXmlSize(class CNSmlXmlParser const *) const
+	?CountXmlSizeL@CNSmlFolderParser@@UAEHXZ @ 11 NONAME ; int CNSmlFolderParser::CountXmlSizeL(void)
+	??1CNSmlXmlParser@@UAE@XZ @ 12 NONAME ; CNSmlXmlParser::~CNSmlXmlParser(void)
+	?NewL@CNSmlFolderParser@@SAPAV1@XZ @ 13 NONAME ; class CNSmlFolderParser * CNSmlFolderParser::NewL(void)
+	??1CNSmlFolderParser@@UAE@XZ @ 14 NONAME ; CNSmlFolderParser::~CNSmlFolderParser(void)
+	?CountXmlSize@TNSmlFolderAttributeData@@QBEHPBVCNSmlXmlParser@@@Z @ 15 NONAME ; int TNSmlFolderAttributeData::CountXmlSize(class CNSmlXmlParser const *) const
+	?GenerateXml@CNSmlFolderParser@@UAE?AW4TNSmlParserGeneratorError@@AAPAVHBufC8@@@Z @ 16 NONAME ; enum TNSmlParserGeneratorError CNSmlFolderParser::GenerateXml(class HBufC8 * &)
+	??1CNSmlExtData@@UAE@XZ @ 17 NONAME ; CNSmlExtData::~CNSmlExtData(void)
+	??0TNSmlFolderAttributeData@@QAE@XZ @ 18 NONAME ; TNSmlFolderAttributeData::TNSmlFolderAttributeData(void)
+	?ParseXml@CNSmlFolderParser@@UAE?AW4TNSmlParserGeneratorError@@PAVHBufC8@@@Z @ 19 NONAME ; enum TNSmlParserGeneratorError CNSmlFolderParser::ParseXml(class HBufC8 *)
+	?GenerateXml@TNSmlFolderAttributeData@@QBEXAAVTPtr8@@PBVCNSmlXmlParser@@@Z @ 20 NONAME ; void TNSmlFolderAttributeData::GenerateXml(class TPtr8 &, class CNSmlXmlParser const *) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmlfolderutils/bld/def/eabifolderparseru.def	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,35 @@
+EXPORTS
+	_ZN12CNSmlExtData20ConvertIntoEntitiesLEPK14CNSmlXmlParser @ 1 NONAME
+	_ZN12CNSmlExtData4NewLEv @ 2 NONAME
+	_ZN12CNSmlExtData5NewLCEv @ 3 NONAME
+	_ZN12CNSmlExtData8AddXValLEP6HBufC8 @ 4 NONAME
+	_ZN12CNSmlExtDataD0Ev @ 5 NONAME
+	_ZN12CNSmlExtDataD1Ev @ 6 NONAME
+	_ZN12CNSmlExtDataD2Ev @ 7 NONAME
+	_ZN14CNSmlXmlParserC2Ev @ 8 NONAME
+	_ZN14CNSmlXmlParserD0Ev @ 9 NONAME
+	_ZN14CNSmlXmlParserD1Ev @ 10 NONAME
+	_ZN14CNSmlXmlParserD2Ev @ 11 NONAME
+	_ZN17CNSmlFolderParser11GenerateXmlERP6HBufC8 @ 12 NONAME
+	_ZN17CNSmlFolderParser13CountXmlSizeLEv @ 13 NONAME
+	_ZN17CNSmlFolderParser4NewLEv @ 14 NONAME
+	_ZN17CNSmlFolderParser5NewLCEv @ 15 NONAME
+	_ZN17CNSmlFolderParser7AddExtLEP12CNSmlExtData @ 16 NONAME
+	_ZN17CNSmlFolderParser8ParseXmlEP6HBufC8 @ 17 NONAME
+	_ZN17CNSmlFolderParserD0Ev @ 18 NONAME
+	_ZN17CNSmlFolderParserD1Ev @ 19 NONAME
+	_ZN17CNSmlFolderParserD2Ev @ 20 NONAME
+	_ZN24TNSmlFolderAttributeDataC1Ev @ 21 NONAME
+	_ZN24TNSmlFolderAttributeDataC2Ev @ 22 NONAME
+	_ZNK12CNSmlExtData12CountXmlSizeEPK14CNSmlXmlParser @ 23 NONAME
+	_ZNK12CNSmlExtData12GenerateXmlLER5TPtr8PK14CNSmlXmlParser @ 24 NONAME
+	_ZNK24TNSmlFolderAttributeData11GenerateXmlER5TPtr8PK14CNSmlXmlParser @ 25 NONAME
+	_ZNK24TNSmlFolderAttributeData12CountXmlSizeEPK14CNSmlXmlParser @ 26 NONAME
+	_ZNK24TNSmlFolderAttributeData14AttributeCountEv @ 27 NONAME
+	_ZTI12CNSmlExtData @ 28 NONAME
+	_ZTI14CNSmlXmlParser @ 29 NONAME
+	_ZTI17CNSmlFolderParser @ 30 NONAME
+	_ZTV12CNSmlExtData @ 31 NONAME
+	_ZTV14CNSmlXmlParser @ 32 NONAME
+	_ZTV17CNSmlFolderParser @ 33 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmlfolderutils/bld/nsmlfolderparser.mmp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Folder XML Parser mmp file
+*
+*/
+
+
+#include "defaultcaps.hrh"
+#include <platform_paths.hrh>
+
+CAPABILITY	CAP_GENERAL_DLL
+VENDORID 	VID_DEFAULT
+TARGET          nsmlfolderparser.dll
+TARGETTYPE      dll
+UID             0x1000008d 0x20029F12
+
+#if defined(ARMCC)
+DEFFILE		./def/eabifolderparser
+#elif defined(WINSCW)
+DEFFILE		./def/bwinscwfolderparser
+#elif defined(WINS)
+DEFFILE		./def/bwinsfolderparser
+#else
+DEFFILE		./def/bmarmfolderparser
+#endif
+
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+USERINCLUDE 	../inc
+SOURCE		    nsmlxmlparser.cpp
+SOURCE          NSmlExtData.cpp
+SOURCE          NSmlFolderAttributeData.cpp
+SOURCE          NSmlFolderParser.cpp
+
+LIBRARY         euser.lib estor.lib efsrv.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmlfolderutils/inc/nsmlparserconstants.h	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,117 @@
+/*
+* 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:  Folder parser constants
+*
+*/
+
+
+#ifndef __NSMLPARSERCONSTANTS_H__
+#define __NSMLPARSERCONSTANTS_H__
+
+// ------------------------------------------------------------------------------------------------
+// Defines for binary size optimization
+// ------------------------------------------------------------------------------------------------
+#define __NO_XML_COMMENTS_
+//#define __NO_EMPTY_ELEMENTS_
+
+
+// ------------------------------------------------------------------------------------------------
+// constants
+// ------------------------------------------------------------------------------------------------
+
+// the length of element start (<) and end (>)
+const TInt KElementStartEndWidth = 2;
+
+// constants used with files
+const TInt KReadDataLength = 512;
+const TUint KFileReadAccess	= EFileRead|EFileShareAny;
+const TUint KFileWriteAccess = EFileWrite|EFileShareExclusive;
+
+// Whitespace characters
+const TText KWhitespaceEmpty = ' ';
+const TText KWhitespaceLineFeed = '\r';
+const TText KWhitespaceNewLine = '\n';
+const TText KWhitespaceTabular = '\t';
+const TText KWhitespaceLineFeedNewLine = '\r\n';
+
+const TText KCharacterSlash = '/';
+
+// CData
+_LIT8(KCDataStart,		"<![CDATA[");
+_LIT8(KCDataEnd,		"]]>");
+_LIT8(KCDataInnerEnd,	"]]]]>&gt;<![CDATA[");
+
+#ifndef __NO_XML_COMMENTS_
+// Xml comments
+_LIT8(KCommentStart,	"<!--");
+_LIT8(KCommentEnd,		"-->");
+#endif
+
+const TText KElementStart = '<';
+const TText KElementEnd = '>';
+
+// Xml entities
+_LIT8(KEntityLT,	"&lt;");
+_LIT8(KEntityGT,	"&gt;");
+_LIT8(KEntityAMP,	"&amp;");
+_LIT8(KEntityAPOS,	"&apos;");
+_LIT8(KEntityQUOT,	"&quot;");
+
+// special characters
+_LIT8(KLessThan,	"<");
+_LIT8(KGreaterThan,	">");
+_LIT8(KAmpersand,	"&");
+_LIT8(KApostrophe,	"\'");
+_LIT8(KQuotation,	"\"");
+
+// boolean string representations
+_LIT8(KStringTrue,	"true");
+_LIT8(KStringFalse,	"false");
+
+// empty string
+_LIT8(KStringEmpty,	"");
+
+// truncated info spesific elements
+_LIT8(KTruncatedElement,		"truncated");
+_LIT8(KTruncatedBodyElement,	"body");
+_LIT8(KTruncatedAttachElement,	"attach");
+_LIT8(KTruncatedSizeElement,	"size");
+_LIT8(KTruncatedTypeElement,	"type");
+_LIT8(KTruncatedNameElement,	"name");
+
+// extension spesific elements
+_LIT8(KExtElement,		"Ext");
+_LIT8(KExtXNamElement,	"XNam");
+_LIT8(KExtXValElement,	"XVal");
+
+// folder spesific elements
+_LIT8(KFolderElement,			"Folder");
+_LIT8(KFolderNameElement,		"name");
+_LIT8(KFolderCreatedElement,	"created");
+_LIT8(KFolderModifiedElement,	"modified");
+_LIT8(KFolderAccessedElement,	"accessed");
+_LIT8(KFolderAttributesElement,	"attributes");
+_LIT8(KFolderRoleElement,		"role");
+
+// folder attributes
+_LIT8(KAttributeHiddenElement,		"h");
+_LIT8(KAttributeSystemElement,		"s");
+_LIT8(KAttributeArchivedElement,	"a");
+_LIT8(KAttributeDeleteElement,		"d");
+_LIT8(KAttributeWritableElement,	"w");
+_LIT8(KAttributeReadableElement,	"r");
+_LIT8(KAttributeExecutableElement,	"x");
+
+
+#endif // __NSMLPARSERCONSTANTS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmlfolderutils/src/NSmlExtData.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Sources
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <s32buf.h>
+#include <s32file.h>
+
+#include <nsmlfolderparser.h>
+#include "nsmlparserconstants.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNSmlExtData::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlExtData* CNSmlExtData::NewL()
+	{
+	CNSmlExtData* self = CNSmlExtData::NewLC();
+	CleanupStack::Pop();
+
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlExtData::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlExtData* CNSmlExtData::NewLC()
+	{
+	CNSmlExtData* self = new (ELeave) CNSmlExtData();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlExtData::~CNSmlExtData
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlExtData::~CNSmlExtData()
+	{
+	if (iXVals) 
+		{
+		iXVals->ResetAndDestroy();
+		delete iXVals;
+		}
+
+	if (iXNam) delete iXNam;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlExtData::AddXValL
+// Adds given buffer to iXVals.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlExtData::AddXValL( HBufC8* aXVal )
+	{
+	iXVals->AppendL(aXVal);
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlExtData::GenerateXmlL
+// Generates ext data xml using aParser and appends the xml to aXml.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlExtData::GenerateXmlL( TPtr8& aXml, const CNSmlXmlParser* aParser) const
+	{
+	if ( aParser == NULL )
+		return;
+
+	aParser->AppendElement(aXml, KExtElement());
+
+	if( iXNam )
+		{
+		aParser->AppendElement(aXml, KExtXNamElement(), *iXNam);
+		}
+	else
+		User::Leave(EMandatoryFieldNotFound);
+
+	if ( iXVals )
+		{
+		for (TInt i=0; i < iXVals->Count(); ++i)
+			{
+			aParser->AppendElement(aXml, KExtXValElement(), *iXVals->At(i));
+			}
+		}
+
+	aParser->AppendEndElement(aXml, KExtElement());
+
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlExtData::CountXmlSize
+// Counts the size of the ext data xml if it was generated with current 
+// values in member variables.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CNSmlExtData::CountXmlSize( const CNSmlXmlParser* aParser ) const
+	{
+	TInt size = 0;
+	size += aParser->SizeOfElements( KExtElement() );
+
+	if( iXNam )
+		{
+		size += aParser->SizeOfString( iXNam, KExtXNamElement() );
+		}
+
+	if ( iXVals )
+		{
+		for (TInt i=0; i < iXVals->Count(); ++i)
+			{
+			size += aParser->SizeOfString( iXVals->At(i), KExtXValElement() );
+			}
+		}
+
+	return size;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlExtData::ConvertIntoEntitiesL
+// Converts special characters in member variables into entities.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlExtData::ConvertIntoEntitiesL( const CNSmlXmlParser* aParser )
+	{
+	if( iXNam )
+		aParser->CharactersToEntitiesL(iXNam, 0, iXNam->Length());
+
+	if( iXVals )
+		{
+		for (TInt i=0; i < iXVals->Count(); ++i)
+			{
+			aParser->CharactersToEntitiesL(iXVals->At(i), 0, iXVals->At(i)->Length());
+			}
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlExtData::CNSmlExtData
+// Constructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlExtData::CNSmlExtData()
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlExtData::ConstructL
+// Second phase construction.
+// -----------------------------------------------------------------------------
+//
+void CNSmlExtData::ConstructL()
+	{
+	iXVals = new (ELeave) CNSmlXValArray(3);
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmlfolderutils/src/NSmlFolderAttributeData.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Sources
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <s32buf.h>
+#include <s32file.h>
+
+#include <nsmlfolderparser.h>
+#include "nsmlparserconstants.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// TNSmlFolderAttributeData::TNSmlFolderAttributeData
+// Constructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TNSmlFolderAttributeData::TNSmlFolderAttributeData()
+: iHidden(EBooleanMissing), iSystem(EBooleanMissing), 
+iArchived(EBooleanMissing), iDelete(EBooleanMissing),
+iWritable(EBooleanMissing), iReadable(EBooleanMissing),
+iExecutable(EBooleanMissing)
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// TNSmlFolderAttributeData::AttributeCount
+// Returns the amount of fields that are not EBooleanMissing
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt TNSmlFolderAttributeData::AttributeCount() const
+	{
+	TInt count = 0;
+
+	if ( iHidden ) count++;
+	if ( iSystem ) count++;
+	if ( iArchived ) count++;
+	if ( iDelete ) count++;
+	if ( iWritable ) count++;
+	if ( iReadable ) count++;
+	if ( iExecutable ) count++;
+
+	return count;
+	}
+
+// -----------------------------------------------------------------------------
+// TNSmlFolderAttributeData::GenerateXml
+// Generates attribute xml
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void TNSmlFolderAttributeData::GenerateXml( TPtr8& aXml, const CNSmlXmlParser* aParser ) const
+	{
+	aParser->AppendElement(aXml, KFolderAttributesElement());
+
+	if ( iHidden )
+		{
+		aParser->AppendElement(aXml, KAttributeHiddenElement(), aParser->BooleanToString( iHidden ));
+		}
+
+	if ( iSystem )
+		{
+		aParser->AppendElement(aXml, KAttributeSystemElement(), aParser->BooleanToString( iSystem ));
+		}
+
+	if ( iArchived )
+		{
+		aParser->AppendElement(aXml, KAttributeArchivedElement(), aParser->BooleanToString( iArchived ));
+		}
+
+	if ( iDelete )
+		{
+		aParser->AppendElement(aXml, KAttributeDeleteElement(), aParser->BooleanToString( iDelete ));
+		}
+
+	if ( iWritable )
+		{
+		aParser->AppendElement(aXml, KAttributeWritableElement(), aParser->BooleanToString( iWritable ));
+		}
+
+	if ( iReadable )
+		{
+		aParser->AppendElement(aXml, KAttributeReadableElement(), aParser->BooleanToString( iReadable ));
+		}
+
+	if ( iExecutable )
+		{
+		aParser->AppendElement(aXml, KAttributeExecutableElement(), aParser->BooleanToString( iExecutable ));
+		}
+
+	aParser->AppendEndElement(aXml, KFolderAttributesElement());
+	}
+
+// -----------------------------------------------------------------------------
+// TNSmlFolderAttributeData::CountXmlSize
+// Coounts the size of the xml if it was generated using the values currently in 
+// member variables
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt TNSmlFolderAttributeData::CountXmlSize( const CNSmlXmlParser* aParser ) const
+	{
+	TInt size = 0;
+	size += aParser->SizeOfElements( KFolderAttributesElement() );
+
+	if ( iHidden )
+		{
+		size += aParser->SizeOfBoolean( iHidden, KAttributeHiddenElement() );
+		}
+
+	if ( iSystem )
+		{
+		size += aParser->SizeOfBoolean( iSystem, KAttributeSystemElement() );
+		}
+
+	if ( iArchived )
+		{
+		size += aParser->SizeOfBoolean( iArchived, KAttributeArchivedElement() );
+		}
+
+	if ( iDelete )
+		{
+		size += aParser->SizeOfBoolean( iDelete, KAttributeDeleteElement() );
+		}
+
+	if ( iWritable )
+		{
+		size += aParser->SizeOfBoolean( iWritable, KAttributeWritableElement() );
+		}
+
+	if ( iReadable )
+		{
+		size += aParser->SizeOfBoolean( iReadable, KAttributeReadableElement() );
+		}
+
+	if ( iExecutable )
+		{
+		size += aParser->SizeOfBoolean( iExecutable, KAttributeExecutableElement() );
+		}
+
+	return size;
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmlfolderutils/src/NSmlFolderParser.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,631 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Sources
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <s32buf.h>
+#include <s32file.h>
+
+#include <nsmlfolderparser.h>
+#include "nsmlparserconstants.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlFolderParser* CNSmlFolderParser::NewL()
+	{
+	CNSmlFolderParser* self = CNSmlFolderParser::NewLC();
+	CleanupStack::Pop();
+
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlFolderParser* CNSmlFolderParser::NewLC()
+	{
+	CNSmlFolderParser* self = new (ELeave) CNSmlFolderParser();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::~CNSmlFolderParser
+// Destructor
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlFolderParser::~CNSmlFolderParser()
+	{
+	if(iExt) 
+		{
+		iExt->ResetAndDestroy();
+		delete iExt;
+		}
+
+	if(iName) delete iName;
+	if(iRole) delete iRole;
+
+	if( iExtData ) delete iExtData;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::ParseXml
+// Parses through the given XML and places the data to member variables.
+// Note: The method does not check whether the member variables 
+// already contains data or not, but just writes it (if some of them are already 
+// instantiated dynamically, they should be deleted before this method is called).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TNSmlParserGeneratorError CNSmlFolderParser::ParseXml( HBufC8* aXml )
+	{
+
+	TRAPD(cdataErr, PreProcessL(aXml));
+	if (cdataErr != EErrorNone)
+		return (TNSmlParserGeneratorError)cdataErr;
+
+	iSetValues.Reset();
+	iCurrentState = EFolderNone;
+	iLastState = EFolderNone;
+	TPtrC8 ptr(*aXml);
+
+	TRAPD(err, ParseL( ptr ));
+
+	if( err == EErrorNone && iCurrentState != EFolderNone )
+		return EInvalidXmlError;
+
+	return CheckError(err);
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::GenerateXml
+// Generates Folder-XML using the values in member variables. aXml contains the 
+// generated xml when the function returns successfully. Note: caller should not 
+// instantiate the HBufC8, since this method first counts the size of the 
+// xml to be generated and then instatiates the HBufC8 with a correct maximum size.
+// If the given buffer is not NULL, it is destroyed and a new one is instantiated.
+// Caller gets the control of the HBufC8 when the function returns.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TNSmlParserGeneratorError CNSmlFolderParser::GenerateXml( HBufC8*& aXml ) 
+	{
+
+	TRAPD( err, ConvertIntoEntitiesL(); // convert special characters into entities
+	
+			GenerateFolderXmlL( aXml ) );
+
+	return CheckError(err);
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::GenerateFolderXmlL
+// Private methods that does the actual folder xml generation
+// -----------------------------------------------------------------------------
+//
+void CNSmlFolderParser::GenerateFolderXmlL( HBufC8*& aXml )
+	{
+	// count the size of the xml
+	TInt size = CountXmlSizeL();
+
+	// create buffer for the xml
+
+	if ( aXml )
+		{
+		delete aXml;
+		aXml = NULL;
+		}
+
+	aXml = HBufC8::NewLC(size);
+	TPtr8 ptr = aXml->Des();
+
+	AppendElement(ptr, KFolderElement());
+
+	if ( iName )
+		{
+		AppendElement(ptr, KFolderNameElement(), *iName);
+		}
+
+	if (iCreated != Time::NullTTime())
+		{
+		AppendElement(ptr, KFolderCreatedElement(), DateTimeToStringL(iCreated));
+		}
+
+	if (iModified != Time::NullTTime())
+		{
+		AppendElement(ptr, KFolderModifiedElement(), DateTimeToStringL(iModified));
+		}
+
+	if (iAccessed != Time::NullTTime())
+		{
+		AppendElement(ptr, KFolderAccessedElement(), DateTimeToStringL(iAccessed));
+		}
+
+	if (iAttributes.AttributeCount() > 0)
+		{
+		iAttributes.GenerateXml(ptr, this);
+		}
+
+	if ( iRole )
+		{
+		AppendElement(ptr, KFolderRoleElement(), *iRole);
+		}
+
+	if ( iExt )
+		{
+		for (TInt i=0; i < iExt->Count(); ++i)
+			{
+			iExt->At(i)->GenerateXmlL(ptr, this);
+			}
+
+		}
+
+	AppendEndElement(ptr, KFolderElement());
+
+	CleanupStack::Pop(); // aXml
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::CountXmlSizeL
+// Counts how long the xml string will be if it was generated using 
+// the values currently in member variables.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CNSmlFolderParser::CountXmlSizeL()
+	{
+	TInt size = 0;
+
+	size += SizeOfElements( KFolderElement() );
+	size += KCDataStart().Length() + KCDataEnd().Length();
+
+	if ( iName )
+		{
+		size += SizeOfString( iName, KFolderNameElement() );
+		}
+
+	if (iCreated != Time::NullTTime())
+		{
+		size += SizeOfDatetime( KFolderCreatedElement() );
+		}
+
+	if (iModified != Time::NullTTime())
+		{
+		size += SizeOfDatetime( KFolderModifiedElement() );
+		}
+
+	if (iAccessed != Time::NullTTime())
+		{
+		size += SizeOfDatetime( KFolderAccessedElement() );
+		}
+
+	// attributes, if any present
+	if (iAttributes.AttributeCount() > 0)
+		{
+		size += iAttributes.CountXmlSize( this );
+		}
+
+	if ( iRole )
+		{
+		size += SizeOfString( iRole, KFolderRoleElement() );
+		}
+
+	if ( iExt )
+		{
+		for (TInt i=0; i < iExt->Count(); ++i)
+			{
+			size += iExt->At(i)->CountXmlSize( this );
+			}
+		}
+
+	return size;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::AddExtL
+// Adds the given extension to iExt
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlFolderParser::AddExtL( CNSmlExtData* aExt )
+	{
+	iExt->AppendL(aExt);
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::NextElementL
+// Base class' ParseL method calls this method, when a new element is found. aElement 
+// is the name of that element (string inside '<' and '>' characters).
+// -----------------------------------------------------------------------------
+//
+void CNSmlFolderParser::NextElementL( TPtrC8 aElement )
+	{
+	if (aElement.Length() == 0)
+		User::Leave(EInvalidXmlError);
+
+	TBool startElement = ETrue;
+
+	if(aElement[0] == KCharacterSlash)
+		{
+		// end element
+		// remove the '/' character from the beginning
+		aElement.Set( aElement.Right( aElement.Length() - 1 ) );
+		startElement = EFalse;
+		}
+#ifndef __NO_EMPTY_ELEMENTS_
+	else if (aElement[aElement.Length()-1] == KCharacterSlash)
+		{
+		// empty element
+		// remove the '/' character from the end
+		aElement.Set( aElement.Left( aElement.Length() - 1 ) );
+
+		// empty element == start element, empty data, end element
+		NextElementL( aElement ); // simulates start element
+		NextDataL( _L8("") ); // simulates the empty data
+
+		HBufC8* end = HBufC8::NewLC(aElement.Length()+1);
+		TPtr8 ptr = end->Des();
+		ptr.Append( _L8("/") );
+		ptr.Append( aElement );
+
+		NextElementL( ptr ); // simulates end element
+
+		CleanupStack::PopAndDestroy(); // end
+
+		return;
+		}
+#endif
+
+	// variables used for state, init to <Folder> and not set
+	TNSmlCurrentFolderElement inner = EFolder;
+	TNSmlCurrentFolderElement outer = EFolder;
+	TBool isSet = EFalse;
+
+	if( aElement == KFolderElement )
+		{
+		outer = EFolderNone;
+		isSet = iSetValues.iFolder;
+		if ( startElement ) iSetValues.iFolder = ETrue;
+		}
+	else if( aElement == KFolderNameElement )
+		{
+		inner = EFolderName;
+		isSet = iSetValues.iName;
+		}
+	else if( aElement == KFolderCreatedElement )
+		{
+		inner = EFolderCreated;
+		isSet = iSetValues.iCreated;
+		}
+	else if( aElement == KFolderModifiedElement )
+		{
+		inner = EFolderModified;
+		isSet = iSetValues.iModified;
+		}
+	else if( aElement == KFolderAccessedElement )
+		{
+		inner = EFolderAccessed;
+		isSet = iSetValues.iAccessed;
+		}
+	else if( aElement == KFolderAttributesElement )
+		{
+		inner = EAttributes;
+		isSet = iSetValues.iAttributes;
+		if ( startElement) iSetValues.iAttributes = ETrue;
+		}
+	else if( aElement == KAttributeHiddenElement )
+		{
+		inner = EAttributesH;
+		outer = EAttributes;
+		isSet = iSetValues.iAttributesH;
+		}
+	else if( aElement == KAttributeSystemElement )
+		{
+		inner = EAttributesS;
+		outer = EAttributes;
+		isSet = iSetValues.iAttributesS;
+		}
+	else if( aElement == KAttributeArchivedElement )
+		{
+		inner = EAttributesA;
+		outer = EAttributes;
+		isSet = iSetValues.iAttributesA;
+		}
+	else if( aElement == KAttributeDeleteElement )
+		{
+		inner = EAttributesD;
+		outer = EAttributes;
+		isSet = iSetValues.iAttributesD;
+		}
+	else if( aElement == KAttributeWritableElement )
+		{
+		inner = EAttributesW;
+		outer = EAttributes;
+		isSet = iSetValues.iAttributesW;
+		}
+	else if( aElement == KAttributeReadableElement )
+		{
+		inner = EAttributesR;
+		outer = EAttributes;
+		isSet = iSetValues.iAttributesR;
+		}
+	else if( aElement == KAttributeExecutableElement )
+		{
+		inner = EAttributesX;
+		outer = EAttributes;
+		isSet = iSetValues.iAttributesX;
+		}
+	else if( aElement == KFolderRoleElement )
+		{
+		inner = EFolderRole;
+		isSet = iSetValues.iRole;
+		}
+	else if( aElement == KExtElement )
+		{
+		inner = EFolderExt;
+
+		if ( startElement )
+			{
+			if( iExtData )
+				{
+				delete iExtData;
+				iExtData = NULL;
+				}
+			iExtData = CNSmlExtData::NewL();
+			iSetValues.iXNam = EFalse;
+			}
+		else
+			{
+			if( !iSetValues.iXNam ) User::Leave(EMandatoryFieldNotFound); // xnam not set
+			iExt->AppendL(iExtData);
+			iExtData = NULL;
+			}
+		}
+	else if( aElement == KExtXNamElement )
+		{
+		inner = EFolderExtXNam;
+		outer = EFolderExt;
+		isSet = iSetValues.iXNam;
+		}
+	else if( aElement == KExtXValElement )
+		{
+		inner = EFolderExtXVal;
+		outer = EFolderExt;
+		}
+	else
+		{
+		User::Leave(EInvalidXmlError);
+		}
+
+
+	// finally, change state depending on was the element start or end element
+	if ( startElement )
+		{
+		StartElementStateChangeL( outer, inner, isSet );
+		}
+	else
+		{
+		EndElementStateChangeL( inner, outer );
+		}
+
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::NextDataL
+// Base class' ParseL method calls this method, when a data is read from xml,
+// but that data is not element name (data inside or between elements).
+// -----------------------------------------------------------------------------
+//
+void CNSmlFolderParser::NextDataL( TPtrC8 aData )
+	{
+	switch(iCurrentState)
+		{
+		case EFolderNone:
+		case EFolder:
+		case EAttributes:
+		case EFolderExt:
+			LeaveIfNotWhiteSpaceL( aData );
+			break;
+		case EFolderName:
+			iName = aData.AllocL();
+			iSetValues.iName = ETrue;
+			break;
+		case EFolderCreated:
+			iCreated = StringToTTimeL(aData);
+			iSetValues.iCreated = ETrue;
+			break;
+		case EFolderModified:
+			iModified = StringToTTimeL(aData);
+			iSetValues.iModified = ETrue;
+			break;
+		case EFolderAccessed:
+			iAccessed = StringToTTimeL(aData);
+			iSetValues.iAccessed = ETrue;
+			break;
+		case EAttributesH:
+			iAttributes.iHidden = StringToBooleanL(aData);
+			iSetValues.iAttributesH = ETrue;
+			break;
+		case EAttributesS:
+			iAttributes.iSystem = StringToBooleanL(aData);
+			iSetValues.iAttributesS = ETrue;
+			break;
+		case EAttributesA:
+			iAttributes.iArchived = StringToBooleanL(aData);
+			iSetValues.iAttributesA = ETrue;
+			break;
+		case EAttributesD:
+			iAttributes.iDelete = StringToBooleanL(aData);
+			iSetValues.iAttributesD = ETrue;
+			break;
+		case EAttributesW:
+			iAttributes.iWritable = StringToBooleanL(aData);
+			iSetValues.iAttributesW = ETrue;
+			break;
+		case EAttributesR:
+			iAttributes.iReadable = StringToBooleanL(aData);
+			iSetValues.iAttributesR = ETrue;
+			break;
+		case EAttributesX:
+			iAttributes.iExecutable = StringToBooleanL(aData);
+			iSetValues.iAttributesX = ETrue;
+			break;
+		case EFolderRole:
+			iRole = aData.AllocL();
+			iSetValues.iRole = ETrue;
+			break;
+		case EFolderExtXNam:
+			iExtData->iXNam = aData.AllocL();
+			iSetValues.iXNam = ETrue;
+			break;
+		case EFolderExtXVal:
+			iExtData->AddXValL(aData.AllocL());
+			break;
+		default:
+			User::Leave(EUnknownError); // should never happen
+			break;
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::StartElementStateChangeL
+// Checks that the state change (new start element) is legal (right order of 
+// elements and element not already set) and changes the state.
+// -----------------------------------------------------------------------------
+//
+void CNSmlFolderParser::StartElementStateChangeL(TNSmlCurrentFolderElement aCurrentState, 
+											     TNSmlCurrentFolderElement aNextState, 
+											     TBool aIsSet)
+	{
+	if( aIsSet || iCurrentState != aCurrentState || aNextState < iLastState )
+		{
+		User::Leave(EInvalidXmlError);
+		}
+
+	iLastState = iCurrentState;
+	iCurrentState = aNextState;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::EndElementStateChangeL
+// Checks that the state change (new end element) is legal (right order of 
+// elements and element not already set) and changes the state.
+// -----------------------------------------------------------------------------
+//
+void CNSmlFolderParser::EndElementStateChangeL(TNSmlCurrentFolderElement aCurrentState, 
+											   TNSmlCurrentFolderElement aNextState )
+	{
+	if( iCurrentState != aCurrentState )
+		{
+		User::Leave(EInvalidXmlError);
+		}
+
+	iLastState = iCurrentState;
+	iCurrentState = aNextState;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::ConvertIntoEntitiesL
+// Converts special characters of this dataobject to corresponding 
+// characters. 
+// -----------------------------------------------------------------------------
+//
+void CNSmlFolderParser::ConvertIntoEntitiesL()
+	{
+	// name
+	if ( iName )
+		{
+		CharactersToEntitiesL(iName, 0, iName->Length());
+		}
+
+	// role
+	if ( iRole )
+		{
+		CharactersToEntitiesL(iRole, 0, iRole->Length());
+		}
+
+	// extensions
+	if ( iExt )
+		{
+		for (TInt i=0; i < iExt->Count(); ++i)
+			{
+			iExt->At(i)->ConvertIntoEntitiesL(this);
+			}
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::CNSmlFolderParser
+// Constructor
+// -----------------------------------------------------------------------------
+//
+CNSmlFolderParser::CNSmlFolderParser()
+	: iCreated(Time::NullTTime()), iModified(Time::NullTTime()), 
+	iAccessed(Time::NullTTime())
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::ConstructL
+// Second phase construction
+// -----------------------------------------------------------------------------
+//
+void CNSmlFolderParser::ConstructL()
+	{
+	iExt = new (ELeave) CNSmlExtDataArray(3);
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::TNSmlSetFolderValues::TNSmlSetFolderValues
+// -----------------------------------------------------------------------------
+//
+CNSmlFolderParser::TNSmlSetFolderValues::TNSmlSetFolderValues()
+	{
+	Reset();
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlFolderParser::TNSmlSetFolderValues::Reset
+// -----------------------------------------------------------------------------
+//
+void CNSmlFolderParser::TNSmlSetFolderValues::Reset()
+	{
+	iFolder = EFalse;
+	iName = EFalse;
+	iCreated = EFalse;
+	iModified = EFalse;
+	iAccessed = EFalse;
+	iAttributes = EFalse;
+	iAttributesH = EFalse;
+	iAttributesS = EFalse;
+	iAttributesA = EFalse;
+	iAttributesD = EFalse;
+	iAttributesW = EFalse;
+	iAttributesR = EFalse;
+	iAttributesX = EFalse;
+	iXNam = EFalse;
+	iRole = EFalse;
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/nsmlfolderutils/src/nsmlxmlparser.cpp	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,798 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Sources
+*
+*/
+
+
+// 1.2 Changes: nsmlxmlparser module added
+
+// ------------------------------------------------------------------------------------------------
+// Includes
+// ------------------------------------------------------------------------------------------------
+#include <s32buf.h>
+#include <s32file.h>
+#include <nsmlfolderparser.h>
+#include "nsmlparserconstants.h"
+
+
+// ------------------------------------------------------------------------------------------------
+// 
+// CNSmlXmlParser methods
+// 
+// ------------------------------------------------------------------------------------------------
+
+// ------------------------------------------------------------------------------------------------
+// Constructor
+// ------------------------------------------------------------------------------------------------
+EXPORT_C CNSmlXmlParser::CNSmlXmlParser()
+	{
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Destructor.
+// ------------------------------------------------------------------------------------------------
+EXPORT_C CNSmlXmlParser::~CNSmlXmlParser()
+	{
+	if( iBuffer ) delete iBuffer;
+	if ( iCompleteBuffer ) delete iCompleteBuffer;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Parses the given string for cdata areas and entitys. If a cdata area is 
+// found, the data in it is skipped over. The entities outside cdata are converted 
+// into characters they represent (but only if cdata is found).
+// Note: This method is intended for processing the CDATA used right after <Data>. 
+// I.e. this method removes the cdata-elements used for wrapping the whole xml data 
+// and processes the string so that the inner cdatas used in the xml become valid.
+// THIS METHOD SHOULD BE CALLED RIGHT IN THE BEGINNING OF PARSING IF <Data>-BLOCK 
+// IS WRAPPED WITHIN CDATA.
+// ------------------------------------------------------------------------------------------------
+void CNSmlXmlParser::PreProcessL( HBufC8* aXml ) const
+	{
+	// take a modifiable pointer
+	TPtr8 xml = aXml->Des();
+
+	// the string used for searching and moving in the string
+	TPtrC8 searchString(*aXml);
+
+	// the current position in the original string
+	TInt searchStartPos = 0;
+
+	// find the first cdata start
+	TInt cdataStartPos = searchString.Find(KCDataStart);
+	
+	// If CDATA is not found from beginning then data is not inside CDATA and then
+	// preprocessing is not needed
+	if ( cdataStartPos != 0 )
+	    {
+	    return;
+	    }
+
+	TInt cdataEndPos = KErrNotFound;
+
+	// while cdata is found
+	while ( cdataStartPos != KErrNotFound )
+		{
+		cdataStartPos += searchStartPos;
+
+		// find an end of cdata before entities are converted
+		cdataEndPos = searchString.Find(KCDataEnd);
+
+		// convert entities between search start and cdata start
+		TInt entityChange = EntitiesToCharactersL(aXml, searchStartPos, cdataStartPos);
+		xml.Set(aXml->Des());
+		cdataStartPos += entityChange;
+
+		if ( cdataEndPos != KErrNotFound )
+			{
+			cdataEndPos += entityChange;
+			cdataEndPos += searchStartPos;
+
+			// if the end is before start -> error
+			if (cdataEndPos < cdataStartPos)
+				User::Leave( EInvalidCDataStructure );
+				
+			// remove cdata end
+			xml.Delete(cdataEndPos, KCDataEnd().Length());
+			// remove cdata start
+			xml.Delete(cdataStartPos, KCDataStart().Length());
+
+			searchStartPos = cdataEndPos - KCDataStart().Length();
+			searchString.Set( xml.Right(xml.Length() - searchStartPos) );
+			}
+		else 
+			{
+			// the end of cdata was not found or cdata end was before start -> error
+			User::Leave( EInvalidCDataStructure );
+			}
+
+		// find a new cdata start that is after the found end
+		cdataStartPos = searchString.Find(KCDataStart);
+
+		}
+
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Return the TNSmlBoolean-value's string-representation.
+// ------------------------------------------------------------------------------------------------
+TPtrC8 CNSmlXmlParser::BooleanToString( const TNSmlBoolean aValue ) const
+	{
+	TPtrC8 str;
+	switch(aValue)
+		{
+		case EBooleanTrue:
+			{
+			str.Set(KStringTrue);
+			break;
+			}
+		case EBooleanFalse:
+			{
+			str.Set(KStringFalse);
+			break;
+			}
+		default:
+			{
+			str.Set(KStringEmpty);
+			}
+		}
+
+	return str;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Returns the TTime-value's string-representation.
+// ------------------------------------------------------------------------------------------------
+TBuf8<KDateTimeLength> CNSmlXmlParser::DateTimeToStringL( const TTime& aValue ) const
+	{
+	TBuf<KDateTimeLength> str;
+	
+	// aValue is not changed but Z character is added to the end of string.
+	// Messaging uses UTC times and that is reason why time is not changed.
+	aValue.FormatL( str, _L("%F%Y%M%DT%H%T%SZ") );
+
+	// from 16-bit to 8-bit
+	TBuf8<KDateTimeLength> dt;
+	dt.Copy(str);
+
+	return dt;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Returns the integer value's string-representation.
+// ------------------------------------------------------------------------------------------------
+TBuf8<KIntegerMaxLength> CNSmlXmlParser::IntegerToString( const TInt aValue ) const
+	{
+	TBuf8<KIntegerMaxLength> str;
+	str.AppendNum(aValue);
+	return str;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Returns the boolean representation of the string or leaves if error (EInvalidBooleanValue).
+// ------------------------------------------------------------------------------------------------
+TNSmlBoolean CNSmlXmlParser::StringToBooleanL( const TPtrC8& aValue ) const
+	{
+	if( aValue == KStringTrue )
+		return EBooleanTrue;
+	else if( aValue == KStringFalse || aValue == KStringEmpty )
+		return EBooleanFalse;
+	else
+		User::Leave(EInvalidBooleanValue);
+
+	return EBooleanMissing;
+	}
+
+	
+// ------------------------------------------------------------------------------------------------
+// Returns the integer representation of the string or leaves if error (EInvalidIntegerValue).
+// ------------------------------------------------------------------------------------------------
+TInt CNSmlXmlParser::StringToIntegerL( const TPtrC8& aValue ) const
+	{
+	if (aValue.Length() <= 0)
+		return 0;
+
+	// convert the data to an integer
+	TLex8 lex(aValue);
+	TUint uValue = 0;
+	TBool isNegative = EFalse;
+
+	TChar c = lex.Peek();
+
+	// check for a minus or plus sign
+	if ( c == '-' )
+		{
+		isNegative = ETrue;
+		lex.Inc();
+		}
+	else if ( c == '+' )
+		{
+		lex.Inc();
+		}
+
+	TRadix radix = EDecimal;
+	c = lex.Peek();
+
+	if (c == '0') // octal or hex
+		{
+		lex.Get();
+		c = lex.Get();
+		if ( c == 'x' || c == 'X' )
+			{
+			radix = EHex;
+			}
+		else
+			{
+			radix = EOctal;
+			lex.UnGet(); // back up
+			}
+		}
+
+	TInt err = lex.Val(uValue, radix);
+	if ( err != KErrNone )
+		User::Leave(EInvalidIntegerValue);
+
+	TInt value = uValue;
+
+	return isNegative ? value*(-1) : value;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Returns the TTime representation of the string or leaves if error (EInvalidDatetimeValue).
+// UTC times are not supported, i.e. datetimes that have Z-ending are treated as 
+// local times.
+// ------------------------------------------------------------------------------------------------
+TTime CNSmlXmlParser::StringToTTimeL( TPtrC8& aValue ) const
+	{
+	// check that there is data
+	if (aValue.Length() <= 0)
+		User::Leave( EInvalidDatetimeValue );
+
+	// format the data into a TTime
+
+	if (aValue[aValue.Length()-1] == 'Z')
+		{
+		// The datetime is in UTC, which is not supported
+		// no correction done, treat as local time
+		aValue.Set( aValue.Left( aValue.Length()-1 ) );
+		}
+
+	TDateTime datetime(0,(TMonth)0,0,0,0,0,0);
+
+	// read datetime and check errors
+
+	TInt error = KErrNone;
+
+	// read year
+	TPtrC8 str = aValue.Left(4);
+	TLex8 lex(str);
+	TInt value;
+	error = lex.Val(value);
+	CheckDatetimeErrorL( error );
+	error  = datetime.SetYear(value);
+	CheckDatetimeErrorL( error );
+
+	// read month
+	str.Set(aValue.Mid(4, 2));
+	lex.Assign(str);
+	error = lex.Val(value);
+	CheckDatetimeErrorL( error );
+	--value;
+	error = datetime.SetMonth((TMonth)value);
+	CheckDatetimeErrorL( error );
+
+	// read day
+	str.Set(aValue.Mid(6, 2));
+	lex.Assign(str);
+	error = lex.Val(value);
+	CheckDatetimeErrorL( error );
+	--value;
+	error = datetime.SetDay(value);
+	CheckDatetimeErrorL( error );
+
+	// Skip character 'T' and read hour
+	str.Set(aValue.Mid(9, 2));
+	lex.Assign(str);
+	error = lex.Val(value);
+	CheckDatetimeErrorL( error );
+	error = datetime.SetHour(value);
+	CheckDatetimeErrorL( error );
+
+	// minutes
+	str.Set(aValue.Mid(11, 2));
+	lex.Assign(str);
+	error = lex.Val(value);
+	CheckDatetimeErrorL( error );
+	error = datetime.SetMinute(value);
+	CheckDatetimeErrorL( error );
+
+	// seconds
+	str.Set(aValue.Mid(13, 2));
+	lex.Assign(str);
+	error = lex.Val(value);
+	CheckDatetimeErrorL( error );
+	error = datetime.SetSecond(value);
+	CheckDatetimeErrorL( error );
+
+	return TTime(datetime);
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Adds start element, the value and end element to aPtr.
+// ------------------------------------------------------------------------------------------------
+void CNSmlXmlParser::AppendElement( TPtr8& aPtr, const TDesC8& aElementName, const TDesC8& aValue ) const
+	{
+	// start element
+	aPtr.Append(KElementStart);
+	aPtr.Append(aElementName);
+	aPtr.Append(KElementEnd);
+
+	// value
+	aPtr.Append(aValue);
+
+	// end element
+	aPtr.Append(KElementStart);
+	aPtr.Append(KCharacterSlash);
+	aPtr.Append(aElementName);
+	aPtr.Append(KElementEnd);
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Forms an element using the given element name and appends it to the given string.
+// ------------------------------------------------------------------------------------------------
+void CNSmlXmlParser::AppendElement( TPtr8& aPtr, const TDesC8& aElementName ) const
+	{
+	aPtr.Append(KElementStart);
+	aPtr.Append(aElementName);
+	aPtr.Append(KElementEnd);
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Forms an end element using the given element name and appends it to the given string.
+// ------------------------------------------------------------------------------------------------
+void CNSmlXmlParser::AppendEndElement( TPtr8& aPtr, const TDesC8& aElementName ) const
+	{
+	aPtr.Append(KElementStart);
+	aPtr.Append(KCharacterSlash);
+	aPtr.Append(aElementName);
+	aPtr.Append(KElementEnd);
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Returns the total length of start and end tag.
+// ------------------------------------------------------------------------------------------------
+TInt CNSmlXmlParser::SizeOfElements( const TDesC8& aElementName ) const
+	{
+	TInt size = 0;
+
+	// start element plus end element ( 1 = length of '/' char )
+	size += 2*aElementName.Length() + 1;
+	size += 2*KElementStartEndWidth; // '<' and '>'
+
+	return size;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Returns the length of the given boolean element and it's data if it was a string.
+// ------------------------------------------------------------------------------------------------
+TInt CNSmlXmlParser::SizeOfBoolean( const TNSmlBoolean aValue, const TDesC8& aElementName ) const
+	{
+	TInt size = 0;
+	size += SizeOfElements( aElementName );
+	switch ( aValue )
+		{
+		case EBooleanTrue:
+			return size+4; // "true"
+		case EBooleanFalse:
+			return size+5; // "false"
+		default:
+			return 0;
+		}
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Returns the length of the given datetime element and it's data if it was a string.
+// ------------------------------------------------------------------------------------------------
+TInt CNSmlXmlParser::SizeOfDatetime( const TDesC8& aElementName ) const
+	{
+	TInt size = SizeOfElements( aElementName ) + KDateTimeLength;
+	return size;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Returns the maximum length of the given integer element and it's data if it was a string.
+// ------------------------------------------------------------------------------------------------
+TInt CNSmlXmlParser::SizeOfInteger( const TDesC8& aElementName ) const
+	{
+	TInt size = SizeOfElements( aElementName ) + KIntegerMaxLength;
+	return size;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Returns the length of the given string element and it's data if it was a string.
+// ------------------------------------------------------------------------------------------------
+TInt CNSmlXmlParser::SizeOfString( const HBufC8* aValue, const TDesC8& aElementName ) const
+	{
+	TInt size = SizeOfElements( aElementName ) + aValue->Length();
+	return size;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Finds entities and replaces them with the characters they represent. Returns 
+// an integer indicating the size change in aXml.
+// ------------------------------------------------------------------------------------------------
+TInt CNSmlXmlParser::EntitiesToCharactersL( HBufC8*& aXml, TInt aStartPos, TInt aEndPos ) const
+	{
+	TInt change = 0;
+	TInt changeSum = 0;
+
+	change = ReplaceL(aXml, KEntityLT, KLessThan, aStartPos, aEndPos);
+	changeSum += change;
+	aEndPos += change;
+
+	change = ReplaceL(aXml, KEntityGT, KGreaterThan, aStartPos, aEndPos);
+	changeSum += change;
+	aEndPos += change;
+
+	change = ReplaceL(aXml, KEntityAMP, KAmpersand, aStartPos, aEndPos);
+	changeSum += change;
+	aEndPos += change;
+
+	change = ReplaceL(aXml, KEntityAPOS, KApostrophe, aStartPos, aEndPos);
+	changeSum += change;
+	aEndPos += change;
+
+	change = ReplaceL(aXml, KEntityQUOT, KQuotation, aStartPos, aEndPos);
+	changeSum += change;
+
+	return changeSum;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Finds special characters and replaces them with corresponding entities. Returns 
+// an integer indicating the size change in aXml.
+// ------------------------------------------------------------------------------------------------
+TInt CNSmlXmlParser::CharactersToEntitiesL( HBufC8*& aXml, TInt aStartPos, TInt aEndPos ) const
+	{
+	TInt change = 0;
+	TInt changeSum = 0;
+
+	// Note: this replace has to be the first one, since it changes 
+	// &-characters to &amp;s and all the other replaces generate 
+	// &-characters as they are entities.
+	change = ReplaceL(aXml, KAmpersand, KEntityAMP, aStartPos, aEndPos);
+	changeSum += change;
+	aEndPos += change;
+
+	change = ReplaceL(aXml, KLessThan, KEntityLT, aStartPos, aEndPos);
+	changeSum += change;
+	aEndPos += change;
+
+	change = ReplaceL(aXml, KGreaterThan, KEntityGT, aStartPos, aEndPos);
+	changeSum += change;
+	aEndPos += change;
+
+	change = ReplaceL(aXml, KApostrophe, KEntityAPOS, aStartPos, aEndPos);
+	changeSum += change;
+	aEndPos += change;
+
+	change = ReplaceL(aXml, KQuotation, KEntityQUOT, aStartPos, aEndPos);
+	changeSum += change;
+
+	return changeSum;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Returns ETrue if all the characters in the given text are whitespace 
+// characters, else EFalse.
+// ------------------------------------------------------------------------------------------------
+TBool CNSmlXmlParser::IsWhitespace( const TDesC8& aText ) const
+	{
+	// loop the string character by character
+	TText c;
+	for ( TInt i=0; i < aText.Length(); ++i )
+		{
+		c = aText[i];
+		switch( c )
+			{
+			case KWhitespaceEmpty:
+				break;
+			case KWhitespaceLineFeed:
+				break;
+			case KWhitespaceNewLine:
+				break;
+			case KWhitespaceTabular:
+				break;
+			case KWhitespaceLineFeedNewLine:
+				break;
+			default:
+				return EFalse;
+			}
+		}
+
+	return ETrue;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Leaves with EInvalidXmlError if the given string is not whitespace.
+// ------------------------------------------------------------------------------------------------
+void CNSmlXmlParser::LeaveIfNotWhiteSpaceL( const TDesC8& aText ) const
+	{
+	if ( !IsWhitespace( aText ) )
+		{
+		User::Leave( EInvalidXmlError );
+		}
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Maps the given value to TNSmlParserGeneratorError.
+// ------------------------------------------------------------------------------------------------
+TNSmlParserGeneratorError CNSmlXmlParser::CheckError( const TInt error ) const
+	{
+	if ( error == KErrNoMemory )
+		{
+		return EOutOfMemory;
+		}
+	else if ( error < KErrNone )
+		{
+		// some system wide error, should not occur
+		return EUnknownError;
+		}
+	else if ( error != EErrorNone )
+		{
+		return (TNSmlParserGeneratorError)error;
+		}
+
+	return EErrorNone;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Parses the given xml and calls NextDataL and NextElementL methods when finds 
+// data or element. 
+// ------------------------------------------------------------------------------------------------
+void CNSmlXmlParser::ParseL( TPtrC8& aXml )
+	{
+
+	ResetBufferL(iBuffer);
+	ResetBufferL(iCompleteBuffer);
+
+	// boolean indicating if reading element name (true) or insides of 
+	// an element (false)
+	TBool readingElementName = EFalse;
+	TText c;
+
+	for( TInt i=0; i < aXml.Length(); ++i )
+		{
+		c = aXml[i];
+		switch(c)
+			{
+			case KElementStart:
+				// if currently reading element, error
+				if( readingElementName )
+					{
+					User::Leave(EInvalidXmlError);
+					}
+
+				if( aXml.Length()-i >= KCDataStart().Length() &&
+					!aXml.Mid(i, KCDataStart().Length()).Compare(KCDataStart()) )
+					{ // cdata
+					aXml.Set( aXml.Right( aXml.Length() - i ) );
+					TInt endPos = aXml.Find(KCDataEnd);
+
+					TPtrC8 cdata = _L8("");
+					if ( endPos == KErrNotFound )
+						{
+						User::Leave(EInvalidCDataStructure);
+						}
+
+					cdata.Set( aXml.Mid( KCDataStart().Length(), endPos - KCDataStart().Length() ) );
+					aXml.Set( aXml.Right( aXml.Length() - endPos - KCDataEnd().Length() ) );
+
+					i = -1;
+
+					// add current buffer to complete buffer
+					EntitiesToCharactersL( iBuffer, 0, iBuffer->Length() );
+					AddToCompleteL(*iBuffer);
+					ResetBufferL(iBuffer);
+					AddToCompleteL(cdata);
+					}
+#ifndef __NO_XML_COMMENTS_
+				else if( aXml.Length()-i >= KCommentStart().Length() &&
+					!aXml.Mid(i, KCommentStart().Length()).Compare(KCommentStart()) )
+					{ // comment
+					aXml.Set( aXml.Right( aXml.Length() - i ) );
+					TInt endPos = aXml.Find(KCommentEnd);
+
+					if ( endPos != KErrNotFound )
+						{
+						aXml.Set( aXml.Right( aXml.Length() - endPos - KCommentEnd().Length() ) );
+						}
+					else
+						{
+						User::Leave(EInvalidXmlError);
+						}
+
+					i = -1;
+					}
+#endif
+				else 
+					{
+					// send the buffer
+					EntitiesToCharactersL( iBuffer, 0, iBuffer->Length() );
+					AddToCompleteL(*iBuffer);
+					NextDataL(*iCompleteBuffer);
+					ResetBufferL(iBuffer);
+					ResetBufferL(iCompleteBuffer);
+					readingElementName = ETrue;
+					}
+
+				break;
+			case KElementEnd:
+				// stop reading element name
+				if( !readingElementName )
+					{
+					User::Leave(EInvalidXmlError);
+					}
+				else 
+					{
+					NextElementL(*iBuffer);
+					ResetBufferL(iBuffer);
+					readingElementName = EFalse;
+					}
+				break;
+			default:
+				// add char to buffer
+				AddToBufferL(c, iBuffer);
+				break;
+			}
+		}
+
+	EntitiesToCharactersL( iBuffer, 0, iBuffer->Length() );
+	AddToCompleteL(*iBuffer);
+	NextDataL(*iCompleteBuffer);
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Adds the given string to iCompleteBuffer
+// ------------------------------------------------------------------------------------------------
+void CNSmlXmlParser::AddToCompleteL( const TPtrC8 aStr )
+	{
+	if(!iCompleteBuffer)
+		{
+		iCompleteBuffer = HBufC8::NewL(aStr.Length());
+		}
+
+	TPtr8 ptr = iCompleteBuffer->Des();
+	if( ptr.MaxLength() < iCompleteBuffer->Length()+aStr.Length() )
+		{
+		iCompleteBuffer = iCompleteBuffer->ReAllocL(iCompleteBuffer->Length()+aStr.Length());
+		ptr.Set(iCompleteBuffer->Des());
+		}
+
+	ptr.Append(aStr);
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Deletes the given buffer and initializes it again to length 10
+// ------------------------------------------------------------------------------------------------
+void CNSmlXmlParser::ResetBufferL( HBufC8*& aBuf ) const
+	{
+	if( aBuf )
+		{
+		delete aBuf;
+		aBuf = NULL;
+		}
+
+	aBuf = HBufC8::NewL(10);
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// Adds the given char to given buffer
+// ------------------------------------------------------------------------------------------------
+void CNSmlXmlParser::AddToBufferL( const TText c, HBufC8*& aBuf ) const
+	{
+	TPtr8 ptr = aBuf->Des();
+	if( ptr.MaxLength() == aBuf->Length()+1 )
+		{
+		aBuf = aBuf->ReAllocL(aBuf->Length()+10);
+		ptr.Set(aBuf->Des());
+		}
+
+	TChar str = c;
+	ptr.Append(str);
+	}
+
+
+
+// ------------------------------------------------------------------------------------------------
+// Replaces all occurances of aTarget in aText with aItem. Returns an integer indicating 
+// the size change in aText. aStartPos and aEndPos indicate the start and end positions 
+// of aText to be parsed (if whole string should be parsed, use 0 and aText.Length()).
+// ------------------------------------------------------------------------------------------------
+TInt CNSmlXmlParser::ReplaceL( HBufC8*& aText, const TDesC8& aTarget, const TDesC8& aItem, TInt aStartPos, TInt aEndPos ) const
+	{
+	TInt change = 0;
+	TInt searchPos = aStartPos;
+	TPtrC8 text = aText->Mid(aStartPos, aEndPos-aStartPos);
+	TInt pos = text.Find(aTarget);
+
+	while ( pos != KErrNotFound )
+		{
+		pos += searchPos;
+
+		TInt currentChange = aItem.Length() - aTarget.Length();
+		change += currentChange;
+		aEndPos += currentChange;
+		searchPos = pos;
+
+		if ( currentChange > 0 )
+			{
+			searchPos += currentChange;
+
+			// check that aText is large enough
+			if ( aText->Des().MaxLength() < aText->Length()+currentChange )
+				{
+				aText = aText->ReAllocL(aText->Length()+currentChange);
+				}
+			}
+
+		// the actual replace
+		aText->Des().Replace(pos, aTarget.Length(), aItem);
+
+		text.Set( aText->Mid(searchPos, aEndPos-searchPos) );
+		pos = text.Find(aTarget);
+		}
+
+	return change;
+	}
+
+
+// ------------------------------------------------------------------------------------------------
+// 
+// ------------------------------------------------------------------------------------------------
+void CNSmlXmlParser::CheckDatetimeErrorL( const TInt error ) const
+	{
+	if ( error != KErrNone )
+		{
+		User::Leave( EInvalidDatetimeValue );
+		}
+	}
+
+//End of File
+
--- a/omads/omadsextensions/group/bld.inf	Tue Aug 31 15:05:37 2010 +0300
+++ b/omads/omadsextensions/group/bld.inf	Wed Sep 01 12:30:02 2010 +0100
@@ -17,9 +17,9 @@
 
 
 #include "../dsutils/cgiscriptutils/bld/bld.inf"
-
+#include "../dsutils/nsmlfolderutils/bld/bld.inf"
+#include "../dsutils/nsmldefaultagendahandler/bld/bld.inf"
 #include "../datamod/bld/bld.inf"
-
 #include "../adapters/bld/bld.inf"
 
 
--- a/omads/omadsextensions/omadsextensions.pro	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#
-#   Name        : omadsextensions.pro
-#   Part of     : contentcontrol  
-#   Description : This is the project specification file for the contentcontrol project.
-#   Version     : 1
-#
-#   Copyright © 2009 Nokia.  All rights reserved.
-#   This material, including documentation and any related computer
-#   programs, is protected by copyright controlled by Nokia.  All
-#   rights are reserved.  Copying, including reproducing, storing,
-#   adapting or translating, any or all of this material requires the
-#   prior written consent of Nokia.  This material also contains
-#   confidential information which may not be disclosed to others
-#   without the prior written consent of Nokia.
-#
-
-TEMPLATE = subdirs
-CONFIG += ordered
-SUBDIRS += dsutils
-
-# End of file	--Don't remove this.
\ No newline at end of file
--- a/omads/rom/omads.iby	Tue Aug 31 15:05:37 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:  iby file for Omads components
-*
-*/
-
-
-#ifndef __OMADS_IBY__
-#define __OMADS_IBY__
-
-REM stub sis file
-data=ZSYSTEM\install\omads_stub.sis     System\Install\omads_stub.sis
-
-REM SyncML  Data Synchronisation plug-in adapters
-
-#ifdef  __SYNCML_DS_CAL // SyncML data synchronization calendar plug-in
-ECOM_PLUGIN(nsmlagendadataprovider.dll,nsmlagendadataprovider.rsc)
-data=DATAZ_\RESOURCE_FILES_DIR\NSmlAgendaDataStore_1_1_2.rsc		RESOURCE_FILES_DIR\NSmlAgendaDataStore_1_1_2.rsc
-data=DATAZ_\RESOURCE_FILES_DIR\NSmlAgendaDataStore_1_2.rsc			RESOURCE_FILES_DIR\NSmlAgendaDataStore_1_2.rsc
-#endif // __SYNCML_DS_CAL
-
-#ifdef  __SYNCML_DS_NOTEPAD
-ECOM_PLUGIN(nsmlnotepaddataprovider.dll,nsmlnotepaddataprovider.rsc)
-data=DATAZ_\RESOURCE_FILES_DIR\nsmlnotepaddatastoreformat.rsc		RESOURCE_FILES_DIR\nsmlnotepaddatastoreformat.rsc
-#endif
-
-#ifdef __SYNCML_DS_CON //  SyncML data synchronization contacts plug-in
-ECOM_PLUGIN(nsmlcontactsdataprovider.dll,nsmlcontactsdataprovider.rsc)
-data=DATAZ_\RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_1_2.rsc	RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_1_2.rsc
-data=DATAZ_\RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_2.rsc		RESOURCE_FILES_DIR\NSmlContactsDataStoreFormat_1_2.rsc
-#endif // __SYNCML_DS_CON
-
-REM \ds\datamod
-file=ABI_DIR\BUILD_DIR\nsmldatamod.dll                  			SHARED_LIB_DIR\nsmldatamod.dll
-
-REM \ds\dsutils
-file=ABI_DIR\BUILD_DIR\nsmlCGIScriptParser.dll       				SHARED_LIB_DIR\nsmlCGIScriptParser.dll
-file=ABI_DIR\BUILD_DIR\nsmlcontactsdatastoreextension.dll       	SHARED_LIB_DIR\nsmlcontactsdatastoreextension.dll
-
-
-#endif //__OMADS_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd	Wed Sep 01 12:30:02 2010 +0100
@@ -0,0 +1,86 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>  
--- a/sysdef_1_5_1.dtd	Tue Aug 31 15:05:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
- <!ELEMENT SystemDefinition (systemModel?, build?)>
- <!ATTLIST SystemDefinition
-  name CDATA #REQUIRED
-  schema CDATA #REQUIRED>
- <!ELEMENT systemModel (layer+)>
- <!ELEMENT layer (logicalset* | module*)*>
- <!ATTLIST layer
-  name CDATA #REQUIRED
-  levels CDATA #IMPLIED
-  span CDATA #IMPLIED>
- <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalset name CDATA #REQUIRED>
- <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalsubset name CDATA #REQUIRED>
- <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
- <!ATTLIST module
-  name CDATA #REQUIRED
-  level CDATA #IMPLIED>
- <!ELEMENT component (unit* | package* | prebuilt*)*>
- <!ATTLIST component name CDATA #REQUIRED>
- <!ELEMENT unit EMPTY>
- <!ATTLIST unit
-  unitID ID #REQUIRED
-  name CDATA #REQUIRED
-  mrp CDATA #REQUIRED
-  filter CDATA #IMPLIED
-  bldFile CDATA #REQUIRED
-  priority CDATA #IMPLIED
-  contract CDATA #IMPLIED
-  proFile CDATA #IMPLIED
-  qmakeArgs CDATA #IMPLIED>
- <!ELEMENT package EMPTY>
- <!ATTLIST package
-  name CDATA #REQUIRED
-  mrp CDATA #REQUIRED
-  filter CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT prebuilt EMPTY>
- <!ATTLIST prebuilt
-  name CDATA #REQUIRED
-  version CDATA #REQUIRED
-  late (Y|N) #IMPLIED
-  filter CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
- <!ELEMENT unitList (unitRef+)>
- <!ATTLIST unitList
-  name ID #REQUIRED
-  description CDATA #REQUIRED>
- <!ELEMENT unitRef EMPTY>
- <!ATTLIST unitRef unit IDREF #REQUIRED>
- <!ELEMENT targetList EMPTY>
- <!ATTLIST targetList
-  name ID #REQUIRED
-  description CDATA #REQUIRED
-  target IDREFS #REQUIRED>
- <!ELEMENT target EMPTY>
- <!ATTLIST target
-  name ID #REQUIRED
-  abldTarget CDATA #REQUIRED
-  description CDATA #REQUIRED>
- <!ELEMENT option EMPTY>
- <!ATTLIST option
-  name ID #REQUIRED
-  abldOption CDATA #REQUIRED
-  description CDATA #REQUIRED
-  enable (Y | N | y | n) #REQUIRED>
- <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
- <!ATTLIST configuration
-  name ID #REQUIRED
-  description CDATA #REQUIRED
-  filter CDATA #REQUIRED>
- <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
- <!ELEMENT unitListRef EMPTY>
- <!ATTLIST unitListRef unitList IDREF #REQUIRED>
- <!ELEMENT layerRef EMPTY>
- <!ATTLIST layerRef layerName CDATA #REQUIRED>
- <!ELEMENT buildLayer EMPTY>
- <!ATTLIST buildLayer
-  command CDATA #REQUIRED
-  targetList IDREFS #IMPLIED
-  unitParallel (Y | N | y | n) #REQUIRED
-  targetParallel (Y | N | y | n) #IMPLIED>
- <!ELEMENT specialInstructions EMPTY>
- <!ATTLIST specialInstructions
-  name CDATA #REQUIRED
-  cwd CDATA #REQUIRED
-  command CDATA #REQUIRED>