当前位置: 首页>>代码示例>>C++>>正文


C++ CMsvEntrySelection::At方法代码示例

本文整理汇总了C++中CMsvEntrySelection::At方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvEntrySelection::At方法的具体用法?C++ CMsvEntrySelection::At怎么用?C++ CMsvEntrySelection::At使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMsvEntrySelection的用法示例。


在下文中一共展示了CMsvEntrySelection::At方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CheckInboxL

/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CSMSMonitor::CheckInboxL(void)
{	
	TInt smsCount(0),mmsCount(0);

	CMsvEntry* Entrie = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId);
	if(Entrie)
	{
		CleanupStack::PushL(Entrie);
		
		if(Entrie->Count())
		{
			TMsvSelectionOrdering MySortType;
			
			MySortType.SetSorting(EMsvSortByDate);
			
			Entrie->SetSortTypeL(MySortType);
			
			CMsvEntrySelection* entries = Entrie->ChildrenL();
			if(entries)
			{
				CleanupStack::PushL(entries);
		 
				for(TInt i = (entries->Count() - 1); i >= 0; i--)
				{
					if(Entrie->ChildDataL(entries->At(i)).Unread())
					{	
						if(Entrie->ChildDataL(entries->At(i)).iMtm == KUidMsgTypeSMS)
						{
							smsCount++;
						}
						else if(Entrie->ChildDataL(entries->At(i)).iMtm == KUidMsgTypeMultimedia)
						{
							mmsCount++;
						}
					}
				} 
			
				CleanupStack::PopAndDestroy(entries);
			}
		}
		
		CleanupStack::PopAndDestroy(1);//Entrie
	}
	
	if(iObserver){
		iObserver->InboxChangedL(smsCount,mmsCount);
	}
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:52,代码来源:SMS_Monitor.cpp

示例2: GetMessagePartIndexL

