omads/omadsextensions/adapters/contacts/inc/NSmlContactsModsFetcher.h
branchRCL_3
changeset 14 b922b9936679
parent 0 dab8a81a92de
equal deleted inserted replaced
8:ad0f53516d84 14:b922b9936679
    23 #include <SmlDataProvider.h>
    23 #include <SmlDataProvider.h>
    24 #include <SmlDataFormat.h>
    24 #include <SmlDataFormat.h>
    25 #include <f32file.h>
    25 #include <f32file.h>
    26 #include <cntdb.h>
    26 #include <cntdb.h>
    27 #include <cntitem.h>
    27 #include <cntitem.h>
    28 #include "nsmlchangefinder.h"
    28 #include <MContactsModsFetcher.h>
    29 
    29 
    30 #include <CVPbkContactManager.h>
    30 #include <CVPbkContactManager.h>
    31 #include <MVPbkContactStore.h>
    31 #include <MVPbkContactStore.h>
    32 #include <MVPbkContactViewObserver.h>
    32 #include <MVPbkContactViewObserver.h>
    33 #include <CVPbkSortOrder.h>
    33 #include <CVPbkSortOrder.h>
    39 const TInt KNSmlSnapshotSize = 56;
    39 const TInt KNSmlSnapshotSize = 56;
    40 const TInt KNSmlSnapshotSmallSize = 8;
    40 const TInt KNSmlSnapshotSmallSize = 8;
    41 _LIT( KNSmlContactSyncNoSync, "none" ); // Taken from phonebook
    41 _LIT( KNSmlContactSyncNoSync, "none" ); // Taken from phonebook
    42 
    42 
    43 // CLASS DECLARATION
    43 // CLASS DECLARATION
       
    44 class CNSmlChangeFinder;
       
    45 class TNSmlSnapshotItem;
    44 
    46 
    45 // ------------------------------------------------------------------------------------------------
    47 // ------------------------------------------------------------------------------------------------
    46 // CNSmlContactsModsFetcher
    48 // CNSmlContactsModsFetcher
    47 //
    49 //
    48 // @lib nsmlcontactsdataprovider.lib
    50 // @lib nsmlcontactsdataprovider.lib
    49 // ------------------------------------------------------------------------------------------------
    51 // ------------------------------------------------------------------------------------------------
    50 class CNSmlContactsModsFetcher : public CActive,
    52 class CNSmlContactsModsFetcher : public CActive, public MContactsModsFetcher,
    51 								MVPbkContactViewObserver,
    53 								MVPbkContactViewObserver,
    52 								MVPbkSingleContactOperationObserver,
    54 								MVPbkSingleContactOperationObserver,
    53 								MVPbkContactOperationBase
    55 								MVPbkContactOperationBase
    54 								
    56 								
    55 	{
    57 	{
    64 		CNSmlContactsModsFetcher( TBool& aSnapshotRegistered,CVPbkContactManager& aContactManager,MVPbkContactStore& aStore,TKeyArrayFix& aKey, CNSmlChangeFinder& aChangeFinder );
    66 		CNSmlContactsModsFetcher( TBool& aSnapshotRegistered,CVPbkContactManager& aContactManager,MVPbkContactStore& aStore,TKeyArrayFix& aKey, CNSmlChangeFinder& aChangeFinder );
    65 		/**
    67 		/**
    66 		* Second phase constructor.
    68 		* Second phase constructor.
    67 		*/
    69 		*/
    68 		void ConstructL();
    70 		void ConstructL();
    69 
       
    70 		/**
       
    71 		* Reads all modifications from clients contacts databse.
       
    72 		* @param		aStatus				On completion of the operation, contains the result code.
       
    73 		*/
       
    74 		void FetchModificationsL( TRequestStatus& aStatus );
       
    75 
    71 
    76 		/**
    72 		/**
    77 		* ~CNSmlContactsModsFetcher() desctructor.
    73 		* ~CNSmlContactsModsFetcher() desctructor.
    78 		*/
    74 		*/
    79 		virtual ~CNSmlContactsModsFetcher();
    75 		virtual ~CNSmlContactsModsFetcher();
   168 		* to the snapshot.
   164 		* to the snapshot.
   169 		* @param    aContact   Fetched contact to be 
   165 		* @param    aContact   Fetched contact to be 
   170 		*						added to snapshot
   166 		*						added to snapshot
   171 		*/
   167 		*/
   172         void UpdateSnapshotL( MVPbkStoreContact* aContact );
   168         void UpdateSnapshotL( MVPbkStoreContact* aContact );
   173 		
   169 
       
   170     private: // from MContactsModsFetcher
       
   171 
       
   172         /**
       
   173         * Cancels the current asynchronous request
       
   174         */
       
   175         void CancelRequest( );
       
   176 
       
   177         /**
       
   178         * Reads all modifications from clients contacts databse.
       
   179         * @param    aStatus   On completion of the operation, contains the result code.
       
   180         */    
       
   181         void FetchModificationsL( TRequestStatus& aStatus );
       
   182 
   174 	private: // data
   183 	private: // data
   175 		TRequestStatus* iCallerStatus;
   184 		TRequestStatus* iCallerStatus;
   176 		TTime iFromTime;
   185 		TTime iFromTime;
   177 		
   186 		
   178 		
   187