Messagelib

encryptjob.h
1/*
2 SPDX-FileCopyrightText: 2009 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
3 SPDX-FileCopyrightText: 2009 Leo Franchi <lfranchi@kde.org>
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
20namespace KMime
21{
22class Content;
23}
24
25namespace MessageComposer
26{
27class EncryptJobPrivate;
28
29/**
30 Encrypt the contents of a message .
31 Used as a subjob of CryptoMessage
32*/
33class MESSAGECOMPOSER_EXPORT EncryptJob : public ContentJobBase, public MessageComposer::AbstractEncryptJob
34{
35 Q_OBJECT
36
37public:
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 [[nodiscard]] std::vector<GpgME::Key> encryptionKeys() const override;
53 [[nodiscard]] QStringList recipients() const override;
54
55protected Q_SLOTS:
56 void doStart() override;
57 void slotResult(KJob *job) override;
58 void process() override;
59
60private:
61 Q_DECLARE_PRIVATE(EncryptJob)
62};
63}
The ContentJobBase class.
Encrypt the contents of a message .
Definition encryptjob.h:34
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.