1 /* 2 * Copyright (c) 2011 Boudewijn Rempt <boud@valdyas.org> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 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 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser 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 INSERTINLINEOBJECTCOMMAND_H 21 #define INSERTINLINEOBJECTCOMMAND_H 22 23 #include <kundo2command.h> 24 25 class KoInlineObject; 26 class QTextDocument; 27 28 class InsertInlineObjectCommand : public KUndo2Command 29 { 30 public: 31 InsertInlineObjectCommand(KoInlineObject *inlineObject, QTextDocument *document, KUndo2Command *parent); 32 ~InsertInlineObjectCommand() override; 33 34 /// redo the command 35 void redo() override; 36 /// revert the actions done in redo 37 void undo() override; 38 private: 39 40 KoInlineObject *m_inlineObject; 41 QTextDocument *m_document; 42 bool m_deleteInlineObject; 43 bool m_first; 44 int m_position; 45 }; 46 47 #endif // INSERTINLINEOBJECTCOMMAND_H 48