2002/css-validator/org/w3c/css/properties/aural ACSSDefault.properties,NONE,1.1 ACssAzimuth.class,NONE,1.1 ACssAzimuth.java,NONE,1.1 ACssCue.class,NONE,1.1 ACssCue.java,NONE,1.1 ACssCueAfter.class,NONE,1.1 ACssCueAfter.java,NONE,1.1 ACssCueBefore.class,NONE,1.1 ACssCueBefore.java,NONE,1.1 ACssElevation.class,NONE,1.1 ACssElevation.java,NONE,1.1 ACssInterpretAs.class,NONE,1.1 ACssInterpretAs.java,NONE,1.1 ACssPause.class,NONE,1.1 ACssPause.java,NONE,1.1 ACssPauseAfter.class,NONE,1.1 ACssPauseAfter.java,NONE,1.1 ACssPauseBefore.class,NONE,1.1 ACssPauseBefore.java,NONE,1.1 ACssPhonemes.class,NONE,1.1 ACssPhonemes.java,NONE,1.1 ACssPitch.class,NONE,1.1 ACssPitch.java,NONE,1.1 ACssPitchRange.class,NONE,1.1 ACssPitchRange.java,NONE,1.1 ACssPlayDuring.class,NONE,1.1 ACssPlayDuring.java,NONE,1.1 ACssProperties.class,NONE,1.1 ACssProperties.java,NONE,1.1 ACssProperty.class,NONE,1.1 ACssProperty.java,NONE,1.1 ACssRichness.class,NONE,1.1 ACssRichness.java,NONE,1.1 ACssSpeak.class,NONE,1.1 ACssSpeak.java,NONE,

Update of /sources/public/2002/css-validator/org/w3c/css/properties/aural
In directory hutz:/tmp/cvs-serv16551/aural

Added Files:
	ACSSDefault.properties ACssAzimuth.class ACssAzimuth.java 
	ACssCue.class ACssCue.java ACssCueAfter.class 
	ACssCueAfter.java ACssCueBefore.class ACssCueBefore.java 
	ACssElevation.class ACssElevation.java ACssInterpretAs.class 
	ACssInterpretAs.java ACssPause.class ACssPause.java 
	ACssPauseAfter.class ACssPauseAfter.java ACssPauseBefore.class 
	ACssPauseBefore.java ACssPhonemes.class ACssPhonemes.java 
	ACssPitch.class ACssPitch.java ACssPitchRange.class 
	ACssPitchRange.java ACssPlayDuring.class ACssPlayDuring.java 
	ACssProperties.class ACssProperties.java ACssProperty.class 
	ACssProperty.java ACssRichness.class ACssRichness.java 
	ACssSpeak.class ACssSpeak.java ACssSpeakCSS3.class 
	ACssSpeakCSS3.java ACssSpeakDate.class ACssSpeakDate.java 
	ACssSpeakNumeral.class ACssSpeakNumeral.java 
	ACssSpeakPunctuation.class ACssSpeakPunctuation.java 
	ACssSpeakTime.class ACssSpeakTime.java ACssSpeechRate.class 
	ACssSpeechRate.java ACssStress.class ACssStress.java 
	ACssStyle.class ACssStyle.java ACssVoiceBalance.class 
	ACssVoiceBalance.java ACssVoiceDuration.class 
	ACssVoiceDuration.java ACssVoiceFamily.class 
	ACssVoiceFamily.java ACssVoiceFamilyCSS3.class 
	ACssVoiceFamilyCSS3.java ACssVoicePitchRange.class 
	ACssVoicePitchRange.java ACssVoiceRate.class 
	ACssVoiceRate.java ACssVoiceStress.class ACssVoiceStress.java 
	ACssVoiceVolume.class ACssVoiceVolume.java ACssVolume.class 
	ACssVolume.java AuralDefault.properties Makefile 
Log Message:
reorg (cvs funkyness...)

--- NEW FILE: ACssRichness.java ---
//
// $Id: ACssRichness.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssRichness.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;


/**
 * <H3> &nbsp;&nbsp 'richness' ('brightness' ?)</H3>
 * <P>
 * <EM>Value: </EM>&lt;number&gt;|inherit<BR>
 * <em>Initial:</EM> 50%<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> Relative to...
 *
 * <P>Specifies the richness (brightness) of the speaking voice. The
 * effect of increasing richness is to produce a voice that
 * <em>carries</em> --reducing richness produces a soft, mellifluous
 * voice.
 *
 * @version $Revision: 1.1 $
 */
public class ACssRichness extends ACssProperty {
    
    CssValue value;
    
    static CssValue DefaultValue = new CssNumber(null, 50);
    
    /**
     * Create a new ACssRichness
     */
    public ACssRichness() {
	value = DefaultValue;
    }  
    
    /**
     * Creates a new ACssRichness
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public ACssRichness(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	int index;

	setByUser();
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	} else if (val instanceof CssNumber) {
	    float f = ((CssNumber) val).getValue();
	    if ((f < 0) || (f > 100)) {		
		throw new InvalidParamException("range", null, ac);
	    }
	    value = val;
	    expression.next();
	    return;
	}

	throw new InvalidParamException("value", 
					expression.getValue().toString(), 
					getPropertyName(), ac);
    }
    
    public ACssRichness(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "richness";
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssRichness != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssRichness = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssRichness && 
		value.equals(((ACssRichness) property).value));
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getRichness();
	} else {
	    return ((ACssStyle) style).acssRichness;
	}
    }
    
}


--- NEW FILE: ACssSpeakDate.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssPhonemes.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACSSDefault.properties ---
style: org.w3c.css.properties.aural.ACssStyle
properties: AuralProperties.properties
extended-parser: true

volume.inherited:	true
speak.inherited:        true
pause.inherited:	false
pause-after.inherited:	false
pause-before.inherited:	false
cue.inherited:		false
cue-after.inherited:	false
cue-before.inherited:	false
play-during.inherited:	false
azimuth.inherited:      true
elevation.inherited:    true
speech-rate.inherited:	true
voice-family.inherited:	true
pitch.inherited:	true
pitch-range.inherited:	true
stress.inherited:       true
richness.inherited:     true
speak-punctuation.inherited: true
speak-numeral.inherited: true

--- NEW FILE: ACssProperties.java ---
//
// $Id: ACssProperties.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.aural;

import java.net.URL;

import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.Utf8Properties;

/**
 * @version $Revision: 1.1 $
 */
public class ACssProperties {
    public static Utf8Properties properties;
    
    public static Utf8Properties UAproperties;
    
    public static Float getValue(CssProperty property, String prop) {
	String value = UAproperties.getProperty(property.getPropertyName()
		+ "." + prop);
	if (value == null) {
	    System.err.println("Can't find value for "
		    + property.getPropertyName() + "." + prop);
	    return null;
	} else {
	    try {
		return Float.valueOf(value);
	    } catch (NumberFormatException e) {
		System.err.println(e);
		System.err.println("Only float value are valid in properties");
		return null;
	    }
	}
    }
    
    public static String getString(CssProperty property, String prop) {
	return properties.getProperty(property.getPropertyName() + "." + prop);
    }
    
    public static boolean getInheritance(CssProperty property) {
	return getString(property, "inherited").equals("true");
    }
    
    static {
	UAproperties = new Utf8Properties();
	try {
	    URL url = ACssProperties.class
	    .getResource("AuralDefault.properties");
	    java.io.InputStream f = url.openStream();
	    UAproperties.load(f);
	    f.close();
	} catch (Exception e) {
	    System.err
	    .println("CSS.ACSSProperties.ACssProperties: couldn't load UA properties ");
	    System.err.println("  " + e.toString());
	}
	
	properties = new Utf8Properties();
	try {
	    URL url = ACssProperties.class
	    .getResource("ACSSDefault.properties");
	    java.io.InputStream f = url.openStream();
	    properties.load(f);
	    f.close();
	} catch (Exception e) {
	    System.err
	    .println("CSS.ACSSProperties.ACssProperties: couldn't load properties ");
	    System.err.println("  " + e.toString());
	}
    }
}

--- NEW FILE: ACssPauseAfter.java ---
//
// $Id: ACssPauseAfter.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssPauseAfter.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.7  1997/08/25 13:53:03  plehegar
 * Added getValue()
 *
 * Revision 1.6  1997/08/22 15:00:09  plehegar
 * Bugs
 *
 * Revision 1.5  1997/08/22 14:57:32  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.4  1997/08/21 21:13:25  plehegar
 * Added time
 *
 * Revision 1.3  1997/08/21 14:34:56  vmallet
 * Minor modifications so we could compile it.
 *
 * Revision 1.2  1997/08/14 13:19:05  plehegar
 * Added ACssPauseAfter(ACssPauseBefore)
 *
 * Revision 1.1  1997/08/14 12:58:44  plehegar
 * Initial revision
 *
 */

package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssTime;
import org.w3c.css.values.CssValue;

/**
 * &nbsp;&nbsp;  'pause-after'
 *
 * <P>
 * <EM>Value: </EM>&lt;time&gt;  | &lt;percentage&gt;<BR>
 * <EM>Initial:</EM> UA specific<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> no<BR>
 * <EM>Percentage values:</EM> NA<BR>
 *
 * <P>This property specifies the pause after an element is spoken. Values are
 * specified the same way as 'pause-before'.
 *
 * @version $Revision: 1.1 $
 */
public class ACssPauseAfter extends ACssProperty {
    
    CssValue value;
    
    /**
     * Create a new ACssPauseAfter
     */  
    public ACssPauseAfter() {
	// Initial is User Agent Specific
	if (defaultValue == null) {
	    defaultValue = new CssTime(ACssProperties.getValue(this, "default"));
	}
	value = defaultValue;
    }
    
    /**
     * Create a new ACssPauseAfter
     */  
    public ACssPauseAfter(ACssPauseBefore pauseBefore) {
	value = pauseBefore.value;
    }
    
    /**
     * Creates a new ACssPauseAfter
     *
     * @param expression the expression of the size
     * @exception InvalidParamException The expression is incorrect
     */  
    public ACssPauseAfter(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	
	setByUser();
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	} else if (val instanceof CssPercentage) {
	    float num = ((Float) val.get()).floatValue();
	    if (num < 0)
		throw new InvalidParamException("negative-value", val.toString(),
						ac);
	    value = val;
	    expression.next();
	    return;
	} else if (val instanceof CssTime) {
	    float num = ((Float) val.get()).floatValue();
	    if (num < 0) {
		throw new InvalidParamException("negative-value", val.toString(),
						ac);
	    }
	    value = val;
	    expression.next();
	    return;
	} else if (val instanceof CssNumber) {
	    value = ((CssNumber) val).getTime();
	    expression.next();
	}
	
	throw new InvalidParamException("value", val.toString(), getPropertyName(),
					ac);
    }
    
    public ACssPauseAfter(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */  
    public Object get() {
	return value;
    }
    
    /**
     * Returns some usable value of this property...
     */
    public int getValue() { // vm
	return ((Float) value.get()).intValue();
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (value != null)
	    return value.toString();
	else
	    return null;
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "pause-after";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	ACssPause acssPause = ((ACssStyle) style).acssPause;
	if (acssPause.pauseAfter != null)
	    style.addRedefinitionWarning(ac, this);
	acssPause.pauseAfter = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	if (value != null)
	    return (property instanceof ACssPauseAfter && 
		    value.equals(((ACssPauseAfter) property).value));
	else
	    return false;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getPauseAfter();
	} else {
	    return ((ACssStyle) style).acssPause.pauseAfter;
	}
    }
    
    private static CssTime defaultValue;
}

--- NEW FILE: ACssVoiceDuration.java ---
//
// $Id: ACssVoiceDuration.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssVoiceDuration.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.2  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/07/30 06:34:52  sijtsche
 * new speech property
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.6  1997/08/25 13:52:36  plehegar
 * Added getValue()
 *
 * Revision 1.5  1997/08/22 15:00:35  plehegar
 * Bugs
 *
 * Revision 1.4  1997/08/22 14:58:25  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.3  1997/08/21 21:13:38  plehegar
 * Added time
 *
 * Revision 1.2  1997/08/21 14:34:19  vmallet
 * Minor modifications so we could compile it.
 *
 * Revision 1.1  1997/08/14 12:58:48  plehegar
 * Initial revision
 *
 */

package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssTime;
import org.w3c.css.values.CssValue;

/**
 * &nbsp;&nbsp; 'pause-before'
 *
 * <P>
 * <EM>Value: </EM>&lt;time&gt; | &lt;percentage&gt;<BR>
 * <EM>Initial:</EM> UA specific<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> no<BR>
 * <EM>Percentage values:</EM> NA<BR>
 *
 * <P>This property specifies the pause before an element is spoken. It
 * may be given in an absolute units (seconds, milliseconds) or as a
 * relative value - in which case it is relative to the reciprocal of the
 * 'speed' property: if speed is 120 words per minute (ie a word takes
 * half a second, 500 milliseconds) then a pause-before of 100% means a
 * pause of 500 ms and a pause-before of 20% means 100ms.
 *
 * <p>Using relative units gives more robust stylesheets in the face of
 * large changes in speed and is recommended practice.
 *
 * @version $Revision: 1.1 $
 */
public class ACssVoiceDuration extends ACssProperty {

    CssValue value;

    private static CssTime defaultValue;

    /**
     * Create a new ACssVoiceDuration
     */
    public ACssVoiceDuration() {
	// Initial is User Agent Specific
	if (defaultValue == null) {
	    defaultValue = new CssTime(ACssProperties.getValue(this, "default"));
	}
	value = defaultValue;
    }

    /**
     * Creates a new ACssVoiceDuration
     *
     * @param expression the expression of the size
     * @exception InvalidParamException The expression is incorrect
     */
    public ACssVoiceDuration(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	} else if (val instanceof CssTime) {
	    float num = ((Float) val.get()).floatValue();
	    if (num < 0) {
		throw new InvalidParamException("negative-value",
						val.toString(), ac);
	    }
	    value = val;
	    expression.next();
	    return;
	}

	throw new InvalidParamException("value", val.toString(),
					getPropertyName(), ac);
    }

    public ACssVoiceDuration(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */
    public Object get() {
	return value;
    }

    /**
     * Returns some usable value of this property...
     */
    public int getValue() { // vm
	return ((Float) value.get()).intValue();
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (value != null)
	    return value.toString();
	else
	    return null;
    }


    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "voice-duration";
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssVoiceDuration != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssVoiceDuration = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	if (value != null) {
	    return (property instanceof ACssVoiceDuration &&
		    value.equals(((ACssVoiceDuration) property).value));
	} else {
	    return false;
	}
    }


    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getVoiceDuration();
	} else {
	    return ((ACssStyle) style).acssVoiceDuration;
	}
    }

}

--- NEW FILE: ACssSpeakCSS3.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssVoiceBalance.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssElevation.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssPauseBefore.java ---
//
// $Id: ACssPauseBefore.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssPauseBefore.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.6  1997/08/25 13:52:36  plehegar
 * Added getValue()
 *
 * Revision 1.5  1997/08/22 15:00:35  plehegar
 * Bugs
 *
 * Revision 1.4  1997/08/22 14:58:25  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.3  1997/08/21 21:13:38  plehegar
 * Added time
 *
 * Revision 1.2  1997/08/21 14:34:19  vmallet
 * Minor modifications so we could compile it.
 *
 * Revision 1.1  1997/08/14 12:58:48  plehegar
 * Initial revision
 *
 */

package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssTime;
import org.w3c.css.values.CssValue;

/**
 * &nbsp;&nbsp; 'pause-before'
 *
 * <P>
 * <EM>Value: </EM>&lt;time&gt; | &lt;percentage&gt;<BR>
 * <EM>Initial:</EM> UA specific<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> no<BR>
 * <EM>Percentage values:</EM> NA<BR>
 *
 * <P>This property specifies the pause before an element is spoken. It
 * may be given in an absolute units (seconds, milliseconds) or as a
 * relative value - in which case it is relative to the reciprocal of the
 * 'speed' property: if speed is 120 words per minute (ie a word takes
 * half a second, 500 milliseconds) then a pause-before of 100% means a
 * pause of 500 ms and a pause-before of 20% means 100ms.
 *
 * <p>Using relative units gives more robust stylesheets in the face of
 * large changes in speed and is recommended practice.
 *
 * @version $Revision: 1.1 $
 */
public class ACssPauseBefore extends ACssProperty {
    
    CssValue value;
    
    private static CssTime defaultValue;

    /**
     * Create a new ACssPauseBefore
     */  
    public ACssPauseBefore() {
	// Initial is User Agent Specific
	if (defaultValue == null) {
	    defaultValue = new CssTime(ACssProperties.getValue(this, "default"));
	}
	value = defaultValue;
    }
    
    /**
     * Creates a new ACssPauseBefore
     *
     * @param expression the expression of the size
     * @exception InvalidParamException The expression is incorrect
     */  
    public ACssPauseBefore(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	
	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	} else if (val instanceof CssPercentage) {
	    float num = ((Float) val.get()).floatValue();
	    if (num < 0) {
		throw new InvalidParamException("negative-value", 
						val.toString(), ac);
	    }
	    value = val;
	    expression.next();
	    return;
	} else if (val instanceof CssTime) {
	    float num = ((Float) val.get()).floatValue();
	    if (num < 0) {
		throw new InvalidParamException("negative-value", 
						val.toString(), ac);
	    }
	    value = val;
	    expression.next();
	    return;
	} else if (val instanceof CssNumber) {
	    value = ((CssNumber) val).getTime();
	    expression.next();
	}
	
