Messagelib

infopart.cpp
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "infopart.h"
8 
9 using namespace MessageComposer;
10 
11 class InfoPart::InfoPartPrivate
12 {
13 public:
14  InfoPartPrivate() = default;
15 
16  KMime::Headers::Base::List extraHeaders;
22  QString from;
23  QString fcc;
26  QString references;
27  int transportId = 0;
28  bool urgent = false;
29 };
30 
31 InfoPart::InfoPart(QObject *parent)
32  : MessagePart(parent)
33  , d(new InfoPartPrivate)
34 {
35 }
36 
37 InfoPart::~InfoPart() = default;
38 
39 QString InfoPart::from() const
40 {
41  return d->from;
42 }
43 
44 void 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 
58 void 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 
72 void 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 
86 void 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 
100 void 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 
114 void InfoPart::setReplyTo(const QStringList &replyTo)
115 {
116  if (d->replyTo == replyTo) {
117  return;
118  }
119  d->replyTo = replyTo;
120  Q_EMIT replyToChanged();
121 }
122 
123 int InfoPart::transportId() const
124 {
125  return d->transportId;
126 }
127 
128 void InfoPart::setTransportId(int tid)
129 {
130  d->transportId = tid;
131 }
132 
133 void InfoPart::setFcc(const QString &fcc)
134 {
135  if (d->fcc == fcc) {
136  return;
137  }
138  d->fcc = fcc;
139  Q_EMIT fccChanged();
140 }
141 
142 QString InfoPart::fcc() const
143 {
144  return d->fcc;
145 }
146 
147 bool InfoPart::urgent() const
148 {
149  return d->urgent;
150 }
151 
152 void 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 
166 void InfoPart::setInReplyTo(const QString &inReplyTo)
167 {
168  if (d->inReplyTo == inReplyTo) {
169  return;
170  }
171  d->inReplyTo = inReplyTo;
172  Q_EMIT inReplyToChanged();
173 }
174 
175 QString InfoPart::references() const
176 {
177  return d->references;
178 }
179 
180 void InfoPart::setReferences(const QString &references)
181 {
182  d->references = references;
183 }
184 
185 void InfoPart::setExtraHeaders(const KMime::Headers::Base::List &headers)
186 {
187  d->extraHeaders = headers;
188 }
189 
190 KMime::Headers::Base::List InfoPart::extraHeaders() const
191 {
192  return d->extraHeaders;
193 }
194 
196 {
197  return d->userAgent;
198 }
199 
200 void InfoPart::setUserAgent(const QString &userAgent)
201 {
202  if (d->userAgent == userAgent) {
203  return;
204  }
205  d->userAgent = userAgent;
206  Q_EMIT userAgentChanged();
207 }
QString inReplyTo
In-Reply-To: Id of the message this message is a reply to.
Definition: infopart.h:54
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
QString fcc
The name of a file, to which a copy of the sent message should be appended.
Definition: infopart.h:45
QStringList to
The email address and optionally the name of the primary recipients.
Definition: infopart.h:29
Q_EMITQ_EMIT
QString subject
Subject of the message.
Definition: infopart.h:42
bool urgent
Set urgency of the message.
Definition: infopart.h:51
QString userAgent
User agent of the sender.
Definition: infopart.h:48
QStringList cc
Carbon copy: The email address and optionally the name of the secondary recipients.
Definition: infopart.h:32
QStringList replyTo
Reply-To: Email address that should be used to reply to this mail.
Definition: infopart.h:39
QString from
The email address and optionally the name of the author of the mail.
Definition: infopart.h:26
QStringList bcc
Blind Carbon copy: The email address and optionally the name of the secondary recipients.
Definition: infopart.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat May 21 2022 03:53:36 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.