diff --git a/src/restapi/changechanneltopicjob.cpp b/src/restapi/changechanneltopicjob.cpp index 6ab604c2..2ca50693 100644 --- a/src/restapi/changechanneltopicjob.cpp +++ b/src/restapi/changechanneltopicjob.cpp @@ -1,71 +1,77 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "changechanneltopicjob.h" #include "ruqola_restapi_debug.h" ChangeChannelTopicJob::ChangeChannelTopicJob(QObject *parent) : RestApiAbstractJob(parent) { } ChangeChannelTopicJob::~ChangeChannelTopicJob() { } bool ChangeChannelTopicJob::start() { if (!canStart()) { deleteLater(); return false; } //TODO return false; } bool ChangeChannelTopicJob::requireHttpAuthentication() const { return true; } bool ChangeChannelTopicJob::canStart() const { if (mTopic.isEmpty()) { qCWarning(RUQOLA_RESTAPI_LOG) << "Topic is empty"; return false; } if (!RestApiAbstractJob::canStart()) { qCWarning(RUQOLA_RESTAPI_LOG) << "Impossible to start ChangeChannelTopicJob job"; return false; } return true; } QString ChangeChannelTopicJob::topic() const { return mTopic; } void ChangeChannelTopicJob::setTopic(const QString &topic) { mTopic = topic; } + + +QNetworkRequest ChangeChannelTopicJob::request() const +{ + return {}; +} diff --git a/src/restapi/changechanneltopicjob.h b/src/restapi/changechanneltopicjob.h index 61c0716a..47614c4a 100644 --- a/src/restapi/changechanneltopicjob.h +++ b/src/restapi/changechanneltopicjob.h @@ -1,46 +1,48 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CHANGECHANNELTOPICJOB_H #define CHANGECHANNELTOPICJOB_H #include "restapiabstractjob.h" #include "libruqola_private_export.h" class LIBRUQOLACORE_TESTS_EXPORT ChangeChannelTopicJob : public RestApiAbstractJob { Q_OBJECT public: explicit ChangeChannelTopicJob(QObject *parent = nullptr); ~ChangeChannelTopicJob() override; bool start() override; bool requireHttpAuthentication() const override; bool canStart() const override; QString topic() const; void setTopic(const QString &topic); + QNetworkRequest request() const override; private: Q_DISABLE_COPY(ChangeChannelTopicJob) QString mTopic; + }; #endif // CHANGECHANNELTOPICJOB_H diff --git a/src/restapi/channellistjob.h b/src/restapi/channellistjob.h index 680730b2..ee360db0 100644 --- a/src/restapi/channellistjob.h +++ b/src/restapi/channellistjob.h @@ -1,47 +1,47 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CHANNELLISTJOB_H #define CHANNELLISTJOB_H #include "restapiabstractjob.h" #include "libruqola_private_export.h" class LIBRUQOLACORE_TESTS_EXPORT ChannelListJob : public RestApiAbstractJob { Q_OBJECT public: explicit ChannelListJob(QObject *parent = nullptr); ~ChannelListJob() override; bool start() override; bool requireHttpAuthentication() const override; - QNetworkRequest request() const; + QNetworkRequest request() const override; Q_SIGNALS: void channelListDone(const QByteArray &data); private: Q_DISABLE_COPY(ChannelListJob) void slotListInfo(); }; #endif // CHANNELLISTJOB_H diff --git a/src/restapi/downloadfilejob.h b/src/restapi/downloadfilejob.h index e319b76e..313f172f 100644 --- a/src/restapi/downloadfilejob.h +++ b/src/restapi/downloadfilejob.h @@ -1,65 +1,65 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DOWNLOADFILEJOB_H #define DOWNLOADFILEJOB_H #include "restapiabstractjob.h" #include class DownloadFileJob : public RestApiAbstractJob { Q_OBJECT public: explicit DownloadFileJob(QObject *parent = nullptr); ~DownloadFileJob() override; bool start() override; bool requireHttpAuthentication() const override; bool canStart() const override; QUrl url() const; void setUrl(const QUrl &url); QString mimeType() const; void setMimeType(const QString &mimeType); - QNetworkRequest request() const; + QNetworkRequest request() const override; bool storeInCache() const; void setStoreInCache(bool storeInCache); QUrl localFileUrl() const; void setLocalFileUrl(const QUrl &localFileUrl); Q_SIGNALS: void downloadFileDone(const QByteArray &data, const QUrl &url, bool useCache, const QUrl &localFileUrl); private: Q_DISABLE_COPY(DownloadFileJob) void slotDownloadDone(); QUrl mUrl; QString mMimeType; QUrl mLocalFileUrl; bool mStoreInCache = true; }; #endif // DOWNLOADFILEJOB_H diff --git a/src/restapi/getavatarjob.h b/src/restapi/getavatarjob.h index 310bfc63..66c244f4 100644 --- a/src/restapi/getavatarjob.h +++ b/src/restapi/getavatarjob.h @@ -1,54 +1,54 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GETAVATARJOB_H #define GETAVATARJOB_H #include "libruqola_private_export.h" #include "restapiabstractjob.h" #include class LIBRUQOLACORE_TESTS_EXPORT GetAvatarJob : public RestApiAbstractJob { Q_OBJECT public: explicit GetAvatarJob(QObject *parent = nullptr); ~GetAvatarJob() override; bool start() override; bool requireHttpAuthentication() const override; QString avatarUserId() const; void setAvatarUserId(const QString &avatarUserId); - QNetworkRequest request() const; + QNetworkRequest request() const override; bool canStart() const override; Q_SIGNALS: void avatar(const QString &userId, const QString &url); private: Q_DISABLE_COPY(GetAvatarJob) void slotGetAvatarInfo(); QString mAvatarUserId; }; #endif // GETAVATARJOB_H diff --git a/src/restapi/loginjob.h b/src/restapi/loginjob.h index 1c9a777d..55c8af0a 100644 --- a/src/restapi/loginjob.h +++ b/src/restapi/loginjob.h @@ -1,58 +1,58 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef LOGINJOB_H #define LOGINJOB_H #include "libruqola_private_export.h" #include "restapiabstractjob.h" #include class LIBRUQOLACORE_TESTS_EXPORT LoginJob : public RestApiAbstractJob { Q_OBJECT public: explicit LoginJob(QObject *parent = nullptr); ~LoginJob() override; bool start() override; bool requireHttpAuthentication() const override; QString userName() const; void setUserName(const QString &userName); QString password() const; void setPassword(const QString &password); bool canStart() const override; - QNetworkRequest request() const; + QNetworkRequest request() const override; QJsonDocument json() const; Q_SIGNALS: void loginDone(const QString &authToken, const QString &userId); private: Q_DISABLE_COPY(LoginJob) void slotLoginDone(); QString mUserName; QString mPassword; }; #endif // LOGINJOB_H diff --git a/src/restapi/logoutjob.h b/src/restapi/logoutjob.h index 7d8a2663..c98d84e6 100644 --- a/src/restapi/logoutjob.h +++ b/src/restapi/logoutjob.h @@ -1,48 +1,48 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef LOGOUTJOB_H #define LOGOUTJOB_H #include "libruqola_private_export.h" #include "restapiabstractjob.h" #include class LIBRUQOLACORE_TESTS_EXPORT LogoutJob : public RestApiAbstractJob { Q_OBJECT public: explicit LogoutJob(QObject *parent = nullptr); ~LogoutJob() override; bool start() override; bool requireHttpAuthentication() const override; - QNetworkRequest request() const; + QNetworkRequest request() const override; Q_SIGNALS: void logoutDone(); private: Q_DISABLE_COPY(LogoutJob) void slotLogout(); }; #endif // LOGOUTJOB_H diff --git a/src/restapi/owninfojob.h b/src/restapi/owninfojob.h index 11a42991..c393b0f2 100644 --- a/src/restapi/owninfojob.h +++ b/src/restapi/owninfojob.h @@ -1,50 +1,50 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef OWNINFOJOB_H #define OWNINFOJOB_H #include "restapiabstractjob.h" #include "libruqola_private_export.h" #include class LIBRUQOLACORE_TESTS_EXPORT OwnInfoJob : public RestApiAbstractJob { Q_OBJECT public: explicit OwnInfoJob(QObject *parent = nullptr); ~OwnInfoJob() override; bool requireHttpAuthentication() const override; bool start() override; - QNetworkRequest request() const; + QNetworkRequest request() const override; Q_SIGNALS: void ownInfoDone(const QByteArray &data); private: Q_DISABLE_COPY(OwnInfoJob) void slotServerInfoFinished(); }; #endif // OWNINFOJOB_H diff --git a/src/restapi/pinmessagejob.cpp b/src/restapi/pinmessagejob.cpp index 009fb3a7..4f86de12 100644 --- a/src/restapi/pinmessagejob.cpp +++ b/src/restapi/pinmessagejob.cpp @@ -1,64 +1,68 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "pinmessagejob.h" #include "restapimethod.h" #include "ruqola_restapi_debug.h" PinMessageJob::PinMessageJob(QObject *parent) : RestApiAbstractJob(parent) { } PinMessageJob::~PinMessageJob() { } bool PinMessageJob::start() { if (!canStart()) { deleteLater(); return false; } //TODO return true; } bool PinMessageJob::requireHttpAuthentication() const { return true; } bool PinMessageJob::canStart() const { if (!RestApiAbstractJob::canStart()) { qCWarning(RUQOLA_RESTAPI_LOG) << "Impossible to start PinMessageJob"; return false; } // if (!mUrl.isValid()) { // qCWarning(RUQOLA_RESTAPI_LOG) << "PinMessageJob: url is not valid"; // return false; // } return true; } +QNetworkRequest PinMessageJob::request() const +{ + return {}; +} diff --git a/src/restapi/pinmessagejob.h b/src/restapi/pinmessagejob.h index b65eb1e7..9c8a76a7 100644 --- a/src/restapi/pinmessagejob.h +++ b/src/restapi/pinmessagejob.h @@ -1,41 +1,42 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PINMESSAGEJOB_H #define PINMESSAGEJOB_H #include "restapiabstractjob.h" #include "libruqola_private_export.h" class LIBRUQOLACORE_TESTS_EXPORT PinMessageJob : public RestApiAbstractJob { Q_OBJECT public: explicit PinMessageJob(QObject *parent = nullptr); ~PinMessageJob() override; bool start() override; bool requireHttpAuthentication() const override; bool canStart() const override; + QNetworkRequest request() const override; private: Q_DISABLE_COPY(PinMessageJob) }; #endif // PINMESSAGEJOB_H diff --git a/src/restapi/postmessagejob.cpp b/src/restapi/postmessagejob.cpp index 56f31103..9e1e83d8 100644 --- a/src/restapi/postmessagejob.cpp +++ b/src/restapi/postmessagejob.cpp @@ -1,44 +1,50 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "postmessagejob.h" PostMessageJob::PostMessageJob(QObject *parent) : RestApiAbstractJob(parent) { } PostMessageJob::~PostMessageJob() { } bool PostMessageJob::start() { //TODO return false; } bool PostMessageJob::requireHttpAuthentication() const { return true; } + + +QNetworkRequest PostMessageJob::request() const +{ + return {}; +} diff --git a/src/restapi/postmessagejob.h b/src/restapi/postmessagejob.h index 91a3eea4..de262cfc 100644 --- a/src/restapi/postmessagejob.h +++ b/src/restapi/postmessagejob.h @@ -1,41 +1,42 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef POSTMESSAGEJOB_H #define POSTMESSAGEJOB_H #include "restapiabstractjob.h" #include "libruqola_private_export.h" class LIBRUQOLACORE_TESTS_EXPORT PostMessageJob : public RestApiAbstractJob { Q_OBJECT public: explicit PostMessageJob(QObject *parent = nullptr); ~PostMessageJob() override; bool start() override; bool requireHttpAuthentication() const override; + QNetworkRequest request() const override; private: Q_DISABLE_COPY(PostMessageJob) }; #endif // POSTMESSAGEJOB_H diff --git a/src/restapi/privateinfojob.h b/src/restapi/privateinfojob.h index 9cfac166..9f333776 100644 --- a/src/restapi/privateinfojob.h +++ b/src/restapi/privateinfojob.h @@ -1,47 +1,47 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PRIVATEINFOJOB_H #define PRIVATEINFOJOB_H #include "restapiabstractjob.h" #include "libruqola_private_export.h" #include class LIBRUQOLACORE_TESTS_EXPORT PrivateInfoJob : public RestApiAbstractJob { Q_OBJECT public: explicit PrivateInfoJob(QObject *parent = nullptr); ~PrivateInfoJob() override; bool start() override; bool requireHttpAuthentication() const override; - QNetworkRequest request() const; + QNetworkRequest request() const override; Q_SIGNALS: void privateInfoDone(const QByteArray &data); private: Q_DISABLE_COPY(PrivateInfoJob) void slotPrivateInfoDone(); }; #endif // PRIVATEINFOJOB_H diff --git a/src/restapi/restapiabstractjob.h b/src/restapi/restapiabstractjob.h index 64199a9c..946cd42a 100644 --- a/src/restapi/restapiabstractjob.h +++ b/src/restapi/restapiabstractjob.h @@ -1,68 +1,69 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef RESTAPIABSTRACTJOB_H #define RESTAPIABSTRACTJOB_H #include +#include #include "libruqola_private_export.h" class QNetworkAccessManager; -class QNetworkRequest; class RestApiMethod; class RuqolaLogger; class LIBRUQOLACORE_TESTS_EXPORT RestApiAbstractJob : public QObject { public: explicit RestApiAbstractJob(QObject *parent = nullptr); QNetworkAccessManager *networkAccessManager() const; void setNetworkAccessManager(QNetworkAccessManager *networkAccessManager); RestApiMethod *restApiMethod() const; void setRestApiMethod(RestApiMethod *restApiMethod); QString authToken() const; void setAuthToken(const QString &authToken); QString userId() const; void setUserId(const QString &userId); bool hasAuthenticationValue() const; virtual bool start() = 0; virtual bool requireHttpAuthentication() const = 0; RuqolaLogger *ruqolaLogger() const; void setRuqolaLogger(RuqolaLogger *ruqolaLogger); void addLoggerInfo(const QByteArray &str); virtual bool canStart() const; + virtual QNetworkRequest request() const = 0; protected: Q_DISABLE_COPY(RestApiAbstractJob) void addAuthRawHeader(QNetworkRequest &request) const; QString mAuthToken; QString mUserId; QNetworkAccessManager *mNetworkAccessManager = nullptr; RestApiMethod *mRestApiMethod = nullptr; RuqolaLogger *mRuqolaLogger = nullptr; }; #endif // RESTAPIABSTRACTJOB_H diff --git a/src/restapi/serverinfojob.h b/src/restapi/serverinfojob.h index 113cb0f9..5e3e82bb 100644 --- a/src/restapi/serverinfojob.h +++ b/src/restapi/serverinfojob.h @@ -1,48 +1,48 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SERVERINFOJOB_H #define SERVERINFOJOB_H #include "restapiabstractjob.h" #include "libruqola_private_export.h" class QNetworkRequest; class LIBRUQOLACORE_TESTS_EXPORT ServerInfoJob : public RestApiAbstractJob { Q_OBJECT public: explicit ServerInfoJob(QObject *parent = nullptr); ~ServerInfoJob() override; bool start() override; - QNetworkRequest request() const; + QNetworkRequest request() const override; bool requireHttpAuthentication() const override; Q_SIGNALS: void serverInfoDone(const QString &versionInfo); private: Q_DISABLE_COPY(ServerInfoJob) void slotServerInfoFinished(); }; #endif // SERVERINFOJOB_H diff --git a/src/restapi/starmessagejob.h b/src/restapi/starmessagejob.h index ab473653..4990cb18 100644 --- a/src/restapi/starmessagejob.h +++ b/src/restapi/starmessagejob.h @@ -1,58 +1,58 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef STARMESSAGEJOB_H #define STARMESSAGEJOB_H #include "restapiabstractjob.h" #include "libruqola_private_export.h" class QNetworkRequest; class LIBRUQOLACORE_TESTS_EXPORT StarMessageJob : public RestApiAbstractJob { Q_OBJECT public: explicit StarMessageJob(QObject *parent = nullptr); ~StarMessageJob() override; bool start() override; bool requireHttpAuthentication() const override; QString messageId() const; void setMessageId(const QString &messageId); - QNetworkRequest request() const; + QNetworkRequest request() const override; QJsonDocument json() const; bool starMessage() const; void setStarMessage(bool starMessage); bool canStart() const override; Q_SIGNALS: void messageStarred(); private: Q_DISABLE_COPY(StarMessageJob) void slotStarMessageFinished(); QString mMessageId; bool mStarMessage = true; }; #endif // STARMESSAGEJOB_H diff --git a/src/restapi/uploadfilejob.h b/src/restapi/uploadfilejob.h index e5d84257..a93ab97c 100644 --- a/src/restapi/uploadfilejob.h +++ b/src/restapi/uploadfilejob.h @@ -1,63 +1,63 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef UPLOADFILEJOB_H #define UPLOADFILEJOB_H #include #include #include #include "libruqola_private_export.h" #include "restapiabstractjob.h" class LIBRUQOLACORE_TESTS_EXPORT UploadFileJob : public RestApiAbstractJob { Q_OBJECT public: explicit UploadFileJob(QObject *parent = nullptr); ~UploadFileJob() override; bool start() override; QString roomId() const; void setRoomId(const QString &roomId); QString description() const; void setDescription(const QString &description); QString messageText() const; void setMessageText(const QString &messageText); QUrl filenameUrl() const; void setFilenameUrl(const QUrl &filenameUrl); bool requireHttpAuthentication() const override final; - QNetworkRequest request() const; + QNetworkRequest request() const override; bool canStart() const override; private: Q_DISABLE_COPY(UploadFileJob) void slotUploadFinished(); QString mRoomId; QString mDescription; QString mMessageText; QUrl mFilenameUrl; }; #endif // UPLOADFILEJOB_H