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


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

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


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

示例1: SendSmtpMessageL

LOCAL_C void SendSmtpMessageL()
	{
	CTestActive* testActive = new (ELeave) CTestActive();
	CleanupStack::PushL(testActive);
	testUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
	testUtils->InstantiateSmtpClientMtmL();
	CMsvEntrySelection* sendSel = testUtils->iMsvEntry->ChildrenL();
	CleanupStack::PushL(sendSel);
	TInt count = sendSel->Count();
	test(count >= 1);
	testUtils->Printf(KMsgSend, count);
	testUtils->iSmtpClientMtm->SetCurrentEntryL(testUtils->iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId));
	CMsvOperation* msvOperation = testUtils->iSmtpClientMtm->Entry().CopyL(*sendSel, smtpService, testActive->iStatus);
	CleanupStack::PushL(msvOperation);
	testActive->StartL();
	CActiveScheduler::Start();
	//check progress
    testUtils->Printf(KMsgCompleted, testActive->iStatus.Int()); 
	CMsvEntrySelection* sendSelc = testUtils->iMsvEntry->ChildrenL();
	TInt noOfMessages = sendSelc->Count();
	// Check Whether the mails in Outbox is Zero (i.e. mails has been sent..).
    test(noOfMessages == 0);
  	delete sendSelc;
 	TImSmtpProgress temp;	
	TPckgC<TImSmtpProgress> paramPack(temp);
	const TDesC8& progBuf = msvOperation->ProgressL();
	paramPack.Set(progBuf);
	TImSmtpProgress progress = paramPack();	
	testUtils->Printf(KProgressError, progress.Error()); 
	test(progress.Error()==0);
	CleanupStack::PopAndDestroy(3,testActive); //msvOperation,sendsel,testActive
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:32,代码来源:T_INC083099_Enquire_Email_Structure.cpp

示例2: ResetSubscriptionFlagsL

