Revision: 201011
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 16 Apr 2010 14:53:26 +0300
changeset 20 e1de7d03f843
parent 19 2691f6aa1921
child 22 1a3f0bca12c6
Revision: 201011 Kit: 201015
connectivitymodules/SeCon/catalogspcconnectivityplugin/group/catalogspcconnectivityplugin.mmp
connectivitymodules/SeCon/clients/pcconn/bld/sconpcconnclient.mmp
connectivitymodules/SeCon/cntparser/bld/cntparsersrv.mmp
connectivitymodules/SeCon/cntparser/src/cntparsercollector.cpp
connectivitymodules/SeCon/common/conmltask/src/sconconmltask.cpp
connectivitymodules/SeCon/group/bld.inf
connectivitymodules/SeCon/plugins/ftp/bld/sconftpplugin.mmp
connectivitymodules/SeCon/plugins/hapticsconnplugin/group/hapticsconnplugin.mmp
connectivitymodules/SeCon/plugins/pcconn/bld/sconpcconnplugin.mmp
connectivitymodules/SeCon/servers/pcconn/bld/sconpcconnserver.mmp
connectivitymodules/SeCon/servers/pcconn/src/sconpcconnserver.cpp
connectivitymodules/SeCon/services/csc/bld/sconcsc.mmp
connectivitymodules/SeCon/services/csc/src/sconsyncservice.cpp
connectivitymodules/SeCon/services/csc/src/sconversioninfo.cpp
connectivitymodules/SeCon/services/ftp/bld/sconftp.mmp
connectivitymodules/SeCon/services/ftp/src/sconfshandler.cpp
connectivitymodules/SeCon/services/ftp/src/sconinboxhandler.cpp
connectivitymodules/SeCon/services/pcd/bld/sconpcd.mmp
connectivitymodules/SeCon/services/pcd/inc/sconpcdconsts.h
connectivitymodules/SeCon/services/pcd/inc/sconvideoparser.h
connectivitymodules/SeCon/services/pcd/src/sconbrqueue.cpp
connectivitymodules/SeCon/services/pcd/src/sconinstaller.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/sconvideoparser.cpp
connectivitymodules/SeCon/wbxml/conmlhandler/bld/sconconmlhandler.mmp
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmlgenerator.h
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.h
connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.inl
connectivitymodules/SeCon/wbxml/conmlhandler/src/sconconmlgenerator.cpp
contentcontrol.pro
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_data_modification_api/ds_data_modification_api.metaxml
contentctrl_plat/ds_data_modification_api/group/bld.inf
contentctrl_plat/ds_data_modification_api/inc/NSmlDataModBase.h
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/bld.inf
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/dllmain.cpp
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/mt_cnsmldatamodbase.cpp
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/mt_cnsmldatamodbase.h
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/mt_cnsmldatamodbase.mmp
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/mt_cnsmldatamodbase_eabiu.def
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/mt_cnsmldatamodbase_winsu.def
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/DataModTestStoreFormat_1.rss
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/DataModTestStoreFormat_2.rss
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/OwnStoreFormat_1_2.rss
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/PartnerStoreFormat_1_2.rss
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/TestVCard_no_title.vcf
contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/TestVCard_title.vcf
contentctrl_plat/group/bld.inf
dsdcmoadapter/conf/dsdcmocontrol.confml
dsdcmoadapter/conf/dsdcmocontrol_20022FC0.crml
dsdcmoadapter/data/20022FBC.rss
dsdcmoadapter/group/bld.inf
dsdcmoadapter/group/nsmldsctrldcmoadapter.mmp
dsdcmoadapter/inc/nsmldsctrldcmoadapter.h
dsdcmoadapter/rom/dsdcmoadapter.iby
dsdcmoadapter/src/nsmldsctrldcmoadapter.cpp
dsdcmoadapter/src/nsmldsctrldcmodapterproxy.cpp
group/bld.inf
layers.sysdef.xml
omads/group/bld.inf
omads/omads.pro
omads/omadsextensions/adapters/agenda/bld/bld.inf
omads/omadsextensions/adapters/agenda/bld/def/bwinscwnsmlagendadataprovideru.def
omads/omadsextensions/adapters/agenda/bld/def/eabinsmlagendadataprovideru.def
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/nsmlagendadefines.hrh
omads/omadsextensions/adapters/agenda/loc/101F6DD7.loc
omads/omadsextensions/adapters/agenda/src/101F6DD7.rss
omads/omadsextensions/adapters/agenda/src/NSmlAgendaDataStore_1_1_2.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/contacts/bld/bld.inf
omads/omadsextensions/adapters/contacts/bld/def/eabicontactsdataprovideru.def
omads/omadsextensions/adapters/contacts/bld/nsmldscontactsdataprovider.mmp
omads/omadsextensions/adapters/contacts/inc/NSmlContactsDataProvider.h
omads/omadsextensions/adapters/contacts/inc/NSmlContactsDataStore.h
omads/omadsextensions/adapters/contacts/loc/101F6DD6.loc
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/inc/nsmldsimpluids.h
omads/omadsextensions/datamod/bld/bld.inf
omads/omadsextensions/datamod/bld/def/bwinscwdatamodu.def
omads/omadsextensions/datamod/bld/def/eabidatamodu.def
omads/omadsextensions/datamod/bld/nsmldatamod.mmp
omads/omadsextensions/datamod/src/NSmlProperty.cpp
omads/omadsextensions/datamod/src/NSmlVCalMod.cpp
omads/omadsextensions/datamod/src/NSmlVCardMod.cpp
omads/omadsextensions/datamod/src/nsmldatamodbase.cpp
omads/omadsextensions/dsutils/cgiscriptutils/bld/bld.inf
omads/omadsextensions/dsutils/cgiscriptutils/bld/def/bwinscwcgiscriptparseru.def
omads/omadsextensions/dsutils/cgiscriptutils/bld/def/eabicgiscriptparseru.def
omads/omadsextensions/dsutils/cgiscriptutils/bld/nsmlCGIScriptParser.mmp
omads/omadsextensions/dsutils/cgiscriptutils/inc/nsmlcgiscriptparser.h
omads/omadsextensions/dsutils/cgiscriptutils/src/NSmlCGIScript.cpp
omads/omadsextensions/dsutils/cgiscriptutils/src/NSmlCGIScriptParseData.cpp
omads/omadsextensions/dsutils/cgiscriptutils/src/NSmlCGIScriptParseStateInfo.cpp
omads/omadsextensions/dsutils/cgiscriptutils/src/nsmlcgiscriptparser.cpp
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/group/bld.inf
omads/omadsextensions/omadsextensions.pro
omads/rom/omads.iby
package_definition.xml
sysdef_1_4_0.dtd
sysdef_1_5_1.dtd
--- a/connectivitymodules/SeCon/catalogspcconnectivityplugin/group/catalogspcconnectivityplugin.mmp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/catalogspcconnectivityplugin/group/catalogspcconnectivityplugin.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -32,9 +32,8 @@
 
 USERINCLUDE             ../inc
 
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
+// Default system include paths.
+APP_LAYER_SYSTEMINCLUDE
 
 LIBRARY                 euser.lib
 LIBRARY                 apmime.lib
-
--- a/connectivitymodules/SeCon/clients/pcconn/bld/sconpcconnclient.mmp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/clients/pcconn/bld/sconpcconnclient.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -53,8 +53,8 @@
 // Server
 USERINCLUDE     ../../../servers/pcconn/inc
 
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
+// Default system include paths.
+APP_LAYER_SYSTEMINCLUDE
 
 LIBRARY         euser.lib
 LIBRARY         estor.lib   // RMemWriteStream
--- a/connectivitymodules/SeCon/cntparser/bld/cntparsersrv.mmp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/cntparser/bld/cntparsersrv.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -46,8 +46,8 @@
 USERINCLUDE     ../inc
 USERINCLUDE     ../../inc
 
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
+// Default system include paths.
+APP_LAYER_SYSTEMINCLUDE
 
 LIBRARY         euser.lib
 LIBRARY	        cntmodel.lib
--- a/connectivitymodules/SeCon/cntparser/src/cntparsercollector.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/cntparser/src/cntparsercollector.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -52,7 +52,7 @@
     {
     LOGGER_ENTERFN( "CntParserCollector::~CCntParserCollector()" );
 
-    if( iVersitTLS != NULL )
+    if( iVersitTLS )
         {
         iVersitTLS->VersitTlsDataClose(); //Close reference 
         }
--- a/connectivitymodules/SeCon/common/conmltask/src/sconconmltask.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/common/conmltask/src/sconconmltask.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -85,6 +85,7 @@
 CSConDataOwner* CSConDataOwner::CopyL()
     {
     CSConDataOwner* copy = new (ELeave) CSConDataOwner();
+    CleanupStack::PushL( copy );
     copy->iType = iType;
     copy->iUid = iUid;
     copy->iDriveList.Copy( iDriveList );
@@ -105,9 +106,9 @@
             delete copy->iJavaHash;
             copy->iJavaHash = NULL;
             }
-        copy->iJavaHash = iJavaHash->Alloc();
+        copy->iJavaHash = iJavaHash->AllocL();
         }
-                        
+    CleanupStack::Pop( copy );
     return copy;
     }
     
@@ -211,6 +212,7 @@
 CSConListInstApps* CSConListInstApps::CopyL()
     {
     CSConListInstApps* copy = new (ELeave) CSConListInstApps();
+    CleanupStack::PushL( copy );
     copy->iAllApps = iAllApps;
     copy->iDriveList = iDriveList;
             
@@ -219,9 +221,12 @@
         
     for( TInt i = 0; i < iApps.Count(); i++ )
         {
-        copy->iApps.Append( iApps[i]->CopyL() );
+        CSConInstApp* temp = iApps[i]->CopyL();
+        CleanupStack::PushL( temp );
+        copy->iApps.AppendL( temp );
+        CleanupStack::Pop( temp );
         }
-            
+    CleanupStack::Pop( copy );
     return copy;
     }
 
@@ -364,7 +369,10 @@
     CleanupStack::PushL( copy );
     for( TInt i = 0; i < iDataOwners.Count(); i++ )
         {
-        copy->iDataOwners.Append( iDataOwners[i]->CopyL() );
+        CSConDataOwner* temp = iDataOwners[i]->CopyL();
+        CleanupStack::PushL( temp );
+        copy->iDataOwners.AppendL( temp );
+        CleanupStack::Pop( temp );
         }
     CleanupStack::Pop( copy );
     
@@ -454,7 +462,10 @@
     CleanupStack::PushL( copy );
     for( TInt i = 0; i < iDataOwners.Count(); i++ )
         {
-        copy->iDataOwners.Append( iDataOwners[i]->CopyL() );
+        CSConDataOwner* temp = iDataOwners[i]->CopyL();
+        CleanupStack::PushL( temp );
+        copy->iDataOwners.AppendL( temp );
+        CleanupStack::Pop( temp );
         }
     CleanupStack::Pop( copy );
     copy->iComplete = iComplete;
@@ -508,12 +519,18 @@
     CleanupStack::PushL( copy );
     for( TInt i = 0; i < iFiles.Count(); i++ )
         {
-        copy->iFiles.Append( iFiles[i]->CopyL() );
+        CSConFile* temp = iFiles[i]->CopyL();
+        CleanupStack::PushL( temp );
+        copy->iFiles.AppendL( temp );
+        CleanupStack::Pop( temp );
         }
         
     for( TInt j = 0; j < iDataOwners.Count(); j++ )
         {
-        copy->iDataOwners.Append( iDataOwners[j]->CopyL() );
+        CSConDataOwner* temp = iDataOwners[j]->CopyL();
+        CleanupStack::PushL( temp );
+        copy->iDataOwners.AppendL( temp );
+        CleanupStack::Pop( temp );
         }
     CleanupStack::Pop( copy );
     
@@ -642,7 +659,10 @@
     CleanupStack::PushL( copy );
     for( TInt i = 0; i < iDataOwners.Count(); i++ )
         {
-        copy->iDataOwners.Append( iDataOwners[i]->CopyL() );
+        CSConDataOwner* temp = iDataOwners[i]->CopyL();
+        CleanupStack::PushL( temp );
+        copy->iDataOwners.AppendL( temp );
+        CleanupStack::Pop( temp );
         }           
     CleanupStack::Pop( copy );
     
@@ -1512,6 +1532,7 @@
 CSConTaskReply* CSConTaskReply::CopyAndFreeL()  
     {
     CSConTaskReply* copy = new (ELeave) CSConTaskReply();
+    CleanupStack::PushL( copy );
     copy->iTaskId = iTaskId;
     copy->iMethod = iMethod;
     
@@ -1619,7 +1640,7 @@
         delete iGetMetadataParams;
         iGetMetadataParams = NULL;
         }
-    
+    CleanupStack::Pop( copy );
     return copy;
     }
 
--- a/connectivitymodules/SeCon/group/bld.inf	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/group/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -18,8 +18,7 @@
 #include <platform_paths.hrh>
 
 #include "../catalogspcconnectivityplugin/group/bld.inf"
-// cntparser is dropped as it depends on APP-layer. TODO: Check howto get this working
-// #include "../cntparser/bld/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"
@@ -44,6 +43,5 @@
 ../rom/sconftpplugin.iby            CORE_MW_LAYER_IBY_EXPORT_PATH(sconftpplugin.iby)
 ../rom/sconftp.iby                  CORE_MW_LAYER_IBY_EXPORT_PATH(sconftp.iby)
 ../rom/sconcsc.iby                  CORE_MW_LAYER_IBY_EXPORT_PATH(sconcsc.iby)
-// cntparser is dropped as it depends on APP-layer. TODO: Check howto get this working
-// ../rom/cntparser.iby                CORE_MW_LAYER_IBY_EXPORT_PATH(cntparser.iby)
+../rom/cntparser.iby                CORE_MW_LAYER_IBY_EXPORT_PATH(cntparser.iby)
 
--- a/connectivitymodules/SeCon/plugins/ftp/bld/sconftpplugin.mmp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/plugins/ftp/bld/sconftpplugin.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -41,8 +41,8 @@
   TARGET        sconftpplugin.rsc
 END
 
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
+// Default system include paths.
+APP_LAYER_SYSTEMINCLUDE
 
 USERINCLUDE     ../inc 
 USERINCLUDE     ../../../inc 
--- a/connectivitymodules/SeCon/plugins/hapticsconnplugin/group/hapticsconnplugin.mmp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/plugins/hapticsconnplugin/group/hapticsconnplugin.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -42,7 +42,7 @@
   TARGET        hapticsconnplugin.rsc
 END 
 
-MW_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE /epoc32/include/stdapis
 
 USERINCLUDE     ../inc
--- a/connectivitymodules/SeCon/plugins/pcconn/bld/sconpcconnplugin.mmp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/plugins/pcconn/bld/sconpcconnplugin.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -16,7 +16,6 @@
 */
 
 
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
 #include <platform_paths.hrh>
 #include <data_caging_paths.hrh>
 
@@ -41,8 +40,8 @@
   TARGET        sconpcconnplugin.rsc
 END
 
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
+// Default system include paths.
+APP_LAYER_SYSTEMINCLUDE
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../../../inc 
--- a/connectivitymodules/SeCon/servers/pcconn/bld/sconpcconnserver.mmp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/servers/pcconn/bld/sconpcconnserver.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -51,8 +51,8 @@
 USERINCLUDE     ../../../services/csc/inc
 USERINCLUDE     ../../../wbxml/conmlhandler/inc
 
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
+// Default system include paths.
+APP_LAYER_SYSTEMINCLUDE
 
 LIBRARY         euser.lib
 LIBRARY         estor.lib       // RMemWriteStream, RMemReadStream
--- a/connectivitymodules/SeCon/servers/pcconn/src/sconpcconnserver.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/servers/pcconn/src/sconpcconnserver.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -1357,6 +1357,7 @@
                 p && p->data; p=p->next )
             {
             CSConDataOwner* dataOwner = new (ELeave) CSConDataOwner();
+            CleanupStack::PushL( dataOwner );
             if ( p->data->type )
                 {
                 dataOwner->iType = TSConDOType (DesToInt( 
@@ -1385,7 +1386,8 @@
                 TInt intValue = DesToInt( p->data->transferDataType->Data() );
                 dataOwner->iTransDataType = static_cast<TSConTransferDataType> (intValue);
                 }
-            task->iGetDataSizeParams->iDataOwners.Append( dataOwner );
+            task->iGetDataSizeParams->iDataOwners.AppendL( dataOwner );
+            CleanupStack::Pop( dataOwner );
             }
         }
     ret = iPCDHandler->PutTaskL( task );
@@ -1540,7 +1542,7 @@
         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( 
@@ -1571,7 +1573,8 @@
                         dataOwner->iPackageName, 
                         p->data->packageInfo->name->Data());
                 }
-            task->iPubFilesParams->iDataOwners.Append( dataOwner );
+            task->iPubFilesParams->iDataOwners.AppendL( dataOwner );
+            CleanupStack::Pop( dataOwner );
             }
         }
     ret = iPCDHandler->PutTaskL( task );
@@ -1667,6 +1670,7 @@
                 p && p->data; p=p->next )
             {
             CSConDataOwner* dataOwner = new (ELeave) CSConDataOwner();
+            CleanupStack::PushL( dataOwner );
             if ( p->data->type )    
                 {
                 dataOwner->iType = TSConDOType (DesToInt(
@@ -1686,7 +1690,8 @@
                     CleanupStack::PopAndDestroy(); //DesToHashLC()
                     }
                 }           
-            task->iGetDataOwnerParams->iDataOwners.Append( dataOwner );
+            task->iGetDataOwnerParams->iDataOwners.AppendL( dataOwner );
+            CleanupStack::Pop( dataOwner );
             }
         }
     ret = iPCDHandler->PutTaskL( task );
--- a/connectivitymodules/SeCon/services/csc/bld/sconcsc.mmp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/csc/bld/sconcsc.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -53,8 +53,8 @@
 USERINCLUDE     ../inc
 USERINCLUDE     ../../../inc
 
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
+// Default system include paths.
+APP_LAYER_SYSTEMINCLUDE
 
 DEBUGLIBRARY    flogger.lib
 LIBRARY         euser.lib
@@ -71,9 +71,7 @@
 LIBRARY         apparc.lib
 LIBRARY         sisregistryclient.lib
 LIBRARY         SyncMLClientAPI.lib
-// Currently Java is on APP layer, we can't have dependencies to APP layer
-// LIBRARY         javaregistryclient.lib
+LIBRARY         javaregistryclient.lib
 LIBRARY         sysversioninfo.lib
 LIBRARY         Etel3rdParty.lib
 LIBRARY         platformver.lib
-
--- a/connectivitymodules/SeCon/services/csc/src/sconsyncservice.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/csc/src/sconsyncservice.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -23,9 +23,8 @@
 #include <swi/sisregistryentry.h>   // for searching app name from installer
 #include <swi/sisregistrypackage.h>
 #include <swi/sisregistrysession.h>
-// Currently Java is on APP layer, we can't have dependencies to APP layer
-//#include <javaregistryincludes.h>
-//using namespace Java;
+#include <javaregistryincludes.h>
+using namespace Java;
 
 #include "sconsyncservice.h"
 #include "capability.h"
@@ -289,7 +288,6 @@
         {
         // not sis app, might be java app.
         LOGGER_WRITE("SIS package not found");
-        /*
         CJavaRegistry* javaRegistry = CJavaRegistry::NewLC( );
         TBool entryExist = javaRegistry->RegistryEntryExistsL( aPackageUid );
         if ( entryExist )
@@ -303,7 +301,6 @@
             }
         
         CleanupStack::PopAndDestroy( javaRegistry ); 
-        */
         }
     
     CleanupStack::PopAndDestroy( &sisRegistry );
--- a/connectivitymodules/SeCon/services/csc/src/sconversioninfo.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/csc/src/sconversioninfo.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* 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"
@@ -23,7 +23,8 @@
 #include <etel3rdparty.h> // read imsi
 #include <etel.h>
 #include <etelmm.h>
-#include <hal.h>
+#include <e32event.h>
+#include <e32svr.h>
 
 #include "caputils.h"
 #include "debug.h"
@@ -199,6 +200,13 @@
         iProductCode = info.AllocL();
         }
     
+    // screen size
+    TPckgBuf<TScreenInfoV01> siBuf;
+    UserSvr::ScreenInfo(siBuf);
+    TScreenInfoV01& si=siBuf();
+    iScreenSize = si.iScreenSize;
+    
+    
     // read DesktopSync key value
     CRepository* repository(NULL);
     TRAP( iDesktopSyncError, repository = CRepository::NewL( KCRUidDSDCMOConfig ));
@@ -214,9 +222,7 @@
         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;   
--- a/connectivitymodules/SeCon/services/ftp/bld/sconftp.mmp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/ftp/bld/sconftp.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -16,7 +16,6 @@
 */
 
 
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
 #include <platform_paths.hrh>
 #include <data_caging_paths.hrh>
 
@@ -46,11 +45,10 @@
 
 USERINCLUDE     ../../../inc
 USERINCLUDE     ../inc
-// cntparser is dropped as it depends on APP-layer. TODO: Check howto get this working
-// USERINCLUDE     ../../../cntParser/inc
+USERINCLUDE     ../../../cntParser/inc
 
-
-MW_LAYER_SYSTEMINCLUDE
+// Default system include paths.
+APP_LAYER_SYSTEMINCLUDE
 
 
 START RESOURCE  ../src/sconftp.rss
@@ -69,8 +67,7 @@
 LIBRARY         bafl.lib                // Basic Application Framework Library
 LIBRARY         commonengine.lib        // For resource reader
 LIBRARY         platformenv.lib         // For pathinfo
-// cntparser is dropped as it depends on APP-layer. TODO: Check howto get this working
-// LIBRARY         CntParserServer.lib     // for contacts
+LIBRARY         CntParserServer.lib     // for contacts
 LIBRARY         directorylocalizer.lib  // For localizing directories
 LIBRARY         sysutil.lib
 LIBRARY         centralrepository.lib
--- a/connectivitymodules/SeCon/services/ftp/src/sconfshandler.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/ftp/src/sconfshandler.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -28,18 +28,17 @@
 
 #include "sconfshandler.h"
 #include "sconconsts.h"
-// cntparser is dropped as it depends on APP-layer. TODO: Check howto get this working
-// #include "IrMCConsts.h"
-// #include "cntparserclient.h"
-// #include "CntParserInfoLog.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");
+_LIT(KInfoLogIrMCL2File,"IrMC\\info.log");
+_LIT(KInfoLogPathAndFileName,"c:\\IrMC\\info.log");
+_LIT(KPbPathAndFileName,"c:\\IrMC\\pb.vcf");
 
 // ============================= MEMBER FUNCTIONS ===============================
 
@@ -483,8 +482,6 @@
     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.*/
-    // cntparser is dropped as it depends on APP-layer. TODO: Check howto get this working
-    /*
     if( aFileName == KPhoneBookIrMCL2Request || 
     aFileName == KInfoLogIrMCL2Request )
         {
@@ -549,10 +546,10 @@
             }
         }       
     else
-        {*/
+        {
         pathBufPtr.Copy( aPathName );
         pathBufPtr.Append( aFileName );         
-        //}
+        }
     
     LOGGER_WRITE( "CSConFsHandler::GetFileObjectL() : aFileObject->InitFromFileL( pathBufPtr )" );
     TRAP( ret, aFileObject->InitFromFileL( pathBufPtr ) );
--- a/connectivitymodules/SeCon/services/ftp/src/sconinboxhandler.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/ftp/src/sconinboxhandler.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -18,13 +18,7 @@
 
 // INCLUDE FILES
 #include <obexutilsmessagehandler.h>
-
-// btmsgtypeuid.h is on APP layer, we can't use it.
-// define KUidMsgTypeBt locally here for now. this need's to be
-// changed back after moving component to APP-layer
-//#include <btmsgtypeuid.h>    // BT Message Uid
-const TInt32 KUidMsgTypeBtTInt32 = 0x10009ED5;
-const TUid KUidMsgTypeBt = {KUidMsgTypeBtTInt32};
+#include <btmsgtypeuid.h>    // BT Message Uid
 
 #include "sconinboxhandler.h"
 #include "debug.h"
--- a/connectivitymodules/SeCon/services/pcd/bld/sconpcd.mmp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/pcd/bld/sconpcd.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -68,7 +68,7 @@
 LIBRARY         swinstcli.lib
 LIBRARY         sbeclient.lib
 LIBRARY         sisregistryclient.lib
-// LIBRARY         javaregistryclient.lib // Java dependencies reoved as it was on APP layer
+LIBRARY         javaregistryclient.lib
 LIBRARY         platformenv.lib
 LIBRARY         efsrv.lib
 LIBRARY         sysutil.lib
--- a/connectivitymodules/SeCon/services/pcd/inc/sconpcdconsts.h	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/pcd/inc/sconpcdconsts.h	Fri Apr 16 14:53:26 2010 +0300
@@ -42,7 +42,6 @@
 // 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
@@ -58,9 +57,6 @@
 const TInt KSConCodeInstErrAccessDenied = 608;  // Target location of package is not accessible
 const TInt KSConCodeInstUpgradeError = 609;  // The package is an invalid upgrade
 
-// ConML Status code: 1001...1050 System wide error code
-const TInt KSConCodeFirstSymbianErr( 1000 );
-
 struct SDeviceInfo
 	{
 	TSConMethodName method;
--- a/connectivitymodules/SeCon/services/pcd/inc/sconvideoparser.h	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/pcd/inc/sconvideoparser.h	Fri Apr 16 14:53:26 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* 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"
@@ -141,12 +141,9 @@
 private: // data
     CVideoPlayerUtility* iVideoUtil;
     CTNEVideoClipInfo*   iVideoClip;
-    
+
     RWsSession          iWsSession;
     CWsScreenDevice*    iScreen;
-    RWindow*            iWindow;
-    RWindowGroup        iRootWindow;
-    
     TRequestStatus*     iCallerStatus;
     CActiveSchedulerWait iWait;
     CSconTimeOut*       iTimeOut;
--- a/connectivitymodules/SeCon/services/pcd/src/sconbrqueue.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/pcd/src/sconbrqueue.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -30,10 +30,12 @@
 //
 CSConBackupRestoreQueue* CSConBackupRestoreQueue::NewL( const TInt aMaxObjectSize, RFs& aFs )
 	{
+	TRACE_FUNC_ENTRY;
 	CSConBackupRestoreQueue* self = new (ELeave) CSConBackupRestoreQueue();
 	CleanupStack::PushL( self );
 	self->ConstructL( aMaxObjectSize, aFs );
 	CleanupStack::Pop( self );
+	TRACE_FUNC_EXIT;
     return self;
 	}
 	
@@ -54,9 +56,11 @@
 //
 void CSConBackupRestoreQueue::ConstructL( const TInt aMaxObjectSize, RFs& aFs )
 	{
+	TRACE_FUNC_ENTRY;
 	iBackupRestore = CSConBackupRestore::NewL( this, aMaxObjectSize, aFs );
 	CActiveScheduler::Add( iBackupRestore );
 	User::LeaveIfError( iTimer.CreateLocal() );
+	TRACE_FUNC_EXIT;
 	}
 	
 // -----------------------------------------------------------------------------
@@ -84,6 +88,7 @@
 //
 void CSConBackupRestoreQueue::StartQueue()	
 	{
+	TRACE_FUNC_ENTRY;
 	if( IsActive() )
 		{
 		Cancel();
@@ -91,6 +96,7 @@
 		
 	iTimer.After( iStatus, KSConTimerValue );
 	SetActive();
+	TRACE_FUNC_EXIT;
 	}
 	
 // -----------------------------------------------------------------------------
@@ -100,7 +106,9 @@
 //
 void CSConBackupRestoreQueue::StopQueue()	
 	{
+	TRACE_FUNC_ENTRY;
 	iTimer.Cancel();
+	TRACE_FUNC_EXIT;
 	}
 
 // -----------------------------------------------------------------------------
@@ -131,6 +139,7 @@
 		}
 
 	ret = iQueue.InsertInOrder( aNewTask, CSConTaskQueue::Compare );
+	LOGGER_WRITE_1( "CSConBackupRestoreQueue::AddNewTask() : returned %d", ret );
 	return ret;
 	}
 
@@ -180,6 +189,7 @@
 //
 void CSConBackupRestoreQueue::QueueAddress( CSConInstallerQueue*& aTaskQueue )
 	{
+	TRACE_FUNC;
 	iInstQueueAddress = aTaskQueue;
 	}
 
@@ -243,11 +253,14 @@
 //
 void CSConBackupRestoreQueue::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/sconinstaller.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/pcd/src/sconinstaller.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -24,9 +24,9 @@
 #include <swi/sisregistrysession.h>
 #include <SWInstDefs.h>
 #include <mmf/common/mmfcontrollerpluginresolver.h>
-// #include <javaregistry.h> // All dependencies to APP layer must be reoved
+#include <javaregistry.h>
 
-//using namespace Java;
+using namespace Java;
 
 #include "debug.h"
 #include "sconinstaller.h"
@@ -443,12 +443,9 @@
 // Uninstall java package
 // -----------------------------------------------------------------------------
 //
-void CSConAppInstaller::UninstallJavaL( const TUid& /*aUid*/, const TSConInstallMode /*aMode*/ )
+void CSConAppInstaller::UninstallJavaL( const TUid& aUid, const TSConInstallMode aMode )
 	{
 	TRACE_FUNC_ENTRY;
-	// Removed Java related functionality as it was on APP layer
-	User::Leave( KErrNotSupported );
-	/*
 	CJavaRegistry* javaRegistry = CJavaRegistry::NewLC( );
 	TBool entryExist = javaRegistry->RegistryEntryExistsL( aUid );
 	CleanupStack::PopAndDestroy( javaRegistry ); 
@@ -474,7 +471,6 @@
         LOGGER_WRITE( "CSConAppInstaller::UninstallJavaL java entry does not exist -> Leave" )
         User::Leave( KErrNotFound );
         }
-        */
     TRACE_FUNC_EXIT;
 	}
 
--- a/connectivitymodules/SeCon/services/pcd/src/sconpcd.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/pcd/src/sconpcd.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -421,16 +421,22 @@
         
     for ( TInt i = 0; i < installerReply->iTasks.Count(); i++ )
         {
-        mergeReply->iTasks.Append( installerReply->iTasks[i]->CopyAndFreeL() );
+        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 j = 0; j < brReply->iTasks.Count(); j++ )
+    for ( TInt i = 0; i < brReply->iTasks.Count(); i++ )
         {
-        mergeReply->iTasks.Append( brReply->iTasks[j]->CopyAndFreeL() );
+        CSConTaskReply* temp = brReply->iTasks[i]->CopyAndFreeL();
+        CleanupStack::PushL( temp );
+        mergeReply->iTasks.AppendL( temp );
+        CleanupStack::Pop( temp );
         }
     
     CleanupStack::PopAndDestroy( brReply );
--- a/connectivitymodules/SeCon/services/pcd/src/sconpcdutility.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/pcd/src/sconpcdutility.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -22,19 +22,19 @@
 #include <swi/sisregistrypackage.h>
 #include <stringresourcereader.h>
 #include <WidgetRegistryClient.h>
-// #include <javaregistryincludes.h> // All APP-layer dependencias must be removed
-// #include <appversion.h>
+#include <javaregistryincludes.h>
+#include <appversion.h>
 #include <mmf/common/mmfcontrollerpluginresolver.h>
 #include <sconftp.rsg>              // Resource to be read header 
 
-// using namespace Java;
+using namespace Java;
 
 #include "debug.h"
 #include "sconpcdutility.h"
 #include "sconconmltask.h"
 
 // localized "unknown vendor".
-//_LIT( KSConResourceName, "z:\\Resource\\sconftp.rsc" );
+_LIT( KSConResourceName, "z:\\Resource\\sconftp.rsc" );
 
 
 
@@ -211,11 +211,10 @@
 // Appends installed java packages to aApps array.
 //----------------------------------------------------------------------------
 //
-void SConPcdUtility::AppendInstalledJavaL( CSConListInstApps& /*aListInstApps*/ )
+void SConPcdUtility::AppendInstalledJavaL( CSConListInstApps& aListInstApps )
     {
     TRACE_FUNC_ENTRY;
     // Java related functionality was removed as it was on APP layer.
-    /*
     CJavaRegistry* javaRegistry = CJavaRegistry::NewLC( );
     RArray<TUid> packageUids;
     CleanupClosePushL( packageUids );
@@ -300,7 +299,6 @@
     
     CleanupStack::PopAndDestroy( &packageUids );
     CleanupStack::PopAndDestroy( javaRegistry );
-    */
     TRACE_FUNC_EXIT;
     }
 
--- a/connectivitymodules/SeCon/services/pcd/src/sconqueue.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/pcd/src/sconqueue.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -265,17 +265,7 @@
             
             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;
-                    }
-                
+                progress = KSConCodeConflict;
                 break;
             }
             
--- a/connectivitymodules/SeCon/services/pcd/src/sconsbeclient.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/pcd/src/sconsbeclient.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -521,6 +521,7 @@
         {
         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;
@@ -704,24 +705,27 @@
         if( includeToList ) 
             {
             LOGGER_WRITE_1( "Appending to list, uid: 0x%08x", dataOwner->iUid.iUid );
-            iCurrentTask->iListDataOwnersParams->iDataOwners.Append( dataOwner );
+            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.Append( packageDataOwner );
+            iCurrentTask->iListDataOwnersParams->iDataOwners.AppendL( packageDataOwner );
+            CleanupStack::PopAndDestroy( packageDataOwner );
             }
         
         if( !includeToList )
             {
             //Not included to list => delete memory allocation
-            delete dataOwner;
+            CleanupStack::PopAndDestroy( dataOwner );
             }
         }
         
--- a/connectivitymodules/SeCon/services/pcd/src/sconvideoparser.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/services/pcd/src/sconvideoparser.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* 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"
@@ -57,13 +57,6 @@
         iVideoUtil->Close();
         }
     delete iVideoUtil;
-    
-    if ( iWindow )
-        {
-        iWindow->Close();
-        }
-    delete iWindow;
-    iRootWindow.Close();
     delete iScreen;
     iWsSession.Close();
     
@@ -97,16 +90,26 @@
     User::LeaveIfError( iWsSession.Connect() );
     
     iScreen = new(ELeave) CWsScreenDevice( iWsSession );
-    User::LeaveIfError( iScreen->Construct() );
+    iScreen->Construct();
+    
+    RWindowGroup wg( iWsSession );
+    User::LeaveIfError( wg.Construct(reinterpret_cast<TUint32>(&wg), EFalse) );
+    CleanupClosePushL( wg );
     
-    iRootWindow = RWindowGroup(iWsSession);
-    User::LeaveIfError( iRootWindow.Construct(reinterpret_cast<TUint32>(&iWsSession), EFalse) );
+    CWindowGc* gc;
+    User::LeaveIfError( iScreen->CreateContext(gc) );
+    CleanupStack::PushL(gc);
     
-    iWindow = new(ELeave) RWindow( iWsSession );
-    User::LeaveIfError( iWindow->Construct(iRootWindow, reinterpret_cast<TUint32>(&iRootWindow) + 1) );
+    RWindow window( iWsSession );
+    User::LeaveIfError( window.Construct(wg, reinterpret_cast<TUint32>(&wg) + 1) );
+    CleanupClosePushL( window );
     
     TRect temp(0,0,320,240); // dummy parameter
-    iVideoUtil = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceNone, iWsSession, *iScreen, *iWindow, temp, temp);
+    iVideoUtil = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceNone, iWsSession, *(iScreen), window, temp, temp);
+    
+    CleanupStack::PopAndDestroy( &window );
+    CleanupStack::PopAndDestroy( gc );
+    CleanupStack::PopAndDestroy( &wg );
     
     iTimeOut = CSconTimeOut::NewL( *this );
     
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/bld/sconconmlhandler.mmp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/wbxml/conmlhandler/bld/sconconmlhandler.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -48,11 +48,9 @@
 USERINCLUDE     ../inc
 USERINCLUDE     ../../../inc
 
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE   /epoc32/include/libc 
-
-LANG            SC
+// Default system include paths.
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/libc
 
 LIBRARY         euser.lib
 LIBRARY         estor.lib
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmlgenerator.h	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconconmlgenerator.h	Fri Apr 16 14:53:26 2010 +0300
@@ -210,7 +210,7 @@
 private:
     void ConstructL();
     CSConConMLGenerator();
-    void AddElement( CXMLElement* aElement );
+    void AddElementL( CXMLElement* aElement );
 
 private:
     // Parser
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.h	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.h	Fri Apr 16 14:53:26 2010 +0300
@@ -49,7 +49,7 @@
         * @param none
         * @return none
         */
-	inline void Push( T* aItem );
+	inline void PushL( T* aItem );
 	
 	/**
         * Returns the number of items in the stack
@@ -82,4 +82,4 @@
 
 #include "sconxmlstack.inl"
 
-#endif // __SCONXMLSTACK_H__
\ No newline at end of file
+#endif // __SCONXMLSTACK_H__
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.inl	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.inl	Fri Apr 16 14:53:26 2010 +0300
@@ -43,7 +43,7 @@
 	CXMLStack<T>* self = new (ELeave) CXMLStack<T>();
 	CleanupStack::PushL(self);
 	self->iStack = new (ELeave) RPointerArray<T>();
-	CleanupStack::Pop(); // self
+	CleanupStack::Pop(self);
 	return self;
 	}
 
@@ -69,9 +69,9 @@
 
 // ------------------------------------------------------------------------------------------------
 template<class T>
-inline void CXMLStack<T>::Push( T* aItem )
+inline void CXMLStack<T>::PushL( T* aItem )
 	{
-	iStack->Append(aItem);
+	iStack->AppendL(aItem);
 	}
 
 // ------------------------------------------------------------------------------------------------
--- a/connectivitymodules/SeCon/wbxml/conmlhandler/src/sconconmlgenerator.cpp	Fri Mar 19 09:27:26 2010 +0200
+++ b/connectivitymodules/SeCon/wbxml/conmlhandler/src/sconconmlgenerator.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -132,14 +132,17 @@
     LOGGER_ENTERFN( "CSConConMLGenerator::StartElementL()" );
     if( iCmdStack->Top() != 0 )
         {
-        AddElement(iCmdStack->Top()->BeginElementL( 
+        AddElementL(iCmdStack->Top()->BeginElementL( 
             aTag, TXMLElementParams(iCallback, iCmdStack, iCleanupStack ) ) );
         }
     else
         {
         if( aTag == EConML )
             {
-            AddElement(new (ELeave) ConML_ConML_t());
+            ConML_ConML_t* element = new (ELeave) ConML_ConML_t();
+            CleanupStack::PushL( element );
+            AddElementL( element );
+            CleanupStack::Pop( element );
             }
         else
             {
@@ -153,15 +156,15 @@
 // -----------------------------------------------------------------------------
 // AddElement
 // -----------------------------------------------------------------------------
-void CSConConMLGenerator::AddElement( CXMLElement* aElement )
+void CSConConMLGenerator::AddElementL( CXMLElement* aElement )
     {
     LOGGER_ENTERFN( "CSConConMLGenerator::AddElement()" );
     if( aElement )
         {
-        iCmdStack->Push(aElement);
+        iCmdStack->PushL(aElement);
         if( aElement->NeedsCleanup() )
             {
-            iCleanupStack->Push(aElement);
+            iCleanupStack->PushL(aElement);
             }
         }
     LOGGER_LEAVEFN( "CSConConMLGenerator::AddElement()" );
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentcontrol.pro	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  This is the project specification file for the contentcontrol project.
+#
+
+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/ds_contactsdatastoreextension_api/ds_contactsdatastoreextension_api.metaxml	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,13 @@
+<?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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/group/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/inc/nsmlcontactsdatastoreextension.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,147 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/bwins/TestCntDataStoreExtnu.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/conf/TestCntDataStoreExtn.cfg	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,18 @@
+[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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/eabi/TestCntDataStoreExtnu.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/group/TestCntDataStoreExtn.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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.
+*
+*/
+
+
+#if defined(__S60_)
+        // To get the MW_LAYER_SYSTEMINCLUDE-definition
+        #include <platform_paths.hrh>
+#endif
+
+TARGET          TestCntDataStoreExtn.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x2002DC82
+
+CAPABILITY      ALL -TCB
+
+DEFFILE         TestCntDataStoreExtn.def
+
+SOURCEPATH      ../src
+SOURCE          TestCntDataStoreExtn.cpp
+SOURCE          TestCntDataStoreExtnBlocks.cpp
+
+
+USERINCLUDE     ../inc 
+
+#if defined(__S60_)
+    MW_LAYER_SYSTEMINCLUDE
+    APP_LAYER_SYSTEMINCLUDE
+#else
+    SYSTEMINCLUDE   /epoc32/include 
+#endif
+
+LIBRARY         euser.lib
+LIBRARY			efsrv.lib 
+LIBRARY         stiftestinterface.lib
+LIBRARY         charconv.lib 
+LIBRARY			bafl.lib 
+LIBRARY 		nsmlcontactsdatastoreextension.lib
+
+LANG            SC
+
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/group/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,61 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/inc/TestCntDataStoreExtn.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/init/TestFramework.ini	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,180 @@
+#
+# 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/sis/TestCntDataStoreExtn.pkg	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,41 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies 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"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/src/TestCntDataStoreExtn.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,116 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/src/TestCntDataStoreExtnBlocks.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,362 @@
+/*
+* 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_data_modification_api/ds_data_modification_api.metaxml	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="88ff7f54da50174b0b24c5e88b015e73" dataversion="1.0">
+  <name>DS Data Modification API</name>
+  <description>Exports Data Modification API to make possible to modify contact's data directly from operator specific contact adapters</description>
+  <type>c++</type>
+  <subsystem>omads</subsystem>
+  <libs>
+    <lib name="nsmldatamod.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/ds_data_modification_api/group/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+*                Ds Data Modification API
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/NSmlDataModBase.h APP_LAYER_PLATFORM_EXPORT_PATH(NSmlDataModBase.h)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/inc/NSmlDataModBase.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,244 @@
+/*
+* 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:  Stripper and merger base class for versit data and 
+*				 implementation for vCard and vCalendar stripping and merging.
+*
+*/
+
+
+#ifndef __NSMLDATABASE_H__
+#define __NSMLDATABASE_H__
+
+// INCLUDES
+#include <e32base.h>
+#include <vprop.h>
+#include <SmlDataFormat.h>
+
+
+// CLASS DECLARATION
+
+/**
+* Class that is inherited from CParserProperty to make it possible to handle parameters.
+*
+* @lib nsmldatamod.lib
+*/
+class CNSmlProperty : public CParserProperty
+	{
+	public:
+		/**
+	    * Creates new property based on given parameters.
+	    * @param aPropertyValue. 	Value of property.
+	    * @param aName. 			Name of property.
+	    * @param aArrayOfParams. 	Parameters of property.
+	    * @return 					New instance of this class.
+	    */
+		static CNSmlProperty* NewL( CParserPropertyValue& aPropertyValue, const TDesC8& aName, CArrayPtr<CParserParam>* aArrayOfParams );
+		
+		/**
+	    * Returns paramaters of property.
+	    * @return	Parameters of property.
+	    */
+		CArrayPtr<CParserParam>* Parameters() const;
+		
+		/**
+	    * Returns count of paramaters.
+	    * @return	Count of paramaters.
+	    */
+		TInt ParamCount() const;
+		
+		/**
+	    * Compares names of two properties
+	    * @param aFirst. 	First property to compare.
+	    * @param aSecond. 	Second property to compare.
+	    * @return 			Returns 0 if names are equal.
+	    */
+		static TInt Compare( const CNSmlProperty& aFirst, const CNSmlProperty& aSecond );
+		
+	protected:
+		/**
+	    * Basic constructor of class
+	    */
+		CNSmlProperty( CParserPropertyValue& aPropertyValue, CArrayPtr<CParserParam>* aArrayOfParams );
+	};
+
+/**
+* Base class for Calendar and Contacts Data Modifications.
+*
+* @lib nsmldatamod.lib
+*/
+class CNSmlDataModBase : public CBase
+	{
+	public:
+	    /**
+	    * C++ destructor.
+	    */
+		IMPORT_C virtual ~CNSmlDataModBase();
+		
+		/**
+	    * Sets own database format.
+	    * @param aOwnStoreFormat.	Own database format.
+	    */
+		IMPORT_C void SetOwnStoreFormat( CSmlDataStoreFormat& aOwnStoreFormat );
+
+		/**
+	    * Sets remote database format.
+	    * @param aRemoteStoreFormat.	Remote database format.
+	    */
+		IMPORT_C void SetPartnerStoreFormat( CSmlDataStoreFormat& aRemoteStoreFormat );
+
+		/**
+	    * Sets mime type that is used for sending and receiving.
+	    * This method can be called separately before every item.
+	    * @param aMimeType.		Mime type.
+	    * @param aMimeVersion.	Mime type version.
+	    * @return				KErrNone if partnerStoreFormat is passed and same mime type with same version
+	    *						can be found. Otherwise KErrNotFound is returned.
+	    */
+		IMPORT_C TInt SetUsedMimeType( const RStringF aMimeType, const RStringF aMimeVersion );
+		
+		/**
+	    * Strips data that is to be transmitted to the sync partner.
+	    * @param aItem	Item's data. On returns this data may have changed due to stripping.
+	    */
+		IMPORT_C void StripTxL( CBufBase& aItem );
+
+		/**
+	    * Merges received item with item in exported from the local database.
+	    * @param aNewItem 	Received item. On return aItem contains merged item.
+		* @param aOldItem 	Item exported from the local database with which aNewItem is merged.
+	    */
+		IMPORT_C void MergeRxL( CBufBase& aNewItem, CBufBase& aOldItem, TBool aFieldLevel = EFalse );
+
+		/**
+	    * Checks whether merging is needed or not.
+		* @return	ETrue if mergins is needed EFalse otherwise.
+	    */
+		IMPORT_C TBool NeedsMerge();
+
+	protected:
+		/**
+	    * Basic constructor of class.
+	    */
+		CNSmlDataModBase();
+		
+		/**
+	    * Creates correct type of parser for each Data Modifications.
+		* @return	Correct type of versit parser.
+	    */
+		virtual CVersitParser* ChildCreateParserLC() = 0;
+
+		/**
+	    * Strips data that is to be transmitted to the sync partner.
+	    * @param aItem	Item's data. On returns this data may have changed due to stripping.
+	    */
+		void StripL( TDes8& aItem );
+		
+		/**
+	    * Strips data that is to be transmitted to the sync partner from entity.
+	    * @param aEntity	Item's data. On returns this data may have changed due to stripping.
+	    * @param aModified	If item's data is modified then this is ETrue at return. Otherwise EFalse.
+	    */
+		void StripEntityL( CVersitParser* aEntity, TBool& aModified ) const;
+		
+		/**
+	    * Strips all data from entity that is supported by remote server.
+	    * @param aEntity			Item's data. On returns this data may have changed due to stripping.
+	    * @param aModified			If item's data is modified then this is ETrue at return. Otherwise EFalse.
+	    * @param aParamLevelCheck	This is used to decide if parameters are compared when properties are stripped or not.
+	    */
+		void StripAllOnPartnerListL( CVersitParser* aEntity, TBool& aModified, TBool aParamLevelCheck = ETrue ) const;
+		
+		/**
+	    * Strips all data from entity that is not supported by remote server.
+	    * @param aEntity			Item's data. On returns this data may have changed due to stripping.
+	    * @param aModified			If item's data is modified then this is ETrue at return. Otherwise EFalse.
+	    * @param aParamLevelCheck	This is used to decide if parameters are compared when properties are stripped or not.
+	    */
+		void StripAllNotOnPartnerListL( CVersitParser* aEntity, TBool& aModified, TBool aParamLevelCheck = ETrue ) const;
+		
+		/**
+	    * Merges data from old item to new item.
+	    * @param aNewItem		Data of receive item. On returns this data may have changed due to merging.
+	    * @param aOldData		Data of old item.
+	    * @param aFieldLevel	This is used to decide if operation is field level update or not. Are all supported
+	    *						properties updated or just received properties.
+	    */
+		void MergeL( TDes8& aNewItem, const TDesC8& aOldItem,TBool aFieldLevel );
+		
+		/**
+	    * Merges data from old entity to new entity.
+	    * @param aNewEntity		Data of receive entity. On returns this data may have changed due to merging.
+	    * @param aOldEntity		Data of old entity.
+	    * @param aModified		If aNewEntity is modified then this is ETrue at return. Otherwise EFalse.
+	    * @param aFieldLevel	This is used to decide if operation is field level update or not. Are all supported
+	    *						properties updated or just received properties.
+	    */
+		void MergeEntityL( CVersitParser* aNewEntity, CVersitParser* aOldEntity, TBool& aModified, TBool aFieldLevel ) const;
+
+	private:
+		CSmlDataStoreFormat* iOwnStoreFormat;
+		CSmlDataStoreFormat* iRemoteStoreFormat;
+		TInt iUsedOwnMimeType;
+		TInt iUsedRemoteMimeType;
+		RStringF iMimeType;
+		RStringF iMimeVersion;
+	};
+
+
+/**
+* Data Modifications for Calendar.
+*
+* @lib nsmldatamod.lib
+*/
+class CNSmlVCalMod : public CNSmlDataModBase
+	{
+	public:
+		/**
+	    * Constuctor
+	    */
+		IMPORT_C CNSmlVCalMod();
+		
+	protected:
+		/**
+	    * Creates correct type of parser for Calendar Data Modifications.
+		* @return	Correct type of versit parser.
+	    */
+		CVersitParser* ChildCreateParserLC();
+	};
+
+/**
+* Data Modifications for Contacts.
+*
+* @lib nsmldatamod.lib
+*/
+class CNSmlVCardMod : public CNSmlDataModBase
+	{
+	public:
+		/**
+	    * Constuctor
+	    */
+		IMPORT_C CNSmlVCardMod();
+		
+	protected:
+		/**
+	    * Creates correct type of parser for Contacts Data Modifications.
+		* @return	Correct type of versit parser.
+	    */
+		CVersitParser* ChildCreateParserLC();
+	};
+
+
+#endif // __NSMLDATABASE_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build info file for data mod unit tests.
+*
+*/
+
+// INCLUDE FILES
+
+PRJ_MMPFILES
+mt_cnsmldatamodbase.mmp
+
+PRJ_EXPORTS
+./testdata/TestVCard_title.vcf c:/Data/testdata/TestVCard_title.vcf
+./testdata/TestVCard_no_title.vcf c:/Data/testdata/TestVCard_no_title.vcf
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/dllmain.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  DllMain file for data mod unit tests.
+*
+*/
+
+// INCLUDE FILES
+#include <CEUnitTestSuite.h>
+#include "mt_cnsmldatamodbase.h"
+
+/**
+ * mt_cnsmldatamodbase.dll test suite factory function.
+ */
+
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC(_L("DataModBase Module Tests"));
+
+     // Note that NewLC leaves the object in the cleanupstack.
+     rootSuite->AddL( MT_CNSmlDataModBase::NewLC() );
+     CleanupStack::Pop( ); // MT_CNSmlDataModBase
+     
+     CleanupStack::Pop( rootSuite );
+     return rootSuite;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/mt_cnsmldatamodbase.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,441 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 data mod unit tests.
+*
+*/
+
+
+// INCLUDE FILES
+#include "MT_CNSmlDataModBase.h"
+
+#include <SmlDataFormat.h>
+#include <VCARD.H>
+#include <CNTVCARD.H>
+#include <BARSC.H>  
+#include <s32mem.h>
+#include <bautils.h>
+#include <S32FILE.H>
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <data_caging_path_literals.hrh>
+
+#include "NSmlDataModBase.h"
+
+// - Construction -----------------------------------------------------------
+
+MT_CNSmlDataModBase* MT_CNSmlDataModBase::NewL()
+    {
+    MT_CNSmlDataModBase* self = MT_CNSmlDataModBase::NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+
+MT_CNSmlDataModBase* MT_CNSmlDataModBase::NewLC()
+    {
+    MT_CNSmlDataModBase* self = new( ELeave ) MT_CNSmlDataModBase();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+MT_CNSmlDataModBase::~MT_CNSmlDataModBase()
+    {
+    delete iDataMod;
+    delete iOwnStoreFormat;
+    delete iPartnerStoreFormat;
+    iOwnStringPool.Close();
+    iPartnerStringPool.Close();
+    iFs.Close();
+    }
+
+MT_CNSmlDataModBase::MT_CNSmlDataModBase()
+    {
+    }
+
+void MT_CNSmlDataModBase::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    User::LeaveIfError( iFs.Connect() );
+    }
+
+
+// - Test methods -----------------------------------------------------------
+
+void MT_CNSmlDataModBase::SetupL(  )
+    {
+    iDataMod = new (ELeave) CNSmlVCardMod();
+    }
+
+void MT_CNSmlDataModBase::SetupAndConfigure1L()
+    {
+    iDataMod = new (ELeave) CNSmlVCardMod();
+    
+    // Same store format for the "client" and the "server"
+    // The client supports TITLE
+    // The server supports TITLE
+    _LIT( KOwnStoreFormat, "DataModTestStoreFormat_1.rsc" );  
+    _LIT( KPartnerStoreFormat, "DataModTestStoreFormat_1.rsc" ); 
+    ConfigureDataModL( KOwnStoreFormat, KPartnerStoreFormat ); 
+    }
+
+void MT_CNSmlDataModBase::SetupAndConfigure2L()
+    {
+    iDataMod = new (ELeave) CNSmlVCardMod();
+    
+    // Different store format for the "client" and the "server"
+    // The client supports TITLE
+    // The server does not support TITLE
+    _LIT( KOwnStoreFormat, "DataModTestStoreFormat_1.rsc" );  
+    _LIT( KPartnerStoreFormat, "DataModTestStoreFormat_2.rsc" ); 
+    ConfigureDataModL( KOwnStoreFormat, KPartnerStoreFormat ); 
+    }
+
+void MT_CNSmlDataModBase::Teardown(  )
+    {
+    delete iDataMod;
+    iDataMod = NULL;
+    
+    delete iOwnStoreFormat;
+    iOwnStoreFormat = NULL;
+    
+    delete iPartnerStoreFormat;
+    iPartnerStoreFormat = NULL;
+
+    iOwnStringPool.Close();
+    iPartnerStringPool.Close();
+    }
+    
+void MT_CNSmlDataModBase::EmptyL(  )
+    {
+    }
+
+void MT_CNSmlDataModBase::NeedsMerge1L()
+    {
+    // Store format not set on Setup phase. No merge supported.
+    EUNIT_ASSERT( !iDataMod->NeedsMerge() );
+    }
+
+void MT_CNSmlDataModBase::NeedsMerge2L()
+    {
+    // Store formats sets. Merging is needed.
+    EUNIT_ASSERT( iDataMod->NeedsMerge() );
+    }
+
+void MT_CNSmlDataModBase::StripTx1L()
+    {
+    _LIT( KTestVCardTitle, "c:\\Data\\TestData\\TestVCard_title.vcf" );
+    
+    // "Local" vCard includes TITLE field
+    CBufFlat* buffer1 = ReadBufFromFileLC( KTestVCardTitle );
+    EUNIT_ASSERT_NOT_EQUALS( buffer1->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+
+    // Partner store format not set on Setup phase. Leave should occus.
+    EUNIT_ASSERT_SPECIFIC_LEAVE( iDataMod->StripTxL( *buffer1 ), KErrNotFound );
+    CleanupStack::PopAndDestroy( buffer1 );
+    }
+
+void  MT_CNSmlDataModBase::StripTx2L()
+    {
+    _LIT( KTestVCardTitle, "c:\\Data\\TestData\\TestVCard_title.vcf" );
+    _LIT( KTestVCardNoTitle, "c:\\Data\\TestData\\TestVCard_no_title.vcf" );
+    
+    // "Local" vCard includes TITLE field
+    CBufFlat* buffer1 = ReadBufFromFileLC( KTestVCardTitle );
+    EUNIT_ASSERT_NOT_EQUALS( buffer1->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+
+    // TITLE field shall be not be dropped becuase the field is supported 
+    // by the partner store format
+    iDataMod->StripTxL( *buffer1 );
+    EUNIT_ASSERT_NOT_EQUALS( buffer1->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+    
+    CleanupStack::PopAndDestroy( buffer1 );
+    }
+
+
+void  MT_CNSmlDataModBase::StripTx3L()
+    {
+    _LIT( KTestVCardTitle, "c:\\Data\\TestData\\TestVCard_title.vcf" );
+    
+    // "Local" vCard includes TITLE field
+    CBufFlat* buffer1 = ReadBufFromFileLC( KTestVCardTitle );
+    EUNIT_ASSERT_NOT_EQUALS( buffer1->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+
+    // TITLE field shall be dropped because the field is not supported 
+    // by the partner store format
+    iDataMod->StripTxL( *buffer1 );
+    EUNIT_ASSERT_EQUALS( buffer1->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+
+    CleanupStack::PopAndDestroy( buffer1 );
+    }
+
+void MT_CNSmlDataModBase::BasicMerge1L()
+    {
+    _LIT( KTestVCardTitle, "c:\\Data\\TestData\\TestVCard_title.vcf" );
+    _LIT( KTestVCardNoTitle, "c:\\Data\\TestData\\TestVCard_no_title.vcf" );
+    
+    // "Local" vCard includes TITLE field
+    CBufFlat* buffer1 = ReadBufFromFileLC( KTestVCardTitle );
+    EUNIT_ASSERT_NOT_EQUALS( buffer1->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+    
+    // "Received" vCard does not include TITLE field
+    CBufFlat* buffer2 = ReadBufFromFileLC( KTestVCardNoTitle ); 
+    EUNIT_ASSERT_EQUALS( buffer2->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+    
+    // Merge vCards. Do not utilize field level merging.
+    iDataMod->MergeRxL( *buffer2, *buffer1, EFalse );
+
+    // Merged item _shall not_ include TITLE. It is dropped during the merge.
+    EUNIT_ASSERT_EQUALS( buffer2->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+
+    CleanupStack::PopAndDestroy( 2, buffer1 );      
+    }
+
+void MT_CNSmlDataModBase::FieldLevelMerge1L()
+    {
+    _LIT( KTestVCardTitle, "c:\\Data\\TestData\\TestVCard_title.vcf" );
+    _LIT( KTestVCardNoTitle, "c:\\Data\\TestData\\TestVCard_no_title.vcf" );
+    
+    // "Local" vCard includes TITLE field
+    CBufFlat* buffer1 = ReadBufFromFileLC( KTestVCardTitle );
+    EUNIT_ASSERT_NOT_EQUALS( buffer1->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+    
+    // "Received" vCard does not include TITLE field
+    CBufFlat* buffer2 = ReadBufFromFileLC( KTestVCardNoTitle );
+    EUNIT_ASSERT_EQUALS( buffer2->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+    
+    // Merge vCards. Utilize field level merging.
+    iDataMod->MergeRxL( *buffer2, *buffer1, ETrue );
+
+    // Merged item _shall_ include TITLE. It is was maintained due Field level flag.
+    EUNIT_ASSERT_NOT_EQUALS( buffer2->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+
+    CleanupStack::PopAndDestroy( 2, buffer1 );      
+    }
+
+void MT_CNSmlDataModBase::BasicMerge2L()
+    {
+    _LIT( KTestVCardTitle, "c:\\Data\\TestData\\TestVCard_title.vcf" );
+    _LIT( KTestVCardNoTitle, "c:\\Data\\TestData\\TestVCard_no_title.vcf" );
+    
+    // "Local" vCard includes TITLE field
+    CBufFlat* buffer1 = ReadBufFromFileLC( KTestVCardTitle );
+    EUNIT_ASSERT_NOT_EQUALS( buffer1->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+    
+    // "Received" vCard does not include TITLE field
+    CBufFlat* buffer2 = ReadBufFromFileLC( KTestVCardNoTitle ); 
+    EUNIT_ASSERT_EQUALS( buffer2->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+    
+    // Merge vCards. Do not utilize field level merging.
+    iDataMod->MergeRxL( *buffer2, *buffer1, EFalse );
+
+    // Merged item shall include TITLE. It is not dropped because
+    // partner store format does not support TITLE.
+    EUNIT_ASSERT_NOT_EQUALS( buffer2->Ptr(0).Find( _L8("TITLE") ), KErrNotFound );
+
+    CleanupStack::PopAndDestroy( 2, buffer1 );      
+    }
+
+//--------------------------- Helper functions ------------------------
+
+void MT_CNSmlDataModBase::ConfigureDataModL( const TDesC& aOwnFormat, const TDesC& aPartnerFormat )
+    {
+    HBufC8* ownFormat = ReadStoreFormatLC( aOwnFormat );
+
+    TResourceReader ownReader;
+    ownReader.SetBuffer( ownFormat );
+    iOwnStringPool.OpenL();
+    
+    CSmlDataStoreFormat* ownStoreFormat = 
+        CSmlDataStoreFormat::NewLC( iOwnStringPool, ownReader );
+    EUNIT_PRINT( _L("3.1.1"));
+    delete iOwnStoreFormat;
+    iOwnStoreFormat = ownStoreFormat;
+    CleanupStack::Pop( ownStoreFormat );
+    iDataMod->SetOwnStoreFormat( *iOwnStoreFormat );
+    
+    CleanupStack::PopAndDestroy( ownFormat );
+
+    HBufC8* partnerFormat = ReadStoreFormatLC( aPartnerFormat );
+    EUNIT_PRINT( *partnerFormat );
+
+    TResourceReader partnerReader;
+    partnerReader.SetBuffer( partnerFormat );    
+    
+    iPartnerStringPool.OpenL();
+    CSmlDataStoreFormat* partnerStoreFormat = 
+        CSmlDataStoreFormat::NewLC( iPartnerStringPool, partnerReader );
+    delete iPartnerStoreFormat;
+    iPartnerStoreFormat = partnerStoreFormat;
+    CleanupStack::Pop( partnerStoreFormat );
+    iDataMod->SetPartnerStoreFormat( *iPartnerStoreFormat );
+
+    CleanupStack::PopAndDestroy( partnerFormat );
+    
+    iDataMod->SetUsedMimeType( iOwnStoreFormat->MimeFormat( 0 ).MimeType(), iOwnStoreFormat->MimeFormat( 0 ).MimeVersion() );    
+    }
+
+HBufC8* MT_CNSmlDataModBase::ReadStoreFormatLC(const TDesC& aResourceFile)
+    {
+    TFileName fileName;
+    TParse parse;
+
+    parse.Set( aResourceFile, &KDC_RESOURCE_FILES_DIR, NULL  );
+    fileName = parse.FullName();
+
+    RResourceFile resourceFile; 
+    BaflUtils::NearestLanguageFile( iFs, fileName );
+
+    resourceFile.OpenL( iFs, fileName );
+    CleanupClosePushL( resourceFile );
+    
+    HBufC8* contactsDataFormat = resourceFile.AllocReadL( 1 );
+    CleanupStack::PopAndDestroy( &resourceFile );
+    CleanupStack::PushL( contactsDataFormat );
+    
+    return contactsDataFormat;
+    }
+
+CBufFlat* MT_CNSmlDataModBase::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 MT_CNSmlDataModBase::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 );
+    }
+
+// - EUnit test table -------------------------------------------------------
+
+EUNIT_BEGIN_TEST_TABLE(
+    MT_CNSmlDataModBase,
+    "NSmlDataModBase test suite.",
+    "MODULE" )
+
+EUNIT_TEST(
+    "Test creating and deleting the object",
+    "CNSmlDataModBase",
+    "",
+    "FUNCTIONALITY",
+    SetupL, EmptyL, Teardown)
+
+EUNIT_TEST(
+    "Test needs merge, when store formats not set",
+    "CNSmlDataModBase",
+    "NeedsMerge",
+    "FUNCTIONALITY",
+    SetupL, NeedsMerge1L, Teardown)
+
+EUNIT_TEST(
+    "Test needs merge",
+    "CNSmlDataModBase",
+    "NeedsMergeL",
+    "FUNCTIONALITY",
+    SetupAndConfigure1L, NeedsMerge2L, Teardown)    
+    
+EUNIT_TEST(
+    "Test Strip when store format not set",
+    "CNSmlDataModBase",
+    "StripTxL",
+    "FUNCTIONALITY",
+    SetupL, StripTx1L, Teardown)
+
+EUNIT_TEST(
+    "Test Strip field not supported by partner",
+    "CNSmlDataModBase",
+    "StripTxL",
+    "FUNCTIONALITY",
+    SetupAndConfigure1L, StripTx2L, Teardown)
+    
+EUNIT_TEST(
+    "Test Strip field not supported by partner",
+    "CNSmlDataModBase",
+    "StripTxL",
+    "FUNCTIONALITY",
+    SetupAndConfigure2L, StripTx3L, Teardown)
+    
+EUNIT_TEST(
+    "Test configure datamod",
+    "CNSmlDataModBase",
+    "",
+    "FUNCTIONALITY",
+    SetupAndConfigure1L, EmptyL, Teardown)
+    
+EUNIT_TEST(
+    "Test basic merging of vCards",
+    "CNSmlDataModBase",
+    "NeedsMerge",
+    "FUNCTIONALITY",
+    SetupAndConfigure1L, BasicMerge1L, Teardown)    
+
+EUNIT_TEST(
+    "Test field level merging of vCards",
+    "CNSmlDataModBase",
+    "MergeRxL",
+    "FUNCTIONALITY",
+    SetupAndConfigure1L, FieldLevelMerge1L, Teardown)      
+    
+EUNIT_TEST(
+    "Test basic merging of vCards",
+    "CNSmlDataModBase",
+    "NeedsMerge",
+    "FUNCTIONALITY",
+    SetupAndConfigure2L, BasicMerge2L, Teardown)    
+
+EUNIT_TEST(
+    "Test field level merging of vCards",
+    "CNSmlDataModBase",
+    "MergeRxL",
+    "FUNCTIONALITY",
+    SetupAndConfigure2L, FieldLevelMerge1L, Teardown)      
+
+
+    
+EUNIT_END_TEST_TABLE
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/mt_cnsmldatamodbase.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 data mod unit tests.
+*
+*/
+
+#ifndef __MT_CNSMLDATAMODBASE_H__
+#define __MT_CNSMLDATAMODBASE_H__
+
+// INCLUDE FILES
+#include <CEUnitTestSuiteClass.h>
+#include <stringpool.h>
+#include <f32file.h>
+
+// FORWARD DECLARATIONS
+class CNSmlDataModBase;
+class CSmlDataStoreFormat;
+class RFileReadStream;
+class CBufFlat;
+
+// CLASS DEFINITION
+/**
+ * Generated EUnit test suite class.
+ */
+NONSHARABLE_CLASS( MT_CNSmlDataModBase ): public CEUnitTestSuiteClass
+    {
+    public:  // Constructors and destructor
+
+        static MT_CNSmlDataModBase* NewL();
+        static MT_CNSmlDataModBase* NewLC();
+        ~MT_CNSmlDataModBase();
+
+    private: // Constructors
+
+        MT_CNSmlDataModBase();
+        void ConstructL();
+
+    private: // New methods
+
+         void SetupL();
+         void SetupAndConfigure1L();
+         void SetupAndConfigure2L();
+         void Teardown();
+        
+         void EmptyL();
+         void NeedsMerge1L();
+         void NeedsMerge2L();
+         void StripTx1L();
+         void StripTx2L();
+         void StripTx3L();
+         void BasicMerge1L();
+         void BasicMerge2L();
+         void FieldLevelMerge1L();
+         
+         // Helper functions
+         void ConfigureDataModL( const TDesC& aOwnFormat, const TDesC& aPartnerFormat );
+         HBufC8* ReadStoreFormatLC( const TDesC& aResourceFile );
+         CBufFlat* ReadBufFromFileLC( const TDesC& aFileName );
+         void OpenVCardFromFileLC( const TDesC& aFileName, RFileReadStream& aReadStream );
+         
+    private: // Data
+        CNSmlDataModBase* iDataMod;
+        RFs iFs;
+        RStringPool iOwnStringPool;
+        CSmlDataStoreFormat* iOwnStoreFormat;
+        RStringPool iPartnerStringPool;
+        CSmlDataStoreFormat* iPartnerStoreFormat;
+        
+        EUNIT_DECLARE_TEST_TABLE;
+    };
+
+#endif      //  __MT_CNSMLDATAMODBASE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/mt_cnsmldatamodbase.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 data mod unit tests.
+*
+*/
+
+#include <platform_paths.hrh>
+#include <defaultcaps.hrh>
+#include <data_caging_paths.hrh>
+
+// Build target
+TARGET          mt_cnsmldatamodbase.dll
+TARGETTYPE      dll 
+TARGETPATH      /sys/bin
+UID             0x1000af5a 0x01700000
+CAPABILITY      ALL -TCB
+VENDORID        0x00000000
+
+#if defined(WINS)
+DEFFILE ./mt_cnsmldatamodbase_wins.def
+#else
+DEFFILE ./mt_cnsmldatamodbase_eabi.def
+#endif
+
+// Source files
+SOURCEPATH      .
+SOURCE          dllmain.cpp        // Test code
+SOURCE          MT_CNSmlDataModBase.cpp
+
+// Include paths
+USERINCLUDE     . 
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/Digia/EUnit
+
+SOURCEPATH      ./testdata
+
+START RESOURCE DataModTestStoreFormat_1.rss
+	HEADER
+	TARGET DataModTestStoreFormat_1.rsc       
+	TARGETPATH RESOURCE_FILES_DIR 
+	LANG sc
+END 
+
+START RESOURCE DataModTestStoreFormat_2.rss
+	HEADER
+	TARGET DataModTestStoreFormat_2.rsc       
+	TARGETPATH RESOURCE_FILES_DIR 
+	LANG sc
+END
+
+// Dependencies to system components
+LIBRARY         euser.lib EUnit.lib efsrv.lib estor.lib 
+LIBRARY         nsmldatamod.lib
+LIBRARY         smlstoreformat.lib
+LIBRARY         bafl.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/mt_cnsmldatamodbase_eabiu.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z16CreateTestSuiteLv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/mt_cnsmldatamodbase_winsu.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/DataModTestStoreFormat_1.rss	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,402 @@
+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 DataMod tests
+*
+*/
+
+#include "SmlDataFormat.rh"
+#include "SmlDataFormat.hrh"
+
+RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
+	{
+	version=1;
+	display_name="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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/DataModTestStoreFormat_2.rss	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,402 @@
+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 DataMod tests
+*
+*/
+
+#include "SmlDataFormat.rh"
+#include "SmlDataFormat.hrh"
+
+RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
+	{
+	version=1;
+	display_name="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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/OwnStoreFormat_1_2.rss	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,546 @@
+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 DataMod tests
+*
+*/
+
+#include "SmlDataFormat.rh"
+#include "SmlDataFormat.hrh"
+
+RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
+    {
+    version=1;
+    display_name="ECA 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", "X-UNTYPED"};
+                            }
+                        };
+                    },
+                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", "X-UNTYPED"};
+                            }
+                        };
+                    },
+                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", "X-UNTYPED"};
+                            }
+                        };
+                    },
+                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="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"};
+                            }
+                        };
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="Nickname";
+                    name="NICKNAME";
+                    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="IMPP";
+                    name="IMPP";
+                    data_type="";
+                    enum_values={};
+                    flags= 0;
+                    max_size=256;
+                    max_occur=0;
+                    params={};
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-SNC";
+                    name="X-TMO-SNC";
+                    data_type="";
+                    enum_values={};
+                    flags= 0;
+                    max_size=256;
+                    max_occur=0;
+                    params={};
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-TAG";
+                    name="X-TMO-TAG";
+                    data_type="";
+                    enum_values={};
+                    flags= 0;
+                    max_size=256;
+                    max_occur=0;
+                    params={};
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-TAG-TS";
+                    name="X-TMO-TAG-TS";
+                    data_type="";
+                    enum_values={};
+                    flags= 0;
+                    max_size=256;
+                    max_occur=0;
+                    params={};
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-NUMBER";
+                    name="X-TMO-NUMBER";
+                    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={"GRP-ID", "MYF-ID"};
+                            }
+                        };
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-STATUS";
+                    name="X-TMO-STATUS";
+                    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={"GRP-ID", "MYF-ID"};
+                            }
+                        };
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-CHANGE";
+                    name="X-TMO-CHANGE";
+                    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={"GRP-ID", "MYF-ID"};
+                            }
+                        };
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-UIPOS";
+                    name="X-TMO-UIPOS";
+                    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={"GRP-ID", "MYF-ID"};
+                            }
+                        };
+                    }
+                };
+                field_level=1;
+                }
+            };
+        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/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/PartnerStoreFormat_1_2.rss	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,546 @@
+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 DataMod tests
+*
+*/
+
+#include "SmlDataFormat.rh"
+#include "SmlDataFormat.hrh"
+
+RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
+    {
+    version=1;
+    display_name="ECA 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", "X-UNTYPED"};
+                            }
+                        };
+                    },
+                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", "X-UNTYPED"};
+                            }
+                        };
+                    },
+                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", "X-UNTYPED"};
+                            }
+                        };
+                    },
+                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="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"};
+                            }
+                        };
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="Nickname";
+                    name="NICKNAME";
+                    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="IMPP";
+                    name="IMPP";
+                    data_type="";
+                    enum_values={};
+                    flags= 0;
+                    max_size=256;
+                    max_occur=0;
+                    params={};
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-SNC";
+                    name="X-TMO-SNC";
+                    data_type="";
+                    enum_values={};
+                    flags= 0;
+                    max_size=256;
+                    max_occur=0;
+                    params={};
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-TAG";
+                    name="X-TMO-TAG";
+                    data_type="";
+                    enum_values={};
+                    flags= 0;
+                    max_size=256;
+                    max_occur=0;
+                    params={};
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-TAG-TS";
+                    name="X-TMO-TAG-TS";
+                    data_type="";
+                    enum_values={};
+                    flags= 0;
+                    max_size=256;
+                    max_occur=0;
+                    params={};
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-NUMBER";
+                    name="X-TMO-NUMBER";
+                    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={"GRP-ID", "MYF-ID"};
+                            }
+                        };
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-STATUS";
+                    name="X-TMO-STATUS";
+                    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={"GRP-ID", "MYF-ID"};
+                            }
+                        };
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-CHANGE";
+                    name="X-TMO-CHANGE";
+                    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={"GRP-ID", "MYF-ID"};
+                            }
+                        };
+                    },
+                SML_DATA_PROPERTY
+                    {
+                    version=1;
+                    display_name="X-TMO-UIPOS";
+                    name="X-TMO-UIPOS";
+                    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={"GRP-ID", "MYF-ID"};
+                            }
+                        };
+                    }
+                };
+                field_level=1;
+                }
+            };
+        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/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/TestVCard_no_title.vcf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,9 @@
+BEGIN:VCARD
+VERSION:2.1
+N;tina;tester
+ORG:Firm
+TEL;CELL;VOICE:0400654987654
+ADR;WORK:;;Firmstreet 1;New City;Sawo;00000;Finland
+URL;WORK:http://www.firm.com
+EMAIL;PREF;INTERNET:Tina.Tester@firm.com
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/tsrc/mt_cnsmldatamodbase/testdata/TestVCard_title.vcf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,10 @@
+BEGIN:VCARD
+VERSION:2.1
+N;tina;tester
+ORG:Firm
+TITLE:Boss
+TEL;CELL;VOICE:0400654987654
+ADR;WORK:;;Firmstreet 1;New City;Sawo;00000;Finland
+URL;WORK:http://www.firm.com
+EMAIL;PREF;INTERNET:Tina.Tester@firm.com
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/group/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,21 @@
+/*
+* 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:  Includes all the Domain API specific bld.inf files, which 
+*                export files.
+*
+*/
+
+#include "../ds_data_modification_api/group/bld.inf"
+#include "../ds_contactsdatastoreextension_api/group/bld.inf"
+
Binary file dsdcmoadapter/conf/dsdcmocontrol.confml has changed
Binary file dsdcmoadapter/conf/dsdcmocontrol_20022FC0.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dsdcmoadapter/data/20022FBC.rss	Fri Apr 16 14:53:26 2010 +0300
@@ -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:  Resource file for Desktop Sync Control Interface Implementation.
+*
+*/
+
+#include "registryinfo.rh"
+
+// Declares info for two implementations
+RESOURCE REGISTRY_INFO theInfo
+	{
+	// UID for the DLL
+	dll_uid = 0x20022FBC;
+	// Declare array of interface info
+	interfaces = 
+		{
+		INTERFACE_INFO
+			{
+			// UID of interface that is implemented
+			interface_uid = 0x2001FD40;
+			implementations = 
+				{
+				// Info for DSDCMOAdapter
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x20022FBD;
+					version_no = 1;
+					display_name = "DSDCMOAdapter";
+					default_data = "text/wml||This is the type of data that this implementation understands. (Can be anything which will allow the resolver to identify this implementation as the correct one at run time. In this case it is a mime type).";
+					opaque_data = "DesktopSync";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dsdcmoadapter/group/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -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:  This file provides building information for Desktop Sync Ctrl.
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_EXPORTS
+
+// Generic configuration interface for component cenrep settings  
+../conf/dsdcmocontrol.confml APP_LAYER_CONFML(dsdcmocontrol.confml)
+../conf/dsdcmocontrol_20022FC0.crml APP_LAYER_CRML(dsdcmocontrol_20022FC0.crml)
+../rom/dsdcmoadapter.iby      CORE_APP_LAYER_IBY_EXPORT_PATH(dsdcmoadapter.iby)
+
+PRJ_MMPFILES
+nsmldsctrldcmoadapter.mmp
+
+// End Of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dsdcmoadapter/group/nsmldsctrldcmoadapter.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  DS plug-in adapter for DCMO
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET nsmldsctrldcmoadapter.dll
+TARGETTYPE PLUGIN
+
+// ECom Dll recognition UID followed by the unique UID for this dll
+UID 0x10009D8D 0x20022FBC
+VENDORID VID_DEFAULT
+CAPABILITY  CAP_ECOM_PLUGIN
+
+SOURCEPATH ../src
+SOURCE nsmldsctrldcmodapterproxy.cpp nsmldsctrldcmoadapter.cpp
+
+USERINCLUDE 		../inc 
+
+APP_LAYER_SYSTEMINCLUDE
+
+
+SYSTEMINCLUDE 	/epoc32/include/ecom
+
+SOURCEPATH			../data
+start resource 20022FBC.rss
+TARGET nsmldsctrldcmoadapter.rsc
+LANGUAGE_IDS
+end
+
+
+LIBRARY 				euser.lib ECom.lib efsrv.lib 
+LIBRARY         centralrepository.lib
+LIBRARY					commonengine.lib  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dsdcmoadapter/inc/nsmldsctrldcmoadapter.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  header file for DSCtrl plug-in adapter
+*
+*/
+
+#ifndef _NSMLDSCTRLDCMOADAPTER__
+#define _NSMLDSCTRLDCMOADAPTER__
+
+// Header needed for our CDCMO interface
+#include "dcmointerface.h"
+
+/** 
+ * An implementation of the CDCMOInterface definition
+ * Provides methods to read/write the properties of DCMO Plugin
+ * @lib nsmldsctrldcmoadapter.dll
+ */
+class CNsmlDsCtrlDCMOAdapter : public CDCMOInterface
+	{
+
+public:
+	/**
+	* Two phase construction
+	* Standardised safe construction which leaves nothing the cleanup stack.
+    */
+	static CNsmlDsCtrlDCMOAdapter* NewL(TAny* aInitParams);
+	
+	/**
+    * Destructor
+    */
+	~CNsmlDsCtrlDCMOAdapter();
+
+	// Implementation of CDCMOInterface
+	
+	/**
+    * Get DCMO Plug-in's attribute value which are integers
+    * 
+    * @param aId, it refer to the attributes of the capability
+    * @param aValue, it refer to the value of the attribute to be fetched
+    * @return status, It returns DCMO request success or failure
+    */
+	TDCMOStatus  GetDCMOPluginIntAttributeValueL(TDCMONode aId, TInt& aValue);
+	
+	/**
+    * Get DCMO Plug-in's attribute value which are strings
+    * 
+    * @param aId, it refer to the attributes of the capability
+    * @param aValue, it refer to the value of the attribute to be fetched
+    * @return status, It returns DCMO request success or failure
+    */
+	TDCMOStatus  GetDCMOPluginStrAttributeValueL(TDCMONode aId, TDes& aStrValue);
+	
+	/**
+    * Set DCMO Plug-in's attribute value which are integers
+    * 
+    * @param aId, it refer to the attributes of the capability
+    * @param aValue, it refer to the value of the attribute to be set
+    * @return status, It returns DCMO request success or failure
+    */
+	TDCMOStatus  SetDCMOPluginIntAttributeValueL(TDCMONode aId, TInt aValue);
+	
+	/**
+    * Set DCMO Plug-in's attribute value which are strings
+    * 
+    * @param aId, it refer to the attributes of the capability
+    * @param aValue, it refer to the value of the attribute to be set
+    * @return status, It returns DCMO request success or failure
+    */
+	TDCMOStatus  SetDCMOPluginStrAttributeValueL(TDCMONode aId, const TDes& aStrValue);
+	
+	/**
+    * Get localised name of the Plug-in
+    * 
+    * @param aLocName, member to store the name of Plugin
+    */
+	void GetLocalizedNameL (HBufC*& aLocName);    
+	
+private:
+	/**
+    * Construction
+    */
+    CNsmlDsCtrlDCMOAdapter(TAny* aInitParams);
+  
+    /**
+	* Second Phase constructor
+	*/
+	void ConstructL();
+
+private:
+	// Data to pass back from implementation to client
+	
+	/**
+	* Member to store the Property Attribute of the Plug-in
+	* It will be sent back to the client
+	*/
+	HBufC* iProperty;
+	
+	/**
+	* Member to store the Description Attribute of the Plug-in
+	* It will be sent back to the client
+	*/
+	HBufC* iDescription;
+	
+	/**
+	* Parameters taken from client
+	*/
+	TDCMOInterfaceInitParams* iInitParams;
+	};  
+
+#endif //_NSMLDSCTRLDCMOADAPTER__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dsdcmoadapter/rom/dsdcmoadapter.iby	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  iby file for DS DCMO adapter binaries
+*
+*/
+
+
+#ifndef __DSDCMOADAPTER_IBY__
+#define __DSDCMOADAPTER_IBY__
+
+#ifdef FF_RUNTIME_DEVICE_CAPABILITY_CONFIGURATION
+ECOM_PLUGIN(nsmldsctrldcmoadapter.dll, nsmldsctrldcmoadapter.rsc)
+#endif
+
+#endif //__DSDCMOADAPTER_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dsdcmoadapter/src/nsmldsctrldcmoadapter.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,228 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 of DSCtrl plug-in adapter for DCMO
+*
+*/
+
+//SYSTEM INCLUDES
+#include <centralrepository.h>
+#include <dcmo.rsg>
+#include <e32base.h>
+#include <stringresourcereader.h> 
+#include <f32file.h> 
+#include <data_caging_path_literals.hrh>
+
+//USER INCLUDES
+#include "nsmldsctrldcmoadapter.h"
+
+// CONSTANTS
+const TUid KCRUidDSDCMOConfig = { 0x20022FC0 };
+const TInt KNsmlDesktopSync = 0; // 0x0000000 defined in DS cenrep
+
+// Name of the Plug-in adapter
+_LIT(KNsmlDesktopSyncTitle, "Desktop Sync"); 
+// Description for Desktop Sync adapter
+_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 ===============================
+
+// -----------------------------------------------------------------------------
+// CNsmlDsCtrlDCMOAdapter::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+CNsmlDsCtrlDCMOAdapter* CNsmlDsCtrlDCMOAdapter::NewL(TAny* aParams)
+	{
+	CNsmlDsCtrlDCMOAdapter* self=new(ELeave) CNsmlDsCtrlDCMOAdapter(aParams);  
+	CleanupStack::PushL(self);
+	self->ConstructL(); 
+	CleanupStack::Pop();
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CNsmlDsCtrlDCMOAdapter::~CNsmlDsCtrlDCMOAdapter()
+// Destructor.
+// -----------------------------------------------------------------------------
+CNsmlDsCtrlDCMOAdapter::~CNsmlDsCtrlDCMOAdapter()
+	{	
+	delete iProperty;
+	delete iDescription;
+	}
+
+// -----------------------------------------------------------------------------
+// CNsmlDsCtrlDCMOAdapter::CNsmlDsCtrlDCMOAdapter
+// Constructor.
+// -----------------------------------------------------------------------------
+CNsmlDsCtrlDCMOAdapter::CNsmlDsCtrlDCMOAdapter(TAny* aInitParams)
+:  iInitParams((CDCMOInterface::TDCMOInterfaceInitParams*)aInitParams)
+	{
+	// See ConstructL() for initialisation completion.
+	}
+
+// -----------------------------------------------------------------------------
+// CNsmlDsCtrlDCMOAdapter::ConstructL()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+void CNsmlDsCtrlDCMOAdapter::ConstructL()
+    // Safely complete the initialization of the constructed object	
+	{	
+	// Set up the data to pass back
+	if(iInitParams->descriptor)
+	    {
+            iProperty = (iInitParams->descriptor)->AllocL();
+	    }
+	else
+	    {
+            iProperty = KNsmlDesktopSyncTitle().AllocL();
+	    }
+	iDescription = KNsmlDSDCMODescription().AllocL();
+	}
+
+
+// Implementation of CDCMOInterface
+// -----------------------------------------------------------------------------
+// CNsmlDsCtrlDCMOAdapter::GetDCMOPluginIntAttributeValueL
+// - Get the Value of any attribute which is an integer
+// - If its existing attribute, then success is returned. Else Failure.
+// -----------------------------------------------------------------------------
+//
+TDCMOStatus CNsmlDsCtrlDCMOAdapter::GetDCMOPluginIntAttributeValueL(TDCMONode aId, TInt& aValue)
+{
+	TDCMOStatus status(EDcmoSuccess);
+	TInt err(KErrNone);
+	
+	switch(aId)
+	{
+        case EGroup:              {
+            		                  aValue = ESoftware;
+            		              }
+            		              break;
+        case ENotifyUser:         {
+            		                  aValue = 0;
+            		              }
+								  break;
+        case EAttached:           { 
+								  status = EDcmoNotSupported;
+        		                  }
+								  break;
+        case EEnabled:	          {
+            						  CRepository * rep = CRepository::NewLC( KCRUidDSDCMOConfig );
+            						  err = rep->Get( KNsmlDesktopSync, aValue );
+            						  if(err != KErrNone)
+	   										 	{
+														status = EDcmoFail;
+	   										 	}
+            						  CleanupStack::PopAndDestroy( rep );
+            					  }
+            					  break;
+		case EDenyUserEnable:     {
+		                              aValue = 1; // DenyUserEnable
+		                          }
+						          break;
+        default:                  {
+                                      status = EDcmoNotFound;
+                                  }						          
+	}
+	
+	return status;
+}
+
+// -----------------------------------------------------------------------------
+// CNsmlDsCtrlDCMOAdapter::GetDCMOPluginStrAttributeValueL
+// - Get the Value of any attribute which is a string
+// - If its existing attribute, then success is returned. Else Failure.
+// -----------------------------------------------------------------------------
+//
+TDCMOStatus CNsmlDsCtrlDCMOAdapter::GetDCMOPluginStrAttributeValueL(TDCMONode aId, TDes& aStrValue) 
+{
+	TDCMOStatus status(EDcmoSuccess);
+	switch(aId)
+	{
+		case EProperty: 	{
+		                        aStrValue = *iProperty;
+		                    }
+							break;
+		
+		case EDescription:	{
+                    		    aStrValue = *iDescription;
+                    		}
+						    break;
+		default:			{
+                    		    status = EDcmoNotFound;
+                    		}
+	}
+	return status;
+}
+
+// -----------------------------------------------------------------------------
+// CNsmlDsCtrlDCMOAdapter::SetDCMOPluginIntAttributeValueL
+// - Set the Value of any attribute which is an integer
+// - If its existing attribute, then success is returned. Else Failure.
+// -----------------------------------------------------------------------------
+//
+TDCMOStatus CNsmlDsCtrlDCMOAdapter::SetDCMOPluginIntAttributeValueL(TDCMONode aId, TInt aValue)
+{
+	TDCMOStatus status(EDcmoFail);
+	TInt err(KErrNone);
+	switch(aId)
+	{
+		case EDenyUserEnable:
+		case ENotifyUser:
+							 break;
+        case EEnable:	     {
+                                 CRepository * rep = CRepository::NewLC( KCRUidDSDCMOConfig );
+                                 rep->Set( KNsmlDesktopSync, aValue );
+                                 CleanupStack::PopAndDestroy( rep );
+                             }
+                             break;
+	}
+	if(err == KErrNone)
+	    {
+		    status = EDcmoSuccess;
+	    }
+	return status;
+}
+
+// -----------------------------------------------------------------------------
+// CNsmlDsCtrlDCMOAdapter::SetDCMOPluginStrAttributeValueL
+// - Set the Value of any attribute which is a string
+// - Here no Attribute comes as we dont have any String value to be set
+// -----------------------------------------------------------------------------
+//
+TDCMOStatus CNsmlDsCtrlDCMOAdapter::SetDCMOPluginStrAttributeValueL(TDCMONode /*aId */, const TDes& /*aStrValue */)
+{
+	// Nothing to do
+	return EDcmoNotSupported;	
+}
+
+// -----------------------------------------------------------------------------
+// CNsmlDsCtrlDCMOAdapter::GetLocalizedNameL
+// - Get localised name of the Plug-in
+// -----------------------------------------------------------------------------
+//
+void CNsmlDsCtrlDCMOAdapter::GetLocalizedNameL (HBufC*& aLocName)
+{
+	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);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dsdcmoadapter/src/nsmldsctrldcmodapterproxy.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of DSCtrl plug-in adapter proxy for DCMO
+*
+*/
+
+// USER INCLUDES
+#include <e32std.h>
+#include <implementationproxy.h>
+
+#include "nsmldsctrldcmoadapter.h"
+
+// This is the implementation proxy table for the plugin-adapter
+// which is the entry point to the adapter
+
+// Map the interface UIDs to implementation factory functions
+const TImplementationProxy ImplementationTable[] = 
+	{
+		IMPLEMENTATION_PROXY_ENTRY(0x20022FBD,	CNsmlDsCtrlDCMOAdapter::NewL),
+	};
+
+// Exported proxy for instantiation method resolution
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+
+	return ImplementationTable;
+	}
+
--- a/group/bld.inf	Fri Mar 19 09:27:26 2010 +0200
+++ b/group/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -23,13 +23,15 @@
 //Componets:
 
 //omads
-//#include "../omads/group/bld.inf"
+#include "../omads/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"
-
-//ds dcmo adapter
-//#include "../dsdcmoadapter/group/bld.inf"
-
-//connectivity modules
-#include "../connectivitymodules/group/bld.inf"
\ No newline at end of file
+#include "../contentctrl_plat/group/bld.inf"
--- a/layers.sysdef.xml	Fri Mar 19 09:27:26 2010 +0200
+++ b/layers.sysdef.xml	Fri Apr 16 14:53:26 2010 +0300
@@ -1,14 +1,17 @@
 <?xml version="1.0"?>
-<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_5_1.dtd" [
   <!ENTITY layer_real_source_path "sf/app/contentcontrol" >
 ]>
 
-<SystemDefinition name="contentcontrol" schema="1.4.0">
+<SystemDefinition name="contentcontrol" schema="1.5.1">
   <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>
\ No newline at end of file
+</SystemDefinition>
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/group/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,23 @@
+/*
+* 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:  
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_EXPORTS
+../rom/omads.iby      CORE_APP_LAYER_IBY_EXPORT_PATH(omads.iby)
+
+#include "../omadsextensions/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omads.pro	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  This is the project specification file for the contentcontrol project.
+#
+
+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/omadsextensions/adapters/agenda/bld/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,23 @@
+/*
+* 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:  build info file for DS data provider
+*
+*/
+
+
+#include <platform_paths.hrh>
+PRJ_EXPORTS
+../loc/101F6DD7.loc		APP_LAYER_LOC_EXPORT_PATH(101F6DD7.loc)
+PRJ_MMPFILES
+./nsmlagendadataprovider.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/bld/def/bwinscwnsmlagendadataprovideru.def	Fri Apr 16 14:53:26 2010 +0300
@@ -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/omadsextensions/adapters/agenda/bld/def/eabinsmlagendadataprovideru.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,9 @@
+EXPORTS
+	_Z24ImplementationGroupProxyRi @ 1 NONAME
+	_ZTI20CNSmlAgendaDataStore @ 2 NONAME ; #<TI>#
+	_ZTI23CNSmlAgendaDataProvider @ 3 NONAME ; #<TI>#
+	_ZTI23CNSmlAgendaProgressview @ 4 NONAME ; #<TI>#
+	_ZTV20CNSmlAgendaDataStore @ 5 NONAME ; #<VT>#
+	_ZTV23CNSmlAgendaDataProvider @ 6 NONAME ; #<VT>#
+	_ZTV23CNSmlAgendaProgressview @ 7 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/bld/nsmlagendadataprovider.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* 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 DS agenda adapter
+*
+*/
+
+
+#include <platform_paths.hrh>
+#include <defaultcaps.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET		nsmlagendadataprovider.dll
+TARGETTYPE	PLUGIN
+UID			0x10009d8d 0x101F6DDE
+CAPABILITY	CAP_ECOM_PLUGIN
+VENDORID	VID_DEFAULT
+
+#if defined(ARMCC)
+DEFFILE		./def/eabinsmlagendadataprovider
+#elif defined(WINSCW)
+DEFFILE		./def/bwinscwnsmlagendadataprovider
+#endif
+
+SOURCEPATH		../src
+SOURCE			nsmlagendadataprovider.cpp
+SOURCE			nsmlagendadatastore.cpp
+SOURCE			nsmlagendaprogressview.cpp
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE	/epoc32/include/syncml 
+SYSTEMINCLUDE	/epoc32/include/ecom
+SYSTEMINCLUDE	../../inc
+
+USERINCLUDE		../inc
+USERINCLUDE		../../../datamod/inc
+
+START RESOURCE 101F6DD7.rss
+HEADER
+TARGET		nsmlagendadataprovider.rsc
+LANGUAGE_IDS
+END
+
+START RESOURCE NSmlAgendaDataStore_1_1_2.rss
+HEADER
+TARGETPATH	RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END 
+
+START RESOURCE NSmlAgendaDataStore_1_2.rss
+HEADER
+TARGETPATH	RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END 
+
+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 	versit.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/inc/nsmlagendadataprovider.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,157 @@
+/*
+* 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 agenda data provider
+*
+*/
+
+
+#ifndef __NSMLAGENDADATAPROVIDER_H__
+#define __NSMLAGENDADATAPROVIDER_H__
+
+//  INCLUDES
+#include "nsmlagendadatastore.h"
+#include <SmlDataFormat.h>
+
+// CONSTANTS
+_LIT( KNSmlDSAgendaDataStoreRsc_1_1_2,"z:NSMLAGENDADATASTORE_1_1_2.RSC" );
+_LIT( KNSmlDSAgendaDataStoreRsc_1_2,"z:NSMLAGENDADATASTORE_1_2.RSC" );
+
+// CLASS DECLARATION
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider provides basic interface for syncronization
+// partner to be able to access CNSmlAgendaDataStore instance.
+//
+// @lib nsmlagendadataprovider.dll
+// ------------------------------------------------------------------------------------------------
+class CNSmlAgendaDataProvider : public CSmlDataProvider
+	{
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+	    static CNSmlAgendaDataProvider* NewL();
+
+        /**
+        * Destructor.
+        */
+	    virtual ~CNSmlAgendaDataProvider();
+
+    private:
+
+        /**
+        * Not supported.
+        */
+	    void DoOnFrameworkEvent( TSmlFrameworkEvent, TInt aParam1, TInt aParam2 );
+
+        /**
+        * Returns ETrue if operation of id aOpId is supported otherwice returns EFalse.
+        */
+	    TBool DoSupportsOperation( TUid aOpId ) const;
+
+        /**
+        * Gives a reference to DataStoreFormat attribute structure.
+        */
+	    const CSmlDataStoreFormat& DoStoreFormatL();
+
+        /**
+        * Gives a reference to available datastore names structure.
+        */
+	    CDesCArray* DoListStoresLC();
+
+        /**
+        * Gives a reference to a default datastore name.
+        */
+	    const TDesC& DoDefaultStoreL();
+
+        /**
+        * Greates new CNSmlAgendaDataStore 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 the 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 the used store
+		*/
+		void DoGenerateFieldFilterQueryL(const RPointerArray<CSyncMLFilter>& aFilters, TDes& aFilterMimeType, RPointerArray<CSmlDataProperty>& aProperties, TDesC& aStoreName);
+	    
+        /**
+        * C++ default constructor.
+        */
+	    CNSmlAgendaDataProvider();
+ 
+        /**
+        * 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;
+	};
+
+#endif // __NSMLAGENDADATAPROVIDER_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/inc/nsmlagendadatastore.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,577 @@
+/*
+* 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 agenda data store
+*
+*/
+
+
+#ifndef __NSMLAGENDADATASTORE_H__
+#define __NSMLAGENDADATASTORE_H__
+
+
+//  INCLUDES
+#include "nsmlconstants.h"
+#include "nsmlchangefinder.h"
+#include "NSmlDataModBase.h"
+#include "nsmlagendadefines.hrh"
+#include <calentry.h>
+#include <calsession.h> 
+#include <caldataexchange.h> 
+#include <calentryview.h>
+#include <f32file.h>
+#include <SmlDataProvider.h>
+#include <SmlDataFormat.h>
+#include <calprogresscallback.h>
+#include <msvapi.h>
+#include <CalenImporter.h>
+#include <CalenExporter.h>
+#include <CalenInterimUtils2.h>
+#include <versittls.h>
+
+// CONSTANTS
+const TInt KNSmlAgendaCompressLimit        = 20;
+const TInt KNSmlAgendaLittleArraySize      = 4;
+const TInt KNSmlAgendaSmallArraySize       = 8;
+const TInt KNSmlAgendaLargeArraySize       = 128;
+const TInt KNSmlAgendaOwnMaxObjectSize     = 1048576;
+const TInt KNSmlCompactAfterChanges        = 30;
+const TInt KNSmlDefaultStoreNameMaxSize    = 256;
+const TInt KNSmlItemDataExpandSize         = 1024;
+_LIT( KNSmlDriveC, "C" );
+_LIT( KNSmlAgendaStoreNameForDefaultDB, "Calendar" );
+_LIT8( KNSmlMRUtilitiesEComPlugInUID,   "AgnEntryUi" );
+_LIT8( KNSmlVersitTokenRecurrenceID, 	"RECURRENCE-ID");
+_LIT8( KNSmlVersitTokenXRecurrenceID, 	"X-RECURRENCE-ID");
+_LIT8(KNSmlVersitTokenGeoID,"GEO");
+
+
+// DATA TYPES
+enum TNSmlDataStoreStatus
+	{
+	ENSmlClosed = 0,
+	ENSmlOpenAndWaiting,
+	ENSmlItemOpen,
+	ENSmlItemCreating,
+	ENSmlItemUpdating
+	};
+	
+enum TNSmlDataEntryType
+	{
+	ENSmlVCal = 1,
+	ENSmlICal,
+	ENSmlNotSet
+	};
+
+// CLASS DECLARATIONS
+// ----------------------------------------------------------------------------
+// CNSmlAgendaProgressview provides progress observations for some calendar
+// classes.
+// @lib nsmlagendadataprovider.dll
+// ----------------------------------------------------------------------------
+class CNSmlAgendaProgressview : public CBase , public MCalProgressCallBack
+    {
+    public:
+        /**
+        * Two-phased constructor.
+        */
+    	static CNSmlAgendaProgressview* NewL();
+
+        /**
+        * Destructor.
+        */
+    	~CNSmlAgendaProgressview();
+
+    	/**
+        * This calls the observing class with the percentage complete
+        * of the current operation.
+        * @param  aPercentageCompleted    The percentage complete
+        */
+    	void Progress( TInt aPercentageCompleted );
+    	
+    	/**
+        * This calls the observing class when the current operation is
+        * finished.
+        * @param    aError  The error if the operation failed,
+        *                   or KErrNone if successful.
+        */
+    	void Completed( TInt aError );
+
+    	/**
+        * This method returns status of Completed method (see above).
+        * @return   Value based on status of Completed method.
+        *           KErrNotReady is returned if Completed method is not
+        *           called or same value is Completed status.
+        */
+    	TInt GetCompletedStatus();
+    	
+    	/**
+        * Asks the observing class whether progress callbacks are required.
+        * @return   If the observing class returns EFalse, then the Progress()
+        *           function will not be called.
+        */
+    	TBool NotifyProgress();
+
+    private:
+        /**
+        * C++ default constructor.
+        */
+    	CNSmlAgendaProgressview();
+
+        /**
+        * Second phase constructor.
+        */
+    	void ConstructL();
+        
+    private:
+    	TInt    iCompletedStatus;
+	};
+
+// ----------------------------------------------------------------------------
+// CNSmlAgendaDataStore provides services to cope with calendar database access
+// for calendar events manipulation.
+// @lib nsmlagendadataprovider.dll
+// ----------------------------------------------------------------------------
+class CNSmlAgendaDataStore : public CSmlDataStore
+	{
+    public:
+        
+        /**
+        * Two-phased constructor.
+        */
+	    static CNSmlAgendaDataStore* NewL();
+        
+        /**
+        * Destructor.
+        */
+	    virtual ~CNSmlAgendaDataStore();
+
+    public: // New functions
+        
+        /**
+        * Returns a pointer to array of all possible Calendar database names
+        * which are provited by Symbian OS Calendar API.
+        * @param none
+        * @return Pointer to array of all possible Calendar database names 
+        */
+	    CDesCArray *DoListAgendaFilesLC() const;
+ 
+        /**
+        * Returns a reference to default calendar file name which is provited
+        * by Symbian OS Calendar API.
+        * @param none
+        * @return Reference to default calendar file name
+        */
+	    const TDesC& DoGetDefaultFileNameL() const;
+	    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+ 	    CNSmlAgendaDataStore();
+
+        /**
+        * Returns the used store format.
+        */
+	    CSmlDataStoreFormat* DoOwnStoreFormatL();
+
+	    /**
+	    * 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 );
+
+	    /**
+	    * Cancel the current asynchronous request, including open. 
+	    * Only one asynchronous request may be outstanding at any one time.
+	    */
+	    void DoCancelRequest();
+
+	    /**
+	    * Returns the name of the open data store.
+	    */
+	    const TDesC& DoStoreName() const;
+
+	    /**
+	    * BeginTransactionL() 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();
+
+	    /**
+	    * CommitTransactionL() 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 );
+
+	    /**
+	    * RevertTransaction() 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 );
+
+	    /**
+	    * BeginBatchL() 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();
+
+	    /**
+	    * CommitBatchL() 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 );
+
+	    /**
+	    * CancelBatch() will be called to abort an ongoing batch mode.
+	    * None of the operations already submitted may be applied to
+	    * the Data Store.
+	    */
+	    void DoCancelBatch();
+
+	    /**
+	    * 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 );
+
+	    /**
+	    * 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 );
+
+	    /**
+	    * Gets the Data Store maximum object size which is reported to
+	    * the SyncML server. 0 means there is no limit.
+	    */
+	    TInt DoMaxObjectSize() const;
+
+		/**
+		* 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 );
+
+		/**
+		* 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 );
+
+		/**
+		* 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 );
+
+		/**
+		* 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 );
+
+		/**
+		* 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 );
+
+		/**
+		* Completes an item operation started in DoCreateItemL() or
+		* DoReplaceItemL().
+		* @param		aStatus				On completion of the operation,
+		*                                   contains the result code.
+		*/
+	    void DoCommitItemL( TRequestStatus& aStatus );
+
+		/**
+		* Completes an item operation started in DoOpenItemL().
+		*/
+	    void DoCloseItem();
+
+		/**
+		* 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 );
+
+		/**
+		* 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 );
+
+		/**
+		* Softdeletes 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 );
+
+		/**
+		* Deletes all items from opened database asynchronously.
+		* @param		aStatus				On completion of delete, contains
+		*                                   the result code.
+		*/
+	    void DoDeleteAllItemsL( TRequestStatus& aStatus );
+
+		/**
+		* Check if previous sync with opened server and context.
+		*/
+	    TBool DoHasSyncHistory() const;
+
+		/**
+		* Get all added items on client since previous synchronization.
+		*/
+	    const MSmlDataItemUidSet& DoAddedItems() const;
+
+		/**
+		* Get all deleted items on client since previous synchronization.
+		*/
+	    const MSmlDataItemUidSet& DoDeletedItems() const;
+
+		/**
+		* Get all softdeleted items on client since previous synchronization.
+		*/
+	    const MSmlDataItemUidSet& DoSoftDeletedItems() const;
+
+		/**
+		* Get all modified items on client since previous synchronization.
+		*/
+	    const MSmlDataItemUidSet& DoModifiedItems() const;
+
+		/**
+		* Get all moved items on client since previous synchronization.
+		*/
+	    const MSmlDataItemUidSet& DoMovedItems() const;
+
+		/**
+		* Resets client synchronization data => next time will be slow sync.
+		* @param		aStatus				On completion of reset, contains
+		*                                   the result code.
+		*/
+	    void DoResetChangeInfoL( TRequestStatus& aStatus );
+
+		/**
+		* 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 );
+
+		/**
+		* Commits all client synchronization changes.
+		* @param		aStatus				On completion of all items,
+		*                                   contains the result code.
+		*/
+	    void DoCommitChangeInfoL( TRequestStatus& aStatus );
+
+        /**
+        * Registers current snapshot.
+        */
+	    void RegisterSnapshotL();
+	    
+	    /**
+        * Creates new snapshot. Method gets data from database.
+        * @param	aUid    UID of item.
+        * @return   New snapshot based on item with given UID
+        */
+	    TNSmlSnapshotItem CreateSnapshotItemL( const TCalLocalUid& aUid );
+
+        /**
+        * Second phase constructor.
+        */
+	    void ConstructL();
+
+        /**
+        * Returns ETrue if indicated entry can be syncronized.
+        */
+		TBool CanBeSynchronized(
+		       const CCalEntry::TReplicationStatus& aReplicationStatus ) const;
+
+	    /**
+		* Completes an item operation started in DoCreateItemL().
+		*/
+	    void DoCommitCreateItemL();
+	    
+	    /**
+		* Completes an item operation started in DoReplaceItemL().
+		*/
+	    void DoCommitReplaceItemL();
+	    
+	    /**
+		* Gets property from old item.
+		* @param	aOldItem        Data of old item.
+		* @param	aValue          Value of searched property.
+		* @param	aProperty       Property that is searched.
+		*/
+	    void GetPropertiesFromDataL( CBufFlat* aOldItem,
+	                                 HBufC8*& aValue,
+	                                 const TDesC8& aProperty );
+	                                         
+        /**
+		* Adds property and it's value to new item.
+		* This method also removes original property and it's value.
+		* @param	aValue          Value of added property.
+		* @param	aProperty       Property that is added.
+		*/
+	    void SetPropertiesToDataL( HBufC8*& aValue,
+	                               const TDesC8& aProperty );
+        
+
+    private: // Data
+        // Key
+	    TKeyArrayFix iKey;
+        // Position of buffer
+	    TInt iPos;
+        // Flag if Synchronization history is available or not
+	    TBool iHasHistory;
+        // Modification count
+	    TInt iModificationCount;
+        // Internal state of this class
+	    TNSmlDataStoreStatus iState;
+        // Flag if SnapshotRegistered is registered or not
+	    TBool iSnapshotRegistered;
+        // Drive letter
+	    TInt iDrive;
+        // Item's ID that is to be replaced
+	    TInt iReplaceItemId;
+        // Internal entry type for received item
+	    TNSmlDataEntryType iRXEntryType;
+	    // Internal entry type for transmitted item
+	    TNSmlDataEntryType iTXEntryType;
+        // ChangeFinder
+	    CNSmlChangeFinder* iChangeFinder;
+        // DataModel
+	    CNSmlDataModBase* iDataMod;
+        // Status code from functions
+	    TRequestStatus* iCallerStatus;
+        // A handle to a file server session
+	    RFs iRfs;
+        // ServerMaxObjectSize
+	    TInt iServerMaxObjectSize;
+        // Name of the opened database
+	    HBufC* iOpenedStoreName;
+        // Default name of the database
+	    HBufC* iDefaultStoreName;
+        // Opened database ID
+	    TInt64 iOpenedStoreId;
+        // Item's ID that is to be added
+	    TInt* iAddItemId;
+        // Item's data that is to be written
+	    CBufBase* iItemData;
+        // Own store format
+	    CSmlDataStoreFormat* iOwnFormat;
+        // StringPool
+	    RStringPool iStringPool;
+        // Uids of new items
+	    CNSmlDataItemUidSet* iNewUids;
+        // Uids of deleted items
+	    CNSmlDataItemUidSet* iDeletedUids;
+        // Uids of softdeleted items
+	    CNSmlDataItemUidSet* iSoftDeletedUids;
+        // Uids of replaced items
+	    CNSmlDataItemUidSet* iReplacedUids;
+        // Uids of moved items
+	    CNSmlDataItemUidSet* iMovedUids;
+        // Session to calendar server
+	    CCalSession* iVCalSession;
+        // Internal progress notifier
+	    CNSmlAgendaProgressview* iAgendaProgressview;
+	    // Interim Utility
+	    CCalenInterimUtils2* iInterimUtils;
+	    
+        // Importer
+	    CCalenImporter* iImporter;
+	    // Exporter
+	    CCalenExporter* iExporter;
+	    
+	    // Entry view
+        CCalEntryView* iEntryView;
+        CVersitTlsData *iVersitTlsData; // for better performance
+	};
+
+#endif // __NSMLAGENDADATASTORE_H__
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/inc/nsmlagendadefines.hrh	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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:  Defines for DS agenda adapter
+*
+*/
+
+
+
+// DEFINES
+#ifdef RD_DS_ICAL_SUPPORT
+#ifdef __I_CAL_SUPPORT
+#define __NSML_USE_ICAL_FEATURE
+#endif // __I_CAL_SUPPORT
+
+#endif
+
+#ifdef __NSML_DEBUG__ 
+#define __NSML_MORE_DEBUG_FOR_ITEMS__	// If this flag is defined
+					                    // then debug dumb includes
+					                    // old item and new data at replace
+    				                    // commands
+#endif // __NSML_DEBUG__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/loc/101F6DD7.loc	Fri Apr 16 14:53:26 2010 +0300
@@ -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_agn_display_name "Calendar"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/src/101F6DD7.rss	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* 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:  rss file for DS agenda adapter
+*
+*/
+
+
+#include <101F6DD7.loc>
+
+#include <registryinfo.rh>
+#include <nsmldsconstants.h>
+
+RESOURCE REGISTRY_INFO theRegistryInfo
+  {
+  dll_uid = 0x101F6DDE;
+  interfaces = 
+      {
+      INTERFACE_INFO
+          {
+          interface_uid = KNSmlDSInterfaceUid; // DS interface UID
+          implementations = 
+            {
+            IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x101F6DDE; // DS interface implementation UID
+                version_no = 1; 
+                display_name = qtn_nsml_agn_display_name;
+                default_data = "";
+                opaque_data = "";
+                }
+            };
+          }
+      };
+    }
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/src/NSmlAgendaDataStore_1_1_2.rss	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,888 @@
+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
+					{
+					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="Role";
+								name="ROLE";
+								data_type="";
+								enum_values={};
+								},
+							SML_DATA_PROPERTY_PARAM
+								{
+								version=1;
+								display_name="Status";
+								name="STATUS";
+								data_type="";
+								enum_values={};
+								},
+							SML_DATA_PROPERTY_PARAM
+								{
+								version=1;
+								display_name="X-CN";
+								name="X-CN";
+								data_type="";
+								enum_values={};
+								},
+							SML_DATA_PROPERTY_PARAM
+								{
+								version=1;
+								display_name="Role";
+								name="X-ROLE";
+								data_type="";
+								enum_values={};
+								},
+							SML_DATA_PROPERTY_PARAM
+								{
+								version=1;
+								display_name="Sent by";
+								name="X-SENTBY";
+								data_type="";
+								enum_values={};
+								},
+							SML_DATA_PROPERTY_PARAM
+								{
+								version=1;
+								display_name="Sent by";
+								name="X-STATUS";
+								data_type="";
+								enum_values={};
+								}
+							};
+					},
+				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
+					{
+					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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/src/NSmlAgendaDataStore_1_2.rss	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,866 @@
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/src/nsmlagendadataprovider.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -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:  DS agenda data provider
+*
+*/
+
+
+// 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>
+
+// ====================================== MEMBER FUNCTIONS ========================================
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::CNSmlAgendaDataProvider
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ------------------------------------------------------------------------------------------------
+//
+CNSmlAgendaDataProvider::CNSmlAgendaDataProvider()
+	{
+	_DBG_FILE("CNSmlAgendaDataProvider::CNSmlAgendaDataProvider(): BEGIN");
+	_DBG_FILE("CNSmlAgendaDataProvider::CNSmlAgendaDataProvider(): END");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::ConstructL
+// Symbian 2nd phase constructor can leave.
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlAgendaDataProvider::ConstructL( )
+	{
+	_DBG_FILE("CNSmlAgendaDataProvider::NewL: BEGIN");
+	iAgnDataStore = CNSmlAgendaDataStore::NewL();
+	iStringPool.OpenL();
+	User::LeaveIfError( iSession.Connect() );
+	_DBG_FILE("CNSmlAgendaDataProvider::NewL: BEGIN");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::NewL
+// Two-phased constructor.
+// ------------------------------------------------------------------------------------------------
+//
+CNSmlAgendaDataProvider* CNSmlAgendaDataProvider::NewL()
+	{
+	_DBG_FILE("CNSmlAgendaDataProvider::NewL: BEGIN");
+	CNSmlAgendaDataProvider* self = new ( ELeave ) CNSmlAgendaDataProvider();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	_DBG_FILE("CNSmlAgendaDataProvider::NewL: BEGIN");
+	return self;
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::~CNSmlAgendaDataProvider
+// Destructor.
+// ------------------------------------------------------------------------------------------------
+//
+CNSmlAgendaDataProvider::~CNSmlAgendaDataProvider()
+	{
+	_DBG_FILE("CNSmlAgendaDataProvider::~CNSmlAgendaDataProvider(): BEGIN");
+	delete iAgnDataStore;
+	iSession.Close();
+	delete iDSFormat;
+	iStringPool.Close();
+	iFilterArray.ResetAndDestroy();
+	iFilterArray.Close();
+	_DBG_FILE("CNSmlAgendaDataProvider::~CNSmlAgendaDataProvider(): END");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::DoOnFrameworkEvent
+// Not supported.
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlAgendaDataProvider::DoOnFrameworkEvent( TSmlFrameworkEvent /*aEvent*/, TInt /*aParam1*/, TInt /*aParam2*/ )
+    {
+	_DBG_FILE("CNSmlAgendaDataProvider::DoOnFrameworkEvent: BEGIN");
+	_DBG_FILE("CNSmlAgendaDataProvider::DoOnFrameworkEvent: END");
+    }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::DoSupportsOperation
+// Return supported operation uid.
+// ------------------------------------------------------------------------------------------------
+//
+TBool CNSmlAgendaDataProvider::DoSupportsOperation( TUid aOpId ) const
+    {
+	_DBG_FILE("CNSmlAgendaDataProvider::DoSupportsOperation: BEGIN");
+	if ( aOpId == KUidSmlSupportMultipleStores )
+		{
+		_DBG_FILE("CNSmlAgendaDataProvider::DoSupportsOperation: END");
+		return ETrue;
+		}
+	_DBG_FILE("CNSmlAgendaDataProvider::DoSupportsOperation: END");
+	return EFalse;
+    }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::DoStoreFormatL
+// Return the current data store format.
+// ------------------------------------------------------------------------------------------------
+//
+const CSmlDataStoreFormat& CNSmlAgendaDataProvider::DoStoreFormatL()
+    {
+	_DBG_FILE("CNSmlAgendaDataProvider::DoStoreFormatL(): BEGIN");
+	
+	if ( iDSFormat )
+		{
+       	delete iDSFormat;
+       	iDSFormat = NULL;
+		}
+	iDSFormat = DoOwnStoreFormatL();
+	
+    return *iDSFormat;
+    }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::DoListStoresLC
+// Return the list of datastore names.
+// ------------------------------------------------------------------------------------------------
+//
+CDesCArray* CNSmlAgendaDataProvider::DoListStoresLC()
+    {
+	_DBG_FILE("CNSmlAgendaDataProvider::DoListStoresLC(): BEGIN");
+	_DBG_FILE("CNSmlAgendaDataProvider::DoListStoresLC(): END");
+	return iAgnDataStore->DoListAgendaFilesLC();
+    }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::DoDefaultStoreL
+// Return the name of default store name.
+// ------------------------------------------------------------------------------------------------
+//
+const TDesC& CNSmlAgendaDataProvider::DoDefaultStoreL()
+    {
+	_DBG_FILE("CNSmlAgendaDataProvider::DoDefaultStoreL(): BEGIN");
+	_DBG_FILE("CNSmlAgendaDataProvider::DoDefaultStoreL(): END");
+	return iAgnDataStore->DoGetDefaultFileNameL();
+    }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::DoNewStoreInstanceLC
+// Return instance of data store
+// ------------------------------------------------------------------------------------------------
+//
+CSmlDataStore* CNSmlAgendaDataProvider::DoNewStoreInstanceLC()
+    {
+	_DBG_FILE("CNSmlAgendaDataProvider::DoNewStoreInstanceLC(): BEGIN");
+	CNSmlAgendaDataStore* newStore = CNSmlAgendaDataStore::NewL();
+	CleanupStack::PushL( newStore );
+	_DBG_FILE("CNSmlAgendaDataProvider::DoNewStoreInstanceLC(): END");
+	return newStore;
+    } 
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::DoSupportedServerFiltersL
+// 
+// ------------------------------------------------------------------------------------------------
+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");
+	return iFilterArray;
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::DoCheckSupportedServerFiltersL
+// 
+// ------------------------------------------------------------------------------------------------
+void CNSmlAgendaDataProvider::DoCheckSupportedServerFiltersL( const CSmlDataStoreFormat& /*aServerDataStoreFormat*/, RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
+	{
+	_DBG_FILE("CNSmlAgendaDataProvider::DoCheckSupportedServerFiltersL(): BEGIN");
+	User::Leave( KErrNotSupported );
+	_DBG_FILE("CNSmlAgendaDataProvider::DoCheckSupportedServerFiltersL(): END");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::CheckServerFiltersL
+// 
+// ------------------------------------------------------------------------------------------------
+void CNSmlAgendaDataProvider::DoCheckServerFiltersL( RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
+	{
+	_DBG_FILE("CNSmlAgendaDataProvider::DoCheckServerFiltersL(): BEGIN");
+	User::Leave( KErrNotSupported );
+	_DBG_FILE("CNSmlAgendaDataProvider::DoCheckServerFiltersL(): END");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::DoGenerateRecordFilterQueryLC
+// 
+// ------------------------------------------------------------------------------------------------
+HBufC* CNSmlAgendaDataProvider::DoGenerateRecordFilterQueryLC( const RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterMatchType /*aMatch*/, TDes& /*aFilterMimeType*/, TSyncMLFilterType& /*aFilterType*/, TDesC& /*aStoreName*/ )
+	{
+	_DBG_FILE("CNSmlAgendaDataProvider::DoGenerateRecordFilterQueryLC(): BEGIN");
+	User::Leave( KErrNotSupported );
+	_DBG_FILE("CNSmlAgendaDataProvider::DoGenerateRecordFilterQueryLC(): END");
+	return NULL;
+	}
+	
+// ------------------------------------------------------------------------------------------------
+// CNSmlAgendaDataProvider::DoGenerateFieldFilterQueryL
+// 
+// ------------------------------------------------------------------------------------------------
+void CNSmlAgendaDataProvider::DoGenerateFieldFilterQueryL( const RPointerArray<CSyncMLFilter>& /*aFilters*/, TDes& /*aFilterMimeType*/, RPointerArray<CSmlDataProperty>& /*aProperties*/, TDesC& /*aStoreName*/ )
+	{
+	_DBG_FILE("CNSmlAgendaDataProvider::DoGenerateFieldFilterQueryL(): BEGIN");
+	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 ===================================
+#ifndef IMPLEMENTATION_PROXY_ENTRY
+#define IMPLEMENTATION_PROXY_ENTRY( aUid, aFuncPtr ) { { aUid }, ( aFuncPtr ) }
+#endif
+
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY( KNSmlAgendaAdapterImplUid, CNSmlAgendaDataProvider::NewL )
+    };
+
+// ------------------------------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Framework needs this.
+// ------------------------------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+    {
+	_DBG_FILE("ImplementationGroupProxy() for CNSmlAgendaDataProvider: begin");
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+	_DBG_FILE("ImplementationGroupProxy() for CNSmlAgendaDataProvider: end");
+    return ImplementationTable;
+	}
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/src/nsmlagendadatastore.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,1770 @@
+/*
+* 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 agenda data store
+*
+*/
+
+
+
+// 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>
+#include <calsession.h> 
+#include <caldataexchange.h> 
+#include <calentryview.h>
+#include <caliterator.h>
+#include <calentry.h>
+#include <caldataformat.h>
+#include <caltime.h>
+#include <nsmldsimpluids.h>
+#include <sysutil.h>
+#include <SmlDataProvider.h>
+#include <SmlDataFormat.h>
+#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>
+
+#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 ==============================
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::CNSmlAgendaDataStore
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CNSmlAgendaDataStore::CNSmlAgendaDataStore() :
+	iKey( TKeyArrayFix( _FOFF( TNSmlSnapshotItem, ItemId() ), ECmpTInt ) ),
+	iPos( -1 ),
+	iHasHistory( EFalse ),
+	iModificationCount( KNSmlCompactAfterChanges ),
+	iState( ENSmlClosed ),
+	iSnapshotRegistered( EFalse ),
+	iDrive( -1 ),
+	iReplaceItemId( -1 ),
+	iRXEntryType( ENSmlNotSet ),
+	iTXEntryType( ENSmlNotSet )
+	{
+	_DBG_FILE("CNSmlAgendaDataStore::CNSmlAgendaDataStore(): BEGIN");
+	_DBG_FILE("CNSmlAgendaDataStore::CNSmlAgendaDataStore(): END");
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::ConstructL()
+	{
+	_DBG_FILE("CNSmlAgendaDataStore::ConstructL: BEGIN");
+
+	iStringPool.OpenL();
+	User::LeaveIfError( iRfs.Connect() );
+
+	iDataMod = new ( ELeave ) CNSmlVCalMod();
+	
+	iNewUids = new ( ELeave ) CNSmlDataItemUidSet();
+	iDeletedUids = new ( ELeave ) CNSmlDataItemUidSet();
+	iSoftDeletedUids = new ( ELeave ) CNSmlDataItemUidSet();
+	iMovedUids = new ( ELeave ) CNSmlDataItemUidSet();
+	iReplacedUids = new ( ELeave ) CNSmlDataItemUidSet();
+	
+	iDefaultStoreName = HBufC::NewL( KNSmlDefaultStoreNameMaxSize );
+	
+	iVersitTlsData = &CVersitTlsData::VersitTlsDataL();
+	// Create CalSession and CalEntryView instances
+	iVCalSession = CCalSession::NewL();
+	
+	TPtr obptr = iDefaultStoreName->Des();
+	obptr = iVCalSession->DefaultFileNameL(); 
+
+	iOwnFormat = DoOwnStoreFormatL();
+	iDataMod->SetOwnStoreFormat( *iOwnFormat );
+	
+    iInterimUtils = CCalenInterimUtils2::NewL();
+	
+	_DBG_FILE("CNSmlAgendaDataStore::ConstructL: END");
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlAgendaDataStore* CNSmlAgendaDataStore::NewL()
+	{
+	_DBG_FILE("CNSmlAgendaDataStore::NewL: BEGIN");
+	
+	CNSmlAgendaDataStore* self = new ( ELeave ) CNSmlAgendaDataStore();
+	CleanupStack::PushL( self );
+	
+	self->ConstructL();
+	CleanupStack::Pop(); // self
+	
+	_DBG_FILE("CNSmlAgendaDataStore::NewL: END");
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::~CNSmlAgendaDataStore
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlAgendaDataStore::~CNSmlAgendaDataStore()
+	{
+	_DBG_FILE("CNSmlAgendaDataStore::~CNSmlAgendaDataStore(): BEGIN");
+
+    // Enable notifications
+    TInt error( KErrNone );
+    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 iNewUids;
+	delete iDeletedUids;
+	delete iSoftDeletedUids;
+	delete iMovedUids;
+	delete iReplacedUids;
+
+    delete iDefaultStoreName;
+    delete iOpenedStoreName;
+	delete iDataMod;
+	delete iItemData;
+
+    delete iAgendaProgressview;
+    
+	delete iImporter;
+    delete iExporter;
+    
+    delete iEntryView;
+    delete iVCalSession;
+    delete iInterimUtils;
+    
+    
+    // REComSession::FinalClose();
+	
+	_DBG_FILE("CNSmlAgendaDataStore::~CNSmlAgendaDataStore(): END");
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoOpenL
+// Open calendar database for access.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoOpenL( const TDesC& aStoreName,
+                MSmlSyncRelationship& aContext, TRequestStatus& aStatus )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoOpenL: BEGIN");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	if ( iState != ENSmlClosed )
+		{
+		User::RequestComplete( iCallerStatus, KErrInUse );
+		return;
+		}
+
+	if( RFs::CharToDrive( aStoreName[0], iDrive ) != KErrNone )
+		{
+		RFs::CharToDrive( KNSmlDriveC()[0], iDrive );
+		}
+    
+    // Open database
+	TInt err( KErrNone );	
+	if ( aStoreName == KNSmlAgendaStoreNameForDefaultDB )
+		{
+		TRAP( err, iVCalSession->OpenL( *iDefaultStoreName ) );
+		}
+    else 
+    	{
+    	TRAP( err, iVCalSession->OpenL( aStoreName ) );
+    	}
+	if ( 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();
+
+    iEntryView = CCalEntryView::NewL( *iVCalSession, *iAgendaProgressview );
+    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();
+		}
+     	
+	iState = ENSmlOpenAndWaiting;
+    User::RequestComplete( iCallerStatus, err );
+	    
+	_DBG_FILE("CNSmlAgendaDataStore::DoOpenL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCancelRequest
+// Set internal module state to previous state.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCancelRequest()
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoCancelRequest: BEGIN");
+    if ( iState == ENSmlOpenAndWaiting )
+        {
+    	iState = ENSmlClosed;
+        }
+    else
+        {
+	    iState = ENSmlOpenAndWaiting;
+        }
+	_DBG_FILE("CNSmlAgendaDataStore::DoCancelRequest: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoStoreName
+// Returns previously opened database name.
+// -----------------------------------------------------------------------------
+//
+const TDesC& CNSmlAgendaDataStore::DoStoreName() const
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoStoreName: BEGIN");
+	_DBG_FILE("CNSmlAgendaDataStore::DoStoreName: END");
+	return *iOpenedStoreName;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoBeginTransactionL
+// Not supported.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoBeginTransactionL()
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoBeginTransactionL: BEGIN");
+	User::Leave( KErrNotSupported );
+	_DBG_FILE("CNSmlAgendaDataStore::DoBeginTransactionL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCommitTransactionL
+// Not supported.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCommitTransactionL( TRequestStatus& aStatus )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoCommitTransactionL: BEGIN");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	User::RequestComplete( iCallerStatus, KErrNotSupported );
+	_DBG_FILE("CNSmlAgendaDataStore::DoCommitTransactionL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoRevertTransaction
+// Not supported.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoRevertTransaction( TRequestStatus& aStatus )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoRevertTransaction: BEGIN");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	User::RequestComplete( iCallerStatus, KErrNotSupported );
+	_DBG_FILE("CNSmlAgendaDataStore::DoRevertTransaction: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoBeginBatchL
+// Not supported.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoBeginBatchL()
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoBeginBatchL: BEGIN");
+	User::Leave( KErrNotSupported );
+	_DBG_FILE("CNSmlAgendaDataStore::DoBeginBatchL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCommitBatchL
+// Not supported.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCommitBatchL( RArray<TInt>& /*aResultArray*/,
+                TRequestStatus& aStatus )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoCommitBatchL: BEGIN");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	User::RequestComplete( iCallerStatus, KErrNotSupported );
+	_DBG_FILE("CNSmlAgendaDataStore::DoCommitBatchL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCancelBatch
+// Not supported.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCancelBatch()
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoCancelBatch: BEGIN");
+	// Nothing to do
+	_DBG_FILE("CNSmlAgendaDataStore::DoCancelBatch: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoSetRemoteStoreFormatL
+// Set SyncML Remote Server data store format.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoSetRemoteStoreFormatL(
+                const CSmlDataStoreFormat& aServerDataStoreFormat )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: BEGIN");
+	
+	if ( iOwnFormat )
+	    {
+	    delete iOwnFormat;
+	    iOwnFormat = NULL;    
+	    }
+	
+	iOwnFormat = DoOwnStoreFormatL();
+	iDataMod->SetOwnStoreFormat( *iOwnFormat );
+	
+    iDataMod->SetPartnerStoreFormat( ( CSmlDataStoreFormat& )
+                aServerDataStoreFormat );
+    
+    // Check which calendar type (vCal/iCal) is used
+    // If server supports iCal then it is used
+    // Otherwise vCal is used
+    TInt returnValue( KErrNotSupported );
+
+#ifdef __NSML_USE_ICAL_FEATURE
+
+    _DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Support iCal");
+   	returnValue = iDataMod->SetUsedMimeType(
+       	    iOwnFormat->MimeFormat( 1 ).MimeType(),
+           	iOwnFormat->MimeFormat( 1 ).MimeVersion() );
+
+#endif // __NSML_USE_ICAL_FEATURE
+
+    if ( returnValue == KErrNone )
+        {
+        _DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Sets iCal");
+        iRXEntryType = ENSmlICal;
+        iTXEntryType = ENSmlICal;
+        }
+    else
+        {
+        _DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Support vCal");
+        returnValue = iDataMod->SetUsedMimeType(
+            iOwnFormat->MimeFormat( 0 ).MimeType(),
+            iOwnFormat->MimeFormat( 0 ).MimeVersion() );
+        if ( returnValue == KErrNone )
+            {
+            _DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: Sets vCal");
+            iRXEntryType = ENSmlVCal;
+            iTXEntryType = ENSmlVCal;
+            }
+        }
+    if ( iRXEntryType == ENSmlNotSet || iTXEntryType == ENSmlNotSet )
+        {
+        // Leave if server does not support either vCal or iCal
+        _DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: MimeType Not supported");
+        User::Leave( KErrNotFound );        
+        }
+    
+	_DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteStoreFormatL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoSetRemoteMaxObjectSize
+// Set SyncML Remote Server maximum object size.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoSetRemoteMaxObjectSize( TInt aServerMaxObjectSize )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteMaxObjectSize: BEGIN");
+	iServerMaxObjectSize = aServerMaxObjectSize;
+	_DBG_FILE("CNSmlAgendaDataStore::DoSetRemoteMaxObjectSize: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoMaxObjectSize
+// Set SyncML Component maximum object size.
+// -----------------------------------------------------------------------------
+//
+TInt CNSmlAgendaDataStore::DoMaxObjectSize() const
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoMaxObjectSize: BEGIN");
+	_DBG_FILE("CNSmlAgendaDataStore::DoMaxObjectSize - Default: END");
+	return KNSmlAgendaOwnMaxObjectSize;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoOpenItemL
+// Open calendar item for reading.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoOpenItemL( TSmlDbItemUid aUid, TBool& aFieldChange,
+                TInt& aSize, TSmlDbItemUid& /*aParent*/, TDes8& aMimeType,
+                TDes8& aMimeVer, TRequestStatus& aStatus )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoOpenItemL: BEGIN");
+    iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	if ( iState != ENSmlOpenAndWaiting )
+		{
+		User::RequestComplete( iCallerStatus, KErrNotReady );
+		return;
+		}
+		
+ 	iReplaceItemId = aUid;
+ 	
+	CCalEntry* entry = NULL;
+	TInt err( KErrNone );
+    TRAP( err, entry = iEntryView->FetchL( aUid ) );
+	CleanupStack::PushL( entry );
+	
+	if ( err || !entry )
+		{
+		CleanupStack::PopAndDestroy( entry ); // entry
+		User::RequestComplete( iCallerStatus, KErrNotFound );
+		return;
+		}
+		
+	if ( !iSnapshotRegistered )
+		{
+		RegisterSnapshotL();
+		}
+	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 )
+	    {
+	    _DBG_FILE("CNSmlAgendaDataStore::DoOpenItemL: Export - vCal DB");
+	    iExporter->ExportVCalL( *entry, writeStream );
+	    aMimeType = iOwnFormat->MimeFormat( 0 ).MimeType().DesC();
+	    aMimeVer = iOwnFormat->MimeFormat( 0 ).MimeVersion().DesC();
+	    }
+	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;
+	
+#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__
+
+	
+	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;
+	aSize = iItemData->Size();
+	
+	iState = ENSmlItemOpen;
+	
+	if ( iServerMaxObjectSize == 0 || aSize <= iServerMaxObjectSize )
+		{
+		User::RequestComplete( iCallerStatus, KErrNone );
+		}
+	else
+		{
+		User::RequestComplete( iCallerStatus, KErrTooBig );
+		}
+		
+	_DBG_FILE("CNSmlAgendaDataStore::DoOpenItemL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCreateItemL
+// Prepare item data for writing to database. WriteItemL() writes item's data as
+// buffered.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCreateItemL( TSmlDbItemUid& aUid, TInt aSize,
+                TSmlDbItemUid /*aParent*/, const TDesC8& aMimeType,
+                const TDesC8& /*aMimeVer*/, TRequestStatus& aStatus )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL: BEGIN");
+	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 ) 
+        {
+        _DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL: received iCal");
+        mimeFound = ETrue;
+	    iRXEntryType = ENSmlICal;
+        }
+
+#endif // __NSML_USE_ICAL_FEATURE
+
+    // Else use original iRXEntryType
+    else
+        {
+        _DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL: \
+                   mime type not received");
+        iRXEntryType = iTXEntryType;
+        }
+
+	if ( !mimeFound )
+		{
+		User::RequestComplete( iCallerStatus, KErrNotSupported );
+		_DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL -KErrNotSupported: END");
+		return;
+		}
+
+	if( !iSnapshotRegistered )
+		{
+		RegisterSnapshotL();
+		}
+	delete iItemData;
+	iItemData = NULL;
+	iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
+	iPos = 0;
+	
+	iState = ENSmlItemCreating;
+	User::RequestComplete( iCallerStatus, KErrNone );
+	_DBG_FILE("CNSmlAgendaDataStore::DoCreateItemL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoReplaceItemL
+// Prepare item data for writing and replacing item in database. WriteItemL()
+// writes item's data as buffered.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoReplaceItemL( TSmlDbItemUid aUid, TInt aSize,
+                TSmlDbItemUid /*aParent*/, TBool aFieldChange,
+                TRequestStatus& aStatus )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoReplaceItemL: BEGIN");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	
+	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;
+		}
+
+	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 )
+        {
+		CleanupStack::PopAndDestroy( entry ); // entry
+		User::RequestComplete( iCallerStatus, err );
+		_DBG_FILE("CNSmlAgendaDataStore::DoReplaceItemL - Error: END");
+		return;
+        }
+
+	CleanupStack::PopAndDestroy( entry ); // entry
+		
+	if ( !iSnapshotRegistered )
+		{
+		RegisterSnapshotL();
+		}
+		
+	delete iItemData;
+	iItemData = NULL;
+	iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
+	iPos = 0;
+	iReplaceItemId = aUid;
+	
+	iState = ENSmlItemUpdating;
+	User::RequestComplete( iCallerStatus, KErrNone );
+	_DBG_FILE("CNSmlAgendaDataStore::DoReplaceItemL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoReadItemL
+// Read item data to given buffer.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoReadItemL( TDes8& aBuffer )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoReadItemL: BEGIN");
+    if ( iState != ENSmlItemOpen || !iItemData )
+        {
+        iPos = -1;
+        User::Leave( KErrNotReady );
+        }
+
+    if ( iPos == -1 )
+        {
+        User::Leave( KErrEof );
+        }
+
+    if ( aBuffer.Size() < iItemData->Size() - iPos )
+        {
+        iItemData->Read( iPos, aBuffer );
+        iPos += aBuffer.Size();
+        }
+    else
+        {
+        iItemData->Read( iPos, aBuffer, iItemData->Size() - iPos );
+        iPos = -1;
+        }
+	_DBG_FILE("CNSmlAgendaDataStore::DoReadItemL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoWriteItemL
+// Write item data as buffered.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoWriteItemL( const TDesC8& aData )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoWriteItemL: BEGIN");
+	if ( iState == ENSmlItemCreating || iState == ENSmlItemUpdating )
+		{
+		if ( iItemData )
+			{
+			if ( iPos == -1 )
+				{
+				User::Leave( KErrEof );
+				}
+			iItemData->InsertL( iPos, aData );
+			iPos += aData.Size();
+			return;
+			}
+		}
+	User::Leave( KErrNotReady );
+	_DBG_FILE("CNSmlAgendaDataStore::DoWriteItemL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCommitItemL
+// Commit item data to database when adding or replacing item.
+// -----------------------------------------------------------------------------
+//
+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;
+    User::RequestComplete( iCallerStatus, error );    
+	_DBG_FILE("CNSmlAgendaDataStore::DoCommitItemL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCloseItem
+// Return to previous state and clean item buffer.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCloseItem()
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoCloseItem: BEGIN");
+	if ( iState == ENSmlItemOpen )
+		{
+		iPos = -1;
+		iState = ENSmlOpenAndWaiting;
+		}
+	_DBG_FILE("CNSmlAgendaDataStore::DoCloseItem: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoMoveItemL
+// Not supported.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoMoveItemL( TSmlDbItemUid /*aUid*/,
+            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");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoDeleteItemL
+// Delete item from database.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoDeleteItemL( TSmlDbItemUid aUid,
+                TRequestStatus& aStatus )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoDeleteItemL: BEGIN");
+	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 );	
+
+	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;
+	    }
+	    
+    iEntryView->DeleteL( *entry );
+	CleanupStack::PopAndDestroy( entry ); // entry
+	
+	if ( iChangeFinder )
+		{
+		TNSmlSnapshotItem item( aUid );
+		iChangeFinder->ItemDeleted( item );
+		}
+		
+	User::RequestComplete( iCallerStatus, KErrNone );
+	_DBG_FILE("CNSmlAgendaDataStore::DoDeleteItemL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoSoftDeleteItemL
+// Delete item from database.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoSoftDeleteItemL( TSmlDbItemUid /*aUid*/,
+                TRequestStatus& aStatus )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoSoftDeleteItemL: BEGIN");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	User::RequestComplete( iCallerStatus, KErrNotSupported );
+	_DBG_FILE("CNSmlAgendaDataStore::DoSoftDeleteItemL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoDeleteAllItemsL
+// Delete all items from database.
+// -----------------------------------------------------------------------------
+//
+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
+
+    // Update changefinder
+	if ( iChangeFinder )
+		{
+		iChangeFinder->ResetL();
+		}
+	iSnapshotRegistered = EFalse;
+	RegisterSnapshotL();
+	
+	User::RequestComplete( iCallerStatus, KErrNone );
+	
+	_DBG_FILE("CNSmlAgendaDataStore::DoDeleteAllItemsL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoHasSyncHistory
+// Return ETrue if syncronization history is available.
+// -----------------------------------------------------------------------------
+//
+TBool CNSmlAgendaDataStore::DoHasSyncHistory() const
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoHasSyncHistory: BEGIN");
+	TBool ret = EFalse;
+	if ( iHasHistory )
+		{
+		if ( iOpenedStoreId != iChangeFinder->DataStoreUid() )
+			{
+			iChangeFinder->SetDataStoreUid( iOpenedStoreId );
+			}
+		else
+			{
+			ret = ETrue;
+			}
+		}
+	else
+		{
+		iChangeFinder->SetDataStoreUid( iOpenedStoreId );
+		}
+	_DBG_FILE("CNSmlAgendaDataStore::DoHasSyncHistory: END");
+	return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoAddedItems
+// Give uid list of added items since last syncronization.
+// -----------------------------------------------------------------------------
+//
+const MSmlDataItemUidSet& CNSmlAgendaDataStore::DoAddedItems() const
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoAddedItems: BEGIN");
+	if ( iState == ENSmlOpenAndWaiting )
+		{
+		iNewUids->Reset();
+		TRAP_IGNORE( iChangeFinder->FindNewItemsL( *iNewUids ) );
+		}
+	_DBG_FILE("CNSmlAgendaDataStore::DoAddedItems: END");
+	return *iNewUids;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoDeletedItems
+// Give uid list of deleted items since last syncronization.
+// -----------------------------------------------------------------------------
+//
+const MSmlDataItemUidSet& CNSmlAgendaDataStore::DoDeletedItems() const
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoDeletedItems: BEGIN");
+	if ( iState == ENSmlOpenAndWaiting )
+		{
+		iDeletedUids->Reset();
+		TRAP_IGNORE( iChangeFinder->FindDeletedItemsL( *iDeletedUids ) );
+		}
+	_DBG_FILE("CNSmlAgendaDataStore::DoDeletedItems: END");
+	return *iDeletedUids;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoSoftDeletedItems
+// Give uid list of deleted items since last syncronization.
+// -----------------------------------------------------------------------------
+//
+const MSmlDataItemUidSet& CNSmlAgendaDataStore::DoSoftDeletedItems() const
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoSoftDeletedItems: BEGIN");
+	if ( iState == ENSmlOpenAndWaiting )
+		{
+		iSoftDeletedUids->Reset();
+		TRAP_IGNORE(
+		    iChangeFinder->FindSoftDeletedItemsL( *iSoftDeletedUids ) );
+		}
+	_DBG_FILE("CNSmlAgendaDataStore::DoSoftDeletedItems: END");
+	return *iSoftDeletedUids;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoModifiedItems
+// Give uid list of modified items since last syncronization.
+// -----------------------------------------------------------------------------
+//
+const MSmlDataItemUidSet& CNSmlAgendaDataStore::DoModifiedItems() const
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoModifiedItems: BEGIN");
+	if ( iState == ENSmlOpenAndWaiting )
+		{
+		iReplacedUids->Reset();
+		TRAP_IGNORE( iChangeFinder->FindChangedItemsL( *iReplacedUids ) );
+		}
+	_DBG_FILE("CNSmlAgendaDataStore::DoModifiedItems: END");
+	return *iReplacedUids;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoMovedItems
+// Give uid list of moved items since last syncronization.
+// -----------------------------------------------------------------------------
+//
+const MSmlDataItemUidSet& CNSmlAgendaDataStore::DoMovedItems() const
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoMovedItems: BEGIN");
+	if ( iState == ENSmlOpenAndWaiting )
+		{
+		iMovedUids->Reset();
+		TRAP_IGNORE( iChangeFinder->FindMovedItemsL( *iMovedUids ) );
+		}
+	_DBG_FILE("CNSmlAgendaDataStore::DoMovedItems: END");
+	return *iMovedUids;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoResetChangeInfoL
+// Reset change info that exist since last syncronization.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoResetChangeInfoL: BEGIN");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	if ( iState != ENSmlOpenAndWaiting ) 
+		{
+		User::RequestComplete( iCallerStatus, KErrNotReady );
+		return;
+		}
+	iChangeFinder->ResetL();
+	iSnapshotRegistered = EFalse;
+	if( !iSnapshotRegistered )
+		{
+		RegisterSnapshotL();
+		}
+	User::RequestComplete( iCallerStatus, KErrNone );
+	_DBG_FILE("CNSmlAgendaDataStore::DoResetChangeInfoL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCommitChangeInfoL
+// Commit change info that exist since last syncronization for given uid list.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus,
+                const MSmlDataItemUidSet& aItems )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoCommitChangeInfoL: BEGIN");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	if ( iState != ENSmlOpenAndWaiting ) 
+		{
+		User::RequestComplete( iCallerStatus, KErrNotReady );
+		return;
+		}
+	iChangeFinder->CommitChangesL( aItems );
+	User::RequestComplete( iCallerStatus, KErrNone );
+	_DBG_FILE("CNSmlAgendaDataStore::DoCommitChangeInfoL: END");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCommitChangeInfoL
+// Commit change info that exist since last syncronization.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus )
+    {
+	_DBG_FILE("CNSmlAgendaDataStore::DoCommitChangeInfoL: BEGIN");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	if ( iState != ENSmlOpenAndWaiting ) 
+		{
+		User::RequestComplete( iCallerStatus, KErrNotReady );
+		return;
+		}
+	iChangeFinder->CommitChangesL();
+	User::RequestComplete( iCallerStatus, KErrNone );
+	_DBG_FILE("CNSmlAgendaDataStore::DoCommitChangeInfoL: END");
+    }
+    
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::RegisterSnapshotL
+// Register snapshot.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::RegisterSnapshotL()
+    {
+	_DBG_FILE("CNSmlAgendaAdapter::RegisterSnapshotL(): begin");
+	CArrayFixSeg<TNSmlSnapshotItem>* snapshot =
+	                new ( ELeave ) CArrayFixSeg<TNSmlSnapshotItem>( 64 );
+	CleanupStack::PushL( snapshot );
+	
+    // First find all entries ...
+	RArray<TCalLocalUid> uidArray;
+	CleanupClosePushL( uidArray );
+	TCalTime zeroTime;
+	zeroTime.SetTimeUtcL( Time::NullTTime() );
+	iEntryView->GetIdsModifiedSinceDateL( zeroTime, uidArray );
+	
+	// ... 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 );
+		
+	iChangeFinder->SetNewSnapshot( snapshot );
+	
+	// iChangeFinder takes ownership of items
+	CleanupStack::Pop( snapshot );
+	iSnapshotRegistered = ETrue;
+	
+	_DBG_FILE("CNSmlAgendaAdapter::RegisterSnapshotL(): end");
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::CreateSnapshotItemL
+// Creates new snapshot. Method gets data from database.
+// -----------------------------------------------------------------------------
+TNSmlSnapshotItem CNSmlAgendaDataStore::CreateSnapshotItemL(
+                const TCalLocalUid& aUid )
+    {
+    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
+	return item;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoListAgendaFilesL
+// List possible calendar database file names.
+// -----------------------------------------------------------------------------
+//
+CDesCArray* CNSmlAgendaDataStore::DoListAgendaFilesLC() const
+    {
+    CDesCArray* array = iVCalSession->ListCalFilesL();    
+	CleanupStack::PushL( array );
+	return array;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoGetDefaultFileNameL
+// Return default calendar database name.
+// -----------------------------------------------------------------------------
+//
+const TDesC& CNSmlAgendaDataStore::DoGetDefaultFileNameL() const
+    {
+	if ( !iDefaultStoreName )
+		{
+        User::Leave( KErrGeneral );
+		}
+	return *iDefaultStoreName;
+    }
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::CanBeSynchronized
+// Return ETrue if entry can be synchronized.
+// -----------------------------------------------------------------------------
+//
+TBool CNSmlAgendaDataStore::CanBeSynchronized(
+            const CCalEntry::TReplicationStatus&
+            aReplicationStatus ) const
+	{
+	return ( aReplicationStatus != CCalEntry::ERestricted );	
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoOwnStoreFormatL
+// Returns adapters supported store format which is read from Calendar Plug
+// In Adapter own resource file.
+// -----------------------------------------------------------------------------
+//
+CSmlDataStoreFormat* CNSmlAgendaDataStore::DoOwnStoreFormatL()
+	{
+	_DBG_FILE("CNSmlAgendaDataStore:::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( 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 );
+
+	CSmlDataStoreFormat* dsFormat = CSmlDataStoreFormat::NewLC( iStringPool,
+	                                                            reader );
+	CleanupStack::Pop();
+	CleanupStack::PopAndDestroy( 2 ); // resourceFile, profileRes
+	_DBG_FILE("CNSmlAgendaDataStore:::DoOwnStoreFormatL(): END");
+	return dsFormat;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCommitCreateItemL
+// Commit item data to database when adding item.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCommitCreateItemL()
+    {
+    _DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL: BEGIN");
+    iState = ENSmlOpenAndWaiting; // iState set to closed to handle leave
+	CCalEntry::TReplicationStatus  replicationStatus;
+	
+	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 );
+	    }
+    else if ( iRXEntryType == ENSmlVCal )
+        {
+        _DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL: ImportVCalendarL");
+        iImporter->ImportVCalendarL( readStream, rdArray );
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
+		_DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL - \
+		           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::DoCommitCreateItemL - \
+		           Multiple items are not supported: END");
+        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 );
+    if ( err )
+        {
+        CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
+		_DBG_FILE("CNSmlAgendaDataStore::DoCommitCreateItemL - \
+		           Error at storing item to database: END");
+        User::Leave( KErrGeneral );
+        }
+
+    *iAddItemId = rdArray[0]->LocalUidL();
+    
+    CCalEntry* newEntry = iEntryView->FetchL( *iAddItemId );
+    
+    if( 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");
+    }
+    
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::DoCommitReplaceItemL
+// Commit item data to database when replacing item.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::DoCommitReplaceItemL()
+    {
+    _DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: 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 );
+	
+	// Export item from database depending on transmitted item entry type
+	if ( iTXEntryType == ENSmlVCal )
+	    {
+	    _DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: ExportVCalL");
+    	iExporter->ExportVCalL( *entry, writeStream );        
+    	}
+#ifdef __NSML_USE_ICAL_FEATURE
+	else if ( iTXEntryType == ENSmlICal )
+	    {
+	    _DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: ExportICalL");
+    	iExporter->ExportICalL( *entry, writeStream );
+	    }
+#endif // __NSML_USE_ICAL_FEATURE
+	else
+        {
+        CleanupStack::PopAndDestroy( 2 ); // entry, writeStream
+		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL - \
+		           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 );
+
+#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__
+
+   	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() );    
+	    }
+    else
+        {
+        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:" ) );
+
+#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 ) );
+
+	// Import item to database depending on received item entry type
+	if ( iRXEntryType == ENSmlVCal )
+        {
+		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: ImportVCalendarL");
+    	iImporter->ImportVCalendarL( readStream, rdArray );
+        }
+#ifdef __NSML_USE_ICAL_FEATURE
+	else if ( iRXEntryType == ENSmlICal )
+		{
+		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL: ImportICalendarL");
+		iImporter->ImportICalendarL( readStream, rdArray );
+		}
+#endif // __NSML_USE_ICAL_FEATURE
+    else
+        {
+        CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
+		_DBG_FILE("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");
+        User::Leave( KErrNotSupported );
+	    }
+	    
+	TInt 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 );
+    if ( err )
+        {
+        CleanupStack::PopAndDestroy( 2 ); // rdArray, readStream
+		_DBG_FILE("CNSmlAgendaDataStore::DoCommitReplaceItemL - \
+		           Error at storing item to database: END");
+        User::Leave( KErrGeneral );
+        }
+
+	CCalEntry::TReplicationStatus  replicationStatus;
+	
+	CCalEntry* replacedEntry = 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");
+    }
+    
+// -----------------------------------------------------------------------------
+// CNSmlAgendaDataStore::GetPropertiesFromDataL
+// Gets property from old item.
+// -----------------------------------------------------------------------------
+//
+void CNSmlAgendaDataStore::GetPropertiesFromDataL( CBufFlat* aOldItem,
+                                                   HBufC8*& aValue,
+	                                               const TDesC8& aProperty )
+    {
+    _DBG_FILE("CNSmlAgendaDataStore::GetPropertiesFromDataL(): begin");
+    
+    // Gemerate property that is searched (Linebreak + property + tokencolon)
+    HBufC8* startBuffer = HBufC8::NewLC( KVersitTokenCRLF().Size() +
+                                         aProperty.Length() );
+    TPtr8 startBufferPtr( startBuffer->Des() );
+	startBufferPtr.Append( KVersitTokenCRLF() );
+	startBufferPtr.Append( aProperty );
+	
+	// Get start position of property value
+	TInt startPos = aOldItem->Ptr( 0 ).Find( startBufferPtr );
+	
+	TInt endPos( KErrNotFound );
+	if ( startPos != KErrNotFound )
+	    {
+	    // startPos is before UID word
+	    startPos = startPos + KVersitTokenCRLF().Length();
+	    
+	    // End end position of property value
+	    endPos = startPos + 
+	             aOldItem->Ptr( startPos ).Find( KVersitTokenCRLF() );
+	    
+	    TPtrC8 tempPtr( aOldItem->Ptr( 0 ).Mid( endPos ) );
+	    
+	    // If next char after linebreak is ' ' or '=' then it is only
+	    // linebreak inside of value. This does not work with base64 coding!
+	    while ( tempPtr[KVersitTokenCRLF().Length()] == ' ' ||
+	            tempPtr[KVersitTokenCRLF().Length()] == '=' )
+	        {
+	        endPos = endPos + KVersitTokenCRLF().Length();
+	        TInt tempPos = aOldItem->Ptr( endPos ).Find( KVersitTokenCRLF() );
+	        endPos = endPos + tempPos;
+	        tempPtr.Set( aOldItem->Ptr( 0 ).Mid( endPos ) );
+	        }
+        
+        // Then cut value to value parameter
+        delete aValue;
+		aValue = NULL;
+		TInt length = endPos - startPos;
+		aValue = HBufC8::NewLC( length );
+		TPtr8 valuePtr( aValue->Des() );
+		aOldItem->Read( startPos, valuePtr, length );
+		CleanupStack::Pop( aValue ); // aValue
+	    }
+    CleanupStack::PopAndDestroy( startBuffer ); // startBuffer
+    
+    _DBG_FILE("CNSmlAgendaDataStore::GetPropertiesFromDataL(): end");
+    }
+  
+// -----------------------------------------------------------------------------
+// Adds property and it's value to new item.
+// This method also removes original property and it's value.
+// -----------------------------------------------------------------------------
+//  
+void CNSmlAgendaDataStore::SetPropertiesToDataL( HBufC8*& aValue,
+	                                             const TDesC8& aProperty )
+    {
+    _DBG_FILE("CNSmlAgendaDataStore::SetPropertiesToDataL(): begin");
+    
+    // Gemerate property that is searched (Linebreak + property + tokencolon)
+    HBufC8* startBuffer = HBufC8::NewLC( KVersitTokenCRLF().Size() +
+                                         aProperty.Length() );
+    TPtr8 startBufferPtr( startBuffer->Des() );
+	startBufferPtr.Append( KVersitTokenCRLF() );
+	startBufferPtr.Append( aProperty );
+	
+	// Get start position of property value
+	TInt startPos = iItemData->Ptr( 0 ).Find( startBufferPtr );
+	
+	TInt endPos( KErrNotFound );
+	if ( startPos != KErrNotFound )
+	    {
+	    // startPos is before UID word
+	    startPos = startPos + KVersitTokenCRLF().Length();
+	    
+	    // End end position of property value
+	    endPos = startPos + 
+	             iItemData->Ptr( startPos ).Find( KVersitTokenCRLF() );
+	    
+	    TPtrC8 tempPtr( iItemData->Ptr( 0 ).Mid( endPos ) );
+	    
+	    // If next char after linebreak is ' ' or '=' then it is only
+	    // linebreak inside of value. This does not work with base64 coding!
+	    while ( tempPtr[KVersitTokenCRLF().Length()] == ' ' ||
+	            tempPtr[KVersitTokenCRLF().Length()] == '=' )
+	        {
+	        endPos = endPos + KVersitTokenCRLF().Length();
+	        TInt tempPos = iItemData->Ptr( endPos ).Find( KVersitTokenCRLF() );
+	        endPos = endPos + tempPos;
+	        tempPtr.Set( iItemData->Ptr( 0 ).Mid( endPos ) );
+	        }
+        
+        // Delete original property and value
+        iItemData->Delete( startPos, endPos - startPos );
+        
+	    }
+
+    // Add property and new value from parameter.
+    // First find end of VEVENT or VTODO
+    
+    // Generate VEVENT END property
+    HBufC8* endVEvent = HBufC8::NewLC( KVersitTokenCRLF().Size() + 
+                                     KVersitTokenEND().Length() +
+                                     KVersitTokenColon().Length() +
+                                     KVersitVarTokenVEVENT().Length() );
+	TPtr8 endVEventPtr( endVEvent->Des() );
+	endVEventPtr.Append( KVersitTokenCRLF() );
+	endVEventPtr.Append( KVersitTokenEND() );
+	endVEventPtr.Append( KVersitTokenColon() );
+	endVEventPtr.Append( KVersitVarTokenVEVENT() );
+	
+	// Generate VTODO END property
+    HBufC8* endVTodo = HBufC8::NewLC( KVersitTokenCRLF().Size() + 
+                                     KVersitTokenEND().Length() +
+                                     KVersitTokenColon().Length() +
+                                     KVersitVarTokenVTODO().Length() );
+	TPtr8 endVTodoPtr( endVTodo->Des() );
+	endVTodoPtr.Append( KVersitTokenCRLF() );
+	endVTodoPtr.Append( KVersitTokenEND() );
+	endVTodoPtr.Append( KVersitTokenColon() );
+	endVTodoPtr.Append( KVersitVarTokenVTODO() );
+    
+    // Find end of VEVENT or VTODO
+    endPos = iItemData->Ptr( 0 ).Find( endVEventPtr );
+    if ( endPos == KErrNotFound )
+        {
+        endPos = iItemData->Ptr( 0 ).Find( endVTodoPtr );
+        if ( endPos == KErrNotFound )
+            {
+            User::Leave( KErrNotFound );
+            }
+        }
+
+    // Add property and value from parameter
+	iItemData->InsertL( endPos, KVersitTokenCRLF() );
+	iItemData->InsertL( endPos + KVersitTokenCRLF().Size(),
+	                    aValue->Des() );
+    iItemData->Compress();
+    
+    CleanupStack::PopAndDestroy( 3 ); // endVTodo, endVEvent, startBuffer
+    
+    _DBG_FILE("CNSmlAgendaDataStore::SetPropertiesToDataL(): end");
+    }
+	
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/agenda/src/nsmlagendaprogressview.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -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:  DS agenda progress view
+*
+*/
+
+
+
+// INCLUDES
+#include "nsmldebug.h"
+#include "nsmlagendadatastore.h"
+
+// ===================================== MEMBER FUNCTIONS ======================
+// -----------------------------------------------------------------------------
+// CNSmlAgendaProgressview::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+CNSmlAgendaProgressview* CNSmlAgendaProgressview::NewL()
+	{
+	_DBG_FILE("CNSmlAgendaProgressview::NewL(): BEGIN");
+	CNSmlAgendaProgressview* self = new (ELeave) CNSmlAgendaProgressview();
+	self->ConstructL();
+	_DBG_FILE("CNSmlAgendaProgressview::NewL(): END");
+	return self;
+	}
+	
+// -----------------------------------------------------------------------------
+// CNSmlAgendaProgressview::~CNSmlAgendaProgressview
+// Destructor.
+// -----------------------------------------------------------------------------
+CNSmlAgendaProgressview::~CNSmlAgendaProgressview()
+	{
+	_DBG_FILE("CNSmlAgendaProgressview::~CNSmlAgendaProgressview(): BEGIN");
+	// Nothing to do
+	_DBG_FILE("CNSmlAgendaProgressview::~CNSmlAgendaProgressview(): END");
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaProgressview::Progress
+// This calls the observing class with the percentage complete of the current
+// operation.
+// -----------------------------------------------------------------------------
+void CNSmlAgendaProgressview::Progress( TInt /*aPercentageCompleted*/ )
+	{
+	_DBG_FILE("CNSmlAgendaProgressview::Progress(): BEGIN");
+	_DBG_FILE("CNSmlAgendaProgressview::Progress(): END");
+	}
+	
+// -----------------------------------------------------------------------------
+// CNSmlAgendaProgressview::Completed
+// This calls the observing class when the current operation is finished.
+// -----------------------------------------------------------------------------
+void CNSmlAgendaProgressview::Completed( TInt aError )
+	{
+	_DBG_FILE("CNSmlAgendaProgressview::Completed(): BEGIN");
+
+    iCompletedStatus = aError;
+	CActiveScheduler::Stop();
+
+    _DBG_FILE("CNSmlAgendaProgressview::Completed(): END");
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaProgressview::GetCompletedStatus
+// This method returns status of Completed method (see above).
+// -----------------------------------------------------------------------------
+TInt CNSmlAgendaProgressview::GetCompletedStatus()
+    {
+    return iCompletedStatus;
+    }
+	
+// -----------------------------------------------------------------------------
+// CNSmlAgendaProgressview::NotifyProgress
+// Asks the observing class whether progress callbacks are required.
+// -----------------------------------------------------------------------------
+TBool CNSmlAgendaProgressview::NotifyProgress()
+	{
+	_DBG_FILE("CNSmlAgendaProgressview::NotifyProgress(): BEGIN");
+	_DBG_FILE("CNSmlAgendaProgressview::NotifyProgress(): END");
+	return EFalse;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlAgendaProgressview::CNSmlAgendaProgressview
+// C++ default constructor.
+// -----------------------------------------------------------------------------
+CNSmlAgendaProgressview::CNSmlAgendaProgressview() :
+	iCompletedStatus( KErrNotReady )
+	{
+	_DBG_FILE("CNSmlAgendaProgressview::CNSmlAgendaProgressview(): BEGIN");
+	// Nothing to do
+	_DBG_FILE("CNSmlAgendaProgressview::CNSmlAgendaProgressview(): END");
+	}
+	
+// -----------------------------------------------------------------------------
+// CNSmlAgendaProgressview::ConstructL
+// Second phase constructor.
+// -----------------------------------------------------------------------------
+void CNSmlAgendaProgressview::ConstructL()
+    {
+    _DBG_FILE("CNSmlAgendaProgressview::ConstructL(): BEGIN");
+    // Nothing to do
+    _DBG_FILE("CNSmlAgendaProgressview::ConstructL(): END");
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/bld/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* 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"
+* which accompanies 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 SyncML DS Plug In adapters
+*
+*/
+
+
+PRJ_EXPORTS
+
+#ifdef __SYNCML_DS_CON
+#include "../contacts/bld/bld.inf"
+#endif
+
+#ifdef  __SYNCML_DS_CAL
+#include "../agenda/bld/bld.inf"
+#endif
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/bld/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* 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 Contacts adapter
+*
+*/
+
+#include <platform_paths.hrh>
+PRJ_EXPORTS
+../loc/101F6DD6.loc		APP_LAYER_LOC_EXPORT_PATH(101F6DD6.loc)
+PRJ_MMPFILES
+./nsmldscontactsdataprovider.mmp
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/bld/def/eabicontactsdataprovideru.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,91 @@
+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
+	_ZN22CNSmlContactsDataStore6MergeLER8CBufBaseS1_i @ 43 NONAME
+	_ZN22CNSmlContactsDataStore7DoOpenLERK7TDesC16R20MSmlSyncRelationshipR14TRequestStatus @ 44 NONAME
+	_ZN22CNSmlContactsDataStore8StripTxLER8CBufBase @ 45 NONAME
+	_ZN22CNSmlContactsDataStoreC1Ev @ 46 NONAME
+	_ZN22CNSmlContactsDataStoreC2Ev @ 47 NONAME
+	_ZN22CNSmlContactsDataStoreD0Ev @ 48 NONAME
+	_ZN22CNSmlContactsDataStoreD1Ev @ 49 NONAME
+	_ZN22CNSmlContactsDataStoreD2Ev @ 50 NONAME
+	_ZN25CNSmlContactsDataProvider10ConstructLEv @ 51 NONAME
+	_ZN25CNSmlContactsDataProvider14DoListStoresLCEv @ 52 NONAME
+	_ZN25CNSmlContactsDataProvider14DoStoreFormatLEv @ 53 NONAME
+	_ZN25CNSmlContactsDataProvider15DoDefaultStoreLEv @ 54 NONAME
+	_ZN25CNSmlContactsDataProvider18DoOnFrameworkEventE18TSmlFrameworkEventii @ 55 NONAME
+	_ZN25CNSmlContactsDataProvider20DoNewStoreInstanceLCEv @ 56 NONAME
+	_ZN25CNSmlContactsDataProvider21DoCheckServerFiltersLER13RPointerArrayI13CSyncMLFilterER23TSyncMLFilterChangeInfo @ 57 NONAME
+	_ZN25CNSmlContactsDataProvider25DoSupportedServerFiltersLEv @ 58 NONAME
+	_ZN25CNSmlContactsDataProvider27DoGenerateFieldFilterQueryLERK13RPointerArrayI13CSyncMLFilterER6TDes16RS0_I16CSmlDataPropertyER7TDesC16 @ 59 NONAME
+	_ZN25CNSmlContactsDataProvider29DoGenerateRecordFilterQueryLCERK13RPointerArrayI13CSyncMLFilterE22TSyncMLFilterMatchTypeR6TDes16R17TSyncMLFilterTypeR7TDesC16 @ 60 NONAME
+	_ZN25CNSmlContactsDataProvider30DoCheckSupportedServerFiltersLERK19CSmlDataStoreFormatR13RPointerArrayI13CSyncMLFilterER23TSyncMLFilterChangeInfo @ 61 NONAME
+	_ZN25CNSmlContactsDataProvider4NewLEv @ 62 NONAME
+	_ZN25CNSmlContactsDataProvider5NewLCEv @ 63 NONAME
+	_ZN25CNSmlContactsDataProviderC1Ev @ 64 NONAME
+	_ZN25CNSmlContactsDataProviderC2Ev @ 65 NONAME
+	_ZN25CNSmlContactsDataProviderD0Ev @ 66 NONAME
+	_ZN25CNSmlContactsDataProviderD1Ev @ 67 NONAME
+	_ZN25CNSmlContactsDataProviderD2Ev @ 68 NONAME
+	_ZNK22CNSmlContactsDataStore11DoStoreNameEv @ 69 NONAME
+	_ZNK22CNSmlContactsDataStore12DoAddedItemsEv @ 70 NONAME
+	_ZNK22CNSmlContactsDataStore12DoMovedItemsEv @ 71 NONAME
+	_ZNK22CNSmlContactsDataStore14DoDeletedItemsEv @ 72 NONAME
+	_ZNK22CNSmlContactsDataStore14StripPropertyLERP6HBufC8RK6TDesC8 @ 73 NONAME
+	_ZNK22CNSmlContactsDataStore14StripPropertyLERP8CBufBaseRK6TDesC8 @ 74 NONAME
+	_ZNK22CNSmlContactsDataStore15DoMaxObjectSizeEv @ 75 NONAME
+	_ZNK22CNSmlContactsDataStore15DoModifiedItemsEv @ 76 NONAME
+	_ZNK22CNSmlContactsDataStore16DoHasSyncHistoryEv @ 77 NONAME
+	_ZNK22CNSmlContactsDataStore17DefaultStoreNameLEv @ 78 NONAME
+	_ZNK22CNSmlContactsDataStore18DoSoftDeletedItemsEv @ 79 NONAME
+	_ZNK22CNSmlContactsDataStore27GetStoreFormatResourceFileLEv @ 80 NONAME
+	_ZNK25CNSmlContactsDataProvider17CreateDataStoreLCEv @ 81 NONAME
+	_ZNK25CNSmlContactsDataProvider19DoSupportsOperationE4TUid @ 82 NONAME
+	_ZNK25CNSmlContactsDataProvider27GetStoreFormatResourceFileLEv @ 83 NONAME
+	_ZTI22CNSmlContactsDataStore @ 84 NONAME
+	_ZTI25CNSmlContactsDataProvider @ 85 NONAME
+	_ZTIN22CNSmlContactsDataStore23CNSmlContactsBufferItemE @ 86 NONAME
+	_ZTV22CNSmlContactsDataStore @ 87 NONAME
+	_ZTV25CNSmlContactsDataProvider @ 88 NONAME
+	_ZTVN22CNSmlContactsDataStore23CNSmlContactsBufferItemE @ 89 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/bld/nsmldscontactsdataprovider.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,72 @@
+/*
+* 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 contacts adapter
+*
+*/
+
+#include <platform_paths.hrh>
+#include <defaultcaps.hrh>
+#include <data_caging_paths.hrh>
+
+CAPABILITY CAP_ECOM_PLUGIN
+
+TARGET          nsmlcontactsdataprovider.dll
+TARGETPATH		PLUGINS_1_DIR
+TARGETTYPE      PLUGIN
+UID             0x10009D8D 0x101F6DDD
+VENDORID		VID_DEFAULT
+
+#if defined(ARMCC)
+DEFFILE		./def/eabicontactsdataprovider
+#elif defined(WINSCW)
+DEFFILE		./def/bwinscwcontactsdataprovider
+#endif
+
+SOURCEPATH      ../src
+SOURCE          NSmlContactsDataProvider.cpp
+SOURCE          NSmlContactsDataStore.cpp
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 	/epoc32/include/ecom
+SYSTEMINCLUDE 	/epoc32/include/syncml
+
+USERINCLUDE     ../inc ../../inc
+
+
+START RESOURCE 101F6DD6.rss
+HEADER
+TARGET 		nsmlcontactsdataprovider.rsc       
+TARGETPATH	ECOM_RESOURCE_DIR
+END 
+
+START RESOURCE NSmlContactsDataStoreFormat_1_1_2.rss
+HEADER
+TARGET 		NSmlContactsDataStoreFormat_1_1_2.rsc       
+TARGETPATH  RESOURCE_FILES_DIR 
+LANGUAGE_IDS
+END 
+
+START RESOURCE NSmlContactsDataStoreFormat_1_2.rss
+HEADER
+TARGET 		NSmlContactsDataStoreFormat_1_2.rsc       
+TARGETPATH  RESOURCE_FILES_DIR 
+LANGUAGE_IDS
+END 
+
+LIBRARY		ECom.lib bafl.lib euser.lib efsrv.lib estor.lib nsmldebug.lib sysutil.lib
+LIBRARY		nsmlchangefinder.lib cntmodel.lib wbxmllib.lib
+LIBRARY		nsmldatamod.lib smlstoreformat.lib smldataprovider.lib
+LIBRARY		nsmldshostclient.lib
+LIBRARY		nsmlcontactsdatastoreextension.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/inc/NSmlContactsDataProvider.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,159 @@
+/*
+* 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/omads/omadsextensions/adapters/contacts/inc/NSmlContactsDataStore.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,593 @@
+/*
+* 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);
+		    	
+        /**
+        * Merges two vCards
+        * @param aNewItem Received item. On return aNewItem contains merged item.
+        * @param aOldItem Item with which aNewItem is merged.
+        * @param aFieldLevel Merge using field level change 	
+        */
+    	IMPORT_C virtual void MergeL( CBufBase& aNewItem, CBufBase& aOldItem, TBool aFieldLevel = EFalse );
+
+        /**
+         * Strips data that is to be transmitted to the sync partner.
+         * @param aItem Item's data. On returns this data may have changed due 
+         *  to stripping.
+         */
+        IMPORT_C virtual void StripTxL( CBufBase& aItem );
+        
+        /**
+         * 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
+			};
+
+		// ------------------------------------------------------------------------------------------------
+		// 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;
+
+	private:
+		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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/loc/101F6DD6.loc	Fri Apr 16 14:53:26 2010 +0300
@@ -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:  Registery info for DS Contacts
+*
+*/
+
+
+//d:Display name for registry info 
+//l:list_setting_pane_t1
+//
+#define qtn_nsml_cnt_display_name "Contacts" 
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/sis/cnt_adapter.pkg	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,35 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: 
+;
+; Languages
+&EN
+
+; Package header
+#{"DataSync Contact Adapter"}, (0x101F6DDD), 1, 2, 0, TYPE=SA,RU
+
+; Vendor names
+%{"Nokia"}
+:"Nokia"
+
+"\epoc32\release\armv5\urel\nsmlsosserver.exe"-"c:\sys\bin\nsmlsosserver.exe"
+"\epoc32\release\armv5\urel\nsmldshostserver.dll"-"c:\sys\bin\nsmldshostserver.dll"
+
+"\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"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/src/101F6DD6.rss	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* 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 Contacts
+*
+*/
+
+
+#include <101F6DD6.loc>
+
+#include <registryinfo.rh>
+#include <nsmldsconstants.h>
+
+RESOURCE REGISTRY_INFO theRegistryInfo
+  {
+  dll_uid = 0x101F6DDD; // DS interface implementation UID
+  interfaces = 
+      {
+      INTERFACE_INFO
+          {
+          interface_uid = KNSmlDSInterfaceUid; // DS interface UID
+          implementations = 
+            {
+            IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x101F6DDD; // DS interface implementation UID
+                version_no = 1; 
+                display_name = qtn_nsml_cnt_display_name;
+                default_data = "";
+                opaque_data = "";
+                }
+            };
+          }
+      };
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataProvider.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,351 @@
+/*
+* 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
+*
+*/
+
+// INCLUDE FILES
+#include <utf.h>
+#include <e32base.h>
+#include <s32strm.h>
+#include <e32cmn.h>
+#include <sysutil.h>
+#include <barsc.h>
+#include <bautils.h>
+#include <SmlDataProvider.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 "nsmldebug.h"
+#include "nsmlconstants.h"
+#include "nsmldsimpluids.h"
+#include "nsmlchangefinder.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataProvider::NewL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlContactsDataProvider* CNSmlContactsDataProvider::NewL()
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::NewL(): begin");
+	CNSmlContactsDataProvider* self = NewLC();
+	CleanupStack::Pop();
+	_DBG_FILE("CNSmlContactsDataProvider::NewL(): end");
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataProvider::NewLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlContactsDataProvider* CNSmlContactsDataProvider::NewLC()
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::NewLC(): begin");
+	
+	CNSmlContactsDataProvider* self = new (ELeave) CNSmlContactsDataProvider();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	_DBG_FILE("CNSmlContactsDataProvider::NewLC(): end");
+	return self;
+	}
+	
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataProvider::CNSmlContactsDataProvider
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlContactsDataProvider::CNSmlContactsDataProvider()
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::CNSmlContactsDataProvider(): begin");
+	_DBG_FILE("CNSmlContactsDataProvider::CNSmlContactsDataProvider(): end");
+	}
+	
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataProvider::ConstructL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlContactsDataProvider::ConstructL()
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::ConstructL(): begin");
+	
+	User::LeaveIfError( iRfs.Connect() );
+
+	iContactsDataStore = CreateDataStoreLC(); 
+	CleanupStack::Pop( iContactsDataStore );
+	iStringPool.OpenL();
+	
+	_DBG_FILE("CNSmlContactsDataProvider::ConstructL(): end");
+	}
+	
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataProvider::~CNSmlContactsDataProvider
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlContactsDataProvider::~CNSmlContactsDataProvider()
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::~CNSmlContactsDataProvider(): begin");
+
+	iRfs.Close();
+
+	delete iContactsDataStore;
+	delete iStoreFormat;
+	iFilterArray.ResetAndDestroy();
+	iFilterArray.Close();
+
+	iStringPool.Close();
+
+	_DBG_FILE("CNSmlContactsDataProvider::~CNSmlContactsDataProvider(): end");
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataProvider::DoOnFrameworkEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlContactsDataProvider::DoOnFrameworkEvent( TSmlFrameworkEvent /*aFrameworkEvent*/, TInt /*aParam1*/, TInt /*aParam2*/ )
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::DoOnFrameworkEvent(): begin");
+	_DBG_FILE("CNSmlContactsDataProvider::DoOnFrameworkEvent(): end");
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataProvider::DoSupportsOperation
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CNSmlContactsDataProvider::DoSupportsOperation( TUid aOpId ) const
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::DoSupportsOperation(): begin");
+
+	if ( aOpId == KUidSmlSupportBatch ||
+	     aOpId == KUidSmlSupportMultipleStores )
+		{
+		return ETrue;
+		}
+
+	_DBG_FILE("CNSmlContactsDataProvider::DoSupportsOperation(): end");
+
+	return EFalse; // KUidSmlSupportTransaction ,KUidSmlSupportSuspendResume, KUidSmlSupportUserSelectableMatchType
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataProvider::DoStoreFormatL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const CSmlDataStoreFormat& CNSmlContactsDataProvider::DoStoreFormatL()
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::DoStoreFormatL(): begin");
+	
+	delete iStoreFormat;
+	iStoreFormat = NULL;
+	
+	TFileName fileName;
+	TParse parse;
+	
+	// Locate the resource file
+	TFileName dllFileName;
+	Dll::FileName( dllFileName );
+    
+	TFileName resourceFileName;
+	resourceFileName.Copy( TParsePtrC( dllFileName ).Drive() );  
+
+	parse.Set( GetStoreFormatResourceFileL(), &KDC_RESOURCE_FILES_DIR, NULL );
+
+	fileName = parse.FullName();
+
+	RResourceFile resourceFile; 
+	BaflUtils::NearestLanguageFile( iRfs, fileName );
+
+	resourceFile.OpenL( iRfs,fileName );
+	CleanupClosePushL( resourceFile );
+	
+	HBufC8* contactsDataFormat = resourceFile.AllocReadLC( NSML_CONTACTS_DATA_STORE_FORMAT );
+
+	TResourceReader reader;
+	reader.SetBuffer( contactsDataFormat );
+
+	iStoreFormat = CSmlDataStoreFormat::NewLC( iStringPool, reader );
+	CleanupStack::Pop(); // iStoreFormat
+	
+	CleanupStack::PopAndDestroy( 2 ); // contactsDataFormat,resourceFile  
+	
+	_DBG_FILE("CNSmlContactsDataProvider::DoStoreFormatL(): end");
+
+	return *iStoreFormat;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataProvider::DoListStoresLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CDesCArray* CNSmlContactsDataProvider::DoListStoresLC()
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::DoListStoresLC(): begin");
+	_DBG_FILE("CNSmlContactsDataProvider::DoListStoresLC(): end");
+	
+	return iContactsDataStore->DoListStoresLC();
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataProvider::DoDefaultStoreL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TDesC& CNSmlContactsDataProvider::DoDefaultStoreL()
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::DoIdentifier(): begin");
+	_DBG_FILE("CNSmlContactsDataProvider::DoIdentifier(): end");
+
+	return iContactsDataStore->DefaultStoreNameL();
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlContactsDataProvider::DoNewStoreInstanceLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CSmlDataStore* CNSmlContactsDataProvider::DoNewStoreInstanceLC()
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::DoNewStoreInstanceLC(): begin");
+
+	CNSmlContactsDataStore* newDataStore = CreateDataStoreLC();
+
+	_DBG_FILE("CNSmlContactsDataProvider::DoNewStoreInstanceLC(): end");
+
+	return newDataStore;
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataProvider::DoSupportedServerFiltersL
+// 
+// ------------------------------------------------------------------------------------------------
+EXPORT_C const RPointerArray<CSyncMLFilter>& CNSmlContactsDataProvider::DoSupportedServerFiltersL()
+	{
+	// This method returns empty array. It means that this Data Provider does not support filtering
+	_DBG_FILE("CNSmlContactsDataProvider::DoSupportedServerFiltersL(): BEGIN");
+	_DBG_FILE("CNSmlContactsDataProvider::DoSupportedServerFiltersL(): END");
+	return iFilterArray;
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL
+// 
+// ------------------------------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL( const CSmlDataStoreFormat& /*aServerDataStoreFormat*/, RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL(): BEGIN");
+	User::Leave( KErrNotSupported );
+	_DBG_FILE("CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL(): END");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataProvider::CheckServerFiltersL
+// 
+// ------------------------------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataProvider::DoCheckServerFiltersL( RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::DoCheckServerFiltersL(): BEGIN");
+	User::Leave( KErrNotSupported );
+	_DBG_FILE("CNSmlContactsDataProvider::DoCheckServerFiltersL(): END");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataProvider::DoGenerateRecordFilterQueryLC
+// 
+// ------------------------------------------------------------------------------------------------
+EXPORT_C HBufC* CNSmlContactsDataProvider::DoGenerateRecordFilterQueryLC( const RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterMatchType /*aMatch*/, TDes& /*aFilterMimeType*/, TSyncMLFilterType& /*aFilterType*/, TDesC& /*aStoreName*/ )
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::DoGenerateRecordFilterQueryLC(): BEGIN");
+	User::Leave( KErrNotSupported );
+	_DBG_FILE("CNSmlContactsDataProvider::DoGenerateRecordFilterQueryLC(): END");
+	return NULL;
+	}
+	
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataProvider::DoGenerateFieldFilterQueryL
+// 
+// ------------------------------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataProvider::DoGenerateFieldFilterQueryL( const RPointerArray<CSyncMLFilter>& /*aFilters*/, TDes& /*aFilterMimeType*/, RPointerArray<CSmlDataProperty>& /*aProperties*/, TDesC& /*aStoreName*/ )
+	{
+	_DBG_FILE("CNSmlContactsDataProvider::DoGenerateFieldFilterQueryL(): BEGIN");
+	User::Leave( KErrNotSupported );
+	_DBG_FILE("CNSmlContactsDataProvider::DoGenerateFieldFilterQueryL(): END");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataProvider::GetStoreFormatResourceFileL
+// 
+// ------------------------------------------------------------------------------------------------
+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(): END");
+	    return KNSmlContactsStoreFormatRsc_1_1_2;
+	    }
+	else // error or protocol version 1.2 
+	    {
+        _DBG_FILE("CNSmlContactsDataProvider::GetStoreFormatResourceFileL(): END");
+	    return KNSmlContactsStoreFormatRsc_1_2;
+	    }
+    }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataProvider::CreateDataStoreLC
+// 
+// ------------------------------------------------------------------------------------------------
+EXPORT_C CNSmlContactsDataStore* CNSmlContactsDataProvider::CreateDataStoreLC() const
+    {
+    _DBG_FILE("CNSmlContactsDataProvider::CreateDataStoreLC(): BEGIN");    
+    CNSmlContactsDataStore* dataStore = CNSmlContactsDataStore::NewL();
+    CleanupStack::PushL( dataStore );
+    _DBG_FILE("CNSmlContactsDataProvider::CreateDataStoreLC(): END");
+    return dataStore;
+    }
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy array
+// -----------------------------------------------------------------------------
+//
+#ifndef IMPLEMENTATION_PROXY_ENTRY
+#define IMPLEMENTATION_PROXY_ENTRY( aUid, aFuncPtr ) {{aUid},(aFuncPtr)}
+#endif
+
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY( KNSmlContactsAdapterImplUid, CNSmlContactsDataProvider::NewL )
+    };
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+    {
+	_DBG_FILE("ImplementationGroupProxy() for CNSmlContactsDataProvider: begin");
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+	_DBG_FILE("ImplementationGroupProxy() for CNSmlContactsDataProvider: end");
+    return ImplementationTable;
+	}
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStore.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,2124 @@
+/*
+* 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 dataprovider
+*
+*/
+
+
+// INCLUDE FILES
+#include <barsc.h>
+#include <bautils.h>
+#include <e32base.h>
+#include <s32strm.h>
+#include <e32cmn.h>
+#include <e32des16.h>
+#include <s32mem.h>
+#include <implementationproxy.h>
+#include <vtoken.h>
+#include <sysutil.h>
+#include <NSmlContactsDataStoreFormat_1_1_2.rsg>
+#include <NSmlContactsDataStoreFormat_1_2.rsg>
+#include <data_caging_path_literals.hrh>
+#include <SmlDataFormat.h>
+#include <SmlDataProvider.h>
+#include <e32property.h>
+#include <DataSyncInternalPSKeys.h>
+#include <nsmlcontactsdatastoreextension.h>
+#include <NSmlDataModBase.h>
+#include "NSmlContactsDataStore.h"
+#include "nsmldebug.h"
+#include "nsmlconstants.h"
+#include "nsmldsimpluids.h"
+#include "nsmlsnapshotitem.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
+
+
+// ----------------------------------------------------------------------------
+// CNSmlContactsDataStore::CNSmlContactsBufferItem::~CNSmlContactsBufferItem
+// ----------------------------------------------------------------------------
+EXPORT_C CNSmlContactsDataStore::CNSmlContactsBufferItem::~CNSmlContactsBufferItem()
+	{
+	delete iItemData;
+	delete iMimeType;
+	delete iMimeVersion;
+	}
+	
+// ----------------------------------------------------------------------------
+// CNSmlContactsDataStore::NewL
+// ----------------------------------------------------------------------------
+EXPORT_C CNSmlContactsDataStore* CNSmlContactsDataStore::NewL()
+	{
+	_DBG_FILE("CNSmlContactsDataStore::NewL: BEGIN");
+	CNSmlContactsDataStore* self = new ( ELeave ) CNSmlContactsDataStore();
+	CleanupStack::PushL(self);
+		
+	self->ConstructL();
+	CleanupStack::Pop(); // self
+		
+	_DBG_FILE("CNSmlContactsDataStore::NewL: END");
+	return self;
+	}
+
+// ----------------------------------------------------------------------------
+// CNSmlContactsDataStore::CNSmlContactsDataStore() 
+// ----------------------------------------------------------------------------
+EXPORT_C CNSmlContactsDataStore::CNSmlContactsDataStore() : iKey( TKeyArrayFix( _FOFF( TNSmlSnapshotItem,ItemId() ),ECmpTInt ))
+	{
+	_DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): begin");
+	iSyncHistory = EFalse;
+	iSnapshotRegistered = EFalse;
+
+	iServerMaxObjectSize = 0; // Maximum size default value
+	iItemPos = -1;
+	iModificationCount = KNSmlCompactAfterChanges;
+	
+	iState = ENSmlClosed;
+	iStoreName = NULL;
+	
+	_DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): end");
+	}
+	
+// ----------------------------------------------------------------------------
+// CNSmlContactsDataStore::ConstructL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::ConstructL()
+	{
+	_DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): begin");
+	ConstructL( KNSmlContactStoreNameForDefaultDB );		
+	_DBG_FILE("CNSmlContactsDataStore::ConstructL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// CNSmlContactsDataStore::ConstructL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::ConstructL( const TDesC& aStoreName )
+    {
+    _DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): begin");
+    
+    //TODO: NOT RESPECTING THE aStoreName VALUE FOR 10.1
+    
+    User::LeaveIfError( iRfs.Connect() );
+    
+    iStringPool.OpenL();
+    
+    // Uid Sets
+    iNewUids = new (ELeave) CNSmlDataItemUidSet();
+    iDeletedUids = new (ELeave) CNSmlDataItemUidSet();
+    iSoftDeletedUids = new (ELeave) CNSmlDataItemUidSet();
+    iMovedUids = new (ELeave) CNSmlDataItemUidSet();
+    iReplacedUids = new (ELeave) CNSmlDataItemUidSet();
+
+    // Create iDataMod
+    // This should be done after OpenL if there are more than one database
+    iDataMod = new (ELeave) CNSmlVCardMod();
+    iContactsDataStoreExtension = NULL;
+
+    SetOwnStoreFormatL();
+    
+    // TODO: Determine the Default StoreName
+    iDefaultStoreName = HBufC::NewL(KNSmlDefaultStoreNameMaxSize);
+    *iDefaultStoreName = KNSmlContactStoreNameForDefaultDB;
+    
+    iSnapshot = new (ELeave) CArrayFixSeg<TNSmlSnapshotItem>(KNSmlContactsGranularity);
+    iCntUidList = new(ELeave) CArrayFixFlat<TUid>(KNSmlContactsGranularity);
+        
+    _DBG_FILE("CNSmlContactsDataStore::ConstructL(): end");
+    }
+
+// ----------------------------------------------------------------------------
+// CNSmlContactsDataStore::~CNSmlContactsDataStore()
+// ----------------------------------------------------------------------------
+EXPORT_C CNSmlContactsDataStore::~CNSmlContactsDataStore()
+	{
+	_DBG_FILE("CNSmlContactsDataStore::~CNSmlContactsDataStore(): begin");
+	
+	delete iStoreFormat; // SetOwnStoreFormatL creates
+	iStringPool.Close();
+
+	iRfs.Close();
+	if ( iChangeFinder )
+		{
+		TRAP_IGNORE( iChangeFinder->CloseL() );
+		delete iChangeFinder;
+		}
+	
+	if( iContactsDataStoreExtension )
+	    {
+        delete iContactsDataStoreExtension;
+        iContactsDataStoreExtension = NULL;
+	    }
+	
+	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;
+      }
+  }
+	iContactsBufferItemList.ResetAndDestroy();
+	
+	delete iDataMod;
+	
+	if(iItemData)
+    	{
+	    if(iItemData->Size() > 0 )
+	        {
+		    delete iItemData;       
+	        }
+	    }
+	
+	if(iItemDataAddBatch != iItemData)
+		{
+		delete iItemDataAddBatch;	
+		}
+		
+	delete iDefaultStoreName;
+
+	delete iStoreName;
+
+	iAddResultArray.Close();
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoOpenL(const TDesC& 		  aStoreName, 
+//									    MSmlSyncRelationship& aContext,
+//									    TRequestStatus& 	  aStatus)
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoOpenL( const TDesC& aStoreName, 
+                                               MSmlSyncRelationship& aContext, 
+                                               TRequestStatus& aStatus )
+	{
+	DBG_ARGS(_S("CNSmlContactsDataStore::DoOpenL(): '%S' begin"), &aStoreName);
+
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	
+	if( iState != ENSmlClosed )
+		{
+		User::RequestComplete( iCallerStatus, KErrInUse );	
+		return;	
+		}
+
+	if( RFs::CharToDrive(aStoreName[0], iDrive) != KErrNone )
+		{
+		RFs::CharToDrive( KNSmlDriveC()[0], iDrive );
+		}
+	iOpened = EFalse;
+	
+	if( iStoreName )
+		{
+		delete iStoreName;
+		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 )
+		{
+		iChangeFinder->CloseL();
+		delete iChangeFinder;
+		iChangeFinder = NULL;
+		}
+	iChangeFinder = CNSmlChangeFinder::NewL( aContext, iKey, iSyncHistory, KNSmlContactsAdapterImplUid );
+
+	iState = ENSmlOpenAndWaiting;		
+	
+	err = FetchModificationsL();
+	
+	DBG_ARGS(_S("CNSmlContactsDataStore::DoOpenL(): Error: %d"), err);
+	
+	User::RequestComplete( iCallerStatus, err );
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoOpenL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoCancelRequest()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoCancelRequest()
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoCancelRequest(): begin");
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoCancelRequest(): NOT NEEDED end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoStoreName()
+// ----------------------------------------------------------------------------
+EXPORT_C const TDesC& CNSmlContactsDataStore::DoStoreName() const
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoStoreName(): begin");
+	_DBG_FILE("CNSmlContactsDataStore::DoStoreName(): end");
+	return *iStoreName;
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DefaultStoreNameL()
+// ----------------------------------------------------------------------------
+EXPORT_C const TDesC& CNSmlContactsDataStore::DefaultStoreNameL() const
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DefaultStoreNameL(): begin");
+
+	if ( !iDefaultStoreName )
+		{
+		return KNullDesC;
+		}
+
+	_DBG_FILE("CNSmlContactsDataStore::DefaultStoreNameL(): end");
+	return *iDefaultStoreName;
+	}
+	
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoBeginTransactionL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoBeginTransactionL()
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoBeginTransactionL(): begin");
+	User::Leave( KErrNotSupported );
+	_DBG_FILE("CNSmlContactsDataStore::DoBeginTransactionL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoCommitTransactionL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoCommitTransactionL(TRequestStatus& aStatus)
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoCommitTransactionL(): begin");
+	
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	User::RequestComplete( iCallerStatus, KErrNotSupported );
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoCommitTransactionL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoRevertTransaction()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoRevertTransaction(TRequestStatus& aStatus)
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoRevertTransaction(): begin");
+	
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	User::RequestComplete( iCallerStatus, KErrNotSupported );
+
+	_DBG_FILE("CNSmlContactsDataStore::DoRevertTransaction(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoBeginBatchL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoBeginBatchL()
+	{
+	_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 )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoCommitBatchL(): begin");
+
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	
+	if( !iBatchMode )
+		{
+		User::RequestComplete( iCallerStatus, KErrNotReady );
+		_DBG_FILE("CNSmlContactsDataStore::DoCommitBatchL(): NOT ON BATCH MODE end");
+		return;
+		}
+//		
+// 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) );
+	
+	if( leavecode != KErrNone )
+		{
+		err = 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 );
+    }
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoCancelBatch()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoCancelBatch()
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoCancelBatch(): begin");
+	if( iBatchMode )
+		{
+		iBatchMode = EFalse;
+	//
+	//	Empty BufferItemList if any
+	//
+		iContactsBufferItemList.ResetAndDestroy();
+		iItemData = NULL;
+		}
+
+	_DBG_FILE("CNSmlContactsDataStore::DoCancelBatch(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoSetRemoteStoreFormatL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoSetRemoteStoreFormatL( const CSmlDataStoreFormat& aServerDataStoreFormat )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::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 )
+		{
+		_DBG_FILE("CNSmlContactsDataStore::DoSetRemoteStoreFormatL(): SERVER MIMETYPE NOTSUPPORTED end");
+		User::Leave( KErrNotSupported );
+		}
+		
+	iDataMod->SetPartnerStoreFormat( (CSmlDataStoreFormat&) aServerDataStoreFormat );
+	
+	SetOwnStoreFormatL();
+			
+	TInt error = iDataMod->SetUsedMimeType( iServerMimeType, iServerMimeVersion );
+	
+	User::LeaveIfError( error );
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoSetRemoteStoreFormatL(): end");
+	return;
+	}
+	
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::SetOwnStoreFormatL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::SetOwnStoreFormatL()
+	{
+	_DBG_FILE("CNSmlContactsDataStore::SetOwnStoreFormatL(): begin");
+	
+	if( !iStoreFormat )
+		{
+		TFileName fileName;
+		TParse parse;
+
+	    parse.Set( GetStoreFormatResourceFileL(), &KDC_RESOURCE_FILES_DIR, NULL  );		
+
+		fileName = parse.FullName();
+
+		RResourceFile resourceFile; 
+		BaflUtils::NearestLanguageFile( iRfs, fileName );
+
+		resourceFile.OpenL( iRfs, fileName );
+		CleanupClosePushL( resourceFile );
+		
+		HBufC8* contactsDataFormat = resourceFile.AllocReadLC( NSML_CONTACTS_DATA_STORE_FORMAT );
+
+		TResourceReader reader;
+		reader.SetBuffer( contactsDataFormat );
+
+		iStoreFormat = CSmlDataStoreFormat::NewLC( iStringPool, reader );
+		CleanupStack::Pop(); // iStoreFormat
+		
+		CleanupStack::PopAndDestroy(2); // contactsDataFormat, resourceFile  
+		}
+		
+	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.
+    iUsedMimeType.Set( iStoreFormat->MimeFormat(0).MimeType().DesC() );
+    iUsedMimeVersion.Set( iStoreFormat->MimeFormat(0).MimeVersion().DesC() );
+	
+	_DBG_FILE("CNSmlContactsDataStore::SetOwnStoreFormatL(): end");
+	return;
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoSetRemoteMaxObjectSize()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoSetRemoteMaxObjectSize( TInt aServerMaxObjectSize )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoSetRemoteMaxObjectSize(): begin");
+	
+	iServerMaxObjectSize = aServerMaxObjectSize;
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoSetRemoteMaxObjectSize(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoMaxObjectSize()
+// ----------------------------------------------------------------------------
+EXPORT_C TInt CNSmlContactsDataStore::DoMaxObjectSize() const
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoMaxObjectSize(): begin");
+	_DBG_FILE("CNSmlContactsDataStore::DoMaxObjectSize() 100 k: end");
+	return KNSmlDataStoreMaxSize;  // 100 k
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoOpenItemL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoOpenItemL( TSmlDbItemUid aUid, 
+										  TBool& aFieldChange, 
+										  TInt& aSize, 
+										  TSmlDbItemUid& aParent, 
+										  TDes8& aMimeType, 
+										  TDes8& aMimeVer, 
+										  TRequestStatus& aStatus )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoOpenItemL(): begin");
+
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	
+	if ( iState != ENSmlOpenAndWaiting )
+		{
+		User::RequestComplete( iCallerStatus, KErrNotReady );
+		return;
+		}
+		
+	iItemPos = 0;
+	
+	aFieldChange = EFalse; // Whole item sent NOT SUPPORT ON FIELDCHANGE
+	
+	aMimeType    = iStoreFormat->MimeFormat( 0 ).MimeType().DesC();
+	aMimeVer	 = iStoreFormat->MimeFormat( 0 ).MimeVersion().DesC();
+	aParent      = KNullDataItemId;
+	
+	iModType = ENSmlCntItemRead;
+	
+	if( !iItemData )
+		{
+		iItemData= CBufFlat::NewL( KNSmlItemDataExpandSize );
+		}
+	else
+		{
+		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 );
+		}
+
+	_DBG_FILE("CNSmlContactsDataStore::DoOpenItemL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoCreateItemL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoCreateItemL( TSmlDbItemUid& aUid, 
+											TInt aSize, 
+											TSmlDbItemUid /*aParent*/, 
+											const TDesC8& aMimeType, 
+											const TDesC8& aMimeVer, 
+											TRequestStatus& aStatus )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL(): begin");
+
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	
+	TInt err = KErrNone;
+	
+	if ( iState != ENSmlOpenAndWaiting )
+		{
+		User::RequestComplete( iCallerStatus, KErrNotReady );
+		_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL - KErrNotReady: END");
+		return;
+		}
+		
+	iItemSize = aSize; // Size sent from server
+	iModType  = ENSmlCntItemAdd;
+	
+	iMimeTypeItem.Set( aMimeType );
+	iMimeVersionItem.Set( aMimeVer );
+	
+	if ( iItemPos == -1 || !iBatchMode )
+		{
+		iItemPos = 0;
+		}
+	
+	
+	if( iItemData )
+		{
+		iItemData->Reset();
+		}
+		
+	if( !iItemDataAddBatch )
+		{
+		iItemDataAddBatch= CBufFlat::NewL( KNSmlItemDataExpandSize );
+		}
+		
+	// Check MimeType and MimeVersion
+	if( ( aMimeType.MatchF( KNSmlvCard21Name ) < 0 ) &&
+	    ( aMimeType.MatchF( KNSmlvCard30Name ) < 0 ) &&
+	    // Allow using custom MIME type defined in store format resource file
+	    ( aMimeType.MatchF( iUsedMimeType ) < 0 ) )
+		{
+		User::RequestComplete( iCallerStatus, KErrNotSupported );
+		_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL - KErrNotSupported: END");
+		return;
+		}
+    
+    // Is there enough space on drive ?
+	if( DriveBelowCriticalLevelL( aSize ) )
+		{
+		err = KErrDiskFull;
+		}
+				
+	iItemData = AddBufferListL( aUid,aSize, err );
+	
+	if( iBatchMode )
+		{
+		iState = ENSmlItemCreating;
+		User::RequestComplete( iCallerStatus, KErrNone );
+		_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL(): begin BATCH");
+		return ; // Put into buffer
+		}
+				
+	if ( err == KErrNone )
+		{
+		iState = ENSmlItemCreating;
+		}
+	
+	User::RequestComplete( iCallerStatus, err );
+
+	_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoReplaceItemL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoReplaceItemL( TSmlDbItemUid aUid, 
+											 TInt aSize, 
+											 TSmlDbItemUid /*aParent*/, 
+											 TBool aFieldChange, 
+											 TRequestStatus& aStatus )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoReplaceItemL(): begin");
+
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	
+	TInt err = KErrNone;
+			
+	iUid      = aUid;
+	iItemSize = aSize;
+	iModType  = aFieldChange ? ENSmlCntItemFieldLevelReplace : ENSmlCntItemReplace;
+	
+	if ( iItemPos == -1 || !iBatchMode )
+		{
+		iItemPos = 0;
+		}
+	
+	if ( iItemData )
+		{
+		iItemData->Reset();
+		}
+		
+	iFieldLevelReplace = aFieldChange;
+	
+	iItemData = AddBufferListL( aUid, aSize, err );
+	
+	if( iBatchMode )
+		{
+		iState = ENSmlItemUpdating;
+		_DBG_FILE("CNSmlContactsDataStore::DoReplaceItemL(): BATCHMODE end");
+		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 = iContactsDataStoreExtension->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;
+	    }
+	
+	User::RequestComplete( iCallerStatus, err );
+		
+	_DBG_FILE("CNSmlContactsDataStore::DoReplaceItemL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoReadItemL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoReadItemL( TDes8& aBuffer )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoReadItemL(): begin");
+    if ( iState != ENSmlItemOpen || !iItemData )
+        {
+        iItemPos = -1;
+        User::Leave( KErrNotReady );
+        }
+
+    if ( iItemPos == -1 )
+        {
+        User::Leave( KErrEof );
+        }
+
+    if ( aBuffer.Size() < iItemData->Size() - iItemPos )
+        {
+        iItemData->Read( iItemPos, aBuffer );
+        iItemPos += aBuffer.Size();
+        }
+    else
+        {
+        iItemData->Read( iItemPos, aBuffer, iItemData->Size() - iItemPos );
+        iItemPos = -1;
+        }	
+	_DBG_FILE("CNSmlContactsDataStore::DoReadItemL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoWriteItemL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoWriteItemL( const TDesC8& aData )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoWriteItemL(): begin");
+
+	/* Data must be accumulated from pieces of information */
+	if ( iState == ENSmlItemCreating || iState == ENSmlItemUpdating )
+		{
+		if ( iItemData )
+			{
+			if ( iItemPos == -1 )
+				{
+            	iStateItem = KErrEof;
+            	if( iBatchMode )
+            		{
+            		return;
+            		}
+				User::Leave( KErrEof );
+				}
+			iItemData->InsertL( iItemData->Size(), aData );
+			iItemPos += aData.Size();
+			
+			if ( aData.Size() > iItemSize )
+				{
+				iState =     ENSmlItemOverflow;
+            	iStateItem = KErrOverflow;
+            	_DBG_FILE("CNSmlContactsDataStore::DoWriteItemL(): KErrOverflow End");
+        		DBG_ARGS(_S("CNSmlContactsDataStore::DoWriteItemL(): Server sent=(%d) Item=(%d)"),
+        		            iItemSize, aData.Size()); 
+            	if( iBatchMode )
+            		{
+            		return;
+            		}
+				User::Leave( KErrOverflow );				
+				}
+			if ( aData.Size() == iItemSize )
+			    {
+            	iStateItem = KErrNone;
+			    }
+			return;
+			}
+		}
+		
+	iStateItem = KErrNotReady;
+
+	if( iBatchMode )
+		{
+       	_DBG_FILE("CNSmlContactsDataStore::DoWriteItemL(): KErrNotReady End");
+		return;
+		}
+		
+	User::Leave( KErrNotReady );
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoWriteItemL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoCommitItemL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoCommitItemL( TRequestStatus& aStatus )
+	{
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoCommitItemL(): begin");
+		
+	// Data OK => insert to total buffer
+	if (iModType   == ENSmlCntItemAdd && 
+      	iStateItem == KErrNone )
+	    {
+	    iItemDataAddBatch->InsertL( iItemDataAddBatch->Size(),iItemData->Ptr(0), iItemData->Size() );
+	    iItemDataAddBatch->InsertL( iItemDataAddBatch->Size(), KVersitTokenCRLF() );
+      	if( iContactsBufferItemList.Count() > 0 )
+      	    {
+            iContactsBufferItemList[iContactsBufferItemList.Count()-1]->iStatus  = KNSmlNoError; 
+      	    }
+	    }
+	 else if ((iModType   == ENSmlCntItemAdd ||         // If some write problems
+      	       iModType   == ENSmlCntItemReplace ||
+      	       iModType   == ENSmlCntItemFieldLevelReplace ) && 
+      	       iStateItem != KErrNone &&
+      	       iContactsBufferItemList.Count() > 0) 
+	    {
+        iContactsBufferItemList[iContactsBufferItemList.Count()-1]->iStatus  = iStateItem; 
+	    }
+	
+	if( iBatchMode )
+		{
+		iItemData = NULL;
+		iState = ENSmlOpenAndWaiting;
+		User::RequestComplete( iCallerStatus, KErrNone );
+		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();
+		}
+	
+	iItemData = NULL;
+	iState = ENSmlOpenAndWaiting;
+	
+	User::RequestComplete( iCallerStatus, err );
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoCommitItemL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoCloseItem()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoCloseItem()
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoCloseItem(): begin");
+
+	if ( iState == ENSmlItemOpen )
+		{
+		iItemPos = -1;
+		if ( iItemData )
+			{
+			delete iItemData;
+			iItemData = NULL;
+			}
+		iState = ENSmlOpenAndWaiting;
+		}
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoCloseItem(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoMoveItemL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoMoveItemL( TSmlDbItemUid aUid, TSmlDbItemUid /*aNewParent*/, TRequestStatus& aStatus )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoMoveItemL(): begin");
+	
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	
+	if( iBatchMode )
+		{
+		iModType = ENSmlCntItemMove;
+		TInt fSize = 0;
+		AddBufferListL( aUid, fSize, KErrNotSupported );	
+		User::RequestComplete( iCallerStatus, KErrNone );
+		return;
+		}
+	User::RequestComplete( iCallerStatus, KErrNotSupported );
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoMoveItemL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoDeleteItemL()
+// ----------------------------------------------------------------------------
+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( iContactsDataStoreExtension->DeleteContactL( TUid::Uid(aUid) ) )
+		{
+        iChangeFinder->ItemDeleted( TNSmlSnapshotItem( aUid ) );
+		}
+	else
+	    {
+        err = KErrGeneral;
+	    }
+		
+	User::RequestComplete( iCallerStatus, err );
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoDeleteItemL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoSoftDeleteItemL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoSoftDeleteItemL( TSmlDbItemUid /*aUid*/, TRequestStatus& aStatus )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoSoftDeleteItemL(): begin");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	User::RequestComplete( iCallerStatus, KErrNotSupported );
+	_DBG_FILE("CNSmlContactsDataStore::DoSoftDeleteItemL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoDeleteAllItemsL()
+// ----------------------------------------------------------------------------
+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 );
+	    }
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoDeleteAllItemsL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// TBool CNSmlContactsDataStore::DoHasSyncHistory()
+// ----------------------------------------------------------------------------
+EXPORT_C TBool CNSmlContactsDataStore::DoHasSyncHistory() const
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoHasSyncHistory(): begin");
+	
+	TBool doHasSyncHistory = EFalse;
+	
+	if( !iOpened ) 
+		{
+		_DBG_FILE("CNSmlContactsDataStore::DoHasSyncHistory(): NOT OPEN end");
+		return doHasSyncHistory;
+		}
+	
+	if( iSyncHistory )
+		{
+		if ( iOpenedStoreId != iChangeFinder->DataStoreUid() )
+			{
+			iChangeFinder->SetDataStoreUid( iOpenedStoreId );
+			doHasSyncHistory = EFalse;
+			}
+		else
+			{
+			doHasSyncHistory = ETrue;
+			}
+		}
+	else
+		{
+		iChangeFinder->SetDataStoreUid( iOpenedStoreId );
+		}
+		
+	_DBG_FILE("CNSmlContactsDataStore::DoHasSyncHistory(): end");
+	return doHasSyncHistory;
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoAddedItems()
+// ----------------------------------------------------------------------------
+EXPORT_C const MSmlDataItemUidSet& CNSmlContactsDataStore::DoAddedItems() const
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoAddedItems(): begin");
+	if ( iState == ENSmlOpenAndWaiting )
+		{
+		iNewUids->Reset();
+		
+		if( iChangeFinder )
+			{
+			TRAPD( err,iChangeFinder->FindNewItemsL( *iNewUids ) );
+			if( err != KErrNone )
+				{
+				_DBG_FILE("CNSmlContactsDataStore::DoAddedItems(): LEAVE end");				
+				}
+			}
+		}	
+	_DBG_FILE("CNSmlContactsDataStore::DoAddedItems(): end");
+
+	return *iNewUids;
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoDeletedItems()
+// ----------------------------------------------------------------------------
+EXPORT_C const MSmlDataItemUidSet& CNSmlContactsDataStore::DoDeletedItems() const
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoDeletedItems(): begin");	
+	if ( iState == ENSmlOpenAndWaiting )
+		{
+		iDeletedUids->Reset();
+		
+		if( iChangeFinder )
+			{
+			TRAPD(err,iChangeFinder->FindDeletedItemsL( *iDeletedUids ) );
+			if( err != KErrNone )
+				{
+				_DBG_FILE("CNSmlContactsDataStore::DoDeletedItems(): LEAVE end");				
+				}
+			}
+		}
+	_DBG_FILE("CNSmlContactsDataStore::DoDeletedItems(): end");
+
+	return *iDeletedUids;
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoSoftDeletedItems()
+// ----------------------------------------------------------------------------
+EXPORT_C const MSmlDataItemUidSet& CNSmlContactsDataStore::DoSoftDeletedItems() const
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoSoftDeletedItems(): begin");
+	if ( iState == ENSmlOpenAndWaiting )
+		{
+		iSoftDeletedUids->Reset();
+		
+		if( iChangeFinder )
+			{
+			TRAPD( err, iChangeFinder->FindSoftDeletedItemsL( *iSoftDeletedUids ) );
+			if( err != KErrNone )
+				{
+				_DBG_FILE("CNSmlContactsDataStore::DoSoftDeletedItems(): LEAVE end");				
+				}
+			}
+		}
+	_DBG_FILE("CNSmlContactsDataStore::DoSoftDeletedItems: END");
+	
+	return *iSoftDeletedUids;
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoModifiedItems()
+// ----------------------------------------------------------------------------
+EXPORT_C const MSmlDataItemUidSet& CNSmlContactsDataStore::DoModifiedItems() const
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoModifiedItems(): begin");
+	if ( iState == ENSmlOpenAndWaiting )
+		{
+		iReplacedUids->Reset();
+		
+		if( iChangeFinder )
+			{
+			TRAPD( err, iChangeFinder->FindChangedItemsL( *iReplacedUids ) );
+			if( err != KErrNone )
+				{
+				_DBG_FILE("CNSmlContactsDataStore::DoModifiedItems(): LEAVE end");				
+				}
+			}
+		}
+	_DBG_FILE("CNSmlContactsDataStore::DoModifiedItems: END");
+	
+	return *iReplacedUids;
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoMovedItems()
+// ----------------------------------------------------------------------------
+EXPORT_C const MSmlDataItemUidSet& CNSmlContactsDataStore::DoMovedItems() const
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoMovedItems(): begin");
+	
+	if ( iState == ENSmlOpenAndWaiting )
+		{
+		iMovedUids->Reset();
+		
+		if( iChangeFinder )
+			{
+			TRAPD( err, iChangeFinder->FindMovedItemsL( *iMovedUids ) );	
+			if( err != KErrNone )
+				{
+				_DBG_FILE("CNSmlContactsDataStore::DoMovedItems(): LEAVE end");				
+				}
+			}
+		}
+	_DBG_FILE("CNSmlContactsDataStore::DoMovedItems: END");
+	
+	return *iMovedUids;
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoResetChangeInfoL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoResetChangeInfoL(): begin");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	TInt error(KErrNone);
+	
+	if( iChangeFinder )
+		{
+		iChangeFinder->ResetL();
+		}
+		
+	iSnapshotRegistered = EFalse;
+	
+	error = FetchModificationsL();
+	
+    User::RequestComplete( iCallerStatus, error );
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoResetChangeInfoL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoCommitChangeInfoL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus, 
+												  const MSmlDataItemUidSet& aItems )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoCommitChangeInfoL(aItems): begin");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	
+	if( iChangeFinder )
+		{
+		iChangeFinder->CommitChangesL( aItems );
+		User::RequestComplete( iCallerStatus, KErrNone );
+		return;
+		}
+		
+	User::RequestComplete( iCallerStatus, KErrNotReady );
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoCommitChangeInfoL(aItems): end");
+	}
+
+// ----------------------------------------------------------------------------
+// void CNSmlContactsDataStore::DoCommitChangeInfoL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoCommitChangeInfoL(): begin");
+	iCallerStatus = &aStatus;
+	*iCallerStatus = KRequestPending;
+	
+	if( iChangeFinder )
+		{
+		iChangeFinder->CommitChangesL();
+		User::RequestComplete( iCallerStatus, KErrNone );
+		return;
+		}
+	
+	User::RequestComplete( iCallerStatus, KErrNotReady );
+	
+	_DBG_FILE("CNSmlContactsDataStore::DoCommitChangeInfoL(): end");
+	}
+
+// ----------------------------------------------------------------------------
+// CDesCArray* CNSmlContactsDataStore::DoListStoresLC()
+// ----------------------------------------------------------------------------
+EXPORT_C CDesCArray* CNSmlContactsDataStore::DoListStoresLC()
+	{
+	_DBG_FILE("CNSmlContactsDataStore::DoListStoresLC(): begin");
+	
+	 /*CDesCArray* cntStores = new (ELeave) CDesCArrayFlat(1);
+	 iContactsDataStoreExtension->ListStoresL( cntStores );
+     CleanupStack::PushL( cntStores );*/
+	
+	 CDesCArray* array = new (ELeave) CDesCArrayFlat(1);
+	 array->AppendL(*iDefaultStoreName);
+	 CleanupStack::PushL( array );
+     
+     _DBG_FILE("CNSmlContactsDataStore::DoListStoresLC(): end");
+     
+     return array;
+	}
+	
+// ------------------------------------------------------------------------------------------------
+// TInt CNSmlContactsDataStore::LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem )
+// ------------------------------------------------------------------------------------------------
+EXPORT_C TInt 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 = iContactsDataStoreExtension->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");
+	
+	_DBG_FILE("CNSmlContactsDataStore::LdoFetchItemL(): end");
+	return err;
+	}
+
+// ------------------------------------------------------------------------------------------------
+// TInt CNSmlContactsDataStore::LdoAddItemL( TSmlDbItemUid& aUid,
+//                                           const TDesC8& aItem,
+//                                           TInt aSize,
+//                                           TTime& aLastModified )
+// ------------------------------------------------------------------------------------------------
+EXPORT_C TInt CNSmlContactsDataStore::LdoAddItemL( TSmlDbItemUid& aUid,
+                                                   const TDesC8& aItem,
+                                                   TInt aSize,
+                                                   TTime& aLastModified )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): begin");
+	
+	TInt ret( KErrNone );
+	
+	if( !iOpened )
+		{
+		User::Leave( KErrNotReady );
+		}
+		
+	// Is there enough space on drive ?
+	if( DriveBelowCriticalLevelL( aSize ) )
+		{
+		return KErrDiskFull;
+		}
+
+	HBufC8* buf = aItem.AllocLC();
+	StripPropertyL( buf, KVersitTokenUID() );
+
+	CArrayFixFlat<TUid>* entryArray = NULL;
+	TRAP( ret, entryArray = iContactsDataStoreExtension->ImportContactsL( *buf ) );
+
+    DBG_ARGS(_S("New item to database with return value: '%d'"), ret );
+
+	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 );
+		}
+
+	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): end");
+	return ret;
+	}
+
+// ------------------------------------------------------------------------------------------------
+// TInt CNSmlContactsDataStore::LdoAddItemsL( RArray<TInt>& aUids,CBufBase*& aItems,
+//                                            TInt aSize, TTime& aLastModified )
+// ------------------------------------------------------------------------------------------------
+EXPORT_C TInt CNSmlContactsDataStore::LdoAddItemsL( RArray<TInt>& aUids,
+                                                    CBufBase*& aItems,
+                                                    TInt aSize,
+                                                    TTime& aLastModified  )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemsL(): begin");
+	
+	TInt ret( KErrNone );
+	
+	if( !iOpened )
+		{
+		User::Leave( KErrNotReady );
+		}
+		
+	// Is there enough space on drive ?
+	if( DriveBelowCriticalLevelL( aSize ) )
+		{
+		return KErrDiskFull;
+		}
+
+	CArrayFixFlat<TUid>* entryArray = NULL;
+    TRAP( ret, entryArray = iContactsDataStoreExtension->ImportContactsL(  aItems->Ptr(0) ) );
+	
+    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 )
+	{
+	_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() );
+	
+	DBG_DUMP((void*)hItemPtr.Ptr(), hItemPtr.Length(),
+	            _S8("CNSmlContactsDataStore::LdoUpdateItemL(): MergedItem:"));
+
+	// TODO: Get it reviewed
+	CArrayFixFlat<TUid>* entryArray = NULL;
+    TRAP( ret, entryArray = iContactsDataStoreExtension->ImportContactsL( hItemPtr ) );
+	
+    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()
+// ------------------------------------------------------------------------------------------------
+EXPORT_C TBool CNSmlContactsDataStore::DriveBelowCriticalLevelL( TInt aSize )
+	{
+	return SysUtil::DiskSpaceBelowCriticalLevelL( &iRfs, aSize, iDrive );
+	}
+
+// ----------------------------------------------------------------------------
+// CBufBase* CNSmlContactsDataStore::AddBufferListL()
+// ----------------------------------------------------------------------------
+EXPORT_C CBufBase* CNSmlContactsDataStore::AddBufferListL( TSmlDbItemUid& aUid, TInt aSize, TInt aStatus )
+	{
+	_DBG_FILE("CNSmlContactsDataStore::AddBufferListL(): begin");
+	
+	CNSmlContactsBufferItem* newBufferItem = new (ELeave) CNSmlContactsBufferItem;
+	CleanupStack::PushL( newBufferItem );
+	
+	if( iModType == ENSmlCntItemAdd )
+		{
+		newBufferItem->iPUid     = &aUid;
+		newBufferItem->iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
+    	newBufferItem->iStatus   = KErrGeneral; // Default for add
+		}
+	else
+		{
+		newBufferItem->iPUid = &aUid;
+		newBufferItem->iUid = aUid;		
+		newBufferItem->iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
+    	newBufferItem->iStatus = KNSmlNoError; // Default if not handled
+		}		
+	
+	newBufferItem->iModType = iModType;
+	newBufferItem->iMimeType = iMimeTypeItem.AllocL();
+	newBufferItem->iMimeVersion = iMimeVersionItem.AllocL();
+	newBufferItem->iSize = aSize;
+	
+	if( aStatus != KErrNone )
+		{
+		newBufferItem->iStatus  = aStatus;
+		}
+		
+	iContactsBufferItemList.AppendL( newBufferItem );
+	
+	iMimeTypeItem.Set( KNullDesC8 ); 
+	iMimeVersionItem.Set( KNullDesC8 );
+	
+	iLastItem = ETrue;
+	
+	CleanupStack::Pop();	
+	
+	if( iModType == ENSmlCntItemAdd && 
+	    aStatus  == KErrNotSupported )
+		{
+		iStateItem = KErrNotSupported;
+		}
+		
+	_DBG_FILE("CNSmlContactsDataStore::AddBufferListL(): end");
+
+	return newBufferItem->iItemData;
+
+	}
+	
+// ------------------------------------------------------------------------------------------------
+// void CNSmlContactsDataStore::StripPropertyL( HBufC8*& aItem, const TDesC8& aProperty )
+// ------------------------------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::StripPropertyL( HBufC8*& aItem, const TDesC8& aProperty ) const
+	{
+	_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): begin");
+
+	if( !aItem )
+		{
+		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): NULL pointer");
+		return;
+		}
+
+	TPtr8 hItemPtr( aItem->Des() );
+	HBufC8* propBuf = HBufC8::NewLC( aProperty.Length() + 2 );
+	TPtr8 propPtr( propBuf->Des() );
+
+	propPtr.Append( KVersitTokenCRLF() );
+	propPtr.Append( aProperty );
+	TInt propPos = hItemPtr.Find( propPtr );
+	if( propPos != KErrNotFound )
+		{
+		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): property found in item data -> removing it");
+		_DBG_FILE( aProperty.Ptr() );
+		TPtrC8 propPosPtr( hItemPtr.Mid( propPos + KVersitTokenCRLF().Length() ) );
+		TInt propEndPos = propPosPtr.Find( KVersitTokenCRLF() );
+		hItemPtr.Delete( propPos, propEndPos + KVersitTokenCRLF().Length() );
+		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): property removed");
+		}
+	CleanupStack::PopAndDestroy(); // propBuf
+	_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): end");
+	}
+	
+// ------------------------------------------------------------------------------------------------
+// void CNSmlContactsDataStore::StripPropertyL( CBufBase*& aItem, const TDesC8& aProperty )
+// ------------------------------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::StripPropertyL( CBufBase*& aItem, const TDesC8& aProperty ) const
+	{
+	_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): begin");
+	
+	if( !aItem )
+		{
+		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): NULL pointer");
+		return;
+		}
+		
+	HBufC8* propBuf = HBufC8::NewLC( aProperty.Length() + 2 );
+	TPtr8 propPtr( propBuf->Des() );
+	propPtr.Append( KVersitTokenCRLF() );
+	propPtr.Append( aProperty );
+	TInt propPos = aItem->Ptr(0).Find( propPtr );
+	
+	while( propPos != KErrNotFound )
+		{
+		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): property found in item data -> removing it");
+		_DBG_FILE( aProperty.Ptr() );
+		TInt propEndPos = aItem->Ptr( propPos + KVersitTokenCRLF().Length()).Find(KVersitTokenCRLF() );
+		if( propEndPos != KErrNotFound )
+			{
+			aItem->Delete( propPos + KVersitTokenCRLF().Length(), propEndPos );		
+			}
+		
+		propPos = aItem->Ptr(0).Find( propPtr );
+		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): property removed");
+		}
+	CleanupStack::PopAndDestroy(); // propBuf
+	_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataStore::GetStoreFormatResourceFileL
+// ------------------------------------------------------------------------------------------------
+EXPORT_C const TDesC& CNSmlContactsDataStore::GetStoreFormatResourceFileL() const
+    {
+    _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 )
+        {
+        _DBG_FILE("CNSmlContactsDataStore::GetStoreFormatResourceFileL(): END");
+        return KNSmlContactsStoreFormatRsc_1_1_2;
+        }
+    else // error or protocol version 1.2 
+        {
+        _DBG_FILE("CNSmlContactsDataStore::GetStoreFormatResourceFileL(): 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    
+    }
+
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataStore::MergeL
+// 
+// ------------------------------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::MergeL( CBufBase& aNewItem, CBufBase& aOldItem, TBool aFieldLevel )
+    {
+    iDataMod->MergeRxL( aNewItem, aOldItem, aFieldLevel );
+    }
+
+// ----------------------------------------------------------------------------
+// CNSmlContactsDataStore::StripTxL
+//  Strips data that is to be transmitted to the sync partner.
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::StripTxL( CBufBase& aItem )
+    {
+    iDataMod->StripTxL( aItem );
+    }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataStore::FetchModificationsL
+// ------------------------------------------------------------------------------------------------
+//
+TInt CNSmlContactsDataStore::FetchModificationsL()
+    {
+    _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;
+    }
+
+// ----------------------------------------------------------------------------»
+// CNSmlContactsDataStore::GetDataMod
+// return reference to datamod instance.
+// ----------------------------------------------------------------------------
+EXPORT_C CNSmlDataModBase& CNSmlContactsDataStore::GetDataMod()
+    {
+    return *iDataMod;
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStoreFormat_1_1_2.rss	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,508 @@
+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 ContactsDataProvider
+*
+*/
+
+#include "SmlDataFormat.rh"
+#include "SmlDataFormat.hrh"
+
+RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
+	{
+	version=1;
+	display_name="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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStoreFormat_1_2.rss	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,400 @@
+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 ContactsDataProvider
+*
+*/
+
+#include "SmlDataFormat.rh"
+#include "SmlDataFormat.hrh"
+
+RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
+	{
+	version=1;
+	display_name="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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/adapters/inc/nsmldsimpluids.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* 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:  Implementation UIDs for ECOM plug-in adapters
+*
+*/
+
+
+#ifndef __NSMLIMPLUIDS_H__
+#define __NSMLIMPLUIDS_H__
+
+// ------------------------------------------------------------------------------------------------
+// Includes
+// ------------------------------------------------------------------------------------------------
+#include <e32base.h>
+
+// ------------------------------------------------------------------------------------------------
+//
+// ------------------------------------------------------------------------------------------------
+
+// Implementation UIDs for DS adapters
+const TUint KNSmlContactsAdapterImplUid = 0x101F6DDD;
+const TUint KNSmlAgendaAdapterImplUid = 0x101F6DDD+1;
+const TUint KNSmlEmailAdapterImplUid = 0x101F6DDD+2;
+// This one is for testing purposes only!
+const TUint KNSmlParamTestAdapterImplUid = 0x101F6DEB;
+
+#endif // __CNSMLIMPLUIDS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/datamod/bld/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,20 @@
+/*
+* 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:  build info file for DS datamod
+*
+*/
+
+
+PRJ_MMPFILES
+./nsmldatamod.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/datamod/bld/def/bwinscwdatamodu.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,11 @@
+EXPORTS
+	??0CNSmlVCalMod@@QAE@XZ @ 1 NONAME ; CNSmlVCalMod::CNSmlVCalMod(void)
+	??0CNSmlVCardMod@@QAE@XZ @ 2 NONAME ; CNSmlVCardMod::CNSmlVCardMod(void)
+	??1CNSmlDataModBase@@UAE@XZ @ 3 NONAME ; CNSmlDataModBase::~CNSmlDataModBase(void)
+	?MergeRxL@CNSmlDataModBase@@QAEXAAVCBufBase@@0H@Z @ 4 NONAME ; void CNSmlDataModBase::MergeRxL(class CBufBase &, class CBufBase &, int)
+	?NeedsMerge@CNSmlDataModBase@@QAEHXZ @ 5 NONAME ; int CNSmlDataModBase::NeedsMerge(void)
+	?SetOwnStoreFormat@CNSmlDataModBase@@QAEXAAVCSmlDataStoreFormat@@@Z @ 6 NONAME ; void CNSmlDataModBase::SetOwnStoreFormat(class CSmlDataStoreFormat &)
+	?SetPartnerStoreFormat@CNSmlDataModBase@@QAEXAAVCSmlDataStoreFormat@@@Z @ 7 NONAME ; void CNSmlDataModBase::SetPartnerStoreFormat(class CSmlDataStoreFormat &)
+	?SetUsedMimeType@CNSmlDataModBase@@QAEHVRStringF@@0@Z @ 8 NONAME ; int CNSmlDataModBase::SetUsedMimeType(class RStringF, class RStringF)
+	?StripTxL@CNSmlDataModBase@@QAEXAAVCBufBase@@@Z @ 9 NONAME ; void CNSmlDataModBase::StripTxL(class CBufBase &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/datamod/bld/def/eabidatamodu.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,21 @@
+EXPORTS
+	_ZN12CNSmlVCalModC1Ev @ 1 NONAME
+	_ZN12CNSmlVCalModC2Ev @ 2 NONAME
+	_ZN13CNSmlVCardModC1Ev @ 3 NONAME
+	_ZN13CNSmlVCardModC2Ev @ 4 NONAME
+	_ZN16CNSmlDataModBase10NeedsMergeEv @ 5 NONAME
+	_ZN16CNSmlDataModBase15SetUsedMimeTypeE8RStringFS0_ @ 6 NONAME
+	_ZN16CNSmlDataModBase17SetOwnStoreFormatER19CSmlDataStoreFormat @ 7 NONAME
+	_ZN16CNSmlDataModBase21SetPartnerStoreFormatER19CSmlDataStoreFormat @ 8 NONAME
+	_ZN16CNSmlDataModBase8MergeRxLER8CBufBaseS1_i @ 9 NONAME
+	_ZN16CNSmlDataModBase8StripTxLER8CBufBase @ 10 NONAME
+	_ZN16CNSmlDataModBaseD0Ev @ 11 NONAME
+	_ZN16CNSmlDataModBaseD1Ev @ 12 NONAME
+	_ZN16CNSmlDataModBaseD2Ev @ 13 NONAME
+	_ZTI12CNSmlVCalMod @ 14 NONAME ; #<TI>#
+	_ZTI13CNSmlVCardMod @ 15 NONAME ; #<TI>#
+	_ZTI16CNSmlDataModBase @ 16 NONAME ; #<TI>#
+	_ZTV12CNSmlVCalMod @ 17 NONAME ; #<VT>#
+	_ZTV13CNSmlVCardMod @ 18 NONAME ; #<VT>#
+	_ZTV16CNSmlDataModBase @ 19 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/datamod/bld/nsmldatamod.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* 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 DS Data Modification
+*
+*/
+
+
+#include <platform_paths.hrh>
+#include 		"defaultcaps.hrh"
+
+TARGET          nsmldatamod.dll
+TARGETTYPE      DLL
+UID             0x1000008d 0x101F6DE4
+CAPABILITY 		CAP_GENERAL_DLL
+VENDORID		VID_DEFAULT
+
+#if defined(ARMCC)
+DEFFILE			./def/eabidatamod
+#elif defined(WINSCW)
+DEFFILE			./def/bwinscwdatamod
+#endif
+
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+SOURCE          nsmldatamodbase.cpp
+SOURCE          NSmlProperty.cpp
+SOURCE          NSmlVCalMod.cpp
+SOURCE          NSmlVCardMod.cpp
+
+LIBRARY         euser.lib 
+LIBRARY			versit.lib 
+LIBRARY			estor.lib 
+LIBRARY			vcal.lib 
+LIBRARY			vcard.lib
+LIBRARY			bafl.lib
+LIBRARY			smlstoreformat.lib
+LIBRARY			nsmldebug.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/datamod/src/NSmlProperty.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* 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:  Property class
+*
+*/
+
+
+
+// INCLUDES
+#include <NSmlDataModBase.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNSmlProperty::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlProperty* CNSmlProperty::NewL( CParserPropertyValue& aPropertyValue, const TDesC8& aName, CArrayPtr<CParserParam>* aArrayOfParams )
+	{
+	CNSmlProperty* self = new ( ELeave ) CNSmlProperty( aPropertyValue, aArrayOfParams );
+	CleanupStack::PushL( self );
+	ConstructSelfL( *self, aName );
+	CleanupStack::Pop(); // self
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlProperty::Parameters
+// -----------------------------------------------------------------------------
+//
+CArrayPtr<CParserParam>* CNSmlProperty::Parameters() const
+	{
+	return iArrayOfParams;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlProperty::ParamCount
+// -----------------------------------------------------------------------------
+//
+TInt CNSmlProperty::ParamCount() const
+	{
+	if ( iArrayOfParams )
+		{
+		return iArrayOfParams->Count();
+		}
+	return 0;
+	}
+	
+// -----------------------------------------------------------------------------
+// CNSmlProperty::Compare
+// -----------------------------------------------------------------------------
+//
+TInt CNSmlProperty::Compare( const CNSmlProperty& aFirst, const CNSmlProperty& aSecond )
+	{
+	return aFirst.Name().Compare( aSecond.Name() );
+	}
+	
+// -----------------------------------------------------------------------------
+// CNSmlProperty::CNSmlProperty
+// -----------------------------------------------------------------------------
+//
+CNSmlProperty::CNSmlProperty( CParserPropertyValue& aPropertyValue, CArrayPtr<CParserParam>* aArrayOfParams ) : CParserProperty(aPropertyValue, aArrayOfParams)
+	{
+	}
+	
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/datamod/src/NSmlVCalMod.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* 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:  Versit data stripper and merger for calendar.
+*
+*/
+
+
+
+// INCLUDES
+#include <NSmlDataModBase.h>
+#include <vcal.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNSmlVCalMod::CNSmlVCalMod
+// C++ default constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlVCalMod::CNSmlVCalMod() : CNSmlDataModBase()
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlVCalMod::ChildCreateParserLC
+// Creates correct type of parser for Calendar Data Modifications.
+// -----------------------------------------------------------------------------
+//
+CVersitParser* CNSmlVCalMod::ChildCreateParserLC()
+	{
+	CVersitParser* p = CParserVCal::NewL();
+	CleanupStack::PushL( p );
+	return p;
+	}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/datamod/src/NSmlVCardMod.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* 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:  Versit data stripper and merger for contacts.
+*
+*/
+
+
+
+// INCLUDES
+#include <NSmlDataModBase.h>
+#include <vcard.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNSmlVCardMod::CNSmlVCardMod
+// C++ default constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlVCardMod::CNSmlVCardMod() : CNSmlDataModBase()
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlVCardMod::ChildCreateParserLC
+// Creates correct type of parser for Contacts Data Modifications.
+// -----------------------------------------------------------------------------
+//
+CVersitParser* CNSmlVCardMod::ChildCreateParserLC()
+	{
+	CVersitParser* p = CParserVCard::NewL();
+	CleanupStack::PushL( p );
+	return p;
+	}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/datamod/src/nsmldatamodbase.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,779 @@
+/*
+* 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:  Versit data stripper and merger.
+*
+*/
+
+
+// INCLUDES
+#include <NSmlDataModBase.h>
+#include "nsmldebug.h"
+#include "nsmlconstants.h"
+
+#include <versit.h>
+#include <vcal.h>
+#include <vcard.h>
+#include <s32mem.h>
+#include <stringpool.h>
+#include <vtoken.h>
+#include <e32property.h>
+#include <DataSyncInternalPSKeys.h>
+
+//Fix to Remove the Bad Compiler Warnings
+#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 ===============================
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::~CNSmlDataModBase
+// Destructor.
+// ------------------------------------------------------------------------------------------------
+EXPORT_C CNSmlDataModBase::~CNSmlDataModBase()
+	{
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::SetOwnStoreFormat
+// Sets own database format.
+// ------------------------------------------------------------------------------------------------
+EXPORT_C void CNSmlDataModBase::SetOwnStoreFormat( CSmlDataStoreFormat& aOwnStoreFormat )
+	{
+	_DBG_FILE("CNSmlDataModBase::SetOwnStoreFormat(): begin");
+	iOwnStoreFormat = &aOwnStoreFormat;
+	_DBG_FILE("CNSmlDataModBase::SetOwnStoreFormat(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::SetPartnerStoreFormat
+// Sets remote database format.
+// ------------------------------------------------------------------------------------------------
+EXPORT_C void CNSmlDataModBase::SetPartnerStoreFormat( CSmlDataStoreFormat& aRemoteStoreFormat )
+	{
+	_DBG_FILE("CNSmlDataModBase::SetPartnerStoreFormat(): begin");
+	iRemoteStoreFormat = &aRemoteStoreFormat;
+	_DBG_FILE("CNSmlDataModBase::SetPartnerStoreFormat(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::SetUsedMimeType
+// Sets mime type that is used for sending and receiving. 
+// This method can be called separately before every item.
+// ------------------------------------------------------------------------------------------------
+EXPORT_C TInt CNSmlDataModBase::SetUsedMimeType( const RStringF aMimeType, const RStringF aMimeVersion )
+	{
+	_DBG_FILE("CNSmlDataModBase::SetUsedMimeTypeL(): begin");
+	iUsedRemoteMimeType = -1;
+	if ( !iRemoteStoreFormat )
+		{
+		_DBG_FILE("CNSmlDataModBase::SetUsedMimeTypeL() - Not Found: end");
+		return KErrNotFound;
+		}
+	else
+		{
+		for ( TInt i = 0; i < iRemoteStoreFormat->MimeFormatCount(); i++ )
+			{
+			if ( iRemoteStoreFormat->MimeFormat( i ).MimeType().DesC().Compare( aMimeType.DesC() ) == 0 )
+				{
+				if ( iRemoteStoreFormat->MimeFormat( i ).MimeVersion().DesC().Compare( aMimeVersion.DesC() ) == 0 )
+					{
+					iUsedRemoteMimeType = i;
+					iMimeType = iRemoteStoreFormat->MimeFormat( i ).MimeType();
+					iMimeVersion = iRemoteStoreFormat->MimeFormat( i ).MimeVersion();
+					_DBG_FILE("CNSmlDataModBase::SetUsedMimeTypeL() - Found: end");
+					return KErrNone;
+					}
+				}
+			}
+		}
+	_DBG_FILE("CNSmlDataModBase::SetUsedMimeTypeL() - Not Found: end");
+	return KErrNotFound;
+	}
+	
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::StripTxL
+// Strips data that is to be transmitted to the sync partner.
+// ------------------------------------------------------------------------------------------------
+EXPORT_C void CNSmlDataModBase::StripTxL( CBufBase& aItem )
+	{
+	_DBG_FILE("CNSmlDataModBase::StripTxL(): begin");
+	HBufC8* buf = HBufC8::NewLC(aItem.Size() * 2);
+	*buf = aItem.Ptr(0);
+	TPtr8 ptrBuf = buf->Des();
+
+	StripL(ptrBuf);
+
+	aItem.Reset();
+	aItem.InsertL(0, ptrBuf);
+	CleanupStack::PopAndDestroy(); // buf
+	_DBG_FILE("CNSmlDataModBase::StripTxL(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::MergeRxL
+// Merges received item with item in exported from the local database.
+// ------------------------------------------------------------------------------------------------
+EXPORT_C void CNSmlDataModBase::MergeRxL( CBufBase& aNewItem, CBufBase& aOldItem, TBool aFieldLevel )
+	{
+	_DBG_FILE("CNSmlDataModBase::MergeRxL(): begin");
+	if( NeedsMerge() )
+		{
+		HBufC8* b1 = HBufC8::NewLC(aNewItem.Size() + aOldItem.Size());
+		*b1 = aNewItem.Ptr(0);
+		TPtr8 ptrB1 = b1->Des();
+		TPtr8 p2 = aOldItem.Ptr(0);
+
+		MergeL( ptrB1, p2, aFieldLevel );
+
+		aNewItem.Reset();
+		aNewItem.InsertL(0, ptrB1);
+		CleanupStack::PopAndDestroy(); // b1
+		}
+	else if ( iUsedRemoteMimeType == -1 )
+		{
+		User::Leave( KErrNotFound );
+		}
+	_DBG_FILE("CNSmlDataModBase::MergeRxL(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::NeedsMerge
+// Checks whether merging is needed or not.
+// ------------------------------------------------------------------------------------------------
+EXPORT_C TBool CNSmlDataModBase::NeedsMerge()
+	{
+	_DBG_FILE("CNSmlDataModBase::NeedsMerge(): begin");
+	iUsedRemoteMimeType = -1;
+	if ( !iRemoteStoreFormat )
+		{
+		_DBG_FILE("CNSmlDataModBase::NeedsMerge() - EFalse: end");
+		return EFalse;
+		}
+	else
+		{
+		for ( TInt i = 0; i < iRemoteStoreFormat->MimeFormatCount(); i++ )
+			{
+			if ( iRemoteStoreFormat->MimeFormat( i ).MimeType().DesC().Compare( iMimeType.DesC() ) == 0 )
+				{
+				if ( iRemoteStoreFormat->MimeFormat( i ).MimeVersion().DesC().Compare( iMimeVersion.DesC() ) == 0 )
+					{
+					iUsedRemoteMimeType = i;
+					if ( iRemoteStoreFormat->MimeFormat( i ).PropertyCount() > 0 )
+						{
+						_DBG_FILE("CNSmlDataModBase::NeedsMerge() - ETrue: end");
+						return ETrue;
+						}
+					}
+				}
+			}
+		}
+	_DBG_FILE("CNSmlDataModBase::NeedsMerge() - EFalse: end");
+	return EFalse;
+	}
+	
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::CNSmlDataModBase
+// Basic constructor of class.
+// ------------------------------------------------------------------------------------------------
+CNSmlDataModBase::CNSmlDataModBase()
+	{
+	iUsedOwnMimeType = -1;
+	iUsedRemoteMimeType = -1;
+	}
+	
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::StripL
+// Strips data that is to be transmitted to the sync partner.
+// ------------------------------------------------------------------------------------------------
+void CNSmlDataModBase::StripL( TDes8& aItem )
+	{
+	_DBG_FILE("CNSmlDataModBase::StripL(): begin");
+	if ( !NeedsMerge() )
+		{
+		if ( iUsedRemoteMimeType == -1 )
+			{
+			User::Leave( KErrNotFound );
+			}
+		return;
+		}
+	TBool modified( EFalse );
+	CVersitParser* parser = ChildCreateParserLC();
+	RDesReadStream drs( aItem );
+	CleanupClosePushL( drs );
+	parser->InternalizeL( drs );
+
+	// Now we're ready to start analysis
+	CArrayPtr<CVersitParser>* entities = parser->ArrayOfEntities( EFalse );
+	if( entities )
+		{
+		for( TInt i = 0; i < entities->Count(); i++ )
+			{
+			StripEntityL( entities->At( i ), modified );
+			}
+		}
+	else
+		{
+		StripEntityL( parser, modified );
+		}
+
+	// Only update if anything was modified in process
+	if( modified )
+		{
+		aItem.Zero();
+		RDesWriteStream dws( aItem );
+		CleanupClosePushL( dws );
+		parser->ExternalizeL( dws );
+		dws.CommitL();
+		CleanupStack::PopAndDestroy(); // dws
+		}
+	CleanupStack::PopAndDestroy( 2 ); // drs, parser
+	_DBG_FILE("CNSmlDataModBase::StripL(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::StripEntityL
+// Strips data that is to be transmitted to the sync partner from entity.
+// ------------------------------------------------------------------------------------------------
+void CNSmlDataModBase::StripEntityL( CVersitParser* aEntity, TBool& aModified ) const
+	{
+	_DBG_FILE("CNSmlDataModBase::StripEntityL(): begin");
+	StripAllNotOnPartnerListL( aEntity, aModified, ETrue );
+	_DBG_FILE("CNSmlDataModBase::StripEntityL(): end");
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::StripAllOnPartnerListL
+// Strips all data from entity that is supported by remote server.
+// ------------------------------------------------------------------------------------------------
+void CNSmlDataModBase::StripAllOnPartnerListL( CVersitParser* aEntity, TBool& aModified, TBool aParamLevelCheck ) const
+	{
+    _DBG_FILE("CNSmlDataModBase::StripAllOnPartnerListL(): begin");
+
+    if( iRemoteStoreFormat->MimeFormat( iUsedRemoteMimeType ).PropertyCount() )
+        {
+        
+        // Check correct Data Sync protocol
+        TInt value( EDataSyncNotRunning );
+        TSmlProtocolVersion usedSyncProtocol( ESmlVersion1_2 );
+        TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
+                                     KDataSyncStatus,
+                                     value );
+        if ( error == KErrNone &&
+             value == EDataSyncRunning )
+            {
+            usedSyncProtocol = ESmlVersion1_1_2;
+            }
+        
+        TBool wasModified( EFalse );
+
+        CArrayPtr<CParserProperty>* allProps = aEntity->ArrayOfProperties( EFalse );
+        for( TInt i = 0; i < allProps->Count(); ) // Variable i is not increased here because size of count might be changes during loop
+            {
+            const CParserProperty& ownProperty = *allProps->At( i );
+            CParserPropertyValue* ownValue = ownProperty.Value();
+
+            TBool removeMe( EFalse );
+            
+            for( TInt i2 = 0; i2 < iRemoteStoreFormat->MimeFormat( iUsedRemoteMimeType ).PropertyCount(); i2++ )
+                {
+                const CSmlDataProperty& remoteProperty = iRemoteStoreFormat->MimeFormat( iUsedRemoteMimeType ).Property( i2 );
+                if( !ownProperty.Name().Compare( remoteProperty.Field().Name().DesC() ) )
+                    {
+                    if( remoteProperty.ParamCount() > 0 && aParamLevelCheck )
+                        {
+                        if ( usedSyncProtocol == ESmlVersion1_1_2 )
+                            {
+                            for( TInt i3 = 0; i3 < remoteProperty.ParamCount(); i3++ )
+                                {
+                                if( ownProperty.Param( remoteProperty.Param( i3 ).Field().Name().DesC() ) )
+                                    {
+                                    removeMe = ETrue;
+                                    }
+                                }                           
+                            }
+                        else // ESmlVersion1_2
+                            {
+                            CArrayPtr<CParserParam>* ownerparamarray = ownProperty.ParamArray();
+                            if(ownerparamarray != NULL)
+                                {
+                                for(TInt ownerparam = 0; ownerparam < ownerparamarray->Count(); ownerparam++)
+                                    {
+                                    removeMe = EFalse;
+                                    const CParserParam& ownParam = *ownerparamarray->At( ownerparam );
+                                     TPtrC8 ownparamname = ownParam.Name();
+                                     TPtrC8 ownparamvalue = ownParam.Value();
+                                     if(ownparamvalue == _L8(""))
+                                        {
+                                         for(TInt remoteparam = 0; remoteparam < remoteProperty.ParamCount(); remoteparam++)
+                                            {
+                                            TDesC8 remoteparamname = remoteProperty.Param( remoteparam ).Field().Name().DesC();
+                                            const CSmlDataField& field = remoteProperty.Param( remoteparam ).Field();
+											if(field.EnumValueCount() > 0)
+												{
+	                                            for( TInt rmtenumcount = 0; rmtenumcount < field.EnumValueCount(); rmtenumcount++ )
+													{
+	                                                TPtrC8 rmtenumvalue = field.EnumValue( rmtenumcount ).DesC();
+													if( rmtenumvalue.Compare(ownparamname)== 0 )
+	                                                    {
+	                                                    removeMe = ETrue;
+														break;
+	                                                    }  
+	                                                } 
+												}
+											else
+												{
+												removeMe = ETrue;
+												break;
+												}
+                                            }
+                                        }
+                                     else
+                                        {
+										//Handling when the device supports VersitTokenType as "Encoding"    
+										if(ownparamname == KVersitTokenENCODING)
+											{
+											removeMe = ETrue;
+											}
+										else
+											{
+	                                         for(TInt remoteparam = 0; remoteparam < remoteProperty.ParamCount(); remoteparam++)
+	                                            {
+	                                            if(ownparamname.Compare(remoteProperty.Param( remoteparam ).Field().Name().DesC()) == 0)
+	                                                {
+	                                                const CSmlDataField& field = remoteProperty.Param( remoteparam ).Field();
+													if( field.EnumValueCount() > 0 )
+														{
+		                                                for( TInt rmtenumcount = 0; rmtenumcount < field.EnumValueCount(); rmtenumcount++ )
+		                                                    {
+		                                                     TPtrC8 rmtenumvalue = field.EnumValue( rmtenumcount ).DesC();
+		                                                     if( rmtenumvalue.Compare(ownparamvalue)== 0 )
+		                                                         {
+		                                                         removeMe = ETrue;
+																 break;
+		                                                         }  
+		                                                    } 
+														}
+													else
+														{
+														removeMe = ETrue;
+														break;
+														}
+	                                                }                                               
+	                                            }
+											}
+                                        }
+                                    	if( !removeMe )
+                                        {
+                                        	break;
+                                        }	    
+                                    } 
+                                }
+                            else
+                                {
+                                removeMe = ETrue;
+                                }
+                            }
+                        }
+                    else
+                        {
+                        removeMe = ETrue;
+                        }
+
+                    if( removeMe )
+                        {
+                        break;
+                        }
+                    }
+                }
+            if( removeMe )
+                {
+                #ifdef __NSML_DEBUG__
+                    TPtrC8 pn( ownProperty.Name() );
+                    DBG_ARGS8(_S8("CNSmlDataModBase::StripAllOnPartnerListL(): Dropping %S"), &pn);
+                #endif // __NSML_DEBUG__
+                delete allProps->At( i );
+                allProps->Delete( i );
+                wasModified = ETrue;
+                aModified = ETrue;
+                }
+            else
+                {
+                #ifdef __NSML_DEBUG__
+                    TPtrC8 pn( ownProperty.Name() );
+                    DBG_ARGS8(_S8("CNSmlDataModBase::StripAllOnPartnerListL(): NOT dropping %S"), &pn);
+                #endif // __NSML_DEBUG__
+                i++;
+                }
+            }
+        // can't use aModified as that may have been set earlier!
+        if( wasModified )
+            {
+            allProps->Compress();
+            }
+        }
+    _DBG_FILE("CNSmlDataModBase::StripAllOnPartnerListL(): end");
+    }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::StripAllNotOnPartnerListL
+// Strips all data from entity that is not supported by remote server.
+// ------------------------------------------------------------------------------------------------
+void CNSmlDataModBase::StripAllNotOnPartnerListL( CVersitParser* aEntity, TBool& aModified, TBool aParamLevelCheck ) const
+	{
+    _DBG_FILE("CNSmlDataModBase::StripAllNotOnPartnerListL(): begin");
+    TInt remotepropertycount = iRemoteStoreFormat->MimeFormat( iUsedRemoteMimeType ).PropertyCount();
+    if( iRemoteStoreFormat->MimeFormat( iUsedRemoteMimeType ).PropertyCount() )
+        {
+        
+        // Check correct Data Sync protocol
+        TInt value( EDataSyncNotRunning );
+        TSmlProtocolVersion usedSyncProtocol( ESmlVersion1_2 );
+        TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
+                                     KDataSyncStatus,
+                                     value );
+        if ( error == KErrNone &&
+             value == EDataSyncRunning )
+            {
+            usedSyncProtocol = ESmlVersion1_1_2;
+            }
+
+        TBool wasModified( EFalse );
+
+        CArrayPtr<CParserProperty>* allProps = aEntity->ArrayOfProperties( EFalse );
+        for( TInt i = 0; i < allProps->Count(); ) // Variable i is not increased here because size of count might be changes during loop
+            {
+            const CParserProperty& ownProperty = *allProps->At( i );
+            CParserPropertyValue* ownValue = ownProperty.Value();
+
+            TBool removeMe( ETrue );
+            
+            for( TInt i2 = 0; i2 < iRemoteStoreFormat->MimeFormat( iUsedRemoteMimeType ).PropertyCount(); i2++ )
+                {
+                const CSmlDataProperty& remoteProperty = iRemoteStoreFormat->MimeFormat( iUsedRemoteMimeType ).Property( i2 );
+                TPtrC8 remotename = remoteProperty.Field().Name().DesC();
+                if( !ownProperty.Name().Compare( remoteProperty.Field().Name().DesC() ) )
+                    {
+                    TInt remoteparamcount = remoteProperty.ParamCount();
+                    if( remoteProperty.ParamCount() > 0 && aParamLevelCheck )
+                        {
+                        if ( usedSyncProtocol == ESmlVersion1_1_2 )
+                            {
+                            const CParserProperty* p = allProps->At( i );
+                            TInt entityParamCount = (( CNSmlProperty* )p)->ParamCount();
+                            if( entityParamCount > 0)
+                            {
+                            for( TInt i3 = 0; i3 < remoteProperty.ParamCount(); i3++ )
+                                {
+                                TPtrC8 remoteparamname = remoteProperty.Param( i3 ).Field().Name().DesC();
+                                if( ownProperty.Param( remoteProperty.Param( i3 ).Field().Name().DesC() ) )
+                                    {
+                                    removeMe = EFalse;
+                                    }
+                                }                           
+                            }
+                            else
+                            {
+                                removeMe = EFalse;
+                            }
+                            }
+                        else // ESmlVersion1_2
+                            {
+                            CArrayPtr<CParserParam>* ownerparamarray = ownProperty.ParamArray();
+                            if(ownerparamarray != NULL)
+                                {
+                                for(TInt ownerparam = 0; ownerparam < ownerparamarray->Count(); ownerparam++)
+                                    {
+									removeMe = ETrue;
+                                    const CParserParam& ownParam = *ownerparamarray->At( ownerparam );
+                                     TPtrC8 ownparamname = ownParam.Name();
+                                     TPtrC8 ownparamvalue = ownParam.Value();
+                                     if(ownparamvalue == _L8(""))
+                                        {
+                                         for(TInt remoteparam = 0; remoteparam < remoteProperty.ParamCount(); remoteparam++)
+                                            {
+                                            TDesC8 remoteparamname = remoteProperty.Param( remoteparam ).Field().Name().DesC();
+                                            const CSmlDataField& field = remoteProperty.Param( remoteparam ).Field();
+											if( field.EnumValueCount() > 0)
+												{
+												for( TInt rmtenumcount = 0; rmtenumcount < field.EnumValueCount(); rmtenumcount++ )
+													{
+													TPtrC8 rmtenumvalue = field.EnumValue( rmtenumcount ).DesC();
+													if( rmtenumvalue.Compare(ownparamname)== 0 )
+														{
+														removeMe = EFalse;
+														break;
+														}
+													} 
+												}
+											else
+												{
+												removeMe = EFalse;
+												break;
+												}											
+                                            }
+                                        }
+                                     else
+                                        {
+										//Handling when the device supports VersitTokenType as "Encoding"    
+										if(ownparamname == KVersitTokenENCODING)
+											{
+											removeMe = EFalse;
+											}
+										else
+											{
+	                                         for(TInt remoteparam = 0; remoteparam < remoteProperty.ParamCount(); remoteparam++)
+	                                            {
+	                                            TDesC8 remoteparamname = remoteProperty.Param( remoteparam ).Field().Name().DesC();
+	                                            if(ownparamname.Compare(remoteProperty.Param( remoteparam ).Field().Name().DesC()) == 0)
+	                                                {
+	                                                const CSmlDataField& field = remoteProperty.Param( remoteparam ).Field();
+													if( field.EnumValueCount() > 0)
+														{
+		                                                for( TInt rmtenumcount = 0; rmtenumcount < field.EnumValueCount(); rmtenumcount++ )
+		                                                    {
+		                                                     TPtrC8 rmtenumvalue = field.EnumValue( rmtenumcount ).DesC();
+		                                                     if( rmtenumvalue.Compare(ownparamvalue)== 0 )
+		                                                         {
+		                                                         removeMe = EFalse;
+																 break;
+		                                                         }  
+		                                                    }
+														}
+													else
+														{
+														removeMe = EFalse;
+														break;
+														}
+	                                                }
+												}
+											}                                 
+                                        }
+                                        if( removeMe )
+                                        {
+                                        	break;
+                                        }	
+                                    } 
+                                }
+                            else
+                                {
+                                removeMe = EFalse;
+                                }
+                            }
+                        }
+                    else
+                        {
+                        removeMe = EFalse;
+                        }
+
+                    if( !removeMe )
+                        {
+                        break;
+                        }
+                    }
+                }
+            if( removeMe )
+                {
+                #ifdef __NSML_DEBUG__
+                    TPtrC8 pn( ownProperty.Name() );
+                    DBG_ARGS8(_S8("CNSmlDataModBase::StripAllNotOnPartnerListL(): Dropping %S"), &pn);
+                #endif // __NSML_DEBUG__
+                delete allProps->At( i );
+                allProps->Delete( i );
+                wasModified = ETrue;
+                aModified = ETrue;
+                }
+            else
+                {
+                #ifdef __NSML_DEBUG__
+                    TPtrC8 pn( ownProperty.Name() );
+                    DBG_ARGS8(_S8("CNSmlDataModBase::StripAllNotOnPartnerListL(): NOT dropping %S"), &pn);
+                #endif // __NSML_DEBUG__
+                i++;
+                }
+            }
+        // can't use aModified as that may have been set earlier!
+        if( wasModified )
+            {
+            allProps->Compress();
+            }
+        }
+    _DBG_FILE("CNSmlDataModBase::StripAllNotOnPartnerListL(): end");
+    }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::MergeL
+// Merges data from old item to new item.
+// ------------------------------------------------------------------------------------------------
+void CNSmlDataModBase::MergeL( TDes8& aNewItem, const TDesC8& aOldItem,TBool aFieldLevel )
+	{
+	TBool modified( EFalse );
+	CVersitParser* newItemParser = ChildCreateParserLC();
+	RDesReadStream newStream( aNewItem );
+	CleanupClosePushL( newStream );
+	newItemParser->InternalizeL( newStream );
+	CVersitParser* oldItemParser = ChildCreateParserLC();
+	RDesReadStream oldStream( aOldItem );
+	CleanupClosePushL( oldStream );
+	oldItemParser->InternalizeL( oldStream );
+
+	// Now we're ready to start analysis
+	CArrayPtr<CVersitParser>* newEntities = newItemParser->ArrayOfEntities( EFalse );
+	CArrayPtr<CVersitParser>* oldEntities = oldItemParser->ArrayOfEntities( ETrue );
+
+	if( newEntities && oldEntities )
+		{
+		CleanupPtrArrayPushL( oldEntities );
+		for( TInt i = 0; ( i < newEntities->Count() ) && ( i < oldEntities->Count() ); i++ )
+			{
+			MergeEntityL( newEntities->At( i ), oldEntities->At( i ), modified, aFieldLevel );
+			}
+		CleanupStack::PopAndDestroy(); // oldEntities
+		}
+	else
+		{
+		MergeEntityL( newItemParser, oldItemParser, modified, aFieldLevel );
+		}
+
+	// Only update if anything was modified in process
+	if ( modified )
+		{
+		aNewItem.Zero();
+		RDesWriteStream dws( aNewItem );
+		CleanupClosePushL( dws );
+		newItemParser->ExternalizeL( dws );
+		dws.CommitL();
+		CleanupStack::PopAndDestroy(); // dws
+		}
+
+	CleanupStack::PopAndDestroy( 4 ); // oldStream, oldItemParser, newStream, newItemParser
+	}
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDataModBase::MergeEntityL
+// Merges data from old entity to new entity.
+// ------------------------------------------------------------------------------------------------
+void CNSmlDataModBase::MergeEntityL( CVersitParser* aNewEntity, CVersitParser* aOldEntity, TBool& aModified, TBool aFieldLevel ) const
+	{
+	_DBG_FILE("CNSmlDataModBase::MergeEntityL(): begin");
+
+	// Remove all data that was not supposed to be supported by the partner but
+	// it was still sent to us.
+	StripAllNotOnPartnerListL( aNewEntity, aModified );
+	
+	if( !aFieldLevel )
+		{
+		// Remove all properties from old item that are supported by remote server.
+		// If it is field level then old this is not done.
+		StripAllOnPartnerListL( aOldEntity, aModified, ETrue );
+		CArrayPtr<CParserProperty>* mergeProps = aOldEntity->ArrayOfProperties( ETrue );
+		if( mergeProps )
+		    {
+			CleanupStack::PushL( mergeProps );
+			
+			for( TInt i = 0; i < mergeProps->Count(); i++ )
+				{
+				aNewEntity->AddPropertyL( mergeProps->At( i ), ETrue );
+				}
+			
+			CleanupStack::PopAndDestroy(); // mergeProps
+		    }
+		}
+    else // Support for Field level merge
+        {
+        //Field level merge. Merge new item with old item. Properties of 
+        //the old item are copied to new item if the new item entity does not 
+        //contain certain property.
+        //------------------------------------------------------------------------
+        // Old                 New                          Merged                 
+        //------------------------------------------------------------------------
+        // BEGIN:VCARD       -> BEGIN:VCARD                 = BEGIN:VCARD 
+        // VERSION:2.1       -> VERSION:2.1                 = VERSION:2.1
+        // N:Smith;John      -> N:White;John                = N:White;John
+        // ORG:Firm                                         = ORG:Firm
+        // TITLE:Boss                                       = TITLE:Boss
+        //                   -> TEL;CELL;VOICE:1234         = TEL;CELL;VOICE:1234
+        // END:VCARD         -> END:VCARD                   = END:VCARD
+
+        CArrayPtr<CParserProperty>* newProps = aNewEntity->ArrayOfProperties( EFalse );
+        if( newProps )
+            {
+            CArrayPtr<CParserProperty>* oldProps = aOldEntity->ArrayOfProperties( EFalse );
+
+            // Iterate through old list of properties. Add missing properties from old 
+            // contact item, if some of the properties is not included in new item. 
+            for( TInt i = 0; i < oldProps->Count(); ) 
+                {
+                CParserProperty* oldProperty = oldProps->At( i );
+                
+                //Check if the property is included in received vCard
+                CArrayPtr<CParserProperty>* properties = aNewEntity->PropertyL( 
+                    oldProperty->Name(), oldProperty->Uid(), EFalse );
+
+                if ( !properties )
+                    {
+                    // New vCard does not include certain property. Copy all matching properties from 
+                    // existing contact item.
+                    CArrayPtr<CParserProperty>* oldProperties =
+                        aOldEntity->PropertyL( oldProperty->Name(), oldProperty->Uid(), ETrue );
+                    CleanupPtrArrayPushL( oldProperties );
+                    
+                    for ( TInt j = oldProperties->Count()-1; j >= 0; --j )
+                        {
+                        CParserProperty* property = oldProperties->At( j );
+                        oldProperties->Delete( j );
+                        CleanupStack::PushL( property );
+                        aNewEntity->AddPropertyL( property, EFalse );
+                        CleanupStack::Pop( property );
+                        aModified = ETrue;
+                        }       
+                    CleanupStack::PopAndDestroy( oldProperties );
+                    }
+                else
+                    {
+                    // If new vCard includes at least one property with same name we will not copy 
+                    // any any property with same name from existing contact item.
+                    delete properties;
+                     ++i;
+                    }
+                }
+            }
+		}
+	
+	#ifdef __NSML_DEBUG__
+		CArrayPtr<CParserProperty>* props = aNewEntity->ArrayOfProperties( EFalse );
+		for( TInt i = 0; i < props->Count(); i++ )
+			{
+			TBuf8<512> b;
+			const CParserProperty* p = props->At( i );
+			b = p->Name();
+			const CArrayPtr<CParserParam>* pa = ( ( CNSmlProperty* )p )->Parameters();
+			if( pa )
+				{
+				for( TInt i2 = 0; i2 < pa->Count(); i2++ )
+					{
+					b.Append( _L8(":") );
+					b.Append( pa->At( i2 )->Name() );
+					}
+				}
+			DBG_ARGS8(_S8("CNSmlDataModBase::MergeEntityL(): %S"), &b);
+			}
+	#endif // __NSML_DEBUG__
+	_DBG_FILE("CNSmlDataModBase::MergeEntityL(): end");
+	}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/cgiscriptutils/bld/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,22 @@
+/*
+* 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:  CGI Script Utils build file.
+*
+*/
+
+
+PRJ_MMPFILES
+./nsmlCGIScriptParser.mmp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/cgiscriptutils/bld/def/bwinscwcgiscriptparseru.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,16 @@
+EXPORTS
+	??0TNSmlCGIScriptParser@@QAE@XZ @ 1 NONAME ; TNSmlCGIScriptParser::TNSmlCGIScriptParser(void)
+	?AddL@CNSmlCGIScript@@QAEXPAUTNSmlCGIScriptPart@@@Z @ 2 NONAME ; void CNSmlCGIScript::AddL(struct TNSmlCGIScriptPart *)
+	?CGIScript@CNSmlCGIScript@@QBEPAVHBufC16@@XZ @ 3 NONAME ; class HBufC16 * CNSmlCGIScript::CGIScript(void) const
+	?Clear@CNSmlCGIScript@@QAEXXZ @ 4 NONAME ; void CNSmlCGIScript::Clear(void)
+	?Count@CNSmlCGIScript@@QBEHXZ @ 5 NONAME ; int CNSmlCGIScript::Count(void) const
+	?GenerateL@TNSmlCGIScriptParser@@QBEXAAVCNSmlCGIScript@@@Z @ 6 NONAME ; void TNSmlCGIScriptParser::GenerateL(class CNSmlCGIScript &) const
+	?Get@CNSmlCGIScript@@QBEPBUTNSmlCGIScriptPart@@H@Z @ 7 NONAME ; struct TNSmlCGIScriptPart const * CNSmlCGIScript::Get(int) const
+	?LogicalOperator@CNSmlCGIScript@@QBE?AW4TNSmlCGIScriptLogicalOperator@@XZ @ 8 NONAME ; enum TNSmlCGIScriptLogicalOperator CNSmlCGIScript::LogicalOperator(void) const
+	?NewL@CNSmlCGIScript@@SAPAV1@XZ @ 9 NONAME ; class CNSmlCGIScript * CNSmlCGIScript::NewL(void)
+	?NewLC@CNSmlCGIScript@@SAPAV1@XZ @ 10 NONAME ; class CNSmlCGIScript * CNSmlCGIScript::NewLC(void)
+	?ParseL@TNSmlCGIScriptParser@@QBEXAAVCNSmlCGIScript@@ABV?$CArrayPtr@UTNSmlDataTypesForCGIScriptNames@@@@@Z @ 11 NONAME ; void TNSmlCGIScriptParser::ParseL(class CNSmlCGIScript &, class CArrayPtr<struct TNSmlDataTypesForCGIScriptNames> const &) const
+	?Remove@CNSmlCGIScript@@QAEPAUTNSmlCGIScriptPart@@H@Z @ 12 NONAME ; struct TNSmlCGIScriptPart * CNSmlCGIScript::Remove(int)
+	?SetCGIScriptL@CNSmlCGIScript@@QAEXABVTDesC16@@@Z @ 13 NONAME ; void CNSmlCGIScript::SetCGIScriptL(class TDesC16 const &)
+	?SetLogicalOperator@CNSmlCGIScript@@QAEXW4TNSmlCGIScriptLogicalOperator@@@Z @ 14 NONAME ; void CNSmlCGIScript::SetLogicalOperator(enum TNSmlCGIScriptLogicalOperator)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/cgiscriptutils/bld/def/eabicgiscriptparseru.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,19 @@
+EXPORTS
+	_ZN14CNSmlCGIScript13SetCGIScriptLERK7TDesC16 @ 1 NONAME
+	_ZN14CNSmlCGIScript18SetLogicalOperatorE29TNSmlCGIScriptLogicalOperator @ 2 NONAME
+	_ZN14CNSmlCGIScript4AddLEP18TNSmlCGIScriptPart @ 3 NONAME
+	_ZN14CNSmlCGIScript4NewLEv @ 4 NONAME
+	_ZN14CNSmlCGIScript5ClearEv @ 5 NONAME
+	_ZN14CNSmlCGIScript5NewLCEv @ 6 NONAME
+	_ZN14CNSmlCGIScript6RemoveEi @ 7 NONAME
+	_ZN20TNSmlCGIScriptParserC1Ev @ 8 NONAME
+	_ZN20TNSmlCGIScriptParserC2Ev @ 9 NONAME
+	_ZNK14CNSmlCGIScript15LogicalOperatorEv @ 10 NONAME
+	_ZNK14CNSmlCGIScript3GetEi @ 11 NONAME
+	_ZNK14CNSmlCGIScript5CountEv @ 12 NONAME
+	_ZNK14CNSmlCGIScript9CGIScriptEv @ 13 NONAME
+	_ZNK20TNSmlCGIScriptParser6ParseLER14CNSmlCGIScriptRK9CArrayPtrI31TNSmlDataTypesForCGIScriptNamesE @ 14 NONAME
+	_ZNK20TNSmlCGIScriptParser9GenerateLER14CNSmlCGIScript @ 15 NONAME
+	_ZTI14CNSmlCGIScript @ 16 NONAME ; #<TI>#
+	_ZTV14CNSmlCGIScript @ 17 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/cgiscriptutils/bld/nsmlCGIScriptParser.mmp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* 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:  CGI Script Utils mmp file
+*
+*/
+
+
+#include "defaultcaps.hrh"
+#include <platform_paths.hrh>
+
+TARGET          nsmlCGIScriptParser.dll
+TARGETTYPE      dll
+UID             0x1000008d 0x101F6DE4
+CAPABILITY 	CAP_GENERAL_DLL
+VENDORID 	VID_DEFAULT
+
+
+#if defined(ARMCC)
+DEFFILE		./def/eabicgiscriptparser
+#elif defined(WINSCW)
+DEFFILE		./def/bwinscwcgiscriptparser
+#elif defined(WINS)
+DEFFILE		./def/bwinscgiscriptparser
+#else
+DEFFILE		./def/bmarmcgiscriptparser
+#endif
+
+APP_LAYER_SYSTEMINCLUDE
+USERINCLUDE     ../inc
+
+SOURCEPATH      ../src
+SOURCE		nsmlcgiscriptparser.cpp
+SOURCE          NSmlCGIScript.cpp
+SOURCE          NSmlCGIScriptParseStateInfo.cpp
+SOURCE          NSmlCGIScriptParseData.cpp
+
+LIBRARY         euser.lib InetProtUtil.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/cgiscriptutils/inc/nsmlcgiscriptparser.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,493 @@
+/*
+* 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:  CGI parser and generator
+*
+*/
+
+
+#ifndef __TNSMLCGISCRIPTPARSER_H__
+#define __TNSMLCGISCRIPTPARSER_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <e32std.h>
+#include <badesca.h>
+
+// CONSTANTS
+_LIT( KNSmlCGIParserReservedChars, ";/?:@&=+,$[]" );
+_LIT( KNSmlCGIParserDateTimeFormat, "%04u%02u%02uT%02u%02u%02uZ" );
+_LIT( KNSmlCGIParserDateFormat, "%04u%02u%02u" );
+
+_LIT(KNSmlCGIScriptComparatorEqualToCaseSensitiveStr, "&EQ;");
+_LIT(KNSmlCGIScriptComparatorEqualToCaseInSensitiveStr, "&iEQ;");
+_LIT(KNSmlCGIScriptComparatorNotEqualToCaseSensitiveStr, "&NE;");
+_LIT(KNSmlCGIScriptComparatorNotEqualToCaseInSensitiveStr, "&iNE;");
+_LIT(KNSmlCGIScriptComparatorGreaterThanCaseSensitiveStr, "&GT;");
+_LIT(KNSmlCGIScriptComparatorGreaterThanCaseInSensitiveStr, "&iGT;");
+_LIT(KNSmlCGIScriptComparatorGreaterThanOrEqualToCaseSensitiveStr, "&GE;");
+_LIT(KNSmlCGIScriptComparatorGreaterThanOrEqualToCaseInSensitiveStr, "&iGE;");
+_LIT(KNSmlCGIScriptComparatorLessThanCaseSensitiveStr, "&LT;");
+_LIT(KNSmlCGIScriptComparatorLessThanCaseInSensitiveStr, "&iLT;");
+_LIT(KNSmlCGIScriptComparatorLessThanOrEqualCaseSensitiveStr, "&LE;");
+_LIT(KNSmlCGIScriptComparatorLessThanOrEqualCaseInSensitiveStr, "&iLE;");
+_LIT(KNSmlCGIScriptComparatorContainsValueCaseSensitiveStr, "&CON;");
+_LIT(KNSmlCGIScriptComparatorContainsValueCaseInSensitiveStr, "&iCON;");
+
+_LIT(KNSmlCGIScriptLogicalSeparatorAndStr, "&AND;");
+_LIT(KNSmlCGIScriptLogicalSeparatorOrStr, "&OR;");
+
+_LIT(KNSmlCGIScriptNullValue, "&NULL;");
+_LIT(KNSmlCGIScriptLuidValue, "&LUID;");
+
+_LIT(KNSmlCGIScriptNullStr,"");
+
+_LIT(KNSmlCGIScriptBoolTrue, "TRUE");
+_LIT(KNSmlCGIScriptBoolFalse, "FALSE");
+
+const TInt KNSmlCGIScriptLogSepCount = 2;
+const TInt KNSmlCGIParserLogOpsCount = 15;
+const TInt KNSmlCGIScriptSpecialUsageStringsCount = 2;
+
+const TInt KNSmlCGIParserDateTimeLen = 16;
+const TInt KNSmlCGIParserDateLen = 8;
+
+// DATA TYPES
+// ------------------------------------------------------------------------------------------------
+// TNSmlCGIScriptDataType
+// ------------------------------------------------------------------------------------------------
+enum TNSmlCGIScriptDataType
+	{
+	ENSmlCGIScriptDataTypeHBufC,
+	ENSmlCGIScriptDataTypeDate,
+	ENSmlCGIScriptDataTypeDateTime,
+	ENSmlCGIScriptDataTypeNumber,
+	ENSmlCGIScriptDataTypeBoolean,
+    ENSmlCGIScriptDataTypeNoValue,
+	ENSmlCGIScriptDataTypeNull,
+	ENSmlCGIScriptDataTypeUnKnown
+	};
+
+// ------------------------------------------------------------------------------------------------
+// TNSmlCGIScriptLogicalOperator
+// ------------------------------------------------------------------------------------------------
+enum TNSmlCGIScriptLogicalOperator
+	{
+	ENSmlCGIScriptLogicalOperatorAnd,
+	ENSmlCGIScriptLogicalOperatorOr,
+    ENSmlCGIScriptLogicalOperatorNull
+	};
+
+// ------------------------------------------------------------------------------------------------
+// TNSmlCGIScriptComparator
+// ------------------------------------------------------------------------------------------------
+enum TNSmlCGIScriptComparator
+	{
+	ENSmlCGIScriptComparatorEqualToCaseSensitive,
+	ENSmlCGIScriptComparatorEqualToCaseInSensitive,
+	ENSmlCGIScriptComparatorNotEqualToCaseSensitive,
+	ENSmlCGIScriptComparatorNotEqualToCaseInSensitive,
+	ENSmlCGIScriptComparatorGreaterThanCaseSensitive,
+	ENSmlCGIScriptComparatorGreaterThanCaseInSensitive,
+	ENSmlCGIScriptComparatorGreaterThanOrEqualToCaseSensitive,
+	ENSmlCGIScriptComparatorGreaterThanOrEqualToCaseInSensitive,
+	ENSmlCGIScriptComparatorLessThanCaseSensitive,
+	ENSmlCGIScriptComparatorLessThanCaseInSensitive,
+	ENSmlCGIScriptComparatorLessThanOrEqualCaseSensitive,
+	ENSmlCGIScriptComparatorLessThanOrEqualCaseInSensitive,
+	ENSmlCGIScriptComparatorContainsValueCaseSensitive,
+	ENSmlCGIScriptComparatorContainsValueCaseInSensitive,
+    ENSmlCGIScriptComparatorNull
+	};
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+// ------------------------------------------------------------------------------------------------
+// TNSmlCGIScriptPart
+// ------------------------------------------------------------------------------------------------
+struct TNSmlCGIScriptPart
+    {
+    HBufC* iName;
+	TAny* iData;
+	TNSmlCGIScriptDataType iDataType;
+	TNSmlCGIScriptComparator iComparator;
+    };
+
+// ------------------------------------------------------------------------------------------------
+// TNSmlDataTypesForCGIScriptNames
+// ------------------------------------------------------------------------------------------------
+struct TNSmlDataTypesForCGIScriptNames
+	{
+	HBufC* iKeywordOrProperty;
+	TNSmlCGIScriptDataType iDataType;
+	};
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlCGIScript
+// ------------------------------------------------------------------------------------------------
+class CNSmlCGIScript : public CBase
+	{
+public:
+	/**
+    * CNSmlCGIScript NewL.
+    */
+	IMPORT_C static CNSmlCGIScript* NewL();
+
+	/**
+    * CNSmlCGIScript NewLC.
+    */
+	IMPORT_C static CNSmlCGIScript* NewLC();
+	
+	/**
+    * CNSmlCGIScript destructor.
+	* 
+    */
+	~CNSmlCGIScript();
+
+	/**
+    * Returns logical Separator of CNSmlCGIScript.
+    */
+	IMPORT_C TNSmlCGIScriptLogicalOperator LogicalOperator() const;
+
+	/**
+    * Sets logical Separator.
+	* @param aSeparator sets logical Separator of CNSmlCGIScript.
+    */
+	IMPORT_C void SetLogicalOperator( const TNSmlCGIScriptLogicalOperator aSeparator );
+
+	/**
+    * Returns script of CNSmlCGIScript.
+    */
+	IMPORT_C HBufC* CGIScript() const;
+
+	/**
+    * Sets script of CNSmlCGIScript.
+	* @param aCGIScript sets script of CNSmlCGIScript.
+    */
+	IMPORT_C void SetCGIScriptL( const TDesC& aCGIScript );
+
+	/**
+    * Returns number of records in list.
+	* @return TInt Number of records in list.
+    */
+	IMPORT_C TInt Count() const;
+
+	/**
+    * Returns script part at index aIndex from list.
+    * @param aIndex - value between 0 - Count()-1
+	* @return TNSmlCGIScriptPart pointer to script part at index aIndex.
+    */
+	IMPORT_C const TNSmlCGIScriptPart* Get( TInt aIndex ) const;
+
+	/**
+    * Adds new script part to the list.
+	* @param aScriptPart Pointer to script part to add to the list.
+    */
+	IMPORT_C void AddL( TNSmlCGIScriptPart* aScriptPart );
+
+	/**
+    * Removes script part at index aIndex from list.
+	* @param aIndex Index to script part to be removed.
+	* @return TNSmlCGIScriptPart* Pointer to removed script part.
+    */
+	IMPORT_C TNSmlCGIScriptPart* Remove( TInt aIndex );
+
+    /**
+    * Removes all script parts.
+    */
+    IMPORT_C void Clear();
+
+protected:
+	CNSmlCGIScript();
+	void ConstructL();
+	
+private:
+	TNSmlCGIScriptLogicalOperator iSeparator;
+	HBufC* iCGIScript;
+	CArrayPtrFlat<TNSmlCGIScriptPart>* iScriptParts;
+	TAny* iReserved;
+	};
+
+// ------------------------------------------------------------------------------------------------
+//  CGI parser/generator
+// ------------------------------------------------------------------------------------------------
+class TNSmlCGIScriptParser
+    {
+    public:
+// ------------------------------------------------------------------------------------------------
+// TNSmlCGIParserError
+// ------------------------------------------------------------------------------------------------
+        enum TNSmlCGIParserError
+	        {
+	        ENSmlCGIParserErrorOk,
+	        ENSmlCGIParserErrorDataTypeNotFound,
+            ENSmlCGIParserErrorConversion,
+	        ENSmlCGIParserErrorWrongOperator,
+            ENSmlCGIParserErrorWrongSeparator,
+            ENSmlCGIParserErrorParsing,
+            ENSmlCGIParserErrorNoKeyword
+	        };
+
+
+    private:
+        // Private helper classes:
+// ------------------------------------------------------------------------------------------------
+// TNSmlCGIScriptParseState
+// ------------------------------------------------------------------------------------------------
+        enum TNSmlCGIScriptParseState 
+            {
+            ENSmlCGIScriptParseStateKeyWord, 
+            ENSmlCGIScriptParseStateLogOp, 
+            ENSmlCGIScriptParseStateValue, 
+            ENSmlCGIScriptParseStateLogSep
+            };
+
+        // ----------------------------------------------------------------------------------------
+        // TNSmlCGIScriptParseStateInfo
+        // ----------------------------------------------------------------------------------------
+        struct TNSmlCGIScriptParseStateInfo
+            {
+            TNSmlCGIScriptParseStateInfo(
+                const TDesC* aCGIScript,
+                const CArrayPtr<TNSmlDataTypesForCGIScriptNames>* aDatatypes);
+            TNSmlCGIScriptParseState iState;
+            TNSmlCGIScriptParseState iNextState;
+            const TDesC* iCGIScript;
+            const CArrayPtr<TNSmlDataTypesForCGIScriptNames>* iDatatypes;
+            TInt iStartPos;
+            TInt iCurrPos;
+            };
+        // ----------------------------------------------------------------------------------------
+        // TNSmlCGIScriptParseData
+        // ----------------------------------------------------------------------------------------
+        struct TNSmlCGIScriptParseData
+            {
+            TNSmlCGIScriptParseData();
+            TPtrC iKeyword;
+            TNSmlCGIScriptDataType iDataType;
+            TPtrC iValue;
+            TNSmlCGIScriptComparator iComparator;
+            TNSmlCGIScriptLogicalOperator iSeparator;
+            TBool iParseDataReady;
+            };
+
+        friend struct TNSmlCGIScriptParseStateInfo;
+
+    public:  // Constructors and destructor
+
+        
+        /**
+        * constructor.
+        */
+        IMPORT_C TNSmlCGIScriptParser();
+        
+    public: // New functions
+        
+        /**
+        * Converts cgi-script to a data structure.
+        * @param aSp contains cgi-script (=source) and methods to add parsed data structure (=dest.) there.
+        * @param aDatatypes contains all acceptable keyword and property names and their datatypes.
+        */
+        IMPORT_C void ParseL(CNSmlCGIScript& aSp, 
+            const CArrayPtr<TNSmlDataTypesForCGIScriptNames>& aDatatypes) const;
+
+        /**
+        * Converts data structure to cgi-script
+        * @param aS contains the data structure (=source) and method to set the generated cgi-script.
+        */
+        IMPORT_C void GenerateL(CNSmlCGIScript& aS) const;
+        
+    protected:  // New functions
+
+    private:
+
+        /**
+        * In parsing cgi-script, determines whether to split cgi-script at a certain point or not. 
+        * @param aCGIScript - cgi-script
+        * @param aStartFrom - index to cgi-script
+        * @return ETrue if there is split point at aCGIScript[aStartFrom], EFalse otherwise.
+        */
+        TBool IsParseSplitPoint(const TDesC& aCGIScript, TInt aStartFrom) const;
+
+        /**
+        * Does the parsing of cgi-script.
+        * @param aPSInfo contains state information needed for parsing (=source)
+        * @param aPD is filled with data, that is parsed (=dest.)
+        * @return EFalse, if ready for handling of next split point, ETrue, if must be called again before next split point.
+        */
+        TBool ParseStateL(TNSmlCGIScriptParseStateInfo& aPSInfo, TNSmlCGIScriptParseData& aPD) const;
+
+        /**
+        * adds script part to aSp
+        * @param aSp - script to add script part. (=dest)
+        * @param aPD - parsed data, has the data needed for script part.(=source)
+        * @return ETrue, if script part was added, EFalse otherwise.
+        */
+        static TBool AddScriptPartL(CNSmlCGIScript& aSp, TNSmlCGIScriptParseData& aPD);
+
+        /**
+        * parses the script's value.
+        * @param aSp - struct's iData - member receives the parsed value.
+        * @param aValue - value to parse.
+        * @return ETrue, if aSp should be used, EFalse if it should be ignored.
+        */
+        static TBool ParseScriptPartDataLC(TNSmlCGIScriptPart& aSp, const TPtrC& aValue);
+
+        /**
+        * finds datatype for a keyword (=script's keyword or propertyname)
+        * @param aDatatypes - array where to search.
+        * @param aKeyword - keyword to search
+        * @return datatype, leaves if not found
+        */
+        static TNSmlCGIScriptDataType FindDataTypeL(const CArrayPtr<TNSmlDataTypesForCGIScriptNames>& aDatatypes, const TPtrC& aKeyword);
+
+        /**
+        * similar to FindDataTypeL, but doesn't leave if datatype not found, instead returns TNSmlCGIScriptDataTypeUnKnown.
+        * @param aDatatypes - array where to search.
+        * @param aKeyword - keyword to search
+        * @return datatype, leaves if not found
+        */
+        static TNSmlCGIScriptDataType FindDataType(const CArrayPtr<TNSmlDataTypesForCGIScriptNames>& aDatatypes, const TPtrC& aKeyword);
+
+        /**
+        * converts script part to string.
+        * @param aSp - script part to convert
+        * @return converted string.
+        */
+        HBufC* GenerateScriptPartL(const TNSmlCGIScriptPart& aSp) const;
+
+        /**
+        * generates the script's value.
+        * @param aDataType - datatype for value.
+        * @param aValue - value to convert. (=source)
+        * @param aPtr receives the generated value (=dest.)
+        */
+        static void GenerateScriptPartValueL(TNSmlCGIScriptDataType aDataType, const TAny* aValue, TPtr& aPtr);
+
+        /**
+        * collects script-parts to one cgi-script.
+        * @param aSp - where to set the script (=dest)
+        * @param aBufParts - scripts parts to collect (=source)
+        */
+        void SetCGIScriptL(CNSmlCGIScript& aSp, CArrayPtr<HBufC>& aBufParts) const;
+
+        /**
+        * converts cgi-script date to TDateTime.
+        * @param aDateTime receives the parsed datetime(=dest.)
+        * @param aDes - descriptor where date is to be parsed (= source)
+        * @param aStartFrom - index to aDes, where date-string should start.
+        * @return how many letters from aDes[aStartFrom] was needed to get the datetime. 
+        */
+        static TInt ParseDateTimeL(TDateTime& aDateTime, const TDesC& aDes, TInt aStartFrom = 0);
+
+        /**
+        * converts TDateTime to string-format used by cgi-script.
+        * @param aDateTime - the date to convert(=source.)
+        * @param aDes receives the converted date-string. (=dest.)
+        * @param aUseTimePart is ETrue, if timepart (= hour, minute, second) should be converted too.
+        */
+        static void GenerateDateTimeValue(const TDateTime& aDateTime, TDes& aDes, TBool aUseTimePart = ETrue);
+
+        /**
+        * converts boolean value to string-format used by cgi-script.
+        * @param aBool - source boolean value.
+        * @return boolean value as descriptor.
+        */
+        static const TDesC& GenerateBoolValue(TBool aBool);
+
+        /**
+        * converts number as descriptor to TInt.
+        * @param aDes - source number.
+        * @param aStartFrom - index to aDes, where the number should be.
+        * @param aLength - how many numbers follows aDes[aStartFrom].
+        * @return the number as integer.
+        */
+        static TInt ParseIntL(const TDesC& aDes, TInt aStartFrom, TInt aLength);
+
+        /**
+        * converts boolean-value as descriptor to TBool
+        * @param aDes - source boolean-value.
+        * @param aStartFrom - index to aDes, where the boolean-value should be.
+        * @return the boolean-value as TBool.
+        */
+        static TBool ParseBoolL(const TDesC& aDes, TInt aStartFrom = 0);
+        
+        /**
+        * get logical operator as descriptor.
+        * @param aComp - comparator 
+        * @return comparator as string.
+        */
+        const TDesC& LogOpL(TNSmlCGIScriptComparator aComp) const;
+
+        /**
+        * gets comparator from descriptor.
+        * @param aDes - descriptor, where comparator should be.
+        * @param aInd - index to aDes where comparator should be. aInd should point to next letter following '&'.
+        * @return comparator at aDes[aInd] or else leaves.
+        */
+        TNSmlCGIScriptComparator LogOpL(const TDesC& aDes, TInt aInd) const;
+
+        /**
+        * get logical separator as descriptor.
+        * @param aLogSep - separator
+        * @return separator as string.
+        */
+        const TDesC& LogSepL(TNSmlCGIScriptLogicalOperator aLogSep) const;
+
+        /**
+        * gets separator from descriptor.
+        * @param aDes - descriptor, where comparator should be.
+        * @param aInd - index to aDes, where comparator should be. aInd should point to next letter following '&'.
+        * @return separator at aDes[aInd] or else leaves.
+        */
+        TNSmlCGIScriptLogicalOperator LogSepL(const TDesC& aDes, TInt aInd) const;
+
+        /**
+        * compares comparator to one of equality-operators.
+        * @param aComp - comparator to compare.
+        * @return ETrue, if aComp was one of equality-operators, EFalse otherwise.
+        */
+        static TBool IsEqualityOperator(TNSmlCGIScriptComparator aComp);
+
+        /**
+        * checks, if scriptPart-data is valid. Leaves if not.
+        * @param aSp - scriptpart to check.
+        */
+        static void CheckScriptPartValidityL(const TNSmlCGIScriptPart& aSp);
+
+        /**
+        * compares descriptors 
+        * @param aWhat - what to compare.
+        * @param aWhere - where to compare
+        * @param aStartFrom - index to aWhere. 
+        * @return ETrue if aWhat is found exactly at aWhere[aStartFrom], but aWhere can contain letters after the found string.
+        */
+        static TBool Compare(const TDesC& aWhat, const TDesC& aWhere, TInt aStartFrom);
+
+    public:     // Data
+    
+    protected:  // Data
+        
+    private:    // Data
+        const TDesC* KNSmlCGIScriptLogSep[KNSmlCGIScriptLogSepCount];
+        const TDesC* KNSmlCGIScriptLogOps[KNSmlCGIParserLogOpsCount];
+        const TDesC* KNSmlCGIScriptSpecialUsageStrings[KNSmlCGIScriptSpecialUsageStringsCount];        
+    };
+
+#endif      // __TNSMLCGISCRIPTPARSER_H__
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/cgiscriptutils/src/NSmlCGIScript.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,185 @@
+/*
+* Copyright (c) 2002-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:  CGI parser and generator
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "nsmlcgiscriptparser.h"
+
+
+// CONSTANTS
+const TInt KNSmlGranularity = 4;
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::CNSmlCGIScript
+// C++ default constructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlCGIScript::CNSmlCGIScript()
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlCGIScript* CNSmlCGIScript::NewL()
+	{
+	CNSmlCGIScript* self = NewLC();
+	CleanupStack::Pop(); // self
+	return self;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CNSmlCGIScript* CNSmlCGIScript::NewLC()
+	{
+	CNSmlCGIScript* self = new ( ELeave ) CNSmlCGIScript();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	return self;
+	}
+	
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::~CNSmlCGIScript
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CNSmlCGIScript::~CNSmlCGIScript()
+	{
+	delete iCGIScript;
+	Clear();
+	delete iScriptParts;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::ConstructL
+// Symbian 2nd phase constructor.
+// -----------------------------------------------------------------------------
+//
+void CNSmlCGIScript::ConstructL()
+	{
+	iSeparator = ENSmlCGIScriptLogicalOperatorAnd;
+	iScriptParts = new (ELeave) CArrayPtrFlat<TNSmlCGIScriptPart>( KNSmlGranularity );
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::LogicalOperator
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TNSmlCGIScriptLogicalOperator CNSmlCGIScript::LogicalOperator() const
+	{
+	return iSeparator;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::SetLogicalOperator
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlCGIScript::SetLogicalOperator( const TNSmlCGIScriptLogicalOperator aSeparator )
+	{
+	iSeparator = aSeparator;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::CGIScript
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CNSmlCGIScript::CGIScript() const
+	{
+	return iCGIScript;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::SetCGIScriptL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlCGIScript::SetCGIScriptL( const TDesC& aCGIScript )
+	{
+		if ( iCGIScript )
+		{
+		delete iCGIScript;
+		iCGIScript = NULL;
+		}
+	iCGIScript = HBufC::NewL( aCGIScript.Length() );
+	*iCGIScript = aCGIScript;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::Count
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CNSmlCGIScript::Count() const
+	{
+	return iScriptParts->Count();
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::Get
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TNSmlCGIScriptPart* CNSmlCGIScript::Get( TInt aIndex ) const
+	{
+	return iScriptParts->At( aIndex );
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::AddL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlCGIScript::AddL( TNSmlCGIScriptPart* aRecordPart )
+	{
+	iScriptParts->AppendL( aRecordPart );
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::Remove
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TNSmlCGIScriptPart* CNSmlCGIScript::Remove( TInt aIndex )
+	{
+	TNSmlCGIScriptPart* temp = iScriptParts->At( aIndex );
+	iScriptParts->Delete( aIndex );
+	return temp;
+	}
+
+// -----------------------------------------------------------------------------
+// CNSmlCGIScript::Clear
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CNSmlCGIScript::Clear()
+    {
+    for ( TInt i = 0; i < iScriptParts->Count(); i++ )
+		{
+		TNSmlCGIScriptPart* temp = iScriptParts->At( i );
+		delete temp->iName;
+        temp->iName = NULL;
+		delete temp->iData;
+        temp->iData = NULL;
+		}
+  	iScriptParts->ResetAndDestroy();
+    }
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/cgiscriptutils/src/NSmlCGIScriptParseData.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2002-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:  CGI parser and generator
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "nsmlcgiscriptparser.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParseData::TNSmlCGIScriptParseData
+// -----------------------------------------------------------------------------
+//
+TNSmlCGIScriptParser::TNSmlCGIScriptParseData::TNSmlCGIScriptParseData() :
+    iDataType(ENSmlCGIScriptDataTypeUnKnown),
+    iComparator(ENSmlCGIScriptComparatorNull),
+    iSeparator(ENSmlCGIScriptLogicalOperatorNull),
+    iParseDataReady(EFalse){}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/cgiscriptutils/src/NSmlCGIScriptParseStateInfo.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2002-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:  CGI parser and generator
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "nsmlcgiscriptparser.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParseStateInfo::TNSmlCGIScriptParseStateInfo
+// -----------------------------------------------------------------------------
+//
+TNSmlCGIScriptParser::TNSmlCGIScriptParseStateInfo::TNSmlCGIScriptParseStateInfo(
+    const TDesC* aCGIScript,
+    const CArrayPtr<TNSmlDataTypesForCGIScriptNames>* aDatatypes) : 
+
+    iState(ENSmlCGIScriptParseStateKeyWord), 
+    iNextState(ENSmlCGIScriptParseStateKeyWord),
+    iCGIScript(aCGIScript),
+    iDatatypes(aDatatypes),
+    iStartPos(0),
+    iCurrPos(0){}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/cgiscriptutils/src/nsmlcgiscriptparser.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,889 @@
+/*
+* 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:  CGI parser and generator
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <escapeutils.h>
+
+#include "nsmlcgiscriptparser.h"
+#include "nsmlconstants.h" //PtrArrCleanupItem
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::TNSmlCGIScriptParser
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TNSmlCGIScriptParser::TNSmlCGIScriptParser()
+    {
+    //logical separator table initialization
+    KNSmlCGIScriptLogSep[ENSmlCGIScriptLogicalOperatorAnd] = &KNSmlCGIScriptLogicalSeparatorAndStr;
+    KNSmlCGIScriptLogSep[ENSmlCGIScriptLogicalOperatorOr] = &KNSmlCGIScriptLogicalSeparatorOrStr;
+
+    //logical operator table initialization
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorEqualToCaseSensitive] = &KNSmlCGIScriptComparatorEqualToCaseSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorEqualToCaseInSensitive] = &KNSmlCGIScriptComparatorEqualToCaseInSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorNotEqualToCaseSensitive] = &KNSmlCGIScriptComparatorNotEqualToCaseSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorNotEqualToCaseInSensitive] = &KNSmlCGIScriptComparatorNotEqualToCaseInSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorGreaterThanCaseSensitive] = &KNSmlCGIScriptComparatorGreaterThanCaseSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorGreaterThanCaseInSensitive] = &KNSmlCGIScriptComparatorGreaterThanCaseInSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorGreaterThanOrEqualToCaseSensitive] = &KNSmlCGIScriptComparatorGreaterThanOrEqualToCaseSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorGreaterThanOrEqualToCaseInSensitive] = &KNSmlCGIScriptComparatorGreaterThanOrEqualToCaseInSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorLessThanCaseSensitive] = &KNSmlCGIScriptComparatorLessThanCaseSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorLessThanCaseInSensitive] = &KNSmlCGIScriptComparatorLessThanCaseInSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorLessThanOrEqualCaseSensitive] = &KNSmlCGIScriptComparatorLessThanOrEqualCaseSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorLessThanOrEqualCaseInSensitive] = &KNSmlCGIScriptComparatorLessThanOrEqualCaseInSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorContainsValueCaseSensitive] = &KNSmlCGIScriptComparatorContainsValueCaseSensitiveStr; 
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorContainsValueCaseInSensitive] = &KNSmlCGIScriptComparatorContainsValueCaseInSensitiveStr;
+    KNSmlCGIScriptLogOps[ENSmlCGIScriptComparatorNull] = &KNSmlCGIScriptNullStr;
+
+    //special usage table initialization
+    KNSmlCGIScriptSpecialUsageStrings[0] = &KNSmlCGIScriptNullValue;
+    KNSmlCGIScriptSpecialUsageStrings[1] = &KNSmlCGIScriptLuidValue;
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::ParseL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void TNSmlCGIScriptParser::ParseL(
+    CNSmlCGIScript& aSp, 
+    const CArrayPtr<TNSmlDataTypesForCGIScriptNames>& aDatatypes) const
+    {
+
+    aSp.Clear();
+
+    TNSmlCGIScriptParseStateInfo psInfo(aSp.CGIScript(), &aDatatypes);
+    
+    if (psInfo.iCGIScript == NULL)
+        {
+        return;
+        }
+    
+    TNSmlCGIScriptParseData pd;
+
+    //Main parse loop
+    for ( psInfo.iCurrPos = 0; psInfo.iCurrPos < psInfo.iCGIScript->Length();
+        psInfo.iCurrPos++ )
+        {
+        if ( IsParseSplitPoint(*psInfo.iCGIScript, psInfo.iCurrPos) )
+            {
+            for (psInfo.iState = psInfo.iNextState; ParseStateL(psInfo, pd); 
+                 psInfo.iState = psInfo.iNextState )
+                {
+                }
+
+            if ( pd.iParseDataReady )
+                {
+                AddScriptPartL( aSp, pd );
+                pd.iParseDataReady = EFalse;
+                }
+            psInfo.iStartPos = psInfo.iCurrPos + 1;
+            }
+        }
+
+    // parsing script's last value
+    psInfo.iState = psInfo.iNextState;
+    ParseStateL( psInfo, pd );
+    if ( pd.iParseDataReady )
+        {
+        AddScriptPartL( aSp, pd );
+        }
+    else{
+        User::Leave( ENSmlCGIParserErrorParsing );
+        }
+
+    aSp.SetLogicalOperator( pd.iSeparator );
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::GenerateL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void TNSmlCGIScriptParser::GenerateL(CNSmlCGIScript& aSp) const
+    {
+    typedef CArrayPtrFlat<HBufC> CBufParts;
+    CBufParts* bufParts = new (ELeave) CBufParts(aSp.Count());
+    CleanupStack::PushL( PtrArrCleanupItem(HBufC, bufParts) );
+    TInt i;
+
+    //generates all script parts and appends them to array.
+    for (i = 0;i < aSp.Count();i++)
+        {
+        const TNSmlCGIScriptPart* sp = aSp.Get(i);
+        HBufC* bufTmp = GenerateScriptPartL(*sp);
+
+        CleanupStack::PushL(bufTmp);
+        bufParts->AppendL(bufTmp);
+        CleanupStack::Pop(bufTmp);
+        }
+
+    //collects all parts to a single CGI script.
+    SetCGIScriptL(aSp, *bufParts);
+        
+    CleanupStack::PopAndDestroy(bufParts);
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::IsParseSplitPoint
+// -----------------------------------------------------------------------------
+//
+TBool TNSmlCGIScriptParser::IsParseSplitPoint(const TDesC& aCGIScript, TInt aStartFrom) const
+    {
+    if (aCGIScript[aStartFrom] == '&')
+        {
+        for (TInt i(0); i < KNSmlCGIScriptSpecialUsageStringsCount; i++)
+            {
+            if (Compare(*KNSmlCGIScriptSpecialUsageStrings[i], aCGIScript, aStartFrom))
+                {
+                return EFalse;
+                }
+            }
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::ParseStateL
+// -----------------------------------------------------------------------------
+//
+TBool TNSmlCGIScriptParser::ParseStateL(
+    TNSmlCGIScriptParseStateInfo & aPSInfo, 
+    TNSmlCGIScriptParseData & aPD) const
+    {
+    TBool retV(ETrue);
+
+    switch (aPSInfo.iState)
+        {
+        case ENSmlCGIScriptParseStateKeyWord:
+            aPD.iKeyword.Set(aPSInfo.iCGIScript->Mid(aPSInfo.iStartPos, 
+                aPSInfo.iCurrPos - aPSInfo.iStartPos));
+            aPD.iDataType = FindDataTypeL(*aPSInfo.iDatatypes, aPD.iKeyword);
+
+            if (aPD.iDataType == ENSmlCGIScriptDataTypeNoValue)
+                {
+                aPSInfo.iNextState = ENSmlCGIScriptParseStateLogSep;
+                aPD.iValue.Set(TPtrC());
+                aPD.iComparator = ENSmlCGIScriptComparatorNull;
+                aPD.iParseDataReady = ETrue;
+                }
+            else
+                {
+                aPSInfo.iNextState = ENSmlCGIScriptParseStateLogOp;
+                }
+            break;
+        case ENSmlCGIScriptParseStateLogOp:
+            aPD.iComparator = LogOpL(*aPSInfo.iCGIScript,
+                aPSInfo.iCurrPos + 1);
+            aPSInfo.iCurrPos += LogOpL(aPD.iComparator).Length() - 1;
+            aPSInfo.iNextState = ENSmlCGIScriptParseStateValue;
+            retV = EFalse;
+            break;
+        case ENSmlCGIScriptParseStateValue:
+            {
+            aPD.iValue.Set(aPSInfo.iCGIScript->Mid(aPSInfo.iStartPos, 
+                aPSInfo.iCurrPos - aPSInfo.iStartPos));
+
+            aPSInfo.iNextState = ENSmlCGIScriptParseStateLogSep;
+            aPD.iParseDataReady = ETrue;
+            break;
+            }
+        case ENSmlCGIScriptParseStateLogSep:
+            {
+            TNSmlCGIScriptLogicalOperator loTmp(
+                LogSepL(*aPSInfo.iCGIScript, aPSInfo.iCurrPos + 1) );
+
+            if ( aPD.iSeparator != ENSmlCGIScriptLogicalOperatorNull && 
+                (loTmp != aPD.iSeparator) )
+                {
+                //Error: query may contain only 1 type of logical separator
+                User::Leave(ENSmlCGIParserErrorWrongSeparator);
+                }
+            aPD.iSeparator = loTmp;
+
+            aPSInfo.iCurrPos += LogSepL( aPD.iSeparator ).Length() - 1;
+            aPSInfo.iNextState = ENSmlCGIScriptParseStateKeyWord;
+            retV = EFalse;
+            }
+            break;
+        default:
+            User::Leave(ENSmlCGIParserErrorParsing);
+            break;
+        }
+    return retV;
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::AddScriptPartL
+// -----------------------------------------------------------------------------
+//
+TBool TNSmlCGIScriptParser::AddScriptPartL(CNSmlCGIScript& aSp, 
+    TNSmlCGIScriptParseData& aPD)
+    {
+
+    TNSmlCGIScriptDataType datatype(aPD.iDataType);
+
+    TNSmlCGIScriptPart* sp = new (ELeave) TNSmlCGIScriptPart;
+    CleanupStack::PushL(sp);
+
+    sp->iData = NULL;
+    sp->iName = HBufC::NewLC(aPD.iKeyword.Length());
+    *(sp->iName) = aPD.iKeyword;
+
+    sp->iComparator = aPD.iComparator;
+    sp->iDataType = datatype;
+
+    TBool retV = ParseScriptPartDataLC(*sp, aPD.iValue);
+
+    CheckScriptPartValidityL(*sp);
+
+    if (retV)
+        {
+        aSp.AddL(sp);
+        CleanupStack::Pop(3); //ParseScriptPartDataLC:stä, sp->iName,sp;
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy(2); //sp->iName, sp
+        sp->iName = NULL;
+        sp = NULL;
+        }
+    return retV;
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::ParseScriptPartDataLC
+// -----------------------------------------------------------------------------
+//
+TBool TNSmlCGIScriptParser::ParseScriptPartDataLC(
+    TNSmlCGIScriptPart& aSp, 
+    const TPtrC& aValue)
+    {
+    TNSmlCGIScriptDataType datatype( (aValue == KNSmlCGIScriptNullValue) 
+        ? ENSmlCGIScriptDataTypeNull : aSp.iDataType );
+
+    TBool retV(ETrue);
+
+    // in each case - sentence, either push something to cleanupstack, 
+    // set retV to EFalse or leave
+    switch (datatype)
+        {
+        case ENSmlCGIScriptDataTypeHBufC:
+            {
+            aSp.iData = EscapeUtils::EscapeDecodeL(aValue);
+            CleanupStack::PushL(aSp.iData);
+            }
+            break;
+        case ENSmlCGIScriptDataTypeDateTime:
+        case ENSmlCGIScriptDataTypeDate:
+            {
+            TDateTime* dt = new (ELeave) TDateTime();
+            CleanupStack::PushL(dt);
+            TInt num = ParseDateTimeL(*dt, aValue);
+
+            switch(num)
+                {
+                case KNSmlCGIParserDateTimeLen:
+                    aSp.iDataType = ENSmlCGIScriptDataTypeDateTime;
+                    break;
+                case KNSmlCGIParserDateLen:
+                    aSp.iDataType = ENSmlCGIScriptDataTypeDate;
+                    break;
+                default:
+                    User::Leave(ENSmlCGIParserErrorConversion);
+                    break;
+                }
+            aSp.iData = dt;
+            }
+            break;
+        case ENSmlCGIScriptDataTypeNumber:
+            {
+            TInt* num = new (ELeave) TInt();
+            CleanupStack::PushL(num);
+            *num = ParseIntL(aValue, 0, aValue.Length());
+            aSp.iData = num;
+            }
+            break;
+        case ENSmlCGIScriptDataTypeBoolean:
+            {
+            TBool* bln = new (ELeave) TBool;
+            CleanupStack::PushL(bln);
+            *bln = ParseBoolL(aValue);
+            aSp.iData = bln;
+            }
+            break;
+        case ENSmlCGIScriptDataTypeNoValue:
+        case ENSmlCGIScriptDataTypeNull:
+            aSp.iData = NULL;
+            CleanupStack::PushL(aSp.iData);
+            break;
+        default: // TNSmlCGIScriptDataTypeUnKnown
+            User::Leave(ENSmlCGIParserErrorConversion);
+            break;
+        }
+
+    return retV;
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::FindDataTypeL
+// -----------------------------------------------------------------------------
+//
+TNSmlCGIScriptDataType TNSmlCGIScriptParser::FindDataTypeL(
+    const CArrayPtr<TNSmlDataTypesForCGIScriptNames>& aDatatypes, 
+    const TPtrC& aKeyword)
+    {
+    TNSmlCGIScriptDataType dt(FindDataType(aDatatypes, aKeyword));
+    if (dt == ENSmlCGIScriptDataTypeUnKnown)
+        {
+        User::Leave(ENSmlCGIParserErrorDataTypeNotFound);
+        }
+    return dt;
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::FindDataType
+// -----------------------------------------------------------------------------
+//
+TNSmlCGIScriptDataType TNSmlCGIScriptParser::FindDataType(
+    const CArrayPtr<TNSmlDataTypesForCGIScriptNames>& aDatatypes, 
+    const TPtrC& aKeyword)
+    {
+    TNSmlDataTypesForCGIScriptNames* tmp;
+
+    for (TInt i = 0; i < aDatatypes.Count(); i++)
+        {
+        tmp = aDatatypes[i];
+        if (*tmp->iKeywordOrProperty == aKeyword)
+            {
+            return tmp->iDataType;
+            }
+        }
+    return ENSmlCGIScriptDataTypeUnKnown;
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::GenerateScriptPartL
+// -----------------------------------------------------------------------------
+//
+HBufC* TNSmlCGIScriptParser::GenerateScriptPartL(
+    const TNSmlCGIScriptPart& aSp) const
+    {
+
+    CheckScriptPartValidityL(aSp);
+
+    TInt len(LogOpL(aSp.iComparator).Length() + aSp.iName->Length());
+    TAny* value = NULL;
+    TBool destroyValue(EFalse);
+    TNSmlCGIScriptDataType dataType(aSp.iDataType);
+
+    if (aSp.iData == NULL && dataType != ENSmlCGIScriptDataTypeNoValue)
+        {
+        dataType = ENSmlCGIScriptDataTypeNull;
+        }
+
+    if (dataType == ENSmlCGIScriptDataTypeHBufC)
+        {
+        HBufC* buf = EscapeUtils::EscapeEncodeL( 
+            *reinterpret_cast<HBufC*>(aSp.iData), KNSmlCGIParserReservedChars );
+        CleanupStack::PushL(buf);
+        len += buf->Length();
+        destroyValue = ETrue;
+        value = buf;
+        }
+    else
+        {
+        len += 32;              //enough for datetime, number, boolean etc.
+        value = reinterpret_cast<TAny*>(aSp.iData);
+        }
+
+    HBufC* bufTmp = HBufC::NewLC(len);
+    TPtr ptr(bufTmp->Des());
+
+    ptr.Append(*aSp.iName);
+    ptr.Append( LogOpL(aSp.iComparator) );
+    GenerateScriptPartValueL(dataType, value, ptr);
+
+    CleanupStack::Pop(bufTmp);
+
+    if (destroyValue)
+        {
+        CleanupStack::PopAndDestroy(value);
+        }
+
+    return bufTmp;
+
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::GenerateScriptPartValueL
+// -----------------------------------------------------------------------------
+//
+void TNSmlCGIScriptParser::GenerateScriptPartValueL(
+    TNSmlCGIScriptDataType aDataType, 
+    const TAny *aValue,
+    TPtr & aPtr)
+    {
+
+    switch (aDataType)
+        {
+        case ENSmlCGIScriptDataTypeHBufC:
+            {
+            aPtr.Append( *reinterpret_cast<const HBufC*>(aValue) );
+            break;
+            }
+        case ENSmlCGIScriptDataTypeDate:
+            {
+            const TDateTime* dt = reinterpret_cast<const TDateTime*>(aValue);
+            TBuf<KNSmlCGIParserDateLen> des;
+            GenerateDateTimeValue(*dt, des, EFalse);
+            aPtr.Append(des);
+            }
+            break;
+        case ENSmlCGIScriptDataTypeDateTime:
+            {
+            const TDateTime* dt = reinterpret_cast<const TDateTime*>(aValue);
+            TBuf<KNSmlCGIParserDateTimeLen> des;
+            GenerateDateTimeValue(*dt, des, ETrue);
+            aPtr.Append(des);
+            }
+            break;
+        case ENSmlCGIScriptDataTypeNumber:
+            {
+            TBuf<32> des;
+            const TInt* num = reinterpret_cast<const TInt*>(aValue);
+            des.Num(*num);
+            aPtr.Append(des);
+            }
+            break;
+        case ENSmlCGIScriptDataTypeBoolean:
+            {
+            const TBool* bln = reinterpret_cast<const TBool*>(aValue);
+            aPtr.Append(GenerateBoolValue(*bln));
+            }
+            break;
+        case ENSmlCGIScriptDataTypeNull:
+            aPtr.Append(KNSmlCGIScriptNullValue);
+            break;
+        case ENSmlCGIScriptDataTypeNoValue:
+            //empty
+            break;
+        default: //TNSmlCGIScriptDataTypeUnKnown
+            User::Leave(ENSmlCGIParserErrorConversion);
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::SetCGIScriptL
+// -----------------------------------------------------------------------------
+//
+void TNSmlCGIScriptParser::SetCGIScriptL(
+    CNSmlCGIScript& aSp, 
+    CArrayPtr<HBufC>& aBufParts ) const
+    {
+
+    TInt bufPartsCount(aBufParts.Count());
+    TInt i(0);
+    TInt scriptLen(0);
+
+    if (bufPartsCount > 0)
+        {
+
+        //length of entire script
+        for (i = 0; i < bufPartsCount; i++)
+            {
+            scriptLen += aBufParts.At(i)->Length();
+            }
+
+        //adds length of separator between two scriptparts
+        if (bufPartsCount > 1)
+            {
+            scriptLen += (bufPartsCount - 1) * 
+                LogSepL(aSp.LogicalOperator()).Length();
+            }
+
+        //reserves needed memory
+        HBufC* bufTmp = HBufC::NewLC(scriptLen);
+        TPtr ptr(bufTmp->Des());
+
+        //appends all parts to a full script.
+        for (i = 0; i < bufPartsCount;i++)
+            {
+            ptr.Append(*aBufParts.At(i));
+            if (i < (bufPartsCount - 1))
+                {
+                ptr.Append(LogSepL(aSp.LogicalOperator()));
+                }
+            }
+
+        aSp.SetCGIScriptL(*bufTmp);
+        CleanupStack::PopAndDestroy(bufTmp);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::ParseDateTimeL
+// -----------------------------------------------------------------------------
+//
+TInt TNSmlCGIScriptParser::ParseDateTimeL(
+    TDateTime& aDateTime, 
+    const TDesC& aDes, 
+    TInt aStartFrom)
+    {
+
+    enum TDateParseState{ 
+        EDateParseStateDate, 
+        EDateParseStateTime, 
+        EDateParseStateCheckUTC, 
+        EDateParseStateDone};
+
+    TDateParseState stateAfterDate(EDateParseStateTime);
+
+    switch (aDes.Length())
+        {
+        case KNSmlCGIParserDateLen:
+            stateAfterDate = EDateParseStateDone;
+            break;
+        case KNSmlCGIParserDateTimeLen:
+            stateAfterDate = EDateParseStateTime;
+            break;
+        default:
+            User::Leave(ENSmlCGIParserErrorConversion);
+        }
+
+    TInt ind(aStartFrom);
+    const TInt8 DateItemLengths[] = {4, 2, 2, 2, 2, 2};
+    TInt DateValues[6] = {0, 0, 0, 0, 0, 0};
+
+    TDateParseState state(EDateParseStateDate);
+    TDateParseState nextState(state);
+
+    TInt i(0);
+    TInt upto(0);
+
+    while (state != EDateParseStateDone)
+        {
+        switch (state)
+            {
+            case EDateParseStateDate:
+                i = 0;
+                upto = 3;
+                nextState = stateAfterDate;
+                break;
+            case EDateParseStateTime:
+                if (aDes[ind] != 'T')
+                    {
+                    User::Leave(ENSmlCGIParserErrorConversion);
+                    }
+                ind++;
+                upto = 6;
+                nextState = EDateParseStateCheckUTC;
+                break;
+            case EDateParseStateCheckUTC:
+
+                // must be UTC, marked by Z
+                if (aDes[ind] != 'Z')
+                    {
+                    User::Leave(ENSmlCGIParserErrorConversion);
+                    }
+                ind++;
+                state = EDateParseStateDone;
+                break;
+            default:
+                User::Leave(KErrGeneral);
+                break;
+            }
+
+        if (state != EDateParseStateDone)
+            {
+            for (; i < upto;i++)
+                {
+                TInt len(DateItemLengths[i]);
+                DateValues[i] = ParseIntL(aDes, ind, len);
+                ind += len;
+                }
+            state = nextState;
+            }
+        }
+    
+    TInt err(aDateTime.Set(DateValues[0], 
+        static_cast<TMonth>(DateValues[1] - 1), DateValues[2], 
+        DateValues[3], DateValues[4], DateValues[5], 0));
+
+    User::LeaveIfError(err);
+    return(ind - aStartFrom);
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::GenerateDateTimeValue
+// -----------------------------------------------------------------------------
+//
+void TNSmlCGIScriptParser::GenerateDateTimeValue(
+    const TDateTime& aDateTime, 
+    TDes& aDes, 
+    TBool aUseTimePart)
+    {
+
+    if (aUseTimePart)
+        {
+        aDes.Format(KNSmlCGIParserDateTimeFormat, aDateTime.Year(), 
+            aDateTime.Month() + 1, aDateTime.Day(), 
+            aDateTime.Hour(), aDateTime.Minute(), aDateTime.Second());
+        }
+    else
+        {
+        aDes.Format(KNSmlCGIParserDateFormat, aDateTime.Year(),
+            aDateTime.Month() + 1, aDateTime.Day());
+        }
+}
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::GenerateBoolValue
+// -----------------------------------------------------------------------------
+//
+const TDesC & TNSmlCGIScriptParser::GenerateBoolValue(TBool aBool)
+    {
+
+    if (aBool)
+        {
+        return KNSmlCGIScriptBoolTrue;
+        }
+    else
+        {
+        return KNSmlCGIScriptBoolFalse;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::ParseIntL
+// -----------------------------------------------------------------------------
+//
+TInt TNSmlCGIScriptParser::ParseIntL(
+    const TDesC& aDes, 
+    TInt aStartFrom, 
+    TInt aLength)
+    {
+
+    TInt num(0);
+    TPtrC des(aDes.Mid(aStartFrom, aLength));
+    TLex lex(des);    
+    TInt t = lex.Val(num);
+    if (t != KErrNone)
+        {
+        User::Leave(t);
+        }
+    if (!lex.Eos())
+        {
+        User::Leave(ENSmlCGIParserErrorConversion);
+        }
+    return num;
+
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::ParseBoolL
+// -----------------------------------------------------------------------------
+//
+TBool TNSmlCGIScriptParser::ParseBoolL(
+    const TDesC& aDes, 
+    TInt aStartFrom)
+    {
+    TBool bln(EFalse);
+    const TDesC* cmp = NULL;
+
+    if ( Compare(*(cmp = &GenerateBoolValue(ETrue)), aDes, aStartFrom) )
+        {
+        bln = ETrue;
+        }
+    else if ( Compare(*(cmp = &GenerateBoolValue(EFalse)), aDes, aStartFrom) )
+        {
+        bln = EFalse;
+        }
+    else
+        {
+        User::Leave(ENSmlCGIParserErrorConversion);
+        }
+
+    if ( cmp->Length() != (aDes.Length() - aStartFrom) )
+        {
+        User::Leave(ENSmlCGIParserErrorConversion);
+        }
+    
+    return bln;
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::LogOpL
+// -----------------------------------------------------------------------------
+//
+const TDesC& TNSmlCGIScriptParser::LogOpL(TNSmlCGIScriptComparator aComp) const
+    {
+    if ( aComp < KNSmlCGIParserLogOpsCount) //range check
+        {
+        return *KNSmlCGIScriptLogOps[aComp];
+        }
+    else
+        {
+        User::Leave(ENSmlCGIParserErrorWrongOperator);
+        }
+    return KNSmlCGIScriptNullStr;
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::LogOpL
+// -----------------------------------------------------------------------------
+//
+TNSmlCGIScriptComparator TNSmlCGIScriptParser::LogOpL(
+    const TDesC& aDes, 
+    TInt aInd) const
+    {
+
+     for (TInt i = 0; i < KNSmlCGIParserLogOpsCount; i++)
+        {
+        TNSmlCGIScriptComparator lo(
+            static_cast<TNSmlCGIScriptComparator>(i));
+
+        if (Compare(LogOpL(lo), aDes, aInd-1))
+            {
+            return lo;
+            }
+        }
+    User::Leave(ENSmlCGIParserErrorWrongOperator);
+
+    return ENSmlCGIScriptComparatorNull;
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::LogSepL
+// -----------------------------------------------------------------------------
+//
+const TDesC & TNSmlCGIScriptParser::LogSepL(
+    TNSmlCGIScriptLogicalOperator aLogSep) const
+    {
+    
+    if ( aLogSep < KNSmlCGIScriptLogSepCount) //range check
+        {
+        return *KNSmlCGIScriptLogSep[aLogSep];
+        }
+    else
+        {
+        User::Leave(ENSmlCGIParserErrorWrongSeparator);
+        }
+
+    return KNSmlCGIScriptNullStr;
+
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::LogSepL
+// -----------------------------------------------------------------------------
+//
+TNSmlCGIScriptLogicalOperator TNSmlCGIScriptParser::LogSepL(
+    const TDesC& aDes, 
+    TInt aInd) const
+    {
+
+    for (TInt i = 0; i < KNSmlCGIScriptLogSepCount; i++)
+        {
+        TNSmlCGIScriptLogicalOperator lo(
+            static_cast<TNSmlCGIScriptLogicalOperator>(i));
+
+        if (Compare(LogSepL(lo), aDes, aInd-1))
+            {
+            return lo;
+            }
+        }
+    User::Leave(ENSmlCGIParserErrorWrongSeparator);
+    return ENSmlCGIScriptLogicalOperatorNull;
+
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::IsEqualityOperator
+// -----------------------------------------------------------------------------
+//
+TBool TNSmlCGIScriptParser::IsEqualityOperator(TNSmlCGIScriptComparator comp)
+    {
+    if (comp >= ENSmlCGIScriptComparatorEqualToCaseSensitive 
+        && comp <= ENSmlCGIScriptComparatorNotEqualToCaseInSensitive)
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::CheckScriptPartValidityL
+// -----------------------------------------------------------------------------
+//
+void TNSmlCGIScriptParser::CheckScriptPartValidityL(const TNSmlCGIScriptPart & aSp)
+    {
+    if (aSp.iData == NULL)
+        {
+        if (aSp.iDataType == ENSmlCGIScriptDataTypeNoValue)
+            {
+            if (aSp.iComparator != ENSmlCGIScriptComparatorNull)
+                {
+                User::Leave(ENSmlCGIParserErrorWrongOperator);
+                }
+            }
+        else if ( !IsEqualityOperator(aSp.iComparator) )
+            {
+            User::Leave(ENSmlCGIParserErrorWrongOperator);
+            }
+        }
+    else
+        {
+        if (aSp.iDataType == ENSmlCGIScriptDataTypeNoValue)
+            {
+            User::Leave(ENSmlCGIParserErrorConversion);
+            }
+        if (aSp.iComparator == ENSmlCGIScriptComparatorNull)
+            {
+            User::Leave(ENSmlCGIParserErrorWrongOperator);
+            }
+        }
+    if (aSp.iName == NULL)
+        {
+        User::Leave(ENSmlCGIParserErrorNoKeyword);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TNSmlCGIScriptParser::Compare
+// -----------------------------------------------------------------------------
+//
+TBool TNSmlCGIScriptParser::Compare(
+    const TDesC& aWhat, 
+    const TDesC& aWhere, 
+    TInt aStartFrom)
+    {
+
+    if((aWhere.Length() - aStartFrom) < aWhat.Length())
+        {
+        return EFalse; //aWhat is longer than what's left in aWhere. No match
+        }
+    TBuf<32> buf( aWhere.Mid(aStartFrom, aWhat.Length()) );
+    return ( buf.Compare(aWhat) == 0 );
+
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/contactsdatastoreextension/contactsdatastoreextension.pro	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  Project file
+#
+
+
+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 \
+		
+		
+IfdefBlock = \
+ "$${LITERAL_HASH}if defined(ARMCC)" \
+ "DEFFILE ./def/eabicontactsdatastoreextension" \
+ "$${LITERAL_HASH}elif defined(WINSCW)" \
+ "DEFFILE ./def/bwinscwcontactsdatastoreextension" \
+ "$${LITERAL_HASH}endif"
+ 
+MMP_RULES += IfdefBlock
+
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/contactsdatastoreextension/def/bwinscwcontactsdatastoreextensionu.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,20 @@
+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)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/contactsdatastoreextension/def/eabicontactsdatastoreextensionu.def	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,26 @@
+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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/contactsdatastoreextension/inc/nsmlcontactsdatastoreextension_p.h	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,129 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/contactsdatastoreextension/sis/contactsdatastoreextension.pkg	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,41 @@
+;
+; 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"},(0x2002DC83),1,0,0
+
+; 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/contactsdatastoreextension/src/nsmlcontactsdatastoreextension.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,276 @@
+/*
+* 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
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/contactsdatastoreextension/src/nsmlcontactsdatastoreextension_p.cpp	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,395 @@
+/*
+* 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( 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);
+    QBuffer contactsbuf;
+    contactsbuf.open(QBuffer::ReadWrite);    
+    mWriter->setDevice( &contactsbuf );    
+    QVersitDocument::VersitType versitType(QVersitDocument::VCard21);
+    
+    QContact contact = mContactManager->contact( uid.iUid );
+    /*error = mContactManager->error();
+    if( error != QContactManager::NoError )
+        {
+        DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ExportContactsL:Error %d"), error );
+        return error; 
+        }*/
+    
+    QVersitDocument document = mExporter->exportContact( contact,versitType );    
+    mWriter->setVersitDocument( document );    
+    bool status = mWriter->writeAll();    
+    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ExportContactsL:status %d"), status);    
+    contactbufbase.InsertL( contactbufbase.Size(), *XQConversions::qStringToS60Desc8( contactsbuf.data() ) );
+    
+    
+    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 :"));      
+    
+    TInt error(KErrNone);
+    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);
+    mReader->readAll(); 
+    
+    foreach (QVersitDocument document, mReader->result()) 
+    {
+        QContact contact = mImporter->importContact(document);
+        mContactManager->saveContact(&contact);
+        error = mContactManager->error();
+        DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ImportContactsL:Error %d"), error );
+        if( error == QContactManager::NoError )
+        {
+            TUint contactid = contact.id().localId();
+            contactItems->AppendL( TUid::Uid( contactid ) );
+            DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ImportContactsL:UID %d"), contactid );
+        }
+    }
+    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::ImportContactsL:Count %d"), contactItems->Count() );
+    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");
+    
+    TBool ret = ETrue;
+    for( TInt count = 0; count < arrDelete->Count(); count++ )
+    {
+        ret = mContactManager->removeContact( arrDelete->At( count ).iUid );
+        if( EFalse == ret )
+        {
+            DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::DeleteContactsL:ERROR : %d"), ret );
+            return ret;
+        }
+    }
+    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::DeleteContactsL: END");
+    
+    return ret;
+    }
+
+/*!
+ * Delete all contacts except selfcontact
+ */
+TBool CNsmlContactsDataStoreExtensionPrivate::DeleteAllContactsL()
+    {
+    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::DeleteAllContactsL: BEGIN");
+    
+    QList<QContactManager::Error> err;
+    TBool ret = ETrue;
+    QContactLocalId selfcontactid = mContactManager->selfContactId();
+    QList<QContactLocalId> contactIds = mContactManager->contacts();
+    int index = contactIds.indexOf( selfcontactid );
+    contactIds.removeAt( index );
+    err = mContactManager->removeContacts( &contactIds );
+    
+    foreach ( const QContactManager::Error error, err )
+    {
+        if( error != QContactManager::NoError )
+        {
+            ret = EFalse;
+            break;
+        }
+    }
+    _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)
+    {
+        cntstores->AppendL( XQConversions::qStringToS60Desc( manager )->Des() );
+    }
+    
+    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::ListStoresL: END");
+    }
+
+
+/*!
+ * Fetch Manager URI
+ */
+TInt64 CNsmlContactsDataStoreExtensionPrivate::MachineIdL()
+    {
+    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::MachineIdL: BEGIN");
+    
+    TInt64 machineid = DefaultHash::Des16( *XQConversions::qStringToS60Desc( 
+                                                                    mContactManager->managerUri() ) );
+    
+    DBG_ARGS(_S("CNsmlContactsDataStoreExtensionPrivate::MachineIdL: %d"), machineid );
+    
+    return machineid;
+    }
+
+/*!
+ * List all contacts
+ */
+void CNsmlContactsDataStoreExtensionPrivate::ListContactsL( CArrayFixFlat<TUid> *contactuidlist )
+    {
+    _DBG_FILE("CNsmlContactsDataStoreExtensionPrivate::ListContactsL: BEGIN");
+    
+    QList<QContactLocalId> contactIds = mContactManager->contacts();    
+     
+    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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/dsutils/dsutils.pro	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  This is the project specification file for the contentcontrol project.
+#
+
+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/group/bld.inf	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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:  build info file for SyncML DS Plug In adapters
+*
+*/
+
+
+#include "../dsutils/cgiscriptutils/bld/bld.inf"
+
+#include "../dsutils/contactsdatastoreextension/bld.inf"
+
+#include "../datamod/bld/bld.inf"
+
+#include "../adapters/bld/bld.inf"
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omads/omadsextensions/omadsextensions.pro	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  This is the project specification file for the contentcontrol project.
+#
+
+TEMPLATE = subdirs
+CONFIG += ordered
+SUBDIRS += dsutils
+
+# 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/rom/omads.iby	Fri Apr 16 14:53:26 2010 +0300
@@ -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:  iby file for Omads components
+*
+*/
+
+
+#ifndef __OMADS_IBY__
+#define __OMADS_IBY__
+
+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_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__
--- a/package_definition.xml	Fri Mar 19 09:27:26 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
-  <package id="contentcontrol" name="Content Control Daemons" levels="plugin app">
-    <collection id="applicationmanagement" name="Application Management" level="app">
-	   	<!-- could this collection be collapsed into a single component? Do all these need to be noted separately? --> 
-      <component id="options" filter="s60" name="Install Options">
-        <unit bldFile="applicationmanagement/options/group"/>
-      </component>
-      <component id="applicationmanagement_client" filter="s60" name="AM Client">
-        <unit bldFile="applicationmanagement/client/group"/>
-      </component>
-      <component id="applicationmanagement_server" filter="s60" name="AM Server">
-        <unit bldFile="applicationmanagement/server/group"/>
-      </component>
-      <component id="rfsplugin" filter="s60" name="AM RFS Plugin" class="plugin">
-        <unit bldFile="applicationmanagement/rfsplugin/group"/>
-      </component>
-      <component id="amadapter2" filter="s60" name="AM Adapter" class="plugin">
-        <unit bldFile="applicationmanagement/amadapter2/group"/>
-      </component>
-      <component id="applicationmanagement_build" filter="s60" name="AM Build">
-		<!-- can the exports be moved into the other components? -->
-        <unit bldFile="applicationmanagement/group"/>
-      </component>
-    </collection>
-    <collection id="customization" name="DM Customization Adapters" level="plugin">
-      <component id="dmutils" name="DM Utils" filter="s60">
-        <unit bldFile="customization/dmutils/bld"/>
-      </component>
-      <component id="uisettingssrv" filter="s60" name="UI Settings Server">
-        <unit bldFile="customization/uisettingssrv/bld"/>
-      </component>
-      <component id="isadapter" filter="s60" name="Idle State Adapter" class="plugin">
-        <unit bldFile="customization/isadapter/bld"/>
-      </component>
-      <component id="supadapter" filter="s60" name="Startup Adapter" class="plugin">
-        <unit bldFile="customization/supadapter/bld"/>
-      </component>
-      <component id="wallpaperadapter" filter="s60" name="Wallpaper Adapter" class="plugin">
-        <unit bldFile="customization/wallpaperadapter/bld"/>
-      </component>
-      <component id="operatorlogoadapter" filter="s60" name="Operator Logo Adapter" class="plugin">
-        <unit bldFile="customization/operatorlogoadapter/bld"/>
-      </component>
-      <component id="screensaveradapter" filter="s60" name="Screen Saver Adapter" class="plugin">
-        <unit bldFile="customization/screensaveradapter/bld"/>
-      </component>
-      <component id="themesadapter" filter="s60" name="Themes Adapter" class="plugin">
-        <unit bldFile="customization/themesadapter/bld"/>
-      </component>
-      <component id="embeddedlinkadapter" filter="s60" name="Embedded Link Adapter" class="plugin">
-        <unit bldFile="customization/embeddedlinkadapter/bld"/>
-      </component>
-      <component id="customization_build" filter="s60" name="DM Customization Build">
-		<!-- can these exports be included in one of the above components? -->
-        <unit bldFile="customization/group"/>
-      </component>
-    </collection>
-    <collection id="omads" name="OMA Data Sync" level="app">
-      <component id="omadsappui" filter="s60" name="OMA DS Application UI">
-        <unit bldFile="omads/omadsappui/group"/>
-      </component>
-      <component id="omadsextensions" filter="s60" name="OMA DS Extensions" class="plugin">
-        <unit bldFile="omads/omadsextensions/group"/>
-        	<!-- should this bld.inf be #included?  -->
-        <!-- <unit bldFile="omads/omadsextensions/dsutils/emailxmlutils/bld"/> -->
-      </component>
-    </collection>
-    <collection id="contentcontrol_info" name="Content Control Daemons Info" level="app">
-      <component id="contentctrl_plat" filter="s60" class="api" name="Content Control Daemons Platforn Interfaces">
-        <unit bldFile="contentctrl_plat/group"/>
-      </component>
-    </collection>
-  </package>
-</SystemDefinition>
--- a/sysdef_1_4_0.dtd	Fri Mar 19 09:27:26 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +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>
- <!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>  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_5_1.dtd	Fri Apr 16 14:53:26 2010 +0300
@@ -0,0 +1,88 @@
+ <!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>