digiKam
assignnamewidget_p.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-09-12
7  * Description : Widget for assignment and confirmation of names for faces
8  *
9  * Copyright (C) 2010 by Aditya Bhatt <adityabhatt1991 at gmail dot com>
10  * Copyright (C) 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11  * Copyright (C) 2012-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_WIDGET_P_H
27 #define DIGIKAM_ASSIGN_NAME_WIDGET_P_H
28 
29 #include "assignnamewidget.h"
30 
31 // Qt includes
32 
33 #include <QGridLayout>
34 #include <QKeyEvent>
35 #include <QToolButton>
36 #include <QApplication>
37 #include <QIcon>
38 
39 // KDE includes
40 
41 #include <klocalizedstring.h>
42 
43 // Local includes
44 
45 #include "dexpanderbox.h"
46 #include "digikam_debug.h"
47 #include "addtagscombobox.h"
48 #include "addtagslineedit.h"
49 #include "album.h"
50 #include "albummanager.h"
51 #include "albumtreeview.h"
52 #include "facetagsiface.h"
53 #include "facetags.h"
54 #include "dimg.h"
55 #include "iteminfo.h"
56 #include "thememanager.h"
57 #include "applicationsettings.h"
58 
59 namespace Digikam
60 {
61 
62 class Q_DECL_HIDDEN AssignNameWidget::Private
63 {
64 public:
65 
66  explicit Private(AssignNameWidget* const q);
67 
68  bool isValid() const;
69 
70  void updateModes();
71  void updateContents();
72 
79  void updateRejectButtonTooltip();
80 
81  void updateIgnoreButton();
82 
83 private:
84 
85  void clearWidgets();
86  void checkWidgets();
87  void updateLayout();
88  void updateVisualStyle();
89 
90  QToolButton* createToolButton(const QIcon& icon,
91  const QString& text,
92  const QString& tip = QString()) const;
93 
94  QWidget* addTagsWidget() const;
95 
96  template <class T> void setupAddTagsWidget(T* const widget);
97  template <class T> void setAddTagsWidgetContents(T* const widget);
98 
99  void layoutAddTagsWidget(bool exceedBounds, int minimumContentsLength);
100  void setSizePolicies(QSizePolicy::Policy h, QSizePolicy::Policy v);
101  void setToolButtonStyles(Qt::ToolButtonStyle style);
102  QString styleSheetFontDescriptor(const QFont& font) const;
103 
104 public:
105 
107  QVariant faceIdentifier;
109 
114 
117  QToolButton* confirmButton;
118  QToolButton* rejectButton;
119  QToolButton* ignoreButton;
121 
127 
128  QGridLayout* layout;
129 
131 };
132 
133 } // namespace Digikam
134 
135 #endif // DIGIKAM_ASSIGN_NAME_WIDGET_P_H
Definition: addtagscombobox.h:49
Definition: addtagslineedit.h:46
Definition: albumpointer.h:48
Definition: assignnamewidget_p.h:63
VisualStyle visualStyle
Definition: assignnamewidget_p.h:112
QToolButton * rejectButton
Definition: assignnamewidget_p.h:118
CheckableAlbumFilterModel * tagFilterModel
Definition: assignnamewidget_p.h:124
AddTagsComboBox * comboBox
Definition: assignnamewidget_p.h:115
TagPropertiesFilterModel * tagFilteredModel
Definition: assignnamewidget_p.h:125
AlbumPointer< TAlbum > currentTag
Definition: assignnamewidget_p.h:108
bool modelsGiven
Definition: assignnamewidget_p.h:122
Mode mode
Definition: assignnamewidget_p.h:110
AssignNameWidget *const q
Definition: assignnamewidget_p.h:130
QVariant faceIdentifier
Definition: assignnamewidget_p.h:107
LayoutMode layoutMode
Definition: assignnamewidget_p.h:111
QToolButton * ignoreButton
Definition: assignnamewidget_p.h:119
TagModel * tagModel
Definition: assignnamewidget_p.h:123
TagEntryWidgetMode widgetMode
Definition: assignnamewidget_p.h:113
QToolButton * confirmButton
Definition: assignnamewidget_p.h:117
AddTagsLineEdit * lineEdit
Definition: assignnamewidget_p.h:116
QGridLayout * layout
Definition: assignnamewidget_p.h:128
DClickLabel * clickLabel
Definition: assignnamewidget_p.h:120
ItemInfo info
Definition: assignnamewidget_p.h:106
AlbumPointer< TAlbum > parentTag
Definition: assignnamewidget_p.h:126
Definition: assignnamewidget.h:48
Mode
Definition: assignnamewidget.h:58
LayoutMode
Definition: assignnamewidget.h:76
VisualStyle
Definition: assignnamewidget.h:85
TagEntryWidgetMode
Definition: assignnamewidget.h:68
Definition: albumfiltermodel.h:294
Definition: dexpanderbox.h:105
Definition: iteminfo.h:78
Definition: albummodel.h:63
Definition: albumfiltermodel.h:376
#define T
Definition: datefolderview.cpp:43