Loading...
Searching...
No Matches
QXmppFileShare.h
// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPFILESHARE_H
#define QXMPPFILESHARE_H
#include "QXmppGlobal.h"
#include <any>
#include <functional>
#include <QSharedDataPointer>
class QDomElement;
class QUrl;
class QXmlStreamWriter;
class QXmppFileSharePrivate;
class QXmppFileMetadata;
class QXmppHttpFileSource;
class QXmppEncryptedFileSource;
class QXMPP_EXPORT QXmppFileShare
{
public:
enum Disposition {
Inline,
Attachment,
};
QXmppFileShare();
QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppFileShare)
Disposition disposition() const;
void setDisposition(Disposition);
const QXmppFileMetadata &metadata() const;
void setMetadata(const QXmppFileMetadata &);
const QVector<QXmppHttpFileSource> &httpSources() const;
void setHttpSources(const QVector<QXmppHttpFileSource> &newHttpSources);
const QVector<QXmppEncryptedFileSource> &encryptedSources() const;
void setEncryptedSourecs(const QVector<QXmppEncryptedFileSource> &newEncryptedSources);
bool parse(const QDomElement &el);
void toXml(QXmlStreamWriter *writer) const;
protected:
friend class QXmppFileSharingManager;
friend class QXmppFileUpload;
// Private, internally used API:
void visitSources(std::function<bool(const std::any &)> &&visitor) const;
void addSource(const std::any &source);
private:
QSharedDataPointer<QXmppFileSharePrivate> d;
};
#endif // QXMPPFILESHARE_H
QXmppEncryptedFileSource
Represents an encrypted file source for file sharing.
Definition QXmppEncryptedFileSource.h:21
QXmppFileMetadata
Definition QXmppFileMetadata.h:24
QXmppFileShare
Definition QXmppFileShare.h:24
QXmppFileShare::Disposition
Disposition
Decides whether to display the file contents (e.g. an image) inline in the chat or as a file.
Definition QXmppFileShare.h:26
QXmppFileSharingManager
Definition QXmppFileSharingManager.h:121
QXmppFileUpload
Provides progress of stateless file sharing uploads.
Definition QXmppFileSharingManager.h:32
QXmppHttpFileSource
Definition QXmppHttpFileSource.h:16