Search for usage in LXR

MimeTreeParser::NodeHelper Class Reference

#include <nodehelper.h>

Inheritance diagram for MimeTreeParser::NodeHelper:


void update (MimeTreeParser::UpdateMode)

Public Member Functions

void addTempFile (const QString &file)
QString asHREF (const KMime::Content *node) const
QString asHREF (const KMime::Content *node, const QString &place) const
void attachExtraContent (KMime::Content *topLevelNode, KMime::Content *content)
QList< KMime::Content * > attachmentsOfExtraContents () const
Interface::BodyPartMementobodyPartMemento (KMime::Content *node, const QByteArray &which) const
void cleanExtraContent (KMime::Content *topLevelNode)
void clear ()
void clearOverrideHeaders ()
QByteArray codecName (KMime::Content *node) const
QString createTempDir (const QString &param=QString())
QDateTime dateHeader (KMime::Content *message) const
KMime::ContentdecryptedNodeForContent (KMime::Content *content) const
KMMsgEncryptionState encryptionState (const KMime::Content *node) const
QList< KMime::Content * > extraContents (KMime::Content *topLevelNode) const
QString extractAttachmentIndex (const QString &path) const
void forceCleanTempFiles ()
QString fromAsString (KMime::Content *node) const
KMime::ContentfromHREF (const KMime::Message::Ptr &mMessage, const QUrl &href) const
bool hasMailHeader (const char *header, const KMime::Content *message) const
QList< KMime::Headers::Base * > headers (const char *header, const KMime::Content *message)
bool isNodeDisplayedEmbedded (KMime::Content *node) const
bool isNodeDisplayedHidden (KMime::Content *node) const
QSharedPointer< KMime::Headers::Generics::AddressListmailHeaderAsAddressList (const char *header, const KMime::Content *message) const
const KMime::Headers::BasemailHeaderAsBase (const char *header, const KMime::Content *message) const
QList< MessagePartPtrmessagePartsOfMailHeader (const char *header, const KMime::Content *message) const
KMime::MessagemessageWithExtraContent (KMime::Content *topLevelNode)
bool nodeProcessed (KMime::Content *node) const
KMMsgEncryptionState overallEncryptionState (KMime::Content *node) const
KMMsgSignatureState overallSignatureState (KMime::Content *node) const
PartMetaData partMetaData (KMime::Content *node)
void registerOverrideHeader (KMime::Content *message, MessagePartPtr)
void removeTempFiles ()
void setBodyPartMemento (KMime::Content *node, const QByteArray &which, Interface::BodyPartMemento *memento)
void setEncryptionState (const KMime::Content *node, const KMMsgEncryptionState state)
void setNodeDisplayedEmbedded (KMime::Content *node, bool displayedEmbedded)
void setNodeDisplayedHidden (KMime::Content *node, bool displayedHidden)
void setNodeProcessed (KMime::Content *node, bool recurse)
void setNodeUnprocessed (KMime::Content *node, bool recurse)
void setOverrideCodec (KMime::Content *node, const QByteArray &codec)
void setPartMetaData (KMime::Content *node, const PartMetaData &metaData)
void setSignatureState (const KMime::Content *node, const KMMsgSignatureState state)
KMMsgSignatureState signatureState (const KMime::Content *node) const
QUrl tempFileUrlFromNode (const KMime::Content *node)
KMime::Message::Ptr unencryptedMessage (const KMime::Message::Ptr &originalMessage)
QString writeFileToTempFile (KMime::Content *node, const QString &filename)
QString writeNodeToTempFile (KMime::Content *node)
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
bool blockSignals (bool block)
const QObjectListchildren () const const
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
void deleteLater ()
void destroyed (QObject *obj)
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
bool disconnect (const QObject *receiver, const char *method) const const
void dumpObjectInfo ()
void dumpObjectInfo () const const
void dumpObjectTree ()
void dumpObjectTree () const const
QList< QByteArraydynamicPropertyNames () const const
virtual bool event (QEvent *e)
virtual bool eventFilter (QObject *watched, QEvent *event)
findChild (const QString &name, Qt::FindChildOptions options) const const
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
bool inherits (const char *className) const const
void installEventFilter (QObject *filterObj)
bool isWidgetType () const const
bool isWindowType () const const
void killTimer (int id)
virtual const QMetaObjectmetaObject () const const
void moveToThread (QThread *targetThread)
QString objectName () const const
void objectNameChanged (const QString &objectName)
QObjectparent () const const
QVariant property (const char *name) const const
 Q_CLASSINFO (Name, Value)
 Q_ENUM (...)
 Q_ENUM_NS (...)
 Q_ENUMS (...)
 Q_FLAG (...)
 Q_FLAG_NS (...)
 Q_FLAGS (...)
