2 Copyright (c) 2008 Volker Krause <vkrause@kde.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef _MESSAGEVIEWER_KLEOJOBEXECUTOR_H
20 #define _MESSAGEVIEWER_KLEOJOBEXECUTOR_H
22 #include <gpgme++/decryptionresult.h>
23 #include <gpgme++/importresult.h>
24 #include <gpgme++/verificationresult.h>
26 #include <QtCore/QObject>
33 class DecryptVerifyJob
;
35 class VerifyDetachedJob
;
36 class VerifyOpaqueJob
;
39 namespace MessageViewer
{
42 Helper class for synchronous execution of Kleo crypto jobs.
44 class KleoJobExecutor
: public QObject
48 KleoJobExecutor( QObject
*parent
= 0 );
50 GpgME::VerificationResult
exec( Kleo::VerifyDetachedJob
* job
,
51 const QByteArray
&signature
,
52 const QByteArray
&signedData
);
53 GpgME::VerificationResult
exec( Kleo::VerifyOpaqueJob
* job
,
54 const QByteArray
&signedData
,
55 QByteArray
&plainText
);
56 std::pair
<GpgME::DecryptionResult
,GpgME::VerificationResult
> exec( Kleo::DecryptVerifyJob
*job
,
57 const QByteArray
&cipherText
,
58 QByteArray
&plainText
);
59 GpgME::ImportResult
exec( Kleo::ImportJob
* job
, const QByteArray
&certData
);
61 GpgME::Error
auditLogError() const { return mAuditLogError
; }
62 QString
auditLogAsHtml() const;
65 void verificationResult( const GpgME::VerificationResult
&result
);
66 void verificationResult( const GpgME::VerificationResult
&result
, const QByteArray
&plainText
);
67 void decryptResult( const GpgME::DecryptionResult
& decryptionresult
,
68 const GpgME::VerificationResult
& verificationresult
,
69 const QByteArray
& plainText
);
70 void importResult( const GpgME::ImportResult
&result
);
73 QEventLoop
*mEventLoop
;
74 GpgME::VerificationResult mVerificationResult
;
75 GpgME::DecryptionResult mDecryptResult
;
76 GpgME::ImportResult mImportResult
;
78 GpgME::Error mAuditLogError
;