Messagelib

cryptobodypartmemento.h
1 /*
2  SPDX-FileCopyrightText: 2014-2021 Laurent Montel <[email protected]>
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 
17 namespace MimeTreeParser
18 {
19 class CryptoBodyPartMemento : public QObject, public Interface::BodyPartMemento
20 {
21  Q_OBJECT
22 public:
23  CryptoBodyPartMemento();
24  ~CryptoBodyPartMemento() override;
25 
26  virtual bool start() = 0;
27  virtual void exec() = 0;
28  Q_REQUIRED_RESULT bool isRunning() const;
29 
30  const QString &auditLogAsHtml() const
31  {
32  return m_auditLog;
33  }
34 
35  Q_REQUIRED_RESULT GpgME::Error auditLogError() const
36  {
37  return m_auditLogError;
38  }
39 
40  void detach() override;
41 
42 Q_SIGNALS:
43  void update(MimeTreeParser::UpdateMode);
44 
45 protected Q_SLOTS:
46  void notify()
47  {
48  Q_EMIT update(MimeTreeParser::Force);
49  }
50 
51 protected:
52  void setAuditLog(const GpgME::Error &err, const QString &log);
53  void setRunning(bool running);
54 
55 private:
56  bool m_running = false;
57  QString m_auditLog;
58  GpgME::Error m_auditLogError;
59 };
60 }
Q_SIGNALSQ_SIGNALS
Q_OBJECTQ_OBJECT
void update(Part *part, const QByteArray &data, qint64 dataSize)
Q_SLOTSQ_SLOTS
Q_EMITQ_EMIT
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.