File indexing completed on 2025-02-02 04:14:49
0001 /* This file is part of the KDE project 0002 * SPDX-FileCopyrightText: 2006 Thomas Zander <zander@kde.org> 0003 * SPDX-FileCopyrightText: 2006 Jan Hambrecht <jaham@gmx.net> 0004 * 0005 * SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef KOSHAPEDELETECOMMAND_H 0009 #define KOSHAPEDELETECOMMAND_H 0010 0011 #include "kritaflake_export.h" 0012 #include <kundo2command.h> 0013 #include <QList> 0014 0015 class KoShape; 0016 class KoShapeControllerBase; 0017 0018 /// The undo / redo command for deleting shapes 0019 class KRITAFLAKE_EXPORT KoShapeDeleteCommand : public KUndo2Command 0020 { 0021 public: 0022 /** 0023 * Command to delete a single shape by means of a shape controller. 0024 * @param controller the controller to used for deleting. 0025 * @param shape a single shape that should be deleted. 0026 * @param parent the parent command used for macro commands 0027 */ 0028 KoShapeDeleteCommand(KoShapeControllerBase *controller, KoShape *shape, KUndo2Command *parent = 0); 0029 /** 0030 * Command to delete a set of shapes by means of a shape controller. 0031 * @param controller the controller to used for deleting. 0032 * @param shapes a set of all the shapes that should be deleted. 0033 * @param parent the parent command used for macro commands 0034 */ 0035 KoShapeDeleteCommand(KoShapeControllerBase *controller, const QList<KoShape*> &shapes, KUndo2Command *parent = 0); 0036 ~KoShapeDeleteCommand() override; 0037 /// redo the command 0038 void redo() override; 0039 /// revert the actions done in redo 0040 void undo() override; 0041 private: 0042 class Private; 0043 Private * const d; 0044 }; 0045 0046 #endif