File indexing completed on 2024-05-12 16:01:39

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2008 Boudewijn Rempt <boud@valdyas.org>
0003  * SPDX-FileCopyrightText: 2021 L. E. Segovia <amy@amyspark.me>
0004  *
0005  * SPDX-License-Identifier: LGPL-2.0-or-later
0006  */
0007 #ifndef KIS_PAINTOP_SETTINGS_WIDGET_H
0008 #define KIS_PAINTOP_SETTINGS_WIDGET_H
0009 
0010 #include <kritaui_export.h>
0011 
0012 #include <brushengine/kis_paintop_config_widget.h>
0013 
0014 #include "kis_paintop_option.h"
0015 
0016 class KisPropertiesConfiguration;
0017 class KisPaintOpConfigWidget;
0018 class KisPaintopLodLimitations;
0019 
0020 /**
0021  * A common widget for enabling/disabling and determining
0022  * the effect of tablet pressure, tilt and rotation and
0023  * other paintop settings.
0024  */
0025 class KRITAUI_EXPORT KisPaintOpSettingsWidget : public KisPaintOpConfigWidget
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030 
0031     KisPaintOpSettingsWidget(QWidget * parent = 0);
0032 
0033     ~KisPaintOpSettingsWidget() override;
0034 
0035     void addPaintOpOption(KisPaintOpOption *option);
0036     void addPaintOpOption(KisPaintOpOption *option, KisPaintOpOption::PaintopCategory category);
0037 
0038     /// Reimplemented
0039     void setConfiguration(const KisPropertiesConfigurationSP  config) override;
0040 
0041     /// Reimplemented
0042     void writeConfiguration(KisPropertiesConfigurationSP config) const override;
0043 
0044     KisPaintopLodLimitations lodLimitations() const override;
0045 
0046     ///Reimplemented, sets image on option widgets
0047     void setImage(KisImageWSP image) override;
0048 
0049     ///Reimplemented, sets node on option widgets
0050     void setNode(KisNodeWSP node) override;
0051 
0052     void setResourcesInterface(KisResourcesInterfaceSP resourcesInterface) override;
0053     void setCanvasResourcesInterface(KoCanvasResourcesInterfaceSP canvasResourcesInterface) override;
0054 
0055 private Q_SLOTS:
0056 
0057     void changePage(const QModelIndex&);
0058     void lockProperties(const QModelIndex& index);
0059     void slotLockPropertiesDrop();
0060     void slotLockPropertiesSave();
0061     void slotEntryChecked(const QModelIndex &index);
0062 
0063 protected:
0064     void addPaintOpOption(KisPaintOpOption *option, QString category);
0065     virtual void notifyPageChanged();
0066     bool eventFilter(QObject *obj, QEvent *event) override;
0067 
0068 private:
0069     
0070     struct Private;
0071     Private* const m_d;
0072     bool m_saveLockedOption;
0073 
0074 };
0075 
0076 #endif