| 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 KDAV::DavItemsFetchJob |
| 27 | * \inheaderfile KDAV/DavItemsFetchJob |
| 28 | * \inmodule KDAV |
| 29 | * |
| 30 | * \brief A job that fetches a list of items from a DAV server using a MULTIGET query. |
| 31 | */ |
| 32 | class KDAV_EXPORT DavItemsFetchJob : public DavJobBase |
| 33 | { |
| 34 | Q_OBJECT |
| 35 | |
| 36 | public: |
| 37 | /*! |
| 38 | * Creates a new items fetch job. |
| 39 | * |
| 40 | * \a collectionUrl The DAV collection on which to run the query |
| 41 | * |
| 42 | * \a urls The list of URLs to fetch |
| 43 | * |
| 44 | * \a parent The parent object |
| 45 | */ |
| 46 | DavItemsFetchJob(const DavUrl &collectionUrl, const QStringList &urls, QObject *parent = nullptr); |
| 47 | |
| 48 | /*! |
| 49 | * Starts the job. |
| 50 | */ |
| 51 | void start() override; |
| 52 | |
| 53 | /*! |
| 54 | * Returns the list of fetched items |
| 55 | */ |
| 56 | Q_REQUIRED_RESULT DavItem::List items() const; |
| 57 | |
| 58 | /*! |
| 59 | * Return the item found at \a url |
| 60 | */ |
| 61 | Q_REQUIRED_RESULT DavItem item(const QString &url) const; |
| 62 | |
| 63 | private: |
| 64 | Q_DECLARE_PRIVATE(DavItemsFetchJob) |
| 65 | }; |
| 66 | } |
| 67 | |
| 68 | #endif |
| 69 | |