33 #ifndef __KLEO_TQGPGMEJOB_H__
34 #define __KLEO_TQGPGMEJOB_H__
36 #include <gpgmepp/interfaces/progressprovider.h>
37 #include <gpgmepp/interfaces/passphraseprovider.h>
39 #include <gpgmepp/key.h>
40 #include <gpgmepp/context.h>
42 #include <tqcstring.h>
46 #include <tdemacros.h>
57 class TQByteArrayDataProvider;
78 class TDE_EXPORT QGpgMEJob : public GpgME::ProgressProvider, public GpgME::PassphraseProvider {
88 void hookupContextToEventLoopInteractor();
90 void setPatterns( const TQStringList & sl, bool allowEmpty= false );
94 const char* * nextChunk();
96 const char* * patterns() const;
98 void setChunkSize( unsigned int size );
102 void createOutData();
105 void createInData( const TQByteArray & in );
107 GpgME::Error setSigningKeys( const std::vector<GpgME::Key> & signers );
109 void doSlotOperationDoneEvent( GpgME::Context * context, const GpgME::Error & e );
118 virtual void doEmitProgressSignal( const TQString & what, int current, int total ) = 0;
119 virtual void doEmitDoneSignal() = 0;
121 TQString auditLogAsHtml() const { return mAuditLogAsHtml; }
122 GpgME::Error auditLogError() const { return mAuditLogError; }
126 void showProgress( const char * what, int type, int current, int total );
127 char * getPassphrase( const char * useridHint, const char * description,
128 bool previousWasBad, bool & canceled );
129 void deleteAllPatterns();
132 void checkInvariants() const;
136 GpgME::Context * mCtx;
137 GpgME::Data * mInData;
138 QGpgME::TQByteArrayDataProvider * mInDataDataProvider;
139 GpgME::Data * mOutData;
140 QGpgME::TQByteArrayDataProvider * mOutDataDataProvider;
142 const char* * mPatterns;
145 const char * mReplacedPattern;
146 unsigned int mNumPatterns;
147 unsigned int mChunkSize;
148 unsigned int mPatternStartIndex, mPatternEndIndex;
149 GpgME::Error mAuditLogError;
150 TQString mAuditLogAsHtml;
155 #define make_slot_cancel private: void slotCancel() { QGpgMEJob::doSlotCancel(); }
156 #define make_progress_emitter private: void doEmitProgressSignal( const TQString & what, int cur, int tot ) { emit progress( what, cur, tot ); }
157 #define make_done_emitter private: void doEmitDoneSignal() { emit done(); }
158 #define make_auditLogAsHtml private: TQString auditLogAsHtml() const { return QGpgMEJob::auditLogAsHtml(); } GpgME::Error auditLogError() const { return QGpgMEJob::auditLogError(); }
159 #define TQGPGME_JOB make_slot_cancel make_progress_emitter make_done_emitter make_auditLogAsHtml
An abstract base class for asynchronous crypto operations.
This is a hackish helper class to avoid code duplication in this backend's Kleo::Job subclasses.
virtual void doOperationDoneEvent(const GpgME::Error &e)=0
unsigned int numPatterns() const
unsigned int chunkSize() const
|