SVGLineElement.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/SVG/SVGAnimatedLength.h>
  8. #include <LibWeb/SVG/SVGGeometryElement.h>
  9. namespace Web::SVG {
  10. class SVGLineElement final : public SVGGeometryElement {
  11. WEB_PLATFORM_OBJECT(SVGLineElement, SVGGeometryElement);
  12. public:
  13. virtual ~SVGLineElement() override = default;
  14. virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
  15. virtual Gfx::Path& get_path() override;
  16. JS::NonnullGCPtr<SVGAnimatedLength> x1() const;
  17. JS::NonnullGCPtr<SVGAnimatedLength> y1() const;
  18. JS::NonnullGCPtr<SVGAnimatedLength> x2() const;
  19. JS::NonnullGCPtr<SVGAnimatedLength> y2() const;
  20. private:
  21. SVGLineElement(DOM::Document&, DOM::QualifiedName);
  22. virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
  23. Optional<Gfx::Path> m_path;
  24. Optional<float> m_x1;
  25. Optional<float> m_y1;
  26. Optional<float> m_x2;
  27. Optional<float> m_y2;
  28. };
  29. }