1 /* 2 * Copyright 2006, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 #ifndef COMMAND_H 10 #define COMMAND_H 11 12 #include <SupportDefs.h> 13 #include <String.h> 14 15 class BString; 16 17 class Command { 18 public: 19 Command(); 20 virtual ~Command(); 21 22 virtual status_t InitCheck(); 23 24 virtual status_t Perform(); 25 virtual status_t Undo(); 26 virtual status_t Redo(); 27 28 virtual void GetName(BString& name); 29 30 virtual bool UndoesPrevious(const Command* previous); 31 virtual bool CombineWithNext(const Command* next); 32 virtual bool CombineWithPrevious(const Command* previous); 33 34 protected: 35 const char* _GetString(uint32 key, 36 const char* defaultString) const; 37 38 bigtime_t fTimeStamp; 39 }; 40 41 #endif // COMMAND_H 42