| 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 | |
| 16 | namespace KDAV |
| 17 | { |
| 18 | class DavCollectionsFetchJobPrivate; |
| 19 | |
| 20 | /*! |
| 21 | * \class KDAV::DavCollectionsFetchJob |
| 22 | * \inheaderfile KDAV/DavCollectionsFetchJob |
| 23 | * \inmodule KDAV |
| 24 | * |
| 25 | * \brief A job that fetches all DAV collection. |
| 26 | * |
| 27 | * This job is used to fetch all DAV collection that are available |
| 28 | * under a certain DAV URL. |
| 29 | */ |
| 30 | class KDAV_EXPORT DavCollectionsFetchJob : public DavJobBase |
| 31 | { |
| 32 | Q_OBJECT |
| 33 | |
| 34 | public: |
| 35 | /*! |
| 36 | * Creates a new DAV collections fetch job. |
| 37 | * |
| 38 | * \a url The DAV URL of the DAV collection whose sub collections shall be fetched. |
| 39 | * |
| 40 | * \a parent The parent object. |
| 41 | */ |
| 42 | explicit DavCollectionsFetchJob(const DavUrl &url, QObject *parent = nullptr); |
| 43 | |
| 44 | /*! |
| 45 | * Starts the job. |
| 46 | */ |
| 47 | void start() override; |
| 48 | |
| 49 | /*! |
| 50 | * Returns the list of fetched DAV collections. |
| 51 | */ |
| 52 | Q_REQUIRED_RESULT DavCollection::List collections() const; |
| 53 | |
| 54 | /*! |
| 55 | * Return the DavUrl used by this job |
| 56 | */ |
| 57 | Q_REQUIRED_RESULT DavUrl davUrl() const; |
| 58 | |
| 59 | Q_SIGNALS: |
| 60 | /*! |
| 61 | * This signal is emitted every time a new collection has been discovered. |
| 62 | * |
| 63 | * \a collectionUrl The URL of the discovered collection |
| 64 | * |
| 65 | * \a configuredUrl The URL given to the job |
| 66 | */ |
| 67 | void collectionDiscovered(KDAV::Protocol protocol, const QString &collectionUrl, const QString &configuredUrl); |
| 68 | |
| 69 | private: |
| 70 | Q_DECLARE_PRIVATE(DavCollectionsFetchJob) |
| 71 | }; |
| 72 | } |
| 73 | |
| 74 | #endif |
| 75 | |