libfuoten 0.8.2
Qt based library to access the Nextcloud News App API.
Loading...
Searching...
No Matches
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.
bool hideRead
 When true, items with no unread items will be hidden.
bool inOperation
 Returns true while the underlying BaseModel is initially loading data.
bool loaded
 This property holds true after the source model has initially loaded its data.
qint64 parentId
 Sets the parentId property of the underlying BaseModel.
QString search
 Search string to filter the model for.
Fuoten::FuotenEnums::SortingRole sortingRole
 The property the model items should be sorted by.
Qt::SortOrder sortOrder
 Defines the sort order.
Fuoten::AbstractStoragestorage
 Pointer to the AbstractStorage object of the underlying BaseModel.

Public Member Functions

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

Signals

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

Protected Member Functions

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

Detailed Description

Abstract base filter model for other filter models.

Property Documentation

◆ doubleParentId

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

Fuoten::FuotenEnums::SortingRole Fuoten::BaseFilterModel::sortingRole
readwrite

◆ sortOrder

Qt::SortOrder Fuoten::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 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 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 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()

FuotenEnums::SortingRole 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()

Qt::SortOrder 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:
  • Fuoten/Models/basefiltermodel.h
  • build/Fuoten/FuotenQt5_autogen/include/moc_basefiltermodel.cpp
  • Fuoten/Models/basefiltermodel.cpp