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


C++ CMsvAttachment::AttachmentName方法代码示例

本文整理汇总了C++中CMsvAttachment::AttachmentName方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvAttachment::AttachmentName方法的具体用法?C++ CMsvAttachment::AttachmentName怎么用?C++ CMsvAttachment::AttachmentName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMsvAttachment的用法示例。


在下文中一共展示了CMsvAttachment::AttachmentName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CheckAttachmentsL

/**
CheckAttachmentsL()
Compares attachments for the email messages aRecvEntry and aSentEntry using
expected results in aMailInfo

@param aRecvEntry
An identifier for the recieved email

@param aMailInfo
Expected state of recieved email attachments

@param aSentEntry
An identifier for the original email

@return
ETrue if attachments match otherwise EFalse
*/
TBool CT_MsgComparePopEmailMsgs::CheckAttachmentsL(TMsvEntry& aRecvEntry, CExpPop3MailInfo& aMailInfo, TMsvEntry& aSentEntry)
	{
	TBool ret = ETrue;
	CAttachmentItem* recvManager = CAttachmentItem::NewLC(*iSharedDataPOP.iSession, aRecvEntry);
	CAttachmentItem* sentManager = CAttachmentItem::NewLC(*iSharedDataPOP.iSession, aSentEntry);

	TInt recvCount = recvManager->MMsvAttachmentManager().AttachmentCount();	
	TInt sentCount = sentManager->MMsvAttachmentManager().AttachmentCount();

	TFileName recvFileName;
	TFileName sentFileName;

	if(recvCount == aMailInfo.GetNumAttachments())
		{
		for(TInt i=0;i<recvCount;i++)
			{
			for(TInt j=0;j<sentCount;j++)
				{
				CMsvAttachment* recvAttInfo = recvManager->MMsvAttachmentManager().GetAttachmentInfoL(i);
				CleanupStack::PushL(recvAttInfo);

				CMsvAttachment* sentAttInfo = sentManager->MMsvAttachmentManager().GetAttachmentInfoL(j);
				CleanupStack::PushL(sentAttInfo);

				if(recvAttInfo->AttachmentName().Compare(sentAttInfo->AttachmentName()) == 0)
					{
					recvFileName = recvAttInfo->FilePath();
					sentFileName = sentAttInfo->FilePath();
					ret = CompareFilesL(recvFileName, sentFileName);
					}
				CleanupStack::PopAndDestroy(2, recvAttInfo);		
				}
			}
		}
	else
		{
		INFO_PRINTF3(_L("Warning - Expected attachments mismatch recieved (%d) expected (%d)"),
								 recvCount, aMailInfo.GetNumAttachments());
		ret = EFalse;
		}
	CleanupStack::PopAndDestroy(2, recvManager); // recvManager,sentManager
	return ret;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:60,代码来源:T_ComparePopEmailMsgs.cpp

示例2: ExecuteActionL

void CMtfTestActionVerifyAttachmentInfo::ExecuteActionL()
	{
	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionVerifyAttachmentInfo);
	CMsvAttachment* attachmentInfo = ObtainParameterReferenceL<CMsvAttachment>(TestCase(),ActionParameters().Parameter(0));
	HBufC*	paramFileName   = ObtainParameterReferenceL<HBufC>(TestCase(),ActionParameters().Parameter(1));
	TInt	paramFileSize   = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(2));
	HBufC*	paramMimeType   = ObtainParameterReferenceL<HBufC>(TestCase(),ActionParameters().Parameter(3));

	
	TestCase().INFO_PRINTF1(_L("VerifyAttachmentInfo....."));

	TestCase().INFO_PRINTF2(_L("Attachment Name - %S"), &attachmentInfo->AttachmentName());
	TestCase().INFO_PRINTF2(_L("Size - %d"), attachmentInfo->Size());
	
	TBuf<KMimeTypeLength> mimeType;
	mimeType.Copy(attachmentInfo->MimeType());
	TestCase().INFO_PRINTF2(_L("MimeType - %S"), &mimeType);
	

	TestCase().INFO_PRINTF1(_L("With.."));

	TestCase().INFO_PRINTF2(_L("Attachment Name - %S"), paramFileName);
	TestCase().INFO_PRINTF2(_L("Size - %d"), paramFileSize);
	TestCase().INFO_PRINTF2(_L("MimeType - %S"), paramMimeType);

	if ( 
		(paramFileName->Compare(attachmentInfo->AttachmentName()) == 0) &&
		(paramMimeType->Compare(mimeType) == 0) &&
		(paramFileSize == attachmentInfo->Size())
	   )
		{		
		}
	else
		{
		User::Leave(KErrGeneral);
		}

	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionVerifyAttachmentInfo);
	TestCase().ActionCompletedL(*this);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:40,代码来源:CMtfTestActionVerifyAttachmentInfo.cpp

