# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1270059247 -10800 # Node ID 4d5e9526124eee3ef8e61dbd2762f52c0721d6d7 # Parent 3f1ffafb31ec9a62d8b925f118d03fa234560c6c Revision: 201011 Kit: 201013 diff -r 3f1ffafb31ec -r 4d5e9526124e omads/omadsappui/AiwSyncProvider/group/ABLD.BAT --- a/omads/omadsappui/AiwSyncProvider/group/ABLD.BAT Mon Mar 15 12:39:28 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -rem -rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -rem All rights reserved. -rem This component and the accompanying materials are made available -rem under the terms of the License "Eclipse Public License v1.0" -rem which accompanies this distribution, and is available -rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -rem -rem Initial Contributors: -rem Nokia Corporation - initial contribution. -rem -rem Contributors: -rem -rem Description: -rem - -@ECHO OFF - -REM Bldmake-generated batch file - ABLD.BAT -REM ** DO NOT EDIT ** - -perl -S ABLD.PL "\s60\app\contentcontrol\omads\OmaDsAppUi\AiwSyncProvider\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 -if errorlevel==1 goto CheckPerl -goto End - -:CheckPerl -perl -v >NUL -if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? -goto End - -:End diff -r 3f1ffafb31ec -r 4d5e9526124e omads/omadsappui/AspPreSyncPlugin/group/ABLD.BAT --- a/omads/omadsappui/AspPreSyncPlugin/group/ABLD.BAT Mon Mar 15 12:39:28 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -rem -rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -rem All rights reserved. -rem This component and the accompanying materials are made available -rem under the terms of the License "Eclipse Public License v1.0" -rem which accompanies this distribution, and is available -rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -rem -rem Initial Contributors: -rem Nokia Corporation - initial contribution. -rem -rem Contributors: -rem -rem Description: -rem - -@ECHO OFF - -REM Bldmake-generated batch file - ABLD.BAT -REM ** DO NOT EDIT ** - -perl -S ABLD.PL "\s60\app\contentcontrol\omads\OmaDsAppUi\AspPreSyncPlugin\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 -if errorlevel==1 goto CheckPerl -goto End - -:CheckPerl -perl -v >NUL -if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? -goto End - -:End diff -r 3f1ffafb31ec -r 4d5e9526124e omads/omadsappui/AspSyncUtil/group/ABLD.BAT --- a/omads/omadsappui/AspSyncUtil/group/ABLD.BAT Mon Mar 15 12:39:28 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -rem -rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -rem All rights reserved. -rem This component and the accompanying materials are made available -rem under the terms of the License "Eclipse Public License v1.0" -rem which accompanies this distribution, and is available -rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -rem -rem Initial Contributors: -rem Nokia Corporation - initial contribution. -rem -rem Contributors: -rem -rem Description: -rem - -@ECHO OFF - -REM Bldmake-generated batch file - ABLD.BAT -REM ** DO NOT EDIT ** - -perl -S ABLD.PL "\s60\app\contentcontrol\omads\OmaDsAppUi\AspSyncUtil\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 -if errorlevel==1 goto CheckPerl -goto End - -:CheckPerl -perl -v >NUL -if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? -goto End - -:End diff -r 3f1ffafb31ec -r 4d5e9526124e omads/omadsappui/group/ABLD.BAT --- a/omads/omadsappui/group/ABLD.BAT Mon Mar 15 12:39:28 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -rem -rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -rem All rights reserved. -rem This component and the accompanying materials are made available -rem under the terms of the License "Eclipse Public License v1.0" -rem which accompanies this distribution, and is available -rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -rem -rem Initial Contributors: -rem Nokia Corporation - initial contribution. -rem -rem Contributors: -rem -rem Description: -rem - -@ECHO OFF - -REM Bldmake-generated batch file - ABLD.BAT -REM ** DO NOT EDIT ** - -perl -S ABLD.PL "\s60\app\contentcontrol\omads\OmaDsAppUi\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 -if errorlevel==1 goto CheckPerl -goto End - -:CheckPerl -perl -v >NUL -if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? -goto End - -:End diff -r 3f1ffafb31ec -r 4d5e9526124e omads/omadsappui/ui/group/ABLD.BAT --- a/omads/omadsappui/ui/group/ABLD.BAT Mon Mar 15 12:39:28 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -rem -rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -rem All rights reserved. -rem This component and the accompanying materials are made available -rem under the terms of the License "Eclipse Public License v1.0" -rem which accompanies this distribution, and is available -rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -rem -rem Initial Contributors: -rem Nokia Corporation - initial contribution. -rem -rem Contributors: -rem -rem Description: -rem - -@ECHO OFF - -REM Bldmake-generated batch file - ABLD.BAT -REM ** DO NOT EDIT ** - -perl -S ABLD.PL "\s60\app\contentcontrol\omads\OmaDsAppUi\ui\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 -if errorlevel==1 goto CheckPerl -goto End - -:CheckPerl -perl -v >NUL -if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? -goto End - -:End diff -r 3f1ffafb31ec -r 4d5e9526124e omads/omadsextensions/adapters/contacts/inc/NSmlContactsDataProvider.h --- a/omads/omadsextensions/adapters/contacts/inc/NSmlContactsDataProvider.h Mon Mar 15 12:39:28 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: DS contacts dataprovider. -* -*/ - - -#ifndef __NSMLCONTACTSDATAPROVIDER_H__ -#define __NSMLCONTACTSDATAPROVIDER_H__ - -// INCLUDES -#include -#include -#include "NSmlContactsDataStore.h" - -// CLASS DECLARATION - -// ------------------------------------------------------------------------------------------------ -// CNSmlContactsDataProvider -// -// @lib nsmlcontactsdataprovider.lib -// ------------------------------------------------------------------------------------------------ -class CNSmlContactsDataProvider : public CSmlDataProvider - { - public: - /** - * Two-phased constructor. - */ - static CNSmlContactsDataProvider* NewL(); - - /** - * Destructor. - */ - virtual ~CNSmlContactsDataProvider(); - - private: - /** - * Two-phased constructor. - */ - static CNSmlContactsDataProvider* NewLC(); - - /** - * This method handles framework events. - * @param Frameworks event. - * @param aParam1 First parameter. - * @param aParam2 Second parameter. - */ - void DoOnFrameworkEvent(TSmlFrameworkEvent, TInt aParam1, TInt aParam2); - - /** - * Check if operation is supported by dataprovider. - * @param aOpId Operations type. - * @return ETrue if the operation is supported. - */ - TBool DoSupportsOperation(TUid aOpId) const; - - /** - * Gets dataproviders own StoreFormat. - */ - const CSmlDataStoreFormat& DoStoreFormatL(); - - /** - * Lists all contacts databases on client. - * @return List of contact databases. - */ - CDesCArray* DoListStoresLC(); - - /** - * Gets default storename on client. - * @return Default storename. - */ - const TDesC& DoDefaultStoreL(); - - /** - * Constructs new instance of datastore. - * @return Newly created instance. - */ - CSmlDataStore* DoNewStoreInstanceLC(); - - /** - This method returns the set of filters that can be used to send to the SyncML server. - * @return New filters. - */ - const RPointerArray& DoSupportedServerFiltersL(); - - /** - This method checks what filters are supported by server. - @param aServerDataStoreFormat The store format of server - @param aFilters The array that includes filters - @param aChangeInfo The change information about changes that data provider did - */ - void DoCheckSupportedServerFiltersL(const CSmlDataStoreFormat& aServerDataStoreFormat, RPointerArray& aFilters, TSyncMLFilterChangeInfo& aChangeInfo); - - /** - This method updates dynamic filters up-to-date. - @param aFilters The array that includes filters - @param aChangeInfo The change information about changes that data provider did - */ - void DoCheckServerFiltersL(RPointerArray& aFilters, TSyncMLFilterChangeInfo& aChangeInfo); - - /** - This method generates a record filter query to be sent to the SyncML server for the provided filters. - @param aFilters The filters to be used for the query generation - @param aMatch The filter match type to be used - @param aFilterMimeType The mime type of the returned filter query - @param TSyncMLFilterType The filter type of the returned filter query - @param aStoreName The name of used store - @return The record filter query to be sent to the SyncML server - empty if no record filter involved - for this specific filter - */ - HBufC* DoGenerateRecordFilterQueryLC(const RPointerArray& aFilters, TSyncMLFilterMatchType aMatch, TDes& aFilterMimeType, TSyncMLFilterType& aFilterType, TDesC& aStoreName); - - /** - This method generates a field filter query to be sent to the SyncML server for the provided filters. - @param aFilters The filters to be used for the query generation - @param aFilterMimeType The mime type of the returned filter query - @param aProperties The field filter query to be sent to the SyncML server - empty if no field filter involved - for this specific filter - @param aStoreName The name of used store - */ - void DoGenerateFieldFilterQueryL(const RPointerArray& aFilters, TDes& aFilterMimeType, RPointerArray& aProperties, TDesC& aStoreName); - - /** - * C++ constructor. - */ - CNSmlContactsDataProvider(); - - /** - * 2nd phase constructor. - */ - void ConstructL(); - - private: // data - CNSmlContactsDataStore* iContactsDataStore; - RPointerArray iFilterArray; - RFs iRfs; - RStringPool iStringPool; - CSmlDataStoreFormat* iStoreFormat; - }; - -#endif // __NSMLCONTACTSDATAPROVIDER_H__ - -// End of File diff -r 3f1ffafb31ec -r 4d5e9526124e omads/omadsextensions/adapters/contacts/inc/NSmlContactsDataStore.h --- a/omads/omadsextensions/adapters/contacts/inc/NSmlContactsDataStore.h Mon Mar 15 12:39:28 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,753 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: DS contacts datastore. -* -*/ - - -#ifndef __NSMLCONTACTSDATASTORE_H__ -#define __NSMLCONTACTSDATASTORE_H__ - -// INCLUDE FILES -#include -#include -#include - -//vpbk headers -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "nsmlchangefinder.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 CNSmlContactsModsFetcher; -class CNSmlDataModBase; - - -// CLASS DECLARATION - -// ------------------------------------------------------------------------------------------------ -// CNSmlContactsDataStore -// -// @lib nsmlcontactsdataprovider.lib -// ------------------------------------------------------------------------------------------------ -class CNSmlContactsDataStore : public CSmlDataStore, - MVPbkContactStoreObserver, - MVPbkSingleContactOperationObserver, - MVPbkContactCopyObserver, - MVPbkBatchOperationObserver, - MVPbkContactViewObserver, - MVPbkContactOperationBase - { - public: - /** - * Two-phased constructor. - */ - static CNSmlContactsDataStore* NewL(); - - /** - * Destructor. - */ - virtual ~CNSmlContactsDataStore(); - - /** - * Default store name of client. - * @return Default store name. - */ - const TDesC& DefaultStoreNameL() const; - - /** - * Gets a list of all contacts databases on client. - * @return List of databases. - */ - CDesCArray* DoListStoresLC(); - - - private: - /** - * From MVPbkContactStoreListObserver - * Called when a contact store is ready to use. - */ - void StoreReady( MVPbkContactStore& aContactStore ); - - /** - * From MVPbkContactStoreListObserver - * Called when a contact store becomes unavailable. - */ - void StoreUnavailable(MVPbkContactStore& aContactStore,TInt aReason ); - - /** - * From MVPbkContactStoreListObserver - * Called when changes occur in the contact store. - */ - void HandleStoreEventL(MVPbkContactStore& aContactStore,TVPbkContactStoreEvent aStoreEvent ); - - /** - * From MVPbkSingleContactOperationObserver - * Called when the operation is completed. - */ - void VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& aOperation, - MVPbkStoreContact* aContact ); - - /** - * From MVPbkSingleContactOperationObserver - * Called if the operation fails. - */ - void VPbkSingleContactOperationFailed(MVPbkContactOperationBase& aOperation, TInt aError ); - - /** - * From MVPbkContactCopyObserver - * Called when the contact has been successfully commited or - * copied. Caller takes the ownership of results. - */ - void ContactsSaved( MVPbkContactOperationBase& aOperation, - MVPbkContactLinkArray* aResults ) ; - - /** - * From MVPbkContactCopyObserver - *Called when there was en error while saving contact(s). - */ - 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 - */ - 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 - */ - TBool StepFailed( - MVPbkContactOperationBase& aOperation, - TInt aStepSize, - TInt aError ); - - /** - * Called when operation is completed - * @param aOperation the completed operation - */ - void OperationComplete( MVPbkContactOperationBase& aOperation ); - - /** - * From MVPbkContactViewObserver - * Called when a view is ready for use. - */ - - void ContactViewReady( - MVPbkContactViewBase& aView ) ; - /** - * From MVPbkContactViewObserver - * Called when a view is unavailable for a while. - */ - void ContactViewUnavailable( - MVPbkContactViewBase& aView ) ; - /** - * From MVPbkContactViewObserver - * Called when a contact has been added to the view. - */ - void ContactAddedToView( - MVPbkContactViewBase& aView, - TInt aIndex, - const MVPbkContactLink& aContactLink ); - /** - * From MVPbkContactViewObserver - * Called when a contact has been removed from a view. - */ - void ContactRemovedFromView( - MVPbkContactViewBase& aView, - TInt aIndex, - const MVPbkContactLink& aContactLink ) ; - /** - * From MVPbkContactViewObserver - * Called when an error occurs in the view. - */ - void ContactViewError( - MVPbkContactViewBase& aView, - TInt aError, - TBool aErrorNotified ) ; - - private: - /** - * 2nd phase constructor. - */ - void ConstructL(); - - /** - * DoOpenL() opens the data store specified by aStoreName asynchronously. - * @param aStoreName The name of the data store to open. - * @param aContext Identifies the specific synchronisation relationship to use for the synchronisation. - * @param aStatus On completion of the open, contains the result code. - */ - void DoOpenL(const TDesC& aStoreName, MSmlSyncRelationship& aContext, TRequestStatus& aStatus); - - /** - * DoCancelRequest() cancels the current asynchronous request, including open. Only one asynchronous request may be outstanding at any one time. - */ - void DoCancelRequest(); - - /** - * DoStoreName() returns the name of the open data store. - * @return The name of the currently opened data store. - */ - const TDesC& DoStoreName() const; - - /** - * DoBeginTransactionL() starts the transaction mode. During this mode calls to CreateItemL, ReplaceItemL, - * WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this transaction. - * Their RequestStatus must be completed, even if the change is not yet really executed in the Data Store. - * If a RequestStatus is completed with an error code, the transaction has failed and a rollback must be - * done. In this case RevertTransaction will be called. - */ - void DoBeginTransactionL(); - - /** - * DoCommitTransactionL() will be called at the end of a successful transaction. At this point in time the - * operations within the transaction are applied to the Data Store in an atomic way. If all operations - * succeed, the RequestStatus must be completed with KErrNone. If an operation fails, a rollback must be - * done and the RequestStatus must be completed with an appropriate error code. - */ - void DoCommitTransactionL(TRequestStatus& aStatus); - - /** - * DoRevertTransaction() will be called to abort an ongoing transaction. None of the operations already - * submitted may be applied to the Data Store. The RequestStatus must be completed with KErrNone as a revert - * cannot fail. - */ - void DoRevertTransaction(TRequestStatus& aStatus); - - /** - * DoBeginBatchL() starts the batch mode. During this mode calls to CreateItemL, ReplaceItemL, - * WriteItemL, CommitItemL, MoveItemL, DeleteItemL and SoftDeleteItemL will be part of this batch. - * Their RequestStatus must be completed with KErrNone, which only signals acceptance of the operation - * for batch processing. - */ - void DoBeginBatchL(); - - /** - * DoCommitBatchL() will be called at the end of the batch mode. This tells the Data Store to - * process the batched operations (in the order they were submitted), and to append the error code - * for each operation to aResultArray. - * The error codes in aResultArray are only valid if the RequestStatus is completed with KErrNone. - * If the RequestStatus is completed with an error code none of the operations in the batch mode - * were applied to the Data Store. - */ - void DoCommitBatchL(RArray& aResultArray, TRequestStatus& aStatus); - - /** - * DoCancelBatch() will be called to abort an ongoing batch mode. None of the operations already - * submitted may be applied to the Data Store. - */ - void DoCancelBatch(); - - /** - * DoSetRemoteStoreFormatL() sets the SyncML server Data Format - this may optionally be used by the Data - * Provider to filter out properties that the server does not support, and should be used to avoid deleting - * these properties in case the server sends a changed item to the Data Provider - */ - void DoSetRemoteStoreFormatL(const CSmlDataStoreFormat& aServerDataStoreFormat); - - /** - * DoSetRemoteMaxObjectSize() sets the SyncML server maximum object size - this may optionally be used by the - * Data Provider to not send items to the server exceeding its maximum size. 0 means there is no limit. - */ - void DoSetRemoteMaxObjectSize(TInt aServerMaxObjectSize); - - /** - * DoMaxObjectSize() gets the Data Store maximum object size which is reported to the SyncML server. 0 means - * there is no limit. - * @return The maximum object size. - */ - TInt DoMaxObjectSize() const; - - /** - * DoOpenItemL() opens the data item specified by aUid asynchronously for reading. - * @param aUid Item UID which going to be read. - * @param aFieldChange Accept field changes. - * @param aParent Parent of the item. - * @param aSize Size of the item data. - * @param aMimeType MIME type of the item. - * @param aMimeVer MIME version used on item. - * @param aStatus On completion of the opening of item, contains the result code. - */ - void DoOpenItemL(TSmlDbItemUid aUid, TBool& aFieldChange, TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType, TDes8& aMimeVer, TRequestStatus& aStatus); - - /** - * DoCreateItemL() sets the item properties and reference to aUid which will be created. - * @param aUid Reference to item UID which going to be created. - * @param aSize Size of the item to be created. - * @param aParent Parent of the item. - * @param aMimeType MIME type of the item. - * @param aMimeVer MIME version used on item. - * @param aStatus On completion of the creating an item, contains the result code. - */ - void DoCreateItemL(TSmlDbItemUid& aUid, TInt aSize, TSmlDbItemUid aParent, const TDesC8& aMimeType, const TDesC8& aMimeVer, TRequestStatus& aStatus); - - /** - * DoReplaceItemL() opens the data item specified by aUid asynchronously to be updated. - * @param aUid Item UID which going to be updated. - * @param aSize Size of the item data. - * @param aParent Parent of the item. - * @param aFieldChange Accept field changes. - * @param aStatus On completion of the updating of item, contains the result code. - */ - void DoReplaceItemL(TSmlDbItemUid aUid, TInt aSize, TSmlDbItemUid aParent, TBool aFieldChange, TRequestStatus& aStatus); - - /** - * DoReadItemL() reads data(or size of aBuffer) of an item opened in DoOpenItemL() to given aBuffer. - * @param aBuffer Buffer to item data. - */ - void DoReadItemL(TDes8& aBuffer); - - /** - * DoWriteItemL() writes aData of an item opened in DoCreateItemL() or DoReplaceItemL() to be saved on database. - * @param aData Item data (or part of data). - */ - void DoWriteItemL(const TDesC8& aData); - - /** - * DoCommitItemL() completes an item operation started in DoCreateItemL() or DoReplaceItemL(). - * @param aStatus On completion of the operation, contains the result code. - */ - void DoCommitItemL(TRequestStatus& aStatus); - - /** - * DoCloseItem() completes an item operation started in DoOpenItemL(). - */ - void DoCloseItem(); - - /** - * DoMoveItemL() moves item specified by aUid asynchronously. - * @param aUid Item UID which going to be moved. - * @param aNewParent A new parent of the item. - * @param aStatus On completion of the moving an item, contains the result code. - */ - void DoMoveItemL(TSmlDbItemUid aUid, TSmlDbItemUid aNewParent, TRequestStatus& aStatus); - - /** - * DoDeleteItemL() deletes item specified by aUid asynchronously. - * @param aUid Item UID which going to be deleted. - * @param aStatus On completion of the deleting an item, contains the result code. - */ - void DoDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus); - - /** - * DoSoftDeleteItemL() soft deletes item specified by aUid asynchronously. - * @param aUid Item UID which going to be softdeleted. - * @param aStatus On completion of the softdeleting an item, contains the result code. - */ - void DoSoftDeleteItemL(TSmlDbItemUid aUid, TRequestStatus& aStatus); - - /** - * DoDeleteAllItemsL() deletes all items from opened database asynchronously. - * @param aStatus On completion of delete, contains the result code. - */ - void DoDeleteAllItemsL(TRequestStatus& aStatus); - - /** - * DoHasSyncHistory() checks if previous sync with opened server and context. - * @return ETrue if there is synchonization history. - */ - TBool DoHasSyncHistory() const; - - /** - * DoAddedItems() gets all added items on client since previous synchronization. - * @return Added items. - */ - const MSmlDataItemUidSet& DoAddedItems() const; - - /** - * DoDeletedItems() gets all deleted items on client since previous synchronization. - * @return Deleted items. - */ - const MSmlDataItemUidSet& DoDeletedItems() const; - - /** - * DoSoftDeletedItems() gets all softdeleted items on client since previous synchronization. - * @return Soft deleted items. - */ - const MSmlDataItemUidSet& DoSoftDeletedItems() const; - - /** - * DoModifiedItems() gets all modified items on client since previous synchronization. - * @return Modified items. - */ - const MSmlDataItemUidSet& DoModifiedItems() const; - - /** - * DoMovedItems() gets all moved items on client since previous synchronization. - * @return Moved items. - */ - const MSmlDataItemUidSet& DoMovedItems() const; - - /** - * DoResetChangeInfoL() resets client synchronization data => next time will be slow sync. - * @param aStatus On completion of reset, contains the result code. - */ - void DoResetChangeInfoL(TRequestStatus& aStatus); - - /** - * DoCommitChangeInfoL() commits client synchronization changes for given aItems list. - * @param aStatus On completion of given items, contains the result code. - * @param aItems Item ids to be commited. - */ - void DoCommitChangeInfoL(TRequestStatus& aStatus, const MSmlDataItemUidSet& aItems); - - /** - * DoCommitChangeInfoL() commits all client synchronization changes. - * @param aStatus On completion of all items, contains the result code. - */ - void DoCommitChangeInfoL(TRequestStatus& aStatus); - - /** - * Default constructor. - */ - CNSmlContactsDataStore(); - - /** - * SetOwnStoreFormatL() Sets dataproviders own storeformat. - */ - void SetOwnStoreFormatL(); - - /** - * LdoFetchItemL() Fetches item data from database. - * @param aUid Items uid for fetching. - * @param aItem Items data after fetch. - * - */ - void LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem ); - - /* - * LdoAddItemL() Adds item data to database. - * @param aItem Item data to be added. - * @param aSize Item data size. - */ - 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. - */ - void LdoAddItemsL( CBufBase*& aItems,TInt aSize); - - /** - * LdoUpdateItemL() Updates item data to database. - * - */ - 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. - */ - 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. - */ - 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. - */ - void StripPropertyL( CBufBase*& aItem, const TDesC8& aProperty ) const; - - /** - * ExecuteBufferL() Executes all buffered items from buffer. - * @param aResultArray Array to return statuscodes for each command. - */ - void ExecuteBufferL(); - - /** - * ExecuteAddL() Executes all the add commands in buffer. - */ - TInt ExecuteAddL(); - - /** - * ExecuteDeleteL() Executes all the delete commands in buffer. - */ - void ExecuteDeleteL(); - - /** - * ExecuteBufferL() Executes all the update commands in buffer. - */ - void ExecuteUpdateL(); - - /** - * ExecuteMoveL() Executes all the move commands in buffer. - */ - 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. - */ - 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. - */ - TBool IsConfidentialL( MVPbkStoreContact& aItem ); - - /** - * Leaving function called when fetch/retrieve - * operation is complete - * @param aContact contact fetched/retrieved - * - */ - void SingleContactOperationCompleteL(MVPbkStoreContact* aContact); - - /** - * Create a contact view of the store which is opened - */ - void CreateViewL(); - - /** - * Delete all the contacts - */ - void DoDeleteAllContactsL(); - /** - * Leaving function called when the operation is complete - */ - void OperationCompleteL(); - /** - * Reset the contacts data buffer - */ - void ResetBuffer(); - - - private: // 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 - }; - - 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 - }; - - - CNSmlChangeFinder* iChangeFinder; - TRequestStatus* iCallerStatus; - TBool iSnapshotRegistered; - TBool iBatchMode; - TBool iTransactionMode; - TBool iOpened; - TInt iModificationCount; - TInt64 iOpenedStoreId; - - TPtrC8 iMimeTypeItem; - TPtrC8 iMimeVersionItem; - - TPtrC8 iUsedMimeType; - TPtrC8 iUsedMimeVersion; - - RStringF iServerMimeType; - RStringF iServerMimeVersion; - - TInt iServerMaxObjectSize; - 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; - CNSmlContactsModsFetcher* iContactsModsFetcher; - - RFs iRfs; - TInt iDrive; - - - TSmlDbItemUid iUid; - TInt iItemSize; - TInt iItemPos; - TNSmlCntCommand iModType; - - CBufBase* iItemData; - CBufBase* iItemDataAddBatch; - CBufFlat* iMergeItem; - - RPointerArray iContactsBufferItemList; - - TKeyArrayFix iKey; - TBool iSyncHistory; - HBufC* iStoreName; - - RStringPool iStringPool; - CSmlDataStoreFormat* iStoreFormat; - - CNSmlDataItemUidSet* iNewUids; - CNSmlDataItemUidSet* iDeletedUids; - CNSmlDataItemUidSet* iSoftDeletedUids; - CNSmlDataItemUidSet* iReplacedUids; - CNSmlDataItemUidSet* iMovedUids; - - - TNSmlDataStoreStatus iState; - TInt iStateItem; - - RArray iAddResultArray; - - CVPbkContactManager* iContactManager; - MVPbkContactStore* iStore; - CVPbkVCardEng* iVCardEngine ; - MVPbkContactLink* iContactLink; - CVPbkContactIdConverter* iIdConverter; - CVPbkContactLinkArray* iContactLnks; - MVPbkContactViewBase* iContactViewBase; - - TInt *iSize; - RBufWriteStream iWriteStream; - RDesReadStream iReadStream; - HBufC8* iBuf; - TInt iRetCommand; - - TInt iIndex; - TInt iRetrieveCount; - RArray *iResultArray; - TNSmlLastOp iLastOperation; - }; - - -#endif // __NSMLCONTACTSDATASTORE_H__ - -// End of File diff -r 3f1ffafb31ec -r 4d5e9526124e omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStore.cpp --- a/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStore.cpp Mon Mar 15 12:39:28 2010 +0200 +++ b/omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStore.cpp Wed Mar 31 21:14:07 2010 +0300 @@ -183,6 +183,7 @@ iPacketStoreName = HBufC::NewL(dataBase.Length()); TPtr pktStorePtr(iPacketStoreName->Des()); pktStorePtr.Copy(dataBase); + iDeleteAllOperation = NULL; _DBG_FILE("CNSmlContactsDataStore::ConstructL(): end"); } @@ -216,13 +217,15 @@ } if(iContactLnks) { - delete iContactLnks; + delete iContactLnks; + iContactLnks = NULL; } - if(iContactLink) - { - delete iContactLink; - } - delete iContactViewBase; + + if(iContactViewBase) + { + delete iContactViewBase; + iContactViewBase = NULL; + } if ( iContactsModsFetcher ) { iContactsModsFetcher->CancelRequest(); @@ -2383,6 +2386,10 @@ } else { + if(iLastOperation == ENSMLDeleteAllOp) + { + iDeleteAllOperation = NULL; + } if( iChangeFinder ) { iChangeFinder->ResetL(); @@ -2435,7 +2442,7 @@ CleanupStack::Pop(); } - iContactManager->DeleteContactsL( *iContactLnks, *this ); + iDeleteAllOperation = iContactManager->DeleteContactsL( *iContactLnks, *this ); } diff -r 3f1ffafb31ec -r 4d5e9526124e omads/omadsextensions/datamod/inc/NSmlDataModBase.h --- a/omads/omadsextensions/datamod/inc/NSmlDataModBase.h Mon Mar 15 12:39:28 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 -#include -#include - - -// 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* aArrayOfParams ); - - /** - * Returns paramaters of property. - * @return Parameters of property. - */ - CArrayPtr* 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* 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 diff -r 3f1ffafb31ec -r 4d5e9526124e package_definition.xml --- a/package_definition.xml Mon Mar 15 12:39:28 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -