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

#include <Fuoten/Storage/AbstractStorage>

Inheritance diagram for AbstractStorage:
SQLiteStorage

Properties

AbstractConfigurationconfiguration
Fuoten::Errorerror
bool inOperation
Fuoten::AbstractNotificatornotificator
bool ready
int starred
int totalUnread

Public Member Functions

 AbstractStorage (QObject *parent=nullptr)
 ~AbstractStorage () override
virtual void clearQueue ()
virtual Q_INVOKABLE void clearStorage ()
AbstractConfigurationconfiguration () const
virtual bool enqueueItem (FuotenEnums::QueueAction action, Article *article)
virtual Q_INVOKABLE bool enqueueMarkAllItemsRead ()
virtual bool enqueueMarkFeedRead (qint64 feedId, qint64 newestItemId)
virtual bool enqueueMarkFolderRead (qint64 folderId, qint64 newestItemId)
Errorerror () const
virtual ArticlegetArticle (qint64 id, int bodyLimit=0)=0
virtual Q_INVOKABLE QString getArticleBody (qint64 id)=0
virtual QList< Article * > getArticles (const QueryArgs &args)=0
virtual void getArticlesAsync (const QueryArgs &args)
virtual FeedgetFeed (qint64 id)=0
virtual QList< Feed * > getFeeds (const QueryArgs &args)=0
virtual QList< Folder * > getFolders (FuotenEnums::SortingRole sortingRole=FuotenEnums::Name, Qt::SortOrder sortOrder=Qt::AscendingOrder, const IdList &ids=IdList(), FuotenEnums::Type idType=FuotenEnums::Folder, int limit=0)=0
virtual qint64 getNewestItemId (FuotenEnums::Type type=FuotenEnums::All, qint64 id=-1)=0
virtual void init ()=0
bool inOperation () const
AbstractNotificatornotificator () const
bool ready () const
void setConfiguration (AbstractConfiguration *nConfiguration)
void setNotificator (AbstractNotificator *notificator)
virtual int starred () const
virtual int totalUnread () const

Public Slots

virtual void allItemsMarkedRead (qint64 newestItemId)=0
virtual void feedCreated (const QJsonDocument &json)=0
virtual void feedDeleted (qint64 id)=0
virtual void feedMarkedRead (qint64 id, qint64 newestItem)=0
virtual void feedMoved (qint64 id, qint64 targetFolder)=0
virtual void feedRenamed (qint64 id, const QString &newTitle)=0
virtual void feedsRequested (const QJsonDocument &json)=0
virtual void folderCreated (const QJsonDocument &json)=0
virtual void folderDeleted (qint64 id)=0
virtual void folderMarkedRead (qint64 id, qint64 newestItem)=0
virtual void folderRenamed (qint64 id, const QString &newName)=0
virtual void foldersRequested (const QJsonDocument &json)=0
virtual void itemMarked (qint64 itemId, bool unread)=0
virtual void itemsMarked (const Fuoten::IdList &itemIds, bool unread)=0
virtual void itemsRequested (const QJsonDocument &json)=0
virtual void itemsStarred (const QList< QPair< qint64, QString > > &articles, bool star)=0
virtual void itemStarred (qint64 feedId, const QString &guidHash, bool star)=0

Signals

