Mailcommon

mdnwarningjob.h
1 /*
2  SPDX-FileCopyrightText: 2022 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "mailcommon_export.h"
10 #include <Akonadi/Item>
11 #include <MailCommon/MailKernel>
12 #include <MessageComposer/MDNAdviceHelper>
13 #include <QObject>
14 
15 namespace MailCommon
16 {
17 class IKernel;
18 /**
19  * @brief The MDNWarningWidgetJob class
20  * @author Laurent Montel <[email protected]>
21  */
22 class MAILCOMMON_EXPORT MDNWarningJob : public QObject
23 {
24  Q_OBJECT
25 public:
26  enum ResponseMDN {
27  Unknown = 0,
28  MDNIgnore,
29  Denied,
30  Send,
31  };
32  explicit MDNWarningJob(IKernel *kernel, QObject *parent = nullptr);
33  ~MDNWarningJob() override;
34 
35  void start();
36 
37  Q_REQUIRED_RESULT const Akonadi::Item &item() const;
38  void setItem(const Akonadi::Item &newItem);
39 
40  Q_REQUIRED_RESULT bool canStart() const;
41 
42  Q_REQUIRED_RESULT ResponseMDN response() const;
43  void setResponse(ResponseMDN newResponse);
44 
45  Q_REQUIRED_RESULT KMime::MDN::SendingMode sendingMode() const;
46  void setSendingMode(KMime::MDN::SendingMode newSendingMode);
47 
48 Q_SIGNALS:
49  void finished();
50 
51 private:
52  Q_REQUIRED_RESULT QPair<bool, KMime::MDN::SendingMode> modifyItem(const KMime::Message::Ptr &msg);
53  Akonadi::Item mItem;
54  ResponseMDN mResponse = Unknown;
55  KMime::MDN::SendingMode mSendingMode = KMime::MDN::SendingMode::SentAutomatically;
56  IKernel *const mKernel = nullptr;
57 };
58 }
Q_SCRIPTABLE Q_NOREPLY void start()
The MDNWarningWidgetJob class.
Definition: mdnwarningjob.h:22
Generic interface for mail kernels.
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Sep 24 2022 03:58:15 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.