// SPDX-FileCopyrightText: 2025 Joshua Goins // SPDX-License-Identifier: LGPL-2.0-or-later #pragma once #include #include #include #include #include "messagemodel.h" #include "neochatroommember.h" namespace Quotient { class Connection; } class NeoChatRoom; /** * @class PinnedMessageModel * * This class defines the model for visualising a room's pinned messages. */ class PinnedMessageModel : public MessageModel { Q_OBJECT QML_ELEMENT /** * @brief Whether the model is currently loading. */ Q_PROPERTY(bool loading READ loading NOTIFY loadingChanged) public: explicit PinnedMessageModel(QObject *parent = nullptr); /** * @brief Number of rows in the model. * * @sa QAbstractItemModel::rowCount */ int rowCount(const QModelIndex &parent = QModelIndex()) const override; bool loading() const; Q_SIGNALS: void loadingChanged(); protected: std::optional> getEventForIndex(QModelIndex index) const override; private: void setLoading(bool loading); void fill(); bool m_loading = false; std::vector> m_pinnedEvents; };