void configurationChanged (Fuoten::AbstractConfiguration *configuration)
void createdFeed (qint64 id, qint64 folderId)
void createdFolder (qint64 id, const QString &name)
void deletedFeed (qint64 id)
void deletedFolder (qint64 id)
void errorChanged (Fuoten::Error *error)
void gotArticlesAsync (const Fuoten::ArticleList &articles)
void inOperationChanged (bool inOperation)
void markedAllItemsRead (qint64 newestItemId)
void markedAllItemsReadInQueue ()
void markedItem (qint64 itemId, bool unread)
void markedItems (const Fuoten::IdList &itemIds, bool unread)
void markedReadFeed (qint64 id, qint64 newestItem)
void markedReadFeedInQueue (qint64 feedId, qint64 newestItemId)
void markedReadFolder (qint64 id, qint64 newestItem)
void markedReadFolderInQueue (qint64 folderId, qint64 newestItemId)
void movedFeed (qint64 id, qint64 targetFolder)
void notificatorChanged (Fuoten::AbstractNotificator *notificator)
void queueCleared ()
void readyChanged (bool ready)
void renamedFeed (qint64 id, const QString &newName)
void renamedFolder (qint64 id, const QString &newName)
void requestedFeeds (const Fuoten::IdList &updatedFeeds, const Fuoten::IdList &newFeeds, const Fuoten::IdList &deletedFeeds)
void requestedFolders (const QList< QPair< qint64, QString > > &updatedFolders, const QList< QPair< qint64, QString > > &newFolders, const Fuoten::IdList &deletedFolders)
void requestedItems (const Fuoten::IdList &updatedItems, const Fuoten::IdList &newItems, const Fuoten::IdList &deletedItems)
void starredChanged (int starred)
void starredItem (qint64 feedId, const QString &guidHash, bool starred)
void starredItems (const QList< QPair< qint64, QString > > &articles, bool star)
void storageCleared ()
void totalUnreadChanged (int totalUnread)

Protected Slots

virtual void setStarred (int nStarred)
virtual void setTotalUnread (int nTotalUnread)

Protected Member Functions

void notify (AbstractNotificator::Type type, QtMsgType severity, const QVariant &data) const
void notify (const Error *e) const
void setError (Error *nError)
void setInOperation (bool nInOperation)
void setReady (bool nReady)

Detailed Description

Abstract class to handle the storage of requested News App data.

Reimplement this class to store the data requested from the News App API. You can set your derived class to the Component::storage property, that all classes use that derive from Component. Also BaseItem hast the BaseItem::storage property for derived classes, that is used to set the storage handler to API classes that perfrom API actions.

If you derive from AbstractStorage, initialize the storage in init() and set setReady() to true when your storage is ready to handle data.

Property Documentation

◆ configuration

AbstractConfiguration * configuration
readwrite

◆ error

Fuoten::Error * error
read

Returns a pointer to an Error object, if any error occures, otherwise a nullptr.

Access functions:
Error*error() const
Notifier signal:
voiderrorChanged(Error *error)
See also
setError()

◆ inOperation

bool inOperation
read

Returns true while the storage is in operation.

This will only be set to true by pure storage functions (like queue functions), not when processing requested data.

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

◆ notificator

Fuoten::AbstractNotificator * notificator
readwrite

Pointer to an object derived from AbstractNotificator.

Set a notificator to notify users about errors and events. This is not mandatory. You have to derive your own notificator that uses the notification system of the target platform.

If no notificator has been set via setNotificator(), the one set via Component::setDefaultConfigurator() will be used - if any has been set. If you do not set a notificator either per instance or global, this property will hold a nullptr. If a notificator is set to an instance of this class via setNotificator(), this notificator will take precedence over the global default notificator object (if any set).

Access functions:
Notifier signal:
See also
notify()

◆ ready

bool ready
read

Returns true when the storage handler has finished its initialization.

Access functions:
boolready() const
Notifier signal:
voidreadyChanged(bool ready)
See also
setReady()

◆ starred

int starred
read

Amount of starred items.

Access functions:
intstarred() const
Notifier signal:
voidstarredChanged(int starred)
See also
setStarred()

◆ totalUnread

int totalUnread
read

Total amount of unread items in the storage.

Access functions:
inttotalUnread() const
Notifier signal:
voidtotalUnreadChanged(int totalUnread)
See also
setTotalUnread()

Constructor & Destructor Documentation

◆ AbstractStorage()

AbstractStorage ( QObject * parent = nullptr)
explicit

Constructs a new abstract local storage with the given parent.

◆ ~AbstractStorage()

~AbstractStorage ( )
override

Deconstructs the AbstractStorage object.

Member Function Documentation

◆ allItemsMarkedRead

