ladybird/Libraries/LibGUI/GCommand.h
Andreas Kling f430da1d45 LibGUI: Add GUndoStack and GCommand classes
This patch converts the undo stack from GTextDocument into GUndoStack,
and GTextDocumentUndoCommand now inherits from GCommand.

Let's turn this into a generic mechanism that can be used to implement
undo/redo in any application. :^)
2019-11-30 15:36:17 +01:00

20 lines
341 B
C++

#pragma once
#include <AK/String.h>
class GCommand {
public:
virtual ~GCommand();
virtual void undo() {}
virtual void redo() {}
String action_text() const { return m_action_text; }
protected:
GCommand() {}
void set_action_text(const String& text) { m_action_text = text; }
private:
String m_action_text;
};