Messagelib

emailaddressresolvejob.h
1/*
2 * This file is part of KMail.
3 *
4 * SPDX-FileCopyrightText: 2010 KDAB
5 * SPDX-FileContributor: Tobias Koenig <tokoe@kde.org>
6 * SPDX-FileContributor: Leo Franchi <lfranchi@kde.org>
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11#pragma once
12
13#include "messagecomposer_export.h"
14
15#include <KJob>
16
17#include <QStringList>
18
19namespace MessageComposer
20{
21
22class EmailAddressResolveJobPrivate;
23/**
24 * @short A job to resolve nicknames, distribution lists and email addresses for queued emails.
25 */
26class MESSAGECOMPOSER_EXPORT EmailAddressResolveJob : public KJob
27{
29
30public:
31 /**
32 * Creates a new email address resolve job.
33 *
34 * @param parent The parent object.
35 */
36 explicit EmailAddressResolveJob(QObject *parent = nullptr);
37
38 /**
39 * Destroys the email address resolve job.
40 */
42
43 /**
44 * Starts the job.
45 */
46 void start() override;
47
48 /**
49 * Sets the from address to expand.
50 */
51 void setFrom(const QString &from);
52
53 /**
54 * Sets the from address to expand.
55 */
56 void setTo(const QStringList &from);
57
58 /**
59 * Sets the from address to expand.
60 */
61 void setCc(const QStringList &from);
62
63 /**
64 * Sets the from address to expand.
65 */
66 void setBcc(const QStringList &from);
67 /**
68 * Sets the Reply-To address to expand.
69 */
70 void setReplyTo(const QStringList &replyTo);
71
72 /**
73 * Returns the expanded From field
74 */
75 [[nodiscard]] QString expandedFrom() const;
76
77 /**
78 * Returns the expanded To field
79 */
80 [[nodiscard]] QStringList expandedTo() const;
81
82 /**
83 * Returns the expanded CC field
84 */
85 [[nodiscard]] QStringList expandedCc() const;
86
87 /**
88 * Returns the expanded Bcc field
89 */
90 [[nodiscard]] QStringList expandedBcc() const;
91
92 void setDefaultDomainName(const QString &domainName);
93 /**
94 * Returns the expanded Reply-To field
95 */
96 [[nodiscard]] QStringList expandedReplyTo() const;
97
98private:
99 MESSAGECOMPOSER_NO_EXPORT void slotAliasExpansionDone(KJob *);
100 std::unique_ptr<EmailAddressResolveJobPrivate> const d;
101};
102}
KJob(QObject *parent=nullptr)
QStringList expandedReplyTo() const
Returns the expanded Reply-To field.
QString expandedFrom() const
Returns the expanded From field.
QStringList expandedCc() const
Returns the expanded CC field.
void setFrom(const QString &from)
Sets the from address to expand.
void setBcc(const QStringList &from)
Sets the from address to expand.
EmailAddressResolveJob(QObject *parent=nullptr)
Creates a new email address resolve job.
QStringList expandedBcc() const
Returns the expanded Bcc field.
void setCc(const QStringList &from)
Sets the from address to expand.
~EmailAddressResolveJob() override
Destroys the email address resolve job.
void setTo(const QStringList &from)
Sets the from address to expand.
QStringList expandedTo() const
Returns the expanded To field.
void setReplyTo(const QStringList &replyTo)
Sets the Reply-To address to expand.
Q_SCRIPTABLE Q_NOREPLY void start()
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 31 2025 12:05:40 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.