Messagelib

cryptobodypartmemento.h
1 /*
2  SPDX-FileCopyrightText: 2014-2023 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  Q_REQUIRED_RESULT 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_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
Q_EMITQ_EMIT
Q_SCRIPTABLE Q_NOREPLY void start()
Q_SIGNALSQ_SIGNALS
void update(Part *part, const QByteArray &data, qint64 dataSize)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 04:08:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.