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

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2007 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #ifndef STARSHAPECONFIGCOMMAND_H
0008 #define STARSHAPECONFIGCOMMAND_H
0009 
0010 #include <kundo2command.h>
0011 
0012 class StarShape;
0013 
0014 /// The undo / redo command for configuring a star shape
0015 class StarShapeConfigCommand : public KUndo2Command
0016 {
0017 public:
0018     /**
0019      * Configures a star shape
0020      * @param star the star shape to configure
0021      * @param cornerCount the number of corners to set
0022      * @param innerRadius the inner radius
0023      * @param outerRadius the outer radius
0024      * @param convex indicates whether the star is convex or not
0025      * @param parent the optional parent command
0026      */
0027     StarShapeConfigCommand(StarShape *star, uint cornerCount, qreal innerRadius, qreal outerRadius, bool convex, KUndo2Command *parent = 0);
0028     /// redo the command
0029     void redo() override;
0030     /// revert the actions done in redo
0031     void undo() override;
0032 private:
0033     StarShape *m_star;
0034     uint m_oldCornerCount;
0035     qreal m_oldInnerRadius;
0036     qreal m_oldOuterRadius;
0037     bool m_oldConvex;
0038     uint m_newCornerCount;
0039     qreal m_newInnerRadius;
0040     qreal m_newOuterRadius;
0041     bool m_newConvex;
0042 };
0043 
0044 #endif // STARSHAPECONFIGCOMMAND_H
0045