libfuoten  0.8.1
Qt based library to access the ownCloud/Nextcloud News App API
Public Types | Properties | Public Member Functions | Signals | List of all members
Feed Class Reference

#include <Fuoten/Feed>

Inheritance diagram for Feed:
BaseItem

Public Types

enum  FeedOrdering : quint8 { NoSpecial = 0, OldestFirst = 1, NewestFirst = 2 }
 

Properties

QDateTime added
 
QUrl faviconLink
 
qint64 folderId
 
QString folderName
 
QString lastUpdateError
 
QUrl link
 
Fuoten::Feed::FeedOrdering ordering
 
bool pinned
 
QString title
 
uint unreadCount
 
uint updateErrorCount
 
QUrl url
 
- Properties inherited from BaseItem
Fuoten::Error error
 
qint64 id
 
bool inOperation
 

Public Member Functions

 Feed (QObject *parent=nullptr)
 
 Feed (qint64 id, qint64 folderId, const QString &title, const QUrl &url, const QUrl &link, const QDateTime &added, uint unreadCount, Feed::FeedOrdering ordering, bool pinned, uint updateErrorCount, const QString &lastUpdateError, const QUrl &faviconLink, const QString &folderName, QObject *parent=nullptr)
 
 ~Feed () override
 
QDateTime added () const
 
void copy (BaseItem *other) override
 
QUrl faviconLink () const
 
qint64 folderId () const
 
QString folderName () const
 
QString lastUpdateError () const
 
QUrl link () const
 
Q_INVOKABLE void markAsRead (Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage, bool enqueue=false)
 
Q_INVOKABLE void markAsRead (bool enqueue=false)
 
Q_INVOKABLE void move (qint64 targetFolderId, Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage=nullptr)
 
Q_INVOKABLE void move (qint64 targetFolderId)
 
FeedOrdering ordering () const
 
bool pinned () const
 
Q_INVOKABLE void remove (Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage=nullptr)
 
Q_INVOKABLE void remove ()
 
Q_INVOKABLE void rename (const QString &newName, Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage=nullptr)
 
Q_INVOKABLE void rename (const QString &newName)
 
void setAdded (const QDateTime &nAdded)
 
void setFaviconLink (const QUrl &nFaviconLink)
 
void setFolderId (qint64 nFolderId)
 
void setFolderName (const QString &nFolderName)
 
void setLastUpdateError (const QString &nLastUpdateError)
 
void setLink (const QUrl &nLink)
 
void setOrdering (Fuoten::Feed::FeedOrdering nOrdering)
 
void setPinned (bool nPinned)
 
void setTitle (const QString &nTitle)
 
void setUnreadCount (uint nUnreadCount)
 
void setUpdateErrorCount (uint nUpdateErrorCount)
 
void setUrl (const QUrl &nUrl)
 
QString title () const
 
uint unreadCount () const
 
uint updateErrorCount () 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 addedChanged (const QDateTime &added)
 
void faviconLinkChanged (const QUrl &faviconLink)
 
void folderIdChanged (qint64 folderId)
 
void folderNameChanged (const QString &folderName)
 
void lastUpdateErrorChanged (const QString &lastUpdateError)
 
void linkChanged (const QUrl &link)
 
void orderingChanged (Fuoten::Feed::FeedOrdering ordering)
 
void pinnedChanged (bool pinned)
 
void titleChanged (const QString &title)
 
void unreadCountChanged (uint unreadCount)
 
void updateErrorCountChanged (uint updateErrorCount)
 
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 feed.

Member Enumeration Documentation

◆ FeedOrdering

enum FeedOrdering : quint8

Type of the article ordering in this feed on the server.

Enumerator
NoSpecial 

No special ordering

OldestFirst 

Oldest first

NewestFirst 

Newest first

Property Documentation

◆ added

QDateTime added
readwrite

Date and time the feed has been added.

Access functions:
QDateTimeadded() const
voidsetAdded(const QDateTime &nAdded)
Notifier signal:
voidaddedChanged(const QDateTime &added)

◆ faviconLink

QUrl faviconLink
readwrite

The URL to the feed's favicon.

Access functions:
QUrlfaviconLink() const
voidsetFaviconLink(const QUrl &nFaviconLink)
Notifier signal:
voidfaviconLinkChanged(const QUrl &faviconLink)

◆ folderId

qint64 folderId
readwrite

The ID of the folder, the feed belongs to.

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

◆ folderName

QString folderName
readwrite

The name of the folder the feed belongs to.

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

◆ lastUpdateError

QString lastUpdateError
readwrite

Contains the last update error message, if any.

Access functions:
QStringlastUpdateError() const
voidsetLastUpdateError(const QString &nLastUpdateError)
Notifier signal:
voidlastUpdateErrorChanged(const QString &lastUpdateError)

