File indexing completed on 2024-05-12 16:02:04

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 <QWidget>
0011 #include <QVector3D>
0012 #include "kritawidgets_export.h"
0013 #include <QScopedPointer>
0014 
0015 class KisVisualColorSelector;
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 to
0031      *        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 attachToSelector(KisVisualColorSelector *selector);
0038 
0039 Q_SIGNALS:
0040     void sigHSXChanged(const QVector3D &hsx);
0041 
0042 public Q_SLOTS:
0043     void slotColorModelChanged();
0044     void slotHSXChanged(const QVector3D &hsx);
0045 private Q_SLOTS:
0046     void slotSpinBoxChanged();
0047 private:
0048     struct Private;
0049     const QScopedPointer<Private> m_d;
0050 };
0051 
0052 #endif // KISSPINBOXHSXSELECTOR_H