digiKam
facetags.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2011-08-08
7  * Description : Accessing face tags
8  *
9  * Copyright (C) 2010-2011 by Aditya Bhatt <adityabhatt1991 at gmail dot com>
10  * Copyright (C) 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_FACE_TAGS_H
26 #define DIGIKAM_FACE_TAGS_H
27 
28 // Qt includes
29 
30 #include <QList>
31 #include <QMultiMap>
32 #include <QRect>
33 #include <QString>
34 
35 // Local includes
36 
37 #include "digikam_export.h"
38 
39 namespace Digikam
40 {
41 
42 class DIGIKAM_DATABASE_EXPORT FaceTags
43 {
44 
45 public:
46 
50  static bool isPerson(int tagId);
51 
52  static bool isTheUnknownPerson(int tagId);
53  static int unknownPersonTagId();
54 
55  static bool isTheUnconfirmedPerson(int tagId);
56  static int unconfirmedPersonTagId();
57 
58  static bool isTheIgnoredPerson(int tagId);
59  static int ignoredPersonTagId();
60 
61  static bool isSystemPersonTagId(int tagId);
62 
66  static QList<int> allPersonTags();
67 
71  static QList<QString> allPersonNames();
72 
76  static QList<QString> allPersonPaths();
77 
81  static int personParentTag();
82 
89  static int tagForPerson(const QString& name, int parentId = -1, const QString& fullName = QString());
90 
96  static int getOrCreateTagForPerson(const QString& name, int parentId = -1, const QString& fullName = QString());
97 
102  static void ensureIsPerson(int tagId, const QString& fullName = QString());
103 
104  static QString getNameForRect(qlonglong imageid, const QRect& faceRect);
105 
110  static int getOrCreateTagForIdentity(const QMultiMap<QString, QString>& attributes);
111  static QMultiMap<QString, QString> identityAttributes(int tagId);
112 
117  static void applyTagIdentityMapping(int tagId, const QMultiMap<QString, QString>& attributes);
118 
122  static QString faceNameForTag(int tagId);
123 
124  static int scannedForFacesTagId();
125 };
126 
127 } // namespace Digikam
128 
129 #endif // DIGIKAM_FACE_TAGS_H
Definition: facetags.h:43
static QString getNameForRect(qlonglong imageid, const QRect &faceRect)
Definition: datefolderview.cpp:43