1 | /* |
2 | SPDX-FileCopyrightText: 2010 Grégory Oestreicher <greg@kamago.net> |
3 | |
4 | Based on DavItemsListJob: |
5 | SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org> |
6 | |
7 | SPDX-License-Identifier: LGPL-2.0-or-later |
8 | */ |
9 | |
10 | #ifndef KDAV_DAVITEMSFETCHJOB_H |
11 | #define KDAV_DAVITEMSFETCHJOB_H |
12 | |
13 | #include "kdav_export.h" |
14 | |
15 | #include "davitem.h" |
16 | #include "davjobbase.h" |
17 | #include "davurl.h" |
18 | |
19 | #include <QStringList> |
20 | |
21 | namespace KDAV |
22 | { |
23 | class DavItemsFetchJobPrivate; |
24 | |
25 | /** |
26 | * @class DavItemsFetchJob davitemsfetchjob.h <KDAV/DavItemsFetchJob> |
27 | * |
28 | * @short A job that fetches a list of items from a DAV server using a MULTIGET query. |
29 | */ |
30 | class KDAV_EXPORT DavItemsFetchJob : public DavJobBase |
31 | { |
32 | Q_OBJECT |
33 | |
34 | public: |
35 | /** |
36 | * Creates a new items fetch job. |
37 | * |
38 | * @param collectionUrl The DAV collection on which to run the query |
39 | * @param urls The list of URLs to fetch |
40 | * @param parent The parent object |
41 | */ |
42 | DavItemsFetchJob(const DavUrl &collectionUrl, const QStringList &urls, QObject *parent = nullptr); |
43 | |
44 | /** |
45 | * Starts the job. |
46 | */ |
47 | void start() override; |
48 | |
49 | /** |
50 | * Returns the list of fetched items |
51 | */ |
52 | Q_REQUIRED_RESULT DavItem::List items() const; |
53 | |
54 | /** |
55 | * Return the item found at @p url |
56 | */ |
57 | Q_REQUIRED_RESULT DavItem item(const QString &url) const; |
58 | |
59 | private: |
60 | Q_DECLARE_PRIVATE(DavItemsFetchJob) |
61 | }; |
62 | } |
63 | |
64 | #endif |
65 | |