libfuoten  0.8.2
Qt based library to access the Nextcloud News App API.
Properties | Public Member Functions | Signals | List of all members
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. More...
 
QString name
 The name of the folder. More...
 
uint unreadCount
 Returns the number of unread items in this folder. 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

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

Property Documentation

◆ feedCount

uint 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 Folder::name
read

The name of the folder.

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

◆ unreadCount

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

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

◆ name()

QString Fuoten::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 ( 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.

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

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

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

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