Commands.h 900 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Forward.h>
  8. namespace Web::Editing {
  9. struct CommandDefinition {
  10. FlyString const& command;
  11. Function<bool(DOM::Document&, String const&)> action;
  12. Function<bool(DOM::Document const&)> indeterminate;
  13. Function<bool(DOM::Document const&)> state;
  14. Function<String(DOM::Document const&)> value;
  15. };
  16. Optional<CommandDefinition const&> find_command_definition(FlyString const&);
  17. // Command implementations
  18. bool command_default_paragraph_separator_action(DOM::Document&, String const&);
  19. String command_default_paragraph_separator_value(DOM::Document const&);
  20. bool command_delete_action(DOM::Document&, String const&);
  21. bool command_style_with_css_action(DOM::Document&, String const&);
  22. bool command_style_with_css_state(DOM::Document const&);
  23. }