	throw new InvalidParamException("value", val.toString(), 
					getPropertyName(), ac);
    }
    
    public ACssPauseBefore(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */  
    public Object get() {
	return value;
    }
    
    /**
     * Returns some usable value of this property...
     */
    public int getValue() { // vm
	return ((Float) value.get()).intValue();
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (value != null)
	    return value.toString();
	else
	    return null;
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "pause-before";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	ACssPause acssPause = ((ACssStyle) style).acssPause;
	if (acssPause.pauseBefore != null)
	    style.addRedefinitionWarning(ac, this);
	acssPause.pauseBefore = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	if (value != null) {
	    return (property instanceof ACssPauseBefore && 
		    value.equals(((ACssPauseBefore) property).value));
	} else {
	    return false;
	}
    }
    
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getPauseBefore();
	} else {
	    return ((ACssStyle) style).acssPause.pauseBefore;
	}
    }
    
}

--- NEW FILE: ACssVoiceVolume.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssPhonemes.java ---
//
// $Id: ACssPhonemes.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssPhonemes.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.2  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/07/30 06:34:52  sijtsche
 * new speech property
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.6  1997/08/25 13:52:36  plehegar
 * Added getValue()
 *
 * Revision 1.5  1997/08/22 15:00:35  plehegar
 * Bugs
 *
 * Revision 1.4  1997/08/22 14:58:25  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.3  1997/08/21 21:13:38  plehegar
 * Added time
 *
 * Revision 1.2  1997/08/21 14:34:19  vmallet
 * Minor modifications so we could compile it.
 *
 * Revision 1.1  1997/08/14 12:58:48  plehegar
 * Initial revision
 *
 */

package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssString;
import org.w3c.css.values.CssValue;

/**

 *
 * @version $Revision: 1.1 $
 */
public class ACssPhonemes extends ACssProperty {

    CssValue value;


    /**
     * Create a new ACssPhonemes
     */
    public ACssPhonemes() {
    }

    /**
     * Creates a new ACssPhonemes
     *
     * @param expression the expression of the size
     * @exception InvalidParamException The expression is incorrect
     */
    public ACssPhonemes(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	} else if (val instanceof CssString) {
	    value = val;
	    expression.next();
	    return;
	}

	throw new InvalidParamException("value", val.toString(),
					getPropertyName(), ac);
    }

    public ACssPhonemes(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */
    public Object get() {
	return value;
    }

    /**
     * Returns some usable value of this property...
     */
    public int getValue() { // vm
		return 0;
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (value != null)
	    return value.toString();
	else
	    return null;
    }


    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "phonemes";
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssPhonemes != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssPhonemes = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	if (value != null) {
	    return (property instanceof ACssPhonemes &&
		    value.equals(((ACssPhonemes) property).value));
	} else {
	    return false;
	}
    }


    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getPhonemes();
	} else {
	    return ((ACssStyle) style).acssPhonemes;
	}
    }

}

--- NEW FILE: ACssCueAfter.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssPlayDuring.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssVoiceRate.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: AuralDefault.properties ---
# User agent specific
pause-after.default:  0
pause-before.default: 0

# Volume :
volume.silent: -1
volume.x-soft: 0
volume.soft:   25
volume.medium: 50
volume.loud:   75
volume.x-loud: 100

# azimuth
azimuth.left-side: 270
azimuth.behind.left-side: 270
azimuth.far-left:  300
azimuth.behind.far-left:  240
azimuth.left:      320
azimuth.behind.left:      220
azimuth.center-left: 340
azimuth.behind.center-left: 200
azimuth.center:     0
azimuth.behind.center:     180
azimuth.center-right: 20
azimuth.behind.center-right: 140
azimuth.right:      40
azimuth.behind.right:     120
azimuth.far-right:  60
azimuth.behind.far-right: 90
azimuth.left-side:  90
azimuth.behind.left-side: 90
azimuth.leftwards:  20
azimuth.rightwards: 20

# elevation (funny values !)
elevation.below:  10
elevation.level:  30
elevation.above:  50
elevation.higher: 70
elevation.lower:  90

# speech-rate
speech-rate.medium: 150
speech-rate.x-slow: 50
speech-rate.slow:   100
speech-rate.fast:   200
speech-rate.x-fast: 250
speech-rate.faster: -1
speech-rate.slower: -2

# pitch
pitch.x-low:  56 
pitch.low:    85
pitch.medium: 113
pitch.high:   170
pitch.x-high: 226

--- NEW FILE: ACssSpeak.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssVoiceFamily.java ---
//
// $Id: ACssVoiceFamily.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssVoiceFamily.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.1  1997/08/25 13:40:59  plehegar
 * Initial revision
 *
 */

package org.w3c.css.properties.aural;

import java.util.Enumeration;
import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.util.Util;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssString;
import org.w3c.css.values.CssValue;

/** 
 * <H3>5.2 &nbsp;&nbsp;   'voice-family'</H3>
 * <P>
 * <EM>Value:</EM>  [[&lt;specific-voice&gt; | &lt;generic-voice&gt;],]* 
 * [&lt;specific-voice&gt; | &lt;generic-voice&gt;]<BR>
 * <EM>Initial:</EM> UA <BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <P>The value is a prioritized list of voice family names (compare 
 * with '<a
 * href="/pub/WWW/TR/REC-CSS1##font-family">font-family</a>'. Suggested
 * genric families: male, female, child.
 *
 * <P>Examples of specific voice families are: comedian, trinoids, carlos, lisa
 *
 * <p>Examples
 *
 * <pre>
 *   H1 { voice-family: announcer, male }
 *   P.part.romeo {  voice-family: romeo, male }
 *   P.part.juliet { voice-family: juliet, female }
 * </pre>
 *
 * <p class=comment>Should the properties of these family names be
 * described, using an @-rule, to allow better client-side matching (like
 * fonts). If so, what are the values that describe these voice families
 * in a way that is independent of speech synthesizer?
 *
 * @version $Revision: 1.1 $ 
 */
public class ACssVoiceFamily extends ACssProperty implements CssOperator {
    
    Vector family_name = new Vector();
    boolean inheritValue;
    
    static String[] genericFamily = { "male", "female", "child" };
    
    static int[] genericFamilyHash;

    boolean withSpace = false;
    
    /**
     * Create a new ACssVoiceFamily
     */
    public ACssVoiceFamily() {
	// depends on user agent
    }  
    
    /**
     * Create a new ACssVoiceFamily
     * @param value the voice name
     * @exception InvalidParamException The expression is incorrect
     */
    public ACssVoiceFamily(ApplContext ac, CssExpression value, boolean check)
    	throws InvalidParamException {
	boolean family = true;
	CssValue val = value.getValue();
	char op;
	//@@ and if name is already in the vector ?
	
	setByUser();
	if (val.equals(inherit)) {
	    if(value.getCount() > 1) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    inheritValue = true;
	    return;
	}
	
	while (family) {
	    val = value.getValue();
	    op = value.getOperator();
	    
	    if ((op != COMMA) && (op != SPACE)) {
		throw new InvalidParamException("operator", 
						(new Character(op)).toString(), ac);
	    }
	    
	    if(val != null && val.equals(inherit)) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    
	    if (val instanceof CssString) {
		String familyName = null;
		if (op == COMMA) { // "helvetica", "roman"
		    familyName = trimToOneSpace(val.toString());
		    value.next();
		} else { // "helvetica" CssValue
		    familyName = trimToOneSpace(val.toString());
		    family = false;
		    value.next();
		}
		if (familyName.length() > 2) {
		    String tmp = familyName.substring(1, familyName.length()-1);
		    for (int i = 0; i < genericFamily.length; i++) {
			if (genericFamily[i].equals(tmp)) {
			    throw new InvalidParamException("generic-family.quote",
				    genericFamily[i],
				    getPropertyName(),
				    ac);
			}
		    }
		}
		family_name.addElement(familyName);
	    } else if (val instanceof CssIdent) {
		if (op == COMMA) {
		    family_name.addElement(val.toString());
		    value.next();
		} else {
		    CssValue next = value.getNextValue();
		    
		    if (next != null && next instanceof CssIdent) { 
			// @@ null and instanceof
			CssIdent New = new CssIdent(val.get() 
						    + " " + next.get());
			withSpace = true;
			value.remove();
			op = value.getOperator();
			value.remove();
			value.insert(New);
			value.setCurrentOperator(op);
		    } else {
			family_name.addElement(val.toString());
			value.next();
			family = false;
		    }
		}
	    } else {
		throw new InvalidParamException("value", val.toString(), 
						getPropertyName(), ac);
	    }
	}
	
    }    
    
    public ACssVoiceFamily(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns all voices name
     */  
    public Enumeration elements() {
	return family_name.elements();
    }
    
    /**
     * Returns the size
     */
    public int size() {
	return family_name.size();
    }
    
    /**
     * Returns the voice (null if no voice)
     */  
    public Object get() {
	if (family_name.size() == 0) {
	    return null;
	}
	return family_name.firstElement();
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return inheritValue;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {  
	if (inheritValue) {
	    return inherit.toString();
	} else {
	    
	    String r = "";
	    for (Enumeration e = elements(); e.hasMoreElements();)
		//		r += ", " + e.nextElement().toString();
		r += ", " + e.nextElement().toString();
	    if (r.length() < 3) {
		return null;
	    }
	    return r.substring(2);
	}
    }
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "voice-family";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssVoiceFamily != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssVoiceFamily = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return false; //@@ FIXME
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getVoiceFamily();
	} else {
	    return ((ACssStyle) style).acssVoiceFamily;
	}
    }
    
    private static String trimToOneSpace(String name) {
	int count = name.length();
	char[] dst = new char[count];
	char[] src = new char[count];
	int index = -1;
	
	name.getChars(0, count, src, 0);
	for(int i=0; i < count; i++)
	    if ( i == 0 || ! Util.isWhiteSpace(src[i]) || 
		 ( Util.isWhiteSpace(src[i]) && !Util.isWhiteSpace(dst[index]) ) )
		dst[++index] = src[i];
	
	return new String(dst, 0, index+1);
    }
    
    /**
     * Returns true if this property contains a generic family name
     */  
    public boolean containsGenericFamily() {
	if (family_name.size() == 0) {
	    return true;
	} else {
	    for (Enumeration e = family_name.elements(); 
		 e.hasMoreElements();) {
		int hash = ((String) e.nextElement()).toLowerCase().hashCode();
		for (int i = 0; i < genericFamilyHash.length; i++) {
		    if (hash == genericFamilyHash[i])
			return true;
		}
	    }
	    return false;
	}
    }
    
    
    static {
	genericFamilyHash = new int[genericFamily.length];
	for (int i = 0; i < genericFamily.length; i++) {
	    genericFamilyHash[i] = genericFamily[i].hashCode();
	}
    }
}

--- NEW FILE: ACssVoiceFamilyCSS3.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssProperty.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssVoiceVolume.java ---
//
// $Id: ACssVoiceVolume.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssVoiceVolume.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.2  2005/08/08 13:18:04  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/07/25 13:20:38  sijtsche
 * new CSS3 speech property
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.5  1997/08/23 03:09:36  vmallet
 * Added the 'usable' getValue() method.
 *
 * Revision 1.4  1997/08/22 17:57:50  plehegar
 * Updated
 *
 * Revision 1.3  1997/08/22 17:12:31  plehegar
 * Added documentation
 *
 * Revision 1.2  1997/08/22 14:54:33  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.1  1997/08/20 18:41:36  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;


/**
 *  &nbsp;&nbsp; 'volume'
 *
 * <P>
 * <EM>Value:</EM> &lt;percentage&gt; | silent | x-soft | soft | medium | loud | x-loud<br>
 * <EM>Initial:</EM> medium<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> relative to user-specified mapping
 *
 * <P>The legal range of percentage values is 0% to 100%. Note that '0%'
 * <strong>does not mean the same as "silent"</strong>. 0% represents the
 * <em>minimum audible</em> volume level and 100% corresponds to the
 * <em>maximum comfortable</em> level. There is a fixed mapping between
 * keyword values and percentages:
 *
 * <UL>
 * <li>'silent' = no sound at all, the element is  spoken silently
 * <LI>'x-soft' = '0%'
 * <LI>'soft' = '25%'
 * <LI>'medium' = '50%'
 * <LI>'loud' = '75%'
 * <LI>'x-loud' = '100%'
 * </UL>
 *
 * <P>VoiceVolume refers to the median volume of the waveform. In other words,
 * a highly inflected voice at a volume of 50 might peak well above
 * that. The overall values are likely to be human adjustable
 * for comfort, for example with a physical volume control (which would
 * increase both the 0% and 100% values proportionately); what this
 * property does is adjust the dynamic range.
 *
 *
 * <p>The UA <em>should</em> allow the values corresponding to 0% and
 * 100% to be set by the listener. No one setting is universally
 * applicable; suitable values depend on the equipment in use (speakers,
 * headphones), the environment (in car, home theater, library) and
 * personal preferences. Some examples:
 *
 * <ul><li>A browser for in-car use has a setting for when there is lots
 * of background noise. 0% would map to a fairly high level and 100% to a
 * quite high level. The speech is easily audible over the road noise but
 * the overall dynamic range is compressed. Plusher cars with better
 * insulation allow a wider dynamic range.
 *
 *
 * <li>Another speech browser is being used in the home, late at night,
 * (don't annoy the neighbors) or in a shared study room. 0% is set to
 * a very quiet level and 100% to a fairly quiet level, too. As with the first
 * example, there is a low slope; the dynamic range is reduced. The
 * actual volumes are low here, wheras they were high in the first
 * example.
 *
 * <li>In a quiet and isolated house, an expensive hi-fi home theatre
 * setup. 0% is set fairly low and 100% to quite high; there is wide
 * dynamic range.
 * </ul>
 *
 * <p>The same authors stylesheet could be used in all cases, simply by
 * mapping the 0 and 100 points suitably at the client side.
 *
 * <p>If an element has a volume of silent, it is spoken silently. It
 * takes up the same time as if it had been spoken, including any pause
 * before and after the element, but no sound is generated. This may be
 * used in language teaching applications, for example. A pause is
 * gdenerated for the pupil to speak the element themselves. <b>Note:</b>
 * the value is inherited so child elements will also be silent.  Child
 * elements may however set the volume to a non-silent value and will
 * then be spoken.
 *
 * <p>To inhibit the speaking of an element and all it's children so that
 * it takes no time at all (for example, to get the effect of collapsing
 * and expanding lists) use the CSS1 property 'display'
 *
 * <pre>display: none</pre>
 *
 * <p>When using the rule <tt>display: none</tt> the element takes up
 * <em>no time</em>; it is not represented as a pause the length of the
 * spoken text.
 *
 * @version $Revision: 1.1 $
 */
public class ACssVoiceVolume extends ACssProperty {

    CssValue value;

    private static int[] hash_values;

    private static String[] VOLUME = { "silent", "x-soft", "soft",
				       "medium", "loud", "x-loud", "louder", "softer", "inherit" };

    private static CssIdent defaultValue = new CssIdent(VOLUME[3]);

    /**
     * Create a new ACssVoiceVolume
     */
    public ACssVoiceVolume() {
	value = defaultValue;
    }

    /**
     * Creates a new ACssVoiceVolume
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public ACssVoiceVolume(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	int index;

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val instanceof CssIdent) {
	    value = checkIdent(ac, (CssIdent) val);
	} else if (val instanceof CssPercentage) {
	    value = val;
	} else if (val instanceof CssNumber) {
	    CssNumber num = (CssNumber) val;
	    int i = (int) num.getValue();
	    if (i < 0) {
		value = new CssNumber(ac, 0);
	    } else if (i > 100) {
		value = new CssNumber(ac, 100);
	    } else {
		value = val;
	    }
	    expression.next();
	} else {
	    throw new InvalidParamException("value",
					    expression.getValue().toString(),
					    getPropertyName(), ac);
	}

	expression.next();
    }
    
    public ACssVoiceVolume(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }

    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }


    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }

    /**
     * Returns some usable value of this property...
     *
     * @deprecated
     */
    public float getValue() { // vm
	return ((CssNumber) value).getValue();
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "voice-volume";
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssVoiceVolume != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssVoiceVolume = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof ACssVoiceVolume &&
		value.equals(((ACssVoiceVolume) property).value));
    }

    private CssIdent checkIdent(ApplContext ac, CssIdent ident)
	throws InvalidParamException {

	int hash = ident.hashCode();
	for (int i = 0; i < VOLUME.length; i++) {
	    if (hash_values[i] == hash) {
		return ident;
	    }
	}

	throw new InvalidParamException("value", ident.toString(),
					getPropertyName(), ac);
    }

    /** @deprecated */
    private CssPercentage ValueOfIdent(ApplContext ac, CssIdent ident)
	throws InvalidParamException {

	int hash = ident.hashCode();
	for (int i = 0; i < VOLUME.length; i++) {
	    if (hash_values[i] == hash) {
		return new CssPercentage(ACssProperties.getValue(this, VOLUME[i]));
	    }
	}

	throw new InvalidParamException("value", ident.toString(),
					getPropertyName(), ac);
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getVoiceVolume();
	} else {
	    return ((ACssStyle) style).acssVoiceVolume;
	}
    }

    static {
	hash_values = new int[VOLUME.length];
	for (int i = 0; i < VOLUME.length; i++)
	    hash_values[i] = VOLUME[i].hashCode();
    }
}


