File indexing completed on 2024-06-09 04:20:43

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2006 Jan Hambrecht <jaham@gmx.net>
0003  * SPDX-FileCopyrightText: 2006, 2007 Thorsten Zachmann <zachmann@kde.org>
0004  *
0005  * SPDX-License-Identifier: LGPL-2.0-or-later
0006  */
0007 
0008 #ifndef KOPATHCOMBINECOMMAND_H
0009 #define KOPATHCOMBINECOMMAND_H
0010 
0011 #include <kundo2command.h>
0012 #include <QList>
0013 #include "kritaflake_export.h"
0014 
0015 class KoShapeControllerBase;
0016 class KoPathShape;
0017 class KoPathPointData;
0018 
0019 /// The undo / redo command for combining two or more paths into one
0020 class KRITAFLAKE_EXPORT KoPathCombineCommand : public KUndo2Command
0021 {
0022 public:
0023     /**
0024      * Command for combining a list of paths into one single path.
0025      * @param controller the controller to used for removing/inserting.
0026      * @param paths the list of paths to combine
0027      * @param parent the parent command used for macro commands
0028      */
0029     KoPathCombineCommand(KoShapeControllerBase *controller, const QList<KoPathShape*> &paths, KUndo2Command *parent = 0);
0030     ~KoPathCombineCommand() override;
0031     /// redo the command
0032     void redo() override;
0033     /// revert the actions done in redo
0034     void undo() override;
0035 
0036     KoPathShape *combinedPath() const;
0037     KoPathPointData originalToCombined(KoPathPointData pd) const;
0038 
0039 private:
0040     class Private;
0041     Private * const d;
0042 };
0043 
0044 #endif // KOPATHCOMBINECOMMAND_H