|
libfuoten 0.8.1
Qt based library to access the ownCloud/Nextcloud News App API
|
#include <Fuoten/Helpers/Synchronizer>
Properties | |
| Fuoten::AbstractConfiguration * | configuration |
| QString | currentAction |
| Fuoten::Error * | error |
| bool | inOperation |
| Fuoten::AbstractNotificator * | notificator |
| qreal | progress |
| Fuoten::AbstractStorage * | storage |
Public Member Functions | |
| Synchronizer (QObject *parent=nullptr) | |
| ~Synchronizer () override | |
| Q_INVOKABLE void | clearError () |
| AbstractConfiguration * | configuration () const |
| QString | currentAction () const |
| virtual Q_INVOKABLE void | deferredSync (quint32 miliseconds) |
| Error * | error () const |
| bool | inOperation () const |
| AbstractNotificator * | notificator () const |
| qreal | progress () const |
| void | setConfiguration (AbstractConfiguration *nAbstractConfiguration) |
| void | setNotificator (AbstractNotificator *notificator) |
| void | setStorage (AbstractStorage *nStorageHandler) |
| AbstractStorage * | storage () const |
| virtual Q_INVOKABLE void | sync () |
Public Slots | |
| void | start () |
Signals | |
| void | configurationChanged (Fuoten::AbstractConfiguration *configuration) |
| void | currentActionChanged (const QString ¤tAction) |
| void | errorChanged (Fuoten::Error *error) |
| void | failed (Fuoten::Error *error) |
| void | inOperationChanged (bool inOperation) |
| void | notificatorChanged (Fuoten::AbstractNotificator *notificator) |
| void | progressChanged (qreal progress) |
| void | storageChanged (Fuoten::AbstractStorage *storage) |
| void | succeeded () |
Protected Slots | |
| void | finished () |
| void | notifyAboutRead () |
| void | notifyAboutStarred () |
| void | notifyAboutUnread () |
| void | notifyAboutUnstarred () |
| void | requestFeeds () |
| void | requestFolders () |
| void | requestStarred () |
| void | requestUnread () |
| void | requestUpdated () |
| void | setError (Fuoten::Error *nError) |
Protected Member Functions | |
| void | setCurrentAction (const QString &nCurrentAction) |
| void | setProgress (qreal nProgress) |
Combines updating of folders, feeds and articles.
|
readwrite |
Pointer to a AbstractConfiguration object.
You have to set a valid AbstractConfiguration object in order to start a synchronization. This property can not be changed while Component::inOperation() returns true.
| AbstractConfiguration* | configuration() const |
| void | setConfiguration(AbstractConfiguration *nAbstractConfiguration) |
| void | configurationChanged(AbstractConfiguration *configuration) |
|
read |
Returns the current performed action.
| QString | currentAction() const |
| void | currentActionChanged(const QString ¤tAction) |
|
read |
Pointer to an Error object, if an error occurred. Otherwise a nullptr.
| Error* | error() const |
| void | errorChanged(Error *error) |
|
read |
Returns true while the Synchronizer is in operational mode.
| bool | inOperation() const |
| void | inOperationChanged(bool inOperation) |
|
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).
|
read |
Pregress value between 0.0 and 1.0.
| qreal | progress() const |
| void | progressChanged(qreal progress) |
|
readwrite |
Pointer to an AbstractStorage derived object.
This property can not be changed while Component::inOperation() returns true.
| AbstractStorage* | storage() const |
| void | setStorage(AbstractStorage *nStorageHandler) |
| void | storageChanged(AbstractStorage *storage) |
|
explicit |
Constructs a new Synchronizer object with the given parent.
|
override |
Deconstructs the Synchronizer object.
| void clearError | ( | ) |
Clears the current error and sets the error property to a nullptr.
| AbstractConfiguration * configuration | ( | ) | const |
Returns the pointer to the currently set AbstractConfiguration object.
|
signal |
This signal is emitted if the pointer to the AbstractConfiguration object changes.
| QString currentAction | ( | ) | const |
Getter function for the currentAction property.
|
signal |
This is emitted if the value of the currentAction property changes.
|
virtual |
Invokes the synchronizing process after miliseconds.
The base implementation simply calls start() after the timeout in miliseconds.
| Error * error | ( | ) | const |
|
signal |
|
signal |
This signal is emitted if the synchonization process failed for some reason.
|
protectedslot |
Finishes the synchronization and cleans up.
| bool inOperation | ( | ) | const |
Returns true while the synchronization is active.
|
signal |
This signal is emitted if the oprational state changes.
| AbstractNotificator * notificator | ( | ) | const |
Getter function for the notificator property.
|
signal |
Notifier signal for the notificator property.
|
protectedslot |
Notifies the News App about read articles from the local queue.
|
protectedslot |
Notifies the News App about starred articles from the local queue.
|
protectedslot |
Notifies the News App about unread articles from the local queue.
|
protectedslot |
Notifies the News app about unstarred articles from the local queue.
| qreal progress | ( | ) | const |
Getter function for the progress property.
|
signal |
This is emitted if the value of the progress property changes.
|
protectedslot |
Requests feed information from the News App.
|
protectedslot |
Requests folder information from the News App.
|
protectedslot |
Requests all starred articles from the News App.
|
protectedslot |
Requests all unread articles from the News App.
|
protectedslot |
Requests articles from the News App that are new or have been updated since last sync.
| void setConfiguration | ( | AbstractConfiguration * | nAbstractConfiguration | ) |
Sets the pointer to a AbstractConfiguration object.
|
protected |
Sets the current action string. Emits the currentActionChanged() signal if nCurrentAction is not equal to the stored value.
|
protectedslot |
| void setNotificator | ( | AbstractNotificator * | notificator | ) |
Setter function for the notificator property.
|
protected |
Sets the current progress value. Emits the progressChanged() signal if nProgress is not equal to the stored value.
| void setStorage | ( | AbstractStorage * | nStorageHandler | ) |
Sets the pointer to an AbstractStorage object.
|
slot |
Starts the synchronizing process.
Prior to starting the synchronizing process, it checks inOperation(). If that returns true, nothing will happen. If inOperation() returns false, it will set it to true and will start the update process.
When you create a derived class, call start() in your implementation of sync().
| AbstractStorage * storage | ( | ) | const |
Returns the pointer to the currently set AbstractStorage object, if any, otherwise a nullptr.
|
signal |
This signall is emitted if the pointer to the AbstractStorage object changes.
|
signal |
This signal is emitted if the synchronization process was successful.
|
virtual |
Invokes the synchronizing process.
The base implementation simply calls start().