Class CSSPrimitiveValue

Class CSSPrimitiveValue

Namespace: Aspose.Html.Dom.Css
Assembly: Aspose.HTML.dll (25.2.0)

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 property explicitly within the block. An instance of this interface might be obtained from the getPropertyCSSValue method of the CSSStyleDeclaration interface. A CSSPrimitiveValue object only occurs in a context of a CSS property.

[DOMObject]
[DOMName("CSSPrimitiveValue")]
[ComVisible(true)]
public abstract class CSSPrimitiveValue : CSSValue, INotifyPropertyChanged

Inheritance

objectDOMObjectCSSValueCSSPrimitiveValue

Implements

INotifyPropertyChanged

Inherited Members

CSSValue.CSS_INHERIT, CSSValue.CSS_PRIMITIVE_VALUE, CSSValue.CSS_VALUE_LIST, CSSValue.CSS_CUSTOM, CSSValue.ToString(), CSSValue.GetPlatformType(), CSSValue.Equals(CSSValue), CSSValue.Equals(object), CSSValue.GetHashCode(), CSSValue.CSSText, CSSValue.CSSValueType, DOMObject.GetPlatformType(), object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

CSSPrimitiveValue(ushort)

Initializes a new instance of the Aspose.Html.Dom.Css.CSSPrimitiveValue class.

protected CSSPrimitiveValue(ushort unitType)

Parameters

unitType ushort

Type of the unit.

Fields

CSS_ATTR

The value is a attribute function. The value can be obtained by using the getStringValue method.

public const ushort CSS_ATTR = 24

Field Value

ushort

CSS_CH

The value is a length (ch). The value can be obtained by using the getFloatValue method.

public const ushort CSS_CH = 20

Field Value

ushort

CSS_CM

The value is a length (cm). The value can be obtained by using the getFloatValue method.

public const ushort CSS_CM = 6

Field Value

ushort

CSS_COUNTER

The value is a counter or counters function. The value can be obtained by using the GetCounterValue method.

public const ushort CSS_COUNTER = 25

Field Value

ushort

CSS_DEG

The value is an angle (deg). The value can be obtained by using the getFloatValue method.

public const ushort CSS_DEG = 11

Field Value

ushort

CSS_DIMENSION

The value is a number with an unknown dimension. The value can be obtained by using the getFloatValue method.

public const ushort CSS_DIMENSION = 18

Field Value

ushort

CSS_DPCM

The value is a dots per centimeter (dpcm).

public const ushort CSS_DPCM = 29

Field Value

ushort

CSS_DPI

The value is a dots per inch (dpi).

public const ushort CSS_DPI = 28

Field Value

ushort

CSS_DPPX

The value is a dots per ‘px’ unit (dppx).

public const ushort CSS_DPPX = 30

Field Value

ushort

CSS_EMS

The value is a length (ems). The value can be obtained by using the getFloatValue method.

public const ushort CSS_EMS = 3

Field Value

ushort

CSS_EXS

The value is a length (exs). The value can be obtained by using the getFloatValue method.

public const ushort CSS_EXS = 4

Field Value

ushort

CSS_GRAD

The value is an angle (grad). The value can be obtained by using the getFloatValue method.

public const ushort CSS_GRAD = 13

Field Value

ushort

CSS_HZ

The value is a frequency (Hz). The value can be obtained by using the getFloatValue method.

public const ushort CSS_HZ = 16

Field Value

ushort

CSS_IDENT

The value is an identifier. The value can be obtained by using the getStringValue method.

public const ushort CSS_IDENT = 23

Field Value

ushort

CSS_IN

The value is a length (in). The value can be obtained by using the getFloatValue method.

public const ushort CSS_IN = 8

Field Value

ushort

CSS_KHZ

The value is a frequency (kHz). The value can be obtained by using the getFloatValue method.

public const ushort CSS_KHZ = 17

Field Value

ushort

CSS_MM

The value is a length (mm). The value can be obtained by using the getFloatValue method.

public const ushort CSS_MM = 7

Field Value

ushort

CSS_MS

The value is a time (ms). The value can be obtained by using the getFloatValue method.

public const ushort CSS_MS = 14

Field Value

ushort

CSS_NUMBER

The value is a simple number. The value can be obtained by using the getFloatValue method.

public const ushort CSS_NUMBER = 1

Field Value

ushort

CSS_PC

The value is a length (pc). The value can be obtained by using the getFloatValue method.

