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

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2010 Jeremy Lugagne <lugagne.jeremy@gmail.com>
0003  * SPDX-FileCopyrightText: 2011 Jean-Nicolas Artaud <jeannicolasartaud@gmail.com>
0004  *
0005  * SPDX-License-Identifier: LGPL-2.0-or-later
0006  */
0007 
0008 #ifndef KoPathShapeMarkerCommand_H
0009 #define KoPathShapeMarkerCommand_H
0010 
0011 #include "kritaflake_export.h"
0012 
0013 #include <QScopedPointer>
0014 
0015 #include "KoFlake.h"
0016 #include <kundo2command.h>
0017 #include <QList>
0018 
0019 class KoPathShape;
0020 class KoMarker;
0021 
0022 /// The undo / redo command for setting the shape marker
0023 class KRITAFLAKE_EXPORT KoPathShapeMarkerCommand : public KUndo2Command
0024 {
0025 public:
0026     /**
0027      * Command to set a new shape marker.
0028      * @param shapes a set of all the shapes that should get the new marker.
0029      * @param marker the new marker, the same for all given shapes
0030      * @param position the position - start or end - of the marker on the shape
0031      * @param parent the parent command used for macro commands
0032      */
0033     KoPathShapeMarkerCommand(const QList<KoPathShape*> &shapes, KoMarker *marker, KoFlake::MarkerPosition position, KUndo2Command *parent = 0);
0034 
0035     ~KoPathShapeMarkerCommand() override;
0036 
0037     void redo() override;
0038     void undo() override;
0039 
0040     int id() const override;
0041     bool mergeWith(const KUndo2Command *command) override;
0042 
0043 private:
0044     struct Private;
0045     const QScopedPointer<Private> m_d;
0046 };
0047 
0048 #endif // KoPathShapeMarkerCommand_H