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