本文整理汇总了C++中CMsvEntry::SetSortTypeL方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvEntry::SetSortTypeL方法的具体用法?C++ CMsvEntry::SetSortTypeL怎么用?C++ CMsvEntry::SetSortTypeL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMsvEntry
的用法示例。
在下文中一共展示了CMsvEntry::SetSortTypeL方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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);
}
}
示例3: ReadSmsSettingsFromConfigurationFileL
//.........这里部分代码省略.........
// Status Report Handling
if(scriptFileParser->GetFieldAsString(KScriptItemStatusReportHandling, stringPtr) == KErrNone)
{
CSmsSettings::TSmsReportHandling statusReportHandling = ObtainValueParameterL<CSmsSettings::TSmsReportHandling>(aTestCase, stringPtr);
aSmsSettings.SetStatusReportHandling(statusReportHandling);
}
// Special Message Handling
if(scriptFileParser->GetFieldAsString(KScriptItemSpecialMessageHandling, stringPtr) == KErrNone)
{
CSmsSettings::TSmsReportHandling specialMessageHandling = ObtainValueParameterL<CSmsSettings::TSmsReportHandling>(aTestCase, stringPtr);
aSmsSettings.SetSpecialMessageHandling(specialMessageHandling);
}
// Commdb action
if(scriptFileParser->GetFieldAsString(KScriptItemSmsCommdbAction, stringPtr) == KErrNone)
{
CSmsSettings::TSmsSettingsCommDbAction commdbAction = ObtainValueParameterL<CSmsSettings::TSmsSettingsCommDbAction>(aTestCase, stringPtr);
aSmsSettings.SetCommDbAction(commdbAction);
}
// Sms Bearer Action
if(scriptFileParser->GetFieldAsString(KScriptItemSmsBearerAction, stringPtr) == KErrNone)
{
CSmsSettings::TSmsSettingsCommDbAction smsBearerAction = ObtainValueParameterL<CSmsSettings::TSmsSettingsCommDbAction>(aTestCase, stringPtr);
aSmsSettings.SetSmsBearerAction(smsBearerAction);
}
// Message Conversion
if(scriptFileParser->GetFieldAsString(KScriptItemSmsMessageConversion, stringPtr) == KErrNone)
{
TSmsPIDConversion messageConversion = ObtainValueParameterL<TSmsPIDConversion>(aTestCase, stringPtr);
aSmsSettings.SetMessageConversion(messageConversion);
}
// Vailidity Period Format
if(scriptFileParser->GetFieldAsString(KScriptItemSmsValidityPeriodFormat, stringPtr) == KErrNone)
{
TSmsFirstOctet::TSmsValidityPeriodFormat valPeriodFormat = ObtainValueParameterL<TSmsFirstOctet::TSmsValidityPeriodFormat>(aTestCase, stringPtr);
aSmsSettings.SetValidityPeriodFormat(valPeriodFormat);
}
// Class2 Folder
if(scriptFileParser->GetFieldAsString(KScriptItemClass2Folder, stringPtr) == KErrNone)
{
// Try to find a folder with that name
MDummySessionObserver obser;
CMsvSession* session = CMsvSession::OpenSyncL(obser);
CleanupStack::PushL(session);
CMsvEntry* entry = CMsvEntry::NewL(*session, KMsvLocalServiceIndexEntryId, TMsvSelectionOrdering(KMsvGroupByStandardFolders||KMsvGroupByType,EMsvSortByNone));
CleanupStack::PushL(entry);
entry->SetEntryL(KMsvLocalServiceIndexEntryId); // Search only the local folders
TMsvSelectionOrdering order;
order.SetShowInvisibleEntries(ETrue);
entry->SetSortTypeL(order);
CMsvEntrySelection* selection = entry->ChildrenL();
CleanupStack::PushL(selection);
TBool found = EFalse;
TInt count = selection->Count();
for (TInt i=0; i<count; i++)
{
entry->SetEntryL((*selection)[i]);
if ((stringPtr.CompareF(entry->Entry().iDescription) == 0) ||
(stringPtr.CompareF(entry->Entry().iDetails) == 0))
{
found = ETrue;
break;
}
}
TMsvId entryId = KMsvGlobalInBoxIndexEntryId;
if (found)
entryId = entry->Entry().Id();
else
User::Leave(KErrNotFound);
aSmsSettings.SetClass2Folder(entryId);
CleanupStack::PopAndDestroy(3, session); // selection, entry, session
}
//Last Segment Delivery Report
if(scriptFileParser->GetFieldAsString(KLastSegmentDeliveryReport, stringPtr) == KErrNone)
{
if (stringPtr.CompareF(_L("NO")) == 0)
{
aSmsSettings.SetLastSegmentDeliveryReport(EFalse);
}
else if (stringPtr.CompareF(_L("YES")) == 0)
{
aSmsSettings.SetLastSegmentDeliveryReport(ETrue);
}
}
CleanupStack::PopAndDestroy(scriptFileParser);
}