1/*
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
3 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#pragma once
22
23#include "FEDropShadow.h"
24#include "SVGFilterPrimitiveStandardAttributes.h"
25
26namespace WebCore {
27
28class SVGFEDropShadowElement final : public SVGFilterPrimitiveStandardAttributes {
29 WTF_MAKE_ISO_ALLOCATED(SVGFEDropShadowElement);
30public:
31 static Ref<SVGFEDropShadowElement> create(const QualifiedName&, Document&);
32
33 void setStdDeviation(float stdDeviationX, float stdDeviationY);
34
35 String in1() const { return m_in1->currentValue(); }
36 float dx() const { return m_dx->currentValue(); }
37 float dy() const { return m_dy->currentValue(); }
38 float stdDeviationX() const { return m_stdDeviationX->currentValue(); }
39 float stdDeviationY() const { return m_stdDeviationY->currentValue(); }
40
41 SVGAnimatedString& in1Animated() { return m_in1; }
42 SVGAnimatedNumber& dxAnimated() { return m_dx; }
43 SVGAnimatedNumber& dyAnimated() { return m_dy; }
44 SVGAnimatedNumber& stdDeviationXAnimated() { return m_stdDeviationX; }
45 SVGAnimatedNumber& stdDeviationYAnimated() { return m_stdDeviationY; }
46
47private:
48 SVGFEDropShadowElement(const QualifiedName&, Document&);
49
50 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDropShadowElement, SVGFilterPrimitiveStandardAttributes>;
51 const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; }
52
53 void parseAttribute(const QualifiedName&, const AtomicString&) override;
54 void svgAttributeChanged(const QualifiedName&) override;
55
56 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
57
58 PropertyRegistry m_propertyRegistry { *this };
59 Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) };
60 Ref<SVGAnimatedNumber> m_dx { SVGAnimatedNumber::create(this, 2) };
61 Ref<SVGAnimatedNumber> m_dy { SVGAnimatedNumber::create(this, 2) };
62 Ref<SVGAnimatedNumber> m_stdDeviationX { SVGAnimatedNumber::create(this, 2) };
63 Ref<SVGAnimatedNumber> m_stdDeviationY { SVGAnimatedNumber::create(this, 2) };
64};
65
66} // namespace WebCore
67