File indexing completed on 2024-06-23 05:18:35

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "plugineditorcheckbeforesendparams.h"
0008 
0009 using namespace MessageComposer;
0010 
0011 class MessageComposer::PluginEditorCheckBeforeSendParamsPrivate
0012 {
0013 public:
0014     PluginEditorCheckBeforeSendParamsPrivate() = default;
0015 
0016     QString ccAddresses;
0017     QString bccAddresses;
0018     QString toAddresses;
0019     QString plainText;
0020     QString subject;
0021     QString defaultDomain;
0022     int transportId = -1;
0023     bool isHtml = false;
0024     uint identity = 0;
0025     bool hasAttachment = false;
0026 };
0027 
0028 PluginEditorCheckBeforeSendParams::PluginEditorCheckBeforeSendParams()
0029     : d(new MessageComposer::PluginEditorCheckBeforeSendParamsPrivate)
0030 {
0031 }
0032 
0033 PluginEditorCheckBeforeSendParams::PluginEditorCheckBeforeSendParams(const PluginEditorCheckBeforeSendParams &other)
0034     : d(new MessageComposer::PluginEditorCheckBeforeSendParamsPrivate)
0035 {
0036     (*this) = other;
0037 }
0038 
0039 PluginEditorCheckBeforeSendParams::~PluginEditorCheckBeforeSendParams() = default;
0040 
0041 PluginEditorCheckBeforeSendParams &PluginEditorCheckBeforeSendParams::operator=(const PluginEditorCheckBeforeSendParams &other)
0042 {
0043     if (this != &other) {
0044         d->subject = other.subject();
0045         d->identity = other.identity();
0046         d->isHtml = other.isHtmlMail();
0047         d->plainText = other.plainText();
0048         d->defaultDomain = other.defaultDomain();
0049         d->hasAttachment = other.hasAttachment();
0050         d->transportId = other.transportId();
0051         d->bccAddresses = other.bccAddresses();
0052         d->ccAddresses = other.ccAddresses();
0053         d->toAddresses = other.toAddresses();
0054     }
0055     return *this;
0056 }
0057 
0058 bool PluginEditorCheckBeforeSendParams::operator==(const PluginEditorCheckBeforeSendParams &other) const
0059 {
0060     return (d->subject == other.subject()) && (d->identity == other.identity()) && (d->isHtml == other.isHtmlMail()) && (d->plainText == other.plainText())
0061         && (d->defaultDomain == other.defaultDomain()) && (d->hasAttachment == other.hasAttachment()) && (d->transportId == other.transportId())
0062         && (d->bccAddresses == other.bccAddresses()) && (d->ccAddresses == other.ccAddresses()) && (d->toAddresses == other.toAddresses());
0063 }
0064 
0065 void PluginEditorCheckBeforeSendParams::setSubject(const QString &subject)
0066 {
0067     d->subject = subject;
0068 }
0069 
0070 QString PluginEditorCheckBeforeSendParams::subject() const
0071 {
0072     return d->subject;
0073 }
0074 
0075 void PluginEditorCheckBeforeSendParams::setIdentity(uint currentIdentity)
0076 {
0077     d->identity = currentIdentity;
0078 }
0079 
0080 uint PluginEditorCheckBeforeSendParams::identity() const
0081 {
0082     return d->identity;
0083 }
0084 
0085 bool PluginEditorCheckBeforeSendParams::isHtmlMail() const
0086 {
0087     return d->isHtml;
0088 }
0089 
0090 void PluginEditorCheckBeforeSendParams::setHtmlMail(bool html)
0091 {
0092     d->isHtml = html;
0093 }
0094 
0095 void PluginEditorCheckBeforeSendParams::setPlainText(const QString &text)
0096 {
0097     d->plainText = text;
0098 }
0099 
0100 QString PluginEditorCheckBeforeSendParams::plainText() const
0101 {
0102     return d->plainText;
0103 }
0104 
0105 void PluginEditorCheckBeforeSendParams::setBccAddresses(const QString &lst)
0106 {
0107     d->bccAddresses = lst;
0108 }
0109 
0110 QString PluginEditorCheckBeforeSendParams::bccAddresses() const
0111 {
0112     return d->bccAddresses;
0113 }
0114 
0115 void PluginEditorCheckBeforeSendParams::setToAddresses(const QString &lst)
0116 {
0117     d->toAddresses = lst;
0118 }
0119 
0120 QString PluginEditorCheckBeforeSendParams::toAddresses() const
0121 {
0122     return d->toAddresses;
0123 }
0124 
0125 void PluginEditorCheckBeforeSendParams::setCcAddresses(const QString &lst)
0126 {
0127     d->ccAddresses = lst;
0128 }
0129 
0130 QString PluginEditorCheckBeforeSendParams::ccAddresses() const
0131 {
0132     return d->ccAddresses;
0133 }
0134 
0135 void PluginEditorCheckBeforeSendParams::setDefaultDomain(const QString &domain)
0136 {
0137     d->defaultDomain = domain;
0138 }
0139 
0140 QString PluginEditorCheckBeforeSendParams::defaultDomain() const
0141 {
0142     return d->defaultDomain;
0143 }
0144 
0145 bool PluginEditorCheckBeforeSendParams::hasAttachment() const
0146 {
0147     return d->hasAttachment;
0148 }
0149 
0150 void PluginEditorCheckBeforeSendParams::setHasAttachment(bool b)
0151 {
0152     d->hasAttachment = b;
0153 }
0154 
0155 int PluginEditorCheckBeforeSendParams::transportId() const
0156 {
0157     return d->transportId;
0158 }
0159 
0160 void PluginEditorCheckBeforeSendParams::setTransportId(int id)
0161 {
0162     d->transportId = id;
0163 }