1/*
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
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#ifndef SVGCursorElement_h
22#define SVGCursorElement_h
23
24#include "SVGAnimatedBoolean.h"
25#include "SVGAnimatedLength.h"
26#include "SVGAnimatedString.h"
27#include "SVGElement.h"
28#include "SVGExternalResourcesRequired.h"
29#include "SVGTests.h"
30#include "SVGURIReference.h"
31
32namespace WebCore {
33
34class SVGCursorElement final : public SVGElement,
35                               public SVGTests,
36                               public SVGExternalResourcesRequired,
37                               public SVGURIReference {
38public:
39    static PassRefPtr<SVGCursorElement> create(const QualifiedName&, Document&);
40
41    virtual ~SVGCursorElement();
42
43    void addClient(SVGElement*);
44    void removeClient(SVGElement*);
45    void removeReferencedElement(SVGElement*);
46
47private:
48    SVGCursorElement(const QualifiedName&, Document&);
49
50    virtual bool isValid() const override { return SVGTests::isValid(); }
51
52    bool isSupportedAttribute(const QualifiedName&);
53    virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
54    virtual void svgAttributeChanged(const QualifiedName&) override;
55
56    virtual bool rendererIsNeeded(const RenderStyle&) override { return false; }
57
58    virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const override;
59
60    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGCursorElement)
61        DECLARE_ANIMATED_LENGTH(X, x)
62        DECLARE_ANIMATED_LENGTH(Y, y)
63        DECLARE_ANIMATED_STRING(Href, href)
64        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
65    END_DECLARE_ANIMATED_PROPERTIES
66
67    // SVGTests
68    virtual void synchronizeRequiredFeatures() override { SVGTests::synchronizeRequiredFeatures(this); }
69    virtual void synchronizeRequiredExtensions() override { SVGTests::synchronizeRequiredExtensions(this); }
70    virtual void synchronizeSystemLanguage() override { SVGTests::synchronizeSystemLanguage(this); }
71
72    HashSet<SVGElement*> m_clients;
73};
74
75NODE_TYPE_CASTS(SVGCursorElement)
76
77} // namespace WebCore
78
79#endif
80