MessageViewer::Util
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 QAction * | createAppAction (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) |
MESSAGEVIEWER_EXPORT QByteArray | htmlCodec (const QByteArray &data, const QByteArray ¤tCodec) |
MESSAGEVIEWER_EXPORT QStringConverter::Encoding | htmlEncoding (const QByteArray &data, const QByteArray &codec) |
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 | ) |
Definition at line 27 of file mimetype.cpp.
◆ checkOverwrite()
Definition at line 111 of file messageviewerutil.cpp.
◆ containsExternalReferences()
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 45 of file messageviewerutil.cpp.
◆ createAppAction()
QAction * MessageViewer::Util::createAppAction | ( | const KService::Ptr & | service, |
bool | singleOffer, | ||
QActionGroup * | actionGroup, | ||
QObject * | parent ) |
Definition at line 637 of file messageviewerutil.cpp.
◆ deleteAttachment()
bool MessageViewer::Util::deleteAttachment | ( | KMime::Content * | node | ) |
Replaces the node
message part by an empty attachment with information about deleted attachment.
- Parameters
-
node A 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 576 of file messageviewerutil.cpp.
◆ deleteAttachments()
int MessageViewer::Util::deleteAttachments | ( | const KMime::Content::List & | contents | ) |
Calls deleteAttachment() for each node in the contents
list.
- Parameters
-
contents List 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 626 of file messageviewerutil.cpp.
◆ excludeExtraHeader()
bool MessageViewer::Util::excludeExtraHeader | ( | const QString & | s | ) |
Definition at line 654 of file messageviewerutil.cpp.
◆ generateFileNameForExtension()
QString MessageViewer::Util::generateFileNameForExtension | ( | const Akonadi::Item & | msgBase, |
const QString & | extension ) |
Definition at line 460 of file messageviewerutil.cpp.
◆ generateMboxFileName()
QString MessageViewer::Util::generateMboxFileName | ( | const Akonadi::Item & | msgBase | ) |
Definition at line 477 of file messageviewerutil.cpp.
◆ htmlCodec()
QByteArray MessageViewer::Util::htmlCodec | ( | const QByteArray & | data, |
const QByteArray & | currentCodec ) |
Definition at line 781 of file messageviewerutil.cpp.
◆ htmlEncoding()
QStringConverter::Encoding MessageViewer::Util::htmlEncoding | ( | const QByteArray & | data, |
const QByteArray & | codec ) |
Return a QTextCodec for the specified charset.
This function is a bit more tolerant, than QTextCodec::codecForName
Definition at line 797 of file messageviewerutil.cpp.
◆ iconPathForContent()
QString MessageViewer::Util::iconPathForContent | ( | KMime::Content * | node, |
int | iconSize ) |
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() ) |
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
-
mimeType The primary mime type used to find the icon, e.g. "application/zip". Alias mimetypes are resolved. iconSize Size of the requested icon, e.g. KIconLoader::Desktop fallbackFileName1 When 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" fallbackFileName2 Fallback for fallbackFileName1
.
- Returns
- the full file name of the icon file
Definition at line 17 of file mimetype.cpp.
◆ parseBodyStyle()
Definition at line 684 of file messageviewerutil.cpp.
◆ processHtml()
Util::HtmlMessageInfo MessageViewer::Util::processHtml | ( | const QString & | htmlSource | ) |
Definition at line 713 of file messageviewerutil.cpp.
◆ saveAttachments()
bool MessageViewer::Util::saveAttachments | ( | const KMime::Content::List & | contents, |
QWidget * | parent, | ||
QList< QUrl > & | saveUrl ) |
Definition at line 450 of file messageviewerutil.cpp.
◆ saveMessageInMbox()
bool MessageViewer::Util::saveMessageInMbox | ( | const Akonadi::Item::List & | retrievedMsgs, |
QWidget * | parent, | ||
bool | appendMessages = false ) |
Definition at line 570 of file messageviewerutil.cpp.
◆ saveMessageInMboxAndGetUrl()
bool MessageViewer::Util::saveMessageInMboxAndGetUrl | ( | QUrl & | url, |
const Akonadi::Item::List & | retrievedMsgs, | ||
QWidget * | parent, | ||
bool | appendMessages = false ) |
Definition at line 482 of file messageviewerutil.cpp.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:44 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.