/**
Reset subscription flags for all children, and recurse into folders

@param aFolder
Folder from which to start the flags resetting
*/
void CImapOpSyncSubs::ResetSubscriptionFlagsL(const TMsvId aFolder)
	{
	// Do this one
	SetEntryL(aFolder);
	TMsvEmailEntry entry = iServerEntry.Entry();

	// A folder or service? If not, return
	if (entry.iType!=KUidMsvServiceEntry &&
		entry.iType!=KUidMsvFolderEntry)
		{
		return;
		}

	// Reset flag if needed
	if (entry.Subscribed())
		{
		// Reset flag and save
		entry.SetSubscribed(EFalse);
		ChangeEntryL(entry);
		}

	// Any children?
	CMsvEntrySelection *children = new (ELeave) CMsvEntrySelection;
	CleanupStack::PushL(children);
	GetChildrenL(*children);
	if (children->Count())
		{
		// Do each in turn
		for(TInt child = 0; child<children->Count(); ++child)
			{
			ResetSubscriptionFlagsL((*children)[child]);
			}
		}
	CleanupStack::PopAndDestroy();
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:41,代码来源:cimapopsyncsubs.cpp

示例3: PrepareMsvEntryL

// ----------------------------------------------------------------------------
// CIpsPlgNewChildPartFromFileOperation::PrepareMsvEntryL
// ----------------------------------------------------------------------------
//
void CIpsPlgNewChildPartFromFileOperation::PrepareMsvEntryL()
    {
    // Dig out the entry ID of the new attachment
    iMessage->GetAttachmentsListL( iEntry->Entry().Id( ), 
        CImEmailMessage::EAllAttachments, CImEmailMessage::EThisMessageOnly );
    TKeyArrayFix key( 0, ECmpTInt32 );
    CMsvEntrySelection* attachmentIds = iMessage->Selection().CopyLC();
    attachmentIds->Sort( key );
    if ( !attachmentIds->Count() )
        {
        User::Leave( KErrGeneral );
        }
    iNewAttachmentId = (*attachmentIds)[ attachmentIds->Count()-1 ];
    CleanupStack::PopAndDestroy( attachmentIds );
    
    CMsvEntry* cAtta = iMsvSession.GetEntryL( iNewAttachmentId );
    CleanupStack::PushL( cAtta );
    
    // Set filename to iDetails
    TMsvEntry tEntry = cAtta->Entry();
    tEntry.iDetails.Set(iFilePath->Des());

    // Do async
    iOperation = cAtta->ChangeL( tEntry, iStatus );
    CleanupStack::PopAndDestroy( cAtta );
    iStep = EPrepareStore; // Next step
    SetActive();
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:32,代码来源:ipsplgnewchildpartfromfileoperation.cpp

示例4: AddEmailFoldersL

/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CMailBoxContainer::AddEmailFoldersL(CMsvSession* aSession)
{
	if(aSession)
	{	
		CMsvEntry *localServiceEntry = aSession->GetEntryL(KMsvRootIndexEntryId);//KMsvLocalServiceIndexEntryId);
		CleanupStack::PushL(localServiceEntry);
		CMsvEntrySelection *folders = localServiceEntry->ChildrenL();
		CleanupStack::PushL(folders);

		if(folders->Count() > 1) // first is local folder
		{
			for (TInt i = 1;i <  folders->Count();i++)
			{
				TMsvEntry ExtraFolder = localServiceEntry->ChildDataL((*folders)[i]);
				
				CMailFldItem* NewIttem = new(ELeave)CMailFldItem();
				CleanupStack::PushL(NewIttem);
					
				NewIttem->iTitle = ExtraFolder.iDetails.AllocL();
				NewIttem->iMscId = 	ExtraFolder.Id();
			
				CleanupStack::Pop();//NewIttem
				iFolderArray.Append(NewIttem);
			}
		}
		
		CleanupStack::PopAndDestroy(2); // localServiceEntry, folders
	}
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:33,代码来源:mail_Container.cpp

示例5: ExecuteActionL

void CMtfTestActionSetUserResponse::ExecuteActionL()
	{	
	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionSetUserResponse);
	CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession> (TestCase(),ActionParameters().Parameter(0));	
	TInt paramUserResponse = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(1),EFalse);
	
	CMsvEntry* cEntry = CMsvEntry::NewL(*paramSession, KMsvDraftEntryId, 
						TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue));
	CleanupStack::PushL(cEntry);
	
	CMsvEntrySelection* selection = cEntry->ChildrenL();
	CleanupStack::PushL(selection);

	TestCase().INFO_PRINTF2(_L("Count of Draft Folder's selection is %d"),selection->Count());
	
	if (selection->Count() == 0)
	{	
	User::Leave(KErrNotFound);
	}
	
	cEntry->SetEntryL((*selection)[0]);

	if (!paramUserResponse)
	{	
	TMsvEntry entry = cEntry->Entry();
	entry.iError = KErrCancel;
	cEntry->ChangeL(entry);
	}
	
	CleanupStack::PopAndDestroy(2);
	
	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionSetUserResponse);
	TestCase().ActionCompletedL(*this);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:34,代码来源:CMtfTestActionSetUserResponse.cpp

示例6: 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

示例7: TestInitialStructureL

