diff -r ba8a586c45f1 -r c20154ccf3c0 creator/engine/inc/creator_phonebook.h --- a/creator/engine/inc/creator_phonebook.h Fri Jun 11 16:29:34 2010 +0100 +++ b/creator/engine/inc/creator_phonebook.h Thu Jul 22 16:33:59 2010 +0100 @@ -17,66 +17,21 @@ - - #ifndef __CREATORPHONEBOOK_H__ #define __CREATORPHONEBOOK_H__ -#include "engine.h" #include "creator_phonebookbase.h" #include "creator_randomdatafield.h" +#include "creator_phonebookwrapper.h" -//#include //defines Q_SFW_EXPORT -//#include - -#include -#include -#include -#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include - -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -QTM_USE_NAMESPACE class CCreatorEngine; class CCreatorModuleBaseParameters; -//class QContactManager; -//class QContact; -//class QContactId; -//class QContactData; -//class QContactName; - -//class MVPbkStoreContact; //to change -//class MVPbkContactStore; //to change -//class CAsyncWaiter; //to change - remove class CContactDatabase; -//class MVPbkContactLinkArray; //to change class CPhonebookParameters; - +class CCreatorPhonebookWrapper; class CCreatorPhonebook : public CCreatorPhonebookBase { @@ -90,7 +45,6 @@ void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase public: - virtual TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); TInt CreateContactEntryL(CCreatorModuleBaseParameters *aParameters); TInt CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters); TInt CreateSubscribedContactEntryL(CCreatorModuleBaseParameters *aParameters); @@ -101,57 +55,47 @@ void DeleteAllGroupsL(); void DeleteAllGroupsCreatedByCreatorL(); + void TestPrintOut(CPhonebookParameters* aParam); + private: - void InitializeContactParamsL(/*CCreatorModuleBaseParameters* aParameters*/); - TBool IsContactGroupL(/*const MVPbkContactLink& aLink*/); //modify - void StoreLinksForDeleteL( RArray& aLinks, TUid aStoreUid ); //modify - void DeleteContactsL( QList& contacts /*MVPbkContactLinkArray* aContacts, TBool aGroup*/ ); //modify + void InitializeContactParamsL(); + TBool IsContactGroupL( TUint32& aLink ); + void StoreLinksForDeleteL( RArray& aLinks, TUid aStoreUid ); + void DeleteContactsL( RArray& aContactsToDelete, TUid aStoreUid ); void DeleteItemsCreatedWithCreatorL( TUid aStoreUid ); void DoDeleteItemsCreatedWithCreatorL( TUid aStoreUid, CDictionaryFileStore* aStore ); - TBool HasOtherThanGroupsL( /*MVPbkContactLinkArray* aContacts */); //modify + TBool HasOtherThanGroupsL(); - QContactDetail CreateContactDetail(QString aDetail, QString aFieldContext, QString aFieldString, TInt aRand ); private: - - QContactManager* iContactMngr;//CVPbkContactManager* iContactManager; + CCreatorPhonebookWrapper* iPhonebookWrapper; TInt iOpCounter; CPhonebookParameters* iParameters; - static QString iPhoneNumberFields[]; static TInt iUrlFields[]; static TInt iEmailFields[]; - TBool iAddAllFields; - //QList - RArray iContactLinkArray;//CVPbkContactLinkArray* iContactLinkArray; //modify - RArray iContactsToDelete; //CVPbkContactLinkArray* iContactsToDelete; //modify - RArray iContactGroupsToDelete; //CVPbkContactLinkArray* iContactGroupsToDelete; //modify + + RArray iContactLinkArray; + RArray iContactsToDelete; + RArray iContactGroupsToDelete; RArray iPreviousDeleteLinks; - //RPointerArray iPreviousDeleteLinks; //modify private: //new variables /// Ref: the target of the copy - QContact* iStore; //MVPbkContactStore* iStore; - - //CAsyncWaiter* iWaiter; //remove + /// Own: Contact database for this store CContactDatabase* iContactDb; - //Contacts found in contacts db. - QList* iContactResults;//MVPbkContactLinkArray* iContactResults; - // Contact groups that are found in the store. These are used in filtering - // the groups from the find results. - QList* iContactGroupsInStore;//MVPbkContactLinkArray* iContactGroupsInStore; }; /** - * Virtual phonebook parameters + * phonebook parameters */ @@ -163,15 +107,16 @@ TInt CPhonebookParameters::ScriptLinkId() const; void CPhonebookParameters::SetScriptLinkId(TInt aLinkId); - QList iContactFields;// RPointerArray iContactFields; + TCreatorContactFields iContactFields; - QString iGroupName;//HBufC* iGroupName; - TInt iContactsInGroup; + HBufC* iGroupName; + TInt iContactsInGroup; TInt iNumberOfPhoneNumberFields; TInt iNumberOfURLFields; TInt iNumberOfEmailAddressFields; TInt iContactSetPtr; - RArray iLinkIds; //QList iLinkIds;// For contactgroup. Stores the linked contact ids. + RArray iLinkIds; // For contactgroup. Stores the linked contact ids. + public: CPhonebookParameters(); @@ -182,5 +127,16 @@ }; +class CCreatorContactField : public CBase //, public MCreatorRandomDataField + { +public: + static CCreatorContactField* NewL(); + void AddFieldToParamL( CCreatorEngine* aEngine, CPhonebookParameters* aParam, TInt aType, TInt aRand = KErrNotFound ); + void AddFieldToParamL( CPhonebookParameters* aParam, TInt aType, TPtrC aContent ); + ~CCreatorContactField(); +private: + CCreatorContactField(); + void ConstructL(); + }; #endif // __CREATORPHONEBOOK_H__