File indexing completed on 2024-12-01 04:37:03

0001 /*
0002    SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 #include "libruqolawidgets_private_export.h"
0009 #include "uploadfilejob.h"
0010 #include <QMap>
0011 #include <QScrollArea>
0012 class UploadFileProgressStatusWidget;
0013 class LIBRUQOLAWIDGETS_TESTS_EXPORT UploadFileProgressStatusListWidget : public QScrollArea
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit UploadFileProgressStatusListWidget(QWidget *parent = nullptr);
0018     ~UploadFileProgressStatusListWidget() override;
0019 
0020     void addProgressStatusWidget(int identifier);
0021 
0022     void removeUploadFileProgressStatusWidget(int identifier);
0023 
0024     void uploadProgress(const RocketChatRestApi::UploadFileJob::UploadStatusInfo &info, int jobIdentifier, const QString &accountName);
0025 Q_SIGNALS:
0026     void cancelUpload(int identifier);
0027 
0028 protected:
0029     void resizeEvent(QResizeEvent *event) override;
0030     QSize sizeHint() const override;
0031     QSize minimumSizeHint() const override;
0032 
0033 private:
0034     LIBRUQOLAWIDGETS_NO_EXPORT void slotLayoutFirstItem();
0035     QWidget *const mBigBox;
0036     QMap<int, UploadFileProgressStatusWidget *> mUploadItems;
0037 };