~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to messageviewer/webkitparthtmlwriter.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  -*- c++ -*-
 
2
    webkitparthtmlwriter.h
 
3
 
 
4
    This file is part of KMail, the KDE mail client.
 
5
    Copyright (c) 2003 Marc Mutz <mutz@kde.org>
 
6
    Copyright (c) 2009 Torgny Nyblom <kde@nyblom.org>
 
7
 
 
8
    KMail is free software; you can redistribute it and/or modify it
 
9
    under the terms of the GNU General Public License, version 2, as
 
10
    published by the Free Software Foundation.
 
11
 
 
12
    KMail is distributed in the hope that it will be useful, but
 
13
    WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
    General Public License for more details.
 
16
 
 
17
    You should have received a copy of the GNU General Public License
 
18
    along with this program; if not, write to the Free Software
 
19
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
20
 
 
21
    In addition, as a special exception, the copyright holders give
 
22
    permission to link the code of this program with any edition of
 
23
    the Qt library by Trolltech AS, Norway (or with modified versions
 
24
    of Qt that use the same license as Qt), and distribute linked
 
25
    combinations including the two.  You must obey the GNU General
 
26
    Public License in all respects for all of the code used other than
 
27
    Qt.  If you modify this file, you may extend this exception to
 
28
    your version of the file, but you are not obligated to do so.  If
 
29
    you do not wish to do so, delete this exception statement from
 
30
    your version.
 
31
*/
 
32
 
 
33
#ifndef MESSAGEVIEWER_WEBKITPARTHTMLWRITER_H
 
34
#define MESSAGEVIEWER_WEBKITPARTHTMLWRITER_H
 
35
 
 
36
#include "interfaces/htmlwriter.h"
 
37
#include <QObject>
 
38
 
 
39
#include <QString>
 
40
#include <QByteArray>
 
41
#include <QMap>
 
42
 
 
43
namespace MessageViewer {
 
44
  class MailWebView;
 
45
}
 
46
 
 
47
namespace MessageViewer {
 
48
 
 
49
class WebKitPartHtmlWriter : public QObject, public HtmlWriter {
 
50
  Q_OBJECT
 
51
public:
 
52
  explicit WebKitPartHtmlWriter( MailWebView * view, QObject * parent=0 );
 
53
  ~WebKitPartHtmlWriter();
 
54
 
 
55
  void begin( const QString & cssDefs );
 
56
  void end();
 
57
  void reset();
 
58
  void write( const QString & str );
 
59
  void queue( const QString & str );
 
60
  void flush();
 
61
  void embedPart( const QByteArray & contentId, const QString & url );
 
62
 
 
63
signals:
 
64
  void finished();
 
65
 
 
66
private:
 
67
  void resolveCidUrls();
 
68
 
 
69
private:
 
70
  MailWebView * mHtmlView;
 
71
  QString mHtml;
 
72
  QString mCss;
 
73
  enum State {
 
74
    Begun,
 
75
    Queued,
 
76
    Ended
 
77
  } mState;
 
78
  // Key is Content-Id, value is URL
 
79
  typedef QMap<QString, QString> EmbeddedPartMap;
 
80
  EmbeddedPartMap mEmbeddedPartMap;
 
81
};
 
82
 
 
83
}
 
84
 
 
85
#endif // __MESSAGEVIEWER_WEBKITPARTHTMLWRITER_H__