1// -*- c++ -*-
2/*
3 This file is part of the KDE libraries
4 SPDX-FileCopyrightText: 2002 Jan-Pascal van Best <janpascal@vanbest.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KIO_DAVJOB_H
10#define KIO_DAVJOB_H
11
12#include "global.h"
13#include "kiocore_export.h"
14#include "transferjob.h"
15
16#include <QObject>
17#include <QPointer>
18#include <QString>
19#include <QStringList>
20
21#include <sys/stat.h>
22#include <sys/types.h>
23
24namespace KIO
25{
26
27class DavJobPrivate;
28/**
29 * @class KIO::DavJob davjob.h <KIO/DavJob>
30 *
31 * The transfer job pumps data into and/or out of a KIO worker.
32 * Data is sent to the worker on request of the worker ( dataReq).
33 * If data coming from the worker can not be handled, the
34 * reading of data from the worker should be suspended.
35 * @see KIO::davPropFind()
36 * @see KIO::davPropPatch()
37 * @see KIO::davSearch()
38 */
39class KIOCORE_EXPORT DavJob : public TransferJob
40{
41 Q_OBJECT
42public:
43 /**
44 * Returns the reponse data.
45 * @since 5.86
46 */
47 QByteArray responseData() const;
48
49protected Q_SLOTS:
50 void slotFinished() override;
51 void slotData(const QByteArray &data) override;
52
53protected:
54 KIOCORE_NO_EXPORT DavJob(DavJobPrivate &dd, int, const QString &);
55
56private:
57 Q_DECLARE_PRIVATE(DavJob)
58};
59
60/**
61 * Creates a new DavJob that issues a PROPFIND command. PROPFIND retrieves
62 * the properties of the resource identified by the given @p url.
63 *
64 * @param url the URL of the resource
65 * @param properties a propfind document that describes the properties that
66 * should be retrieved
67 * @param depth the depth of the request. Can be "0", "1" or "infinity"
68 * @param flags We support HideProgressInfo here
69 * @return the new DavJob
70 * @since 5.84
71 */
72KIOCORE_EXPORT DavJob *davPropFind(const QUrl &url, const QString &properties, const QString &depth, JobFlags flags = DefaultFlags);
73
74/**
75 * Creates a new DavJob that issues a PROPPATCH command. PROPPATCH sets
76 * the properties of the resource identified by the given @p url.
77 *
78 * @param url the URL of the resource
79 * @param properties a PROPPACTCH document that describes the properties that
80 * should be modified and its new values
81 * @param flags We support HideProgressInfo here
82 * @return the new DavJob
83 * @since 5.84
84 */
85KIOCORE_EXPORT DavJob *davPropPatch(const QUrl &url, const QString &properties, JobFlags flags = DefaultFlags);
86
87/**
88 * Creates a new DavJob that issues a SEARCH command.
89 *
90 * @param url the URL of the resource
91 * @param nsURI the URI of the search method's qualified name
92 * @param qName the local part of the search method's qualified name
93 * @param query the search string
94 * @param flags We support HideProgressInfo here
95 * @return the new DavJob
96 */
97KIOCORE_EXPORT DavJob *davSearch(const QUrl &url, const QString &nsURI, const QString &qName, const QString &query, JobFlags flags = DefaultFlags);
98
99/**
100 * Creates a new DavJob that issues a REPORT command.
101 *
102 * @param url the URL of the resource
103 * @param report a REPORT document that describes the request to make
104 * @param depth the depth of the request. Can be "0", "1" or "infinity"
105 * @param flags We support HideProgressInfo here
106 * @return the new DavJob
107 */
108KIOCORE_EXPORT DavJob *davReport(const QUrl &url, const QString &report, const QString &depth, JobFlags flags = DefaultFlags);
109
110} // namespace KIO
111
112#endif
113

source code of kio/src/core/davjob.h