--- NEW FILE: ACssStress.java ---
//
// $Id: ACssStress.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssStress.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;


/**
 * <H3> &nbsp;&nbsp; 'stress'</H3>
 *
 * <P>
 * <EM>Value: </EM>&lt;number&gt;|inherit<BR>
 * <em>Initial:</EM> 50%<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> Relative to...
 *
 *
 * <p>Specifies the level of stress (assertiveness or emphasis) of the
 * speaking voice.  English is a <strong>stressed</strong> language, and
 * different parts of a sentence are assigned primary, secondary or
 * tertiary stress. The value of property 'stress' controls the amount of
 * inflection that results from these stress markers.  
 *
 * <P>Increasing the value of this property results in the speech being
 * more strongly inflected.  It is in a sense dual to property
 * <em>:pitch-range</em> and is provided to allow developers to exploit
 * higher-end auditory displays.
 *
 * <p class=comment>Combine 'pitch-range' and 'stress' into one property
 * 'inflection'?</p>
 *
 *
 * @version $Revision: 1.1 $
 */
public class ACssStress extends ACssProperty {
    
    CssValue value;
    
    static CssValue DefaultValue = new CssNumber(null, 50);

    /**
     * Create a new ACssStress
     */
    public ACssStress() {
	value = DefaultValue;
    }  
    
    /**
     * Creates a new ACssStress
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public ACssStress(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	int index;
	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	} else if (val instanceof CssNumber) {
	    float f = ((CssNumber) val).getValue();
	    if ((f < 0) || (f > 100)) {		
		throw new InvalidParamException("range", null, ac);
	    }
	    value = val;
	    expression.next();
	    return;
	}

	throw new InvalidParamException("value", 
					expression.getValue().toString(), 
					getPropertyName(), ac);
    }
    
    public ACssStress(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "stress";
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssStress != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssStress = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssStress && 
		value.equals(((ACssStress) property).value));
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getStress();
	} else {
	    return ((ACssStyle) style).acssStress;
	}
    }
    
}


--- NEW FILE: ACssVoiceRate.java ---
//
// $Id: ACssVoiceRate.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssVoiceRate.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.2  2005/08/08 13:18:04  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/07/28 14:56:30  sijtsche
 * new CSS3 speech property
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.4  1997/08/25 13:51:32  plehegar
 * Added getValue()
 *
 * Revision 1.3  1997/08/22 18:01:18  plehegar
 * Updated
 *
 * Revision 1.2  1997/08/22 17:58:30  plehegar
 * Updated
 *
 * Revision 1.1  1997/08/22 17:07:38  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  &nbsp;&nbsp; 'voice-rate'
 *
 * <P>
 * <EM>Value:</EM> &lt;words-per-minute&gt; | x-slow | slow | medium |
 * fast | x-fast <BR>
 * <EM>Initial:</EM> medium<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <P>Specifies the speaking rate. Note that both absolute and relative
 * keyword values are allowed. (compare with font-weight').
 *
 *
 * @version $Revision: 1.1 $
 */
public class ACssVoiceRate extends ACssProperty {

    CssValue value;

    private static int[] hash_values;

    private static String[] SPEECHRATE = { "x-slow", "slow", "medium",
					   "fast", "x-fast" };
    private static CssIdent defaultValue = new CssIdent(SPEECHRATE[2]);

    /**
     * Create a new ACssVoiceRate
     */
    public ACssVoiceRate() {
	value = defaultValue;
    }

    /**
     * Creates a new ACssVoiceRate
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Expressions are incorrect
     */
    public ACssVoiceRate(ApplContext ac, CssExpression expression, boolean check)
	    throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	int index;

	setByUser();
	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val instanceof CssIdent) {
	    value = checkIdent(ac, (CssIdent) val);
	} else if (val instanceof CssNumber) {
	    value = val;
	} else {
	    throw new InvalidParamException("value",
					    expression.getValue().toString(),
					    getPropertyName(), ac);
	}
	expression.next();
    }

    public ACssVoiceRate(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }


    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "voice-rate";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssVoiceRate != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssVoiceRate = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof ACssVoiceRate &&
		value.equals(((ACssVoiceRate) property).value));
    }

    private CssIdent checkIdent(ApplContext ac, CssIdent ident) throws InvalidParamException {
	int hash = ident.hashCode();
	for (int i = 0; i < SPEECHRATE.length; i++) {
	    if (hash_values[i] == hash) {
		return ident;
	    }
	}

	throw new InvalidParamException("value",
					ident.toString(),
					getPropertyName(), ac);
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getVoiceRate();
	} else {
	    return ((ACssStyle) style).acssVoiceRate;
	}
    }

    static {
	hash_values = new int[SPEECHRATE.length];
	for (int i = 0; i < SPEECHRATE.length; i++)
	    hash_values[i] = SPEECHRATE[i].hashCode();
    }
}


--- NEW FILE: ACssAzimuth.java ---
//
// $Id: ACssAzimuth.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssAzimuth.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssAngle;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *
 * @version $Revision: 1.1 $
 */
public class ACssAzimuth extends ACssProperty {
    
    CssValue value;

    boolean isBehind;
    
    private static int[] hash_values;
    
    private static String[] AZIMUTH = { "left-side", "far-left", "left",
					"center-left", "center", "center-right",
					"right", "far-right", "right-side" };
    
    private static CssIdent defaultIdentValue = new CssIdent(AZIMUTH[4]);
    private static CssIdent behind = new CssIdent("behind");
    private static CssIdent leftwards = new CssIdent("leftwards");
    private static CssIdent rightwards = new CssIdent("rightwards");
    
    /**
     * Create a new ACssAzimuth
     */
    public ACssAzimuth() {
	value = defaultIdentValue;
    }  
    
    /**
     * Creates a new ACssAzimuth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Expressions are incorrect
     */  
    public ACssAzimuth(ApplContext ac, CssExpression expression, boolean check)
    	throws InvalidParamException {
			
	this();
	
	if(check && expression.getCount() > 2) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	int index;
	
	setByUser();
	
	if (val.equals(leftwards)) {
	    if(check && expression.getCount() > 1) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    value = leftwards;
	    expression.next();
	    return;
	} if (val.equals(inherit)) {
	    if(expression.getCount() > 1) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    value = inherit;
	    expression.next();
	    return;
	} else if (val.equals(rightwards)) {
	    if(check && expression.getCount() > 1) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    value = rightwards;
	    expression.next();
	    return;
	} else if (val.equals(behind)) {	    
	    isBehind = true;
	    expression.next();
	    CssValue valnext = expression.getValue();
	    if (valnext == null) {
		// behind == behind center
		value = null;
		return;
	    } else if (valnext instanceof CssIdent) {
		value = checkIdent(ac, (CssIdent) valnext);
		expression.next();
		return;
	    }
	} else if (val instanceof CssIdent) {
	    expression.next();
	    CssValue valnext = expression.getValue();
	    if (valnext == null) {
		// left
		value = checkIdent(ac, (CssIdent) val);
		return;
	    } else if (valnext.equals(behind)) {
		// left behind
		value = checkIdent(ac, (CssIdent) val);
		isBehind = true;
		expression.next();
		return;
	    }
	} else if (val instanceof CssAngle) {
	    if(check && expression.getCount() > 1) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    CssAngle angle = (CssAngle) val;
	    if (!angle.isDegree()) {
		throw new InvalidParamException("degree", null, ac);
	    }
	    value = val;
	    expression.next();
	    return;
	} else if (val instanceof CssNumber) {
	    if(check && expression.getCount() > 1) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    value = ((CssNumber) val).getAngle();
	    expression.next();
	    return;
	}
	
	throw new InvalidParamException("value", 
					expression.getValue().toString(), 
					getPropertyName(), ac);
    }
    
    public ACssAzimuth(ApplContext ac, CssExpression expression)
	throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "azimuth";
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (isBehind) {
	    if (value != null) {
		return behind.toString() + " " + value.toString();
	    } else {
		return behind.toString();
	    }
	} else {
	    return value.toString();
	}
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssAzimuth != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssAzimuth = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssAzimuth && 
		value.equals(((ACssAzimuth) property).value));
    }
    
    private CssIdent checkIdent(ApplContext ac, CssIdent ident) 
	throws InvalidParamException {
	
	int hash = ident.hashCode();
	
	for (int i = 0; i < AZIMUTH.length; i++) {
	    if (hash_values[i] == hash) {
		return ident;
	    }
	}	
	throw new InvalidParamException("value", 
					ident.toString(), 
					getPropertyName(), ac);
    }
    
    /** @deprecated */
    private Float ValueOfIdent(ApplContext ac, CssIdent ident, boolean b) 
	throws InvalidParamException {
	
	int hash = ident.hashCode();
	
	for (int i = 0; i < AZIMUTH.length; i++) {
	    if (hash_values[i] == hash) {
		if (b) {
		    return ACssProperties.getValue(this, 
						   behind.toString() + "." + AZIMUTH[i]);
		} else {
		    return ACssProperties.getValue(this, AZIMUTH[i]);
		}
	    }
	}
	
	throw new InvalidParamException("value", 
					ident.toString(), 
					getPropertyName(), ac);
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getAzimuth();
	} else {
	    return ((ACssStyle) style).acssAzimuth;
	}
    }
    
    static {
	hash_values = new int[AZIMUTH.length];
	for (int i = 0; i < AZIMUTH.length; i++)
	    hash_values[i] = AZIMUTH[i].hashCode();
    }
}


--- NEW FILE: ACssSpeakPunctuation.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssPause.java ---
//
// $Id: ACssPause.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssPause.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.7  1997/08/26 14:26:13  plehegar
 * Bug
 * Added setSelectors()
 *
 * Revision 1.6  1997/08/25 13:27:54  plehegar
 * Updated toString()
 *
 * Revision 1.5  1997/08/22 14:59:16  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.4  1997/08/21 14:34:42  vmallet
 * Minor modifications so we could compile it.
 *
 * Revision 1.3  1997/08/14 13:30:48  plehegar
 * Updated setImportant()
 *
 * Revision 1.2  1997/08/14 13:24:21  plehegar
 * Added AddToStyle and setInfo
 *
 * Revision 1.1  1997/08/14 13:18:33  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssPrinterStyle;
import org.w3c.css.parser.CssSelectors;
import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;


/**
 *  &nbsp;&nbsp; 'pause'
 *
 * <P>
 * <EM>Value: </EM>[&lt;timee&gt; | &lt;percentage&gt; ]{1,2};<BR>
 * <EM>Initial:</EM> UA specific<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> no<BR>
 * <EM>Percentage values:</EM> NA<BR>
 *
 * <P>The 'pause' property is a shorthand for setting 'pause-before' and
 * 'pause-after'.  If two values are given, the first value is
 * pause-before and the second is pause-after. If only one value is
 * given, it applies to both properties.
 *
 *
 * <P>
 * Examples:
 * <PRE>
 *   H1 { pause: 20ms } /* pause-before: 20ms; pause-after: 20ms * /
 *   H2 { pause: 30ms 40ms } /* pause-before: 30ms; pause-after: 40ms * /
 *   H3 { pause-after: 10ms } /* pause-before: ?; pause-after: 10ms * /
 * </PRE>
 *
 *
 * @version $Revision: 1.1 $
 */
public class ACssPause extends ACssProperty implements CssOperator {
    
    ACssPauseBefore pauseBefore;
    ACssPauseAfter pauseAfter;

    boolean same;
    
    /**
     * Create a new ACssPause
     */
    public ACssPause() {
    }  
    
    /**
     * Create a new ACssPause
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public ACssPause(ApplContext ac, CssExpression expression, boolean check)
    	throws InvalidParamException {
	CssValue val = expression.getValue();

	if (val.equals(inherit)) {
	    if(expression.getCount() > 1) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    this.same = true;
	    pauseBefore = new ACssPauseBefore(ac, expression);
	    pauseAfter = new ACssPauseAfter(pauseBefore);
	    return;
	}
	
	switch (expression.getCount()) {
	case 1:
	    this.same = true;
	    pauseBefore = new ACssPauseBefore(ac, expression);
	    pauseAfter = new ACssPauseAfter(pauseBefore);
	    break;
	case 2:
	    if (expression.getOperator() != SPACE) {
		throw new InvalidParamException("operator", 
						(new Character(expression.getOperator()).toString()),
						ac);
	    }
	    pauseBefore = new ACssPauseBefore(ac, expression);
	    pauseAfter = new ACssPauseAfter(ac, expression);
	    break;
	default:
	    if(check) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	}
    }
    
    public ACssPause(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return pauseBefore;
    }
    
    /**
     * Get the before property
     */
    public ACssPauseBefore getBefore() {
	return pauseBefore;
    }
    
    /**
     * Get the after property
     */
    public ACssPauseAfter getAfter() {
	return pauseAfter;
    }
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "pause";
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	// pauseBefore and pauseAfter must be not null !
	if (same) {
	    return pauseBefore.toString();
	} else {
	    return pauseBefore + " " + pauseAfter;
	}
    }
    
    /**
     * Set this property to be important.
     * Overrides this method for a macro
     */  
    public void setImportant() {
	super.setImportant();
	pauseBefore.setImportant();
	pauseAfter.setImportant();
    }
    
    /**
     * Returns true if this property is important.
     * Overrides this method for a macro
     */
    public boolean getImportant() {
	return ((pauseAfter == null || pauseAfter.getImportant()) &&
		(pauseBefore == null || pauseBefore.getImportant()));
    }
    
    /**
     * Print this property.
     *
     * @param printer The printer.
     * @see #toString()
     * @see #getPropertyName()
     */  
    public void print(CssPrinterStyle printer) {
	if ((pauseBefore != null && pauseAfter != null) &&
	    (getImportant() ||
	     (!pauseBefore.getImportant() &&
	      !pauseAfter.getImportant()))) {
	    printer.print(this);
	} else {	
	if (pauseBefore != null) {
		pauseBefore.print(printer);
	    }
	    if (pauseAfter != null && !same) {
		pauseAfter.print(printer);
	    }
	}
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	// pauseBefore and pauseAfter can't be null ...
	((ACssStyle) style).acssPause.same = same;
	pauseBefore.addToStyle(ac, style);
	pauseAfter.addToStyle(ac, style);
    }
    
    /**
     * Update the source file and the line.
     * Overrides this method for a macro
     *
     * @param line The line number where this property is defined
     * @param source The source file where this property is defined
     */  
    public void setInfo(int line, String source) {
	super.setInfo(line, source);
	// pauseBefore and pauseAfter can't be null ...
	pauseBefore.setInfo(line, source);
	pauseAfter.setInfo(line, source);
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return false; // @FIXME
    }
    
    /**
     * Set the context.
     * Overrides this method for a macro
     *
     * @see org.w3c.css.css.CssCascadingOrder#order
     * @see org.w3c.css.css.StyleSheetParser#handleRule
     */
    public void setSelectors(CssSelectors selector) {
	super.setSelectors(selector);
	if (pauseBefore != null) {
	    pauseBefore.setSelectors(selector);
	}
	if (pauseAfter != null) {
	    pauseAfter.setSelectors(selector);
	}
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getPause();
	} else {
	    return ((ACssStyle) style).acssPause;
	}
    }
    
}

--- NEW FILE: ACssRichness.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssVoiceStress.java ---
//
// $Id: ACssVoiceStress.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssVoiceStress.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.2  2005/08/08 13:18:04  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/07/28 14:56:30  sijtsche
 * new CSS3 speech property
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.4  1997/08/25 13:51:32  plehegar
 * Added getValue()
 *
 * Revision 1.3  1997/08/22 18:01:18  plehegar
 * Updated
 *
 * Revision 1.2  1997/08/22 17:58:30  plehegar
 * Updated
 *
 * Revision 1.1  1997/08/22 17:07:38  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class ACssVoiceStress extends ACssProperty {

    CssValue value;

    private static int[] hash_values;

    private static String[] STRESS = { "strong", "moderate", "none", "reduced" };
    private static CssIdent defaultValue = new CssIdent(STRESS[2]);

    /**
     * Create a new ACssVoiceStress
     */
    public ACssVoiceStress() {
	value = defaultValue;
    }

    /**
     * Creates a new ACssVoiceStress
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Expressions are incorrect
     */
    public ACssVoiceStress(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	int index;

	setByUser();
	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val instanceof CssIdent) {
	    value = checkIdent(ac, (CssIdent) val);
	} else if (val instanceof CssNumber) {
	    value = val;
	} else {
	    throw new InvalidParamException("value",
					    expression.getValue().toString(),
					    getPropertyName(), ac);
	}
	expression.next();
    }

    public ACssVoiceStress(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }


    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "voice-stress";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssVoiceStress != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssVoiceStress = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof ACssVoiceStress &&
		value.equals(((ACssVoiceStress) property).value));
    }

    private CssIdent checkIdent(ApplContext ac, CssIdent ident) throws InvalidParamException {
	int hash = ident.hashCode();
	for (int i = 0; i < STRESS.length; i++) {
	    if (hash_values[i] == hash) {
		return ident;
	    }
	}

	throw new InvalidParamException("value",
					ident.toString(),
					getPropertyName(), ac);
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getVoiceStress();
	} else {
	    return ((ACssStyle) style).acssVoiceStress;
	}
    }

    static {
	hash_values = new int[STRESS.length];
	for (int i = 0; i < STRESS.length; i++)
	    hash_values[i] = STRESS[i].hashCode();
    }
}


