certmanager/lib

job.cpp
1/*
2 job.cpp
3
4 This file is part of libkleopatra, the KDE keymanagement library
5 Copyright (c) 2004,2005 Klarälvdalens Datakonsult AB
6
7 Libkleopatra is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
11
12 Libkleopatra is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21 In addition, as a special exception, the copyright holders give
22 permission to link the code of this program with any edition of
23 the TQt library by Trolltech AS, Norway (or with modified versions
24 of TQt that use the same license as TQt), and distribute linked
25 combinations including the two. You must obey the GNU General
26 Public License in all respects for all of the code used other than
27 TQt. If you modify this file, you may extend this exception to
28 your version of the file, but you are not obligated to do so. If
29 you do not wish to do so, delete this exception statement from
30 your version.
31*/
32
33#ifdef HAVE_CONFIG_H
34#include <config.h>
35#endif
36
37#include "job.h"
38
39#include "keylistjob.h"
40#include "encryptjob.h"
41#include "decryptjob.h"
42#include "decryptverifyjob.h"
43#include "signjob.h"
44#include "signencryptjob.h"
45#include "verifydetachedjob.h"
46#include "verifyopaquejob.h"
47#include "keygenerationjob.h"
48#include "importjob.h"
49#include "exportjob.h"
50#include "downloadjob.h"
51#include "deletejob.h"
52#include "refreshkeysjob.h"
53#include "specialjob.h"
54
55#include <gpgmepp/context.h>
56
57#include <tqapplication.h>
58#include <kdebug.h>
59
60#include <gpg-error.h>
61
62Kleo::Job::Job( TQObject * parent, const char * name )
63 : TQObject( parent, name )
64{
65 if ( tqApp )
66 connect( tqApp, TQ_SIGNAL(aboutToQuit()), TQ_SLOT(slotCancel()) );
67}
68
69Kleo::Job::~Job() {
70
71}
72
73void Kleo::Job::showErrorDialog( TQWidget *, const TQString & ) const {
74 kdDebug() << "Kleo::Job::showErrorDialog() should be reimplemented in Kleo::Job subclasses!" << endl;
75}
76
77TQString Kleo::Job::auditLogAsHtml() const {
78 kdDebug() << "Kleo::Job::auditLogAsHtml() should be reimplemented in Kleo::Job subclasses!" << endl;
79 return TQString();
80}
81
82GpgME::Error Kleo::Job::auditLogError() const {
83 kdDebug() << "Kleo::Job::auditLogError() should be reimplemented in Kleo::Job subclasses!" << endl;
84 return GpgME::Error( gpg_error( GPG_ERR_NOT_IMPLEMENTED ) );
85}
86
87bool Kleo::Job::isAuditLogSupported() const {
88 const GpgME::Error err = auditLogError();
89 return err.code() != GPG_ERR_NOT_IMPLEMENTED ;
90}
91
92#define make_job_subclass(x) \
93 Kleo::x::x( TQObject * parent, const char * name ) : Job( parent, name ) {} \
94 Kleo::x::~x() {}
95
96make_job_subclass(KeyListJob)
97make_job_subclass(EncryptJob)
98make_job_subclass(DecryptJob)
99make_job_subclass(DecryptVerifyJob)
100make_job_subclass(SignJob)
101make_job_subclass(SignEncryptJob)
102make_job_subclass(VerifyDetachedJob)
103make_job_subclass(VerifyOpaqueJob)
104make_job_subclass(KeyGenerationJob)
105make_job_subclass(ImportJob)
106make_job_subclass(ExportJob)
107make_job_subclass(DownloadJob)
108make_job_subclass(DeleteJob)
109make_job_subclass(RefreshKeysJob)
110make_job_subclass(SpecialJob)
111
112#undef make_job_subclass
113
114#include "job.moc"
115
116#include "keylistjob.moc"
117#include "encryptjob.moc"
118#include "decryptjob.moc"
119#include "decryptverifyjob.moc"
120#include "signjob.moc"
121#include "signencryptjob.moc"
122#include "verifydetachedjob.moc"
123#include "verifyopaquejob.moc"
124#include "keygenerationjob.moc"
125#include "importjob.moc"
126#include "exportjob.moc"
127#include "downloadjob.moc"
128#include "deletejob.moc"
129#include "refreshkeysjob.moc"
130#include "specialjob.moc"
An abstract base class for asynchronous decrypters.
Definition decryptjob.h:62
An abstract base class for asynchronous combined decrypters and verifiers.
An abstract base class for asynchronous deleters.
Definition deletejob.h:58
An abstract base class for asynchronous downloaders.
Definition downloadjob.h:61
An abstract base class for asynchronous encrypters.
Definition encryptjob.h:64
An abstract base class for asynchronous exporters.
Definition exportjob.h:61
An abstract base class for asynchronous importers.
Definition importjob.h:62
An abstract base class for asynchronous key generation.
An abstract base class for asynchronous key listers.
Definition keylistjob.h:65
An abstract base class for asynchronous key refreshers.
An abstract base class for asynchronous combined signing and encrypting.
An abstract base class for asynchronous signing.
Definition signjob.h:65
An abstract base class for protocol-specific jobs.
Definition specialjob.h:65
An abstract base class for asynchronous verification of detached signatures.
An abstract base class for asynchronous verification of opaque signatures.