Rubber-stamped by Brady Eidson.
[webbrowser.git] / WebCore / svg / SVGMarkerElement.h
blob7e08a96f1394316208c660a69a935de7b5106656
1 /*
2 Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005, 2006 Rob Buis <buis@kde.org>
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.
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.
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.
21 #ifndef SVGMarkerElement_h
22 #define SVGMarkerElement_h
24 #if ENABLE(SVG)
26 #include "SVGAngle.h"
27 #include "SVGExternalResourcesRequired.h"
28 #include "SVGFitToViewBox.h"
29 #include "SVGLangSpace.h"
30 #include "SVGResourceMarker.h"
31 #include "SVGStyledElement.h"
33 namespace WebCore {
35 class Document;
36 class SVGAngle;
38 extern char SVGOrientTypeAttrIdentifier[];
39 extern char SVGOrientAngleAttrIdentifier[];
41 class SVGMarkerElement : public SVGStyledElement,
42 public SVGLangSpace,
43 public SVGExternalResourcesRequired,
44 public SVGFitToViewBox {
45 public:
46 enum SVGMarkerUnitsType {
47 SVG_MARKERUNITS_UNKNOWN = 0,
48 SVG_MARKERUNITS_USERSPACEONUSE = 1,
49 SVG_MARKERUNITS_STROKEWIDTH = 2
52 enum SVGMarkerOrientType {
53 SVG_MARKER_ORIENT_UNKNOWN = 0,
54 SVG_MARKER_ORIENT_AUTO = 1,
55 SVG_MARKER_ORIENT_ANGLE = 2
58 SVGMarkerElement(const QualifiedName&, Document*);
59 virtual ~SVGMarkerElement();
61 TransformationMatrix viewBoxToViewTransform(float viewWidth, float viewHeight) const;
63 void setOrientToAuto();
64 void setOrientToAngle(PassRefPtr<SVGAngle>);
66 virtual void parseMappedAttribute(MappedAttribute*);
67 virtual void svgAttributeChanged(const QualifiedName&);
68 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
70 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
71 virtual SVGResource* canvasResource();
73 private:
74 ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, SVGNames::markerTagString, SVGNames::refXAttrString, SVGLength, RefX, refX)
75 ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, SVGNames::markerTagString, SVGNames::refYAttrString, SVGLength, RefY, refY)
76 ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, SVGNames::markerTagString, SVGNames::markerWidthAttrString, SVGLength, MarkerWidth, markerWidth)
77 ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, SVGNames::markerTagString, SVGNames::markerHeightAttrString, SVGLength, MarkerHeight, markerHeight)
78 ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, SVGNames::markerTagString, SVGNames::markerUnitsAttrString, int, MarkerUnits, markerUnits)
79 ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, SVGNames::markerTagString, SVGOrientTypeAttrIdentifier, int, OrientType, orientType)
80 ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, SVGNames::markerTagString, SVGOrientAngleAttrIdentifier, SVGAngle, OrientAngle, orientAngle)
82 // SVGExternalResourcesRequired
83 ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, SVGExternalResourcesRequiredIdentifier,
84 SVGNames::externalResourcesRequiredAttrString, bool,
85 ExternalResourcesRequired, externalResourcesRequired)
87 // SVGFitToViewBox
88 ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, SVGFitToViewBoxIdentifier, SVGNames::viewBoxAttrString, FloatRect, ViewBox, viewBox)
89 ANIMATED_PROPERTY_DECLARATIONS(SVGMarkerElement, SVGFitToViewBoxIdentifier, SVGNames::preserveAspectRatioAttrString, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
91 RefPtr<SVGResourceMarker> m_marker;
94 } // namespace WebCore
96 #endif // ENABLE(SVG)
97 #endif