File indexing completed on 2024-05-12 05:02:09

0001 /*
0002    SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libruqolacore_export.h"
0010 #include <QSortFilterProxyModel>
0011 
0012 class LIBRUQOLACORE_EXPORT UsersForRoomFilterProxyModel : public QSortFilterProxyModel
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit UsersForRoomFilterProxyModel(QObject *parent = nullptr);
0017     ~UsersForRoomFilterProxyModel() override;
0018     void setFilterString(const QString &string);
0019 
0020     [[nodiscard]] bool hasFullList() const;
0021     [[nodiscard]] bool loadMoreUsersInProgress() const;
0022 
0023     [[nodiscard]] int total() const;
0024     [[nodiscard]] int numberOfUsers() const;
0025 
0026     void setStatusType(const QString &statusType);
0027 
0028     void clearFilter();
0029 Q_SIGNALS:
0030     void hasFullListChanged();
0031     void loadingInProgressChanged();
0032 
0033 protected:
0034     bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
0035     bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
0036 
0037 private:
0038     QString mStatusType;
0039 };