OSDN Git Service

Merge WebKit at r73109: Initial merge by git.
[android-x86/external-webkit.git] / 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 "SVGAnimatedPropertyMacros.h"
26 #include "SVGElement.h"
27 #include "SVGExternalResourcesRequired.h"
28 #include "SVGURIReference.h"
29 #include "ScriptElement.h"
30
31 namespace WebCore {
32
33     class SVGScriptElement : public SVGElement
34                            , public SVGURIReference
35                            , public SVGExternalResourcesRequired
36                            , public ScriptElement {
37     public:
38         static PassRefPtr<SVGScriptElement> create(const QualifiedName&, Document*, bool wasInsertedByParser);
39
40         String type() const;
41         void setType(const String&);
42
43     private:
44         SVGScriptElement(const QualifiedName&, Document*, bool wasInsertedByParser, bool wasAlreadyStarted);
45
46         virtual void parseMappedAttribute(Attribute*);
47         virtual void insertedIntoDocument();
48         virtual void removedFromDocument();
49         virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
50
51         virtual void svgAttributeChanged(const QualifiedName&);
52         virtual void synchronizeProperty(const QualifiedName&);
53         virtual bool isURLAttribute(Attribute*) const;
54         virtual void finishParsingChildren();
55
56         virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
57
58         virtual bool haveLoadedRequiredResources();
59
60         virtual String sourceAttributeValue() const;
61         virtual String charsetAttributeValue() const;
62         virtual String typeAttributeValue() const;
63         virtual String languageAttributeValue() const;
64         virtual String forAttributeValue() const;
65         virtual String eventAttributeValue() const;
66         virtual bool asyncAttributeValue() const;
67         virtual bool deferAttributeValue() const;
68
69         virtual void dispatchLoadEvent();
70         virtual void dispatchErrorEvent();
71
72         PassRefPtr<Element> cloneElementWithoutAttributesAndChildren() const;
73
74         // SVGURIReference
75         DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGScriptElement, XLinkNames::hrefAttr, String, Href, href)
76
77         // SVGExternalResourcesRequired
78         DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGScriptElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
79
80         String m_type;
81     };
82
83 } // namespace WebCore
84
85 #endif // ENABLE(SVG)
86 #endif