2020-02-28 23:25:08 +01:00
|
|
|
/**
|
2020-08-14 20:56:04 +02:00
|
|
|
* SPDX-FileCopyrightText: 2020 Tobias Fella <fella@posteo.de>
|
2021-04-08 13:16:36 +02:00
|
|
|
* SPDX-FileCopyrightText: 2021 Bart De Vries <bart@mogwai.be>
|
2020-02-28 23:25:08 +01:00
|
|
|
*
|
2020-08-14 20:56:04 +02:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2020-02-28 23:25:08 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-05-26 16:32:07 +02:00
|
|
|
#include <QAbstractListModel>
|
2021-04-17 21:53:55 +02:00
|
|
|
#include <QVariant>
|
2020-05-26 16:32:07 +02:00
|
|
|
#include <QHash>
|
2020-02-28 23:25:08 +01:00
|
|
|
#include <QObject>
|
|
|
|
|
2020-10-09 13:47:35 +02:00
|
|
|
#include "feed.h"
|
2020-05-26 16:32:07 +02:00
|
|
|
|
2020-10-09 13:47:35 +02:00
|
|
|
class EntriesModel : public QAbstractListModel
|
2020-02-28 23:25:08 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2020-05-26 16:32:07 +02:00
|
|
|
|
2020-10-09 13:47:35 +02:00
|
|
|
Q_PROPERTY(Feed *feed READ feed CONSTANT)
|
2020-05-26 16:32:07 +02:00
|
|
|
|
2020-02-28 23:25:08 +01:00
|
|
|
public:
|
2020-10-09 13:47:35 +02:00
|
|
|
explicit EntriesModel(Feed *feed);
|
2020-02-28 23:25:08 +01:00
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
QHash<int, QByteArray> roleNames() const override;
|
2020-05-26 16:32:07 +02:00
|
|
|
int rowCount(const QModelIndex &parent) const override;
|
2020-02-28 23:25:08 +01:00
|
|
|
|
2021-04-05 22:16:13 +02:00
|
|
|
Feed* feed() const;
|
2020-02-28 23:25:08 +01:00
|
|
|
|
|
|
|
private:
|
2020-05-26 16:32:07 +02:00
|
|
|
Feed *m_feed;
|
2020-02-28 23:25:08 +01:00
|
|
|
};
|