/**
GetMessagePartIndexL()
Retrieves the part index id for the email identified by aEntry

@param aEntry
A valid email identifier

@param aUid
An identifier tfor the type of message part to be retrieved

@return
TMsvId - message part identifier
*/
TMsvId CT_MsgComparePopEmailMsgs::GetMessagePartIndexL(TMsvEntry& aEntry, TUid aUid)
	{
	static TBool msgPartFound = EFalse;	
	TMsvId msgPartId = 0;
	CMsvEntry*	baseEntry  = iSharedDataPOP.iSession->GetEntryL(aEntry.Id());
	CleanupStack::PushL(baseEntry);
	CMsvEntrySelection*	selection =  baseEntry->ChildrenL();
	CleanupStack::PushL(selection);
	TInt count = selection->Count();
	TInt ind1;
	CMsvEntry* entry = iSharedDataPOP.iSession->GetEntryL(KMsvRootIndexEntryId);
	CleanupStack::PushL(entry);
	for (ind1=0, msgPartFound=EFalse; ind1 < count; ind1++)
		{
		if(msgPartFound)
			{
			break;
			}		
		TMsvId	childId  = selection->At(ind1);
		entry->SetEntryL(childId);

		if (entry->Entry().iType  == aUid)
			{
			msgPartId = childId;
			break;
			}
		else if (entry->Entry().iType  == KUidMsvFolderEntry)
			{
			TMsvEntry ent = entry->Entry();
			msgPartId = GetMessagePartIndexL(ent, aUid);
			}
		}
	CleanupStack::PopAndDestroy(3, baseEntry);  // entry,selection,baseEntry
	return msgPartId;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:48,代码来源:T_ComparePopEmailMsgs.cpp

示例3: ConstructL

void CBulkCommitServerMtm::ConstructL()
	{	
	// Get the entry id for the bulkcommit service entry.
	User::LeaveIfError(iServerEntry->SetEntry(KMsvRootIndexEntryId));
	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
	CleanupStack::PushL(sel);
	User::LeaveIfError(iServerEntry->GetChildrenWithMtm(KUidBulkCommitTestMtm, *sel));
	TInt count = sel->Count();
	if( count > 1 )	// should only be one service entry
		{
		User::Leave(KErrCorrupt);
		}
	if( count == 0 )
		{
		// Create the settings
		TMsvEntry serviceEntry;
		serviceEntry.iType= KUidMsvServiceEntry;
		serviceEntry.iMtm = KUidBulkCommitTestMtm;

		User::LeaveIfError(iServerEntry->CreateEntry(serviceEntry));
		iServiceId = serviceEntry.Id();		
		}
	else
		{
		iServiceId = sel->At(0);
		}
	CleanupStack::PopAndDestroy(sel);	
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:28,代码来源:cbulkcommitservermtm.cpp

示例4: LaunchEditorL

// methods from CSendAsEditUtils
void CSendAsTestEditUtils::LaunchEditorL(TMsvId /*aId*/, TRequestStatus& aStatus)
	{

	CDummyObserver* ob1 = new(ELeave) CDummyObserver;
	CleanupStack::PushL(ob1);

	CMsvSession* session = CMsvSession::OpenSyncL(*ob1);
	CleanupStack::PushL(session);

	CMsvEntry* cEntry = CMsvEntry::NewL(*session, KMsvDraftEntryId, 
		TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue));
	CleanupStack::PushL(cEntry);

	CMsvEntrySelection* selection = cEntry->ChildrenL();
	CleanupStack::PushL(selection);

	CMsvEntry* cEntry2 = session->GetEntryL(selection->At(0));
	CleanupStack::PushL(cEntry2);

	TMsvEntry entry = cEntry2->Entry();
	entry.SetMtmData3(234567890); // Show we've been called by touching the TMsvEntry.
	cEntry2->ChangeL(entry);
	
	CleanupStack::PopAndDestroy(5, ob1); // cEntry2, selection, cEntry, session, ob1

	iUserStatus = &aStatus;
	aStatus = KRequestPending;
	// wait a few seconds before completing
	iEditTimer->After(KSendAsTestEditWaitTime);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:31,代码来源:csendastesteditutils.cpp

示例5: DoMoveEntriesL

void CMsvServerEntry::DoMoveEntriesL(CMsvEntrySelection& aSelection, TMsvId aDestination, CMsvEntrySelection*& aMoved)
	{
	__ASSERT_DEBUG(!aMoved, PanicServer(EMsvMoveSelectionNotNull));
	__ASSERT_DEBUG(aSelection.Count() > 0, PanicServer(EMsvMovingEmptySelection));

	aMoved = new(ELeave)CMsvEntrySelection;
	aMoved->SetReserveL(aSelection.Count());

	CMsvMove* move = CMsvMove::NewL(iServer);
	CleanupStack::PushL(move);

	TInt error = KErrNone;

	TInt count = aSelection.Count();
	while(count--)
		{
		TMsvId id = aSelection.At(count);
		if (!IsAChild(id))
			error = KErrNotFound;
		else
			{
			move->StartL(id, aDestination);
			aSelection.Delete(count);
			aMoved->AppendL(id);
			}
		}
	User::LeaveIfError(error);
	CleanupStack::PopAndDestroy(); // move
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:29,代码来源:MSVENTRY.CPP

示例6: FindUserFolderL

// -----------------------------------------------------------------------------
// CMmsAdapterMsvApi::FindUserFolderL
// -----------------------------------------------------------------------------
//    
TBool CMmsAdapterMsvApi::FindUserFolderL( TMsvId aFolder, TPtrC& aName, TTime& aDate )
    {
    TBool found( EFalse );
    
    CMsvEntry* entry = iSession.GetEntryL( KMsvMyFoldersEntryIdValue );
    CleanupStack::PushL( entry );
     
    CMsvEntrySelection* selection = entry->ChildrenL();
    CleanupStack::PushL( selection );
    
    TMsvId serviceId;
    TMsvEntry entryT;

    for ( TInt i = 0; i < selection->Count(); i++ )
        {
        User::LeaveIfError( iSession.GetEntry( selection->At( i ), serviceId, entryT ) );
        
        if ( !entryT.Deleted() && entryT.iType == KUidMsvFolderEntry && entryT.Id() == aFolder )
            {
            found = ETrue;
            aDate = entryT.iDate;
            aName.Set( entryT.iDetails );
            break;
            }
        }
    
    CleanupStack::PopAndDestroy( selection );
    CleanupStack::PopAndDestroy( entry ); 
    
    return found;        
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:35,代码来源:mmsadaptermsvapi.cpp

示例7: GetMessagesL

void CMsvScheduleSend::GetMessagesL(const CMsvEntrySelection& aSelection)
	{
	iSchEntries->ResetAndDestroy();

	const TInt entryCount = aSelection.Count();

	iSchEntries->SetReserveL(entryCount); //so following AppendL()s won't leave

	CMsvScheduledEntry* schEntry = NULL;

	for (TInt curMsg = 0; curMsg < entryCount; ++curMsg) //not while because must transverse forward
		{
		//Retrieve each message from the message server
		TMsvId msvId = aSelection.At(curMsg);

		TRAPD(error, schEntry = GetMessageL(msvId));

		if (error == KErrNone)
			{
			CleanupStack::PushL(schEntry);
			iSchEntries->AppendL(schEntry);
			CleanupStack::Pop(schEntry);
			}
		else if (error != KErrLocked && error != KErrNotFound)
			{
			User::Leave(error);
			}
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:29,代码来源:MsvScheduleSend.cpp

示例8: ConstructL

void CPigeonServerMtm::ConstructL()
{
    iScheduleSend = CPigeonScheduledSend::NewL(*iServerEntry);

    // Get the entry id for the pigeon service entry.
    User::LeaveIfError(iServerEntry->SetEntry(KMsvRootIndexEntryId));
    CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
    CleanupStack::PushL(sel);
    User::LeaveIfError(iServerEntry->GetChildrenWithMtm(KUidMsgTypePigeon, *sel));
    TInt count = sel->Count();
    if( count > 1 )	// should only be one service entry
        User::Leave(KErrCorrupt);
    if( count == 0 )
    {
        // Create the settings
        TMsvEntry serviceEntry;
        serviceEntry.iType= KUidMsvServiceEntry;
        serviceEntry.iMtm = KUidMsgTypePigeon;

        User::LeaveIfError(iServerEntry->CreateEntry(serviceEntry));
        iServiceId = serviceEntry.Id();
    }
    else
    {
        iServiceId = sel->At(0);
    }
    CleanupStack::PopAndDestroy(sel);
    User::LeaveIfError(iServerEntry->SetEntry(KMsvNullIndexEntryId));
    iHeapFailure = EFalse;
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:30,代码来源:pigeonservermtm.cpp

示例9: DeleteServiceL

EXPORT_C void CMsvTestUtils::DeleteServiceL(TUid aMtm)
	{
	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
	CleanupStack::PushL(sel);
	TMsvId firstId = 0;
	TRAPD(err, ServiceIdL(aMtm, firstId, sel));
	
	if (!err)
		{
		TInt count = sel->Count();

		while (count--)
			{
			TMsvId del = sel->At(count);
			TRAP(err, SetEntryL(del));

			if (!err)
				{
				TRAP(err, SetEntryL(Entry().Parent()));

				if (!err)
					{
					TRAP(err, DeleteEntryL(del));
					}
				}

			if (err)
				{
				Printf(_L("Error deleting service entry\n"));
				}
			}
		}

	CleanupStack::PopAndDestroy(); //sel
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:35,代码来源:msvtestutils.cpp

示例10: BaseConstructL

// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
void CIpsPlgImap4PopulateOp::ConstructL( 
        const CMsvEntrySelection& aSel,
        TBool aDoFilterSelection )
    {
    FUNC_LOG;
    BaseConstructL( KUidMsgTypeIMAP4 );
    
    // <qmail> instantiation moved here
    iSelection = new ( ELeave ) CMsvEntrySelection();
    iTempSelection = new ( ELeave ) CMsvEntrySelection();

    if ( aDoFilterSelection )
        {
        FilterSelectionL( aSel );
        }
    else // no filtering; populate all
        {
        // first entry in selection is serviceId
        for ( TInt i = 1; i < aSel.Count(); i++ )
            {
            if ( aSel[i] != iService )
                {
                iSelection->AppendL( aSel.At(i) );
                }
            }
        }
    DoConnectL();
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:30,代码来源:ipsplgimap4populateop.cpp

示例11: TestHiddenEntryStreamsL

LOCAL_C void TestHiddenEntryStreamsL()
{
    CDummyObserver ob;
    CMsvSession* session = CMsvSession::OpenSyncL(ob);
    CleanupStack::PushL(session);
    CMsvEntry* cEntry1 = CMsvEntry::NewL(*session, KMsvRootIndexEntryId, TMsvSelectionOrdering(KMsvNoGrouping, EMsvSortByNone, ETrue));
    CleanupStack::PushL(cEntry1);
    TMsvSelectionOrdering sort(KMsvNoGrouping, EMsvSortByNone, ETrue);
    cEntry1->SetSortTypeL(sort);

    // all services
    CMsvEntrySelection* selection = cEntry1->ChildrenL();
    TInt count=selection->Count();
    while (count--)
        TestEntryStream(*cEntry1, selection->At(count), selection->At(count), EFalse);
    delete selection;

    // local entries
    TestEntryStream(*cEntry1, KMsvLocalServiceIndexEntryId, KMsvLocalServiceIndexEntryId, ETrue);

    CleanupStack::PopAndDestroy(2); // cEntry1,session
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:22,代码来源:T_CLT0.CPP

示例12: UpdateLogicArrayL

// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
//
void CIpsSosAOImapPopLogic::UpdateLogicArrayL( 
        const CMsvEntrySelection& aChilds )
    {
    FUNC_LOG;
    for ( TInt i = 0; i < aChilds.Count(); i++ )
        {
        TBool found = EFalse;
        TMsvId mboxId = aChilds.At(i);
        for ( TInt j = 0; !found && j < iMailboxLogics.Count(); j++  )
            {
            if ( iMailboxLogics[j]->GetMailboxId() == mboxId )
                {
                found = ETrue;
                }
            }
		//<QMail>
        CIpsSosAOSettingsHandler* settings = 
                 CIpsSosAOSettingsHandler::NewL(iSession, mboxId);
        CleanupStack::PushL(settings);
         
        if ( !found  && ( settings->AlwaysOnlineState() 
                != IpsServices::EMailAoOff || 
                    settings->EmailNotificationState() 
                != IpsServices::EMailEmnOff || 
                    !settings->FirstEmnReceived() )
                 )
            {
            CIpsSosAOMBoxLogic* newLogic = CIpsSosAOMBoxLogic::NewL( 
                    iSession, mboxId );
            CleanupStack::PushL( newLogic );
            iMailboxLogics.AppendL( newLogic );
            CleanupStack::Pop( newLogic );
            }
        else if ( found && settings->AlwaysOnlineState() 
                == IpsServices::EMailAoOff &&
                    settings->EmailNotificationState() 
                == IpsServices::EMailEmnOff &&
                    settings->FirstEmnReceived() )
            {
            StopAndRemoveMailboxL( mboxId );
            }
        
        CleanupStack::PopAndDestroy(settings);
		//</QMail>
        }
    
    //finally, check for orphans ( mailbox has been deleted )
    RemoveOrphanLogicsL();
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:52,代码来源:IpsSosAOImapPopLogic.cpp

示例13: AreChildren

TBool CMsvServerEntry::AreChildren(const CMsvEntrySelection& aSelection) const
//
// Returns true if all the entries are children
//
	{
	TInt count = aSelection.Count();
	while (count--)
		{
		if (!IsAChild(aSelection.At(count)))
			{
			return EFalse;
			}
		}
	return ETrue;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:15,代码来源:MSVENTRY.CPP

示例14: TestEntryStream

LOCAL_C void TestEntryStream(CMsvEntry& aEntry, TMsvId aId, TMsvId aService, TBool aAllDescendents)
{
    // get the store
    aEntry.SetEntryL(aId);
    CMsvStore* store=NULL;
    if(aEntry.HasStoreL()) store = aEntry.ReadStoreL();
    test(store==NULL || store->IsPresentL(KUidMsvHiddenEntryStream)==EFalse);
    delete store;
    // recurse into the children
    if (aAllDescendents)
    {
        CMsvEntrySelection* selection = aEntry.ChildrenL();
        TInt count=selection->Count();
        while (count--)
            TestEntryStream(aEntry, selection->At(count), aService, EFalse);
        delete selection;
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:18,代码来源:T_CLT0.CPP

示例15: ServiceIdL

EXPORT_C void CMsvTestUtils::ServiceIdL(TUid aMtm, TMsvId& rFirstId, CMsvEntrySelection* rServiceIds)
	{
//Returns the Service IDs of MTM aMtm

	rFirstId = KMsvNullIndexEntryId;

	SetEntryL(KMsvRootIndexEntryId);

//	TMsvSelectionOrdering oldOrder = aEntry.SortType();
	TMsvSelectionOrdering order;
	order.SetShowInvisibleEntries(ETrue);
	SetSortTypeL(order);

	//Get the children on the Root Index Entry
	CMsvEntrySelection* selection = ChildrenWithTypeLC(KUidMsvServiceEntry);

	TInt count = selection->Count();

	//Find an entry for MTM aMtm
	for (TInt curChild = 0; curChild < count && (rFirstId == KMsvNullIndexEntryId || rServiceIds); curChild++)
		{
		SetEntryL(selection->At(curChild));

		if (Entry().iMtm == aMtm)
			{
			TMsvId id = Entry().Id();

			if (rFirstId == KMsvNullIndexEntryId)
				rFirstId = id;

			if (rServiceIds)
				rServiceIds->AppendL(id);
			}
		}

	//Leave if no Service Entry found for MTM aMtm
	if (rFirstId == KMsvNullIndexEntryId)
		{
		CleanupStack::PopAndDestroy(); //selection
		User::Leave(KErrNotFound);
		}

	CleanupStack::PopAndDestroy(); //selection
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:44,代码来源:msvtestutils.cpp


注:本文中的CMsvEntrySelection::At方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。