QXmpp  Version: 1.4.0
QXmppHttpUploadIq.h
1 /*
2  * Copyright (C) 2008-2021 The QXmpp developers
3  *
4  * Authors:
5  * Linus Jahn
6  *
7  * Source:
8  * https://github.com/qxmpp-project/qxmpp
9  *
10  * This file is a part of QXmpp library.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  */
23 
24 #ifndef QXMPPHTTPUPLOADIQ_H
25 #define QXMPPHTTPUPLOADIQ_H
26 
27 #include "QXmppIq.h"
28 
29 #include <QSharedDataPointer>
30 
31 class QUrl;
32 class QMimeType;
33 
34 class QXmppHttpUploadRequestIqPrivate;
35 class QXmppHttpUploadSlotIqPrivate;
36 
43 
44 class QXMPP_EXPORT QXmppHttpUploadRequestIq : public QXmppIq
45 {
46 public:
49  ~QXmppHttpUploadRequestIq() override;
50 
52 
53  QString fileName() const;
54  void setFileName(const QString &filename);
55 
56  qint64 size() const;
57  void setSize(qint64 size);
58 
59  QMimeType contentType() const;
60  void setContentType(const QMimeType &type);
61 
62  static bool isHttpUploadRequestIq(const QDomElement &element);
63 
64 protected:
66  void parseElementFromChild(const QDomElement &element) override;
67  void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
69 
70 private:
71  QSharedDataPointer<QXmppHttpUploadRequestIqPrivate> d;
72 };
73 
80 
81 class QXMPP_EXPORT QXmppHttpUploadSlotIq : public QXmppIq
82 {
83 public:
86  ~QXmppHttpUploadSlotIq() override;
87 
89 
90  QUrl putUrl() const;
91  void setPutUrl(const QUrl &putUrl);
92 
93  QUrl getUrl() const;
94  void setGetUrl(const QUrl &getUrl);
95 
96  QMap<QString, QString> putHeaders() const;
97  void setPutHeaders(const QMap<QString, QString> &putHeaders);
98 
99  static bool isHttpUploadSlotIq(const QDomElement &element);
100 
101 protected:
103  void parseElementFromChild(const QDomElement &element) override;
104  void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
106 
107 private:
108  QSharedDataPointer<QXmppHttpUploadSlotIqPrivate> d;
109 };
110 
111 #endif // QXMPPHTTPUPLOADIQ_H
Represents an HTTP File Upload IQ for requesting an upload slot as defined by XEP-0363: HTTP File Upl...
Definition: QXmppHttpUploadIq.h:45
Represents an HTTP File Upload IQ result for receiving an upload slot as defined by XEP-0363: HTTP Fi...
Definition: QXmppHttpUploadIq.h:82
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:42
QXmppIq & operator=(const QXmppIq &other)
Assigns other to this IQ.
Definition: QXmppIq.cpp:68