summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.h
blob: 72c338cfed7fa607ed5d77bcc629ca3a1b4a6ec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/RefCounted.h>
#include <AK/Weakable.h>
#include <LibWeb/Bindings/Wrappable.h>
#include <LibWeb/SVG/SVGLength.h>

namespace Web::SVG {

// https://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedLength
class SVGAnimatedLength
    : public RefCounted<SVGAnimatedLength>
    , public Bindings::Wrappable
    , public Weakable<SVGAnimatedLength> {
public:
    using WrapperType = Bindings::SVGAnimatedLengthWrapper;

    static NonnullRefPtr<SVGAnimatedLength> create(NonnullRefPtr<SVGLength> base_val, NonnullRefPtr<SVGLength> anim_val);
    virtual ~SVGAnimatedLength() = default;

    NonnullRefPtr<SVGLength> const& base_val() const { return m_base_val; }
    NonnullRefPtr<SVGLength> const& anim_val() const { return m_anim_val; }

private:
    SVGAnimatedLength(NonnullRefPtr<SVGLength> base_val, NonnullRefPtr<SVGLength> anim_val);

    NonnullRefPtr<SVGLength> m_base_val;
    NonnullRefPtr<SVGLength> m_anim_val;
};

}