1 | /* |
2 | This file is part of KDE. |
3 | |
4 | SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@kde.org> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
7 | */ |
8 | |
9 | #ifndef ATTICA_POSTJOB_H |
10 | #define ATTICA_POSTJOB_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 PostJob postjob.h <Attica/PostJob> |
26 | * |
27 | * Represents a post job. |
28 | */ |
29 | class ATTICA_EXPORT PostJob : public BaseJob |
30 | { |
31 | Q_OBJECT |
32 | |
33 | protected: |
34 | PostJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data); |
35 | PostJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap ¶meters = StringMap()); |
36 | PostJob(PlatformDependent *internals, const QNetworkRequest &request, const QByteArray &byteArray); |
37 | |
38 | private: |
39 | QNetworkReply *executeRequest() override; |
40 | void parse(const QString &) override; |
41 | |
42 | QIODevice *m_ioDevice; |
43 | QByteArray m_byteArray; |
44 | |
45 | QString m_responseData; |
46 | const QNetworkRequest m_request; |
47 | |
48 | QString m_status; |
49 | QString m_statusMessage; |
50 | |
51 | friend class Attica::Provider; |
52 | }; |
53 | |
54 | } |
55 | |
56 | #endif |
57 | |