MessageViewer::Util

MessageViewer::Util Namespace Reference

Functions

AttachmentDisplayInfo attachmentDisplayInfo (KMime::Content *node)
 
bool MESSAGEVIEWER_EXPORT checkOverwrite (const QUrl &url, QWidget *w)
 
MESSAGEVIEWER_EXPORT bool containsExternalReferences (const QString &str, const QString &extraHead)
 
MESSAGEVIEWER_EXPORT QActioncreateAppAction (const KService::Ptr &service, bool singleOffer, QActionGroup *actionGroup, QObject *parent)
 
MESSAGEVIEWER_EXPORT bool deleteAttachment (KMime::Content *node)
 
MESSAGEVIEWER_EXPORT int deleteAttachments (const KMime::Content::List &contents)
 
MESSAGEVIEWER_EXPORT bool excludeExtraHeader (const QString &s)
 
MESSAGEVIEWER_EXPORT QString generateFileNameForExtension (const Akonadi::Item &msgBase, const QString &extension)
 
MESSAGEVIEWER_EXPORT QString generateMboxFileName (const Akonadi::Item &msgBase)
 
QString MESSAGEVIEWER_EXPORT iconPathForContent (KMime::Content *node, int iconSize)
 
QString MESSAGEVIEWER_EXPORT iconPathForMimetype (const QString &mimeType, int iconSize, const QString &fallbackFileName1=QString(), const QString &fallbackFileName2=QString())
 
MESSAGEVIEWER_EXPORT QString parseBodyStyle (const QString &style)
 
MESSAGEVIEWER_EXPORT HtmlMessageInfo processHtml (const QString &htmlSource)
 
MESSAGEVIEWER_EXPORT bool saveAttachments (const KMime::Content::List &contents, QWidget *parent, QList< QUrl > &saveUrl)
 
MESSAGEVIEWER_EXPORT bool saveMessageInMbox (const Akonadi::Item::List &retrievedMsgs, QWidget *parent, bool appendMessages=false)
 
MESSAGEVIEWER_EXPORT bool saveMessageInMboxAndGetUrl (QUrl &url, const Akonadi::Item::List &retrievedMsgs, QWidget *parent, bool appendMessages=false)
 

Detailed Description

The Util namespace contains a collection of helper functions use in various places.

Function Documentation

◆ attachmentDisplayInfo()

MessageViewer::Util::AttachmentDisplayInfo MessageViewer::Util::attachmentDisplayInfo ( KMime::Content * node)
nodiscard

Definition at line 27 of file mimetype.cpp.

◆ checkOverwrite()

bool MessageViewer::Util::checkOverwrite ( const QUrl & url,
QWidget * w )
nodiscard

Definition at line 110 of file messageviewerutil.cpp.

◆ containsExternalReferences()

bool MessageViewer::Util::containsExternalReferences ( const QString & str,
const QString & extraHead )
nodiscard

Checks whether str contains external references.

To be precise, we only check whether str contains 'xxx="http[s]:' where xxx is not href. Obfuscated external references are ignored on purpose.

Definition at line 44 of file messageviewerutil.cpp.

◆ createAppAction()

QAction * MessageViewer::Util::createAppAction ( const KService::Ptr & service,
bool singleOffer,
QActionGroup * actionGroup,
QObject * parent )
nodiscard

Definition at line 619 of file messageviewerutil.cpp.

◆ deleteAttachment()

bool MessageViewer::Util::deleteAttachment ( KMime::Content * node)
nodiscard

Replaces the node message part by an empty attachment with information about deleted attachment.

Parameters
nodeA message part representing an attachment. The part will be replaced by a new empty party with filename "Deleted: <original attachment name>". Must not be null.
Returns
Returns whether the message was actually modified.

Definition at line 558 of file messageviewerutil.cpp.

◆ deleteAttachments()

int MessageViewer::Util::deleteAttachments ( const KMime::Content::List & contents)
nodiscard

Calls deleteAttachment() for each node in the contents list.

Parameters
contentsList of attachments to replace by an empty part (see deleteAttachment())
Returns
Returns number of attachments that have actually been replaced.
See also
deleteAttachment()

Definition at line 608 of file messageviewerutil.cpp.

◆ excludeExtraHeader()

bool MessageViewer::Util::excludeExtraHeader ( const QString & s)
nodiscard

Definition at line 636 of file messageviewerutil.cpp.

◆ generateFileNameForExtension()

QString MessageViewer::Util::generateFileNameForExtension ( const Akonadi::Item & msgBase,
const QString & extension )
nodiscard

Definition at line 442 of file messageviewerutil.cpp.

◆ generateMboxFileName()

QString MessageViewer::Util::generateMboxFileName ( const Akonadi::Item & msgBase)
nodiscard

Definition at line 459 of file messageviewerutil.cpp.

◆ iconPathForContent()

QString MessageViewer::Util::iconPathForContent ( KMime::Content * node,
int iconSize )
nodiscard

Definition at line 22 of file mimetype.cpp.

◆ iconPathForMimetype()

QString MessageViewer::Util::iconPathForMimetype ( const QString & mimeType,
int iconSize,
const QString & fallbackFileName1 = QString(),
const QString & fallbackFileName2 = QString() )
nodiscard

Finds the filename of an icon based on the given mimetype or filenames.

Always use this functions when looking up icon names for mime types, don't use KMimeType directly.

Uses the IconNameCache internally to speed things up.

Parameters
mimeTypeThe primary mime type used to find the icon, e.g. "application/zip". Alias mimetypes are resolved.
iconSizeSize of the requested icon, e.g. KIconLoader::Desktop
fallbackFileName1When the icon is not found by the given mime type, use the file name extensions of these file names to look the icon up. Example: "test.zip"
fallbackFileName2Fallback for fallbackFileName1.
Returns
the full file name of the icon file

Definition at line 17 of file mimetype.cpp.

◆ parseBodyStyle()

QString MessageViewer::Util::parseBodyStyle ( const QString & style)
nodiscard

Definition at line 666 of file messageviewerutil.cpp.

◆ processHtml()

Util::HtmlMessageInfo MessageViewer::Util::processHtml ( const QString & htmlSource)
nodiscard

Definition at line 695 of file messageviewerutil.cpp.

◆ saveAttachments()

bool MessageViewer::Util::saveAttachments ( const KMime::Content::List & contents,
QWidget * parent,
QList< QUrl > & saveUrl )
nodiscard

Definition at line 432 of file messageviewerutil.cpp.

◆ saveMessageInMbox()

bool MessageViewer::Util::saveMessageInMbox ( const Akonadi::Item::List & retrievedMsgs,
QWidget * parent,
bool appendMessages = false )
nodiscard

Definition at line 552 of file messageviewerutil.cpp.

◆ saveMessageInMboxAndGetUrl()

bool MessageViewer::Util::saveMessageInMboxAndGetUrl ( QUrl & url,
const Akonadi::Item::List & retrievedMsgs,
QWidget * parent,
bool appendMessages = false )
nodiscard

Definition at line 464 of file messageviewerutil.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.