libfuoten 0.8.2
Qt based library to access the Nextcloud News App API.
Loading...
Searching...
No Matches
Fuoten::Feed Class Reference

Contains information about a single feed. More...

#include <Fuoten/Feed>

Inheritance diagram for Fuoten::Feed:
Fuoten::BaseItem QObject

Public Types

enum  FeedOrdering : quint8 { NoSpecial = 0 , OldestFirst = 1 , NewestFirst = 2 }
 Type of the article ordering in this feed on the server. More...

Properties

QDateTime added
 Date and time the feed has been added.
QUrl faviconLink
 The URL to the feed's favicon.
qint64 folderId
 The ID of the folder, the feed belongs to.
QString folderName
 The name of the folder the feed belongs to.
QString lastUpdateError
 Contains the last update error message, if any.
QUrl link
 Link to the homepage of the feed.
Fuoten::Feed::FeedOrdering ordering
 The ordering of the articles in this feed on the server.
bool pinned
 True if the feed is pinned.
QString title
 The title of the feed.
uint unreadCount
 The number of unread items in this feed.
uint updateErrorCount
 Indicating that the feed has faild to update that many times.
QUrl url
 The URL of the feed.
Properties inherited from Fuoten::BaseItem
Fuoten::Errorerror
 Pointer to an Error object, if an error occurred, otherwise returns a nullptr.
qint64 id
 Database ID of the Article, Feed or Folder.
bool inOperation
 Returns true while there is an operation running on the item.

Public Member Functions

 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 (QObject *parent=nullptr)
 Constructs a new empty Feed object with the given parent.
 ~Feed () override
 Deconstructs the Feed object.
QDateTime added () const
 Returns the date and time the feed has been added.
void copy (BaseItem *other) override
 Makes a deep copy of other.
QUrl faviconLink () const
 Returns the URL of the feed's favion.
qint64 folderId () const
 Return the ID of the Folder the feed belongs to.
QString folderName () const
 Returns the name of the Folder the feed belongs to.
QString lastUpdateError () const
 Returns the message of the last update error.
QUrl link () const
 Return the URL of the feed's homepage.
Q_INVOKABLE 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().
Q_INVOKABLE void markAsRead (Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage, bool enqueue=false)
 Marks the complete feed as read on the remote server and local.
Q_INVOKABLE 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().
Q_INVOKABLE void move (qint64 targetFolderId, Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage=nullptr)
 Moves this feed to a different folder on the remote server.
FeedOrdering ordering () const
 Returns the ordering of the items in this feed on the server.
bool pinned () const
 Returns true if this feed is pinned.
Q_INVOKABLE 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().
Q_INVOKABLE void remove (Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage=nullptr)
 Removes this feed from the remote server.
Q_INVOKABLE 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().
Q_INVOKABLE void rename (const QString &newName, Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage=nullptr)
 Sets a new name for the feed on the remote server.
void setAdded (const QDateTime &nAdded)
 Sets the date and time the feed has been added.
void setFaviconLink (const QUrl &nFaviconLink)
 Sets the URL of the feed's favicon.
void setFolderId (qint64 nFolderId)
 Sets the ID of the Folder the feed belongs to.
void setFolderName (const QString &nFolderName)
 Sets the name of the Folder the feed belongs to.
void setLastUpdateError (const QString &nLastUpdateError)
 Sets the message of the last update error.
void setLink (const QUrl &nLink)
 Sets the URL to the feed's homepage.
void setOrdering (Fuoten::Feed::FeedOrdering nOrdering)
 Sets the ordering of the items in this feed on the server.
void setPinned (bool nPinned)
 Set to true if this feed is pinned.
void setTitle (const QString &nTitle)
 Sets the title of the feed.
void setUnreadCount (uint nUnreadCount)
 Sets the count of unread items in this feed.
void setUpdateErrorCount (uint nUpdateErrorCount)
 Sets the count of update errors.
void setUrl (const QUrl &nUrl)
 Sets the URL of the feed.
QString title () const
 Returns the title of the feed.
uint unreadCount () const
 Returns the count of unread items in this feed.
uint updateErrorCount () const
 Returns the count of update errors.
QUrl url () const
 Returns the URL of the feed.
Public Member Functions inherited from Fuoten::BaseItem
 BaseItem (QObject *parent=nullptr)
 Constructs an empty base item with the given parent.
 ~BaseItem () override
 Deconstructs the base item.
