libfuoten 0.8.1
Qt based library to access the ownCloud/Nextcloud News App API
Loading...
Searching...
No Matches
Article Class Reference

#include <Fuoten/Article>

Inheritance diagram for Article:
BaseItem

Properties

QString author
QString body
QUrl enclosureLink
QString enclosureMime
qint64 feedId
QString feedTitle
QString fingerprint
qint64 folderId
QString folderName
QString guid
QString guidHash
QString humanPubDate
QString humanPubTime
QDateTime lastModified
QString mediaDescription
QUrl mediaThumbnail
QDateTime pubDate
bool rtl
bool starred
QString title
bool unread
QUrl url
Properties inherited from BaseItem
Fuoten::Errorerror
qint64 id
bool inOperation

Public Member Functions

 Article (Article *other, QObject *parent=nullptr)
 Article (qint64 id, qint64 feedId, const QString &feedTitle, const QString &guid, const QString &guidHash, const QUrl &url, const QString &title, const QString &author, const QDateTime &pubDate, const QString &body, const QString &enclosureMime, const QUrl &enclosureLink, bool unread, bool starred, const QDateTime &lastModified, const QString &fingerprint, qint64 folderId, const QString &folderName, FuotenEnums::QueueActions queue, bool rtl, const QUrl &mediaThumbnail, const QString &mediaDescription, QObject *parent=nullptr)
 Article (QObject *parent=nullptr)
 ~Article () override
QString author () const
QString body () const
void copy (BaseItem *other) override
QUrl enclosureLink () const
QString enclosureMime () const
qint64 feedId () const
QString feedTitle () const
QString fingerprint () const
qint64 folderId () const
QString folderName () const
QString guid () const
QString guidHash () const
QString humanPubDate () const
QString humanPubTime () const
QDateTime lastModified () const
Q_INVOKABLE void mark (bool unread, bool enqueue=false)
Q_INVOKABLE void mark (bool unread, Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage=nullptr, bool enqueue=false)
QString mediaDescription () const
QUrl mediaThumbnail () const
QDateTime pubDate () const
bool rtl () const
void setAuthor (const QString &nAuthor)
void setBody (const QString &nBody)
void setEnclosureLink (const QUrl &nEnclosureLink)
void setEnclosureMime (const QString &nEnclosureMime)
void setFeedId (qint64 nFeedId)
void setFeedTitle (const QString &nFeedTitle)
void setFingerprint (const QString &nFingerprint)
void setFolderId (qint64 nFolderId)
void setFolderName (const QString &nFolderName)
void setGuid (const QString &nGuid)
void setGuidHash (const QString &nGuidHash)
void setLastModified (const QDateTime &nLastModified)
void setMediaDescription (const QString &nMediaDescription)
void setMediaThumbnail (const QUrl &nMediaThumbnail)
void setPubDate (const QDateTime &nPubDate)
void setRtl (bool nRtl)
void setStarred (bool nStarred)
void setTitle (const QString &nTitle)
void setUnread (bool nUnread)
void setUrl (const QUrl &nUrl)
Q_INVOKABLE void star (bool starred, bool enqueue=false)
Q_INVOKABLE void star (bool starred, Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage=nullptr, bool enqueue=false)
bool starred () const
QString title () const
bool unread () const
QUrl url () const
Public Member Functions inherited from BaseItem
 BaseItem (QObject *parent=nullptr)
 ~BaseItem () override
Q_INVOKABLE void clearError ()
Errorerror () const
qint64 id () const
bool inOperation () const
void setId (qint64 nId)

Signals

void authorChanged (const QString &author)
void bodyChanged (const QString &body)
void enclosureLinkChanged (const QUrl &enclosureLink)
void enclosureMimeChanged (const QString &enclosureMime)
void feedIdChanged (qint64 feedId)
void feedTitleChanged (const QString &feedTitle)
void fingerprintChanged (const QString &fingerprint)
void folderIdChanged (qint64 folderId)
void folderNameChanged (const QString &folderName)
void guidChanged (const QString &guid)
void guidHashChanged (const QString &guidHash)
void humanPubDateChanged (const QString &humanPubDate)
void humanPubTimeChanged (const QString &humanPubTime)
void lastModifiedChanged (const QDateTime &lastModified)
void mediaDescriptionChanged (const QString &mediaDescription)
void mediaThumbnailChanged (const QUrl &mediaThumbnail)
void pubDateChanged (const QDateTime &pubDate)
void rtlChanged (bool rtl)
void starredChanged (bool starred)
void titleChanged (const QString &title)
void unreadChanged (bool unread)
void urlChanged (const QUrl &url)
Signals inherited from BaseItem
void errorChanged (Fuoten::Error *error)
void idChanged (qint64 id)
void inOperationChanged (bool inOperation)

