Command.h 430 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/String.h>
  8. namespace GUI {
  9. class Command {
  10. public:
  11. virtual ~Command();
  12. virtual void undo() { }
  13. virtual void redo() { }
  14. virtual String action_text() const { return {}; }
  15. virtual bool merge_with(Command const&) { return false; }
  16. protected:
  17. Command() { }
  18. };
  19. }