File indexing completed on 2025-02-02 04:14:50

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2011 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #ifndef KOSHAPEUNCLIPCOMMAND_H
0008 #define KOSHAPEUNCLIPCOMMAND_H
0009 
0010 #include "kritaflake_export.h"
0011 #include <kundo2command.h>
0012 #include <QList>
0013 
0014 class KoShape;
0015 class KoShapeControllerBase;
0016 
0017 /// The undo / redo command for removing the shape clip path
0018 class KRITAFLAKE_EXPORT KoShapeUnclipCommand : public KUndo2Command
0019 {
0020 public:
0021     /**
0022      * Command to remove clip path from multiple shapes.
0023      * @param controller the controller to used for adding the clip shapes.
0024      * @param shapes a set of all the shapes to remove the clip path from.
0025      * @param parent the parent command used for macro commands
0026      */
0027     KoShapeUnclipCommand(KoShapeControllerBase *controller, const QList<KoShape*> &shapes, KUndo2Command *parent = 0);
0028 
0029     /**
0030      * Command to remove clip path from a single shape.
0031      * @param controller the controller to used for adding the clip shapes.
0032      * @param shape a single shape to remove the clip path from.
0033      * @param parent the parent command used for macro commands
0034      */
0035     KoShapeUnclipCommand(KoShapeControllerBase *controller, KoShape *shape, KUndo2Command *parent = 0);
0036 
0037     /// Destroys the command
0038     ~KoShapeUnclipCommand() override;
0039     
0040     /// redo the command
0041     void redo() override;
0042     /// revert the actions done in redo
0043     void undo() override;
0044 
0045 private:
0046     class Private;
0047     Private * const d;
0048 };
0049 
0050 #endif // KOSHAPEUNCLIPCOMMAND_H