|
libfuoten 0.8.1
Qt based library to access the ownCloud/Nextcloud News App API
|
#include <Fuoten/API/GetVersion>
Properties | |
| QString | versionString |
| 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 | |
| GetVersion (QObject *parent=nullptr) | |
| ~GetVersion () override | |
| Q_INVOKABLE void | execute () override |
| QVersionNumber | version () const |
| QString | versionString () const |
| 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 | versionChanged (const QVersionNumber &version) |
| void | versionStringChanged (const QString &versionString) |
| 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 | checkOutput () 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 | checkInput () |
| virtual void | extractError (QNetworkReply *reply) |
| 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) |
Requests the installed News App version from the server.
The version reply will only contain the version number of the installed News App. To request the version information, set the configuration property and call execute().
You can get the raw JSON response from the Component::succeeded() signal. If something failed, the Component::failed() signal will be emitted and Component::error will contain a valid pointer to an Error object.
|
read |
This property holds the version of the Nextcoud News app as a string.
The default value is an empty string. It will be set in the successCallback().
| QString | versionString() const |
| void | versionStringChanged(const QString versionString) |
|
explicit |
Constructs an API request object with the given parent to query the News App version from the remote server.
|
override |
Destroys the GetVersion object.
|
overrideprotectedvirtual |
Checks for version in the replied JSON object.
Will at first perform the checks from Component::checkOutput().
Reimplemented from Component.
|
overridevirtual |
Executes the API request.
To perform a successful API request, Component::configuration has to be set to a valid AbstractConfiguration object.
Execution will not run if Component::inOperation returns true and will itself set that property to true when start to perform the request.
Implements Component.
|
overrideprotectedvirtual |
Finishes the version request if it was successful.
Will set the versionString property and emit the versionStringChanged() and versionChanged() signals.
Implements Component.
| QVersionNumber version | ( | ) | const |
Returns the version of the Nextcloud News app.
The default value is a null version.
|
signal |
Emitted when the version value changed.
This signal will be triggered in the successCallback().
| QString versionString | ( | ) | const |
Returns the version of the Nextcloud News app as a string.
The default value is an empty string.
|
signal |
Emitted when the versionString value changed.
This signal will be triggered in the successCallback().