File indexing completed on 2024-05-12 16:27:23
0001 /* 0002 SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 #pragma once 0007 0008 #include "libruqolawidgets_private_export.h" 0009 #include <QWidget> 0010 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 0011 #include <Prison/Barcode> 0012 #endif 0013 class QLabel; 0014 namespace Prison 0015 { 0016 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0017 class AbstractBarcode; 0018 #else 0019 class Barcode; 0020 #endif 0021 } 0022 class RocketChatAccount; 0023 class QLineEdit; 0024 class LIBRUQOLAWIDGETS_TESTS_EXPORT MyAccount2FaTotpWidget : public QWidget 0025 { 0026 Q_OBJECT 0027 public: 0028 explicit MyAccount2FaTotpWidget(RocketChatAccount *account, QWidget *parent = nullptr); 0029 ~MyAccount2FaTotpWidget() override; 0030 0031 Q_SIGNALS: 0032 void show2FaEnabledWidget(); 0033 0034 private: 0035 LIBRUQOLAWIDGETS_NO_EXPORT void slotTotpResult(const QString &secret, const QString &url); 0036 LIBRUQOLAWIDGETS_NO_EXPORT void slotVerify(); 0037 LIBRUQOLAWIDGETS_NO_EXPORT void slotTotpInvalid(); 0038 LIBRUQOLAWIDGETS_NO_EXPORT void slotTotpValid(const QStringList &listCodes); 0039 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0040 Prison::AbstractBarcode *const mQRCode; 0041 #else 0042 std::optional<Prison::Barcode> mQRCode; 0043 #endif 0044 QLabel *const mTotpQrCode; 0045 QLabel *const mQrCoreLabel; 0046 QLineEdit *const mVerifyQrCode; 0047 RocketChatAccount *const mRocketChatAccount; 0048 };