本文整理汇总了C++中TMsvEntry::MtmData1方法的典型用法代码示例。如果您正苦于以下问题:C++ TMsvEntry::MtmData1方法的具体用法?C++ TMsvEntry::MtmData1怎么用?C++ TMsvEntry::MtmData1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMsvEntry
的用法示例。
在下文中一共展示了TMsvEntry::MtmData1方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetMessagePathL
void CBtMsgViewerUtils::GetMessagePathL(TPtr aMsgPath, const TInt aMessageId )
{
CMsvEntry* messageEntry = iMsvSession->GetEntryL(aMessageId);
CleanupStack::PushL(messageEntry);
TMsvEntry entry = messageEntry->Entry();
if(entry.MtmData1() == KUidMsgTypeBtTInt32)
{
CMsvStore* store = messageEntry->ReadStoreL();
CleanupStack::PushL(store);
TInt attachmentCount = store->AttachmentManagerL().AttachmentCount();
RFile attachmentFile;
if(attachmentCount != 0)
{
//get file handle for the attachment & the complete path of the file
attachmentFile = store->AttachmentManagerL().GetAttachmentFileL(0);
CleanupClosePushL(attachmentFile);
User::LeaveIfError(attachmentFile.FullName(aMsgPath));
CleanupStack::PopAndDestroy(&attachmentFile);
StoreMessageMimeTypeL(aMsgPath);
//mark attachment as Read
TMsvEntry attachEntry = messageEntry->Entry();
attachEntry.SetUnread(EFalse);
messageEntry->ChangeL(attachEntry);
}
else
{
CClientMtmRegistry* mtmReg = CClientMtmRegistry::NewL(*iMsvSession);
CleanupStack::PushL(mtmReg); //1st Push
CBIOClientMtm* bioClientMtm = (CBIOClientMtm*) mtmReg->NewMtmL(KBioUidValueUid);
CleanupStack::PushL(bioClientMtm); //2nd Push
bioClientMtm->SwitchCurrentEntryL(aMessageId);
CMsvEntry* attachmentEntry = CMsvEntry::NewL(bioClientMtm->Session(),
aMessageId,
TMsvSelectionOrdering());
CleanupStack::PushL(attachmentEntry); //3rd Push
bioClientMtm->LoadMessageL();
CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
CleanupStack::PushL(selection); //4th Push
selection->AppendL(aMessageId);
TBuf8<1> aParameter;
CMsvOperationActiveSchedulerWait* wait = CMsvOperationActiveSchedulerWait::NewLC();
//5th Push
CMsvOperation* operation = bioClientMtm->InvokeAsyncFunctionL(KBiosMtmParse, *selection,
aParameter, wait->iStatus);
wait->Start();
CMsvStore* store = attachmentEntry->ReadStoreL();
CleanupStack::PushL(store); //6th Push
MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
attachmentFile = attachMan.GetAttachmentFileL(0);
CleanupClosePushL(attachmentFile); //7th Push
User::LeaveIfError(attachmentFile.FullName(aMsgPath));
CleanupStack::PopAndDestroy(&attachmentFile);
StoreMessageMimeTypeL(aMsgPath);
//mark attachment as Read
TMsvEntry attachEntry = attachmentEntry->Entry();
attachEntry.SetUnread(EFalse);
attachmentEntry->ChangeL(attachEntry);
delete operation;
CleanupStack::PopAndDestroy(6);
}
CleanupStack::PopAndDestroy(store);
}
else
{
CMsvEntry* attachmentEntry = iMsvSession->GetEntryL((*messageEntry)[0].Id());
CleanupStack::PushL(attachmentEntry); //1st push
CMsvStore* store = attachmentEntry->ReadStoreL();
CleanupStack::PushL(store); //2nd push
TBuf<KMaxPath> attachmentName(store->AttachmentManagerL().GetAttachmentInfoL(0)->AttachmentName());
RFs fs;
User::LeaveIfError(fs.Connect());
CleanupClosePushL(fs);
TEntry entry;
User::LeaveIfError(fs.Entry(attachmentName, entry));
CleanupStack::PopAndDestroy(&fs);
//get file handle for the attachment & the complete path of the file
RFile attachmentFile;
attachmentFile = store->AttachmentManagerL().GetAttachmentFileL(0);
CleanupClosePushL(attachmentFile); //3rd Push
User::LeaveIfError(attachmentFile.FullName(aMsgPath));
CleanupStack::PopAndDestroy(&attachmentFile);
//.........这里部分代码省略.........