class EE::UI::UndoStack¶
#include <undostack.hpp> class UndoStack: public EE::NonCopyable { public: // typedefs typedef Uint32 EventId; typedef std::function<void(const Event*event)> EventCb; // enums enum EventType; // classes class Event; class EventCanRedoChanged; class EventCanUndoChanged; class EventCleanChanged; class EventIndexChanged; class EventRedoTextChanged; class EventUndoTextChanged; // construction ~UndoStack(); // methods void clear(); void push(UndoCommand* cmd); bool canUndo() const; bool canRedo() const; std::string undoText() const; std::string redoText() const; int count() const; int index() const; std::string text(int idx) const; bool isClean() const; int cleanIndex() const; void beginMacro(const std::string& text); void endMacro(); void setUndoLimit(int limit); int undoLimit() const; const UndoCommand* command(int index) const; void setClean(); void resetClean(); void setIndex(int idx); void undo(); void redo(); EventId addEventListener(EventType type, EventCb cb); EventId on(EventType type, EventCb cb); void removeEventListener(EventId id); };