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

List model containing Article objects. More...

#include <Fuoten/Models/ArticleListModel>

Inheritance diagram for Fuoten::ArticleListModel:
Fuoten::AbstractArticleModel Fuoten::BaseModel QAbstractItemModel QObject

Public Member Functions

 ArticleListModel (QObject *parent=nullptr)
 Constructs a new empty ArticleListModel object with the given parent.
 ~ArticleListModel () override
 Destroys the ArticleListModel object.
Public Member Functions inherited from Fuoten::AbstractArticleModel
 AbstractArticleModel (QObject *parent=nullptr)
 Constructs a new empty abstract Article model with the given parent.
 ~AbstractArticleModel () override
 Destroys the AbstractArticleModel object.
int bodyLimit () const
 Getter function for the bodyLimit property.
QModelIndex findByID (qint64 id) const override
 Returns the model index of the Article identified by id. Returns an invalid index if the ID could not be found in the mode.
QHash< qint64, QModelIndexfindByIDs (const IdList &ids) const override
 Returns IDs and model indices of the Article objects in the model identified by their ID in ids.
FuotenEnums::Type parentIdType () const
 Getter function for the parentIdType property.
void setBodyLimit (int nBodyLimit)
 Setter function for the bodyLimit property. Emits the bodyLimitChanged() signal if nBodyLimit is not equal to the stored value.
void setParentIdType (FuotenEnums::Type nParentIdType)
 Setter function for the parentIdType property. Emits the parentIdTypeChanged() signal if nParentIdType is not equal to the stored value.
void setStarredOnly (bool nStarredOnly)
 Setter function for the starredOnly property. Emits the starredOnlyChanged() signal if nStarredOnly is not equal to the stored value.
bool starredOnly () const
 Getter function for the starredOnly property.
Public Member Functions inherited from Fuoten::BaseModel
 BaseModel (QObject *parent=nullptr)
 Constructs a new BaseModel object.
 ~BaseModel () override
 Deconstructs the BaseModel object.
double doubleParentId () const
 Returns the currently set parent ID as double. This function is for use in QML, that does not support 64bit integers. It performs a static cast from the saved qint64 parent ID to double.
bool inOperation () const
 Returns true while the model is loading data.
int limit () const
 Getter function for the limit property.
bool loaded () const
 Getter function for the loaded property. *.
qint64 parentId () const
 Returns the currently set parent ID.
void setDoubleParentId (double nDoubleParentId)
 Sets the parent ID via a double. This function is for use in QML, that does not support 64bit integers. It performs a static cast from the double to a qint64 to save it.
void setLimit (int nLimit)
 Setter function for the limit property. Emits the limitChanged() signal if nLimit is not equal to the stored value.
void setParentId (qint64 nParentId)
 Set the parent ID.
void setSortingRole (FuotenEnums::SortingRole nSortingRole)
 Setter function for the sortingRole property. Emits the sortingRoleChanged() signal if nSortingRole is not equal to the stored value.
void setSortOrder (Qt::SortOrder nSortOrder)
 Setter function for the sortOrder property. Emits the sortOrderChanged() signal if nSortOrder is not equal to the stored value.
void setStorage (AbstractStorage *nStorage)
 Sets the pointer to the local storage handler.
void setUnreadOnly (bool nUnreadOnly)
 Setter function for the unreadOnly property. Emits the unreadOnlyChanged() signal if nUnreadOnly is not equal to the stored value.
FuotenEnums::SortingRole sortingRole () const
 Getter function for the sortingRole property.
Qt::SortOrder sortOrder () const
 Getter function for the sortOrder property.
AbstractStoragestorage () const
 Returns the pointer to the currently set local storage.
bool unreadOnly () const
 Getter function for the unreadOnly property.

Additional Inherited Members

Properties inherited from Fuoten::AbstractArticleModel
int bodyLimit
 Limits the size of the body text in number of characters.
Fuoten::FuotenEnums::Type parentIdType
 Defines the type of the parentId. Can be Feed, Folder or All.
bool starredOnly
 If true, only starred articles will be returned.
Properties inherited from Fuoten::BaseModel
double doubleParentId
 Stores the parent ID as double to make it accesseable from QML.
bool inOperation
 Returns true while the model is loading data.
int limit
 Limits the result to the specified number of objects.
bool loaded
 This property holds true if the model has initially loaded the data.
qint64 parentId
 Sets the parent database ID to load feeds/items for.
Fuoten::FuotenEnums::SortingRole sortingRole
 The role/value used to sort the result.
Qt::SortOrder sortOrder
 The sorting order.
Fuoten::AbstractStoragestorage
 Pointer to a class derived from AbstractStorage.
