File indexing completed on 2024-12-22 04:09:15

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2007 Thomas Zander <zander@kde.org>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 #ifndef PATHTOOLOPTIONWIDGET_H
0007 #define PATHTOOLOPTIONWIDGET_H
0008 
0009 #include <QWidget>
0010 #include <QFlags>
0011 
0012 #include <ui_PathToolOptionWidgetBase.h>
0013 
0014 class KoPathTool;
0015 class KoPathShape;
0016 class KoShapeConfigWidgetBase;
0017 class KoCanvasBase;
0018 
0019 
0020 class PathToolOptionWidget : public QWidget
0021 {
0022     Q_OBJECT
0023 public:
0024     enum Type {
0025         PlainPath = 1,
0026         ParametricShape = 2
0027     };
0028     Q_DECLARE_FLAGS(Types, Type)
0029 
0030     explicit PathToolOptionWidget(KoPathTool *tool, QWidget *parent = 0);
0031     ~PathToolOptionWidget() override;
0032 
0033 public Q_SLOTS:
0034     void setSelectionType(int type);
0035     void setCurrentShape(KoPathShape *pathShape);
0036 
0037 private Q_SLOTS:
0038     void slotShapePropertyChanged();
0039 
0040 Q_SIGNALS:
0041     void sigRequestUpdateActions();
0042 
0043 protected:
0044     void showEvent(QShowEvent *event) override;
0045 
0046 private:
0047     Ui::PathToolOptionWidgetBase widget;
0048 
0049     KoPathShape *m_currentShape;
0050     QString m_currentShapeId;
0051     KoShapeConfigWidgetBase *m_currentPanel;
0052     KoCanvasBase *m_canvas;
0053 };
0054 
0055 Q_DECLARE_OPERATORS_FOR_FLAGS(PathToolOptionWidget::Types)
0056 
0057 #endif