messageviewer
nodehelper.cpp
Go to the documentation of this file.
55 QStringList replySubjPrefixes(QStringList() << QLatin1String("Re\\s*:") << QLatin1String("Re\\[\\d+\\]:") << QLatin1String("Re\\d+:"));
56 QStringList forwardSubjPrefixes( QStringList() << QLatin1String("Fwd:") << QLatin1String("FW:"));
100 //kDebug() << "Node processed: " << node->index().toString() << node->contentType()->as7BitString();
118 const QMap<KMime::Content*, QList<KMime::Content*> >::iterator it = mExtraContents.find( node );
147 static void clearBodyPartMemento(QMap<QByteArray, Interface::BodyPartMemento*> & bodyPartMementoMap)
171 for ( QMap<KMime::Content*, QList<KMime::Content*> >::ConstIterator it = mExtraContents.constBegin(); it != end; ++it) {
480 return Util::fileNameForMimetype( QLatin1String(mimeType), size, node->contentDisposition()->filename(),
567 c = codecForName( MessageCore::GlobalSettings::self()->fallbackCharacterEncoding().toLatin1() );
596 //FIXME(Andras) review it (by Marc?) to see if I got it right. This is supposed to be the partNode::internalBodyPartMemento replacement
609 //FIXME(Andras) review it (by Marc?) to see if I got it right. This is supposed to be the partNode::internalSetBodyPartMemento replacement
732 QByteArray NodeHelper::autoDetectCharset(const QByteArray &_encoding, const QStringList &encodingList, const QString &text)
839 kWarning() << "Asked to attach extra content to a kmime::message, this does not make sense. Attaching to:" << node <<
911 typeBlacklisted = MessageCore::StringUtil::isCryptoPart( QLatin1String(node->contentType()->mediaType()),
938 bool NodeHelper::unencryptedMessage_helper( KMime::Content *node, QByteArray &resultingData, bool addHeaders,
945 const QByteArray type = node->contentType( false ) ? QByteArray( node->contentType()->mediaType() ).toLower() : "text";
946 const QByteArray subType = node->contentType( false ) ? node->contentType()->subType().toLower() : "plain";
986 headers.contentTransferEncoding()->from7BitString( decryptedNode->contentTransferEncoding()->as7BitString( false ) );
991 headers.contentDisposition()->from7BitString( decryptedNode->contentDisposition()->as7BitString( false ) );
996 headers.contentDescription()->from7BitString( decryptedNode->contentDescription()->as7BitString( false ) );
1010 // We can't change the nodes under the signature, as that would invalidate it. Add the signature
1020 //kDebug() << "Current node is a multipart node, adding its header and then processing all children.";
1029 const bool changed = unencryptedMessage_helper( child, resultingData, true, recursionLevel + 1 );
1044 returnValue = unencryptedMessage_helper( curNode->bodyAsMessage().get(), resultingData, true, recursionLevel + 1 );
1061 KMime::Message::Ptr NodeHelper::unencryptedMessage( const KMime::Message::Ptr& originalMessage )
1064 const bool messageChanged = unencryptedMessage_helper( originalMessage.get(), resultingData, true );
KMime::Message::Ptr unencryptedMessage(const KMime::Message::Ptr &originalMessage)
This function returns the unencrypted message that is based on originalMessage.
Definition: nodehelper.cpp:1061
void addTempFile(const QString &file)
Definition: attachmenttemporaryfilesdirs.cpp:69
void forceCleanTempFiles()
Definition: attachmenttemporaryfilesdirs.cpp:48
Definition: partmetadata.h:31
void attachExtraContent(KMime::Content *topLevelNode, KMime::Content *content)
Attach an extra node to an existing node.
Definition: nodehelper.cpp:797
QString MESSAGEVIEWER_EXPORT fileNameForMimetype(const QString &mimeType, int iconSize, const QString &fallbackFileName1=QString(), const QString &fallbackFileName2=QString())
Finds the filename of an icon based on the given mimetype or filenames.
Definition: util.cpp:93
void addTempDir(const QString &dir)
Definition: attachmenttemporaryfilesdirs.cpp:74
KMMsgSignatureState overallSignatureState(KMime::Content *node) const
Definition: nodehelper.cpp:422
static QStringList supportedEncodings(bool usAscii)
Return a list of the supported encodings.
Definition: nodehelper.cpp:708
KMime::Content * decryptedNodeForContent(KMime::Content *content) const
Definition: nodehelper.cpp:925
PartMetaData partMetaData(KMime::Content *node)
Definition: nodehelper.cpp:206
QStringList forwardSubjPrefixes(QStringList()<< QLatin1String("Fwd:")<< QLatin1String("FW:"))
QList< KMime::Content * > extraContents(KMime::Content *topLevelNode) const
Get the extra nodes attached to the.
Definition: nodehelper.cpp:813
static QByteArray toUsAscii(const QString &_str, bool *ok)
Definition: nodehelper.cpp:774
Definition: nodehelper.h:61
Definition: nodehelper.h:63
Definition: nodehelper.h:51
void forceCleanTempFiles()
Definition: nodehelper.cpp:300
KMime::Message * messageWithExtraContent(KMime::Content *topLevelNode)
Return a modified message (node tree) starting from.
Definition: nodehelper.cpp:874
QStringList temporaryFiles() const
Definition: attachmenttemporaryfilesdirs.cpp:79
void addTempFile(const QString &file)
Add a file to the list of managed temporary files.
Definition: nodehelper.cpp:314
void setOverrideCodec(KMime::Content *node, const QTextCodec *codec)
Set the charset the user selected for the message to display.
Definition: nodehelper.cpp:546
static QByteArray autoDetectCharset(const QByteArray &_encoding, const QStringList &encodingList, const QString &text)
Definition: nodehelper.cpp:732
bool nodeProcessed(KMime::Content *node) const
Definition: nodehelper.cpp:140
KUrl tempFileUrlFromNode(const KMime::Content *node)
Returns the temporary file path and name where this node was saved, or an empty url if it wasn't save...
Definition: nodehelper.cpp:257
static const QTextCodec * codecForName(const QByteArray &_str)
Return a QTextCodec for the specified charset.
Definition: nodehelper.cpp:577
KMMsgEncryptionState encryptionState(KMime::Content *node) const
Definition: nodehelper.cpp:191
void removeTempFiles()
Definition: attachmenttemporaryfilesdirs.cpp:43
QString asHREF(const KMime::Content *node, const QString &place)
Definition: nodehelper.cpp:683
void setBodyPartMemento(KMime::Content *node, const QByteArray &which, Interface::BodyPartMemento *memento)
Definition: nodehelper.cpp:610
static QString encodingForName(const QString &descriptiveName)
Drop-in replacement for KCharsets::encodingForName().
Definition: nodehelper.cpp:702
bool isNodeDisplayedHidden(KMime::Content *node) const
Definition: nodehelper.cpp:646
QStringList replySubjPrefixes(QStringList()<< QLatin1String("Re\\s*:")<< QLatin1String("Re\\[\\d+\\]:")<< QLatin1String("Re\\d+:"))
MESSAGEVIEWER_EXPORT KMimeType::Ptr mimetype(const QString &name)
Search mimetype from filename when mimetype is empty or application/octet-stream. ...
Definition: util.cpp:568
void setSignatureState(KMime::Content *node, const KMMsgSignatureState state)
Definition: nodehelper.cpp:196
QString writeNodeToTempFile(KMime::Content *node)
Writes the given message part to a temporary file and returns the name of this file or QString() if w...
Definition: nodehelper.cpp:216
Interface::BodyPartMemento * bodyPartMemento(KMime::Content *node, const QByteArray &which) const
Definition: nodehelper.cpp:597
static QString cleanSubject(KMime::Message *message)
Return this mails subject, with all "forward" and "reply" prefixes removed.
Definition: nodehelper.cpp:526
KMMsgEncryptionState overallEncryptionState(KMime::Content *node) const
Definition: nodehelper.cpp:374
static QByteArray charset(KMime::Content *node)
Returns the charset for the given node.
Definition: nodehelper.cpp:366
interface of classes that implement status for BodyPartFormatters.
Definition: bodypart.h:55
void setPartMetaData(KMime::Content *node, const PartMetaData &metaData)
Definition: nodehelper.cpp:211
static QString fromAsString(KMime::Content *node)
Definition: nodehelper.cpp:789
static bool isToltecMessage(KMime::Content *node)
Definition: nodehelper.cpp:319
void removeAllExtraContent(KMime::Content *topLevelNode)
Definition: nodehelper.cpp:803
void setNodeDisplayedHidden(KMime::Content *node, bool displayedHidden)
Definition: nodehelper.cpp:651
void setNodeDisplayedEmbedded(KMime::Content *node, bool displayedEmbedded)
Definition: nodehelper.cpp:637
static void clearBodyPartMemento(QMap< QByteArray, Interface::BodyPartMemento * > &bodyPartMementoMap)
Definition: nodehelper.cpp:147
virtual void detach()=0
static QString iconName(KMime::Content *node, int size=KIconLoader::Desktop)
Definition: nodehelper.cpp:469
void setNodeUnprocessed(KMime::Content *node, bool recurse)
Definition: nodehelper.cpp:111
void setNodeProcessed(KMime::Content *node, bool recurse)
Definition: nodehelper.cpp:95
bool displayInHeader
Definition: nodehelper.h:253
KMMsgSignatureState signatureState(KMime::Content *node) const
Definition: nodehelper.cpp:201
static bool isInEncapsulatedMessage(KMime::Content *node)
Definition: nodehelper.cpp:350
const QTextCodec * codec(KMime::Content *node)
Get a QTextCodec suitable for this message part.
Definition: nodehelper.cpp:554
bool isNodeDisplayedEmbedded(KMime::Content *node) const
Definition: nodehelper.cpp:631
static QString replacePrefixes(const QString &str, const QStringList &prefixRegExps, bool replace, const QString &newPrefix)
Check for prefixes prefixRegExps in str.
Definition: nodehelper.cpp:494
static AttachmentDisplayInfo attachmentDisplayInfo(KMime::Content *node)
Definition: nodehelper.cpp:899
static QString fixEncoding(const QString &encoding)
Fixes an encoding received by a KDE function and returns the proper, MIME-compilant encoding name ins...
Definition: nodehelper.cpp:688
QString createTempDir(const QString ¶m=QString())
Creates a temporary dir for saving attachments, etc.
Definition: nodehelper.cpp:278
bool isPermanentWithExtraContent(KMime::Content *node) const
Returns true if the given node at least one extra content node, implying that the given node is an en...
Definition: nodehelper.cpp:823
void setEncryptionState(KMime::Content *node, const KMMsgEncryptionState state)
Definition: nodehelper.cpp:186
static QString fileName(const KMime::Content *node)
Returns a usable filename for a node, that can be the filename from the content disposition header...
Definition: nodehelper.cpp:586
void magicSetType(KMime::Content *node, bool autoDecode=true)
Set the 'Content-Type' by mime-magic from the contents of the body.
Definition: nodehelper.cpp:484
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.