00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
#ifndef __KLEO_QGPGMESIGNENCRYPTJOB_H__
00034
#define __KLEO_QGPGMESIGNENCRYPTJOB_H__
00035
00036
#include <kleo/signencryptjob.h>
00037
00038
#include "qgpgmejob.h"
00039
00040
#include <gpgmepp/signingresult.h>
00041
#include <gpgmepp/encryptionresult.h>
00042
00043
#include <qcstring.h>
00044
00045
#include <utility>
00046
00047
namespace GpgME {
00048
class Error;
00049
class Context;
00050
class Key;
00051 }
00052
00053
namespace Kleo {
00054
00055
class QGpgMESignEncryptJob :
public SignEncryptJob,
private QGpgMEJob {
00056 Q_OBJECT QGPGME_JOB
00057
public:
00058 QGpgMESignEncryptJob( GpgME::Context * context );
00059 ~QGpgMESignEncryptJob();
00060
00062 GpgME::Error start(
const std::vector<GpgME::Key> & signers,
00063
const std::vector<GpgME::Key> & recipients,
00064
const QByteArray & plainText,
bool alwaysTrust );
00065
00066 std::pair<GpgME::SigningResult,GpgME::EncryptionResult>
00067 exec(
const std::vector<GpgME::Key> & signers,
00068
const std::vector<GpgME::Key> & recipients,
00069
const QByteArray & plainText,
bool alwaysTrust,
00070
QByteArray & cipherText );
00071
00073
void showErrorDialog(
QWidget * parent )
const;
00074
00075
private slots:
00076
void slotOperationDoneEvent( GpgME::Context * context,
const GpgME::Error & e ) {
00077 QGpgMEJob::doSlotOperationDoneEvent( context, e );
00078 }
00079
00080
private:
00081
void doOperationDoneEvent(
const GpgME::Error & e );
00082 GpgME::Error setup(
const std::vector<GpgME::Key> &,
00083
const QByteArray & );
00084
private:
00085 std::pair<GpgME::SigningResult,GpgME::EncryptionResult> mResult;
00086 };
00087
00088 }
00089
00090
#endif // __KLEO_QGPGMESIGNENCRYPTJOB_H__