File indexing completed on 2024-12-08 10:25:56
0001 /* 0002 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "libruqolacore_export.h" 0010 0011 #include <QDebug> 0012 #include <QJsonObject> 0013 class LIBRUQOLACORE_EXPORT ServicePassword 0014 { 0015 public: 0016 ServicePassword(); 0017 ~ServicePassword(); 0018 [[nodiscard]] bool operator==(const ServicePassword &other) const; 0019 void parseService(const QJsonObject &replyObject); 0020 0021 [[nodiscard]] bool email2faEnabled() const; 0022 void setEmail2faEnabled(bool email2faEnabled); 0023 0024 [[nodiscard]] QString password() const; 0025 void setPassword(const QString &password); 0026 0027 [[nodiscard]] bool totp() const; 0028 void setTotp(bool totp); 0029 0030 private: 0031 QString mPassword; 0032 bool mEmail2faEnabled = false; 0033 bool mTotp = false; 0034 }; 0035 0036 Q_DECLARE_METATYPE(ServicePassword) 0037 Q_DECLARE_TYPEINFO(ServicePassword, Q_MOVABLE_TYPE); 0038 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const ServicePassword &t);