WebCore/svg/SVGTextPathElement.h
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     1 /*
       
     2     Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
       
     3 
       
     4     This library is free software; you can redistribute it and/or
       
     5     modify it under the terms of the GNU Library General Public
       
     6     License as published by the Free Software Foundation; either
       
     7     version 2 of the License, or (at your option) any later version.
       
     8 
       
     9     This library is distributed in the hope that it will be useful,
       
    10     but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    12     Library General Public License for more details.
       
    13 
       
    14     You should have received a copy of the GNU Library General Public License
       
    15     along with this library; see the file COPYING.LIB.  If not, write to
       
    16     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
       
    17     Boston, MA 02110-1301, USA.
       
    18 */
       
    19 
       
    20 #ifndef SVGTextPathElement_h
       
    21 #define SVGTextPathElement_h
       
    22 
       
    23 #if ENABLE(SVG)
       
    24 #include "SVGTextContentElement.h"
       
    25 
       
    26 #include "SVGURIReference.h"
       
    27 
       
    28 namespace WebCore {
       
    29     enum SVGTextPathMethodType {
       
    30         SVG_TEXTPATH_METHODTYPE_UNKNOWN = 0,
       
    31         SVG_TEXTPATH_METHODTYPE_ALIGN = 1,
       
    32         SVG_TEXTPATH_METHODTYPE_STRETCH = 2
       
    33     };
       
    34 
       
    35     enum SVGTextPathSpacingType {
       
    36         SVG_TEXTPATH_SPACINGTYPE_UNKNOWN = 0,
       
    37         SVG_TEXTPATH_SPACINGTYPE_AUTO = 1,
       
    38         SVG_TEXTPATH_SPACINGTYPE_EXACT = 2
       
    39     };
       
    40 
       
    41     class SVGTextPathElement : public SVGTextContentElement,
       
    42                                public SVGURIReference {
       
    43     public:
       
    44         // Forward declare these enums in the w3c naming scheme, for IDL generation
       
    45         enum {
       
    46             TEXTPATH_METHODTYPE_UNKNOWN = SVG_TEXTPATH_METHODTYPE_UNKNOWN,
       
    47             TEXTPATH_METHODTYPE_ALIGN = SVG_TEXTPATH_METHODTYPE_ALIGN,
       
    48             TEXTPATH_METHODTYPE_STRETCH = SVG_TEXTPATH_METHODTYPE_STRETCH,
       
    49             TEXTPATH_SPACINGTYPE_UNKNOWN = SVG_TEXTPATH_SPACINGTYPE_UNKNOWN,
       
    50             TEXTPATH_SPACINGTYPE_AUTO = SVG_TEXTPATH_SPACINGTYPE_AUTO,
       
    51             TEXTPATH_SPACINGTYPE_EXACT = SVG_TEXTPATH_SPACINGTYPE_EXACT
       
    52         };
       
    53 
       
    54         SVGTextPathElement(const QualifiedName&, Document*);
       
    55         virtual ~SVGTextPathElement();
       
    56  
       
    57         virtual void insertedIntoDocument();
       
    58 
       
    59         virtual void parseMappedAttribute(Attribute*);
       
    60         virtual void svgAttributeChanged(const QualifiedName&);
       
    61         virtual void synchronizeProperty(const QualifiedName&);
       
    62         virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
       
    63 
       
    64         bool childShouldCreateRenderer(Node*) const;
       
    65 
       
    66     private:
       
    67         virtual bool selfHasRelativeLengths() const;
       
    68 
       
    69         DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::startOffsetAttr, SVGLength, StartOffset, startOffset)
       
    70         DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::methodAttr, int, Method, method)
       
    71         DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::spacingAttr, int, Spacing, spacing)
       
    72     
       
    73         // SVGURIReference
       
    74         DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, XLinkNames::hrefAttr, String, Href, href)
       
    75     };
       
    76 
       
    77 } // namespace WebCore
       
    78 
       
    79 #endif // ENABLE(SVG)
       
    80 #endif