SVGTextPositioningElement.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2023, MacDue <macdue@dueutil.tech>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/SVG/SVGTextContentElement.h>
  8. #include <LibWeb/WebIDL/ExceptionOr.h>
  9. namespace Web::SVG {
  10. // https://svgwg.org/svg2-draft/text.html#InterfaceSVGTextPositioningElement
  11. class SVGTextPositioningElement : public SVGTextContentElement {
  12. WEB_PLATFORM_OBJECT(SVGTextPositioningElement, SVGTextContentElement);
  13. public:
  14. virtual void attribute_changed(FlyString const& name, Optional<String> const& value) override;
  15. Gfx::FloatPoint get_offset() const;
  16. JS::NonnullGCPtr<SVGAnimatedLength> x() const;
  17. JS::NonnullGCPtr<SVGAnimatedLength> y() const;
  18. JS::NonnullGCPtr<SVGAnimatedLength> dx() const;
  19. JS::NonnullGCPtr<SVGAnimatedLength> dy() const;
  20. protected:
  21. SVGTextPositioningElement(DOM::Document&, DOM::QualifiedName);
  22. virtual void initialize(JS::Realm&) override;
  23. private:
  24. float m_x { 0 };
  25. float m_y { 0 };
  26. float m_dx { 0 };
  27. float m_dy { 0 };
  28. };
  29. }