Libkdav2

davcollectionsmultifetchjob.h
1/*
2 Copyright (c) 2010 Tobias Koenig <tokoe@kde.org>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19#ifndef KDAV2_DAVCOLLECTIONSMULTIFETCHJOB_H
20#define KDAV2_DAVCOLLECTIONSMULTIFETCHJOB_H
21
22#include "kpimkdav2_export.h"
23
24#include "davcollection.h"
25#include "davurl.h"
26
27#include <KCoreAddons/KJob>
28
29namespace KDAV2
30{
31
32/**
33 * @short A job that fetches all DAV collection.
34 *
35 * This job is used to fetch all DAV collection that are available
36 * under a certain list of DAV urls.
37 *
38 * @note This class just combines multiple calls of DavCollectionsFetchJob
39 * into one job.
40 */
41class KPIMKDAV2_EXPORT DavCollectionsMultiFetchJob : public KJob
42{
43 Q_OBJECT
44
45public:
46 /**
47 * Creates a new dav collections multi fetch job.
48 *
49 * @param urls The list of DAV urls whose sub collections shall be fetched.
50 * @param parent The parent object.
51 */
52 explicit DavCollectionsMultiFetchJob(const DavUrl::List &urls, QObject *parent = nullptr);
53
54 /**
55 * Starts the job.
56 */
57 void start() Q_DECL_OVERRIDE;
58
59 /**
60 * Returns the list of fetched DAV collections.
61 */
62 DavCollection::List collections() const;
63
64Q_SIGNALS:
65 /**
66 * This signal is emitted every time a new collection has been discovered.
67 *
68 * @param collectionUrl The URL of the discovered collection
69 * @param configuredUrl The URL given to the job
70 */
71 void collectionDiscovered(int protocol, const QString &collectionUrl, const QString &configuredUrl);
72
73private Q_SLOTS:
74 void davJobFinished(KJob *);
75
76private:
77 DavUrl::List mUrls;
78 DavCollection::List mCollections;
79 uint mSubJobCount;
80};
81
82}
83
84#endif
A job that fetches all DAV collection.
void collectionDiscovered(int protocol, const QString &collectionUrl, const QString &configuredUrl)
This signal is emitted every time a new collection has been discovered.
Q_SCRIPTABLE Q_NOREPLY void start()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.