◆ link

QUrl link
readwrite

Link to the homepage of the feed.

Access functions:
QUrllink() const
voidsetLink(const QUrl &nLink)
Notifier signal:
voidlinkChanged(const QUrl &link)

◆ ordering

Feed::FeedOrdering ordering
readwrite

The ordering of the articles in this feed on the server.

Access functions:
FeedOrderingordering() const
voidsetOrdering(FeedOrdering nOrdering)
Notifier signal:
voidorderingChanged(FeedOrdering ordering)

◆ pinned

bool pinned
readwrite

True if the feed is pinned.

Access functions:
boolpinned() const
voidsetPinned(bool nPinned)
Notifier signal:
voidpinnedChanged(bool pinned)

◆ title

QString title
readwrite

The title of the feed.

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

◆ unreadCount

uint unreadCount
readwrite

The number of unread items in this feed.

Access functions:
uintunreadCount() const
voidsetUnreadCount(uint nUnreadCount)
Notifier signal:
voidunreadCountChanged(uint unreadCount)

◆ updateErrorCount

uint updateErrorCount
readwrite

Indicating that the feed has faild to update that many times.

Access functions:
uintupdateErrorCount() const
voidsetUpdateErrorCount(uint nUpdateErrorCount)
Notifier signal:
voidupdateErrorCountChanged(uint updateErrorCount)

◆ url

QUrl url
readwrite

The URL of the feed.

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

Constructor & Destructor Documentation

◆ Feed() [1/2]

Feed ( QObject *  parent = nullptr)
explicit

Constructs a new empty Feed object with the given parent.

◆ Feed() [2/2]

Feed ( qint64  id,
qint64  folderId,
const QString &  title,
const QUrl &  url,
const QUrl &  link,
const QDateTime &  added,
uint  unreadCount,
Feed::FeedOrdering  ordering,
bool  pinned,
uint  updateErrorCount,
const QString &  lastUpdateError,
const QUrl &  faviconLink,
const QString &  folderName,
QObject *  parent = nullptr 
)

Constructs a new Feed object with the given arguments.

◆ ~Feed()

~Feed ( )
override

Deconstructs the Feed object.

Member Function Documentation

◆ added()

QDateTime added ( ) const

Returns the date and time the feed has been added.

See also
added

◆ addedChanged

void addedChanged ( const QDateTime &  added)
signal

This signal is emitted if the date and time changes the feed was added.

See also
added

◆ copy()

void copy ( Fuoten::BaseItem other)
overridevirtual

Makes a deep copy of other.

other has to be a Feed object.

Reimplemented from BaseItem.

◆ faviconLink()

QUrl faviconLink ( ) const

Returns the URL of the feed's favion.

See also
faviconLink

◆ faviconLinkChanged

void faviconLinkChanged ( const QUrl &  faviconLink)
signal

This signal is emitted if the URL to the favicon of this feed changes.

See also
favicon

◆ folderId()

qint64 folderId ( ) const

Return the ID of the Folder the feed belongs to.

See also
folderId

◆ folderIdChanged

void folderIdChanged ( qint64  folderId)
signal

This signal is emitted if the id of the Folder changes the feed belongs to.

See also
folderId

◆ folderName()

QString folderName ( ) const

Returns the name of the Folder the feed belongs to.

See also
folderName

◆ folderNameChanged

void folderNameChanged ( const QString &  folderName)
signal

This signal is emitted if the name of the Folder changes the feed belongs to.

See also
folderName

◆ lastUpdateError()

QString lastUpdateError ( ) const

Returns the message of the last update error.

See also
lastUpdateError

◆ lastUpdateErrorChanged

void lastUpdateErrorChanged ( const QString &  lastUpdateError)
signal

This signal is emitted if the message of the last update error changes.

See also
lastUpdateError

◆ link()

QUrl link ( ) const

Return the URL of the feed's homepage.

See also
link

◆ linkChanged

void linkChanged ( const QUrl &  link)
signal

This signal is emitted if the URL of the homepage of this feed changes.

See also
link

◆ markAsRead() [1/2]

void markAsRead ( Fuoten::AbstractConfiguration config,
Fuoten::AbstractStorage storage,
bool  enqueue = false 
)

Marks the complete feed as read on the remote server and local.

Parameters
configpointer to an AbstractConfiguration subclass to get the account configuration
storagepointer to an AbstractStorage subclass to query the newest item ID in the feed and update the local storage
enqueuetrue to enqueue the marking local up to the next sync, valid storage has to be available

◆ markAsRead() [2/2]

void markAsRead ( bool  enqueue = false)

Marks the complete feed as read on the remote server and local. 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()

◆ move() [1/2]

void move ( qint64  targetFolderId,
Fuoten::AbstractConfiguration config,
Fuoten::AbstractStorage storage = nullptr 
)

