• 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
  • viewer
objecttreeparser_p.h
Go to the documentation of this file.
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2  objecttreeparser_p.h
3 
4  This file is part of KMail, the KDE mail client.
5  Copyright (C) 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
6  Copyright (c) 2009 Andras Mantia <andras@kdab.net>
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_OBJECTTREEPARSER_P_H_
34 #define _MESSAGEVIEWER_OBJECTTREEPARSER_P_H_
35 
36 #include <gpgme++/verificationresult.h>
37 #include <gpgme++/decryptionresult.h>
38 #include <gpgme++/key.h>
39 
40 #include <QObject>
41 #include <QString>
42 #include <QPointer>
43 
44 #include "interfaces/bodypart.h"
45 #include "viewer/viewer.h"
46 
47 namespace Kleo {
48  class DecryptVerifyJob;
49  class VerifyDetachedJob;
50  class VerifyOpaqueJob;
51  class KeyListJob;
52 }
53 
54 class QStringList;
55 
56 namespace MessageViewer {
57 
58 class CryptoBodyPartMemento
59  : public QObject,
60  public Interface::BodyPartMemento
61 {
62  Q_OBJECT
63 public:
64  CryptoBodyPartMemento();
65  ~CryptoBodyPartMemento();
66 
67  bool isRunning() const { return m_running; }
68 
69  const QString & auditLogAsHtml() const { return m_auditLog; }
70  GpgME::Error auditLogError() const { return m_auditLogError; }
71 
72  void detach();
73 
74 signals:
75  void update(MessageViewer::Viewer::UpdateMode);
76 
77 protected slots:
78  void notify() {
79  emit update(Viewer::Force);
80  }
81 
82 protected:
83  void setAuditLog( const GpgME::Error & err, const QString & log );
84  void setRunning( bool running );
85 
86 private:
87  bool m_running;
88  QString m_auditLog;
89  GpgME::Error m_auditLogError;
90 };
91 
92 class DecryptVerifyBodyPartMemento
93  : public CryptoBodyPartMemento
94 {
95  Q_OBJECT
96 public:
97  DecryptVerifyBodyPartMemento( Kleo::DecryptVerifyJob * job, const QByteArray & cipherText );
98  ~DecryptVerifyBodyPartMemento();
99 
100  bool start();
101  void exec();
102 
103  const QByteArray & plainText() const { return m_plainText; }
104  const GpgME::DecryptionResult & decryptResult() const { return m_dr; }
105  const GpgME::VerificationResult & verifyResult() const { return m_vr; }
106 
107 private slots:
108  void slotResult( const GpgME::DecryptionResult & dr,
109  const GpgME::VerificationResult & vr,
110  const QByteArray & plainText );
111 
112 private:
113  void saveResult( const GpgME::DecryptionResult &,
114  const GpgME::VerificationResult &,
115  const QByteArray & );
116 private:
117  // input:
118  const QByteArray m_cipherText;
119  QPointer<Kleo::DecryptVerifyJob> m_job;
120  // output:
121  GpgME::DecryptionResult m_dr;
122  GpgME::VerificationResult m_vr;
123  QByteArray m_plainText;
124 };
125 
126 
127 class VerifyDetachedBodyPartMemento
128  : public CryptoBodyPartMemento
129 {
130  Q_OBJECT
131 public:
132  VerifyDetachedBodyPartMemento( Kleo::VerifyDetachedJob * job,
133  Kleo::KeyListJob * klj,
134  const QByteArray & signature,
135  const QByteArray & plainText );
136  ~VerifyDetachedBodyPartMemento();
137 
138  bool start();
139  void exec();
140 
141  const GpgME::VerificationResult & verifyResult() const { return m_vr; }
142  const GpgME::Key & signingKey() const { return m_key; }
143 
144 private slots:
145  void slotResult( const GpgME::VerificationResult & vr );
146  void slotKeyListJobDone();
147  void slotNextKey( const GpgME::Key & );
148 
149 private:
150  void saveResult( const GpgME::VerificationResult & );
151  bool canStartKeyListJob() const;
152  QStringList keyListPattern() const;
153  bool startKeyListJob();
154 private:
155  // input:
156  const QByteArray m_signature;
157  const QByteArray m_plainText;
158  QPointer<Kleo::VerifyDetachedJob> m_job;
159  QPointer<Kleo::KeyListJob> m_keylistjob;
160  // output:
161  GpgME::VerificationResult m_vr;
162  GpgME::Key m_key;
163 };
164 
165 
166 class VerifyOpaqueBodyPartMemento
167  : public CryptoBodyPartMemento
168 {
169  Q_OBJECT
170 public:
171  VerifyOpaqueBodyPartMemento( Kleo::VerifyOpaqueJob * job,
172  Kleo::KeyListJob * klj,
173  const QByteArray & signature );
174  ~VerifyOpaqueBodyPartMemento();
175 
176  bool start();
177  void exec();
178 
179  const QByteArray & plainText() const { return m_plainText; }
180  const GpgME::VerificationResult & verifyResult() const { return m_vr; }
181  const GpgME::Key & signingKey() const { return m_key; }
182 
183 private slots:
184  void slotResult( const GpgME::VerificationResult & vr,
185  const QByteArray & plainText );
186  void slotKeyListJobDone();
187  void slotNextKey( const GpgME::Key & );
188 
189 private:
190  void saveResult( const GpgME::VerificationResult &,
191  const QByteArray & );
192  bool canStartKeyListJob() const;
193  QStringList keyListPattern() const;
194  bool startKeyListJob();
195 private:
196  // input:
197  const QByteArray m_signature;
198  QPointer<Kleo::VerifyOpaqueJob> m_job;
199  QPointer<Kleo::KeyListJob> m_keylistjob;
200  // output:
201  GpgME::VerificationResult m_vr;
202  QByteArray m_plainText;
203  GpgME::Key m_key;
204 };
205 
206 }
207 
208 
209 #endif // _KMAIL_OBJECTTREEPARSER_H_
MessageViewer::VerifyOpaqueBodyPartMemento::verifyResult
const GpgME::VerificationResult & verifyResult() const
Definition: objecttreeparser_p.h:180
MessageViewer::VerifyDetachedBodyPartMemento::verifyResult
const GpgME::VerificationResult & verifyResult() const
Definition: objecttreeparser_p.h:141
viewer.h
MessageViewer::VerifyDetachedBodyPartMemento
Definition: objecttreeparser_p.h:127
MessageViewer::VerifyDetachedBodyPartMemento::signingKey
const GpgME::Key & signingKey() const
Definition: objecttreeparser_p.h:142
MessageViewer::DecryptVerifyBodyPartMemento::verifyResult
const GpgME::VerificationResult & verifyResult() const
Definition: objecttreeparser_p.h:105
MessageViewer::Viewer::UpdateMode
UpdateMode
The display update mode: Force updates the display immediately, Delayed updates after some time (150m...
Definition: viewer.h:132
MessageViewer::VerifyOpaqueBodyPartMemento::~VerifyOpaqueBodyPartMemento
~VerifyOpaqueBodyPartMemento()
MessageViewer::DecryptVerifyBodyPartMemento::start
bool start()
QObject
MessageViewer::CryptoBodyPartMemento::setAuditLog
void setAuditLog(const GpgME::Error &err, const QString &log)
MessageViewer::CryptoBodyPartMemento::notify
void notify()
Definition: objecttreeparser_p.h:78
MessageViewer::CryptoBodyPartMemento::isRunning
bool isRunning() const
Definition: objecttreeparser_p.h:67
MessageViewer::DecryptVerifyBodyPartMemento::~DecryptVerifyBodyPartMemento
~DecryptVerifyBodyPartMemento()
MessageViewer::DecryptVerifyBodyPartMemento
Definition: objecttreeparser_p.h:92
MessageViewer::VerifyOpaqueBodyPartMemento::exec
void exec()
MessageViewer::CryptoBodyPartMemento::detach
void detach()
bodypart.h
MessageViewer::DecryptVerifyBodyPartMemento::DecryptVerifyBodyPartMemento
DecryptVerifyBodyPartMemento(Kleo::DecryptVerifyJob *job, const QByteArray &cipherText)
MessageViewer::DecryptVerifyBodyPartMemento::plainText
const QByteArray & plainText() const
Definition: objecttreeparser_p.h:103
MessageViewer::VerifyOpaqueBodyPartMemento::signingKey
const GpgME::Key & signingKey() const
Definition: objecttreeparser_p.h:181
MessageViewer::CryptoBodyPartMemento::CryptoBodyPartMemento
CryptoBodyPartMemento()
MessageViewer::VerifyOpaqueBodyPartMemento::start
bool start()
MessageViewer::Interface::BodyPartMemento
interface of classes that implement status for BodyPartFormatters.
Definition: bodypart.h:55
MessageViewer::VerifyDetachedBodyPartMemento::VerifyDetachedBodyPartMemento
VerifyDetachedBodyPartMemento(Kleo::VerifyDetachedJob *job, Kleo::KeyListJob *klj, const QByteArray &signature, const QByteArray &plainText)
MessageViewer::VerifyOpaqueBodyPartMemento::plainText
const QByteArray & plainText() const
Definition: objecttreeparser_p.h:179
MessageViewer::CryptoBodyPartMemento
Definition: objecttreeparser_p.h:58
MessageViewer::CryptoBodyPartMemento::~CryptoBodyPartMemento
~CryptoBodyPartMemento()
MessageViewer::DecryptVerifyBodyPartMemento::decryptResult
const GpgME::DecryptionResult & decryptResult() const
Definition: objecttreeparser_p.h:104
MessageViewer::VerifyDetachedBodyPartMemento::~VerifyDetachedBodyPartMemento
~VerifyDetachedBodyPartMemento()
MessageViewer::Viewer::Force
Definition: viewer.h:133
MessageViewer::VerifyOpaqueBodyPartMemento::VerifyOpaqueBodyPartMemento
VerifyOpaqueBodyPartMemento(Kleo::VerifyOpaqueJob *job, Kleo::KeyListJob *klj, const QByteArray &signature)
MessageViewer::VerifyDetachedBodyPartMemento::start
bool start()
MessageViewer::VerifyDetachedBodyPartMemento::exec
void exec()
MessageViewer::DecryptVerifyBodyPartMemento::exec
void exec()
MessageViewer::CryptoBodyPartMemento::auditLogAsHtml
const QString & auditLogAsHtml() const
Definition: objecttreeparser_p.h:69
MessageViewer::CryptoBodyPartMemento::setRunning
void setRunning(bool running)
MessageViewer::CryptoBodyPartMemento::update
void update(MessageViewer::Viewer::UpdateMode)
MessageViewer::CryptoBodyPartMemento::auditLogError
GpgME::Error auditLogError() const
Definition: objecttreeparser_p.h:70
MessageViewer::VerifyOpaqueBodyPartMemento
Definition: objecttreeparser_p.h:166
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