File indexing completed on 2024-06-09 04:20:44
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 KOPATHSEGMENTBREAKCOMMAND_H 0009 #define KOPATHSEGMENTBREAKCOMMAND_H 0010 0011 #include <kundo2command.h> 0012 #include "KoPathPointData.h" 0013 0014 /// The undo / redo command for breaking a subpath by removing the segment 0015 class KoPathSegmentBreakCommand : public KUndo2Command 0016 { 0017 public: 0018 /** 0019 * Command to break a subpath by removing the segment 0020 * 0021 * The segment following the given point will be removed. 0022 * 0023 * @param pointData describing the point 0024 * @param parent the parent command used for macro commands 0025 */ 0026 explicit KoPathSegmentBreakCommand(const KoPathPointData &pointData, KUndo2Command *parent = 0); 0027 ~KoPathSegmentBreakCommand() override; 0028 0029 /// redo the command 0030 void redo() override; 0031 /// revert the actions done in redo 0032 void undo() override; 0033 private: 0034 KoPathPointData m_pointData; 0035 KoPathPointIndex m_startIndex; 0036 bool m_broken; 0037 }; 0038 0039 #endif // KOPATHSEGMENTBREAKCOMMAND_H