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
20// TODO KF6 make this an enum only in KF6 similar to properties.h
21/*!
22 * \class KFileMetaData::EmbeddedImageData
23 * \inheaderfile KFileMetaData/EmbeddedImageData
24 * \inmodule KFileMetaData
25 *
26 * \brief EmbeddedImageData defines enums for different image types that can
27 * be extracted from the metadata of e.g. music files.
28 */
29class KFILEMETADATA_EXPORT EmbeddedImageData {
30public:
31 /*!
32 *
33 */
34 EmbeddedImageData();
35 virtual ~EmbeddedImageData();
36 /*!
37 * \value FrontCover
38 * \value Other
39 * \value FileIcon
40 * \value OtherFileIcon
41 * \value BackCover
42 * \value LeafletPage
43 * \value Media
44 * \value LeadArtist
45 * \value Artist
46 * \value Conductor
47 * \value Band
48 * \value Composer
49 * \value Lyricist
50 * \value RecordingLocation
51 * \value DuringRecording
52 * \value DuringPerformance
53 * \value MovieScreenCapture
54 * \value ColouredFish
55 * \value Illustration
56 * \value BandLogo
57 * \value PublisherLogo
58 * \value Unknown
59 * \value AllImages
60 */
61 enum ImageType {
62 FrontCover = 1 << 0x0,
63 Other = 1 << 0x01,
64 FileIcon = 1 << 0x02,
65 OtherFileIcon = 1 << 0x03,
66 BackCover = 1 << 0x04,
67 LeafletPage = 1 << 0x05,
68 Media = 1 << 0x06,
69 LeadArtist = 1 << 0x07,
70 Artist = 1 << 0x08,
71 Conductor = 1 << 0x09,
72 Band = 1 << 0x0A,
73 Composer = 1 << 0x0B,
74 Lyricist = 1 << 0x0C,
75 RecordingLocation = 1 << 0x0D,
76 DuringRecording = 1 << 0x0E,
77 DuringPerformance = 1 << 0x0F,
78 MovieScreenCapture = 1 << 0x10,
79 ColouredFish = 1 << 0x11,
80 Illustration = 1 << 0x12,
81 = 1 << 0x13,
82 = 1 << 0x14,
83 Unknown = 1 << 30,
84 AllImages = 0x7fffffff
85 };
86 Q_DECLARE_FLAGS(ImageTypes, ImageType)
87
88private:
89 class Private;
90 std::unique_ptr<Private> d;
91 EmbeddedImageData& operator=(const EmbeddedImageData&) = delete;
92};
93
94}
95
96Q_DECLARE_METATYPE(KFileMetaData::EmbeddedImageData::ImageType)
97Q_DECLARE_METATYPE(KFileMetaData::EmbeddedImageData::ImageTypes)
98
99#endif // KFILEMETADATA_EMBEDDEDIMAGEDATA_H
100

source code of kfilemetadata/src/embeddedimagedata.h