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 Attica::ItemJob |
25 | * \inheaderfile Attica/ItemJob |
26 | * \inmodule Attica |
27 | * |
28 | * \brief Represents an item get job. |
29 | */ |
30 | template<class T> |
31 | class ATTICA_EXPORT ItemJob : public GetJob |
32 | { |
33 | public: |
34 | /*! |
35 | * |
36 | */ |
37 | T result() const; |
38 | |
39 | private: |
40 | ItemJob(PlatformDependent *, const QNetworkRequest &request); |
41 | void parse(const QString &xml) override; |
42 | T m_item; |
43 | friend class Attica::Provider; |
44 | }; |
45 | |
46 | /*! |
47 | * \class Attica::ItemDeleteJob |
48 | * \inheaderfile Attica/ItemJob |
49 | * \inmodule Attica |
50 | * |
51 | * \brief Represents an item delete job. |
52 | */ |
53 | template<class T> |
54 | class ATTICA_EXPORT ItemDeleteJob : public DeleteJob |
55 | { |
56 | public: |
57 | /*! |
58 | * |
59 | */ |
60 | T result() const; |
61 | |
62 | private: |
63 | ItemDeleteJob(PlatformDependent *, const QNetworkRequest &request); |
64 | void parse(const QString &xml) override; |
65 | T m_item; |
66 | friend class Attica::Provider; |
67 | }; |
68 | |
69 | /*! |
70 | * \class Attica::ItemPostJob |
71 | * \inheaderfile Attica/ItemJob |
72 | * \inmodule Attica |
73 | * |
74 | * \brief Represents an item post job. |
75 | */ |
76 | template<class T> |
77 | class ATTICA_EXPORT ItemPostJob : public PostJob |
78 | { |
79 | public: |
80 | /*! |
81 | * |
82 | */ |
83 | T result() const; |
84 | |
85 | private: |
86 | ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data); |
87 | ItemPostJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap ¶meters = StringMap()); |
88 | |
89 | void parse(const QString &xml) override; |
90 | T m_item; |
91 | friend class Attica::Provider; |
92 | }; |
93 | |
94 | /*! |
95 | * \class Attica::ItemPutJob |
96 | * \inheaderfile Attica/ItemJob |
97 | * \inmodule Attica |
98 | * |
99 | * \brief Represents an item put job. |
100 | */ |
101 | template<class T> |
102 | class ATTICA_EXPORT ItemPutJob : public PutJob |
103 | { |
104 | public: |
105 | /*! |
106 | * |
107 | */ |
108 | T result() const; |
109 | |
110 | private: |
111 | ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, QIODevice *data); |
112 | ItemPutJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap ¶meters = StringMap()); |
113 | |
114 | void parse(const QString &xml) override; |
115 | T m_item; |
116 | friend class Attica::Provider; |
117 | }; |
118 | |
119 | } |
120 | |
121 | #endif |
122 | |