KFileMetaData

propertyinfo.cpp
1 /*
2  This file is part of the KFileMetaData project
3  SPDX-FileCopyrightText: 2014 Vishesh Handa <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7 
8 #include "propertyinfo.h"
9 
10 #include <KLocalizedString>
11 
12 #include "formatstrings_p.h"
13 
14 #include <QLocale>
15 
16 using namespace KFileMetaData;
17 
18 class Q_DECL_HIDDEN PropertyInfo::Private
19 {
20 public:
21  Property::Property prop;
22  QString name;
23  QString displayName;
24  QVariant::Type valueType;
25  bool shouldBeIndexed;
26  QString (*formatAsString)(const QVariant& value) = nullptr;
27 };
28 
29 PropertyInfo::PropertyInfo()
30  : d(new Private)
31 {
32  d->prop = Property::Empty;
33  d->name = QStringLiteral("empty");
34  d->valueType = QVariant::Invalid;
35  d->shouldBeIndexed = false;
36  d->formatAsString = &FormatStrings::toStringFunction;
37 }
38 
39 PropertyInfo::PropertyInfo(Property::Property property)
40  : d(new Private)
41 {
42  d->prop = property;
43  d->shouldBeIndexed = true;
44  d->formatAsString = &FormatStrings::toStringFunction;
45 
46  switch (property) {
47  case Property::Album:
48  d->name = QStringLiteral("album");
49  d->displayName = i18nc("@label music album", "Album");
50  d->valueType = QVariant::String;
51  break;
52 
53  case Property::AlbumArtist:
54  d->name = QStringLiteral("albumArtist");
55  d->displayName = i18nc("@label", "Album Artist");
56  d->valueType = QVariant::String;
57  break;
58 
59  case Property::Artist:
60  d->name = QStringLiteral("artist");
61  d->displayName = i18nc("@label", "Artist");
62  d->valueType = QVariant::String;
63  break;
64 
65  case Property::AspectRatio:
66  d->name = QStringLiteral("aspectRatio");
67  d->displayName = i18nc("@label", "Aspect Ratio");
68  d->valueType = QVariant::Double;
69  d->formatAsString = &FormatStrings::formatAspectRatio;
70  break;
71 
72  case Property::Author:
73  d->name = QStringLiteral("author");
74  d->displayName = i18nc("@label", "Author");
75  d->valueType = QVariant::String;
76  break;
77 
78  case Property::BitRate:
79  d->name = QStringLiteral("bitRate");
80  d->displayName = i18nc("@label", "Bitrate");
81  d->valueType = QVariant::Int;
82  d->formatAsString = &FormatStrings::formatBitRate;
83  break;
84 
85  case Property::Channels:
86  d->name = QStringLiteral("channels");
87  d->displayName = i18nc("@label", "Channels");
88  d->valueType = QVariant::Int;
89  break;
90 
91  case Property::Comment:
92  d->name = QStringLiteral("comment");
93  d->displayName = i18nc("@label", "Comment");
94  d->valueType = QVariant::String;
95  d->shouldBeIndexed = false;
96  break;
97 
98  case Property::Description:
99  d->name = QStringLiteral("description");
100  d->displayName = i18nc("@label", "Description");
101  d->valueType = QVariant::String;
102  d->shouldBeIndexed = false;
103  break;
104 
105  case Property::Composer:
106  d->name = QStringLiteral("composer");
107  d->displayName = i18nc("@label", "Composer");
108  d->valueType = QVariant::String;
109  break;
110 
111  case Property::Copyright:
112  d->name = QStringLiteral("copyright");
113  d->displayName = i18nc("@label", "Copyright");
114  d->valueType = QVariant::String;
115  d->shouldBeIndexed = false;
116  break;
117 
118  case Property::CreationDate:
119  d->name = QStringLiteral("creationDate");
120  d->displayName = i18nc("@label", "Creation Date");
121  d->valueType = QVariant::DateTime;
122  d->formatAsString = &FormatStrings::formatDate;
123  break;
124 
125  case Property::Duration:
126  d->name = QStringLiteral("duration");
127  d->displayName = i18nc("@label", "Duration");
128  d->valueType = QVariant::Int;
129  d->formatAsString = &FormatStrings::formatDuration;
130  break;
131 
132  case Property::Empty:
133  d->name = QStringLiteral("empty");
134  d->valueType = QVariant::Invalid;
135  break;
136 
137  case Property::FrameRate:
138  d->name = QStringLiteral("frameRate");
139  d->displayName = i18nc("@label", "Frame Rate");
140  d->valueType = QVariant::Double;
141  d->formatAsString = &FormatStrings::formatAsFrameRate;
142  break;
143 
144  case Property::Generator:
145  d->name = QStringLiteral("generator");
146  d->displayName = i18nc("@label", "Document Generated By");
147  d->valueType = QVariant::String;
148  d->shouldBeIndexed = false;
149  break;
150 
151  case Property::Genre:
152  d->name = QStringLiteral("genre");
153  d->displayName = i18nc("@label music genre", "Genre");
154  d->valueType = QVariant::String;
155  break;
156 
157  case Property::Height:
158  d->name = QStringLiteral("height");
159  d->displayName = i18nc("@label", "Height");
160  d->valueType = QVariant::Int;
161  break;
162 
163  case Property::ImageDateTime:
164  d->name = QStringLiteral("imageDateTime");
165  d->displayName = i18nc("@label EXIF", "Image Date Time");
166  d->valueType = QVariant::DateTime;
167  d->formatAsString = &FormatStrings::formatDate;
168  break;
169 
170  case Property::Manufacturer:
171  d->name = QStringLiteral("manufacturer");
172  d->displayName = i18nc("@label EXIF", "Manufacturer");
173  d->valueType = QVariant::String;
174  d->shouldBeIndexed = false;
175  break;
176 
177  case Property::Model:
178  d->name = QStringLiteral("model");
179  d->displayName = i18nc("@label EXIF", "Model");
180  d->valueType = QVariant::String;
181  d->shouldBeIndexed = false;
182  break;
183 
184  case Property::ImageOrientation:
185  d->name = QStringLiteral("imageOrientation");
186  d->displayName = i18nc("@label EXIF", "Image Orientation");
187  d->valueType = QVariant::Int;
188  d->formatAsString = &FormatStrings::formatOrientationValue;
189  break;
190 
191  case Property::Keywords:
192  d->name = QStringLiteral("keywords");
193  d->displayName = i18nc("@label", "Keywords");
194  d->valueType = QVariant::String;
195  d->shouldBeIndexed = false;
196  break;
197 
198  case Property::Language:
199  d->name = QStringLiteral("language");
200  d->displayName = i18nc("@label", "Language");
201  d->valueType = QVariant::String;
202  d->shouldBeIndexed = false;
203  break;
204 
205  case Property::LineCount:
206  d->name = QStringLiteral("lineCount");
207  d->displayName = i18nc("@label number of lines", "Line Count");
208  d->valueType = QVariant::Int;
209  break;
210 
211  case Property::Lyricist:
212  d->name = QStringLiteral("lyricist");
213  d->displayName = i18nc("@label", "Lyricist");
214  d->valueType = QVariant::String;
215  break;
216 
217  case Property::PageCount:
218  d->name = QStringLiteral("pageCount");
219  d->displayName = i18nc("@label", "Page Count");
220  d->valueType = QVariant::Int;
221  break;
222 
223  case Property::PhotoApertureValue:
224  d->name = QStringLiteral("photoApertureValue");
225  d->displayName = i18nc("@label EXIF", "Aperture Value");
226  d->valueType = QVariant::Double;
227  d->formatAsString = &FormatStrings::formatAsFNumber;
228  break;
229 
230  case Property::PhotoDateTimeOriginal:
231  d->name = QStringLiteral("photoDateTimeOriginal");
232  d->displayName = i18nc("@label EXIF", "Original Date Time");
233  d->valueType = QVariant::DateTime;
234  d->formatAsString = &FormatStrings::formatDate;
235  break;
236 
237  case Property::PhotoExposureBiasValue:
238  d->name = QStringLiteral("photoExposureBiasValue");
239  d->displayName = i18nc("@label EXIF", "Exposure Bias");
240  d->valueType = QVariant::Double;
241  d->formatAsString = &FormatStrings::formatPhotoExposureBias;
242  break;
243 
244  case Property::PhotoExposureTime:
245  d->name = QStringLiteral("photoExposureTime");
246  d->displayName = i18nc("@label EXIF", "Exposure Time");
247  d->valueType = QVariant::Double;
248  d->formatAsString = &FormatStrings::formatPhotoTime;
249  break;
250 
251  case Property::PhotoFlash:
252  d->name = QStringLiteral("photoFlash");
253  d->displayName = i18nc("@label EXIF", "Flash");
254  d->valueType = QVariant::Int;
255  d->formatAsString = &FormatStrings::formatPhotoFlashValue;
256  break;
257 
258  case Property::PhotoFNumber:
259  d->name = QStringLiteral("photoFNumber");
260  d->displayName = i18nc("@label EXIF", "F Number");
261  d->valueType = QVariant::Double;
262  d->formatAsString = &FormatStrings::formatAsFNumber;
263  break;
264 
265  case Property::PhotoFocalLength:
266  d->name = QStringLiteral("photoFocalLength");
267  d->displayName = i18nc("@label EXIF", "Focal Length");
268  d->valueType = QVariant::Double;
269  d->formatAsString = &FormatStrings::formatAsMilliMeter;
270  break;
271 
272  case Property::PhotoFocalLengthIn35mmFilm:
273  d->name = QStringLiteral("photoFocalLengthIn35mmFilm");
274  d->displayName = i18nc("@label EXIF", "Focal Length 35mm");
275  d->valueType = QVariant::Double;
276  d->formatAsString = &FormatStrings::formatAsMilliMeter;
277  break;
278 
279  case Property::PhotoGpsLatitude:
280  d->name = QStringLiteral("photoGpsLatitude");
281  d->displayName = i18nc("@label EXIF", "GPS Latitude");
282  d->valueType = QVariant::Double;
283  d->formatAsString = &FormatStrings::formatAsDegree;
284  break;
285 
286  case Property::PhotoGpsLongitude:
287  d->name = QStringLiteral("photoGpsLongitude");
288  d->displayName = i18nc("@label EXIF", "GPS Longitude");
289  d->valueType = QVariant::Double;
290  d->formatAsString = &FormatStrings::formatAsDegree;
291  break;
292 
293  case Property::PhotoGpsAltitude:
294  d->name = QStringLiteral("photoGpsAltitude");
295  d->displayName = i18nc("@label EXIF", "GPS Altitude");
296  d->valueType = QVariant::Double;
297  d->formatAsString = &FormatStrings::formatAsMeter;
298  break;
299 
300  case Property::PhotoISOSpeedRatings:
301  d->name = QStringLiteral("photoISOSpeedRatings");
302  d->displayName = i18nc("@label EXIF", "ISO Speed Rating");
303  d->valueType = QVariant::Int;
304  break;
305 
306  case Property::PhotoMeteringMode:
307  d->name = QStringLiteral("photoMeteringMode");
308  d->displayName = i18nc("@label EXIF", "Metering Mode");
309  d->valueType = QVariant::Int;
310  break;
311 
312  case Property::PhotoPixelXDimension:
313  d->name = QStringLiteral("photoPixelXDimension");
314  d->displayName = i18nc("@label EXIF", "X Dimension");
315  d->valueType = QVariant::Int;
316  break;
317 
318  case Property::PhotoPixelYDimension:
319  d->name = QStringLiteral("photoPixelYDimension");
320  d->displayName = i18nc("@label EXIF", "Y Dimension");
321  d->valueType = QVariant::Int;
322  break;
323 
324  case Property::PhotoSaturation:
325  d->name = QStringLiteral("photoSaturation");
326  d->displayName = i18nc("@label EXIF", "Saturation");
327  d->valueType = QVariant::Int;
328  break;
329 
330  case Property::PhotoSharpness:
331  d->name = QStringLiteral("photoSharpness");
332  d->displayName = i18nc("@label EXIF", "Sharpness");
333  d->valueType = QVariant::Int;
334  break;
335 
336  case Property::PhotoWhiteBalance:
337  d->name = QStringLiteral("photoWhiteBalance");
338  d->displayName = i18nc("@label EXIF", "White Balance");
339  d->valueType = QVariant::Int;
340  break;
341 
342  case Property::Publisher:
343  d->name = QStringLiteral("publisher");
344  d->displayName = i18nc("@label", "Publisher");
345  d->valueType = QVariant::String;
346  break;
347 
348  case Property::Label:
349  d->name = QStringLiteral("label");
350  d->displayName = i18nc("@label", "Label");
351  d->valueType = QVariant::String;
352  break;
353 
354  case Property::ReleaseYear:
355  d->name = QStringLiteral("releaseYear");
356  d->displayName = i18nc("@label", "Release Year");
357  d->valueType = QVariant::Int;
358  break;
359 
360  case Property::SampleRate:
361  d->name = QStringLiteral("sampleRate");
362  d->displayName = i18nc("@label", "Sample Rate");
363  d->valueType = QVariant::Int;
364  d->formatAsString = &FormatStrings::formatSampleRate;
365  break;
366 
367  case Property::Subject:
368  d->name = QStringLiteral("subject");
369  d->displayName = i18nc("@label", "Subject");
370  d->valueType = QVariant::String;
371  d->shouldBeIndexed = false;
372  break;
373 
374  case Property::Title:
375  d->name = QStringLiteral("title");
376  d->displayName = i18nc("@label", "Title");
377  d->valueType = QVariant::String;
378  break;
379 
380  case Property::TrackNumber:
381  d->name = QStringLiteral("trackNumber");
382  d->displayName = i18nc("@label music track number", "Track Number");
383  d->valueType = QVariant::Int;
384  break;
385 
386  case Property::DiscNumber:
387  d->name = QStringLiteral("discNumber");
388  d->displayName = i18nc("@label music disc number", "Disc Number");
389  d->valueType = QVariant::Int;
390  break;
391 
392  case Property::Location:
393  d->name = QStringLiteral("location");
394  d->displayName = i18nc("@label", "Location");
395  d->valueType = QVariant::String;
396  break;
397 
398  case Property::Performer:
399  d->name = QStringLiteral("performer");
400  d->displayName = i18nc("@label", "Performer");
401  d->valueType = QVariant::String;
402  break;
403 
404  case Property::Ensemble:
405  d->name = QStringLiteral("ensemble");
406  d->displayName = i18nc("@label", "Ensemble");
407  d->valueType = QVariant::String;
408  break;
409 
410  case Property::Arranger:
411  d->name = QStringLiteral("arranger");
412  d->displayName = i18nc("@label", "Arranger");
413  d->valueType = QVariant::String;
414  break;
415 
416  case Property::Conductor:
417  d->name = QStringLiteral("conductor");
418  d->displayName = i18nc("@label", "Conductor");
419  d->valueType = QVariant::String;
420  break;
421 
422  case Property::Compilation:
423  d->name = QStringLiteral("compilation");
424  d->displayName = i18nc("@label", "Compilation");
425  d->valueType = QVariant::String;
426  break;
427 
428  case Property::License:
429  d->name = QStringLiteral("license");
430  d->displayName = i18nc("@label", "License");
431  d->valueType = QVariant::String;
432  break;
433 
434  case Property::Lyrics:
435  d->name = QStringLiteral("lyrics");
436  d->displayName = i18nc("@label", "Lyrics");
437  d->valueType = QVariant::String;
438  break;
439 
440  case Property::Opus:
441  d->name = QStringLiteral("opus");
442  d->displayName = i18nc("@label", "Opus");
443  d->valueType = QVariant::Int;
444  break;
445 
446  case Property::Rating:
447  d->name = QStringLiteral("embeddedRating");
448  d->displayName = i18nc("@label", "Rating");
449  d->valueType = QVariant::Int;
450  break;
451 
452  case Property::ReplayGainAlbumPeak:
453  d->name = QStringLiteral("replayGainAlbumPeak");
454  d->displayName = i18nc("@label", "Replay Gain Album Peak");
455  d->valueType = QVariant::Double;
456  d->formatAsString = &FormatStrings::formatDouble;
457  break;
458 
459  case Property::ReplayGainAlbumGain:
460  d->name = QStringLiteral("replayGainAlbumGain");
461  d->displayName = i18nc("@label", "Replay Gain Album Gain");
462  d->valueType = QVariant::Double;
463  d->formatAsString = &FormatStrings::formatDouble;
464  break;
465 
466  case Property::ReplayGainTrackPeak:
467  d->name = QStringLiteral("replayGainTrackPeak");
468  d->displayName = i18nc("@label", "Replay Gain Track Peak");
469  d->valueType = QVariant::Double;
470  d->formatAsString = &FormatStrings::formatDouble;
471  break;
472 
473  case Property::ReplayGainTrackGain:
474  d->name = QStringLiteral("replayGainTrackGain");
475  d->displayName = i18nc("@label", "Replay Gain Track Gain");
476  d->valueType = QVariant::Double;
477  d->formatAsString = &FormatStrings::formatDouble;
478  break;
479 
480  case Property::Width:
481  d->name = QStringLiteral("width");
482  d->displayName = i18nc("@label", "Width");
483  d->valueType = QVariant::Int;
484  break;
485 
486  case Property::WordCount:
487  d->name = QStringLiteral("wordCount");
488  d->displayName = i18nc("@label number of words", "Word Count");
489  d->valueType = QVariant::Int;
490  break;
491 
492  case Property::TranslationUnitsTotal:
493  d->name = QStringLiteral("translationUnitsTotal");
494  d->displayName = i18nc("@label number of translatable strings",
495  "Translatable Units");
496  d->valueType = QVariant::Int;
497  d->shouldBeIndexed = false;
498  break;
499 
500  case Property::TranslationUnitsWithTranslation:
501  d->name = QStringLiteral("translationUnitsWithTranslation");
502  d->displayName = i18nc("@label number of translated strings", "Translations");
503  d->valueType = QVariant::Int;
504  d->shouldBeIndexed = false;
505  break;
506 
507  case Property::TranslationUnitsWithDraftTranslation:
508  d->name = QStringLiteral("translationUnitsWithDraftTranslation");
509  d->displayName = i18nc("@label number of fuzzy translated strings",
510  "Draft Translations");
511  d->valueType = QVariant::Int;
512  d->shouldBeIndexed = false;
513  break;
514 
515  case Property::TranslationLastAuthor:
516  d->name = QStringLiteral("translationLastAuthor");
517  d->displayName = i18nc("@label translation author", "Author");
518  d->valueType = QVariant::String;
519  d->shouldBeIndexed = false;
520  break;
521 
522  case Property::TranslationLastUpDate:
523  d->name = QStringLiteral("translationLastUpDate");
524  d->displayName = i18nc("@label translations last update", "Last Update");
525  d->valueType = QVariant::String;
526  d->shouldBeIndexed = false;
527  d->formatAsString = &FormatStrings::formatDate;
528  break;
529 
530  case Property::TranslationTemplateDate:
531  d->name = QStringLiteral("translationTemplateDate");
532  d->displayName = i18nc("@label date of template creation8", "Template Creation");
533  d->valueType = QVariant::String;
534  d->shouldBeIndexed = false;
535  d->formatAsString = &FormatStrings::formatDate;
536  break;
537 
538  case Property::OriginUrl:
539  d->name = QStringLiteral("originUrl");
540  d->displayName = i18nc("@label the URL a file was originally downloaded from", "Downloaded From");
541  d->valueType = QVariant::Url;
542  d->shouldBeIndexed = false;
543  break;
544 
545  case Property::OriginEmailSubject:
546  d->name = QStringLiteral("originEmailSubject");
547  d->displayName = i18nc("@label the subject of an email this file was attached to", "E-Mail Attachment Subject");
548  d->valueType = QVariant::String;
549  d->shouldBeIndexed = false;
550  break;
551 
552  case Property::OriginEmailSender:
553  d->name = QStringLiteral("originEmailSender");
554  d->displayName = i18nc("@label the sender of an email this file was attached to", "E-Mail Attachment Sender");
555  d->valueType = QVariant::String;
556  d->shouldBeIndexed = false;
557  break;
558 
559  case Property::OriginEmailMessageId:
560  d->name = QStringLiteral("originEmailMessageId");
561  d->displayName = i18nc("@label the message ID of an email this file was attached to", "E-Mail Attachment Message ID");
562  d->valueType = QVariant::String;
563  d->shouldBeIndexed = false;
564  break;
565 
566  case Property::PropertyCount: // To silence the compiler.
567  break;
568 
569  // NOTE: new properties must also be added to ::fromName()
570  }
571 
572  if (d->valueType == QVariant::Int || d->valueType == QVariant::DateTime ||
573  d->valueType == QVariant::Double)
574  {
575  d->shouldBeIndexed = false;
576  }
577 }
578 
579 PropertyInfo::PropertyInfo(const PropertyInfo& pi)
580  : d(new Private(*pi.d))
581 {
582 }
583 
584 PropertyInfo::~PropertyInfo()
585 {
586  delete d;
587 }
588 
589 PropertyInfo& PropertyInfo::operator=(const PropertyInfo& rhs)
590 {
591  *d = *rhs.d;
592  return *this;
593 }
594 
595 bool PropertyInfo::operator==(const PropertyInfo& rhs) const
596 {
597  return d->name == rhs.d->name && d->displayName == rhs.d->displayName &&
598  d->prop == rhs.d->prop && d->shouldBeIndexed == rhs.d->shouldBeIndexed;
599 }
600 
602 {
603  return d->displayName;
604 }
605 
607 {
608  return d->name;
609 }
610 
612 {
613  return d->prop;
614 }
615 
617 {
618  return d->valueType;
619 }
620 
622 {
623  return d->shouldBeIndexed;
624 }
625 
627 {
628  if (value.type() == QVariant::List || value.type() == QVariant::StringList) {
629  if (d->valueType == QVariant::String) {
630  return QLocale().createSeparatedList(value.toStringList());
631  } else {
632  QStringList displayList;
633  const auto valueList = value.toList();
634  for (const auto& entry : valueList) {
635  displayList << d->formatAsString(entry);
636  }
637  return QLocale().createSeparatedList(displayList);
638  }
639  } else {
640  return d->formatAsString(value);
641  }
642 }
643 
645 {
646  static QHash<QString, Property::Property> propertyHash = {
647  { QStringLiteral("bitrate"), Property::BitRate },
648  { QStringLiteral("channels"), Property::Channels },
649  { QStringLiteral("duration"), Property::Duration },
650  { QStringLiteral("genre"), Property::Genre },
651  { QStringLiteral("samplerate"), Property::SampleRate },
652  { QStringLiteral("tracknumber"), Property::TrackNumber },
653  { QStringLiteral("discnumber"), Property::DiscNumber },
654  { QStringLiteral("releaseyear"), Property::ReleaseYear },
655  { QStringLiteral("comment"), Property::Comment },
656  { QStringLiteral("description"), Property::Description },
657  { QStringLiteral("artist"), Property::Artist },
658  { QStringLiteral("album"), Property::Album },
659  { QStringLiteral("albumartist"), Property::AlbumArtist },
660  { QStringLiteral("composer"), Property::Composer },
661  { QStringLiteral("lyricist"), Property::Lyricist },
662  { QStringLiteral("location"), Property::Location },
663  { QStringLiteral("performer"), Property::Performer },
664  { QStringLiteral("ensemble"), Property::Ensemble },
665  { QStringLiteral("arranger"), Property::Arranger },
666  { QStringLiteral("conductor"), Property::Conductor },
667  { QStringLiteral("opus"), Property::Opus },
668  { QStringLiteral("embeddedrating"), Property::Rating },
669  { QStringLiteral("author"), Property::Author },
670  { QStringLiteral("title"), Property::Title },
671  { QStringLiteral("subject"), Property::Subject },
672  { QStringLiteral("generator"), Property::Generator },
673  { QStringLiteral("pagecount"), Property::PageCount },
674  { QStringLiteral("wordcount"), Property::WordCount },
675  { QStringLiteral("linecount"), Property::LineCount },
676  { QStringLiteral("language"), Property::Language },
677  { QStringLiteral("copyright"), Property::Copyright },
678  { QStringLiteral("publisher"), Property::Publisher },
679  { QStringLiteral("label"), Property::Label },
680  { QStringLiteral("compilation"), Property::Compilation },
681  { QStringLiteral("license"), Property::License },
682  { QStringLiteral("lyrics"), Property::Lyrics },
683  { QStringLiteral("replaygainalbumpeak"), Property::ReplayGainAlbumPeak },
684  { QStringLiteral("replaygainalbumgain"), Property::ReplayGainAlbumGain },
685  { QStringLiteral("replaygaintrackpeak"), Property::ReplayGainTrackPeak },
686  { QStringLiteral("replaygaintrackgain"), Property::ReplayGainTrackGain },
687  { QStringLiteral("creationdate"), Property::CreationDate },
688  { QStringLiteral("keywords"), Property::Keywords },
689  { QStringLiteral("width"), Property::Width },
690  { QStringLiteral("height"), Property::Height },
691  { QStringLiteral("aspectratio"), Property::AspectRatio },
692  { QStringLiteral("framerate"), Property::FrameRate },
693  { QStringLiteral("manufacturer"), Property::Manufacturer },
694  { QStringLiteral("model"), Property::Model },
695  { QStringLiteral("imagedatetime"), Property::ImageDateTime },
696  { QStringLiteral("imageorientation"), Property::ImageOrientation },
697  { QStringLiteral("photoflash"), Property::PhotoFlash },
698  { QStringLiteral("photopixelxdimension"), Property::PhotoPixelXDimension },
699  { QStringLiteral("photopixelydimension"), Property::PhotoPixelYDimension },
700  { QStringLiteral("photodatetimeoriginal"), Property::PhotoDateTimeOriginal },
701  { QStringLiteral("photofocallength"), Property::PhotoFocalLength },
702  { QStringLiteral("photofocallengthin35mmfilm"), Property::PhotoFocalLengthIn35mmFilm },
703  { QStringLiteral("photoexposuretime"), Property::PhotoExposureTime },
704  { QStringLiteral("photofnumber"), Property::PhotoFNumber },
705  { QStringLiteral("photoaperturevalue"), Property::PhotoApertureValue },
706  { QStringLiteral("photoexposurebiasvalue"), Property::PhotoExposureBiasValue },
707  { QStringLiteral("photowhitebalance"), Property::PhotoWhiteBalance },
708  { QStringLiteral("photometeringmode"), Property::PhotoMeteringMode },
709  { QStringLiteral("photoisospeedratings"), Property::PhotoISOSpeedRatings },
710  { QStringLiteral("photosaturation"), Property::PhotoSaturation },
711  { QStringLiteral("photosharpness"), Property::PhotoSharpness },
712  { QStringLiteral("photogpslatitude"), Property::PhotoGpsLatitude },
713  { QStringLiteral("photogpslongitude"), Property::PhotoGpsLongitude },
714  { QStringLiteral("photogpsaltitude"), Property::PhotoGpsAltitude },
715  { QStringLiteral("translationunitstotal"), Property::TranslationUnitsTotal },
716  { QStringLiteral("translationunitswithtranslation"), Property::TranslationUnitsWithTranslation },
717  { QStringLiteral("translationunitswithdrafttranslation"), Property::TranslationUnitsWithDraftTranslation },
718  { QStringLiteral("translationlastauthor"), Property::TranslationLastAuthor },
719  { QStringLiteral("translationlastupdate"), Property::TranslationLastUpDate },
720  { QStringLiteral("translationtemplatedate"), Property::TranslationTemplateDate },
721  { QStringLiteral("originurl"), Property::OriginUrl },
722  { QStringLiteral("originemailsubject"), Property::OriginEmailSubject },
723  { QStringLiteral("originemailsender"), Property::OriginEmailSender },
724  { QStringLiteral("originemailmessageid"), Property::OriginEmailMessageId }
725  };
726 
727  return PropertyInfo(propertyHash.value(name.toLower()));
728 }
The PropertyInfo class can be used to obtain extra information about any property.
Definition: propertyinfo.h:26
QString name(const QVariant &location)
QList< QVariant > toList() const const
QString formatAsDisplayString(const QVariant &value) const
Returns the value of the property as a QString with added formatting, added units if needed...
QString displayName() const
A user visible name of the property.
static PropertyInfo fromName(const QString &name)
Construct a PropertyInfo from the internal property name.
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QVariant::Type valueType() const
The type the value of this property should be.
QString createSeparatedList(const QStringList &list) const const
QString toLower() const const
const T value(const Key &key) const const
Property
The Property enum contains all files property types that KFileMetaData manipulates.
Definition: properties.h:25
QStringList toStringList() const const
Property::Property property() const
The enumeration which represents this property.
QString name() const
The internal unique name used to refer to the property.
QVariant::Type type() const const
bool shouldBeIndexed() const
Indicates if this property requires indexing or should just be stored.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jul 9 2020 22:53:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.