// niklas@protocol7.com // 50 using System; namespace SharpVectors.Dom.Css { /// /// 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. /// public interface ICssPrimitiveValue { /// /// The type of the value as defined by the constants specified above. /// CssPrimitiveType PrimitiveType{get;} /// /// 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 /// /// A unit code as defined above. The unit code can only be a float unit type (i.e. CSS_NUMBER, CSS_PERCENTAGE, CSS_EMS, CSS_EXS, 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). /// The new float value. /// INVALID_ACCESS_ERR: Raised if the attached property doesn't support the float value or the unit type. /// NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. void SetFloatValue(CssPrimitiveType unitType, double floatValue); /// /// 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. /// /// A unit code to get the float value. The unit code can only be a float unit type (i.e. CSS_NUMBER, CSS_PERCENTAGE, CSS_EMS, CSS_EXS, 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). /// The float value in the specified unit. /// INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a float value or if the float value can't be converted into the specified unit. double GetFloatValue(CssPrimitiveType unitType); /// /// 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. /// /// A string code as defined above. The string code can only be a string unit type (i.e. CSS_STRING, CSS_URI, CSS_IDENT, and CSS_ATTR). /// The new string value. /// INVALID_ACCESS_ERR: Raised 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. void SetStringValue(CssPrimitiveType stringType, string stringValue); /// /// This method is used to get the string value. If the CSS value doesn't contain a string value, a DOMException is raised. /// Note: Some properties (like 'font-family' or 'voice-family') convert a whitespace separated list of idents to a string. /// /// The string value in the current unit. The current primitiveType can only be a string unit type (i.e. CSS_STRING, CSS_URI, CSS_IDENT and CSS_ATTR). /// INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string value. string GetStringValue(); /// /// 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 /// /// The Counter value /// INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Counter value (e.g. this is not CSS_COUNTER). ICssCounter GetCounterValue(); /// /// 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. /// /// The Rect value /// INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Rect value. (e.g. this is not CSS_RECT). ICssRect GetRectValue(); /// /// 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. /// /// the RGB color value. /// INVALID_ACCESS_ERR: Raised if the attached property can't return a RGB color value (e.g. this is not CSS_RGBCOLOR). ICssColor GetRgbColorValue(); } }