qgpgmejob.h
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_QGPGMEJOB_H__
00034 #define __KLEO_QGPGMEJOB_H__
00035
00036 #include <gpgmepp/interfaces/progressprovider.h>
00037 #include <gpgmepp/interfaces/passphraseprovider.h>
00038
00039 #include <gpgmepp/key.h>
00040
00041 #include <qcstring.h>
00042
00043 #include <vector>
00044
00045 namespace GpgME {
00046 class Error;
00047 class Context;
00048 class Data;
00049 }
00050
00051 namespace Kleo {
00052 class Job;
00053 }
00054
00055 namespace QGpgME {
00056 class QByteArrayDataProvider;
00057 }
00058
00059 class QString;
00060 class QStringList;
00061
00062 namespace Kleo {
00063
00077 class QGpgMEJob : public GpgME::ProgressProvider, public GpgME::PassphraseProvider {
00078 public:
00079 QGpgMEJob( Kleo::Job * _this, GpgME::Context * context );
00080 ~QGpgMEJob();
00081
00082 protected:
00085 virtual void doOperationDoneEvent( const GpgME::Error & e ) = 0;
00087 void hookupContextToEventLoopInteractor();
00089 void setPatterns( const QStringList & sl, bool allowEmpty=false );
00091 void createOutData();
00094 void createInData( const QByteArray & in );
00096 GpgME::Error setSigningKeys( const std::vector<GpgME::Key> & signers );
00098 void doSlotOperationDoneEvent( GpgME::Context * context, const GpgME::Error & e );
00099
00100
00101
00102
00103
00104 protected:
00105 virtual void doEmitProgressSignal( const QString & what, int current, int total ) = 0;
00106 virtual void doEmitDoneSignal() = 0;
00107 void doSlotCancel();
00108
00109 private:
00111 void showProgress( const char * what, int type, int current, int total );
00112 char * getPassphrase( const char * useridHint, const char * description,
00113 bool previousWasBad, bool & canceled );
00114
00115 protected:
00116 Kleo::Job * mThis;
00117 GpgME::Context * mCtx;
00118 const char* * mPatterns;
00119 GpgME::Data * mInData;
00120 QGpgME::QByteArrayDataProvider * mInDataDataProvider;
00121 GpgME::Data * mOutData;
00122 QGpgME::QByteArrayDataProvider * mOutDataDataProvider;
00123 };
00124
00125 }
00126
00127 #define make_slot_cancel private: void slotCancel() { QGpgMEJob::doSlotCancel(); }
00128 #define make_progress_emitter private: void doEmitProgressSignal( const QString & what, int cur, int tot ) { emit progress( what, cur, tot ); }
00129 #define make_done_emitter private: void doEmitDoneSignal() { emit done(); }
00130 #define QGPGME_JOB make_slot_cancel make_progress_emitter make_done_emitter
00131
00132 #endif // __KLEO_QGPGMEJOB_H__
This file is part of the documentation for certmanager/lib Library Version 3.3.2.