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 | |
24 | namespace KIO |
25 | { |
26 | |
27 | class DavJobPrivate; |
28 | /*! |
29 | * \class KIO::DavJob |
30 | * \inheaderfile KIO/DavJob |
31 | * \inmodule KIOCore |
32 | * |
33 | * The transfer job pumps data into and/or out of a KIO worker. |
34 | * Data is sent to the worker on request of the worker ( dataReq). |
35 | * If data coming from the worker can not be handled, the |
36 | * reading of data from the worker should be suspended. |
37 | * \sa KIO::davPropFind() |
38 | * \sa KIO::davPropPatch() |
39 | * \sa KIO::davSearch() |
40 | */ |
41 | class KIOCORE_EXPORT DavJob : public TransferJob |
42 | { |
43 | Q_OBJECT |
44 | public: |
45 | /*! |
46 | * Returns the reponse data. |
47 | * \since 5.86 |
48 | */ |
49 | QByteArray responseData() const; |
50 | |
51 | protected Q_SLOTS: |
52 | void slotFinished() override; |
53 | void slotData(const QByteArray &data) override; |
54 | |
55 | protected: |
56 | KIOCORE_NO_EXPORT DavJob(DavJobPrivate &dd, int, const QString &); |
57 | |
58 | private: |
59 | Q_DECLARE_PRIVATE(DavJob) |
60 | }; |
61 | |
62 | /*! |
63 | * \relates KIO::DavJob |
64 | * |
65 | * Creates a new DavJob that issues a PROPFIND command. PROPFIND retrieves |
66 | * the properties of the resource identified by the given \a url. |
67 | * |
68 | * \a url the URL of the resource |
69 | * |
70 | * \a properties a propfind document that describes the properties that |
71 | * should be retrieved |
72 | * |
73 | * \a depth the depth of the request. Can be "0", "1" or "infinity" |
74 | * |
75 | * \a flags We support HideProgressInfo here |
76 | * |
77 | * Returns the new DavJob |
78 | * \since 5.84 |
79 | */ |
80 | KIOCORE_EXPORT DavJob *davPropFind(const QUrl &url, const QString &properties, const QString &depth, JobFlags flags = DefaultFlags); |
81 | |
82 | /*! |
83 | * \relates KIO::DavJob |
84 | * |
85 | * Creates a new DavJob that issues a PROPPATCH command. PROPPATCH sets |
86 | * the properties of the resource identified by the given \a url. |
87 | * |
88 | * \a url the URL of the resource |
89 | * |
90 | * \a properties a PROPPACTCH document that describes the properties that |
91 | * should be modified and its new values |
92 | * |
93 | * \a flags We support HideProgressInfo here |
94 | * |
95 | * Returns the new DavJob |
96 | * \since 5.84 |
97 | */ |
98 | KIOCORE_EXPORT DavJob *davPropPatch(const QUrl &url, const QString &properties, JobFlags flags = DefaultFlags); |
99 | |
100 | /*! |
101 | * \relates KIO::DavJob |
102 | * |
103 | * Creates a new DavJob that issues a SEARCH command. |
104 | * |
105 | * \a url the URL of the resource |
106 | * |
107 | * \a nsURI the URI of the search method's qualified name |
108 | * |
109 | * \a qName the local part of the search method's qualified name |
110 | * |
111 | * \a query the search string |
112 | * |
113 | * \a flags We support HideProgressInfo here |
114 | * |
115 | * Returns the new DavJob |
116 | */ |
117 | KIOCORE_EXPORT DavJob *davSearch(const QUrl &url, const QString &nsURI, const QString &qName, const QString &query, JobFlags flags = DefaultFlags); |
118 | |
119 | /*! |
120 | * \relates KIO::DavJob |
121 | * |
122 | * Creates a new DavJob that issues a REPORT command. |
123 | * |
124 | * \a url the URL of the resource |
125 | * |
126 | * \a report a REPORT document that describes the request to make |
127 | * |
128 | * \a depth the depth of the request. Can be "0", "1" or "infinity" |
129 | * |
130 | * \a flags We support HideProgressInfo here |
131 | * |
132 | * Returns the new DavJob |
133 | */ |
134 | KIOCORE_EXPORT DavJob *davReport(const QUrl &url, const QString &report, const QString &depth, JobFlags flags = DefaultFlags); |
135 | |
136 | } // namespace KIO |
137 | |
138 | #endif |
139 | |