digiKam
tagmodificationhelper.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 : 2000-12-05
7  * Description : helper class used to modify tag albums in views
8  *
9  * Copyright (C) 2009-2010 by Johannes Wienke <languitar at semipol dot de>
10  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles 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_TAG_MODIFICATION_HELPER_H
26 #define DIGIKAM_TAG_MODIFICATION_HELPER_H
27 
28 // Qt includes
29 
30 #include <QObject>
31 #include <QString>
32 #include <QList>
33 
34 // Local includes
35 
36 #include "album.h"
37 
38 class QAction;
39 
40 namespace Digikam
41 {
42 
52 class TagModificationHelper: public QObject
53 {
54  Q_OBJECT
55 
56 public:
57 
64  explicit TagModificationHelper(QObject* const parent, QWidget* const dialogParent);
65 
69  ~TagModificationHelper() override;
70 
76  TAlbum* boundTag(QObject* action) const;
77 
78 public Q_SLOTS:
79 
93  TAlbum* slotTagNew(TAlbum* parent, const QString& title = QString(),
94  const QString& iconName = QString());
95 
103  TAlbum* slotTagNew();
104 
110  void slotTagEdit(TAlbum* tag);
111 
115  void slotTagEdit();
116 
122  void slotTagDelete(TAlbum* tag);
123 
127  void slotTagDelete();
128 
134  void slotMultipleTagDel(const QList<TAlbum*>& tags);
135 
139  void slotMultipleTagDel();
140 
147  void slotFaceTagDelete(TAlbum* tag);
148 
152  void slotFaceTagDelete();
153 
160  void slotMultipleFaceTagDel(const QList<TAlbum*>& tags);
161 
165  void slotMultipleFaceTagDel();
166 
172  void slotTagToFaceTag(TAlbum* tag);
173 
177  void slotTagToFaceTag();
178 
184  void slotMultipleTagsToFaceTags(const QList<TAlbum*>& tags);
185 
190 
191 public:
192 
199  void bindTag(QAction* action, TAlbum* parent) const;
200 
208  void bindMultipleTags(QAction* action, const QList<TAlbum*>& tags);
209 
214  QList< TAlbum* > boundMultipleTags(QObject* sender);
215 
216 Q_SIGNALS:
217 
218  void tagCreated(TAlbum* tag);
219  void tagEdited(TAlbum* tag);
221 
222 private:
223 
228  QList<TAlbum*> getFaceTags(TAlbum* rootTags = nullptr);
229 
234  QSet<TAlbum*> getFaceTags(const QList<TAlbum*>& tags);
235 
236 private:
237 
238  class Private;
239  Private* const d;
240 };
241 
242 } // namespace Digikam
243 
244 #endif // DIGIKAM_TAG_MODIFICATION_HELPER_H
Definition: album.h:420
Definition: tagmodificationhelper.h:53
void slotFaceTagDelete()
Definition: tagmodificationhelper.cpp:456
void slotTagToFaceTag()
Definition: tagmodificationhelper.cpp:715
void slotTagEdit()
Definition: tagmodificationhelper.cpp:239
TagModificationHelper(QObject *const parent, QWidget *const dialogParent)
Definition: tagmodificationhelper.cpp:77
void slotMultipleTagDel()
Definition: tagmodificationhelper.cpp:442
~TagModificationHelper() override
Definition: tagmodificationhelper.cpp:84
void slotMultipleTagsToFaceTags()
Definition: tagmodificationhelper.cpp:728
void tagCreated(TAlbum *tag)
TAlbum * slotTagNew()
Definition: tagmodificationhelper.cpp:176
void slotMultipleFaceTagDel()
Definition: tagmodificationhelper.cpp:690
void bindMultipleTags(QAction *action, const QList< TAlbum * > &tags)
Definition: tagmodificationhelper.cpp:106
QList< TAlbum * > boundMultipleTags(QObject *sender)
Definition: tagmodificationhelper.cpp:111
TAlbum * boundTag(QObject *action) const
Definition: tagmodificationhelper.cpp:94
void aboutToDeleteTag(TAlbum *tag)
void bindTag(QAction *action, TAlbum *parent) const
Definition: tagmodificationhelper.cpp:89
void slotTagDelete()
Definition: tagmodificationhelper.cpp:319
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43