Messagelib

infopart.cpp
1/*
2 SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "infopart.h"
8
9using namespace MessageComposer;
10
11class InfoPart::InfoPartPrivate
12{
13public:
14 InfoPartPrivate() = default;
15
16 KMime::Headers::Base::List extraHeaders;
17 QStringList to;
18 QStringList cc;
19 QStringList bcc;
20 QStringList replyTo;
21 QString subject;
22 QString from;
23 QString fcc;
24 QString userAgent;
25 QString inReplyTo;
26 QString references;
27 int transportId = 0;
28 bool urgent = false;
29};
30
31InfoPart::InfoPart(QObject *parent)
32 : MessagePart(parent)
33 , d(new InfoPartPrivate)
34{
35}
36
37InfoPart::~InfoPart() = default;
38
40{
41 return d->from;
42}
43
44void InfoPart::setFrom(const QString &from)
45{
46 if (d->from == from) {
47 return;
48 }
49 d->from = from;
50 Q_EMIT fromChanged();
51}
52
54{
55 return d->to;
56}
57
58void InfoPart::setTo(const QStringList &to)
59{
60 if (d->to == to) {
61 return;
62 }
63 d->to = to;
64 Q_EMIT toChanged();
65}
66
68{
69 return d->cc;
70}
71
72void InfoPart::setCc(const QStringList &cc)
73{
74 if (d->cc == cc) {
75 return;
76 }
77 d->cc = cc;
78 Q_EMIT ccChanged();
79}
80
82{
83 return d->bcc;
84}
85
86void InfoPart::setBcc(const QStringList &bcc)
87{
88 if (d->bcc == bcc) {
89 return;
90 }
91 d->bcc = bcc;
92 Q_EMIT bccChanged();
93}
94
96{
97 return d->subject;
98}
99
100void InfoPart::setSubject(const QString &subject)
101{
102 if (d->subject == subject) {
103 return;
104 }
105 d->subject = subject;
106 Q_EMIT subjectChanged();
107}
108
110{
111 return d->replyTo;
112}
113
114void InfoPart::setReplyTo(const QStringList &replyTo)
115{
116 if (d->replyTo == replyTo) {
117 return;
118 }
119 d->replyTo = replyTo;
120 Q_EMIT replyToChanged();
121}
122
123int InfoPart::transportId() const
124{
125 return d->transportId;
126}
127
128void InfoPart::setTransportId(int tid)
129{
130 d->transportId = tid;
131}
132
133void InfoPart::setFcc(const QString &fcc)
134{
135 if (d->fcc == fcc) {
136 return;
137 }
138 d->fcc = fcc;
139 Q_EMIT fccChanged();
140}
141
143{
144 return d->fcc;
145}
146
147bool InfoPart::urgent() const
148{
149 return d->urgent;
150}
151
152void InfoPart::setUrgent(bool urgent)
153{
154 if (d->urgent == urgent) {
155 return;
156 }
157 d->urgent = urgent;
158 Q_EMIT urgentChanged();
159}
160
162{
163 return d->inReplyTo;
164}
165
166void InfoPart::setInReplyTo(const QString &inReplyTo)
167{
168 if (d->inReplyTo == inReplyTo) {
169 return;
170 }
171 d->inReplyTo = inReplyTo;
172 Q_EMIT inReplyToChanged();
173}
174
175QString InfoPart::references() const
176{
177 return d->references;
178}
179
180void InfoPart::setReferences(const QString &references)
181{
182 d->references = references;
183}
184
185void InfoPart::setExtraHeaders(const KMime::Headers::Base::List &headers)
186{
187 d->extraHeaders = headers;
188}
189
190KMime::Headers::Base::List InfoPart::extraHeaders() const
191{
192 return d->extraHeaders;
193}
194
196{
197 return d->userAgent;
198}
199
200void InfoPart::setUserAgent(const QString &userAgent)
201{
202 if (d->userAgent == userAgent) {
203 return;
204 }
205 d->userAgent = userAgent;
206 Q_EMIT userAgentChanged();
207}
208
209#include "moc_infopart.cpp"
QStringList replyTo
Reply-To: Email address that should be used to reply to this mail.
Definition infopart.h:39
QStringList cc
Carbon copy: The email address and optionally the name of the secondary recipients.
Definition infopart.h:32
QString inReplyTo
In-Reply-To: Id of the message this message is a reply to.
Definition infopart.h:54
QString from
The email address and optionally the name of the author of the mail.
Definition infopart.h:26
QStringList to
The email address and optionally the name of the primary recipients.
Definition infopart.h:29
QString subject
Subject of the message.
Definition infopart.h:42
QString fcc
The name of a file, to which a copy of the sent message should be appended.
Definition infopart.h:45
bool urgent
Set urgency of the message.
Definition infopart.h:51
QStringList bcc
Blind Carbon copy: The email address and optionally the name of the secondary recipients.
Definition infopart.h:36
QString userAgent
User agent of the sender.
Definition infopart.h:48
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
Q_EMITQ_EMIT
T qobject_cast(QObject *object)
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.