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

Proxy filter model for ArticleListModel. More...

#include <Fuoten/Models/ArticleListFilterModel>

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

Properties

int bodyLimit
 Limits the size of the body text in number of characters.
Fuoten::FuotenEnums::Type parentIdType
 Defines the type of the parentId used in the underlying model.
Properties inherited from Fuoten::BaseFilterModel
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

 ArticleListFilterModel (QObject *parent=nullptr)
 Constructs a new ArticleListFilterModel object with the given parent.
 ~ArticleListFilterModel () override
 Destroys the ArticleListFilterModel object.
int bodyLimit () const
 Getter function for the bodyLimit property.
bool inOperation () const override
 Returns true while the underlying ArticleListModel is loading.
Q_INVOKABLE void load (const QString &locale=QString()) override
 Loads the data in the underlying ArticleListModel.
bool loaded () const override
 Returns true if the source model has initially loaded its data.
qint64 parentId () const override
 Returns the parent ID that is currently set in the underlying ArticleListModel.
FuotenEnums::Type parentIdType () const
 Getter function for the parentIdType property.
Q_INVOKABLE void reload (const QString &locale=QString()) override
 Reloads the complete underlying ArticleListModel.
void setBodyLimit (int nBodyLimit)
 Setter function for the bodyLimit property. Emits the bodyLimitChanged() signal if nBodyLimit is not equal to the stored value.
void setParentId (qint64 nParentId) override
 Sets the parent ID in the underlying ArticleListModel.
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 setStorage (AbstractStorage *nStorage) override
 Sets the pointer to a local storage object in the underlying ArticleListModel.
AbstractStoragestorage () const override
 Returns the pointer to the local storage handler set in the underlying ArticleListModel.
Public Member Functions inherited from Fuoten::BaseFilterModel
 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.
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.
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 FuotenEnums::SortingRole sortingRole () const
 Returns the currently set sorting role.
virtual Qt::SortOrder sortOrder () const
 Returns the currently set sort order.

Signals

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.
Signals inherited from Fuoten::BaseFilterModel
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.

Additional Inherited Members

Protected Member Functions inherited from Fuoten::BaseFilterModel
bool find (const QString &str) const
 Returns true if the string set by setSearch() is part of str.

Detailed Description

Proxy filter model for ArticleListModel.

This proxy model filters and sorts the data of a ArticleListModel that is internally created.

Property Documentation

◆ bodyLimit

int Fuoten::ArticleListFilterModel::bodyLimit
readwrite

Limits the size of the body text in number of characters.

Values lower than 0 will return no body text, 0 will return the full body text, any other positive value will return a body stripped from HTML tags and limited to the amount of characters. Defaults to -1.

Access functions:
intbodyLimit() const
voidsetBodyLimit(int nBodyLimit)
Notifier signal:
voidbodyLimitChanged(int bodyLimit)

◆ parentIdType

Fuoten::FuotenEnums::Type Fuoten::ArticleListFilterModel::parentIdType
readwrite

Defines the type of the parentId used in the underlying model.

Defaults to FuotenEnums::All

Access functions:
FuotenEnums::TypeparentIdType() const
voidsetParentIdType(FuotenEnums::Type nParentIdType)
Notifier signal:
voidparentIdTypeChanged(FuotenEnums::Type parentIdType)

Constructor & Destructor Documentation

◆ ArticleListFilterModel()

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

Constructs a new ArticleListFilterModel object with the given parent.

◆ ~ArticleListFilterModel()

ArticleListFilterModel::~ArticleListFilterModel ( )
override

Destroys the ArticleListFilterModel object.

Member Function Documentation

◆ bodyLimit()

int ArticleListFilterModel::bodyLimit ( ) const

◆ bodyLimitChanged

void Fuoten::ArticleListFilterModel::bodyLimitChanged ( int bodyLimit)
signal

This is emitted if the value of the bodyLimit property changes.

See also
AbstractArticleModel::bodyLimit(), AbstractArticleModel::setBodyLimit()

◆ inOperation()

bool ArticleListFilterModel::inOperation ( ) const
overridevirtual

Returns true while the underlying ArticleListModel is loading.

Implements Fuoten::BaseFilterModel.

◆ load()

void ArticleListFilterModel::load ( const QString & locale = QString())
overridevirtual

Loads the data in the underlying ArticleListModel.

Implements Fuoten::BaseFilterModel.

◆ loaded()

bool ArticleListFilterModel::loaded ( ) const
overridevirtual

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

Implements Fuoten::BaseFilterModel.

◆ parentId()

qint64 ArticleListFilterModel::parentId ( ) const
overridevirtual

Returns the parent ID that is currently set in the underlying ArticleListModel.

Implements Fuoten::BaseFilterModel.

◆ parentIdType()

FuotenEnums::Type ArticleListFilterModel::parentIdType ( ) const

◆ parentIdTypeChanged

void Fuoten::ArticleListFilterModel::parentIdTypeChanged ( FuotenEnums::Type parentIdType)
signal

This is emitted if the value of the parentIdType property changes.

See also
ArticleListFilterModel::parentIdType(), ArticleListFilterModel::setParentIdType()

◆ reload()

void ArticleListFilterModel::reload ( const QString & locale = QString())
overridevirtual

Reloads the complete underlying ArticleListModel.

Implements Fuoten::BaseFilterModel.

◆ setBodyLimit()

void ArticleListFilterModel::setBodyLimit ( int nBodyLimit)

Setter function for the bodyLimit property. Emits the bodyLimitChanged() signal if nBodyLimit is not equal to the stored value.

See also
AbstractArticleModel::bodyLimit(), AbstractArticleModel::bodyLimitChanged()

◆ setParentId()

void ArticleListFilterModel::setParentId ( qint64 nParentId)
overridevirtual

Sets the parent ID in the underlying ArticleListModel.

Parameters
nParentIdID of the parent folder, -1 (default) to show all feeds

Implements Fuoten::BaseFilterModel.

◆ setParentIdType()

void ArticleListFilterModel::setParentIdType ( FuotenEnums::Type nParentIdType)

Setter function for the parentIdType property. Emits the parentIdTypeChanged() signal if nParentIdType is not equal to the stored value.

See also
ArticleListFilterModel::parentIdType(), ArticleListFilterModel::parentIdTypeChanged()

◆ setStorage()

void ArticleListFilterModel::setStorage ( AbstractStorage * nStorage)
overridevirtual

Sets the pointer to a local storage object in the underlying ArticleListModel.

Parameters
nStoragereimplemented local storage

Implements Fuoten::BaseFilterModel.

◆ storage()

AbstractStorage * ArticleListFilterModel::storage ( ) const
overridevirtual

Returns the pointer to the local storage handler set in the underlying ArticleListModel.

Implements Fuoten::BaseFilterModel.


The documentation for this class was generated from the following files:
  • Fuoten/Models/articlelistfiltermodel.h
  • build/Fuoten/FuotenQt5_autogen/include/moc_articlelistfiltermodel.cpp
  • Fuoten/Models/articlelistfiltermodel.cpp