MimeTreeParser::NodeHelper

Search for usage in LXR

MimeTreeParser::NodeHelper Class Reference

#include <nodehelper.h>

Inheritance diagram for MimeTreeParser::NodeHelper:

Signals

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
 
KMime::Headers::Base constmailHeaderAsBase (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)
 
QBindable< QStringbindableObjectName ()
 
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 () const const
 
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 QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
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_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, 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)
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- 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

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

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

Constructor & Destructor Documentation

◆ NodeHelper()

MimeTreeParser::NodeHelper::NodeHelper ( )

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

◆ ~NodeHelper()

MimeTreeParser::NodeHelper::~NodeHelper ( )
override

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

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.

◆ asHREF() [1/2]

QString MimeTreeParser::NodeHelper::asHREF ( const KMime::Content * node) const

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

◆ asHREF() [2/2]

QString MimeTreeParser::NodeHelper::asHREF ( const KMime::Content * node,
const QString & place ) const

Definition at line 740 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
KMime::Content::attachments().

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

◆ bodyPartMemento()

Interface::BodyPartMemento * MimeTreeParser::NodeHelper::bodyPartMemento ( KMime::Content * node,
const QByteArray & which ) const

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

◆ charset()

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

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.

◆ cleanExtraContent()

void MimeTreeParser::NodeHelper::cleanExtraContent ( KMime::Content * topLevelNode)

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

◆ clear()

void MimeTreeParser::NodeHelper::clear ( )

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

◆ clearOverrideHeaders()

void MimeTreeParser::NodeHelper::clearOverrideHeaders ( )

Definition at line 530 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.

Parameters
paramOptional part of the directory name.

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

◆ dateHeader()

QDateTime MimeTreeParser::NodeHelper::dateHeader ( KMime::Content * message) const

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

◆ decryptedNodeForContent()

KMime::Content * MimeTreeParser::NodeHelper::decryptedNodeForContent ( KMime::Content * content) const

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

◆ encodingForName()

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

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.

◆ encryptionState()

KMMsgEncryptionState MimeTreeParser::NodeHelper::encryptionState ( const KMime::Content * node) const

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

◆ extraContents()

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

Get the extra nodes attached to the.

Parameters
topLevelNodeand all sub-nodes of
topLevelNode

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

◆ extractAttachmentIndex()

QString MimeTreeParser::NodeHelper::extractAttachmentIndex ( const QString & path) const

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

◆ fileName()

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

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)
static

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

See also
encodingForName

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

◆ forceCleanTempFiles()

void MimeTreeParser::NodeHelper::forceCleanTempFiles ( )

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

◆ fromAsString()

QString MimeTreeParser::NodeHelper::fromAsString ( KMime::Content * node) const

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

◆ fromHREF()

KMime::Content * MimeTreeParser::NodeHelper::fromHREF ( const KMime::Message::Ptr & mMessage,
const QUrl & href ) const

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

◆ hasMailHeader()

bool MimeTreeParser::NodeHelper::hasMailHeader ( const char * header,
const KMime::Content * message ) const

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

◆ headers()

QList< KMime::Headers::Base * > MimeTreeParser::NodeHelper::headers ( const char * header,
const KMime::Content * message )

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

◆ isInEncapsulatedMessage()

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

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

◆ isNodeDisplayedEmbedded()

bool MimeTreeParser::NodeHelper::isNodeDisplayedEmbedded ( KMime::Content * node) const

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

◆ isNodeDisplayedHidden()

bool MimeTreeParser::NodeHelper::isNodeDisplayedHidden ( KMime::Content * node) const

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

◆ magicSetType()

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

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.

◆ mailHeaderAsAddressList()

QSharedPointer< KMime::Headers::Generics::AddressList > MimeTreeParser::NodeHelper::mailHeaderAsAddressList ( const char * header,
const KMime::Content * message ) const

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

◆ mailHeaderAsBase()

KMime::Headers::Base const * MimeTreeParser::NodeHelper::mailHeaderAsBase ( const char * header,
const KMime::Content * message ) const

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

◆ messagePartsOfMailHeader()

QList< MessagePart::Ptr > MimeTreeParser::NodeHelper::messagePartsOfMailHeader ( const char * header,
const KMime::Content * message ) const

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

◆ messageWithExtraContent()

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

Return a modified message (node tree) starting from.

Parameters
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.

◆ nodeProcessed()

bool MimeTreeParser::NodeHelper::nodeProcessed ( KMime::Content * node) const

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

◆ overallEncryptionState()

KMMsgEncryptionState MimeTreeParser::NodeHelper::overallEncryptionState ( KMime::Content * node) const

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

◆ overallSignatureState()

KMMsgSignatureState MimeTreeParser::NodeHelper::overallSignatureState ( KMime::Content * node) const

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

◆ partMetaData()

PartMetaData MimeTreeParser::NodeHelper::partMetaData ( KMime::Content * node)

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

◆ registerOverrideHeader()

void MimeTreeParser::NodeHelper::registerOverrideHeader ( KMime::Content * message,
MessagePartPtr part )

Definition at line 535 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.

◆ setBodyPartMemento()

void MimeTreeParser::NodeHelper::setBodyPartMemento ( KMime::Content * node,
const QByteArray & which,
Interface::BodyPartMemento * memento )

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

◆ setEncryptionState()

void MimeTreeParser::NodeHelper::setEncryptionState ( const KMime::Content * node,
const KMMsgEncryptionState state )

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

◆ setNodeDisplayedEmbedded()

void MimeTreeParser::NodeHelper::setNodeDisplayedEmbedded ( KMime::Content * node,
bool displayedEmbedded )

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

◆ setNodeDisplayedHidden()

void MimeTreeParser::NodeHelper::setNodeDisplayedHidden ( KMime::Content * node,
bool displayedHidden )

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

◆ setNodeProcessed()

void MimeTreeParser::NodeHelper::setNodeProcessed ( KMime::Content * node,
bool recurse )

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

◆ setNodeUnprocessed()

void MimeTreeParser::NodeHelper::setNodeUnprocessed ( KMime::Content * node,
bool recurse )

Definition at line 69 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.

◆ setPartMetaData()

void MimeTreeParser::NodeHelper::setPartMetaData ( KMime::Content * node,
const PartMetaData & metaData )

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

◆ setSignatureState()

void MimeTreeParser::NodeHelper::setSignatureState ( const KMime::Content * node,
const KMMsgSignatureState state )

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

◆ signatureState()

KMMsgSignatureState MimeTreeParser::NodeHelper::signatureState ( const KMime::Content * node) const

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

◆ supportedEncodings()

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

Return a list of the supported encodings.

Parameters
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().

Returns
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.

◆ writeFileToTempFile()

QString MimeTreeParser::NodeHelper::writeFileToTempFile ( KMime::Content * node,
const QString & filename )

Definition at line 174 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-2024 The KDE developers.
Generated on Fri May 17 2024 11:53:09 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.