コード例 #1
0
//---------------------------------------------------------------
// 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
0
//---------------------------------------------------------------
// 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

}
コード例 #3
0
bool partNode::isHeuristicalAttachment() const {
  if ( isAttachment() )
    return true;
  const KMMessagePart & p = msgPart();
  return !p.fileName().isEmpty() || !p.name().isEmpty() ;
}