--- NEW FILE: ACssProperties.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssSpeakCSS3.java ---
//
// $Id: ACssSpeakCSS3.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssSpeakCSS3.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.2  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/07/25 13:22:55  sijtsche
 * extra values for property in CSS3
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.5  1997/08/23 03:09:36  vmallet
 * Added the 'usable' getValue() method.
 *
 * Revision 1.4  1997/08/22 17:57:50  plehegar
 * Updated
 *
 * Revision 1.3  1997/08/22 17:12:31  plehegar
 * Added documentation
 *
 * Revision 1.2  1997/08/22 14:54:33  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.1  1997/08/20 18:41:36  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  &nbsp;&nbsp; 'speak'
 *
 * @version $Revision: 1.1 $
 */
public class ACssSpeakCSS3 extends CssProperty {

    CssValue value;

    private static int[] hash_values;

    private static String[] SPEAK = { "normal", "none", "spell-out", "digits", "literal-punctuation", "no-punctuation", "inherit" };

    private static CssIdent defaultValue = new CssIdent(SPEAK[1]);

    /**
     * Create a new ACssSpeakCSS3
     */
    public ACssSpeakCSS3() {
	value = defaultValue;
    }

    /**
     * Creates a new ACssSpeakCSS3
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public ACssSpeakCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	int index;

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val instanceof CssIdent) {
	    value = checkIdent(ac, (CssIdent) val);
	} else {
	    throw new InvalidParamException("value",
					    expression.getValue().toString(),
					    getPropertyName(), ac);
	}

	expression.next();
    }

    public ACssSpeakCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }


    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
		return "speak";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
		return value.equals(inherit);
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
		return value.toString();
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssSpeakCSS3 != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssSpeakCSS3 = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
		return (property instanceof ACssSpeakCSS3 &&
			value.equals(((ACssSpeakCSS3) property).value));
    }

    private CssIdent checkIdent(ApplContext ac, CssIdent ident)
	throws InvalidParamException {

		int hash = ident.hashCode();
		for (int i = 0; i < SPEAK.length; i++) {
		    if (hash_values[i] == hash) {
				return ident;
		    }
		}

		throw new InvalidParamException("value", ident.toString(),
					getPropertyName(), ac);
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getSpeakCSS3();
	} else {
	    return ((ACssStyle) style).acssSpeakCSS3;
	}
    }

    static {
	hash_values = new int[SPEAK.length];
	for (int i = 0; i < SPEAK.length; i++)
	    hash_values[i] = SPEAK[i].hashCode();
    }
}


--- NEW FILE: ACssCue.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssSpeakNumeral.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssPitch.java ---
//
// $Id: ACssPitch.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssPitch.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.1  1997/08/22 18:11:54  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFrequency;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  &nbsp;&nbsp; 'pitch' <span>(or 'average pitch'
 * ?, what is the relationship with voice-family?)</span>
 *
 * <P>
 * <EM>Value: </EM>&lt;hertz&gt; | x-low | low | medium | high | x-high<BR>
 * <EM>Initial:</EM> medium<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <p>Specifies the average pitch of the speaking voice in hertz (Hz).
 *
 * @version $Revision: 1.1 $
 */
public class ACssPitch extends ACssProperty {
    
    CssValue value;
    

    private static int[] hash_values;
    
    private static String[] PITCH = { "x-low", "low", "medium", 
				      "high", "x-high" };
    
    private static CssIdent defaultValue = new CssIdent(PITCH[2]);

    /**
     * Create a new ACssPitch
     */
    public ACssPitch() {
	value = defaultValue;
    }  
    
    /**
     * Creates a new ACssPitch
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public ACssPitch(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	
	setByUser();

	if (val.equals(inherit)) {
	    val = inherit;
	} else if (val instanceof CssIdent) {
	    value = checkIdent(ac,(CssIdent) val);
	} else if (val instanceof CssFrequency) {
	    value = val;
	} else {
	    throw new InvalidParamException("value", 
					    expression.getValue().toString(), 
					    getPropertyName(), ac);
	}

	expression.next();
    }
    
    public ACssPitch(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    
    /**
     * Returns some usable value of this property...
     */
    public int getValue() { // vm
	return ((Float) value.get()).intValue();
    }
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "pitch";
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssPitch != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssPitch = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssPitch && 
		value.equals(((ACssPitch) property).value));
    }
    
    private CssIdent checkIdent(ApplContext ac, CssIdent ident) throws InvalidParamException {
	int hash = ident.hashCode();
	for (int i = 0; i < PITCH.length; i++) {
	    if (hash_values[i] == hash) {
		return ident;
	    }
	}
	
	throw new InvalidParamException("value", 
					ident.toString(), 
					getPropertyName(), ac);
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getPitch();
	} else {
	    return ((ACssStyle) style).acssPitch;
	}
    }
    
    static {
	hash_values = new int[PITCH.length];
	for (int i = 0; i < PITCH.length; i++)
	    hash_values[i] = PITCH[i].hashCode();
    }
}


--- NEW FILE: ACssVoiceBalance.java ---
//
// $Id: ACssVoiceBalance.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssVoiceBalance.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.2  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/07/25 13:20:38  sijtsche
 * new CSS3 speech property
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.5  1997/08/23 03:09:36  vmallet
 * Added the 'usable' getValue() method.
 *
 * Revision 1.4  1997/08/22 17:57:50  plehegar
 * Updated
 *
 * Revision 1.3  1997/08/22 17:12:31  plehegar
 * Added documentation
 *
 * Revision 1.2  1997/08/22 14:54:33  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.1  1997/08/20 18:41:36  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;


/**
 *
 * @version $Revision: 1.1 $
 */
public class ACssVoiceBalance extends ACssProperty {

    CssValue value;

    private static int[] hash_values;

    private static String[] VOLUME = { "left", "center", "right", "inherit" };

    private static CssIdent defaultValue = new CssIdent(VOLUME[3]);

    /**
     * Create a new ACssVoiceBalance
     */
    public ACssVoiceBalance() {
	value = defaultValue;
    }

    /**
     * Creates a new ACssVoiceBalance
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public ACssVoiceBalance(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	int index;

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val instanceof CssIdent) {
	    value = checkIdent(ac, (CssIdent) val);
	} else if (val instanceof CssNumber) {
	    CssNumber num = (CssNumber) val;
	    int i = (int) num.getValue();
	    if (i < 0) {
		value = new CssNumber(ac, 0);
	    } else if (i > 100) {
		value = new CssNumber(ac, 100);
	    } else {
		value = val;
	    }
	    expression.next();
	} else {
	    throw new InvalidParamException("value",
					    expression.getValue().toString(),
					    getPropertyName(), ac);
	}

	expression.next();
    }

    public ACssVoiceBalance(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }


    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }

    /**
     * Returns some usable value of this property...
     *
     * @deprecated
     */
    public float getValue() { // vm
	return ((CssNumber) value).getValue();
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "voice-balance";
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssVoiceBalance != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssVoiceBalance = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof ACssVoiceBalance &&
		value.equals(((ACssVoiceBalance) property).value));
    }

    private CssIdent checkIdent(ApplContext ac, CssIdent ident)
	throws InvalidParamException {

	int hash = ident.hashCode();
	for (int i = 0; i < VOLUME.length; i++) {
	    if (hash_values[i] == hash) {
		return ident;
	    }
	}

	throw new InvalidParamException("value", ident.toString(),
					getPropertyName(), ac);
    }

    /** @deprecated */
    private CssPercentage ValueOfIdent(ApplContext ac, CssIdent ident)
	throws InvalidParamException {

	int hash = ident.hashCode();
	for (int i = 0; i < VOLUME.length; i++) {
	    if (hash_values[i] == hash) {
		return new CssPercentage(ACssProperties.getValue(this, VOLUME[i]));
	    }
	}

	throw new InvalidParamException("value", ident.toString(),
					getPropertyName(), ac);
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getVoiceBalance();
	} else {
	    return ((ACssStyle) style).acssVoiceBalance;
	}
    }

    static {
	hash_values = new int[VOLUME.length];
	for (int i = 0; i < VOLUME.length; i++)
	    hash_values[i] = VOLUME[i].hashCode();
    }
}


--- NEW FILE: ACssSpeakDate.java ---
//
// $Id: ACssSpeakDate.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssSpeakDate.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 */

package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 * <H3>&nbsp;&nbsp 'speak-date'</H3>
 * <P>
 * <EM>Value: </EM> myd | dmy | ymd <BR>
 * <EM>Initial:</EM> (Browser-specific)<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <p>This is a request about how any
 * dates should be spoken. month-day-year is common in the USA, while
 * day-month-year is common in Europe and year-month-day is also used.

 * <p class=comment>This would be most useful when combined with a new
 * HTML tag used to identify dates, such as this theoretical example:
 *
 * <pre>
 *    &lt;p&gt;The campaign started on &lt;date value="1874-oct-21"&gt;
 *    the twenty-first of that month&lt;/date&gt; and finished 
 *    &lt;date value="1874-oct-28"&gt;a week later&lt;/date&gt;
 * </pre>
 *
 *
 * @version $Revision: 1.1 $
 */
public class ACssSpeakDate extends ACssProperty {
    
    CssValue value;
    
    /**
     * Create a new ACssSpeakDate
     */  
    public ACssSpeakDate() {
	value = myd; // browser specific
    }
    
    /**
     * Creates a new ACssSpeakDate
     *
     * @param expression the expression of the size
     * @exception InvalidParamException The expression is incorrect
     */  
    public ACssSpeakDate(ApplContext ac, CssExpression expression, boolean check) 
    throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	
	if (val.equals(dmy)) {
	    value = dmy;
	    expression.next();
	    return;
	} else if (val.equals(ymd)) {
	    value = ymd;
	    expression.next();
	    return;
	} else if (val.equals(myd)) {
	    value = myd;
	    expression.next();
	    return;
	}
	
	throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
    }
    
    public ACssSpeakDate(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */  
    public Object get() {
	return value;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "speak-date";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssSpeakDate != null)
	    ((ACssStyle) style).addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssSpeakDate = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssSpeakDate && 
		value.equals(((ACssSpeakDate) property).value));
    }
    
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getSpeakDate();
	} else {
	    return ((ACssStyle) style).acssSpeakDate;
	}
    }
    
    private static CssIdent myd = new CssIdent("myd");
    private static CssIdent dmy = new CssIdent("dmy");
    private static CssIdent ymd = new CssIdent("ymd");
}

--- NEW FILE: ACssPause.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssVoicePitchRange.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssSpeakNumeral.java ---
//
// $Id: ACssSpeakNumeral.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssSpeakNumeral.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 */

package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 * <H3> &nbsp;&nbsp 'speak-numeral'</H3>
 * <P>
 * <EM>Value: </EM> digits | continous | none<BR>
 * <EM>Initial:</EM> none<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> NA
 *
 *
 * @version $Revision: 1.1 $
 */
public class ACssSpeakNumeral extends ACssProperty {
    
    CssValue value;
    
    private static CssIdent none = new CssIdent("none");
    private static CssIdent digits = new CssIdent("digits");
    private static CssIdent continuous = new CssIdent("continuous");

    /**
     * Create a new ACssSpeakNumeral
     */  
    public ACssSpeakNumeral() {
	value = none;
    }
    
    /**
     * Creates a new ACssSpeakNumeral
     *
     * @param expression the expression of the size
     * @exception InvalidParamException The expression is incorrect
     */  
    public ACssSpeakNumeral(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	} else if (val.equals(none)) {
	    value = none;
	    expression.next();
	    return;
	} else if (val.equals(continuous)) {
	    value = continuous;
	    expression.next();
	    return;
	} else if (val.equals(digits)) {
	    value = digits;
	    expression.next();
	    return;
	}
	
	throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
    }
    
    public ACssSpeakNumeral(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */  
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "speak-numeral";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssSpeakNumeral != null)
	    ((ACssStyle) style).addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssSpeakNumeral = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssSpeakNumeral && 
		value.equals(((ACssSpeakNumeral) property).value));
    }
    
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getSpeakNumeral();
	} else {
	    return ((ACssStyle) style).acssSpeakNumeral;
	}
    }
    
}

--- NEW FILE: ACssVoiceFamilyCSS3.java ---
//
// $Id: ACssVoiceFamilyCSS3.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssVoiceFamilyCSS3.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.2  2005/08/08 13:18:04  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/07/28 14:20:12  sijtsche
 * new CSS3 speech property
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.1  1997/08/25 13:40:59  plehegar
 * Initial revision
 *
 */

package org.w3c.css.properties.aural;

import java.util.Enumeration;
import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.util.Util;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssString;
import org.w3c.css.values.CssValue;

/**
 * <H3>5.2 &nbsp;&nbsp;   'voice-family'</H3>
 * <P>
 * <EM>Value:</EM>  [[&lt;specific-voice&gt; | &lt;generic-voice&gt;],]*
 * [&lt;specific-voice&gt; | &lt;generic-voice&gt;]<BR>
 * <EM>Initial:</EM> UA <BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <P>The value is a prioritized list of voice family names (compare
 * with '<a
 * href="/pub/WWW/TR/REC-CSS1##font-family">font-family</a>'. Suggested
 * genric families: male, female, child.
 *
 * <P>Examples of specific voice families are: comedian, trinoids, carlos, lisa
 *
 * <p>Examples
 *
 * <pre>
 *   H1 { voice-family: announcer, male }
 *   P.part.romeo {  voice-family: romeo, male }
 *   P.part.juliet { voice-family: juliet, female }
 * </pre>
 *
 * <p class=comment>Should the properties of these family names be
 * described, using an @-rule, to allow better client-side matching (like
 * fonts). If so, what are the values that describe these voice families
 * in a way that is independent of speech synthesizer?
 *
 * @version $Revision: 1.1 $
 */
public class ACssVoiceFamilyCSS3 extends ACssProperty implements CssOperator {

    Vector family_name = new Vector();
    boolean inheritValue;

    static String[] genericFamily = { "male", "female" };
    static String[] age = { "child", "young", "old" };

    static int[] genericFamilyHash;

    boolean withSpace = false;

    /**
     * Create a new ACssVoiceFamilyCSS3
     */
    public ACssVoiceFamilyCSS3() {
	// depends on user agent
    }

    /**
     * Create a new ACssVoiceFamilyCSS3
     * @param value the voice name
     * @exception InvalidParamException The expression is incorrect
     */
    public ACssVoiceFamilyCSS3(ApplContext ac, CssExpression value,
	    boolean check) throws InvalidParamException {
	boolean family = true;
	CssValue val = value.getValue();
	char op;
	//@@ and if name is already in the vector ?

	setByUser();
	if (val.equals(inherit)) {
	    if(check && value.getCount() > 1) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    inheritValue = true;
	    return;
	}

	while (family) {
	    val = value.getValue();
	    op = value.getOperator();

	    if ((op != COMMA) && (op != SPACE)) {
			throw new InvalidParamException("operator",
						(new Character(op)).toString(), ac);
	    }

	    if(val != null && val.equals(inherit)) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    
	    if (val instanceof CssString) {								//specific voice
			String familyName = null;
			if (op == COMMA) { // "helvetica", "roman"
			    familyName = trimToOneSpace(val.toString());
			    value.next();
			} else { // "helvetica" CssValue
			    familyName = trimToOneSpace(val.toString());
			    family = false;
			    value.next();
			}
			if (familyName.length() > 2) {
			    String tmp = familyName.substring(1, familyName.length()-1);
			    for (int i = 0; i < genericFamily.length; i++) {
					if (genericFamily[i].equals(tmp)) {
					    throw new InvalidParamException("generic-family.quote",
								    genericFamily[i],
								    getPropertyName(),
								    ac);
					}
			    }
			}

			family_name.addElement(familyName);

	    } else if (val instanceof CssIdent) {
			if (op == COMMA) {												//specific voice
			    family_name.addElement(val.toString());
			    value.next();
			} else {														//AGE or generic voice, optionally followed by a number
		    	String familydesc = null;

		    	int valuecount = value.getCount();

		    	if (val != null && val instanceof CssIdent) {
					// @@ null and instanceof

					boolean ageok = false;
					for (int i=0; i < age.length; i++) {					//age optional
						if (age[i].equals(val.toString())) {
							familydesc = age[i];
							ageok = true;
							break;
						}
					}

					if (ageok) {
						value.next();
						val = value.getValue();
    					op = value.getOperator();
					}

					if (op == SPACE) {

						boolean genericfamok = false;
						for (int i=0; i < genericFamily.length; i++) {			// generic voice (male or female)
							if (genericFamily[i].equals(val.toString())) {
								familydesc += " " + genericFamily[i];
								genericfamok = true;
								break;
							}
						}

						if (!genericfamok) {
							family_name.addElement(val.toString());
							family = false;
							break;
						}

						// optional number

						if (op == SPACE && !value.end()) {

							val = value.getNextValue();
							op = value.getOperator();

							if (val != null) {
								try {
									Integer tmp = new Integer(val.toString());
									familydesc += " " + val.toString();
								} catch (NumberFormatException e) {
									throw new InvalidParamException("value", val.toString(),
											getPropertyName(), ac);
								}

								if (op != COMMA) {
									family = false;
								}
							} else {
								family = false;
							}
						} else {
							family = false;
						}

					} else {
						throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
					}

					family_name.addElement(familydesc);

		    	} else {
					family_name.addElement(val.toString());					//specific voice
					value.next();
					family = false;
		    	}
			}
	    } else {
			throw new InvalidParamException("value", val.toString(),
						getPropertyName(), ac);
	    }
	}

    }

