digiKam
focuspointgroup.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 : 28/08/2021
7  * Description : Managing of focus point items on a GraphicsDImgView
8  *
9  * Copyright (C) 2021-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2021 by Phuoc Khanh Le <phuockhanhnk94 at gmail dot com>
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_FOCUSPOINT_GROUP_H
26 #define DIGIKAM_FOCUSPOINT_GROUP_H
27 
28 // Qt includes
29 
30 #include <QObject>
31 #include <QPointF>
32 #include <QGraphicsWidget>
33 #include <QGraphicsSceneHoverEvent>
34 
35 // Local includes
36 
37 #include "assignnamewidget.h"
38 #include "regionframeitem.h"
39 
40 #include "addtagscombobox.h"
41 #include "albummodel.h"
42 #include "albumfiltermodel.h"
43 #include "albummanager.h"
44 #include "clickdragreleaseitem.h"
45 #include "dimgpreviewitem.h"
46 #include "graphicsdimgview.h"
47 #include "iteminfo.h"
48 #include "taggingaction.h"
49 #include "metadatahub.h"
50 #include "tagregion.h"
51 #include "digikam_debug.h"
53 
54 class QGraphicsSceneHoverEvent;
55 
56 namespace Digikam
57 {
58 
59 class Album;
60 class ItemInfo;
61 class GraphicsDImgView;
62 class RegionFrameItem;
63 class TaggingAction;
64 
65 class FocusPointGroup : public QObject
66 {
67  Q_OBJECT
68  Q_PROPERTY(bool visible READ isVisible WRITE setVisible)
69 
70 public:
71 
72  explicit FocusPointGroup(GraphicsDImgView* const view);
73  ~FocusPointGroup() override;
74 
75  bool isVisible() const;
76  ItemInfo info() const;
77  bool hasVisibleItems() const;
78 
80 
81  void leaveEvent(QEvent*);
82 
83 public:
84 
85  bool isAllowedToAddFocusPoint() const;
86 
87 public Q_SLOTS:
88 
92  void setVisible(bool visible);
93  void setVisibleItem(RegionFrameItem* const item);
94 
98  void setInfo(const ItemInfo& info);
99 
100  void addPoint();
101 
103 
104 protected:
105 
106  void load();
107  void clear();
108 /*
109  void applyItemGeometryChanges();
110 */
111 
112 protected Q_SLOTS:
113 
114  void itemStateChanged(int);
115  void slotAlbumsUpdated(int type);
116 
117  void slotAddItemStarted(const QPointF& pos);
118  void slotAddItemMoving(const QRectF& rect);
119  void slotAddItemFinished(const QRectF& rect);
120  void cancelAddItem();
121 
122 private:
123 
124  // Disable
125  FocusPointGroup() = delete;
126  FocusPointGroup(const FocusPointGroup&) = delete;
127  FocusPointGroup& operator=(const FocusPointGroup&) = delete;
128 
129 private:
130 
131  class Private;
132  Private* const d;
133 };
134 
135 } // namespace Digikam
136 
137 #endif // DIGIKAM_FOCUSPOINT_GROUP_H
Abstract base class for all album types.
Definition: album.h:67
Definition: focuspointgroup_p.h:46
Definition: focuspointgroup.h:66
void leaveEvent(QEvent *)
Definition: focuspointgroup.cpp:154
bool isVisible() const
Definition: focuspointgroup.cpp:82
bool hasVisibleItems() const
Definition: focuspointgroup.cpp:87
void cancelAddItem()
Definition: focuspointgroup.cpp:332
void slotAlbumsUpdated(int type)
Definition: focuspointgroup.cpp:221
ItemInfo info() const
Definition: focuspointgroup.cpp:92
void setVisibleItem(RegionFrameItem *const item)
Definition: focuspointgroup.cpp:122
void itemStateChanged(int)
Definition: focuspointgroup.cpp:58
void slotAddItemMoving(const QRectF &rect)
Definition: focuspointgroup.cpp:286
void clear()
Definition: focuspointgroup.cpp:207
QList< RegionFrameItem * > items() const
Definition: focuspointgroup.cpp:97
void slotAddItemStarted(const QPointF &pos)
Definition: focuspointgroup.cpp:281
void setInfo(const ItemInfo &info)
Definition: focuspointgroup.cpp:128
void setVisible(bool visible)
Definition: focuspointgroup.cpp:109
void load()
Definition: focuspointgroup.cpp:162
bool isAllowedToAddFocusPoint() const
Definition: focuspointgroup.cpp:345
void slotAddItemFinished(const QRectF &rect)
Definition: focuspointgroup.cpp:300
bool visible
Definition: focuspointgroup.h:68
void addPoint()
Definition: focuspointgroup.cpp:256
~FocusPointGroup() override
Definition: focuspointgroup.cpp:53
void aboutToSetInfoAfterRotate(const ItemInfo &info)
Definition: focuspointgroup.cpp:144
Definition: graphicsdimgview.h:44
Definition: iteminfo.h:78
Definition: regionframeitem.h:43
Definition: taggingaction.h:36
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43