File indexing completed on 2024-12-22 05:01:11

0001 /*
0002  * This file is part of KMail.
0003  *
0004  * SPDX-FileCopyrightText: 2010 KDAB
0005  *
0006  * SPDX-FileContributor: Tobias Koenig <tokoe@kde.org>
0007  *
0008  * SPDX-License-Identifier: GPL-2.0-or-later
0009  */
0010 
0011 #pragma once
0012 
0013 #include <KJob>
0014 
0015 class AddressValidationJob : public KJob
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     explicit AddressValidationJob(const QString &emailAddresses, QWidget *parentWidget, QObject *parent = nullptr);
0021     ~AddressValidationJob() override;
0022 
0023     void start() override;
0024 
0025     [[nodiscard]] bool isValid() const;
0026 
0027     void setDefaultDomain(const QString &domainName);
0028 
0029 private:
0030     void slotAliasExpansionDone(KJob *);
0031     const QString mEmailAddresses;
0032     QString mDomainDefaultName;
0033     bool mIsValid = false;
0034     QWidget *const mParentWidget;
0035 };