    public ACssVoiceFamilyCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns all voices name
     */
    public Enumeration elements() {
	return family_name.elements();
    }

    /**
     * Returns the size
     */
    public int size() {
	return family_name.size();
    }

    /**
     * Returns the voice (null if no voice)
     */
    public Object get() {
	if (family_name.size() == 0) {
	    return null;
	}
	return family_name.firstElement();
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return inheritValue;
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (inheritValue) {
	    return inherit.toString();
	} else {

	    String r = "";
	    for (Enumeration e = elements(); e.hasMoreElements();)
		//		r += ", " + e.nextElement().toString();
		r += ", " + e.nextElement().toString();
	    if (r.length() < 3) {
		return null;
	    }
	    return r.substring(2);
	}
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "voice-family";
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssVoiceFamilyCSS3 != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssVoiceFamilyCSS3 = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return false; //@@ FIXME
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getVoiceFamilyCSS3();
	} else {
	    return ((ACssStyle) style).acssVoiceFamilyCSS3;
	}
    }

    private static String trimToOneSpace(String name) {
	int count = name.length();
	char[] dst = new char[count];
	char[] src = new char[count];
	int index = -1;

	name.getChars(0, count, src, 0);
	for(int i=0; i < count; i++)
	    if ( i == 0 || ! Util.isWhiteSpace(src[i]) ||
		 ( Util.isWhiteSpace(src[i]) && !Util.isWhiteSpace(dst[index]) ) )
		dst[++index] = src[i];

	return new String(dst, 0, index+1);
    }

    /**
     * Returns true if this property contains a generic family name
     */
    public boolean containsGenericFamily() {
	if (family_name.size() == 0) {
	    return true;
	} else {
	    for (Enumeration e = family_name.elements();
		 e.hasMoreElements();) {
		int hash = ((String) e.nextElement()).toLowerCase().hashCode();
		for (int i = 0; i < genericFamilyHash.length; i++) {
		    if (hash == genericFamilyHash[i])
			return true;
		}
	    }
	    return false;
	}
    }


    static {
	genericFamilyHash = new int[genericFamily.length];
	for (int i = 0; i < genericFamily.length; i++) {
	    genericFamilyHash[i] = genericFamily[i].hashCode();
	}
    }
}

--- NEW FILE: ACssInterpretAs.java ---
//
// $Id: ACssInterpretAs.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssInterpretAs.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.2  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/07/30 06:34:52  sijtsche
 * new speech property
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.6  1997/08/25 13:52:36  plehegar
 * Added getValue()
 *
 * Revision 1.5  1997/08/22 15:00:35  plehegar
 * Bugs
 *
 * Revision 1.4  1997/08/22 14:58:25  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.3  1997/08/21 21:13:38  plehegar
 * Added time
 *
 * Revision 1.2  1997/08/21 14:34:19  vmallet
 * Minor modifications so we could compile it.
 *
 * Revision 1.1  1997/08/14 12:58:48  plehegar
 * Initial revision
 *
 */

package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssDate;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssTime;
import org.w3c.css.values.CssValue;

/**

 *
 * @version $Revision: 1.1 $
 */
public class ACssInterpretAs extends ACssProperty {

    CssValue value;

    private static CssTime defaultValue;

	private static String[] interpretas = { "currency", "measure", "telephone", "address", "name", "net" };

    /**
     * Create a new ACssInterpretAs
     */
    public ACssInterpretAs() {
	// Initial is User Agent Specific
	if (defaultValue == null) {
	    defaultValue = new CssTime(ACssProperties.getValue(this, "default"));
	}
	value = defaultValue;
    }

    /**
     * Creates a new ACssInterpretAs
     *
     * @param expression the expression of the size
     * @exception InvalidParamException The expression is incorrect
     */
    public ACssInterpretAs(ApplContext ac, CssExpression expression, 
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	
	setByUser();
	
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	} else if (val instanceof CssTime) {
	    float num = ((Float) val.get()).floatValue();
	    if (num < 0) {
		throw new InvalidParamException("negative-value",
			val.toString(), ac);
	    }
	    value = val;
	    expression.next();
	    return;
	} else if (val instanceof CssDate) {
	    value = val;
	    expression.next();
	    return;
	} else if (val instanceof CssIdent) {
	    for (int i=0; i < interpretas.length; i++) {
		if (val.toString().equals(interpretas[i])) {
		    value = val;
		    expression.next();
		    return;
		}
	    }
	}
	
	throw new InvalidParamException("value", val.toString(),
		getPropertyName(), ac);
    }
    
    public ACssInterpretAs(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */
    public Object get() {
	return value;
    }

    /**
     * Returns some usable value of this property...
     */
    public int getValue() { // vm
	return ((Float) value.get()).intValue();
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (value != null)
	    return value.toString();
	else
	    return null;
    }


    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "interpret-as";
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssInterpretAs != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssInterpretAs = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	if (value != null) {
	    return (property instanceof ACssInterpretAs &&
		    value.equals(((ACssInterpretAs) property).value));
	} else {
	    return false;
	}
    }
    
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getInterpretAs();
	} else {
	    return ((ACssStyle) style).acssInterpretAs;
	}
    }

}

--- NEW FILE: ACssPlayDuring.java ---
//
// $Id: ACssPlayDuring.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssPlayDuring.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.1  1997/08/25 13:03:48  plehegar
 * Initial revision
 *
 * Revision 1.6  1997/08/22 15:00:09  plehegar
 * Bugs
 *
 * Revision 1.5  1997/08/22 14:57:32  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.4  1997/08/21 21:13:25  plehegar
 * Added time
 *
 * Revision 1.3  1997/08/21 14:34:56  vmallet
 * Minor modifications so we could compile it.
 *
 * Revision 1.2  1997/08/14 13:19:05  plehegar
 * Added ACssPauseBefore(ACssPauseBefore)
 *
 * Revision 1.1  1997/08/14 12:58:44  plehegar
 * Initial revision
 *
 */

package org.w3c.css.properties.aural;

import java.io.IOException;
import java.net.URL;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 *  &nbsp;&nbsp;'play-during'
 *
 * <P>
 * <EM>Value: </EM> &lt;url&gt; mix? repeat? | auto | none<BR>
 * <EM>Initial:</EM> auto<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> no<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <p>Similar to the cue-before and cue-after properties, this indicates
 * sound to be played during an element as a background (ie the sound is
 * mixed in with the speech). 
 *
 * <p>The optional 'mix' keyword means the sound inherited from the parent
 * element's play-during property continues to play and the current
 * element sound (pointed to by the URL) is mixed with it. If mix is not
 * specified, the sound replaces the sound of the parent element. 
 *
 * <p>The optional 'repeat' keyword means the sound will repeat if it is
 * too short to fill the entire duration of the element. Without this
 * keyword, the sound plays once and then stops. Thuis is similar to the
 * background repeat properties in CSS1. If the sound is too long for the
 * element, it is clipped once the element is spoken.
 *
 * <p>Auto
 * means that the sound of the parent element continues to play 
 * (it is not restarted, which would have been the case if
 * this property inherited)and none means that there is silence -
 * the sound of the parent element (if any) is silent for the current
 * element and continues after the current element.
 *
 * <!-- cut for now <p class=comment>What happens with mixed-mode
 * rendering if an element is displayed onscreen rather than being
 * spoken, yet has a play-during property? Do we need a property that
 * switches between visual, aural, and other modes on a per-element
 * basis? Need synchronised multimedia feedback on this.  --> <!-- volume
 * wrt speech?? fade in and out? -->
 *
 *
 * <p> Examples:
 * <PRE>
 *   BLOCKQUOTE.sad {play-during: url(violins.aiff) }
 *   BLOCKQUOTE Q {play-during: url(harp.wav) mix}
 *   SPAN.quiet {play-during: none }
 * </pre>
 *
 * <p><b>Note:</b> If a stereo icon is dereferenced the central point of
 * the stereo pair should be placed at the azimuth for that element and
 * the left and right channels should be placed to either side of this
 * position.
 *
 * @version $Revision: 1.1 $
 */
public class ACssPlayDuring extends ACssProperty implements CssOperator {
    
    CssValue value;
    boolean mix;
    boolean repeat;
    
    private URL url;  
    
    private static CssIdent NONE = new CssIdent("none");
    private static CssIdent AUTO = new CssIdent("auto");
    private static CssIdent MIX = new CssIdent("mix");
    private static CssIdent REPEAT = new CssIdent("repeat");

    /**
     * Create a new ACssPlayDuring
     */  
    public ACssPlayDuring() {
	value = AUTO;
    }
    
    /**
     * Creates a new ACssPlayDuring
     * @param expression the expression of the size
     * @exception InvalidParamException The expression is incorrect
     */  
    public ACssPlayDuring(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	int valuesNb = expression.getCount();
	
	if(check && valuesNb > 3) {
	    throw new InvalidParamException("unrecognize", ac);	    
	}
	
	CssValue val = expression.getValue();		
	
	if (val instanceof CssURL) {
	    this.value = val;	    
	    if (valuesNb == 3) {
		if (expression.getOperator() != SPACE) {
		    throw new InvalidParamException("operator", 
			    (new Character(expression.getOperator()).toString()),
			    ac);
		}
		expression.next();
		if (expression.getOperator() != SPACE) {
		    throw new InvalidParamException("operator", 
			    (new Character(expression.getOperator()).toString()),
			    ac);
		}
		val = expression.getValue();
		if (!val.equals(MIX) && !val.equals(REPEAT)) {
		    throw new InvalidParamException("few-value", 
			    getPropertyName(), ac);
		}
		else if(!val.equals(MIX)) {
		    mix = true;
		}
		else { // val = REPEAT
		    repeat = true;
		}
		expression.next();
		val = expression.getValue();
		if (mix && val.equals(REPEAT)) {
		    repeat = true;
		}
		else if(repeat && val.equals(MIX)) {
		    mix = true;
		}
		else {
		    throw new InvalidParamException("unrecognize", ac);
		}
	    } else if (valuesNb == 2) {
		if (expression.getOperator() != SPACE) {
		    throw new InvalidParamException("operator", 
			    (new Character(expression.getOperator()).toString()),
			    ac);
		}
		expression.next();
		val = expression.getValue();
		if (val.equals(MIX)) {
		    mix = true;
		} else if (val.equals(REPEAT)) {
		    repeat = true;
		} else {
		    throw new InvalidParamException("unrecognize", ac);
		}
	    }
	    expression.next();
	    return;
	} else if (val.equals(inherit)) {
	    if(check && valuesNb > 1) {
		throw new InvalidParamException("unrecognize", ac);	    
	    }
	    this.value = inherit;
	    expression.next();
	    return;
	} else if (val.equals(NONE)) {
	    if(check && valuesNb > 1) {
		throw new InvalidParamException("unrecognize", ac);	    
	    }
	    this.value = NONE;
	    expression.next();
	    return;
	} else if (val.equals(AUTO)) {
	    if(check && valuesNb > 1) {
		throw new InvalidParamException("unrecognize", ac);	    
	    }
	    this.value = AUTO;
	    expression.next();
	    return;
	}
	
	throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
    }
    
    public ACssPlayDuring(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */  
    public Object get() {
	return value;
    }
    
    /**
     * Returns some usable value of this property...
     */
    public URL getValue() throws IOException { // vm
	if (value == NONE || value == AUTO || value == inherit)
	    return null;
	else {
	    if (url == null) {
		url = new URL((String) value.get());
	    }
	    return url;
	}
    }
    
    /**
     * The optional 'mix' keyword means the sound inherited from the parent
     * element's play-during property continues to play and the current
     * element sound (pointed to by the URL) is mixed with it. If mix is not
     * specified, the sound replaces the sound of the parent element. 
     */  
    public boolean isMix() {
	return mix;
    }
    
    /**
     * The optional 'repeat' keyword means the sound will repeat if it is
     * too short to fill the entire duration of the element. Without this
     * keyword, the sound plays once and then stops. Thuis is similar to the
     * background repeat properties in CSS1. If the sound is too long for the
     * element, it is clipped once the element is spoken.
     */  
    public boolean isRepeat() {
	return repeat;
    }
    
    /**
     * 'auto' means that the sound of the parent element continues to play 
     * (it is not restarted, which would have been the case if
     * this property inherited).
     */  
    public boolean isAuto() {
	return value == AUTO;
    }
    
    /**
     * 'none' means that there is silence.
     * the sound of the parent element (if any) is silent for the current
     * element and continues after the current element.
     */  
    public boolean isNone() {
	return value == NONE;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (value == NONE || value == AUTO || value == inherit) {
	    return value.toString();
	} else {
	    String ret = value.toString();
	    if (mix)
		ret += " mix";
	    if (repeat)
		ret += " repeat";
	    return ret;
	}
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "play-during";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssPlayDuring != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssPlayDuring = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssPlayDuring && 
		value.equals(((ACssPlayDuring) property).value));
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getPlayDuring();
	} else {
	    return ((ACssStyle) style).acssPlayDuring;
	}
    }    
}

--- NEW FILE: Makefile ---
SRCS = ACssPauseAfter.java ACssProperty.java\
ACssCue.java ACssPauseBefore.java ACssSpeechRate.java\
ACssCueAfter.java ACssPitch.java ACssStyle.java\
ACssCueBefore.java ACssPlayDuring.java ACssVoiceFamily.java\
ACssPause.java ACssProperties.java ACssVolume.java\
ACssSpeakPunctuation.java ACssSpeakDate.java\
ACssSpeakNumeral.java ACssSpeakTime.java\
ACssRichness.java ACssStress.java\
ACssPitchRange.java ACssElevation.java\
ACssAzimuth.java

OBJS = $(SRCS:.java=.class)

PACKAGE = org.w3c.css.aural
JAVAC = javac
JAVADOC = javadoc
JAVADOCFLAGS = -version -d docs -protected
JAVACFLAGS = 
MAKEDEPEND = jmakedepend

.SUFFIXES: .class .java
.java.class:; $(JAVAC) $(JAVACFLAGS) $<

all: $(OBJS)

javadoc:; $(JAVADOC) $(JAVADOCFLAGS) $(PACKAGE)

clean:; -rm -f $(OBJS) *~ core

depend:; $(MAKEDEPEND) $(SRCS)

# DO NOT DELETE THIS LINE -- make depend depends on it.
ACssPitchRange.class:: ACssPitchRange.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssNumber.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssProperty.class:: ACssProperty.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class
ACssCueBefore.class:: ACssCueBefore.java\
	/usr/local/java11/bin/../lib/classes.zip\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssURL.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class
ACssSpeakDate.class:: ACssSpeakDate.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssPitch.class:: ACssPitch.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssFrequency.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssRichness.class:: ACssRichness.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssNumber.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssPauseBefore.class:: ACssPauseBefore.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssNumber.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssTime.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssPercentage.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssSpeechRate.class:: ACssSpeechRate.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssNumber.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssStyle.class:: ACssStyle.java\
	/usr/local/java11/bin/../lib/classes.zip\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/Warnings.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/Warning.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssPrinterStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/Css1Style.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssPercentage.class
ACssPlayDuring.class:: ACssPlayDuring.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssURL.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssOperator.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class\
	/usr/local/java11/bin/../lib/classes.zip
ACssProperties.class:: ACssProperties.java\
	/usr/local/java11/bin/../lib/classes.zip\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class
ACssSpeakPunctuation.class:: ACssSpeakPunctuation.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssPauseAfter.class:: ACssPauseAfter.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssTime.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssNumber.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssPercentage.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssStress.class:: ACssStress.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssNumber.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssCueAfter.class:: ACssCueAfter.java\
	/usr/local/java11/bin/../lib/classes.zip\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssURL.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class
ACssAzimuth.class:: ACssAzimuth.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssNumber.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssAngle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssElevation.class:: ACssElevation.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssNumber.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssAngle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssVoiceFamily.class:: ACssVoiceFamily.java\
	/usr/local/java11/bin/../lib/classes.zip\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssOperator.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssString.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/Util.class
