File indexing completed on 2025-01-26 03:28:30

0001 /*
0002     SPDX-FileCopyrightText: 2023 Montel Laurent <montel@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QSortFilterProxyModel>
0010 class AccessibleObjectTreeModel;
0011 class AccessibleObjectTreeProxyModel : public QSortFilterProxyModel
0012 {
0013     Q_OBJECT
0014 public:
0015     explicit AccessibleObjectTreeProxyModel(AccessibleObjectTreeModel *model, QObject *parent = nullptr);
0016     ~AccessibleObjectTreeProxyModel() override;
0017 
0018     void setFilterString(const QString &str);
0019 
0020     [[nodiscard]] bool showAllElementWithChildren() const;
0021     void setShowAllElementWithChildren(bool newShowAllElementWithChildren);
0022 
0023 protected:
0024     [[nodiscard]] bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
0025 
0026 private:
0027     QString mFilterString;
0028     bool mShowAllElementWithChildren = false;
0029     AccessibleObjectTreeModel *const mAccessibleObjectTreeModel;
0030 };