00001 00005 00006 #ifndef _H_ACT_ACTION 00007 #define _H_ACT_ACTION 00008 00009 #include "GEN_Shared.h" 00010 #include "GEN_StdString.h" 00011 00019 00020 class ACT_Action : public GEN_Shared { 00021 public: 00027 ACT_Action(GEN_String& name, bool applied = false); 00028 00033 inline virtual void getName(GEN_String& name) const; 00034 00039 inline virtual char* getName(); 00040 00045 inline virtual void setName(const GEN_String& name); 00046 00051 inline virtual bool getIsApplied() const; 00052 00053 00059 virtual void apply(); 00060 00066 virtual void undo(); 00067 00068 protected: 00072 virtual void doApply() = 0; 00073 00077 virtual void doUndo() = 0; 00078 00080 bool m_applied; 00082 GEN_String m_name; 00083 }; 00084 00085 00086 void ACT_Action::getName(GEN_String& name) const 00087 { 00088 name = m_name; 00089 } 00090 00091 char* ACT_Action::getName() 00092 { 00093 return m_name.Ptr(); 00094 } 00095 00096 void ACT_Action::setName(const GEN_String& name) 00097 { 00098 m_name = name; 00099 } 00100 00101 inline bool ACT_Action::getIsApplied() const 00102 { 00103 return m_applied; 00104 } 00105 00106 #endif // _H_ACT_ACTION