示例3: GetAttachmentFileL

/*
-----------------------------------------------------------------------------
RFile GetAttachmentFileL(TMsvAttachmentId aId)
----------------------------------------------------------------------------
*/
void CMailBoxContainer::CopyFileL(const TDesC& aFolderName)
{

	TFileName fileName,FullFilName;

	if(iSession && iSelectionBox && iListArray)
	{	
		TInt CurrItmIndex = iSelCopyItemIndex;
		iSelCopyItemIndex = -1;
		
		if(CurrItmIndex < 0 || CurrItmIndex >= iIDArray->Count())
		{
			CurrItmIndex = iSelectionBox->CurrentItemIndex();
		}
		
		TMsvSelectionOrdering sort;
		sort.SetShowInvisibleEntries(ETrue);
		sort.SetSorting(EMsvSortByDate);
		// Take a handle to the folder entry
		CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession,iCurrentMailBox,sort);
		CleanupStack::PushL(parentEntry);
		
		// A selection of all BT entries
		CMsvEntrySelection* entries = parentEntry->ChildrenL();//ChildrenWithMtmL(KUidMsgTypeBt);
		CleanupStack::PushL(entries);
			
		//Process all entries
		if(CurrItmIndex >= 0 && CurrItmIndex < iIDArray->Count())
		{
			//Get entry
			CMsvEntry* btEntry = iSession->GetEntryL(iIDArray->At(CurrItmIndex).iEnt);
			CleanupStack::PushL(btEntry);
			
			//Then get entrys child
			CMsvEntrySelection* btChildren = btEntry->ChildrenL();
			CleanupStack::PushL(btChildren);
		
			btEntry->SetEntryL(iIDArray->At(CurrItmIndex).iMsg);
									
	
			if (btEntry->HasStoreL())
			{
				CMsvStore* store = btEntry->ReadStoreL();
				CleanupStack::PushL(store);
				
				MMsvAttachmentManager& attMngr = store->AttachmentManagerL();
				CMsvAttachment* attachment = attMngr.GetAttachmentInfoL(iIDArray->At(CurrItmIndex).iAtt);
				if(attachment)
				{
					fileName.Copy(attachment->AttachmentName());
					
					delete attachment;
					attachment = NULL;
				
					TBool OkToSave(EFalse),SkipMe(EFalse);
				
					do
					{
						FullFilName.Zero();
						StringLoader::Load(FullFilName,R_SH_STR_FILENAME);
					
						CAknTextQueryDialog* Dialog = CAknTextQueryDialog::NewL(fileName,CAknQueryDialog::ENoTone);
						Dialog->PrepareLC(R_ASK_NAME_DIALOG);
						Dialog->SetPromptL(FullFilName);
						if(Dialog->RunLD())
						{
							FullFilName.Copy(aFolderName);
							FullFilName.Append(fileName);
			
							if(BaflUtils::FileExists(CEikonEnv::Static()->FsSession(),FullFilName))
							{
								HBufC* TmpText = StringLoader::LoadLC(R_SH_STR_FILOVERRT);
								
								CAknQueryDialog* dlg = CAknQueryDialog::NewL();
								if(dlg->ExecuteLD(R_QUERY,*TmpText))
								{
									TInt Err = CEikonEnv::Static()->FsSession().Delete(FullFilName);
									if(Err == KErrNone)
									{
										OkToSave = ETrue;
									}
									else
									{
										iUtils.GetFileUtils().ShowFileErrorNoteL(FullFilName,Err);
									}
								}
								
								CleanupStack::PopAndDestroy(TmpText);
							}
							else
							{
								OkToSave = ETrue;
							}
						}
						else
//.........这里部分代码省略.........
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:101,代码来源:mail_Container.cpp


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