Command.h 497 B

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