001/*
002 * ============================================================================
003 * Copyright © 2002-2023 by Thomas Thrien.
004 * All Rights Reserved.
005 * ============================================================================
006 * Licensed to the public under the agreements of the GNU Lesser General Public
007 * License, version 3.0 (the "License"). You may obtain a copy of the License at
008 *
009 *      http://www.gnu.org/licenses/lgpl.html
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
013 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
014 * License for the specific language governing permissions and limitations
015 * under the License.
016 */
017
018package org.tquadrat.foundation.svg;
019
020import static org.apiguardian.api.API.Status.STABLE;
021import static org.tquadrat.foundation.svg.SVGUtils.number;
022
023import org.apiguardian.api.API;
024import org.tquadrat.foundation.annotation.ClassVersion;
025import org.tquadrat.foundation.svg.internal.SVGPathImpl;
026import org.tquadrat.foundation.svg.type.SVGNumber.SVGUserUnitValue;
027import org.tquadrat.foundation.svg.type.SVGPathElement;
028
029/**
030 *  The definition of the SVG {@code <path>} element.
031 *
032 *  @extauthor Thomas Thrien - thomas.thrien@tquadrat.org
033 *  @version $Id: SVGPath.java 1074 2023-10-02 12:05:06Z tquadrat $
034 *  @since 0.0.5
035 *
036 *  @UMLGraph.link
037 */
038@ClassVersion( sourceVersion = "$Id: SVGPath.java 1074 2023-10-02 12:05:06Z tquadrat $" )
039@API( status = STABLE, since = "0.0.5" )
040public sealed interface SVGPath extends SVGElementWithChildren, AllowsConditionalProcessingAttributes, AllowsGlobalEventAttributes, AllowsGraphicalEventAttributes, AllowsPresentationAttributes, AllowsStyleAttributes
041    permits SVGElementAdapter, SVGPathImpl
042{
043        /*---------*\
044    ====** Methods **==========================================================
045        \*---------*/
046    /**
047     *  Sets the path definition for this SVG {@code <path>} element.
048     *
049     *  @param  pathElements    The elements of the path.
050     */
051    public void setPathDefinition( final SVGPathElement... pathElements );
052
053    /**
054     *  Sets the length of the path represented by this SVG {@code <path>}
055     *  element.
056     *
057     *  @param  length  The author's computation of the total length of the
058     *      path, in user units. This type is used to calibrate the user
059     *      agent's own distance-along-a-path calculations with that of the
060     *      author. The user agent will scale all distance-along-a-path
061     *      computations by the ratio of this type to the user agent's own
062     *      computed type for total path length.<br>
063     *      <br>A type of zero is valid, but a negative type is an error.
064     *
065     *  @throws IllegalArgumentException    The type is less than 0.
066     */
067    public void setPathLength( @SuppressWarnings( "UseOfConcreteClass" ) final SVGUserUnitValue length );
068
069    /**
070     *  Sets the length of the path represented by this SVG {@code <path>}
071     *  element.
072     *
073     *  @param  length  The author's computation of the total length of the
074     *      path, in user units. This type is used to calibrate the user
075     *      agent's own distance-along-a-path calculations with that of the
076     *      author. The user agent will scale all distance-along-a-path
077     *      computations by the ratio of this type to the user agent's own
078     *      computed type for total path length.<br>
079     *      <br>A type of zero is valid, but a negative type is an error.
080     *
081     *  @throws IllegalArgumentException    The type is less than 0.
082     */
083    public default void setPathLength( final double length ) { setPathLength( number( length ) ); }
084
085    /**
086     *  Sets the length of the path represented by this SVG {@code <path>}
087     *  element.
088     *
089     *  @param  length  The author's computation of the total length of the
090     *      path, in user units. This type is used to calibrate the user
091     *      agent's own distance-along-a-path calculations with that of the
092     *      author. The user agent will scale all distance-along-a-path
093     *      computations by the ratio of this type to the user agent's own
094     *      computed type for total path length.<br>
095     *      <br>A type of zero is valid, but a negative type is an error.
096     *
097     *  @throws IllegalArgumentException    The type is less than 0.
098     */
099    public default void setPathLength( final long length ) { setPathLength( number( length ) ); }
100}
101//  interface SVGPath
102
103/*
104 *  End of File
105 */