qFindChild (const QObject *obj, const QString &name)
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
QList< T > qFindChildren (const QObject *obj, const QString &name)
qobject_cast (const QObject *object)
qobject_cast (QObject *object)
void removeEventFilter (QObject *obj)
void setObjectName (const QString &name)
void setParent (QObject *parent)
bool setProperty (const char *name, const QVariant &value)
bool signalsBlocked () const const
int startTimer (int interval, Qt::TimerType timerType)
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
QThreadthread () const const

Static Public Member Functions

static QByteArray charset (KMime::Content *node)
static QString encodingForName (const QString &descriptiveName)
static QString fileName (const KMime::Content *node)
static QString fixEncoding (const QString &encoding)
static bool isInEncapsulatedMessage (KMime::Content *node)
static void magicSetType (KMime::Content *node, bool autoDecode=true)
static QStringList supportedEncodings (bool usAscii)
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect (const QMetaObject::Connection &connection)
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
QString tr (const char *sourceText, const char *disambiguation, int n)
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)

Additional Inherited Members

- Properties inherited from QObject
- Public Attributes inherited from QObject
typedef QObjectList
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
virtual void connectNotify (const QMetaMethod &signal)
virtual void customEvent (QEvent *event)
virtual void disconnectNotify (const QMetaMethod &signal)
bool isSignalConnected (const QMetaMethod &signal) const const
int receivers (const char *signal) const const
QObjectsender () const const
int senderSignalIndex () const const
virtual void timerEvent (QTimerEvent *event)

Detailed Description

Andras Mantia andra.nosp@m.s@kd.nosp@m.ab.ne.nosp@m.t

Definition at line 41 of file mimetreeparser/src/nodehelper.h.

Member Function Documentation

◆ addTempFile()

void MimeTreeParser::NodeHelper::addTempFile ( const QString file)

Add a file to the list of managed temporary files.

Definition at line 308 of file mimetreeparser/src/nodehelper.cpp.

◆ attachExtraContent()

