QXmpp: QXmppFileMetadata.h Source File

QXmpp Version: 1.14.4

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
23 class QXMPP_EXPORT QXmppFileMetadata
24{
25public:
26 static QXmppFileMetadata fromFileInfo(const QFileInfo &info);
27
28 QXmppFileMetadata();
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
QXmppFileMetadata::setThumbnails
void setThumbnails(const QVector< QXmppThumbnail > &thumbnail)
Sets the thumbnail references.
Definition QXmppFileMetadata.cpp:231
QXmppFileMetadata::height
std::optional< uint32_t > height() const
Returns the height of the image.
Definition QXmppFileMetadata.cpp:165
QXmppFileMetadata::size
std::optional< uint64_t > size() const
Returns the size of the file in bytes.
Definition QXmppFileMetadata.cpp:213
QXmppFileMetadata::setDescription
void setDescription(const std::optional< QString > &description)
Sets the description of the file.
Definition QXmppFileMetadata.cpp:147
QXmppFileMetadata::fromFileInfo
static QXmppFileMetadata fromFileInfo(const QFileInfo &info)
Creates a QXmppFileMetadata object from information from QFileInfo.
Definition QXmppFileMetadata.cpp:54
QXmppFileMetadata::description
const std::optional< QString > & description() const
Returns the description of the file.
Definition QXmppFileMetadata.cpp:141
QXmppFileMetadata::setSize
void setSize(std::optional< uint64_t > size)
Sets the size of the file in bytes.
Definition QXmppFileMetadata.cpp:219
QXmppFileMetadata::setFilename
void setFilename(std::optional< QString >)
Sets the filename.
Definition QXmppFileMetadata.cpp:207
QXmppFileMetadata::thumbnails
const QVector< QXmppThumbnail > & thumbnails() const
Returns the thumbnail references.
Definition QXmppFileMetadata.cpp:225
QXmppFileMetadata::setMediaType
void setMediaType(std::optional< QMimeType > mediaType)
Sets the media type of the file.
Definition QXmppFileMetadata.cpp:195
QXmppFileMetadata::setHeight
void setHeight(std::optional< uint32_t > height)
Sets the height of the image.
Definition QXmppFileMetadata.cpp:171
QXmppFileMetadata::setLength
void setLength(std::optional< uint32_t > length)
Sets the length of a video or audio file.
Definition QXmppFileMetadata.cpp:183
QXmppFileMetadata::width
std::optional< uint32_t > width() const
Returns the width of the image or video.
Definition QXmppFileMetadata.cpp:237
QXmppFileMetadata::hashes
const QVector< QXmppHash > & hashes() const
Returns the hashes of the file.
Definition QXmppFileMetadata.cpp:153
QXmppFileMetadata::setLastModified
void setLastModified(const std::optional< QDateTime > &date)
Sets when the file was last modified.
Definition QXmppFileMetadata.cpp:135
QXmppFileMetadata::length
std::optional< uint32_t > length() const
Returns the length of a video or audio file.
Definition QXmppFileMetadata.cpp:177
QXmppFileMetadata::setHashes
void setHashes(const QVector< QXmppHash > &hashes)
Sets the hashes of the file.
Definition QXmppFileMetadata.cpp:159
QXmppFileMetadata::mediaType
const std::optional< QMimeType > & mediaType() const
Returns the media type of the file.
Definition QXmppFileMetadata.cpp:189
QXmppFileMetadata::lastModified
const std::optional< QDateTime > & lastModified() const
Returns when the file was last modified.
Definition QXmppFileMetadata.cpp:129
QXmppFileMetadata::setWidth
void setWidth(std::optional< uint32_t > width)
Sets the width of the image or video.
Definition QXmppFileMetadata.cpp:243
QXmppFileMetadata::filename
std::optional< QString > filename() const
Returns the filename.
Definition QXmppFileMetadata.cpp:201
QXmppHash
Definition QXmppHash.h:40
QXmppThumbnail
Definition QXmppThumbnail.h:21