2020-05-26 16:32:07 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2020 Tobias Fella <fella@posteo.de>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License or (at your option) version 3 or any later version
|
|
|
|
* accepted by the membership of KDE e.V. (or its successor approved
|
|
|
|
* by the membership of KDE e.V.), which shall act as a proxy
|
|
|
|
* defined in Section 14 of version 3 of the license.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FEED_H
|
|
|
|
#define FEED_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2020-05-30 17:33:08 +02:00
|
|
|
#include "author.h"
|
|
|
|
|
2020-05-26 16:32:07 +02:00
|
|
|
class Feed : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_PROPERTY(QString url READ url CONSTANT)
|
|
|
|
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
|
|
|
|
Q_PROPERTY(QString image READ image WRITE setImage NOTIFY imageChanged)
|
2020-05-30 17:33:08 +02:00
|
|
|
Q_PROPERTY(QString link READ link WRITE setLink NOTIFY linkChanged)
|
|
|
|
Q_PROPERTY(QString description READ description WRITE setDescription NOTIFY descriptionChanged)
|
|
|
|
Q_PROPERTY(QVector<Author *> authors READ authors WRITE setAuthors NOTIFY authorsChanged)
|
2020-05-31 18:17:25 +02:00
|
|
|
Q_PROPERTY(bool refreshing READ refreshing WRITE setRefreshing NOTIFY refreshingChanged)
|
2020-05-26 16:32:07 +02:00
|
|
|
|
|
|
|
public:
|
2020-05-30 17:33:08 +02:00
|
|
|
Feed(QString url, QString name, QString image, QString link, QString description, QVector<Author *> authors, QObject *parent = nullptr);
|
2020-05-26 16:32:07 +02:00
|
|
|
|
|
|
|
~Feed();
|
|
|
|
|
|
|
|
QString url() const;
|
|
|
|
QString name() const;
|
|
|
|
QString image() const;
|
2020-05-30 17:33:08 +02:00
|
|
|
QString link() const;
|
|
|
|
QString description() const;
|
|
|
|
QVector<Author *> authors() const;
|
2020-05-31 18:17:25 +02:00
|
|
|
bool refreshing() const;
|
2020-05-26 16:32:07 +02:00
|
|
|
|
|
|
|
void setName(QString name);
|
|
|
|
void setImage(QString image);
|
2020-05-30 17:33:08 +02:00
|
|
|
void setLink(QString link);
|
|
|
|
void setDescription(QString description);
|
|
|
|
void setAuthors(QVector<Author *> authors);
|
2020-05-31 18:17:25 +02:00
|
|
|
void setRefreshing(bool refreshing);
|
2020-05-26 16:32:07 +02:00
|
|
|
|
2020-05-31 22:47:42 +02:00
|
|
|
Q_INVOKABLE void refresh();
|
2020-05-26 16:32:07 +02:00
|
|
|
void remove();
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void nameChanged(QString &name);
|
|
|
|
void imageChanged(QString &image);
|
2020-05-30 17:33:08 +02:00
|
|
|
void linkChanged(QString &link);
|
|
|
|
void descriptionChanged(QString &description);
|
|
|
|
void authorsChanged(QVector<Author *> &authors);
|
2020-05-31 18:17:25 +02:00
|
|
|
void refreshingChanged(bool refreshing);
|
2020-05-26 16:32:07 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_url;
|
|
|
|
QString m_name;
|
|
|
|
QString m_image;
|
2020-05-30 17:33:08 +02:00
|
|
|
QString m_link;
|
|
|
|
QString m_description;
|
|
|
|
QVector<Author *> m_authors;
|
2020-05-31 18:17:25 +02:00
|
|
|
bool m_refreshing = false;
|
2020-05-26 16:32:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FEED_H
|