当前位置: 首页>>代码示例>>C++>>正文


C++ TMsvEntry::MtmData1方法代码示例

本文整理汇总了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);
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:101,代码来源:btmsgviewerutils.cpp


注:本文中的TMsvEntry::MtmData1方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。