| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 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 | 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, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #ifndef SVGTextContentElement_h | 21 #ifndef SVGTextContentElement_h |
| 22 #define SVGTextContentElement_h | 22 #define SVGTextContentElement_h |
| 23 | 23 |
| 24 #include "core/svg/SVGAnimatedBoolean.h" | 24 #include "core/svg/SVGAnimatedBoolean.h" |
| 25 #include "core/svg/SVGAnimatedEnumeration.h" | 25 #include "core/svg/SVGAnimatedEnumeration.h" |
| 26 #include "core/svg/SVGAnimatedLength.h" | 26 #include "core/svg/SVGAnimatedLength.h" |
| 27 #include "core/svg/SVGExternalResourcesRequired.h" | |
| 28 #include "core/svg/SVGGraphicsElement.h" | 27 #include "core/svg/SVGGraphicsElement.h" |
| 29 | 28 |
| 30 namespace WebCore { | 29 namespace WebCore { |
| 31 | 30 |
| 32 class ExceptionState; | 31 class ExceptionState; |
| 33 | 32 |
| 34 enum SVGLengthAdjustType { | 33 enum SVGLengthAdjustType { |
| 35 SVGLengthAdjustUnknown, | 34 SVGLengthAdjustUnknown, |
| 36 SVGLengthAdjustSpacing, | 35 SVGLengthAdjustSpacing, |
| 37 SVGLengthAdjustSpacingAndGlyphs | 36 SVGLengthAdjustSpacingAndGlyphs |
| (...skipping 21 matching lines...) Expand all Loading... |
| 59 static SVGLengthAdjustType fromString(const String& value) | 58 static SVGLengthAdjustType fromString(const String& value) |
| 60 { | 59 { |
| 61 if (value == "spacingAndGlyphs") | 60 if (value == "spacingAndGlyphs") |
| 62 return SVGLengthAdjustSpacingAndGlyphs; | 61 return SVGLengthAdjustSpacingAndGlyphs; |
| 63 if (value == "spacing") | 62 if (value == "spacing") |
| 64 return SVGLengthAdjustSpacing; | 63 return SVGLengthAdjustSpacing; |
| 65 return SVGLengthAdjustUnknown; | 64 return SVGLengthAdjustUnknown; |
| 66 } | 65 } |
| 67 }; | 66 }; |
| 68 | 67 |
| 69 class SVGTextContentElement : public SVGGraphicsElement, | 68 class SVGTextContentElement : public SVGGraphicsElement { |
| 70 public SVGExternalResourcesRequired { | |
| 71 public: | 69 public: |
| 72 // Forward declare enumerations in the W3C naming scheme, for IDL generation
. | 70 // Forward declare enumerations in the W3C naming scheme, for IDL generation
. |
| 73 enum { | 71 enum { |
| 74 LENGTHADJUST_UNKNOWN = SVGLengthAdjustUnknown, | 72 LENGTHADJUST_UNKNOWN = SVGLengthAdjustUnknown, |
| 75 LENGTHADJUST_SPACING = SVGLengthAdjustSpacing, | 73 LENGTHADJUST_SPACING = SVGLengthAdjustSpacing, |
| 76 LENGTHADJUST_SPACINGANDGLYPHS = SVGLengthAdjustSpacingAndGlyphs | 74 LENGTHADJUST_SPACINGANDGLYPHS = SVGLengthAdjustSpacingAndGlyphs |
| 77 }; | 75 }; |
| 78 | 76 |
| 79 unsigned getNumberOfChars(); | 77 unsigned getNumberOfChars(); |
| 80 float getComputedTextLength(); | 78 float getComputedTextLength(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 111 virtual bool isTextContent() const { return true; } | 109 virtual bool isTextContent() const { return true; } |
| 112 | 110 |
| 113 // Custom 'textLength' property | 111 // Custom 'textLength' property |
| 114 static void synchronizeTextLength(SVGElement* contextElement); | 112 static void synchronizeTextLength(SVGElement* contextElement); |
| 115 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateTextLengthWrapper(SVGEl
ement* contextElement); | 113 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateTextLengthWrapper(SVGEl
ement* contextElement); |
| 116 mutable SVGSynchronizableAnimatedProperty<SVGLength> m_textLength; | 114 mutable SVGSynchronizableAnimatedProperty<SVGLength> m_textLength; |
| 117 SVGLength m_specifiedTextLength; | 115 SVGLength m_specifiedTextLength; |
| 118 | 116 |
| 119 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGTextContentElement) | 117 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGTextContentElement) |
| 120 DECLARE_ANIMATED_ENUMERATION(LengthAdjust, lengthAdjust, SVGLengthAdjust
Type) | 118 DECLARE_ANIMATED_ENUMERATION(LengthAdjust, lengthAdjust, SVGLengthAdjust
Type) |
| 121 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesReq
uired) | |
| 122 END_DECLARE_ANIMATED_PROPERTIES | 119 END_DECLARE_ANIMATED_PROPERTIES |
| 123 }; | 120 }; |
| 124 | 121 |
| 125 inline SVGTextContentElement* toSVGTextContentElement(SVGElement* element) | 122 inline SVGTextContentElement* toSVGTextContentElement(SVGElement* element) |
| 126 { | 123 { |
| 127 ASSERT_WITH_SECURITY_IMPLICATION(!element || element->isTextContent()); | 124 ASSERT_WITH_SECURITY_IMPLICATION(!element || element->isTextContent()); |
| 128 return static_cast<SVGTextContentElement*>(element); | 125 return static_cast<SVGTextContentElement*>(element); |
| 129 } | 126 } |
| 130 | 127 |
| 131 } // namespace WebCore | 128 } // namespace WebCore |
| 132 | 129 |
| 133 #endif | 130 #endif |
| OLD | NEW |