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;
	}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
//
CArrayFixSeg<TPosLmItemId>* CPosLmNameIndex::GetSortedIdsLC( TInt aFirst, TInt aCount ) const
    {
    if ( iStatus == KErrNone )
        {
        const TInt KGranularity( 512 );
        CArrayFixSeg<TPosLmItemId>* array = new (ELeave) CArrayFixSeg<TPosLmItemId>( KGranularity );
        CleanupStack::PushL( array );
        TInt first = Max( 0, aFirst );
        TInt last = Min( first + aCount, iArray->Count() );
        for ( TInt i = first; i < last; i++ )
            {
            CIndexItem* item = iArray->At(i);
            array->AppendL( item->Id() );
            }
        return array;
        }
    else
        {
        User::Leave( iStatus );
        return NULL;
        }
    }
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;
	}
// ---------------------------------------------------------
// CWlanScanRequest::RunProtectedSetup
// ---------------------------------------------------------
//
void CWlanMgmtClient::RunProtectedSetup(
    TRequestStatus& aStatus,
    const TWlanSsid& aSsid,
    const TWlanWpsPin& /* aWpsPin */,
    CArrayFixSeg<TWlanProtectedSetupCredentialAttribute>& aCredentials )
{
    // Complete the request immediately
    TRequestStatus *status = &aStatus;
    TInt err = KErrNone;
    TWlanProtectedSetupCredentialAttribute attr;
    
    attr.iSsid.Copy(aSsid);
    attr.iSecurityMode = EWlanIapSecurityModeAllowUnsecure;
    attr.iAuthenticationMode = EWlanAuthenticationModeOpen;
    attr.iOperatingMode = EWlanOperatingModeInfrastructure;
    attr.iWepDefaultKey = EWlanDefaultWepKey1;
    
    TRAP(err, aCredentials.AppendL(attr) );
    User::RequestComplete(status, err);
}
Exemplo n.º 6
0
void CTestList::AppendToListL(const TDesC &aDesc)
{
    TestNameBuf buf(aDesc);
    iTestNames.AppendL(buf);
}
Exemplo n.º 7
0
TInt CTestList::ListCount()
{
    return(iTestNames.Count());
}