virtual void allItemsMarkedRead ( qint64 newestItemId)
pure virtualslot

Receives the reply data from the MarkAllItemsRead request.

Will mark all items in the local database as read which have an ID lower or equal to newestItemId.

◆ clearQueue()

void clearQueue ( )
virtual

Clears the local queue. Does not revert the action itself.

The default implementation does nothing. When reimplementing this function, only remove the queue entry but do not revert the action already done locally. It will be called after working the queue.

Reimplemented in SQLiteStorage.

◆ clearStorage()

void clearStorage ( )
virtual

Removes all data from the storage.

The default implementation does nothing. When reimplementing this, emit storageCleared() after successfully clear all stored data. Do not forget to also reset last sync time with AbstractConfiguration::setLastSync().

Reimplemented in SQLiteStorage.

◆ configuration()

AbstractConfiguration * configuration ( ) const

◆ configurationChanged

void configurationChanged ( Fuoten::AbstractConfiguration * configuration)
signal

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

See also
AbstractStorage::configuration(), AbstractStorage::setConfiguration()

◆ createdFeed

void createdFeed ( qint64 id,
qint64 folderId )
signal

Emit this after a new feed has been created.

Best loaction to emit this signal is your implementation of feedCreated(). The signal has to contain the id of the new feed it's parent folderId.

◆ createdFolder

void createdFolder ( qint64 id,
const QString & name )
signal

Emit this after a new folder has been created.

Best loaction to emit this signal is your implementation of folderCreated(). The signal has to contain the id and the name of the new folder.

◆ deletedFeed

void deletedFeed ( qint64 id)
signal

Emit this after a feed has been deleted.

Best location to emit this signal is your implementation of feedDeleted(). The signal has to contain the id fo the deleted feed.

◆ deletedFolder

void deletedFolder ( qint64 id)
signal

Emit this after a folder has been deleted.

Best location to emit this signal is your implementation of folderDeleted(). The signal has to contain the id fo the deleted folder.

◆ enqueueItem()

bool enqueueItem ( FuotenEnums::QueueAction action,
Article * article )
virtual

Enqueues an action for the given article.

When enqueueing an article, the performed action should already be saved in the local storage together with the queue action. If the article is marked as read for example, add the action to your local queue and also mark the article as read in your local storage.

The default implementation does nothing and returns false.

Parameters
actionthe action that should be enqueued
articlepointer to the Article object that should be enqueued
Returns
true if the enqueue was successful, otherwise false

Reimplemented in SQLiteStorage.

◆ enqueueMarkAllItemsRead()

bool enqueueMarkAllItemsRead ( )
virtual

Adds all local articles that are unread to the queue and marks them as read.

After successfully addint the items/articles to the local queue, emit the markedAllItemsReadInQueue() signal. The default implementation does nothing and returns false.

Returns
true on success, otherwise false

Reimplemented in SQLiteStorage.

◆ enqueueMarkFeedRead()

bool enqueueMarkFeedRead ( qint64 feedId,
qint64 newestItemId )
virtual

Adds all articles older than newestItemId in the feed identified by feedId as read to the local queue.

After successfully adding the items/articles to the local queue, emit the markedReadFeedInQueue() signal. The default implementation does nothing and returns false.

Parameters
feedIdID of the feed to be marked as read
newestItemIdID of the newest item in the feed
Returns
true on success, otherwise false

Reimplemented in SQLiteStorage.

◆ enqueueMarkFolderRead()

bool enqueueMarkFolderRead ( qint64 folderId,
qint64 newestItemId )
virtual

Adds all articles older than newestItemId in the folder identified folderId as read to the local queue.

After successfully adding the items/articles to the local queue, emit the markedReadFolderInQueue() signal. The default implementation does nothing and returns false.

Parameters
folderIdID of the folder to be marked as read
newestItemIdID of the newest item in the folder
Returns
true on success, otherwise false

Reimplemented in SQLiteStorage.

◆ error()

Error * error ( ) const

