1 /* 2 * Copyright 2006-2112, Stephan Aßmus <superstippi@gmx.de> 3 * Copyright 2021, Andrew Lindesay <apl@lindesay.co.nz> 4 * Distributed under the terms of the MIT License. 5 */ 6 7 #ifndef COMPOUND_EDIT_H 8 #define COMPOUND_EDIT_H 9 10 #include <vector> 11 12 #include <String.h> 13 14 #include "UndoableEdit.h" 15 16 class CompoundEdit : public UndoableEdit { 17 public: 18 CompoundEdit(const char* name); 19 virtual ~CompoundEdit(); 20 21 virtual status_t InitCheck(); 22 23 virtual status_t Perform(EditContext& context); 24 virtual status_t Undo(EditContext& context); 25 virtual status_t Redo(EditContext& context); 26 27 virtual void GetName(BString& name); 28 29 void AppendEdit(const UndoableEditRef& edit); 30 31 private: 32 std::vector<UndoableEditRef> 33 fEdits; 34 BString fName; 35 }; 36 37 #endif // COMPOUND_EDIT_H 38