Additional Inherited Members

Protected Member Functions inherited from BaseItem
Componentcomponent () const
void setComponent (Component *nComp)
void setError (Error *nError)

Detailed Description

Contains information about a single article/item.

Property Documentation

◆ author

QString author
readwrite

The author of the article.

Access functions:
QStringauthor() const
voidsetAuthor(const QString &nAuthor)
Notifier signal:
voidauthorChanged(const QString &author)

◆ body

QString body
readwrite

The text body of the article.

Access functions:
QStringbody() const
voidsetBody(const QString &nBody)
Notifier signal:
voidbodyChanged(const QString &body)

◆ enclosureLink

QUrl enclosureLink
readwrite

◆ enclosureMime

QString enclosureMime
readwrite

MIME type of an optional enclosure.

Access functions:
QStringenclosureMime() const
voidsetEnclosureMime(const QString &nEnclosureMime)
Notifier signal:
voidenclosureMimeChanged(const QString &enclosureMime)

◆ feedId

qint64 feedId
readwrite

ID of the Feed this Article belongs to.

Access functions:
qint64feedId() const
voidsetFeedId(qint64 nFeedId)
Notifier signal:
voidfeedIdChanged(qint64 feedId)

◆ feedTitle

QString feedTitle
readwrite

Title of the feed this article belongs to.

Access functions:
QStringfeedTitle() const
voidsetFeedTitle(const QString &nFeedTitle)
Notifier signal:
voidfeedTitleChanged(const QString &feedTitle)

◆ fingerprint

QString fingerprint
readwrite

Hash over title, enclosure, body and url.

Access functions:
QStringfingerprint() const
voidsetFingerprint(const QString &nFingerprint)
Notifier signal:
voidfingerprintChanged(const QString &fingerprint)

◆ folderId

qint64 folderId
readwrite

ID of the folder this article belongs to.

Access functions:
qint64folderId() const
voidsetFolderId(qint64 nFolderId)
Notifier signal:
voidfolderIdChanged(qint64 folderId)

◆ folderName

QString folderName
readwrite

Name of the folder this article belongs to.

Access functions:
QStringfolderName() const
voidsetFolderName(const QString &nFolderName)
Notifier signal:
voidfolderNameChanged(const QString &folderName)

◆ guid

QString guid
readwrite

Global unique identifier of the article.

Access functions:
QStringguid() const
voidsetGuid(const QString &nGuid)
Notifier signal:
voidguidChanged(const QString &guid)

◆ guidHash

QString guidHash
readwrite

Hash of the global uniquie identifier of the article.

Access functions:
QStringguidHash() const
voidsetGuidHash(const QString &nGuidHash)
Notifier signal:
voidguidHashChanged(const QString &guidHash)

◆ humanPubDate

QString humanPubDate
read

Returns a human readable string of the publication date.

Will be automatically created from pubDate.

Access functions:
QStringgetHumanPubDate() const
Notifier signal:
voidhumanPubDateChanged(const QString &humanPubDate)

◆ humanPubTime

QString humanPubTime
read

Return a human readable string of the publication time.

Access functions:
QStringhumanPubTime() const
Notifier signal:
voidhumanPubTimeChanged(const QString &humanPubTime)

◆ lastModified

QDateTime lastModified
readwrite

Date and time this articles has been modified the last time.

Access functions:
QDateTimelastModified() const
voidsetLastModified(const QDateTime &nLastModified)
Notifier signal:
voidlastModifiedChanged(const QDateTime &lastModified)

◆ mediaDescription

QString mediaDescription
readwrite

Holds the description of a optional media object.

