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

Contains information about a single folder. More...

#include <Fuoten/Folder>

Inheritance diagram for Fuoten::Folder:
Fuoten::BaseItem QObject

Properties

uint feedCount
 Returns the number of feeds conained in this folder.
QString name
 The name of the folder.
uint unreadCount
 Returns the number of unread items in this folder.
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

 Folder (qint64 id, const QString &name, uint feedCount, uint unreadCount, QObject *parent=nullptr)
 Constructs a new Folder object from the given arguments.
 Folder (QObject *parent=nullptr)
 Constructs a new empty Folder object with the given parent.
 ~Folder () override
 Deconstructs the Folder object.
void copy (BaseItem *other) override
 Makes a deep copy of other.
uint feedCount () const
 Returns the number of feeds contained in this folder.
Q_INVOKABLE void markAsRead (bool enqueue=false)
 Marks the complete folder 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 folder as read on the remote server and local.
QString name () const
 Returns the name of the folder.
Q_INVOKABLE void remove ()
 Removes this folder 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 folder from the remote server.
Q_INVOKABLE void rename (const QString &newName)
 Sets a new name for the 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 rename (const QString &newName, Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage=nullptr)
 Sets a new name for the folder on the remote server.
void setFeedCount (uint nFeedCount)
 Sets the number of feeds the folder contains.
void setName (const QString &nName)
 Sets the name of the folder.
void setUnreadCount (uint nUnreadCount)
 Sets the number of unread items in this folder.
uint unreadCount () const
 Returns the number of unread items in this folder.
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 feedCountChanged (uint feedCount)
 This signal will be emitted if the number of feeds in the folder changes.
void nameChanged (const QString &name)
 This signal will be emitted if the folder name changes.
void unreadCountChanged (uint unreadCount)
 This signal will be emitted if the number of unread items in the folder 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 folder.

Property Documentation

◆ feedCount

uint Fuoten::Folder::feedCount
read

Returns the number of feeds conained in this folder.

Access functions:
uintfeedCount() const
Notifier signal:
voidfeedCountChanged(uint feedCount)
See also
setFeedCount()

◆ name

QString Fuoten::Folder::name
read

The name of the folder.

Access functions:
QStringname() const
Notifier signal:
voidnameChanged(const QString &name)
See also
setName()

◆ unreadCount

uint Fuoten::Folder::unreadCount
read

Returns the number of unread items in this folder.

Access functions:
uintunreadCount() const
Notifier signal:
voidunreadCountChanged(uint unreadCount)
See also
setUnreadCount()

Constructor & Destructor Documentation

◆ Folder() [1/2]

Folder::Folder ( QObject * parent = nullptr)
explicit

Constructs a new empty Folder object with the given parent.

◆ ~Folder()

Folder::~Folder ( )
override

Deconstructs the Folder object.

◆ Folder() [2/2]

Folder::Folder ( qint64 id,
const QString & name,
uint feedCount,
uint unreadCount,
QObject * parent = nullptr )

Constructs a new Folder object from the given arguments.

Member Function Documentation

◆ copy()

void Folder::copy ( BaseItem * other)
overridevirtual

Makes a deep copy of other.

other has to be a Folder object.

Reimplemented from Fuoten::BaseItem.

◆ feedCount()

uint Folder::feedCount ( ) const

Returns the number of feeds contained in this folder.

See also
Folder::feedCount

◆ feedCountChanged

void Fuoten::Folder::feedCountChanged ( uint feedCount)
signal

This signal will be emitted if the number of feeds in the folder changes.

See also
Folder::feedCount

◆ markAsRead() [1/2]

void Folder::markAsRead ( bool enqueue = false)

Marks the complete folder 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 Folder::markAsRead ( Fuoten::AbstractConfiguration * config,
Fuoten::AbstractStorage * storage,
bool enqueue = false )

Marks the complete folder 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 folder and update the local storage
enqueuetrue to enqueue the marking local up to the next sync, valid storage has to be available

◆ name()

QString Folder::name ( ) const

Returns the name of the folder.

See also
Folder::name

◆ nameChanged

void Fuoten::Folder::nameChanged ( const QString & name)
signal

This signal will be emitted if the folder name changes.

See also
Folder::name

◆ remove() [1/2]

void Folder::remove ( )

Removes this folder 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 Folder::remove ( Fuoten::AbstractConfiguration * config,
Fuoten::AbstractStorage * storage = nullptr )

Removes this folder from the remote server.

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

This function is invokable from QML.

◆ rename() [1/2]

void Folder::rename ( const QString & newName)

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

◆ rename() [2/2]

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

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

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

This function is invokable from QML.

◆ setFeedCount()

void Folder::setFeedCount ( uint nFeedCount)

Sets the number of feeds the folder contains.

See also
feedCount

◆ setName()

void Folder::setName ( const QString & nName)

Sets the name of the folder.

See also
name

◆ setUnreadCount()

void Folder::setUnreadCount ( uint nUnreadCount)

Sets the number of unread items in this folder.

See also
unreadCount

◆ unreadCount()

uint Folder::unreadCount ( ) const

Returns the number of unread items in this folder.

See also
Folder::unreadCount

◆ unreadCountChanged

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

This signal will be emitted if the number of unread items in the folder changes.

See also
Folder:unreadCount

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