File indexing completed on 2025-03-09 04:54:29

0001 /*
0002    SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "messageviewer_export.h"
0010 #include <QObject>
0011 class QDnsLookup;
0012 namespace MessageViewer
0013 {
0014 /**
0015  * @brief The DKIMDownloadKeyJob class
0016  * @author Laurent Montel <montel@kde.org>
0017  */
0018 class MESSAGEVIEWER_EXPORT DKIMDownloadKeyJob : public QObject
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit DKIMDownloadKeyJob(QObject *parent = nullptr);
0023     ~DKIMDownloadKeyJob() override;
0024 
0025     [[nodiscard]] bool start();
0026 
0027     [[nodiscard]] bool canStart() const;
0028 
0029     [[nodiscard]] QString domainName() const;
0030     void setDomainName(const QString &domainName);
0031 
0032     [[nodiscard]] QString selectorName() const;
0033     void setSelectorName(const QString &selectorName);
0034 
0035     [[nodiscard]] QString resolvDnsValue() const;
0036 
0037     QDnsLookup *dnsLookup() const;
0038 
0039 Q_SIGNALS:
0040     void error(const QString &error);
0041     void success(const QList<QByteArray> &, const QString &domain, const QString &selector);
0042 
0043 private:
0044     MESSAGEVIEWER_NO_EXPORT void resolvDnsDone();
0045     QString mDomainName;
0046     QString mSelectorName;
0047     QDnsLookup *mDnsLookup = nullptr;
0048 };
0049 }