本文整理汇总了C++中CMsvEntry::ChildrenL方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvEntry::ChildrenL方法的具体用法?C++ CMsvEntry::ChildrenL怎么用?C++ CMsvEntry::ChildrenL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMsvEntry
的用法示例。
在下文中一共展示了CMsvEntry::ChildrenL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: GetAttachmentFileL
/*
-----------------------------------------------------------------------------
RFile GetAttachmentFileL(TMsvAttachmentId aId)
----------------------------------------------------------------------------
*/
void CMailBoxContainer::OpenFileL(TBool /*aOpenWith*/)
{
if(iSession && iSelectionBox)
{
TInt CurrItmIndex = iSelectionBox->CurrentItemIndex();
TMsvSelectionOrdering sort;
sort.SetShowInvisibleEntries(ETrue);
sort.SetSorting(EMsvSortByDate);
// Take a handle to the folder entry
CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession,iCurrentMailBox,sort);
CleanupStack::PushL(parentEntry);
// A selection of all BT entries
CMsvEntrySelection* entries = parentEntry->ChildrenL();//ChildrenWithMtmL(KUidMsgTypeBt);
CleanupStack::PushL(entries);
//Process all entries
if(CurrItmIndex >= 0 && CurrItmIndex < iIDArray->Count())
{
//Get entry
CMsvEntry* btEntry = iSession->GetEntryL(iIDArray->At(CurrItmIndex).iEnt);
CleanupStack::PushL(btEntry);
//Then get entrys child
CMsvEntrySelection* btChildren = btEntry->ChildrenL();
CleanupStack::PushL(btChildren);
btEntry->SetEntryL(iIDArray->At(CurrItmIndex).iMsg);
if (btEntry->HasStoreL())
{
CMsvStore* store = btEntry->ReadStoreL();
CleanupStack::PushL(store);
MMsvAttachmentManager& attMngr = store->AttachmentManagerL();
CMsvAttachment* attachment = attMngr.GetAttachmentInfoL(iIDArray->At(CurrItmIndex).iAtt);
if(attachment)
{
RFile SourceFil(attMngr.GetAttachmentFileL(iIDArray->At(CurrItmIndex).iAtt));
iUtils.GetFileUtils().OpenFileWithHandler(SourceFil);
SourceFil.Close();
}
CleanupStack::PopAndDestroy(store);
}
CleanupStack::PopAndDestroy(2);
}
CleanupStack::PopAndDestroy(2);
}
}
示例3: 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
}
示例4: 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);
}
示例5: FindUserFolderL
// -----------------------------------------------------------------------------
// CMmsAdapterMsvApi::FindUserFolderL
// -----------------------------------------------------------------------------
//
TBool CMmsAdapterMsvApi::FindUserFolderL( const TDesC& aName, TMsvId& aFolder )
{
CMsvEntry* entry = iSession.GetEntryL( KMsvMyFoldersEntryIdValue );
CleanupStack::PushL( entry );
CMsvEntrySelection* selection = entry->ChildrenL();
CleanupStack::PushL( selection );
TBool found( EFalse );
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 &&
aName.Compare(entryT.iDescription) == 0 )
{
found = ETrue;
aFolder = entryT.Id();
break;
}
}
CleanupStack::PopAndDestroy( selection );
CleanupStack::PopAndDestroy( entry );
return found;
}
示例6: 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
}
}
示例7: 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);
}
示例8: 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;
}
示例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;
}
示例10: TestSortingL
TVerdict CTestUTCSort::TestSortingL()
{
TVerdict result=EPass;
//create ordering objects
TMsvSelectionOrdering ordering;
ordering.SetSorting(EMsvSortByDate);
//sort the gloabl inbox by date
CMsvEntry* inboxEntry = CMsvEntry::NewL(*iSession, KMsvDraftEntryIdValue,ordering);
CleanupStack::PushL(inboxEntry);
//retrieve the children of the inbox
CMsvEntrySelection* msvEntrySelection;
msvEntrySelection=inboxEntry->ChildrenL();
CleanupStack::PushL(msvEntrySelection);
CMsvEntry* child;
TMsvEntry childDetails;
TBuf<45> dateTimeString;
//look at the id of each child and test its id, these should
//be in the order the entries were created.
for(TInt i=0;i<KNumEmailMessages;++i)
{
child=iSession->GetEntryL((*msvEntrySelection)[i]);
childDetails=child->Entry();
delete child;
//print the time of the entry to the log file
dateTimeString.Zero();
FormatDateTime(dateTimeString,childDetails.iDate);
INFO_PRINTF2(_L("%S"),&dateTimeString);
if(childDetails.Id()!=iTMsvIdList->At(i))
{
ERR_PRINTF1(_L("Entries in wrong order"));
result=EFail;
break;
}
}
CleanupStack::PopAndDestroy(msvEntrySelection);
CleanupStack::PopAndDestroy(inboxEntry);
return result;
}
示例11: 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);
}
}
示例12: 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;
}
}
示例13: CheckMessageL
TBool CSmsReplyToStep::CheckMessageL()
{
INFO_PRINTF1(_L("Received new message in Inbox - should be status report..."));
TMsvSelectionOrdering ordering;
ordering.ShowInvisibleEntries();
CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId,ordering);
CleanupStack::PushL(entry);
CMsvEntrySelection* msvEntrySelection;
msvEntrySelection=entry->ChildrenL();
CleanupStack::PushL(msvEntrySelection);
// Check how many mesasges there are - should be just 1
TInt count = msvEntrySelection->Count();
INFO_PRINTF3(_L("Number of new messages: %d, should be: %d"), count, 1);
// Restore the message
CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iTestUtils->iRichText);
CleanupStack::PushL(header);
entry->SetEntryL((*msvEntrySelection)[0]);
CMsvStore* store = entry->ReadStoreL();
CleanupStack::PushL(store);
header->RestoreL(*store);
if(store->HasBodyTextL())
{
store->RestoreBodyTextL(*iTestUtils->iRichText);
}
TBuf<KSmsDescriptionLength> desc;
User::LeaveIfError(TSmsUtilities::GetDescription(header->Message(), desc));
//Check for a reply address field
CSmsReplyAddressOperations& operations = STATIC_CAST(CSmsReplyAddressOperations&,header->Message().GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
TBool result=operations.ContainsReplyAddressIEL();
CleanupStack::PopAndDestroy(4,entry);
return result;
}
示例14: TraverseL
void CTestUTCParse::TraverseL(const TMsvId aTMsvId)
{
//open the entry, dont sort
TMsvSelectionOrdering ordering;
ordering.SetSorting(EMsvSortByNone);
CMsvEntry* entry = CMsvEntry::NewL(*iSession, aTMsvId,ordering);
CleanupStack::PushL(entry);
//retrieve the entries children
CMsvEntrySelection* msvEntrySelection;
msvEntrySelection=entry->ChildrenL();
CleanupStack::PushL(msvEntrySelection);
TInt count = entry->Count();
CMsvEntry* child;
TMsvEntry childDetails;
//for each child test if its a message entry
for(TInt i=0;i<count;i++)
{
child=iSession->GetEntryL((*msvEntrySelection)[i]);
childDetails=child->Entry();
if(childDetails.iType==KUidMsvMessageEntry)
{
iMessageEntryCount++;
iTimeList->AppendL(childDetails.iDate);
PrintEntryTime(&childDetails.iDate);
}
//recursive call
TraverseL(childDetails.Id());
if(child)
{
delete child;
}
}
CleanupStack::PopAndDestroy(msvEntrySelection);
CleanupStack::PopAndDestroy(entry);
}
示例15: GetOutboxEntriesL
// ---------------------------------------------------------
// GetOutboxEntries()
// Outgoing Pending message/messages
// ---------------------------------------------------------
TInt MsgStoreHandler::GetOutboxEntriesL(MsgInfo& aFailedIndicatorData,
MsgInfo& aPendingIndicatorData)
{
CMsvEntry* rootEntry = iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
CMsvEntrySelection* messages = rootEntry->ChildrenL();
TInt failedMessageCount = 0;
TInt pendingMessageCount = 0;
for (TInt i = 0; i < messages->Count(); ++i) {
TMsvEntry entry = rootEntry->ChildDataL(messages->At(i));
if ((entry.iMtm != KSenduiMtmSmsUid) && (entry.iMtm != KSenduiMtmMmsUid)) {
continue;
}
if (entry.SendingState() == KMsvSendStateFailed) {
++failedMessageCount;
}
else {
++pendingMessageCount;
}
if (entry.SendingState() == KMsvSendStateFailed) {
ProcessIndicatorDataL(entry.Id(), aFailedIndicatorData);
}
else {
ProcessIndicatorDataL(entry.Id(), aPendingIndicatorData);
}
}
aFailedIndicatorData.mFromSingle = (failedMessageCount > 1) ? false : true;
aPendingIndicatorData.mFromSingle = (pendingMessageCount > 1) ? false : true;
aFailedIndicatorData.mIndicatorType = FailedIndicatorPlugin;
aPendingIndicatorData.mIndicatorType = PendingIndicatorPlugin;
aFailedIndicatorData.mMsgCount = failedMessageCount;
aPendingIndicatorData.mMsgCount = pendingMessageCount;
return KErrNone;
}