本文整理汇总了C++中CMsvAttachment::FilePath方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvAttachment::FilePath方法的具体用法?C++ CMsvAttachment::FilePath怎么用?C++ CMsvAttachment::FilePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMsvAttachment
的用法示例。
在下文中一共展示了CMsvAttachment::FilePath方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getBodyTextFromAttManL
//---------------------------------------------------------------
// CNativeMmsUtility::getBodyTextFromAttManL
// @see header
//---------------------------------------------------------------
void CNativeMmsUtility::getBodyTextFromAttManL(QString& returnbuf)
{
#ifdef _DEBUG_TRACES_
qDebug() << " Enter CNativeMmsUtility::getBodyTextFromAttManL";
#endif
TUint count = iattachmanager->AttachmentCount();
for (int i = 0; i < count; i++)
{
CMsvAttachment *attachment = iattachmanager->GetAttachmentInfoL(i);
TPtrC8 mimetype = attachment->MimeType();
if (!isAttachment(attachment) && mimetype.CompareF(KMsgMimeTextPlain)
== 0)
{
QString filepath =
XQConversions::s60DescToQString(attachment->FilePath());
readFileIntoBuffer(filepath, returnbuf);
break;
}
}
#ifdef _DEBUG_TRACES_
qDebug() << " Exit CNativeMmsUtility::getBodyTextFromAttManL";
#endif
return;
}
示例2: getSmilFileL
//---------------------------------------------------------------
// CNativeMmsUtility::getSmilFileL
// @see header
//---------------------------------------------------------------
const QString CNativeMmsUtility::getSmilFileL()
{
#ifdef _DEBUG_TRACES_
qDebug() << " Enter CNativeMmsUtility::getSmilFileL";
#endif
TUint count = iattachmanager->AttachmentCount();
for (int i = 0; i < count; i++)
{
CMsvAttachment *attachment = iattachmanager->GetAttachmentInfoL(i);
if (attachment->MimeType().CompareF(KMsgMimeSmil) == 0)
{
#ifdef _DEBUG_TRACES_
qDebug() << " Exit CNativeMmsUtility::getSmilFileL";
#endif
return XQConversions::s60DescToQString(attachment->FilePath());
}
}
#ifdef _DEBUG_TRACES_
qDebug() << " Exit CNativeMmsUtility::getSmilFileL";
#endif
return QString();
}
示例3: 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;
}
示例4: getAttachmentListFromAttManL
//---------------------------------------------------------------
// CNativeMmsUtility::getAttachmentListFromAttManL
// @see header
//---------------------------------------------------------------
void CNativeMmsUtility::getAttachmentListFromAttManL(
ConvergedMessageAttachmentList& attachmentlist)
{
#ifdef _DEBUG_TRACES_
qDebug() << " Enter CNativeMmsUtility::getAttachmentListFromAttManL";
#endif
TUint count = iattachmanager->AttachmentCount();
for (int i = 0; i < count; i++)
{
CMsvAttachment *attachment = iattachmanager->GetAttachmentInfoL(i);
TPtrC8 mimetype = attachment->MimeType();
QString filepath =
XQConversions::s60DescToQString(attachment->FilePath());
// converting directory separators from native to
// universal (QT) format
filepath.replace(KBackwardSlash, KForwardSlash);
quint16 attachmenttype;
if (isAttachment(attachment))
attachmenttype = ConvergedMessageAttachment::EAttachment;
else
attachmenttype = ConvergedMessageAttachment::EUnknown;
//smil files aren't of either type
if (mimetype.CompareF(KMsgMimeSmil) == 0)
{
ConvergedMessageAttachment
* targetatt =
new ConvergedMessageAttachment(filepath,
ConvergedMessageAttachment::ESmil);
attachmentlist << targetatt;
}
else
{
ConvergedMessageAttachment* targetatt =
new ConvergedMessageAttachment(filepath, attachmenttype);
attachmentlist << targetatt;
}
}
#ifdef _DEBUG_TRACES_
qDebug() << " Exit CNativeMmsUtility::getAttachmentListFromAttManL";
#endif
}
示例5: getByUrlL
//---------------------------------------------------------------
// CNativeMmsUtility::getByUrlL
// @see header
//---------------------------------------------------------------
const QString CNativeMmsUtility::getByUrlL(const TDesC& url)
{
#ifdef _DEBUG_TRACES_
qDebug() << " Enter CNativeMmsUtility::getByUrlL";
#endif
CMsvAttachment* targetattachment = NULL;
TBool found = EFalse;
//newlc puts it on cleanupstack
HBufC8* url8bit = HBufC8::NewLC(url.Length());
CUri16* decodedUri = NULL;
TUriParser8 parser;
//get the uri in display format
if (url.MatchF(KContentIdString) == 0)
{
//Remove "cid:" from the beginning
url8bit->Des().Copy(url.Right(url.Length()
- KContentIdString().Length() + 1));
parser.Parse(*url8bit);
}
else
{
url8bit->Des().Copy(url);
parser.Parse(*url8bit);
}
decodedUri = UriUtils::ConvertToDisplayFormL(parser);
CleanupStack::PushL(decodedUri);
//run through the attachements to check for a match
TUint count = iattachmanager->AttachmentCount();
for (int i = 0; i < count && !found; i++)
{
CMsvAttachment *attachment = iattachmanager->GetAttachmentInfoL(i);
CleanupStack::PushL(attachment);
//restore mimeheaders from the attachment
CMsvMimeHeaders* mimeheaders = CMsvMimeHeaders::NewL();
CleanupStack::PushL(mimeheaders);
mimeheaders->RestoreL(*attachment);
//check for a match with content-loc and then content-id
if (resolvedByContentLocL(mimeheaders->ContentLocation(), *decodedUri)
|| resolvedByContentIdL(mimeheaders->ContentId(), *decodedUri))
{
targetattachment = CMsvAttachment::NewL(*attachment);
found = ETrue;
}
CleanupStack::PopAndDestroy(2, attachment); //mimeheaders, attachment
}
CleanupStack::PopAndDestroy(decodedUri);
if (url8bit)
CleanupStack::PopAndDestroy(url8bit);
if (targetattachment)
{
#ifdef _DEBUG_TRACES_
qDebug() << " Exit CNativeMmsUtility::getByUrlL";
#endif
return XQConversions::s60DescToQString(targetattachment->FilePath());
}
else
{
#ifdef _DEBUG_TRACES_
qDebug() << " Exit CNativeMmsUtility::getByUrlL";
#endif
return QString();
}
}
示例6: getRemainingAttachmentsFromAttManL
//---------------------------------------------------------------
// CNativeMmsUtility::getRemainingAttachmentsFromAttManL
// @see header
//---------------------------------------------------------------
void CNativeMmsUtility::getRemainingAttachmentsFromAttManL(
ConvergedMessageAttachmentList& attachmentlist)
{
#ifdef _DEBUG_TRACES_
qDebug() << " Enter CNativeMmsUtility::getRemainingAttachmentsFromAttManL";
#endif
TUint count = iattachmanager->AttachmentCount();
for (int i = 0; i < count; i++)
{
CMsvAttachment *attachment = iattachmanager->GetAttachmentInfoL(i);
TPtrC8 mimetype = attachment->MimeType();
QString filepath =
XQConversions::s60DescToQString(attachment->FilePath());
// converting directory separators from native to
// universal (QT) format
filepath.replace(KBackwardSlash, KForwardSlash);
//create convergedmessage attachment to match with inline objects
ConvergedMessageAttachment
compareatt(filepath, ConvergedMessageAttachment::EInline);
//before adding to the list check if already present in the list
TBool found = EFalse;
TUint listcount = attachmentlist.count();
for (int j = 0; j < listcount && !found; j++)
{
if (compareatt == *attachmentlist.at(j))
{
found = ETrue;
}
}
//no match found in the list
if (!found)
{
//smil files aren't of either type
if (mimetype.CompareF(KMsgMimeSmil) == 0)
{
ConvergedMessageAttachment
* targetatt =
new ConvergedMessageAttachment(filepath,
ConvergedMessageAttachment::ESmil);
attachmentlist << targetatt;
}
else
{
ConvergedMessageAttachment
* targetatt =
new ConvergedMessageAttachment(filepath,
ConvergedMessageAttachment::EAttachment);
attachmentlist << targetatt;
}
}
}
#ifdef _DEBUG_TRACES_
qDebug() << " Exit CNativeMmsUtility::getRemainingAttachmentsFromAttManL";
#endif
return;
}
示例7: CheckNewAttachmentL
void CheckNewAttachmentL(const TDesC& aFileName, TInt aFileSize, const TDesC8& aMimeType, TUint aCharset, TBool aLinkedAttachment)
{
// Check that file exists in the store and it matches our control file.
CDummyObserver* ob1 = new(ELeave) CDummyObserver;
CleanupStack::PushL(ob1);
CMsvSession* session = CMsvSession::OpenSyncL(*ob1);
CleanupStack::PushL(session);
CMsvEntry* cEntry = CMsvEntry::NewL(*session, KMsvDraftEntryId,
TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue));
CleanupStack::PushL(cEntry);
CMsvEntrySelection* selection = cEntry->ChildrenL();
CleanupStack::PushL(selection);
test(selection->Count() == 1);
cEntry->SetEntryL((*selection)[0]);
CMsvStore* store = cEntry->ReadStoreL();
CleanupStack::PushL(store);
MMsvAttachmentManager& attachmentMgr = store->AttachmentManagerL();
TInt count = attachmentMgr.AttachmentCount();
test(count > 0);
TBool found = EFalse;
while( count-- > 0 && !found )
{
CMsvAttachment* attachmentInfo = attachmentMgr.GetAttachmentInfoL(count);
CleanupStack::PushL(attachmentInfo);
// Check the attachment info is what we expect.
TParse parser1;
TParse parser2;
parser1.Set(attachmentInfo->FilePath(), NULL, NULL);
parser2.Set(aFileName, NULL, NULL);
found = ETrue;
if (aLinkedAttachment)
{
found = found && (attachmentInfo->Type() == CMsvAttachment::EMsvLinkedFile); // Check it's a linked file.
found = found && (parser1.DriveAndPath() == parser2.DriveAndPath());
}
else
{
found = found && (attachmentInfo->Type() == CMsvAttachment::EMsvFile); // Check it's a file.
found = found && (parser1.DriveAndPath() != parser2.DriveAndPath());
}
found = found && (attachmentInfo->MimeType().Match(aMimeType) == 0); // Check mime type matches.
found = found && (parser1.NameAndExt() == parser2.NameAndExt()); // This necessarily correct?
found = found && (attachmentInfo->Size() == aFileSize); // Check size matches.
// check charset matches
CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewLC();
mimeHeaders->RestoreL(*attachmentInfo);
found = found && (mimeHeaders->MimeCharset() == aCharset);
CleanupStack::PopAndDestroy(2, attachmentInfo); // mimeHeaders, attachmentInfo
}
test(found);
CleanupStack::PopAndDestroy(5, ob1); // store, selection, cEntry, sesion, ob1
}