Retruns a pointer to an Error object, if any error occures, otherwise returns a nullptr.

◆ errorChanged

void errorChanged ( Fuoten::Error * error)
signal

Emitted whenever the error property changes.

◆ feedCreated

virtual void feedCreated ( const QJsonDocument & json)
pure virtualslot

Receives the reply data of the CreateFeed request.

Implement this in a derived class to store new feed data, for example in a local SQL databse. You my want to emit createdFeed() in your implementation after you processed the data.

Example JSON response data
{
"feeds": [
{
"id": 39,
"url": "http://feeds.feedburner.com/oatmealfeed",
"title": "The Oatmeal - Comics, Quizzes, & Stories",
"faviconLink": "http://theoatmeal.com/favicon.ico",
"added": 1367063790,
"folderId": 4,
"unreadCount": 9,
"ordering": 0, // 0 means no special ordering, 1 means oldest first, 2 newest first, new in 5.1.0
"link": "http://theoatmeal.com/",
"pinned": true // if a feed should be sorted before other feeds, added in 6.0.3
}
],
"newestItemId": 23 // only sent if there are items
}

◆ feedDeleted

virtual void feedDeleted ( qint64 id)
pure virtualslot

Receives the reply data of the DeleteFeed request.

Will delete the feed identified by id in the local storage and emits the deletedFeed() signal.

◆ feedMarkedRead

virtual void feedMarkedRead ( qint64 id,
qint64 newestItem )
pure virtualslot

Receives the reply data of the MarkFeedRead request.

Will mark all items in the feed identified by id that have a lower ID than newestItem as read in the local storage. Will than emit the markedReadFeed() signal.

◆ feedMoved

virtual void feedMoved ( qint64 id,
qint64 targetFolder )
pure virtualslot

Receives the reply data of the MoveFeed request.

Will move the feed identified by id to the targetFolder id and emits the movedFeed() signal.

◆ feedRenamed

virtual void feedRenamed ( qint64 id,
const QString & newTitle )
pure virtualslot

Receives the reply data of the RenameFeed request.

Will rename the feed identified by id to the newTitle and emits the renamedFeed() signal.

◆ feedsRequested

virtual void feedsRequested ( const QJsonDocument & json)
pure virtualslot

Receives the reply data of the GetFeeds request.

Implement this in a derived class to store feed data, for example in a local SQL database. You may want to emit requestedFeeds() in your implementation after you processed the data.

Example JSON response data
{
"feeds": [
{
"id": 39,
"url": "http://feeds.feedburner.com/oatmealfeed",
"title": "The Oatmeal - Comics, Quizzes, & Stories",
"faviconLink": "http://theoatmeal.com/favicon.ico",
"added": 1367063790,
"folderId": 4,
"unreadCount": 9,
"ordering": 0, // 0 means no special ordering, 1 means oldest first, 2 newest first, new in 5.1.0
"link": "http://theoatmeal.com/",
"pinned": true // if a feed should be sorted before other feeds, added in 6.0.3,
"updateErrorCount": 0,
"lastUpdateError": "error message here"
}, // etc
],
"starredCount": 2,
"newestItemId": 3443 // only sent if there are items
}

◆ folderCreated

virtual void folderCreated ( const QJsonDocument & json)
pure virtualslot

Receives the reply data of the CreateFolder request.

Implement this in a derived class to store new folder data, for example in a local SQL databse. You my want to emit createdFolder() in your implementation after you processed the data.

Example JSON response data
{
"folders": [
{
"id": 3,
"name": "New Folder"
}
]
}

◆ folderDeleted

virtual void folderDeleted ( qint64 id)
pure virtualslot

Receives the reply data of the DeleteFolder request.

Will delete the folder identified by id in the local storage and emits the deletedFolder() signal.

◆ folderMarkedRead

virtual void folderMarkedRead ( qint64 id,
qint64 newestItem )
pure virtualslot

Receives the reply data of the MarkFolderRead request.

