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

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2012 C. Boemann <cbo@boemann.dk>
0003  * SPDX-FileCopyrightText: 2008 Jan Hambrecht <jaham@gmx.net>
0004  *
0005  * SPDX-License-Identifier: LGPL-2.0-or-later
0006  */
0007 
0008 #ifndef KOSHADOWCONFIGWIDGET_H
0009 #define KOSHADOWCONFIGWIDGET_H
0010 
0011 #include "kritawidgets_export.h"
0012 #include <QWidget>
0013 
0014 class KoUnit;
0015 class KoCanvasBase;
0016 class KisSpinBoxUnitManager;
0017 
0018 /// A widget for configuring the shadow of a shape
0019 class KRITAWIDGETS_EXPORT KoShadowConfigWidget : public QWidget
0020 {
0021     Q_OBJECT
0022 public:
0023     explicit KoShadowConfigWidget(QWidget *parent);
0024     ~KoShadowConfigWidget() override;
0025 
0026     /// Sets the shadow color
0027     void setShadowColor(const QColor &color);
0028 
0029     /// Returns the shadow color
0030     QColor shadowColor() const;
0031 
0032     /// Sets the shadow offset
0033     void setShadowOffset(const QPointF &offset);
0034 
0035     /// Returns the shadow offset
0036     QPointF shadowOffset() const;
0037 
0038     /// Sets the shadow blur radius
0039     void setShadowBlur(const qreal &blur);
0040 
0041     /// Returns the shadow blur radius
0042     qreal shadowBlur() const;
0043 
0044     /// Sets if the shadow is visible
0045     void setShadowVisible(bool visible);
0046 
0047     /// Returns if shadow is visible
0048     bool shadowVisible() const;
0049 
0050 public Q_SLOTS:
0051 
0052     void setUnitManagers(KisSpinBoxUnitManager* managerBlur, KisSpinBoxUnitManager* managerOffset);
0053     void setUnit( const KoUnit &unit );
0054     void setCanvas(KoCanvasBase *canvas);
0055 
0056 private Q_SLOTS:
0057     void visibilityChanged();
0058     void applyChanges();
0059     void selectionChanged();
0060     void resourceChanged( int key, const QVariant & res );
0061 
0062 private:
0063     class Private;
0064     Private *const d;
0065 };
0066 
0067 #endif // KOSHADOWCONFIGWIDGET_H