Warning, file /pim/mailcommon/src/mdn/mdnwarningjob.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002   SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "mailcommon_export.h"
0010 #include <Akonadi/Item>
0011 #include <MailCommon/MailKernel>
0012 #include <MessageComposer/MDNAdviceHelper>
0013 #include <QObject>
0014 
0015 namespace MailCommon
0016 {
0017 class IKernel;
0018 /**
0019  * @brief The MDNWarningWidgetJob class
0020  * @author Laurent Montel <montel@kde.org>
0021  */
0022 class MAILCOMMON_EXPORT MDNWarningJob : public QObject
0023 {
0024     Q_OBJECT
0025 public:
0026     enum ResponseMDN {
0027         Unknown = 0,
0028         MDNIgnore,
0029         Denied,
0030         Send,
0031     };
0032     explicit MDNWarningJob(IKernel *kernel, QObject *parent = nullptr);
0033     ~MDNWarningJob() override;
0034 
0035     void start();
0036 
0037     [[nodiscard]] const Akonadi::Item &item() const;
0038     void setItem(const Akonadi::Item &newItem);
0039 
0040     [[nodiscard]] bool canStart() const;
0041 
0042     [[nodiscard]] ResponseMDN response() const;
0043     void setResponse(ResponseMDN newResponse);
0044 
0045     [[nodiscard]] KMime::MDN::SendingMode sendingMode() const;
0046     void setSendingMode(KMime::MDN::SendingMode newSendingMode);
0047 
0048 Q_SIGNALS:
0049     void finished();
0050 
0051 private:
0052     [[nodiscard]] MAILCOMMON_NO_EXPORT QPair<bool, KMime::MDN::SendingMode> modifyItem(const KMime::Message::Ptr &msg);
0053     Akonadi::Item mItem;
0054     ResponseMDN mResponse = Unknown;
0055     KMime::MDN::SendingMode mSendingMode = KMime::MDN::SendingMode::SentAutomatically;
0056     IKernel *const mKernel = nullptr;
0057 };
0058 }