11#include <KLocalizedString>
16class MessageComposer::RecipientPrivate
19 RecipientPrivate(
const QString &email, Recipient::Type type)
25 Kleo::Action mEncryptionAction = Kleo::Impossible;
26 MessageComposer::Recipient::Type mType;
32Recipient::Recipient(
const QString &email, Recipient::Type type)
37Recipient::~Recipient() =
default;
39void Recipient::setType(Type type)
44Recipient::Type Recipient::type()
const
49void Recipient::setEmail(
const QString &email)
59void Recipient::setName(
const QString &name)
69bool Recipient::isEmpty()
const
71 return d->mEmail.isEmpty();
74void Recipient::clear()
77 d->mType = Recipient::To;
80int Recipient::typeToId(Recipient::Type type)
82 return static_cast<int>(type);
85Recipient::Type Recipient::idToType(
int id)
87 return static_cast<Type
>(id);
90QString Recipient::typeLabel()
const
92 return typeLabel(d->mType);
95QString Recipient::typeLabel(Recipient::Type type)
99 return i18nc(
"@label:listbox Recipient of an email message.",
"To");
101 return i18nc(
"@label:listbox Carbon Copy recipient of an email message.",
"CC");
103 return i18nc(
"@label:listbox Blind carbon copy recipient of an email message.",
"BCC");
105 return i18nc(
"@label:listbox Reply-To recipient of an email message.",
"Reply-To");
110 return xi18nc(
"@label:listbox",
"<placeholder>Undefined Recipient Type</placeholder>");
116 types.
append(typeLabel(To));
117 types.
append(typeLabel(Cc));
118 types.
append(typeLabel(Bcc));
119 types.
append(typeLabel(ReplyTo));
123GpgME::Key Recipient::key()
const
128void Recipient::setKey(
const GpgME::Key &key)
133Kleo::Action MessageComposer::Recipient::encryptionAction()
const
135 return d->mEncryptionAction;
138void MessageComposer::Recipient::setEncryptionAction(
const Kleo::Action action)
140 d->mEncryptionAction = action;
QString xi18nc(const char *context, const char *text, const TYPE &arg...)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString name(StandardAction id)
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
void append(QList< T > &&value)