Since
0.8.0
Access functions:
QStringmediaDescription() const
voidsetMediaDescription(const QString &nMediaDescription)
Notifier signal:
voidmediaDescriptionChanged(const QString &mediaDescription)

◆ mediaThumbnail

QUrl mediaThumbnail
readwrite

Holds the url to a optional media thumbnail.

Since
0.8.0
Access functions:
QUrlmediaThumbnail() const
voidsetMediaThumbnail(const QUrl &nMediaThumbnail)
Notifier signal:
voidmediaThumbnailChanged(const QUrl &mediaThumbnail)

◆ pubDate

QDateTime pubDate
readwrite

Date and time the article was published.

Access functions:
QDateTimepubDate() const
voidsetPubDate(const QDateTime &nPubDate)
Notifier signal:
voidpubDateChanged(const QDateTime &pubDate)

◆ rtl

bool rtl
readwrite

Returns true if the text is right to left.

Since
0.8.0
Access functions:
boolrtl() const
voidsetRtl(bool nRtl)
Notifier signal:
voidrtlChanged(bool rtl)

◆ starred

bool starred
readwrite

True if the user has starred this article.

Access functions:
boolstarred() const
voidsetStarred(bool nStarred)
Notifier signal:
voidstarredChanged(bool starred)

◆ title

QString title
readwrite

Title of the article.

Access functions:
QStringtitle() const
voidsetTitle(const QString &nTitle)
Notifier signal:
voidtitleChanged(const QString &title)

◆ unread

bool unread
readwrite

True if the article has not been read.

Access functions:
boolunread() const
voidsetUnread(bool nUnread)
Notifier signal:
voidunreadChanged(bool unread)

◆ url

QUrl url
readwrite

URL of the article.

Access functions:
QUrlurl() const
voidsetUrl(const QUrl &nUrl)
Notifier signal:
voidurlChanged(const QUrl &url)

Constructor & Destructor Documentation

◆ Article() [1/3]

Article ( QObject * parent = nullptr)
explicit

Constructs a new Article object with default values and the given parent.

◆ Article() [2/3]

Article ( qint64 id,
qint64 feedId,
const QString & feedTitle,
const QString & guid,
const QString & guidHash,
const QUrl & url,
const QString & title,
const QString & author,
const QDateTime & pubDate,
const QString & body,
const QString & enclosureMime,
const QUrl & enclosureLink,
bool unread,
bool starred,
const QDateTime & lastModified,
const QString & fingerprint,
qint64 folderId,
const QString & folderName,
FuotenEnums::QueueActions queue,
bool rtl,
const QUrl & mediaThumbnail,
const QString & mediaDescription,
QObject * parent = nullptr )

Constructs a new Article object with the given arguments and parent.

◆ Article() [3/3]

Article ( Article * other,
QObject * parent = nullptr )
explicit

Constructs a new Article object with the given parent by copying the properties of other to the new object.

◆ ~Article()

~Article ( )
override

Deconstructs the Article object.

Member Function Documentation

◆ author()

QString author ( ) const

Getter function for the author property.

See also
Article::setAuthor(), Article::authorChanged()

◆ authorChanged

void authorChanged ( const QString & author)
signal

This is emitted if the value of the author property changes.

See also
Article::author(), Article::setAuthor()

◆ body()

QString body ( ) const

Getter function for the body property.

See also
Article::setBody(), Article::bodyChanged()

◆ bodyChanged

void bodyChanged ( const QString & body)
signal

This is emitted if the value of the body property changes.

See also
Article::body(), Article::setBody()

◆ copy()

void copy ( BaseItem * other)
overridevirtual

Makes a deep copy of other.

other has to be an Article object.

Reimplemented from BaseItem.

◆ enclosureLink()

QUrl enclosureLink ( ) const

◆ enclosureLinkChanged

void enclosureLinkChanged ( const QUrl & enclosureLink)
signal

This is emitted if the value of the enclosureLink property changes.

See also
Article::enclosureLink(), Article::setEnclosureLink()

◆ enclosureMime()

QString enclosureMime ( ) const

◆ enclosureMimeChanged

void enclosureMimeChanged ( const QString & enclosureMime)
signal

