libfuoten  0.8.2
Qt based library to access the Nextcloud News App API.
Public Types | Properties | Public Member Functions | Signals | List of all members
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. More...
 
QUrl faviconLink
 The URL to the feed's favicon. More...
 
qint64 folderId
 The ID of the folder, the feed belongs to. More...
 
QString folderName
 The name of the folder the feed belongs to. More...
 
QString lastUpdateError
 Contains the last update error message, if any. More...
 
QUrl link
 Link to the homepage of the feed. More...
 
Fuoten::Feed::FeedOrdering ordering
 The ordering of the articles in this feed on the server. More...
 
bool pinned
 True if the feed is pinned. More...
 
QString title
 The title of the feed. More...
 
uint unreadCount
 The number of unread items in this feed. More...
 
uint updateErrorCount
 Indicating that the feed has faild to update that many times. More...
 
QUrl url
 The URL of the feed. More...
 
- Properties inherited from Fuoten::BaseItem
Fuoten::Error error
 Pointer to an Error object, if an error occurred, otherwise returns a nullptr. More...
 
qint64 id
 Database ID of the Article, Feed or Folder. More...
 
bool inOperation
 Returns true while there is an operation running on the item. More...
 

Public Member Functions

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

Signals

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

Additional Inherited Members

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

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 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 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 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 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 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 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

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

True if the feed is pinned.

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

◆ title

QString Feed::title
readwrite

The title of the feed.

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

◆ unreadCount

uint 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 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 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 Fuoten::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 Fuoten::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 Fuoten::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 Fuoten::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 Fuoten::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 Fuoten::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 ( 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 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()

◆ move() [1/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

◆ move() [2/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()

◆ ordering()

FeedOrdering Fuoten::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 Fuoten::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 ( 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 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()

◆ rename() [1/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

◆ rename() [2/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()

◆ 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 Fuoten::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 Fuoten::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 Fuoten::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 Fuoten::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: