File indexing completed on 2025-01-19 03:53:36
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2009-07-04 0007 * Description : Access to extended properties of an item in the database 0008 * 0009 * SPDX-FileCopyrightText: 2009-2013 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de> 0010 * SPDX-FileCopyrightText: 2009-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #ifndef DIGIKAM_ITEM_EXTENDED_PROPERTIES_H 0017 #define DIGIKAM_ITEM_EXTENDED_PROPERTIES_H 0018 0019 // Qt includes 0020 0021 #include <QString> 0022 #include <QStringList> 0023 #include <QList> 0024 0025 // Local includes 0026 0027 #include "template.h" 0028 #include "metadatainfo.h" 0029 #include "digikam_export.h" 0030 0031 namespace Digikam 0032 { 0033 0034 class DIGIKAM_DATABASE_EXPORT ItemExtendedProperties 0035 { 0036 0037 public: 0038 0039 explicit ItemExtendedProperties(qlonglong imageid); 0040 0041 /** 0042 * Create a null ItemExtendedProperties object 0043 */ 0044 ItemExtendedProperties(); 0045 0046 /** 0047 * Return the Intellectual Genre. 0048 * This is Photoshop Object Attribute Reference. 0049 * “ Describes the nature, intellectual or journalistic characteristic of a news object, 0050 * not specifically its content. 0051 * Note / Examples: 0052 * Journalistic genres: actuality, interview, background, feature, summary, wrapup 0053 * News category related genres: daybook, obituary, press release, transcript 0054 * It is advised to use terms from a controlled vocabulary.” 0055 */ 0056 QString intellectualGenre(); 0057 void setIntellectualGenre(const QString& intellectualGenre); 0058 void removeIntellectualGenre(); 0059 0060 /** 0061 * Returns the Job ID. 0062 * This is Photoshop Transmission Reference. 0063 * This is IPTC Original Transmission Reference 0064 * “ Number or identifier for the purpose of improved workflow handling. This ID should be 0065 * added by the creator or provider for transmission and routing purposes only and should 0066 * have no significance for archiving.” 0067 */ 0068 QString jobId(); 0069 void setJobId(const QString& jobId); 0070 void removeJobId(); 0071 0072 /** 0073 * Returns the Scene. 0074 * “ Describes the scene of a photo content. Specifies one ore more terms from the 0075 * IPTC ‘Scene-NewsCodes’. Each Scene is represented as a string of 6 digits in an unordered list.” 0076 */ 0077 QStringList scene(); 0078 void setScene(const QStringList& scene); 0079 void removeScene(); 0080 0081 /** 0082 * Returns the Subject Code. 0083 * This is IPTC Subject Reference. 0084 * “ Specifies one or more Subjects from the IPTC ‘Subject-NewsCodes’ taxonomy to categorize 0085 * the content. Each Subject is represented as a string of 8 digits in an unordered list. 0086 * Note: Only Subjects from a controlled vocabulary should be used in this metadata 0087 * element, free text has to be put into the Keyword element. More about IPTC 0088 * Subject-NewsCodes at www.newscodes.org.” 0089 */ 0090 QStringList subjectCode(); 0091 void setSubjectCode(const QStringList& subjectCode); 0092 void removeSubjectCode(); 0093 0094 /** 0095 * Returns the similarity. of the image to the given image. 0096 */ 0097 double similarityTo(const qlonglong imageId); 0098 void setSimilarityTo(const qlonglong imageId, const double value); 0099 void removeSimilarityTo(const qlonglong imageId); 0100 0101 /** 0102 * Return the IPTC Core Location. 0103 * This includes Country, Country Code, City, Location and ProvinceState. 0104 * This includes IPTC Country Name, Country Code, City, SubLocation and ProvinceState. 0105 */ 0106 IptcCoreLocationInfo location(); 0107 void setLocation(const IptcCoreLocationInfo& location); 0108 void removeLocation(); 0109 0110 protected: 0111 0112 QString readProperty(const QString& property); 0113 void setProperty(const QString& property, const QString& value); 0114 QStringList readFakeListProperty(const QString& property); 0115 void setFakeListProperty(const QString& property, const QStringList& value); 0116 void removeProperty(const QString& property); 0117 0118 protected: 0119 0120 qlonglong m_id; 0121 }; 0122 0123 } // namespace Digikam 0124 0125 #endif // DIGIKAM_ITEM_EXTENDED_PROPERTIES_H