File indexing completed on 2024-02-18 15:43:55

0001 /*
0002    SPDX-FileCopyrightText: 2021-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 class TeamRoomsModel;
0012 class LIBRUQOLACORE_EXPORT TeamRoomsFilterProxyModel : public QSortFilterProxyModel
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit TeamRoomsFilterProxyModel(TeamRoomsModel *teamModel = nullptr, QObject *parent = nullptr);
0017     ~TeamRoomsFilterProxyModel() override;
0018 
0019     void setFilterString(const QString &string);
0020 
0021     [[nodiscard]] bool sortByAutoJoin() const;
0022     void setSortByAutoJoin(bool sortByAutoJoin);
0023 
0024 protected:
0025     bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
0026 
0027 private:
0028     TeamRoomsModel *const mTeamRoomsModel;
0029     bool mSortByAutoJoin = false;
0030 };