Q_INVOKABLE void clearError ()
 Removes the current Error object and sets a nullptr.
Errorerror () const
 Returns a pointer to an Error object, if any error occurred, otherwise a nullptr.
qint64 id () const
 Returns the ID of the item.
bool inOperation () const
 Returns true while there is some operation ongoing directly on the item.
void setId (qint64 nId)
 Sets the database ID of the item/feed/folder.

Signals

void addedChanged (const QDateTime &added)
 This signal is emitted if the date and time changes the feed was added.
void faviconLinkChanged (const QUrl &faviconLink)
 This signal is emitted if the URL to the favicon of this feed changes.
void folderIdChanged (qint64 folderId)
 This signal is emitted if the id of the Folder changes the feed belongs to.
void folderNameChanged (const QString &folderName)
 This signal is emitted if the name of the Folder changes the feed belongs to.
void lastUpdateErrorChanged (const QString &lastUpdateError)
 This signal is emitted if the message of the last update error changes.
void linkChanged (const QUrl &link)
 This signal is emitted if the URL of the homepage of this feed changes.
void orderingChanged (Fuoten::Feed::FeedOrdering ordering)
 This signal is emitted if the server side ordering of this feed changes.
void pinnedChanged (bool pinned)
 This signal is emitted if the pinned status of the feed changes.
void titleChanged (const QString &title)
 This signal is emitted if the feed's title changes.
void unreadCountChanged (uint unreadCount)
 This signal is emitted if the count of unread items/articles in this feed changes.
void updateErrorCountChanged (uint updateErrorCount)
 This signal is emitted if the count of update errors of this feed changes.
void urlChanged (const QUrl &url)
 This signal is emitted if the feed's URL changes.
Signals inherited from Fuoten::BaseItem
void errorChanged (Fuoten::Error *error)
 This signal will be emitted whenever the error property changes. May return a nullptr.
void idChanged (qint64 id)
 This signal will be emitted whenever the id property changes.
void inOperationChanged (bool inOperation)
 This signal will be emitted whenever the inOperation property changes.

Additional Inherited Members

Protected Member Functions inherited from Fuoten::BaseItem
Componentcomponent () const
 Returns the pointer to the currently active Component.
void setComponent (Component *nComp)
 Sets the API component to perform an internal API request.
void setError (Error *nError)
 Sets the Error object of the error property.

Detailed Description

Contains information about a single feed.

Member Enumeration Documentation

◆ FeedOrdering

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 Fuoten::Feed::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 Fuoten::Feed::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 Fuoten::Feed::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 Fuoten::Feed::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 Fuoten::Feed::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 Fuoten::Feed::link
readwrite

Link to the homepage of the feed.

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

◆ ordering

Fuoten::Feed::FeedOrdering Fuoten::Feed::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 Fuoten::Feed::pinned
readwrite

True if the feed is pinned.

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

◆ title

QString Fuoten::Feed::title
readwrite

The title of the feed.

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

◆ unreadCount

uint Fuoten::Feed::unreadCount
readwrite

The number of unread items in this feed.

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

◆ updateErrorCount

uint Fuoten::Feed::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 Fuoten::Feed::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::Feed ( QObject * parent = nullptr)
explicit

Constructs a new empty Feed object with the given parent.

◆ Feed() [2/2]

Feed::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::~Feed ( )
override

Deconstructs the Feed object.

Member Function Documentation

◆ added()

QDateTime Feed::added ( ) const

Returns the date and time the feed has been added.

See also
added

◆ addedChanged

void Fuoten::Feed::addedChanged ( const QDateTime & added)
signal

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

See also
added

◆ copy()

void Feed::copy ( Fuoten::BaseItem * other)
overridevirtual

Makes a deep copy of other.

other has to be a Feed object.

Reimplemented from Fuoten::BaseItem.

◆ faviconLink()

QUrl Feed::faviconLink ( ) const

Returns the URL of the feed's favion.

See also
faviconLink

◆ faviconLinkChanged

void Fuoten::Feed::faviconLinkChanged ( const QUrl & faviconLink)
signal

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

See also
favicon

◆ folderId()

qint64 Feed::folderId ( ) const

Return the ID of the Folder the feed belongs to.

See also
folderId

