File indexing completed on 2024-12-08 07:35:40
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 "ddpapi/ddpauthenticationmanager.h" 0010 #include "ddpapi/ddpclient.h" 0011 #include "libruqolawidgets_private_export.h" 0012 #include <QWidget> 0013 class QLineEdit; 0014 class QPushButton; 0015 class QLabel; 0016 class KBusyIndicatorWidget; 0017 class AuthenticationOauthWidget; 0018 class PasswordLineEditWidget; 0019 class TwoAuthenticationPasswordWidget; 0020 class LIBRUQOLAWIDGETS_TESTS_EXPORT RuqolaLoginWidget : public QWidget 0021 { 0022 Q_OBJECT 0023 public: 0024 explicit RuqolaLoginWidget(QWidget *parent = nullptr); 0025 ~RuqolaLoginWidget() override; 0026 0027 void setRocketChatAccount(RocketChatAccount *account); 0028 void setLoginStatus(DDPAuthenticationManager::LoginStatus status); 0029 void showError(const QString &text); 0030 0031 private: 0032 LIBRUQOLAWIDGETS_NO_EXPORT void changeWidgetStatus(bool enabled); 0033 LIBRUQOLAWIDGETS_NO_EXPORT void slotLogin(); 0034 LIBRUQOLAWIDGETS_NO_EXPORT void slotResetPasswordRequested(const QString &email); 0035 LIBRUQOLAWIDGETS_NO_EXPORT void slotUpdateLoginButton(); 0036 0037 QLineEdit *const mAccountName; 0038 QLineEdit *const mServerUrl; 0039 QLineEdit *const mUserName; 0040 PasswordLineEditWidget *const mPasswordLineEditWidget; 0041 0042 QMetaObject::Connection mUpdatePasswordConnection; 0043 QPushButton *const mLoginButton; 0044 KBusyIndicatorWidget *const mBusyIndicatorWidget; 0045 QLabel *const mFailedError; 0046 TwoAuthenticationPasswordWidget *const mTwoFactorAuthenticationPasswordLineEdit; 0047 QWidget *const mTwoFactorAuthenticationWidget; 0048 QWidget *const mAuthenticationAccountWidget; 0049 AuthenticationOauthWidget *const mAuthenticationWidget; 0050 RocketChatAccount *mRocketChatAccount = nullptr; 0051 };