ACssSpeakNumeral.class:: ACssSpeakNumeral.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssCue.class:: ACssCue.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssSelectors.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssPrinterStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssOperator.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssVolume.class:: ACssVolume.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssNumber.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssPercentage.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssPause.class:: ACssPause.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssSelectors.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssPrinterStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssOperator.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class
ACssSpeakTime.class:: ACssSpeakTime.java\
	/u/koala/0/koala/plehegar/old/org.w3c.css.parser/CssStyle.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssExpression.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssValue.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssIdent.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.values/CssNumber.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.properties/CssProperty.class\
	/u/koala/0/koala/plehegar/old/org.w3c.css.util/InvalidParamException.class

--- NEW FILE: ACssCueAfter.java ---
//
// $Id: ACssCueAfter.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssCueAfter.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.2  1997/08/26 14:26:55  plehegar
 * Bug in getValue()
 *
 * Revision 1.1  1997/08/25 13:03:54  plehegar
 * Initial revision
 *
 * Revision 1.6  1997/08/22 15:00:09  plehegar
 * Bugs
 *
 * Revision 1.5  1997/08/22 14:57:32  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.4  1997/08/21 21:13:25  plehegar
 * Added time
 *
 * Revision 1.3  1997/08/21 14:34:56  vmallet
 * Minor modifications so we could compile it.
 *
 * Revision 1.2  1997/08/14 13:19:05  plehegar
 * Added ACssPauseAfter(ACssPauseBefore)
 *
 * Revision 1.1  1997/08/14 12:58:44  plehegar
 * Initial revision
 *
 */

package org.w3c.css.properties.aural;

import java.io.IOException;
import java.net.URL;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.HTTPURL;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 * &nbsp;&nbsp;  'cue-after'
 *
 * <P>
 * <EM>Value: </EM> &lt;url&gt; | none<BR>
 * <EM>Initial:</EM> none<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> no<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <P>Auditory icons are another way to distinguish semantic
 * elements. Sounds may be played before, and/or after the element to
 * delimit it. The same sound can be used both before and after, using the
 * shorthand 'cue' property.
 *
 * <p> Examples:
 * <PRE>
 *   A {cue-before: url(bell.aiff); cue-after: url(dong.wav) }
 *   H1 {cue-before: url(pop.au); cue-after: url(pop.au) }
 *   H1 {cue: url(pop.au) }  / * same as previous * /
 * </pre>
 *
 * <p class=comment>The <tt>:before</tt> and <tt>:after</tt>
 * pseudo-elements (see frostings document) could be used to generate
 * this content, rather than using two special-purpose properties. This
 * would be more general.</p>
 *
 * @version $Revision: 1.1 $
 */
public class ACssCueAfter extends ACssProperty {
    
    CssValue value;
    
    private URL url;
    private static CssIdent none = new CssIdent("none");

    /**
     * Create a new ACssCueAfter
     */  
    public ACssCueAfter() {
	value = none;
    }
    
    /**
     * Create a new ACssCueAfter
     */  
    public ACssCueAfter(ACssCueBefore cueBefore) {
	value = cueBefore.value;
    }
    
    /**
     * Creates a new ACssCueAfter
     * @param value the value of the size
     * @exception InvalidParamException The value is incorrect
     */  
    public ACssCueAfter(ApplContext ac, CssExpression value, boolean check)
    	throws InvalidParamException {
	
	if(check && value.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = value.getValue();
	
	if (val instanceof CssURL) {
	    this.value = val;
	    value.next();
	    return;
	} else if (val.equals(inherit)) {
	    this.value = inherit;
	    value.next();
	    return;
	} else if (val.equals(none)) {
	    this.value = none;
	    value.next();
	    return;
	}
	
	throw new InvalidParamException("value", val.toString(), 
					getPropertyName(), ac);
    }
    
    public ACssCueAfter(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */  
    public Object get() {
	if (value == none)
	    return null;
	else
	    return value;
    }
    
    
    /**
     * Returns some usable value of this property...
     */
    public URL getValue() throws IOException { // vm
	if (value == none)
	    return null;
	else {
	    if (url == null) {
		url = HTTPURL.getURL(new URL(sourceFile), (String) value.get());
	    }
	    return url;
	}
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "cue-after";
    }
    
    public void addToStyle(ApplContext ac, CssStyle style) {
	ACssCue acssCue = ((ACssStyle) style).acssCue;
	if (acssCue.cueAfter != null)
	    style.addRedefinitionWarning(ac, this);
	acssCue.cueAfter = this;
    }
    
    public boolean equals(CssProperty property) {
	return (property instanceof ACssCueAfter && value.equals(((ACssCueAfter) property).value));
    }
    
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getCueAfter();
	} else {
	    return ((ACssStyle) style).acssCue.cueAfter;
	}
    }
    
}

--- NEW FILE: ACssCue.java ---
//
// $Id: ACssCue.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssCue.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.3  1997/08/26 14:25:43  plehegar
 * Bug
 * Added setSelectors()
 *
 * Revision 1.2  1997/08/25 13:27:40  plehegar
 * Minor bug
 *
 * Revision 1.1  1997/08/25 13:04:31  plehegar
 * Initial revision
 *
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssPrinterStyle;
import org.w3c.css.parser.CssSelectors;
import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;


/**
 * &nbsp;&nbsp;  'cue'
 *
 * <P>
 * <EM>Value: </EM> &lt;'cue-before'&gt; || &lt;'cue-before'&gt;<BR>
 * <EM>Initial:</EM> none<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> no<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <P>Auditory icons are another way to distinguish semantic
 * elements. Sounds may be played before, and/or after the element to
 * delimit it. The same sound can be used both before and after, using the
 * shorthand 'cue' property.
 *
 * <p> Examples:
 * <PRE>
 *   A {cue-before: url(bell.aiff); cue-after: url(dong.wav) }
 *   H1 {cue-before: url(pop.au); cue-after: url(pop.au) }
 *   H1 {cue: url(pop.au) }  / * same as previous * /
 * </pre>
 *
 * <p class=comment>The <tt>:before</tt> and <tt>:after</tt>
 * pseudo-elements (see frostings document) could be used to generate
 * this content, rather than using two special-purpose properties. This
 * would be more general.</p>
 *
 * @version $Revision: 1.1 $
 */
public class ACssCue extends ACssProperty implements CssOperator {
    
    ACssCueBefore cueBefore;
    ACssCueAfter cueAfter;
    
    boolean same;
    
    /**
     * Create a new ACssCue
     */
    public ACssCue() {
    }  
    
    /**
     * Create a new ACssCue
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public ACssCue(ApplContext ac, CssExpression expression, boolean check)
    	throws InvalidParamException {
	switch (expression.getCount()) {
	case 1:
	    same = true;
	    cueBefore = new ACssCueBefore(ac, expression);
	    cueAfter = new ACssCueAfter(cueBefore);
	    break;
	case 2:
	    if (expression.getOperator() != SPACE) {
		throw new InvalidParamException("operator", 
			(new Character(expression.getOperator()).toString()),
			ac);
	    }
	    if(check && expression.getValue().equals(inherit)) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    cueBefore = new ACssCueBefore(ac, expression);
	    if(check && expression.getValue().equals(inherit)) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	    cueAfter = new ACssCueAfter(ac, expression);
	    break;
	default:
	    if(check) {
		throw new InvalidParamException("unrecognize", ac);
	    }
	}
    }
    
    public ACssCue(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return cueBefore;
    }
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "cue";
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	// cueBefore and cueAfter must be not null !
	if (same) {
	    return cueBefore.toString();
	} else {
	    return cueBefore + " " + cueAfter;
	}
    }
    
    /**
     * Set this property to be important.
     * Overrides this method for a macro
     */  
    public void setImportant() {
	super.setImportant();
	cueBefore.setImportant();
	cueAfter.setImportant();
    }
    
    /**
     * Returns true if this property is important.
     * Overrides this method for a macro
     */
    public boolean getImportant() {
	return ((cueAfter == null || cueAfter.getImportant()) &&
		(cueBefore == null || cueBefore.getImportant()));
    }
    
    /**
     * Print this property.
     *
     * @param printer The printer.
     * @see #toString()
     * @see #getPropertyName()
     */  
    public void print(CssPrinterStyle printer) {
	if ((cueBefore != null && cueAfter != null) &&
	    (getImportant() ||
	     (!cueBefore.getImportant() &&
	      !cueAfter.getImportant()))) {
	    printer.print(this);
	} else {
	    if (cueBefore != null)
		cueBefore.print(printer);
	    if (cueAfter != null && !same)
		cueAfter.print(printer);
	}
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	// cueBefore and cueAfter can't be null ...
	((ACssStyle) style).acssCue.same = same;
	cueBefore.addToStyle(ac, style);
	cueAfter.addToStyle(ac, style);
    }
    
    /**
     * Update the source file and the line.
     * Overrides this method for a macro
     *
     * @param line The line number where this property is defined
     * @param source The source file where this property is defined
     */  
    public void setInfo(int line, String source) {
	super.setInfo(line, source);
	// cueBefore and cueAfter can't be null ...
	cueBefore.setInfo(line, source);
	cueAfter.setInfo(line, source);
    }
    
    /**
     * Set the context.
     * Overrides this method for a macro
     *
     * @see org.w3c.css.css.CssCascadingOrder#order
     * @see org.w3c.css.css.StyleSheetParser#handleRule
     */
    public void setSelectors(CssSelectors selector) {
	super.setSelectors(selector);
	if (cueBefore != null) {
	    cueBefore.setSelectors(selector);
	}
	if (cueAfter != null) {
	    cueAfter.setSelectors(selector);
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return false; // ????
    }
    
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getCue();
	} else {
	    return ((ACssStyle) style).acssCue;
	}
    }
    
}

--- NEW FILE: ACssStyle.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssVolume.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssSpeak.java ---
//
// $Id: ACssSpeak.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssSpeak.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.5  1997/08/23 03:09:36  vmallet
 * Added the 'usable' getValue() method.
 *
 * Revision 1.4  1997/08/22 17:57:50  plehegar
 * Updated
 *
 * Revision 1.3  1997/08/22 17:12:31  plehegar
 * Added documentation
 *
 * Revision 1.2  1997/08/22 14:54:33  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.1  1997/08/20 18:41:36  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;


/**
 *  &nbsp;&nbsp; 'speak'
 *
 * @version $Revision: 1.1 $
 */
public class ACssSpeak extends ACssProperty {
    
    CssValue value;
    
    private static int[] hash_values;
    
    private static String[] SPEAK = { "normal", "none", "spell-out" };

    private static CssIdent defaultValue = new CssIdent(SPEAK[1]);
    
    /**
     * Create a new ACssSpeak
     */
    public ACssSpeak() {
	value = defaultValue;
    }  
    
    /**
     * Creates a new ACssSpeak
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public ACssSpeak(ApplContext ac, CssExpression expression, boolean check)
    	throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	int index;

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val instanceof CssIdent) {
	    value = checkIdent(ac, (CssIdent) val);
	} else {
	    throw new InvalidParamException("value", 
					    expression.getValue().toString(), 
					    getPropertyName(), ac);
	}

	expression.next();
    }
    
    public ACssSpeak(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "speak";
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssSpeak != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssSpeak = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssSpeak && 
		value.equals(((ACssSpeak) property).value));
    }
    
    private CssIdent checkIdent(ApplContext ac, CssIdent ident) 
	throws InvalidParamException {
	
	int hash = ident.hashCode();
	for (int i = 0; i < SPEAK.length; i++) {
	    if (hash_values[i] == hash) {
		return ident;
	    }
	}
	
	throw new InvalidParamException("value", ident.toString(), 
					getPropertyName(), ac);
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getSpeak();
	} else {
	    return ((ACssStyle) style).acssSpeak;
	}
    }
    
    static {
	hash_values = new int[SPEAK.length];
	for (int i = 0; i < SPEAK.length; i++)
	    hash_values[i] = SPEAK[i].hashCode();
    }
}


--- NEW FILE: ACssPitchRange.java ---
//
// $Id: ACssPitchRange.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssPitchRange.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;


/**
 * <H3> &nbsp;&nbsp; 'pitch-range' <span class="notes">(could be
 * combined with 'pitch' ?) or 'inflection'</span></H3>
 *
 * <P>
 * <EM>Value: </EM>&lt;number&gt;|inherit<BR>
 * <em>Initial:</EM>50%<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> relative to..
 *
 * <p>Specifies variation in average pitch. A pitch range of 0% produces
 * a flat, monotonic voice. A pitch range of 50% produces normal
 * inflection.  Pitch ranges greater than 50% produce animated voices.
 *
 *
 * @version $Revision: 1.1 $
 */
public class ACssPitchRange extends ACssProperty {
    
    CssValue value;
    
    static CssValue DefaultValue = new CssNumber(null, 50);
    
    /**
     * Create a new ACssPitchRange
     */
    public ACssPitchRange() {
	value = DefaultValue;
    }  
    
    /**
     * Creates a new ACssPitchRange
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public ACssPitchRange(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	int index;
	
	setByUser();
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	} else if (val instanceof CssNumber) {
	    float f = ((CssNumber) val).getValue();
	    if ((f < 0) || (f > 100)) {		
		throw new InvalidParamException("range", null, ac);
	    }
	    value = val;
	    expression.next();
	    return;
	}
	
	throw new InvalidParamException("value", 
					expression.getValue().toString(), 
					getPropertyName(), ac);
    }
    
    public ACssPitchRange(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "pitch-range";
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssPitchRange != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssPitchRange = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssPitchRange && 
		value.equals(((ACssPitchRange) property).value));
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getPitchRange();
	} else {
	    return ((ACssStyle) style).acssPitchRange;
	}
    }
    
}


--- NEW FILE: ACssVoicePitchRange.java ---
//
// $Id: ACssVoicePitchRange.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssVoicePitchRange.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.2  2005/08/08 13:18:04  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/07/28 14:56:30  sijtsche
 * new CSS3 speech property
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.1  1997/08/22 18:11:54  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFrequency;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  &nbsp;&nbsp; 'pitch' <span>(or 'average pitch'
 * ?, what is the relationship with voice-family?)</span>
 *
 * <P>
 * <EM>Value: </EM>&lt;hertz&gt; | x-low | low | medium | high | x-high<BR>
 * <EM>Initial:</EM> medium<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <p>Specifies the average pitch of the speaking voice in hertz (Hz).
 *
 * @version $Revision: 1.1 $
 */
public class ACssVoicePitchRange extends ACssProperty {

    CssValue value;


    private static int[] hash_values;

    private static String[] PITCH = { "low", "medium", "high" };

    private static CssIdent defaultValue = new CssIdent(PITCH[2]);

    /**
     * Create a new ACssVoicePitchRange
     */
    public ACssVoicePitchRange() {
	value = defaultValue;
    }

    /**
     * Creates a new ACssVoicePitchRange
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public ACssVoicePitchRange(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();

	setByUser();

	if (val.equals(inherit)) {
	    val = inherit;
	} else if (val instanceof CssIdent) {
	    value = checkIdent(ac,(CssIdent) val);
	} else if (val instanceof CssFrequency) {
	    value = val;
	} else {
	    throw new InvalidParamException("value",
					    expression.getValue().toString(),
					    getPropertyName(), ac);
	}

	expression.next();
    }

    public ACssVoicePitchRange(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }


    /**
     * Returns some usable value of this property...
     */
    public int getValue() { // vm
	return ((Float) value.get()).intValue();
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "voice-pitch-range";
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssVoicePitchRange != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssVoicePitchRange = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof ACssVoicePitchRange &&
		value.equals(((ACssVoicePitchRange) property).value));
    }

    private CssIdent checkIdent(ApplContext ac, CssIdent ident) throws InvalidParamException {
	int hash = ident.hashCode();
	for (int i = 0; i < PITCH.length; i++) {
	    if (hash_values[i] == hash) {
		return ident;
	    }
	}

	throw new InvalidParamException("value",
					ident.toString(),
					getPropertyName(), ac);
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getVoicePitchRange();
	} else {
	    return ((ACssStyle) style).acssVoicePitchRange;
	}
    }

    static {
	hash_values = new int[PITCH.length];
	for (int i = 0; i < PITCH.length; i++)
	    hash_values[i] = PITCH[i].hashCode();
    }
}


--- NEW FILE: ACssCueBefore.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssVoiceDuration.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssStress.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssSpeakTime.java ---
//
// $Id: ACssSpeakTime.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssSpeakTime.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 */

package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 * <H3> &nbsp;&nbsp 'speak-time'</H3>
 * <P>
 * <EM>Value: </EM> 24 | 12 | none<BR>
 * <EM>Initial:</EM> none<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> NA
 *
 * @version $Revision: 1.1 $
 */
public class ACssSpeakTime extends ACssProperty {
    
    CssValue value;
    
    /**
     * Create a new ACssSpeakTime
     */  
    public ACssSpeakTime() {
	value = none;
    }
    
