2 Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005, 2007 Rob Buis <buis@kde.org>
5 This file is part of the KDE project
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
23 #ifndef SVGStyledElement_h
24 #define SVGStyledElement_h
27 #include "AffineTransform.h"
29 #include "SVGElement.h"
30 #include "SVGLength.h"
31 #include "SVGResource.h"
32 #include "SVGStylable.h"
35 #include "RenderStyle.h"
39 class SVGStyledElement
: public SVGElement
,
42 SVGStyledElement(const QualifiedName
&, Document
*);
43 virtual ~SVGStyledElement();
45 virtual bool isStyled() const { return true; }
46 virtual bool supportsMarkers() const { return false; }
48 virtual PassRefPtr
<CSSValue
> getPresentationAttribute(const String
& name
);
49 virtual CSSStyleDeclaration
* style() { return StyledElement::style(); }
51 bool isKnownAttribute(const QualifiedName
&);
53 virtual bool rendererIsNeeded(RenderStyle
*);
54 virtual SVGResource
* canvasResource() { return 0; }
56 /*virtual bool mapToEntry(const QualifiedName&, MappedAttributeEntry&) const;*/
57 virtual void parseMappedAttribute(MappedAttribute
*);
59 virtual void svgAttributeChanged(const QualifiedName
&);
61 virtual void childrenChanged(bool changedByParser
= false, Node
* beforeChange
= 0, Node
* afterChange
= 0, int childCountDelta
= 0);
63 // Centralized place to force a manual style resolution. Hacky but needed for now.
64 RenderStyle
* resolveStyle(RenderStyle
* parentStyle
);
66 void invalidateResourcesInAncestorChain() const;
67 virtual void detach();
69 void setInstanceUpdatesBlocked(bool);
72 virtual bool hasRelativeValues() const { return true; }
74 static int cssPropertyIdForSVGAttributeName(const QualifiedName
&);
77 ANIMATED_PROPERTY_DECLARATIONS(SVGStyledElement
, String
, String
, ClassName
, className
)
79 void updateElementInstance(SVGDocumentExtensions
*) const;
82 } // namespace WebCore
85 #endif // SVGStyledElement