◆ folderIdChanged

void Fuoten::Feed::folderIdChanged ( qint64 folderId)
signal

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

See also
folderId

◆ folderName()

QString Feed::folderName ( ) const

Returns the name of the Folder the feed belongs to.

See also
folderName

◆ folderNameChanged

void Fuoten::Feed::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 Feed::lastUpdateError ( ) const

Returns the message of the last update error.

See also
lastUpdateError

◆ lastUpdateErrorChanged

void Fuoten::Feed::lastUpdateErrorChanged ( const QString & lastUpdateError)
signal

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

See also
lastUpdateError

◆ link()

QUrl Feed::link ( ) const

Return the URL of the feed's homepage.

See also
link

◆ linkChanged

void Fuoten::Feed::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 Feed::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().

◆ markAsRead() [2/2]

void Feed::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

◆ move() [1/2]

void Feed::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().

◆ move() [2/2]

void Feed::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

◆ ordering()

Feed::FeedOrdering Feed::ordering ( ) const

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

See also
ordering

◆ orderingChanged

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

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

See also
ordering

◆ pinned()

bool Feed::pinned ( ) const

Returns true if this feed is pinned.

See also
pinned

◆ pinnedChanged

void Fuoten::Feed::pinnedChanged ( bool pinned)
signal

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

See also
pinned

◆ remove() [1/2]

void Feed::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().

◆ remove() [2/2]

void Feed::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

◆ rename() [1/2]

void Feed::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().

◆ rename() [2/2]

void Feed::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

◆ setAdded()

void Feed::setAdded ( const QDateTime & nAdded)

Sets the date and time the feed has been added.

See also
added

◆ setFaviconLink()

void Feed::setFaviconLink ( const QUrl & nFaviconLink)

Sets the URL of the feed's favicon.

See also
faviconLink

◆ setFolderId()

void Feed::setFolderId ( qint64 nFolderId)

Sets the ID of the Folder the feed belongs to.

See also
folderId

◆ setFolderName()

void Feed::setFolderName ( const QString & nFolderName)

Sets the name of the Folder the feed belongs to.

See also
folderName

◆ setLastUpdateError()

void Feed::setLastUpdateError ( const QString & nLastUpdateError)

Sets the message of the last update error.

See also
lastUpdateError

◆ setLink()

void Feed::setLink ( const QUrl & nLink)

Sets the URL to the feed's homepage.

See also
link

◆ setOrdering()

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

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

See also
ordering

◆ setPinned()

void Feed::setPinned ( bool nPinned)

Set to true if this feed is pinned.

See also
pinned

◆ setTitle()

void Feed::setTitle ( const QString & nTitle)

Sets the title of the feed.

See also
title

◆ setUnreadCount()

void Feed::setUnreadCount ( uint nUnreadCount)

Sets the count of unread items in this feed.

See also
unreadCount

◆ setUpdateErrorCount()

void Feed::setUpdateErrorCount ( uint nUpdateErrorCount)

Sets the count of update errors.

See also
updateErrorCount

◆ setUrl()

void Feed::setUrl ( const QUrl & nUrl)

Sets the URL of the feed.

See also
url

◆ title()

QString Feed::title ( ) const

Returns the title of the feed.

See also
title

◆ titleChanged

void Fuoten::Feed::titleChanged ( const QString & title)
signal

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

See also
title

◆ unreadCount()

uint Feed::unreadCount ( ) const

Returns the count of unread items in this feed.

See also
unreadCount

◆ unreadCountChanged

void Fuoten::Feed::unreadCountChanged ( uint unreadCount)
signal

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

See also
unreadCount

◆ updateErrorCount()

uint Feed::updateErrorCount ( ) const

Returns the count of update errors.

See also
updateErrorCount

◆ updateErrorCountChanged

void Fuoten::Feed::updateErrorCountChanged ( uint updateErrorCount)
signal

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

See also
updateErrorCount

◆ url()

QUrl Feed::url ( ) const

Returns the URL of the feed.

See also
url

◆ urlChanged

void Fuoten::Feed::urlChanged ( const QUrl & url)
signal

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

See also
url

The documentation for this class was generated from the following files:
  • Fuoten/feed.h
  • build/Fuoten/FuotenQt5_autogen/include/moc_feed.cpp
  • Fuoten/feed.cpp