QXmpp: QXmppHttpUploadIq.h Source File

QXmpp Version: 1.14.4

Loading...
Searching...
No Matches
QXmppHttpUploadIq.h
1// SPDX-FileCopyrightText: 2019 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPHTTPUPLOADIQ_H
6#define QXMPPHTTPUPLOADIQ_H
7
8#include "QXmppIq.h"
9
10#include <QSharedDataPointer>
11
12class QUrl;
13class QMimeType;
14
15class QXmppHttpUploadRequestIqPrivate;
16class QXmppHttpUploadSlotIqPrivate;
17
26 class QXMPP_EXPORT QXmppHttpUploadRequestIq : public QXmppIq
27{
28public:
29 QXmppHttpUploadRequestIq();
30 QXmppHttpUploadRequestIq(const QXmppHttpUploadRequestIq &);
31 QXmppHttpUploadRequestIq(QXmppHttpUploadRequestIq &&);
32 ~QXmppHttpUploadRequestIq() override;
33
34 QXmppHttpUploadRequestIq &operator=(const QXmppHttpUploadRequestIq &);
35 QXmppHttpUploadRequestIq &operator=(QXmppHttpUploadRequestIq &&);
36
37 QString fileName() const;
38 void setFileName(const QString &filename);
39
40 qint64 size() const;
41 void setSize(qint64 size);
42
43 QMimeType contentType() const;
44 void setContentType(const QMimeType &type);
45
47 static constexpr std::tuple PayloadXmlTag = { u"request", QXmpp::Private::ns_http_upload };
48 [[deprecated("Use QXmpp::isIqElement()")]]
49 static bool isHttpUploadRequestIq(const QDomElement &element);
50
51protected:
52 void parseElementFromChild(const QDomElement &element) override;
53 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
55
56private:
57 QSharedDataPointer<QXmppHttpUploadRequestIqPrivate> d;
58};
59
68 class QXMPP_EXPORT QXmppHttpUploadSlotIq : public QXmppIq
69{
70public:
71 QXmppHttpUploadSlotIq();
72 QXmppHttpUploadSlotIq(const QXmppHttpUploadSlotIq &);
73 QXmppHttpUploadSlotIq(QXmppHttpUploadSlotIq &&);
74 ~QXmppHttpUploadSlotIq() override;
75
76 QXmppHttpUploadSlotIq &operator=(const QXmppHttpUploadSlotIq &);
77 QXmppHttpUploadSlotIq &operator=(QXmppHttpUploadSlotIq &&);
78
79 QUrl putUrl() const;
80 void setPutUrl(const QUrl &putUrl);
81
82 QUrl getUrl() const;
83 void setGetUrl(const QUrl &getUrl);
84
85 QMap<QString, QString> putHeaders() const;
86 void setPutHeaders(const QMap<QString, QString> &putHeaders);
87
89 static constexpr std::tuple PayloadXmlTag = { u"slot", QXmpp::Private::ns_http_upload };
90 [[deprecated("Use QXmpp::isIqElement()")]]
91 static bool isHttpUploadSlotIq(const QDomElement &element);
92
93protected:
94 void parseElementFromChild(const QDomElement &element) override;
95 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
97
98private:
99 QSharedDataPointer<QXmppHttpUploadSlotIqPrivate> d;
100};
101
102#endif // QXMPPHTTPUPLOADIQ_H
QXmppHttpUploadRequestIq::setContentType
void setContentType(const QMimeType &type)
Definition QXmppHttpUploadIq.cpp:86
QXmppHttpUploadRequestIq::contentType
QMimeType contentType() const
Definition QXmppHttpUploadIq.cpp:78
QXmppHttpUploadRequestIq::operator=
QXmppHttpUploadRequestIq & operator=(const QXmppHttpUploadRequestIq &)
Default assignment operator.
QXmppHttpUploadRequestIq::QXmppHttpUploadRequestIq
QXmppHttpUploadRequestIq(const QXmppHttpUploadRequestIq &)
Default copy-constructor.
QXmppHttpUploadRequestIq::size
qint64 size() const
Definition QXmppHttpUploadIq.cpp:62
QXmppHttpUploadRequestIq::fileName
QString fileName() const
Definition QXmppHttpUploadIq.cpp:43
QXmppHttpUploadRequestIq::operator=
QXmppHttpUploadRequestIq & operator=(QXmppHttpUploadRequestIq &&)
Default assignment operator.
QXmppHttpUploadRequestIq::QXmppHttpUploadRequestIq
QXmppHttpUploadRequestIq(QXmppHttpUploadRequestIq &&)
Default move-constructor.
QXmppHttpUploadRequestIq::setSize
void setSize(qint64 size)
Definition QXmppHttpUploadIq.cpp:70
QXmppHttpUploadRequestIq::setFileName
void setFileName(const QString &filename)
Definition QXmppHttpUploadIq.cpp:54
QXmppHttpUploadSlotIq::putUrl
QUrl putUrl() const
Definition QXmppHttpUploadIq.cpp:143
QXmppHttpUploadSlotIq::getUrl
QUrl getUrl() const
Definition QXmppHttpUploadIq.cpp:159
QXmppHttpUploadSlotIq::setGetUrl
void setGetUrl(const QUrl &getUrl)
Definition QXmppHttpUploadIq.cpp:167
QXmppHttpUploadSlotIq::setPutHeaders
void setPutHeaders(const QMap< QString, QString > &putHeaders)
Definition QXmppHttpUploadIq.cpp:187
QXmppHttpUploadSlotIq::setPutUrl
void setPutUrl(const QUrl &putUrl)
Definition QXmppHttpUploadIq.cpp:151
QXmppHttpUploadSlotIq::operator=
QXmppHttpUploadSlotIq & operator=(QXmppHttpUploadSlotIq &&)
Default move-assignment operator.
QXmppHttpUploadSlotIq::QXmppHttpUploadSlotIq
QXmppHttpUploadSlotIq(const QXmppHttpUploadSlotIq &)
Default copy-constructor.
QXmppHttpUploadSlotIq::QXmppHttpUploadSlotIq
QXmppHttpUploadSlotIq(QXmppHttpUploadSlotIq &&)
Default move-constructor.
QXmppHttpUploadSlotIq::operator=
QXmppHttpUploadSlotIq & operator=(const QXmppHttpUploadSlotIq &)
Default assignment operator.
QXmppHttpUploadSlotIq::putHeaders
QMap< QString, QString > putHeaders() const
Definition QXmppHttpUploadIq.cpp:177
QXmppIq::QXmppIq
QXmppIq(QXmppIq::Type type=QXmppIq::Get)
Definition QXmppIq.cpp:39
QXmppIq::type
QXmppIq::Type type() const
Definition QXmppIq.cpp:60