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

#include <Fuoten/Model/BaseFilterModel>

Inheritance diagram for BaseFilterModel:
ArticleListFilterModel FeedListFilterModel FolderListFilterModel

Properties

double doubleParentId
bool hideRead
bool inOperation
bool loaded
qint64 parentId
QString search
Fuoten::FuotenEnums::SortingRole sortingRole
Qt::SortOrder sortOrder
Fuoten::AbstractStoragestorage

Public Member Functions

 BaseFilterModel (QObject *parent=nullptr)
 ~BaseFilterModel () override
double doubleParentId () const
bool hideRead () const
virtual bool inOperation () const =0
virtual Q_INVOKABLE void load (const QString &locale=QString())=0
virtual bool loaded () const =0
virtual qint64 parentId () const =0
virtual Q_INVOKABLE void reload (const QString &locale=QString())=0
QString search () const
void setDoubleParentId (double nDoubleParentId)
void setHideRead (bool nHideRead)
virtual void setParentId (qint64 nParentId)=0
void setSearch (const QString &nSearch)
virtual void setSortingRole (FuotenEnums::SortingRole nSortingRole)
virtual void setSortOrder (Qt::SortOrder nSortOrder)
virtual void setStorage (AbstractStorage *nStorage)=0
virtual FuotenEnums::SortingRole sortingRole () const
virtual Qt::SortOrder sortOrder () const
virtual AbstractStoragestorage () const =0

Signals

void doubleParentIdChanged (double doubleParentId)
void hideReadChanged (bool hideRead)
void inOperationChanged (bool inOperation)
void loadedChanged (bool loaded)
void parentIdChanged (qint64 parentId)
void searchChanged (const QString &search)
void sortingRoleChanged (FuotenEnums::SortingRole sortingRole)
void sortOrderChanged (Qt::SortOrder sortOrder)
void storageChanged (Fuoten::AbstractStorage *storage)

Protected Member Functions

bool find (const QString &str) const

Detailed Description

Abstract base filter model for other filter models.

Property Documentation

◆ doubleParentId

double 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 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 inOperation
read

Returns true while the underlying BaseModel is initially loading data.

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

◆ loaded

bool 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 parentId
readwrite

Sets the parentId property of the underlying BaseModel.

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

◆ search

QString search
readwrite

Search string to filter the model for.

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

◆ sortingRole

◆ sortOrder

Qt::SortOrder sortOrder
readwrite

Defines the sort order.

Access functions:
Qt::SortOrdersortOrder() const
voidsetSortOrder(Qt::SortOrder nSortOrder)
Notifier signal:
voidsortOrderChanged(Qt::SortOrder sortOrder)

◆ storage

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

Constructs a new base filter model with the given parent.

QSortFilterProxyModel::isSortLocaleAware will be set to true.

◆ ~BaseFilterModel()

~BaseFilterModel ( )
override

Deconstructs the BaseFilterModel object.

Member Function Documentation

◆ doubleParentId()

double doubleParentId ( ) const

Getter function for the doubleParentId property.

See also
setDoubleParentId(), doubleParentIdChanged()

◆ doubleParentIdChanged

void doubleParentIdChanged ( double doubleParentId)
signal

This signal is emitted if the doubleParentId property changes.

See also
doubleParentId

◆ find()

bool find ( const QString & str) const
protected

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

See also
setSearch

◆ hideRead()

bool hideRead ( ) const

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

◆ hideReadChanged

void hideReadChanged ( bool hideRead)
signal

This signal is emitted if the hideRead property changes.

See also
hideRead

◆ inOperation()

virtual bool 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 ArticleListFilterModel, FeedListFilterModel, and FolderListFilterModel.

◆ inOperationChanged

void 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 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 ArticleListFilterModel, FeedListFilterModel, and FolderListFilterModel.

◆ loaded()

virtual bool loaded ( ) const
pure virtual

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

Implemented in ArticleListFilterModel, FeedListFilterModel, and FolderListFilterModel.

◆ loadedChanged

void loadedChanged ( bool loaded)
signal

This signal is emitted if the loaded property changes.

See also
loaded

◆ parentId()

virtual qint64 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 ArticleListFilterModel, FeedListFilterModel, and FolderListFilterModel.

◆ parentIdChanged

void 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 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 ArticleListFilterModel, FeedListFilterModel, and FolderListFilterModel.

◆ search()

QString search ( ) const

Returns the currently set serach string.

See also
setSearch

◆ searchChanged

void searchChanged ( const QString & search)
signal

This signal is emitted if the search string changes.

See also
search

◆ setDoubleParentId()

void setDoubleParentId ( double nDoubleParentId)

Setter function for the doubleParentId property.

See also
doubleParentId(), doubleParentIdChanged()

◆ setHideRead()

void setHideRead ( bool nHideRead)

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

See also
hideRead

◆ setParentId()

virtual void setParentId ( qint64 nParentId)
pure virtual

Sets the parent ID for the underlying model.

See also
parentId

Implemented in ArticleListFilterModel, FeedListFilterModel, and FolderListFilterModel.

◆ setSearch()

void setSearch ( const QString & nSearch)

Sets the search string.

See also
search find

◆ setSortingRole()

void setSortingRole ( FuotenEnums::SortingRole nSortingRole)
virtual

Sets the sorting role.

See also
sortingRole

◆ setSortOrder()

void setSortOrder ( Qt::SortOrder nSortOrder)
virtual

Sets the sort order.

See also
sortOrder

◆ setStorage()

virtual void setStorage ( AbstractStorage * nStorage)
pure virtual

Sets the local storage handler for the underlying model.

See also
storage

Implemented in ArticleListFilterModel, FeedListFilterModel, and FolderListFilterModel.

◆ sortingRole()

FuotenEnums::SortingRole sortingRole ( ) const
virtual

Returns the currently set sorting role.

See also
sortingRole

◆ sortingRoleChanged

void sortingRoleChanged ( FuotenEnums::SortingRole sortingRole)
signal

This signal is emitted if the sorting role changes.

See also
sortingRole

◆ sortOrder()

Qt::SortOrder sortOrder ( ) const
virtual

Returns the currently set sort order.

See also
sortOrder

◆ sortOrderChanged

void sortOrderChanged ( Qt::SortOrder sortOrder)
signal

This signal is emitted if the sort order changes.

See also
sortOrder

◆ storage()

virtual AbstractStorage * 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 ArticleListFilterModel, FeedListFilterModel, and FolderListFilterModel.

◆ storageChanged

void 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