File indexing completed on 2024-12-22 04:45: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 "administratormoderationrangewidget.h"
0010 #include "libruqolawidgets_private_export.h"
0011 #include "misc/searchtreebasewidget.h"
0012 class QWidget;
0013 class ModerationMessagesModel;
0014 class CommonMessageFilterProxyModel;
0015 class LIBRUQOLAWIDGETS_TESTS_EXPORT ModerationConsoleTreeWidget : public SearchTreeBaseWidget
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit ModerationConsoleTreeWidget(RocketChatAccount *account, QWidget *parent = nullptr);
0020     ~ModerationConsoleTreeWidget() override;
0021 
0022     void setModerationRanges(const AdministratorModerationRangeWidget::DateTimeRange &range);
0023 
0024 protected:
0025     void updateLabel() override;
0026     void slotLoadElements(int offset = -1, int count = -1, const QString &searchName = {}) override;
0027     void slotCustomContextMenuRequested(const QPoint &pos) override;
0028 
0029 Q_SIGNALS:
0030     void refreshList();
0031 
0032 private:
0033     LIBRUQOLAWIDGETS_NO_EXPORT void slotShowReportedMessages(const QJsonObject &obj);
0034     LIBRUQOLAWIDGETS_NO_EXPORT void slotDismissReport(const QModelIndex &index);
0035     LIBRUQOLAWIDGETS_NO_EXPORT void slotDeleteAllMessages(const QModelIndex &index);
0036     LIBRUQOLAWIDGETS_NO_EXPORT void slotShowMessages(const QModelIndex &newModelIndex);
0037     [[nodiscard]] LIBRUQOLAWIDGETS_NO_EXPORT QString displayShowMessage() const;
0038     AdministratorModerationRangeWidget::DateTimeRange mModerationRanges;
0039     ModerationMessagesModel *const mCommonMessagesModel;
0040     CommonMessageFilterProxyModel *mCommonMessageFilterProxyModel = nullptr;
0041 };