    /**
     * Creates a new ACssSpeakTime
     *
     * @param expression the expression of the size
     * @exception InvalidParamException The expression is incorrect
     */  
    public ACssSpeakTime(ApplContext ac, CssExpression expression, boolean check) 
    throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}	
	
	CssValue val = expression.getValue();
	
	if (val.equals(none)) {
	    value = none;
	    expression.next();
	    return;
	} else if (val instanceof CssNumber) {
	    float v = ((Float) val.get()).floatValue();
	    if (v == 12 || v == 24) {
		value = val;
		expression.next();
		return;
	    }
	}
	
	throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
    }
    
    public ACssSpeakTime(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */  
    public Object get() {
	return value;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "speak-time";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssSpeakTime != null)
	    ((ACssStyle) style).addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssSpeakTime = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssSpeakTime && 
		value.equals(((ACssSpeakTime) property).value));
    }
    
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getSpeakTime();
	} else {
	    return ((ACssStyle) style).acssSpeakTime;
	}
    }
    
    private static CssIdent none = new CssIdent("none");
}

--- NEW FILE: ACssVolume.java ---
//
// $Id: ACssVolume.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssVolume.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:04  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.5  1997/08/23 03:09:36  vmallet
 * Added the 'usable' getValue() method.
 *
 * Revision 1.4  1997/08/22 17:57:50  plehegar
 * Updated
 *
 * Revision 1.3  1997/08/22 17:12:31  plehegar
 * Added documentation
 *
 * Revision 1.2  1997/08/22 14:54:33  plehegar
 * Added getPropertyInStyle()
 *
 * Revision 1.1  1997/08/20 18:41:36  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;


/**
 *  &nbsp;&nbsp; 'volume'
 *
 * <P>
 * <EM>Value:</EM> &lt;percentage&gt; | silent | x-soft | soft | medium | loud | x-loud<br>
 * <EM>Initial:</EM> medium<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> relative to user-specified mapping
 *
 * <P>The legal range of percentage values is 0% to 100%. Note that '0%'
 * <strong>does not mean the same as "silent"</strong>. 0% represents the
 * <em>minimum audible</em> volume level and 100% corresponds to the
 * <em>maximum comfortable</em> level. There is a fixed mapping between
 * keyword values and percentages:
 *
 * <UL>
 * <li>'silent' = no sound at all, the element is  spoken silently
 * <LI>'x-soft' = '0%'
 * <LI>'soft' = '25%'
 * <LI>'medium' = '50%'
 * <LI>'loud' = '75%'
 * <LI>'x-loud' = '100%'
 * </UL>
 *
 * <P>Volume refers to the median volume of the waveform. In other words,
 * a highly inflected voice at a volume of 50 might peak well above
 * that. The overall values are likely to be human adjustable
 * for comfort, for example with a physical volume control (which would
 * increase both the 0% and 100% values proportionately); what this
 * property does is adjust the dynamic range.
 *
 *
 * <p>The UA <em>should</em> allow the values corresponding to 0% and
 * 100% to be set by the listener. No one setting is universally
 * applicable; suitable values depend on the equipment in use (speakers,
 * headphones), the environment (in car, home theater, library) and
 * personal preferences. Some examples:
 *
 * <ul><li>A browser for in-car use has a setting for when there is lots
 * of background noise. 0% would map to a fairly high level and 100% to a
 * quite high level. The speech is easily audible over the road noise but
 * the overall dynamic range is compressed. Plusher cars with better
 * insulation allow a wider dynamic range.
 *
 *
 * <li>Another speech browser is being used in the home, late at night,
 * (don't annoy the neighbors) or in a shared study room. 0% is set to
 * a very quiet level and 100% to a fairly quiet level, too. As with the first
 * example, there is a low slope; the dynamic range is reduced. The
 * actual volumes are low here, wheras they were high in the first
 * example.
 *
 * <li>In a quiet and isolated house, an expensive hi-fi home theatre
 * setup. 0% is set fairly low and 100% to quite high; there is wide
 * dynamic range.
 * </ul>
 *
 * <p>The same authors stylesheet could be used in all cases, simply by
 * mapping the 0 and 100 points suitably at the client side.
 *
 * <p>If an element has a volume of silent, it is spoken silently. It
 * takes up the same time as if it had been spoken, including any pause
 * before and after the element, but no sound is generated. This may be
 * used in language teaching applications, for example. A pause is
 * gdenerated for the pupil to speak the element themselves. <b>Note:</b>
 * the value is inherited so child elements will also be silent.  Child
 * elements may however set the volume to a non-silent value and will
 * then be spoken.
 *
 * <p>To inhibit the speaking of an element and all it's children so that
 * it takes no time at all (for example, to get the effect of collapsing
 * and expanding lists) use the CSS1 property 'display' 
 *
 * <pre>display: none</pre>
 *
 * <p>When using the rule <tt>display: none</tt> the element takes up
 * <em>no time</em>; it is not represented as a pause the length of the
 * spoken text.
 *
 * @version $Revision: 1.1 $
 */
public class ACssVolume extends ACssProperty {
    
    CssValue value;
    
    private static int[] hash_values;
    
    private static String[] VOLUME = { "silent", "x-soft", "soft", 
				       "medium", "loud", "x-loud" };

    private static CssIdent defaultValue = new CssIdent(VOLUME[3]);
    
    /**
     * Create a new ACssVolume
     */
    public ACssVolume() {
	value = defaultValue;
    }  
    
    /**
     * Creates a new ACssVolume
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public ACssVolume(ApplContext ac, CssExpression expression, boolean check)
    	throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	//int index;

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val instanceof CssIdent) {
	    value = checkIdent(ac, (CssIdent) val);
	} else if (val instanceof CssPercentage) {
	    value = val;

	    /*
	     can't do the clipping here. see specs
	     
	     float v = ((Float) ((CssPercentage) val).get()).floatValue();
	     if (v < 0 || v > 100) {
	     // clipped
	     value = new CssPercentage((v<0)?0:100);
	     } else {
	     value = (CssPercentage) val;
	     }
	    */
	} else if (val instanceof CssNumber) {
	    CssNumber num = (CssNumber) val;
	    int i = (int) num.getValue();
	    if (i < 0) {
		value = new CssNumber(ac, 0);
	    } else if (i > 100) {
		value = new CssNumber(ac, 100);
	    } else {
		value = val;
	    }
	    expression.next();
	} else {
	    throw new InvalidParamException("value", 
					    expression.getValue().toString(), 
					    getPropertyName(), ac);
	}

	expression.next();
    }
    
    public ACssVolume(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns some usable value of this property...
     *
     * @deprecated
     */
    public float getValue() { // vm
	return ((CssNumber) value).getValue();
    }
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "volume";
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssVolume != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssVolume = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssVolume && 
		value.equals(((ACssVolume) property).value));
    }
    
    private CssIdent checkIdent(ApplContext ac, CssIdent ident) 
	throws InvalidParamException {
	
	int hash = ident.hashCode();
	for (int i = 0; i < VOLUME.length; i++) {
	    if (hash_values[i] == hash) {
		return ident;
	    }
	}
	
	throw new InvalidParamException("value", ident.toString(), 
					getPropertyName(), ac);
    }
    
    /** @deprecated */
    private CssPercentage ValueOfIdent(ApplContext ac, CssIdent ident) 
	throws InvalidParamException {
	
	int hash = ident.hashCode();
	for (int i = 0; i < VOLUME.length; i++) {
	    if (hash_values[i] == hash) {
		return new CssPercentage(ACssProperties.getValue(this, VOLUME[i]));
	    }
	}
	
	throw new InvalidParamException("value", ident.toString(), 
					getPropertyName(), ac);
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getVolume();
	} else {
	    return ((ACssStyle) style).acssVolume;
	}
    }
    
    static {
	hash_values = new int[VOLUME.length];
	for (int i = 0; i < VOLUME.length; i++)
	    hash_values[i] = VOLUME[i].hashCode();
    }
}


--- NEW FILE: ACssStyle.java ---
//
// $Id: ACssStyle.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssStyle.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.6  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.5  2003/07/30 06:54:50  sijtsche
 * new properties added
 *
 * Revision 1.4  2003/07/28 14:55:50  sijtsche
 * new properties and CSS3 property versions added
 *
 * Revision 1.3  2003/07/28 14:21:52  sijtsche
 * new properties and CSS3 property versions added
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.6  1997/08/26 14:25:55  plehegar
 * nothing
 *
 * Revision 1.5  1997/08/22 18:11:29  plehegar
 * Added speech-rate and pitch
 *
 * Revision 1.4  1997/08/22 15:24:21  plehegar
 * Udpated
 *
 * Revision 1.3  1997/08/22 15:05:41  plehegar
 * Updated
 *
 * Revision 1.2  1997/08/21 21:12:01  vmallet
 * Minor modifications so we could compile it.
 *
 * Revision 1.1  1997/08/20 18:42:05  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import java.util.Enumeration;

import org.w3c.css.parser.CssPrinterStyle;
import org.w3c.css.properties.css1.Css1Style;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.Warning;
import org.w3c.css.util.Warnings;
import org.w3c.css.values.CssPercentage;

/**
 * @version $Revision: 1.1 $
 */
public class ACssStyle extends Css1Style {

  ACssVolume acssVolume;
  ACssPause  acssPause = new ACssPause(); // it's a macro
  ACssCue  acssCue = new ACssCue(); // it's a macro
  ACssAzimuth acssAzimuth;
  ACssElevation acssElevation;
  ACssSpeechRate acssSpeechRate;
  ACssVoiceFamily acssVoiceFamily;
  ACssPitch acssPitch;
  ACssPitchRange acssPitchRange;
  ACssPlayDuring acssPlayDuring;

  ACssStress acssStress;
  ACssRichness acssRichness;

  ACssSpeakPunctuation acssSpeakPunctuation;
  ACssSpeakDate    acssSpeakDate;
  ACssSpeakNumeral acssSpeakNumeral;
  ACssSpeakTime    acssSpeakTime;
  ACssSpeak        acssSpeak;

  ACssSpeakCSS3    acssSpeakCSS3;
  ACssVoiceVolume  acssVoiceVolume;
  ACssVoiceBalance acssVoiceBalance;
  ACssVoiceFamilyCSS3 acssVoiceFamilyCSS3;
  ACssVoiceRate    acssVoiceRate;
  ACssVoicePitchRange acssVoicePitchRange;
  ACssVoiceStress  acssVoiceStress;
  ACssVoiceDuration acssVoiceDuration;
  ACssInterpretAs  acssInterpretAs;
  ACssPhonemes 	   acssPhonemes;

  /**
   * Get the volume
   */
  public ACssVolume getVolume() {
    if (acssVolume == null) {
      acssVolume = (ACssVolume) style.CascadingOrder(new ACssVolume(), style, selector);
    }
    return acssVolume;
  }

  /**
   * Get the pause after
   */
  public ACssPauseAfter getPauseAfter() {
    if (acssPause.pauseAfter == null) {
      acssPause.pauseAfter = (ACssPauseAfter) style.CascadingOrder(new ACssPauseAfter(), style, selector);
    }
    return acssPause.pauseAfter;
  }

  /**
   * Get the pause before
   */
  public ACssPauseBefore getPauseBefore() {
    if (acssPause.pauseBefore == null) {
      acssPause.pauseBefore = (ACssPauseBefore) style.CascadingOrder(new ACssPauseBefore(), style, selector);
    }
    return acssPause.pauseBefore;
  }

  /**
   * Get the pause
   */
  public ACssPause getPause() {
    if (acssPause.pauseAfter == null) {
      acssPause.pauseAfter = getPauseAfter();
    }
    if (acssPause.pauseBefore == null) {
      acssPause.pauseBefore = getPauseBefore();
    }
    return acssPause;
  }

  /**
   * Get the azimuth
   */
  public ACssAzimuth getAzimuth() {
    if (acssAzimuth == null) {
      acssAzimuth =
	(ACssAzimuth) style.CascadingOrder(new ACssAzimuth(),
					   style, selector);
    }
    return acssAzimuth;
  }

  /**
   * Get the elevation
   */
  public ACssElevation getElevation() {
    if (acssElevation == null) {
      acssElevation =
	(ACssElevation) style.CascadingOrder(new ACssElevation(),
					     style, selector);
    }
    return acssElevation;
  }

  /**
   * Get the speech rate
   */
  public ACssSpeechRate getSpeechRate() {
    if (acssSpeechRate == null) {
      acssSpeechRate = (ACssSpeechRate) style.CascadingOrder(new ACssSpeechRate(), style, selector);
    }
    return acssSpeechRate;
  }

  /**
   * Get the voice family
   */
  public ACssVoiceFamily getVoiceFamily() {
    if (acssVoiceFamily == null) {
      acssVoiceFamily = (ACssVoiceFamily) style.CascadingOrder(new ACssVoiceFamily(), style, selector);
    }
    return acssVoiceFamily;
  }

  /**
   * Get the pitch
   */
  public ACssPitch getPitch() {
    if (acssPitch == null) {
      acssPitch = (ACssPitch) style.CascadingOrder(new ACssPitch(), style, selector);
    }
    return acssPitch;
  }

  /**
   * Get the pitch
   */
  public ACssPitchRange getPitchRange() {
    if (acssPitchRange == null) {
      acssPitchRange = (ACssPitchRange) style.CascadingOrder(new ACssPitchRange(), style, selector);
    }
    return acssPitchRange;
  }

  /**
   * Get the cue after
   */
  public ACssCueAfter getCueAfter() {
    if (acssCue.cueAfter == null) {
      acssCue.cueAfter = (ACssCueAfter) style.CascadingOrder(new ACssCueAfter(), style, selector);
    }
    return acssCue.cueAfter;
  }

  /**
   * Get the cue before
   */
  public ACssCueBefore getCueBefore() {
    if (acssCue.cueBefore == null) {
      acssCue.cueBefore = (ACssCueBefore) style.CascadingOrder(new ACssCueBefore(), style, selector);
    }
    return acssCue.cueBefore;
  }

  /**
   * Get the cue
   */
  public ACssCue getCue() {
    if (acssCue.cueAfter == null) {
      acssCue.cueAfter = getCueAfter();
    }
    if (acssCue.cueBefore == null) {
      acssCue.cueBefore = getCueBefore();
    }
    return acssCue;
  }

  /**
   * Get the play during
   */
  public ACssPlayDuring getPlayDuring() {
    if (acssPlayDuring == null) {
      acssPlayDuring =
	(ACssPlayDuring) style.CascadingOrder(new ACssPlayDuring(),
					      style, selector);
    }
    return acssPlayDuring;
  }

  /**
   * Get the stress
   */
  public ACssStress getStress() {
    if (acssStress == null) {
      acssStress =
	(ACssStress) style.CascadingOrder(new ACssStress(),
					    style, selector);
    }
    return acssStress;
  }

  /**
   * Get the richness
   */
  public ACssRichness getRichness() {
    if (acssRichness == null) {
      acssRichness =
	(ACssRichness) style.CascadingOrder(new ACssRichness(),
					    style, selector);
    }
    return acssRichness;
  }

  /**
   * Get the speak punctuation
   */
  public ACssSpeakPunctuation getSpeakPunctuation() {
    if (acssSpeakPunctuation == null) {
      acssSpeakPunctuation =
	(ACssSpeakPunctuation) style.CascadingOrder(new ACssSpeakPunctuation(),
						    style, selector);
    }
    return acssSpeakPunctuation;
  }

  /**
   * Get the speak date
   */
  public ACssSpeakDate getSpeakDate() {
    if (acssSpeakDate == null) {
      acssSpeakDate =
	(ACssSpeakDate) style.CascadingOrder(new ACssSpeakDate(), style, selector);
    }
    return acssSpeakDate;
  }

  /**
   * Get the speak numeral
   */
  public ACssSpeakNumeral getSpeakNumeral() {
    if (acssSpeakNumeral == null) {
      acssSpeakNumeral =
	(ACssSpeakNumeral) style.CascadingOrder(new ACssSpeakNumeral(), style, selector);
    }
    return acssSpeakNumeral;
  }

  /**
   * Get the speak time
   */
  public ACssSpeakTime getSpeakTime() {
    if (acssSpeakTime == null) {
      acssSpeakTime =
	(ACssSpeakTime) style.CascadingOrder(new ACssSpeakTime(), style, selector);
    }
    return acssSpeakTime;
  }

  /**
   * Get the speak
   */
  public ACssSpeak getSpeak() {
    if (acssSpeak == null) {
      acssSpeak =
	(ACssSpeak) style.CascadingOrder(new ACssSpeak(), style, selector);
    }
    return acssSpeak;
  }

  public ACssSpeakCSS3 getSpeakCSS3() {
    if (acssSpeakCSS3 == null) {
      acssSpeakCSS3 =
	(ACssSpeakCSS3) style.CascadingOrder(new ACssSpeakCSS3(), style, selector);
    }
    return acssSpeakCSS3;
  }

  public ACssVoiceVolume getVoiceVolume() {
    if (acssVoiceVolume == null) {
      acssVoiceVolume =
	(ACssVoiceVolume) style.CascadingOrder(new ACssVoiceVolume(), style, selector);
    }
    return acssVoiceVolume;
  }

