void CCalCategoryManagerImpl::GetFilteredEntryL(CArrayFixSeg<TAgnEntryId>& aEntryId, RPointerArray<CCalEntry>& aEntries, CCalSessionImpl& aCalSessionImpl)
	{// Get the light entry by its entry id and fill in it into the array past in by the client
	aCalSessionImpl.Server().FilterCategoryL(aEntryId, aCalSessionImpl.FileId());
	TInt count=aEntryId.Count();
	for (TInt ii=0;ii<count;++ii)
		{
		CAgnSimpleEntry* simpleEntry=aCalSessionImpl.Server().GetSimpleEntryL(aEntryId[ii], aCalSessionImpl.CollectionId());
		if (simpleEntry)
			{
			TCleanSimpleEntry simpleEntryCleanupItem(*simpleEntry, aCalSessionImpl.Server().SimpleEntryAllocator());
			CleanupStack::PushL(TCleanupItem(TCleanSimpleEntry::DestroySimpleEntry, &simpleEntryCleanupItem));
			CCalLiteEntry* liteEntry = CCalLiteEntry::NewL(*simpleEntry, aCalSessionImpl.Server());
			CleanupStack::Pop();
			CleanupStack::PushL(liteEntry);
			CCalEntryImpl* entryImpl = CCalEntryImpl::NewL(*liteEntry, aCalSessionImpl);
			CleanupStack::Pop(liteEntry);
			CleanupStack::PushL(entryImpl);
			CCalEntry* entry=CCalEntry::NewL(entryImpl);
			CleanupStack::Pop(entryImpl);
			CleanupStack::PushL(entry);
			aEntries.AppendL(entry);
			CleanupStack::Pop(entry);
			}		
		}
	}
TInt CCalInstanceIteratorAll::CountL() const
	{
	CArrayFixSeg<TAgnInstance>* instances = new (ELeave) CArrayFixSeg<TAgnInstance>(8);
	TInt instanceCount = 0;
	if (instances)
		{
		CleanupStack::PushL(instances);
		RArray<TInt64> fileIds;
		iInstanceViewImpl.GetFileIdLC(fileIds);
	 	iInstanceViewImpl.GetServ().FindInstancesL(fileIds, *instances, iFindInstanceParams);
		CleanupStack::PopAndDestroy(&fileIds);
		instanceCount = instances->Count();
		CleanupStack::PopAndDestroy(instances);
		}
	
	return instanceCount;
	}
TBool CCalInstanceIteratorAll::HasMoreL() const
	{
	TBool hasMore(ETrue);
	
	if (iCurrentIndex >= iInstanceIdCache->Count() - 1)
		{
		// There are no more instances in the cache
		// so find out if there are more in the store
		
		CArrayFixSeg<TAgnInstance>* instances = new(ELeave) CArrayFixSeg<TAgnInstance>(1);
		CleanupStack::PushL(instances);
		
		if (iInstanceIdCache->Count() != 0)
			{
			// we have already got some instances so fetch from there
			iFindInstanceParams.iInstance = (*iInstanceIdCache)[iCurrentIndex];
			}
		else
			{
			// we have no instances so search from the start time
			iFindInstanceParams.iInstance.iId.SetDate(iFindInstanceParams.iRangeStart);
			iFindInstanceParams.iInstance.iCollectionId = 0;
			}
	
		iFindInstanceParams.iNumInstances = 256;
		RArray<TInt64> fileIds;
		iInstanceViewImpl.GetFileIdLC(fileIds);

		iInstanceViewImpl.GetServ().NextInstancesL(fileIds, *instances, iFindInstanceParams);
		CleanupStack::PopAndDestroy(&fileIds);
		hasMore = (instances->Count() != 0);
				
		CleanupStack::PopAndDestroy(instances);
		}
	
	return hasMore;
	}
Beispiel #4
0
TInt CTestList::ListCount()
{
    return(iTestNames.Count());
}