1 /* 2 * MoveCommand.h 3 * 4 * Copyright (C) 1999 Stephen F. White 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program (see the file "COPYING" for details); if 18 * not, write to the Free Software Foundation, Inc., 675 Mass Ave, 19 * Cambridge, MA 02139, USA. 20 */ 21 22 #pragma once 23 24 #include "Command.h" 25 26 class Node; 27 class FieldValue; 28 29 class MoveCommand : public Command { 30 public: 31 MoveCommand(Node *node, Node *src, int srcField, 32 Node *dest, int destField, 33 int destIndex = -1, bool handleUSE = false); 34 virtual ~MoveCommand(); 35 36 virtual void execute(SceneView *sender = NULL); 37 virtual void undo(); getType()38 virtual int getType() { return MOVE_COMMAND; } 39 40 protected: 41 Node *m_node; 42 Node *m_src; 43 int m_srcField; 44 Node *m_dest; 45 int m_destField; 46 FieldValue *m_oldValueSrc; 47 FieldValue *m_oldValueDest; 48 FieldValue *m_newValueSrc; 49 FieldValue *m_newValueDest; 50 bool m_failed; 51 bool m_isUSE; 52 }; 53