void MimeTreeParser::NodeHelper::attachExtraContent ( KMime::Content topLevelNode,
KMime::Content content 

Attach an extra node to an existing node.

Definition at line 840 of file mimetreeparser/src/nodehelper.cpp.

◆ attachmentsOfExtraContents()

QList< KMime::Content * > MimeTreeParser::NodeHelper::attachmentsOfExtraContents ( ) const

Returns a list of attachments of attached extra content nodes.

This is mainly useful is order to get attachments of encrypted messages. Note that this does not include attachments from the primary node tree.

See also

Definition at line 1079 of file mimetreeparser/src/nodehelper.cpp.

◆ charset()

QByteArray MimeTreeParser::NodeHelper::charset ( KMime::Content node)

Returns the charset for the given node.

If no charset is specified for the node, the defaultCharset() is returned.

Definition at line 328 of file mimetreeparser/src/nodehelper.cpp.

◆ codecName()

QByteArray MimeTreeParser::NodeHelper::codecName ( KMime::Content node) const

Get a codec suitable for this message part.

Definition at line 561 of file mimetreeparser/src/nodehelper.cpp.

◆ createTempDir()

QString MimeTreeParser::NodeHelper::createTempDir ( const QString param = QString())

Creates a temporary dir for saving attachments, etc.

Will be automatically deleted when another message is viewed.

paramOptional part of the directory name.

Definition at line 269 of file mimetreeparser/src/nodehelper.cpp.

◆ encodingForName()

QString MimeTreeParser::NodeHelper::encodingForName ( const QString descriptiveName)

Drop-in replacement for KCharsets::encodingForName().

The problem with the KCharsets function is that it returns "human-readable" encoding names like "ISO 8859-15" instead of valid encoding names like "ISO-8859-15". This function fixes this by replacing whitespace with a hyphen.

Definition at line 797 of file mimetreeparser/src/nodehelper.cpp.

◆ extraContents()

QList< KMime::Content * > MimeTreeParser::NodeHelper::extraContents ( KMime::Content topLevelNode) const

Get the extra nodes attached to the.

topLevelNodeand all sub-nodes of

Definition at line 852 of file mimetreeparser/src/nodehelper.cpp.

◆ fileName()

QString MimeTreeParser::NodeHelper::fileName ( const KMime::Content node)

Returns a usable filename for a node, that can be the filename from the content disposition header, or if that one is empty, the name from the content type header.

Definition at line 589 of file mimetreeparser/src/nodehelper.cpp.

◆ fixEncoding()

QString MimeTreeParser::NodeHelper::fixEncoding ( const QString encoding)

Fixes an encoding received by a KDE function and returns the proper, MIME-compliant encoding name instead.

See also

Definition at line 783 of file mimetreeparser/src/nodehelper.cpp.

◆ isInEncapsulatedMessage()

bool MimeTreeParser::NodeHelper::isInEncapsulatedMessage ( KMime::Content node)
true if this node is a child or an encapsulated message

Definition at line 313 of file mimetreeparser/src/nodehelper.cpp.

◆ magicSetType()

void MimeTreeParser::NodeHelper::magicSetType ( KMime::Content node,
bool  autoDecode = true 

Set the 'Content-Type' by mime-magic from the contents of the body.

If autoDecode is true the decoded body will be used for mime type determination (this does not change the body itself).

Definition at line 459 of file mimetreeparser/src/nodehelper.cpp.

◆ messageWithExtraContent()

KMime::Message * MimeTreeParser::NodeHelper::messageWithExtraContent ( KMime::Content topLevelNode)

Return a modified message (node tree) starting from.

topLevelNodethat has the original nodes and the extra nodes. The caller has the responsibility to delete the new message.

Definition at line 904 of file mimetreeparser/src/nodehelper.cpp.

◆ removeTempFiles()

void MimeTreeParser::NodeHelper::removeTempFiles ( )

Cleanup the attachment temp files.

Definition at line 298 of file mimetreeparser/src/nodehelper.cpp.

◆ setOverrideCodec()

void MimeTreeParser::NodeHelper::setOverrideCodec ( KMime::Content node,
const QByteArray codec 

Set the charset the user selected for the message to display.

Definition at line 552 of file mimetreeparser/src/nodehelper.cpp.

◆ supportedEncodings()

QStringList MimeTreeParser::NodeHelper::supportedEncodings ( bool  usAscii)

Return a list of the supported encodings.

usAsciiif true, US-Ascii encoding will be prepended to the list.

Definition at line 803 of file mimetreeparser/src/nodehelper.cpp.

◆ tempFileUrlFromNode()

QUrl MimeTreeParser::NodeHelper::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 saved yet with writeNodeToTempFile()

Definition at line 245 of file mimetreeparser/src/nodehelper.cpp.

◆ unencryptedMessage()

KMime::Message::Ptr MimeTreeParser::NodeHelper::unencryptedMessage ( const KMime::Message::Ptr originalMessage)

This function returns the unencrypted message that is based on originalMessage.

All encrypted MIME parts are removed and replaced by their decrypted plain-text versions. Encrypted parts that are within signed parts are not replaced, since that would invalidate the signature.

This only works if the message was run through ObjectTreeParser::parseObjectTree() with the current NodeHelper before, because parseObjectTree() actually decrypts the message and stores the decrypted nodes by calling attachExtraContent().

the unencrypted message or an invalid pointer if the original message didn't contain a part that needed to be modified.

Definition at line 1058 of file mimetreeparser/src/nodehelper.cpp.

◆ writeNodeToTempFile()

QString MimeTreeParser::NodeHelper::writeNodeToTempFile ( KMime::Content node)

Writes the given message part to a temporary file and returns the name of this file or QString() if writing failed.

Definition at line 197 of file mimetreeparser/src/nodehelper.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Dec 6 2023 03:56:42 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.