SVGCircleElement.h 908 B

1234567891011121314151617181920212223242526272829303132333435363738
  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, SVGGraphicsElement);
  12. public:
  13. virtual ~SVGCircleElement() override = default;
  14. virtual void parse_attribute(FlyString const& name, String 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. Optional<Gfx::Path> m_path;
  22. Optional<float> m_center_x;
  23. Optional<float> m_center_y;
  24. Optional<float> m_radius;
  25. };
  26. }