File indexing completed on 2025-03-09 04:03:41

0001 /*
0002  *  SPDX-FileCopyrightText: 2016 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef KOSHAPERESIZECOMMAND_H
0008 #define KOSHAPERESIZECOMMAND_H
0009 
0010 #include "kritaflake_export.h"
0011 #include "kundo2command.h"
0012 #include "kis_command_utils.h"
0013 
0014 #include <QList>
0015 #include <QPointF>
0016 #include <KoFlake.h>
0017 
0018 #include <QScopedPointer>
0019 
0020 class KoShape;
0021 
0022 
0023 class KRITAFLAKE_EXPORT KoShapeResizeCommand : public KisCommandUtils::SkipFirstRedoBase
0024 {
0025 public:
0026     KoShapeResizeCommand(const QList<KoShape*> &shapes,
0027                          qreal scaleX, qreal scaleY,
0028                          const QPointF &absoluteStillPoint, bool useGLobalMode,
0029                          bool usePostScaling, const QTransform &postScalingCoveringTransform,
0030                          KUndo2Command *parent = 0);
0031 
0032     ~KoShapeResizeCommand() override;
0033     void redoImpl() override;
0034     void undoImpl() override;
0035 
0036     QMap<KoShape*, QRectF> redoNoUpdate();
0037     QMap<KoShape*, QRectF> undoNoUpdate();
0038 
0039     int id() const override;
0040     bool mergeWith(const KUndo2Command *command) override;
0041 
0042     void replaceResizeAction(qreal scaleX, qreal scaleY,
0043                              const QPointF &absoluteStillPoint);
0044 
0045 private:
0046     struct Private;
0047     QScopedPointer<Private> const m_d;
0048 
0049 };
0050 
0051 #endif // KOSHAPERESIZECOMMAND_H