通过CMsvSession获取子条目(Entry)ID时进行过滤和排序
来源:互联网 发布:宏程序模拟软件 编辑:程序博客网 时间:2024/06/05 02:47
在使用CMsvSession::GetChildIdsL()获取子条目时可以通过CMsvEntryFilter进行过滤和排序,CMsvEntryFilter提供了下面几种过滤方法:
通过Entry的修改时间过滤
void SetLastChangeDate(const TTime& aLastChange);
Description
Sets the last date change for the filter.
This is used to retrieve entries that have changed since a particular date.
通过Entry的MTM过滤
void SetMtm(TUid aMtm);
Description
Sets the MTM UID for the filter.
通过Entry的Service ID过滤
SetService()
void SetService(TMsvId aServiceId);
Description
Sets the service ID for the filter.
未知
SetSortMtm()
void SetSortMtm(TUid aSortMtm);
Description
Sets the sorting by MTM for the filter.
通过Entry的类型过滤
SetType()
void SetType(TUid aType);
Description
Sets the entry type for the filter.
CMsvEntryFilter还提供了SetOrder()方法对过滤的结果进行排序,该方法通指定TMsvSelectionOrdering对象并设置TMsvSorting中的枚举值可以实现不同的排序方法,另外还可以通过TMsvGrouping指定分组方法:
TMsvSorting:
EMsvSortByNone Don't sort
EMsvSortByDate Date (earliest-latest)
EMsvSortByDateReverse Date (latest-earliest)
EMsvSortBySize Size (smallest-largest)
EMsvSortBySizeReverse Size (largest-smallest)
EMsvSortByDetails To/From (A-Z folded)
EMsvSortByDetailsReverse To/From (Z-A folded)
EMsvSortByDescription Description (A-Z folded)
EMsvSortByDescriptionReverse Description (Z-A folded)
EMsvSortById Sort by message ID.
EMsvSortByIdReverse Sort in reverse order by message ID.
TMsvGrouping:
KMsvNoGrouping
No grouping
KMsvGroupByType
Group by entry type, in order, services, folders, messages, attachments
KMsvGroupByStandardFolders
Place standard folders first, in the order they were created
KMsvGroupByPriority
Group by message priority, in order, high, medium, then low
KMsvGroupByMtm
Group by MTM, either in the order set by CMsvEntry::SetMtmListL() or by MTM Uid value
示例代码:
//Gets a selection containing the IDs of all the context children.
//If the entry has no children, the selection is empty.
//The calling function is responsible for the deletion of
//the returned CMsvEntrySelection
CMsvEntrySelection* CMsgEngine::ChildrenL( TMsvId aMsvId, TBool aShowInvisible ) const
{
TMsvSelectionOrdering order;
order.SetGroupByType( ETrue );
order.SetSorting( EMsvSortByDate );
order.SetShowInvisibleEntries( aShowInvisible );
CMsvEntrySelection *sel = new(ELeave)CMsvEntrySelection;
CMsvEntryFilter * filter = CMsvEntryFilter::NewLC();
filter->SetOrder( order );
iSession->GetChildIdsL( aMsvId, *filter, *sel );
CleanupStack::PopAndDestroy( filter );
return sel;
}
Symbian OS中的消息存储与常用操作
http://blog.csdn.net/beover1984/archive/2006/01/05/571317.aspx
- 通过CMsvSession获取子条目(Entry)ID时进行过滤和排序
- 进程管理:通过父进程ID获取子进程ID
- EASBOS根据id获取对象方法来进行过滤字段
- ucGUI通过ID获取控件WM_GetDialogItem会递归子窗体。
- WIN通过子进程获取父进程ID
- 通过ParserUtil进行过滤
- oracle 递归获取id和id的所有子机构
- 获取当前进程ID和子线程的线程ID
- 通过进程名称获取进程ID、通过子进程ID获取其父进程ID及通过进程ID获取进程名称
- 获取子id
- 通过ID获取元素
- 通过ID获取元素
- 通过Id获取资源
- 实现对ListView中的条目进行排序
- 对DBGrid的数据进行排序和过滤
- 对json数组进行排序和filter过滤
- 对json数组进行排序和filter过滤
- Android联系人列表,实现ListView的A-Z字母排序和过滤搜索功能,字母条目上顶
- gdb参数详解(整理过)
- 敏捷测试指引(7)- 敏捷项目中的测试员
- 19款网站常见多图片自动轮播banner源码
- 对ACE select的考虑
- 从.Net类库代码来看Asp.net运行时
- 通过CMsvSession获取子条目(Entry)ID时进行过滤和排序
- 开证明
- 关于在VC里设置条件断点的技巧: 设定条件为一个字符串指针等于某个字串时
- 怎样从一名程序员过度到项目经理(整理自csdn论坛)
- 扩展 TreeView 实现选择 CheckBox 自动回发
- FreeEIM - 沟通最简单
- 如何对 DataTable 执行 SELECT DISTINCT
- 用css实现链接经过时显示浮动图片背景的效果
- 用js格式化数字(可用于金额的处理)