This is emitted if the value of the enclosureMime property changes.

See also
Article::enclosureMime(), Article::setEnclosureMime()

◆ feedId()

qint64 feedId ( ) const

Getter function for the feedId property.

See also
Article::setFeedId(), Article::feedIdChanged()

◆ feedIdChanged

void feedIdChanged ( qint64 feedId)
signal

This is emitted if the value of the feedId property changes.

See also
Article::feedId(), Article::setFeedId()

◆ feedTitle()

QString feedTitle ( ) const

Getter function for the feedTitle property.

See also
Article::setFeedTitle(), Article::feedTitleChanged()

◆ feedTitleChanged

void feedTitleChanged ( const QString & feedTitle)
signal

This is emitted if the value of the feedTitle property changes.

See also
Article::feedTitle(), Article::setFeedTitle()

◆ fingerprint()

QString fingerprint ( ) const

Getter function for the fingerprint property.

See also
Article::setFingerprint(), Article::fingerprintChanged()

◆ fingerprintChanged

void fingerprintChanged ( const QString & fingerprint)
signal

This is emitted if the value of the fingerprint property changes.

See also
Article::fingerprint(), Article::setFingerprint()

◆ folderId()

qint64 folderId ( ) const

Getter function for the folderId property.

See also
Article::setFolderId(), Article::folderIdChanged()

◆ folderIdChanged

void folderIdChanged ( qint64 folderId)
signal

This is emitted if the value of the folderId property changes.

See also
Article::folderId(), Article::setFolderId()

◆ folderName()

QString folderName ( ) const

Getter function for the folderName property.

See also
Article::setFolderName(), Article::folderNameChanged()

◆ folderNameChanged

void folderNameChanged ( const QString & folderName)
signal

This is emitted if the value of the folderName property changes.

See also
Article::folderName(), Article::setFolderName()

◆ guid()

QString guid ( ) const

Getter function for the guid property.

See also
Article::setGuid(), Article::guidChanged()

◆ guidChanged

void guidChanged ( const QString & guid)
signal

This is emitted if the value of the guid property changes.

See also
Article::guid(), Article::setGuid()

◆ guidHash()

QString guidHash ( ) const

Getter function for the guidHash property.

See also
Article::setGuidHash(), Article::guidHashChanged()

◆ guidHashChanged

void guidHashChanged ( const QString & guidHash)
signal

This is emitted if the value of the guidHash property changes.

See also
Article::guidHash(), Article::setGuidHash()

◆ humanPubDate()

QString humanPubDate ( ) const

Getter function for the humanPubDate property.

See also
Article::humanPubDateChanged()

◆ humanPubDateChanged

void humanPubDateChanged ( const QString & humanPubDate)
signal

This is emitted if the value of the humanPubDate property changes.

See also
Article::getHumanPubDate()

◆ humanPubTime()

QString humanPubTime ( ) const

Getter function for the humanPubTime property.

See also
Article::humanPubTimeChanged()

◆ humanPubTimeChanged

void humanPubTimeChanged ( const QString & humanPubTime)
signal

This is emitted if the value of the humanPubTime property changes.

See also
Article::humanPubTime()

◆ lastModified()

QDateTime lastModified ( ) const

Getter function for the lastModified property.

See also
Article::setLastModified(), Article::lastModifiedChanged()

◆ lastModifiedChanged

void lastModifiedChanged ( const QDateTime & lastModified)
signal

This is emitted if the value of the lastModified property changes.

See also
Article::lastModified(), Article::setLastModified()

◆ mark() [1/2]

void mark ( bool unread,
bool enqueue = false )

Marks this article as read or unread on the server. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This uses Component::defaultConfiguration() and Component::defaultStorage().

◆ mark() [2/2]

void mark ( bool unread,
Fuoten::AbstractConfiguration * config,
Fuoten::AbstractStorage * storage = nullptr,
bool enqueue = false )

Marks this article as read or unread on the server.

Will also mark the article as read or unread in the local storage, if a valid AbstractStorage object is available.

Parameters
unreadset to true to mark the item as unread, set to false to mark it as read
configpointer to an AbstractConfiguration object that containts the authentication credentials
storagepointer to an AbstractStorage object to update the local storage after successful request
enqueuetrue to enqueue the marking local up to the next sync, valid storage has to be available

