mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
To facilitate the implementation of "delete" and all associated algorithms, split off this piece of `Document` into a separate directory. This sets up the infrastructure for arbitrary commands to be supported.
27 lines
624 B
C++
27 lines
624 B
C++
/*
|
|
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace Web::Editing {
|
|
|
|
struct CommandDefinition {
|
|
FlyString const& command;
|
|
Function<bool(DOM::Document&, String const&)> action;
|
|
Function<bool(DOM::Document const&)> indeterminate;
|
|
Function<bool(DOM::Document const&)> state;
|
|
Function<String(DOM::Document const&)> value;
|
|
};
|
|
|
|
Optional<CommandDefinition const&> find_command_definition(FlyString const&);
|
|
|
|
// Command implementations
|
|
bool command_delete_action(DOM::Document&, String const&);
|
|
|
|
}
|