Messagelib

encryptjob.h
1 /*
2  SPDX-FileCopyrightText: 2009 Klaralvdalens Datakonsult AB, a KDAB Group company, [email protected]
3  SPDX-FileCopyrightText: 2009 Leo Franchi <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #pragma once
9 
10 #include "abstractencryptjob.h"
11 #include "contentjobbase.h"
12 #include "infopart.h"
13 #include "messagecomposer_export.h"
14 
15 #include <Libkleo/Enum>
16 
17 #include <gpgme++/key.h>
18 #include <vector>
19 
20 namespace KMime
21 {
22 class Content;
23 }
24 
25 namespace MessageComposer
26 {
27 class EncryptJobPrivate;
28 
29 /**
30  Encrypt the contents of a message .
31  Used as a subjob of CryptoMessage
32 */
33 class MESSAGECOMPOSER_EXPORT EncryptJob : public ContentJobBase, public MessageComposer::AbstractEncryptJob
34 {
35  Q_OBJECT
36 
37 public:
38  explicit EncryptJob(QObject *parent = nullptr);
39  ~EncryptJob() override;
40 
41  void setContent(KMime::Content *content);
42  void setCryptoMessageFormat(Kleo::CryptoMessageFormat format);
43  void setEncryptionKeys(const std::vector<GpgME::Key> &keys) override;
44  void setRecipients(const QStringList &rec) override;
45  void setSkeletonMessage(KMime::Message *skeletonMessage);
46 
47  void setProtectedHeaders(bool protectedHeaders);
48  void setProtectedHeadersObvoscate(bool protectedHeadersObvoscate);
49 
50  void setGnupgHome(const QString &path);
51 
52  std::vector<GpgME::Key> encryptionKeys() const override;
53  QStringList recipients() const override;
54 
55 protected Q_SLOTS:
56  void doStart() override;
57  void slotResult(KJob *job) override;
58  void process() override;
59 
60 private:
61  Q_DECLARE_PRIVATE(EncryptJob)
62 };
63 }
64 
Encrypt the contents of a message .
Definition: encryptjob.h:33
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
The ContentJobBase class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Nov 26 2021 23:16:42 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.