◆ mediaDescription()

QString mediaDescription ( ) const

Getter function for the mediaDescription property.

See also
setMediaDescription(), mediaDescriptionChanged()

◆ mediaDescriptionChanged

void mediaDescriptionChanged ( const QString & mediaDescription)
signal

This is emitted if the value of the mediaDescription property changes.

See also
mediaDescription(), setMediaDescription()

◆ mediaThumbnail()

QUrl mediaThumbnail ( ) const

Getter function for the mediaThumbnail property.

See also
setMediaThumbnail(), mediaThumbnailChanged()

◆ mediaThumbnailChanged

void mediaThumbnailChanged ( const QUrl & mediaThumbnail)
signal

This is emitted if the value of the mediaThumbnail property changes.

See also
mediaThumbnail(), setMediaThumbnail()

◆ pubDate()

QDateTime pubDate ( ) const

Getter function for the pubDate property.

See also
Article::setPubDate(), Article::pubDateChanged()

◆ pubDateChanged

void pubDateChanged ( const QDateTime & pubDate)
signal

This is emitted if the value of the pubDate property changes.

See also
Article::pubDate(), Article::setPubDate()

◆ rtl()

bool rtl ( ) const

Getter function for the rtl property.

See also
setRtl(), rtlChanged()

◆ rtlChanged

void rtlChanged ( bool rtl)
signal

This is emitted if the value of the rtl property changes.

See also
rtl(), setRtl()

◆ setAuthor()

void setAuthor ( const QString & nAuthor)

Setter function for the author property. Emits the authorChanged() signal if nAuthor is not equal to the stored value.

See also
Article::author(), Article::authorChanged()

◆ setBody()

void setBody ( const QString & nBody)

Setter function for the body property. Emits the bodyChanged() signal if nBody is not equal to the stored value.

See also
Article::body(), Article::bodyChanged()

◆ setEnclosureLink()

void setEnclosureLink ( const QUrl & nEnclosureLink)

Setter function for the enclosureLink property. Emits the enclosureLinkChanged() signal if nEnclosureLink is not equal to the stored value.

See also
Article::enclosureLink(), Article::enclosureLinkChanged()

◆ setEnclosureMime()

void setEnclosureMime ( const QString & nEnclosureMime)

Setter function for the enclosureMime property. Emits the enclosureMimeChanged() signal if nEnclosureMime is not equal to the stored value.

See also
Article::enclosureMime(), Article::enclosureMimeChanged()

◆ setFeedId()

void setFeedId ( qint64 nFeedId)

Setter function for the feedId property. Emits the feedIdChanged() signal if nFeedId is not equal to the stored value.

See also
Article::feedId(), Article::feedIdChanged()

◆ setFeedTitle()

void setFeedTitle ( const QString & nFeedTitle)

Setter function for the feedTitle property. Emits the feedTitleChanged() signal if nFeedTitle is not equal to the stored value.

See also
Article::feedTitle(), Article::feedTitleChanged()

◆ setFingerprint()

void setFingerprint ( const QString & nFingerprint)

Setter function for the fingerprint property. Emits the fingerprintChanged() signal if nFingerprint is not equal to the stored value.

See also
Article::fingerprint(), Article::fingerprintChanged()

◆ setFolderId()

void setFolderId ( qint64 nFolderId)

Setter function for the folderId property. Emits the folderIdChanged() signal if nFolderId is not equal to the stored value.

See also
Article::folderId(), Article::folderIdChanged()

◆ setFolderName()

void setFolderName ( const QString & nFolderName)

Setter function for the folderName property. Emits the folderNameChanged() signal if nFolderName is not equal to the stored value.

See also
Article::folderName(), Article::folderNameChanged()

◆ setGuid()

void setGuid ( const QString & nGuid)

Setter function for the guid property. Emits the guidChanged() signal if nGuid is not equal to the stored value.

See also
Article::guid(), Article::guidChanged()

◆ setGuidHash()

void setGuidHash ( const QString & nGuidHash)

Setter function for the guidHash property. Emits the guidHashChanged() signal if nGuidHash is not equal to the stored value.

