File indexing completed on 2024-04-28 03:53:55

0001 /*
0002     SPDX-FileCopyrightText: 2010 Grégory Oestreicher <greg@kamago.net>
0003 
0004     Based on DavItemsListJob:
0005     SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 #ifndef KDAV_DAVITEMSFETCHJOB_H
0011 #define KDAV_DAVITEMSFETCHJOB_H
0012 
0013 #include "kdav_export.h"
0014 
0015 #include "davitem.h"
0016 #include "davjobbase.h"
0017 #include "davurl.h"
0018 
0019 #include <QStringList>
0020 
0021 namespace KDAV
0022 {
0023 class DavItemsFetchJobPrivate;
0024 
0025 /**
0026  * @class DavItemsFetchJob davitemsfetchjob.h <KDAV/DavItemsFetchJob>
0027  *
0028  * @short A job that fetches a list of items from a DAV server using a MULTIGET query.
0029  */
0030 class KDAV_EXPORT DavItemsFetchJob : public DavJobBase
0031 {
0032     Q_OBJECT
0033 
0034 public:
0035     /**
0036      * Creates a new items fetch job.
0037      *
0038      * @param collectionUrl The DAV collection on which to run the query
0039      * @param urls The list of URLs to fetch
0040      * @param parent The parent object
0041      */
0042     DavItemsFetchJob(const DavUrl &collectionUrl, const QStringList &urls, QObject *parent = nullptr);
0043 
0044     /**
0045      * Starts the job.
0046      */
0047     void start() override;
0048 
0049     /**
0050      * Returns the list of fetched items
0051      */
0052     Q_REQUIRED_RESULT DavItem::List items() const;
0053 
0054     /**
0055      * Return the item found at @p url
0056      */
0057     Q_REQUIRED_RESULT DavItem item(const QString &url) const;
0058 
0059 private:
0060     Q_DECLARE_PRIVATE(DavItemsFetchJob)
0061 };
0062 }
0063 
0064 #endif