org.kde.koala

Class CSSPrimitiveValue

public class CSSPrimitiveValue extends CSSValue

The CSSPrimitiveValue interface represents a single CSS value . This interface may be used to determine the value of a specific style property currently set in a block or to set a specific style properties explicitly within the block. An instance of this interface can be obtained from the getPropertyCSSValue method of the CSSStyleDeclaration interface.

UNKNOWN: The CSSPrimitiveValue interface represents a single Constructor Summary protected CSSPrimitiveValue(Class dummy)

CSSPrimitiveValue()
CSSPrimitiveValue(CSSPrimitiveValue other)
CSSPrimitiveValue(CSSValue other)
Method Summary
CountergetCounterValue()
This method is used to get the Counter value.
floatgetFloatValue(short unitType)
This method is used to get a float value in a specified unit.
RectgetRectValue()
This method is used to get the Rect value.
RGBColorgetRGBColorValue()
This method is used to get the RGB color.
StringgetStringValue()
This method is used to get the string value in a specified unit.
shortprimitiveType()
The type of the value as defined by the constants specified above.
voidsetFloatValue(short unitType, float floatValue)
A method to set the float value with a specified unit.
voidsetStringValue(short stringType, String stringValue)
A method to set the string value with a specified unit.

Constructor Detail

CSSPrimitiveValue

protected CSSPrimitiveValue(Class dummy)

CSSPrimitiveValue

public CSSPrimitiveValue()

CSSPrimitiveValue

public CSSPrimitiveValue(CSSPrimitiveValue other)

CSSPrimitiveValue

public CSSPrimitiveValue(CSSValue other)

Method Detail

getCounterValue

public Counter getCounterValue()
This method is used to get the Counter value. If this CSS value doesn't contain a counter value, a DOMException is raised. Modification to the corresponding style property can be achieved using the Counter interface.

Returns: The Counter value.

UNKNOWN: This method is used to get the Counter value.

getFloatValue

public float getFloatValue(short unitType)
This method is used to get a float value in a specified unit. If this CSS value doesn't contain a float value or can't be converted into the specified unit, a DOMException is raised.

Parameters: unitType A unit code to get the float value. The unit code can only be a float unit type (e.g. CSS_NUMBER , CSS_PERCENTAGE , CSS_EMS , CSS_EXS , CSS_PX , CSS_PX , CSS_CM , CSS_MM , CSS_IN , CSS_PT , CSS_PC , CSS_DEG , CSS_RAD , CSS_GRAD , CSS_MS , CSS_S , CSS_HZ , CSS_KHZ , CSS_DIMENSION ).

Returns: The float value in the specified unit.

UNKNOWN: This method is used to get a float value in a specified unit.

getRectValue

public Rect getRectValue()
This method is used to get the Rect value. If this CSS value doesn't contain a rect value, a DOMException is raised. Modification to the corresponding style property can be achieved using the Rect interface.

Returns: The Rect value.

UNKNOWN: This method is used to get the Rect value.

getRGBColorValue

public RGBColor getRGBColorValue()
This method is used to get the RGB color. If this CSS value doesn't contain a RGB color value, a DOMException is raised. Modification to the corresponding style property can be achieved using the RGBColor interface.

Returns: the RGB color value.

UNKNOWN: This method is used to get the RGB color.

getStringValue

public String getStringValue()
This method is used to get the string value in a specified unit. If the CSS value doesn't contain a string value, a DOMException is raised.

Returns: The string value in the current unit. The current valueType can only be a string unit type (e.g. CSS_URI , CSS_IDENT and CSS_ATTR ).

UNKNOWN: This method is used to get the string value in a specified unit.

primitiveType

public short primitiveType()
The type of the value as defined by the constants specified above.

UNKNOWN: The type of the value as defined by the constants specified above.

setFloatValue

public void setFloatValue(short unitType, float floatValue)
A method to set the float value with a specified unit. If the property attached with this value can not accept the specified unit or the float value, the value will be unchanged and a DOMException will be raised.

Parameters: unitType A unit code as defined above. The unit code can only be a float unit type (e.g. NUMBER , PERCENTAGE , CSS_EMS , CSS_EXS , CSS_PX , CSS_PX , CSS_CM , CSS_MM , CSS_IN , CSS_PT , CSS_PC , CSS_DEG , CSS_RAD , CSS_GRAD , CSS_MS , CSS_S , CSS_HZ , CSS_KHZ , CSS_DIMENSION ). floatValue The new float value. NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.

UNKNOWN: A method to set the float value with a specified unit.

setStringValue

public void setStringValue(short stringType, String stringValue)
A method to set the string value with a specified unit. If the property attached to this value can't accept the specified unit or the string value, the value will be unchanged and a DOMException will be raised.

Parameters: stringType A string code as defined above. The string code can only be a string unit type (e.g. CSS_URI , CSS_IDENT , CSS_INHERIT and CSS_ATTR ). stringValue The new string value. If the stringType is equal to CSS_INHERIT , the stringValue should be inherit . NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.

UNKNOWN: A method to set the string value with a specified unit.