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