• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

messageviewer

  • sources
  • kde-4.12
  • kdepim
  • messageviewer
  • utils
util.h
Go to the documentation of this file.
1 /*******************************************************************************
2 **
3 ** Filename : util
4 ** Created on : 03 April, 2005
5 ** Copyright : (c) 2005 Till Adam
6 ** Email : <adam@kde.org>
7 **
8 *******************************************************************************/
9 
10 /*******************************************************************************
11 **
12 ** This program is free software; you can redistribute it and/or modify
13 ** it under the terms of the GNU General Public License as published by
14 ** the Free Software Foundation; either version 2 of the License, or
15 ** (at your option) any later version.
16 **
17 ** It is distributed in the hope that it will be useful, but
18 ** WITHOUT ANY WARRANTY; without even the implied warranty of
19 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ** General Public License for more details.
21 **
22 ** You should have received a copy of the GNU General Public License
23 ** along with this program; if not, write to the Free Software
24 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 **
26 ** In addition, as a special exception, the copyright holders give
27 ** permission to link the code of this program with any edition of
28 ** the Qt library by Trolltech AS, Norway (or with modified versions
29 ** of Qt that use the same license as Qt), and distribute linked
30 ** combinations including the two. You must obey the GNU General
31 ** Public License in all respects for all of the code used other than
32 ** Qt. If you modify this file, you may extend this exception to
33 ** your version of the file, but you are not obligated to do so. If
34 ** you do not wish to do so, delete this exception statement from
35 ** your version.
36 **
37 *******************************************************************************/
38 #ifndef MAILVIEWERUTIL_H
39 #define MAILVIEWERUTIL_H
40 
41 #include "messageviewer_export.h"
42 #include "kmime/kmime_content.h"
43 #include <KMimeType>
44 #include <QString>
45 #include <KService>
46 
47 class KUrl;
48 class QWidget;
49 class QActionGroup;
50 class KAction;
51 
52 namespace KMime {
53  class Content;
54  class Message;
55 }
56 
57 namespace Akonadi {
58  class Item;
59 }
60 
61 namespace MessageViewer {
62 
67 namespace Util {
68 
73  enum HtmlMode {
74  Normal,
75  Html,
76  MultipartPlain,
77  MultipartHtml
78  };
79 
80  // return true if we should proceed, false if we should abort
81  bool MESSAGEVIEWER_EXPORT checkOverwrite( const KUrl &url, QWidget *w );
82 
88  bool MESSAGEVIEWER_EXPORT handleUrlWithQDesktopServices( const KUrl& url );
89 
95  int MESSAGEVIEWER_EXPORT getWritePermissions();
96 
97  QList<KMime::Content*> MESSAGEVIEWER_EXPORT allContents( const KMime::Content *message );
98  QList<KMime::Content*> MESSAGEVIEWER_EXPORT extractAttachments( const KMime::Message *message );
99  bool MESSAGEVIEWER_EXPORT saveContents( QWidget *parent,
100  const QList<KMime::Content*> &contents );
101  bool MESSAGEVIEWER_EXPORT saveContent( QWidget *parent, KMime::Content* content,
102  const KUrl& url );
103 
120  QString MESSAGEVIEWER_EXPORT fileNameForMimetype( const QString &mimeType, int iconSize,
121  const QString &fallbackFileName1 = QString(),
122  const QString &fallbackFileName2 = QString() );
123  bool MESSAGEVIEWER_EXPORT saveMessageInMbox( const QList<Akonadi::Item>& retrievedMsgs, QWidget*parent, bool appendMessages = false);
124 
125  bool MESSAGEVIEWER_EXPORT saveAttachments( const KMime::Content::List& contents, QWidget *parent );
126 
127  bool MESSAGEVIEWER_EXPORT speakSelectedText( const QString& text, QWidget *parent);
128  MESSAGEVIEWER_EXPORT KAction* createAppAction(const KService::Ptr& service, bool singleOffer, QActionGroup *actionGroup, QObject *parent );
129 
133  MESSAGEVIEWER_EXPORT KMimeType::Ptr mimetype(const QString& name);
134 }
135 
136 }
137 Q_DECLARE_METATYPE(KService::Ptr)
138 #endif
MessageViewer::Util::fileNameForMimetype
QString MESSAGEVIEWER_EXPORT fileNameForMimetype(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.
Definition: util.cpp:93
MessageViewer::Util::HtmlMode
HtmlMode
Describes the type of the displayed message.
Definition: util.h:73
MessageViewer::Util::saveAttachments
bool MESSAGEVIEWER_EXPORT saveAttachments(const KMime::Content::List &contents, QWidget *parent)
Definition: util.cpp:453
MessageViewer::Util::MultipartPlain
A multipart/alternative message, the plain text part is currently displayed.
Definition: util.h:76
MessageViewer::Util::speakSelectedText
bool MESSAGEVIEWER_EXPORT speakSelectedText(const QString &text, QWidget *parent)
Definition: util.cpp:530
MessageViewer::Util::saveMessageInMbox
bool MESSAGEVIEWER_EXPORT saveMessageInMbox(const QList< Akonadi::Item > &retrievedMsgs, QWidget *parent, bool appendMessages=false)
Definition: util.cpp:463
QWidget
QObject
MessageViewer::Util::saveContents
bool MESSAGEVIEWER_EXPORT saveContents(QWidget *parent, const QList< KMime::Content * > &contents)
Definition: util.cpp:190
MessageViewer::Util::createAppAction
MESSAGEVIEWER_EXPORT KAction * createAppAction(const KService::Ptr &service, bool singleOffer, QActionGroup *actionGroup, QObject *parent)
Definition: util.cpp:550
MessageViewer::Util::Normal
A normal plaintext message, non-multipart.
Definition: util.h:74
MessageViewer::Util::Html
A HTML message, non-multipart.
Definition: util.h:75
MESSAGEVIEWER_EXPORT
#define MESSAGEVIEWER_EXPORT
Definition: messageviewer_export.h:37
MessageViewer::Util::mimetype
MESSAGEVIEWER_EXPORT KMimeType::Ptr mimetype(const QString &name)
Search mimetype from filename when mimetype is empty or application/octet-stream. ...
Definition: util.cpp:568
MessageViewer::Util::saveContent
bool MESSAGEVIEWER_EXPORT saveContent(QWidget *parent, KMime::Content *content, const KUrl &url)
Definition: util.cpp:306
MessageViewer::Util::checkOverwrite
bool MESSAGEVIEWER_EXPORT checkOverwrite(const KUrl &url, QWidget *w)
Definition: util.cpp:79
MessageViewer::Util::allContents
QList< KMime::Content * > MESSAGEVIEWER_EXPORT allContents(const KMime::Content *message)
Definition: util.cpp:153
MessageViewer::Util::handleUrlWithQDesktopServices
bool MESSAGEVIEWER_EXPORT handleUrlWithQDesktopServices(const KUrl &url)
Delegates opening a URL to the QDesktopServices mechanisms for that on Windows and MacOSX...
Definition: util.cpp:142
MessageViewer::Util::getWritePermissions
int MESSAGEVIEWER_EXPORT getWritePermissions()
evaluates GlobalSettings->disregardUmask() and returns resulting permissions for storing files ...
Definition: util.cpp:443
MessageViewer::Util::extractAttachments
QList< KMime::Content * > MESSAGEVIEWER_EXPORT extractAttachments(const KMime::Message *message)
Definition: util.cpp:170
MessageViewer::Util::MultipartHtml
A multipart/altervative message, the HTML part is currently displayed.
Definition: util.h:77
messageviewer_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messageviewer

Skip menu "messageviewer"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal