SVGAnimatedLength.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Bindings/PlatformObject.h>
  8. #include <LibWeb/SVG/SVGLength.h>
  9. namespace Web::SVG {
  10. // https://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedLength
  11. class SVGAnimatedLength final : public Bindings::PlatformObject {
  12. WEB_PLATFORM_OBJECT(SVGAnimatedLength, Bindings::PlatformObject);
  13. public:
  14. static WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGAnimatedLength>> create(JS::Realm&, JS::NonnullGCPtr<SVGLength> base_val, JS::NonnullGCPtr<SVGLength> anim_val);
  15. virtual ~SVGAnimatedLength() override;
  16. JS::NonnullGCPtr<SVGLength> base_val() const { return m_base_val; }
  17. JS::NonnullGCPtr<SVGLength> anim_val() const { return m_anim_val; }
  18. private:
  19. SVGAnimatedLength(JS::Realm&, JS::NonnullGCPtr<SVGLength> base_val, JS::NonnullGCPtr<SVGLength> anim_val);
  20. virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
  21. virtual void visit_edges(Cell::Visitor&) override;
  22. JS::NonnullGCPtr<SVGLength> m_base_val;
  23. JS::NonnullGCPtr<SVGLength> m_anim_val;
  24. };
  25. }