1 /* This file is part of the KDE project
2  * Copyright (C) 2006 Thomas Zander <zander@kde.org>
3  * Copyright (C) 2006 Jan Hambrecht <jaham@gmx.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef KOSHAPELOCKCOMMAND_H
22 #define KOSHAPELOCKCOMMAND_H
23 
24 #include <kundo2command.h>
25 #include <QList>
26 
27 class KoShape;
28 
29 /// The undo / redo command to lock a set of shapes position and size
30 class KoShapeLockCommand : public KUndo2Command
31 {
32 public:
33     /**
34      * Command to lock a set of shapes position and size
35      * @param shapes a set of shapes that should change lock state
36      * @param oldLock list of old lock states the same length as @p shapes
37      * @param newLock list of new lock states the same length as @p shapes
38      * @param parent the parent command used for macro commands
39      */
40     KoShapeLockCommand(const QList<KoShape*> &shapes, const QList<bool> &oldLock, const QList<bool> &newLock,
41                        KUndo2Command *parent = 0);
42     ~KoShapeLockCommand() override;
43 
44     /// redo the command
45     void redo() override;
46     /// revert the actions done in redo
47     void undo() override;
48 
49 private:
50     QList<KoShape*> m_shapes;    /// the shapes to set background for
51     QList<bool> m_oldLock;       /// old lock states
52     QList<bool> m_newLock;       /// new lock states
53 };
54 
55 #endif
56