2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 11:38:21 +03:00
|
|
|
*/
|
|
|
|
|
2019-11-30 17:36:17 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/String.h>
|
|
|
|
|
2020-02-02 17:07:41 +03:00
|
|
|
namespace GUI {
|
|
|
|
|
|
|
|
class Command {
|
2019-11-30 17:36:17 +03:00
|
|
|
public:
|
2020-02-02 17:07:41 +03:00
|
|
|
virtual ~Command();
|
2019-11-30 17:36:17 +03:00
|
|
|
|
2020-09-18 10:49:51 +03:00
|
|
|
virtual void undo() { }
|
|
|
|
virtual void redo() { }
|
2019-11-30 17:36:17 +03:00
|
|
|
|
2021-05-08 22:16:47 +03:00
|
|
|
virtual String action_text() const { return {}; }
|
2021-05-08 17:49:36 +03:00
|
|
|
virtual bool merge_with(Command const&) { return false; }
|
|
|
|
|
2019-11-30 17:36:17 +03:00
|
|
|
protected:
|
2020-09-18 10:49:51 +03:00
|
|
|
Command() { }
|
2019-11-30 17:36:17 +03:00
|
|
|
};
|
2020-02-02 17:07:41 +03:00
|
|
|
|
|
|
|
}
|