File indexing completed on 2024-05-26 04:26:19
0001 /* This file is part of the KDE project 0002 * SPDX-FileCopyrightText: 2007 Peter Simonsson <peter.simonsson@gmail.com> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KOSHAPEKEEPASPECTRATIOCOMMAND_H 0008 #define KOSHAPEKEEPASPECTRATIOCOMMAND_H 0009 0010 #include "kritaflake_export.h" 0011 #include <kundo2command.h> 0012 #include <QList> 0013 0014 class KoShape; 0015 0016 /** 0017 * Command that changes the keepAspectRatio property of KoShape 0018 */ 0019 class KRITAFLAKE_EXPORT KoShapeKeepAspectRatioCommand : public KUndo2Command 0020 { 0021 public: 0022 /** 0023 * Constructor 0024 * @param shapes the shapes affected by the command 0025 * @param newKeepAspectRatio the new setting 0026 * @param parent the parent command 0027 */ 0028 KoShapeKeepAspectRatioCommand(const QList<KoShape*> &shapes, bool newKeepAspectRatio, KUndo2Command* parent = 0); 0029 ~KoShapeKeepAspectRatioCommand() override; 0030 0031 /// Execute the command 0032 void redo() override; 0033 /// Unexecute the command 0034 void undo() override; 0035 0036 private: 0037 QList<KoShape*> m_shapes; 0038 QList<bool> m_oldKeepAspectRatio; 0039 QList<bool> m_newKeepAspectRatio; 0040 }; 0041 0042 #endif