1/*
2 SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KDAV_DAVCOLLECTIONSFETCHJOB_H
8#define KDAV_DAVCOLLECTIONSFETCHJOB_H
9
10#include "kdav_export.h"
11
12#include "davcollection.h"
13#include "davjobbase.h"
14#include "davurl.h"
15
16namespace KDAV
17{
18class DavCollectionsFetchJobPrivate;
19
20/**
21 * @class DavCollectionsFetchJob davcollectionsfetchjob.h <KDAV/DavCollectionsFetchJob>
22 *
23 * @short A job that fetches all DAV collection.
24 *
25 * This job is used to fetch all DAV collection that are available
26 * under a certain DAV URL.
27 */
28class KDAV_EXPORT DavCollectionsFetchJob : public DavJobBase
29{
30 Q_OBJECT
31
32public:
33 /**
34 * Creates a new DAV collections fetch job.
35 *
36 * @param url The DAV URL of the DAV collection whose sub collections shall be fetched.
37 * @param parent The parent object.
38 */
39 explicit DavCollectionsFetchJob(const DavUrl &url, QObject *parent = nullptr);
40
41 /**
42 * Starts the job.
43 */
44 void start() override;
45
46 /**
47 * Returns the list of fetched DAV collections.
48 */
49 Q_REQUIRED_RESULT DavCollection::List collections() const;
50
51 /**
52 * Return the DavUrl used by this job
53 */
54 Q_REQUIRED_RESULT DavUrl davUrl() const;
55
56Q_SIGNALS:
57 /**
58 * This signal is emitted every time a new collection has been discovered.
59 *
60 * @param collectionUrl The URL of the discovered collection
61 * @param configuredUrl The URL given to the job
62 */
63 void collectionDiscovered(KDAV::Protocol protocol, const QString &collectionUrl, const QString &configuredUrl);
64
65private:
66 Q_DECLARE_PRIVATE(DavCollectionsFetchJob)
67};
68}
69
70#endif
71

source code of kdav/src/common/davcollectionsfetchjob.h