Loading...
Searching...
No Matches
QXmppPasswordChecker.h
// SPDX-FileCopyrightText: 2011 Jeremy Lainé <jeremy.laine@m4x.org>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPPASSWORDCHECKER_H
#define QXMPPPASSWORDCHECKER_H
#include "QXmppGlobal.h"
#include <QObject>
class QXMPP_EXPORT QXmppPasswordRequest
{
public:
enum Type {
CheckPassword = 0
};
QString domain() const;
void setDomain(const QString &domain);
QString password() const;
void setPassword(const QString &password);
QString username() const;
void setUsername(const QString &username);
private:
QString m_domain;
QString m_password;
QString m_username;
};
class QXMPP_EXPORT QXmppPasswordReply : public QObject
{
Q_OBJECT
public:
enum Error {
NoError = 0,
AuthorizationError,
TemporaryError
};
QXmppPasswordReply(QObject *parent = nullptr);
QByteArray digest() const;
void setDigest(const QByteArray &digest);
QString password() const;
void setPassword(const QString &password);
QXmppPasswordReply::Error error() const;
void setError(QXmppPasswordReply::Error error);
bool isFinished() const;
Q_SLOT void finish();
Q_SLOT void finishLater();
Q_SIGNAL void finished();
private:
QByteArray m_digest;
QString m_password;
QXmppPasswordReply::Error m_error;
bool m_isFinished;
};
class QXMPP_EXPORT QXmppPasswordChecker
{
public:
virtual QXmppPasswordReply *checkPassword(const QXmppPasswordRequest &request);
virtual QXmppPasswordReply *getDigest(const QXmppPasswordRequest &request);
virtual bool hasGetPassword() const;
protected:
virtual QXmppPasswordReply::Error getPassword(const QXmppPasswordRequest &request, QString &password);
};
#endif
QXmppPasswordChecker
The QXmppPasswordChecker class represents an abstract password checker.
Definition QXmppPasswordChecker.h:81
QXmppPasswordChecker::getPassword
virtual QXmppPasswordReply::Error getPassword(const QXmppPasswordRequest &request, QString &password)
Definition QXmppPasswordChecker.cpp:172
QXmppPasswordChecker::checkPassword
virtual QXmppPasswordReply * checkPassword(const QXmppPasswordRequest &request)
Definition QXmppPasswordChecker.cpp:123
QXmppPasswordChecker::hasGetPassword
virtual bool hasGetPassword() const
Returns true if the getPassword() method is implemented.
Definition QXmppPasswordChecker.cpp:180
QXmppPasswordChecker::getDigest
virtual QXmppPasswordReply * getDigest(const QXmppPasswordRequest &request)
Definition QXmppPasswordChecker.cpp:148
QXmppPasswordReply
The QXmppPasswordReply class represents a password reply.
Definition QXmppPasswordChecker.h:40
QXmppPasswordReply::finished
Q_SIGNAL void finished()
This signal is emitted when the reply has finished.
QXmppPasswordReply::QXmppPasswordReply
QXmppPasswordReply(QObject *parent=nullptr)
Constructs a new QXmppPasswordReply.
Definition QXmppPasswordChecker.cpp:51
QXmppPasswordReply::Error
Error
This enum is used to describe authentication errors.
Definition QXmppPasswordChecker.h:45
QXmppPasswordRequest
The QXmppPasswordRequest class represents a password request.
Definition QXmppPasswordChecker.h:15
QXmppPasswordRequest::Type
Type
This enum is used to describe request types.
Definition QXmppPasswordChecker.h:18