File indexing completed on 2024-04-28 11:41:05

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2007 Thiago Macieira <thiago@kde.org>
0004     SPDX-FileCopyrightText: 2007 Andreas Hartmetz <ahartmetz@gmail.com>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #ifndef KSSLERRORUIDATA_H
0010 #define KSSLERRORUIDATA_H
0011 
0012 #include <kiocore_export.h>
0013 
0014 #include <memory>
0015 
0016 template<typename T>
0017 class QList;
0018 class KTcpSocket;
0019 class QNetworkReply;
0020 class QSslError;
0021 class QSslSocket;
0022 
0023 /**
0024  * This class can hold all the necessary data from a KTcpSocket to ask the user
0025  * to continue connecting in the face of SSL errors.
0026  * It can be used to carry the data for the UI over time or over thread boundaries.
0027  *
0028  * @see: KSslCertificateManager::askIgnoreSslErrors()
0029  */
0030 class KIOCORE_EXPORT KSslErrorUiData
0031 {
0032 public:
0033     /**
0034      * Default construct an instance with no useful data.
0035      */
0036     KSslErrorUiData();
0037 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 65)
0038     /**
0039      * Create an instance and initialize it with SSL error data from @p socket.
0040      * @deprecated since 5.65, use QSslSocket variant
0041      */
0042     KIOCORE_DEPRECATED_VERSION(5, 65, "Use QSslSocket variant")
0043     KSslErrorUiData(const KTcpSocket *socket);
0044 #endif
0045     /**
0046      * Create an instance and initialize it with SSL error data from @p socket.
0047      */
0048     KSslErrorUiData(const QSslSocket *socket);
0049     /**
0050      * Create an instance and initialize it with SSL error data from @p reply.
0051      * @since 5.62
0052      */
0053     KSslErrorUiData(const QNetworkReply *reply, const QList<QSslError> &sslErrors);
0054 
0055     KSslErrorUiData(const KSslErrorUiData &other);
0056     KSslErrorUiData &operator=(const KSslErrorUiData &);
0057     /**
0058      * Destructor
0059      * @since 4.7
0060      */
0061     ~KSslErrorUiData();
0062 
0063     class Private;
0064 
0065 private:
0066     friend class Private;
0067     std::unique_ptr<Private> const d;
0068 };
0069 
0070 #endif // KSSLERRORUIDATA_H