--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/adapter_customization_api.metaxml Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="362b63ad05d47d3510d9b5b064228d45" dataversion="1.0">
+ <name>Adapter Customization API</name>
+ <description>Exports Contact Adapter API to make possible to inherit Contact Adapter and create Extended Contacts Adapters</description>
+ <type>c++</type>
+ <subsystem>omads</subsystem>
+ <libs>
+ <lib name="nsmlcontactsdataprovider.lib" />
+ </libs>
+ <release category="domain"/>
+ <attributes>
+ <!-- This indicates wether the api provedes separate html documentation -->
+ <!-- or is the additional documentation generated from headers. -->
+ <!-- If you are unsuere then the value is "no" -->
+ <htmldocprovided>no</htmldocprovided>
+ <adaptation>no</adaptation>
+ </attributes>
+</api>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/group/bld.inf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: File that exports the files belonging to
+: Adapter Customization API
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+..\inc\NSmlContactsDataProvider.h APP_LAYER_PLATFORM_EXPORT_PATH(NSmlContactsDataProvider.h)
+..\inc\NSmlContactsDataStore.h APP_LAYER_PLATFORM_EXPORT_PATH(NSmlContactsDataStore.h)
+..\inc\MContactsModsFetcher.h APP_LAYER_PLATFORM_EXPORT_PATH(MContactsModsFetcher.h)
+
+PRJ_TESTMMPFILES
+..\tsrc\DummyAdapter\group\nsmldummydataprovider.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/inc/MContactsModsFetcher.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS contacts dataprovider.
+*
+*/
+
+#ifndef MCONTACTSMODSFETCHER_H
+#define MCONTACTSMODSFETCHER_H
+
+// EXTERNAL INCLUDES
+#include <e32def.h>
+
+
+// CLASS DEFINITION
+/**
+ * Interface class for Contacts mods fetcher
+ * @since 3.23
+ */
+class MContactsModsFetcher
+ {
+ public: // Destructor
+
+ virtual ~MContactsModsFetcher() {}
+
+ public: // Abstract methods
+
+ /**
+ * Cancels the current asynchronous request
+ */
+ virtual void CancelRequest( ) = 0;
+
+ /**
+ * Reads all modifications from clients contacts databse.
+ * @param aStatus On completion of the operation, contains the result code.
+ */
+ virtual void FetchModificationsL( TRequestStatus& aStatus ) = 0;
+
+ };
+
+#endif // MCONTACTSMODSFETCHER_H
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/inc/NSmlContactsDataProvider.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS contacts dataprovider.
+*
+*/
+
+
+#ifndef __NSMLCONTACTSDATAPROVIDER_H__
+#define __NSMLCONTACTSDATAPROVIDER_H__
+
+// INCLUDES
+#include <f32file.h>
+#include <SmlDataProvider.h>
+#include <NSmlContactsDataStore.h>
+
+// CLASS DECLARATION
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataProvider
+//
+// @lib nsmlcontactsdataprovider.lib
+// ------------------------------------------------------------------------------------------------
+class CNSmlContactsDataProvider : public CSmlDataProvider
+ {
+ public:
+ /**
+ * Two-phased constructor.
+ */
+ IMPORT_C static CNSmlContactsDataProvider* NewL();
+
+ /**
+ * Destructor.
+ */
+ IMPORT_C virtual ~CNSmlContactsDataProvider();
+
+ protected:
+ /**
+ * Two-phased constructor.
+ */
+ IMPORT_C static CNSmlContactsDataProvider* NewLC();
+
+ /**
+ * This method handles framework events.
+ * @param Frameworks event.
+ * @param aParam1 First parameter.
+ * @param aParam2 Second parameter.
+ */
+ IMPORT_C void DoOnFrameworkEvent(TSmlFrameworkEvent, TInt aParam1, TInt aParam2);
+
+ /**
+ * Check if operation is supported by dataprovider.
+ * @param aOpId Operations type.
+ * @return ETrue if the operation is supported.
+ */
+ IMPORT_C TBool DoSupportsOperation(TUid aOpId) const;
+
+ /**
+ * Gets dataproviders own StoreFormat.
+ */
+ IMPORT_C const CSmlDataStoreFormat& DoStoreFormatL();
+
+ /**
+ * Lists all contacts databases on client.
+ * @return List of contact databases.
+ */
+ IMPORT_C CDesCArray* DoListStoresLC();
+
+ /**
+ * Gets default storename on client.
+ * @return Default storename.
+ */
+ IMPORT_C const TDesC& DoDefaultStoreL();
+
+ /**
+ * Constructs new instance of datastore.
+ * @return Newly created instance.
+ */
+ IMPORT_C CSmlDataStore* DoNewStoreInstanceLC();
+
+ /**
+ This method returns the set of filters that can be used to send to the SyncML server.
+ * @return New filters.
+ */
+ IMPORT_C const RPointerArray<CSyncMLFilter>& DoSupportedServerFiltersL();
+
+ /**
+ This method checks what filters are supported by server.
+ @param aServerDataStoreFormat The store format of server
+ @param aFilters The array that includes filters
+ @param aChangeInfo The change information about changes that data provider did
+ */
+ IMPORT_C void DoCheckSupportedServerFiltersL(const CSmlDataStoreFormat& aServerDataStoreFormat, RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo);
+
+ /**
+ This method updates dynamic filters up-to-date.
+ @param aFilters The array that includes filters
+ @param aChangeInfo The change information about changes that data provider did
+ */
+ IMPORT_C void DoCheckServerFiltersL(RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo);
+
+ /**
+ This method generates a record filter query to be sent to the SyncML server for the provided filters.
+ @param aFilters The filters to be used for the query generation
+ @param aMatch The filter match type to be used
+ @param aFilterMimeType The mime type of the returned filter query
+ @param TSyncMLFilterType The filter type of the returned filter query
+ @param aStoreName The name of used store
+ @return The record filter query to be sent to the SyncML server - empty if no record filter involved
+ for this specific filter
+ */
+ IMPORT_C HBufC* DoGenerateRecordFilterQueryLC(const RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterMatchType aMatch, TDes& aFilterMimeType, TSyncMLFilterType& aFilterType, TDesC& aStoreName);
+
+ /**
+ This method generates a field filter query to be sent to the SyncML server for the provided filters.
+ @param aFilters The filters to be used for the query generation
+ @param aFilterMimeType The mime type of the returned filter query
+ @param aProperties The field filter query to be sent to the SyncML server - empty if no field filter involved
+ for this specific filter
+ @param aStoreName The name of used store
+ */
+ IMPORT_C void DoGenerateFieldFilterQueryL(const RPointerArray<CSyncMLFilter>& aFilters, TDes& aFilterMimeType, RPointerArray<CSmlDataProperty>& aProperties, TDesC& aStoreName);
+
+ /**
+ * C++ constructor.
+ */
+ IMPORT_C CNSmlContactsDataProvider();
+
+ /**
+ * 2nd phase constructor.
+ */
+ IMPORT_C void ConstructL();
+
+ protected: // New
+
+ IMPORT_C virtual const TDesC& GetStoreFormatResourceFileL() const;
+
+ IMPORT_C virtual CNSmlContactsDataStore* CreateDataStoreLC() const;
+
+ private: // data
+ CNSmlContactsDataStore* iContactsDataStore;
+ RPointerArray<CSyncMLFilter> iFilterArray;
+ RFs iRfs;
+ RStringPool iStringPool;
+ CSmlDataStoreFormat* iStoreFormat;
+ };
+
+#endif // __NSMLCONTACTSDATAPROVIDER_H__
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/inc/NSmlContactsDataStore.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,773 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS contacts datastore.
+*
+*/
+
+
+#ifndef __NSMLCONTACTSDATASTORE_H__
+#define __NSMLCONTACTSDATASTORE_H__
+
+// INCLUDE FILES
+#include <SmlDataProvider.h>
+#include <SmlDataFormat.h>
+#include <f32file.h>
+
+//vpbk headers
+#include <CVPbkContactManager.h>
+#include <MVPbkContactStore.h>
+#include <MVPbkContactStoreObserver.h>
+#include <MVPbkBatchOperationObserver.h>
+#include <MVPbkContactViewObserver.h>
+#include <CVPbkSortOrder.h>
+#include <CVPbkContactIdConverter.h>
+#include <CVPbkContactLinkArray.h>
+#include <MVPbkContactViewBase.h>
+#include <MVPbkSingleContactOperationObserver.h>
+#include <CVPbkVCardEng.h>
+#include <MVPbkContactCopyObserver.h>
+#include <MVPbkBatchOperationObserver.h>
+#include <MVPbkContactViewObserver.h>
+#include <MVPbkContactOperationBase.h>
+#include <CVPbkSortOrder.h>
+#include <s32mem.h>
+
+// MACROS
+#define KNSmlvCard21Version TVersion(2,1,0);
+#define KNSmlvCard30Version TVersion(3,0,0);
+
+// CONSTANTS
+_LIT( KNSmlContactStoreNameForDefaultDB, "C:Contacts.cdb" );
+_LIT( KNSmlDriveC, "C" );
+_LIT8( KNSmlvCard30Name, "text/vcard" );
+_LIT8( KNSmlvCard30Ver, "3.0" );
+_LIT8( KNSmlvCard21Name, "text/x-vcard" );
+_LIT8( KNSmlvCard21Ver, "2.1" );
+
+_LIT8( KVersitTokenHOME, "HOME" );
+_LIT8( KVersitTokenWORK, "WORK" );
+_LIT8( KVersitTokenCELL, "CELL" );
+_LIT8( KVersitTokenPAGER,"PAGER" );
+_LIT8( KVersitTokenFAX, "FAX" );
+_LIT8( KVersitTokenVOICE,"VOICE" );
+_LIT8( KVersitTokenVIDEO,"VIDEO" );
+
+//CONSTANTS INTRODUCED FOR HAVING BACKWARD COMPATIBLE PHONE DB SENT TO SERVER
+//THE CHANGE WAS NEEDED AFTER ADAPTING TO VIRTUAL PHONEBOOK
+_LIT( KLegacySymbianDatabase,"C:Contacts.cdb");
+const TInt KOldSymbianDBLength = 20;
+
+_LIT( KVPbhkSymbianDBPrefix,"cntdb://");
+const TInt KVPbhkPrefixLength = 10;
+
+//End NEW CONSTANTS
+const TInt KNSmlContactsGranularity = 8;
+const TInt KNSmlCompactAfterChanges = 16;
+const TInt KNSmlDataStoreMaxSize = 102400; // 100 k
+const TInt KNSmlDefaultStoreNameMaxSize = 256;
+const TInt KNSmlItemDataExpandSize = 1024;
+const TInt KNSmlNoError = 1;
+
+_LIT(KNSmlContactsStoreFormatRsc_1_1_2,"NSmlContactsDataStoreFormat_1_1_2.rsc");
+_LIT(KNSmlContactsStoreFormatRsc_1_2,"NSmlContactsDataStoreFormat_1_2.rsc");
+
+// FORWARD DECLARATIONS
+class MContactsModsFetcher;
+class CNSmlDataModBase;
+class CNSmlChangeFinder;
+class CNSmlDataItemUidSet;
+
+// CLASS DECLARATION
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataStore
+//
+// @lib nsmlcontactsdataprovider.lib
+// ------------------------------------------------------------------------------------------------
+class CNSmlContactsDataStore : public CSmlDataStore,
+ public MVPbkContactStoreObserver,
+ public MVPbkSingleContactOperationObserver,
+ public MVPbkContactCopyObserver,
+ public MVPbkBatchOperationObserver,
+ public MVPbkContactViewObserver,
+ public MVPbkContactOperationBase
+ {
+ public:
+ /**
+ * Two-phased constructor.
+ */
+ IMPORT_C static CNSmlContactsDataStore* NewL();
+
+ /**
+ * Destructor.
+ */
+ IMPORT_C virtual ~CNSmlContactsDataStore();
+
+ /**
+ * Default store name of client.
+ * @return Default store name.
+ */
+ IMPORT_C const TDesC& DefaultStoreNameL() const;
+
+ /**
+ * Gets a list of all contacts databases on client.
+ * @return List of databases.
+ */
+ IMPORT_C CDesCArray* DoListStoresLC();
+
+
+ protected:
+ /**
+ * From MVPbkContactStoreListObserver
+ * Called when a contact store is ready to use.
+ */
+ IMPORT_C void StoreReady( MVPbkContactStore& aContactStore );
+
+ /**
+ * From MVPbkContactStoreListObserver
+ * Called when a contact store becomes unavailable.
+ */
+ IMPORT_C void StoreUnavailable(MVPbkContactStore& aContactStore,TInt aReason );
+
+ /**
+ * From MVPbkContactStoreListObserver
+ * Called when changes occur in the contact store.
+ */
+ IMPORT_C void HandleStoreEventL(MVPbkContactStore& aContactStore,TVPbkContactStoreEvent aStoreEvent );
+
+ /**
+ * From MVPbkSingleContactOperationObserver
+ * Called when the operation is completed.
+ */
+ IMPORT_C void VPbkSingleContactOperationComplete(
+ MVPbkContactOperationBase& aOperation,
+ MVPbkStoreContact* aContact );
+
+ /**
+ * From MVPbkSingleContactOperationObserver
+ * Called if the operation fails.
+ */
+ IMPORT_C void VPbkSingleContactOperationFailed(MVPbkContactOperationBase& aOperation, TInt aError );
+
+ /**
+ * From MVPbkContactCopyObserver
+ * Called when the contact has been successfully commited or
+ * copied. Caller takes the ownership of results.
+ */
+ IMPORT_C void ContactsSaved( MVPbkContactOperationBase& aOperation,
+ MVPbkContactLinkArray* aResults ) ;
+
+ /**
+ * From MVPbkContactCopyObserver
+ *Called when there was en error while saving contact(s).
+ */
+ IMPORT_C void ContactsSavingFailed(
+ MVPbkContactOperationBase& aOperation,
+ TInt aError );
+ // From MVPbkBatchOperationObserver
+
+ /**
+ * Called when one step of the operation is complete.
+ * @param aOperation Operation whose step has completed
+ * @param aStepSize Size of the performed step
+ */
+ IMPORT_C void StepComplete( MVPbkContactOperationBase& aOperation,
+ TInt aStepSize );
+
+ /**
+ * Called when one step of the operation fails
+ * @param aOperation Operation whose step has failed
+ * @param aStepSize Size of the performed step
+ * @param aError Error that occured
+ * @return ETrue if the batch operation should continue,
+ * EFalse otherwise
+ */
+ IMPORT_C TBool StepFailed(
+ MVPbkContactOperationBase& aOperation,
+ TInt aStepSize,
+ TInt aError );
+
+ /**
+ * Called when operation is completed
+ * @param aOperation the completed operation
+ */
+ IMPORT_C void OperationComplete( MVPbkContactOperationBase& aOperation );
+
+ /**
+ * From MVPbkContactViewObserver
+ * Called when a view is ready for use.
+ */
+
+ IMPORT_C void ContactViewReady(
+ MVPbkContactViewBase& aView ) ;
+ /**
+ * From MVPbkContactViewObserver
+ * Called when a view is unavailable for a while.
+ */
+ IMPORT_C void ContactViewUnavailable(
+ MVPbkContactViewBase& aView ) ;
+ /**
+ * From MVPbkContactViewObserver
+ * Called when a contact has been added to the view.
+ */
+ IMPORT_C void ContactAddedToView(
+ MVPbkContactViewBase& aView,
+ TInt aIndex,
+ const MVPbkContactLink& aContactLink );
+ /**
+ * From MVPbkContactViewObserver
+ * Called when a contact has been removed from a view.
+ */
+ IMPORT_C void ContactRemovedFromView(
+ MVPbkContactViewBase& aView,
+ TInt aIndex,
+ const MVPbkContactLink& aContactLink ) ;
+ /**
+ * From MVPbkContactViewObserver
+ * Called when an error occurs in the view.
+ */
+ IMPORT_C void ContactViewError(
+ MVPbkContactViewBase& aView,
+ TInt aError,
+ TBool aErrorNotified ) ;
+
+ protected:
+ /**
+ * 2nd phase constructor.
+ */
+ IMPORT_C void ConstructL();
+
+ /*
+ * 2nd phase constructor.
+ * @param aStorename Name of the contact database instance.
+ * @param aLegaceStore Legacy name of the contact database instance.
+ * This store name is used in the communication with server.
+ */
+ IMPORT_C void ConstructL( const TDesC& aStoreName, const TDesC& aLegacyStore );
+ /**
+ * DoOpenL() opens the data store specified by aStoreName asynchronously.
+ * @param aStoreName The name of the data store to open.
+ * @param aContext Identifies the specific synchronisation relationship to use for the synchronisation.
+ * @param aStatus On completion of the open, contains the result code.
+ */
+ IMPORT_C void DoOpenL(const TDesC& aStoreName, MSmlSyncRelationship& aContext, TRequestStatus& aStatus);
+
+ /**
+ * DoCancelRequest() cancels the current asynchronous request, including open. Only one asynchronous request may be outstanding at any one time.
+ */
+ IMPORT_C void DoCancelRequest();
+
+ /**
+ * DoStoreName() returns the name of the open data store.
+ * @return The name of the currently opened data store.
+ */
+ IMPORT_C const TDesC& DoStoreName() const;
+
+ /**
+ * DoBeginTransactionL() starts the transaction mode. During this mode calls to CreateItemL, ReplaceItemL,
+ * WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this transaction.
+ * Their RequestStatus must be completed, even if the change is not yet really executed in the Data Store.
+ * If a RequestStatus is completed with an error code, the transaction has failed and a rollback must be
+ * done. In this case RevertTransaction will be called.
+ */
+ IMPORT_C void DoBeginTransactionL();
+
+ /**
+ * DoCommitTransactionL() will be called at the end of a successful transaction. At this point in time the
+ * operations within the transaction are applied to the Data Store in an atomic way. If all operations
+ * succeed, the RequestStatus must be completed with KErrNone. If an operation fails, a rollback must be
+ * done and the RequestStatus must be completed with an appropriate error code.
+ */
+ IMPORT_C void DoCommitTransactionL(TRequestStatus& aStatus);
+
+ /**
+ * DoRevertTransaction() will be called to abort an ongoing transaction. None of the operations already
+ * submitted may be applied to the Data Store. The RequestStatus must be completed with KErrNone as a revert
+ * cannot fail.
+ */
+ IMPORT_C void DoRevertTransaction(TRequestStatus& aStatus);
+
+ /**
+ * DoBeginBatchL() starts the batch mode. During this mode calls to CreateItemL, ReplaceItemL,
+ * WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this batch.
+ * Their RequestStatus must be completed with KErrNone, which only signals acceptance of the operation
+ * for batch processing.
+ */
+ IMPORT_C void DoBeginBatchL();
+
+ /**
+ * DoCommitBatchL() will be called at the end of the batch mode. This tells the Data Store to
+ * process the batched operations (in the order they were submitted), and to append the error code
+ * for each operation to aResultArray.
+ * The error codes in aResultArray are only valid if the RequestStatus is completed with KErrNone.
+ * If the RequestStatus is completed with an error code none of the operations in the batch mode
+ * were applied to the Data Store.
+ */
+ IMPORT_C void DoCommitBatchL(RArray<TInt>& aResultArray, TRequestStatus& aStatus);
+
+ /**
+ * DoCancelBatch() will be called to abort an ongoing batch mode. None of the operations already
+ * submitted may be applied to the Data Store.
+ */
+ IMPORT_C void DoCancelBatch();
+
+ /**
+ * DoSetRemoteStoreFormatL() sets the SyncML server Data Format - this may optionally be used by the Data
+ * Provider to filter out properties that the server does not support, and should be used to avoid deleting
+ * these properties in case the server sends a changed item to the Data Provider
+ */
+ IMPORT_C void DoSetRemoteStoreFormatL(const CSmlDataStoreFormat& aServerDataStoreFormat);
+
+ /**
+ * DoSetRemoteMaxObjectSize() sets the SyncML server maximum object size - this may optionally be used by the
+ * Data Provider to not send items to the server exceeding its maximum size. 0 means there is no limit.
+ */
+ IMPORT_C void DoSetRemoteMaxObjectSize(TInt aServerMaxObjectSize);
+
+ /**
+ * DoMaxObjectSize() gets the Data Store maximum object size which is reported to the SyncML server. 0 means
+ * there is no limit.
+ * @return The maximum object size.
+ */
+ IMPORT_C TInt DoMaxObjectSize() const;
+
+ /**
+ * DoOpenItemL() opens the data item specified by aUid asynchronously for reading.
+ * @param aUid Item UID which going to be read.
+ * @param aFieldChange Accept field changes.
+ * @param aParent Parent of the item.
+ * @param aSize Size of the item data.
+ * @param aMimeType MIME type of the item.
+ * @param aMimeVer MIME version used on item.
+ * @param aStatus On completion of the opening of item, contains the result code.
+ */
+ IMPORT_C void DoOpenItemL(TSmlDbItemUid aUid, TBool& aFieldChange, TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType, TDes8& aMimeVer, TRequestStatus& aStatus);
+
+ /**
+ * DoCreateItemL() sets the item properties and reference to aUid which will be created.
+ * @param aUid Reference to item UID which going to be created.
+ * @param aSize Size of the item to be created.
+ * @param aParent Parent of the item.
+ * @param aMimeType MIME type of the item.
+ * @param aMimeVer MIME version used on item.
+ * @param aStatus On completion of the creating an item, contains the result code.
+ */
+ IMPORT_C void DoCreateItemL(TSmlDbItemUid& aUid, TInt aSize, TSmlDbItemUid aParent, const TDesC8& aMimeType, const TDesC8& aMimeVer, TRequestStatus& aStatus);
+
+ /**
+ * DoReplaceItemL() opens the data item specified by aUid asynchronously to be updated.
+ * @param aUid Item UID which going to be updated.
+ * @param aSize Size of the item data.
+ * @param aParent Parent of the item.
+ * @param aFieldChange Accept field changes.
+ * @param aStatus On completion of the updating of item, contains the result code.
+ */
+ IMPORT_C void DoReplaceItemL(TSmlDbItemUid aUid, TInt aSize, TSmlDbItemUid aParent, TBool aFieldChange, TRequestStatus& aStatus);
+
+ /**
+ * DoReadItemL() reads data(or size of aBuffer) of an item opened in DoOpenItemL() to given aBuffer.
+ * @param aBuffer Buffer to item data.
+ */
+ IMPORT_C void DoReadItemL(TDes8& aBuffer);
+
+ /**
+ * DoWriteItemL() writes aData of an item opened in DoCreateItemL() or DoReplaceItemL() to be saved on database.
+ * @param aData Item data (or part of data).
+ */
+ IMPORT_C void DoWriteItemL(const TDesC8& aData);
+
+ /**
+ * DoCommitItemL() completes an item operation started in DoCreateItemL() or DoReplaceItemL().
+ * @param aStatus On completion of the operation, contains the result code.
+ */
+ IMPORT_C void DoCommitItemL(TRequestStatus& aStatus);
+
+ /**
+ * DoCloseItem() completes an item operation started in DoOpenItemL().
+ */
+ IMPORT_C void DoCloseItem();
+
+ /**
+ * DoMoveItemL() moves item specified by aUid asynchronously.
+ * @param aUid Item UID which going to be moved.
+ * @param aNewParent A new parent of the item.
+ * @param aStatus On completion of the moving an item, contains the result code.
+ */
+ IMPORT_C void DoMoveItemL(TSmlDbItemUid aUid, TSmlDbItemUid aNewParent, TRequestStatus& aStatus);
+
+ /**
+ * DoDeleteItemL() deletes item specified by aUid asynchronously.
+ * @param aUid Item UID which going to be deleted.
+ * @param aStatus On completion of the deleting an item, contains the result code.
+ */
+ IMPORT_C void DoDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus);
+
+ /**
+ * DoSoftDeleteItemL() soft deletes item specified by aUid asynchronously.
+ * @param aUid Item UID which going to be softdeleted.
+ * @param aStatus On completion of the softdeleting an item, contains the result code.
+ */
+ IMPORT_C void DoSoftDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus);
+
+ /**
+ * DoDeleteAllItemsL() deletes all items from opened database asynchronously.
+ * @param aStatus On completion of delete, contains the result code.
+ */
+ IMPORT_C void DoDeleteAllItemsL(TRequestStatus& aStatus);
+
+ /**
+ * DoHasSyncHistory() checks if previous sync with opened server and context.
+ * @return ETrue if there is synchonization history.
+ */
+ IMPORT_C TBool DoHasSyncHistory() const;
+
+ /**
+ * DoAddedItems() gets all added items on client since previous synchronization.
+ * @return Added items.
+ */
+ IMPORT_C const MSmlDataItemUidSet& DoAddedItems() const;
+
+ /**
+ * DoDeletedItems() gets all deleted items on client since previous synchronization.
+ * @return Deleted items.
+ */
+ IMPORT_C const MSmlDataItemUidSet& DoDeletedItems() const;
+
+ /**
+ * DoSoftDeletedItems() gets all softdeleted items on client since previous synchronization.
+ * @return Soft deleted items.
+ */
+ IMPORT_C const MSmlDataItemUidSet& DoSoftDeletedItems() const;
+
+ /**
+ * DoModifiedItems() gets all modified items on client since previous synchronization.
+ * @return Modified items.
+ */
+ IMPORT_C const MSmlDataItemUidSet& DoModifiedItems() const;
+
+ /**
+ * DoMovedItems() gets all moved items on client since previous synchronization.
+ * @return Moved items.
+ */
+ IMPORT_C const MSmlDataItemUidSet& DoMovedItems() const;
+
+ /**
+ * DoResetChangeInfoL() resets client synchronization data => next time will be slow sync.
+ * @param aStatus On completion of reset, contains the result code.
+ */
+ IMPORT_C void DoResetChangeInfoL(TRequestStatus& aStatus);
+
+ /**
+ * DoCommitChangeInfoL() commits client synchronization changes for given aItems list.
+ * @param aStatus On completion of given items, contains the result code.
+ * @param aItems Item ids to be commited.
+ */
+ IMPORT_C void DoCommitChangeInfoL(TRequestStatus& aStatus, const MSmlDataItemUidSet& aItems);
+
+ /**
+ * DoCommitChangeInfoL() commits all client synchronization changes.
+ * @param aStatus On completion of all items, contains the result code.
+ */
+ IMPORT_C void DoCommitChangeInfoL(TRequestStatus& aStatus);
+
+ /**
+ * Default constructor.
+ */
+ IMPORT_C CNSmlContactsDataStore();
+
+ /**
+ * SetOwnStoreFormatL() Sets dataproviders own storeformat.
+ */
+ IMPORT_C void SetOwnStoreFormatL();
+
+ /**
+ * LdoFetchItemL() Fetches item data from database.
+ * @param aUid Items uid for fetching.
+ * @param aItem Items data after fetch.
+ *
+ */
+ IMPORT_C virtual void LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem );
+
+ /*
+ * LdoAddItemL() Adds item data to database.
+ * @param aItem Item data to be added.
+ * @param aSize Item data size.
+ */
+ IMPORT_C virtual void LdoAddItemL( const TDesC8& aItem,
+ TInt aSize);
+ /*
+ * LdoAddItemL() Adds several items to database.
+ * @param aItem Items data to be added.
+ * @param aSize Items data size.
+ */
+ IMPORT_C virtual void LdoAddItemsL( CBufBase*& aItems,TInt aSize);
+
+ /**
+ * LdoUpdateItemL() Updates item data to database.
+ *
+ */
+ IMPORT_C virtual void LdoUpdateItemL();
+
+ /**
+ * DriveBelowCriticalLevelL() Checks if there is enough space on client to store added item data.
+ * @param aSize Item size to be added.
+ * @return ETrue if there isn't enough drive space.
+ */
+ IMPORT_C TBool DriveBelowCriticalLevelL( TInt aSize );
+
+
+ /**
+ * StripPropertyL() Removes aProperty from aItem data.
+ * @param aItem Item data to be stripped.
+ * @param aProperty Property to be removed from aItem.
+ */
+ IMPORT_C void StripPropertyL( HBufC8*& aItem, const TDesC8& aProperty ) const;
+
+ /**
+ * StripPropertyL() Remove aPropertys from aItem data.
+ * @param aItem Item(s) data to be stripped.
+ * @param aProperty Property to be removed from aItem.
+ */
+ IMPORT_C void StripPropertyL( CBufBase*& aItem, const TDesC8& aProperty ) const;
+
+ /**
+ * ExecuteBufferL() Executes all buffered items from buffer.
+ * @param aResultArray Array to return statuscodes for each command.
+ */
+ IMPORT_C virtual void ExecuteBufferL();
+
+ /**
+ * ExecuteAddL() Executes all the add commands in buffer.
+ */
+ IMPORT_C virtual TInt ExecuteAddL();
+
+ /**
+ * ExecuteDeleteL() Executes all the delete commands in buffer.
+ */
+ IMPORT_C virtual void ExecuteDeleteL();
+
+ /**
+ * ExecuteBufferL() Executes all the update commands in buffer.
+ */
+ IMPORT_C virtual void ExecuteUpdateL();
+
+ /**
+ * ExecuteMoveL() Executes all the move commands in buffer.
+ */
+ IMPORT_C virtual void ExecuteMoveL();
+
+ /**
+ * AddBufferListL()Adds a new item to buffer.
+ * @param aUid New item's uid.
+ * @param aSize New item's size.
+ * @param aStatus New item's status.
+ * @return Pointer to the buffer.
+ */
+ IMPORT_C CBufBase* AddBufferListL(TSmlDbItemUid& aUid, TInt aSize, TInt aStatus);
+
+ /**
+ * Checks if aItem is confidential or not.
+ * @param aItem Item that is checked.
+ * @return TBool ETrue if item is confidential.
+ * Otherwise EFalse is returned.
+ */
+ IMPORT_C TBool IsConfidentialL( MVPbkStoreContact& aItem );
+
+ /**
+ * Leaving function called when fetch/retrieve
+ * operation is complete
+ * @param aContact contact fetched/retrieved
+ *
+ */
+ IMPORT_C void SingleContactOperationCompleteL(MVPbkStoreContact* aContact);
+
+ /**
+ * Create a contact view of the store which is opened
+ */
+ IMPORT_C void CreateViewL();
+
+ /**
+ * Delete all the contacts
+ */
+ IMPORT_C virtual void DoDeleteAllContactsL();
+ /**
+ * Leaving function called when the operation is complete
+ */
+ IMPORT_C void OperationCompleteL();
+ /**
+ * Reset the contacts data buffer
+ */
+ IMPORT_C void ResetBuffer();
+
+ protected: // New
+
+ /**
+ * Returns the file name for the store format resources.
+ * @return Store format resource file name.
+ */
+ IMPORT_C virtual const TDesC& GetStoreFormatResourceFileL();
+
+ /**
+ * Creates the ModsFetcher object for the DataStore.
+ * @return ContactsModsFetcher object.
+ */
+ IMPORT_C virtual MContactsModsFetcher* CreateModsFetcherL();
+
+ /**
+ * Get datamod instance
+ * @return reference to datamod instance.
+ */
+ IMPORT_C virtual CNSmlDataModBase& GetDataMod();
+
+ protected: // data
+
+ // MODULE DATA STRUCTURES
+ enum TNSmlDataStoreStatus // DataStore status
+ {
+ ENSmlClosed = 1,
+ ENSmlOpenAndWaiting,
+ ENSmlItemOverflow,
+ ENSmlItemOpen,
+ ENSmlItemCreating,
+ ENSmlItemUpdating
+ };
+
+ enum TNSmlCntCommand // Modification type
+ {
+ ENSmlCntItemAdd = 1,
+ ENSmlCntItemDelete,
+ ENSmlCntItemSoftDelete,
+ ENSmlCntItemRead,
+ ENSmlCntItemMove,
+ ENSmlCntItemReplace,
+ ENSmlCntItemFieldLevelReplace
+ };
+
+ enum TNSmlLastOp
+ {
+ ENSmlRetrieveOp = 1,
+ ENSmlAddOp,
+ ENSmlDeleteOp,
+ ENSMLFetchOp,
+ ENSMLDeleteAllOp,
+ ENSMLUpdateExportOp,
+ ENSMLUpdateImportOp,
+ ENSmlNone
+ };
+
+
+ // ------------------------------------------------------------------------------------------------
+ // Buffering Stuff for BatchMode operations
+ // ------------------------------------------------------------------------------------------------
+ class CNSmlContactsBufferItem : public CBase
+ {
+ public:
+ /**
+ * Destructor.
+ */
+ ~CNSmlContactsBufferItem();
+
+ public: // data
+ TSmlDbItemUid *iPUid; // New item ID
+ TSmlDbItemUid iUid; // Item ID
+ CBufBase *iItemData; // Item data
+ HBufC8 *iMimeType; // Mimetype
+ HBufC8 *iMimeVersion; // Mime version
+ TNSmlCntCommand iModType; // Commands type
+ TInt iStatus; // Command status
+ TInt iSize; // Item size
+ };
+
+ protected:
+ CNSmlChangeFinder* iChangeFinder;
+ TRequestStatus* iCallerStatus;
+ TBool iSnapshotRegistered;
+ TBool iBatchMode;
+ TBool iOpened;
+ TInt64 iOpenedStoreId;
+ TInt iServerMaxObjectSize;
+ TSmlDbItemUid iUid;
+ TInt iItemPos;
+ TNSmlCntCommand iModType;
+ CBufBase* iItemData;
+ CBufBase* iItemDataAddBatch;
+ CBufFlat* iMergeItem;
+ RPointerArray<CNSmlContactsBufferItem> iContactsBufferItemList;
+ TKeyArrayFix iKey;
+ TBool iSyncHistory;
+ CSmlDataStoreFormat* iStoreFormat;
+ TNSmlDataStoreStatus iState;
+
+ CVPbkContactManager* iContactManager;
+ MVPbkContactStore* iStore;
+ CVPbkContactIdConverter* iIdConverter;
+ MVPbkContactViewBase* iContactViewBase;
+
+ TInt *iSize;
+ RBufWriteStream iWriteStream;
+ RDesReadStream iReadStream;
+ HBufC8* iBuf;
+ TInt iRetCommand;
+ TInt iIndex;
+ TInt iRetrieveCount;
+ RArray<TInt> *iResultArray;
+ TNSmlLastOp iLastOperation;
+
+ TInt iStateItem;
+
+ TBool iFieldLevelReplace;
+
+ private:
+ TBool iTransactionMode;
+ TInt iModificationCount;
+ TPtrC8 iMimeTypeItem;
+ TPtrC8 iMimeVersionItem;
+ TPtrC8 iUsedMimeType;
+ TPtrC8 iUsedMimeVersion;
+ RStringF iServerMimeType;
+ RStringF iServerMimeVersion;
+ HBufC* iDefaultStoreName;
+
+ //The symbian Db name that is used for communication with servers
+ //Changes done to mantain backward compatibility of function
+ HBufC* iPacketStoreName;
+
+ CNSmlDataModBase* iDataMod;
+ MContactsModsFetcher* iContactsModsFetcher;
+
+ RFs iRfs;
+ TInt iDrive;
+ TInt iItemSize;
+
+ HBufC* iStoreName;
+
+ RStringPool iStringPool;
+
+ CNSmlDataItemUidSet* iNewUids;
+ CNSmlDataItemUidSet* iDeletedUids;
+ CNSmlDataItemUidSet* iSoftDeletedUids;
+ CNSmlDataItemUidSet* iReplacedUids;
+ CNSmlDataItemUidSet* iMovedUids;
+
+ RArray<TInt> iAddResultArray;
+
+ CVPbkVCardEng* iVCardEngine ;
+ MVPbkContactLink* iContactLink;
+ CVPbkContactLinkArray* iContactLnks;
+ };
+
+
+#endif // __NSMLCONTACTSDATASTORE_H__
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/bld.inf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: build info file for DS contact adapter unit tests.
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_MMPFILES
+UT_nsmldsdummyadapter.mmp
+
+PRJ_EXPORTS
+testdata\standard.vcf c:\data\testdata\standard.vcf
+testdata\basic.vcf c:\data\testdata\basic.vcf
+testdata\basicInvalid.vcf c:\data\testdata\basicInvalid.vcf
+testdata\multioccurence.vcf c:\data\testdata\multioccurence.vcf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmladaptertestutilities.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,329 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Source code file for contact adapter test utilities.
+*
+*/
+
+#include "CNSmlAdapterTestUtilities.h"
+#include <EUnitMacros.h>
+#include <UTF.H>
+#include <cntitem.h> // CContactCard
+#include <cntfield.h> // CContactItemField
+#include <cntfldst.h> // CContactTextField
+#include <S32MEM.H>
+
+namespace
+ {
+ // EUNIT_PRINT will truncate descriptors longer than 512 characters.
+ const TInt KEunitPrintMaxLength = 512;
+ }
+
+CNSmlAdapterTestUtilities* CNSmlAdapterTestUtilities::NewL()
+ {
+ CNSmlAdapterTestUtilities* self = CNSmlAdapterTestUtilities::NewLC();
+ CleanupStack::Pop();
+ return self;
+ }
+
+CNSmlAdapterTestUtilities* CNSmlAdapterTestUtilities::NewLC()
+ {
+ CNSmlAdapterTestUtilities* self = new( ELeave ) CNSmlAdapterTestUtilities();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+CNSmlAdapterTestUtilities::CNSmlAdapterTestUtilities()
+ {
+ }
+
+CNSmlAdapterTestUtilities::~CNSmlAdapterTestUtilities()
+ {
+ iFs.Close();
+ delete iIdArray;
+ delete iContactDatabase;
+ }
+
+void CNSmlAdapterTestUtilities::ConstructL()
+ {
+ User::LeaveIfError( iFs.Connect() );
+ }
+
+void CNSmlAdapterTestUtilities::OpenVCardFromFileLC( const TDesC& aFileName, RFileReadStream& aReadStream )
+ {
+ TInt err = aReadStream.Open( iFs, aFileName, EFileRead );
+ if (err != KErrNone)
+ {
+ if (err == KErrNotFound)
+ {
+ EUNIT_PRINT( _L("%S ,vCard file not found"), &aFileName );
+ }
+ else if ( err == KErrPathNotFound )
+ {
+ EUNIT_PRINT( _L("%S ,vCard path not found"), &aFileName );
+ }
+ else
+ {
+ EUNIT_PRINT( _L("%S , vCard file cannot be opened. Error code %d"), &aFileName, err );
+ }
+ User::Leave( err );
+ }
+ EUNIT_PRINT( _L("VCard opened") );
+ CleanupClosePushL( aReadStream );
+ }
+
+HBufC* CNSmlAdapterTestUtilities::ReadVCardFromFileLC( const TDesC& aFileName )
+ {
+ HBufC8* vCard8 = ReadVCard8FromFileLC( aFileName );
+ HBufC* vCard = HBufC::NewL( vCard8->Length() );
+ vCard8->Des().Copy( *vCard8 );
+ CleanupStack::PopAndDestroy( vCard8 );
+
+ CleanupStack::PushL( vCard );
+ return vCard;
+ }
+
+HBufC8* CNSmlAdapterTestUtilities::ReadVCard8FromFileLC( const TDesC& aFileName )
+ {
+ RFileReadStream readStream;
+ OpenVCardFromFileLC(aFileName, readStream);
+
+ const TInt fileSize = readStream.Source()->SizeL();
+ CBufFlat* buffer = CBufFlat::NewL( fileSize );
+ CleanupStack::PushL( buffer );
+
+ RBufWriteStream writeStream( *buffer );
+ CleanupClosePushL( writeStream );
+ writeStream.WriteL( readStream );
+ writeStream.CommitL();
+
+ HBufC8* vCard8 = buffer->Ptr(0).AllocL();
+ CleanupStack::PopAndDestroy( 3, &readStream );
+
+ CleanupStack::PushL( vCard8 );
+ return vCard8;
+ }
+
+CBufFlat* CNSmlAdapterTestUtilities::ReadBufFromFileLC( const TDesC& aFileName )
+ {
+ RFileReadStream readStream;
+ OpenVCardFromFileLC(aFileName, readStream);
+
+ const TInt fileSize = readStream.Source()->SizeL();
+ CBufFlat* buffer = CBufFlat::NewL( fileSize );
+ CleanupStack::PushL( buffer );
+
+ RBufWriteStream writeStream( *buffer );
+ CleanupClosePushL( writeStream );
+ writeStream.WriteL( readStream );
+ writeStream.CommitL();
+ CleanupStack::PopAndDestroy( &writeStream );
+ CleanupStack::Pop( buffer );
+ CleanupStack::PopAndDestroy( &readStream );
+ CleanupStack::PushL( buffer );
+ return buffer;
+ }
+
+void CNSmlAdapterTestUtilities::SetupEmptyContactDbL( const TDesC& aDbName )
+ {
+ if( aDbName.Length() > 0 )
+ {
+ iContactDatabase = CContactDatabase::ReplaceL( aDbName );
+ }
+ else
+ {
+ iContactDatabase = CContactDatabase::OpenL(); // Use default contact DB.
+ }
+
+ CContactIdArray* array = iContactDatabase->ContactsChangedSinceL( Time::NullTTime() );
+ CleanupStack::PushL( array );
+ iContactDatabase->DeleteContactsL(*array);
+ CleanupStack::PopAndDestroy( array );
+ }
+
+/**
+ * Setup contact DB with the following contacts
+ * + Tim Tester (id index 0)
+ * + Teddy McTest (id index 1)
+ * + Tod TestHill (id index 2)
+ * + Simon Software (id index 3)
+ * + Cyd Effect (id index 4)
+ * + Nick Name (id index 5)
+ *
+ */
+void CNSmlAdapterTestUtilities::SetupAndPopulateContactDbL( const TDesC& aDbName )
+ {
+ if( aDbName.Length() > 0 )
+ {
+ iContactDatabase = CContactDatabase::ReplaceL( aDbName );
+ }
+ else
+ {
+ iContactDatabase = CContactDatabase::OpenL(); // Use default contact DB.
+ }
+
+ iIdArray = CContactIdArray::NewL();
+
+ // Create test contacts
+ iIdArray->AddL( AddContactL( _L( "Tim" ), _L( "Tester" ), _L( "+358501234567" ) ) );
+ iIdArray->AddL( AddContactL( _L( "Teddy" ), _L("McTest" ), _L( "+358501112222" ) ) );
+ iIdArray->AddL( AddContactL( _L( "Tod" ), _L( "TestHill" ), _L( "+358506666666" ) ) );
+ iIdArray->AddL( AddContactL( _L( "Simon" ), _L( "Software" ), _L( "+3585011223333" ) ) );
+ iIdArray->AddL( AddContactL( _L( "Cyd" ), _L( "Effect" ), _L( "+358503334444" ) ) );
+ iIdArray->AddL( AddContactL( _L( "Nick" ), _L( "Name" ), _L( "+358402223333" ) ) );
+ }
+
+// Helper method to add a simple contact to test contact DB
+TContactItemId CNSmlAdapterTestUtilities::AddContactL(
+ const TDesC& aFirstName,
+ const TDesC& aLastName,
+ const TDesC& aPhoneNumber )
+ {
+ _LIT( KLabelFamilyName, "Last name");
+ _LIT( KLabelGivenName, "First name");
+ _LIT( KLabelPhone, "Phone");
+ //_LIT( KLabelNickname, "X-EPOCSECONDNAME");
+
+ CContactCard* card = CContactCard::NewLC();
+
+ // Family name field
+ CContactItemField* familyNameField =
+ CContactItemField::NewLC( KStorageTypeText, KUidContactFieldFamilyName );
+ familyNameField->SetLabelL( KLabelFamilyName );
+ familyNameField->SetMapping( KUidContactFieldVCardMapUnusedN );
+ familyNameField->TextStorage()->SetTextL( aLastName );
+ card->AddFieldL( *familyNameField ); // Takes ownership
+ CleanupStack::Pop( familyNameField );
+
+ // First name field
+ CContactItemField* nameField =
+ CContactItemField::NewLC( KStorageTypeText, KUidContactFieldGivenName );
+ nameField->SetLabelL( KLabelGivenName );
+ nameField->SetMapping( KUidContactFieldVCardMapUnusedN );
+ nameField->TextStorage()->SetTextL( aFirstName );
+ card->AddFieldL( *nameField );
+ CleanupStack::Pop(nameField);
+
+ // Phone number field
+ CContactItemField* phoneField =
+ CContactItemField::NewLC( KStorageTypeText, KUidContactFieldPhoneNumber );
+ phoneField->SetLabelL( KLabelPhone );
+ phoneField->SetMapping( KUidContactFieldVCardMapTEL );
+ phoneField->TextStorage()->SetTextL( aPhoneNumber );
+ card->AddFieldL( *phoneField );
+ CleanupStack::Pop( phoneField );
+
+ // Nickname field
+ /*if( aNickname.Length() > 0 )
+ {
+ CContactItemField* NicknameField =
+ CContactItemField::NewLC( KStorageTypeText, KUidContactFieldSecondName );
+ NicknameField->SetLabelL( KLabelNickname );
+ NicknameField->SetMapping( KUidContactFieldVCardMapSECONDNAME );
+ NicknameField->TextStorage()->SetTextL( aNickname );
+ card->AddFieldL( *NicknameField );
+ CleanupStack::Pop( NicknameField );
+ }*/
+
+
+ TContactItemId cardId = iContactDatabase->AddNewContactL( *card );
+ CleanupStack::PopAndDestroy( card );
+
+ return cardId;
+ }
+
+/**
+ * Empties the test contact DB to its initial state.
+ */
+void CNSmlAdapterTestUtilities::TeardownAndEmptyContactDbL( const TDesC& aDbName )
+ {
+ iContactDatabase->DeleteContactsL( *iIdArray );
+
+ delete iIdArray;
+ iIdArray = NULL;
+
+ delete iContactDatabase;
+ iContactDatabase = NULL;
+ if( aDbName.Length() > 0 )
+ {
+ TRAP_IGNORE( CContactDatabase::DeleteDatabaseL( aDbName ) );
+ }
+ }
+
+CContactDatabase* CNSmlAdapterTestUtilities::GetDb()
+ {
+ EUNIT_ASSERT( iContactDatabase );
+ return iContactDatabase;
+ }
+
+CContactIdArray* CNSmlAdapterTestUtilities::GetContactArray()
+ {
+ return iIdArray;
+ }
+
+RFs& CNSmlAdapterTestUtilities::FileSession()
+ {
+ return iFs;
+ }
+
+CBufBase* CNSmlAdapterTestUtilities::ExportContactLC( TContactItemId aId )
+ {
+ CContactDatabase* db = CContactDatabase::OpenL(); // Use default contact DB.
+ CleanupStack::PushL( db );
+ CContactIdArray* idArr = CContactIdArray::NewLC();
+ idArr->AddL( aId );
+ CBufFlat* buffer = CBufFlat::NewL( 1024 );
+ CleanupStack::PushL( buffer );
+ RBufWriteStream writeStream( *buffer );
+ CleanupClosePushL( writeStream );
+
+ TRAPD( err, iContactDatabase->ExportSelectedContactsL( TUid::Uid(KVersitEntityUidVCard), *idArr,
+ writeStream, CContactDatabase::EExcludeUid, Versit::EUTF8CharSet ) );
+
+ EUNIT_ASSERT_EQUALS_DESC( err, KErrNone, "ExportSelectedContactsL leave" );
+
+ CleanupStack::PopAndDestroy( &writeStream );
+ CleanupStack::Pop( buffer );
+ CleanupStack::PopAndDestroy( idArr );
+ CleanupStack::PopAndDestroy( db );
+ CleanupStack::PushL( buffer );
+ return buffer;
+ }
+
+void CNSmlAdapterTestUtilities::PrintData( const TDesC& aTitle, CBufBase& aBuf )
+ {
+
+ EUNIT_PRINT( aTitle );
+
+ for (TInt i = 0; i < aBuf.Ptr(0).Length(); i += KEunitPrintMaxLength )
+ {
+ EUNIT_PRINT( aBuf.Ptr(i) );
+ }
+
+ }
+
+void CNSmlAdapterTestUtilities::PrintData( const TDesC8& aTitle, CBufBase& aBuf )
+ {
+
+ EUNIT_PRINT( aTitle );
+
+ for (TInt i = 0; i < aBuf.Ptr(0).Length(); i += KEunitPrintMaxLength )
+ {
+ EUNIT_PRINT( aBuf.Ptr(i) );
+ }
+
+ }
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmladaptertestutilities.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header file for contact adapter test utilities.
+*
+*/
+
+#ifndef CNSMLADAPTERTESTUTILITIES_H_
+#define CNSMLADAPTERTESTUTILITIES_H_
+
+#include <e32base.h>
+#include <f32file.h>
+#include <S32FILE.H>
+#include <cntdb.h> // CContactDatabase
+#include <cntdef.h> // TContactItemId
+
+class CNSmlAdapterTestUtilities : public CBase
+ {
+ public:
+
+ static CNSmlAdapterTestUtilities* NewL();
+ static CNSmlAdapterTestUtilities* NewLC();
+ virtual ~CNSmlAdapterTestUtilities();
+
+ private:
+ CNSmlAdapterTestUtilities();
+ void ConstructL();
+
+ public:
+
+ void OpenVCardFromFileLC( const TDesC& aFileName, RFileReadStream& aReadStream );
+ HBufC* ReadVCardFromFileLC( const TDesC& aFileName );
+ HBufC8* ReadVCard8FromFileLC( const TDesC& aFileName );
+ CBufFlat* ReadBufFromFileLC( const TDesC& aFileName );
+
+ // Setting up / Tearing down a test DB with a few contacts
+ void SetupEmptyContactDbL( const TDesC& aDbName );
+ void SetupAndPopulateContactDbL( const TDesC& aDbName );
+ void TeardownAndEmptyContactDbL( const TDesC& aDbName );
+ CContactDatabase* GetDb();
+ CContactIdArray* GetContactArray();
+ RFs& FileSession();
+ CBufBase* ExportContactLC( TContactItemId aId );
+ void PrintData( const TDesC& aTitle , CBufBase& aBuf );
+ void PrintData( const TDesC8& aTitle , CBufBase& aBuf );
+
+ public:
+ // Helper methods
+ TContactItemId AddContactL( const TDesC& aFirstName,
+ const TDesC& aLastName,
+ const TDesC& aPhoneNumber );
+
+ private:
+ RFs iFs;
+ CContactDatabase* iContactDatabase;
+ CContactIdArray* iIdArray;
+ };
+
+#endif /* CNSMLADAPTERTESTUTILITIES_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydataprovider_test.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,315 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Source code file for contact adapter's dataprovider unit tests.
+*
+*/
+
+#include "CNSmlDummyDataProvider_Test.h"
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <S32MEM.H>
+#include <nsmlconstants.h>
+#include <SmlDataProvider.h>
+#include <e32def.h>
+
+// - Construction -----------------------------------------------------------
+
+CNSmlDummyDataProvider_Test* CNSmlDummyDataProvider_Test::NewL()
+ {
+ CNSmlDummyDataProvider_Test* self = CNSmlDummyDataProvider_Test::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+CNSmlDummyDataProvider_Test* CNSmlDummyDataProvider_Test::NewLC()
+ {
+ CNSmlDummyDataProvider_Test* self = new( ELeave ) CNSmlDummyDataProvider_Test();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+CNSmlDummyDataProvider_Test::~CNSmlDummyDataProvider_Test()
+ {
+ }
+
+CNSmlDummyDataProvider_Test::CNSmlDummyDataProvider_Test()
+ {
+ }
+
+void CNSmlDummyDataProvider_Test::ConstructL()
+ {
+ CEUnitTestSuiteClass::ConstructL();
+ }
+
+// - Test methods -----------------------------------------------------------
+
+
+
+void CNSmlDummyDataProvider_Test::SetupL( )
+ {
+ iCNSmlDummyDataProvider = CNSmlDummyDataProvider::NewL();
+ }
+
+
+void CNSmlDummyDataProvider_Test::Teardown( )
+ {
+ delete iCNSmlDummyDataProvider;
+ iCNSmlDummyDataProvider = NULL;
+ }
+
+
+void CNSmlDummyDataProvider_Test::T_Global_NewLL( )
+ {
+ CNSmlDummyDataProvider* provider = CNSmlDummyDataProvider::NewL();
+ EUNIT_ASSERT(provider);
+ delete provider;
+ }
+
+void CNSmlDummyDataProvider_Test::GreateAdapterL()
+ {
+ TSmlDataProviderId id = {0x101F6DDD};// Contact Adapter Uid
+ CSmlDataProvider* dp = CSmlDataProvider::NewL( id );
+ CSmlDataStore* store = dp->NewStoreInstanceLC();
+ EUNIT_ASSERT( store );
+ CleanupStack::PopAndDestroy( store );
+ TBool operation = dp->SupportsOperation( KUidSmlSupportBatch );
+ EUNIT_ASSERT( operation );
+ operation = dp->SupportsOperation( KUidSmlSupportMultipleStores );
+ EUNIT_ASSERT( operation );
+ operation = dp->SupportsOperation( KUidSmlSupportSuspendResume );
+ EUNIT_ASSERT( !operation );
+ TPtrC storeName = dp->DefaultStoreL();
+ EUNIT_ASSERT( dp->DefaultStoreL().Compare( _L("C:Contacts.cdb") ) == 0 );
+ const CSmlDataStoreFormat& format = dp->StoreFormatL();
+ EUNIT_ASSERT( format.DisplayName().Compare( _L("Contacts") ) == 0 );
+ EUNIT_PRINT( format.DisplayName() );
+ delete dp;
+ }
+
+void CNSmlDummyDataProvider_Test::GetStoreFormatResourceFileLL()
+ {
+ const TDesC& resourceFile = iCNSmlDummyDataProvider->GetStoreFormatResourceFileL();
+ EUNIT_PRINT( resourceFile );
+ }
+
+void CNSmlDummyDataProvider_Test::DoStoreFormatLL()
+ {
+ const CSmlDataStoreFormat& storeFormat = iCNSmlDummyDataProvider->DoStoreFormatL();
+ EUNIT_PRINT( storeFormat.DisplayName() );
+ EUNIT_PRINT( _L("Property count %d"), storeFormat.FolderPropertyCount() );
+ CBufFlat* store = CBufFlat::NewL(512);
+ CleanupStack::PushL( store );
+ RBufWriteStream writeStream(*store, 0);
+ CleanupClosePushL( writeStream );
+ storeFormat.ExternalizeL( writeStream );
+ CleanupStack::PopAndDestroy(2, store);
+ }
+
+void CNSmlDummyDataProvider_Test::TestStoreSupportForPartialSyncL()
+ {
+ const CSmlDataStoreFormat& storeFormat = iCNSmlDummyDataProvider->DoStoreFormatL();
+ EUNIT_ASSERT_EQUALS( storeFormat.MimeFormatCount(), 1 );
+ EUNIT_ASSERT( !storeFormat.MimeFormat(0).FieldLevel() );
+ }
+
+void CNSmlDummyDataProvider_Test::TestStoreSupportMimeTypeL()
+ {
+ _LIT8( KNSmlvCard21Name, "text/x-vcard" );
+ _LIT8( KNSmlvCard21Ver, "2.1" );
+
+ const CSmlDataStoreFormat& storeFormat = iCNSmlDummyDataProvider->DoStoreFormatL();
+ EUNIT_ASSERT_EQUALS( storeFormat.MimeFormatCount() ,1 );
+ EUNIT_ASSERT_EQUALS( storeFormat.MimeFormat(0).MimeType().DesC(), KNSmlvCard21Name() );
+ EUNIT_ASSERT_EQUALS( storeFormat.MimeFormat(0).MimeVersion().DesC(), KNSmlvCard21Ver() );
+ }
+
+void CNSmlDummyDataProvider_Test::DoListStoresLCL()
+ {
+ CDesCArray* store = iCNSmlDummyDataProvider->DoListStoresLC();
+ TPtrC ptrStoreName = ( *store )[ 0 ];
+ EUNIT_PRINT( ptrStoreName );
+ EUNIT_ASSERT( ptrStoreName.Compare( _L("C:Contacts.cdb") ) == 0 );
+ CleanupStack::PopAndDestroy( store );
+ }
+
+void CNSmlDummyDataProvider_Test::DoOnFrameworkEvent()
+ {
+ iCNSmlDummyDataProvider->DoOnFrameworkEvent( TSmlFrameworkEvent( 0 ), 0, 0 );
+ }
+
+void CNSmlDummyDataProvider_Test::DoSupportedServerFiltersL()
+ {
+ RPointerArray<CSyncMLFilter> filterArray;
+ filterArray = iCNSmlDummyDataProvider->DoSupportedServerFiltersL();
+ filterArray.ResetAndDestroy();
+ filterArray.Close();
+ }
+
+void CNSmlDummyDataProvider_Test::DoCheckSupportedServerFiltersL()
+ {
+ const CSmlDataStoreFormat& storeFormat = iCNSmlDummyDataProvider->DoStoreFormatL();
+ RPointerArray<CSyncMLFilter>* filters = new ( ELeave ) RPointerArray<CSyncMLFilter>();
+ CleanupRPtrArrayPushL( filters );
+ TSyncMLFilterChangeInfo changeInfo( ESyncMLDefault );
+ TRAPD( err, iCNSmlDummyDataProvider->DoCheckSupportedServerFiltersL( storeFormat, *filters, changeInfo ) );
+ EUNIT_ASSERT( err == KErrNotSupported );
+ CleanupStack::PopAndDestroy( filters );
+ }
+
+void CNSmlDummyDataProvider_Test::DoCheckServerFiltersL()
+ {
+ RPointerArray<CSyncMLFilter>* filters = new ( ELeave ) RPointerArray<CSyncMLFilter>();
+ CleanupRPtrArrayPushL( filters );
+ TSyncMLFilterChangeInfo changeInfo( ESyncMLDefault );
+ TRAPD( err, iCNSmlDummyDataProvider->DoCheckServerFiltersL( *filters, changeInfo ) );
+ EUNIT_ASSERT( err == KErrNotSupported );
+ CleanupStack::PopAndDestroy( filters );
+ }
+
+void CNSmlDummyDataProvider_Test::DoGenerateRecordFilterQueryL()
+ {
+ RPointerArray<CSyncMLFilter>* filters = new ( ELeave ) RPointerArray<CSyncMLFilter>();
+ CleanupRPtrArrayPushL( filters );
+ TSyncMLFilterMatchType matchType( ESyncMLMatchDisabled );
+ TSyncMLFilterType filterType( ESyncMLTypeInclusive );
+ TBuf<100> mimeType;
+
+ TRAPD( err, {
+ HBufC* storeName = NULL;
+ HBufC* record = NULL;
+ record = iCNSmlDummyDataProvider->DoGenerateRecordFilterQueryLC(
+ *filters, matchType, mimeType, filterType, *storeName );
+ delete record;
+ delete storeName;
+ }
+ );
+ EUNIT_ASSERT( err == KErrNotSupported );
+
+ CleanupStack::PopAndDestroy( ); //filters
+ }
+
+void CNSmlDummyDataProvider_Test::DoGenerateFieldFilterQueryL()
+ {
+ RPointerArray<CSyncMLFilter>* filters = new ( ELeave ) RPointerArray<CSyncMLFilter>();
+ CleanupRPtrArrayPushL( filters );
+ RPointerArray<CSmlDataProperty> properties;
+ CleanupStack::PushL( PtrArrCleanupItemRArr( CSmlDataProperty, &properties ) );
+ TBuf<100> mimeType;
+ HBufC* storeName = NULL;
+ TRAPD( err, iCNSmlDummyDataProvider->DoGenerateFieldFilterQueryL( *filters, mimeType, properties, *storeName ) );
+ EUNIT_ASSERT( err == KErrNotSupported );
+ delete storeName;
+ CleanupStack::PopAndDestroy( 2 ); //filters, properties
+ }
+
+// - EUnit test table -------------------------------------------------------
+
+EUNIT_BEGIN_TEST_TABLE(
+ CNSmlDummyDataProvider_Test,
+ "Unit test for Contacts dataprovider.",
+ "UNIT" )
+
+EUNIT_TEST(
+ "Test to verify memory allocation for the object",
+ "CNSmlCmtContactsDataProvider",
+ "",
+ "FUNCTIONALITY",
+ Empty, T_Global_NewLL, Empty)
+
+EUNIT_TEST(
+ "Test to create contact adapter and few other atapter methods",
+ "CNSmlCmtContactsDataProvider",
+ "",
+ "FUNCTIONALITY",
+ Empty, GreateAdapterL, Empty)
+
+EUNIT_TEST(
+ "Test for GetStoreFormatResourceFileL",
+ "CNSmlCmtContactsDataProvider_Test",
+ "",
+ "FUNCTIONALITY",
+ SetupL, GetStoreFormatResourceFileLL, Teardown )
+
+EUNIT_TEST(
+ "Test to verify DoStoreFormatL function",
+ "CNSmlCmtContactsDataProvider_Test",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoStoreFormatLL, Teardown )
+
+EUNIT_TEST(
+ "Test DataStore support for field level partial sync",
+ "CNSmlCmtContactsDataProvider_Test",
+ "",
+ "FUNCTIONALITY",
+ SetupL, TestStoreSupportForPartialSyncL, Teardown )
+
+EUNIT_TEST(
+ "Verify operator specific MIME type",
+ "CNSmlDummyDataProvider_Test",
+ "",
+ "FUNCTIONALITY",
+ SetupL, TestStoreSupportMimeTypeL, Teardown )
+
+EUNIT_TEST(
+ "Verify method DoListStoresLCL return value",
+ "CNSmlDummyDataProvider_Test",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoListStoresLCL, Teardown )
+
+EUNIT_TEST(
+ "Test DoOnFrameworkEvent",
+ "CNSmlDummyDataProvider_Test",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoOnFrameworkEvent, Teardown )
+
+EUNIT_TEST(
+ "Test DoSupportedServerFiltersL",
+ "CNSmlDummyDataProvider_Test",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoSupportedServerFiltersL, Teardown )
+
+EUNIT_TEST(
+ "Test DoCheckSupportedServerFiltersL",
+ "CNSmlDummyDataProvider_Test",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoCheckSupportedServerFiltersL, Teardown )
+
+EUNIT_TEST(
+ "Test DoCheckServerFiltersL",
+ "CNSmlDummyDataProvider_Test",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoCheckServerFiltersL, Teardown )
+
+EUNIT_TEST(
+ "Test DoGenerateRecordFilterQueryL",
+ "CNSmlDummyDataProvider_Test",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoGenerateRecordFilterQueryL, Teardown )
+
+EUNIT_TEST(
+ "Test DoGenerateFieldFilterQueryL",
+ "CNSmlDummyDataProvider_Test",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoGenerateFieldFilterQueryL, Teardown )
+
+EUNIT_END_TEST_TABLE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydataprovider_test.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header file for contact adapter's dataprovider unit tests.
+*
+*/
+
+#ifndef __CNSMLDUMMYDATAPROVIDER_TEST_H__
+#define __CNSMLDUMMYDATAPROVIDER_TEST_H__
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+#include "nsmldummydataprovider.h"
+
+// FORWARD DECLARATIONS
+
+
+// CLASS DEFINITION
+/**
+ * Generated EUnit test suite class.
+ */
+NONSHARABLE_CLASS( CNSmlDummyDataProvider_Test )
+ : public CEUnitTestSuiteClass
+ {
+ public: // Constructors and destructor
+
+ static CNSmlDummyDataProvider_Test* NewL();
+ static CNSmlDummyDataProvider_Test* NewLC();
+ ~CNSmlDummyDataProvider_Test();
+
+ private: // Constructors
+
+ CNSmlDummyDataProvider_Test();
+ void ConstructL();
+
+ private: // New methods
+
+ void Empty() {};
+
+ void SetupL();
+
+ void Teardown();
+
+ void T_Global_NewLL();
+
+ void GreateAdapterL();
+
+ void GetStoreFormatResourceFileLL();
+
+ void DoStoreFormatLL();
+
+ void TestStoreSupportForPartialSyncL();
+
+ void TestStoreSupportMimeTypeL();
+
+ void DoListStoresLCL();
+
+ void DoOnFrameworkEvent();
+
+ void DoSupportedServerFiltersL();
+
+ void DoCheckSupportedServerFiltersL();
+
+ void DoCheckServerFiltersL();
+
+ void DoGenerateRecordFilterQueryL();
+
+ void DoGenerateFieldFilterQueryL();
+
+ private: // Data
+
+ CNSmlDummyDataProvider* iCNSmlDummyDataProvider;
+
+ EUNIT_DECLARE_TEST_TABLE;
+ };
+
+#endif // __CNSMLDUMMYDATAPROVIDER_TEST_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastore_test.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,1320 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Source code file for contact adapter's datastore unit tests.
+*
+*/
+
+#include "CNSmlDummyDataStore_Test.h"
+#include "CNSmlAdapterTestUtilities.h"
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <cntdb.h>
+#include <cntitem.h>
+#include <cntfield.h>
+#include <cntfldst.h>
+#include <s32mem.h>
+#include <BAUTILS.H>
+#include <SmlDataFormat.h>
+#include <CVPbkContactViewDefinition.h>
+#include <CVPbkContactStoreUriArray.h>
+#include <tvpbkcontactstoreuriptr.h>
+#include <VPbkContactStoreUris.h>
+#include "nsmldummydatastore.h"
+#include "cnsmldummydatastorewaiter.h"
+
+namespace
+ {
+ // "abld test export" will export test data.
+ _LIT( KVCardStandard, "c:\\Data\\TestData\\standard.vcf" );
+ _LIT( KVCardBasic, "c:\\Data\\TestData\\basic.vcf" );
+ _LIT( KVCardBasicInvalid, "c:\\Data\\TestData\\basicInvalid.vcf" );
+ _LIT( KVCardMultiOccurence, "c:\\Data\\TestData\\multioccurence.vcf" );
+ }
+
+
+// - Construction -----------------------------------------------------------
+
+CNSmlDummyDataStore_Test* CNSmlDummyDataStore_Test::NewL()
+ {
+ CNSmlDummyDataStore_Test* self = CNSmlDummyDataStore_Test::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+CNSmlDummyDataStore_Test* CNSmlDummyDataStore_Test::NewLC()
+ {
+ CNSmlDummyDataStore_Test* self = new( ELeave ) CNSmlDummyDataStore_Test();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+CNSmlDummyDataStore_Test::~CNSmlDummyDataStore_Test()
+ {
+ iWriteStream.Close();
+ iFsSession.Close();
+ delete iCNSmlDummyDataStore;
+ delete iTestUtilities;
+ delete iContactDatabase;
+ delete iIdArray;
+ delete iStoreWaiter;
+ }
+
+CNSmlDummyDataStore_Test::CNSmlDummyDataStore_Test()
+ {
+ }
+
+void CNSmlDummyDataStore_Test::ConstructL()
+ {
+ CEUnitTestSuiteClass::ConstructL();
+ User::LeaveIfError( iFsSession.Connect() );
+ }
+
+// from MSmlSyncRelationship
+TSmlSyncTaskKey CNSmlDummyDataStore_Test::SyncTaskKey() const
+ {
+ TSmlSyncTaskKey key = 0;
+ return key;
+ }
+
+void CNSmlDummyDataStore_Test::OpenReadStreamLC(
+ RReadStream& /*aReadStream*/, TUid /*aStreamUid*/)
+ {
+ }
+
+void CNSmlDummyDataStore_Test::OpenWriteStreamLC(
+ RWriteStream& aWriteStream, TUid /*aStreamUid*/ )
+ {
+ User::LeaveIfError(
+ iWriteStream.Replace( iFsSession, _L("store.test"), EFileWrite ) );
+ aWriteStream = iWriteStream;
+ CleanupClosePushL( aWriteStream );
+ }
+
+TBool CNSmlDummyDataStore_Test::IsStreamPresentL(TUid /*aStreamUid*/) const
+ {
+ return EFalse;
+ }
+
+// - Test methods -----------------------------------------------------------
+
+// ++++++++++++ SETUP METHODS ++++++++++++
+
+void CNSmlDummyDataStore_Test::SetupL( )
+ {
+ iCNSmlDummyDataStore = CNSmlDummyDataStore::NewL();
+ iTestUtilities = CNSmlAdapterTestUtilities::NewL();
+ // Create contact manager
+ CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
+ uriArray->AppendL( TVPbkContactStoreUriPtr( VPbkContactStoreUris::DefaultCntDbUri() ) );
+ iContactManager = CVPbkContactManager::NewL(*uriArray);
+ CleanupStack::PopAndDestroy(uriArray);
+ }
+
+void CNSmlDummyDataStore_Test::SetupAndOpenStoreL( )
+ {
+ SetupL();
+
+ iStoreWaiter =
+ CNSmlDummyDataStoreWaiter::NewL( *iCNSmlDummyDataStore );
+ iStoreWaiter->OpenStoreL( *this );
+
+ iContactDatabase = CContactDatabase::OpenL();
+ }
+
+void CNSmlDummyDataStore_Test::SetupPopulateDbAndOpenStoreL()
+ {
+ SetupAndPopulateContactDbL();
+
+ EUNIT_ASSERT_NO_LEAVE(
+ iCNSmlDummyDataStore = CNSmlDummyDataStore::NewL() );
+
+ iStoreWaiter =
+ CNSmlDummyDataStoreWaiter::NewL( *iCNSmlDummyDataStore );
+ iStoreWaiter->OpenStoreL( *this );
+ }
+
+/**
+ * Setup contact DB with the following contacts
+ * + Tim Tester (id index 0)
+ * + Teddy McTest (id index 1)
+ * + Tod TestHill (id index 2)
+ * + Simon Software (id index 3)
+ * + Cyd Effect (id index 4)
+ *
+ */
+void CNSmlDummyDataStore_Test::SetupAndPopulateContactDbL()
+ {
+ if( !iContactDatabase )
+ {
+ iContactDatabase = CContactDatabase::OpenL();
+ }
+ if( !iTestUtilities )
+ {
+ iTestUtilities = CNSmlAdapterTestUtilities::NewL();
+ }
+
+ iIdArray = CContactIdArray::NewL();
+
+ // Create test contacts
+ iIdArray->AddL( AddContactL( _L( "Tim" ), _L( "Tester" ), _L( "+358501234567" ) ) );
+ iIdArray->AddL( AddContactL( _L( "Teddy" ), _L("McTest" ), _L( "+358501112222" ) ) );
+ iIdArray->AddL( AddContactL( _L( "Tod" ), _L( "TestHill" ), _L( "+358506666666" ) ) );
+ iIdArray->AddL( AddContactL( _L( "Simon" ), _L( "Software" ), _L( "+3585011223333" ) ) );
+ iIdArray->AddL( AddContactL( _L( "Cyd" ), _L( "Effect" ), _L( "+358503334444" ) ) );
+ }
+
+//// ++++++++++++ TEARDOWN METHODS ++++++++++++
+//
+void CNSmlDummyDataStore_Test::Teardown()
+ {
+ delete iCNSmlDummyDataStore;
+ iCNSmlDummyDataStore = NULL;
+
+ delete iTestUtilities;
+ iTestUtilities = NULL;
+ delete iContactManager;
+ iContactManager = NULL;
+ }
+
+void CNSmlDummyDataStore_Test::TeardownAndCloseStore()
+ {
+ delete iStoreWaiter;
+ iStoreWaiter = NULL;
+
+ delete iContactDatabase;
+ iContactDatabase = NULL;
+
+ Teardown();
+ }
+
+void CNSmlDummyDataStore_Test::TeardownCloseAndEmptyContactDb()
+ {
+ delete iStoreWaiter;
+ iStoreWaiter = NULL;
+
+ delete iCNSmlDummyDataStore;
+ iCNSmlDummyDataStore = NULL;
+
+ TeardownAndEmptyContactDb();
+ }
+
+void CNSmlDummyDataStore_Test::TeardownAndEmptyContactDb()
+ {
+ if (iContactDatabase && iIdArray)
+ {
+ TRAP_IGNORE( iContactDatabase->DeleteContactsL( *iIdArray ) );
+ }
+
+ delete iIdArray;
+ iIdArray = NULL;
+ delete iContactDatabase;
+ iContactDatabase = NULL;
+ delete iTestUtilities;
+ iTestUtilities = NULL;
+ }
+
+// ++++++++++++ UNIT TEST METHODS ++++++++++++
+
+// ====================== CNSmlDummyDataStore ===========================
+
+// MEMORY ALLOCATION FOR DATASTORE
+void CNSmlDummyDataStore_Test::NewLL( )
+ {
+ CNSmlDummyDataStore* dataStore = NULL;
+ EUNIT_ASSERT_NO_LEAVE( dataStore = CNSmlDummyDataStore::NewL() );
+ EUNIT_ASSERT( dataStore );
+ delete dataStore;
+ }
+
+// DoOpenL()
+void CNSmlDummyDataStore_Test::DoOpenLL()
+ {
+ CNSmlDummyDataStoreWaiter* storeWaiter =
+ CNSmlDummyDataStoreWaiter::NewLC( *iCNSmlDummyDataStore );
+
+ TRAPD( err, storeWaiter->OpenStoreL( *this ) );
+
+ // Check for leave
+ EUNIT_PRINT( _L( "Leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoOpenL() leave" );
+ CleanupStack::PopAndDestroy( storeWaiter );
+ }
+
+// DoHasSyncHistory()
+void CNSmlDummyDataStore_Test::DoHasSyncHistoryL()
+ {
+ TBool ret = iCNSmlDummyDataStore->DoHasSyncHistory();
+ EUNIT_ASSERT_DESC( ret == EFalse, "DoHasSyncHistory returns faulty value");
+ }
+
+// DoModifiedItems(), DoCommitChangeInfoL()
+void CNSmlDummyDataStore_Test::DoModifiedItemsL()
+ {
+ const MSmlDataItemUidSet& uiSet = iCNSmlDummyDataStore->DoModifiedItems();
+ EUNIT_ASSERT_DESC( uiSet.ItemCount() == 0, "DoModifiedItems returns faulty uid set");
+
+ TInt returnCode = KErrNone;
+
+ TRAPD( err, returnCode = iStoreWaiter->DoCommitChangeInfoL( uiSet ) );
+
+ // Check for leave
+ EUNIT_PRINT( _L( "Leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitChangeInfoL() leave" );
+
+ // Check for return code
+ EUNIT_PRINT( _L( "Return code: %d" ), returnCode );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitChangeInfoL returns error");
+ }
+
+
+// DoResetChangeInfoL()
+void CNSmlDummyDataStore_Test::DoResetChangeInfoLL()
+ {
+ // Temporarily remove ChangeFinders from Store to prevent leaves
+ // when reseting ChangeFinders in code under test.
+ CNSmlChangeFinder* cF = iCNSmlDummyDataStore->iChangeFinder;
+ iCNSmlDummyDataStore->iChangeFinder = NULL;
+
+ TInt returnCode = KErrNone;
+ TRAPD( err, returnCode = iStoreWaiter->DoResetChangeInfoL() );
+
+ // Return ChangeFinders
+ iCNSmlDummyDataStore->iChangeFinder = cF;
+
+ // Check for leave
+ EUNIT_PRINT( _L( "Leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoResetChangeInfoL() leave" );
+
+ // Check for return code
+ EUNIT_PRINT( _L( "Return code: %d" ), returnCode );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoResetChangeInfoL returns error");
+ }
+
+// DoCommitChangeInfoL()
+void CNSmlDummyDataStore_Test::DoCommitChangeInfoLL()
+ {
+ TInt returnCode = KErrNone;
+ TRAPD( err, returnCode = iStoreWaiter->DoCommitChangeInfoL() );
+
+ // Check for leave
+ EUNIT_PRINT( _L( "Leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitChangeInfoL() leave" );
+
+ // Check for return code
+ EUNIT_PRINT( _L( "Return code: %d" ), returnCode );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitChangeInfoL returns error");
+ }
+
+// Item addition - "Normal" (non-batch) mode
+// (DoCreateItemL(), DoWriteItemL(), DoCommitItemL())
+void CNSmlDummyDataStore_Test::AddSingleItemL()
+ {
+ TBuf8< 20 > type;
+ TBuf8< 20 > ver = KNSmlvCard21Ver();
+ TInt returnCode = KErrNone;
+ iItemUid = KNullContactId;
+
+ // Try creating contact with illegal MIME type
+ EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 1") );
+ TRAPD( err, returnCode = iStoreWaiter->DoCreateItemL(
+ iItemUid, 0, type, ver ) );
+
+ EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( returnCode == KErrNotSupported,
+ "DoCreateItemL() accepts illegal MIME" );
+
+ // Create legal contact
+ type = KNSmlvCard21Name();
+ EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 2") );
+ TRAP( err, returnCode = iStoreWaiter->DoCreateItemL(
+ iItemUid, 512, type, ver ) );
+
+ EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error");
+
+ // Perform item writing to data store
+ HBufC8* vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasic() );
+ EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 3") );
+ // Non-async call (no need for iStoreWaiter usage)
+ TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+ EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+ CleanupStack::PopAndDestroy( vCard );
+
+ // Commit the contact to be created
+ EUNIT_PRINT( _L("Calling DoCommmitItemL(), STEP 4") );
+ TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
+
+ EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitItemL returns error");
+
+ // Check the imported item
+ EUNIT_ASSERT_DESC( iItemUid != KNullContactId, "Illegal UID for imported contact" );
+ EUNIT_PRINT( _L("Item ID: %d"), iItemUid );
+
+ // Print out the imported vCard
+ CContactIdArray* idArr = CContactIdArray::NewLC();
+ idArr->AddL( iItemUid );
+ CBufFlat* buffer = CBufFlat::NewL( 1024 );
+ CleanupStack::PushL( buffer );
+ RBufWriteStream writeStream( *buffer );
+ CleanupClosePushL( writeStream );
+
+ TRAP( err, iContactDatabase->ExportSelectedContactsL( TUid::Uid(KVersitEntityUidVCard), *idArr,
+ writeStream, CContactDatabase::EExcludeUid, Versit::EUTF8CharSet ) );
+
+ EUNIT_ASSERT_EQUALS_DESC( err, KErrNone, "ExportSelectedContactsL leave" );
+
+ CleanupStack::PopAndDestroy( &writeStream );
+
+ EUNIT_PRINT( buffer->Ptr( 0 ) );
+
+ // Do some asserts
+ EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("N:Smith;John") ) != KErrNotFound );
+ EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("TITLE:Boss") ) != KErrNotFound );
+
+ CleanupStack::PopAndDestroy( 2, idArr ); // buffer, idArr
+
+ // Do cleanup (remove added contact)
+ CContactIdArray* tmpArray = CContactIdArray::NewLC();
+ tmpArray->AddL( iItemUid );
+ TRAP_IGNORE( iContactDatabase->DeleteContactsL( *tmpArray ) );
+ CleanupStack::PopAndDestroy( tmpArray );
+ }
+
+
+// Item addition - Batch mode, empty batch
+// (DoBeginBatchL(), DoCommitBatchL())
+void CNSmlDummyDataStore_Test::AddEmptyBatchL()
+ {
+ // DoBeginBatchL()
+ TRAPD( err, iCNSmlDummyDataStore->DoBeginBatchL() );
+ EUNIT_PRINT( _L( "DoBeginBatchL(): leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoBeginBatchL() leave" );
+
+ // DoCommitBatchL()
+ TInt returnCode = KErrNone;
+ RArray< TInt > array;
+ TRAP( err, returnCode = iStoreWaiter->DoCommitBatchL( array ) );
+
+ EUNIT_PRINT( _L( "DoCommitBatchL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitBatchL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitBatchL returns error");
+ }
+
+// Item addition - Batch mode with two contacts
+void CNSmlDummyDataStore_Test::AddTwoItemBatchL()
+ {
+ TBuf8<20> type = KNSmlvCard21Name();
+ TBuf8<20> ver = KNSmlvCard21Ver();
+ TInt returnCode = KErrNone;
+ HBufC8* vCard = NULL;
+
+ // DoBeginBatchL()
+ EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 1") );
+ TRAPD( err, iCNSmlDummyDataStore->DoBeginBatchL() );
+ EUNIT_PRINT( _L( "DoBeginBatchL(): leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoBeginBatchL() leave" );
+
+ // == == CONTACT ITEM NO 1 == ==
+ vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasic() );
+ EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 2") );
+ TRAP( err, returnCode = iStoreWaiter->DoCreateItemL(
+ iItemUid, vCard->Size(), type, ver ) );
+
+ EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error");
+
+ // Perform item writing to data store
+ EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 3") );
+ // Non-async call (no need for iStoreWaiter usage)
+ TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+ EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+ CleanupStack::PopAndDestroy( vCard );
+ vCard = NULL;
+
+ // Commit the contact to be created
+ EUNIT_PRINT( _L("Calling DoCommitItemL(), STEP 4") );
+ TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
+
+ EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitItemL returns error");
+
+ // == == CONTACT ITEM NO 2 == ==
+ vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardStandard() );
+
+ EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 5") );
+ TRAP( err, returnCode = iStoreWaiter->DoCreateItemL(
+ iItemUid2, vCard->Size(), type, ver ) );
+ EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error" );
+
+ // Perform item writing to data store
+ EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 6") );
+ // Non-async call (no need for iStoreWaiter usage)
+ TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+ EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+ CleanupStack::PopAndDestroy( vCard );
+
+ // Commit the contact to be created
+ EUNIT_PRINT( _L("Calling DoCommitItemL(), STEP 7") );
+ TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
+ EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitItemL returns error" );
+
+ // Commit batch
+ RArray<TInt> array;
+ EUNIT_PRINT( _L("Calling DoCommitBatchL(), STEP 8") );
+ TRAP( err, returnCode = iStoreWaiter->DoCommitBatchL( array ) );
+
+ EUNIT_PRINT( _L( "DoCommitBatchL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitBatchL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitBatchL returns error" );
+
+ // Verify results
+ for( TInt i = 0; i < array.Count(); i++ )
+ {
+ EUNIT_PRINT( _L( "Contact: %d, Error code: %d "), i, array[ i ] );
+ EUNIT_ASSERT( array[ i ] == KErrNone );
+ }
+ EUNIT_ASSERT_DESC( array.Count() == 2, "Wrong number of contacts added" );
+ EUNIT_PRINT( _L("Item 1 ID = %d"), iItemUid );
+ EUNIT_PRINT( _L("Item 2 ID = %d"), iItemUid2 );
+
+ // Cleanup
+ array.Reset();
+ array.Close();
+
+ CContactIdArray* tmpArray = CContactIdArray::NewLC();
+ tmpArray->AddL( iItemUid );
+ tmpArray->AddL( iItemUid2 );
+ TRAP_IGNORE( iContactDatabase->DeleteContactsL( *tmpArray ) );
+ CleanupStack::PopAndDestroy( tmpArray );
+ }
+
+// Item addition - cancel Batch mode
+void CNSmlDummyDataStore_Test::CancelBatchL()
+ {
+ TBuf8<20> type = KNSmlvCard21Name();
+ TBuf8<20> ver = KNSmlvCard21Ver();
+ TInt returnCode = KErrNone;
+ HBufC8* vCard = NULL;
+
+ // DoBeginBatchL()
+ EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 1") );
+ TRAPD( err, iCNSmlDummyDataStore->DoBeginBatchL() );
+ EUNIT_PRINT( _L( "DoBeginBatchL(): leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoBeginBatchL() leave" );
+
+ // == == CONTACT ITEM NO 1 == ==
+ vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasic() );
+ EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 2") );
+ TRAP( err, returnCode = iStoreWaiter->DoCreateItemL(
+ iItemUid, vCard->Size(), type, ver ) );
+
+ EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error");
+
+ // Perform item writing to data store
+ EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 3") );
+ // Non-async call (no need for iStoreWaiter usage)
+ TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+ EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+ CleanupStack::PopAndDestroy( vCard );
+ vCard = NULL;
+
+ // Cancel Batch
+ EUNIT_PRINT( _L("Calling DoCancelBatch(), STEP 4") );
+ iStoreWaiter->DoCancelBatch();
+ }
+
+// DoOpenItemL(), DoReadItemL(), DoCloseItemL()
+// (LdoFetchItemL(), SingleContactOperationCompleteL())
+void CNSmlDummyDataStore_Test::FetchItemL()
+ {
+ TBuf8<20> type;
+ TBuf8<20> ver;
+ TInt returnCode = KErrNone;
+ TInt size = 0;
+ TSmlDbItemUid parentId = KNullContactId;
+ TBool fieldChange = EFalse;
+
+ // Open item ("Tim Tester") for reading
+ EUNIT_PRINT( _L("Calling DoOpenItemL()") );
+
+ //Make some preparations:
+ // (a) Set remote store format; needed by StripTxL()
+ // - Otherwise we get access violation
+ EUNIT_ASSERT( iCNSmlDummyDataStore->iStoreFormat );
+ iCNSmlDummyDataStore->DoSetRemoteStoreFormatL(
+ *(iCNSmlDummyDataStore->iStoreFormat) );
+
+ TRAPD( err, returnCode = iStoreWaiter->DoOpenItemL(
+ ( *iIdArray )[ 0 ], fieldChange, size, parentId, type, ver ) );
+
+ EUNIT_PRINT( _L( "DoOpenItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoOpenItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoOpenItemL returns error");
+
+ // Execute some asserts to verify functionality
+ EUNIT_PRINT( _L( "DoOpenItemL(): size: %d" ),
+ size );
+ EUNIT_ASSERT_DESC( size != 0, "Illegal size value" );
+ EUNIT_ASSERT_DESC( parentId == KNullDataItemId, "Wrong parent ID" );
+ EUNIT_ASSERT_DESC( type.Compare( KNSmlvCard21Name() ) == 0,
+ "Illegal MIME type" );
+ EUNIT_ASSERT_DESC( ver.Compare( KNSmlvCard21Ver() ) == 0,
+ "Illegal MIME version" );
+
+ // Read the item contents (i.e. vCard)
+ HBufC8* vCard = HBufC8::NewLC( 86 );
+ TPtr8 vCardPtr = vCard->Des();
+ EUNIT_ASSERT_NO_LEAVE( iCNSmlDummyDataStore->DoReadItemL( vCardPtr ) );
+
+ EUNIT_PRINT( *vCard );
+ EUNIT_ASSERT( vCard->Find( _L8("N:Tester;Tim") ) != KErrNotFound );
+ EUNIT_ASSERT( vCard->Find( _L8("TEL:+358501234567") ) != KErrNotFound );
+
+ CleanupStack::PopAndDestroy( vCard );
+
+ // Close the contact item
+ iCNSmlDummyDataStore->DoCloseItem();
+ }
+
+void CNSmlDummyDataStore_Test::FetchItem2L()
+ {
+ TBuf8<20> type;
+ TBuf8<20> ver;
+ TInt returnCode = KErrNone;
+ TInt size = 0;
+ TSmlDbItemUid parentId = KNullContactId;
+ TBool fieldChange = EFalse;
+
+ TRAPD( err, returnCode = iStoreWaiter->DoOpenItemL(
+ 10000, fieldChange, size, parentId, type, ver ) );
+
+ EUNIT_PRINT( _L( "DoOpenItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoOpenItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone || returnCode == KErrNotFound, "DoOpenItemL returns error");
+ }
+
+// Update a standard contact
+// (DoReplaceItemL(), ExecuteBufferL(), ExecuteUpdateL(), ...)
+void CNSmlDummyDataStore_Test::UpdateItemL()
+ {
+ TInt returnCode = KErrNone;
+ TSmlDbItemUid parentId = KNullContactId;
+ TBool fieldChange = EFalse;
+
+ HBufC8* vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardStandard() );
+
+ // Update "Tim Tester" contact
+ TRAPD( err, returnCode = iStoreWaiter->DoReplaceItemL(
+ ( *iIdArray )[ 0 ], vCard->Size(), parentId, fieldChange ) );
+
+ EUNIT_PRINT( _L( "DoReplaceItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoReplaceItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoReplaceItemL returns error");
+
+ // Perform item writing to data store
+ EUNIT_PRINT( _L("Calling DoWriteItemL()") );
+ TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+ EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoWriteItemL() leave" );
+ CleanupStack::PopAndDestroy( vCard );
+
+ // Commit the contact to be created
+ EUNIT_PRINT( _L("Calling DoCommmitItemL()") );
+ TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
+
+ EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCommitItemL returns error");
+
+ // Print out the imported vCard
+ CContactIdArray* idArr = CContactIdArray::NewLC();
+ idArr->AddL( ( *iIdArray )[ 0 ] );
+ CBufFlat* buffer = CBufFlat::NewL( 1024 );
+ CleanupStack::PushL( buffer );
+ RBufWriteStream writeStream( *buffer );
+ CleanupClosePushL( writeStream );
+
+ TRAP( err, iContactDatabase->ExportSelectedContactsL(
+ TUid::Uid(KVersitEntityUidVCard), *idArr,
+ writeStream, CContactDatabase::EExcludeUid, Versit::EUTF8CharSet ) );
+
+ EUNIT_ASSERT_EQUALS_DESC( err, KErrNone, "ExportSelectedContactsL leave" );
+
+ CleanupStack::PopAndDestroy( &writeStream );
+
+ EUNIT_PRINT( buffer->Ptr( 0 ) );
+
+ // Do some asserts
+ EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("N:Smith;John") ) != KErrNotFound );
+ EUNIT_ASSERT( buffer->Ptr( 0 ).Find( _L8("TITLE:Boss") ) != KErrNotFound );
+
+ CleanupStack::PopAndDestroy( 2, idArr ); // buffer, idArr
+ }
+
+// Not working - memory leak: Heap cell count, 61, 73, Request count, 0, 1
+// The test case never receives OpetionComplete() callback from VPbk. Therefore
+// the request count & heap allocation do not match.
+// DoDeleteItemL(), StepComplete()
+void CNSmlDummyDataStore_Test::DeleteItemL()
+ {
+ // Delete item
+ TInt returnCode = KErrNone;
+ EUNIT_PRINT( _L("Calling DoDeleteItemL()") );
+ TRAPD( err, returnCode = iStoreWaiter->DoDeleteItemL( ( *iIdArray )[ 0 ] ) );
+
+ EUNIT_PRINT( _L( "DoDeleteItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoDeleteItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoDeleteItemL returns error");
+ iCNSmlDummyDataStore->ExecuteDeleteL();
+ // Check that the contact does not exist any more
+ CContactItem* item = NULL;
+ CContactDatabase* cntDb = NULL;
+ TRAP( err, cntDb = CContactDatabase::OpenL() );
+ TRAP( err, item = cntDb->ReadMinimalContactL(
+ ( *iIdArray )[ 0 ] ) );
+ EUNIT_ASSERT( !item );
+ EUNIT_PRINT( _L("Error=%d"), err );
+ EUNIT_ASSERT_EQUALS_DESC( err, KErrNotFound, "Deleted item found" );
+ delete item;
+ item = NULL;
+
+ if( cntDb )
+ {
+ delete cntDb;
+ }
+
+ iIdArray->Remove( 0 );
+ }
+
+// DoDeleteAllItemsL(), DoDeleteAllContactsL(), ...
+void CNSmlDummyDataStore_Test::DeleteAllItemsL()
+ {
+ // Temporarily remove ChangeFinders from Store to prevent leaves
+ // when reseting ChangeFinders in code under test.
+ CNSmlChangeFinder* cF = iCNSmlDummyDataStore->iChangeFinder;
+ CleanupStack::PushL( cF );
+ iCNSmlDummyDataStore->iChangeFinder = NULL;
+
+ TInt returnCode = KErrNone;
+ EUNIT_PRINT( _L("Calling DoDeleteAllItemsL()") );
+ TRAPD( err, returnCode = iStoreWaiter->DoDeleteAllItemsL() );
+
+ // Return ChangeFinders
+ CleanupStack::Pop( cF );
+ iCNSmlDummyDataStore->iChangeFinder = cF;
+
+ EUNIT_PRINT( _L( "DoDeleteAllItemsL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoDeleteAllItemsL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoDeleteAllItemsL returns error");
+
+ // Check that all normal contacts are removed
+ TContactItemId ownCardId = iContactDatabase->OwnCardId();
+
+ TInt contactCount = 0;
+ TInt groupCount = iContactDatabase->GroupCount();
+ TContactIter iter( *iContactDatabase );
+ for( TContactItemId id = iter.FirstL(); id != KNullContactId; id = iter.NextL() )
+ {
+ // KUidContactGroup
+ if( id != ownCardId )
+ {
+ contactCount++;
+ }
+ }
+ EUNIT_PRINT( _L("Number of items in DB=%d"), contactCount );
+ EUNIT_PRINT( _L("Number of groups in DB=%d"), groupCount );
+ EUNIT_ASSERT_DESC( contactCount - groupCount == 0, "All contacts not deleted");
+ }
+
+// GetStoreFormatResourceFileL()
+void CNSmlDummyDataStore_Test::GetStoreFormatResourceFileLL()
+ {
+ const TDesC& resourceFile = iCNSmlDummyDataStore->GetStoreFormatResourceFileL();
+ EUNIT_PRINT( resourceFile );
+ }
+
+
+// VCARD IMPORT TEST CASES
+
+void CNSmlDummyDataStore_Test::RemoveItemFromAddBatchL()
+ {
+ // Test case:
+ // - Run RemoveItemFromAddBatch() and verify its functionality
+
+ if( !iCNSmlDummyDataStore->iItemDataAddBatch )
+ {
+ iCNSmlDummyDataStore->iItemDataAddBatch =
+ CBufFlat::NewL( KNSmlItemDataExpandSize );
+ }
+
+ HBufC8* vCard = NULL;
+ // Test material: basic vCard
+ vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasic );
+ iCNSmlDummyDataStore->iItemDataAddBatch->InsertL(
+ iCNSmlDummyDataStore->iItemDataAddBatch->Size(),
+ *vCard, vCard->Size() );
+ iCNSmlDummyDataStore->iItemDataAddBatch->InsertL(
+ iCNSmlDummyDataStore->iItemDataAddBatch->Size(),
+ KVersitTokenCRLF() );
+ CleanupStack::PopAndDestroy( vCard );
+
+ // Test material 2: vCard with multiple TEL fields
+ vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardMultiOccurence );
+ iCNSmlDummyDataStore->iItemDataAddBatch->InsertL(
+ iCNSmlDummyDataStore->iItemDataAddBatch->Size(),
+ *vCard, vCard->Size() );
+ iCNSmlDummyDataStore->iItemDataAddBatch->InsertL(
+ iCNSmlDummyDataStore->iItemDataAddBatch->Size(),
+ KVersitTokenCRLF() );
+ CleanupStack::PopAndDestroy( vCard );
+
+// iTestUtilities->PrintData( _L8("Buffer contents"),
+// *iCNSmlDummyDataStore->iItemDataAddBatch ); // DEBUG PRINT
+
+ TInt count = 0;
+
+ // ASSERTS
+ count = CountItemsLeftInBatchL(
+ *iCNSmlDummyDataStore->iItemDataAddBatch );
+ EUNIT_PRINT( _L("Items left %d"), count ); // DEBUG PRINT
+ EUNIT_ASSERT_DESC( count == 2, "Wrong initial item count in batch.")
+// EUNIT_PRINT( _L("Items left %d"), count ); // DEBUG PRINT
+ }
+
+
+void CNSmlDummyDataStore_Test::TestStoreSupportMimeTypeL()
+ {
+ EUNIT_ASSERT( iCNSmlDummyDataStore->iStoreFormat );
+ EUNIT_ASSERT_EQUALS( iCNSmlDummyDataStore->iStoreFormat->MimeFormatCount() ,1 );
+ EUNIT_ASSERT_EQUALS(
+ iCNSmlDummyDataStore->iStoreFormat->MimeFormat(0).MimeType().DesC(),
+ KNSmlvCard21Name() );
+ EUNIT_ASSERT_EQUALS(
+ iCNSmlDummyDataStore->iStoreFormat->MimeFormat(0).MimeVersion().DesC(),
+ KNSmlvCard21Ver() );
+ }
+
+void CNSmlDummyDataStore_Test::DoBeginTransactionL()
+ {
+ TRAPD( err, iCNSmlDummyDataStore->DoBeginTransactionL() );
+ EUNIT_ASSERT( err == KErrNotSupported );
+ }
+
+void CNSmlDummyDataStore_Test::DoCommitTransactionL()
+ {
+ TRequestStatus status;
+ iCNSmlDummyDataStore->DoCommitTransactionL( status );
+ EUNIT_ASSERT_DESC( status.Int() == KErrNotSupported, "DoCommitTransactionL fail" )
+ }
+
+void CNSmlDummyDataStore_Test::DoRevertTransaction()
+ {
+ TRequestStatus status;
+ iCNSmlDummyDataStore->DoRevertTransaction( status );
+ EUNIT_ASSERT_DESC( status.Int() == KErrNotSupported, "DoRevertTransaction fail" )
+ }
+
+void CNSmlDummyDataStore_Test::StoreNameL()
+ {
+ CreateDataStoreL();
+ EUNIT_PRINT( iDataStore->StoreName() );
+ iDataStore->CancelRequest();
+ DeleteDataStoreL();
+ }
+
+void CNSmlDummyDataStore_Test::FindChangedItemsL()
+ {
+ CreateDataStoreL();
+ const MSmlDataItemUidSet& added = iDataStore->AddedItems();
+ EUNIT_ASSERT_DESC( added.ItemCount() == 0, "AddedItems returns faulty uid set");
+ const MSmlDataItemUidSet& deleted = iDataStore->DeletedItems();
+ EUNIT_ASSERT_DESC( deleted.ItemCount() == 0, "DeletedItems returns faulty uid set");
+ const MSmlDataItemUidSet& softDeleted = iDataStore->SoftDeletedItems();
+ EUNIT_ASSERT_DESC( softDeleted.ItemCount() == 0, "SoftDeletedItems returns faulty uid set");
+ const MSmlDataItemUidSet& moved = iDataStore->MovedItems();
+ EUNIT_ASSERT_DESC( moved.ItemCount() == 0, "MovedItems returns faulty uid set");
+ DeleteDataStoreL();
+ }
+
+void CNSmlDummyDataStore_Test::MoveAndDeleteL()
+ {
+ CreateDataStoreL();
+ TSmlDbItemUid uid = 1;
+ TSmlDbItemUid parent = 0;
+ TRequestStatus status;
+ iDataStore->MoveItemL( uid, parent, status );
+
+ TRequestStatus status2;
+ iDataStore->SoftDeleteItemL( uid, status2 );
+
+ DeleteDataStoreL();
+ }
+
+void CNSmlDummyDataStore_Test::ExecuteMoveL()
+ {
+ iCNSmlDummyDataStore->ExecuteMoveL();
+ }
+
+void CNSmlDummyDataStore_Test::DoSetRemoteMaxObjectSize()
+ {
+ iCNSmlDummyDataStore->DoSetRemoteMaxObjectSize( 100000 );
+ }
+
+void CNSmlDummyDataStore_Test::DoMaxObjectSize()
+ {
+ TInt size = iCNSmlDummyDataStore->DoMaxObjectSize();
+ EUNIT_ASSERT( size == 102400 );
+ }
+
+void CNSmlDummyDataStore_Test::ContactsSavingFailedL()
+ {
+ TBuf8< 20 > type= KNSmlvCard21Name();
+ TBuf8< 20 > ver = KNSmlvCard21Ver();
+ TInt returnCode = KErrNone;
+ iItemUid = KNullContactId;
+ // Create legal contact
+ EUNIT_PRINT( _L("Calling DoCreateItemL(), STEP 1") );
+ TRAPD( err, returnCode = iStoreWaiter->DoCreateItemL(
+ iItemUid, 512, type, ver ) );
+
+ EUNIT_PRINT( _L( "DoCreateItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNone, "DoCreateItemL returns error");
+
+ // Perform item writing to data store
+ HBufC8* vCard = iTestUtilities->ReadVCard8FromFileLC( KVCardBasicInvalid() );
+ EUNIT_PRINT( _L("Calling DoWriteItemL(), STEP 2") );
+ // Non-async call (no need for iStoreWaiter usage)
+ TRAP( err, iCNSmlDummyDataStore->DoWriteItemL( *vCard ) );
+ EUNIT_PRINT( _L( "DoWriteItemL(): leave code: %d" ), err );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCreateItemL() leave" );
+ CleanupStack::PopAndDestroy( vCard );
+
+ // Commit the contact to be created
+ EUNIT_PRINT( _L("Calling DoCommmitItemL(), STEP 3") );
+ TRAP( err, returnCode = iStoreWaiter->DoCommitItemL() );
+
+ EUNIT_PRINT( _L( "DoCommitItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ EUNIT_ASSERT_DESC( err == KErrNone, "DoCommitItemL() leave" );
+ EUNIT_ASSERT_DESC( returnCode == KErrNotFound, "DoCommitItemL returns error");
+ }
+
+void CNSmlDummyDataStore_Test::StepFailed()
+ {
+ TInt returnCode = KErrNone;
+ // delete contact which not exist
+ EUNIT_PRINT( _L("Calling DoDeleteItemL()") );
+ TRAPD( err, returnCode = iStoreWaiter->DoDeleteItemL( 10000 ) );
+ EUNIT_PRINT( _L( "DoDeleteItemL(): leave code: %d, return code: %d" ),
+ err, returnCode );
+ }
+
+void CNSmlDummyDataStore_Test::GetDataMod()
+ {
+ CNSmlDataModBase& dataMod = iCNSmlDummyDataStore->GetDataMod();
+ }
+
+
+// --------------- Helper methods --------------
+
+// Helper method to add a simple contact to test contact DB
+TContactItemId CNSmlDummyDataStore_Test::AddContactL(
+ const TDesC& aFirstName,
+ const TDesC& aLastName,
+ const TDesC& aPhoneNumber )
+ {
+ _LIT( KLabelFamilyName, "Last name");
+ _LIT( KLabelGivenName, "First name");
+ _LIT( KLabelPhone, "Phone");
+
+ CContactCard* card = CContactCard::NewLC();
+
+ // Family name field
+ CContactItemField* familyNameField =
+ CContactItemField::NewLC( KStorageTypeText, KUidContactFieldFamilyName );
+ familyNameField->SetLabelL( KLabelFamilyName );
+ familyNameField->SetMapping( KUidContactFieldVCardMapUnusedN );
+ familyNameField->TextStorage()->SetTextL( aLastName );
+ card->AddFieldL( *familyNameField ); // Takes ownership
+ CleanupStack::Pop( familyNameField );
+
+ // First name field
+ CContactItemField* nameField =
+ CContactItemField::NewLC( KStorageTypeText, KUidContactFieldGivenName );
+ nameField->SetLabelL( KLabelGivenName );
+ nameField->SetMapping( KUidContactFieldVCardMapUnusedN );
+ nameField->TextStorage()->SetTextL( aFirstName );
+ card->AddFieldL( *nameField );
+ CleanupStack::Pop(nameField);
+
+ // Phone number field
+ CContactItemField* phoneField =
+ CContactItemField::NewLC( KStorageTypeText, KUidContactFieldPhoneNumber );
+ phoneField->SetLabelL( KLabelPhone );
+ phoneField->SetMapping( KUidContactFieldVCardMapTEL );
+ phoneField->TextStorage()->SetTextL( aPhoneNumber );
+ card->AddFieldL( *phoneField );
+ CleanupStack::Pop( phoneField );
+
+ TContactItemId cardId = iContactDatabase->AddNewContactL( *card );
+ CleanupStack::PopAndDestroy( card );
+
+ return cardId;
+ }
+
+TInt CNSmlDummyDataStore_Test::CountItemsLeftInBatchL( CBufBase& aItems )
+ {
+ _LIT8( KVCardBeginTag, "BEGIN:VCARD\r\n");
+ _LIT8( KVCardEndTag, "\r\nEND:VCARD\r\n");
+
+ TInt vCardCount = 0;
+ TBool processed = EFalse;
+
+ HBufC8* tmpBuf = HBufC8::NewLC( aItems.Size() );
+ TPtr8 ptr = tmpBuf->Des();
+ aItems.Read( 0, ptr, aItems.Size() );
+
+ while( !processed )
+ {
+ TInt offsetBegin = ptr.FindF( KVCardBeginTag );
+ TInt offsetEnd = ptr.FindF( KVCardEndTag );
+
+ if( offsetBegin != KErrNotFound && offsetEnd != KErrNotFound )
+ {
+ offsetEnd += KVCardEndTag().Length();
+ vCardCount++;
+ ptr = ptr.MidTPtr( offsetEnd );
+ }
+ else
+ {
+ processed = ETrue;
+ }
+ }
+ CleanupStack::PopAndDestroy( tmpBuf );
+ return vCardCount;
+ }
+
+void CNSmlDummyDataStore_Test::CreateDataStoreL()
+ {
+ TSmlDataProviderId id = {0x101F6DDD};// Contact Adapter Uid
+ CSmlDataProvider* dp = CSmlDataProvider::NewL( id );
+ iDataStore = dp->NewStoreInstanceLC();
+ CleanupStack::Pop( iDataStore );
+ delete dp;
+ }
+
+void CNSmlDummyDataStore_Test::DeleteDataStoreL()
+ {
+ delete iDataStore;
+ iDataStore = NULL;
+ }
+
+void CNSmlDummyDataStore_Test::CreateViewL()
+ {
+ CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
+ CleanupStack::PushL( viewDef );
+ viewDef->SetType( EVPbkContactsView );
+
+ iContactViewBase = iContactManager->CreateContactViewLC(
+ *this,
+ *viewDef,
+ iContactManager->FieldTypes() );
+ CleanupStack::Pop();// iContactViewBase
+ CleanupStack::PopAndDestroy( viewDef );
+ }
+
+// ------------------ From MVPbkContactViewObserver ---------------------
+void CNSmlDummyDataStore_Test::ContactViewReady( MVPbkContactViewBase& /*aView*/ )
+ {
+ }
+
+void CNSmlDummyDataStore_Test::ContactViewUnavailable(
+ MVPbkContactViewBase& /*aView*/ )
+ {
+ }
+
+void CNSmlDummyDataStore_Test::ContactAddedToView(
+ MVPbkContactViewBase& /*aView*/,
+ TInt /*aIndex*/,
+ const MVPbkContactLink& /*aContactLink*/ )
+ {
+ }
+
+void CNSmlDummyDataStore_Test::ContactRemovedFromView(
+ MVPbkContactViewBase& /*aView*/,
+ TInt /*aIndex*/,
+ const MVPbkContactLink& /*aContactLink*/ )
+ {
+ }
+
+void CNSmlDummyDataStore_Test::ContactViewError(
+ MVPbkContactViewBase& /*aView*/,
+ TInt /*aError*/,
+ TBool /*aErrorNotified*/ )
+ {
+ }
+
+// - EUnit test table -------------------------------------------------------
+
+EUNIT_BEGIN_TEST_TABLE(
+ CNSmlDummyDataStore_Test,
+ "Unit tests Contact adapter datastore",
+ "UNIT" )
+
+EUNIT_TEST(
+ "Test to verify memory allocation for the object",
+ "CNSmlContactsDataStore",
+ "NewL",
+ "FUNCTIONALITY",
+ Empty, NewLL, Empty)
+
+EUNIT_TEST(
+ "Open data store",
+ "CNSmlContactsDataStore",
+ "DoOpenL",
+ "FUNCTIONALITY",
+ SetupL, DoOpenLL, Teardown )
+
+EUNIT_TEST(
+ "DoHasSyncHistory",
+ "CNSmlContactsDataStore",
+ "DoHasSyncHistory",
+ "FUNCTIONALITY",
+ SetupAndOpenStoreL, DoHasSyncHistoryL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+ "DoModifiedItems & DoCommitChangeInfoL",
+ "CNSmlContactsDataStore",
+ "DoModifiedItems",
+ "FUNCTIONALITY",
+ SetupAndOpenStoreL, DoModifiedItemsL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+ "DoResetChangeInfoL",
+ "CNSmlContactsDataStore",
+ "DoResetChangeInfoL",
+ "FUNCTIONALITY",
+ SetupAndOpenStoreL, DoResetChangeInfoLL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+ "DoCommitChangeInfoL",
+ "CNSmlContactsDataStore",
+ "DoCommitChangeInfoL",
+ "FUNCTIONALITY",
+ SetupAndOpenStoreL, DoCommitChangeInfoLL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+ "Add single item (normal mode)",
+ "CNSmlContactsDataStore",
+ "DoCreateItemL, DoCommitItemL, ExecuteAddL, LdoAddItem",
+ "FUNCTIONALITY",
+ SetupAndOpenStoreL, AddSingleItemL, TeardownAndCloseStore )
+
+/* TIMEOUT error
+EUNIT_TEST(
+ "Add items in batch mode (empty batch)",
+ "CNSmlContactsDataStore",
+ "DoBeginBatchL, DoCommitBatchL",
+ "FUNCTIONALITY",
+ SetupAndOpenStoreL, AddEmptyBatchL, TeardownAndCloseStore )*/
+
+EUNIT_TEST(
+ "Add items in batch mode (2 contacts)",
+ "CNSmlContactsDataStore",
+ "DoBeginBatchL, DoCommitBatchL",
+ "FUNCTIONALITY",
+ SetupAndOpenStoreL, AddTwoItemBatchL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+ "CancelBatchL",
+ "CNSmlContactsDataStore",
+ "DoCancelBatch",
+ "FUNCTIONALITY",
+ SetupAndOpenStoreL, CancelBatchL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+ "Fetch/read normal contact",
+ "CNSmlContactsDataStore",
+ "LdoFetchItemL",
+ "FUNCTIONALITY",
+ SetupPopulateDbAndOpenStoreL, FetchItemL, TeardownCloseAndEmptyContactDb )
+
+EUNIT_TEST(
+ "Fail fetch",
+ "CNSmlContactsDataStore",
+ "LdoFetchItemL",
+ "FUNCTIONALITY",
+ SetupPopulateDbAndOpenStoreL, FetchItem2L, TeardownCloseAndEmptyContactDb )
+
+EUNIT_TEST(
+ "Update normal contact",
+ "CNSmlContactsDataStore",
+ "ExecuteUpdateL",
+ "FUNCTIONALITY",
+ SetupPopulateDbAndOpenStoreL, UpdateItemL, TeardownCloseAndEmptyContactDb )
+
+EUNIT_TEST(
+ "Delete normal contact",
+ "CNSmlContactsDataStore",
+ "DoDeleteItemL",
+ "FUNCTIONALITY",
+ SetupPopulateDbAndOpenStoreL, DeleteItemL, TeardownCloseAndEmptyContactDb )
+
+EUNIT_TEST(
+ "Delete all contacts",
+ "CNSmlContactsDataStore",
+ "DoDeleteItemL",
+ "FUNCTIONALITY",
+ SetupPopulateDbAndOpenStoreL, DeleteAllItemsL, TeardownCloseAndEmptyContactDb )
+
+EUNIT_TEST(
+ "Test for GetStoreFormatResourceFileL function",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, GetStoreFormatResourceFileLL, Teardown )
+
+EUNIT_TEST(
+ "RemoveItemFromAddBatch",
+ "CNSmlContactsDataStore",
+ "RemoveItemFromAddBatch",
+ "FUNCTIONALITY",
+ SetupL, RemoveItemFromAddBatchL, Teardown )
+
+EUNIT_TEST(
+ "Verify operator specific MIME type",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, TestStoreSupportMimeTypeL, Teardown )
+
+EUNIT_TEST(
+ "GetDataMod",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, GetDataMod, Teardown )
+
+EUNIT_TEST(
+ "DoBeginTransactionL",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoBeginTransactionL, Teardown )
+
+EUNIT_TEST(
+ "DoCommitTransactionL",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoCommitTransactionL, Teardown )
+
+EUNIT_TEST(
+ "DoRevertTransaction",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoRevertTransaction, Teardown )
+
+EUNIT_TEST(
+ "StoreNameL",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, StoreNameL, Teardown )
+
+EUNIT_TEST(
+ "FindChangedItemsL",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, FindChangedItemsL, Teardown )
+
+EUNIT_TEST(
+ "MoveAndDeleteL",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, MoveAndDeleteL, Teardown )
+
+EUNIT_TEST(
+ "ExecuteMoveL (move command is not supported)",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, ExecuteMoveL, Teardown )
+
+EUNIT_TEST(
+ "DoSetRemoteMaxObjectSize",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoSetRemoteMaxObjectSize, Teardown )
+
+EUNIT_TEST(
+ "DoMaxObjectSize",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupL, DoMaxObjectSize, Teardown )
+
+EUNIT_TEST(
+ "ContactsSavingFailedL",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupAndOpenStoreL, ContactsSavingFailedL, TeardownAndCloseStore )
+
+EUNIT_TEST(
+ "StepFailed",
+ "CNSmlContactsDataStore",
+ "",
+ "FUNCTIONALITY",
+ SetupPopulateDbAndOpenStoreL, StepFailed, TeardownCloseAndEmptyContactDb )
+
+EUNIT_END_TEST_TABLE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastore_test.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header file for contact adapter's datastore unit tests.
+*
+*/
+
+#ifndef __CNSMLDUMMYDATASTORE_TEST_H__
+#define __CNSMLDUMMYDATASTORE_TEST_H__
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <SmlDataSyncDefs.h>
+#include <cntdb.h>
+#include <s32mem.h>
+#include <MVPbkContactViewBase.h>
+#include <MVPbkContactViewObserver.h>
+#include <CVPbkContactManager.h>
+
+// FORWARD DECLARATIONS
+class CNSmlDummyDataStore;
+class CNSmlAdapterTestUtilities;
+class CNSmlDummyDataStoreWaiter;
+class CSmlDataStore;
+// CLASS DEFINITION
+
+/**
+ * Generated EUnit test suite class.
+ */
+NONSHARABLE_CLASS( CNSmlDummyDataStore_Test )
+ : public CEUnitTestSuiteClass,
+ public MSmlSyncRelationship,
+ public MVPbkContactViewObserver
+ {
+ public: // Constructors and destructor
+
+ static CNSmlDummyDataStore_Test* NewL();
+ static CNSmlDummyDataStore_Test* NewLC();
+ ~CNSmlDummyDataStore_Test();
+
+ private: // Constructors
+
+ CNSmlDummyDataStore_Test();
+ void ConstructL();
+
+ private: // New methods
+
+ void Empty() {};
+
+ // ++ Setup methods ++
+ void SetupL();
+
+ void SetupAndOpenStoreL();
+
+ void SetupAndPopulateContactDbL();
+
+ void SetupPopulateDbAndOpenStoreL();
+
+ // ++ Teardown methods ++
+ void Teardown();
+
+ void TeardownAndCloseStore();
+
+ void TeardownAndEmptyContactDb();
+
+ void TeardownCloseAndEmptyContactDb();
+
+ // ++ DataStore test cases ++
+ void NewLL();
+
+ void DoOpenLL();
+
+ void DoHasSyncHistoryL();
+
+ void DoModifiedItemsL();
+
+ void DoResetChangeInfoLL();
+
+ void DoCommitChangeInfoLL();
+
+ void AddSingleItemL();
+
+ void AddEmptyBatchL();
+
+ void AddTwoItemBatchL();
+
+ void CancelBatchL();
+
+ void FetchItemL();
+
+ void FetchItem2L();
+
+ void UpdateItemL();
+
+ void DeleteItemL();
+
+ void DeleteAllItemsL();
+
+ void GetStoreFormatResourceFileLL();
+
+ void RemoveItemFromAddBatchL();
+
+ void TestStoreSupportMimeTypeL();
+
+ void DoBeginTransactionL();
+
+ void DoCommitTransactionL();
+
+ void DoRevertTransaction();
+
+ void StoreNameL();
+
+ void FindChangedItemsL();
+
+ void MoveAndDeleteL();
+
+ void ExecuteMoveL();
+
+ void DoSetRemoteMaxObjectSize();
+
+ void DoMaxObjectSize();
+
+ void LdoFetchItemL();
+
+ void ContactsSavingFailedL();
+
+ void StepFailed();
+
+ void GetDataMod();
+
+//
+
+ // ++ Helper methods ++
+ TContactItemId AddContactL( const TDesC& aFirstName,
+ const TDesC& aLastName,
+ const TDesC& aPhoneNumber );
+ TInt CountItemsLeftInBatchL( CBufBase& aItems );
+
+ void CreateViewL();
+
+ void CreateDataStoreL();
+
+ void DeleteDataStoreL();
+
+ // From MVPbkContactViewObserver
+ void ContactViewReady( MVPbkContactViewBase& aView ) ;
+
+ void ContactViewUnavailable(
+ MVPbkContactViewBase& aView ) ;
+
+ void ContactAddedToView(
+ MVPbkContactViewBase& aView,
+ TInt aIndex,
+ const MVPbkContactLink& aContactLink );
+
+ void ContactRemovedFromView(
+ MVPbkContactViewBase& aView,
+ TInt aIndex,
+ const MVPbkContactLink& aContactLink ) ;
+
+ void ContactViewError(
+ MVPbkContactViewBase& aView,
+ TInt aError,
+ TBool aErrorNotified ) ;
+
+ private: // from MSmlSyncRelationship
+ TSmlSyncTaskKey SyncTaskKey() const;
+
+ void OpenReadStreamLC(RReadStream& aReadStream, TUid aStreamUid);
+
+ void OpenWriteStreamLC(RWriteStream& aWriteStream, TUid aStreamUid);
+
+ TBool IsStreamPresentL(TUid aStreamUid) const;
+
+ private: // Data
+
+ CNSmlDummyDataStore* iCNSmlDummyDataStore;
+ CNSmlAdapterTestUtilities* iTestUtilities;
+
+ CContactDatabase* iContactDatabase;
+ CContactIdArray* iIdArray;
+ RFs iFsSession;
+ RFileWriteStream iWriteStream;
+ TSmlDbItemUid iItemUid;
+ TSmlDbItemUid iItemUid2;
+
+ CNSmlDummyDataStoreWaiter* iStoreWaiter;
+ MVPbkContactViewBase* iContactViewBase;
+ CVPbkContactManager* iContactManager;
+
+ CSmlDataStore* iDataStore;
+
+ EUNIT_DECLARE_TEST_TABLE;
+ };
+
+#endif // __CNSMLDUMMYDATASTORE_TEST_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastorewaiter.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,309 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Source code file for datastorewaiter helper class.
+*
+*/
+
+// CLASS HEADER
+#include "cnsmldummydatastorewaiter.h"
+
+// INTERNAL INCLUDES
+#include "NSmlDummyDataStore.h"
+
+// EXTERNAL INCLUDES
+#include <EUnitMacros.h>
+
+// CONSTANTS
+
+
+// --- Constructors & destructors --------------------------------------------
+CNSmlDummyDataStoreWaiter* CNSmlDummyDataStoreWaiter::NewL(
+ CNSmlDummyDataStore& aStore )
+ {
+ CNSmlDummyDataStoreWaiter* self =
+ CNSmlDummyDataStoreWaiter::NewLC( aStore );
+ CleanupStack::Pop( self );
+
+ return self;
+ }
+
+CNSmlDummyDataStoreWaiter* CNSmlDummyDataStoreWaiter::NewLC(
+ CNSmlDummyDataStore& aStore )
+ {
+ CNSmlDummyDataStoreWaiter* self =
+ new ( ELeave ) CNSmlDummyDataStoreWaiter( aStore );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+
+ return self;
+ }
+
+CNSmlDummyDataStoreWaiter::~CNSmlDummyDataStoreWaiter()
+ {
+ Cancel();
+ delete iWait;
+ iOpen = EFalse;
+ }
+
+CNSmlDummyDataStoreWaiter::CNSmlDummyDataStoreWaiter(
+ CNSmlDummyDataStore& aStore ):
+ CActive( EPriorityNormal ), iStore( aStore ), iOpen( EFalse )
+ {
+
+ }
+
+void CNSmlDummyDataStoreWaiter::ConstructL()
+ {
+ CActiveScheduler::Add( this );
+ iWait = new ( ELeave ) CActiveSchedulerWait();
+ }
+
+// --- From CActive ----------------------------------------------------------
+void CNSmlDummyDataStoreWaiter::DoCancel()
+ {
+ iStore.CancelRequest();
+ }
+
+void CNSmlDummyDataStoreWaiter::RunL()
+ {
+ iWait->AsyncStop();
+ }
+
+// --- Test methods -----------------------------------------------------------
+
+void CNSmlDummyDataStoreWaiter::OpenStoreL( MSmlSyncRelationship& aRelationship,
+ const TDesC& aStoreName )
+ {
+ Cancel();
+ if ( aStoreName == KNSmlContactStoreNameForDefaultDB )
+ {
+ iStore.OpenL( KNSmlContactStoreNameForDefaultDB, aRelationship, iStatus );
+ }
+ else
+ {
+ iStore.OpenL( aStoreName, aRelationship, iStatus );
+ }
+ SetActive();
+
+ if( !iWait->IsStarted() )
+ {
+ iWait->Start();
+ }
+ iOpen = ETrue;
+ }
+
+TInt CNSmlDummyDataStoreWaiter::DoCommitChangeInfoL(
+ const MSmlDataItemUidSet& aItems )
+ {
+ if( !iOpen )
+ {
+ User::Leave( KErrNotReady );
+ }
+
+ Cancel();
+ iStore.DoCommitChangeInfoL( iStatus, aItems );
+ SetActive();
+
+ if( !iWait->IsStarted() )
+ {
+ iWait->Start();
+ }
+
+ return iStatus.Int();
+ }
+
+TInt CNSmlDummyDataStoreWaiter::DoResetChangeInfoL()
+ {
+ if( !iOpen )
+ {
+ User::Leave( KErrNotReady );
+ }
+
+ Cancel();
+ iStore.DoResetChangeInfoL( iStatus );
+ SetActive();
+
+ if( !iWait->IsStarted() )
+ {
+ iWait->Start();
+ }
+
+ return iStatus.Int();
+ }
+
+TInt CNSmlDummyDataStoreWaiter::DoCommitChangeInfoL()
+ {
+ if( !iOpen )
+ {
+ User::Leave( KErrNotReady );
+ }
+
+ Cancel();
+ iStore.DoCommitChangeInfoL( iStatus );
+ SetActive();
+
+ if( !iWait->IsStarted() )
+ {
+ iWait->Start();
+ }
+
+ return iStatus.Int();
+ }
+
+// Item addition in "normal" (non-batch) mode
+TInt CNSmlDummyDataStoreWaiter::DoCreateItemL( TSmlDbItemUid& aUid,
+ TInt aSize, const TDesC8& aMimeType, const TDesC8& aMimeVer )
+ {
+ if( !iOpen )
+ {
+ User::Leave( KErrNotReady );
+ }
+ Cancel();
+ iStore.DoCreateItemL( aUid, aSize, 0, aMimeType, aMimeVer, iStatus );
+
+ SetActive();
+
+ if( !iWait->IsStarted() )
+ {
+ iWait->Start();
+ }
+
+ return iStatus.Int();
+ }
+
+TInt CNSmlDummyDataStoreWaiter::DoCommitItemL()
+ {
+ if( !iOpen )
+ {
+ User::Leave( KErrNotReady );
+ }
+ Cancel();
+ iStore.DoCommitItemL( iStatus );
+
+ SetActive();
+
+ if( !iWait->IsStarted() )
+ {
+ iWait->Start();
+ }
+
+ return iStatus.Int();
+ }
+
+TInt CNSmlDummyDataStoreWaiter::DoCommitBatchL( RArray<TInt>& aResultArray )
+ {
+ if( !iOpen )
+ {
+ User::Leave( KErrNotReady );
+ }
+ Cancel();
+ iStore.DoCommitBatchL( aResultArray, iStatus );
+
+ SetActive();
+
+ if( !iWait->IsStarted() )
+ {
+ iWait->Start();
+ }
+
+ return iStatus.Int();
+ }
+
+void CNSmlDummyDataStoreWaiter::DoCancelBatch()
+ {
+ if( !iOpen )
+ {
+ return;
+ }
+ iStore.DoCancelBatch();
+ }
+
+TInt CNSmlDummyDataStoreWaiter::DoOpenItemL( TSmlDbItemUid aUid,
+ TBool& aFieldChange, TInt& aSize, TSmlDbItemUid& aParent,
+ TDes8& aMimeType, TDes8& aMimeVer )
+ {
+ if( !iOpen )
+ {
+ User::Leave( KErrNotReady );
+ }
+ Cancel();
+ iStore.OpenItemL( aUid, aFieldChange, aSize, aParent, aMimeType,
+ aMimeVer, iStatus );
+
+ SetActive();
+
+ if( !iWait->IsStarted() )
+ {
+ iWait->Start();
+ }
+
+ return iStatus.Int();
+ }
+
+TInt CNSmlDummyDataStoreWaiter::DoReplaceItemL( TSmlDbItemUid aUid,
+ TInt aSize, TSmlDbItemUid aParent, TBool aFieldChange )
+ {
+ if( !iOpen )
+ {
+ User::Leave( KErrNotReady );
+ }
+ Cancel();
+ iStore.ReplaceItemL( aUid, aSize, aParent, aFieldChange, iStatus );
+ SetActive();
+ if( !iWait->IsStarted() )
+ {
+ iWait->Start();
+ }
+ return iStatus.Int();
+ }
+
+TInt CNSmlDummyDataStoreWaiter::DoDeleteItemL( TSmlDbItemUid aUid )
+ {
+ if( !iOpen )
+ {
+ User::Leave( KErrNotReady );
+ }
+ Cancel();
+ iStore.DeleteItemL( aUid, iStatus );
+
+ SetActive();
+
+ if( !iWait->IsStarted() )
+ {
+ iWait->Start();
+ }
+
+ return iStatus.Int();
+ }
+
+TInt CNSmlDummyDataStoreWaiter::DoDeleteAllItemsL()
+ {
+ if( !iOpen )
+ {
+ User::Leave( KErrNotReady );
+ }
+ Cancel();
+ iStore.DeleteAllItemsL( iStatus );
+
+ SetActive();
+
+ if( !iWait->IsStarted() )
+ {
+ iWait->Start();
+ }
+
+ return iStatus.Int();
+ }
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummydatastorewaiter.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header file for datastorewaiter helper class.
+*
+*/
+
+#ifndef __CNSMLDUMMYDATASTOREWAITER_H__
+#define __CNSMLDUMMYDATASTOREWAITER_H__
+
+// INCLUDES
+#include <e32base.h>
+#include "nsmldummydatastore.h"
+
+// FORWARD DECLARATIONS
+class MSmlSyncRelationship;
+
+// CLASS DEFINITION
+
+
+NONSHARABLE_CLASS( CNSmlDummyDataStoreWaiter ):
+ public CActive
+ {
+ public: // Constructors and destructor
+ static CNSmlDummyDataStoreWaiter* NewL( CNSmlDummyDataStore& aStore );
+ static CNSmlDummyDataStoreWaiter* NewLC( CNSmlDummyDataStore& aStore );
+ virtual ~CNSmlDummyDataStoreWaiter();
+
+ private: // Constructors
+ CNSmlDummyDataStoreWaiter( CNSmlDummyDataStore& aStore );
+ void ConstructL();
+
+ private: // From CActive
+ void DoCancel();
+ void RunL();
+
+ public:
+ void OpenStoreL( MSmlSyncRelationship& aRelationship,
+ const TDesC& aStoreName = KNSmlContactStoreNameForDefaultDB );
+ TInt DoCommitChangeInfoL( const MSmlDataItemUidSet& aItems );
+ TInt DoResetChangeInfoL();
+ TInt DoCommitChangeInfoL();
+
+ TInt DoCreateItemL( TSmlDbItemUid& aUid, TInt aSize,
+ const TDesC8& aMimeType, const TDesC8& aMimeVer );
+ TInt DoCommitItemL();
+
+ TInt DoCommitBatchL( RArray<TInt>& aResultArray );
+ void DoCancelBatch();
+
+ TInt DoOpenItemL( TSmlDbItemUid aUid, TBool& aFieldChange,
+ TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType,
+ TDes8& aMimeVer );
+ TInt DoReplaceItemL( TSmlDbItemUid aUid, TInt aSize,
+ TSmlDbItemUid aParent, TBool aFieldChange );
+ TInt DoDeleteItemL( TSmlDbItemUid aUid );
+ TInt DoDeleteAllItemsL();
+
+ private: // Data
+ CActiveSchedulerWait* iWait;
+ CNSmlDummyDataStore& iStore;
+ TBool iOpen;
+ };
+
+#endif // __CNSMLDUMMYDATASTOREWAITER_H__
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummymodsfetcher_test.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,314 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Source code file for contact adapter's modfetcher unit tests.
+*
+*/
+
+#include "CNSmlDummyModsFetcher_Test.h"
+#include <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <CNTDB.H>
+#include <cntfield.h>
+#include <CNTFLDST.H>
+#include <nsmlsnapshotitem.h>
+#include <e32hashtab.h>
+#include <nsmlchangefinder.h>
+
+// VPbk includes
+#include <cvpbkcontactstoreuriarray.h>
+#include <tvpbkcontactstoreuriptr.h>
+#include <cvpbkcontactmanager.h>
+#include <VPbkContactStoreUris.h>
+#include <MVPbkContactStoreList.h>
+#include <CVPbkContactViewDefinition.h>
+#include <MVPbkContactLink.h>
+
+#include "CNSmlAdapterTestUtilities.h"
+#include "nsmldummymodsfetcher.h"
+
+namespace
+ {
+ _LIT( KTestDB, "c:eunitdb" );
+ }
+
+//// Implementation UID for contacts adapter
+const TUint KNSmlContactsAdapterImplUid = 0x101F6DDD;
+
+// - Construction -----------------------------------------------------------
+
+CNSmlDummyModsFetcher_Test* CNSmlDummyModsFetcher_Test::NewL()
+ {
+ CNSmlDummyModsFetcher_Test* self = CNSmlDummyModsFetcher_Test::NewLC();
+ CleanupStack::Pop();
+ return self;
+ }
+
+CNSmlDummyModsFetcher_Test* CNSmlDummyModsFetcher_Test::NewLC()
+ {
+ CNSmlDummyModsFetcher_Test* self = new( ELeave ) CNSmlDummyModsFetcher_Test();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+CNSmlDummyModsFetcher_Test::~CNSmlDummyModsFetcher_Test()
+ {
+ iReadStream.Close();
+ delete iTestData;
+
+ delete iCNSmlDummyModsFetcher;
+
+ delete iChangeFinder;
+
+ delete iTestUtilities;
+
+ delete iContactManager;
+ }
+
+CNSmlDummyModsFetcher_Test::CNSmlDummyModsFetcher_Test():
+ iKey( TKeyArrayFix( _FOFF( TNSmlSnapshotItem, ItemId() ), ECmpTInt ))
+ {
+ }
+
+void CNSmlDummyModsFetcher_Test::ConstructL()
+ {
+ CEUnitTestSuiteClass::ConstructL();
+ }
+
+// - Test methods -----------------------------------------------------------
+
+// ++++++++++++ SETUP METHODS ++++++++++++
+
+void CNSmlDummyModsFetcher_Test::SetupL( )
+ {
+ EUNIT_PRINT( _L("SetupL: begin"));
+ iTestUtilities = CNSmlAdapterTestUtilities::NewL();
+ iTestUtilities->SetupAndPopulateContactDbL( KTestDB );
+ iContactDatabase = iTestUtilities->GetDb();
+
+ iTestData = HBufC8::NewL( 1024 );
+ iReadStream.Open( *iTestData );
+
+ EUNIT_PRINT( _L("SetupL: contact mgr"));
+
+ // Create contact manager
+ CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
+ uriArray->AppendL( TVPbkContactStoreUriPtr( VPbkContactStoreUris::DefaultCntDbUri() ) );
+ iContactManager = CVPbkContactManager::NewL(*uriArray);
+ CleanupStack::PopAndDestroy(uriArray);
+
+ // Create store and open it
+ EUNIT_PRINT( _L("SetupL: store"));
+ iStore = iContactManager->ContactStoresL().Find(
+ TVPbkContactStoreUriPtr( VPbkContactStoreUris::DefaultCntDbUri() ) );
+ iStore->OpenL( *this );
+
+ iSyncHistory = EFalse;
+ iSnapshotRegistered = EFalse;
+
+ // Create platform ChangeFinder
+ EUNIT_PRINT( _L("SetupL: ChangeFinder"));
+ TRAPD(err, iChangeFinder = CNSmlChangeFinder::NewL(
+ *this, iKey, iSyncHistory, KNSmlContactsAdapterImplUid ));
+ if( err != KErrNone )
+ {
+ EUNIT_PRINT( _L("ChangeFinder Error: %d"), err );
+ }
+
+ // Finally, create ModsFetcher && assert allocation
+ EUNIT_PRINT( _L("SetupL: ModsFetcher"));
+ iCNSmlDummyModsFetcher = new (ELeave) CNSmlDummyModsFetcher(
+ iSnapshotRegistered,
+ *iContactManager,
+ *iStore,
+ iKey,
+ *iChangeFinder );
+
+ EUNIT_ASSERT( iCNSmlDummyModsFetcher );
+
+ iCNSmlDummyModsFetcher->ConstructL();
+
+ iLastChanged = Time::NullTTime();
+
+ EUNIT_PRINT( _L("SetupL -end"));
+ }
+
+void CNSmlDummyModsFetcher_Test::SetupCreateItemL()
+ {
+ SetupL();
+ iCardId = iTestUtilities->AddContactL( _L("Test"), KNullDesC(),
+ KNullDesC() );
+ }
+
+
+// ++++++++++++ TEARDOWN METHODS ++++++++++++
+
+void CNSmlDummyModsFetcher_Test::Teardown()
+ {
+ iReadStream.Close();
+ delete iTestData;
+ iTestData = NULL;
+
+ EUNIT_PRINT( _L("Teardown"));
+ delete iCNSmlDummyModsFetcher;
+ iCNSmlDummyModsFetcher = NULL;
+ EUNIT_PRINT( _L("Teardown-2"));
+
+ delete iChangeFinder;
+ EUNIT_PRINT( _L("Teardown-3"));
+
+ EUNIT_PRINT( _L("Teardown-4"));
+
+ EUNIT_PRINT( _L("Teardown-5"));
+ if ( iContactManager )
+ {
+ if(iStore)
+ {
+ iStore->Close( *this );
+ }
+ delete iContactManager;
+ iContactManager = NULL;
+ }
+ EUNIT_PRINT( _L("Teardown-6"));
+ TRAP_IGNORE( iTestUtilities->TeardownAndEmptyContactDbL( KTestDB ) );
+ delete iTestUtilities;
+ iTestUtilities = NULL;
+ iCardId = 0;
+ EUNIT_PRINT( _L("Teardown-7"));
+ }
+
+void CNSmlDummyModsFetcher_Test::CreateViewL()
+ {
+ CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
+ CleanupStack::PushL( viewDef );
+ viewDef->SetType( EVPbkContactsView );
+
+ //viewDef->SetUriL( iStore->StoreProperties().Uri().UriDes() );
+
+ iContactViewBase = iContactManager->CreateContactViewLC(
+ *this,
+ *viewDef,
+ iContactManager->FieldTypes() );
+ CleanupStack::Pop();
+ CleanupStack::PopAndDestroy( viewDef );
+ }
+
+// ++++++++++++ ACTUAL TEST METHODS ++++++++++++
+
+// ------------------ From MSmlSyncRelationship ---------------------
+TSmlSyncTaskKey CNSmlDummyModsFetcher_Test::SyncTaskKey() const
+ {
+ EUNIT_PRINT( _L("SyncTaskKey"));
+ return 0;
+ }
+
+void CNSmlDummyModsFetcher_Test::OpenReadStreamLC(RReadStream& aReadStream, TUid /*aStreamUid*/)
+ {
+ EUNIT_PRINT( _L("OpenReadStreamLC"));
+ aReadStream = iReadStream;
+ CleanupClosePushL( iReadStream );
+
+ EUNIT_PRINT( _L("OpenReadStreamLC - end"));
+ }
+
+void CNSmlDummyModsFetcher_Test::OpenWriteStreamLC(RWriteStream& /*aWriteStream*/, TUid /*aStreamUid*/)
+ {
+ EUNIT_PRINT( _L("OpenWriteStreamLC"));
+ }
+
+TBool CNSmlDummyModsFetcher_Test::IsStreamPresentL(TUid /*aStreamUid*/) const
+ {
+ EUNIT_PRINT( _L("IsStreamPresentL"));
+ return EFalse;
+ }
+// ---------------- MSmlSyncRelationship END -----------------------
+
+// ------------------ From MVPbkContactStoreObserver ---------------------
+void CNSmlDummyModsFetcher_Test::StoreReady(
+ MVPbkContactStore& /*aContactStore*/ )
+ {
+ }
+
+void CNSmlDummyModsFetcher_Test::StoreUnavailable(
+ MVPbkContactStore& /*aContactStore*/, TInt /*aReason*/)
+ {
+ }
+
+void CNSmlDummyModsFetcher_Test::HandleStoreEventL(
+ MVPbkContactStore& /*aContactStore*/,
+ TVPbkContactStoreEvent /*aStoreEvent*/)
+ {
+ }
+
+// ------------------ From MVPbkContactViewObserver ---------------------
+void CNSmlDummyModsFetcher_Test::ContactViewReady( MVPbkContactViewBase& /*aView*/ )
+ {
+ }
+
+void CNSmlDummyModsFetcher_Test::ContactViewUnavailable(
+ MVPbkContactViewBase& /*aView*/ )
+ {
+ }
+
+void CNSmlDummyModsFetcher_Test::ContactAddedToView(
+ MVPbkContactViewBase& /*aView*/,
+ TInt /*aIndex*/,
+ const MVPbkContactLink& /*aContactLink*/ )
+ {
+ }
+
+void CNSmlDummyModsFetcher_Test::ContactRemovedFromView(
+ MVPbkContactViewBase& /*aView*/,
+ TInt /*aIndex*/,
+ const MVPbkContactLink& /*aContactLink*/ )
+ {
+ }
+
+void CNSmlDummyModsFetcher_Test::ContactViewError(
+ MVPbkContactViewBase& /*aView*/,
+ TInt /*aError*/,
+ TBool /*aErrorNotified*/ )
+ {
+ }
+
+// ---------------- MVPbkContactStoreObserver END -----------------------
+
+// Helper functions
+
+CContactItemField* CNSmlDummyModsFetcher_Test::CreateConfidentialLC()
+ {
+ CContactItemField* confidentialField =
+ CContactItemField::NewLC( KStorageTypeText, KUidContactFieldClass );
+ confidentialField->SetMapping( KUidContactFieldVCardMapClass );
+ confidentialField->TextStorage()->SetTextL( KNSmlContactSyncNoSync );
+ EUNIT_PRINT( _L("CreateConfidentialLC - END"));
+ return confidentialField;
+ }
+
+
+// - EUnit test table -------------------------------------------------------
+
+EUNIT_BEGIN_TEST_TABLE(
+ CNSmlDummyModsFetcher_Test,
+ "Unit tests for CNSmlDummyModsFetcher.",
+ "UNIT" )
+
+EUNIT_TEST(
+ "CNSmlContactsModsFetcher allocation",
+ "CNSmlContactsModsFetcher",
+ "Allocation",
+ "FUNCTIONALITY",
+ SetupL, Empty, Teardown)
+
+EUNIT_END_TEST_TABLE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/cnsmldummymodsfetcher_test.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,174 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header file for contact adapter's modfetcher unit tests.
+*
+*/
+
+#ifndef __CNSMLDUMMYMODSFETCHER_TEST_H__
+#define __CNSMLDUMMYMODSFETCHER_TEST_H__
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+#include <SmlDataSyncDefs.h>
+#include <S32MEM.H>
+#include <CNTDEF.H>
+#include <MVPbkContactStore.h>
+#include <MVPbkContactStoreObserver.h>
+#include <MVPbkContactViewObserver.h>
+#include <MVPbkContactViewBase.h>
+
+// FORWARD DECLARATIONS
+class CNSmlDummyModsFetcher;
+class CContactDatabase;
+class CNSmlChangeFinder;
+class CNSmlAdapterTestUtilities;
+class CContactItemField;
+class CVPbkContactManager;
+
+
+// CLASS DEFINITION
+/**
+ * Generated EUnit test suite class.
+ */
+NONSHARABLE_CLASS( CNSmlDummyModsFetcher_Test ):
+ public CEUnitTestSuiteClass,
+ public MSmlSyncRelationship,
+ public MVPbkContactStoreObserver,
+ public MVPbkContactViewObserver
+ {
+ public: // Constructors and destructor
+
+ static CNSmlDummyModsFetcher_Test* NewL();
+ static CNSmlDummyModsFetcher_Test* NewLC();
+ ~CNSmlDummyModsFetcher_Test();
+
+ private: // Constructors
+
+ CNSmlDummyModsFetcher_Test();
+ void ConstructL();
+
+ private: // New methods
+
+ void Empty() {};
+
+ void SetupL();
+ void SetupCreateItemL();
+
+ void Teardown();
+
+ void CreateViewL();
+
+ void RunError();
+
+ void ContactViewUnavailable();
+
+ void ContactRemovedFromView();
+
+ void ContactViewError();
+
+ void VPbkSingleContactOperationFailed();
+
+ public: // MSmlSyncRelationship
+
+ /**
+ Returns the unique identifier for the synchronisation relationship.
+ @return A unique identifier for the sync relationship.
+ */
+ TSmlSyncTaskKey SyncTaskKey() const;
+
+ /**
+ Opens a specified stream for reading, and places an item on the cleanup stack to close it.
+ @param aReadStream On return, an open read stream
+ @param aStreamUid The UID of the stream to open for reading.
+ */
+ void OpenReadStreamLC(RReadStream& aReadStream, TUid aStreamUid);
+
+ /**
+ Opens the specified stream, or creates a new one if it does not exist, and places an item on the cleanup stack to close it.
+ @param aWriteStream On return, an open write stream
+ @param aStreamUid The UID of the stream to open or create
+ */
+ void OpenWriteStreamLC(RWriteStream& aWriteStream, TUid aStreamUid);
+
+ /**
+ Tests if the specified stream identified exists in the store.
+ @param aStreamUid The stream UID
+ @return Non-zero if the stream exists, otherwise EFalse.
+ */
+ TBool IsStreamPresentL(TUid aStreamUid) const;
+
+ private: // from MVPbkContactStoreObserver
+
+ void StoreReady(MVPbkContactStore& aContactStore);
+
+ void StoreUnavailable(MVPbkContactStore& aContactStore,
+ TInt aReason);
+
+ void HandleStoreEventL(
+ MVPbkContactStore& aContactStore,
+ TVPbkContactStoreEvent aStoreEvent);
+
+ // From MVPbkContactViewObserver
+ void ContactViewReady( MVPbkContactViewBase& aView ) ;
+
+ void ContactViewUnavailable(
+ MVPbkContactViewBase& aView ) ;
+
+ void ContactAddedToView(
+ MVPbkContactViewBase& aView,
+ TInt aIndex,
+ const MVPbkContactLink& aContactLink );
+
+ void ContactRemovedFromView(
+ MVPbkContactViewBase& aView,
+ TInt aIndex,
+ const MVPbkContactLink& aContactLink ) ;
+
+ void ContactViewError(
+ MVPbkContactViewBase& aView,
+ TInt aError,
+ TBool aErrorNotified ) ;
+
+
+ private: // helper
+
+ CContactItemField* CreateConfidentialLC();
+
+
+ private: // Data
+
+ CNSmlDummyModsFetcher* iCNSmlDummyModsFetcher;
+ CContactDatabase* iContactDatabase; // Not owned
+ CNSmlChangeFinder* iChangeFinder;
+ TKeyArrayFix iKey;
+ TBool iSyncHistory;
+ TBool iSnapshotRegistered;
+ HBufC8* iTestData;
+ RDesReadStream iReadStream;
+
+ CNSmlAdapterTestUtilities* iTestUtilities;
+ TContactItemId iCardId;
+ TTime iLastChanged;
+
+ // VPbk related
+ CVPbkContactManager* iContactManager;
+ MVPbkContactStore* iStore;
+ MVPbkContactViewBase* iContactViewBase;
+
+ EUNIT_DECLARE_TEST_TABLE;
+
+ };
+
+#endif // __CNSMLDUMMYMODSFETCHER_TEST_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/dllmain.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,38 @@
+// EXTERNAL INCLUDES
+#include <CEUnitTestSuite.h>
+#include "CNSmlDummyDataProvider_Test.h"
+#include "CNSmlDummyDataStore_Test.h"
+#include "CNSmlDummyModsFetcher_Test.h"
+
+/**
+* UT_nsmldscontactsdataprovider.dll test suite factory function.
+*/
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+ {
+ // In this example, a root suite is needed for holding the two suites
+ //with test cases. If there was only one suite with tests, that suite
+ //instance could be returned directly. (see the other examples)
+ CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC(_L("Unit test for Contact adapter"));
+
+ // Unit tests for dataprovider class (CNSmlDummyDataProvider)
+ MEUnitTest* providerSuite = CNSmlDummyDataProvider_Test::NewL();
+ CleanupStack::PushL( providerSuite );
+ rootSuite->AddL( providerSuite );
+ CleanupStack::Pop( providerSuite );
+
+ // Unit tests for datastore class (CNSmlDummyDataStore)
+ MEUnitTest* storeSuite = CNSmlDummyDataStore_Test::NewL();
+ CleanupStack::PushL( storeSuite );
+ rootSuite->AddL( storeSuite );
+ CleanupStack::Pop( storeSuite );
+
+ // Unit tests for ModsFetcher class (CNSmlDummyModsFetcher)
+ MEUnitTest* modsFetcherSuite = CNSmlDummyModsFetcher_Test::NewL();
+ CleanupStack::PushL( modsFetcherSuite );
+ rootSuite->AddL( modsFetcherSuite );
+ CleanupStack::Pop( modsFetcherSuite );
+
+ CleanupStack::Pop( rootSuite );
+
+ return rootSuite;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/basic.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,5 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Smith;John
+TITLE:Boss
+END:VCARD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/basicInvalid.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,4 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Smith;John
+TITLE:Boss
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/basic_partial.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,5 @@
+BEGIN:VCARD
+VERSION:2.1
+N:White;John
+URL;WORK:http://www.nokia.com
+END:VCARD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/email_type_issue.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Smith;John
+TITLE:Boss
+EMAIL;TYPE=internet:jqpublic@xyz.dom1.com
+END:VCARD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/issue1_standard.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Jill;;;
+TEL;CELL:+491713902793
+URL:http://
+END:VCARD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multioccurence.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,9 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Smith;John
+ORG:Firm
+TITLE:Boss
+TEL;WORK;VOICE:123456
+TEL;HOME;VOICE:987654
+TEL;CELL;VOICE:111111
+END:VCARD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multioccurence_partial.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,8 @@
+BEGIN:VCARD
+VERSION:2.1
+N:White;John
+ORG:Firm
+TITLE:Boss
+TEL;HOME;VOICE:987654
+TEL;CELL;VOICE:222222
+END:VCARD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multioccurence_partial2.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,6 @@
+BEGIN:VCARD
+VERSION:2.1
+N:White;John
+ORG:Firm
+TITLE:Specialist
+END:VCARD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multipleVCards.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,34 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Software;Sidney
+FN:Sidney Software
+ORG:Firm
+TITLE:Boss
+TEL;WORK;VOICE:132456798
+TEL;HOME;VOICE:654654987
+TEL;CELL;VOICE:0400654987654
+ADR;WORK:;;Firmstreet 1;New City;Sawo;00000;Finland
+EMAIL;PREF;INTERNET:John.Smith@firm.com
+REV:20080306T115812Z
+END:VCARD
+
+BEGIN:VCARD
+VERSION:2.1
+N:Sorsa;Simon
+FN:Simon Sorsa
+ORG:Duck inc.
+TITLE:Slave
+TEL;CELL;VOICE:123456789
+ADR;WORK:;;Duckstreet 1;Town;HundredAbout;00000;Finland
+EMAIL;PREF;INTERNET:Simon.Sorsa@duck.com
+REV:20080306T115812Z
+END:VCARD
+
+BEGIN:VCARD
+VERSION:2.1
+N:Karhu;Gabriel
+FN:Gabriel Karhu
+TEL;CELL;VOICE:09787967638
+EMAIL;PREF;INTERNET:gabriel.karhu@foobar.com
+REV:20080306T115812Z
+END:VCARD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/multipleVCards_Standard.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,31 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Software;Sidney
+FN:Sidney Software
+ORG:Firm
+TITLE:Boss
+TEL;WORK;VOICE:132456798
+TEL;HOME;VOICE:654654987
+TEL;CELL;VOICE:0400654987654
+ADR;WORK:;;Firmstreet 1;New City;Sawo;00000;Finland
+EMAIL;PREF;INTERNET:John.Smith@firm.com
+END:VCARD
+
+BEGIN:VCARD
+VERSION:2.1
+N:Sorsa;Simon
+FN:Simon Sorsa
+ORG:Duck inc.
+TITLE:Slave
+TEL;CELL;VOICE:123456789
+ADR;WORK:;;Duckstreet 1;Town;HundredAbout;00000;Finland
+EMAIL;PREF;INTERNET:Simon.Sorsa@duck.com
+END:VCARD
+
+BEGIN:VCARD
+VERSION:2.1
+N:Karhu;Gabriel
+FN:Gabriel Karhu
+TEL;CELL;VOICE:09787967638
+EMAIL;PREF;INTERNET:gabriel.karhu@foobar.com
+END:VCARD
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/photo_issue.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,63 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Hopo1;Hessua;qwerty
+PHOTO;JPEG;ENCODING=BASE64:
+ /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkS
+ Ew8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJ
+ CQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy
+ MjIyMjIyMjIyMjIyMjL/wAARCAC3AMoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEA
+ AAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh
+ MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6
+ Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZ
+ mqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx
+ 8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
+ AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV
+ YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hp
+ anN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPE
+ xcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3
+ +iiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+ CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+ CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+ CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+ CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+ CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA
+ CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooqvf31vpm
+ nXN/eSeXa2sTzTPtJ2ooJY4HJwAelAGH4l8ZWXhu4gtZVjaedCwea6it4IecJ5ru
+ wKhiGxtVmIjkIU7SK5tPFN75Vrqo8X6HqjWWJ9X07SpIxCloFIllXPmSs0bMrZDK
+ GVNoUMees8K6XNp2lyz3iSJqGo3D314jymQxySYxFuyQRGgSMFcAiMEAZqn42+xw
+ W2k3knkR366rZQWkzYEo8y5iEiRt1+aMOGA6qDnjNAHUUVzfh+ZdIv5fC0gkjS2T
+ fpQaNjvskSIf6wDaSjuY8E79oQtnO5ukoAKKKKAI554bW3luLiWOGCJC8kkjBVRQ
+ MkkngADnNcnpEur+L7VtZXUdV0Own2NYQRJaM0sDRIwlfckuGLM4xuHyqvyg5Jse
+ Kfsd/qOn6NqnkDSWim1K++0Y8uSO3MeEfPRd8qSE5xiLaQQxxTtNBtPGD3Gp69Ld
+ 3EUrwlNFluHSKyVVWREnhUgPKdyu4kDY3KoyFDMAalh4n0S3+zaReeKtKu9Xj2W0
+ w+0xRySzjCt+7DfKxbPyjoTiugqnNpOm3OljS59PtJdPCKgtHhVogq42jYRjAwMD
+ HGBWf4Rnmk8NWlreSyS6hYILK9aViztNGArOc8kPgSKTgsrq2OaANyiiigAooooA
+ KKKKACiiigAooooAKKKKACiiigArD8aQTXXgXxDb28Uk08umXKRxxqWZ2MTAAAck
+ k8YrcooA5uD4g+Dbm3inTxVowSRA6iS9jRgCM8qxBU+xAI71XF3beKPFmj3WlajH
+ eaXpaT3E0to6SRG5ZRFEpcA5IjknJVTkZQtjK56yigAooooAKKKKAOH8dWNxfanZ
+ 2UMf/IV0rU9IimZgEjnljjkTf/FtKwScgHGB610HhjSbjR9Dhhv7n7Vqcv76/ujg
+ madvvHIVflHCrwMIqjtWhfWNvqNnJa3UfmQvgkBipBBBVlYYKsCAQwIIIBBBFY/2
+ HxZH8kWv6U8a8K1xpDtIw7FylwqlvUqqjPQAcUAdBXN+Ep4dQl1/VbOWOewvtTL2
+ s8bBllVIIYWI9vMikGe+MjIIJJ/CZ1m3lj8R6nd34lQo1vaSyWVuFIwwCRvuYMMZ
+ EjvznbtBIroIIIbW3it7eKOGCJAkccahVRQMAADgADjFAElFFFABRRRQAUUUUAFF
+ FFABRRRQAUUUUAFFFFABRRRQAUVj3l9cW/i3SrUybLG5tLoMCow86tCY1Df3tnnk
+ KDyFY4O3jYoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKK
+ ACiiigAooooAz9Y0z+1LNEjm+z3UEqXFtOF3GORTkcZBKkZRgCCyOy5Gc0aTqf8A
+ aUU6Sw+ReWkv2e6gDbxHJtV/lbA3KVdGBwDhhkK2VGhWPqGmXi6idW0iaCO+aJYZ
+ 4rlS0dzGhZkXIOY2BdwHAYAO2UfC7QDYorn/APhNvD8H7vU9Sg0i6H3rXU5FtpAe
+ +A5Adc5G9CyEg4Y4o/4Tvwf/ANDXof8A4MYf/iqAOgorn/8AhO/B/wD0Neh/+DGH
+ /wCKrQ0zXdH1vzf7J1Wxv/Jx5n2S4SXZnOM7ScZwevoaANCiiigAooooAKKKKACi
+ svQNSm1XTpbidY1dL27twEBA2xXEkSnknnagJ989OlalABRRRQAUUUUAFFFFABRR
+ RQAUUUUAFFFFABRRRQAUUUUAFZ+p6Fo+t+V/a2lWN/5OfL+126S7M4zjcDjOB09B
+ WhRQBz//AAgng/8A6FTQ/wDwXQ//ABNH/CCeD/8AoVND/wDBdD/8TXQUUAc//wAI
+ J4P/AOhU0P8A8F0P/wATR/wgng//AKFTQ/8AwXQ//E10FFAHP/8ACCeD/wDoVND/
+ APBdD/8AE0f8IJ4P/wChU0P/AMF0P/xNdBRQBXsbCz0yzjs7C0gtLWPOyGCMRouS
+ ScKOBkkn8asUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAF
+ FFFABRRRQAUUUUAFFFFABRRRQB//2Q==
+
+UID:dd7pc23a200904211251281062027
+BDAY:20090415T000000Z
+EMAIL;INTERNET:jaa.joo@ii.fi
+TEL;CELL;PREF:78787878
+TEL;HOME;VOICE:131313
+END:VCARD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/standard.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,17 @@
+BEGIN:VCARD
+VERSION:2.1
+N:Smith;John
+FN:John Smith
+ORG:Firm
+TITLE:Boss
+NOTE;ENCODING=QUOTED-PRINTABLE:Liirum larum.=0D=0A
+TEL;WORK;VOICE:132456798
+TEL;HOME;VOICE:654654987
+TEL;CELL;VOICE:0400654987654
+TEL;WORK;FAX:2321654987987
+ADR;WORK:;;Firmstreet 1;New City;Sawo;00000;Finland
+LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Firmstreet 1=0D=0ANew City, Sawo 00000=0D=0AFinland
+URL;WORK:http://www.nokia.com
+EMAIL;PREF;INTERNET:John.Smith@firm.com
+REV:20080306T115812Z
+END:VCARD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/testdata/tel_type_issue.vcf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,9 @@
+BEGIN:VCARD
+VERSION:2.1
+ORG:nokia
+N:Testaaja;Teppo;Kustaa
+BDAY:20090415T000000Z
+TEL;CELL:123456789
+TEL;HOME;VOICE;PREF:987654321
+TEL;WORK;VOICE:54545454
+END:VCARD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/ContactAdapter/ut_nsmldsdummyadapter.mmp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MMP file for contact adapter unit tests.
+*
+*/
+
+#include <Digia/Eunit/EUnitCaps.h>
+#include <platform_paths.hrh>
+#include <defaultcaps.hrh>
+#include <data_caging_paths.hrh>
+
+// DEFINES
+#define KMyUniqueUid3 0x01700000
+#define KEUnitTestDllUid2 0x1000af5a
+MACRO __NSML_MODULETEST__
+
+// Build target
+TARGET UT_nsmldsdummydataprovider.dll
+TARGETTYPE dll
+UID KEUnitTestDllUid2 KMyUniqueUid3
+//UID 0x100039CE 0x2001FDEA
+CAPABILITY EUNIT_CAPS
+VENDORID 0x00000000
+
+#if defined(ARMCC)
+DEFFILE .\def\eabicontactsdataprovider_test
+#elif defined(WINSCW)
+DEFFILE .\def\bwinscwcontactsdataprovider_test
+#endif
+
+// Source files
+SOURCEPATH .
+SOURCE DllMain.cpp
+SOURCE CNSmlDummyDataProvider_Test.cpp
+SOURCE CNSmlDummyDataStore_Test.cpp
+SOURCE CNSmlAdapterTestUtilities.cpp
+SOURCE CNSmlDummyModsFetcher_Test.cpp
+SOURCE CNSmlDummyDataStoreWaiter.cpp
+
+// Code under test
+SOURCEPATH ..\DummyAdapter\src
+SOURCE nsmldummydataprovider.cpp
+SOURCE nsmldummymodsfetcher.cpp
+SOURCE nsmldummydatastore.cpp
+SOURCE nsmldummydllmain.cpp
+SOURCE nsmldummyutility.cpp
+
+// Include paths
+USERINCLUDE . ..\DummyAdapter\Inc
+
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE \epoc32\include\ecom
+SYSTEMINCLUDE \epoc32\include\syncml
+SYSTEMINCLUDE \epoc32\include\internal
+SYSTEMINCLUDE \epoc32\include\Digia\EUnit
+
+SOURCEPATH .\testdata
+
+// Dependencies to system components
+LIBRARY euser.lib EUnit.lib ECom.lib
+LIBRARY bafl.lib efsrv.lib estor.lib nsmldebug.lib sysutil.lib
+LIBRARY nsmlchangefinder.lib cntmodel.lib wbxmllib.lib
+LIBRARY smlstoreformat.lib smldataprovider.lib
+LIBRARY nsmldshostclient.lib versit.lib charconv.lib vcard.lib
+LIBRARY nsmlcontactsdataprovider.lib nsmldummydataprovider.lib
+LIBRARY centralrepository.lib flogger.lib
+LIBRARY nsmldatamod.lib
+LIBRARY VPbkEng.lib
+LIBRARY vpbkvcardEng.lib
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydataprovider.loc Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Localization file for DS Dummy Adapter.
+*
+*/
+
+//d:Display name for registry info
+//l:list_setting_pane_t1
+//
+#define qtn_nsml_dummy_adapter_display_name "Contacts (dummy)"
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydataprovider.rss Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Registery info for DS Dummy Adapter.
+*
+*/
+
+#include "nsmldummydataprovider.loc"
+
+#include <registryinfo.rh>
+#include <nsmldsconstants.h>
+
+RESOURCE REGISTRY_INFO theRegistryInfo
+ {
+ dll_uid = 0x2001FDF1; // DS interface implementation UID
+ interfaces =
+ {
+ INTERFACE_INFO
+ {
+ interface_uid = KNSmlDSInterfaceUid; // DS interface UID
+ implementations =
+ {
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = 0x2001FDF1; // DS interface implementation UID
+ version_no = 1;
+ display_name = qtn_nsml_dummy_adapter_display_name;
+ default_data = "";
+ opaque_data = "";
+ }
+ };
+ }
+ };
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydatastoreformat_1_1_2.rss Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,596 @@
+CHARACTER_SET UTF8
+
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Resource data for DS Dummy dataprovider.
+*
+*/
+
+#include "SmlDataFormat.rh"
+#include "SmlDataFormat.hrh"
+
+RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
+ {
+ version=1;
+ display_name="Test adapter";
+ sync_types=KSmlSyncType_TwoWay+KSmlSyncType_OneWayFromSvr+
+ KSmlSyncType_OneWayFromClnt+KSmlSyncType_SlowSync+
+ KSmlSyncType_RefreshFromSvr+KSmlSyncType_RefreshFromClnt;
+ mime_format=
+ {
+ SML_MIME_FORMAT
+ {
+ version=1;
+ mime_type="text/x-vcard";
+ mime_ver="2.1";
+ properties=
+ {
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Begin";
+ name="BEGIN";
+ data_type="";
+ enum_values={"VCARD"};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="End";
+ name="END";
+ data_type="";
+ enum_values={"VCARD"};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Version";
+ name="VERSION";
+ data_type="";
+ enum_values={"2.1"};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Revision";
+ name="REV";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Name";
+ name="N";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Address";
+ name="ADR";
+ data_type="";
+ enum_values={};
+ flags=0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Home address";
+ name="HOME";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Work address";
+ name="WORK";
+ data_type="";
+ enum_values={};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Telephone number";
+ name="TEL";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Home telephone";
+ name="HOME";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Work telephone";
+ name="WORK";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Cellular number";
+ name="CELL";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Pager number";
+ name="PAGER";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Fax number";
+ name="FAX";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Video number";
+ name="VIDEO";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Default number";
+ name="PREF";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Car telephone";
+ name="CAR";
+ data_type="";
+ enum_values={};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="FullName";
+ name="FN";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Email address";
+ name="EMAIL";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="";
+ name="INTERNET";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Home email";
+ name="HOME";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Work email";
+ name="WORK";
+ data_type="";
+ enum_values={};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="URL address";
+ name="URL";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Home URL";
+ name="HOME";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Work URL";
+ name="WORK";
+ data_type="";
+ enum_values={};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Note";
+ name="NOTE";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Title";
+ name="TITLE";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Organisation";
+ name="ORG";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Photo";
+ name="PHOTO";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Birthday";
+ name="BDAY";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Sound";
+ name="SOUND";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Wireless Village Id";
+ name="X-WV-ID";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Assistant name";
+ name="X-ASSISTANT";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Assistant phone";
+ name="X-ASSISTANT-TEL";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Anniversary";
+ name="X-ANNIVERSARY";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Spouse";
+ name="X-SPOUSE";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Children";
+ name="X-CHILDREN";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Nickname";
+ name="X-NICKNAME";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Class";
+ name="X-CLASS";
+ data_type="";
+ enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="IMPP";
+ name="X-IMPP";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="";
+ name="PERSONAL";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="";
+ name="HOME";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="";
+ name="WORK";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="";
+ name="BUSINESS";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="";
+ name="MOBILE";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="";
+ name="PREF";
+ data_type="";
+ enum_values={};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Top contact";
+ name="X-FAVORITE";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="SIP protocol";
+ name="X-SIP";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="POC";
+ name="POC";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="SWIS";
+ name="SWIS";
+ data_type="";
+ enum_values={};
+ },
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Voice over IP";
+ name="VOIP";
+ data_type="";
+ enum_values={};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Categories";
+ name="X-CATEGORIES";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ }
+ };
+ field_level=0;
+ }
+ };
+ mime_format_tx_pref=0; // Preferred index for tx
+ mime_format_rx_pref=0; // Preferred index for rx
+ folder_properties={};
+ filter_capabilities={};
+ max_size=0; // no limit
+ max_items=0; // no limit
+ flags=0;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/data/nsmldummydatastoreformat_1_2.rss Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,448 @@
+CHARACTER_SET UTF8
+
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Resource data for DS Dummy dataprovider.
+*
+*/
+
+#include "SmlDataFormat.rh"
+#include "SmlDataFormat.hrh"
+
+RESOURCE SML_DATA_STORE_FORMAT NSML_CONTACTS_DATA_STORE_FORMAT
+ {
+ version=1;
+ display_name="Test adapter";
+ sync_types=KSmlSyncType_TwoWay+KSmlSyncType_OneWayFromSvr+
+ KSmlSyncType_OneWayFromClnt+KSmlSyncType_SlowSync+
+ KSmlSyncType_RefreshFromSvr+KSmlSyncType_RefreshFromClnt;
+ mime_format=
+ {
+ SML_MIME_FORMAT
+ {
+ version=1;
+ mime_type="text/x-vcard";
+ mime_ver="2.1";
+ properties=
+ {
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Begin";
+ name="BEGIN";
+ data_type="";
+ enum_values={"VCARD"};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="End";
+ name="END";
+ data_type="";
+ enum_values={"VCARD"};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Version";
+ name="VERSION";
+ data_type="";
+ enum_values={"2.1"};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Revision";
+ name="REV";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Name";
+ name="N";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Address";
+ name="ADR";
+ data_type="";
+ enum_values={};
+ flags=0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Type";
+ name="TYPE";
+ data_type="";
+ enum_values={"HOME", "WORK"};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Telephone number";
+ name="TEL";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Type";
+ name="TYPE";
+ data_type="";
+ enum_values={"HOME", "WORK", "CELL", "PAGER", "FAX", "VIDEO", "PREF", "CAR"};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="FullName";
+ name="FN";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Email address";
+ name="EMAIL";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Type";
+ name="TYPE";
+ data_type="";
+ enum_values={"INTERNET", "HOME", "WORK"};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="URL address";
+ name="URL";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Type";
+ name="TYPE";
+ data_type="";
+ enum_values={"HOME", "WORK"};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Note";
+ name="NOTE";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Title";
+ name="TITLE";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Organisation";
+ name="ORG";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Photo";
+ name="PHOTO";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Birthday";
+ name="BDAY";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Sound";
+ name="SOUND";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Wireless Village Id";
+ name="X-WV-ID";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Assistant name";
+ name="X-ASSISTANT";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Assistant phone";
+ name="X-ASSISTANT-TEL";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Anniversary";
+ name="X-ANNIVERSARY";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Spouse";
+ name="X-SPOUSE";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Children";
+ name="X-CHILDREN";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Nickname";
+ name="X-NICKNAME";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Class";
+ name="X-CLASS";
+ data_type="";
+ enum_values={"PUBLIC","PRIVATE","CONFIDENTIAL"};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="IMPP";
+ name="X-IMPP";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Type";
+ name="TYPE";
+ data_type="";
+ enum_values={"PERSONAL", "HOME", "WORK","BUSINESS", "MOBILE", "PREF"};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Top Contact";
+ name="X-FAVORITE";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="SIP protocol";
+ name="X-SIP";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params=
+ {
+ SML_DATA_PROPERTY_PARAM
+ {
+ version=1;
+ display_name="Type";
+ name="TYPE";
+ data_type="";
+ enum_values={"POC", "SWIS", "VOIP"};
+ }
+ };
+ },
+ SML_DATA_PROPERTY
+ {
+ version=1;
+ display_name="Categories";
+ name="X-CATEGORIES";
+ data_type="";
+ enum_values={};
+ flags= 0;
+ max_size=256;
+ max_occur=0;
+ params={};
+ }
+ };
+ field_level=0;
+ }
+ };
+ mime_format_tx_pref=0; // Preferred index for tx
+ mime_format_rx_pref=0; // Preferred index for rx
+ folder_properties={};
+ filter_capabilities={};
+ max_size=0; // no limit
+ max_items=0; // no limit
+ flags=0;
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/bld.inf Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: build info file for DS Dummy adapter
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_MMPFILES
+.\nsmldummydataprovider.mmp
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/def/bwinscwdummydataprovideru.def Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+ ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/def/eabidummydataprovideru.def Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,9 @@
+EXPORTS
+ _Z24ImplementationGroupProxyRi @ 1 NONAME
+ _ZTI19CNSmlDummyDataStore @ 2 NONAME ; #<TI>#
+ _ZTI21CNSmlDummyModsFetcher @ 3 NONAME ; #<TI>#
+ _ZTI22CNSmlDummyDataProvider @ 4 NONAME ; #<TI>#
+ _ZTV19CNSmlDummyDataStore @ 5 NONAME ; #<VT>#
+ _ZTV21CNSmlDummyModsFetcher @ 6 NONAME ; #<VT>#
+ _ZTV22CNSmlDummyDataProvider @ 7 NONAME ; #<VT>#
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/group/nsmldummydataprovider.mmp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mmp file for DS Dummy Adapter
+*
+*/
+
+#include <platform_paths.hrh>
+#include <defaultcaps.hrh>
+#include <data_caging_paths.hrh>
+
+CAPABILITY CAP_ECOM_PLUGIN
+
+TARGET nsmldummydataprovider.dll
+TARGETPATH PLUGINS_1_DIR
+TARGETTYPE PLUGIN
+UID 0x10009D8D 0x2001FDF1
+VENDORID VID_DEFAULT
+
+#if defined(ARMCC)
+DEFFILE .\def\eabidummydataprovider
+#elif defined(WINSCW)
+DEFFILE .\def\bwinscwdummydataprovider
+#endif
+
+SOURCEPATH ..\src
+SOURCE nsmldummydataprovider.cpp
+SOURCE nsmldummymodsfetcher.cpp
+SOURCE nsmldummydatastore.cpp
+SOURCE nsmldummydllmain.cpp
+SOURCE nsmldummyutility.cpp
+
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE \epoc32\include\ecom
+SYSTEMINCLUDE \epoc32\include\syncml
+
+
+USERINCLUDE ..\inc
+
+SOURCEPATH ..\data
+START RESOURCE nsmldummydataprovider.rss
+ HEADER
+ TARGET nsmldummydataprovider.rsc
+ TARGETPATH ECOM_RESOURCE_DIR
+ LANG sc
+END
+
+START RESOURCE nsmldummydatastoreformat_1_1_2.rss
+ HEADER
+ TARGET nsmldummydatastoreformat_1_1_2.rsc
+ TARGETPATH RESOURCE_FILES_DIR
+ LANG sc
+END
+
+START RESOURCE nsmldummydatastoreformat_1_2.rss
+ HEADER
+ TARGET nsmldummydatastoreformat_1_2.rsc
+ TARGETPATH RESOURCE_FILES_DIR
+ LANG sc
+END
+
+
+
+LIBRARY ECom.lib
+LIBRARY bafl.lib
+LIBRARY euser.lib
+LIBRARY efsrv.lib
+LIBRARY estor.lib
+LIBRARY sysutil.lib
+LIBRARY flogger.lib
+LIBRARY cntmodel.lib
+LIBRARY wbxmllib.lib
+LIBRARY centralrepository.lib
+LIBRARY smlstoreformat.lib
+LIBRARY smldataprovider.lib
+LIBRARY nsmldatamod.lib
+LIBRARY nsmldshostclient.lib
+LIBRARY nsmlchangefinder.lib
+LIBRARY VPbkEng.lib
+LIBRARY vpbkvcardEng.lib
+LIBRARY versit.lib
+LIBRARY vcard.lib
+LIBRARY nsmlcontactsdataprovider.lib
+LIBRARY nsmldebug.lib
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummydataprovider.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS Dummy dataprovider
+*
+*/
+
+#ifndef CNSMLDUMMYDATAPROVIDER_H
+#define CNSMLDUMMYDATAPROVIDER_H
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+
+
+// INTERNAL INCLUDES
+#include "nsmlcontactsdataprovider.h"
+
+// CONSTANTS
+const TUint KNSmlDummyAdapterImplUid = 0x2001FDF1;
+
+
+
+// CLASS DEFINITION
+/**
+ * Dataprovider class for Dummy adapters
+ * @lib nsmldummydataprovider.lib
+ * @since 5.0
+ */
+class CNSmlDummyDataProvider : public CNSmlContactsDataProvider
+ {
+
+ private: // Friend class definitions
+ friend class CNSmlDummyDataProvider_Test;
+
+ public: // Constructors and destructor
+ static CNSmlDummyDataProvider* NewL();
+ static CNSmlDummyDataProvider* NewLC();
+ ~CNSmlDummyDataProvider();
+
+ protected: // Constructors
+ CNSmlDummyDataProvider();
+ void ConstructL();
+
+ protected: // CSmlDataProvider
+
+ /**
+ * Gets dataproviders own StoreFormat.
+ */
+ const CSmlDataStoreFormat& DoStoreFormatL();
+
+ protected: // CNSmlContactsDataProvider
+
+ const TDesC& GetStoreFormatResourceFileL() const;
+
+ CNSmlContactsDataStore* CreateDataStoreLC() const;
+
+ CDesCArray* DoListStoresLC();
+
+ };
+
+
+#endif // CNSMLDUMMYDATAPROVIDER_H
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummydatastore.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS Dummy datastore
+*
+*/
+
+#ifndef CNSMLDUMMYDATASTORE_H
+#define CNSMLDUMMYDATASTORE_H
+
+// EXTERNAL INCLUDES
+#include <NSmlContactsDataStore.h>
+
+// Device Info resource filenames
+_LIT( KNSmlDummyContactsStoreFormatRsc_1_1_2, "z:NSmlDummyDataStoreFormat_1_1_2.rsc" );
+_LIT( KNSmlDummyContactsStoreFormatRsc_1_2, "z:NSmlDummyDataStoreFormat_1_2.rsc" );
+
+// CLASS DEFINITION
+/**
+ * Datastore class for Dummy adapters
+ * @lib nsmldummydataprovider.lib
+ * @since 3.23
+ */
+class CNSmlDummyDataStore : public CNSmlContactsDataStore
+ {
+ private: // Friend class definitions
+ friend class CNSmlDummyDataStore_Test;
+ friend class CNSmlDummyDataStoreWaiter;
+
+ public: // Constructors and destructor
+
+ static CNSmlDummyDataStore* NewL();
+ static CNSmlDummyDataStore* NewLC();
+ ~CNSmlDummyDataStore();
+
+ protected: // Constructors
+
+ CNSmlDummyDataStore();
+ void ConstructL();
+
+ protected: // From CNSmlContactsDataStore
+
+ void DoOpenL( const TDesC& aStoreName, MSmlSyncRelationship& aContext,
+ TRequestStatus& aStatus );
+
+ void DoBeginBatchL();
+
+ void DoOpenItemL( TSmlDbItemUid aUid, TBool& aFieldChange,
+ TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType,
+ TDes8& aMimeVer, TRequestStatus& aStatus );
+
+ void DoCommitItemL( TRequestStatus& aStatus );
+
+ void DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus );
+
+ TBool DoHasSyncHistory() const;
+
+ const MSmlDataItemUidSet& DoModifiedItems() const;
+
+ void DoResetChangeInfoL( TRequestStatus& aStatus );
+
+ void DoCommitChangeInfoL( TRequestStatus& aStatus,
+ const MSmlDataItemUidSet& aItems );
+
+ void DoCommitChangeInfoL( TRequestStatus& aStatus );
+
+ void LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem );
+
+ void LdoAddItemL( const TDesC8& aItem, TInt aSize );
+
+ void LdoAddItemsL( CBufBase*& aItems,TInt aSize );
+
+ TInt ExecuteAddL();
+
+ void ExecuteDeleteL();
+
+ void ExecuteUpdateL();
+
+ void SingleContactOperationCompleteL( MVPbkStoreContact* aContact );
+
+ void StepComplete( MVPbkContactOperationBase& aOperation,
+ TInt aStepSize );
+
+ void OperationCompleteL();
+
+ void DoDeleteAllContactsL();
+
+ const TDesC& GetStoreFormatResourceFileL() const;
+
+ MContactsModsFetcher* CreateModsFetcherL();
+
+ protected: // From MVPbkContactCopyObserver
+
+ void ContactsSaved( MVPbkContactOperationBase& aOperation,
+ MVPbkContactLinkArray* aResults );
+
+ void ContactsSavingFailed( MVPbkContactOperationBase& aOperation,
+ TInt aError );
+
+ };
+
+#endif // CNSMLDUMMYDATASTORE_H
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummymodsfetcher.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS Dummy Adapter ModsFetcher
+*
+*/
+
+#ifndef __NSMLDUMMYMODSFETCHER_H__
+#define __NSMLDUMMYMODSFETCHER_H__
+
+// INCLUDES
+#include <SmlDataProvider.h>
+#include <SmlDataFormat.h>
+#include <f32file.h>
+#include <cntdb.h>
+#include <cntitem.h>
+#include <MContactsModsFetcher.h>
+
+#include <cvpbkcontactmanager.h>
+#include <mvpbkcontactstore.h>
+#include <MVPbkContactViewObserver.h>
+#include <CVPbkSortOrder.h>
+#include <MVPbkContactViewBase.h>
+#include <MVPbkSingleContactOperationObserver.h>
+#include <MVPbkContactOperationBase.h>
+
+// CONSTANTS
+const TInt KNSmlSnapshotSize = 56;
+const TInt KNSmlSnapshotSmallSize = 8;
+const TInt KNSmlSnapshotCompressSize = 20;
+_LIT( KNSmlContactSyncNoSync, "none" ); // Taken from phonebook
+
+// CLASS DECLARATION
+class CNSmlChangeFinder;
+class TNSmlSnapshotItem;
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher
+//
+// @lib nsmlcontactsdataprovider.lib
+// ------------------------------------------------------------------------------------------------
+class CNSmlDummyModsFetcher : public CActive, public MContactsModsFetcher,
+ public MVPbkContactViewObserver,
+ public MVPbkSingleContactOperationObserver,
+ public MVPbkContactOperationBase
+
+ {
+
+ private: // Friend class definitions
+ friend class CNSmlDummyModsFetcher_Test;
+
+ public:
+ /**
+ * C++ constructor.
+ * @param aSnapshotRegistered Is snapshot registered.
+ * @param aContactManager Reference to ContactManager.
+ * @param aStore Reference to ContactStore.
+ * @param aKey Key array.
+ * @param aChangeFinder Reference to Changefinder.
+ */
+ CNSmlDummyModsFetcher( TBool& aSnapshotRegistered,CVPbkContactManager& aContactManager,MVPbkContactStore& aStore,TKeyArrayFix& aKey, CNSmlChangeFinder& aChangeFinder );
+ /**
+ * Second phase constructor.
+ */
+ void ConstructL();
+
+ /**
+ * ~CNSmlDummyModsFetcher() destructor.
+ */
+ virtual ~CNSmlDummyModsFetcher();
+
+ private: // From MVPbkContactViewObserver
+
+ /**
+ * Called when a view is ready for use.
+ */
+
+ void ContactViewReady(
+ MVPbkContactViewBase& aView ) ;
+ /**
+ * Called when a view is unavailable for a while.
+ */
+ void ContactViewUnavailable(
+ MVPbkContactViewBase& aView ) ;
+ /**
+ * Called when a contact has been added to the view.
+ */
+ void ContactAddedToView(
+ MVPbkContactViewBase& aView,
+ TInt aIndex,
+ const MVPbkContactLink& aContactLink );
+ /**
+ * Called when a contact has been removed from a view.
+ */
+ void ContactRemovedFromView(
+ MVPbkContactViewBase& aView,
+ TInt aIndex,
+ const MVPbkContactLink& aContactLink ) ;
+ /**
+ * Called when an error occurs in the view.
+ */
+ void ContactViewError(
+ MVPbkContactViewBase& aView,
+ TInt aError,
+ TBool aErrorNotified ) ;
+ /**
+ * Called when the operation is completed.
+ */
+ void VPbkSingleContactOperationComplete(MVPbkContactOperationBase& aOperation,MVPbkStoreContact* aContact );
+
+ /**
+ * Called if the operation fails.
+ */
+ void VPbkSingleContactOperationFailed(
+ MVPbkContactOperationBase& aOperation,
+ TInt aError );
+
+ private: //From CActive
+
+ /**
+ * Called when asynchronous operation completes.
+ */
+ void RunL();
+
+ /**
+ * Called when RunL leaves.
+ */
+ TInt RunError( TInt aError );
+
+ /**
+ * Cancels operation.
+ */
+ void DoCancel();
+
+ private: //new method
+ /**
+ * Fetches next chunk of data (client contacts data changes).
+ */
+ void FetchNextContactL();
+ /**
+ * Checks if aItem is confidential or not.
+ * @param aItem Item that is checked.
+ * @return TBool ETrue if item is confidential.
+ * Otherwise EFalse is returned.
+ */
+ TBool IsConfidentialL( MVPbkStoreContact& aItem );
+ /**
+ * Create a contact view of the store which is opened
+ */
+ void CreateViewL();
+ /**
+ * Add the fetched contacts id and timestamp
+ * to the snapshot.
+ * @param aContact Fetched contact to be
+ * added to snapshot
+ */
+ void UpdateSnapshotL( MVPbkStoreContact* aContact );
+
+ private: // from MContactsModsFetcher
+
+ /**
+ * Cancels the current asynchronous request
+ */
+ void CancelRequest( );
+
+ /**
+ * Reads all modifications from clients contacts databse.
+ * @param aStatus On completion of the operation, contains the result code.
+ */
+ void FetchModificationsL( TRequestStatus& aStatus );
+
+ private: // data
+ TRequestStatus* iCallerStatus;
+ TTime iFromTime;
+
+
+ CArrayFixSeg<TNSmlSnapshotItem>* iSnapshot;
+
+ TBool& iSnapshotRegistered;
+
+
+ TKeyArrayFix& iKey;
+
+ CNSmlChangeFinder& iChangeFinder;
+ TInt iCurrentSnapshotCounter;
+
+ CVPbkContactManager& iContactManager;
+ MVPbkContactStore& iStore;
+ MVPbkContactViewBase* iContactViewBase;
+ TInt iContactCount;
+
+ };
+
+#endif // __NSMLDUMMYMODSFETCHER_H__
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/inc/nsmldummyutility.h Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS Dummy Adapter utility
+*
+*/
+
+#ifndef CNSMLDUMMYUTILITY_H
+#define CNSMLDUMMYUTILITY_H
+
+// EXTERNAL INCLUDES
+// EXTERNAL INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <e32des16.h>
+
+// INTERNAL INCLUDES
+#include "nsmldebug.h"
+
+class CNSmlDummyUtility
+ {
+ public:
+
+ static void ShowNote( const TDesC& aNote );
+
+ };
+
+
+
+#endif //CNSMLDUMMYUTILITY_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/readme.txt Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,9 @@
+What is DummyAdapter?
+
+Dummy adapter is a ECOM plugin, which acts as a stub implementation for Adapter Customization API. It is a SyncML adapter, which fully implements Adapter Customization API interface, but does not extend or restrict the default functionality provided by platform. Dummy adapter works identically compared to platform contact adapter. It enables to synchronize contacts with SyncML servers, such as Nokia OVI server, using vCards.
+
+Dummy adapter can be also used as a skeleton for new operator adapters. This will reduce the work effort to implement new operator specific adapters compared to starting implementation from the scratch.
+
+
+How to synchronize with OVI server using Dummy adapter?
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydataprovider.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS Dummy dataprovider
+*
+*/
+
+// CLASS HEADER
+#include "nsmldummydataprovider.h"
+
+// EXTERNAL INCLUDES
+#include <DataSyncInternalPSKeys.h>
+#include <e32property.h>
+
+// INTERNAL INCLUDES
+#include "nsmldebug.h"
+#include "nsmldummydatastore.h"
+#include "nsmldummyutility.h"
+
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::NewL
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataProvider* CNSmlDummyDataProvider::NewL()
+ {
+ CNSmlDummyDataProvider* self = CNSmlDummyDataProvider::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::NewLC
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataProvider* CNSmlDummyDataProvider::NewLC()
+ {
+ CNSmlDummyDataProvider* self = new( ELeave ) CNSmlDummyDataProvider;
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::~CNSmlDummyDataProvider
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataProvider::~CNSmlDummyDataProvider()
+ {
+ _DBG_FILE("CNSmlDummyDataProvider::~CNSmlDummyDataProvider(): begin");
+
+ _DBG_FILE("CNSmlDummyDataProvider::~CNSmlDummyDataProvider(): end");
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::CNSmlDummyDataProvider
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataProvider::CNSmlDummyDataProvider()
+ {
+ _DBG_FILE("CNSmlDummyDataProvider::CNSmlDummyDataProvider(): begin");
+
+ _DBG_FILE("CNSmlDummyDataProvider::CNSmlDummyDataProvider(): end");
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CNSmlDummyDataProvider::ConstructL()
+ {
+ _DBG_FILE("CNSmlDummyDataProvider::ConstructL(): begin");
+ CNSmlContactsDataProvider::ConstructL();
+ _DBG_FILE("CNSmlDummyDataProvider::ConstructL(): end");
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::DoStoreFormatL
+// -----------------------------------------------------------------------------
+//
+const CSmlDataStoreFormat& CNSmlDummyDataProvider::DoStoreFormatL()
+ {
+ _DBG_FILE("CNSmlDummyDataProvider::DoStoreFormatL()");
+ return CNSmlContactsDataProvider::DoStoreFormatL();
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::GetStoreFormatResourceFileL
+// -----------------------------------------------------------------------------
+//
+const TDesC& CNSmlDummyDataProvider::GetStoreFormatResourceFileL() const
+ {
+ _DBG_FILE("CNSmlDummyDataProvider::DoStoreFormatL()");
+
+ // Check correct Data Sync protocol
+ TInt value( EDataSyncNotRunning );
+ TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
+ KDataSyncStatus,
+ value );
+
+ if ( error == KErrNone && value == EDataSyncRunning )
+ {
+ return KNSmlDummyContactsStoreFormatRsc_1_1_2;
+ }
+ else // error or protocol version 1.2
+ {
+ return KNSmlDummyContactsStoreFormatRsc_1_2;
+ }
+ }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyDataProvider::CreateDataStoreLC
+//
+// ------------------------------------------------------------------------------------------------
+CNSmlContactsDataStore* CNSmlDummyDataProvider::CreateDataStoreLC() const
+ {
+ _DBG_FILE("CNSmlDummyDataProvider::CreateDataStoreLC()");
+ CNSmlContactsDataStore* dataStore = CNSmlDummyDataStore::NewLC();
+ return dataStore;
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataProvider::DoListStoresLC
+// -----------------------------------------------------------------------------
+//
+CDesCArray* CNSmlDummyDataProvider::DoListStoresLC()
+ {
+ _DBG_FILE("CNSmlDummyDataProvider::DoListStoresLC()");
+ return CNSmlContactsDataProvider::DoListStoresLC();
+ }
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydatastore.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,392 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS Dummy datastore
+*
+*/
+
+// CLASS HEADER
+#include "nsmldummydatastore.h"
+
+// EXTERNAL INCLUDES
+#include <DataSyncInternalPSKeys.h>
+#include <e32property.h>
+
+// INTERNAL INCLUDES
+#include "nsmldebug.h"
+#include "nsmldummyutility.h"
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataStore::NewL
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataStore* CNSmlDummyDataStore::NewL()
+ {
+ CNSmlDummyDataStore* self = CNSmlDummyDataStore::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataStore::NewLC
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataStore* CNSmlDummyDataStore::NewLC()
+ {
+ CNSmlDummyDataStore* self = new( ELeave ) CNSmlDummyDataStore;
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataStore::CNSmlDummyDataStore
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataStore::CNSmlDummyDataStore()
+ {
+ _DBG_FILE("CNSmlDummyDataStore::CNSmlDummyDataStore(): begin");
+
+ _DBG_FILE("CNSmlDummyDataStore::CNSmlDummyDataStore(): end");
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataStore::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CNSmlDummyDataStore::ConstructL()
+ {
+ _DBG_FILE("CNSmlDummyDataStore::ConstructL(): begin");
+
+ CNSmlContactsDataStore::ConstructL();
+
+ _DBG_FILE("CNSmlDummyDataStore::ConstructL(): end");
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyDataStore::~CNSmlDummyDataStore
+// -----------------------------------------------------------------------------
+//
+CNSmlDummyDataStore::~CNSmlDummyDataStore()
+ {
+ _DBG_FILE("CNSmlDummyDataStore::~CNSmlDummyDataStore(): begin");
+
+ _DBG_FILE("CNSmlDummyDataStore::~CNSmlDummyDataStore(): end");
+ }
+
+// -----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoOpenL
+// -----------------------------------------------------------------------------
+//
+void CNSmlDummyDataStore::DoOpenL( const TDesC& aStoreName,
+ MSmlSyncRelationship& aContext, TRequestStatus& aStatus )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::DoOpenL(): begin");
+
+ CNSmlContactsDataStore::DoOpenL( aStoreName, aContext, aStatus );
+
+ _DBG_FILE("CNSmlDummyDataStore::DoOpenL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoBeginBatchL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::DoBeginBatchL()
+ {
+ _DBG_FILE("CNSmlDummyDataStore::DoBeginBatchL(): begin");
+
+ CNSmlContactsDataStore::DoBeginBatchL();
+
+ _DBG_FILE("CNSmlDummyDataStore::DoBeginBatchL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoOpenItemL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::DoOpenItemL( TSmlDbItemUid aUid,
+ TBool& aFieldChange, TInt& aSize, TSmlDbItemUid& aParent,
+ TDes8& aMimeType, TDes8& aMimeVer, TRequestStatus& aStatus )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::DoOpenItemL(): begin");
+
+ CNSmlContactsDataStore::DoOpenItemL( aUid, aFieldChange,
+ aSize, aParent, aMimeType, aMimeVer, aStatus );
+
+ _DBG_FILE("CNSmlDummyDataStore::DoOpenItemL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoCommitItemL()
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::DoCommitItemL( TRequestStatus& aStatus )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::DoCommitItemL(): begin");
+
+ CNSmlContactsDataStore::DoCommitItemL( aStatus );
+
+ _DBG_FILE("CNSmlDummyDataStore::DoCommitItemL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoDeleteItemL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::DoDeleteItemL(
+ TSmlDbItemUid aUid, TRequestStatus& aStatus )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::DoDeleteItemL(): begin");
+
+ CNSmlContactsDataStore::DoDeleteItemL( aUid, aStatus );
+
+ _DBG_FILE("CNSmlDummyDataStore::DoDeleteItemL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// TBool CNSmlDummyDataStore::DoHasSyncHistory
+// ----------------------------------------------------------------------------
+TBool CNSmlDummyDataStore::DoHasSyncHistory() const
+ {
+ _DBG_FILE("CNSmlDummyDataStore::DoHasSyncHistory()");
+ return CNSmlContactsDataStore::DoHasSyncHistory();
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoModifiedItems
+// ----------------------------------------------------------------------------
+//
+const MSmlDataItemUidSet& CNSmlDummyDataStore::DoModifiedItems() const
+ {
+ _DBG_FILE("CNSmlDummyDataStore::DoModifiedItems()");
+ return CNSmlContactsDataStore::DoModifiedItems();
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoResetChangeInfoL
+// ----------------------------------------------------------------------------
+//
+void CNSmlDummyDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::DoResetChangeInfoL(): begin");
+
+ CNSmlContactsDataStore::DoResetChangeInfoL( aStatus );
+
+ _DBG_FILE("CNSmlDummyDataStore::DoResetChangeInfoL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoCommitChangeInfoL
+// ----------------------------------------------------------------------------
+//
+void CNSmlDummyDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus,
+ const MSmlDataItemUidSet& aItems )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(aItems): begin");
+
+ CNSmlContactsDataStore::DoCommitChangeInfoL( aStatus, aItems );
+
+ _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(aItems): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoCommitChangeInfoL
+// ----------------------------------------------------------------------------
+//
+void CNSmlDummyDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(): begin");
+
+ CNSmlContactsDataStore::DoCommitChangeInfoL( aStatus );
+
+ _DBG_FILE("CNSmlDummyDataStore::DoCommitChangeInfoL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::LdoFetchItemL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::LdoFetchItemL(
+ TSmlDbItemUid& aUid, CBufBase& aItem )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::LdoFetchItemL(): begin");
+
+ CNSmlContactsDataStore::LdoFetchItemL( aUid, aItem );
+
+ _DBG_FILE("CNSmlDummyDataStore::LdoFetchItemL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::LdoAddItemL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::LdoAddItemL( const TDesC8& aItem, TInt aSize )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::LdoAddItemL(): begin");
+
+ CNSmlContactsDataStore::LdoAddItemL( aItem, aSize );
+
+ _DBG_FILE("CNSmlDummyDataStore::LdoAddItemL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::LdoAddItemsL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::LdoAddItemsL( CBufBase*& aItems, TInt aSize)
+ {
+ _DBG_FILE("CNSmlDummyDataStore::LdoAddItemsL(): begin");
+
+ CNSmlContactsDataStore::LdoAddItemsL( aItems, aSize );
+
+ _DBG_FILE("CNSmlDummyDataStore::LdoAddItemsL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// TInt CNSmlDummyDataStore::ExecuteAddL
+// ----------------------------------------------------------------------------
+TInt CNSmlDummyDataStore::ExecuteAddL()
+ {
+ _DBG_FILE("CNSmlDummyDataStore::ExecuteAddL()");
+ return CNSmlContactsDataStore::ExecuteAddL();
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::ExecuteDeleteL
+// ----------------------------------------------------------------------------
+
+void CNSmlDummyDataStore::ExecuteDeleteL()
+ {
+ _DBG_FILE("CNSmlDummyDataStore::ExecuteDeleteL(): begin");
+
+ CNSmlContactsDataStore::ExecuteDeleteL();
+
+ _DBG_FILE("CNSmlDummyDataStore::ExecuteDeleteL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::ExecuteUpdateL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::ExecuteUpdateL()
+ {
+ _DBG_FILE("CNSmlDummyDataStore::ExecuteUpdateL(): begin");
+
+ CNSmlContactsDataStore::ExecuteUpdateL();
+
+ _DBG_FILE("CNSmlDummyDataStore::ExecuteUpdateL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::SingleContactOperationCompleteL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::SingleContactOperationCompleteL(
+ MVPbkStoreContact* aContact )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::SingleContactOperationCompleteL(): begin");
+
+ CNSmlContactsDataStore::SingleContactOperationCompleteL( aContact );
+
+ _DBG_FILE("CNSmlDummyDataStore::SingleContactOperationCompleteL(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::ContactsSaved
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::ContactsSaved(
+ MVPbkContactOperationBase& aOperation, MVPbkContactLinkArray* aResults )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::ContactsSaved(): begin");
+
+ CNSmlContactsDataStore::ContactsSaved( aOperation, aResults );
+
+ _DBG_FILE("CNSmlDummyDataStore::ContactsSaved(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::ContactsSavingFailed
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::ContactsSavingFailed(
+ MVPbkContactOperationBase& aOperation, TInt aError )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::ContactsSavingFailed(): begin");
+
+ CNSmlContactsDataStore::ContactsSavingFailed( aOperation, aError );
+
+ _DBG_FILE("CNSmlDummyDataStore::ContactsSavingFailed(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::StepComplete
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::StepComplete(
+ MVPbkContactOperationBase& aOperation, TInt aStepSize )
+ {
+ _DBG_FILE("CNSmlDummyDataStore::StepComplete(): begin");
+
+ CNSmlContactsDataStore::StepComplete( aOperation, aStepSize );
+
+ _DBG_FILE("CNSmlDummyDataStore::StepComplete(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::OperationCompleteL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::OperationCompleteL()
+ {
+ _DBG_FILE("CNSmlDummyDataStore::OperationCompleteL(): begin");
+
+ CNSmlContactsDataStore::OperationCompleteL();
+
+ _DBG_FILE("CNSmlDummyDataStore::OperationCompleteL(): end");
+ }
+
+
+// ----------------------------------------------------------------------------
+// void CNSmlDummyDataStore::DoDeleteAllContactsL
+// ----------------------------------------------------------------------------
+void CNSmlDummyDataStore::DoDeleteAllContactsL()
+ {
+ _DBG_FILE("CNSmlDummyDataStore::DoDeleteAllContactsL(): begin");
+
+ CNSmlContactsDataStore::DoDeleteAllContactsL();
+
+ _DBG_FILE("CNSmlDummyDataStore::DoDeleteAllContactsL(): end");
+ }
+
+// -----------------------------------------------------------------------------
+// const TDesC& CNSmlDummyDataStore::GetStoreFormatResourceFileL
+// -----------------------------------------------------------------------------
+const TDesC& CNSmlDummyDataStore::GetStoreFormatResourceFileL() const
+ {
+ _DBG_FILE("CNSmlDummyDataStore::GetStoreFormatResourceFileL()");
+ // Check correct Data Sync protocol
+ TInt value( EDataSyncNotRunning );
+ TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
+ KDataSyncStatus,
+ value );
+ if ( error == KErrNone && value == EDataSyncRunning )
+ {
+ return KNSmlDummyContactsStoreFormatRsc_1_1_2;
+ }
+ else // error or protocol version 1.2
+ {
+ return KNSmlDummyContactsStoreFormatRsc_1_2;
+ }
+ }
+
+// ----------------------------------------------------------------------------
+// MContactsModsFetcher* CNSmlDummyDataStore::CreateModsFetcherL
+// ----------------------------------------------------------------------------
+MContactsModsFetcher* CNSmlDummyDataStore::CreateModsFetcherL()
+ {
+ _DBG_FILE("CNSmlDummyDataStore::CreateModsFetcherL()");
+
+ return CNSmlContactsDataStore::CreateModsFetcherL();
+ }
+
+
+// END OF FILE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummydllmain.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS Dummy adapter entry point
+*
+*/
+
+#include <ImplementationProxy.h>
+#include "nsmldebug.h"
+#include "nsmlDummydataprovider.h"
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy array
+// -----------------------------------------------------------------------------
+//
+#ifndef IMPLEMENTATION_PROXY_ENTRY
+#define IMPLEMENTATION_PROXY_ENTRY( aUid, aFuncPtr ) {{aUid},(aFuncPtr)}
+#endif
+
+const TImplementationProxy ImplementationTable[] =
+ {
+ IMPLEMENTATION_PROXY_ENTRY( KNSmlDummyAdapterImplUid, CNSmlDummyDataProvider::NewL )
+ };
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+ {
+ _DBG_FILE("ImplementationGroupProxy() for CNSmlDummyDataProvider: begin");
+
+ aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+
+ _DBG_FILE("ImplementationGroupProxy() for CNSmlDummyDataProvider: end");
+ return ImplementationTable;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummymodsfetcher.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,433 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS Dummy Adapter ModsFetcher
+*
+*/
+
+// CLASS HEADER
+#include "nsmldummymodsfetcher.h"
+
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+#include <s32strm.h>
+#include <e32cmn.h>
+#include <e32des16.h>
+#include <CVPbkContactViewDefinition.h>
+#include <CVPbkContactIdConverter.h>
+#include <CVPbkContactFieldIterator.h>
+#include <MVPbkContactStoreProperties.h>
+#include <MVPbkStoreContactProperties.h>
+#include <MVPbkViewContact.h>
+#include <MVPbkFieldType.h>
+#include <MVPbkContactFieldTextData.h>
+#include <MVPbkStoreContact.h>
+#include <MVPbkStoreContact2.h>
+#include <MVPbkContactLink.h>
+#include <vpbkeng.rsg>
+
+// INTERNAL INCLUDES
+#include "nsmldebug.h"
+#include "nsmlsnapshotitem.h"
+#include "nsmlchangefinder.h"
+#include "nsmldummyutility.h"
+
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::CNSmlDummyModsFetcher
+// ------------------------------------------------------------------------------------------------
+//
+CNSmlDummyModsFetcher::CNSmlDummyModsFetcher(
+ TBool& aSnapshotRegistered,CVPbkContactManager& aContactManager,
+ MVPbkContactStore& aStore,TKeyArrayFix& aKey,
+ CNSmlChangeFinder& aChangeFinder ) :
+ CActive( EPriorityLow ),
+ iSnapshotRegistered( aSnapshotRegistered ),
+ iKey( aKey ),
+ iChangeFinder( aChangeFinder ),
+ iContactManager( aContactManager ),
+ iStore( aStore ),
+ iContactViewBase( NULL )
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::CNSmlDummyModsFetcher(): begin");
+ CActiveScheduler::Add( this );
+ _DBG_FILE("CNSmlDummyModsFetcher::CNSmlDummyModsFetcher(): end");
+ }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::~CNSmlDummyModsFetcher
+// ------------------------------------------------------------------------------------------------
+//
+CNSmlDummyModsFetcher::~CNSmlDummyModsFetcher()
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::~CNSmlDummyModsFetcher(): begin");
+
+ Cancel();
+ delete iSnapshot;
+ delete iContactViewBase;
+
+ _DBG_FILE("CNSmlDummyModsFetcher::~CNSmlDummyModsFetcher(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::CancelRequest
+// ----------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::CancelRequest()
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::CancelRequest(): begin");
+
+ Cancel();
+
+ _DBG_FILE("CNSmlDummyModsFetcher::CancelRequest(): end");
+ }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::FetchModificationsL
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::FetchModificationsL( TRequestStatus& aStatus )
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::FetchModificationsL(): begin");
+
+ iCallerStatus = &aStatus;
+ *iCallerStatus = KRequestPending;
+ iContactCount = 0;
+ if( !iSnapshot )
+ {
+ iSnapshot = new (ELeave) CArrayFixSeg< TNSmlSnapshotItem >( KNSmlSnapshotSize );
+ }
+
+ if( iContactViewBase )
+ {
+ delete iContactViewBase;
+ iContactViewBase = NULL;
+ }
+
+ CreateViewL();
+
+ _DBG_FILE("CNSmlDummyModsFetcher::FetchModificationsL(): end");
+ }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::ConstructL
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::ConstructL()
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::ConstructL(): begin");
+
+ iSnapshot = new ( ELeave ) CArrayFixSeg< TNSmlSnapshotItem >( KNSmlSnapshotSmallSize );
+
+ _DBG_FILE("CNSmlDummyModsFetcher::ConstructL(): end");
+ }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::RunL
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::RunL()
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::RunL(): begin");
+
+ if ( !iSnapshotRegistered )
+ {
+ FetchNextContactL();
+ }
+#ifdef __NSML_MODULETEST__
+ else
+ {
+ CActiveScheduler::Stop();
+ }
+#endif
+
+ _DBG_FILE("CNSmlDummyModsFetcher::RunL(): end");
+ }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::FetchNextContactL
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::FetchNextContactL()
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::FetchNextContactL(): begin");
+ if( iContactViewBase->ContactCountL() == 0 )
+ {
+ User::RequestComplete( iCallerStatus, KErrNone );
+ return;
+ }
+ if ( !iSnapshotRegistered )
+ {
+ const MVPbkViewContact& contact = iContactViewBase->ContactAtL( iContactCount );
+
+ MVPbkContactLink* contactLink = contact.CreateLinkLC();
+ iContactManager.RetrieveContactL( *contactLink, *this );
+ CleanupStack::PopAndDestroy();
+ }
+
+ _DBG_FILE("CNSmlDummyModsFetcher::FetchNextContactL(): end");
+ }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::DoCancel
+// ------------------------------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::DoCancel()
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::DoCancel(): begin");
+
+ User::RequestComplete( iCallerStatus, KErrCancel );
+
+ _DBG_FILE("CNSmlDummyModsFetcher::DoCancel(): end");
+ }
+
+// ----------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::IsConfidentialL
+// ----------------------------------------------------------------------------
+//
+TBool CNSmlDummyModsFetcher::IsConfidentialL( MVPbkStoreContact& aItem )
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::IsConfidentialL(): begin");
+ TBool ret( EFalse );
+
+ //find X-CLASS field type
+ const MVPbkFieldType* syncclass =
+ iContactManager.FieldTypes().Find( R_VPBK_FIELD_TYPE_SYNCCLASS );
+ CVPbkBaseContactFieldTypeIterator* itr =
+ CVPbkBaseContactFieldTypeIterator::NewLC( *syncclass,
+ aItem.Fields() );
+ while ( itr->HasNext() )
+ {
+ const MVPbkBaseContactField* field = itr->Next();
+ const MVPbkContactFieldTextData& data =
+ MVPbkContactFieldTextData::Cast( field->FieldData() );
+ TPtrC ptr = data.Text();
+ //compare the sync type
+ if ( ptr.Compare( KNSmlContactSyncNoSync ) == 0 )
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::IsConfidentialL(): \
+ find confidential");
+ ret = ETrue;
+ }
+
+ }
+ CleanupStack::PopAndDestroy( itr );
+
+ _DBG_FILE("CNSmlDummyModsFetcher::IsConfidentialL(): end");
+ return ret;
+ }
+
+
+// ----------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::RunError
+// ----------------------------------------------------------------------------
+ TInt CNSmlDummyModsFetcher::RunError( TInt aError )
+ {
+ DBG_FILE_CODE(aError, _S8("CNSmlDummyModsFetcher::RunError() : error code received "));
+ User::RequestComplete( iCallerStatus, aError );
+ return KErrNone;
+ }
+
+// -----------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::CreateViewL()
+// Create a contact view of the store which is opened
+// -----------------------------------------------------------------------------
+
+void CNSmlDummyModsFetcher::CreateViewL()
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::CreateViewL(): begin");
+
+ CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
+ CleanupStack::PushL( viewDef );
+ viewDef->SetType( EVPbkContactsView );
+
+ viewDef->SetUriL( iStore.StoreProperties().Uri().UriDes() );
+
+ iContactViewBase = iContactManager.CreateContactViewLC(
+ *this,
+ *viewDef,
+ iContactManager.FieldTypes() );
+ CleanupStack::Pop();
+ CleanupStack::PopAndDestroy( viewDef );
+
+ _DBG_FILE("CNSmlDummyModsFetcher::CreateViewL(): end");
+ }
+// ---------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::UpdateSnapshotL
+// Add the fetched contacts id and timestamp
+// to the snapshot.
+// ---------------------------------------------------------------------------
+//
+
+ void CNSmlDummyModsFetcher::UpdateSnapshotL( MVPbkStoreContact* aContact )
+{
+ _DBG_FILE("CNSmlDummyModsFetcher::UpdateSnapshotL(): begin");
+
+ if( !IsConfidentialL( *aContact) )
+ {
+ CVPbkContactIdConverter* idConverter = CVPbkContactIdConverter::NewL( iStore );
+ CleanupStack::PushL( idConverter );
+
+ TInt32 id = idConverter->LinkToIdentifier(
+ *iContactViewBase->ContactAtL( iContactCount).CreateLinkLC() );
+ TNSmlSnapshotItem snap( id );
+
+ MVPbkStoreContact2* tempContact =
+ reinterpret_cast<MVPbkStoreContact2*> ( aContact->StoreContactExtension ( KMVPbkStoreContactExtension2Uid ) );
+
+ MVPbkStoreContactProperties *contactProterties
+ = tempContact ->PropertiesL();
+ CleanupDeletePushL( contactProterties );
+ snap.SetLastChangedDate( contactProterties->LastModifiedL() );
+ CleanupStack::PopAndDestroy();
+
+ iSnapshot->InsertIsqL( snap, iKey );
+ iCurrentSnapshotCounter++;
+ if ( iCurrentSnapshotCounter > KNSmlSnapshotCompressSize )
+ {
+ iSnapshot->Compress();
+ iCurrentSnapshotCounter = 0;
+ }
+ CleanupStack::PopAndDestroy();
+ CleanupStack::PopAndDestroy( idConverter );
+ }
+
+ iContactCount++;
+
+ if ( iContactCount == iContactViewBase->ContactCountL() )
+ {
+ iChangeFinder.SetNewSnapshot( iSnapshot ); // changefinder takes ownership
+ iSnapshot = NULL;
+ iSnapshotRegistered = ETrue;
+ User::RequestComplete( iCallerStatus, KErrNone );
+ }
+
+ _DBG_FILE("CNSmlDummyModsFetcher::UpdateSnapshotL(): end");
+}
+// ---------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::ContactViewReady
+// Implements the view ready function of MVPbkContactViewObserver
+// ---------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::ContactViewReady(
+ MVPbkContactViewBase& /*aView*/ )
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::ContactViewReady(): begin");
+
+ SetActive();
+ TRequestStatus* status = &iStatus;
+ User::RequestComplete( status, KErrNone );
+
+ _DBG_FILE("CNSmlDummyModsFetcher::ContactViewReady(): end");
+ }
+
+// ---------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::ContactViewUnavailable
+// Implements the view unavailable function of MVPbkContactViewObserver
+// ---------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::ContactViewUnavailable(
+ MVPbkContactViewBase& /*aView*/ )
+{
+}
+
+// ---------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::ContactAddedToView
+// Implements the add contact function of MVPbkContactViewObserver
+// ---------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::ContactAddedToView(
+ MVPbkContactViewBase& /*aView*/,
+ TInt /*aIndex*/,
+ const MVPbkContactLink& /*aContactLink*/ )
+{
+}
+
+// ---------------------------------------------------------------------------
+// Implements the remove contact function of MVPbkContactViewObserver
+// ---------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::ContactRemovedFromView(
+ MVPbkContactViewBase& /*aView*/,
+ TInt /*aIndex*/,
+ const MVPbkContactLink& /*aContactLink*/ )
+{
+}
+
+// ---------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::ContactViewError
+// Implements the view error function of MVPbkContactViewObserver
+// ---------------------------------------------------------------------------
+void CNSmlDummyModsFetcher::ContactViewError(
+ MVPbkContactViewBase& /*aView*/,
+ TInt aError,
+ TBool /*aErrorNotified*/ )
+{
+ _DBG_FILE("CNSmlDummyModsFetcher::ContactViewError(): begin");
+
+ User::RequestComplete( iCallerStatus, aError );
+
+ _DBG_FILE("CNSmlDummyModsFetcher::ContactViewError(): end");
+}
+
+// ---------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::VPbkSingleContactOperationComplete
+// Called when the contact operation is completed.
+// ---------------------------------------------------------------------------
+//
+ void CNSmlDummyModsFetcher::VPbkSingleContactOperationComplete(
+ MVPbkContactOperationBase& aOperation,
+ MVPbkStoreContact* aContact )
+{
+ _DBG_FILE("CNSmlDummyModsFetcher::VPbkSingleContactOperationComplete(): begin");
+
+ MVPbkContactOperationBase* operation = &aOperation;
+ if ( operation )
+ {
+ delete operation;
+ operation = NULL;
+ }
+
+ TRAPD( error,UpdateSnapshotL( aContact ) );
+ delete aContact;
+ if( error!= KErrNone )
+ {
+ User::RequestComplete( iCallerStatus, error );
+ }
+ else
+ {
+ SetActive();
+ TRequestStatus* status = &iStatus;
+ User::RequestComplete( status, KErrNone );
+ }
+
+ _DBG_FILE("CNSmlDummyModsFetcher::VPbkSingleContactOperationComplete(): end");
+}
+
+// ---------------------------------------------------------------------------
+// CNSmlDummyModsFetcher::VPbkSingleContactOperationFailed
+// Called when the contact operation fails
+// ---------------------------------------------------------------------------
+//
+void CNSmlDummyModsFetcher::VPbkSingleContactOperationFailed(
+ MVPbkContactOperationBase& aOperation,
+ TInt /*aError*/ )
+ {
+ _DBG_FILE("CNSmlDummyModsFetcher::VPbkSingleContactOperationFailed(): begin");
+
+ MVPbkContactOperationBase* operation = &aOperation;
+ if ( operation )
+ {
+ delete operation;
+ operation = NULL;
+ }
+
+ _DBG_FILE("CNSmlDummyModsFetcher::VPbkSingleContactOperationFailed(): end");
+ }
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/adapter_customization_api/tsrc/DummyAdapter/src/nsmldummyutility.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DS Dummy Adapter utility
+*
+*/
+/*
+* ==============================================================================
+* Name : nsmldummyutility.cpp
+* Part of : Nokia SyncML / DS Contacts
+* Description : DS dummy adapters
+* Version :
+*
+* Copyright © 2009 Nokia Corporation.
+* This material, including documentation and any related
+* computer programs, is protected by copyright controlled by
+* Nokia Corporation. All rights are reserved. Copying,
+* including reproducing, storing, adapting or translating, any
+* or all of this material requires the prior written consent of
+* Nokia Corporation. This material also contains confidential
+* information which may not be disclosed to others without the
+* prior written consent of Nokia Corporation.
+* ==============================================================================
+*/
+
+// CLASS HEADER
+#include "nsmldummyutility.h"
+
+
+
+
+void CNSmlDummyUtility::ShowNote( const TDesC& aNote )
+ {
+ DBG_ARGS(aNote);
+ }
+
+
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contentctrl_plat/ds_data_modification_api/ds_data_modification_api.metaxml Fri Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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 Mar 12 15:41:30 2010 +0200
@@ -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
--- a/contentctrl_plat/group/bld.inf Fri Feb 19 22:40:37 2010 +0200
+++ b/contentctrl_plat/group/bld.inf Fri Mar 12 15:41:30 2010 +0200
@@ -20,3 +20,5 @@
#include "../oma_ds_presync_plugin_api/group/bld.inf"
#include "../ds_agenda_handler_plugin_api/group/bld.inf"
#include "../ds_folder_util_api/group/bld.inf"
+#include "../adapter_customization_api/group/bld.inf"
+#include "../ds_data_modification_api/group/bld.inf"
--- a/omads/omadsappui/AspSyncUtil/inc/AspProfile.h Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsappui/AspSyncUtil/inc/AspProfile.h Fri Mar 12 15:41:30 2010 +0200
@@ -37,6 +37,17 @@
// CONSTANTS
+// Visibility settings for operator specific sync profiles on UI
+// - Normal = Profile shown without any specific formatting
+// - ReadOnly = Profile fields locked (non-editable), deletion not allowed
+// - Hidden = Profile not shown in UI
+enum TOperatorProfileVisibility
+ {
+ EProfileVisibilityNormal = 0,
+ EProfileVisibilityReadOnly = 1,
+ EProfileVisibilityHidden = 2
+ };
+
// FORWARD DECLARATIONS
class CAspProfile;
@@ -1180,6 +1191,52 @@
*/
static TBool IsPCSuiteProfile(CAspProfile* aProfile);
+ /**
+ * Is this profile Operator specific profile.
+ * @param aProfile.
+ * @return Boolean.
+ */
+ static TBool IsOperatorProfileL(CAspProfile* aProfile);
+
+ /**
+ * Get Operator adapter Uid.
+ * @return Operator adapter Uid .
+ */
+ static TInt OperatorAdapterUidL();
+
+ /**
+ * Get Profile adapter Uid.
+ * @return Profile adapter Uid .
+ */
+ static TInt ProfileAdapterUidL();
+
+ /**
+ * Get Operator profile visibility setting.
+ * @return Visibility setting value.
+ */
+ static TInt ProfileVisibilityL();
+
+
+ /**
+ * Is this profile read-only operator specific profile.
+ * @return Boolean.
+ */
+ TBool IsReadOnlyOperatorProfileL();
+
+ /**
+ * Is this profile hidden operator specific profile.
+ * @return Boolean.
+ */
+ TBool IsHiddenOperatorProfileL();
+
+ /**
+ * Does the given serverID equal with the operator specific
+ * serverID value (defined in central repository).
+ * @param aServerId to be compared
+ * @return Boolean
+ */
+ static TBool EqualsToOperatorServerId( const TDesC& aServerId );
+
public:
/**
* Check mandatory task data.
--- a/omads/omadsappui/AspSyncUtil/inc/AspProfileDialog.h Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsappui/AspSyncUtil/inc/AspProfileDialog.h Fri Mar 12 15:41:30 2010 +0200
@@ -376,7 +376,7 @@
* @param None.
* @return None.
*/
- void SetVisibility();
+ void SetVisibilityL();
/**
* Set all settings to read-only state.
--- a/omads/omadsappui/AspSyncUtil/inc/AspUtil.h Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsappui/AspSyncUtil/inc/AspUtil.h Fri Mar 12 15:41:30 2010 +0200
@@ -134,7 +134,10 @@
static TBool IsEmpty(const TDesC& aText);
static TInt ProviderIdFromAppId(TInt aApplicationId);
+ static TInt ProviderIdFromAppId(TInt aApplicationId, TBool aOperatorProfile);
+ static TInt OperatorProviderIdFromAppId(TInt aApplicationId);
static TInt AppIdFromProviderId(TInt aAdapterId);
+ static TInt AppIdFromOperatorSpecificProviderId(TInt aAdapterId);
static TBool IsValidAppId(TInt aApplicationId);
static TBool IsValidSID(TInt aApplicationId);
--- a/omads/omadsappui/AspSyncUtil/src/AspProfile.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsappui/AspSyncUtil/src/AspProfile.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -21,6 +21,9 @@
#include <SyncMLTransportProperties.h>
#include <featmgr.h> // FeatureManager
+#include <centralrepository.h> // CRepository
+#include <NSmlOperatorDataCRKeys.h> // KCRUidOperatorDatasyncInternalKeys
+
#include <calsession.h>
#include <calcalendarinfo.h>
#include <e32math.h>
@@ -407,6 +410,10 @@
Session().ListDataProvidersL(arr);
CleanupClosePushL(arr);
+ TBool operatorProfile = CAspProfile::IsOperatorProfileL(iProfile);
+ TInt operatorUid = CAspProfile::OperatorAdapterUidL();
+ TInt profileUid = CAspProfile::ProfileAdapterUidL();
+
TInt count = arr.Count();
for (TInt i=0; i<count; i++)
{
@@ -430,9 +437,29 @@
FTRACE( RDebug::Print(_L("### provider has no display name (id=%x) ###"), item.iDataProviderId) );
continue;
}
-
- User::LeaveIfError(iProviderList.Append(item));
-
+
+ if ( iApplicationId == 0 )
+ {
+ if ( operatorProfile )
+ {
+ if ( id != KUidNSmlAdapterContact.iUid )
+ {
+ User::LeaveIfError(iProviderList.Append(item));
+ }
+ }
+ else
+ {
+ if ( id != operatorUid && id != profileUid )
+ {
+ User::LeaveIfError(iProviderList.Append(item));
+ }
+ }
+ }
+ else
+ {
+ User::LeaveIfError(iProviderList.Append(item));
+ }
+
CleanupStack::PopAndDestroy(&provider);
}
@@ -2242,7 +2269,7 @@
if (iApplicationId != EApplicationIdSync)
{
- TInt dataProviderId = TUtil::ProviderIdFromAppId(iApplicationId);
+ TInt dataProviderId = TUtil::ProviderIdFromAppId(iApplicationId, CAspProfile::IsOperatorProfileL(profile));
TInt taskId = TAspTask::FindTaskIdL(profile, dataProviderId, KNullDesC);
item.iTaskId = taskId; // needed for syncing only one content
}
@@ -2325,13 +2352,20 @@
profile->OpenL(id, CAspProfile::EOpenRead, CAspProfile::EAllProperties);
}
+
+ // Hidden operator specific profile should not be visible
+ if (profile->IsHiddenOperatorProfileL())
+ {
+ CleanupStack::PopAndDestroy(profile);
+ continue;
+ }
TAspProfileItem item;
item.Init();
if (iApplicationId != EApplicationIdSync)
{
- TInt dataProviderId = TUtil::ProviderIdFromAppId(iApplicationId);
+ TInt dataProviderId = TUtil::ProviderIdFromAppId(iApplicationId, CAspProfile::IsOperatorProfileL(profile));
TInt taskId = TAspTask::FindTaskIdL(profile, dataProviderId, KNullDesC);
item.iTaskId = taskId; // needed for syncing only one content
}
@@ -2567,7 +2601,13 @@
{
return ETrue;
}
-
+
+ // Operator specific serverID is not considered as unique
+ if (CAspProfile::EqualsToOperatorServerId(aServerId))
+ {
+ return EFalse;
+ }
+
TBool serverIdFound = EFalse;
TInt count = iList.Count();
@@ -2916,9 +2956,20 @@
// -----------------------------------------------------------------------------
//
TBool CAspProfile::DeleteAllowed()
- {
- return iProfile.DeleteAllowed();
- }
+ {
+ TBool operatorProfile = EFalse;
+ TRAPD( err, operatorProfile = IsReadOnlyOperatorProfileL() );
+
+ // Disallow deletion of operator specific profile
+ if( err == KErrNone && operatorProfile )
+ {
+ return EFalse;
+ }
+ else
+ {
+ return iProfile.DeleteAllowed();
+ }
+ }
// -----------------------------------------------------------------------------
@@ -4123,7 +4174,133 @@
}
}
-
+//-----------------------------------------------------------------------------
+// CAspProfile:::IsOperatorProfileL
+//
+//-----------------------------------------------------------------------------
+//
+TBool CAspProfile::IsOperatorProfileL( CAspProfile* aProfile )
+ {
+ if ( !aProfile )
+ {
+ return EFalse;
+ }
+
+ TBuf<KBufSize255> serverId;
+ TBuf8<KBufSize255> serverIdUtf8;
+ TBuf8<KBufSize255> value;
+
+ aProfile->GetServerId( serverId );
+ if ( serverId.Length() > 0 )
+ {
+ serverIdUtf8.Copy( serverId );
+
+ CRepository* rep = CRepository::NewLC( KCRUidOperatorDatasyncInternalKeys );
+ TInt err = rep->Get( KNsmlOpDsOperatorSyncServerId, value );
+ CleanupStack::PopAndDestroy( rep );
+
+ if ( !err && serverIdUtf8.Compare( value ) == 0 )
+ {
+ return ETrue;
+ }
+ }
+ return EFalse;
+ }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::OperatorAdapterUidL
+//
+//-----------------------------------------------------------------------------
+//
+TInt CAspProfile::OperatorAdapterUidL()
+ {
+ TInt value = 0;
+ CRepository* rep = CRepository::NewLC( KCRUidOperatorDatasyncInternalKeys );
+ rep->Get( KNsmlOpDsOperatorAdapterUid, value );
+ CleanupStack::PopAndDestroy( rep );
+ return value;
+ }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::ProfileAdapterUidL
+//
+//-----------------------------------------------------------------------------
+//
+TInt CAspProfile::ProfileAdapterUidL()
+ {
+ TInt value = 0;
+ CRepository* rep = CRepository::NewLC( KCRUidOperatorDatasyncInternalKeys );
+ rep->Get( KNsmlOpDsProfileAdapterUid, value );
+ CleanupStack::PopAndDestroy( rep );
+ return value;
+ }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::ProfileVisibilityL
+//
+//-----------------------------------------------------------------------------
+//
+TInt CAspProfile::ProfileVisibilityL()
+ {
+ TInt value = 0;
+ CRepository* rep = CRepository::NewLC( KCRUidOperatorDatasyncInternalKeys );
+ rep->Get( KNsmlOpDsSyncProfileVisibility, value );
+ CleanupStack::PopAndDestroy( rep );
+ return value;
+ }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::IsReadOnlyOperatorProfileL
+//
+//-----------------------------------------------------------------------------
+//
+TBool CAspProfile::IsReadOnlyOperatorProfileL()
+ {
+ return ( IsOperatorProfileL( this ) &&
+ ProfileVisibilityL() == EProfileVisibilityReadOnly );
+ }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::IsHiddenOperatorProfileL
+//
+//-----------------------------------------------------------------------------
+//
+TBool CAspProfile::IsHiddenOperatorProfileL()
+ {
+ return ( IsOperatorProfileL( this ) &&
+ ProfileVisibilityL() == EProfileVisibilityHidden );
+ }
+
+//-----------------------------------------------------------------------------
+// CAspProfile:::EqualsToOperatorServerIdL
+//
+//-----------------------------------------------------------------------------
+//
+TBool CAspProfile::EqualsToOperatorServerId( const TDesC& aServerId )
+ {
+ if ( aServerId.Length() > 0 )
+ {
+ TBuf8<KBufSize255> serverIdUtf8;
+ TBuf8<KBufSize255> value;
+ serverIdUtf8.Copy( aServerId );
+
+ // Read operator specific serverId from cenrep
+ CRepository* rep = NULL;
+ TRAPD( err, rep = CRepository::NewL( KCRUidOperatorDatasyncInternalKeys ) );
+ if( err == KErrNone )
+ {
+ rep->Get( KNsmlOpDsOperatorSyncServerId, value );
+ delete rep;
+
+ if ( serverIdUtf8.Compare( value ) == 0 )
+ {
+ return ETrue;
+ }
+ }
+ }
+
+ return EFalse;
+ }
/*******************************************************************************
* class TAspTask
--- a/omads/omadsappui/AspSyncUtil/src/AspProfileDialog.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsappui/AspSyncUtil/src/AspProfileDialog.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -416,7 +416,7 @@
// open editor for Yes/No setting
if (EditSettingItemListL(*item))
{
- SetVisibility();
+ SetVisibilityL();
UpdateListBoxL(ListBox(), iSettingList);
}
}
@@ -859,7 +859,7 @@
if (EditSettingItemL(*item))
{
- SetVisibility();
+ SetVisibilityL();
UpdateListBoxL(ListBox(), iSettingList);
}
}
@@ -910,7 +910,7 @@
InitSettingItemL((*iSettingList)[i]);
}
- SetVisibility(); // find out what setting appear on UI
+ SetVisibilityL(); // find out what setting appear on UI
CleanupStack::PopAndDestroy(arr);
}
@@ -963,7 +963,27 @@
{
continue;
}
-
+
+ // In Phonebooks syncronization settings, remove another provider from
+ // end of settings item list
+ if (appId == EApplicationIdContact)
+ {
+ TInt operatorUid = CAspProfile::OperatorAdapterUidL();
+ //if current profile is operator profile, don't display s60 contacts adapter
+ if (CAspProfile::IsOperatorProfileL(iProfile))
+ {
+ if (operatorUid != providerItem.iDataProviderId)
+ {
+ continue;
+ }
+ }
+ //if current profile is not operator profile, don't display operator adapter
+ else if (operatorUid == providerItem.iDataProviderId)
+ {
+ continue;
+ }
+ }
+
HBufC* firstLine = CAspResHandler::GetContentSettingLC(
providerItem.iDataProviderId,
providerItem.iDisplayName);
@@ -1042,11 +1062,11 @@
// -----------------------------------------------------------------------------
-// CAspProfileDialog::SetVisibility
+// CAspProfileDialog::SetVisibilityL
//
// -----------------------------------------------------------------------------
//
-void CAspProfileDialog::SetVisibility()
+void CAspProfileDialog::SetVisibilityL()
{
TBool isPCSuite = CAspProfile::IsPCSuiteProfile(iProfile);
@@ -1123,7 +1143,8 @@
#endif
if (iEditMode == EDialogModeReadOnly ||
- iEditMode == EDialogModeSettingEnforcement)
+ iEditMode == EDialogModeSettingEnforcement ||
+ iProfile->IsReadOnlyOperatorProfileL() )
{
SetAllReadOnly();
}
--- a/omads/omadsappui/AspSyncUtil/src/AspSettingDialog.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsappui/AspSyncUtil/src/AspSettingDialog.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -2092,6 +2092,13 @@
UpdateNavipaneL(iCurrentProfileName);
#endif
}
+ else
+ {
+#ifdef RD_DSUI_TIMEDSYNC
+
+ UpdateTabsL();
+#endif
+ }
}
--- a/omads/omadsappui/AspSyncUtil/src/AspSyncUtil.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsappui/AspSyncUtil/src/AspSyncUtil.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -729,7 +729,7 @@
return EFalse;
}
- TInt dataProviderId = TUtil::ProviderIdFromAppId(iApplicationId);
+ TInt dataProviderId = TUtil::ProviderIdFromAppId(iApplicationId, CAspProfile::IsOperatorProfileL(profile));
iContentList->RemoveAllTasks();
iContentList->SetProfile(profile);
iContentList->InitAllTasksL();
--- a/omads/omadsappui/AspSyncUtil/src/AspUtil.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsappui/AspSyncUtil/src/AspUtil.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -33,6 +33,7 @@
#include <hlplch.h> // HlpLauncher
#include <MuiuMsvUiServiceUtilities.h> // for MsvUiServiceUtilities
+#include <NsmlOperatorDataCRKeys.h> // KCRUidOperatorDatasyncInternalKeys
#include "AspUtil.h"
@@ -345,7 +346,65 @@
return id;
}
+// -----------------------------------------------------------------------------
+// TUtil::ProviderIdFromAppId
+//
+// -----------------------------------------------------------------------------
+//
+TInt TUtil::ProviderIdFromAppId(TInt aApplicationId, TBool aOperatorProfile)
+ {
+ TInt id=KErrNotFound;
+ if (aOperatorProfile)
+ {
+ id = OperatorProviderIdFromAppId( aApplicationId );
+ }
+ else
+ {
+ id = ProviderIdFromAppId( aApplicationId );
+ }
+ return id;
+ }
+
+// -----------------------------------------------------------------------------
+// TUtil::OperatorProviderIdFromAppId
+//
+// -----------------------------------------------------------------------------
+//
+TInt TUtil::OperatorProviderIdFromAppId(TInt aApplicationId)
+ {
+ TInt id = KErrNotFound;
+ CRepository* repository = NULL;
+
+ TInt err = KErrNotFound;
+ TRAP(err, repository = CRepository::NewL(KCRUidOperatorDatasyncInternalKeys));
+ if (err == KErrNone)
+ {
+ switch (aApplicationId)
+ {
+ // Operator specific version of Contacts adapter is supported
+ case EApplicationIdContact:
+ {
+ err = repository->Get(KNsmlOpDsOperatorAdapterUid, id);
+ break;
+ }
+ default:
+ {
+ id = ProviderIdFromAppId(aApplicationId);
+ break;
+ }
+ }
+ delete repository;
+ }
+
+ if ( (id == KErrNotFound) || (err != KErrNone) )
+ {
+ // Use default adapter
+ id = ProviderIdFromAppId(aApplicationId);
+ }
+ return id;
+ }
+
// -----------------------------------------------------------------------------
// TUtil::AppIdFromProviderId
//
@@ -371,10 +430,38 @@
{
id = EApplicationIdNote;
}
-
+ if (id == KErrNotFound) // Check if this operator specific adapter
+ {
+ id = AppIdFromOperatorSpecificProviderId( aAdapterId );
+ }
return id;
}
+// -----------------------------------------------------------------------------
+// TUtil::AppIdFromOperatorSpecificProviderId
+//
+// -----------------------------------------------------------------------------
+//
+TInt TUtil::AppIdFromOperatorSpecificProviderId(TInt aAdapterId)
+ {
+ TInt id=KErrNotFound;
+ CRepository* repository = NULL;
+
+ TRAPD(err, repository = CRepository::NewL(KCRUidOperatorDatasyncInternalKeys));
+ if (err == KErrNone)
+ {
+ TInt operatorContactsProvider = KErrNotFound;
+ err = repository->Get(KNsmlOpDsOperatorAdapterUid, operatorContactsProvider);
+
+ if ( err == KErrNone && aAdapterId == operatorContactsProvider )
+ {
+ id = EApplicationIdContact;
+ }
+ delete repository;
+ }
+ return id;
+ }
+
// -----------------------------------------------------------------------------
// TUtil::IsToDay
--- a/omads/omadsappui/help/inc/ds.hlp.hrh Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsappui/help/inc/ds.hlp.hrh Fri Mar 12 15:41:30 2010 +0200
@@ -1,8 +1,8 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
+* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
@@ -10,8 +10,8 @@
* Nokia Corporation - initial contribution.
*
* Contributors:
-*
-* Description:
+*
+* Description: Declarations used for help text.
*
*/
--- a/omads/omadsextensions/adapters/contacts/bld/def/bwinscwcontactsdataprovideru.def Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsextensions/adapters/contacts/bld/def/bwinscwcontactsdataprovideru.def Fri Mar 12 15:41:30 2010 +0200
@@ -1,3 +1,99 @@
EXPORTS
?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
+ ?DoWriteItemL@CNSmlContactsDataStore@@MAEXABVTDesC8@@@Z @ 2 NONAME ; void CNSmlContactsDataStore::DoWriteItemL(class TDesC8 const &)
+ ?DoSupportedServerFiltersL@CNSmlContactsDataProvider@@MAEABV?$RPointerArray@VCSyncMLFilter@@@@XZ @ 3 NONAME ; class RPointerArray<class CSyncMLFilter> const & CNSmlContactsDataProvider::DoSupportedServerFiltersL(void)
+ ?DoModifiedItems@CNSmlContactsDataStore@@MBEABVMSmlDataItemUidSet@@XZ @ 4 NONAME ; class MSmlDataItemUidSet const & CNSmlContactsDataStore::DoModifiedItems(void) const
+ ?DoReadItemL@CNSmlContactsDataStore@@MAEXAAVTDes8@@@Z @ 5 NONAME ; void CNSmlContactsDataStore::DoReadItemL(class TDes8 &)
+ ?DoDeletedItems@CNSmlContactsDataStore@@MBEABVMSmlDataItemUidSet@@XZ @ 6 NONAME ; class MSmlDataItemUidSet const & CNSmlContactsDataStore::DoDeletedItems(void) const
+ ?ConstructL@CNSmlContactsDataStore@@IAEXXZ @ 7 NONAME ; void CNSmlContactsDataStore::ConstructL(void)
+ ?NewL@CNSmlContactsDataStore@@SAPAV1@XZ @ 8 NONAME ; class CNSmlContactsDataStore * CNSmlContactsDataStore::NewL(void)
+ ?DoGenerateFieldFilterQueryL@CNSmlContactsDataProvider@@MAEXABV?$RPointerArray@VCSyncMLFilter@@@@AAVTDes16@@AAV?$RPointerArray@VCSmlDataProperty@@@@AAVTDesC16@@@Z @ 9 NONAME ; void CNSmlContactsDataProvider::DoGenerateFieldFilterQueryL(class RPointerArray<class CSyncMLFilter> const &, class TDes16 &, class RPointerArray<class CSmlDataProperty> &, class TDesC16 &)
+ ?ContactRemovedFromView@CNSmlContactsDataStore@@MAEXAAVMVPbkContactViewBase@@HABVMVPbkContactLink@@@Z @ 10 NONAME ; void CNSmlContactsDataStore::ContactRemovedFromView(class MVPbkContactViewBase &, int, class MVPbkContactLink const &)
+ ??0CNSmlContactsDataStore@@IAE@XZ @ 11 NONAME ; CNSmlContactsDataStore::CNSmlContactsDataStore(void)
+ ?OperationComplete@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@@Z @ 12 NONAME ; void CNSmlContactsDataStore::OperationComplete(class MVPbkContactOperationBase &)
+ ?ExecuteDeleteL@CNSmlContactsDataStore@@MAEXXZ @ 13 NONAME ; void CNSmlContactsDataStore::ExecuteDeleteL(void)
+ ?DoResetChangeInfoL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 14 NONAME ; void CNSmlContactsDataStore::DoResetChangeInfoL(class TRequestStatus &)
+ ?DoBeginBatchL@CNSmlContactsDataStore@@MAEXXZ @ 15 NONAME ; void CNSmlContactsDataStore::DoBeginBatchL(void)
+ ?DoSoftDeletedItems@CNSmlContactsDataStore@@MBEABVMSmlDataItemUidSet@@XZ @ 16 NONAME ; class MSmlDataItemUidSet const & CNSmlContactsDataStore::DoSoftDeletedItems(void) const
+ ?StoreReady@CNSmlContactsDataStore@@MAEXAAVMVPbkContactStore@@@Z @ 17 NONAME ; void CNSmlContactsDataStore::StoreReady(class MVPbkContactStore &)
+ ??1CNSmlContactsDataStore@@UAE@XZ @ 18 NONAME ; CNSmlContactsDataStore::~CNSmlContactsDataStore(void)
+ ?GetStoreFormatResourceFileL@CNSmlContactsDataProvider@@MBEABVTDesC16@@XZ @ 19 NONAME ; class TDesC16 const & CNSmlContactsDataProvider::GetStoreFormatResourceFileL(void) const
+ ?SetOwnStoreFormatL@CNSmlContactsDataStore@@IAEXXZ @ 20 NONAME ; void CNSmlContactsDataStore::SetOwnStoreFormatL(void)
+ ?AddBufferListL@CNSmlContactsDataStore@@IAEPAVCBufBase@@AAHHH@Z @ 21 NONAME ; class CBufBase * CNSmlContactsDataStore::AddBufferListL(int &, int, int)
+ ?DoListStoresLC@CNSmlContactsDataStore@@QAEPAVCDesC16Array@@XZ @ 22 NONAME ; class CDesC16Array * CNSmlContactsDataStore::DoListStoresLC(void)
+ ?StripPropertyL@CNSmlContactsDataStore@@IBEXAAPAVCBufBase@@ABVTDesC8@@@Z @ 23 NONAME ; void CNSmlContactsDataStore::StripPropertyL(class CBufBase * &, class TDesC8 const &) const
+ ?ContactAddedToView@CNSmlContactsDataStore@@MAEXAAVMVPbkContactViewBase@@HABVMVPbkContactLink@@@Z @ 24 NONAME ; void CNSmlContactsDataStore::ContactAddedToView(class MVPbkContactViewBase &, int, class MVPbkContactLink const &)
+ ?ContactsSaved@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@PAVMVPbkContactLinkArray@@@Z @ 25 NONAME ; void CNSmlContactsDataStore::ContactsSaved(class MVPbkContactOperationBase &, class MVPbkContactLinkArray *)
+ ?ExecuteUpdateL@CNSmlContactsDataStore@@MAEXXZ @ 26 NONAME ; void CNSmlContactsDataStore::ExecuteUpdateL(void)
+ ??0CNSmlContactsDataProvider@@IAE@XZ @ 27 NONAME ; CNSmlContactsDataProvider::CNSmlContactsDataProvider(void)
+ ?ConstructL@CNSmlContactsDataProvider@@IAEXXZ @ 28 NONAME ; void CNSmlContactsDataProvider::ConstructL(void)
+ ?LdoAddItemsL@CNSmlContactsDataStore@@MAEXAAPAVCBufBase@@H@Z @ 29 NONAME ; void CNSmlContactsDataStore::LdoAddItemsL(class CBufBase * &, int)
+ ?StepFailed@CNSmlContactsDataStore@@MAEHAAVMVPbkContactOperationBase@@HH@Z @ 30 NONAME ; int CNSmlContactsDataStore::StepFailed(class MVPbkContactOperationBase &, int, int)
+ ?HandleStoreEventL@CNSmlContactsDataStore@@MAEXAAVMVPbkContactStore@@VTVPbkContactStoreEvent@@@Z @ 31 NONAME ; void CNSmlContactsDataStore::HandleStoreEventL(class MVPbkContactStore &, class TVPbkContactStoreEvent)
+ ?DoCommitChangeInfoL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@ABVMSmlDataItemUidSet@@@Z @ 32 NONAME ; void CNSmlContactsDataStore::DoCommitChangeInfoL(class TRequestStatus &, class MSmlDataItemUidSet const &)
+ ?DoOnFrameworkEvent@CNSmlContactsDataProvider@@MAEXW4TSmlFrameworkEvent@@HH@Z @ 33 NONAME ; void CNSmlContactsDataProvider::DoOnFrameworkEvent(enum TSmlFrameworkEvent, int, int)
+ ?DoDeleteAllItemsL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 34 NONAME ; void CNSmlContactsDataStore::DoDeleteAllItemsL(class TRequestStatus &)
+ ??1CNSmlContactsDataProvider@@UAE@XZ @ 35 NONAME ; CNSmlContactsDataProvider::~CNSmlContactsDataProvider(void)
+ ?IsConfidentialL@CNSmlContactsDataStore@@IAEHAAVMVPbkStoreContact@@@Z @ 36 NONAME ; int CNSmlContactsDataStore::IsConfidentialL(class MVPbkStoreContact &)
+ ?DefaultStoreNameL@CNSmlContactsDataStore@@QBEABVTDesC16@@XZ @ 37 NONAME ; class TDesC16 const & CNSmlContactsDataStore::DefaultStoreNameL(void) const
+ ?DoSetRemoteStoreFormatL@CNSmlContactsDataStore@@MAEXABVCSmlDataStoreFormat@@@Z @ 38 NONAME ; void CNSmlContactsDataStore::DoSetRemoteStoreFormatL(class CSmlDataStoreFormat const &)
+ ?DriveBelowCriticalLevelL@CNSmlContactsDataStore@@IAEHH@Z @ 39 NONAME ; int CNSmlContactsDataStore::DriveBelowCriticalLevelL(int)
+ ?CreateViewL@CNSmlContactsDataStore@@IAEXXZ @ 40 NONAME ; void CNSmlContactsDataStore::CreateViewL(void)
+ ?GetDataMod@CNSmlContactsDataStore@@MAEAAVCNSmlDataModBase@@XZ @ 41 NONAME ; class CNSmlDataModBase & CNSmlContactsDataStore::GetDataMod(void)
+ ?ResetBuffer@CNSmlContactsDataStore@@IAEXXZ @ 42 NONAME ; void CNSmlContactsDataStore::ResetBuffer(void)
+ ?DoSoftDeleteItemL@CNSmlContactsDataStore@@MAEXHAAVTRequestStatus@@@Z @ 43 NONAME ; void CNSmlContactsDataStore::DoSoftDeleteItemL(int, class TRequestStatus &)
+ ?DoMoveItemL@CNSmlContactsDataStore@@MAEXHHAAVTRequestStatus@@@Z @ 44 NONAME ; void CNSmlContactsDataStore::DoMoveItemL(int, int, class TRequestStatus &)
+ ?DoDefaultStoreL@CNSmlContactsDataProvider@@MAEABVTDesC16@@XZ @ 45 NONAME ; class TDesC16 const & CNSmlContactsDataProvider::DoDefaultStoreL(void)
+ ?ExecuteMoveL@CNSmlContactsDataStore@@MAEXXZ @ 46 NONAME ; void CNSmlContactsDataStore::ExecuteMoveL(void)
+ ?SingleContactOperationCompleteL@CNSmlContactsDataStore@@IAEXPAVMVPbkStoreContact@@@Z @ 47 NONAME ; void CNSmlContactsDataStore::SingleContactOperationCompleteL(class MVPbkStoreContact *)
+ ?DoStoreName@CNSmlContactsDataStore@@MBEABVTDesC16@@XZ @ 48 NONAME ; class TDesC16 const & CNSmlContactsDataStore::DoStoreName(void) const
+ ?DoDeleteAllContactsL@CNSmlContactsDataStore@@MAEXXZ @ 49 NONAME ; void CNSmlContactsDataStore::DoDeleteAllContactsL(void)
+ ?DoCreateItemL@CNSmlContactsDataStore@@MAEXAAHHHABVTDesC8@@1AAVTRequestStatus@@@Z @ 50 NONAME ; void CNSmlContactsDataStore::DoCreateItemL(int &, int, int, class TDesC8 const &, class TDesC8 const &, class TRequestStatus &)
+ ??1CNSmlContactsBufferItem@CNSmlContactsDataStore@@UAE@XZ @ 51 NONAME ; CNSmlContactsDataStore::CNSmlContactsBufferItem::~CNSmlContactsBufferItem(void)
+ ?DoListStoresLC@CNSmlContactsDataProvider@@MAEPAVCDesC16Array@@XZ @ 52 NONAME ; class CDesC16Array * CNSmlContactsDataProvider::DoListStoresLC(void)
+ ?DoSupportsOperation@CNSmlContactsDataProvider@@MBEHVTUid@@@Z @ 53 NONAME ; int CNSmlContactsDataProvider::DoSupportsOperation(class TUid) const
+ ?ContactViewError@CNSmlContactsDataStore@@MAEXAAVMVPbkContactViewBase@@HH@Z @ 54 NONAME ; void CNSmlContactsDataStore::ContactViewError(class MVPbkContactViewBase &, int, int)
+ ?ContactViewReady@CNSmlContactsDataStore@@MAEXAAVMVPbkContactViewBase@@@Z @ 55 NONAME ; void CNSmlContactsDataStore::ContactViewReady(class MVPbkContactViewBase &)
+ ?DoCommitChangeInfoL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 56 NONAME ; void CNSmlContactsDataStore::DoCommitChangeInfoL(class TRequestStatus &)
+ ?ConstructL@CNSmlContactsDataStore@@IAEXABVTDesC16@@0@Z @ 57 NONAME ; void CNSmlContactsDataStore::ConstructL(class TDesC16 const &, class TDesC16 const &)
+ ?NewL@CNSmlContactsDataProvider@@SAPAV1@XZ @ 58 NONAME ; class CNSmlContactsDataProvider * CNSmlContactsDataProvider::NewL(void)
+ ?ExecuteBufferL@CNSmlContactsDataStore@@MAEXXZ @ 59 NONAME ; void CNSmlContactsDataStore::ExecuteBufferL(void)
+ ?DoGenerateRecordFilterQueryLC@CNSmlContactsDataProvider@@MAEPAVHBufC16@@ABV?$RPointerArray@VCSyncMLFilter@@@@W4TSyncMLFilterMatchType@@AAVTDes16@@AAW4TSyncMLFilterType@@AAVTDesC16@@@Z @ 60 NONAME ; class HBufC16 * CNSmlContactsDataProvider::DoGenerateRecordFilterQueryLC(class RPointerArray<class CSyncMLFilter> const &, enum TSyncMLFilterMatchType, class TDes16 &, enum TSyncMLFilterType &, class TDesC16 &)
+ ?ExecuteAddL@CNSmlContactsDataStore@@MAEHXZ @ 61 NONAME ; int CNSmlContactsDataStore::ExecuteAddL(void)
+ ?VPbkSingleContactOperationComplete@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@PAVMVPbkStoreContact@@@Z @ 62 NONAME ; void CNSmlContactsDataStore::VPbkSingleContactOperationComplete(class MVPbkContactOperationBase &, class MVPbkStoreContact *)
+ ?LdoAddItemL@CNSmlContactsDataStore@@MAEXABVTDesC8@@H@Z @ 63 NONAME ; void CNSmlContactsDataStore::LdoAddItemL(class TDesC8 const &, int)
+ ?DoCheckSupportedServerFiltersL@CNSmlContactsDataProvider@@MAEXABVCSmlDataStoreFormat@@AAV?$RPointerArray@VCSyncMLFilter@@@@AAW4TSyncMLFilterChangeInfo@@@Z @ 64 NONAME ; void CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL(class CSmlDataStoreFormat const &, class RPointerArray<class CSyncMLFilter> &, enum TSyncMLFilterChangeInfo &)
+ ?GetStoreFormatResourceFileL@CNSmlContactsDataStore@@MAEABVTDesC16@@XZ @ 65 NONAME ; class TDesC16 const & CNSmlContactsDataStore::GetStoreFormatResourceFileL(void)
+ ?DoRevertTransaction@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 66 NONAME ; void CNSmlContactsDataStore::DoRevertTransaction(class TRequestStatus &)
+ ?DoCommitItemL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 67 NONAME ; void CNSmlContactsDataStore::DoCommitItemL(class TRequestStatus &)
+ ?LdoUpdateItemL@CNSmlContactsDataStore@@MAEXXZ @ 68 NONAME ; void CNSmlContactsDataStore::LdoUpdateItemL(void)
+ ?DoDeleteItemL@CNSmlContactsDataStore@@MAEXHAAVTRequestStatus@@@Z @ 69 NONAME ; void CNSmlContactsDataStore::DoDeleteItemL(int, class TRequestStatus &)
+ ?CreateDataStoreLC@CNSmlContactsDataProvider@@MBEPAVCNSmlContactsDataStore@@XZ @ 70 NONAME ; class CNSmlContactsDataStore * CNSmlContactsDataProvider::CreateDataStoreLC(void) const
+ ?DoHasSyncHistory@CNSmlContactsDataStore@@MBEHXZ @ 71 NONAME ; int CNSmlContactsDataStore::DoHasSyncHistory(void) const
+ ?DoCommitBatchL@CNSmlContactsDataStore@@MAEXAAV?$RArray@H@@AAVTRequestStatus@@@Z @ 72 NONAME ; void CNSmlContactsDataStore::DoCommitBatchL(class RArray<int> &, class TRequestStatus &)
+ ?DoMaxObjectSize@CNSmlContactsDataStore@@MBEHXZ @ 73 NONAME ; int CNSmlContactsDataStore::DoMaxObjectSize(void) const
+ ?DoReplaceItemL@CNSmlContactsDataStore@@MAEXHHHHAAVTRequestStatus@@@Z @ 74 NONAME ; void CNSmlContactsDataStore::DoReplaceItemL(int, int, int, int, class TRequestStatus &)
+ ?DoCloseItem@CNSmlContactsDataStore@@MAEXXZ @ 75 NONAME ; void CNSmlContactsDataStore::DoCloseItem(void)
+ ?ContactViewUnavailable@CNSmlContactsDataStore@@MAEXAAVMVPbkContactViewBase@@@Z @ 76 NONAME ; void CNSmlContactsDataStore::ContactViewUnavailable(class MVPbkContactViewBase &)
+ ?DoCommitTransactionL@CNSmlContactsDataStore@@MAEXAAVTRequestStatus@@@Z @ 77 NONAME ; void CNSmlContactsDataStore::DoCommitTransactionL(class TRequestStatus &)
+ ?DoStoreFormatL@CNSmlContactsDataProvider@@MAEABVCSmlDataStoreFormat@@XZ @ 78 NONAME ; class CSmlDataStoreFormat const & CNSmlContactsDataProvider::DoStoreFormatL(void)
+ ?DoCancelBatch@CNSmlContactsDataStore@@MAEXXZ @ 79 NONAME ; void CNSmlContactsDataStore::DoCancelBatch(void)
+ ?CreateModsFetcherL@CNSmlContactsDataStore@@MAEPAVMContactsModsFetcher@@XZ @ 80 NONAME ; class MContactsModsFetcher * CNSmlContactsDataStore::CreateModsFetcherL(void)
+ ?NewLC@CNSmlContactsDataProvider@@KAPAV1@XZ @ 81 NONAME ; class CNSmlContactsDataProvider * CNSmlContactsDataProvider::NewLC(void)
+ ?StoreUnavailable@CNSmlContactsDataStore@@MAEXAAVMVPbkContactStore@@H@Z @ 82 NONAME ; void CNSmlContactsDataStore::StoreUnavailable(class MVPbkContactStore &, int)
+ ?LdoFetchItemL@CNSmlContactsDataStore@@MAEXAAHAAVCBufBase@@@Z @ 83 NONAME ; void CNSmlContactsDataStore::LdoFetchItemL(int &, class CBufBase &)
+ ?DoCheckServerFiltersL@CNSmlContactsDataProvider@@MAEXAAV?$RPointerArray@VCSyncMLFilter@@@@AAW4TSyncMLFilterChangeInfo@@@Z @ 84 NONAME ; void CNSmlContactsDataProvider::DoCheckServerFiltersL(class RPointerArray<class CSyncMLFilter> &, enum TSyncMLFilterChangeInfo &)
+ ?DoCancelRequest@CNSmlContactsDataStore@@MAEXXZ @ 85 NONAME ; void CNSmlContactsDataStore::DoCancelRequest(void)
+ ?DoOpenItemL@CNSmlContactsDataStore@@MAEXHAAH00AAVTDes8@@1AAVTRequestStatus@@@Z @ 86 NONAME ; void CNSmlContactsDataStore::DoOpenItemL(int, int &, int &, int &, class TDes8 &, class TDes8 &, class TRequestStatus &)
+ ?DoBeginTransactionL@CNSmlContactsDataStore@@MAEXXZ @ 87 NONAME ; void CNSmlContactsDataStore::DoBeginTransactionL(void)
+ ?OperationCompleteL@CNSmlContactsDataStore@@IAEXXZ @ 88 NONAME ; void CNSmlContactsDataStore::OperationCompleteL(void)
+ ?StepComplete@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@H@Z @ 89 NONAME ; void CNSmlContactsDataStore::StepComplete(class MVPbkContactOperationBase &, int)
+ ?DoAddedItems@CNSmlContactsDataStore@@MBEABVMSmlDataItemUidSet@@XZ @ 90 NONAME ; class MSmlDataItemUidSet const & CNSmlContactsDataStore::DoAddedItems(void) const
+ ?DoSetRemoteMaxObjectSize@CNSmlContactsDataStore@@MAEXH@Z @ 91 NONAME ; void CNSmlContactsDataStore::DoSetRemoteMaxObjectSize(int)
+ ?StripPropertyL@CNSmlContactsDataStore@@IBEXAAPAVHBufC8@@ABVTDesC8@@@Z @ 92 NONAME ; void CNSmlContactsDataStore::StripPropertyL(class HBufC8 * &, class TDesC8 const &) const
+ ?DoOpenL@CNSmlContactsDataStore@@MAEXABVTDesC16@@AAVMSmlSyncRelationship@@AAVTRequestStatus@@@Z @ 93 NONAME ; void CNSmlContactsDataStore::DoOpenL(class TDesC16 const &, class MSmlSyncRelationship &, class TRequestStatus &)
+ ?VPbkSingleContactOperationFailed@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@H@Z @ 94 NONAME ; void CNSmlContactsDataStore::VPbkSingleContactOperationFailed(class MVPbkContactOperationBase &, int)
+ ?ContactsSavingFailed@CNSmlContactsDataStore@@MAEXAAVMVPbkContactOperationBase@@H@Z @ 95 NONAME ; void CNSmlContactsDataStore::ContactsSavingFailed(class MVPbkContactOperationBase &, int)
+ ?DoMovedItems@CNSmlContactsDataStore@@MBEABVMSmlDataItemUidSet@@XZ @ 96 NONAME ; class MSmlDataItemUidSet const & CNSmlContactsDataStore::DoMovedItems(void) const
+ ?DoNewStoreInstanceLC@CNSmlContactsDataProvider@@MAEPAVCSmlDataStore@@XZ @ 97 NONAME ; class CSmlDataStore * CNSmlContactsDataProvider::DoNewStoreInstanceLC(void)
--- a/omads/omadsextensions/adapters/contacts/bld/def/eabicontactsdataprovideru.def Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsextensions/adapters/contacts/bld/def/eabicontactsdataprovideru.def Fri Mar 12 15:41:30 2010 +0200
@@ -8,4 +8,135 @@
_ZTV24CNSmlContactsModsFetcher @ 7 NONAME ; #<VT>#
_ZTV25CNSmlContactsDataProvider @ 8 NONAME ; #<VT>#
_ZTVN22CNSmlContactsDataStore23CNSmlContactsBufferItemE @ 9 NONAME ; #<VT>#
+ _ZN22CNSmlContactsDataStore10ConstructLERK7TDesC16S2_ @ 10 NONAME
+ _ZN22CNSmlContactsDataStore10ConstructLEv @ 11 NONAME
+ _ZN22CNSmlContactsDataStore10GetDataModEv @ 12 NONAME
+ _ZN22CNSmlContactsDataStore10StepFailedER25MVPbkContactOperationBaseii @ 13 NONAME
+ _ZN22CNSmlContactsDataStore10StoreReadyER17MVPbkContactStore @ 14 NONAME
+ _ZN22CNSmlContactsDataStore11CreateViewLEv @ 15 NONAME
+ _ZN22CNSmlContactsDataStore11DoCloseItemEv @ 16 NONAME
+ _ZN22CNSmlContactsDataStore11DoMoveItemLEiiR14TRequestStatus @ 17 NONAME
+ _ZN22CNSmlContactsDataStore11DoOpenItemLEiRiS0_S0_R5TDes8S2_R14TRequestStatus @ 18 NONAME
+ _ZN22CNSmlContactsDataStore11DoReadItemLER5TDes8 @ 19 NONAME
+ _ZN22CNSmlContactsDataStore11ExecuteAddLEv @ 20 NONAME
+ _ZN22CNSmlContactsDataStore11LdoAddItemLERK6TDesC8i @ 21 NONAME
+ _ZN22CNSmlContactsDataStore11ResetBufferEv @ 22 NONAME
+ _ZN22CNSmlContactsDataStore12DoWriteItemLERK6TDesC8 @ 23 NONAME
+ _ZN22CNSmlContactsDataStore12ExecuteMoveLEv @ 24 NONAME
+ _ZN22CNSmlContactsDataStore12LdoAddItemsLERP8CBufBasei @ 25 NONAME
+ _ZN22CNSmlContactsDataStore12StepCompleteER25MVPbkContactOperationBasei @ 26 NONAME
+ _ZN22CNSmlContactsDataStore13ContactsSavedER25MVPbkContactOperationBaseP21MVPbkContactLinkArray @ 27 NONAME
+ _ZN22CNSmlContactsDataStore13DoBeginBatchLEv @ 28 NONAME
+ _ZN22CNSmlContactsDataStore13DoCancelBatchEv @ 29 NONAME
+ _ZN22CNSmlContactsDataStore13DoCommitItemLER14TRequestStatus @ 30 NONAME
+ _ZN22CNSmlContactsDataStore13DoCreateItemLERiiiRK6TDesC8S3_R14TRequestStatus @ 31 NONAME
+ _ZN22CNSmlContactsDataStore13DoDeleteItemLEiR14TRequestStatus @ 32 NONAME
+ _ZN22CNSmlContactsDataStore13LdoFetchItemLERiR8CBufBase @ 33 NONAME
+ _ZN22CNSmlContactsDataStore14AddBufferListLERiii @ 34 NONAME
+ _ZN22CNSmlContactsDataStore14DoCommitBatchLER6RArrayIiER14TRequestStatus @ 35 NONAME
+ _ZN22CNSmlContactsDataStore14DoListStoresLCEv @ 36 NONAME
+ _ZN22CNSmlContactsDataStore14DoReplaceItemLEiiiiR14TRequestStatus @ 37 NONAME
+ _ZN22CNSmlContactsDataStore14ExecuteBufferLEv @ 38 NONAME
+ _ZN22CNSmlContactsDataStore14ExecuteDeleteLEv @ 39 NONAME
+ _ZN22CNSmlContactsDataStore14ExecuteUpdateLEv @ 40 NONAME
+ _ZN22CNSmlContactsDataStore14LdoUpdateItemLEv @ 41 NONAME
+ _ZN22CNSmlContactsDataStore15DoCancelRequestEv @ 42 NONAME
+ _ZN22CNSmlContactsDataStore15IsConfidentialLER17MVPbkStoreContact @ 43 NONAME
+ _ZN22CNSmlContactsDataStore16ContactViewErrorER20MVPbkContactViewBaseii @ 44 NONAME
+ _ZN22CNSmlContactsDataStore16ContactViewReadyER20MVPbkContactViewBase @ 45 NONAME
+ _ZN22CNSmlContactsDataStore16StoreUnavailableER17MVPbkContactStorei @ 46 NONAME
+ _ZN22CNSmlContactsDataStore17DoDeleteAllItemsLER14TRequestStatus @ 47 NONAME
+ _ZN22CNSmlContactsDataStore17DoSoftDeleteItemLEiR14TRequestStatus @ 48 NONAME
+ _ZN22CNSmlContactsDataStore17HandleStoreEventLER17MVPbkContactStore22TVPbkContactStoreEvent @ 49 NONAME
+ _ZN22CNSmlContactsDataStore17OperationCompleteER25MVPbkContactOperationBase @ 50 NONAME
+ _ZN22CNSmlContactsDataStore18ContactAddedToViewER20MVPbkContactViewBaseiRK16MVPbkContactLink @ 51 NONAME
+ _ZN22CNSmlContactsDataStore18CreateModsFetcherLEv @ 52 NONAME
+ _ZN22CNSmlContactsDataStore18DoResetChangeInfoLER14TRequestStatus @ 53 NONAME
+ _ZN22CNSmlContactsDataStore18OperationCompleteLEv @ 54 NONAME
+ _ZN22CNSmlContactsDataStore18SetOwnStoreFormatLEv @ 55 NONAME
+ _ZN22CNSmlContactsDataStore19DoBeginTransactionLEv @ 56 NONAME
+ _ZN22CNSmlContactsDataStore19DoCommitChangeInfoLER14TRequestStatus @ 57 NONAME
+ _ZN22CNSmlContactsDataStore19DoCommitChangeInfoLER14TRequestStatusRK18MSmlDataItemUidSet @ 58 NONAME
+ _ZN22CNSmlContactsDataStore19DoRevertTransactionER14TRequestStatus @ 59 NONAME
+ _ZN22CNSmlContactsDataStore20ContactsSavingFailedER25MVPbkContactOperationBasei @ 60 NONAME
+ _ZN22CNSmlContactsDataStore20DoCommitTransactionLER14TRequestStatus @ 61 NONAME
+ _ZN22CNSmlContactsDataStore20DoDeleteAllContactsLEv @ 62 NONAME
+ _ZN22CNSmlContactsDataStore22ContactRemovedFromViewER20MVPbkContactViewBaseiRK16MVPbkContactLink @ 63 NONAME
+ _ZN22CNSmlContactsDataStore22ContactViewUnavailableER20MVPbkContactViewBase @ 64 NONAME
+ _ZN22CNSmlContactsDataStore23CNSmlContactsBufferItemD0Ev @ 65 NONAME
+ _ZN22CNSmlContactsDataStore23CNSmlContactsBufferItemD1Ev @ 66 NONAME
+ _ZN22CNSmlContactsDataStore23CNSmlContactsBufferItemD2Ev @ 67 NONAME
+ _ZN22CNSmlContactsDataStore23DoSetRemoteStoreFormatLERK19CSmlDataStoreFormat @ 68 NONAME
+ _ZN22CNSmlContactsDataStore24DoSetRemoteMaxObjectSizeEi @ 69 NONAME
+ _ZN22CNSmlContactsDataStore24DriveBelowCriticalLevelLEi @ 70 NONAME
+ _ZN22CNSmlContactsDataStore27GetStoreFormatResourceFileLEv @ 71 NONAME
+ _ZN22CNSmlContactsDataStore31SingleContactOperationCompleteLEP17MVPbkStoreContact @ 72 NONAME
+ _ZN22CNSmlContactsDataStore32VPbkSingleContactOperationFailedER25MVPbkContactOperationBasei @ 73 NONAME
+ _ZN22CNSmlContactsDataStore34VPbkSingleContactOperationCompleteER25MVPbkContactOperationBaseP17MVPbkStoreContact @ 74 NONAME
+ _ZN22CNSmlContactsDataStore4NewLEv @ 75 NONAME
+ _ZN22CNSmlContactsDataStore7DoOpenLERK7TDesC16R20MSmlSyncRelationshipR14TRequestStatus @ 76 NONAME
+ _ZN22CNSmlContactsDataStoreC1Ev @ 77 NONAME
+ _ZN22CNSmlContactsDataStoreC2Ev @ 78 NONAME
+ _ZN22CNSmlContactsDataStoreD0Ev @ 79 NONAME
+ _ZN22CNSmlContactsDataStoreD1Ev @ 80 NONAME
+ _ZN22CNSmlContactsDataStoreD2Ev @ 81 NONAME
+ _ZN25CNSmlContactsDataProvider10ConstructLEv @ 82 NONAME
+ _ZN25CNSmlContactsDataProvider14DoListStoresLCEv @ 83 NONAME
+ _ZN25CNSmlContactsDataProvider14DoStoreFormatLEv @ 84 NONAME
+ _ZN25CNSmlContactsDataProvider15DoDefaultStoreLEv @ 85 NONAME
+ _ZN25CNSmlContactsDataProvider18DoOnFrameworkEventE18TSmlFrameworkEventii @ 86 NONAME
+ _ZN25CNSmlContactsDataProvider20DoNewStoreInstanceLCEv @ 87 NONAME
+ _ZN25CNSmlContactsDataProvider21DoCheckServerFiltersLER13RPointerArrayI13CSyncMLFilterER23TSyncMLFilterChangeInfo @ 88 NONAME
+ _ZN25CNSmlContactsDataProvider25DoSupportedServerFiltersLEv @ 89 NONAME
+ _ZN25CNSmlContactsDataProvider27DoGenerateFieldFilterQueryLERK13RPointerArrayI13CSyncMLFilterER6TDes16RS0_I16CSmlDataPropertyER7TDesC16 @ 90 NONAME
+ _ZN25CNSmlContactsDataProvider29DoGenerateRecordFilterQueryLCERK13RPointerArrayI13CSyncMLFilterE22TSyncMLFilterMatchTypeR6TDes16R17TSyncMLFilterTypeR7TDesC16 @ 91 NONAME
+ _ZN25CNSmlContactsDataProvider30DoCheckSupportedServerFiltersLERK19CSmlDataStoreFormatR13RPointerArrayI13CSyncMLFilterER23TSyncMLFilterChangeInfo @ 92 NONAME
+ _ZN25CNSmlContactsDataProvider4NewLEv @ 93 NONAME
+ _ZN25CNSmlContactsDataProvider5NewLCEv @ 94 NONAME
+ _ZN25CNSmlContactsDataProviderC1Ev @ 95 NONAME
+ _ZN25CNSmlContactsDataProviderC2Ev @ 96 NONAME
+ _ZN25CNSmlContactsDataProviderD0Ev @ 97 NONAME
+ _ZN25CNSmlContactsDataProviderD1Ev @ 98 NONAME
+ _ZN25CNSmlContactsDataProviderD2Ev @ 99 NONAME
+ _ZNK22CNSmlContactsDataStore11DoStoreNameEv @ 100 NONAME
+ _ZNK22CNSmlContactsDataStore12DoAddedItemsEv @ 101 NONAME
+ _ZNK22CNSmlContactsDataStore12DoMovedItemsEv @ 102 NONAME
+ _ZNK22CNSmlContactsDataStore14DoDeletedItemsEv @ 103 NONAME
+ _ZNK22CNSmlContactsDataStore14StripPropertyLERP6HBufC8RK6TDesC8 @ 104 NONAME
+ _ZNK22CNSmlContactsDataStore14StripPropertyLERP8CBufBaseRK6TDesC8 @ 105 NONAME
+ _ZNK22CNSmlContactsDataStore15DoMaxObjectSizeEv @ 106 NONAME
+ _ZNK22CNSmlContactsDataStore15DoModifiedItemsEv @ 107 NONAME
+ _ZNK22CNSmlContactsDataStore16DoHasSyncHistoryEv @ 108 NONAME
+ _ZNK22CNSmlContactsDataStore17DefaultStoreNameLEv @ 109 NONAME
+ _ZNK22CNSmlContactsDataStore18DoSoftDeletedItemsEv @ 110 NONAME
+ _ZNK25CNSmlContactsDataProvider17CreateDataStoreLCEv @ 111 NONAME
+ _ZNK25CNSmlContactsDataProvider19DoSupportsOperationE4TUid @ 112 NONAME
+ _ZNK25CNSmlContactsDataProvider27GetStoreFormatResourceFileLEv @ 113 NONAME
+ _ZThn12_N22CNSmlContactsDataStore13ContactsSavedER25MVPbkContactOperationBaseP21MVPbkContactLinkArray @ 114 NONAME
+ _ZThn12_N22CNSmlContactsDataStore20ContactsSavingFailedER25MVPbkContactOperationBasei @ 115 NONAME
+ _ZThn12_N22CNSmlContactsDataStoreD0Ev @ 116 NONAME
+ _ZThn12_N22CNSmlContactsDataStoreD1Ev @ 117 NONAME
+ _ZThn16_N22CNSmlContactsDataStore10StepFailedER25MVPbkContactOperationBaseii @ 118 NONAME
+ _ZThn16_N22CNSmlContactsDataStore12StepCompleteER25MVPbkContactOperationBasei @ 119 NONAME
+ _ZThn16_N22CNSmlContactsDataStore17OperationCompleteER25MVPbkContactOperationBase @ 120 NONAME
+ _ZThn16_N22CNSmlContactsDataStoreD0Ev @ 121 NONAME
+ _ZThn16_N22CNSmlContactsDataStoreD1Ev @ 122 NONAME
+ _ZThn20_N22CNSmlContactsDataStore16ContactViewErrorER20MVPbkContactViewBaseii @ 123 NONAME
+ _ZThn20_N22CNSmlContactsDataStore16ContactViewReadyER20MVPbkContactViewBase @ 124 NONAME
+ _ZThn20_N22CNSmlContactsDataStore18ContactAddedToViewER20MVPbkContactViewBaseiRK16MVPbkContactLink @ 125 NONAME
+ _ZThn20_N22CNSmlContactsDataStore22ContactRemovedFromViewER20MVPbkContactViewBaseiRK16MVPbkContactLink @ 126 NONAME
+ _ZThn20_N22CNSmlContactsDataStore22ContactViewUnavailableER20MVPbkContactViewBase @ 127 NONAME
+ _ZThn20_N22CNSmlContactsDataStoreD0Ev @ 128 NONAME
+ _ZThn20_N22CNSmlContactsDataStoreD1Ev @ 129 NONAME
+ _ZThn24_N22CNSmlContactsDataStoreD0Ev @ 130 NONAME
+ _ZThn24_N22CNSmlContactsDataStoreD1Ev @ 131 NONAME
+ _ZThn4_N22CNSmlContactsDataStore10StoreReadyER17MVPbkContactStore @ 132 NONAME
+ _ZThn4_N22CNSmlContactsDataStore16StoreUnavailableER17MVPbkContactStorei @ 133 NONAME
+ _ZThn4_N22CNSmlContactsDataStore17HandleStoreEventLER17MVPbkContactStore22TVPbkContactStoreEvent @ 134 NONAME
+ _ZThn4_N22CNSmlContactsDataStoreD0Ev @ 135 NONAME
+ _ZThn4_N22CNSmlContactsDataStoreD1Ev @ 136 NONAME
+ _ZThn8_N22CNSmlContactsDataStore32VPbkSingleContactOperationFailedER25MVPbkContactOperationBasei @ 137 NONAME
+ _ZThn8_N22CNSmlContactsDataStore34VPbkSingleContactOperationCompleteER25MVPbkContactOperationBaseP17MVPbkStoreContact @ 138 NONAME
+ _ZThn8_N22CNSmlContactsDataStoreD0Ev @ 139 NONAME
+ _ZThn8_N22CNSmlContactsDataStoreD1Ev @ 140 NONAME
--- a/omads/omadsextensions/adapters/contacts/inc/NSmlContactsModsFetcher.h Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsextensions/adapters/contacts/inc/NSmlContactsModsFetcher.h Fri Mar 12 15:41:30 2010 +0200
@@ -25,7 +25,7 @@
#include <f32file.h>
#include <cntdb.h>
#include <cntitem.h>
-#include "nsmlchangefinder.h"
+#include <MContactsModsFetcher.h>
#include <CVPbkContactManager.h>
#include <MVPbkContactStore.h>
@@ -41,13 +41,15 @@
_LIT( KNSmlContactSyncNoSync, "none" ); // Taken from phonebook
// CLASS DECLARATION
+class CNSmlChangeFinder;
+class TNSmlSnapshotItem;
// ------------------------------------------------------------------------------------------------
// CNSmlContactsModsFetcher
//
// @lib nsmlcontactsdataprovider.lib
// ------------------------------------------------------------------------------------------------
-class CNSmlContactsModsFetcher : public CActive,
+class CNSmlContactsModsFetcher : public CActive, public MContactsModsFetcher,
MVPbkContactViewObserver,
MVPbkSingleContactOperationObserver,
MVPbkContactOperationBase
@@ -68,12 +70,6 @@
void ConstructL();
/**
- * Reads all modifications from clients contacts databse.
- * @param aStatus On completion of the operation, contains the result code.
- */
- void FetchModificationsL( TRequestStatus& aStatus );
-
- /**
* ~CNSmlContactsModsFetcher() desctructor.
*/
virtual ~CNSmlContactsModsFetcher();
@@ -170,7 +166,20 @@
* added to snapshot
*/
void UpdateSnapshotL( MVPbkStoreContact* aContact );
-
+
+ private: // from MContactsModsFetcher
+
+ /**
+ * Cancels the current asynchronous request
+ */
+ void CancelRequest( );
+
+ /**
+ * Reads all modifications from clients contacts databse.
+ * @param aStatus On completion of the operation, contains the result code.
+ */
+ void FetchModificationsL( TRequestStatus& aStatus );
+
private: // data
TRequestStatus* iCallerStatus;
TTime iFromTime;
--- a/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataProvider.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataProvider.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -34,10 +34,10 @@
#include <vtoken.h>
#include <e32property.h>
#include <DataSyncInternalPSKeys.h>
-#include "NSmlContactsDataProvider.h"
+#include <NSmlContactsDataProvider.h>
#include "nsmldebug.h"
#include "nsmlconstants.h"
-#include "NSmlDataModBase.h"
+#include <NSmlDataModBase.h>
#include "nsmldsimpluids.h"
#include "nsmlchangefinder.h"
@@ -47,7 +47,7 @@
// CNSmlContactsDataProvider::NewL
// -----------------------------------------------------------------------------
//
-CNSmlContactsDataProvider* CNSmlContactsDataProvider::NewL()
+EXPORT_C CNSmlContactsDataProvider* CNSmlContactsDataProvider::NewL()
{
_DBG_FILE("CNSmlContactsDataProvider::NewL(): begin");
CNSmlContactsDataProvider* self = NewLC();
@@ -60,7 +60,7 @@
// CNSmlContactsDataProvider::NewLC
// -----------------------------------------------------------------------------
//
-CNSmlContactsDataProvider* CNSmlContactsDataProvider::NewLC()
+EXPORT_C CNSmlContactsDataProvider* CNSmlContactsDataProvider::NewLC()
{
_DBG_FILE("CNSmlContactsDataProvider::NewLC(): begin");
@@ -75,7 +75,7 @@
// CNSmlContactsDataProvider::CNSmlContactsDataProvider
// -----------------------------------------------------------------------------
//
-CNSmlContactsDataProvider::CNSmlContactsDataProvider()
+EXPORT_C CNSmlContactsDataProvider::CNSmlContactsDataProvider()
{
_DBG_FILE("CNSmlContactsDataProvider::CNSmlContactsDataProvider(): begin");
_DBG_FILE("CNSmlContactsDataProvider::CNSmlContactsDataProvider(): end");
@@ -85,13 +85,14 @@
// CNSmlContactsDataProvider::ConstructL
// -----------------------------------------------------------------------------
//
-void CNSmlContactsDataProvider::ConstructL()
+EXPORT_C void CNSmlContactsDataProvider::ConstructL()
{
_DBG_FILE("CNSmlContactsDataProvider::ConstructL(): begin");
User::LeaveIfError( iRfs.Connect() );
- iContactsDataStore = CNSmlContactsDataStore::NewL();
+ iContactsDataStore = CreateDataStoreLC();
+ CleanupStack::Pop( iContactsDataStore );
iStringPool.OpenL();
@@ -102,7 +103,7 @@
// CNSmlContactsDataProvider::~CNSmlContactsDataProvider
// -----------------------------------------------------------------------------
//
-CNSmlContactsDataProvider::~CNSmlContactsDataProvider()
+EXPORT_C CNSmlContactsDataProvider::~CNSmlContactsDataProvider()
{
_DBG_FILE("CNSmlContactsDataProvider::~CNSmlContactsDataProvider(): begin");
@@ -122,7 +123,7 @@
// CNSmlContactsDataProvider::DoOnFrameworkEvent
// -----------------------------------------------------------------------------
//
-void CNSmlContactsDataProvider::DoOnFrameworkEvent( TSmlFrameworkEvent /*aFrameworkEvent*/, TInt /*aParam1*/, TInt /*aParam2*/ )
+EXPORT_C void CNSmlContactsDataProvider::DoOnFrameworkEvent( TSmlFrameworkEvent /*aFrameworkEvent*/, TInt /*aParam1*/, TInt /*aParam2*/ )
{
_DBG_FILE("CNSmlContactsDataProvider::DoOnFrameworkEvent(): begin");
_DBG_FILE("CNSmlContactsDataProvider::DoOnFrameworkEvent(): end");
@@ -132,7 +133,7 @@
// CNSmlContactsDataProvider::DoSupportsOperation
// -----------------------------------------------------------------------------
//
-TBool CNSmlContactsDataProvider::DoSupportsOperation( TUid aOpId ) const
+EXPORT_C TBool CNSmlContactsDataProvider::DoSupportsOperation( TUid aOpId ) const
{
_DBG_FILE("CNSmlContactsDataProvider::DoSupportsOperation(): begin");
@@ -151,7 +152,7 @@
// CNSmlContactsDataProvider::DoStoreFormatL
// -----------------------------------------------------------------------------
//
-const CSmlDataStoreFormat& CNSmlContactsDataProvider::DoStoreFormatL()
+EXPORT_C const CSmlDataStoreFormat& CNSmlContactsDataProvider::DoStoreFormatL()
{
_DBG_FILE("CNSmlContactsDataProvider::DoStoreFormatL(): begin");
@@ -167,22 +168,8 @@
TFileName resourceFileName;
resourceFileName.Copy( TParsePtrC( dllFileName ).Drive() );
- // Check correct Data Sync protocol
- TInt value( EDataSyncNotRunning );
- TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
- KDataSyncStatus,
- value );
- if ( error == KErrNone &&
- value == EDataSyncRunning )
- {
- resourceFileName.Append(KNSmlContactsStoreFormatRsc_1_1_2);
- parse.Set( resourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
- }
- else // error or protocol version 1.2
- {
- resourceFileName.Append(KNSmlContactsStoreFormatRsc_1_2);
- parse.Set( resourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
- }
+
+ parse.Set( GetStoreFormatResourceFileL(), &KDC_RESOURCE_FILES_DIR, NULL );
fileName = parse.FullName();
@@ -211,7 +198,7 @@
// CNSmlContactsDataProvider::DoListStoresLC
// -----------------------------------------------------------------------------
//
-CDesCArray* CNSmlContactsDataProvider::DoListStoresLC()
+EXPORT_C CDesCArray* CNSmlContactsDataProvider::DoListStoresLC()
{
_DBG_FILE("CNSmlContactsDataProvider::DoListStoresLC(): begin");
_DBG_FILE("CNSmlContactsDataProvider::DoListStoresLC(): end");
@@ -223,7 +210,7 @@
// CNSmlContactsDataProvider::DoDefaultStoreL
// -----------------------------------------------------------------------------
//
-const TDesC& CNSmlContactsDataProvider::DoDefaultStoreL()
+EXPORT_C const TDesC& CNSmlContactsDataProvider::DoDefaultStoreL()
{
_DBG_FILE("CNSmlContactsDataProvider::DoIdentifier(): begin");
_DBG_FILE("CNSmlContactsDataProvider::DoIdentifier(): end");
@@ -235,12 +222,11 @@
// CNSmlContactsDataProvider::DoNewStoreInstanceLC
// -----------------------------------------------------------------------------
//
-CSmlDataStore* CNSmlContactsDataProvider::DoNewStoreInstanceLC()
+EXPORT_C CSmlDataStore* CNSmlContactsDataProvider::DoNewStoreInstanceLC()
{
_DBG_FILE("CNSmlContactsDataProvider::DoNewStoreInstanceLC(): begin");
- CNSmlContactsDataStore* newDataStore = CNSmlContactsDataStore::NewL();
- CleanupStack::PushL( newDataStore );
+ CNSmlContactsDataStore* newDataStore = CreateDataStoreLC();
_DBG_FILE("CNSmlContactsDataProvider::DoNewStoreInstanceLC(): end");
@@ -251,7 +237,7 @@
// CNSmlContactsDataProvider::DoSupportedServerFiltersL
//
// ------------------------------------------------------------------------------------------------
-const RPointerArray<CSyncMLFilter>& 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");
@@ -263,7 +249,7 @@
// CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL
//
// ------------------------------------------------------------------------------------------------
-void CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL( const CSmlDataStoreFormat& /*aServerDataStoreFormat*/, RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
+EXPORT_C void CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL( const CSmlDataStoreFormat& /*aServerDataStoreFormat*/, RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
{
_DBG_FILE("CNSmlContactsDataProvider::DoCheckSupportedServerFiltersL(): BEGIN");
User::Leave( KErrNotSupported );
@@ -274,7 +260,7 @@
// CNSmlContactsDataProvider::CheckServerFiltersL
//
// ------------------------------------------------------------------------------------------------
-void CNSmlContactsDataProvider::DoCheckServerFiltersL( RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
+EXPORT_C void CNSmlContactsDataProvider::DoCheckServerFiltersL( RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterChangeInfo& /*aChangeInfo*/ )
{
_DBG_FILE("CNSmlContactsDataProvider::DoCheckServerFiltersL(): BEGIN");
User::Leave( KErrNotSupported );
@@ -285,7 +271,7 @@
// CNSmlContactsDataProvider::DoGenerateRecordFilterQueryLC
//
// ------------------------------------------------------------------------------------------------
-HBufC* CNSmlContactsDataProvider::DoGenerateRecordFilterQueryLC( const RPointerArray<CSyncMLFilter>& /*aFilters*/, TSyncMLFilterMatchType /*aMatch*/, TDes& /*aFilterMimeType*/, TSyncMLFilterType& /*aFilterType*/, TDesC& /*aStoreName*/ )
+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 );
@@ -297,13 +283,51 @@
// CNSmlContactsDataProvider::DoGenerateFieldFilterQueryL
//
// ------------------------------------------------------------------------------------------------
-void CNSmlContactsDataProvider::DoGenerateFieldFilterQueryL( const RPointerArray<CSyncMLFilter>& /*aFilters*/, TDes& /*aFilterMimeType*/, RPointerArray<CSmlDataProperty>& /*aProperties*/, TDesC& /*aStoreName*/ )
+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 )
+ {
+ return KNSmlContactsStoreFormatRsc_1_1_2;
+ }
+ else // error or protocol version 1.2
+ {
+ return KNSmlContactsStoreFormatRsc_1_2;
+ }
+ _DBG_FILE("CNSmlContactsDataProvider::GetStoreFormatResourceFileL(): END");
+ }
+
+// ------------------------------------------------------------------------------------------------
+// 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
// -----------------------------------------------------------------------------
--- a/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStore.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStore.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -53,11 +53,11 @@
#include <MVPbkContactLink.h>
#include <s32mem.h>
-#include "NSmlContactsDataStore.h"
+#include <NSmlContactsDataStore.h>
#include "NSmlContactsModsFetcher.h"
#include "nsmldebug.h"
#include "nsmlconstants.h"
-#include "NSmlDataModBase.h"
+#include <NSmlDataModBase.h>
#include "nsmlcontactsdefs.h"
#include "nsmldsimpluids.h"
#include "nsmlsnapshotitem.h"
@@ -75,7 +75,7 @@
// ----------------------------------------------------------------------------
// CNSmlContactsDataStore::CNSmlContactsBufferItem::~CNSmlContactsBufferItem
// ----------------------------------------------------------------------------
-CNSmlContactsDataStore::CNSmlContactsBufferItem::~CNSmlContactsBufferItem()
+EXPORT_C CNSmlContactsDataStore::CNSmlContactsBufferItem::~CNSmlContactsBufferItem()
{
delete iItemData;
delete iMimeType;
@@ -85,7 +85,7 @@
// ----------------------------------------------------------------------------
// CNSmlContactsDataStore::NewL
// ----------------------------------------------------------------------------
-CNSmlContactsDataStore* CNSmlContactsDataStore::NewL()
+EXPORT_C CNSmlContactsDataStore* CNSmlContactsDataStore::NewL()
{
_DBG_FILE("CNSmlContactsDataStore::NewL: BEGIN");
CNSmlContactsDataStore* self = new ( ELeave ) CNSmlContactsDataStore();
@@ -101,16 +101,16 @@
// ----------------------------------------------------------------------------
// CNSmlContactsDataStore::CNSmlContactsDataStore()
// ----------------------------------------------------------------------------
-CNSmlContactsDataStore::CNSmlContactsDataStore() :
+EXPORT_C CNSmlContactsDataStore::CNSmlContactsDataStore() :
iKey( TKeyArrayFix( _FOFF( TNSmlSnapshotItem,ItemId() ),ECmpTInt )),
iContactManager(NULL),
iStore(NULL),
- iVCardEngine(NULL),
iIdConverter(NULL),
- iContactLnks(NULL),
iContactViewBase(NULL),
iSize(NULL),
- iBuf(NULL)
+ iBuf(NULL),
+ iVCardEngine(NULL),
+ iContactLnks(NULL)
{
_DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): begin");
@@ -132,50 +132,61 @@
// ----------------------------------------------------------------------------
// CNSmlContactsDataStore::ConstructL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::ConstructL()
+EXPORT_C void CNSmlContactsDataStore::ConstructL()
{
- _DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): begin");
-
- User::LeaveIfError( iRfs.Connect() );
-
- iUsedMimeType.Set( KNSmlvCard21Name() );
- iUsedMimeVersion.Set( KNSmlvCard21Ver() );
- iStringPool.OpenL();
+ _DBG_FILE("CNSmlContactsDataStore::ConstructL(): begin");
- // 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();
-
- SetOwnStoreFormatL();
- // open contact database
- CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
- uriArray->AppendL( TVPbkContactStoreUriPtr(VPbkContactStoreUris::DefaultCntDbUri()));
-
- iContactManager = CVPbkContactManager::NewL(*uriArray);
- CleanupStack::PopAndDestroy(uriArray);
- //Default store name
- iDefaultStoreName = (VPbkContactStoreUris::DefaultCntDbUri()).AllocL();
-
- //Fill iPacketStoreName buffer with KLegacySymbianDatabase
- TBuf<KOldSymbianDBLength> dataBase(KLegacySymbianDatabase);
- iPacketStoreName = HBufC::NewL(dataBase.Length());
- TPtr pktStorePtr(iPacketStoreName->Des());
- pktStorePtr.Copy(dataBase);
+ ConstructL( ( VPbkContactStoreUris::DefaultCntDbUri() ), KLegacySymbianDatabase );
_DBG_FILE("CNSmlContactsDataStore::ConstructL(): end");
}
-
+
+// ----------------------------------------------------------------------------
+// CNSmlContactsDataStore::ConstructL()
+// ----------------------------------------------------------------------------
+EXPORT_C void CNSmlContactsDataStore::ConstructL(
+ const TDesC& aStoreName, const TDesC& aLegacyStore )
+ {
+ _DBG_FILE("CNSmlContactsDataStore::ConstructL(): begin");
+
+ 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();
+
+ SetOwnStoreFormatL();
+ // open contact database
+ CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
+ uriArray->AppendL( TVPbkContactStoreUriPtr( aStoreName ));
+
+ iContactManager = CVPbkContactManager::NewL(*uriArray);
+ CleanupStack::PopAndDestroy(uriArray);
+ //Default store name
+ iDefaultStoreName = aStoreName.AllocL();
+
+ //Fill iPacketStoreName buffer with legacy store name
+ TBuf<KOldSymbianDBLength> dataBase(aLegacyStore);
+ iPacketStoreName = HBufC::NewL(dataBase.Length());
+ TPtr pktStorePtr(iPacketStoreName->Des());
+ pktStorePtr.Copy(dataBase);
+
+ _DBG_FILE("CNSmlContactsDataStore::ConstructL(): end");
+ }
+
// ----------------------------------------------------------------------------
// CNSmlContactsDataStore::~CNSmlContactsDataStore()
// ----------------------------------------------------------------------------
-CNSmlContactsDataStore::~CNSmlContactsDataStore()
+EXPORT_C CNSmlContactsDataStore::~CNSmlContactsDataStore()
{
_DBG_FILE("CNSmlContactsDataStore::~CNSmlContactsDataStore(): begin");
@@ -208,7 +219,7 @@
delete iContactViewBase;
if ( iContactsModsFetcher )
{
- iContactsModsFetcher->Cancel();
+ iContactsModsFetcher->CancelRequest();
delete iContactsModsFetcher;
}
if ( iContactManager )
@@ -271,7 +282,7 @@
// MSmlSyncRelationship& aContext,
// TRequestStatus& aStatus)
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoOpenL( const TDesC& aStoreName,
+EXPORT_C void CNSmlContactsDataStore::DoOpenL( const TDesC& aStoreName,
MSmlSyncRelationship& aContext,
TRequestStatus& aStatus )
{
@@ -329,14 +340,12 @@
iIdConverter = CVPbkContactIdConverter::NewL(*iStore );
if ( iContactsModsFetcher )
{
- iContactsModsFetcher->Cancel();
+ iContactsModsFetcher->CancelRequest();
delete iContactsModsFetcher;
iContactsModsFetcher = NULL;
}
- iContactsModsFetcher = new (ELeave) CNSmlContactsModsFetcher(
- iSnapshotRegistered, *iContactManager,*iStore, iKey, *iChangeFinder );
- iContactsModsFetcher->ConstructL();
+ iContactsModsFetcher = CreateModsFetcherL();
#ifdef __NSML_MODULETEST__
CActiveScheduler::Start();
@@ -348,12 +357,12 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoCancelRequest()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoCancelRequest()
+EXPORT_C void CNSmlContactsDataStore::DoCancelRequest()
{
_DBG_FILE("CNSmlContactsDataStore::DoCancelRequest(): begin");
if(iContactsModsFetcher)
{
- iContactsModsFetcher->Cancel();
+ iContactsModsFetcher->CancelRequest();
}
_DBG_FILE("CNSmlContactsDataStore::DoCancelRequest(): NOT NEEDED end");
@@ -362,7 +371,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoStoreName()
// ----------------------------------------------------------------------------
-const TDesC& CNSmlContactsDataStore::DoStoreName() const
+EXPORT_C const TDesC& CNSmlContactsDataStore::DoStoreName() const
{
_DBG_FILE("CNSmlContactsDataStore::DoStoreName(): begin");
_DBG_FILE("CNSmlContactsDataStore::DoStoreName(): end");
@@ -372,7 +381,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DefaultStoreNameL()
// ----------------------------------------------------------------------------
-const TDesC& CNSmlContactsDataStore::DefaultStoreNameL() const
+EXPORT_C const TDesC& CNSmlContactsDataStore::DefaultStoreNameL() const
{
_DBG_FILE("CNSmlContactsDataStore::DefaultStoreNameL(): begin");
@@ -389,7 +398,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoBeginTransactionL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoBeginTransactionL()
+EXPORT_C void CNSmlContactsDataStore::DoBeginTransactionL()
{
_DBG_FILE("CNSmlContactsDataStore::DoBeginTransactionL(): begin");
User::Leave( KErrNotSupported );
@@ -399,7 +408,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoCommitTransactionL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoCommitTransactionL(TRequestStatus& aStatus)
+EXPORT_C void CNSmlContactsDataStore::DoCommitTransactionL(TRequestStatus& aStatus)
{
_DBG_FILE("CNSmlContactsDataStore::DoCommitTransactionL(): begin");
@@ -413,7 +422,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoRevertTransaction()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoRevertTransaction(TRequestStatus& aStatus)
+EXPORT_C void CNSmlContactsDataStore::DoRevertTransaction(TRequestStatus& aStatus)
{
_DBG_FILE("CNSmlContactsDataStore::DoRevertTransaction(): begin");
@@ -427,7 +436,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoBeginBatchL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoBeginBatchL()
+EXPORT_C void CNSmlContactsDataStore::DoBeginBatchL()
{
_DBG_FILE("CNSmlContactsDataStore::DoBeginBatchL(): begin");
@@ -439,7 +448,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoCommitBatchL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoCommitBatchL( RArray<TInt>& aResultArray, TRequestStatus& aStatus )
+EXPORT_C void CNSmlContactsDataStore::DoCommitBatchL( RArray<TInt>& aResultArray, TRequestStatus& aStatus )
{
_DBG_FILE("CNSmlContactsDataStore::DoCommitBatchL(): begin");
@@ -472,7 +481,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::ExecuteBufferL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::ExecuteBufferL()
+EXPORT_C void CNSmlContactsDataStore::ExecuteBufferL()
{
_DBG_FILE("CNSmlContactsDataStore::ExecuteBufferL(): begin");
@@ -492,7 +501,8 @@
{
retCommand = ExecuteAddL();
}
- else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemReplace )
+ else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemReplace ||
+ iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemFieldLevelReplace )
{
ExecuteUpdateL();
}
@@ -510,6 +520,7 @@
//
if( ( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemAdd ||
iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemReplace ||
+ iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemFieldLevelReplace ||
iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemDelete ||
iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemSoftDelete ) &&
iContactsBufferItemList[iIndex]->iStatus != KNSmlNoError )
@@ -533,7 +544,7 @@
// void CNSmlContactsDataStore::ExecuteAddL()
// ----------------------------------------------------------------------------
-TInt CNSmlContactsDataStore::ExecuteAddL()
+EXPORT_C TInt CNSmlContactsDataStore::ExecuteAddL()
{
TInt retCommand( KErrNone );
StripPropertyL( iItemDataAddBatch, KVersitTokenUID() ); // Remove UID's from data
@@ -576,7 +587,7 @@
// void CNSmlContactsDataStore::ExecuteDeleteL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore:: ExecuteDeleteL()
+EXPORT_C void CNSmlContactsDataStore:: ExecuteDeleteL()
{
if(iBatchMode)
@@ -629,7 +640,7 @@
// void CNSmlContactsDataStore::ExecuteUpdateL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::ExecuteUpdateL()
+EXPORT_C void CNSmlContactsDataStore::ExecuteUpdateL()
{
iUid = iContactsBufferItemList[iIndex]->iUid;
@@ -658,7 +669,7 @@
// void CNSmlContactsDataStore::ExecuteMoveL
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::ExecuteMoveL()
+EXPORT_C void CNSmlContactsDataStore::ExecuteMoveL()
{
// move command is not supported
if(!iBatchMode)
@@ -684,7 +695,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoCancelBatch()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoCancelBatch()
+EXPORT_C void CNSmlContactsDataStore::DoCancelBatch()
{
_DBG_FILE("CNSmlContactsDataStore::DoCancelBatch(): begin");
if( iBatchMode )
@@ -703,7 +714,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoSetRemoteStoreFormatL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoSetRemoteStoreFormatL( const CSmlDataStoreFormat& aServerDataStoreFormat )
+EXPORT_C void CNSmlContactsDataStore::DoSetRemoteStoreFormatL( const CSmlDataStoreFormat& aServerDataStoreFormat )
{
_DBG_FILE("CNSmlContactsDataStore::DoSetRemoteStoreFormatL(): begin");
@@ -747,7 +758,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::SetOwnStoreFormatL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::SetOwnStoreFormatL()
+EXPORT_C void CNSmlContactsDataStore::SetOwnStoreFormatL()
{
_DBG_FILE("CNSmlContactsDataStore::SetOwnStoreFormatL(): begin");
@@ -756,20 +767,7 @@
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( KNSmlContactsStoreFormatRsc_1_1_2, &KDC_RESOURCE_FILES_DIR, NULL );
- }
- else // error or protocol version 1.2
- {
- parse.Set( KNSmlContactsStoreFormatRsc_1_2, &KDC_RESOURCE_FILES_DIR, NULL );
- }
+ parse.Set( GetStoreFormatResourceFileL(), &KDC_RESOURCE_FILES_DIR, NULL );
fileName = parse.FullName();
@@ -791,7 +789,12 @@
}
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;
}
@@ -799,7 +802,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoSetRemoteMaxObjectSize()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoSetRemoteMaxObjectSize( TInt aServerMaxObjectSize )
+EXPORT_C void CNSmlContactsDataStore::DoSetRemoteMaxObjectSize( TInt aServerMaxObjectSize )
{
_DBG_FILE("CNSmlContactsDataStore::DoSetRemoteMaxObjectSize(): begin");
@@ -811,7 +814,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoMaxObjectSize()
// ----------------------------------------------------------------------------
-TInt CNSmlContactsDataStore::DoMaxObjectSize() const
+EXPORT_C TInt CNSmlContactsDataStore::DoMaxObjectSize() const
{
_DBG_FILE("CNSmlContactsDataStore::DoMaxObjectSize(): begin");
_DBG_FILE("CNSmlContactsDataStore::DoMaxObjectSize() 100 k: end");
@@ -821,7 +824,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoOpenItemL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoOpenItemL( TSmlDbItemUid aUid,
+EXPORT_C void CNSmlContactsDataStore::DoOpenItemL( TSmlDbItemUid aUid,
TBool& aFieldChange,
TInt& aSize,
TSmlDbItemUid& aParent,
@@ -868,7 +871,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoCreateItemL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoCreateItemL( TSmlDbItemUid& aUid,
+EXPORT_C void CNSmlContactsDataStore::DoCreateItemL( TSmlDbItemUid& aUid,
TInt aSize,
TSmlDbItemUid /*aParent*/,
const TDesC8& aMimeType,
@@ -913,7 +916,9 @@
// Check MimeType and MimeVersion
if( ( aMimeType.MatchF( KNSmlvCard21Name ) < 0 ) &&
- ( aMimeType.MatchF( KNSmlvCard30Name ) < 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");
@@ -949,7 +954,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoReplaceItemL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoReplaceItemL( TSmlDbItemUid aUid,
+EXPORT_C void CNSmlContactsDataStore::DoReplaceItemL( TSmlDbItemUid aUid,
TInt aSize,
TSmlDbItemUid /*aParent*/,
TBool aFieldChange,
@@ -964,7 +969,7 @@
iUid = aUid;
iItemSize = aSize;
- iModType = ENSmlCntItemReplace;
+ iModType = aFieldChange ? ENSmlCntItemFieldLevelReplace : ENSmlCntItemReplace;
if ( iItemPos == -1 || !iBatchMode )
{
@@ -975,18 +980,9 @@
{
iItemData->Reset();
}
-
- // Field change not supported
- if( aFieldChange )
- {
- err = KErrNotSupported;
- if( !iBatchMode )
- {
- User::RequestComplete( iCallerStatus, err );
- return;
- }
- }
-
+
+ iFieldLevelReplace = aFieldChange;
+
iItemData = AddBufferListL( aUid, aSize, err );
if( iBatchMode )
@@ -1009,7 +1005,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoReadItemL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoReadItemL( TDes8& aBuffer )
+EXPORT_C void CNSmlContactsDataStore::DoReadItemL( TDes8& aBuffer )
{
_DBG_FILE("CNSmlContactsDataStore::DoReadItemL(): begin");
@@ -1041,7 +1037,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoWriteItemL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoWriteItemL( const TDesC8& aData )
+EXPORT_C void CNSmlContactsDataStore::DoWriteItemL( const TDesC8& aData )
{
_DBG_FILE("CNSmlContactsDataStore::DoWriteItemL(): begin");
@@ -1099,7 +1095,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoCommitItemL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoCommitItemL( TRequestStatus& aStatus )
+EXPORT_C void CNSmlContactsDataStore::DoCommitItemL( TRequestStatus& aStatus )
{
iCallerStatus = &aStatus;
*iCallerStatus = KRequestPending;
@@ -1118,9 +1114,10 @@
}
}
else if ((iModType == ENSmlCntItemAdd || // If some write problems
- iModType == ENSmlCntItemReplace) &&
- iStateItem != KErrNone &&
- iContactsBufferItemList.Count() > 0)
+ iModType == ENSmlCntItemReplace ||
+ iModType == ENSmlCntItemFieldLevelReplace ) &&
+ iStateItem != KErrNone &&
+ iContactsBufferItemList.Count() > 0)
{
iContactsBufferItemList[iContactsBufferItemList.Count()-1]->iStatus = iStateItem;
}
@@ -1146,7 +1143,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoCloseItem()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoCloseItem()
+EXPORT_C void CNSmlContactsDataStore::DoCloseItem()
{
_DBG_FILE("CNSmlContactsDataStore::DoCloseItem(): begin");
@@ -1167,7 +1164,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoMoveItemL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoMoveItemL( TSmlDbItemUid aUid, TSmlDbItemUid /*aNewParent*/, TRequestStatus& aStatus )
+EXPORT_C void CNSmlContactsDataStore::DoMoveItemL( TSmlDbItemUid aUid, TSmlDbItemUid /*aNewParent*/, TRequestStatus& aStatus )
{
_DBG_FILE("CNSmlContactsDataStore::DoMoveItemL(): begin");
@@ -1190,7 +1187,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoDeleteItemL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus )
+EXPORT_C void CNSmlContactsDataStore::DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus )
{
_DBG_FILE("CNSmlContactsDataStore::DoDeleteItemL(): begin");
iCallerStatus = &aStatus;
@@ -1230,7 +1227,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoSoftDeleteItemL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoSoftDeleteItemL( TSmlDbItemUid /*aUid*/, TRequestStatus& aStatus )
+EXPORT_C void CNSmlContactsDataStore::DoSoftDeleteItemL( TSmlDbItemUid /*aUid*/, TRequestStatus& aStatus )
{
_DBG_FILE("CNSmlContactsDataStore::DoSoftDeleteItemL(): begin");
iCallerStatus = &aStatus;
@@ -1242,7 +1239,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoDeleteAllItemsL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoDeleteAllItemsL( TRequestStatus& aStatus )
+EXPORT_C void CNSmlContactsDataStore::DoDeleteAllItemsL( TRequestStatus& aStatus )
{
_DBG_FILE("CNSmlContactsDataStore::DoDeleteAllItemsL(): begin");
@@ -1263,7 +1260,7 @@
// ----------------------------------------------------------------------------
// TBool CNSmlContactsDataStore::DoHasSyncHistory()
// ----------------------------------------------------------------------------
-TBool CNSmlContactsDataStore::DoHasSyncHistory() const
+EXPORT_C TBool CNSmlContactsDataStore::DoHasSyncHistory() const
{
_DBG_FILE("CNSmlContactsDataStore::DoHasSyncHistory(): begin");
@@ -1299,7 +1296,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoAddedItems()
// ----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CNSmlContactsDataStore::DoAddedItems() const
+EXPORT_C const MSmlDataItemUidSet& CNSmlContactsDataStore::DoAddedItems() const
{
_DBG_FILE("CNSmlContactsDataStore::DoAddedItems(): begin");
if ( iState == ENSmlOpenAndWaiting )
@@ -1323,7 +1320,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoDeletedItems()
// ----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CNSmlContactsDataStore::DoDeletedItems() const
+EXPORT_C const MSmlDataItemUidSet& CNSmlContactsDataStore::DoDeletedItems() const
{
_DBG_FILE("CNSmlContactsDataStore::DoDeletedItems(): begin");
if ( iState == ENSmlOpenAndWaiting )
@@ -1347,7 +1344,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoSoftDeletedItems()
// ----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CNSmlContactsDataStore::DoSoftDeletedItems() const
+EXPORT_C const MSmlDataItemUidSet& CNSmlContactsDataStore::DoSoftDeletedItems() const
{
_DBG_FILE("CNSmlContactsDataStore::DoSoftDeletedItems(): begin");
if ( iState == ENSmlOpenAndWaiting )
@@ -1371,7 +1368,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoModifiedItems()
// ----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CNSmlContactsDataStore::DoModifiedItems() const
+EXPORT_C const MSmlDataItemUidSet& CNSmlContactsDataStore::DoModifiedItems() const
{
_DBG_FILE("CNSmlContactsDataStore::DoModifiedItems(): begin");
if ( iState == ENSmlOpenAndWaiting )
@@ -1395,7 +1392,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoMovedItems()
// ----------------------------------------------------------------------------
-const MSmlDataItemUidSet& CNSmlContactsDataStore::DoMovedItems() const
+EXPORT_C const MSmlDataItemUidSet& CNSmlContactsDataStore::DoMovedItems() const
{
_DBG_FILE("CNSmlContactsDataStore::DoMovedItems(): begin");
@@ -1420,7 +1417,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoResetChangeInfoL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
+EXPORT_C void CNSmlContactsDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
{
_DBG_FILE("CNSmlContactsDataStore::DoResetChangeInfoL(): begin");
iCallerStatus = &aStatus;
@@ -1451,7 +1448,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoCommitChangeInfoL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus,
+EXPORT_C void CNSmlContactsDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus,
const MSmlDataItemUidSet& aItems )
{
_DBG_FILE("CNSmlContactsDataStore::DoCommitChangeInfoL(aItems): begin");
@@ -1473,7 +1470,7 @@
// ----------------------------------------------------------------------------
// void CNSmlContactsDataStore::DoCommitChangeInfoL()
// ----------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus )
+EXPORT_C void CNSmlContactsDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus )
{
_DBG_FILE("CNSmlContactsDataStore::DoCommitChangeInfoL(): begin");
iCallerStatus = &aStatus;
@@ -1494,7 +1491,7 @@
// ----------------------------------------------------------------------------
// CDesCArray* CNSmlContactsDataStore::DoListStoresLC()
// ----------------------------------------------------------------------------
-CDesCArray* CNSmlContactsDataStore::DoListStoresLC()
+EXPORT_C CDesCArray* CNSmlContactsDataStore::DoListStoresLC()
{
_DBG_FILE("CNSmlContactsDataStore::DoListStoresLC(): begin");
@@ -1529,7 +1526,7 @@
// ------------------------------------------------------------------------------------------------
// TInt CNSmlContactsDataStore::LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem )
// ------------------------------------------------------------------------------------------------
-void CNSmlContactsDataStore::LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem )
+EXPORT_C void CNSmlContactsDataStore::LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem )
{
_DBG_FILE("CNSmlContactsDataStore::LdoFetchItemL(): begin");
@@ -1552,7 +1549,7 @@
// TTime& aLastModified,
// TBool& aConfidential )
// ------------------------------------------------------------------------------------------------
-void CNSmlContactsDataStore::LdoAddItemL( const TDesC8& aItem,
+EXPORT_C void CNSmlContactsDataStore::LdoAddItemL( const TDesC8& aItem,
TInt aSize)
{
_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): begin");
@@ -1584,7 +1581,7 @@
// TInt CNSmlContactsDataStore::LdoAddItemsL( CBufBase*& aItems,
// TInt aSize)
// ------------------------------------------------------------------------------------------------
-void CNSmlContactsDataStore::LdoAddItemsL( CBufBase*& aItems,
+EXPORT_C void CNSmlContactsDataStore::LdoAddItemsL( CBufBase*& aItems,
TInt aSize)
{
_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): begin");
@@ -1614,7 +1611,7 @@
// TInt aSize,
// TTime& aLastModified )
// ------------------------------------------------------------------------------------------------
-void CNSmlContactsDataStore::LdoUpdateItemL()
+EXPORT_C void CNSmlContactsDataStore::LdoUpdateItemL()
{
_DBG_FILE("CNSmlContactsDataStore::LdoUpdateItemL(): begin");
@@ -1623,8 +1620,8 @@
StripPropertyL( iBuf, KVersitTokenUID() );
iReadStream.Open( *iBuf );
- MVPbkContactLink* contactLink = iIdConverter->IdentifierToLinkLC(iUid);
- iVCardEngine->ImportVCardMergeL(*contactLink,*iStore,iReadStream,*this);
+ iContactLink = iIdConverter->IdentifierToLinkLC(iUid);
+ iVCardEngine->ImportVCardMergeL(*iContactLink, *iStore, iReadStream, *this);
CleanupStack::Pop();
iLastOperation = ENSMLUpdateImportOp;
@@ -1638,7 +1635,7 @@
// ------------------------------------------------------------------------------------------------
// CNSmlContactsDataStore::DriveBelowCriticalLevelL()
// ------------------------------------------------------------------------------------------------
-TBool CNSmlContactsDataStore::DriveBelowCriticalLevelL( TInt aSize )
+EXPORT_C TBool CNSmlContactsDataStore::DriveBelowCriticalLevelL( TInt aSize )
{
return SysUtil::DiskSpaceBelowCriticalLevelL( &iRfs, aSize, iDrive );
}
@@ -1646,7 +1643,7 @@
// ----------------------------------------------------------------------------
// CBufBase* CNSmlContactsDataStore::AddBufferListL()
// ----------------------------------------------------------------------------
-CBufBase* CNSmlContactsDataStore::AddBufferListL( TSmlDbItemUid& aUid, TInt aSize, TInt aStatus )
+EXPORT_C CBufBase* CNSmlContactsDataStore::AddBufferListL( TSmlDbItemUid& aUid, TInt aSize, TInt aStatus )
{
_DBG_FILE("CNSmlContactsDataStore::AddBufferListL(): begin");
@@ -1700,7 +1697,7 @@
// ------------------------------------------------------------------------------------------------
// void CNSmlContactsDataStore::StripPropertyL( HBufC8*& aItem, const TDesC8& aProperty )
// ------------------------------------------------------------------------------------------------
-void CNSmlContactsDataStore::StripPropertyL( HBufC8*& aItem, const TDesC8& aProperty ) const
+EXPORT_C void CNSmlContactsDataStore::StripPropertyL( HBufC8*& aItem, const TDesC8& aProperty ) const
{
_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): begin");
@@ -1733,7 +1730,7 @@
// ------------------------------------------------------------------------------------------------
// void CNSmlContactsDataStore::StripPropertyL( CBufBase*& aItem, const TDesC8& aProperty )
// ------------------------------------------------------------------------------------------------
-void CNSmlContactsDataStore::StripPropertyL( CBufBase*& aItem, const TDesC8& aProperty ) const
+EXPORT_C void CNSmlContactsDataStore::StripPropertyL( CBufBase*& aItem, const TDesC8& aProperty ) const
{
_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): begin");
@@ -1770,7 +1767,7 @@
// CNSmlContactsDataStore::IsConfidentialL
// ----------------------------------------------------------------------------
//
-TBool CNSmlContactsDataStore::IsConfidentialL( MVPbkStoreContact& aItem )
+EXPORT_C TBool CNSmlContactsDataStore::IsConfidentialL( MVPbkStoreContact& aItem )
{
_DBG_FILE("CNSmlContactsDataStore::IsConfidentialL(): begin");
TBool ret( EFalse );
@@ -1789,7 +1786,7 @@
//compare the sync type
if ( ptr.Compare( KNSmlContactSyncNoSync ) == 0 )
{
- _DBG_FILE("CNSmlContactsModsFetcher::IsConfidentialL(): \
+ _DBG_FILE("CNSmlContactsDataStore::IsConfidentialL(): \
find confidential");
ret = ETrue;
}
@@ -1805,7 +1802,7 @@
// CNSmlContactsDataStore::ResetBuffer
// ----------------------------------------------------------------------------
//
-void CNSmlContactsDataStore:: ResetBuffer()
+EXPORT_C void CNSmlContactsDataStore:: ResetBuffer()
{
if( iItemDataAddBatch )
{
@@ -1818,7 +1815,7 @@
// Called when a contact store is ready to use.
// -----------------------------------------------------------------------------
-void CNSmlContactsDataStore::StoreReady( MVPbkContactStore& /*aContactStore*/ )
+EXPORT_C void CNSmlContactsDataStore::StoreReady( MVPbkContactStore& /*aContactStore*/ )
{
_DBG_FILE("CNSmlContactsDataStore::StoreReady(): begin");
//The contact data base opened successfully
@@ -1827,7 +1824,7 @@
iOpenedStoreId = DefaultHash::Des16(
iStore->StoreProperties().Uri().UriDes());
- TRAPD(error,iContactsModsFetcher->FetchModificationsL( *iCallerStatus ));
+ TRAPD(error, iContactsModsFetcher->FetchModificationsL( *iCallerStatus ));
if(error != KErrNone)
{
User::RequestComplete( iCallerStatus, error );
@@ -1841,7 +1838,7 @@
// Called when a contact store becomes unavailable.
// ---------------------------------------------------------------------------
//
-void CNSmlContactsDataStore::StoreUnavailable(
+EXPORT_C void CNSmlContactsDataStore::StoreUnavailable(
MVPbkContactStore& /*aContactStore*/,
TInt aReason )
{
@@ -1862,7 +1859,7 @@
// From MVPbkContactStoreListObserver
// ---------------------------------------------------------------------------
//
-void CNSmlContactsDataStore::HandleStoreEventL(
+EXPORT_C void CNSmlContactsDataStore::HandleStoreEventL(
MVPbkContactStore& /*aContactStore*/,
TVPbkContactStoreEvent /*aStoreEvent*/ )
{
@@ -1873,8 +1870,7 @@
// CNSmlContactsDataStore::VPbkSingleContactOperationComplete
// ---------------------------------------------------------------------------
//
-
- void CNSmlContactsDataStore::VPbkSingleContactOperationComplete(
+EXPORT_C void CNSmlContactsDataStore::VPbkSingleContactOperationComplete(
MVPbkContactOperationBase& aOperation,
MVPbkStoreContact* aContact )
{
@@ -1896,18 +1892,19 @@
// CNSmlContactsDataStore::VPbkSingleContactOperationFailed
// ---------------------------------------------------------------------------
//
-void CNSmlContactsDataStore::VPbkSingleContactOperationFailed(
- MVPbkContactOperationBase& aOperation,
- TInt aError )
- {
+EXPORT_C void CNSmlContactsDataStore::VPbkSingleContactOperationFailed(
+ MVPbkContactOperationBase& aOperation,
+ TInt aError )
+ {
MVPbkContactOperationBase* operation = &aOperation;
if ( operation )
- {
+ {
delete operation;
operation = NULL;
- }
+ }
+
if(iLastOperation == ENSMLFetchOp)
- {
+ {
iWriteStream.Close();
User::RequestComplete( iCallerStatus, aError );
}
@@ -1924,6 +1921,8 @@
{
iResultArray->Append( aError );
}
+ delete iContactLink;
+ iContactLink = NULL;
delete iBuf;
iBuf = NULL;
iReadStream.Close();
@@ -1969,7 +1968,7 @@
// CNSmlContactsDataStore::VPbkSingleContactOperationFailed
// ---------------------------------------------------------------------------
//
- void CNSmlContactsDataStore::SingleContactOperationCompleteL(
+EXPORT_C void CNSmlContactsDataStore::SingleContactOperationCompleteL(
MVPbkStoreContact* aContact)
{
if(iLastOperation == ENSMLFetchOp)
@@ -1992,7 +1991,8 @@
}
else if (iLastOperation == ENSMLUpdateExportOp)
{
- iDataMod->MergeRxL( *iContactsBufferItemList[iIndex]->iItemData, *iMergeItem );
+ iDataMod->MergeRxL( *iContactsBufferItemList[iIndex]->iItemData,
+ *iMergeItem, iFieldLevelReplace );
iWriteStream.Close();
delete iMergeItem;
iMergeItem = NULL;
@@ -2000,6 +2000,8 @@
}
else if (iLastOperation == ENSMLUpdateImportOp)
{
+ iFieldLevelReplace = EFalse;
+
if(!IsConfidentialL(*aContact))
{
TInt32 id = iIdConverter->LinkToIdentifier(*aContact->CreateLinkLC());
@@ -2025,12 +2027,13 @@
iResultArray->Append(KErrNone);
}
+ delete iContactLink;
+ iContactLink = NULL;
delete iBuf;
iBuf = NULL;
iReadStream.Close();
-
iIndex++;
if(iIndex == iContactsBufferItemList.Count() )
{
@@ -2091,7 +2094,7 @@
// CNSmlContactsDataStore::ContactsSaved.
// ---------------------------------------------------------------------------
//
- void CNSmlContactsDataStore::ContactsSaved(
+EXPORT_C void CNSmlContactsDataStore::ContactsSaved(
MVPbkContactOperationBase& aOperation,
MVPbkContactLinkArray* aResults )
{
@@ -2155,7 +2158,7 @@
// CNSmlContactsDataStore::ContactsSavingFailed
// ---------------------------------------------------------------------------
//
-void CNSmlContactsDataStore::ContactsSavingFailed(
+EXPORT_C void CNSmlContactsDataStore::ContactsSavingFailed(
MVPbkContactOperationBase& aOperation, TInt aError )
{
MVPbkContactOperationBase* operation = &aOperation;
@@ -2204,7 +2207,7 @@
// CNSmlContactsDataStore::StepComplete
// ---------------------------------------------------------------------------
//
-void CNSmlContactsDataStore::StepComplete(
+EXPORT_C void CNSmlContactsDataStore::StepComplete(
MVPbkContactOperationBase& /*aOperation*/,
TInt aStepSize )
{
@@ -2244,7 +2247,7 @@
// CNSmlContactsDataStore::StepFailed
// ---------------------------------------------------------------------------
//
- TBool CNSmlContactsDataStore::StepFailed(
+EXPORT_C TBool CNSmlContactsDataStore::StepFailed(
MVPbkContactOperationBase& /*aOperation*/,
TInt /*aStepSize*/,
TInt aError )
@@ -2272,7 +2275,7 @@
// CNSmlContactsDataStore::OperationComplete
// ---------------------------------------------------------------------------
//
-void CNSmlContactsDataStore::OperationComplete
+EXPORT_C void CNSmlContactsDataStore::OperationComplete
( MVPbkContactOperationBase& aOperation )
{
MVPbkContactOperationBase* operation = &aOperation;
@@ -2293,8 +2296,7 @@
// CNSmlContactsDataStore::OperationCompleteL
// ---------------------------------------------------------------------------
//
-
-void CNSmlContactsDataStore::OperationCompleteL()
+EXPORT_C void CNSmlContactsDataStore::OperationCompleteL()
{
if(iLastOperation == ENSmlDeleteOp)
{
@@ -2361,7 +2363,7 @@
// CNSmlContactsDataStore::ContactViewReady
// Implements the view ready function of MVPbkContactViewObserver
// ---------------------------------------------------------------------------
-void CNSmlContactsDataStore::ContactViewReady(
+EXPORT_C void CNSmlContactsDataStore::ContactViewReady(
MVPbkContactViewBase& /*aView*/ )
{
if(iLastOperation == ENSMLDeleteAllOp)
@@ -2377,7 +2379,7 @@
// CNSmlContactsDataStore::PrepareForContactsDeleteL()
// Delete all the contacts at client
// ---------------------------------------------------------------------------
-void CNSmlContactsDataStore::DoDeleteAllContactsL()
+EXPORT_C void CNSmlContactsDataStore::DoDeleteAllContactsL()
{
iContactLnks = CVPbkContactLinkArray::NewL();
TInt contactCount = iContactViewBase->ContactCountL();
@@ -2399,7 +2401,7 @@
// CNSmlContactsDataStore::ContactViewUnavailable
// Implements the view unavailable function of MVPbkContactViewObserver
// ---------------------------------------------------------------------------
-void CNSmlContactsDataStore::ContactViewUnavailable(
+EXPORT_C void CNSmlContactsDataStore::ContactViewUnavailable(
MVPbkContactViewBase& /*aView*/ )
{
@@ -2409,7 +2411,7 @@
// CNSmlContactsDataStore::ContactAddedToView
// Implements the add contact function of MVPbkContactViewObserver
// ---------------------------------------------------------------------------
-void CNSmlContactsDataStore::ContactAddedToView(
+EXPORT_C void CNSmlContactsDataStore::ContactAddedToView(
MVPbkContactViewBase& /*aView*/,
TInt /*aIndex*/,
const MVPbkContactLink& /*aContactLink*/ )
@@ -2420,7 +2422,7 @@
// CNSmlContactsDataStore::ContactRemovedFromView
// Implements the remove contact function of MVPbkContactViewObserver
// ---------------------------------------------------------------------------
-void CNSmlContactsDataStore::ContactRemovedFromView(
+EXPORT_C void CNSmlContactsDataStore::ContactRemovedFromView(
MVPbkContactViewBase& /*aView*/,
TInt /*aIndex*/,
const MVPbkContactLink& /*aContactLink*/ )
@@ -2431,7 +2433,7 @@
// CNSmlContactsDataStore::ContactViewError
// Implements the view error function of MVPbkContactViewObserver
// ---------------------------------------------------------------------------
-void CNSmlContactsDataStore::ContactViewError(
+EXPORT_C void CNSmlContactsDataStore::ContactViewError(
MVPbkContactViewBase& /*aView*/,
TInt /*aError*/,
TBool /*aErrorNotified*/ )
@@ -2443,8 +2445,7 @@
// CNSmlContactsDataStore::CreateViewL()
// Create a contact view
// -----------------------------------------------------------------------------
-
-void CNSmlContactsDataStore::CreateViewL()
+EXPORT_C void CNSmlContactsDataStore::CreateViewL()
{
CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
@@ -2459,7 +2460,54 @@
iContactManager->FieldTypes() );
CleanupStack::Pop();
CleanupStack::PopAndDestroy(viewDef);
-
}
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataStore::GetStoreFormatResourceFileL
+// ------------------------------------------------------------------------------------------------
+EXPORT_C const TDesC& CNSmlContactsDataStore::GetStoreFormatResourceFileL()
+ {
+ _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 )
+ {
+ return KNSmlContactsStoreFormatRsc_1_1_2;
+ }
+ else // error or protocol version 1.2
+ {
+ return KNSmlContactsStoreFormatRsc_1_2;
+ }
+ _DBG_FILE("CNSmlContactsDataStore::GetStoreFormatResourceFileL(): end");
+ }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataStore::CreateModsFetcherL
+// ------------------------------------------------------------------------------------------------
+EXPORT_C MContactsModsFetcher* CNSmlContactsDataStore::CreateModsFetcherL()
+ {
+ _DBG_FILE("CNSmlContactsDataStore::CreateModsFetcherL(): begin");
+ CNSmlContactsModsFetcher* modsFetcher =
+ new ( ELeave ) CNSmlContactsModsFetcher( iSnapshotRegistered,
+ *iContactManager,*iStore, iKey, *iChangeFinder );
+ CleanupStack::PushL( modsFetcher );
+ modsFetcher->ConstructL();
+ CleanupStack::Pop( modsFetcher );
+ _DBG_FILE("CNSmlContactsDataStore::CreateModsFetcherL(): end");
+ return modsFetcher;
+ }
+
+// ------------------------------------------------------------------------------------------------
+// CNSmlContactsDataStore::GetDataMod
+// ------------------------------------------------------------------------------------------------
+EXPORT_C CNSmlDataModBase& CNSmlContactsDataStore::GetDataMod()
+ {
+ _DBG_FILE("CNSmlContactsDataStore::GetDataMod()");
+ return *iDataMod;
+ }
+
// End of File
--- a/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStoreFormat_1_2.rss Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStoreFormat_1_2.rss Fri Mar 12 15:41:30 2010 +0200
@@ -135,7 +135,7 @@
display_name="Type";
name="TYPE";
data_type="";
- enum_values={"HOME", "WORK", "CELL", "PAGER", "FAX", "VIDEO", "PREF", "CAR"};
+ enum_values={"HOME", "WORK", "VOICE", "CELL", "PAGER", "FAX", "VIDEO", "PREF", "CAR"};
}
};
},
--- a/omads/omadsextensions/adapters/contacts/src/NSmlContactsModsFetcher.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsModsFetcher.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -79,7 +79,15 @@
_DBG_FILE("CNSmlContactsModsFetcher::~CNSmlContactsModsFetcher(): end");
}
-
+
+// ----------------------------------------------------------------------------
+// CNSmlContactsModsFetcher::CancelRequest
+// ----------------------------------------------------------------------------
+void CNSmlContactsModsFetcher::CancelRequest()
+ {
+ Cancel();
+ }
+
// ------------------------------------------------------------------------------------------------
// CNSmlContactsModsFetcher::FetchModificationsL
// ------------------------------------------------------------------------------------------------
--- a/omads/omadsextensions/datamod/src/NSmlProperty.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsextensions/datamod/src/NSmlProperty.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -18,7 +18,7 @@
// INCLUDES
-#include "NSmlDataModBase.h"
+#include <NSmlDataModBase.h>
// ============================ MEMBER FUNCTIONS ===============================
--- a/omads/omadsextensions/datamod/src/NSmlVCalMod.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsextensions/datamod/src/NSmlVCalMod.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -18,7 +18,7 @@
// INCLUDES
-#include "NSmlDataModBase.h"
+#include <NSmlDataModBase.h>
#include <vcal.h>
// ============================ MEMBER FUNCTIONS ===============================
--- a/omads/omadsextensions/datamod/src/NSmlVCardMod.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsextensions/datamod/src/NSmlVCardMod.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -18,7 +18,7 @@
// INCLUDES
-#include "NSmlDataModBase.h"
+#include <NSmlDataModBase.h>
#include <vcard.h>
// ============================ MEMBER FUNCTIONS ===============================
--- a/omads/omadsextensions/datamod/src/nsmldatamodbase.cpp Fri Feb 19 22:40:37 2010 +0200
+++ b/omads/omadsextensions/datamod/src/nsmldatamodbase.cpp Fri Mar 12 15:41:30 2010 +0200
@@ -17,7 +17,7 @@
// INCLUDES
-#include "NSmlDataModBase.h"
+#include <NSmlDataModBase.h>
#include "nsmldebug.h"
#include "nsmlconstants.h"
@@ -458,7 +458,6 @@
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 );
- TBuf8<30> name = ownProperty.Name();
CParserPropertyValue* ownValue = ownProperty.Value();
TBool removeMe( ETrue );
@@ -676,10 +675,10 @@
// it was still sent to us.
StripAllNotOnPartnerListL( aNewEntity, aModified );
- // Remove all properties from old item that are supported by remote server.
- // If it is field level then old this is not done.
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 )
@@ -694,9 +693,65 @@
CleanupStack::PopAndDestroy(); // mergeProps
}
}
- else
- {
- User::Leave( KErrNotSupported );
+ 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__