Akonadi Mime

addressattribute.h
1/*
2 SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "akonadi-mime_export.h"
10
11#include <QString>
12#include <QStringList>
13
14#include <Akonadi/Attribute>
15
16#include <memory>
17
18namespace Akonadi
19{
20class AddressAttributePrivate;
21
22/**
23 Attribute storing the From, To, Cc, Bcc addresses of a message.
24
25 @author Constantin Berzan <exit3219@gmail.com>
26 @since 4.4
27*/
28class AKONADI_MIME_EXPORT AddressAttribute : public Akonadi::Attribute
29{
30public:
31 /**
32 Creates a new AddressAttribute.
33 */
34 explicit AddressAttribute(const QString &from = QString(),
35 const QStringList &to = QStringList(),
36 const QStringList &cc = QStringList(),
37 const QStringList &bcc = QStringList(),
38 bool dsn = false);
39 /**
40 Destroys the AddressAttribute.
41 */
43
44 /* reimpl */
45 [[nodiscard]] AddressAttribute *clone() const override;
46 [[nodiscard]] QByteArray type() const override;
47 [[nodiscard]] QByteArray serialized() const override;
48 void deserialize(const QByteArray &data) override;
49
50 /**
51 Returns the address of the sender.
52 */
53 [[nodiscard]] QString from() const;
54
55 /**
56 Sets the address of the sender.
57 */
58 void setFrom(const QString &from);
59
60 /**
61 Returns the addresses of the "To:" receivers.
62 */
63 [[nodiscard]] QStringList to() const;
64
65 /**
66 * Sets the addresses of the "To: "receivers."
67 * @param to address of the receiver.
68 */
69 void setTo(const QStringList &to);
70
71 /**
72 Returns the addresses of the "Cc:" receivers.
73 */
74 [[nodiscard]] QStringList cc() const;
75
76 /**
77 * Sets the addresses of the "Cc:" receivers."
78 * @param cc addresses of the receivers (CC)
79 */
80 void setCc(const QStringList &cc);
81
82 /**
83 * Returns the addresses of the "Bcc:" receivers.
84 */
85 [[nodiscard]] QStringList bcc() const;
86
87 /**
88 * Sets the addresses of the "Bcc:" receivers."
89 * @param bcc addresses of the receivers (CC)
90 */
91 void setBcc(const QStringList &bcc);
92
93 void setDeliveryStatusNotification(bool b);
94 [[nodiscard]] bool deliveryStatusNotification() const;
95
96 bool operator==(const AddressAttribute &other) const;
97
98private:
99 std::unique_ptr<AddressAttributePrivate> const d;
100};
101} // namespace Akonadi
Attribute storing the From, To, Cc, Bcc addresses of a message.
~AddressAttribute() override
Destroys the AddressAttribute.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:32:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.