File indexing completed on 2024-05-12 07:50:05

0001 // -*- c++ -*-
0002 /*
0003     This file is part of the KDE libraries
0004     SPDX-FileCopyrightText: 2002 Jan-Pascal van Best <janpascal@vanbest.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #ifndef KIO_DAVJOB_H
0010 #define KIO_DAVJOB_H
0011 
0012 #include "global.h"
0013 #include "kiocore_export.h"
0014 #include "transferjob.h"
0015 
0016 #include <QObject>
0017 #include <QPointer>
0018 #include <QString>
0019 #include <QStringList>
0020 
0021 #include <sys/stat.h>
0022 #include <sys/types.h>
0023 
0024 namespace KIO
0025 {
0026 
0027 class DavJobPrivate;
0028 /**
0029  * @class KIO::DavJob davjob.h <KIO/DavJob>
0030  *
0031  * The transfer job pumps data into and/or out of a KIO worker.
0032  * Data is sent to the worker on request of the worker ( dataReq).
0033  * If data coming from the worker can not be handled, the
0034  * reading of data from the worker should be suspended.
0035  * @see KIO::davPropFind()
0036  * @see KIO::davPropPatch()
0037  * @see KIO::davSearch()
0038  */
0039 class KIOCORE_EXPORT DavJob : public TransferJob
0040 {
0041     Q_OBJECT
0042 public:
0043     /**
0044      * Returns the reponse data.
0045      *  @since 5.86
0046      */
0047     QByteArray responseData() const;
0048 
0049 protected Q_SLOTS:
0050     void slotFinished() override;
0051     void slotData(const QByteArray &data) override;
0052 
0053 protected:
0054     KIOCORE_NO_EXPORT DavJob(DavJobPrivate &dd, int, const QString &);
0055 
0056 private:
0057     Q_DECLARE_PRIVATE(DavJob)
0058 };
0059 
0060 /**
0061  * Creates a new DavJob that issues a PROPFIND command. PROPFIND retrieves
0062  * the properties of the resource identified by the given @p url.
0063  *
0064  * @param url the URL of the resource
0065  * @param properties a propfind document that describes the properties that
0066  *        should be retrieved
0067  * @param depth the depth of the request. Can be "0", "1" or "infinity"
0068  * @param flags We support HideProgressInfo here
0069  * @return the new DavJob
0070  * @since 5.84
0071  */
0072 KIOCORE_EXPORT DavJob *davPropFind(const QUrl &url, const QString &properties, const QString &depth, JobFlags flags = DefaultFlags);
0073 
0074 /**
0075  * Creates a new DavJob that issues a PROPPATCH command. PROPPATCH sets
0076  * the properties of the resource identified by the given @p url.
0077  *
0078  * @param url the URL of the resource
0079  * @param properties a PROPPACTCH document that describes the properties that
0080  *        should be modified and its new values
0081  * @param flags We support HideProgressInfo here
0082  * @return the new DavJob
0083  * @since 5.84
0084  */
0085 KIOCORE_EXPORT DavJob *davPropPatch(const QUrl &url, const QString &properties, JobFlags flags = DefaultFlags);
0086 
0087 /**
0088  * Creates a new DavJob that issues a SEARCH command.
0089  *
0090  * @param url the URL of the resource
0091  * @param nsURI the URI of the search method's qualified name
0092  * @param qName the local part of the search method's qualified name
0093  * @param query the search string
0094  * @param flags We support HideProgressInfo here
0095  * @return the new DavJob
0096  */
0097 KIOCORE_EXPORT DavJob *davSearch(const QUrl &url, const QString &nsURI, const QString &qName, const QString &query, JobFlags flags = DefaultFlags);
0098 
0099 /**
0100  * Creates a new DavJob that issues a REPORT command.
0101  *
0102  * @param url the URL of the resource
0103  * @param report a REPORT document that describes the request to make
0104  * @param depth the depth of the request. Can be "0", "1" or "infinity"
0105  * @param flags We support HideProgressInfo here
0106  * @return the new DavJob
0107  */
0108 KIOCORE_EXPORT DavJob *davReport(const QUrl &url, const QString &report, const QString &depth, JobFlags flags = DefaultFlags);
0109 
0110 } // namespace KIO
0111 
0112 #endif