File indexing completed on 2024-04-14 04:54:42

0001 /*
0002    SPDX-FileCopyrightText: 2019-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 "listmessagesmodel.h"
0011 #include <QSortFilterProxyModel>
0012 class LIBRUQOLACORE_EXPORT ListMessagesFilterProxyModel : public QSortFilterProxyModel
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit ListMessagesFilterProxyModel(ListMessagesModel *model = nullptr, QObject *parent = nullptr);
0017     ~ListMessagesFilterProxyModel() override;
0018     void setFilterString(const QString &string);
0019 
0020     ListMessagesModel *listMessageModel() const;
0021     [[nodiscard]] int total() const;
0022     [[nodiscard]] bool hasFullList() const;
0023     [[nodiscard]] bool loadMoreListMessagesInProgress() const;
0024 
0025     [[nodiscard]] int numberOfMessages() const;
0026 
0027     void clear();
0028 
0029 Q_SIGNALS:
0030     void hasFullListChanged();
0031     void listMessageTypeChanged();
0032     void totalChanged();
0033     void loadingInProgressChanged();
0034 
0035 private:
0036     [[nodiscard]] LIBRUQOLACORE_NO_EXPORT QString title() const;
0037     [[nodiscard]] LIBRUQOLACORE_NO_EXPORT ListMessagesModel::ListMessageType listMessageType() const;
0038     ListMessagesModel *const mModel;
0039 };