Will mark all items in the folder identified by id that have a lower ID than newestItem as read in the local storage. Will than emit the markedReadFolder() signal.

◆ folderRenamed

virtual void folderRenamed ( qint64 id,
const QString & newName )
pure virtualslot

Receives the reply data of the RenameFolder request.

Will rename the folder identified by id in the local storage to newName and emits the renamedFolder() signal.

◆ foldersRequested

virtual void foldersRequested ( const QJsonDocument & json)
pure virtualslot

Receives the reply data of the GetFolders request.

Implement this in a derived class to store folder data, for example in a local SQL database. You may want to emit requestedFolders() in your implementation after you processed the data.

Example JSON response data
{
"folders": [
{
"id": 1,
"name": "Interersting Folder"
},
{
"id": 2,
"name": "Other Folder"
}, // etc
]
}

◆ getArticle()

virtual Article * getArticle ( qint64 id,
int bodyLimit = 0 )
pure virtual

Returns the Article identified by id.

bodyLimit 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.

Returns a nullptr if the Article can not be found.

Implemented in SQLiteStorage.

◆ getArticleBody()

virtual Q_INVOKABLE QString getArticleBody ( qint64 id)
pure virtual

Returns the full body of an Article identified by id.

Implemented in SQLiteStorage.

◆ getArticles()

virtual QList< Article * > getArticles ( const QueryArgs & args)
pure virtual

Returns a list of Article objects from the local storage.

See QueryArgs for a list of possible query arguments.

Implemented in SQLiteStorage.

◆ getArticlesAsync()

void getArticlesAsync ( const QueryArgs & args)
virtual

Invokes a query for Article objects from the local storage, limited by args.

This should emit the gotArticlesAsync() signal containing a list of Article objects. The default implementation is not really asynchronous, it simply calls getArticles() and emits gotArticlesSync() with the return value of that function.

When reimplementing this and connecting to the gotArticlesSync() signal, be aware that the Article objects in the list might have been created in a different thread.

Reimplemented in SQLiteStorage.

◆ getFeed()

virtual Feed * getFeed ( qint64 id)
pure virtual

Returns the Feed identified by id.

Returns a nullptr if the Feed can not be found.

Implemented in SQLiteStorage.

◆ getFeeds()

virtual QList< Feed * > getFeeds ( const QueryArgs & args)
pure virtual

Returns a list of Feed objects from the local storage.

See QueryArgs for a list of possible query arguments.

Implemented in SQLiteStorage.

◆ getFolders()

virtual QList< Folder * > getFolders ( FuotenEnums::SortingRole sortingRole = FuotenEnums::Name,
Qt::SortOrder sortOrder = Qt::AscendingOrder,
const IdList & ids = IdList(),
FuotenEnums::Type idType = FuotenEnums::Folder,
int limit = 0 )
pure virtual

Returns a list of Folder objects from the local storage.

The returned list will be sorted by sortingRole and sortOrder. If ids is not empty, only folders with IDs of idType from the list will be returned. The idType specifies the id the folder is compared with. If the idType is not one of out of the table below, it will be treated as FuotenEnums::Folder.

FuotenEnums::FolderOnly folders with an ID in ids will be returned
FuotenEnums::FeedOnly folders will be returned that contain feeds with an ID in ids
FuotenEnums::ItemOnly folders will be returned that contain items with an ID in ids

Setting limit > 0 returns only the amount of items up to that limit.

The Folder objects in the returned list will have their parent set to nullptr.

Examples

Implemented in SQLiteStorage.

◆ getNewestItemId()

virtual qint64 getNewestItemId ( FuotenEnums::Type type = FuotenEnums::All,
qint64 id = -1 )
pure virtual

Returns the newest item/article ID for the given type.

Supported Types: FuotenEnums::Feed, FuotenEnums::Folder, FuotenEnums::All. For folder and feed type a valid id has to be provided that identifieds the folder or feed.

If the type does not match one of the supported or if there are not items, -1 is returned.

Implemented in SQLiteStorage.

◆ gotArticlesAsync

