digiKam
itemdescedittab.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 : 2003-03-09
7  * Description : Captions, Tags, and Rating properties editor
8  *
9  * Copyright (C) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
10  * Copyright (C) 2003-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2006-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
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_ITEM_DESC_EDIT_TAB_H
27 #define DIGIKAM_ITEM_DESC_EDIT_TAB_H
28 
29 // Qt includes
30 
31 #include <QScrollArea>
32 #include <QPixmap>
33 #include <QEvent>
34 
35 // Local includes
36 
37 #include "dlayoutbox.h"
38 #include "digikam_export.h"
39 #include "iteminfolist.h"
40 #include "albummanager.h"
41 #include "albummodel.h"
42 #include "metadatahub.h"
43 #include "searchtextbar.h"
44 #include "addtagslineedit.h"
45 #include "disjointmetadata.h"
46 
47 namespace Digikam
48 {
49 class ItemInfo;
50 class TaggingAction;
51 
52 class ItemDescEditTab : public DVBox
53 {
54  Q_OBJECT
55 
56 public:
57 
58  explicit ItemDescEditTab(QWidget* const parent);
59  ~ItemDescEditTab() override;
60 
61  void assignPickLabel(int pickId);
62  void assignColorLabel(int colorId);
63  void assignRating(int rating);
64  void setItem(const ItemInfo& info = ItemInfo());
65  void setItems(const ItemInfoList& infos);
66  void populateTags();
67  void setFocusToTagsView();
68  void setFocusToNewTagEdit();
69  void setFocusToTitlesEdit();
72 
74 
75  void readSettings(KConfigGroup& group);
76  void writeSettings(KConfigGroup& group);
77 
78 Q_SIGNALS:
79 
80  void signalProgressMessageChanged(const QString& actionDescription);
81  void signalProgressValueChanged(float percent);
83 
87 
88 protected:
89 
90  bool eventFilter(QObject* o, QEvent* e) override;
91 
92 private:
93 
94  void reset();
95  void setTagState(TAlbum* const tag, DisjointMetadataDataFields::Status status);
96 
97  void setInfos(const ItemInfoList& infos);
98  void setFocusToLastSelectedWidget();
99 
100  void updateTagsView();
101  void updateComments();
102  void updatePickLabel();
103  void updateColorLabel();
104  void updateRating();
105  void updateDate();
106  void updateTemplate();
107  void updateRecentTags();
108 
109  bool singleSelection() const;
110  void setMetadataWidgetStatus(int status, QWidget* const widget);
111  void metadataChange(qlonglong imageId);
112  void resetMetadataChangeInfo();
113  void initProgressIndicator();
114 
115 Q_SIGNALS:
116 
118 
119 private Q_SLOTS:
120 
121  void slotApplyAllChanges();
122  void slotApplyChangesToAllVersions();
123  void slotRevertAllChanges();
124  void slotChangingItems();
125  void slotTagsSearchChanged(const SearchTextSettings& settings);
126  void slotTagStateChanged(Album* album, Qt::CheckState checkState);
127  void slotOpenTagsManager();
128  void slotCommentChanged();
129  void slotTitleChanged();
130  void slotDateTimeChanged(const QDateTime& dateTime);
131  void slotPickLabelChanged(int pickId);
132  void slotColorLabelChanged(int colorId);
133  void slotRatingChanged(int rating);
134  void slotTemplateSelected();
135  void slotModified();
136  void slotTaggingActionActivated(const TaggingAction&);
137  void slotReloadForMetadataChange();
138 
139  void slotImageTagsChanged(qlonglong imageId);
140  void slotImagesChanged(int albumId);
141  void slotImageRatingChanged(qlonglong imageId);
142  void slotImageDateChanged(qlonglong imageId);
143  void slotImageCaptionChanged(qlonglong imageId);
144 
145  void slotRecentTagsMenuActivated(int);
146  void slotAssignedTagsToggled(bool);
147 
148  void slotMoreMenu();
149  void slotUnifyPartiallyTags();
150  void slotReadFromFileMetadataToDatabase();
151  void slotWriteToFileMetadataFromDatabase();
152 
153  void slotAskToApplyChanges(const QList<ItemInfo>& infos, DisjointMetadata* hub);
154 
155 private:
156 
157  class Private;
158  Private* const d;
159 };
160 
161 } // namespace Digikam
162 
163 #endif // DIGIKAM_ITEM_DESC_EDIT_TAB_H
Definition: addtagslineedit.h:46
Abstract base class for all album types.
Definition: album.h:67
Definition: dlayoutbox.h:75
Status
Definition: disjointmetadatadatafields.h:59
Definition: disjointmetadata.h:47
Definition: itemdescedittab.h:53
void activateAssignedTagsButton()
Definition: itemdescedittab.cpp:522
AddTagsLineEdit * getNewTagEdit() const
Definition: itemdescedittab.cpp:1585
void setItem(const ItemInfo &info=ItemInfo())
Definition: itemdescedittab.cpp:774
void setFocusToNewTagEdit()
Definition: itemdescedittab.cpp:502
void readSettings(KConfigGroup &group)
Definition: itemdescedittab.cpp:457
void populateTags()
Definition: itemdescedittab.cpp:974
void assignRating(int rating)
Definition: itemdescedittab.cpp:1118
void signalProgressValueChanged(float percent)
void assignPickLabel(int pickId)
Definition: itemdescedittab.cpp:1108
void setItems(const ItemInfoList &infos)
Definition: itemdescedittab.cpp:787
void assignColorLabel(int colorId)
Definition: itemdescedittab.cpp:1113
void setFocusToCommentsEdit()
Definition: itemdescedittab.cpp:516
bool eventFilter(QObject *o, QEvent *e) override
Definition: itemdescedittab.cpp:916
void askToApplyChanges(const QList< ItemInfo > &infos, DisjointMetadata *hub)
ItemDescEditTab(QWidget *const parent)
Definition: itemdescedittab.cpp:179
void setFocusToTitlesEdit()
Definition: itemdescedittab.cpp:510
~ItemDescEditTab() override
Definition: itemdescedittab.cpp:452
void writeSettings(KConfigGroup &group)
Definition: itemdescedittab.cpp:473
void signalProgressMessageChanged(const QString &actionDescription)
void signalTagFilterMatch(bool)
void setFocusToTagsView()
Definition: itemdescedittab.cpp:495
Definition: iteminfolist.h:47
Definition: iteminfo.h:78
Definition: searchtextbar.h:43
Definition: album.h:420
Definition: taggingaction.h:36
Definition: datefolderview.cpp:43