phonebookengines/contactsmodel/cntplsql/inc/pplcontactitemmanager.h
changeset 46 efe85016a067
parent 31 2a11b5b00470
equal deleted inserted replaced
40:b46a585f6909 46:efe85016a067
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description: 
    14 * Description: 
    15 *
    15 *
    16 */
    16 */
    17 
       
    18 
       
    19 
    17 
    20 
    18 
    21 /**
    19 /**
    22  @file
    20  @file
    23  @internalComponent
    21  @internalComponent
    35 #include "persistencelayer.h"
    33 #include "persistencelayer.h"
    36 #include "rpplicccontactstore.h"
    34 #include "rpplicccontactstore.h"
    37 
    35 
    38 class CPplTableBase;
    36 class CPplTableBase;
    39 class CPplPreferencesPersistor;
    37 class CPplPreferencesPersistor;
    40 class CPplPredictiveSearchTable;
    38 class CPplPredictiveSearchTableBase;
       
    39 class C12keyPredictiveSearchTable;
       
    40 class CQwertyPredictiveSearchTable;
       
    41 class CPredictiveSearchSettingsTable;
       
    42 class CPredictiveSearchSynchronizer;
       
    43 
    41 
    44 
    42 /**
    45 /**
    43 The CPplContactItemManager implements the MLplPersistenceBroker.
    46 The CPplContactItemManager implements the MLplPersistenceBroker.
    44 
    47 
    45 MLplPersistenceBroker is a public interface responsible for carrying out the
    48 MLplPersistenceBroker is a public interface responsible for carrying out the
    79     void SetCardTemplatePrefIdL(TInt aCardTemplatePrefId);
    82     void SetCardTemplatePrefIdL(TInt aCardTemplatePrefId);
    80 	void SynchronizePredSearchTableL();
    83 	void SynchronizePredSearchTableL();
    81 	void RecreatePredSearchTablesL();
    84 	void RecreatePredSearchTablesL();
    82 
    85 
    83 private:
    86 private:
    84 	CPplContactItemManager(RSqlDatabase& aDatabase, MLplTransactionManager& aTransactionManager, CLplContactProperties&  aContactProperties, RPplIccContactStore& aIccContactStore);
    87 	CPplContactItemManager(RSqlDatabase& aDatabase,
       
    88 						   MLplTransactionManager& aTransactionManager,
       
    89 						   CLplContactProperties& aContactProperties,
       
    90 						   RPplIccContactStore& aIccContactStore);
    85 	void ConstructL();
    91 	void ConstructL();
    86 	static void CleanupOperationRollbackL(TAny* aDatabase);
    92 	static void CleanupOperationRollbackL(TAny* aDatabase);
    87 	
    93 	
    88 	void StartTransactionL(TUint aSessionId);
    94 	void StartTransactionL(TUint aSessionId);
    89 	void CommitTransactionL();
    95 	void CommitTransactionL();
    90 	
    96 	
    91 	TInt NameFieldIndex(const CContactItemField& aNameField) const;
    97 	TInt NameFieldIndex(const CContactItemField& aNameField) const;
    92 	void DeleteInLowDiskConditionL(CPplTableBase* aTable, CContactItem* aContactItem);
    98 	void DeleteInLowDiskConditionL(CPplTableBase* aTable, CContactItem* aContactItem);
    93 
    99 
    94 	TBool DoesPredSearchTableExistL() const;
   100 private:
    95 	void CreatePredSearchTablesL();
   101 	RSqlDatabase&				  iDatabase; // CPplContactItemManager does not own the RSqlDatabase object
    96 	void DeletePredSearchTablesL();
   102 	MLplTransactionManager& 	  iTransactionManager;
       
   103 	TUint						  iSessionId;
       
   104 	CCntSqlStatement* 			  iSelectStatement;
       
   105 	CLplContactProperties&  	  iContactProperties;
       
   106 	CPplTableBase* 				  iContactTable;
       
   107 	CPplTableBase* 				  iGroupTable;	
       
   108 	CPplTableBase* 			      iCommAddrTable;
       
   109 	C12keyPredictiveSearchTable*  iPredSearch12keyTable;
       
   110 	CQwertyPredictiveSearchTable* iPredSearchQwertyTable;
       
   111 	CPredictiveSearchSettingsTable* iPredSearchSettingsTable;
       
   112 	CPplTableBase*                iPresenceTable;
       
   113 	CPplPreferencesPersistor*     iPreferencePersistor;
       
   114 	RPplIccContactStore&          iIccContactStore;
       
   115 	//RColumboSession             iColSession;
       
   116 	CPredictiveSearchSynchronizer* iPredictiveSearchSynchronizer; // Owned
    97 
   117 
    98 private:
   118 	// For unit testing
    99 	RSqlDatabase&				iDatabase;				// CPplContactItemManager does not own the RSqlDatabase object
   119 	friend class UT_CPplPredictiveSearchTable;
   100 	MLplTransactionManager& 	iTransactionManager;
       
   101 	TUint						iSessionId;
       
   102 	CCntSqlStatement* 			iSelectStatement;
       
   103 	CLplContactProperties&  	iContactProperties;
       
   104 	CPplTableBase* 				iContactTable;
       
   105 	CPplTableBase* 				iGroupTable;	
       
   106 	CPplTableBase* 				iCommAddrTable;
       
   107 	CPplPredictiveSearchTable*   	iPredSearchTable;
       
   108 	CPplTableBase*              iPresenceTable;
       
   109 	CPplPreferencesPersistor*	iPreferencePersistor;
       
   110 	RPplIccContactStore&        iIccContactStore;
       
   111 	//RColumboSession             iColSession;
       
   112 };
   120 };
   113 
   121 
   114 #endif // __PPLCONTACTITEMMANAGER_H__
   122 #endif // __PPLCONTACTITEMMANAGER_H__