public const ushort CSS_PC = 10

Field Value

ushort

CSS_PERCENTAGE

The value is a percentage. The value can be obtained by using the getFloatValue method.

public const ushort CSS_PERCENTAGE = 2

Field Value

ushort

CSS_PT

The value is a length (pt). The value can be obtained by using the getFloatValue method.

public const ushort CSS_PT = 9

Field Value

ushort

CSS_PX

The value is a length (px). The value can be obtained by using the getFloatValue method.

public const ushort CSS_PX = 5

Field Value

ushort

CSS_RAD

The value is an angle (rad). The value can be obtained by using the getFloatValue method.

public const ushort CSS_RAD = 12

Field Value

ushort

CSS_RECT

The value is a rect function. The value can be obtained by using the GetRectValue method.

public const ushort CSS_RECT = 26

Field Value

ushort

CSS_REM

The value is a length (rem). The value can be obtained by using the getFloatValue method.

public const ushort CSS_REM = 19

Field Value

ushort

CSS_RGBCOLOR

The value is a RGB color. The value can be obtained by using the GetRGBColorValue method.

public const ushort CSS_RGBCOLOR = 27

Field Value

ushort

CSS_S

The value is a time (s). The value can be obtained by using the getFloatValue method.

public const ushort CSS_S = 15

Field Value

ushort

CSS_STRING

The value is a STRING. The value can be obtained by using the getStringValue method.

public const ushort CSS_STRING = 21

Field Value

ushort

CSS_UNKNOWN

The value is not a recognized CSS2 value. The value can only be obtained by using the cssText attribute.

public const ushort CSS_UNKNOWN = 0

Field Value

ushort

CSS_URI

The value is a URI. The value can be obtained by using the getStringValue method.

public const ushort CSS_URI = 22

Field Value

ushort

CSS_VH

The value is a percentage of the full viewport height.

public const ushort CSS_VH = 32

Field Value

ushort

CSS_VMAX

The value is a percentage of the viewport width or height, whichever is larger.

public const ushort CSS_VMAX = 34

Field Value

ushort

CSS_VMIN

The value is a percentage of the viewport width or height, whichever is smaller.

public const ushort CSS_VMIN = 33

Field Value

ushort

CSS_VW

The value is a percentage of the full viewport width.

public const ushort CSS_VW = 31

Field Value

ushort

Properties

PrimitiveType

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

[DOMName("primitiveType")]
public ushort PrimitiveType { get; }

Property Value

ushort

Methods

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.

[DOMName("getCounterValue")]
public abstract Counter GetCounterValue()

Returns

Counter

Returns Counter value

GetFloatValue(ushort)

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.

[DOMName("getFloatValue")]
public abstract float GetFloatValue(ushort unitType)

Parameters

unitType ushort

Type of the unit.

Returns

float

Returns value

GetIntValue(ushort)

This method is used to get an int value in a specified unit. If this CSS value doesn’t contain an int value or can’t be converted into the specified unit, a DOMException is raised.

public abstract int GetIntValue(ushort unitType)

Parameters

unitType ushort

Type of the unit.

Returns

int

Returns value

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.

[DOMName("getRGBColorValue")]
public abstract RGBColor GetRGBColorValue()

Returns

RGBColor

Returns RGB color value

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.

[DOMName("getRectValue")]
public abstract Rect GetRectValue()

Returns

Rect

Returns Rect value

GetStringValue()

This method is used to get the string value. If the CSS value doesn’t contain a string value, a DOMException is raised.

[DOMName("getStringValue")]
public abstract string GetStringValue()

Returns

string

Returns value

SetFloatValue(ushort, float)

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.

[DOMName("setFloatValue")]
public abstract void SetFloatValue(ushort unitType, float floatValue)

Parameters

unitType ushort

Type of the unit.

floatValue float

The float value.

SetIntValue(ushort, int)

A method to set the int value with a specified unit. If the property attached with this value can not accept the specified unit or the int value, the value will be unchanged and a DOMException will be raised.

public abstract void SetIntValue(ushort unitType, int intValue)

Parameters

unitType ushort

Type of the unit.

intValue int

The int value.

SetStringValue(ushort, string)

A method to set the string value with the 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.

[DOMName("setStringValue")]
public abstract void SetStringValue(ushort stringType, string stringValue)

Parameters

stringType ushort

Type of the string.

stringValue string

The string value.