void gotArticlesAsync ( const Fuoten::ArticleList & articles)
signal

Emit this after getArticlesAsync() has been called and articles have been queried.

Be aware that the objects in the list might have been created in a different thread when you connect to this signal.

Parameters
articleslist of Article objects

◆ init()

virtual void init ( )
pure virtual

Initializes the storage handler.

For example, create your database layout. When finished set setReady() to true.

Implemented in SQLiteStorage.

◆ inOperation()

bool inOperation ( ) const

◆ inOperationChanged

void inOperationChanged ( bool inOperation)
signal

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

See also
AbstractStorage::inOperation(), AbstractStorage::setInOperation()

◆ itemMarked

virtual void itemMarked ( qint64 itemId,
bool unread )
pure virtualslot

Receives the reply data for the MarkItem request.

Will mark the item identified by itemId in the local storage as read or unread.

Parameters
itemIdID of the item/article that has been marked
unreadtrue if the item has been marked as unread, false if marked as read

◆ itemsMarked

virtual void itemsMarked ( const Fuoten::IdList & itemIds,
bool unread )
pure virtualslot

Receives the reply data for the MarkItems request.

Will mark the items identified by their ID in the itemIds as read if unread is set to false, otherwise it will mark them as unread. You should emit markedItems() in your implementation after you processed the data to update connected models.

Parameters
itemIdsIDs of articles that have been marked as read or unread
unreadtrue if the articles have been marked as unread, false if marked as read

◆ itemsRequested

virtual void itemsRequested ( const QJsonDocument & json)
pure virtualslot

Receives the reply data of the GetItems request.

Implement this in a derived class to store item data, for example in a local SQL database. You may want to emit requestedItems() in your implementation after you processed the data.

Example JSON response data
{
"items": [
{
"id": 3443,
"guid": "http://grulja.wordpress.com/?p=76",
+ "guidHash": "3059047a572cd9cd5d0bf645faffd077",
"url": "http://grulja.wordpress.com/2013/04/29/plasma-nm-after-the-solid-sprint/",
"title": "Plasma-nm after the solid sprint",
"author": "Jan Grulich (grulja)",
"pubDate": 1367270544,
"body": "<p>At first I have to say...</p>",
"enclosureMime": null,
"enclosureLink": null,
"feedId": 67,
"unread": true,
"starred": false,
"lastModified": 1367273003,
"fingerprint": "aeaae2123"
}, // etc
]
}

◆ itemsStarred

virtual void itemsStarred ( const QList< QPair< qint64, QString > > & articles,
bool star )
pure virtualslot

Receives the reply data for the StarItems request.

The lists contains the item/article IDs and the guid hash of the items/articles that have been either starred or unstarred. You should emit starredItems() in your implementation after you processed the data to update connected models.

Parameters
articleslist of pairs of feed ID and guid hash of starred/unstarred articles
startrue if the articles have been starred, false if they have been unstarred

◆ itemStarred

virtual void itemStarred ( qint64 feedId,
const QString & guidHash,
bool star )
pure virtualslot

Receives the reply data from the StarItem request.

Will star or unstar the item/article identified by itemId and guidHash in the local storage.

Parameters
feedIdID of the feed the item/article that has been starred or unstarred belongs to
guidHashglobal unique ID hash of the item/article that has been starred or unstarred
startrue if the article has been starred, false if it has been unstarred

◆ markedAllItemsRead

void markedAllItemsRead ( qint64 newestItemId)
signal

Emit this signal after all items/articles have been marked as read.

Best location to emit this signal is your implementation of allItemsMarkedRead().

Parameters
newestItemIdhighest/newest ID of the local available items/articles

◆ markedAllItemsReadInQueue

void markedAllItemsReadInQueue ( )
signal

Emit this signal after all items/articles have been marked as read in the local queue.

Best location to emit this signal is your implemetation of enqueueMarkAllItemsRead().

◆ markedItem

void markedItem ( qint64 itemId,
bool unread )
signal

