Messagelib

infopart.h
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
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>
16 namespace MessageComposer
17 {
18 /**
19  * @brief The InfoPart class contains the message header.
20  */
21 class 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 
56 public:
57  explicit InfoPart(QObject *parent = nullptr);
58  ~InfoPart() override;
59 
60  Q_REQUIRED_RESULT QString from() const;
61  void setFrom(const QString &from);
62  Q_REQUIRED_RESULT QStringList to() const;
63  void setTo(const QStringList &to);
64  Q_REQUIRED_RESULT QStringList cc() const;
65  void setCc(const QStringList &cc);
66  Q_REQUIRED_RESULT QStringList bcc() const;
67  void setBcc(const QStringList &bcc);
68 
69  Q_REQUIRED_RESULT QStringList replyTo() const;
70  void setReplyTo(const QStringList &replyTo);
71 
72  Q_REQUIRED_RESULT QString subject() const;
73  void setSubject(const QString &subject);
74 
75  Q_REQUIRED_RESULT QString fcc() const;
76  void setFcc(const QString &fcc);
77 
78  Q_REQUIRED_RESULT QString userAgent() const;
79  void setUserAgent(const QString &userAgent);
80 
81  Q_REQUIRED_RESULT bool urgent() const;
82  void setUrgent(bool);
83 
84  Q_REQUIRED_RESULT QString inReplyTo() const;
85  void setInReplyTo(const QString &inReplyTo);
86 
87  Q_REQUIRED_RESULT QString references() const;
88  void setReferences(const QString &references);
89 
90  void setExtraHeaders(const KMime::Headers::Base::List &headers);
91  Q_REQUIRED_RESULT KMime::Headers::Base::List extraHeaders() const;
92 
93  Q_REQUIRED_RESULT int transportId() const;
94  void setTransportId(int tid);
95 
96 Q_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 
108 private:
109  class InfoPartPrivate;
110  std::unique_ptr<InfoPartPrivate> const d;
111 };
112 } // namespace MessageComposer
113 
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
The InfoPart class contains the message header.
Definition: infopart.h:21
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.