Akonadi Mime

mdnstateattribute.h
1/******************************************************************************
2 *
3 * SPDX-FileCopyrightText: 2010 Leo Franchi <lfranchi@kde.org>
4 * SPDX-FileCopyrightText: 2010 KDAB
5 *
6 * SPDX-License-Identifier: LGPL-2.0-or-later
7 *
8 *****************************************************************************/
9
10#pragma once
11#include "akonadi-mime_export.h"
12
13#include <Akonadi/Attribute>
14#include <memory>
15
16namespace Akonadi
17{
18/**
19 * @short An Attribute that keeps track of the MDN state of a mail message.
20 *
21 * Once a mail that contains a Message Disposition Notification is processed,
22 * the outcome of the user action will be stored in this attribute.
23 *
24 * @author Leo Franchi <lfranchi@kde.org>
25 * @see Akonadi::Attribute
26 * @since 4.6
27 */
28class AKONADI_MIME_EXPORT MDNStateAttribute : public Akonadi::Attribute
29{
30public:
31 /**
32 * Describes the "MDN sent" state.
33 */
35 MDNStateUnknown, ///< The state is unknown.
36 MDNNone, ///< No MDN has been set.
37 MDNIgnore, ///< Ignore sending a MDN.
38 MDNDisplayed, ///< The message has been displayed by the UA to someone reading the recipient's mailbox.
39 MDNDeleted, ///< The message has been deleted.
40 MDNDispatched, ///< The message has been sent somewhere in some manner without necessarily having been previously displayed to the user.
41 MDNProcessed, ///< The message has been processed in some manner without being displayed to the user.
42 MDNDenied, ///< The recipient does not wish the sender to be informed of the message's disposition.
43 MDNFailed ///< A failure occurred that prevented the proper generation of an MDN.
44 };
45
46 /**
47 * Creates a new MDN state attribute.
48 *
49 * @param state The state the attribute will have.
50 */
51 explicit MDNStateAttribute(MDNSentState state = MDNStateUnknown);
52
53 /**
54 * Creates a new MDN state attribute.
55 *
56 * @param state The string representation of the state the attribute will have.
57 */
58 explicit MDNStateAttribute(const QByteArray &state);
59
60 /**
61 * Destroys the MDN state attribute.
62 */
64
65 /**
66 * Reimplemented from Attribute
67 */
68 [[nodiscard]] QByteArray type() const override;
69
70 /**
71 * Reimplemented from Attribute
72 */
73 MDNStateAttribute *clone() const override;
74
75 /**
76 * Reimplemented from Attribute
77 */
78 [[nodiscard]] QByteArray serialized() const override;
79
80 /**
81 * Reimplemented from Attribute
82 */
83 void deserialize(const QByteArray &data) override;
84
85 /**
86 * Sets the MDN @p state.
87 */
88 void setMDNState(MDNSentState state);
89
90 /**
91 * Returns the MDN state.
92 */
93 [[nodiscard]] MDNStateAttribute::MDNSentState mdnState() const;
94
95 [[nodiscard]] bool operator==(const MDNStateAttribute &other) const;
96
97private:
98 //@cond PRIVATE
99 class MDNStateAttributePrivate;
100 std::unique_ptr<MDNStateAttributePrivate> const d;
101 //@endcond
102};
103}
An Attribute that keeps track of the MDN state of a mail message.
MDNSentState
Describes the "MDN sent" state.
@ MDNDeleted
The message has been deleted.
@ MDNStateUnknown
The state is unknown.
@ MDNDenied
The recipient does not wish the sender to be informed of the message's disposition.
@ MDNIgnore
Ignore sending a MDN.
@ MDNDispatched
The message has been sent somewhere in some manner without necessarily having been previously display...
@ MDNNone
No MDN has been set.
@ MDNProcessed
The message has been processed in some manner without being displayed to the user.
@ MDNDisplayed
The message has been displayed by the UA to someone reading the recipient's mailbox.
~MDNStateAttribute() override
Destroys the MDN state attribute.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:18:09 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.