File indexing completed on 2024-02-25 16:44:34

0001 /*
0002    SPDX-FileCopyrightText: 2020-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 "searchtreebasefilterproxymodel.h"
0011 class CustomBaseModel;
0012 class LIBRUQOLACORE_EXPORT AdminRoomsFilterProxyModel : public SearchTreeBaseFilterProxyModel
0013 {
0014     Q_OBJECT
0015 public:
0016     enum FilterRoom {
0017         None = 0,
0018         DirectRooms = 1,
0019         PublicRooms = 2,
0020         PrivateRooms = 4,
0021         DiscussionRooms = 8,
0022         TeamRooms = 16,
0023         Omnichannel = 32,
0024         All = DirectRooms | PublicRooms | DiscussionRooms | PrivateRooms | TeamRooms | Omnichannel,
0025     };
0026     Q_FLAGS(FilterRoom FilterRooms)
0027     Q_DECLARE_FLAGS(FilterRooms, FilterRoom)
0028 
0029     explicit AdminRoomsFilterProxyModel(CustomBaseModel *model = nullptr, QObject *parent = nullptr);
0030     ~AdminRoomsFilterProxyModel() override;
0031 
0032     void setFilterRooms(AdminRoomsFilterProxyModel::FilterRooms filters);
0033 
0034 protected:
0035     bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
0036 
0037 private:
0038     AdminRoomsFilterProxyModel::FilterRooms mFilters = FilterRoom::All;
0039 };