Messagelib

infopart.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 "messagepart.h"
10
11#include <QStringList>
12
13#include <KMime/Headers>
14#include <KMime/KMimeMessage>
15#include <memory>
16namespace MessageComposer
17{
18/**
19 * @brief The InfoPart class contains the message header.
20 */
21class MESSAGECOMPOSER_EXPORT InfoPart : public MessageComposer::MessagePart
22{
23 Q_OBJECT
24
25 /// The email address and optionally the name of the author of the mail.
26 Q_PROPERTY(QString from READ from WRITE setFrom NOTIFY fromChanged)
27
28 /// The email address and optionally the name of the primary recipients.
29 Q_PROPERTY(QStringList to READ to WRITE setTo NOTIFY toChanged)
30
31 /// Carbon copy: The email address and optionally the name of the secondary recipients.
32 Q_PROPERTY(QStringList cc READ cc WRITE setCc NOTIFY ccChanged)
33
34 /// Blind Carbon copy: The email address and optionally the name of the secondary recipients.
35 /// Only specified during SMTP delivery but not in the final mail delivery.
36 Q_PROPERTY(QStringList bcc READ bcc WRITE setBcc NOTIFY bccChanged)
37
38 /// Reply-To: Email address that should be used to reply to this mail.
39 Q_PROPERTY(QStringList replyTo READ replyTo WRITE setReplyTo NOTIFY replyToChanged)
40
41 /// Subject of the message.
42 Q_PROPERTY(QString subject READ subject WRITE setSubject NOTIFY subjectChanged)
43
44 /// The name of a file, to which a copy of the sent message should be appended.
45 Q_PROPERTY(QString fcc READ fcc WRITE setFcc NOTIFY fccChanged)
46
47 /// User agent of the sender.
48 Q_PROPERTY(QString userAgent READ userAgent WRITE setUserAgent NOTIFY userAgentChanged)
49
50 /// Set urgency of the message.
51 Q_PROPERTY(bool urgent READ urgent WRITE setUrgent NOTIFY urgentChanged)
52
53 /// In-Reply-To: Id of the message this message is a reply to.
54 Q_PROPERTY(QString inReplyTo READ inReplyTo WRITE setInReplyTo NOTIFY inReplyToChanged)
55
56public:
57 explicit InfoPart(QObject *parent = nullptr);
58 ~InfoPart() override;
59
60 [[nodiscard]] QString from() const;
61 void setFrom(const QString &from);
62 [[nodiscard]] QStringList to() const;
63 void setTo(const QStringList &to);
64 [[nodiscard]] QStringList cc() const;
65 void setCc(const QStringList &cc);
66 [[nodiscard]] QStringList bcc() const;
67 void setBcc(const QStringList &bcc);
68
69 [[nodiscard]] QStringList replyTo() const;
70 void setReplyTo(const QStringList &replyTo);
71
72 [[nodiscard]] QString subject() const;
73 void setSubject(const QString &subject);
74
75 [[nodiscard]] QString fcc() const;
76 void setFcc(const QString &fcc);
77
78 [[nodiscard]] QString userAgent() const;
79 void setUserAgent(const QString &userAgent);
80
81 [[nodiscard]] bool urgent() const;
82 void setUrgent(bool);
83
84 [[nodiscard]] QString inReplyTo() const;
85 void setInReplyTo(const QString &inReplyTo);
86
87 [[nodiscard]] QString references() const;
88 void setReferences(const QString &references);
89
90 void setExtraHeaders(const KMime::Headers::Base::List &headers);
91 [[nodiscard]] KMime::Headers::Base::List extraHeaders() const;
92
93 [[nodiscard]] int transportId() const;
94 void setTransportId(int tid);
95
96Q_SIGNALS:
97 void toChanged();
98 void fromChanged();
99 void ccChanged();
100 void bccChanged();
101 void replyToChanged();
102 void subjectChanged();
103 void urgentChanged();
104 void userAgentChanged();
105 void inReplyToChanged();
106 void fccChanged();
107
108private:
109 class InfoPartPrivate;
110 std::unique_ptr<InfoPartPrivate> const d;
111};
112} // namespace MessageComposer
The InfoPart class contains the message header.
Definition infopart.h:22
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 Tue Mar 26 2024 11:12:43 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.