bool unreadOnly
 If true, only unread articles, feeds or folders are returned.
Public Slots inherited from Fuoten::AbstractArticleModel
void load () override
 Populates the model with data from the local storage.
Public Slots inherited from Fuoten::BaseModel
virtual void load ()=0
 Loads the model data.
virtual void reload ()
 Reloads the complete model.
Signals inherited from Fuoten::AbstractArticleModel
void bodyLimitChanged (int bodyLimit)
 This is emitted if the value of the bodyLimit property changes.
void parentIdTypeChanged (FuotenEnums::Type parentIdType)
 This is emitted if the value of the parentIdType property changes.
void starredOnlyChanged (bool starredOnly)
 This is emitted if the value of the starredOnly property changes.
Signals inherited from Fuoten::BaseModel
void doubleParentIdChanged (double doubleParentId)
 This signal is emitted if the parent ID changes.
void inOperationChanged (bool inOperation)
 This signal is emitted if the operational state of the model changes.
void limitChanged (int limit)
 This is emitted if the value of the limit property changes.
void loadedChanged (bool loaded)
 This is emitted if the value of the loaded property changes.
void parentIdChanged (qint64 parentId)
 This signal is emitted if the parent ID changes.
void sortingRoleChanged (FuotenEnums::SortingRole sortingRole)
 This is emitted if the value of the sortingRole property changes.
void sortOrderChanged (Qt::SortOrder sortOrder)
 This is emitted if the value of the sortOrder property changes.
void storageChanged (Fuoten::AbstractStorage *storage)
 This signal is emitted if the poiner to the local storage changes.
void unreadOnlyChanged (bool unreadOnly)
 This is emitted if the value of the unreadOnly property changes.
Protected Slots inherited from Fuoten::AbstractArticleModel
void allItemsMarkedRead (qint64 newestItemId)
 Takes and processes data after all items/articles have been marked as read.
void allItemsMarkedReadInQueue ()
 Takes and processes data after all items/articles have been marked as read in local queue.
void feedDeleted (qint64 feedId)
 Takes and processes data after a feed has been deleted.
void feedMarkedRead (qint64 feedId, qint64 newestItemId)
 Takes and processes data after a feed has been marked as read.
void feedMarkedReadInQueue (qint64 feedId, qint64 newestItemId)
 Takes and processes data after a feeds has been marked as read in local queue.
void folderDeleted (qint64 folderId)
 Takes and processes data after a folder has been deleted.
void folderMarkedRead (qint64 folderId, qint64 newestItemId)
 Takes and processses data after a folder has been marked as read.
void folderMarkedReadInQueue (qint64 folderId, qint64 newestItemId)
 Takes and processses data after a folder has been marked as read in the queue.
void itemMarked (qint64 itemId, bool unread)
 Takes and processes data after an item/article has been marked as read/unread.
void itemsMarked (const Fuoten::IdList &itemIds, bool unread)
 Takes and processes data after a list of items/articles has been marked as read/unread.
void itemsRequested (const Fuoten::IdList &updatedItems, const Fuoten::IdList &newItems, const Fuoten::IdList &deletedItems)
 Takes and processes data after items/articles have been requested.
void itemsStarred (const QList< QPair< qint64, QString > > &articles, bool starred)
 Takes and processes data after a list of items/articles has been starred/unstarred.
void itemStarred (qint64 feedId, const QString &guidHash, bool starred)
 Takes and processes data after an item/article has been starred/unstarred.
void queueCleared ()
 Updates the model after the local queue has been cleared.
Protected Member Functions inherited from Fuoten::AbstractArticleModel
QList< Article * > articles () const
 Returns the list of Article objects in the model.
void clear () override
 Clears the model and destroy all Article objects.
void handleStorageChanged (AbstractStorage *old) override
 Connets the article related signals of AbstractStorage to the model's slots.
Protected Member Functions inherited from Fuoten::BaseModel
void setInOperation (bool nInOperation)
 Sets the inOperation property.
void setLoaded (bool loaded)
 Set this to true if the model has initially loaded its data.

Detailed Description

List model containing Article objects.

List model with one column that contains a pointer to an Article object. The Qt::DisplayRole (display in QML) returns the pointer. To use this model, you need an AbstractStorage derived class that has to be set to the BaseModel::storage property.

Constructor & Destructor Documentation

◆ ArticleListModel()

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

Constructs a new empty ArticleListModel object with the given parent.

◆ ~ArticleListModel()

ArticleListModel::~ArticleListModel ( )
override

Destroys the ArticleListModel object.


The documentation for this class was generated from the following files:
  • Fuoten/Models/articlelistmodel.h
  • Fuoten/Models/articlelistmodel.cpp