Emit this after an item/article has been marked read or unread.

Best location to emit this signal is your implementation of itemMarked().

Parameters
itemIdthe ID of the item/article that has been marked as read or unread
unreadtrue if the article has been marked as unread, false if marked as read

◆ markedItems

void markedItems ( const Fuoten::IdList & itemIds,
bool unread )
signal

Emit this after items/articles have been marked as read or unread.

Best location to emit this signal is your implementation of itemsMarked().

The lists have to conatin the item/article IDs that haven been marked as read or unread.

Parameters
itemIdsIDs of articles that have been marked as read or unread
unreadtrue if the articles have been marked as unread, false if marked as read

◆ markedReadFeed

void markedReadFeed ( qint64 id,
qint64 newestItem )
signal

Emit this after a feed has been marked as read.

Best location to emit this signal is your implementation of feedMarkedRead(). The signal has to contain the id of the feed that has been marked as read as well as the ID of the newestItem that has been marked as read.

◆ markedReadFeedInQueue

void markedReadFeedInQueue ( qint64 feedId,
qint64 newestItemId )
signal

Emit this after a feed has been marked as read in the local queue.

Parameters
feedIdID of the feed that has been marked as read
newestItemIdID of the newest item in the feed

◆ markedReadFolder

void markedReadFolder ( qint64 id,
qint64 newestItem )
signal

Emit this after a folder has been marked as read.

Best location to emit this signal is your implementation of folderMarkedRead(). The signal has to contain the id of the folder that has been marked as read as well as the ID of the newestItem that has been marked as read.

◆ markedReadFolderInQueue

void markedReadFolderInQueue ( qint64 folderId,
qint64 newestItemId )
signal

Emit this after a folder has been marked as read in the local queue.

Best location to emit this signal is your implementation of enqueueMarkFolderRead().

Parameters
folderIdID of the folder that has been marked as read in the local queue
newestItemIdID of the newest item in folder that has been marked as read in the local queue

◆ movedFeed

void movedFeed ( qint64 id,
qint64 targetFolder )
signal

Emit this signal after a feed has been moved to another folder.

Best location to emit this signal is your implementation of feedMoved(). The signal has to contain the id of the moved feed and the targetFolder id.

◆ notificator()

AbstractNotificator * notificator ( ) const

Getter function for the notificator property.

See also
setNotificator(), notificatorChanged()

◆ notificatorChanged

void notificatorChanged ( Fuoten::AbstractNotificator * notificator)
signal

Notifier signal for the notificator property.

See also
setNotificator(), notificator()

◆ notify() [1/2]

void notify ( AbstractNotificator::Type type,
QtMsgType severity,
const QVariant & data ) const
protected

Checks if a notificator has been set and will use it to notify the user.

See also
AbstractNotificator::notify(AbstractNotificator::Type type, QtMsgType severity, const QVariant &data)

◆ notify() [2/2]

void notify ( const Error * e) const
protected

Checks if a notificator has been set and will use it to notify about an occured error.

See also
AbstractNotificator::notify(const Error *e)

◆ queueCleared

void queueCleared ( )
signal

This is emitted after the local queue has been cleared.

Emit this in your implementation of clearQueue().

◆ ready()

bool ready ( ) const

Returns true when the storage is ready to handle data, otherwise false.

◆ readyChanged

void readyChanged ( bool ready)
signal

Emitted whenever the ready property changes.

◆ renamedFeed

void renamedFeed ( qint64 id,
const QString & newName )
signal

Emit this signal after a feed has been renamed.

Best location to emit this signal is your implementation of feedRename(). The signal has to contain the id of the renamed feed and the newName.

◆ renamedFolder

void renamedFolder ( qint64 id,
const QString & newName )
signal

Emit this after a folder has been renamed.

Best location to emit this signal is your implementation of folderRenamed(). The signal has to contain the id and the newName of the folder.

◆ requestedFeeds

void requestedFeeds ( const Fuoten::IdList & updatedFeeds,
const Fuoten::IdList & newFeeds,
const Fuoten::IdList & deletedFeeds )
signal

