KFileMetaData 5.109.0
embeddedimagedata.h
1/*
2 EmbeddedImageData extracts binary data of cover art files.
3 SPDX-FileCopyrightText: 2018 Alexander Stippich <a.stippich@gmx.net>
4
5 SPDX-License-Identifier: LGPL-2.1-or-later
6*/
7
8#ifndef KFILEMETADATA_EMBEDDEDIMAGEDATA_H
9#define KFILEMETADATA_EMBEDDEDIMAGEDATA_H
10
11#include "kfilemetadata_export.h"
12#include <QByteArray>
13#include <QFlags>
14#include <QMap>
15#include <QMetaType>
16#include <memory>
17
18namespace KFileMetaData {
19
27class KFILEMETADATA_EXPORT EmbeddedImageData {
28public:
30 virtual ~EmbeddedImageData();
34 enum ImageType {
35 FrontCover = 1 << 0x0,
36 Other = 1 << 0x01,
37 FileIcon = 1 << 0x02,
38 OtherFileIcon = 1 << 0x03,
39 BackCover = 1 << 0x04,
40 LeafletPage = 1 << 0x05,
41 Media = 1 << 0x06,
42 LeadArtist = 1 << 0x07,
43 Artist = 1 << 0x08,
44 Conductor = 1 << 0x09,
45 Band = 1 << 0x0A,
46 Composer = 1 << 0x0B,
47 Lyricist = 1 << 0x0C,
48 RecordingLocation = 1 << 0x0D,
49 DuringRecording = 1 << 0x0E,
50 DuringPerformance = 1 << 0x0F,
51 MovieScreenCapture = 1 << 0x10,
52 ColouredFish = 1 << 0x11,
53 Illustration = 1 << 0x12,
54 BandLogo = 1 << 0x13,
55 PublisherLogo = 1 << 0x14,
56 Unknown = 1 << 30,
57 AllImages = 0x7fffffff
58 };
62 Q_DECLARE_FLAGS(ImageTypes, ImageType)
63
64#if KFILEMETADATA_ENABLE_DEPRECATED_SINCE(5, 91)
65
71KFILEMETADATA_DEPRECATED_VERSION(5, 91, "Use ExtractorCollection and ExtractionResult::imageData() instead")
72 QMap<ImageType, QByteArray> imageData(const QString &fileUrl, const EmbeddedImageData::ImageTypes types = FrontCover) const;
73
80KFILEMETADATA_DEPRECATED_VERSION(5, 91, "Mimetypes are automatically handled when using the Extractor/WriterCollection")
81 QStringList mimeTypes() const;
82
88KFILEMETADATA_DEPRECATED_VERSION(5, 91, "Use WriterCollection and WriteData::addImageData() instead")
89 void writeImageData(const QString &fileUrl, QMap<ImageType, QByteArray> &imageData);
90#endif
91
92private:
93 class Private;
94 std::unique_ptr<Private> d;
95 EmbeddedImageData& operator=(const EmbeddedImageData&);
96};
97
98}
99
102
103#endif // KFILEMETADATA_EMBEDDEDIMAGEDATA_H
EmbeddedImageData defines enums for different image types that can be extracted from the metadata of ...
Definition embeddedimagedata.h:27
QFlags< ImageType > ImageTypes
Stores a combination of ImageType values.
Definition embeddedimagedata.h:62
ImageType
Definition embeddedimagedata.h:34