1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org>
5 SPDX-FileCopyrightText: 2011 Laszlo Papp <djszapi@archlinux.us>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
8 */
9
10#ifndef ATTICA_ITEMJOB_H
11#define ATTICA_ITEMJOB_H
12
13#include "attica_export.h"
14#include "deletejob.h"
15#include "getjob.h"
16#include "postjob.h"
17#include "putjob.h"
18
19namespace Attica
20{
21class Provider;
22
23/**
24 * @class ItemJob itemjob.h <Attica/ItemJob>
25 *
26 * Represents an item get job.
27 */
28template<class T>
29class ATTICA_EXPORT ItemJob : public GetJob
30{
31public:
32 T result() const;
33
34private:
35 ItemJob(PlatformDependent *, const QNetworkRequest &request);
36 void parse(const QString &xml) override;
37 T m_item;
38 friend class Attica::Provider;
39};
40
41/**
42 * @class ItemDeleteJob itemjob.h <Attica/ItemJob>
43 *
44 * Represents an item delete job.
45 */
46template<class T>
47class ATTICA_EXPORT ItemDeleteJob : public DeleteJob
48{
49public:
50 T result() const;
51
52private:
53 ItemDeleteJob(PlatformDependent *, const QNetworkRequest &request);
54 void parse(const QString &xml) override;
55 T m_item;
56 friend class Attica::Provider;
57};
58
59/**
60 * @class ItemPostJob itemjob.h <Attica/ItemJob>
61 *
62 * Represents an item post job.
63 */
64template<class T>
65class ATTICA_EXPORT ItemPostJob : public PostJob
66{
67public:
68 T result() const;
69
70private:
71 ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data);
72 ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap &parameters = StringMap());
73
74 void parse(const QString &xml) override;
75 T m_item;
76 friend class Attica::Provider;
77};
78
79/**
80 * @class ItemPutJob itemjob.h <Attica/ItemJob>
81 *
82 * Represents an item put job.
83 */
84template<class T>
85class ATTICA_EXPORT ItemPutJob : public PutJob
86{
87public:
88 T result() const;
89
90private:
91 ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data);
92 ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap &parameters = StringMap());
93
94 void parse(const QString &xml) override;
95 T m_item;
96 friend class Attica::Provider;
97};
98
99}
100
101#endif
102

source code of attica/src/itemjob.h