001: /*
002: * Copyright (c) 2000 World Wide Web Consortium,
003: * (Massachusetts Institute of Technology, Institut National de
004: * Recherche en Informatique et en Automatique, Keio University). All
005: * Rights Reserved. This program is distributed under the W3C's Software
006: * Intellectual Property License. This program is distributed in the
007: * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008: * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009: * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
010: * details.
011: */
012:
013: package org.w3c.dom.css;
014:
015: import org.w3c.dom.DOMException;
016:
017: /**
018: * The <code>CSS2PageSize</code> interface represents the size CSS Level 2
019: * descriptor.
020: * <p> For this extension of the <code>CSSValue</code> interface, the
021: * <code>valueType</code> attribute of the underlying <code>CSSValue</code>
022: * interface shall be <code>CSS_CUSTOM</code> .
023: * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
024: * @since DOM Level 2
025: */
026: public interface CSS2PageSize extends CSSValue {
027: /**
028: * A code defining the type of the width of the page. It would be one of
029: * <code>CSS_EMS</code> , <code>CSS_EXS</code> , <code>CSS_PX</code> ,
030: * <code>CSS_CM</code> , <code>CSS_MM</code> , <code>CSS_IN</code> ,
031: * <code>CSS_PT</code> , <code>CSS_PC</code> or <code>CSS_IDENT</code> .
032: */
033: public short getWidthType();
034:
035: /**
036: * A code defining the type of the height of the page. It would be one of
037: * <code>CSS_EMS</code> , <code>CSS_EXS</code> , <code>CSS_PX</code> ,
038: * <code>CSS_CM</code> , <code>CSS_MM</code> , <code>CSS_IN</code> ,
039: * <code>CSS_PT</code> , <code>CSS_PC</code> or <code>CSS_IDENT</code> .
040: * If one of width or height is <code>CSS_IDENT</code> , it's guaranteed
041: * that the other is the same.
042: */
043: public short getHeightType();
044:
045: /**
046: * If <code>width</code> is <code>CSS_IDENT</code> , this attribute
047: * contains the string representation of the ident, otherwise it contains
048: * an empty string.
049: */
050: public String getIdentifier();
051:
052: /**
053: * This method is used to get the float value in a specified unit if the
054: * <code>widthType</code> represents a length. If the float doesn't
055: * contain a float value or can't be converted into the specified unit, a
056: * <code>DOMException</code> is raised.
057: * @param wType The width unit.
058: * @return The float value.
059: * @exception DOMException
060: * INVALID_ACCESS_ERR: Raised if the property doesn't contain a float
061: * or the value can't be converted.
062: */
063: public float getWidth(float wType) throws DOMException;
064:
065: /**
066: * This method is used to get the float value in a specified unit if the
067: * <code>heightType</code> represents a length. If the float doesn't
068: * contain a float value or can't be converted into the specified unit, a
069: * <code>DOMException</code> is raised. If only the width value has been
070: * specified, the height value is the same.
071: * @param hType The height unit.
072: * @return The float value.
073: * @exception DOMException
074: * INVALID_ACCESS_ERR: Raised if the property doesn't contain a float
075: * or the value can't be converted.
076: */
077: public float getHeightSize(float hType) throws DOMException;
078:
079: /**
080: * This method is used to set the width position with a specified unit.
081: * If the <code>heightType</code> is not a length, it sets the height
082: * position to the same value.
083: * @param wType The width unit.
084: * @param value The new value.
085: * @exception DOMException
086: * INVALID_ACCESS_ERR: Raised if the specified unit is not a length or
087: * a percentage.
088: * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
089: * readonly.
090: */
091: public void setWidthSize(short wType, float value)
092: throws DOMException;
093:
094: /**
095: * This method is used to set the height position with a specified unit.
096: * If the <code>widthType</code> is not a length, it sets the width
097: * position to the same value.
098: * @param hType The height unit.
099: * @param value The new value.
100: * @exception DOMException
101: * INVALID_ACCESS_ERR: Raised if the specified unit is not a length or
102: * a percentage.
103: * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
104: * readonly.
105: */
106: public void setHeightSize(short hType, float value)
107: throws DOMException;
108:
109: /**
110: * Sets the identifier.
111: * @param ident The new identifier.
112: * @exception DOMException
113: * SYNTAX_ERR: Raised if the identifier has a syntax error and is
114: * unparsable.
115: * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
116: * readonly.
117: */
118: public void setIdentifier(String ident) throws DOMException;
119:
120: }
|