Mailcommon

mdnwarningjob.h
1/*
2 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
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
15namespace MailCommon
16{
17class IKernel;
18/**
19 * @brief The MDNWarningWidgetJob class
20 * @author Laurent Montel <montel@kde.org>
21 */
22class MAILCOMMON_EXPORT MDNWarningJob : public QObject
23{
24 Q_OBJECT
25public:
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 [[nodiscard]] const Akonadi::Item &item() const;
38 void setItem(const Akonadi::Item &newItem);
39
40 [[nodiscard]] bool canStart() const;
41
42 [[nodiscard]] ResponseMDN response() const;
43 void setResponse(ResponseMDN newResponse);
44
45 [[nodiscard]] KMime::MDN::SendingMode sendingMode() const;
46 void setSendingMode(KMime::MDN::SendingMode newSendingMode);
47
48Q_SIGNALS:
49 void finished();
50
51private:
52 [[nodiscard]] MAILCOMMON_NO_EXPORT 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}
Generic interface for mail kernels.
The MDNWarningWidgetJob class.
Q_SCRIPTABLE Q_NOREPLY void start()
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.