Warning, file /network/tokodon/src/timeline/tagstimelinemodel.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // SPDX-FileCopyrightText: 2022 Carl Schwan <carlschwan@kde.org>
0002 // SPDX-License-Identifier: LGPL-2.1-or-later
0003 
0004 #pragma once
0005 
0006 #include "timelinemodel.h"
0007 
0008 /// Model used for fetching posts for a specific tag (like searching for #KDE)
0009 /// \see TimelineModel
0010 class TagsTimelineModel : public TimelineModel
0011 {
0012     Q_OBJECT
0013 
0014     Q_PROPERTY(QString hashtag READ hashtag WRITE setHashtag NOTIFY hashtagChanged)
0015 
0016 public:
0017     explicit TagsTimelineModel(QObject *parent = nullptr);
0018     ~TagsTimelineModel() override;
0019 
0020     void fillTimeline(const QString &fromId) override;
0021     QString displayName() const override;
0022 
0023     /// The hashtag the timeline is searching for
0024     /// \see setHashtag
0025     QString hashtag() const;
0026 
0027     /// Sets the hashtag the timeline is searching for
0028     /// Once called, will start re-filling the timeline
0029     /// \see hashtag
0030     void setHashtag(const QString &hashtag);
0031 
0032 Q_SIGNALS:
0033     /// Emitted if the hashtag is changed
0034     /// \see setHashtag
0035     void hashtagChanged();
0036 
0037 private:
0038     QString m_hashtag;
0039 };