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

#include <Fuoten/API/DeleteFeed>

Inheritance diagram for DeleteFeed:
Component

Properties

qint64 feedId
Properties inherited from Component
Fuoten::AbstractConfigurationconfiguration
Fuoten::Errorerror
bool inOperation
Fuoten::AbstractNotificatornotificator
quint16 requestTimeout
Fuoten::AbstractStoragestorage
bool useStorage
Fuoten::WipeManagerwipeManager

Public Member Functions

 DeleteFeed (QObject *parent=nullptr)
 ~DeleteFeed () override
Q_INVOKABLE void execute () override
qint64 feedId () const
void setFeedId (qint64 nFeedId)
Public Member Functions inherited from Component
 Component (QObject *parent=nullptr)
 ~Component () override
AbstractConfigurationconfiguration () const
Errorerror () const
bool inOperation () const
bool isUseStorageEnabled () const
AbstractNotificatornotificator () 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)
AbstractStoragestorage () const
WipeManagerwipeManager () const

Signals

void feedIdChanged (qint64 feedId)
void succeeded (qint64 id)
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 AbstractConfigurationdefaultConfiguration ()
static AbstractNotificatordefaultNotificator ()
static AbstractStoragedefaultStorage ()
static WipeManagerdefaultWipeManager ()
static AbstractNamFactorynetworkAccessManagerFactory ()
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)

Detailed Description

Deletes a feed on the News App server.

To delete a feed on the server, set DeleteFeed::feedId to a valid ID and set an AbstractConfiguration to Component::configuration.

If a valid AbstractStorage object is set to the Component::storage property, AbstractStorage::feedDeleted() will be called in the successCallback() to delete the feed in the local storage. If the request succeeded, the succeed() signal will be emitted in the successCallback() and it will contain the id of the deleted feed. If the request failed, Component::faild() will be emitted and Component::error contains a valid pointer to an Error object.

Mandatory properties
DeleteFeed::feedId, Component::configuration
API route
/feeds/{feedId}
Method
DELETE

Property Documentation

◆ feedId

qint64 feedId
readwrite

ID of the feed to delete.

This property can not be changed while Component::inOperation() returns true.

Access functions:
qint64feedId() const
voidsetFeedId(qint64 nFeedId)
Notifier signal:
voidfeedIdChanged(qint64 feedId)

Constructor & Destructor Documentation

◆ DeleteFeed()

DeleteFeed ( QObject * parent = nullptr)
explicit

Constructs an API request object with the given parent to delete a feed on the remote server.

◆ ~DeleteFeed()

~DeleteFeed ( )
override

Destroys the DeleteFeed object.

Member Function Documentation

◆ checkInput()

bool checkInput ( )
overrideprotectedvirtual

Checks for a valid feed ID.

This will at first perform the checks of Component::checkInput() and will than simply check if the feed id is greater than zero.

Reimplemented from Component.

◆ execute()

void execute ( )
overridevirtual

Executes the API request.

To perform a successful API request to delete a feed, DeleteFeed::feedId has to be a valid feed ID and there has to be an 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.

◆ extractError()

void extractError ( QNetworkReply * reply)
overrideprotectedvirtual

Extracts possible errors replied by the News App API.

Reimplemented from Component.

◆ feedId()

qint64 feedId ( ) const

Returns the ID of the feed to delete.

See also
feedId

◆ feedIdChanged

void feedIdChanged ( qint64 feedId)
signal

This is emitted if the ID of the feed to delete changes.

See also
feedId

◆ setFeedId()

void setFeedId ( qint64 nFeedId)

Sets the ID of the feed to delete.

See also
feedId

◆ succeeded

void succeeded ( qint64 id)
signal

Will be emitted in the success callback function and contains the ID of the deleted folder.

See also
Component::failed()

◆ successCallback()

void successCallback ( )
overrideprotectedvirtual

Finishes the feed deletion if the request was successful.

Implements Component.