libfuoten  0.8.2
Qt based library to access the Nextcloud News App API.
Properties | Public Member Functions | Signals | Protected Member Functions | List of all members
Fuoten::BaseFilterModel Class Referenceabstract

Abstract base filter model for other filter models. More...

#include <Fuoten/Model/BaseFilterModel>

Inheritance diagram for Fuoten::BaseFilterModel:
QSortFilterProxyModel QAbstractProxyModel QAbstractItemModel QObject Fuoten::ArticleListFilterModel Fuoten::FeedListFilterModel Fuoten::FolderListFilterModel

Properties

double doubleParentId
 Stores the parent ID as double to make it accesseable from QML. More...
 
bool hideRead
 When true, items with no unread items will be hidden. More...
 
bool inOperation
 Returns true while the underlying BaseModel is initially loading data. More...
 
bool loaded
 This property holds true after the source model has initially loaded its data. More...
 
qint64 parentId
 Sets the parentId property of the underlying BaseModel. More...
 
QString search
 Search string to filter the model for. More...
 
Fuoten::FuotenEnums::SortingRole sortingRole
 The property the model items should be sorted by. More...
 
Qt::SortOrder sortOrder
 Defines the sort order. More...
 
Fuoten::AbstractStorage storage
 Pointer to the AbstractStorage object of the underlying BaseModel. More...
 

Public Member Functions

 BaseFilterModel (QObject *parent=nullptr)
 Constructs a new base filter model with the given parent. More...
 
 ~BaseFilterModel () override
 Deconstructs the BaseFilterModel object. More...
 
double doubleParentId () const
 Getter function for the doubleParentId property. More...
 
bool hideRead () const
 Returns true if model items with no unread items or unread articles should be hidden. More...
 
virtual bool inOperation () const =0
 Returns true while the underlying model is in operational mode. More...
 
virtual Q_INVOKABLE void load (const QString &locale=QString())=0
 Loads the data in the underlying model. More...
 
virtual bool loaded () const =0
 Returns true if the source model has initially loaded its data. More...
 
virtual qint64 parentId () const =0
 Returns the parent ID that is currently set to the underlyiing model. Reimplement this in a derived class. More...
 
virtual Q_INVOKABLE void reload (const QString &locale=QString())=0
 Reloads the complete underlying model. More...
 
QString search () const
 Returns the currently set serach string. More...
 
void setDoubleParentId (double nDoubleParentId)
 Setter function for the doubleParentId property. More...
 
void setHideRead (bool nHideRead)
 Set this to true to hide items with no unread content or read articles. More...
 
virtual void setParentId (qint64 nParentId)=0
 Sets the parent ID for the underlying model. More...
 
void setSearch (const QString &nSearch)
 Sets the search string. More...
 
virtual void setSortingRole (FuotenEnums::SortingRole nSortingRole)
 Sets the sorting role. More...
 
virtual void setSortOrder (Qt::SortOrder nSortOrder)
 Sets the sort order. More...
 
virtual void setStorage (AbstractStorage *nStorage)=0
 Sets the local storage handler for the underlying model. More...
 
virtual FuotenEnums::SortingRole sortingRole () const
 Returns the currently set sorting role. More...
 
virtual Qt::SortOrder sortOrder () const
 Returns the currently set sort order. More...
 
virtual AbstractStoragestorage () const =0
 Returns the local storage that is currently set to the underlying model. More...
 

Signals

void doubleParentIdChanged (double doubleParentId)
 This signal is emitted if the doubleParentId property changes. More...
 
void hideReadChanged (bool hideRead)
 This signal is emitted if the hideRead property changes. More...
 
void inOperationChanged (bool inOperation)
 This signal is emitted when the operational state of the underlying model changes. More...
 
void loadedChanged (bool loaded)
 This signal is emitted if the loaded property changes. More...
 
void parentIdChanged (qint64 parentId)
 This signal is emitted when the parent ID property changed in the underlying model. More...
 
void searchChanged (const QString &search)
 This signal is emitted if the search string changes. More...
 
void sortingRoleChanged (FuotenEnums::SortingRole sortingRole)
 This signal is emitted if the sorting role changes. More...
 
void sortOrderChanged (Qt::SortOrder sortOrder)
 This signal is emitted if the sort order changes. More...
 
void storageChanged (Fuoten::AbstractStorage *storage)
 This signal is emitted when the pointer to the local storage handler changes in the underlying model. More...
 

Protected Member Functions

bool find (const QString &str) const
 Returns true if the string set by setSearch() is part of str. More...
 

Detailed Description

Abstract base filter model for other filter models.

