|
libfuoten 0.8.1
Qt based library to access the ownCloud/Nextcloud News App API
|
#include <Fuoten/Models/AbstractArticleModel>
Properties | |
| int | bodyLimit |
| Fuoten::FuotenEnums::Type | parentIdType |
| bool | starredOnly |
| Properties inherited from BaseModel | |
| double | doubleParentId |
| bool | inOperation |
| int | limit |
| bool | loaded |
| qint64 | parentId |
| Fuoten::FuotenEnums::SortingRole | sortingRole |
| Qt::SortOrder | sortOrder |
| Fuoten::AbstractStorage * | storage |
| bool | unreadOnly |
Public Member Functions | |
| AbstractArticleModel (QObject *parent=nullptr) | |
| ~AbstractArticleModel () override | |
| int | bodyLimit () const |
| QModelIndex | findByID (qint64 id) const override |
| QHash< qint64, QModelIndex > | findByIDs (const IdList &ids) const override |
| FuotenEnums::Type | parentIdType () const |
| void | setBodyLimit (int nBodyLimit) |
| void | setParentIdType (FuotenEnums::Type nParentIdType) |
| void | setStarredOnly (bool nStarredOnly) |
| bool | starredOnly () const |
| Public Member Functions inherited from BaseModel | |
| BaseModel (QObject *parent=nullptr) | |
| ~BaseModel () override | |
| double | doubleParentId () const |
| bool | inOperation () const |
| int | limit () const |
| bool | loaded () const |
| qint64 | parentId () const |
| void | setDoubleParentId (double nDoubleParentId) |
| void | setLimit (int nLimit) |
| void | setParentId (qint64 nParentId) |
| void | setSortingRole (FuotenEnums::SortingRole nSortingRole) |
| void | setSortOrder (Qt::SortOrder nSortOrder) |
| void | setStorage (AbstractStorage *nStorage) |
| void | setUnreadOnly (bool nUnreadOnly) |
| FuotenEnums::SortingRole | sortingRole () const |
| Qt::SortOrder | sortOrder () const |
| AbstractStorage * | storage () const |
| bool | unreadOnly () const |
Public Slots | |
| void | load () override |
| Public Slots inherited from BaseModel | |
| virtual void | load ()=0 |
| virtual void | reload () |
Signals | |
| void | bodyLimitChanged (int bodyLimit) |
| void | parentIdTypeChanged (FuotenEnums::Type parentIdType) |
| void | starredOnlyChanged (bool starredOnly) |
| Signals inherited from BaseModel | |
| void | doubleParentIdChanged (double doubleParentId) |
| void | inOperationChanged (bool inOperation) |
| void | limitChanged (int limit) |
| void | loadedChanged (bool loaded) |
| void | parentIdChanged (qint64 parentId) |
| void | sortingRoleChanged (FuotenEnums::SortingRole sortingRole) |
| void | sortOrderChanged (Qt::SortOrder sortOrder) |
| void | storageChanged (Fuoten::AbstractStorage *storage) |
| void | unreadOnlyChanged (bool unreadOnly) |
Protected Slots | |
| void | allItemsMarkedRead (qint64 newestItemId) |
| void | allItemsMarkedReadInQueue () |
| void | feedDeleted (qint64 feedId) |
| void | feedMarkedRead (qint64 feedId, qint64 newestItemId) |
| void | feedMarkedReadInQueue (qint64 feedId, qint64 newestItemId) |
| void | folderDeleted (qint64 folderId) |
| void | folderMarkedRead (qint64 folderId, qint64 newestItemId) |
| void | folderMarkedReadInQueue (qint64 folderId, qint64 newestItemId) |
| void | itemMarked (qint64 itemId, bool unread) |
| void | itemsMarked (const Fuoten::IdList &itemIds, bool unread) |
| void | itemsRequested (const Fuoten::IdList &updatedItems, const Fuoten::IdList &newItems, const Fuoten::IdList &deletedItems) |
| void | itemsStarred (const QList< QPair< qint64, QString > > &articles, bool starred) |
| void | itemStarred (qint64 feedId, const QString &guidHash, bool starred) |
| void | queueCleared () |
Protected Member Functions | |
| QList< Article * > | articles () const |
| void | clear () override |
| void | handleStorageChanged (AbstractStorage *old) override |
| Protected Member Functions inherited from BaseModel | |
| void | setInOperation (bool nInOperation) |
| void | setLoaded (bool loaded) |
Abstract article model that provides basic functionalities for Article models.
|
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.
| int | bodyLimit() const |
| void | setBodyLimit(int nBodyLimit) |
| void | bodyLimitChanged(int bodyLimit) |
|
readwrite |
Defines the type of the parentId. Can be Feed, Folder or All.
Default: FuotenEnums::All
| FuotenEnums::Type | parentIdType() const |
| void | setParentIdType(FuotenEnums::Type nParentIdType) |
| void | parentIdTypeChanged(FuotenEnums::Type parentIdType) |
|
readwrite |
If true, only starred articles will be returned.
| bool | starredOnly() const |
| void | setStarredOnly(bool nStarredOnly) |
| void | starredOnlyChanged(bool starredOnly) |
|
explicit |
Constructs a new empty abstract Article model with the given parent.
|
override |
Destroys the AbstractArticleModel object.
|
protectedslot |
Takes and processes data after all items/articles have been marked as read.
handleStorageChanged() will connect the AbstractStorage::markedAllItemsRead() signal to this slot.
| newestItemId | highest/newest ID of local available items/articles |
|
protectedslot |
Takes and processes data after all items/articles have been marked as read in local queue.
handleStorageChanged() will connect the AbstractStorage::markedAllItemsReadInQueue() signal to this slot.
| int bodyLimit | ( | ) | const |
Getter function for the bodyLimit property.
|
signal |
This is emitted if the value of the bodyLimit property changes.
|
overrideprotectedvirtual |
|
protectedslot |
Takes and processes data after a feed has been deleted.
handleStorageChanged() will connect the AbstractStorage::deletedFeed() signal to this slot.
| feedId | ID of the feed that has been deleted. |
|
protectedslot |
Takes and processes data after a feed has been marked as read.
handleStorageChanged() will connect the AbstractStorage::markedReadFeed() signal to this slot.
| feedId | ID of the feed that has been marked as read |
| newestItemId | ID of the newest item that has been marked as read |
|
protectedslot |
Takes and processes data after a feeds has been marked as read in local queue.
Will do the same as feedMarkedRead() but will also update the queue property of the article objects.
handleStorageChanged() will connect the AbstractStorage::markedReadFeedInQueue() signal to this slot.
| feedId | ID of the feed that has been marked as read |
| newestItemId | ID of the newest item that has been marked as read |
|
overridevirtual |
|
overridevirtual |
Returns IDs and model indices of the Article objects in the model identified by their ID in ids.
The key of the returned hash table will contain the ID of the Article, the value will contain the article's model index. Only articles will be returned of that the ID is part of the model.
| ids | list of article IDs to find in the model |
Reimplemented from BaseModel.
|
protectedslot |
Takes and processes data after a folder has been deleted.
handleStorageChanged() will connect the AbstractStorage::deletedFolder() signal to this slots.
| folderId | ID of the folder that has been deleted. |
|
protectedslot |
Takes and processses data after a folder has been marked as read.
handleStorageChanged() will connect the AbstractStorage::markedFolderRead() signal to this slot.
| folderId | ID of the folder that has been marked as read |
| newestItemId | ID of the newest item that has been marked as read |
|
protectedslot |
Takes and processses data after a folder has been marked as read in the queue.
handleStorageChanged() will connect the AbstractStorage::markedReadFolderInQueue() signal to this slots.
| folderId | ID of the folder that has been marked as read |
| newestItemId | ID of the newest item that has been marked as read |
|
overrideprotectedvirtual |
Connets the article related signals of AbstractStorage to the model's slots.
Reimplemented from BaseModel.
|
protectedslot |
Takes and processes data after an item/article has been marked as read/unread.
handleStorageChanged() will connect the AbstractStorage::markedItem() signal to this slot.
| itemId | ID of the article that has been marked as read or unread |
| unread | true if the article has been marked as unread, false if it has been marked as read |
|
protectedslot |
Takes and processes data after a list of items/articles has been marked as read/unread.
handleStorageChanged() will connect the AbstractStorage::markedItems() signal to this slot.
| itemIds | list of IDs of items/articles that have been marked as read/unread |
| unread | true if the items/articles in the list have been marked as unread, false if they have been marked as read |
|
protectedslot |
Takes and processes data after items/articles have been requested.
handleStorageChanged() will connect the AbstractStorage::requestedItems() signal to this slot.
| updatedItems | list of IDs of items that have been updated |
| newItems | list of IDs of items that are new to the local storage |
| deletedItems | list of IDs of items that have benn updated in the local storage |
|
protectedslot |
Takes and processes data after a list of items/articles has been starred/unstarred.
handleStorageChanged() will connect the AbstractStorage::starredItems() signal to this slot.
| articles | list of pairs of feed ID and article/item guid hash of articles that have been starred/unstarred |
| starred | true if the articles in the list have been starred, false if the have been unstarred |
|
protectedslot |
Takes and processes data after an item/article has been starred/unstarred.
handleStorageChanged() will connect the AbstractStorage::starredItem() signal to this slot.
| feedId | ID of the feed the article/item that has been starred/unstarred belongs to |
| guidHash | GUID hash of the article/item that has been starred/unstarred |
| starred | true if the article/item has been starred, false if it has been unstarred |
|
overrideslot |
Populates the model with data from the local storage.
Use AbstractStorage::getArticles() to ge Article objects from the local storage that will be added to the model. If the BaseModel::parentId property is set to a value gerater than -1, only Articles will be loaded that are part of the type defined in AbstractArticleMode::parentIdType.
| FuotenEnums::Type parentIdType | ( | ) | const |
Getter function for the parentIdType property.
|
signal |
This is emitted if the value of the parentIdType property changes.
|
protectedslot |
Updates the model after the local queue has been cleared.
Will set the Article::queue property of every article in the model to FuotenEnums::NoQueueAction. handleStorageChanged() will connect the AbstractStorage::queueCleared() signal to this slot.
| 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.
|
signal |
This is emitted if the value of the starredOnly property changes.