|
libfuoten 0.8.1
Qt based library to access the ownCloud/Nextcloud News App API
|
#include <Fuoten/API/GetUser>
Public Member Functions | |
| GetUser (QObject *parent=nullptr) | |
| ~GetUser () override | |
| Q_INVOKABLE void | execute () override |
| 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 |
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) |
Requests the user information from the News App.
The user reply will contain information about the authenticated user like display name, avatar and last login time. To request the user information, set the configuration property and call execute().
The requested data will be written to AbstractConfiguration::setDisplayName() and AbstractConfiguration::setAvatar(). 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.
|
explicit |
Constructs an API request object with the given parent to query information about the authenticated user from the remote server.
|
override |
Destroys the GetUser object.
|
overrideprotectedvirtual |
Checks for displayName 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 user request if it was successful.
Will use AbstractConfiguration::setDisplayName() and AbstractConfiguration::setAvatar() to store the reply. Afterwards it will set Component::inOperation to false and emits the Component::succeeded() signal.
Implements Component.