File indexing completed on 2024-12-15 04:55:35

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "../../sieveeditorutil.h"
0010 #include "libsieveeditor_private_export.h"
0011 #include <QObject>
0012 class AbstractImapSettingsPassword;
0013 class LIBSIEVEEDITOR_TESTS_EXPORT AbstractImapSettingsCheckJob : public QObject
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit AbstractImapSettingsCheckJob(QObject *parent = nullptr);
0018     ~AbstractImapSettingsCheckJob() override;
0019     virtual void start() = 0;
0020 
0021     [[nodiscard]] virtual bool settingsCanBeImported() const = 0;
0022     [[nodiscard]] virtual QString name() const = 0;
0023 
0024     virtual void setImapSettingsPassword(AbstractImapSettingsPassword *passwordImporter);
0025 
0026 Q_SIGNALS:
0027     void importSetting(const QString &name, const SieveEditorUtil::SieveServerConfig &settings);
0028     void noSettingsImported(const QString &name);
0029 
0030 protected:
0031     Q_DISABLE_COPY(AbstractImapSettingsCheckJob)
0032     void checkNoSettingsImported();
0033     AbstractImapSettingsPassword *mPasswordImporter = nullptr;
0034     bool mSettingsWereImported = false;
0035 };