MauiKit File Browsing

WebDAVClient.hpp
1#pragma once
2
3#include <QIODevice>
4#include <QList>
5#include <QNetworkAccessManager>
6#include <QNetworkReply>
7#include <QSslError>
8#include <QString>
9
10#include "filebrowsing_export.h"
11
12#include "utils/NetworkHelper.hpp"
13#include "utils/WebDAVReply.hpp"
14#include "utils/XMLHelper.hpp"
15
16enum ListDepthEnum { Zero, One, Two, Infinity };
17
18class FILEBROWSING_EXPORT WebDAVClient : public QObject
19{
20 Q_OBJECT
21
22public:
23 WebDAVClient(QString host, QString username, QString password);
24
25 WebDAVReply* listDir(QString path = QStringLiteral("/"));
26 WebDAVReply* listDir(QString path, ListDepthEnum depth);
27
28 WebDAVReply* downloadFrom(QString path);
29 WebDAVReply* downloadFrom(QString path, qint64 startByte, qint64 endByte);
30
31 WebDAVReply* uploadTo(QString path, QString filename, QIODevice* file);
32
33 WebDAVReply* createDir(QString path, QString dirName);
34
35 WebDAVReply* copy(QString source, QString destination);
36
37 WebDAVReply* move(QString source, QString destination,
38 bool overwrite = false);
39
41
42 ~WebDAVClient();
43
44private:
45 NetworkHelper* networkHelper;
46 XMLHelper* xmlHelper;
47
48 void errorReplyHandler(WebDAVReply* reply, QNetworkReply::NetworkError err);
49};
Wraps the available actions for a remote item.
KIOCORE_EXPORT CopyJob * move(const QList< QUrl > &src, const QUrl &dest, JobFlags flags=DefaultFlags)
KIOCORE_EXPORT CopyJob * copy(const QList< QUrl > &src, const QUrl &dest, JobFlags flags=DefaultFlags)
KIOCORE_EXPORT ListJob * listDir(const QUrl &url, JobFlags flags=DefaultFlags, ListJob::ListFlags listFlags=ListJob::ListFlag::IncludeHidden)
KGuiItem remove()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:32:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.