Messagelib

cryptobodypartmemento.h
1/*
2 SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <gpgme++/error.h>
10
11#include <QObject>
12#include <QString>
13
14#include "enums.h"
15#include "interfaces/bodypart.h"
16
17namespace MimeTreeParser
18{
19class CryptoBodyPartMemento : public QObject, public Interface::BodyPartMemento
20{
22public:
23 CryptoBodyPartMemento();
24 ~CryptoBodyPartMemento() override;
25
26 virtual bool start() = 0;
27 virtual void exec() = 0;
28 [[nodiscard]] bool isRunning() const;
29
30 [[nodiscard]] const QString &auditLogAsHtml() const
31 {
32 return m_auditLog;
33 }
34
35 [[nodiscard]] GpgME::Error auditLogError() const
36 {
37 return m_auditLogError;
38 }
39
40 void detach() override;
41
43 void update(MimeTreeParser::UpdateMode);
44
45protected Q_SLOTS:
46 void notify()
47 {
48 Q_EMIT update(MimeTreeParser::Force);
49 }
50
51protected:
52 void setAuditLog(const GpgME::Error &err, const QString &log);
53 void setRunning(bool running);
54
55private:
56 bool m_running = false;
57 QString m_auditLog;
58 GpgME::Error m_auditLogError;
59};
60}
Q_EMITQ_EMIT
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.