File indexing completed on 2025-02-02 05:08:37

0001 /*
0002     SPDX-FileCopyrightText: 2010 Tom Albers <toma@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 #include "libaccountwizard_export.h"
0009 #include <QObject>
0010 
0011 namespace MailTransport
0012 {
0013 class ServerTest;
0014 }
0015 
0016 class LIBACCOUNTWIZARD_EXPORT ServerTest : public QObject
0017 {
0018     Q_OBJECT
0019 public:
0020     explicit ServerTest(QObject *parent = nullptr);
0021     ~ServerTest() override;
0022 
0023 public Q_SLOTS:
0024     /* @p protocol being 'imap' 'smtp' or 'pop3' */
0025     Q_SCRIPTABLE void test(const QString &server, const QString &protocol);
0026 
0027 Q_SIGNALS:
0028     /* returns the advised setting, @p result begin 'ssl' 'tls' or 'none'. */
0029     void testResult(const QString &result);
0030 
0031     /* returns if no connection is possible, test failed. */
0032     void testFail();
0033 
0034 private:
0035     void testFinished(const QList<int> &list);
0036     MailTransport::ServerTest *const m_serverTest;
0037 };