DOM::CSS2BackgroundPosition class Reference (khtml Library)

| # khtml Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# DOM::CSS2BackgroundPosition Class Reference

The `CSS2BackgroundPosition` interface represents the background-position CSS Level 2 property. More...

`#include <css_extensions.h>`

Inheritance diagram for DOM::CSS2BackgroundPosition:

[legend]
Collaboration diagram for DOM::CSS2BackgroundPosition:

[legend]
List of all members.

## Public Member Functions
| CSS2BackgroundPosition (const CSS2BackgroundPosition &other)
| CSS2BackgroundPosition (CSS2BackgroundPositionImpl *impl)
CSS2BackgroundPosition & | operator= (const CSS2BackgroundPosition &other)
unsigned short | horizontalType () const
| A code defining the type of the horizontal value.
unsigned short | verticalType () const
| A code defining the type of the horizontal value.
DOM::DOMString | horizontalIdentifier () const
| If `horizontalType` is `CSS_IDENT` or `CSS_INHERIT` , this attribute contains the string representation of the ident, otherwise it contains an empty string.
DOM::DOMString | verticalIdentifier () const
| If `verticalType` is `CSS_IDENT` or `CSS_INHERIT` , this attribute contains the string representation of the ident, otherwise it contains an empty string.
float | getHorizontalPosition (const float horizontalType)
| This method is used to get the float value in a specified unit if the `horizontalPosition` represents a length or a percentage.
float | getVerticalPosition (const float verticalType)
| This method is used to get the float value in a specified unit if the `verticalPosition` represents a length or a percentage.
void | setHorizontalPosition (const unsigned short horizontalType, const float value)
| This method is used to set the horizontal position with a specified unit.
void | setVerticalPosition (const unsigned short verticalType, const float value)
| This method is used to set the vertical position with a specified unit.
void | setPositionIdentifier (const DOM::DOMString &horizontalIdentifier, const DOM::DOMString &verticalIdentifier)
| Sets the identifiers.

## Detailed Description

The `CSS2BackgroundPosition` interface represents the background-position CSS Level 2 property.

Definition at line 147 of file css_extensions.h.

## Member Function Documentation

unsigned short CSS2BackgroundPosition::horizontalType | ( |  | ) | const

| A code defining the type of the horizontal value. It would be one `CSS_PERCENTAGE` , `CSS_EMS` , `CSS_EXS` , `CSS_PX` , `CSS_CM` , `CSS_MM` , `CSS_IN` , `CSS_PT` , `CSS_PC` , `CSS_IDENT` , `CSS_INHERIT` . If one of horizontal or vertical is `CSS_IDENT` or `CSS_INHERIT` , it's guaranteed that the other is the same. Definition at line 113 of file css_extensions.cpp.

unsigned short CSS2BackgroundPosition::verticalType | ( |  | ) | const

| A code defining the type of the horizontal value. The code can be one of the following units : `CSS_PERCENTAGE` , `CSS_EMS` , `CSS_EXS` , `CSS_PX` , `CSS_CM` , `CSS_MM` , `CSS_IN` , `CSS_PT` , `CSS_PC` , `CSS_IDENT` , `CSS_INHERIT` . If one of horizontal or vertical is `CSS_IDENT` or `CSS_INHERIT` , it's guaranteed that the other is the same. Definition at line 119 of file css_extensions.cpp.

DOMString CSS2BackgroundPosition::horizontalIdentifier | ( |  | ) | const

| If `horizontalType` is `CSS_IDENT` or `CSS_INHERIT` , this attribute contains the string representation of the ident, otherwise it contains an empty string. Definition at line 125 of file css_extensions.cpp.

DOMString CSS2BackgroundPosition::verticalIdentifier | ( |  | ) | const

| If `verticalType` is `CSS_IDENT` or `CSS_INHERIT` , this attribute contains the string representation of the ident, otherwise it contains an empty string. The value is `"center"` if only the horizontalIdentifier has been set. The value is `"inherit"` if the horizontalIdentifier is `"inherit"` . Definition at line 131 of file css_extensions.cpp.

float CSS2BackgroundPosition::getHorizontalPosition | ( | const float | horizontalType | ) |

  | This method is used to get the float value in a specified unit if the `horizontalPosition` represents a length or a percentage. If the float doesn't contain a float value or can't be converted into the specified unit, a `DOMException` is raised. Parameters:
  horizontalType | The specified unit.
  Returns: The float value. Exceptions:
  DOMException | INVALID_ACCESS_ERR: Raises if the property doesn't contain a float or the value can't be converted.
Definition at line 137 of file css_extensions.cpp.

float CSS2BackgroundPosition::getVerticalPosition | ( | const float | verticalType | ) |

  | This method is used to get the float value in a specified unit if the `verticalPosition` represents a length or a percentage. If the float doesn't contain a float value or can't be converted into the specified unit, a `DOMException` is raised. The value is `50%` if only the horizontal value has been specified. Parameters:
  verticalType | The specified unit.
  Returns: The float value. Exceptions:
  DOMException | INVALID_ACCESS_ERR: Raises if the property doesn't contain a float or the value can't be converted.
Definition at line 143 of file css_extensions.cpp.

void CSS2BackgroundPosition::setHorizontalPosition | ( | const unsigned short | horizontalType,
|  | const float | value
| ) |

  | This method is used to set the horizontal position with a specified unit. If the vertical value is not a percentage or a length, it sets the vertical position to `50%` . Parameters:
  horizontalType | The specified unit (a length or a percentage).
  value | The new value.
  Returns: Exceptions:
  DOMException | INVALID_ACCESS_ERR: Raises if the specified unit is not a length or a percentage.
NO_MODIFICATION_ALLOWED_ERR: Raises if this property is readonly. Definition at line 149 of file css_extensions.cpp.

void CSS2BackgroundPosition::setVerticalPosition | ( | const unsigned short | verticalType,
|  | const float | value
| ) |

  | This method is used to set the vertical position with a specified unit. If the horizontal value is not a percentage or a length, it sets the vertical position to `50%` . Parameters:
  verticalType | The specified unit (a length or a percentage).
  value | The new value.
  Returns: Exceptions:
  DOMException | INVALID_ACCESS_ERR: Raises if the specified unit is not a length or a percentage.
NO_MODIFICATION_ALLOWED_ERR: Raises if this property is readonly. Definition at line 155 of file css_extensions.cpp.

void CSS2BackgroundPosition::setPositionIdentifier | ( | const DOM::DOMString & | horizontalIdentifier,
|  | const DOM::DOMString & | verticalIdentifier
| ) |

  | Sets the identifiers. If the second identifier is the empty string, the vertical identifier is set to his default value ( `"center"` ). If the first identfier is `"inherit` , the second identifier is ignored and is set to `"inherit"` . Parameters:
  horizontalIdentifier | The new horizontal identifier.
  verticalIdentifier | The new vertical identifier.
  Returns: Exceptions:
  DOMException | SYNTAX_ERR: Raises if the identifiers have a syntax error and is unparsable.
NO_MODIFICATION_ALLOWED_ERR: Raises if this property is readonly. Definition at line 161 of file css_extensions.cpp.

The documentation for this class was generated from the following files:

- css_extensions.h
- css_extensions.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:35:18 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001