File indexing completed on 2024-12-08 04:34:20

0001 /*
0002    SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 #pragma once
0007 
0008 #include "directory/directorywidget.h"
0009 #include "libruqolawidgets_private_export.h"
0010 #include <QStackedWidget>
0011 class RocketChatAccount;
0012 class DirectoryNotAuthorizedWidget;
0013 
0014 class LIBRUQOLAWIDGETS_TESTS_EXPORT DirectoryStackedWidget : public QStackedWidget
0015 {
0016     Q_OBJECT
0017 public:
0018     explicit DirectoryStackedWidget(RocketChatAccount *account, DirectoryWidget::DirectoryType type, QWidget *parent = nullptr);
0019     ~DirectoryStackedWidget() override;
0020 
0021     [[nodiscard]] bool isAutorized() const;
0022     void setIsAutorized(bool newIsAutorized);
0023 
0024     void fillDirectory();
0025 
0026     [[nodiscard]] DirectoryWidget *directoryWidget() const;
0027 
0028     [[nodiscard]] DirectoryNotAuthorizedWidget *directoryNotAutorizedWidget() const;
0029 
0030 private:
0031     DirectoryWidget *const mDirectoryWidget;
0032     DirectoryNotAuthorizedWidget *const mDirectoryNotAutorizedWidget;
0033     bool mIsAutorized = true;
0034 };