symbian 实现删除发件箱里面的短信
2010-05-31 20:23:00 来源:WEB开发网在短信引擎的函数 void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1,
TAny* aArg2, TAny* aArg3 );中添加:
case EMsvEntriesMoved://移除短信
{
// Entry id is obtained from the session event arguments.
TMsvId* entryId = STATIC_CAST( TMsvId*, aArg2 );
// We are interested in messages that are moved to Sent Item Folder
if ( *entryId == KMsvSentEntryId )
{
TMsvSelectionOrdering sort;
sort.SetSorting(EMsvSortByDateReverse);
sort.SetShowInvisibleEntries(ETrue); // we want to handle also the invisible entries
CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession, KMsvSentEntryId, sort);
CleanupStack::PushL(parentEntry);
CMsvEntrySelection* entries = parentEntry->ChildrenL();
CleanupStack::PushL(entries);
for(TInt i = 0; i < entries->Count(); i++)
{
if( parentEntry->ChildDataL(entries->At(i)).iMtmData3 != KUidMsgTypeSMS.iUid )
{
parentEntry->DeleteL(entries->At(i));
break;
}
}
CleanupStack::PopAndDestroy( entries );
CleanupStack::PopAndDestroy( parentEntry );
}
break;
}
更多精彩
赞助商链接