initial import
[vuplus_webkit] / Source / WebCore / svg / SVGScriptElement.h
1 /*
2  * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3  * Copyright (C) 2004, 2005, 2007 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 SVGScriptElement_h
22 #define SVGScriptElement_h
23
24 #if ENABLE(SVG)
25 #include "SVGAnimatedBoolean.h"
26 #include "SVGAnimatedString.h"
27 #include "SVGElement.h"
28 #include "SVGExternalResourcesRequired.h"
29 #include "SVGURIReference.h"
30 #include "ScriptElement.h"
31
32 namespace WebCore {
33
34 class SVGScriptElement : public SVGElement
35                        , public SVGURIReference
36                        , public SVGExternalResourcesRequired
37                        , public ScriptElement {
38 public:
39     static PassRefPtr<SVGScriptElement> create(const QualifiedName&, Document*, bool wasInsertedByParser);
40
41     String type() const;
42     void setType(const String&);
43
44 private:
45     SVGScriptElement(const QualifiedName&, Document*, bool wasInsertedByParser, bool alreadyStarted);
46
47     bool isSupportedAttribute(const QualifiedName&);
48     virtual void parseMappedAttribute(Attribute*);
49     virtual void insertedIntoDocument();
50     virtual void removedFromDocument();
51     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
52
53     virtual void svgAttributeChanged(const QualifiedName&);
54     virtual bool isURLAttribute(Attribute*) const;
55     virtual void finishParsingChildren();
56
57     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
58
59     virtual bool haveLoadedRequiredResources();
60
61     virtual String sourceAttributeValue() const;
62     virtual String charsetAttributeValue() const;
63     virtual String typeAttributeValue() const;
64     virtual String languageAttributeValue() const;
65     virtual String forAttributeValue() const;
66     virtual String eventAttributeValue() const;
67     virtual bool asyncAttributeValue() const;
68     virtual bool deferAttributeValue() const;
69     virtual bool hasSourceAttribute() const;
70
71     virtual void dispatchLoadEvent();
72
73     virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren();
74
75     BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGScriptElement)
76         DECLARE_ANIMATED_STRING(Href, href)
77         DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
78     END_DECLARE_ANIMATED_PROPERTIES
79
80     String m_type;
81 };
82
83 } // namespace WebCore
84
85 #endif // ENABLE(SVG)
86 #endif