File indexing completed on 2025-01-19 03:59:45

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2015-07-03
0007  * Description : dialog to edit and create digiKam xmp namespaces
0008  *
0009  * SPDX-FileCopyrightText: 2015 by Veaceslav Munteanu <veaceslav dot munteanu90 at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_NAMESPACE_EDIT_DLG_H
0016 #define DIGIKAM_NAMESPACE_EDIT_DLG_H
0017 
0018 // Qt includes
0019 
0020 #include <QMap>
0021 #include <QString>
0022 #include <QKeySequence>
0023 #include <QDialog>
0024 
0025 // Local includes
0026 
0027 #include "dmetadatasettingscontainer.h"
0028 
0029 namespace Digikam
0030 {
0031 
0032 class NamespaceEditDlg : public QDialog
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037 
0038     explicit NamespaceEditDlg(bool create,
0039                               NamespaceEntry& entry,
0040                               QWidget* const parent = nullptr);
0041     ~NamespaceEditDlg() override;
0042 
0043     void saveData(NamespaceEntry& entry);
0044 
0045     static bool create(QWidget* const parent, NamespaceEntry& entry);
0046     static bool edit(QWidget* const parent, NamespaceEntry& entry);
0047 
0048 public Q_SLOTS:
0049 
0050     void accept()       override;
0051 
0052 private Q_SLOTS:
0053 
0054     void slotHelp();
0055 
0056 private:
0057 
0058     void setupTagGui(NamespaceEntry& entry);
0059     void populateFields(NamespaceEntry& entry);
0060     void setType(NamespaceEntry::NamespaceType type);
0061     void makeReadOnly();
0062     bool validifyCheck(QString& errMsg);
0063 
0064 private:
0065 
0066     class Private;
0067     Private* const d;
0068 };
0069 
0070 } // namespace Digikam
0071 
0072 #endif // DIGIKAM_NAMESPACE_EDIT_DLG_H