001/**********************************************
002 * Copyright (C) 2010 Lukas Laag
003 * This file is part of lib-gwt-svg.
004 * 
005 * libgwtsvg is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU Lesser General Public License as published by
007 * the Free Software Foundation, either version 3 of the License, or
008 * (at your option) any later version.
009 * 
010 * libgwtsvg is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public License
016 * along with libgwtsvg.  If not, see http://www.gnu.org/licenses/
017 **********************************************/
018/*
019 * Copyright (c) 2004 World Wide Web Consortium,
020 *
021 * (Massachusetts Institute of Technology, European Research Consortium for
022 * Informatics and Mathematics, Keio University). All Rights Reserved. This
023 * work is distributed under the W3C(r) Software License [1] in the hope that
024 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
025 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
026 *
027 * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
028 */
029
030package org.vectomatic.dom.svg.itf;
031
032import org.vectomatic.dom.svg.OMSVGPathSegList;
033
034  /**
035   * <p>The SVGAnimatedPathData interface supports elements which have a <span
036   * class='attr-name'>'d'</span> attribute which holds SVG path data, and supports
037   * the ability to animate that attribute.</p> <p>The {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData}
038   * interface provides two lists to access and modify the base (i.e., static)
039   * contents of the <span class='attr-name'>'d'</span> attribute:</p> <ul>
040   * <li>DOM attribute {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData#getPathSegList()}
041   * provides access to the static/base   contents of the <span class='attr-name'>'d'</span>
042   * attribute in a form which matches one-for-one   with SVG's syntax.</li>
043   * <li>DOM attribute {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData#getNormalizedPathSegList()}
044   * provides normalized access   to the static/base contents of the <span class='attr-name'>'d'</span>
045   * attribute where all path   data commands are expressed in terms of the
046   * following subset of   {@link org.vectomatic.dom.svg.OMSVGPathSeg} types:
047   * SVG_PATHSEG_MOVETO_ABS (M),   SVG_PATHSEG_LINETO_ABS (L),   SVG_PATHSEG_CURVETO_CUBIC_ABS
048   * (C) and   SVG_PATHSEG_CLOSEPATH (z).</li> </ul> <p>and two lists to access
049   * the current animated values of the <span class='attr-name'>'d'</span> attribute:</p>
050   * <ul>   <li>DOM attribute {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData#getAnimatedPathSegList()}
051   * provides access to the current   animated contents of the <span class='attr-name'>'d'</span>
052   * attribute in a form which matches   one-for-one with SVG's syntax.</li>
053   * <li>DOM attribute {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData#getAnimatedNormalizedPathSegList()}
054   * provides   normalized access to the current animated contents of the <span
055   * class='attr-name'>'d'</span>   attribute where all path data commands are
056   * expressed in terms of the   following subset of {@link org.vectomatic.dom.svg.OMSVGPathSeg}
057   * types:   SVG_PATHSEG_MOVETO_ABS (M),   SVG_PATHSEG_LINETO_ABS (L),   SVG_PATHSEG_CURVETO_CUBIC_ABS
058   * (C) and   SVG_PATHSEG_CLOSEPATH (z).</li> </ul> <p>Each of the two lists
059   * are always kept synchronized. Modifications to one list will immediately
060   * cause the corresponding list to be modified. Modifications to {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData#getNormalizedPathSegList()}
061   * might cause entries in {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData#getPathSegList()}
062   * to be broken into a set of normalized path segments.</p> <p>Additionally,
063   * the <code>path/d</code> attribute on the <a href='http://www.w3.org/TR/SVG11/paths.html#PathElement'
064   * title='path element specification'>path</a> element accessed via the XML
065   * DOM (e.g., using the <code>getAttribute()</code> method call) will reflect
066   * any changes made to {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData#getPathSegList()}
067   * or {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData#getNormalizedPathSegList()}.</p>
068   */
069public interface ISVGAnimatedPathData {
070  /**
071   * Provides access to the base (i.e., static) contents of the <span class='attr-name'>'d'</span>
072   * attribute in a form which matches one-for-one with SVG's syntax. Thus,
073   * if the <span class='attr-name'>'d'</span> attribute has an "absolute moveto
074   * (M)" and an "absolute arcto (A)" command, then {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData#getPathSegList()}
075   * will have two entries: a SVG_PATHSEG_MOVETO_ABS and a SVG_PATHSEG_ARC_ABS.
076   */
077  public OMSVGPathSegList getPathSegList();
078  /**
079   * <p>Provides access to the base (i.e., static) contents of the <span class='attr-name'>'d'</span>
080   * attribute in a form where all path data commands are expressed in terms
081   * of the following subset of {@link org.vectomatic.dom.svg.OMSVGPathSeg}
082   * types: SVG_PATHSEG_MOVETO_ABS (M), SVG_PATHSEG_LINETO_ABS (L), SVG_PATHSEG_CURVETO_CUBIC_ABS
083   * (C) and SVG_PATHSEG_CLOSEPATH (z). Thus, if the <span class='attr-name'>'d'</span>
084   * attribute has an "absolute moveto (M)" and an "absolute arcto (A)" command,
085   * then pathSegList will have one SVG_PATHSEG_MOVETO_ABS entry followed by
086   * a series of SVG_PATHSEG_LINETO_ABS entries which approximate the arc. This
087   * alternate representation is available to provide a simpler interface to
088   * developers who would benefit from a more limited set of commands.</p> <p>The
089   * only valid {@link org.vectomatic.dom.svg.OMSVGPathSeg} types are SVG_PATHSEG_MOVETO_ABS
090   * (M), SVG_PATHSEG_LINETO_ABS (L), SVG_PATHSEG_CURVETO_CUBIC_ABS (C) and
091   * SVG_PATHSEG_CLOSEPATH (z).</p>
092   */
093  public OMSVGPathSegList getNormalizedPathSegList();
094  /**
095   * Provides access to the current animated contents of the <span class='attr-name'>'d'</span>
096   * attribute in a form which matches one-for-one with SVG's syntax. If the
097   * given attribute or property is being animated, contains the current animated
098   * value of the attribute or property, and both the object itself and its
099   * contents are read only. If the given attribute or property is not currently
100   * being animated, contains the same value as {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData#getPathSegList()}.
101   */
102  public OMSVGPathSegList getAnimatedPathSegList();
103  /**
104   * Provides access to the current animated contents of the <span class='attr-name'>'d'</span>
105   * attribute in a form where all path data commands are expressed in terms
106   * of the following subset of {@link org.vectomatic.dom.svg.OMSVGPathSeg}
107   * types: SVG_PATHSEG_MOVETO_ABS (M), SVG_PATHSEG_LINETO_ABS (L), SVG_PATHSEG_CURVETO_CUBIC_ABS
108   * (C) and SVG_PATHSEG_CLOSEPATH (z). If the given attribute or property is
109   * being animated, contains the current animated value of the attribute or
110   * property, and both the object itself and its contents are read only. If
111   * the given attribute or property is not currently being animated, contains
112   * the same value as {@link org.vectomatic.dom.svg.itf.ISVGAnimatedPathData#getNormalizedPathSegList()}.
113   */
114  public OMSVGPathSegList getAnimatedNormalizedPathSegList();
115}