Messagelib

plugineditorcheckbeforesendparams.cpp
1 /*
2  SPDX-FileCopyrightText: 2016-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "plugineditorcheckbeforesendparams.h"
8 
9 using namespace MessageComposer;
10 
11 class MessageComposer::PluginEditorCheckBeforeSendParamsPrivate
12 {
13 public:
14  PluginEditorCheckBeforeSendParamsPrivate() = default;
15 
16  QString ccAddresses;
17  QString bccAddresses;
18  QString toAddresses;
19  QString plainText;
20  QString subject;
21  QString defaultDomain;
22  int transportId = -1;
23  bool isHtml = false;
24  uint identity = 0;
25  bool hasAttachment = false;
26 };
27 
28 PluginEditorCheckBeforeSendParams::PluginEditorCheckBeforeSendParams()
29  : d(new MessageComposer::PluginEditorCheckBeforeSendParamsPrivate)
30 {
31 }
32 
33 PluginEditorCheckBeforeSendParams::PluginEditorCheckBeforeSendParams(const PluginEditorCheckBeforeSendParams &other)
34  : d(new MessageComposer::PluginEditorCheckBeforeSendParamsPrivate)
35 {
36  (*this) = other;
37 }
38 
39 PluginEditorCheckBeforeSendParams::~PluginEditorCheckBeforeSendParams() = default;
40 
41 PluginEditorCheckBeforeSendParams &PluginEditorCheckBeforeSendParams::operator=(const PluginEditorCheckBeforeSendParams &other)
42 {
43  if (this != &other) {
44  d->subject = other.subject();
45  d->identity = other.identity();
46  d->isHtml = other.isHtmlMail();
47  d->plainText = other.plainText();
48  d->defaultDomain = other.defaultDomain();
49  d->hasAttachment = other.hasAttachment();
50  d->transportId = other.transportId();
51  d->bccAddresses = other.bccAddresses();
52  d->ccAddresses = other.ccAddresses();
53  d->toAddresses = other.toAddresses();
54  }
55  return *this;
56 }
57 
58 bool PluginEditorCheckBeforeSendParams::operator==(const PluginEditorCheckBeforeSendParams &other) const
59 {
60  return (d->subject == other.subject()) && (d->identity == other.identity()) && (d->isHtml == other.isHtmlMail()) && (d->plainText == other.plainText())
61  && (d->defaultDomain == other.defaultDomain()) && (d->hasAttachment == other.hasAttachment()) && (d->transportId == other.transportId())
62  && (d->bccAddresses == other.bccAddresses()) && (d->ccAddresses == other.ccAddresses()) && (d->toAddresses == other.toAddresses());
63 }
64 
65 void PluginEditorCheckBeforeSendParams::setSubject(const QString &subject)
66 {
67  d->subject = subject;
68 }
69 
70 QString PluginEditorCheckBeforeSendParams::subject() const
71 {
72  return d->subject;
73 }
74 
75 void PluginEditorCheckBeforeSendParams::setIdentity(uint currentIdentity)
76 {
77  d->identity = currentIdentity;
78 }
79 
80 uint PluginEditorCheckBeforeSendParams::identity() const
81 {
82  return d->identity;
83 }
84 
85 bool PluginEditorCheckBeforeSendParams::isHtmlMail() const
86 {
87  return d->isHtml;
88 }
89 
90 void PluginEditorCheckBeforeSendParams::setHtmlMail(bool html)
91 {
92  d->isHtml = html;
93 }
94 
95 void PluginEditorCheckBeforeSendParams::setPlainText(const QString &text)
96 {
97  d->plainText = text;
98 }
99 
100 QString PluginEditorCheckBeforeSendParams::plainText() const
101 {
102  return d->plainText;
103 }
104 
105 void PluginEditorCheckBeforeSendParams::setBccAddresses(const QString &lst)
106 {
107  d->bccAddresses = lst;
108 }
109 
110 QString PluginEditorCheckBeforeSendParams::bccAddresses() const
111 {
112  return d->bccAddresses;
113 }
114 
115 void PluginEditorCheckBeforeSendParams::setToAddresses(const QString &lst)
116 {
117  d->toAddresses = lst;
118 }
119 
120 QString PluginEditorCheckBeforeSendParams::toAddresses() const
121 {
122  return d->toAddresses;
123 }
124 
125 void PluginEditorCheckBeforeSendParams::setCcAddresses(const QString &lst)
126 {
127  d->ccAddresses = lst;
128 }
129 
130 QString PluginEditorCheckBeforeSendParams::ccAddresses() const
131 {
132  return d->ccAddresses;
133 }
134 
135 void PluginEditorCheckBeforeSendParams::setDefaultDomain(const QString &domain)
136 {
137  d->defaultDomain = domain;
138 }
139 
140 QString PluginEditorCheckBeforeSendParams::defaultDomain() const
141 {
142  return d->defaultDomain;
143 }
144 
145 bool PluginEditorCheckBeforeSendParams::hasAttachment() const
146 {
147  return d->hasAttachment;
148 }
149 
150 void PluginEditorCheckBeforeSendParams::setHasAttachment(bool b)
151 {
152  d->hasAttachment = b;
153 }
154 
155 int PluginEditorCheckBeforeSendParams::transportId() const
156 {
157  return d->transportId;
158 }
159 
160 void PluginEditorCheckBeforeSendParams::setTransportId(int id)
161 {
162  d->transportId = id;
163 }
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-2021 The KDE developers.
Generated on Sun Nov 28 2021 23:05:44 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.