videodownloader/network/authenticationcredentials.h

74 lines
1.5 KiB
C
Raw Normal View History

2015-04-22 19:32:04 +02:00
#ifndef AUTHENTICATIONCREDENTIALS
#define AUTHENTICATIONCREDENTIALS
#include <QList>
#include <QMap>
2017-05-01 03:22:50 +02:00
#include <QString>
2015-04-22 19:32:04 +02:00
#include <QVariant>
namespace Network {
class Download;
2017-05-01 03:22:50 +02:00
class AuthenticationCredentials {
2015-04-22 19:32:04 +02:00
friend class Download;
public:
AuthenticationCredentials();
AuthenticationCredentials(const QString &userName, const QString &password);
const QString &userName() const;
const QString &password() const;
2019-07-20 20:20:58 +02:00
const QList<QMap<QString, QVariant>> options() const;
2015-04-22 19:32:04 +02:00
bool isIncomplete() const;
void clear();
private:
bool m_requested;
QString m_userName;
QString m_password;
2019-07-20 20:20:58 +02:00
QList<QMap<QString, QVariant>> m_options;
2015-04-22 19:32:04 +02:00
};
2017-05-01 03:22:50 +02:00
inline AuthenticationCredentials::AuthenticationCredentials()
: m_requested(false)
{
}
2015-04-22 19:32:04 +02:00
2017-05-01 03:22:50 +02:00
inline AuthenticationCredentials::AuthenticationCredentials(const QString &userName, const QString &password)
: m_requested(false)
, m_userName(userName)
, m_password(password)
{
}
2015-04-22 19:32:04 +02:00
inline const QString &AuthenticationCredentials::userName() const
{
return m_userName;
}
inline const QString &AuthenticationCredentials::password() const
{
return m_password;
}
2019-07-20 20:20:58 +02:00
inline const QList<QMap<QString, QVariant>> AuthenticationCredentials::options() const
2015-04-22 19:32:04 +02:00
{
return m_options;
}
inline bool AuthenticationCredentials::isIncomplete() const
{
return m_userName.isEmpty() || m_password.isEmpty();
}
inline void AuthenticationCredentials::clear()
{
m_userName.clear();
m_password.clear();
m_options.clear();
}
2019-07-20 20:20:58 +02:00
} // namespace Network
2015-04-22 19:32:04 +02:00
#endif // AUTHENTICATIONCREDENTIALS