00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef UNDOMODEL_H_HEADER_INCLUDED_C16ED098 00020 #define UNDOMODEL_H_HEADER_INCLUDED_C16ED098 00021 00022 #include "mitkOperation.h" 00023 #include <itkObject.h> 00024 #include <itkObjectFactory.h> 00025 00026 namespace mitk { 00027 00028 class UndoStackItem; 00029 class OperationEvent; 00030 class OperationActor; 00031 00032 //##Documentation 00033 //## @brief superclass for all UndoModels 00034 //## 00035 //## all necessary operations, that all UndoModels share. 00036 //## @ingroup Undo 00037 class MITK_CORE_EXPORT UndoModel : public itk::Object 00038 { 00039 public: 00040 mitkClassMacro(UndoModel, itk::Object); 00041 00042 // no New Macro because this is an abstract class! 00043 00044 virtual bool SetOperationEvent(UndoStackItem* stackItem) = 0; 00045 00046 virtual bool Undo() = 0; 00047 virtual bool Undo(bool fine) = 0; 00048 00049 virtual bool Redo() = 0; 00050 virtual bool Redo(bool fine) = 0; 00051 00052 //##Documentation 00053 //## @brief clears undo and Redolist 00054 virtual void Clear() = 0; 00055 00056 //##Documentation 00057 //## @brief clears the RedoList 00058 virtual void ClearRedoList() = 0; 00059 00060 //##Documentation 00061 //## @brief true if RedoList is empty 00062 virtual bool RedoListEmpty() = 0; 00063 00064 //##Documentation 00065 //## @brief returns the ObjectEventId of the 00066 //## top Element in the OperationHistory of the selected 00067 //## UndoModel 00068 virtual int GetLastObjectEventIdInList() = 0; 00069 00070 //##Documentation 00071 //## @brief returns the GroupEventId of the 00072 //## top Element in the OperationHistory of the selected 00073 //## UndoModel 00074 virtual int GetLastGroupEventIdInList() = 0; 00075 00076 //##Documentation 00077 //## @brief returns the last specified OperationEvent in Undo-list 00078 //## corresponding to the given values; if nothing found, then returns NULL 00079 //## 00080 //## needed to get the old Position of an Element for declaring an UndoOperation 00081 virtual OperationEvent* GetLastOfType(OperationActor* destination, OperationType opType) = 0; 00082 00083 protected: 00084 UndoModel(){}; 00085 virtual ~UndoModel(){}; 00086 00087 }; 00088 00089 }// namespace mitk 00090 #endif /* UNDOMODEL_H_HEADER_INCLUDED_C16ED098 */ 00091 00092