File indexing completed on 2025-04-27 03:58:37

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2017-08-09
0007  * Description : Generic range boxes, i.e. ranges where a minimum and maximum can be given.
0008  *
0009  * SPDX-FileCopyrightText: 2017 by Mario Frank <mario dot frank at uni minus potsdam dot de>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_DRANGE_BOX_H
0016 #define DIGIKAM_DRANGE_BOX_H
0017 
0018 // Qt includes
0019 
0020 #include <QWidget>
0021 
0022 // Local includes
0023 
0024 #include "digikam_export.h"
0025 
0026 namespace Digikam
0027 {
0028 
0029 class DIGIKAM_EXPORT DIntRangeBox : public QWidget
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034 
0035     explicit DIntRangeBox(QWidget* const parent = nullptr);
0036     ~DIntRangeBox() override;
0037 
0038     /**
0039      * This method sets the lower and upper threshold of possible interval minimum and maximum values.
0040      * @param min the lowest value to which the interval can be expanded.
0041      * @param max the highest value to which the interval can be expanded.
0042      */
0043     void setRange(int min, int max);
0044 
0045     /**
0046      * This method sets the minimum and maximum of the interval.
0047      * @param min The minimum value of the interval.
0048      * @param max The maximum value of the interval.
0049      */
0050     void setInterval(int min, int max);
0051 
0052     /**
0053      * This method sets the suffix for the minimum and maximum value boxes.
0054      * @param suffix The suffix.
0055      */
0056     void setSuffix(const QString& suffix);
0057 
0058     /**
0059      * This method enables or disables the embedded spinboxes.
0060      * @param enabled If the interval boxes should be enabled.
0061      */
0062     void setEnabled(bool enabled);
0063 
0064     /**
0065      * This method returns the minimum value of the interval.
0066      * @returns the minimum value.
0067      */
0068     int minValue();
0069 
0070     /**
0071      * This method returns the maximum value of the interval.
0072      * @returns the maximum value.
0073      */
0074     int maxValue();
0075 
0076 Q_SIGNALS:
0077 
0078     void minChanged(int);
0079     void maxChanged(int);
0080 
0081 private Q_SLOTS:
0082 
0083     void slotMinimumChanged(int);
0084 
0085 private:
0086 
0087     class Private;
0088     Private* const d;
0089 };
0090 
0091 } // namespace Digikam
0092 
0093 #endif // DIGIKAM_DRANGE_BOX_H