File indexing completed on 2024-12-22 04:28:24

0001 /*
0002   SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 #include "libvoskspeechtotext_private_export.h"
0009 #include <QSortFilterProxyModel>
0010 
0011 class LIBVOSKSPEECHTOTEXT_TESTS_EXPORT VoskSpeechToTextProxyModel : public QSortFilterProxyModel
0012 {
0013     Q_OBJECT
0014 public:
0015     explicit VoskSpeechToTextProxyModel(QObject *parent = nullptr);
0016     ~VoskSpeechToTextProxyModel() override;
0017 
0018     [[nodiscard]] QString searchString() const;
0019     void setSearchString(const QString &newSearchString);
0020 
0021 protected:
0022     [[nodiscard]] bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
0023 
0024     [[nodiscard]] bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
0025 
0026 private:
0027     QString mSearchString;
0028 };