1 /*
2  *  Copyright (c) 2016 Dmitry Kazakov <dimula73@gmail.com>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef KOSHAPERESIZECOMMAND_H
20 #define KOSHAPERESIZECOMMAND_H
21 
22 #include "kritaflake_export.h"
23 #include "kundo2command.h"
24 #include "kis_command_utils.h"
25 
26 #include <QList>
27 #include <QPointF>
28 #include <KoFlake.h>
29 
30 #include <QScopedPointer>
31 
32 class KoShape;
33 
34 
35 class KRITAFLAKE_EXPORT KoShapeResizeCommand : public KisCommandUtils::SkipFirstRedoBase
36 {
37 public:
38     KoShapeResizeCommand(const QList<KoShape*> &shapes,
39                          qreal scaleX, qreal scaleY,
40                          const QPointF &absoluteStillPoint, bool useGLobalMode,
41                          bool usePostScaling, const QTransform &postScalingCoveringTransform,
42                          KUndo2Command *parent = 0);
43 
44     ~KoShapeResizeCommand() override;
45     void redoImpl() override;
46     void undoImpl() override;
47 
48     QMap<KoShape*, QRectF> redoNoUpdate();
49     QMap<KoShape*, QRectF> undoNoUpdate();
50 
51     int id() const override;
52     bool mergeWith(const KUndo2Command *command) override;
53 
54     void replaceResizeAction(qreal scaleX, qreal scaleY,
55                              const QPointF &absoluteStillPoint);
56 
57 private:
58     struct Private;
59     QScopedPointer<Private> const m_d;
60 
61 };
62 
63 #endif // KOSHAPERESIZECOMMAND_H
64