Loading...
Searching...
No Matches
QXmppFileMetadata.h
// SPDX-FileCopyrightText: 2022 Jonah Brüchert <jbb@kaidan.im>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPFILEMETADATA_H
#define QXMPPFILEMETADATA_H
#include "QXmppGlobal.h"
#include <optional>
#include <QSharedDataPointer>
class QDomElement;
class QDateTime;
class QMimeType;
class QXmlStreamWriter;
class QXmppHash;
class QXmppThumbnail;
class QXmppFileMetadataPrivate;
class QFileInfo;
class QXMPP_EXPORT QXmppFileMetadata
{
public:
static QXmppFileMetadata fromFileInfo(const QFileInfo &info);
QXmppFileMetadata();
QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppFileMetadata)
bool parse(const QDomElement &el);
void toXml(QXmlStreamWriter *writer) const;
const std::optional<QDateTime> &lastModified() const;
void setLastModified(const std::optional<QDateTime> &date);
const std::optional<QString> &description() const;
void setDescription(const std::optional<QString> &description);
const QVector<QXmppHash> &hashes() const;
void setHashes(const QVector<QXmppHash> &hashes);
std::optional<uint32_t> height() const;
void setHeight(std::optional<uint32_t> height);
std::optional<uint32_t> length() const;
void setLength(std::optional<uint32_t> length);
const std::optional<QMimeType> &mediaType() const;
void setMediaType(std::optional<QMimeType> mediaType);
std::optional<QString> filename() const;
void setFilename(std::optional<QString>);
std::optional<uint64_t> size() const;
void setSize(std::optional<uint64_t> size);
const QVector<QXmppThumbnail> &thumbnails() const;
void setThumbnails(const QVector<QXmppThumbnail> &thumbnail);
std::optional<uint32_t> width() const;
void setWidth(std::optional<uint32_t> width);
private:
QSharedDataPointer<QXmppFileMetadataPrivate> d;
};
#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