khtml Library API Documentation

DOM::CSSPrimitiveValue Class Reference

The CSSPrimitiveValue interface represents a single CSS value . More...

#include <css_value.h>

Inheritance diagram for DOM::CSSPrimitiveValue:

DOM::CSSValue List of all members.

Public Types

enum  UnitTypes
 An integer indicating which type of unit applies to the value. More...


Public Methods

CSSPrimitiveValue & operator= (const CSSValue &other)
unsigned short primitiveType () const
 The type of the value as defined by the constants specified above.

void setFloatValue (unsigned short unitType, float floatValue)
 A method to set the float value with a specified unit.

float getFloatValue (unsigned short unitType)
 This method is used to get a float value in a specified unit.

void setStringValue (unsigned short stringType, const DOM::DOMString &stringValue)
 A method to set the string value with a specified unit.

DOM::DOMString getStringValue ()
 This method is used to get the string value in a specified unit.

Counter getCounterValue ()
 This method is used to get the Counter value.

Rect getRectValue ()
 This method is used to get the Rect value.

RGBColor getRGBColorValue ()
 This method is used to get the RGB color.


Detailed Description

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.

Definition at line 367 of file css_value.h.


Member Enumeration Documentation

enum DOM::CSSPrimitiveValue::UnitTypes
 

An integer indicating which type of unit applies to the value.

Reimplemented from DOM::CSSValue.

Definition at line 384 of file css_value.h.


Member Function Documentation

unsigned short CSSPrimitiveValue::primitiveType  
 

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

Definition at line 332 of file css_value.cpp.

Referenced by getFloatValue().

void CSSPrimitiveValue::setFloatValue unsigned 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.
Returns:
Exceptions:
DOMException  INVALID_ACCESS_ERR: Raises if the attached property doesn't support the float value or the unit type.
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.

Definition at line 338 of file css_value.cpp.

float CSSPrimitiveValue::getFloatValue unsigned 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.
Exceptions:
DOMException  INVALID_ACCESS_ERR: Raises if the CSS value doesn't contain a float value or if the float value can't be converted into the specified unit.

Definition at line 349 of file css_value.cpp.

References primitiveType().

void CSSPrimitiveValue::setStringValue unsigned short    stringType,
const DOM::DOMString   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 .
Returns:
Exceptions:
DOMException  INVALID_ACCESS_ERR: Raises if the CSS value doesn't contain a string value or if the string value can't be converted into the specified unit.
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.

Definition at line 358 of file css_value.cpp.

DOMString CSSPrimitiveValue::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 ).
Exceptions:
DOMException  INVALID_ACCESS_ERR: Raises if the CSS value doesn't contain a string value.

Definition at line 370 of file css_value.cpp.

Counter CSSPrimitiveValue::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.
Exceptions:
DOMException  INVALID_ACCESS_ERR: Raises if the CSS value doesn't contain a Counter value.

Definition at line 376 of file css_value.cpp.

Rect CSSPrimitiveValue::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.
Exceptions:
DOMException  INVALID_ACCESS_ERR: Raises if the CSS value doesn't contain a Rect value.

Definition at line 382 of file css_value.cpp.

RGBColor CSSPrimitiveValue::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.
Exceptions:
DOMException  INVALID_ACCESS_ERR: Raises if the attached property can't return a RGB color value.

Definition at line 388 of file css_value.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:22:45 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001