QXmpp Version: 1.5.6
Loading...
Searching...
No Matches
QXmppFileMetadata.h
1// SPDX-FileCopyrightText: 2022 Jonah BrĂ¼chert <jbb@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPFILEMETADATA_H
6#define QXMPPFILEMETADATA_H
7
8#include "QXmppGlobal.h"
9
10#include <optional>
11
12#include <QSharedDataPointer>
13
14class QDomElement;
15class QDateTime;
16class QMimeType;
17class QXmlStreamWriter;
18class QXmppHash;
19class QXmppThumbnail;
20class QXmppFileMetadataPrivate;
21class QFileInfo;
22
23class QXMPP_EXPORT QXmppFileMetadata
24{
25public:
26 static QXmppFileMetadata fromFileInfo(const QFileInfo &info);
27
29 QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppFileMetadata)
30
31
32 bool parse(const QDomElement &el);
33 void toXml(QXmlStreamWriter *writer) const;
35
36 const std::optional<QDateTime> &lastModified() const;
37 void setLastModified(const std::optional<QDateTime> &date);
38
39 const std::optional<QString> &description() const;
40 void setDescription(const std::optional<QString> &description);
41
42 const QVector<QXmppHash> &hashes() const;
43 void setHashes(const QVector<QXmppHash> &hashes);
44
45 std::optional<uint32_t> height() const;
46 void setHeight(std::optional<uint32_t> height);
47
48 std::optional<uint32_t> length() const;
49 void setLength(std::optional<uint32_t> length);
50
51 const std::optional<QMimeType> &mediaType() const;
52 void setMediaType(std::optional<QMimeType> mediaType);
53
54 std::optional<QString> filename() const;
55 void setFilename(std::optional<QString>);
56
57 std::optional<uint64_t> size() const;
58 void setSize(std::optional<uint64_t> size);
59
60 const QVector<QXmppThumbnail> &thumbnails() const;
61 void setThumbnails(const QVector<QXmppThumbnail> &thumbnail);
62
63 std::optional<uint32_t> width() const;
64 void setWidth(std::optional<uint32_t> width);
65
66private:
67 QSharedDataPointer<QXmppFileMetadataPrivate> d;
68};
69
70#endif
Definition QXmppFileMetadata.h:24
Definition QXmppHash.h:37
Definition QXmppThumbnail.h:20