diff --git a/src/platformdependent.h b/src/platformdependent.h --- a/src/platformdependent.h +++ b/src/platformdependent.h @@ -54,10 +54,33 @@ virtual void enableProvider(const QUrl &baseUrl, bool enabled) const = 0; virtual bool isEnabled(const QUrl &baseUrl) const = 0; + /** + * Asks the PlatformDependent plugin if it have a credentials for baseUrl + */ virtual bool hasCredentials(const QUrl &baseUrl) const = 0; + + /** + * Asks the PlatformDependent plugin to load credentials from storage, + * and save it in user, password. + */ virtual bool loadCredentials(const QUrl &baseUrl, QString &user, QString &password) = 0; + + /** + * Asks the PlatformDependent plugin to ask user to login and expects it to be stored in + * user and password. + * TODO KF6: Remove, askForCredentials and loadCredentials is essentially same, loadCredentials + * can itself ask for credentials if it is not present in store. + */ virtual bool askForCredentials(const QUrl &baseUrl, QString &user, QString &password) = 0; + + /** + * Method to be called by attica to store the user and password in storage used by PlatformDependent + * plugin. + * TODO KF6: Remove, if you let platform plugin ask for credentials, you don't want to save credentials + * yourself and let plugin handle it. + */ virtual bool saveCredentials(const QUrl &baseUrl, const QString &user, const QString &password) = 0; + virtual QNetworkReply *get(const QNetworkRequest &request) = 0; virtual QNetworkReply *post(const QNetworkRequest &request, QIODevice *data) = 0; virtual QNetworkReply *post(const QNetworkRequest &request, const QByteArray &data) = 0;