SVGCircleElement.h 1002 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 SVGCircleElement final : public SVGGeometryElement {
  11. WEB_PLATFORM_OBJECT(SVGCircleElement, SVGGeometryElement);
  12. public:
  13. virtual ~SVGCircleElement() 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> cx() const;
  17. JS::NonnullGCPtr<SVGAnimatedLength> cy() const;
  18. JS::NonnullGCPtr<SVGAnimatedLength> r() const;
  19. private:
  20. SVGCircleElement(DOM::Document&, DOM::QualifiedName);
  21. virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
  22. Optional<Gfx::Path> m_path;
  23. Optional<float> m_center_x;
  24. Optional<float> m_center_y;
  25. Optional<float> m_radius;
  26. };
  27. }