File indexing completed on 2024-06-23 04:27:04

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2007 Rob Buis <buis@kde.org>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #ifndef SPIRALSHAPECONFIGCOMMAND_H
0008 #define SPIRALSHAPECONFIGCOMMAND_H
0009 
0010 #include "SpiralShape.h"
0011 #include <kundo2command.h>
0012 
0013 /// The undo / redo command for configuring a spiral shape
0014 class SpiralShapeConfigCommand : public KUndo2Command
0015 {
0016 public:
0017     /**
0018      * Configures an spiral shape
0019      * @param spiral the spiral shape to configure
0020      * @param type the spiral type
0021      * @param fade the fade parameter
0022      * @param parent the optional parent command
0023      */
0024     SpiralShapeConfigCommand(SpiralShape *spiral, SpiralShape::SpiralType type, bool clockWise, qreal fade, KUndo2Command *parent = 0);
0025     /// redo the command
0026     void redo() override;
0027     /// revert the actions done in redo
0028     void undo() override;
0029 private:
0030     SpiralShape *m_spiral;
0031     SpiralShape::SpiralType m_oldType;
0032     bool m_oldClockWise;
0033     qreal m_oldFade;
0034     SpiralShape::SpiralType m_newType;
0035     bool m_newClockWise;
0036     qreal m_newFade;
0037 };
0038 
0039 #endif // SPIRALSHAPECONFIGCOMMAND_H
0040