  public ACssVoiceBalance getVoiceBalance() {
    if (acssVoiceBalance == null) {
      acssVoiceBalance =
	(ACssVoiceBalance) style.CascadingOrder(new ACssVoiceBalance(), style, selector);
    }
    return acssVoiceBalance;
  }

  public ACssVoiceFamilyCSS3 getVoiceFamilyCSS3() {
    if (acssVoiceFamilyCSS3 == null) {
      acssVoiceFamilyCSS3 =
	(ACssVoiceFamilyCSS3) style.CascadingOrder(new ACssVoiceFamilyCSS3(), style, selector);
    }
    return acssVoiceFamilyCSS3;
  }

  public ACssVoiceRate getVoiceRate() {
    if (acssVoiceRate == null) {
      acssVoiceRate =
	(ACssVoiceRate) style.CascadingOrder(new ACssVoiceRate(), style, selector);
    }
    return acssVoiceRate;
  }

  public ACssVoicePitchRange getVoicePitchRange() {
    if (acssVoicePitchRange == null) {
      acssVoicePitchRange =
	(ACssVoicePitchRange) style.CascadingOrder(new ACssVoicePitchRange(), style, selector);
    }
    return acssVoicePitchRange;
  }

  public ACssVoiceStress getVoiceStress() {
    if (acssVoiceStress == null) {
      acssVoiceStress =
	(ACssVoiceStress) style.CascadingOrder(new ACssVoiceStress(), style, selector);
    }
    return acssVoiceStress;
  }

  public ACssVoiceDuration getVoiceDuration() {
    if (acssVoiceDuration == null) {
      acssVoiceDuration =
	(ACssVoiceDuration) style.CascadingOrder(new ACssVoiceDuration(), style, selector);
    }
    return acssVoiceDuration;
  }

  public ACssInterpretAs getInterpretAs() {
    if (acssInterpretAs == null) {
      acssInterpretAs =
	(ACssInterpretAs) style.CascadingOrder(new ACssInterpretAs(), style, selector);
    }
    return acssInterpretAs;
  }

  public ACssPhonemes getPhonemes() {
    if (acssPhonemes == null) {
      acssPhonemes =
	(ACssPhonemes) style.CascadingOrder(new ACssPhonemes(), style, selector);
    }
    return acssPhonemes;
  }

  public void print(CssPrinterStyle printer) {
    super.print(printer);
    if (acssVolume != null)
      acssVolume.print(printer);
    if (acssPlayDuring != null)
      acssPlayDuring.print(printer);
    acssPause.print(printer); // don't test null: it's a macro.
    if (acssAzimuth != null)
      acssAzimuth.print(printer);
    if (acssElevation != null)
      acssElevation.print(printer);
    if (acssSpeechRate != null)
      acssSpeechRate.print(printer);
    if (acssVoiceFamily != null)
      acssVoiceFamily.print(printer);
    if (acssPitch != null)
      acssPitch.print(printer);
    if (acssPitchRange != null)
      acssPitchRange.print(printer);
    acssCue.print(printer); // don't test null: it's a macro.
    if (acssStress != null)
      acssStress.print(printer);
    if (acssRichness != null)
      acssRichness.print(printer);
    if (acssSpeakPunctuation != null)
      acssSpeakPunctuation.print(printer);
    if (acssSpeakDate != null)
      acssSpeakDate.print(printer);
    if (acssSpeakNumeral != null)
      acssSpeakNumeral.print(printer);
    if (acssSpeakTime != null)
      acssSpeakTime.print(printer);
    if (acssSpeak != null)
      acssSpeak.print(printer);
    if (acssSpeakCSS3 != null)
	  acssSpeakCSS3.print(printer);
	if (acssVoiceVolume != null)
	  acssVoiceVolume.print(printer);
	if (acssVoiceBalance != null)
	  acssVoiceBalance.print(printer);
	if (acssVoiceFamilyCSS3 != null)
	  acssVoiceFamilyCSS3.print(printer);
	if (acssVoiceRate != null)
	  acssVoiceRate.print(printer);
	if (acssVoicePitchRange != null)
	  acssVoicePitchRange.print(printer);
	if (acssVoiceStress != null)
	  acssVoiceStress.print(printer);
	if (acssVoiceDuration != null)
	  acssVoiceDuration.print(printer);
	if (acssInterpretAs != null)
	  acssInterpretAs.print(printer);
	if (acssPhonemes != null)
	  acssPhonemes.print(printer);

  }

  /**
   * Find conflicts in this Style
   *
   * @param warnings For warnings reports.
   * @param allSelectors All contexts is the entire style sheet.
   */
  public void findConflicts(ApplContext ac, Warnings warnings, Enumeration allSelectors) {
    super.findConflicts(ac, warnings, allSelectors);

    if (acssVoiceFamily != null) {
	if (!acssVoiceFamily.containsGenericFamily()) {
	warnings.addWarning(new Warning(acssVoiceFamily,
					"no-generic-family", 2, ac));
	}
	if (acssVoiceFamily.withSpace) {
	    warnings.addWarning(new Warning(acssVoiceFamily,
					    "with-space", 1, ac));
	}
    }

    if ((acssPause.getBefore() != null) &&
	!acssPause.getBefore().isSoftlyInherited() &&
	!(acssPause.getBefore().get() instanceof CssPercentage)) {
      // Using relative units gives more robust stylesheets
      warnings.addWarning(new Warning(acssPause.getBefore(),
				      "relative", 2, ac));
    }
    if ((acssPause.getAfter() != null) &&
	!acssPause.getAfter().isSoftlyInherited() &&
	!(acssPause.getAfter().get() instanceof CssPercentage)) {
      // Using relative units gives more robust stylesheets
      warnings.addWarning(new Warning(acssPause.getAfter(),
				      "relative", 2, ac));
    }


  }

}

--- NEW FILE: ACssSpeechRate.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssPauseBefore.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssCueBefore.java ---
//
// $Id: ACssCueBefore.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssCueBefore.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.1  1997/08/14 12:58:44  plehegar
 * Initial revision
 *
 */

package org.w3c.css.properties.aural;

import java.io.IOException;
import java.net.URL;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.HTTPURL;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 * &nbsp;&nbsp;  'cue-before'
 *
 * <P>
 * <EM>Value: </EM> &lt;url&gt; | none<BR>
 * <EM>Initial:</EM> none<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> no<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <P>Auditory icons are another way to distinguish semantic
 * elements. Sounds may be played before, and/or after the element to
 * delimit it. The same sound can be used both before and after, using the
 * shorthand 'cue' property.
 *
 * <p> Examples:
 * <PRE>
 *   A {cue-before: url(bell.aiff); cue-after: url(dong.wav) }
 *   H1 {cue-before: url(pop.au); cue-after: url(pop.au) }
 *   H1 {cue: url(pop.au) }  / * same as previous * /
 * </pre>
 *
 * <p class=comment>The <tt>:before</tt> and <tt>:after</tt>
 * pseudo-elements (see frostings document) could be used to generate
 * this content, rather than using two special-purpose properties. This
 * would be more general.</p>
 *
 * @version $Revision: 1.1 $
 */
public class ACssCueBefore extends ACssProperty {
    
    CssValue value;
    
    private URL url;
    private static CssIdent none = new CssIdent("none");

    /**
     * Create a new ACssCueBefore
     */  
    public ACssCueBefore() {
	// Initial is User Agent Specific
	value = none;
    }
    
    /**
     * Create a new ACssCueBefore
     */  
    public ACssCueBefore(ACssCueAfter cueBefore) {
	value = cueBefore.value;
    }
    
    /**
     * Creates a new ACssCueBefore
     * @param value the value of the size
     * @exception InvalidParamException The value is incorrect
     */  
    public ACssCueBefore(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	
	if (val instanceof CssURL) {
	    value = val;
	    expression.next();
	    return;
	} else if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	} else if (val.equals(none)) {
	    value = none;
	    expression.next();
	    return;
	}
	
	throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
    }
    
    public ACssCueBefore(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */  
    public Object get() {
	if (value == none)
	    return null;
	else
	    return value;
    }
    
    /**
     * Returns some usable value of this property...
     */
    public URL getValue() throws IOException { // vm
	if (value == none)
	    return null;
	else {
	    if (url == null) {
		url = HTTPURL.getURL(new URL(sourceFile), (String) value.get());
	    }
	    return url;
	}
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "cue-before";
    }
    
    public void addToStyle(ApplContext ac, CssStyle style) {
	ACssCue acssCue = ((ACssStyle) style).acssCue;
	if (acssCue.cueBefore != null)
	    style.addRedefinitionWarning(ac, this);
	acssCue.cueBefore = this;
    }
    
    public boolean equals(CssProperty property) {
	return (property instanceof ACssCueBefore && value.equals(((ACssCueBefore) property).value));
    }
    
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getCueBefore();
	} else {
	    return ((ACssStyle) style).acssCue.cueBefore;
	}
    }
    
}

--- NEW FILE: ACssPitchRange.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssInterpretAs.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssVoiceFamily.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssPitch.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssSpeakTime.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssPauseAfter.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssAzimuth.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssProperty.java ---
//
// $Id: ACssProperty.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssProperty.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.1  1997/08/26 15:57:58  plehegar
 * Initial revision
 *
 */

package org.w3c.css.properties.aural;

import org.w3c.css.properties.css1.CssProperty;

/**
 * @version $Revision: 1.1 $
 */
public abstract class ACssProperty extends CssProperty {

  /**
   * Returns true if the property is inherited
   */
  public boolean Inherited() {
    return ACssProperties.getInheritance(this);
  }

}

--- NEW FILE: ACssVoiceStress.class ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: ACssSpeechRate.java ---
//
// $Id: ACssSpeechRate.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssSpeechRate.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 * Revision 2.1  1997/08/29 13:11:50  plehegar
 * Updated
 *
 * Revision 1.4  1997/08/25 13:51:32  plehegar
 * Added getValue()
 *
 * Revision 1.3  1997/08/22 18:01:18  plehegar
 * Updated
 *
 * Revision 1.2  1997/08/22 17:58:30  plehegar
 * Updated
 *
 * Revision 1.1  1997/08/22 17:07:38  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  &nbsp;&nbsp; 'speech-rate'
 *
 * <P>
 * <EM>Value:</EM> &lt;words-per-minute&gt; | x-slow | slow | medium |
 * fast | x-fast | faster | slower<BR>
 * <EM>Initial:</EM> medium<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <P>Specifies the speaking rate. Note that both absolute and relative
 * keyword values are allowed. (compare with font-weight').
 *
 *
 * @version $Revision: 1.1 $
 * @see org.w3c.css.properties.css1.CssFontWeight
 */
public class ACssSpeechRate extends ACssProperty {
    
    CssValue value;
    
    private static int[] hash_values;
    
    private static String[] SPEECHRATE = { "x-slow", "slow", "medium", 
					   "fast", "x-fast", "faster", 
					   "slower" };
    private static CssIdent defaultValue = new CssIdent(SPEECHRATE[2]);
    
    /**
     * Create a new ACssSpeechRate
     */
    public ACssSpeechRate() {
	value = defaultValue;
    }  
    
    /**
     * Creates a new ACssSpeechRate
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Expressions are incorrect
     */  
    public ACssSpeechRate(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	int index;
	
	setByUser();
	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val instanceof CssIdent) {
	    value = checkIdent(ac, (CssIdent) val);
	} else if (val instanceof CssNumber) {
	    value = val;
	} else {
	    throw new InvalidParamException("value", 
					    expression.getValue().toString(), 
					    getPropertyName(), ac);
	}
	expression.next();
    }
    
    public ACssSpeechRate(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "speech-rate";
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssSpeechRate != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssSpeechRate = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssSpeechRate && 
		value.equals(((ACssSpeechRate) property).value));
    }
    
    private CssIdent checkIdent(ApplContext ac, CssIdent ident) throws InvalidParamException {
	int hash = ident.hashCode();
	for (int i = 0; i < SPEECHRATE.length; i++) {
	    if (hash_values[i] == hash) {
		return ident;
	    }
	}
	
	throw new InvalidParamException("value", 
					ident.toString(), 
					getPropertyName(), ac);
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getSpeechRate();
	} else {
	    return ((ACssStyle) style).acssSpeechRate;
	}
    }
    
    static {
	hash_values = new int[SPEECHRATE.length];
	for (int i = 0; i < SPEECHRATE.length; i++)
	    hash_values[i] = SPEECHRATE[i].hashCode();
    }
}


--- NEW FILE: ACssElevation.java ---
//
// $Id: ACssElevation.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssElevation.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 */
package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssAngle;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;


/**
 *
 * @version $Revision: 1.1 $
 */
public class ACssElevation extends ACssProperty {
    
    CssValue value;
    
    private static int[] hash_values;
    
    private static String[] ELEVATION = { "below", "level", "above",
					  "highter", "lower" };
    

    private static CssValue defaultValue = new CssIdent(ELEVATION[1]);
    /**
     * Create a new ACssElevation
     */
    public ACssElevation() {
	value = defaultValue;
    }  
    
    /**
     * Creates a new ACssElevation
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public ACssElevation(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this();
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	//int index;
	setByUser();
		
	if (val.equals(inherit)) {	    
	    value = inherit;
	    expression.next();
	    return;
	} else if (val instanceof CssIdent) {
	    value = checkIdent(ac, (CssIdent) val);
	    expression.next();
	    return;
	} else if (val instanceof CssAngle) {
	    float v = ((CssAngle) val).getDegree();
	    String unit = ((CssAngle) val).getUnit();
	    if (!unit.equals("deg")) {
		throw new InvalidParamException("degree", null, ac);
	    }
	    if (v > 90 || v < -90) {
		throw new InvalidParamException("elevation.range", null, ac);
	    }
	    value = val;
	    expression.next();
	    return;
	}

	throw new InvalidParamException("value", 
					expression.getValue().toString(), 
					getPropertyName(), ac);
    }
    
    public ACssElevation(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "elevation";
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssElevation != null)
	    style.addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssElevation = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssElevation && 
		value.equals(((ACssElevation) property).value));
    }
    
    private CssIdent checkIdent(ApplContext ac, CssIdent ident)
	throws InvalidParamException {
	int hash = ident.hashCode();
	for (int i = 0; i < ELEVATION.length; i++) {
	    if (hash_values[i] == hash) {
		return ident;
	    }
	}
	
	throw new InvalidParamException("value", ident.toString(), 
					getPropertyName(), ac);
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getElevation();
	} else {
	    return ((ACssStyle) style).acssElevation;
	}
    }
    
    static {
	hash_values = new int[ELEVATION.length];
	for (int i = 0; i < ELEVATION.length; i++)
	    hash_values[i] = ELEVATION[i].hashCode();
    }
}


--- NEW FILE: ACssSpeakPunctuation.java ---
//
// $Id: ACssSpeakPunctuation.java,v 1.1 2005/08/23 16:51:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: ACssSpeakPunctuation.java,v $
 * Revision 1.1  2005/08/23 16:51:43  ylafon
 * reorg (cvs funkyness...)
 *
 * Revision 1.3  2005/08/08 13:18:03  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/04/08 21:16:56  plehegar
 * New
 *
 */

package org.w3c.css.properties.aural;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 * <H3> &nbsp;&nbsp 'speak-punctuation'</H3>
 *
 * <P>
 * <EM>Value: </EM> code | none <BR>
 * <EM>Initial:</EM> none<BR>
 * <EM>Applies to:</EM> all elements<BR>
 * <EM>Inherited:</EM> yes<BR>
 * <EM>Percentage values:</EM> NA
 *
 * <p>'code' indicates that punctuation such as semicolons, braces, and
 * so on are to be spoken literally. The default value of 'none' means
 * that punctuation is not spoken but instead is rendered naturally as
 * various pauses.
 *
 * @version $Revision: 1.1 $
 */
public class ACssSpeakPunctuation extends ACssProperty {
    
    CssValue value;
    
    private static CssIdent none = new CssIdent("none");
    private static CssIdent code = new CssIdent("code");

    /**
     * Create a new ACssSpeakPunctuation
     */  
    public ACssSpeakPunctuation() {
	value = none;
    }
    
    /**
     * Creates a new ACssSpeakPunctuation
     *
     * @param expression the expression of the size
     * @exception InvalidParamException The expression is incorrect
     */  
    public ACssSpeakPunctuation(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = expression.getValue();
	
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	} else if (val.equals(code)) {
	    value = code;
	    expression.next();
	    return;
	} else if (val.equals(none)) {
	    value = none;
	    expression.next();
	    return;
	}
	
	throw new InvalidParamException("value",
					val.toString(), 
					getPropertyName(), ac);
    }
    
    public ACssSpeakPunctuation(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */  
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "speak-punctuation";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((ACssStyle) style).acssSpeakPunctuation != null)
	    ((ACssStyle) style).addRedefinitionWarning(ac, this);
	((ACssStyle) style).acssSpeakPunctuation = this;
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ACssSpeakPunctuation && 
		value.equals(((ACssSpeakPunctuation) property).value));
    }
    
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((ACssStyle) style).getSpeakPunctuation();
	} else {
	    return ((ACssStyle) style).acssSpeakPunctuation;
	}
    }
    
}

Received on Tuesday, 23 August 2005 16:52:19 UTC