File indexing completed on 2024-12-01 04:36:52
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 "libruqolawidgets_private_export.h" 0010 #include <QWidget> 0011 class QCheckBox; 0012 class RocketChatAccount; 0013 class MyAccount2FaTotpWidget; 0014 class MyAccount2FaDisableTotpWidget; 0015 class QStackedWidget; 0016 class LIBRUQOLAWIDGETS_TESTS_EXPORT MyAccount2FaConfigureWidget : public QWidget 0017 { 0018 Q_OBJECT 0019 public: 0020 enum PageType { 0021 EmptyPage = 0, 0022 Enable2FaPage, 0023 Disable2FaPage, 0024 }; 0025 explicit MyAccount2FaConfigureWidget(RocketChatAccount *account, QWidget *parent = nullptr); 0026 ~MyAccount2FaConfigureWidget() override; 0027 void load(); 0028 void save(); 0029 0030 void initialize(); 0031 0032 private: 0033 LIBRUQOLAWIDGETS_NO_EXPORT void slot2FAViaTOTPActivated(bool checked); 0034 LIBRUQOLAWIDGETS_NO_EXPORT void slotTotpResult(const QString &secret, const QString &url); 0035 QCheckBox *const mActivate2FAViaEmailCheckbox; 0036 QCheckBox *const mActivate2FAViaTOTPCheckbox; 0037 RocketChatAccount *const mRocketChatAccount; 0038 MyAccount2FaTotpWidget *const mMyAccount2FaTotpWidget; 0039 MyAccount2FaDisableTotpWidget *const mMyAccountDisable2FaTotpWidget; 0040 QWidget *const mMyAccount2FaEmpty; 0041 QStackedWidget *const mStackedWidget; 0042 };