KDAV

davitemslistjob.h
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_DAVITEMSLISTJOB_H
8#define KDAV_DAVITEMSLISTJOB_H
9
10#include "kdav_export.h"
11
12#include "davitem.h"
13#include "davjobbase.h"
14
15#include <memory>
16
17#include <QStringList>
18
19namespace KDAV
20{
21class EtagCache;
22class DavUrl;
23class DavItemsListJobPrivate;
24
25/**
26 * @class DavItemsListJob davitemslistjob.h <KDAV/DavItemsListJob>
27 *
28 * @short A job that lists all DAV items inside a DAV collection.
29 */
30class KDAV_EXPORT DavItemsListJob : public DavJobBase
31{
33
34public:
35 /**
36 * Creates a new DAV items list job.
37 *
38 * @param url The URL of the DAV collection.
39 * @param parent The parent object.
40 */
41 DavItemsListJob(const DavUrl &url, const std::shared_ptr<EtagCache> &cache, QObject *parent = nullptr);
42
43 ~DavItemsListJob() override;
44
45 /**
46 * Limits the mime types of the items requested.
47 *
48 * If no mime type is given then all will be requested.
49 *
50 * @param types The list of mime types to include
51 */
52 void setContentMimeTypes(const QStringList &types);
53
54 /**
55 * Sets the start and end time to list items for.
56 *
57 * @param start The range start, in format "date with UTC time"
58 * @param end The range end, in format "date with UTC time"
59 */
60 void setTimeRange(const QString &start, const QString &end);
61
62 /**
63 * Starts the job.
64 */
65 void start() override;
66
67 /**
68 * Returns the list of items seen including identifier URL and ETag information.
69 */
70 Q_REQUIRED_RESULT DavItem::List items() const;
71
72 /**
73 * Returns the list of items that were changed on the server.
74 */
75 Q_REQUIRED_RESULT DavItem::List changedItems() const;
76
77 /**
78 * Returns the list of items URLs that were not seen in the backend.
79 * As this is based on the ETag cache this may contain dependent items.
80 */
81 Q_REQUIRED_RESULT QStringList deletedItems() const;
82
83private:
84 Q_DECLARE_PRIVATE(DavItemsListJob)
85};
86}
87
88#endif
QList< DavItem > List
Defines a list of DAV item objects.
Definition davitem.h:44
void setTimeRange(const QString &start, const QString &end)
Sets the start and end time to list items for.
void setContentMimeTypes(const QStringList &types)
Limits the mime types of the items requested.
DavItem::List items() const
Returns the list of items seen including identifier URL and ETag information.
QStringList deletedItems() const
Returns the list of items URLs that were not seen in the backend.
DavItemsListJob(const DavUrl &url, const std::shared_ptr< EtagCache > &cache, QObject *parent=nullptr)
Creates a new DAV items list job.
DavItem::List changedItems() const
Returns the list of items that were changed on the server.
void start() override
Starts the job.
A helper class to combine URL and protocol of a DAV URL.
Definition davurl.h:27
A helper class to cache ETags.
Definition etagcache.h:32
Q_SCRIPTABLE Q_NOREPLY void start()
The KDAV namespace.
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:49:16 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.