File indexing completed on 2024-05-19 04:29:28

0001 /*
0002  * SPDX-FileCopyrightText: 2020 Mathias Wein <lynx.mw+kde@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef KISSPINBOXHSXSELECTOR_H
0008 #define KISSPINBOXHSXSELECTOR_H
0009 
0010 #include "kritawidgets_export.h"
0011 #include "KisVisualColorModel.h"
0012 
0013 #include <QWidget>
0014 #include <QVector4D>
0015 #include <QScopedPointer>
0016 
0017 /**
0018  * A set of spinboxes to adjust HSV, HSL, HSI or HSY' values.
0019  * This class is meant to be used in conjunction with KisVisualColorSelector only.
0020  */
0021 
0022 class KRITAWIDGETS_EXPORT KisSpinboxHSXSelector : public QWidget
0023 {
0024     Q_OBJECT
0025 public:
0026     explicit KisSpinboxHSXSelector(QWidget *parent = nullptr);
0027     ~KisSpinboxHSXSelector() override;
0028 
0029     /**
0030      * @brief connect signals and slots with given selector model
0031      *        to synchronize value and color model changes.
0032      *
0033      * Note: in case the selector switches to a non-HSX color model,
0034      * it needs to be deactivated or hidden manually since it will
0035      * not synchronize values for other selector models.
0036      */
0037     void setModel(KisVisualColorModelSP model);
0038 
0039 Q_SIGNALS:
0040     void sigChannelValuesChanged(const QVector4D &values);
0041 
0042 public Q_SLOTS:
0043     void slotColorModelChanged();
0044     void slotChannelValuesChanged(const QVector4D &values);
0045 private Q_SLOTS:
0046     void slotSpinBoxChanged();
0047 private:
0048     struct Private;
0049     const QScopedPointer<Private> m_d;
0050 };
0051 
0052 #endif // KISSPINBOXHSXSELECTOR_H