KFileMetaData

properties.h
Go to the documentation of this file.
1 /*
2  This file is part of KFileMetaData
3  SPDX-FileCopyrightText: 2014 Vishesh Handa <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7 
8 #ifndef KFILEMETADATA_PROPERTIES
9 #define KFILEMETADATA_PROPERTIES
10 
11 #include "kfilemetadata_export.h"
12 
13 #include <QMap>
14 #include <QVariant>
15 
16 /** @file properties.h <KFileMetaData/Properties> */
17 namespace KFileMetaData {
18 namespace Property {
19 
20 /**
21  * @brief The Property enum contains all files property types that KFileMetaData manipulates
22  *
23  * @todo KF6 remove PropertyCount and LastProperty such that one can easily add new properties
24  */
25 enum Property {
26  FirstProperty = 0,
27  Empty = 0,
28 
29  /**
30  * The Bit Rate of the Audio in the File. Represented as an integer
31  * in kbit/sec
32  */
34 
35  /**
36  * The number of channels of the Audio in the File. Represented as an
37  * integer.
38  */
40 
41  /**
42  * The duration of the media in the file. Represented as an integer
43  * in seconds.
44  */
46 
47  /**
48  * The Genre of an Audio file. This s represented as a string
49  * of genres and not integers. The IDv1 standard provides a list of
50  * commonly excepted genres.
51  */
53 
54  /**
55  * The same rate or frequency of the Audio in the file. This is represented
56  * as an integer in Hz. So a file with "44.1KHz" will have a frequency
57  * of 44100
58  */
60 
61  /**
62  * Represents the track number in a set. Typically maps to the "TRCK" tag
63  * in IDv3
64  */
66 
67  /**
68  * Indicates the year a track was released. Represented as an integer.
69  * Typically mapped to the "TYE (Year)" tag in IDv1
70  */
72 
73  /**
74  * Represents a comment stored in the file. This can map
75  * to e.g. the "COMM" field from IDv3
76  */
78 
79  /**
80  * Represents the artist of a media file. This generally corresponds
81  * to the IDv1 ARTIST tag. Many extractors often split this string
82  * into a number of artists.
83  */
85 
86  /**
87  * Represents the album of a media file. This generally corresponds
88  * to the IDv1 ALBUM tag.
89  */
91 
92  /**
93  * Represents the album artist of a media file. This generally corresponds
94  * to the IDv3 TPE2 ("Band/Orchestra/Accompaniment") tag.
95  */
97 
98  /**
99  * Represents the Composer of a media file. This generally corresponds
100  * to the IDv2 COMPOSER tag.
101  */
103 
104  /**
105  * Represents the Lyricist of a media file. This generally corresponds
106  * to the IDv2 "Lyricist/text writer" tag.
107  */
109 
110  /**
111  * The Author field indicated the primary creator of a document.
112  * This often corresponds directly to dc:creator
113  */
115 
116  /**
117  * Refers to the Title of the content of the file. This can represented
118  * by the IDv1 tag TT2 (Title/songname/content description) or the TITLE
119  * in a PDF file or the 'dc:title' tag in DublinCore.
120  */
122 
123  /**
124  * Refers to the subject of the file. This directly corresponds to the
125  * 'dc:subject' tag from DublinCore.
126  */
128 
129  /**
130  * Refers to the Application used to create this file. In the ODF standard
131  * this maps to the 'meta:generator' tag. In PDFs its mapped to the
132  * "Producer" tag.
133  */
134  Generator,
135 
136  /**
137  * The number of pages in a document
138  */
140 
141  /**
142  * The number of words in a document. This is often only provided for
143  * documents where the word count is available in the metadata.
144  */
146 
147  /**
148  * The number of lines in a document. This is often only provided for
149  * documents where the line count is available in the metadata.
150  */
152 
153  /**
154  * The language the document is written in. This directly maps to the
155  * 'dc:language' tag from DublinCore. We do NOT employ any language
156  * detection schemes on the text.
157  * @since 5.50
158  */
160 
161 #if KFILEMETADATA_ENABLE_DEPRECATED_SINCE(5, 50)
162  /**
163  * Same as @c Language.
164  * @deprecated Since 5.50, use @c Language instead
165  */
166  Langauge KFILEMETADATA_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 50, "Use Language") = Language,
167 #endif
168 
169  /**
170  * The copyright of the file. Represented as a string.
171  */
173 
174  /**
175  * The publisher of the content. Represented as a string.
176  */
178 
179  /**
180  * The date the content of the file was created. This is extracted
181  * from the File MetaData and not from the file system.
182  * In ODF, it corresponds to "meta:creation-date", in PDF to the
183  * "CreationDate" tag, and otherwise the "dcterms:created" tag.
184  */
186 
187  /**
188  * The keywords used to represent the document. This is mostly a string list
189  * of all the keywords.
190  */
192 
193  /**
194  * Represents the width of the Media in pixels. This is generally
195  * only applicable for Images and Videos.
196  */
198 
199  /**
200  * Represents the height of the Media in pixels. This is generally
201  * only applicable for Images and Videos.
202  */
204 
205  /**
206  * The Aspect Ratio of the visual image or video.
207  * It is the width of a pixel divided by the height of the pixel.
208  */
210 
211  /**
212  * Number of frames per second
213  */
215 
216  /**
217  * The manufacturer of the equipment used for generating the file
218  * and metadata. Typically maps to the 'Exif.Image.Make' tag.
219  * @since 5.60
220  */
222 
223 #if KFILEMETADATA_ENABLE_DEPRECATED_SINCE(5, 60)
224  /**
225  * Same as @c Manufacturer.
226  * @deprecated Since 5.60, use @c Manufacturer instead
227  */
228  ImageMake KFILEMETADATA_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 60, "Use Manufacturer") = Manufacturer,
229 #endif
230 
231  /**
232  * The model name of the equipment used for generating the file
233  * and metadata. Typically maps to the 'Exif.Image.Model' tag.
234  * @since 5.60
235  */
237 
238 #if KFILEMETADATA_ENABLE_DEPRECATED_SINCE(5, 60)
239  /**
240  * Same as @c Model.
241  * @deprecated Since 5.60, use @c Model instead
242  */
243  ImageModel KFILEMETADATA_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 60, "Use Model") = Model,
244 #endif
245 
246  ImageDateTime,
247  ImageOrientation,
248  PhotoFlash,
249  PhotoPixelXDimension,
250  PhotoPixelYDimension,
251  PhotoDateTimeOriginal,
252  PhotoFocalLength,
253  PhotoFocalLengthIn35mmFilm,
254  PhotoExposureTime,
255  PhotoFNumber,
256  PhotoApertureValue,
257  PhotoExposureBiasValue,
258  PhotoWhiteBalance,
259  PhotoMeteringMode,
260  PhotoISOSpeedRatings,
261  PhotoSaturation,
262  PhotoSharpness,
263  PhotoGpsLatitude,
264  PhotoGpsLongitude,
265  PhotoGpsAltitude,
266 
267  TranslationUnitsTotal,
268  TranslationUnitsWithTranslation,
269  TranslationUnitsWithDraftTranslation,
270  TranslationLastAuthor,
271  TranslationLastUpDate,
272  TranslationTemplateDate,
273 
274  /**
275  * The URL this file has originally been downloaded from.
276  */
278 
279  /**
280  * The subject of the email this file was originally attached to.
281  */
283 
284  /**
285  * The sender of the email this file was originally attached to.
286  */
288 
289  /**
290  * The message ID of the email this file was originally attached to.
291  */
293 
294  /**
295  * Represents the disc number in a multi-disc set. Typically maps to the "TPOS" tag for mp3
296  */
298 
299  /**
300  * Represents the location where an audio file was recorded.
301  */
302  Location,
303 
304  /**
305  * Represents the (lead) performer of an audio file.
306  */
308 
309  /**
310  * Represents the ensemble of an audio file.
311  */
313 
314  /**
315  * Represents the arranger of an audio file.
316  */
318 
319  /**
320  * Represents the conductor of an audio file.
321  */
323 
324  /**
325  * Represents the opus of an audio file mostly used for classical music.
326  */
328 
329  /**
330  * Represents the label of the content.
331  */
333 
334  /**
335  * Contains the name of the compilation of an audio file.
336  */
338 
339  /**
340  * Contains the license information of the file
341  */
343 
344  /**
345  * For ratings stored in Metadata tags
346  */
348  /**
349  * Contains the lyrics of a song embedded in the file
350  */
352  /**
353  * Contains ReplayGain information for audio files
354  */
356  /**
357  * Contains ReplayGain information for audio files
358  * The album gain is given in "dB"
359  */
361  /**
362  * Contains ReplayGain information for audio files
363  */
365  /**
366  * Contains ReplayGain information for audio files
367  * The track gain is given in "dB"
368  */
370 
371  /**
372  * Represents the description stored in the file. This maps
373  * to the 'dc:description' tag from DublinCore
374  */
376 
377  PropertyCount,
378  LastProperty = PropertyCount-1,
379 
380 };
381 
382 } // namespace Property
383 
384 typedef QMap<Property::Property, QVariant> PropertyMap;
385 using PropertyMultiMap = QMultiMap<Property::Property, QVariant>;
386 
387 #if QT_DEPRECATED_SINCE(5, 15)
388 #if KFILEMETADATA_ENABLE_DEPRECATED_SINCE(5, 89)
389 QT_WARNING_PUSH
390 QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
391 QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
392 
393 KFILEMETADATA_DEPRECATED_VERSION(5, 89, "Deprecated for lack of usage, manaully convert the data if needed")
394 inline QVariantMap toVariantMap(const PropertyMap& propMap) {
395  QVariantMap varMap;
396  PropertyMap::const_iterator it = propMap.constBegin();
397  for (; it != propMap.constEnd(); ++it) {
398  int p = static_cast<int>(it.key());
399  varMap.insertMulti(QString::number(p), it.value());
400  }
401 
402  return varMap;
403 }
404 
405 KFILEMETADATA_DEPRECATED_VERSION(5, 89, "Deprecated for lack of usage, manaully convert the data if needed")
406 inline PropertyMap toPropertyMap(const QVariantMap& varMap) {
407  PropertyMap propMap;
408  QVariantMap::const_iterator it = varMap.constBegin();
409  for (; it != varMap.constEnd(); ++it) {
410  int p = it.key().toInt();
411  propMap.insertMulti(static_cast<Property::Property>(p), it.value());
412  }
413 
414  return propMap;
415 }
416 QT_WARNING_POP
417 #endif
418 #endif
419 
420 } // namespace KFileMetaData
421 
422 Q_DECLARE_METATYPE(KFileMetaData::Property::Property)
423 
424 #endif
@ Artist
Represents the artist of a media file.
Definition: properties.h:84
@ Composer
Represents the Composer of a media file.
Definition: properties.h:102
@ OriginEmailSender
The sender of the email this file was originally attached to.
Definition: properties.h:287
@ Rating
For ratings stored in Metadata tags.
Definition: properties.h:347
QString number(int n, int base)
@ Opus
Represents the opus of an audio file mostly used for classical music.
Definition: properties.h:327
@ SampleRate
The same rate or frequency of the Audio in the file.
Definition: properties.h:59
@ Performer
Represents the (lead) performer of an audio file.
Definition: properties.h:307
@ Subject
Refers to the subject of the file.
Definition: properties.h:127
@ Ensemble
Represents the ensemble of an audio file.
Definition: properties.h:312
@ Manufacturer
The manufacturer of the equipment used for generating the file and metadata.
Definition: properties.h:221
@ CreationDate
The date the content of the file was created.
Definition: properties.h:185
@ License
Contains the license information of the file.
Definition: properties.h:342
@ OriginUrl
The URL this file has originally been downloaded from.
Definition: properties.h:277
@ TrackNumber
Represents the track number in a set.
Definition: properties.h:65
@ Model
The model name of the equipment used for generating the file and metadata.
Definition: properties.h:236
@ Lyricist
Represents the Lyricist of a media file.
Definition: properties.h:108
@ AlbumArtist
Represents the album artist of a media file.
Definition: properties.h:96
@ Publisher
The publisher of the content.
Definition: properties.h:177
@ OriginEmailSubject
The subject of the email this file was originally attached to.
Definition: properties.h:282
@ Duration
The duration of the media in the file.
Definition: properties.h:45
@ Description
Represents the description stored in the file.
Definition: properties.h:375
@ ReplayGainAlbumGain
Contains ReplayGain information for audio files The album gain is given in "dB".
Definition: properties.h:360
Property
The Property enum contains all files property types that KFileMetaData manipulates.
Definition: properties.h:25
@ Comment
Represents a comment stored in the file.
Definition: properties.h:77
@ Channels
The number of channels of the Audio in the File.
Definition: properties.h:39
@ BitRate
The Bit Rate of the Audio in the File.
Definition: properties.h:33
@ ReplayGainTrackPeak
Contains ReplayGain information for audio files.
Definition: properties.h:364
@ Genre
The Genre of an Audio file.
Definition: properties.h:52
@ Album
Represents the album of a media file.
Definition: properties.h:90
@ Conductor
Represents the conductor of an audio file.
Definition: properties.h:322
@ Author
The Author field indicated the primary creator of a document.
Definition: properties.h:114
@ ImageMake
Same as Manufacturer.
Definition: properties.h:228
@ Arranger
Represents the arranger of an audio file.
Definition: properties.h:317
@ ImageModel
Same as Model.
Definition: properties.h:243
@ ReplayGainAlbumPeak
Contains ReplayGain information for audio files.
Definition: properties.h:355
@ ReleaseYear
Indicates the year a track was released.
Definition: properties.h:71
@ PageCount
The number of pages in a document.
Definition: properties.h:139
@ Lyrics
Contains the lyrics of a song embedded in the file.
Definition: properties.h:351
@ WordCount
The number of words in a document.
Definition: properties.h:145
@ Width
Represents the width of the Media in pixels.
Definition: properties.h:197
@ Langauge
Same as Language.
Definition: properties.h:166
@ DiscNumber
Represents the disc number in a multi-disc set.
Definition: properties.h:297
@ OriginEmailMessageId
The message ID of the email this file was originally attached to.
Definition: properties.h:292
@ AspectRatio
The Aspect Ratio of the visual image or video.
Definition: properties.h:209
@ Copyright
The copyright of the file.
Definition: properties.h:172
@ Language
The language the document is written in.
Definition: properties.h:159
@ LineCount
The number of lines in a document.
Definition: properties.h:151
@ Title
Refers to the Title of the content of the file.
Definition: properties.h:121
@ Height
Represents the height of the Media in pixels.
Definition: properties.h:203
@ Label
Represents the label of the content.
Definition: properties.h:332
@ FrameRate
Number of frames per second.
Definition: properties.h:214
@ ReplayGainTrackGain
Contains ReplayGain information for audio files The track gain is given in "dB".
Definition: properties.h:369
@ Keywords
The keywords used to represent the document.
Definition: properties.h:191
@ Compilation
Contains the name of the compilation of an audio file.
Definition: properties.h:337
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 2 2023 03:48:42 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.