SVGTextContentElement.h 926 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Geometry/DOMPoint.h>
  8. #include <LibWeb/SVG/AttributeParser.h>
  9. #include <LibWeb/SVG/SVGGraphicsElement.h>
  10. #include <LibWeb/WebIDL/ExceptionOr.h>
  11. #include <LibWeb/WebIDL/Types.h>
  12. namespace Web::SVG {
  13. // https://svgwg.org/svg2-draft/text.html#InterfaceSVGTextContentElement
  14. class SVGTextContentElement : public SVGGraphicsElement {
  15. WEB_PLATFORM_OBJECT(SVGTextContentElement, SVGGraphicsElement);
  16. public:
  17. WebIDL::ExceptionOr<WebIDL::Long> get_number_of_chars() const;
  18. Optional<TextAnchor> text_anchor() const;
  19. ByteString text_contents() const;
  20. GC::Ref<Geometry::DOMPoint> get_start_position_of_char(WebIDL::UnsignedLong charnum);
  21. protected:
  22. SVGTextContentElement(DOM::Document&, DOM::QualifiedName);
  23. virtual void initialize(JS::Realm&) override;
  24. };
  25. }