File indexing completed on 2024-12-22 04:12:17

0001 /*
0002  *  SPDX-FileCopyrightText: 2016 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef __KIS_UNIFORM_PAINTOP_PROPERTY_WIDGET_H
0008 #define __KIS_UNIFORM_PAINTOP_PROPERTY_WIDGET_H
0009 
0010 #include <QScopedPointer>
0011 #include <QWidget>
0012 
0013 #include "kis_uniform_paintop_property.h"
0014 
0015 
0016 class KisUniformPaintOpPropertyWidget : public QWidget
0017 {
0018     Q_OBJECT
0019 public:
0020     KisUniformPaintOpPropertyWidget(KisUniformPaintOpPropertySP property, QWidget *parent);
0021     ~KisUniformPaintOpPropertyWidget() override;
0022     void slotThemeChanged(QPalette pal);
0023 
0024 protected:
0025     KisUniformPaintOpPropertySP property() const;
0026 
0027 protected Q_SLOTS:
0028     virtual void setValue(const QVariant &value) = 0;
0029 
0030 Q_SIGNALS:
0031     void valueChanged(const QVariant &value);
0032 
0033 private:
0034     struct Private;
0035     const QScopedPointer<Private> m_d;
0036 };
0037 
0038 class QCheckBox;
0039 
0040 class KisUniformPaintOpPropertyIntSlider : public KisUniformPaintOpPropertyWidget
0041 {
0042     Q_OBJECT
0043 public:
0044     KisUniformPaintOpPropertyIntSlider(KisUniformPaintOpPropertySP property, QWidget *parent);
0045 
0046     void setValue(const QVariant &value) override;
0047 
0048 private Q_SLOTS:
0049     void slotSliderChanged(int value);
0050     void slotRangeChanged();
0051 
0052 private:
0053     QWidget *m_slider;
0054 };
0055 
0056 class KisUniformPaintOpPropertyDoubleSlider : public KisUniformPaintOpPropertyWidget
0057 {
0058     Q_OBJECT
0059 public:
0060     KisUniformPaintOpPropertyDoubleSlider(KisUniformPaintOpPropertySP property, QWidget *parent);
0061 
0062     void setValue(const QVariant &value) override;
0063 
0064 private Q_SLOTS:
0065     void slotSliderChanged(qreal value);
0066     void slotRangeChanged();
0067 
0068 private:
0069     QWidget *m_slider;
0070 };
0071 
0072 class KisUniformPaintOpPropertyCheckBox : public KisUniformPaintOpPropertyWidget
0073 {
0074     Q_OBJECT
0075 public:
0076     KisUniformPaintOpPropertyCheckBox(KisUniformPaintOpPropertySP property, QWidget *parent);
0077 
0078     void setValue(const QVariant &value) override;
0079 
0080 private Q_SLOTS:
0081     void slotCheckBoxChanged(bool value);
0082 
0083 private:
0084     QCheckBox *m_checkBox;
0085 };
0086 
0087 class QComboBox;
0088 
0089 class KisUniformPaintOpPropertyComboBox : public KisUniformPaintOpPropertyWidget
0090 {
0091     Q_OBJECT
0092 public:
0093     KisUniformPaintOpPropertyComboBox(KisUniformPaintOpPropertySP property, QWidget *parent);
0094 
0095     void setValue(const QVariant &value) override;
0096 
0097 private Q_SLOTS:
0098     void slotComboBoxChanged(int value);
0099 
0100 private:
0101     QComboBox *m_comboBox;
0102 };
0103 
0104 #endif /* __KIS_UNIFORM_PAINTOP_PROPERTY_WIDGET_H */