digiKam
assignnameoverlay.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 : 2010-10-14
7  * Description : overlay for assigning names to faces
8  *
9  * Copyright (C) 2010 by Aditya Bhatt <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2009-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_ASSIGN_NAME_OVERLAY_H
27 #define DIGIKAM_ASSIGN_NAME_OVERLAY_H
28 
29 // Qt includes
30 
31 #include <QAbstractItemView>
32 
33 // Local includes
34 
35 #include "itemdelegateoverlay.h"
36 #include "itemviewdelegate.h"
37 
38 namespace Digikam
39 {
40 
41 class AssignNameWidget;
42 class FaceTagsIface;
43 class ItemInfo;
44 class TaggingAction;
45 
47 {
48  Q_OBJECT
50 
51 public:
52 
53  explicit AssignNameOverlay(QObject* const parent);
54  ~AssignNameOverlay() override;
55 
57 
58 Q_SIGNALS:
59 
60  void confirmFaces(const QList<QModelIndex>& indexes, int tagId);
61  void unknownFaces(const QList<QModelIndex>& indexes);
62  void removeFaces(const QList<QModelIndex>& indexes);
63  void ignoreFaces(const QList<QModelIndex>& indexes);
64 
65 protected Q_SLOTS:
66 
67  void slotAssigned(const TaggingAction& action, const ItemInfo&, const QVariant& faceIdentifier);
68  void slotRejected(const ItemInfo&, const QVariant& faceIdentifier);
69  void slotIgnored(const ItemInfo&, const QVariant& faceIdentifier);
70  void slotUnknown(const ItemInfo&, const QVariant& faceIdentifier);
71 
72 protected:
73 
74  QWidget* createWidget() override;
75  void setActive(bool) override;
76  void visualChange() override;
77  void showOnIndex(const QModelIndex& index) override;
78  void hide() override;
79  bool checkIndex(const QModelIndex& index) const override;
80  void viewportLeaveEvent(QObject* obj, QEvent* event) override;
81  void widgetEnterEvent() override;
82  void widgetLeaveEvent() override;
83  void setFocusOnWidget() override;
84  bool eventFilter(QObject* o, QEvent* e) override;
85 
86  void updatePosition();
87  void updateFace();
88 
89 private:
90 
91  // Disable
92  AssignNameOverlay() = delete;
93 
94 private:
95 
96  class Private;
97  Private* const d;
98 };
99 
100 } // namespace Digikam
101 
102 #endif // DIGIKAM_ASSIGN_NAME_OVERLAY_H
Definition: assignnameoverlay.h:47
void ignoreFaces(const QList< QModelIndex > &indexes)
void confirmFaces(const QList< QModelIndex > &indexes, int tagId)
QWidget * createWidget() override
Definition: assignnameoverlay.cpp:127
void viewportLeaveEvent(QObject *obj, QEvent *event) override
Definition: assignnameoverlay.cpp:315
bool eventFilter(QObject *o, QEvent *e) override
Definition: assignnameoverlay.cpp:409
void showOnIndex(const QModelIndex &index) override
see slotEntered()
Definition: assignnameoverlay.cpp:297
void hide() override
Definition: assignnameoverlay.cpp:220
void visualChange() override
Definition: assignnameoverlay.cpp:212
void updatePosition()
Definition: assignnameoverlay.cpp:225
void updateFace()
Definition: assignnameoverlay.cpp:253
void setActive(bool) override
Definition: assignnameoverlay.cpp:146
AssignNameWidget * assignNameWidget() const
Definition: assignnameoverlay.cpp:122
void slotIgnored(const ItemInfo &, const QVariant &faceIdentifier)
Definition: assignnameoverlay.cpp:372
bool checkIndex(const QModelIndex &index) const override
Definition: assignnameoverlay.cpp:279
void setFocusOnWidget() override
Definition: assignnameoverlay.cpp:400
void widgetEnterEvent() override
Definition: assignnameoverlay.cpp:390
void slotRejected(const ItemInfo &, const QVariant &faceIdentifier)
Definition: assignnameoverlay.cpp:363
void widgetLeaveEvent() override
Definition: assignnameoverlay.cpp:395
void slotAssigned(const TaggingAction &action, const ItemInfo &, const QVariant &faceIdentifier)
Definition: assignnameoverlay.cpp:332
void unknownFaces(const QList< QModelIndex > &indexes)
~AssignNameOverlay() override
Definition: assignnameoverlay.cpp:117
void removeFaces(const QList< QModelIndex > &indexes)
void slotUnknown(const ItemInfo &, const QVariant &faceIdentifier)
Definition: assignnameoverlay.cpp:381
Definition: assignnamewidget.h:48
Definition: iteminfo.h:78
Definition: itemviewdelegate.h:42
Definition: itemdelegateoverlay.h:264
QModelIndex index() const
Definition: itemdelegateoverlay.cpp:520
Definition: taggingaction.h:36
#define REQUIRE_DELEGATE(Delegate)
Definition: itemdelegateoverlay.h:112
Definition: datefolderview.cpp:43