File indexing completed on 2024-12-01 04:36:36
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "accountmanager.h" 0010 #include "libruqolawidgets_private_export.h" 0011 #include <QWidget> 0012 class QLineEdit; 0013 class QPushButton; 0014 class PasswordLineEditWidget; 0015 class LIBRUQOLAWIDGETS_TESTS_EXPORT AuthenticationLoginWidget : public QWidget 0016 { 0017 Q_OBJECT 0018 public: 0019 explicit AuthenticationLoginWidget(QWidget *parent = nullptr); 0020 ~AuthenticationLoginWidget() override; 0021 0022 void setExistingAccountName(const QStringList &lst); 0023 0024 void setAccountInfo(const AccountManager::AccountManagerInfo &info); 0025 [[nodiscard]] AccountManager::AccountManagerInfo accountInfo(); 0026 0027 Q_SIGNALS: 0028 void updateOkButton(bool enabled); 0029 0030 private: 0031 LIBRUQOLAWIDGETS_NO_EXPORT void slotRegisterUserDone(); 0032 LIBRUQOLAWIDGETS_NO_EXPORT void slotChangeOkButtonEnabled(); 0033 LIBRUQOLAWIDGETS_NO_EXPORT void slotRegisterAccount(); 0034 QStringList mNames; 0035 AccountManager::AccountManagerInfo mAccountInfo; 0036 QLineEdit *const mServerUrl; 0037 QLineEdit *const mAccountName; 0038 QLineEdit *const mUserName; 0039 PasswordLineEditWidget *const mPasswordLineEditWidget; 0040 QPushButton *const mRegisterAccount; 0041 };