1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
/*
SPDX-FileCopyrightText: 2009 Andras Mantia <amantia@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#pragma once
#include "ksmtp_export.h"
#include "job.h"
#include <QSharedPointer>
class KSslErrorUiData;
namespace KSmtp
{
/** @short Interface to display communication errors and wait for user feedback. */
class KSMTP_EXPORT SessionUiProxy
{
public:
using Ptr = QSharedPointer<SessionUiProxy>;
virtual ~SessionUiProxy();
/**
* Show an SSL error and ask the user whether it should be ignored or not.
* The recommended KDE UI is the following:
* @code
* #include <kio/ksslui.h>
* class UiProxy: public SessionUiProxy {
* public:
* bool ignoreSslError(const KSslErrorUiData& errorData) {
* if (KIO::SslUi::askIgnoreSslErrors(errorData)) {
* return true;
* } else {
* return false;
* }
* }
* };
* [...]
* Session session(server, port);
* UiProxy *proxy = new UiProxy();
* session.setUiProxy(proxy);
* @endcode
* @param errorData contains details about the error.
* @return true if the error can be ignored
*/
virtual bool ignoreSslError(const KSslErrorUiData &errorData) = 0;
};
}
|