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 | |
19 | namespace Attica |
20 | { |
21 | class Provider; |
22 | |
23 | /** |
24 | * @class ItemJob itemjob.h <Attica/ItemJob> |
25 | * |
26 | * Represents an item get job. |
27 | */ |
28 | template<class T> |
29 | class ATTICA_EXPORT ItemJob : public GetJob |
30 | { |
31 | public: |
32 | T result() const; |
33 | |
34 | private: |
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 | */ |
46 | template<class T> |
47 | class ATTICA_EXPORT ItemDeleteJob : public DeleteJob |
48 | { |
49 | public: |
50 | T result() const; |
51 | |
52 | private: |
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 | */ |
64 | template<class T> |
65 | class ATTICA_EXPORT ItemPostJob : public PostJob |
66 | { |
67 | public: |
68 | T result() const; |
69 | |
70 | private: |
71 | ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data); |
72 | ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap ¶meters = 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 | */ |
84 | template<class T> |
85 | class ATTICA_EXPORT ItemPutJob : public PutJob |
86 | { |
87 | public: |
88 | T result() const; |
89 | |
90 | private: |
91 | ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data); |
92 | ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap ¶meters = 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 | |