File indexing completed on 2025-03-09 03:54:58

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam
0004  *
0005  * Date        : 2013-05-18
0006  * Description : Wrapper class for face recognition
0007  *
0008  * SPDX-FileCopyrightText:      2013 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0009  * SPDX-FileCopyrightText: 2014-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_FACESENGINE_IDENTITY_H
0016 #define DIGIKAM_FACESENGINE_IDENTITY_H
0017 
0018 // Qt includes
0019 
0020 #include <QMultiMap>
0021 #include <QString>
0022 #include <QExplicitlySharedDataPointer>
0023 
0024 // Local includes
0025 
0026 #include "digikam_export.h"
0027 
0028 namespace Digikam
0029 {
0030 
0031 class DIGIKAM_EXPORT Identity
0032 {
0033 
0034 public:
0035 
0036     /**
0037      * Wraps a face recognition Identity.
0038      * An identity refers to a natural person.
0039      * There is an internal id which is used the FacesEngine storage,
0040      * and a number of attributes which map the identity to the outside.
0041      * Prespecified attributes:
0042      * "fullName"   The full name as on the ID card, e.g. "Peter Brown"
0043      * "name"       The person's name without further specification, e.g. "Peter" or "Dad"
0044      * "uuid"        A UUID that is assigned to each new identity at creation.
0045      *
0046      * For fullName and name, multiple values are allowed.
0047      *
0048      * Attributes can be used to map an identity to other fields and services where
0049      * natural persons play a role.
0050      */
0051     Identity();
0052     Identity(const Identity& other);
0053     ~Identity();
0054 
0055     Identity& operator=(const Identity& other);
0056 
0057     bool isNull()                          const;
0058     bool operator==(const Identity& other) const;
0059 
0060     /**
0061      * Id value accessor.
0062      */
0063     int  id()                              const;
0064     void setId(int id);
0065 
0066     /**
0067      * Attribute value accessor.
0068      */
0069     QString attribute(const QString& att)  const;
0070     void    setAttribute(const QString& att,
0071                          const QString& val);
0072 
0073     /**
0074      * Attributes map accessor.
0075      */
0076     QMultiMap<QString, QString> attributesMap() const;
0077     void setAttributesMap(const QMultiMap<QString, QString>& attributes);
0078 
0079 private:
0080 
0081     class Private;
0082     QExplicitlySharedDataPointer<Private> d;
0083 };
0084 
0085 } // namespace Digikam
0086 
0087 #endif // DIGIKAM_FACESENGINE_IDENTITY_H