1 | /* |
2 | This file is part of KDE. |
3 | |
4 | SPDX-FileCopyrightText: 2011 Laszlo Papp <djszapi@archlinux.us> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
7 | */ |
8 | |
9 | #ifndef ATTICA_PUTJOB_H |
10 | #define ATTICA_PUTJOB_H |
11 | |
12 | #include <QNetworkRequest> |
13 | |
14 | #include "attica_export.h" |
15 | #include "atticabasejob.h" |
16 | |
17 | // workaround to get initialization working with gcc < 4.4 |
18 | typedef QMap<QString, QString> StringMap; |
19 | |
20 | namespace Attica |
21 | { |
22 | class Provider; |
23 | |
24 | /*! |
25 | * \class Attica::PutJob |
26 | * \inheaderfile Attica/PutJob |
27 | * \inmodule Attica |
28 | * |
29 | * \brief Represents a put job. |
30 | */ |
31 | class ATTICA_EXPORT PutJob : public BaseJob |
32 | { |
33 | Q_OBJECT |
34 | |
35 | protected: |
36 | PutJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data); |
37 | PutJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap ¶meters = StringMap()); |
38 | PutJob(PlatformDependent *internals, const QNetworkRequest &request, const QByteArray &byteArray); |
39 | |
40 | private: |
41 | QNetworkReply *executeRequest() override; |
42 | void parse(const QString &) override; |
43 | |
44 | QIODevice *m_ioDevice; |
45 | QByteArray m_byteArray; |
46 | |
47 | QString m_responseData; |
48 | const QNetworkRequest m_request; |
49 | |
50 | QString m_status; |
51 | QString m_statusMessage; |
52 | |
53 | friend class Attica::Provider; |
54 | }; |
55 | |
56 | } |
57 | |
58 | #endif |
59 | |