Property Documentation

◆ doubleParentId

double BaseFilterModel::doubleParentId
readwrite

Stores the parent ID as double to make it accesseable from QML.

Access functions:
doubledoubleParentId() const
voidsetDoubleParentId(double nDoubleParentId)
Notifier signal:
voiddoubleParentIdChanged(double doubleParentId)

◆ hideRead

bool BaseFilterModel::hideRead
readwrite

When true, items with no unread items will be hidden.

Access functions:
boolhideRead() const
voidsetHideRead(bool nHideRead)
Notifier signal:
voidhideReadChanged(bool hideRead)

◆ inOperation

bool Fuoten::BaseFilterModel::inOperation
read

Returns true while the underlying BaseModel is initially loading data.

Access functions:
boolinOperation() const
Notifier signal:
voidinOperationChanged(bool inOperation)

◆ loaded

bool Fuoten::BaseFilterModel::loaded
read

This property holds true after the source model has initially loaded its data.

Access functions:
bool loaded() const
Notifier signal:
void loadedChanged(bool loaded)

◆ parentId

qint64 Fuoten::BaseFilterModel::parentId
readwrite

Sets the parentId property of the underlying BaseModel.

Access functions:
qint64parentId() const
voidsetParentId(qint64 nParentId)
Notifier signal:
voidparentIdChanged(qint64 parentId)

◆ search

QString BaseFilterModel::search
readwrite

Search string to filter the model for.

Access functions:
QStringsearch() const
voidsetSearch(const QString &nSearch)
Notifier signal:
voidsearchChanged(const QString &search)

◆ sortingRole

FuotenEnums::SortingRole BaseFilterModel::sortingRole
readwrite

◆ sortOrder

Qt::SortOrder BaseFilterModel::sortOrder
readwrite

◆ storage

Fuoten::AbstractStorage Fuoten::BaseFilterModel::storage
readwrite

Pointer to the AbstractStorage object of the underlying BaseModel.

Access functions:
AbstractStorage*storage() const
voidsetStorage(AbstractStorage *nStorage)
Notifier signal:
voidstorageChanged(AbstractStorage *storage)

Constructor & Destructor Documentation

◆ BaseFilterModel()

BaseFilterModel::BaseFilterModel ( QObject parent = nullptr)
explicit

Constructs a new base filter model with the given parent.

QSortFilterProxyModel::isSortLocaleAware will be set to true.

◆ ~BaseFilterModel()

BaseFilterModel::~BaseFilterModel ( )
override

Deconstructs the BaseFilterModel object.

Member Function Documentation

◆ doubleParentId()

double Fuoten::BaseFilterModel::doubleParentId ( ) const

Getter function for the doubleParentId property.

See also
setDoubleParentId(), doubleParentIdChanged()

◆ doubleParentIdChanged

void Fuoten::BaseFilterModel::doubleParentIdChanged ( double  doubleParentId)
signal

This signal is emitted if the doubleParentId property changes.

See also
doubleParentId

◆ find()

bool BaseFilterModel::find ( const QString str) const
protected

Returns true if the string set by setSearch() is part of str.

See also
setSearch

◆ hideRead()

bool Fuoten::BaseFilterModel::hideRead ( ) const

Returns true if model items with no unread items or unread articles should be hidden.

◆ hideReadChanged

void Fuoten::BaseFilterModel::hideReadChanged ( bool  hideRead)
signal

This signal is emitted if the hideRead property changes.

See also
hideRead

◆ inOperation()

virtual bool Fuoten::BaseFilterModel::inOperation ( ) const
pure virtual

Returns true while the underlying model is in operational mode.

Reimplement this in a derived class.

See also
inOperation

Implemented in Fuoten::ArticleListFilterModel, Fuoten::FeedListFilterModel, and Fuoten::FolderListFilterModel.

◆ inOperationChanged

void Fuoten::BaseFilterModel::inOperationChanged ( bool  inOperation)
signal

This signal is emitted when the operational state of the underlying model changes.

See also
inOperation

◆ load()

virtual Q_INVOKABLE void Fuoten::BaseFilterModel::load ( const QString locale = QString())
pure virtual

Loads the data in the underlying model.

Reimplement this in a subclass and call the underlying model's BaseModel::load() function. If locale is not an empty string, the default locale will be set to the defined locale.

See also
QLocale::setDefault()

Implemented in Fuoten::ArticleListFilterModel, Fuoten::FeedListFilterModel, and Fuoten::FolderListFilterModel.

◆ loaded()

virtual bool Fuoten::BaseFilterModel::loaded ( ) const
pure virtual

