QXmpp Version: 1.4.0
Loading...
Searching...
No Matches
QXmppUploadRequestManager.h
1/*
2 * Copyright (C) 2008-2021 The QXmpp developers
3 *
4 * Author:
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 QXMPPUPLOADREQUESTMANAGER_H
25#define QXMPPUPLOADREQUESTMANAGER_H
26
27#include <QXmppClientExtension.h>
28
29#include <QSharedDataPointer>
30
31class QFileInfo;
32class QMimeType;
35class QXmppUploadServicePrivate;
36class QXmppUploadRequestManagerPrivate;
37
41
42class QXMPP_EXPORT QXmppUploadService
43{
44public:
48
50
51 QString jid() const;
52 void setJid(const QString &jid);
53
54 qint64 sizeLimit() const;
55 void setSizeLimit(qint64 sizeLimit);
56
57private:
58 QSharedDataPointer<QXmppUploadServicePrivate> d;
59};
60
98{
99 Q_OBJECT
100
101public:
104
105 QString requestUploadSlot(const QFileInfo &file,
106 const QString &uploadService = QString());
107 QString requestUploadSlot(const QFileInfo &file,
108 const QString &customFileName,
109 const QString &uploadService = QString());
110 QString requestUploadSlot(const QString &fileName,
111 qint64 fileSize,
112 const QMimeType &mimeType,
113 const QString &uploadService = QString());
114
115 bool serviceFound() const;
116
117 QVector<QXmppUploadService> uploadServices() const;
118
119 bool handleStanza(const QDomElement &stanza) override;
120
121Q_SIGNALS:
124
129
132
133protected:
134 void setClient(QXmppClient *client) override;
135
136private:
137 void handleDiscoInfo(const QXmppDiscoveryIq &iq);
138
139 QSharedDataPointer<QXmppUploadRequestManagerPrivate> d;
140};
141
142#endif // QXMPPUPLOADREQUESTMANAGER_H
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition: QXmppClientExtension.h:47
The QXmppClient class is the main class for using QXmpp.
Definition: QXmppClient.h:94
QXmppDiscoveryIq represents a discovery IQ request or result containing a list of features and other ...
Definition: QXmppDiscoveryIq.h:44
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 QXmppUploadRequestManager implements the core of XEP-0369: HTTP File Upload.
Definition: QXmppUploadRequestManager.h:98
void requestFailed(const QXmppHttpUploadRequestIq &request)
void serviceFoundChanged()
Emitted when the first upload service has been found.
void slotReceived(const QXmppHttpUploadSlotIq &slot)
Emitted when an upload slot was received.
QXmppUploadService represents an HTTP File Upload service.
Definition: QXmppUploadRequestManager.h:43
QXmppUploadService(const QXmppUploadService &)
Copy constructor.
QXmppUploadService & operator=(const QXmppUploadService &)
Equal operator.