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:"));
102 //kDebug() << "Node processed: " << node->index().toString() << node->contentType()->as7BitString();
120 const QMap<KMime::Content*, QList<KMime::Content*> >::iterator it = mExtraContents.find( node );
149 static void clearBodyPartMemento(QMap<QByteArray, Interface::BodyPartMemento*> & bodyPartMementoMap)
173 for ( QMap<KMime::Content*, QList<KMime::Content*> >::ConstIterator it = mExtraContents.constBegin(); it != end; ++it) {
482 return Util::fileNameForMimetype( QLatin1String(mimeType), size, node->contentDisposition()->filename(),
569 c = codecForName( MessageCore::GlobalSettings::self()->fallbackCharacterEncoding().toLatin1() );
598 //FIXME(Andras) review it (by Marc?) to see if I got it right. This is supposed to be the partNode::internalBodyPartMemento replacement
611 //FIXME(Andras) review it (by Marc?) to see if I got it right. This is supposed to be the partNode::internalSetBodyPartMemento replacement
734 QByteArray NodeHelper::autoDetectCharset(const QByteArray &_encoding, const QStringList &encodingList, const QString &text)
841 kWarning() << "Asked to attach extra content to a kmime::message, this does not make sense. Attaching to:" << node <<
913 typeBlacklisted = MessageCore::StringUtil::isCryptoPart( QLatin1String(node->contentType()->mediaType()),
940 bool NodeHelper::unencryptedMessage_helper( KMime::Content *node, QByteArray &resultingData, bool addHeaders,
947 const QByteArray type = node->contentType( false ) ? QByteArray( node->contentType()->mediaType() ).toLower() : "text";
948 const QByteArray subType = node->contentType( false ) ? node->contentType()->subType().toLower() : "plain";
988 headers.contentTransferEncoding()->from7BitString( decryptedNode->contentTransferEncoding()->as7BitString( false ) );
993 headers.contentDisposition()->from7BitString( decryptedNode->contentDisposition()->as7BitString( false ) );
998 headers.contentDescription()->from7BitString( decryptedNode->contentDescription()->as7BitString( false ) );
1012 // We can't change the nodes under the signature, as that would invalidate it. Add the signature
1022 //kDebug() << "Current node is a multipart node, adding its header and then processing all children.";
1031 const bool changed = unencryptedMessage_helper( child, resultingData, true, recursionLevel + 1 );
1046 returnValue = unencryptedMessage_helper( curNode->bodyAsMessage().get(), resultingData, true, recursionLevel + 1 );
1063 KMime::Message::Ptr NodeHelper::unencryptedMessage( const KMime::Message::Ptr& originalMessage )
1066 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:1063
void clear()
Definition: partmetadata.h:31
void attachExtraContent(KMime::Content *topLevelNode, KMime::Content *content)
Attach an extra node to an existing node.
Definition: nodehelper.cpp:799
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
QString toUpper() const
iterator erase(iterator pos)
bool contains(const Key &key) const
virtual QByteArray name() const =0
KMMsgSignatureState overallSignatureState(KMime::Content *node) const
Definition: nodehelper.cpp:424
bool empty() const
QByteArray toLower() const
static QStringList supportedEncodings(bool usAscii)
Return a list of the supported encodings.
Definition: nodehelper.cpp:710
KMime::Content * decryptedNodeForContent(KMime::Content *content) const
Definition: nodehelper.cpp:927
PartMetaData partMetaData(KMime::Content *node)
Definition: nodehelper.cpp:208
QList< KMime::Content * > extraContents(KMime::Content *topLevelNode) const
Get the extra nodes attached to the.
Definition: nodehelper.cpp:815
QString & prepend(QChar ch)
const_iterator constBegin() const
const T & at(int i) const
bool isNull() const
bool isEmpty() const
static QByteArray toUsAscii(const QString &_str, bool *ok)
Definition: nodehelper.cpp:776
QString join(const QString &separator) const
const_iterator insert(const T &value)
void clear()
int size() const
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
bool isNull() const
int matchedLength() const
int indexIn(const QString &str, int offset, CaretMode caretMode) const
Definition: nodehelper.h:64
Definition: nodehelper.h:66
void append(const T &value)
bool empty() const
Definition: nodehelper.h:54
void forceCleanTempFiles()
Definition: nodehelper.cpp:302
KMime::Message * messageWithExtraContent(KMime::Content *topLevelNode)
Return a modified message (node tree) starting from.
Definition: nodehelper.cpp:876
bool isEmpty() const
int removeAll(const T &value)
QString trimmed() const
const_iterator constEnd() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
void addTempFile(const QString &file)
Add a file to the list of managed temporary files.
Definition: nodehelper.cpp:316
void setOverrideCodec(KMime::Content *node, const QTextCodec *codec)
Set the charset the user selected for the message to display.
Definition: nodehelper.cpp:548
static QByteArray autoDetectCharset(const QByteArray &_encoding, const QStringList &encodingList, const QString &text)
Definition: nodehelper.cpp:734
T & front()
bool nodeProcessed(KMime::Content *node) const
Definition: nodehelper.cpp:142
iterator end()
ushort unicode() const
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:259
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
iterator lowerBound(const Key &key)
static const QTextCodec * codecForName(const QByteArray &_str)
Return a QTextCodec for the specified charset.
Definition: nodehelper.cpp:579
iterator begin()
KMMsgEncryptionState encryptionState(KMime::Content *node) const
Definition: nodehelper.cpp:193
QString asHREF(const KMime::Content *node, const QString &place)
Definition: nodehelper.cpp:685
QStringList replySubjPrefixes(QStringList()<< QLatin1String("Re\\s*:")<< QLatin1String("Re\\[\\d+\\]:")<< QLatin1String("Re\\d+:"))
void setBodyPartMemento(KMime::Content *node, const QByteArray &which, Interface::BodyPartMemento *memento)
Definition: nodehelper.cpp:612
static QString encodingForName(const QString &descriptiveName)
Drop-in replacement for KCharsets::encodingForName().
Definition: nodehelper.cpp:704
bool isNodeDisplayedHidden(KMime::Content *node) const
Definition: nodehelper.cpp:648
QString toLower() const
bool contains(QChar ch, Qt::CaseSensitivity cs) const
bool contains(const T &value) const
virtual void close()
bool contains(const T &value) const
MESSAGEVIEWER_EXPORT KMimeType::Ptr mimetype(const QString &name)
Search mimetype from filename when mimetype is empty or application/octet-stream. ...
Definition: util.cpp:569
const Key key(const T &value) const
void setSignatureState(KMime::Content *node, const KMMsgSignatureState state)
Definition: nodehelper.cpp:198
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:218
Interface::BodyPartMemento * bodyPartMemento(KMime::Content *node, const QByteArray &which) const
Definition: nodehelper.cpp:599
QString & replace(int position, int n, QChar after)
static QString cleanSubject(KMime::Message *message)
Return this mails subject, with all "forward" and "reply" prefixes removed.
Definition: nodehelper.cpp:528
KMMsgEncryptionState overallEncryptionState(KMime::Content *node) const
Definition: nodehelper.cpp:376
static QByteArray charset(KMime::Content *node)
Returns the charset for the given node.
Definition: nodehelper.cpp:368
interface of classes that implement status for BodyPartFormatters.
Definition: bodypart.h:55
void setPartMetaData(KMime::Content *node, const PartMetaData &metaData)
Definition: nodehelper.cpp:213
QByteArray toLatin1() const
static QString fromAsString(KMime::Content *node)
Definition: nodehelper.cpp:791
QString mid(int position, int n) const
bool remove(const T &value)
static bool isToltecMessage(KMime::Content *node)
Definition: nodehelper.cpp:321
void removeAllExtraContent(KMime::Content *topLevelNode)
Definition: nodehelper.cpp:805
void setNodeDisplayedHidden(KMime::Content *node, bool displayedHidden)
Definition: nodehelper.cpp:653
void setNodeDisplayedEmbedded(KMime::Content *node, bool displayedEmbedded)
Definition: nodehelper.cpp:639
static void clearBodyPartMemento(QMap< QByteArray, Interface::BodyPartMemento * > &bodyPartMementoMap)
Definition: nodehelper.cpp:149
virtual void detach()=0
const QChar at(int position) const
bool isValid() const
QTextCodec * codecForName(const QByteArray &name)
typedef ConstIterator
int length() const
bool canEncode(QChar ch) const
char * data()
static QString iconName(KMime::Content *node, int size=KIconLoader::Desktop)
Definition: nodehelper.cpp:471
void setNodeUnprocessed(KMime::Content *node, bool recurse)
Definition: nodehelper.cpp:113
void setNodeProcessed(KMime::Content *node, bool recurse)
Definition: nodehelper.cpp:97
qint64 write(const char *data, qint64 maxSize)
QString fromLatin1(const char *str, int size)
void sort()
bool displayInHeader
Definition: nodehelper.h:256
void prepend(const T &value)
KMMsgSignatureState signatureState(KMime::Content *node) const
Definition: nodehelper.cpp:203
iterator insert(const Key &key, const T &value)
static bool isInEncapsulatedMessage(KMime::Content *node)
Definition: nodehelper.cpp:352
const QTextCodec * codec(KMime::Content *node)
Get a QTextCodec suitable for this message part.
Definition: nodehelper.cpp:556
const_iterator constEnd() const
bool isNodeDisplayedEmbedded(KMime::Content *node) const
Definition: nodehelper.cpp:633
void clear()
const_iterator constBegin() const
QStringList forwardSubjPrefixes(QStringList()<< QLatin1String("Fwd:")<< QLatin1String("FW:"))
int size() const
static QString replacePrefixes(const QString &str, const QStringList &prefixRegExps, bool replace, const QString &newPrefix)
Check for prefixes prefixRegExps in str.
Definition: nodehelper.cpp:496
static AttachmentDisplayInfo attachmentDisplayInfo(KMime::Content *node)
Definition: nodehelper.cpp:901
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
iterator find(const Key &key)
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:690
QString createTempDir(const QString ¶m=QString())
Creates a temporary dir for saving attachments, etc.
Definition: nodehelper.cpp:280
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:825
QByteArray encodeName(const QString &fileName)
void setEncryptionState(KMime::Content *node, const KMMsgEncryptionState state)
Definition: nodehelper.cpp:188
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:588
void magicSetType(KMime::Content *node, bool autoDecode=true)
Set the 'Content-Type' by mime-magic from the contents of the body.
Definition: nodehelper.cpp:486
const T value(const Key &key) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:45 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:45 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.