diff -r 4f2773374eff -r 4b22a598b890 creator/engine/src/creator_contactsetcache.cpp --- a/creator/engine/src/creator_contactsetcache.cpp Fri May 14 15:53:02 2010 +0300 +++ b/creator/engine/src/creator_contactsetcache.cpp Thu May 27 12:52:19 2010 +0300 @@ -32,9 +32,31 @@ return iLinkId; } +void CCreatorContactSet::AppendL(QContactLocalId aContactLink) + { + iContactLinks.AppendL(aContactLink); + } + +RArray CCreatorContactSet::ContactLinks() + { + return iContactLinks; + } + +const RArray CCreatorContactSet::ContactLinks() const + { + return iContactLinks; + } + + +TInt CCreatorContactSet::NumberOfExistingContacts() const + { + return iNumOfExistingContacts; + } CCreatorContactSet::~CCreatorContactSet() { + iContactLinks.Reset(); + iContactLinks.Close(); } @@ -50,6 +72,10 @@ static CContactLinkCacheImp* NewL(); virtual ~CContactLinkCacheImp(); virtual void AppendL(CCreatorContactSet* aContactSet); + + virtual RArray ContactLinks(TInt aLinkId); + virtual const RArray ContactLinks(TInt aLinkId) const; + virtual RPointerArray& ContactSets(); virtual const RPointerArray& ContactSets() const; virtual const CCreatorContactSet& ContactSet(TInt aLinkId) const; @@ -58,6 +84,9 @@ private: void ConstructL(); CContactLinkCacheImp(); + + RArray iEmptyLinks; + RPointerArray iContactSets; CCreatorContactSet* iDummyContactSet; }; @@ -83,6 +112,9 @@ CContactLinkCacheImp::~CContactLinkCacheImp() { + iEmptyLinks.Reset();// just in case... + iEmptyLinks.Close(); + iContactSets.ResetAndDestroy(); iContactSets.Close(); delete iDummyContactSet; @@ -91,6 +123,30 @@ { iContactSets.AppendL(aContactSet); } +RArray CContactLinkCacheImp::ContactLinks(TInt aLinkId) + { + for( TInt i = 0; i < iContactSets.Count(); ++i ) + { + if( iContactSets[i]->LinkId() == aLinkId ) + { + return iContactSets[i]->ContactLinks(); + } + } + return iEmptyLinks; + } + +const RArray CContactLinkCacheImp::ContactLinks(TInt aLinkId) const + { + for( TInt i = 0; i < iContactSets.Count(); ++i ) + { + if( iContactSets[i]->LinkId() == aLinkId ) + { + return iContactSets[i]->ContactLinks(); + } + } + return iEmptyLinks; + } + const CCreatorContactSet& CContactLinkCacheImp::ContactSet(TInt aLinkId) const {