|
libfuoten 0.8.1
Qt based library to access the ownCloud/Nextcloud News App API
|
#include <Fuoten/Helpers/AbstractConfiguration>
Public Member Functions | |
| AbstractConfiguration (QObject *parent=nullptr) | |
| ~AbstractConfiguration () override | |
| virtual Q_INVOKABLE void | deleteAccount () |
| virtual QString | getHost () const =0 |
| virtual bool | getIgnoreSSLErrors () const |
| virtual QString | getInstallPath () const =0 |
| virtual QDateTime | getLastSync () const |
| virtual Q_INVOKABLE QString | getLoginFlowUserAgent () const |
| virtual QString | getPassword () const =0 |
| virtual FuotenEnums::ItemDeletionStrategy | getPerFeedDeletionStrategy (qint64 feedId) const |
| virtual quint16 | getPerFeedDeletionValue (qint64 feedId) const |
| virtual int | getServerPort () const |
| virtual QString | getUserAgent () const |
| virtual QString | getUsername () const =0 |
| virtual bool | getUseSSL () const |
| virtual bool | isAccountValid () const =0 |
| virtual void | setHost (const QString &host) |
| virtual void | setInstallPath (const QString &path) |
| virtual void | setLastSync (const QDateTime &syncTime) |
| virtual void | setPassword (const QString &password) |
| virtual void | setServerPort (int port) |
| virtual void | setUsername (const QString &username) |
| virtual void | setUseSSL (bool useSSL) |
Public Slots | |
| bool | setLoginFlowCredentials (const QByteArray &credentials) |
| bool | setLoginFlowCredentials (const QJsonDocument &credentials) |
| bool | setLoginFlowCredentials (const QJsonObject &credentials) |
| virtual bool | setLoginFlowCredentials (const QUrl &credentialUrl) |
| bool | setServerUrl (const QString &url) |
| bool | setServerUrl (const QUrl &url) |
Signals | |
| void | accountDeleted () |
Protected Member Functions | |
| void | checkAccountValidity () |
| virtual void | setIsAccountValid (bool nIsAccountValid)=0 |
Server and authentication settings abstract base class.
In order to use libfuoten, you have to reimplement this class, especially all pure virtual functions that provide the necessary data to perform API requests.
The reimplemented class will than be used on all API call classes. All of the API classes have a configuration property that takes subclasses of AbstractConfiguration.
|
explicit |
Constructs a new AbstractConfiguration object with the given parent.
|
override |
Destroys the AbstractConfiguration object.
|
signal |
Emitted when the account data has been deleted.
Emit this signal in your implementation of deleteAccount() after the account data has been deleted.
|
protected |
Performs a simple check on the important account data.
This will check if username, password and host are not empty. You can use this function to set the account validity. The result of the check will be set to setIsAccountValid().
|
virtual |
Deletes all local account data.
Reimplement this to delete the configuration entries for username, password, host, path, port and current verion. Make sure to emit the accountDelted() signal after deleting the data. The default version does nothing.
|
pure virtual |
Returns the host the ownCloud/Nextcloud is installed on.
Reimplement this function in a subclass.
|
virtual |
Returns true if SSL/TLS errors should be ignored.
The default implementation returns false.
|
pure virtual |
Returns the optional installation path of the ownCloud/Nextcloud on the server.
Reimplement this function in a subclass.
|
virtual |
Returns the last date and time in UTC a successful snychronization has been performed.
Reimplement this in a subclass if you want let the Synchronizer save the last sync time. The default implementation returns a invalid QDateTime. Your implementation should also return an invalid QDateTime if there has been no last sync.
|
virtual |
Returns a user agent string usable for the login flow.
In the login flow API, the user agent is used to show the user the application that requests a new application password and will also be used for the identifier of the generated application password.
See also https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html
Reimplement this in a subclass. The default implementation simply returns the same as getUserAgent(), the string "Libfuoten $VERSION" and that is not really meaningful to a user.
|
pure virtual |
Returns the password used for authentiction.
Reimplement this function in a subclass.
|
virtual |
Returns the item deletion strategy for the feed identified by feedId.
The default implementation returns FuotenEnums::NoItemDeletion.
| feedId | ID of the feed to get the deletion strategy for |
|
virtual |
Returns the deletion value for the feed identified by feedId.
If getPerFeedDeletionStrategy() returns FuotenEnums::DeleteItemsByTime, the returned value should be treated as older than n days. If for example 5 is returned, all items in the feed that are older than 5 days should be removed. Reference time should be the publication time.
If getPerFeedDeletionStrategy() return FuotenEnums::DeleteItemsByCount, the returned value should be treated as numer of items in the feed to keep. If for example 200 is returned, so many items should be deleted that after the deletion the feed contains 200 items.
The default implementation returns 0.
| feedId | ID of the feed to get the deletion value for |
|
virtual |
Returns the server port used for the connection.
The default implementation returns 0, what means that the connection should use the default port for HTTP or HTTPS.
|
virtual |
Returns the user agent to send as request header.
The default implementation returns "Libfuoten VERSION"
|
pure virtual |
Returns the user name used for authentication.
Reimplement this function in a subclass.
|
virtual |
Returns true if the connection should use SSL/TLS.
The default implementation returns true.
|
pure virtual |
Returns true if the account data is valid.
Reimplement this function in a subclass. You can use checkAccountValidity() to perform a simple check if the important values are not empty.
|
virtual |
Sets the host the remote Nextcloud instance runs on.
Reimplement this in a subclass. The default implementation does nothing.
|
virtual |
Sets the path under which the remote Nextcloud instance is installed.
Reimplement this in a subclass. The default implementation does nothing.
|
protectedpure virtual |
Set to true if the account data is valid.
Reimplement this in a subclass. You can use checkAccountValidity() to perform a simple check if the important data is not empty.
|
virtual |
Sets the data and time in UTC the last successfule synchronization has been performed.
Reimplement this in a subclass if you want let the Synchronizer save the last sync time. The default implementation does nothing.
| syncTime | the date and time the last/current synchronization has successfully finished |
|
slot |
Sets the login credentials requested from the login flow v2 API and returns true on success.
This has to be a valid JSON object requested from the polling endpoint. See also https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html
|
slot |
Sets the login credentials requested from the login flow v2 API and returns true on success.
This has to be a valid JSON object requested from the polling endpoint. See also https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html
|
slot |
Sets the login credentials requested from the login flow v2 API and returns true on success.
This has to be a valid JSON object requested from the polling endpoint. See also https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html
|
virtualslot |
Sets login credentials requested from the login flow API and returns true on success.
See also https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html
Reimplement this in a subclass. The default implementation does nothing.
|
virtual |
Sets the password used for authentication.
Reimplement this in a subclass. The default implementation does nothing.
| password | used for authentication |
|
virtual |
Sets the server port used for the connection.
Reimplement this in a subclass. The default implementation does nothing.
|
slot |
Sets the server data via url and returns true on success, otherwise false.
This takes the scheme and the host and if available the port and the path from the url to set them to setUseSSL(), setHost(), setServerPort() and setInstallPath().
|
slot |
Sets the server data via url and returns true on success, otherwise false.
This takes the scheme and the host and if available the port and the path from the url to set them to setUseSSL(), setHost(), setServerPort() and setInstallPath().
|
virtual |
Sets the username used for authentication.
Reimplement this in a subclass. The default implementation does nothing.
| username | used for authentication |
|
virtual |
Set useSSL to true to let the connection use SSL/TLS.
Reimplement this in a subclass. The default implementation does nothing.