1 /* This file is part of the KDE project
2    Copyright (C) 2009 Jeremias Epperlein
3 
4    This library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Library General Public
6    License as published by the Free Software Foundation; either
7    version 2 of the License, or (at your option) any later version.
8 
9    This library 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 GNU
12    Library General Public License for more details.
13 
14    You should have received a copy of the GNU Library General Public License
15    along with this library; see the file COPYING.LIB.  If not, write to
16    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17    Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef FORMULACOMMANDUPDATE_H
21 #define FORMULACOMMANDUPDATE_H
22 #include <kundo2command.h>
23 
24 class FormulaCommand;
25 class KoFormulaShape;
26 
27 /**
28  *
29  * This class is used to wrap FormulaCommands, which are part of KFormulaLib
30  * and therefore can't notify the tool and shape of changes (as they don't know
31  * about them). This notification it done by this classes undo / redo methods
32  * after calling the respective methods from the wrapped class
33  *
34  **/
35 
36 class FormulaCommandUpdate : public KUndo2Command {
37 public:
38     FormulaCommandUpdate(KoFormulaShape* shape, FormulaCommand* command);
39 
40     /// Execute the command
41     void redo() override;
42 
43     /// Revert the actions done in redo()
44     void undo() override;
45 
46 private:
47     /// The BasicElement that owns the newly added Text
48     FormulaCommand* m_command;
49     KoFormulaShape* m_shape;
50 };
51 
52 
53 #endif // FORMULACOMMANDUPDATE_H
54