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

#include <Fuoten/Folder>

Inheritance diagram for Folder:
BaseItem

Properties

uint feedCount
 
QString name
 
uint unreadCount
 
- Properties inherited from BaseItem
Fuoten::Error error
 
qint64 id
 
bool inOperation
 

Public Member Functions

 Folder (QObject *parent=nullptr)
 
 Folder (qint64 id, const QString &name, uint feedCount, uint unreadCount, QObject *parent=nullptr)
 
 ~Folder () override
 
void copy (BaseItem *other) override
 
uint feedCount () const
 
Q_INVOKABLE void markAsRead (Fuoten::AbstractConfiguration *config, Fuoten::AbstractStorage *storage, bool enqueue=false)
 
Q_INVOKABLE void markAsRead (bool enqueue=false)
 
QString name () 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 setFeedCount (uint nFeedCount)
 
void setName (const QString &nName)
 
void setUnreadCount (uint nUnreadCount)
 
uint unreadCount () 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 feedCountChanged (uint feedCount)
 
void nameChanged (const QString &name)
 
void unreadCountChanged (uint unreadCount)
 
- 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 folder.

Property Documentation

◆ feedCount

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

The name of the folder.

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

◆ unreadCount

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

Constructs a new empty Folder object with the given parent.

◆ ~Folder()

~Folder ( )
override

Deconstructs the Folder object.

◆ Folder() [2/2]

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 copy ( BaseItem other)
overridevirtual

Makes a deep copy of other.

other has to be a Folder object.

Reimplemented from BaseItem.

◆ feedCount()

uint feedCount ( ) const

Returns the number of feeds contained in this folder.

See also
Folder::feedCount

◆ feedCountChanged

void 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 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 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 name ( ) const

Returns the name of the folder.

See also
Folder::name

◆ nameChanged

void nameChanged ( const QString &  name)
signal

This signal will be emitted if the folder name changes.

See also
Folder::name

◆ remove() [1/2]

void 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 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 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 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 setFeedCount ( uint  nFeedCount)

Sets the number of feeds the folder contains.

See also
feedCount

◆ setName()

void setName ( const QString &  nName)

Sets the name of the folder.

See also
name

◆ setUnreadCount()

void setUnreadCount ( uint  nUnreadCount)

Sets the number of unread items in this folder.

See also
unreadCount

◆ unreadCount()

uint unreadCount ( ) const

Returns the number of unread items in this folder.

See also
Folder::unreadCount

◆ unreadCountChanged

void unreadCountChanged ( uint  unreadCount)
signal

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

See also
Folder:unreadCount