Moves this feed to a different folder on the remote server.

Will also move the feed in the local storage if a valid AbstractStorage object has been set.

Parameters
targetFolderIdID of the folder the feed should be moved to
configpointer to an AbstractConfiguration subclass to get the account configuration
storagepointer to an AbstractStorage subclass to move the feed in the local storage

◆ move() [2/2]

void move ( qint64  targetFolderId)

Moves this feed to a different folder 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()

◆ ordering()

FeedOrdering ordering ( ) const

Returns the ordering of the items in this feed on the server.

See also
ordering

◆ orderingChanged

void orderingChanged ( Fuoten::Feed::FeedOrdering  ordering)
signal

This signal is emitted if the server side ordering of this feed changes.

See also
ordering

◆ pinned()

bool pinned ( ) const

Returns true if this feed is pinned.

See also
pinned

◆ pinnedChanged

void pinnedChanged ( bool  pinned)
signal

This signal is emitted if the pinned status of the feed changes.

See also
pinned

◆ remove() [1/2]

void remove ( Fuoten::AbstractConfiguration config,
Fuoten::AbstractStorage storage = nullptr 
)

Removes this feed from the remote server.

Will also remove the feed from the local storage if a valid AbstractStorage object has been set.

Parameters
configpointer to an AbstractConfiguration subclass to get the account configuration
storagepointer to an AbstractStorage subclass to remove the feed from the local storage

◆ remove() [2/2]

void remove ( )

Removes this feed from 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()

◆ rename() [1/2]

void rename ( const QString &  newName,
Fuoten::AbstractConfiguration config,
Fuoten::AbstractStorage storage = nullptr 
)

Sets a new name for the feed on the remote server.

Will also rename the feed in the local storage if a valid AbstractStorage object has been set.

Parameters
newNamethe new name for the feed
configpointer to an AbstractConfiguration subclass to get the account configuration
storagepointer to an AbstractStorage subclass to rename the feed in the local storage

◆ rename() [2/2]

void rename ( const QString &  newName)

Sets a new name for the feed 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()

◆ setAdded()

void setAdded ( const QDateTime &  nAdded)

Sets the date and time the feed has been added.

See also
added

◆ setFaviconLink()

void setFaviconLink ( const QUrl &  nFaviconLink)

Sets the URL of the feed's favicon.

See also
faviconLink

◆ setFolderId()

void setFolderId ( qint64  nFolderId)

Sets the ID of the Folder the feed belongs to.

See also
folderId

◆ setFolderName()

void setFolderName ( const QString &  nFolderName)

Sets the name of the Folder the feed belongs to.

See also
folderName

◆ setLastUpdateError()

void setLastUpdateError ( const QString &  nLastUpdateError)

Sets the message of the last update error.

See also
lastUpdateError

◆ setLink()

void setLink ( const QUrl &  nLink)

Sets the URL to the feed's homepage.

See also
link

◆ setOrdering()

void setOrdering ( Fuoten::Feed::FeedOrdering  nOrdering)

Sets the ordering of the items in this feed on the server.

See also
ordering

◆ setPinned()

void setPinned ( bool  nPinned)

Set to true if this feed is pinned.

See also
pinned

◆ setTitle()

void setTitle ( const QString &  nTitle)

Sets the title of the feed.

See also
title

◆ setUnreadCount()

void setUnreadCount ( uint  nUnreadCount)

Sets the count of unread items in this feed.

See also
unreadCount

◆ setUpdateErrorCount()

void setUpdateErrorCount ( uint  nUpdateErrorCount)

Sets the count of update errors.

See also
updateErrorCount

◆ setUrl()

void setUrl ( const QUrl &  nUrl)

Sets the URL of the feed.

See also
url

◆ title()

QString title ( ) const

Returns the title of the feed.

See also
title

◆ titleChanged

void titleChanged ( const QString &  title)
signal

This signal is emitted if the feed's title changes.

See also
title

◆ unreadCount()

uint unreadCount ( ) const

Returns the count of unread items in this feed.

See also
unreadCount

◆ unreadCountChanged

void unreadCountChanged ( uint  unreadCount)
signal

This signal is emitted if the count of unread items/articles in this feed changes.

See also
unreadCount

◆ updateErrorCount()

uint updateErrorCount ( ) const

Returns the count of update errors.

See also
updateErrorCount

◆ updateErrorCountChanged

void updateErrorCountChanged ( uint  updateErrorCount)
signal

This signal is emitted if the count of update errors of this feed changes.

See also
updateErrorCount

◆ url()

QUrl url ( ) const

Returns the URL of the feed.

See also
url

◆ urlChanged

void urlChanged ( const QUrl &  url)
signal

This signal is emitted if the feed's URL changes.

See also
url