digiKam
advancedmetadatatab.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 : 2015-06-16
7  * Description : Advanced Configuration tab for metadata.
8  *
9  * Copyright (C) 2015 by Veaceslav Munteanu <veaceslav dot munteanu90 at gmail.com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_ADVANCED_METADATA_TAB_H
25 #define DIGIKAM_ADVANCED_METADATA_TAB_H
26 
27 // Qt includes
28 
29 #include <QWidget>
30 
31 // Local includes
32 
34 
35 class QStandardItemModel;
36 class QStandardItem;
37 
38 namespace Digikam
39 {
40 
41 class AdvancedMetadataTab : public QWidget
42 {
43  Q_OBJECT
44 
45 public:
46 
47  explicit AdvancedMetadataTab(QWidget* const parent = nullptr);
48  ~AdvancedMetadataTab() override;
49 
50  void applySettings();
51 
52 public Q_SLOTS:
53 
54  void slotResetToDefault();
55  void slotRevertChanges();
56  void slotAddNewNamespace();
57  void slotEditNamespace();
58 
59 private Q_SLOTS:
60 
61  void slotUnifyChecked(bool value);
62  void slotAllTagsChecked(bool value);
63  void slotIndexChanged();
64  void slotRevertChangesAvailable();
65 
66 private:
67 
72  enum NsRoles
73  {
74  NAME_ROLE = Qt::UserRole+1,
75  ISTAG_ROLE = Qt::UserRole+2,
76  SEPARATOR_ROLE = Qt::UserRole+3,
77  NSTYPE_ROLE = Qt::UserRole+5,
78 
79  ZEROSTAR_ROLE = Qt::UserRole+6,
80  ONESTAR_ROLE = Qt::UserRole+7,
81  TWOSTAR_ROLE = Qt::UserRole+8,
82  THREESTAR_ROLE = Qt::UserRole+9,
83  FOURSTAR_ROLE = Qt::UserRole+10,
84  FIVESTAR_ROLE = Qt::UserRole+11,
85 
86  SPECIALOPTS_ROLE = Qt::UserRole+12,
87 
88  ALTNAME_ROLE = Qt::UserRole+13,
89  SUBSPACE_ROLE = Qt::UserRole+14,
90  ALTNAMEOPTS_ROLE = Qt::UserRole+15,
91 
92  ISDEFAULT_ROLE = Qt::UserRole+16,
93  };
94 
95 private:
96 
97  void connectButtons();
98 
104  void setModelData(QStandardItemModel* model, const QList<NamespaceEntry>& container);
105  void setUi();
106 
107  void setDataToItem(QStandardItem* item, NamespaceEntry& entry);
108 
115  int getModelIndex();
116 
117  QList<NamespaceEntry>& getCurrentContainer();
118 
119  void setModels();
120 
121  void updateContainer();
122 
123  void saveModelData(QStandardItemModel* model, QList<NamespaceEntry>& container);
124 
125 private:
126 
127  class Private;
128  Private* d;
129 };
130 
131 } // namespace Digikam
132 
133 #endif // DIGIKAM_ADVANCED_METADATA_TAB_H
Definition: advancedmetadatatab.h:42
AdvancedMetadataTab(QWidget *const parent=nullptr)
Definition: advancedmetadatatab.cpp:96
~AdvancedMetadataTab() override
Definition: advancedmetadatatab.cpp:135
void slotAddNewNamespace()
Definition: advancedmetadatatab.cpp:172
void applySettings()
Definition: advancedmetadatatab.cpp:239
void slotEditNamespace()
Definition: advancedmetadatatab.cpp:217
void slotResetToDefault()
Definition: advancedmetadatatab.cpp:140
void slotRevertChanges()
Definition: advancedmetadatatab.cpp:161
The NamespaceEntry class provide a simple container for dmetadata namespaces variables,...
Definition: dmetadatasettingscontainer.h:51
Definition: piwigotalker.h:48
qulonglong value
Definition: itemviewutilities.cpp:592
Definition: datefolderview.cpp:43