File indexing completed on 2024-05-12 05:22:29

0001 /*
0002  * This file is part of LibKGAPI library
0003  *
0004  * SPDX-FileCopyrightText: 2023 Claudio Cambra <claudio.cambra@kde.org>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #pragma once
0010 
0011 #include "modifyjob.h"
0012 #include "kgapipeople_export.h"
0013 
0014 namespace KGAPI2::People
0015 {
0016 
0017 class KGAPIPEOPLE_EXPORT PersonPhotoUpdateJob : public KGAPI2::ModifyJob
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     explicit PersonPhotoUpdateJob(const QString &personResourceName, const QByteArray &photoRawData, const AccountPtr &account, QObject* parent = nullptr);
0023     ~PersonPhotoUpdateJob();
0024 
0025 protected:
0026     void start() override;
0027 
0028     void dispatchRequest(QNetworkAccessManager *accessManager,
0029                          const QNetworkRequest &request,
0030                          const QByteArray &data,
0031                          const QString &contentType) override;
0032     ObjectsList handleReplyWithItems(const QNetworkReply *reply,
0033                                      const QByteArray &rawData) override;
0034 
0035 private:
0036     class Private;
0037     std::unique_ptr<Private> d;
0038     friend class Private;
0039 };
0040 
0041 }