File indexing completed on 2024-04-21 03:51:33

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2011 Laszlo Papp <djszapi@archlinux.us>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #ifndef ATTICA_PUTJOB_H
0010 #define ATTICA_PUTJOB_H
0011 
0012 #include <QNetworkRequest>
0013 
0014 #include "attica_export.h"
0015 #include "atticabasejob.h"
0016 
0017 // workaround to get initialization working with gcc < 4.4
0018 typedef QMap<QString, QString> StringMap;
0019 
0020 namespace Attica
0021 {
0022 class Provider;
0023 
0024 /**
0025  * @class PutJob putjob.h <Attica/PutJob>
0026  *
0027  * Represents a put job.
0028  */
0029 class ATTICA_EXPORT PutJob : public BaseJob
0030 {
0031     Q_OBJECT
0032 
0033 protected:
0034     PutJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data);
0035     PutJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap &parameters = StringMap());
0036     PutJob(PlatformDependent *internals, const QNetworkRequest &request, const QByteArray &byteArray);
0037 
0038 private:
0039     QNetworkReply *executeRequest() override;
0040     void parse(const QString &) override;
0041 
0042     QIODevice *m_ioDevice;
0043     QByteArray m_byteArray;
0044 
0045     QString m_responseData;
0046     const QNetworkRequest m_request;
0047 
0048     QString m_status;
0049     QString m_statusMessage;
0050 
0051     friend class Attica::Provider;
0052 };
0053 
0054 }
0055 
0056 #endif