--- a/phoneuis/easydialing/inc/easydialingcontactdatamanager.h Wed Sep 15 12:12:21 2010 +0300
+++ b/phoneuis/easydialing/inc/easydialingcontactdatamanager.h Wed Oct 13 14:31:22 2010 +0300
@@ -20,9 +20,8 @@
#define __EASYDIALINGCONTACTDATAMANAGER_H__
#include <MPbk2ImageOperationObservers.h>
-#include <MPbk2StoreConfigurationObserver.h>
#include <MVPbkSingleContactOperationObserver.h>
-#include <MVPbkContactStoreListObserver.h>
+#include <MVPbkContactStoreObserver.h>
#include <MVPbkOperationObserver.h>
#include <MVPbkContactViewBase.h>
#include <TPbk2ImageManagerParams.h>
@@ -31,7 +30,6 @@
#include "easydialingcontactdata.h"
// FORWARD DECLARATIONS
-class CPbk2StoreConfiguration;
class CVPbkContactManager;
class MContactDataManagerObserver;
class MVPbkFieldType;
@@ -47,16 +45,15 @@
public CBase,
public MPbk2ImageGetObserver,
public MVPbkSingleContactOperationObserver,
- public MVPbkContactStoreListObserver,
+ public MVPbkContactStoreObserver,
public MVPbkOperationErrorObserver,
public MVPbkOperationResultObserver<MVPbkContactViewBase*>,
- public MPbk2StoreConfigurationObserver,
public MPbkGlobalSettingObserver,
public MVPbkContactViewObserver
{
public:
-
+
/**
* Contact name display order
*/
@@ -65,32 +62,26 @@
EFirstnameLastname,
ELastnameFirstname
};
-
-public: // constructor and destructor
+
+public:
/**
- * Two-phased constructor
+ * Constructor.
*/
- static CEasyDialingContactDataManager* NewL();
+ CEasyDialingContactDataManager(CVPbkContactManager* aContactManager);
+
/**
* Destructor.
*/
~CEasyDialingContactDataManager();
-private: // constructors
- /**
- * Constructor.
- */
- CEasyDialingContactDataManager();
-
/**
* Second phase constructor of the class.
*/
void ConstructL();
-public: // new methods
/**
* Sets the observer. Observer is notified when thumbnail loading is complete
* @param aObserver
@@ -98,11 +89,6 @@
void SetObserver(MContactDataManagerObserver* aObserver);
/**
- * Gets a handle to the VPbk contact manager
- */
- CVPbkContactManager& ContactManager();
-
- /**
* Sets the size of the thumbnails. If the loaded thumbnail is larger than
* the set size, thumnail is scaled to the size. If the set size is different
* from the old one, deletes all loaded thumbnails, which causes them to be
@@ -122,39 +108,14 @@
HBufC* GetThumbnailIdL( MVPbkContactLink* aContact, TBool aMatchThumbnail, TBool aFav );
/**
- * Gets internal index for a contact item with the given internal ID.
- */
- TInt IndexForId( const TDesC& aId ) const;
-
- /**
* Gets the thumbnail for a contact item. If thumbnail is not loaded, starts
* loading it.
- * @param aIndex Internal index for the contact, obtained with IndexForId
+ * @param aContact Contact link
* @param aThumbnail Outparam. Contact thumbnail. NULL if contact doesn't have thumbnail
+ * @param aFav Outparam. Favourite status
* @return true if contact data has been loaded
*/
- TBool GetThumbnail( TInt aIndex, CFbsBitmap*& aThumbnail );
-
- /**
- * Checks if contact is a favorite contact
- * @param aIndex Internal index fo the contact, obtained with IndexForId
- * @return ETrue if contact is a favorite contact
- */
- TBool IsFav( TInt aIndex ) const;
-
- /**
- * Checks if contact is a SIM contact
- * @param aIndex Internal index fo the contact, obtained with IndexForId
- * @return ETrue if contact is a SIM contact
- */
- TBool IsSimContact( TInt aIndex ) const;
-
- /**
- * Checks if contact is a service number contact
- * @param aIndex Internal index fo the contact, obtained with IndexForId
- * @return ETrue if contact is a service number contact
- */
- TBool IsSdnContact( TInt aIndex ) const;
+ TBool GetThumbnailAndFav(const TDesC& aId, CFbsBitmap*& aThumbnail, TBool& aFav);
/**
* Deletes all loaded thumbnails and cancel asynchronous operations.
@@ -240,13 +201,6 @@
TNameOrder NameOrder();
/**
- * Get URIs of the contact stores which are currently shown in Phonebook.
- * @param aUris On return, contains heap descriptors identifying the contact
- * stores which are active. Ownership of the descriptors is given.
- */
- void GetCurrentStoreUrisL( RPointerArray<TDesC>& aUris );
-
- /**
* Pause the loading of contact data. This is used to make sure listbox is responsive
* and smooth during panning and flicking.
* @param aPause Pause on/off
@@ -269,19 +223,6 @@
public:
/**
- * From MPbk2StoreConfigurationObserver
- */
- void ConfigurationChanged();
-
- /**
- * From MPbk2StoreConfigurationObserver
- */
- void ConfigurationChangedComplete();
-
-
-public:
-
- /**
* From MPbkGlobalSettingObserver.
*/
void SettingChangedL( MPbkGlobalSetting::TPbkGlobalSetting aKey );
@@ -305,27 +246,25 @@
private:
+
/**
- * From MVPbkContactStoreListObserver.
+ * From MVPbkContactStoreObserver.
*/
void StoreReady( MVPbkContactStore& aContactStore );
-
+
+
/**
- * From MVPbkContactStoreListObserver.
+ * From MVPbkContactStoreObserver.
*/
void StoreUnavailable( MVPbkContactStore& aContactStore, TInt aReason );
+
/**
- * From MVPbkContactStoreListObserver.
+ * From MVPbkContactStoreObserver.
*/
void HandleStoreEventL( MVPbkContactStore& aContactStore,
- TVPbkContactStoreEvent aStoreEvent );
-
- /**
- * From MVPbkContactStoreListObserver.
- */
- void OpenComplete();
-
+ TVPbkContactStoreEvent aStoreEvent );
+
private:
/**
* From MVPbkOperationErrorObserver.
@@ -388,15 +327,8 @@
void InformObserver();
void UpdateNameOrderL();
-
- void SetupFavStoreSearchedL();
-
- void SetStoreFlagsForContact( CEasyDialingContactData* aContactData ) const;
private:
- /** Phonebook store configuration. Owned. */
- CPbk2StoreConfiguration* iPbkStoreConfiguration;
-
/** Array that contains all loaded contact data. Owned. */
RPointerArray<CEasyDialingContactData> iContactDataArray;
@@ -418,7 +350,7 @@
/** Contact item for which a thumbnail is being loaded. Owned. */
MVPbkStoreContact* iStoreContact;
- /** Virtual phonebook contact manager. Owned. */
+ /** Virtual phonebook contact manager. Not owned. */
CVPbkContactManager* iContactManager;
/** Contact data manager observer. Not owned. */
@@ -430,6 +362,9 @@
/** Virtual phonebook operation handle. Owned. */
MVPbkContactOperationBase* iContactOperation;
+ /** Default contact store. Not owned. */
+ MVPbkContactStore* iContactStore;
+
/** Variable which tells either to show or hide contact thumbnails. */
TBool iContactThumbnailSetting;
@@ -442,9 +377,6 @@
/** Favourites view is ready to be used. */
TBool iFavsViewReady;
- /** Contact store containing favourite contacts is configured to be searched. */
- TBool iFavStoreSearched;
-
/** Virtual phonebook operation handle for getting favourites. Owned. */
MVPbkContactOperationBase* iFavsOperation;