Emit this after feeds have been received and processed.

Best location to emit this signal is your implementation of feedsRequested().

Every argument of the signal should contain a list of feed IDs that are either updated, new or deleted.

◆ requestedFolders

void requestedFolders ( const QList< QPair< qint64, QString > > & updatedFolders,
const QList< QPair< qint64, QString > > & newFolders,
const Fuoten::IdList & deletedFolders )
signal

Emit this after folders have been received and processed.

Best location to emit this signal is your implementation of foldersRequested().

updatedFolders should contain a list of the database IDs and names of updated folders, newFolders should contain a list of databaes IDs and names of new folders, and deletedFolders should contain a list of database IDs of deleted folders.

◆ requestedItems

void requestedItems ( const Fuoten::IdList & updatedItems,
const Fuoten::IdList & newItems,
const Fuoten::IdList & deletedItems )
signal

Emit this after items/articles have been received and processed.

Best location to emit this signal is your implementation of itemsRequested().

Every argument of the signal should contain a list of item IDs that are either updated, new or deleted.

Parameters
updatedItemslist of IDs from items that have been updated
newItemslist of IDs from items that are new in the local storage
deletedItemslist of IDs from items that have been remove from the local storage

◆ setConfiguration()

void setConfiguration ( AbstractConfiguration * nConfiguration)

Setter function for the configuration property. Emits the configurationChanged() signal if nConfiguration is not equal to the stored value.

See also
AbstractStorage::configuration(), AbstractStorage::configurationChanged()

◆ setError()

void setError ( Error * nError)
protected

Sets the Error object.

See also
error

◆ setInOperation()

void setInOperation ( bool nInOperation)
protected

Setter function for the inOperation property. Emits the inOperationChanged() signal if nInOperation is not equal to the stored value.

See also
AbstractStorage::inOperation(), AbstractStorage::inOperationChanged()

◆ setNotificator()

void setNotificator ( AbstractNotificator * notificator)

Setter function for the notificator property.

See also
notificator(), notificatorChanged()

◆ setReady()

void setReady ( bool nReady)
protected

Set this to true when the storage has finished it's initialization.

See also
ready

◆ setStarred

void setStarred ( int nStarred)
protectedvirtualslot

Sets the total number of starred articles.

See also
starred

◆ setTotalUnread

void setTotalUnread ( int nTotalUnread)
protectedvirtualslot

Sets the total number of unread articles.

See also
totalUnread

◆ starred()

int starred ( ) const
virtual

Returns the total number of starred articles.

See also
starred

◆ starredChanged

void starredChanged ( int starred)
signal

This signal is emitted if the amount of total starred articles changes.

See also
starred

◆ starredItem

void starredItem ( qint64 feedId,
const QString & guidHash,
bool starred )
signal

Emit this after an item/article has been starred or unstarred.

Best location to emit this signal is your implementation of itemStarred().

Parameters
feedIdthe ID of the feed the item/article that has been starred or unstarred belongs to
guidHashthe global unique ID hash of the article that has been starred or unstarred
starredtrue if the article has been starred, false if it has been unstarred

◆ starredItems

void starredItems ( const QList< QPair< qint64, QString > > & articles,
bool star )
signal

Emit this after items/articles have been starred or unstarred.

Best location to emit this signal is your implementation of itemsStarred().

Parameters
articleslist of pairs of feed ID and guid hash of starred/unstarred articles
startrue if the articles have been starred, false if they have been unstarred

◆ storageCleared

void storageCleared ( )
signal

This is emitted after the local storage has been cleared.

Emit this in your implementation of clearStorage() after all local data has been deleted successfully.

◆ totalUnread()

int totalUnread ( ) const
virtual

Returns the total number of unread articles.

See also
totalUnread

◆ totalUnreadChanged

void totalUnreadChanged ( int totalUnread)
signal

This signal is emitted if the amount of total unread articles changes.

See also
totalUnread