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
object ← DOMObject ← CSSValue ← CSSPrimitiveValue
Implements
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
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
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
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
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
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
CSS_DPCM
The value is a dots per centimeter (dpcm).
public const ushort CSS_DPCM = 29
Field Value
CSS_DPI
The value is a dots per inch (dpi).
public const ushort CSS_DPI = 28
Field Value
CSS_DPPX
The value is a dots per ‘px’ unit (dppx).
public const ushort CSS_DPPX = 30
Field Value
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
CSS_VH
The value is a percentage of the full viewport height.
public const ushort CSS_VH = 32
Field Value
CSS_VMAX
The value is a percentage of the viewport width or height, whichever is larger.
public const ushort CSS_VMAX = 34
Field Value
CSS_VMIN
The value is a percentage of the viewport width or height, whichever is smaller.
public const ushort CSS_VMIN = 33
Field Value
CSS_VW
The value is a percentage of the full viewport width.
public const ushort CSS_VW = 31
Field Value
Properties
PrimitiveType
The type of the value as defined by the constants specified above.
[DOMName("primitiveType")]
public ushort PrimitiveType { get; }
Property Value
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
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
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
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
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
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
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.