Returns true if the source model has initially loaded its data.

Implemented in Fuoten::ArticleListFilterModel, Fuoten::FeedListFilterModel, and Fuoten::FolderListFilterModel.

◆ loadedChanged

void Fuoten::BaseFilterModel::loadedChanged ( bool  loaded)
signal

This signal is emitted if the loaded property changes.

See also
loaded

◆ parentId()

virtual qint64 Fuoten::BaseFilterModel::parentId ( ) const
pure virtual

Returns the parent ID that is currently set to the underlyiing model. Reimplement this in a derived class.

See also
parentId

Implemented in Fuoten::ArticleListFilterModel, Fuoten::FeedListFilterModel, and Fuoten::FolderListFilterModel.

◆ parentIdChanged

void Fuoten::BaseFilterModel::parentIdChanged ( qint64  parentId)
signal

This signal is emitted when the parent ID property changed in the underlying model.

See also
parentId

◆ reload()

virtual Q_INVOKABLE void Fuoten::BaseFilterModel::reload ( const QString locale = QString())
pure virtual

Reloads the complete underlying model.

Reimplement this in a subclass and call the underlying model's BaseModel::reload() function. If localse is not an empty string, the default local will be set to the defined locale.

See also
QLocale::setDefault()

Implemented in Fuoten::ArticleListFilterModel, Fuoten::FeedListFilterModel, and Fuoten::FolderListFilterModel.

◆ search()

QString Fuoten::BaseFilterModel::search ( ) const

Returns the currently set serach string.

See also
setSearch

◆ searchChanged

void Fuoten::BaseFilterModel::searchChanged ( const QString search)
signal

This signal is emitted if the search string changes.

See also
search

◆ setDoubleParentId()

void BaseFilterModel::setDoubleParentId ( double  nDoubleParentId)

Setter function for the doubleParentId property.

See also
doubleParentId(), doubleParentIdChanged()

◆ setHideRead()

void BaseFilterModel::setHideRead ( bool  nHideRead)

Set this to true to hide items with no unread content or read articles.

See also
hideRead

◆ setParentId()

virtual void Fuoten::BaseFilterModel::setParentId ( qint64  nParentId)
pure virtual

Sets the parent ID for the underlying model.

See also
parentId

Implemented in Fuoten::ArticleListFilterModel, Fuoten::FeedListFilterModel, and Fuoten::FolderListFilterModel.

◆ setSearch()

void BaseFilterModel::setSearch ( const QString nSearch)

Sets the search string.

See also
search find

◆ setSortingRole()

void BaseFilterModel::setSortingRole ( FuotenEnums::SortingRole  nSortingRole)
virtual

Sets the sorting role.

See also
sortingRole

◆ setSortOrder()

void BaseFilterModel::setSortOrder ( Qt::SortOrder  nSortOrder)
virtual

Sets the sort order.

See also
sortOrder

◆ setStorage()

virtual void Fuoten::BaseFilterModel::setStorage ( AbstractStorage nStorage)
pure virtual

Sets the local storage handler for the underlying model.

See also
storage

Implemented in Fuoten::ArticleListFilterModel, Fuoten::FeedListFilterModel, and Fuoten::FolderListFilterModel.

◆ sortingRole()

virtual FuotenEnums::SortingRole Fuoten::BaseFilterModel::sortingRole ( ) const
virtual

Returns the currently set sorting role.

See also
sortingRole

◆ sortingRoleChanged

void Fuoten::BaseFilterModel::sortingRoleChanged ( FuotenEnums::SortingRole  sortingRole)
signal

This signal is emitted if the sorting role changes.

See also
sortingRole

◆ sortOrder()

virtual Qt::SortOrder Fuoten::BaseFilterModel::sortOrder ( ) const
virtual

Returns the currently set sort order.

See also
sortOrder

◆ sortOrderChanged

void Fuoten::BaseFilterModel::sortOrderChanged ( Qt::SortOrder  sortOrder)
signal

This signal is emitted if the sort order changes.

See also
sortOrder

◆ storage()

virtual AbstractStorage* Fuoten::BaseFilterModel::storage ( ) const
pure virtual

Returns the local storage that is currently set to the underlying model.

Reimplement this in a derived class.

See also
storage

Implemented in Fuoten::ArticleListFilterModel, Fuoten::FeedListFilterModel, and Fuoten::FolderListFilterModel.

◆ storageChanged

void Fuoten::BaseFilterModel::storageChanged ( Fuoten::AbstractStorage storage)
signal

This signal is emitted when the pointer to the local storage handler changes in the underlying model.

See also
storage

The documentation for this class was generated from the following files: