KFileMetaData

embeddedimagedata.h
1 /*
2  EmbeddedImageData extracts binary data of cover art files.
3  SPDX-FileCopyrightText: 2018 Alexander Stippich <[email protected]>
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 
18 namespace KFileMetaData {
19 
20 /**
21  * \class EmbeddedImageData embeddedimagedata.h <KFileMetaData/EmbeddedImageData>
22  *
23  * \brief EmbeddedImageData defines enums for different image types that can
24  * be extracted from the metadata of e.g. music files
25  * @todo KF6 make this an enum only in KF6 similar to properties.h
26  */
27 class KFILEMETADATA_EXPORT EmbeddedImageData {
28 public:
30  virtual ~EmbeddedImageData();
31  /**
32  * @see ImageTypes
33  */
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  };
59  /**
60  * Stores a combination of #ImageType values.
61  */
62  Q_DECLARE_FLAGS(ImageTypes, ImageType)
63 
64 #if KFILEMETADATA_ENABLE_DEPRECATED_SINCE(5, 91)
65 
66  /**
67  * Extracts the images stored in the metadata tags from a file.
68  * By default, the front cover is extracted.
69  * @deprecated Since 5.91 Use ExtractorCollection and ExtractionResult::imageData() instead.
70  */
71 KFILEMETADATA_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 
74  /**
75  * Provides a list of mimetypes which are supported for reading
76  * of embedded images in e.g. audio files.
77  * @since 5.52
78  * @deprecated Since 5.91 Mimetypes are automatically handled when using the Extractor/WriterCollection.
79  */
80 KFILEMETADATA_DEPRECATED_VERSION(5, 91, "Mimetypes are automatically handled when using the Extractor/WriterCollection")
81  QStringList mimeTypes() const;
82 
83  /**
84  * Extracts the images stored in the metadata tags from a file.
85  * By default, the front cover is extracted.
86  * @deprecated Since 5.91 Use WriterCollection and WriteData::addImageData() instead.
87  */
88 KFILEMETADATA_DEPRECATED_VERSION(5, 91, "Use WriterCollection and WriteData::addImageData() instead")
89  void writeImageData(const QString &fileUrl, QMap<ImageType, QByteArray> &imageData);
90 #endif
91 
92 private:
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 ...
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu May 26 2022 03:46:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.