|
libfuoten 0.8.1
Qt based library to access the ownCloud/Nextcloud News App API
|
#include <Fuoten/API/MoveFeed>
Properties | |
| qint64 | feedId |
| qint64 | folderId |
| Properties inherited from Component | |
| Fuoten::AbstractConfiguration * | configuration |
| Fuoten::Error * | error |
| bool | inOperation |
| Fuoten::AbstractNotificator * | notificator |
| quint16 | requestTimeout |
| Fuoten::AbstractStorage * | storage |
| bool | useStorage |
| Fuoten::WipeManager * | wipeManager |
Public Member Functions | |
| MoveFeed (QObject *parent=nullptr) | |
| ~MoveFeed () override | |
| Q_INVOKABLE void | execute () override |
| qint64 | feedId () const |
| qint64 | folderId () const |
| void | setFeedId (qint64 nFeedId) |
| void | setFolderId (qint64 nFolderId) |
| Public Member Functions inherited from Component | |
| Component (QObject *parent=nullptr) | |
| ~Component () override | |
| AbstractConfiguration * | configuration () const |
| Error * | error () const |
| bool | inOperation () const |
| bool | isUseStorageEnabled () const |
| AbstractNotificator * | notificator () const |
| quint16 | requestTimeout () const |
| void | setConfiguration (AbstractConfiguration *nAbstractConfiguration) |
| void | setNotificator (AbstractNotificator *notificator) |
| void | setRequestTimeout (quint16 seconds) |
| void | setStorage (AbstractStorage *localStorage) |
| void | setUseStorage (bool useStorage) |
| void | setWipeManager (WipeManager *wipeManager) |
| AbstractStorage * | storage () const |
| WipeManager * | wipeManager () const |
Signals | |
| void | feedIdChanged (qint64 feedId) |
| void | folderIdChanged (qint64 folderId) |
| void | succeeded (qint64 feedId, qint64 folderId) |
| Signals inherited from Component | |
| void | configurationChanged (Fuoten::AbstractConfiguration *configuration) |
| void | errorChanged (Fuoten::Error *error) |
| void | failed (Fuoten::Error *error) |
| void | inOperationChanged (bool inOperation) |
| void | notificatorChanged (Fuoten::AbstractNotificator *notificator) |
| void | requestTimeoutChanged (quint16 requestTimeout) |
| void | sslErrors (QNetworkReply *reply, const QList< QSslError > &errors) |
| void | storageChanged (Fuoten::AbstractStorage *storage) |
| void | succeeded (const QJsonDocument &result) |
| void | useStorageChanged (bool useStorage) |
| void | wipeManagerChanged (Fuoten::WipeManager *wipeManager) |
Protected Member Functions | |
| bool | checkInput () override |
| void | extractError (QNetworkReply *reply) override |
| void | successCallback () override |
| Protected Member Functions inherited from Component | |
| void | addRequestHeader (const QByteArray &headerName, const QByteArray &headerValue) |
| void | addRequestHeaders (const QHash< QByteArray, QByteArray > &headers) |
| virtual bool | checkOutput () |
| QJsonDocument | jsonResult () const |
| void | notify (AbstractNotificator::Type type, QtMsgType severity, const QVariant &data) const |
| void | notify (const Error *e) const |
| QHash< QByteArray, QByteArray > | requestHeaders () const |
| void | sendRequest () |
| void | setApiRoute (const QString &route) |
| void | setApiRoute (const QStringList &routeParts) |
| void | setError (Error *nError) |
| void | setExpectedJSONType (ExpectedJSONType type) |
| void | setInOperation (bool nInOperation) |
| void | setNetworkOperation (QNetworkAccessManager::Operation operation) |
| void | setPayload (const QByteArray &payload) |
| void | setPayload (const QJsonObject &payload) |
| void | setRequestHeaders (const QHash< QByteArray, QByteArray > &headers) |
| void | setRequiresAuth (bool reqAuth) |
| void | setUrlQuery (const QUrlQuery &query) |
Additional Inherited Members | |
| Public Types inherited from Component | |
| enum | ExpectedJSONType : quint8 { Empty = 0 , Array = 1 , Object = 2 } |
| Static Public Member Functions inherited from Component | |
| static AbstractConfiguration * | defaultConfiguration () |
| static AbstractNotificator * | defaultNotificator () |
| static AbstractStorage * | defaultStorage () |
| static WipeManager * | defaultWipeManager () |
| static AbstractNamFactory * | networkAccessManagerFactory () |
| static void | setDefaultConfiguration (AbstractConfiguration *config) |
| static void | setDefaultNotificator (AbstractNotificator *notificator) |
| static void | setDefaultStorage (AbstractStorage *storage) |
| static void | setDefaultWipeManager (WipeManager *wipeManager) |
| static void | setNetworkAccessManagerFactory (AbstractNamFactory *factory) |
Moves a feed to a different folder on the News App server.
To move a feed, set the MoveFeed::feedId and MoveFeed::folderId properties to valid IDs and set the Component::configuration to a valid object. Optionally set the Component::storage property to move the feed also in a local storage. After setting the mandatory properties, call execute() to perform the API request.
If a valid AbstractStorage object is set to the Component::storage property, AbstractStorage::feedMoved() will be called in the successCallback() to to move the feed in the local storage. If the request succeeded, the MoveFeed::succeeded() signal will be emitted, containing the ID of the moved feed and the ID of the target folder. If something failed, the Component::failed() signal will be emitted and Component::error will contain a valid pointer to an Error object.
|
readwrite |
ID of the feed that should be moved.
This property can not be changed while Component::inOperation() returns true.
| qint64 | feedId() const |
| void | setFeedId(qint64 nFeedId) |
| void | feedIdChanged(qint64 feedId) |
|
readwrite |
ID of the folder the feed should be moved to.
This property can not be changed while Component::inOperation() returns true.
| qint64 | folderId() const |
| void | setFolderId(qint64 nFolderId) |
| void | folderIdChanged(qint64 folderId) |
|
explicit |
Constructs an API request object with the given parent to move a feed on the remote server to a different folder.
|
override |
Destroys the MoveFeed object.
|
overrideprotectedvirtual |
Checks for a valid feed and folder ID.
This will at first perform the checks of Component::checkInput() and will than simply check if the feed ID is greater than zero and if the folder ID is not negative.
Reimplemented from Component.
|
overridevirtual |
Executes the API request.
To perform a successful API request to move a feed, MoveFeed::feedId and MoveFeed::folderId have to contain valid IDs and there has to be a AbstractConfiguration object set to Component::configuration.
Execution will not run while Component::inOperation returns true and will itself set that property to true when the request starts.
Implements Component.
|
overrideprotectedvirtual |
Extracts possible errors replied by the News App API.
Reimplemented from Component.
| qint64 feedId | ( | ) | const |
Returns the ID of the feed that should be moved.
|
signal |
This is emitted if the ID of the feed that should be moved changes.
| qint64 folderId | ( | ) | const |
Returns the ID of the folder the feed should be moved to.
|
signal |
This is emitted if the ID of the folder the feed should be moved to changes.
| void setFeedId | ( | qint64 | nFeedId | ) |
Sets the ID of the feed that should be moved.
| void setFolderId | ( | qint64 | nFolderId | ) |
Sets the ID of the folder the feed should be moved to.
|
signal |
|
overrideprotectedvirtual |
Finishes the feed moving if the request was successful.
Implements Component.