File indexing completed on 2024-06-23 04:27:04
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 RECTANGLESHAPECONFIGCOMMAND_H 0008 #define RECTANGLESHAPECONFIGCOMMAND_H 0009 0010 #include <kundo2command.h> 0011 0012 class RectangleShape; 0013 0014 /// The undo / redo command for configuring a rectangle shape 0015 class RectangleShapeConfigCommand : public KUndo2Command 0016 { 0017 public: 0018 /** 0019 * Configures a rectangle shape 0020 * @param Rectangle the rectangle shape to configure 0021 * @param cornerRadiusX the x corner radius 0022 * @param cornerRadiusY the y corner radius 0023 * @param parent the optional parent command 0024 */ 0025 RectangleShapeConfigCommand(RectangleShape *rectangle, qreal cornerRadiusX, qreal cornerRadiusY, KUndo2Command *parent = 0); 0026 /// redo the command 0027 void redo() override; 0028 /// revert the actions done in redo 0029 void undo() override; 0030 0031 int id() const override; 0032 bool mergeWith(const KUndo2Command *command) override; 0033 0034 private: 0035 RectangleShape *m_rectangle; 0036 qreal m_oldCornerRadiusX; 0037 qreal m_oldCornerRadiusY; 0038 qreal m_newCornerRadiusX; 0039 qreal m_newCornerRadiusY; 0040 }; 0041 0042 #endif // RECTANGLESHAPECONFIGCOMMAND_H 0043