File indexing completed on 2025-01-19 03:54:49

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2022-03-30
0007  * Description : abstract class to host DImg loader settings.
0008  *
0009  * SPDX-FileCopyrightText: 2022 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_DIMG_LOADER_SETTINGS_H
0016 #define DIGIKAM_DIMG_LOADER_SETTINGS_H
0017 
0018 // Qt includes
0019 
0020 #include <QWidget>
0021 #include <QMap>
0022 #include <QVariant>
0023 #include <QStringList>
0024 
0025 // Local includes
0026 
0027 #include "digikam_export.h"
0028 
0029 namespace Digikam
0030 {
0031 
0032 /**
0033  * Map container of widget parameter name/value.
0034  */
0035 typedef QMap<QString, QVariant> DImgLoaderPrms;
0036 
0037 class DIGIKAM_EXPORT DImgLoaderSettings : public QWidget
0038 {
0039     Q_OBJECT
0040 
0041 public:
0042 
0043     explicit DImgLoaderSettings(QWidget* const parent = nullptr);
0044     ~DImgLoaderSettings() override;
0045 
0046     /**
0047      * Set the parameters values in the widget from DImgLoaderPrms map container.
0048      */
0049     virtual void setSettings(const DImgLoaderPrms& set) = 0;
0050 
0051     /**
0052      * Return the DImgLoaderPrms map container of parameters/values from the Widget.
0053      */
0054     virtual DImgLoaderPrms settings() const             = 0;
0055 
0056     /**
0057      * Return the list of supported parameter names.
0058      */
0059      QStringList parameters()         const;
0060 
0061 Q_SIGNALS:
0062 
0063     /**
0064      * Signal to emit when a settings is changed from the widget.
0065      */
0066     void signalSettingsChanged();
0067 };
0068 
0069 } // namespace Digikam
0070 
0071 #endif // DIGIKAM_DIMG_LOADER_SETTINGS_H