Scale identity combobox and send/cancel buttons according to screen DPI.
[kdepim.git] / messageviewer / kleojobexecutor.h
blob300b885260dab2ab561312af2b0076357eff3fd5
1 /*
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>
28 #include <utility>
30 class QEventLoop;
32 namespace Kleo {
33 class DecryptVerifyJob;
34 class ImportJob;
35 class VerifyDetachedJob;
36 class VerifyOpaqueJob;
39 namespace MessageViewer {
41 /**
42 Helper class for synchronous execution of Kleo crypto jobs.
44 class KleoJobExecutor : public QObject
46 Q_OBJECT
47 public:
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;
64 private slots:
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 );
72 private:
73 QEventLoop *mEventLoop;
74 GpgME::VerificationResult mVerificationResult;
75 GpgME::DecryptionResult mDecryptResult;
76 GpgME::ImportResult mImportResult;
77 QByteArray mData;
78 GpgME::Error mAuditLogError;
79 QString mAuditLog;
84 #endif