libfuoten 0.8.1
Qt based library to access the ownCloud/Nextcloud News App API
Loading...
Searching...
No Matches
AbstractFolderModel Class Reference

#include <Fuoten/Model/AbstractFolderModel>

Inheritance diagram for AbstractFolderModel:
BaseModel FolderListModel

Public Member Functions

 AbstractFolderModel (QObject *parent=nullptr)
 ~AbstractFolderModel () override
QModelIndex findByID (qint64 id) const override
Public Member Functions inherited from BaseModel
 BaseModel (QObject *parent=nullptr)
 ~BaseModel () override
double doubleParentId () const
virtual QHash< qint64, QModelIndex > findByIDs (const IdList &ids) const
bool inOperation () const
int limit () const
bool loaded () const
qint64 parentId () const
void setDoubleParentId (double nDoubleParentId)
void setLimit (int nLimit)
void setParentId (qint64 nParentId)
void setSortingRole (FuotenEnums::SortingRole nSortingRole)
void setSortOrder (Qt::SortOrder nSortOrder)
void setStorage (AbstractStorage *nStorage)
void setUnreadOnly (bool nUnreadOnly)
FuotenEnums::SortingRole sortingRole () const
Qt::SortOrder sortOrder () const
AbstractStoragestorage () const
bool unreadOnly () const

Public Slots

void load () override
Public Slots inherited from BaseModel
virtual void load ()=0
virtual void reload ()

Protected Slots

void feedCreated (qint64 feedId, qint64 folderId)
void feedMarkedRead (qint64 id)
void feedsRequested (const Fuoten::IdList &updatedFeeds, const Fuoten::IdList &newFeeds, const Fuoten::IdList &deletedFeeds)
void folderCreated (qint64 id, const QString &name)
void folderDeleted (qint64 id)
void folderMarkedRead (qint64 id, qint64 newestItem)
void folderRenamed (qint64 id, const QString &newName)
void foldersRequested (const QList< QPair< qint64, QString > > &updatedFolders, const QList< QPair< qint64, QString > > &newFolders, const Fuoten::IdList &deletedFolders)
void itemMarked (qint64 itemId, bool unread)
void updateCountValues ()

Protected Member Functions

void clear () override
QList< Folder * > folders () const
void handleStorageChanged (AbstractStorage *old) override
Protected Member Functions inherited from BaseModel
void setInOperation (bool nInOperation)
void setLoaded (bool loaded)

Additional Inherited Members

Properties inherited from BaseModel
double doubleParentId
bool inOperation
int limit
bool loaded
qint64 parentId
Fuoten::FuotenEnums::SortingRole sortingRole
Qt::SortOrder sortOrder
Fuoten::AbstractStoragestorage
bool unreadOnly
Signals inherited from BaseModel
void doubleParentIdChanged (double doubleParentId)
void inOperationChanged (bool inOperation)
void limitChanged (int limit)
void loadedChanged (bool loaded)
void parentIdChanged (qint64 parentId)
void sortingRoleChanged (FuotenEnums::SortingRole sortingRole)
void sortOrderChanged (Qt::SortOrder sortOrder)
void storageChanged (Fuoten::AbstractStorage *storage)
void unreadOnlyChanged (bool unreadOnly)

Detailed Description

Abstract folder model that provides basic functionalities for folder models.

Constructor & Destructor Documentation

◆ AbstractFolderModel()

AbstractFolderModel ( QObject * parent = nullptr)
explicit

Constructs a new empty abstract folder model with the given parent.

◆ ~AbstractFolderModel()

~AbstractFolderModel ( )
override

Destroys the AbstractFolderModel object.

Member Function Documentation

◆ clear()

void clear ( )
overrideprotectedvirtual

Clears the complete model and will destroy all Folder objects.

Implements BaseModel.

◆ feedCreated

void feedCreated ( qint64 feedId,
qint64 folderId )
protectedslot

Takes and processes data after a new feed has been created.

handleStorageChanged() will connect the AbstractStorage::createdFeed() signal to this slot.

◆ feedMarkedRead

void feedMarkedRead ( qint64 id)
protectedslot

Takes and processes data after a feed has been created.

handleStorageChanged() will connect the AbstractStorage::markedReadFeed() and AbstractStorage::markedReadFeedInQueue() signals to this slot.

◆ feedsRequested

void feedsRequested ( const Fuoten::IdList & updatedFeeds,
const Fuoten::IdList & newFeeds,
const Fuoten::IdList & deletedFeeds )
protectedslot

Takes and processes data after the feeds have been requeste from the server.

handleStorageChanged() will connect the AbstractStorage::requestedFeeds() signal to this slot.

◆ findByID()

QModelIndex findByID ( qint64 id) const
overridevirtual

Returns the model index of the folder identified by id.

Reimplemented from BaseModel.

◆ folderCreated

void folderCreated ( qint64 id,
const QString & name )
protectedslot

Takes and processes data after a folder has been created.

Will add the new folder to the model. handleStorageChanged() will connect AbstractStorage::createdFolder() to this slot.

◆ folderDeleted

void folderDeleted ( qint64 id)
protectedslot

Takes and processes data after a folder has been delted.

Will delete the folder identified by id from the model. handleStorageChanged() will connect AbstractStorage::deletedFolder() to this slot.

◆ folderMarkedRead

void folderMarkedRead ( qint64 id,
qint64 newestItem )
protectedslot

Takes and processes data after a folder has been marked as read.

Will set the unreadCount of the folder identified by id to 0. handleStorageChanged() will connect the AbstractStorage::markedReadFolder() and AbstractStorage::markedReadFolderInQueue() signals to this slot.

◆ folderRenamed

void folderRenamed ( qint64 id,
const QString & newName )
protectedslot

Takes and processes data after a folder has been renamed.

handleStorageChanged() will connect AbstractStorage::renamedFolder() signal to this slot.

◆ folders()

QList< Folder * > folders ( ) const
protected

Returns the list of Folder objects in the model.

◆ foldersRequested

void foldersRequested ( const QList< QPair< qint64, QString > > & updatedFolders,
const QList< QPair< qint64, QString > > & newFolders,
const Fuoten::IdList & deletedFolders )
protectedslot

Takes and processes data after folders have been requested.

handleStorageChanged() will connect AbstractStorage::requestedFolders() signal to this slot.

◆ handleStorageChanged()

void handleStorageChanged ( Fuoten::AbstractStorage * old)
overrideprotectedvirtual

Connetcs the folder related signals of AbstractStorage to the model's slots.

Reimplemented from BaseModel.

◆ itemMarked

void itemMarked ( qint64 itemId,
bool unread )
protectedslot

Takes and processes data after an item/article has been marked as read.

handleStorageChanged() will connnect the AbstractStorage::markedItem() signal to this slot.

Parameters
itemIdID of the item/article that has been marked as read or unread
unreadtrue if the article has been marked as unread, false if it has been marked as read

◆ load

void load ( )
overrideslot

Populates the mode with data from the local storage.

Uses AbstractStorage::getFolders() to get Folder objects from the local storage that will be added to the model.

◆ updateCountValues

void updateCountValues ( )
protectedslot