LOCAL_C void TestInitialStructureL(CMsvServer& aServer)
	{
	TInt services=1;
	TInt localFolders=5;

	CMsvServerEntry* sEntry = CMsvServerEntry::NewL(aServer, KMsvRootIndexEntryId);
	CleanupStack::PushL(sEntry);
	CMsvEntrySelection* selection = new(ELeave)CMsvEntrySelection;
	CleanupStack::PushL(selection);
	TMsvSelectionOrdering sort(KMsvNoGrouping, EMsvSortByNone, ETrue);
	sEntry->SetSort(sort);

	// root
	REPORT_IF_ERROR(sEntry->SetEntry(KMsvRootIndexEntryId));
	test(sEntry->Entry().iDetails==KNullDesC);
	test(sEntry->Entry().iDescription==KNullDesC);
	REPORT_IF_ERROR(sEntry->GetChildren(*selection));
	test(selection->Count()==services);
	
	// local service
	REPORT_IF_ERROR(sEntry->SetEntry(KMsvLocalServiceIndexEntryId));
	test(sEntry->Entry().iDetails==_L("Local"));
	REPORT_IF_ERROR(sEntry->GetChildren(*selection));
	test(selection->Count()==localFolders);

	// standard folders
	REPORT_IF_ERROR(sEntry->SetEntry(KMsvGlobalInBoxIndexEntryId));
	test(sEntry->Entry().iDetails==_L("Inbox"));
	REPORT_IF_ERROR(sEntry->SetEntry(KMsvGlobalOutBoxIndexEntryId));
	test(sEntry->Entry().iDetails==_L("Outbox"));
	REPORT_IF_ERROR(sEntry->SetEntry(KMsvDraftEntryId));
	test(sEntry->Entry().iDetails==_L("Drafts"));
	REPORT_IF_ERROR(sEntry->SetEntry(KMsvSentEntryId));
	test(sEntry->Entry().iDetails==_L("Sent"));
	REPORT_IF_ERROR(sEntry->SetEntry(KMsvDeletedEntryFolderEntryId));
	test(sEntry->Entry().iDetails==_L("Deleted"));

	// check that only the index file and the local services dir are present
	CDir* dir;
	const TUidType type(KMsvEntryFile, KMsvEntryFile, KNullUid);
	REPORT_IF_ERROR(theUtils->FileSession().GetDir(KTestFolder,type , ESortNone, dir));
	TInt count=dir->Count();
	test(count==0) ;
	delete dir;

	// check that the local services dir is empty
	TFileName filename;
	filename.Append(KTestLocalService);
	filename.Append(_L("\\"));
	REPORT_IF_ERROR(theUtils->FileSession().GetDir(filename,type , ESortNone, dir));
	count=dir->Count();
	test(count==0) ;
	delete dir;

	CleanupStack::PopAndDestroy(2); // sEntry,selection
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:56,代码来源:T_REBLD.CPP

示例8: HandleEntryEventL

void CEntryObserver::HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/)
{
    if (aEvent == EMsvNewChildren && iCurrentMessageNum > -1)
    {
        CMsvEntrySelection* msgs = (CMsvEntrySelection*)aArg1;

        TInt count = msgs->Count();

        TInt msgRecv = 0;

        while (count--)
        {
            TMsvId id = (*msgs)[count];

            CSmsHeader* header = iSmsTest.GetHeaderLC(id);

            if (header->Type() == CSmsPDU::ESmsDeliver)
            {
                iReceived->AppendL(id);
                msgRecv++;
            }

            CleanupStack::PopAndDestroy(header);
        }

        if (msgRecv)
            iSmsTest.Printf(_L("%d Messages Received in inbox\n"), msgRecv);
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:29,代码来源:T_SmsSendRecv.cpp

示例9: CountChildrenL

TInt CMtfTestActionCheckChildrenCountWithFlagBase::CountChildrenL(TMsvId aParent, CMsvSession& aSession)
	{
	TInt children = 0;
	// Get children at this level

	CMsvEntry* entryContext = CMsvEntry::NewL(aSession, aParent, 
	    	TMsvSelectionOrdering(KMsvNoGrouping, EMsvSortByNone, ETrue));
	CleanupStack::PushL(entryContext);
	
	entryContext->SetEntryL(aParent);
	TMsvSelectionOrdering order;
	order.SetShowInvisibleEntries(ETrue);
	entryContext->SetSortTypeL(order);
	
	CMsvEntrySelection* selection = entryContext->ChildrenL();
	CleanupStack::PushL(selection);
	
	// for each child
	TInt count=selection->Count();
	for(TInt child=0;child<count;child++)
		{
		entryContext->SetEntryL((*selection)[child]);
		TMsvEntry entry=entryContext->Entry();
		if (entry.iType==KUidMsvMessageEntry && FlagIsSet(entry) )
			{
			++children;
			}
		// if this is a folder then recurse
		if (entry.iType==KUidMsvFolderEntry)
			children +=CountChildrenL((*selection)[child], aSession);
		}
	CleanupStack::PopAndDestroy(2); // selection,entryContext
	return children;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:34,代码来源:CMtfTestActionCheckChildrenCountWithFlagBase.cpp

示例10: ConfirmMessagesSavedL

/** confirm the message has been stored.
	Writes the number of stored messages found to the log file - if present.
	@param void
	@return TBool
		returns ETrue if messages found
		returns EFalse if no messages found 
*/
TBool CWapPushSIMessageTest::ConfirmMessagesSavedL()
	{
	CSISLPushMsgUtils* wapPushUtils = CSISLPushMsgUtils::NewL();
	CleanupStack::PushL(wapPushUtils);
	
	TMsvId localFolderId;
	wapPushUtils->GetPushMsgFolderIdL(localFolderId);
	
	const TDesC& siId16 = _L("http://www.xyz.com/ppaid/123/abc.wml"); 
	CMsvEntrySelection* matchingIdList = wapPushUtils->FindSiIdLC(siId16);

	// check there are any entries - zero indicates no matches
	TInt foundCount;
	if (matchingIdList) 
		foundCount = matchingIdList->Count(); 
	else
		foundCount = 0;
	
	TBuf<KPushLogBuffer> buf;
	_LIT(KLogSICount,"SI messages stored:\t%d");
	buf.Format(KLogSICount,foundCount);
	WPLPrintf(buf);	

	CleanupStack::PopAndDestroy(2);  // wapPushUtils, matchingIdList
	return foundCount;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:33,代码来源:t_simessage.cpp

示例11: ScheduleL

/**
Schedules messages on the task scheduler.

Messages that are successfully scheduled have their sending state set to
KMsvSendStateScheduled.

@param aSelection 
Array of message IDs that need to be scheduled. This array cannot be empty.
All the messages identified in the selection must belong to the same MTM;
be scheduled for the same time; have the same setting for their OffPeak() 
flag; have the scheduled time stored in the iDate member of their 
corresponding TMsvEntry. 

@param aPackage 
Scheduling options

@leave Any error code but KErrLocked and KErrNotFound
The method overloading CMsvScheduledEntry::GetMessageL() left with an error,
i.e. the scheduling info of one of the messages from the selection could not
be retrieved from the message server.

@leave Any error code
Unable to reset the previous scheduling info for a message.

@panic ScheduleSend-DLL 0
The array of message IDs is empty.
Debug build only.

@panic ScheduleSend-DLL 1
At least one of the selected messages is scheduled for a different time
as the others.
Debug build only.

@panic ScheduleSend-DLL 2
At least one of the selected messages does not belong to the same MTM.
Debug build only.

@panic ScheduleSend-DLL 3
At least one of the selected messages does not have the same off-peak 
settings as the others.
Debug build only.
*/
EXPORT_C void CMsvScheduleSend::ScheduleL(const CMsvEntrySelection& aSelection, const TMsvSchedulePackage& aPackage)
	{
	__ASSERT_DEBUG(aSelection.Count() > 0, gPanic(EMessageSelectionEmpty));

	iPackage = aPackage;
	GetMessagesL(aSelection);	//Leaves with KErrNotFound if there
																	//are no messages returned in schEntries
	TInt entryCount = iSchEntries->Count();
	SCHSENDLOG(FLog(_L8("Asked to schedule %d msgs"), entryCount));
	
	if (entryCount)
		{
		TTime startTime;

#if defined(_DEBUG)
		CMsvScheduledEntry* firstEntry = (*iSchEntries)[0];
#endif

		while (entryCount--)
			{
			CMsvScheduledEntry* message = iSchEntries->At(entryCount);
			__ASSERT_DEBUG(firstEntry->ScheduleDate() == message->ScheduleDate(), gPanic(EMessagesNotSameTime));

			startTime = message->ScheduleDate();

			// Reset previous scheduling info
			DeleteScheduleForEntryL(*message);
			ResetScheduleInfoForEntryL(*message, EFalse);
			}

		//Schedule the messages
		DoScheduleL(*iSchEntries, KMsvSendStateScheduled, startTime, EFalse);
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:76,代码来源:MsvScheduleSend.cpp

示例12: FindFolderL

TMsvId CTestImapSyncManager::FindFolderL(const TDesC& aName, TBool aCaseSensitive)
	{
	TMsvId remoteId = KErrNotFound;
	iEntry->SetEntry(iServiceId);
	CMsvEntrySelection* msvEntrySelection = new (ELeave) CMsvEntrySelection;
	iEntry->GetChildren(*msvEntrySelection);
	TPtrC iEntryName = aName;
	TInt count = msvEntrySelection->Count();
	for (TInt i=0; i<count; i++) 
		{	
		iEntry->SetEntry((*msvEntrySelection)[i]);
		
		if (aCaseSensitive)
			{
			if (iEntryName.Compare(iEntry->Entry().iDetails ) == 0)
				{
				remoteId = (*msvEntrySelection)[i];
				break;
				}
			}
		else if ((iEntryName.CompareF(iEntry->Entry().iDetails) == 0))
			{
			remoteId = (*msvEntrySelection)[i];
			break;
			}
		}
		delete msvEntrySelection;
	return remoteId;	
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:29,代码来源:ctestimapsyncmanager.cpp

示例13: CheckNoAttachmentsL

void CheckNoAttachmentsL()
	{
	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);

	test(selection->Count() == 1);
	cEntry->SetEntryL((*selection)[0]);

	if (cEntry->HasStoreL())
		{
		CMsvStore* store = cEntry->ReadStoreL();
		CleanupStack::PushL(store);
	
		MMsvAttachmentManager& attachmentMgr = store->AttachmentManagerL();
		test(attachmentMgr.AttachmentCount() == 0);
		CleanupStack::PopAndDestroy(store);
		}

	CleanupStack::PopAndDestroy(4, ob1); // selection, cEntry, session, ob1
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:30,代码来源:T_SendAs_Message_Send_Cancel.cpp

示例14: GetFoldersL

/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CMailBoxContainer::GetFoldersL(void)
{
	iFolderArray.ResetAndDestroy();
	
	if(iSession)
	{	
		
		CMsvEntry *localServiceEntry = iSession->GetEntryL(KMsvLocalServiceIndexEntryId);
		CleanupStack::PushL(localServiceEntry);
		CMsvEntrySelection *folders = localServiceEntry->ChildrenWithTypeL(KUidMsvFolderEntry);
		CleanupStack::PushL(folders);

		for (TInt i = 0;i <  folders->Count();i++)
		{
			TMsvEntry ExtraFolder = localServiceEntry->ChildDataL((*folders)[i]);
			
			CMailFldItem* NewIttem = new(ELeave)CMailFldItem();
			CleanupStack::PushL(NewIttem);
			
			NewIttem->iTitle = ExtraFolder.iDetails.AllocL();
			NewIttem->iMscId = 	ExtraFolder.Id();

			CleanupStack::Pop();//NewIttem
			iFolderArray.Append(NewIttem);
		}
		
		CleanupStack::PopAndDestroy(2); // localServiceEntry, folders
	
	
		AddEmailFoldersL(iSession);
	}
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:36,代码来源:mail_Container.cpp

示例15: GetEntryCountL

TInt CPartialDownloadStep::GetEntryCountL()
	{
	
	TImapAccount imapAccount=iImapClient->GetImapAccount();
	
	TMsvSelectionOrdering ordering;	

	//open the imap service entry
	CMsvEntry* imapService = CMsvEntry::NewL(*iSession,imapAccount.iImapService,ordering);
	CleanupStack::PushL(imapService);
	//get its children
	CMsvEntrySelection* msvEntrySelection;
	msvEntrySelection=imapService->ChildrenL();
	//open its child inbox entry
	CMsvEntry* inboxEntry = CMsvEntry::NewL(*iSession, (*msvEntrySelection)[0],ordering);
    CleanupStack::PushL(inboxEntry);
    
    //get the childeren of the inbox
    delete msvEntrySelection;
    msvEntrySelection=NULL;
    msvEntrySelection=inboxEntry->ChildrenL();
    //the count should be 2
    TInt count=msvEntrySelection->Count();
    
    delete msvEntrySelection;
    msvEntrySelection=NULL;	
	CleanupStack::PopAndDestroy(2,imapService);
	
	return count;
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:30,代码来源:T_PartialDownloadStep.cpp


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