1/* 2 * Copyright 2006-2012 Stephan A��mus <superstippi@gmx.de> 3 * Distributed under the terms of the MIT License. 4 */ 5 6#ifndef UNDOABLE_EDIT_H 7#define UNDOABLE_EDIT_H 8 9#include <Referenceable.h> 10 11class BString; 12class EditContext; 13 14class UndoableEdit : public BReferenceable { 15public: 16 UndoableEdit(); 17 virtual ~UndoableEdit(); 18 19 virtual status_t InitCheck(); 20 21 virtual status_t Perform(EditContext& context); 22 virtual status_t Undo(EditContext& context); 23 virtual status_t Redo(EditContext& context); 24 25 virtual void GetName(BString& name); 26 27 virtual bool UndoesPrevious(const UndoableEdit* previous); 28 virtual bool CombineWithNext(const UndoableEdit* next); 29 virtual bool CombineWithPrevious( 30 const UndoableEdit* previous); 31 32 inline bigtime_t TimeStamp() const 33 { return fTimeStamp; } 34 35protected: 36 bigtime_t fTimeStamp; 37}; 38 39typedef BReference<UndoableEdit> UndoableEditRef; 40 41#endif // UNDOABLE_EDIT_H 42