File indexing completed on 2025-01-12 04:34:09
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 "user.h" 0010 #include <QWidget> 0011 0012 #include "libruqolawidgets_private_export.h" 0013 class QLineEdit; 0014 class StatusCombobox; 0015 class LIBRUQOLAWIDGETS_TESTS_EXPORT AdministratorCustomUserStatusCreateWidget : public QWidget 0016 { 0017 Q_OBJECT 0018 public: 0019 struct UserStatusInfo { 0020 QString name; 0021 User::PresenceStatus statusType; 0022 [[nodiscard]] bool isValid() const 0023 { 0024 return !name.isEmpty() && statusType != User::PresenceStatus::Unknown; 0025 } 0026 }; 0027 0028 explicit AdministratorCustomUserStatusCreateWidget(QWidget *parent = nullptr); 0029 ~AdministratorCustomUserStatusCreateWidget() override; 0030 0031 [[nodiscard]] UserStatusInfo userStatusInfo() const; 0032 void setUserStatusInfo(const AdministratorCustomUserStatusCreateWidget::UserStatusInfo &info); 0033 0034 Q_SIGNALS: 0035 void updateOkButton(bool state); 0036 0037 private: 0038 LIBRUQOLAWIDGETS_NO_EXPORT void slotCheckValues(); 0039 QLineEdit *const mName; 0040 StatusCombobox *const mStatusCombobox; 0041 };