Prepare for the removal of sendmail support in mailtransport.
[kdepim.git] / kleopatra / crypto / signemailtask.h
blob2e383f5279dcb3457d11eee9163f3576b974efe6
1 /* -*- mode: c++; c-basic-offset:4 -*-
2 crypto/signemailtask.h
4 This file is part of Kleopatra, the KDE keymanager
5 Copyright (c) 2007 Klarälvdalens Datakonsult AB
7 Kleopatra is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 Kleopatra 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.
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
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 Qt library by Trolltech AS, Norway (or with modified versions
24 of Qt that use the same license as Qt), 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 Qt. 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.
33 #ifndef __KLEOPATRA_CRYPTO_SIGNEMAILTASK_H__
34 #define __KLEOPATRA_CRYPTO_SIGNEMAILTASK_H__
36 #include <crypto/task.h>
38 #include <utils/pimpl_ptr.h>
40 #include <gpgme++/global.h>
42 #include <boost/shared_ptr.hpp>
44 #include <vector>
46 namespace GpgME
48 class Key;
51 namespace Kleo
53 class Input;
54 class Output;
57 namespace Kleo
59 namespace Crypto
62 class SignEMailTask : public Task
64 Q_OBJECT
65 public:
66 explicit SignEMailTask(QObject *parent = Q_NULLPTR);
67 ~SignEMailTask();
69 void setInput(const boost::shared_ptr<Input> &input);
70 void setOutput(const boost::shared_ptr<Output> &output);
71 void setSigners(const std::vector<GpgME::Key> &recipients);
73 void setDetachedSignature(bool detached);
74 void setClearsign(bool clear);
76 GpgME::Protocol protocol() const Q_DECL_OVERRIDE;
78 void cancel() Q_DECL_OVERRIDE;
79 QString label() const Q_DECL_OVERRIDE;
81 QString micAlg() const;
83 private:
84 void doStart() Q_DECL_OVERRIDE;
85 unsigned long long inputSize() const Q_DECL_OVERRIDE;
87 private:
88 class Private;
89 kdtools::pimpl_ptr<Private> d;
90 Q_PRIVATE_SLOT(d, void slotResult(const GpgME::SigningResult &))
96 #endif /* __KLEOPATRA_CRYPTO_SIGNEMAILTASK_H__ */