All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cz.vutbr.web.css.SupportedCSS Maven / Gradle / Ivy

package cz.vutbr.web.css;

import java.util.Set;


/**
 * Encapsulates supported CSS properties, their types and default values.
 * Implementations should provide reasonable User Agent defaults.
 * 
 * @author kapy
 *
 */
public interface SupportedCSS {

	/**
	 * Returns total number of properties defined
	 * @return total number of properties defined
	 */
	int getTotalProperties();
	
	/**
	 * Returns names of defined properties
	 * @return Set with name of defined properties
	 */
	Set getDefinedPropertyNames();
	
	
	/**
	 * Checks whether media type is supported
	 * @param media Name of media, such as screen
	 * @return true if supported, false otherwise
	 */
	boolean isSupportedMedia(String media);
	
	/**
	 * Checks whether property is supported
	 * @param property Name of CSS property
	 * @return true if supported, false otherwise
	 */
	boolean isSupportedCSSProperty(String property);
	
	/**
	 * Return default value of CSSProperty under given name
	 * @param propertyName Name of CSSProperty
	 * @return Default value of CSSProperty or null
	 * when property with this name is not found
	 */
	CSSProperty getDefaultProperty(String propertyName);
	
	/**
	 * Some CSSProperties have even additional values. When this 
	 * happens, this functions could be used to retrieve that value.
	 * 
	 * Example: property background-position, 
	 * has default value of list with two percentages 0% 0%
	 * 
	 * @param propertyName Name of CSSProperty
	 * @return Default value or CSSProperty's value or null
	 * when property with this name is not found
	 */
	Term getDefaultValue(String propertyName);
	
	/**
	 * For testing, this should get name of randomly chosen CSSProperty.
	 * @return Name of CSSProperty
	 */
	String getRandomPropertyName();
	
	/**
	 * Returns ordinal number of propertyName. This number must be positive integer. 
	 * This value should be unique with supported properties
	 * @param propertyName Name of property
	 * @return ordinal number in property was found, -1 elsewhere
	 */
	int getOrdinal(String propertyName);

	/**
	 * Returns property name according to ordinal number
	 * @param o Ordinal number previously retrieved by getOrdinal()
	 * @return Name of property or null if not found
	 */
	String getPropertyName(int o);
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy