MessageViewer::Util

MessageViewer::Util Namespace Reference

Functions

AttachmentDisplayInfo attachmentDisplayInfo (KMime::Content *node)
 
bool MESSAGEVIEWER_EXPORT checkOverwrite (const QUrl &url, QWidget *w)
 
MESSAGEVIEWER_EXPORT const QTextCodeccodecForName (const QByteArray &_str)
 
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 excludeExtraHeader (const QString &s)
 
MESSAGEVIEWER_EXPORT QString generateFileNameForExtension (const Akonadi::Item &msgBase, const QString &extension)
 
MESSAGEVIEWER_EXPORT QString generateMboxFileName (const Akonadi::Item &msgBase)
 
MESSAGEVIEWER_EXPORT QByteArray htmlCodec (const QByteArray &data, const QByteArray &currentCodec)
 
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

const QTextCodec * MessageViewer::Util::codecForName ( const QByteArray _str)

Return a QTextCodec for the specified charset.

This function is a bit more tolerant, than QTextCodec::codecForName

Definition at line 651 of file messageviewerutil.cpp.

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

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 82 of file messageviewerutil.cpp.

QString MessageViewer::Util::iconPathForMimetype ( 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.

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 18 of file mimetype.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Sep 27 2021 23:17:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.