diff -r e8e3147d53eb -r b3431bff8c19 predictivesearch/adapters/contacts/inc/cpcscontactfetch.h --- a/predictivesearch/adapters/contacts/inc/cpcscontactfetch.h Mon Mar 15 12:39:26 2010 +0200 +++ b/predictivesearch/adapters/contacts/inc/cpcscontactfetch.h Wed Mar 31 21:13:53 2010 +0300 @@ -27,238 +27,218 @@ #include #include #include -#include -#include -// USER INCLUDES +// USER INCLUDES #include "mdatastoreobserver.h" #include "cpcscontactstore.h" #include "PSContactsAdapterInternalCRKeys.h" // FORWARD DECLARATIONS -class CPsData; class CVPbkContactManager; -class CVPbkContactStoreUriArray; -class CVPbkContactLinkArray; -class MVPbkContactOperationBase; -class MVPbkContactLinkArray; -class MVPbkBaseContact; -class CVPbkFieldTypeRefsList; -class MVPbkContactViewObserver; /** - * This class is the contact fetch class. - * This class manages all the data stores defined. + * This class is the contact fetch class. + * This class manages all the data stores defined. * @lib pscontactsadapter.lib */ class CPcsContactFetch: public CActive, public MVPbkContactStoreListObserver - -{ - public: + +{ + public: - /** - * 1st phase constructor - * @return returns pointer to the constructed object of type CPcsContactFetch - */ - static CPcsContactFetch* NewL(); + /** + * 1st phase constructor + * @return returns pointer to the constructed object of type CPcsContactFetch + */ + static CPcsContactFetch* NewL(); - /** - * Destructor - */ - virtual ~CPcsContactFetch(); - - public: - - // From base class MVPbkContactStoreListObserver + /** + * Destructor + */ + virtual ~CPcsContactFetch(); + + public: - /** - * From MVPbkContactStoreListObserver - * Called when the opening process is complete, ie. all stores have been reported - * either failed or successfully opened. - */ - void OpenComplete(); + // From base class MVPbkContactStoreListObserver - /** - * From MVPbkContactStoreListObserver - * Called when a contact store is ready to use. - * @param aContactStore - The store that became available. - */ - void StoreReady(MVPbkContactStore& aContactStore); + /** + * From MVPbkContactStoreListObserver + * Called when the opening process is complete, ie. all stores have been reported + * either failed or successfully opened. + */ + void OpenComplete(); - /** - * From MVPbkContactStoreListObserver - * Called when a contact store becomes unavailable. - * Client may inspect the reason of the unavailability and decide whether or not - * it will keep the store opened (ie. listen to the store events). - * @param aContactStore - The store that became unavailable. - * @param aReason - The reason why the store is unavailable. - * This is one of the system wide error codes. - */ - void StoreUnavailable(MVPbkContactStore& aContactStore, TInt aReason); + /** + * From MVPbkContactStoreListObserver + * Called when a contact store is ready to use. + * @param aContactStore - The store that became available. + */ + void StoreReady(MVPbkContactStore& aContactStore); + + /** + * From MVPbkContactStoreListObserver + * Called when a contact store becomes unavailable. + * Client may inspect the reason of the unavailability and decide whether or not + * it will keep the store opened (ie. listen to the store events). + * @param aContactStore - The store that became unavailable. + * @param aReason - The reason why the store is unavailable. + * This is one of the system wide error codes. + */ + void StoreUnavailable(MVPbkContactStore& aContactStore, TInt aReason); - /** - * From MVPbkContactStoreListObserver - * Called when changes occur in the contact store i.e contact - * added/deleted, group added/deleted etc. - * @see TVPbkContactStoreEvent - * @param aContactStore - The store the event occurred in. - * @param aStoreEvent - Event that has occured. - */ - void HandleStoreEventL( - MVPbkContactStore& aContactStore, - TVPbkContactStoreEvent aStoreEvent); - - public: - /** - * Gets the supported data stores URIs - * @param aDataStoresURIs supported data stores URIs - */ - void GetSupportedDataStoresL( RPointerArray &aDataStoresURIs ); - - /** - * Checks if the data store is supported by this adapter - * @param aDataStoreURI - The datastore to be checked - * @return ETrue if this store is supported - */ - TBool IsDataStoresSupportedL( TDesC& aDataStoreURI ); + /** + * From MVPbkContactStoreListObserver + * Called when changes occur in the contact store i.e contact + * added/deleted, group added/deleted etc. + * @see TVPbkContactStoreEvent + * @param aContactStore - The store the event occurred in. + * @param aStoreEvent - Event that has occured. + */ + void HandleStoreEventL( + MVPbkContactStore& aContactStore, + TVPbkContactStoreEvent aStoreEvent); - /** - * Initiate data fetch from the contacts adapter - * @param aDataStoreURI - The store from which data is requested - */ - void RequestForDataL(TDesC& aDataStoreURI); + public: + /** + * Gets the supported data stores URIs + * @param aDataStoresURIs supported data stores URIs + */ + void GetSupportedDataStoresL( RPointerArray &aDataStoresURIs ); - /** - * Set the observer to receive the fetched results - * @param aObserver - Observer to receive the contacts data - */ - void SetObserver(MDataStoreObserver& aObserver); - - public: - /** - * Gets the supported data fields - * @param aDataFields - supported data fields - */ - void GetSupportedDataFieldsL(RArray &aDataFields ); - - protected: + /** + * Checks if the data store is supported by this adapter + * @param aDataStoreURI - The datastore to be checked + * @return ETrue if this store is supported + */ + TBool IsDataStoresSupportedL( TDesC& aDataStoreURI ); + + /** + * Initiate data fetch from the contacts adapter + * @param aDataStoreURI - The store from which data is requested + */ + void RequestForDataL(TDesC& aDataStoreURI); - // From base class CActive + /** + * Set the observer to receive the fetched results + * @param aObserver - Observer to receive the contacts data + */ + void SetObserver(MDataStoreObserver& aObserver); - /** - * From CActive - * Implements cancellation of an outstanding request. - * This function is called as part of the active object's Cancel(). - */ - void DoCancel() ; + public: + /** + * Gets the supported data fields + * @param aDataFields - supported data fields + */ + void GetSupportedDataFieldsL(RArray &aDataFields ); + + protected: + + // From base class CActive - /** - * From CActive - * Handles an active object's request completion event. - * - * The function is called by the active scheduler when a request - * completion event occurs, i.e. after the active scheduler's - * WaitForAnyRequest() function completes. - * - * Before calling this active object's RunL() function, the active scheduler - * has: - * - * 1. decided that this is the highest priority active object with - * a completed request - * - * 2. marked this active object's request as complete (i.e. the request is no - * longer outstanding) - * - * RunL() runs under a trap harness in the active scheduler. If it leaves, - * then the active scheduler calls RunError() to handle the leave. - * - * Note that once the active scheduler's Start() function has been called, - * all user code is run under one of the program's active object's RunL() or - * RunError() functions. - */ - void RunL(); + /** + * From CActive + * Implements cancellation of an outstanding request. + * This function is called as part of the active object's Cancel(). + */ + void DoCancel(); - - /** - * From CActive - * If the RunL function leaves, - * then the active scheduler calls RunError() to handle the leave. - * @param aError - The error code - */ - TInt RunError( TInt aError ); - - private: - - /** - * Constructor - */ - CPcsContactFetch(); - - /** - * 2nd phase constructor - */ - void ConstructL(); - - /** - * Fetches the data from a particular contact - * @param aContact - The contact from database - * @param aPhoneData - The contact in CPsData format - */ - void GetDataForSingleContactL ( MVPbkBaseContact& aContact,CPsData* aPhoneData ); + /** + * From CActive + * Handles an active object's request completion event. + * + * The function is called by the active scheduler when a request + * completion event occurs, i.e. after the active scheduler's + * WaitForAnyRequest() function completes. + * + * Before calling this active object's RunL() function, the active scheduler + * has: + * + * 1. decided that this is the highest priority active object with + * a completed request + * + * 2. marked this active object's request as complete (i.e. the request is no + * longer outstanding) + * + * RunL() runs under a trap harness in the active scheduler. If it leaves, + * then the active scheduler calls RunError() to handle the leave. + * + * Note that once the active scheduler's Start() function has been called, + * all user code is run under one of the program's active object's RunL() or + * RunError() functions. + */ + void RunL(); - /** - * Creates the substore - * @param aDataStoreURI - The store for which substore is to be created - */ - void CreateSubStoresL(TDesC& aDataStoreURI); - - + /** + * From CActive + * If the RunL function leaves, + * then the active scheduler calls RunError() to handle the leave. + * @param aError - The error code + */ + TInt RunError( TInt aError ); + + private: + /** - * Reads the configured URIs from the central repository - */ + * Constructor + */ + CPcsContactFetch(); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + /** + * Creates the substore + * @param aDataStoreURI - The store for which substore is to be created + */ + void CreateSubStoresL(TDesC& aDataStoreURI); + + /** + * Reads the configured URIs from the central repository + */ void ReadUrisFromCenrepL(); - - private: - - /** - * Holds the observer object to communicate add/modify/delete of contacts - * Not owned. - */ - MDataStoreObserver* iObserver; - - /** + + private: + + /** + * Holds the observer object to communicate add/modify/delete of contacts + * Not owned. + */ + MDataStoreObserver* iObserver; + + /** * Owns an instance of active scheduler wait */ - CActiveSchedulerWait *iWait; - - /** - * Flags for store operations - */ - TBool iAtLeastOneStoreReady; - TBool iNoContactStoreAvailable; - TBool iRequestForData; - TBool iSubStoreCreated; + CActiveSchedulerWait *iWait; - /** - * The contact manager for accessing the phone contacts - * Own. - */ - CVPbkContactManager* iContactManager; + /** + * Flags for store operations + */ + TBool iAtLeastOneStoreReady; + TBool iNoContactStoreAvailable; + TBool iRequestForData; + TBool iSubStoreCreated; - /** + /** + * The contact manager for accessing the phone contacts + * Own. + */ + CVPbkContactManager* iContactManager; + + /** * Uris(data stores) read from the central repository */ - RPointerArray iUriFromCenrep; + RPointerArray iUriFromCenrep; - /** + /** * Data stores instances */ - RPointerArray iAllDataStores; - + RPointerArray iAllDataStores; }; #endif // C_PCS_CONTACT_FETCH_H