See also
Article::guidHash(), Article::guidHashChanged()

◆ setLastModified()

void setLastModified ( const QDateTime & nLastModified)

Setter function for the lastModified property. Emits the lastModifiedChanged() signal if nLastModified is not equal to the stored value.

See also
Article::lastModified(), Article::lastModifiedChanged()

◆ setMediaDescription()

void setMediaDescription ( const QString & nMediaDescription)

Setter function for the mediaDescription property. Emits the mediaDescriptionChanged() signal if nMediaDescription is not equal to the stored value.

See also
mediaDescription(), mediaDescriptionChanged()

◆ setMediaThumbnail()

void setMediaThumbnail ( const QUrl & nMediaThumbnail)

Setter function for the mediaThumbnail property. Emits the mediaThumbnailChanged() signal if nMediaThumbnail is not equal to the stored value.

See also
mediaThumbnail(), mediaThumbnailChanged()

◆ setPubDate()

void setPubDate ( const QDateTime & nPubDate)

Setter function for the pubDate property. Emits the pubDateChanged() signal if nPubDate is not equal to the stored value.

See also
Article::pubDate(), Article::pubDateChanged()

◆ setRtl()

void setRtl ( bool nRtl)

Setter function for the rtl property. Emits the rtlChanged() signal if nRtl is not equal to the stored value.

See also
ŗtl(), rtlChanged()

◆ setStarred()

void setStarred ( bool nStarred)

Setter function for the starred property. Emits the starredChanged() signal if nStarred is not equal to the stored value.

See also
Article::starred(), Article::starredChanged()

◆ setTitle()

void setTitle ( const QString & nTitle)

Setter function for the title property. Emits the titleChanged() signal if nTitle is not equal to the stored value.

See also
Article::title(), Article::titleChanged()

◆ setUnread()

void setUnread ( bool nUnread)

Setter function for the unread property. Emits the unreadChanged() signal if nUnread is not equal to the stored value.

See also
Article::unread(), Article::unreadChanged()

◆ setUrl()

void setUrl ( const QUrl & nUrl)

Setter function for the url property. Emits the urlChanged() signal if nUrl is not equal to the stored value.

See also
Article::url(), Article::urlChanged()

◆ star() [1/2]

void star ( bool starred,
bool enqueue = false )

Marks this article as starred or unstarred on the remote server. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This uses Component::defaultConfiguration() and Component::defaultStorage().

◆ star() [2/2]

void star ( bool starred,
Fuoten::AbstractConfiguration * config,
Fuoten::AbstractStorage * storage = nullptr,
bool enqueue = false )

Marks this article as starred or unstarred on the remote server.

Will also mark the article as starred/unstarred in the local storage if a valid AbstractStorage object is available.

Parameters
starredste to true to mark the item as starred, set to false to mark it as unstarred
configpointer to an AbstractConfiguration object that containts the authentication credentials
storagepointer to an AbstractStorage object to update the local storage after successful request
enqueuetrue to enqueue the un/starring local up to the next sync, valid storage has to be available

◆ starred()

bool starred ( ) const

Getter function for the starred property.

See also
Article::setStarred(), Article::starredChanged()

◆ starredChanged

void starredChanged ( bool starred)
signal

This is emitted if the value of the starred property changes.

See also
Article::starred(), Article::setStarred()

◆ title()

QString title ( ) const

Getter function for the title property.

See also
Article::setTitle(), Article::titleChanged()

◆ titleChanged

void titleChanged ( const QString & title)
signal

This is emitted if the value of the title property changes.

See also
Article::title(), Article::setTitle()

◆ unread()

bool unread ( ) const

Getter function for the unread property.

See also
Article::setUnread(), Article::unreadChanged()

◆ unreadChanged

void unreadChanged ( bool unread)
signal

This is emitted if the value of the unread property changes.

See also
Article::unread(), Article::setUnread()

◆ url()

QUrl url ( ) const

Getter function for the url property.

See also
Article::setUrl(), Article::urlChanged()

◆ urlChanged

void urlChanged ( const QUrl & url)
signal

This is emitted if the value of the url property changes.

See also
Article::url(), Article::setUrl()