/* * Copyright (c) 2018-2020, Andreas Kling * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace GUI { class UndoStack { public: UndoStack() = default; ~UndoStack() = default; void push(NonnullOwnPtr); ErrorOr try_push(NonnullOwnPtr); bool can_undo() const; bool can_redo() const; void undo(); void redo(); void set_current_unmodified(); bool is_current_modified() const; Optional