Messagelib

mdnadvicehelper.h
1/*
2 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8#include "messagecomposer_export.h"
9#include <Akonadi/MDNStateAttribute>
10#include <MessageComposer/MessageFactoryNG>
11#include <QObject>
12
13namespace MessageComposer
14{
15class MESSAGECOMPOSER_EXPORT MDNAdviceHelper : public QObject
16{
17 Q_OBJECT
18public:
19 static MDNAdviceHelper *instance();
20
21 /**
22 * Checks the MDN headers to see if the user needs to be asked for any
23 * confirmations. Will ask the user if action is required.
24 *
25 * Returns whether to send an MDN or not, and the sending mode for the MDN
26 * to be created.
27 *
28 * Will also set the Akonadi::MDNStateAttribute on the given item
29 * to what the user has selected.
30 */
31 [[nodiscard]] QPair<bool, KMime::MDN::SendingMode> checkAndSetMDNInfo(const Akonadi::Item &item, KMime::MDN::DispositionType d, bool forceSend = false);
32
33 [[nodiscard]] static Akonadi::MDNStateAttribute::MDNSentState dispositionToSentState(KMime::MDN::DispositionType d);
34
35 [[nodiscard]] QPair<QString, bool> mdnMessageText(const char *what);
36
37private:
38 MESSAGECOMPOSER_NO_EXPORT explicit MDNAdviceHelper(QObject *parent = nullptr)
39 : QObject(parent)
40 {
41 }
42
43 ~MDNAdviceHelper() override = default;
44
45 [[nodiscard]] MESSAGECOMPOSER_NO_EXPORT int requestAdviceOnMDN(const char *what);
46 MESSAGECOMPOSER_NO_EXPORT MessageComposer::MDNAdvice questionIgnoreSend(const QString &text, bool canDeny);
47
48 static MDNAdviceHelper *s_instance;
49};
50}
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:37:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.