mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-26 19:22:30 -05:00
68a0e4f8d5
Use is<T> to check for specific types of command in HackStudio instead of cluttering up GUI::Command with specialized getters.
30 lines
478 B
C++
30 lines
478 B
C++
/*
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/String.h>
|
|
|
|
namespace GUI {
|
|
|
|
class Command {
|
|
public:
|
|
virtual ~Command();
|
|
|
|
virtual void undo() { }
|
|
virtual void redo() { }
|
|
|
|
String action_text() const { return m_action_text; }
|
|
|
|
protected:
|
|
Command() { }
|
|
void set_action_text(const String& text) { m_action_text = text; }
|
|
|
|
private:
|
|
String m_action_text;
|
|
};
|
|
|
|
}
|