File indexing completed on 2025-01-19 03:51:20

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2007-10-08
0007  * Description : a widget to edit a tag with multiple fixed values.
0008  *
0009  * SPDX-FileCopyrightText: 2007-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_MULTI_VALUES_EDIT_H
0016 #define DIGIKAM_MULTI_VALUES_EDIT_H
0017 
0018 // Qt includes
0019 
0020 #include <QWidget>
0021 
0022 namespace DigikamGenericMetadataEditPlugin
0023 {
0024 
0025 class MultiValuesEdit : public QWidget
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030 
0031     explicit MultiValuesEdit(QWidget* const parent, const QString& title, const QString& desc);
0032     ~MultiValuesEdit() override;
0033 
0034     void setValid(bool v);
0035     bool isValid()        const;
0036 
0037     void setData(const QStringList& data);
0038     QStringList getData() const;
0039 
0040     void setValues(const QStringList& values);
0041     bool getValues(QStringList& oldValues, QStringList& newValues);
0042 
0043 Q_SIGNALS:
0044 
0045     void signalModified();
0046 
0047 private Q_SLOTS:
0048 
0049     void slotSelectionChanged();
0050     void slotAddValue();
0051     void slotDeleteValue();
0052     void slotReplaceValue();
0053 
0054 private:
0055 
0056     class Private;
0057     Private* const d;
0058 };
0059 
0060 } // namespace DigikamGenericMetadataEditPlugin
0061 
0062 #endif // DIGIKAM_MULTI_VALUES_EDIT_H