Holds a set of css style properties.
Public Member Functions | |
Style (Node element) | |
Creates a new style for the given element. More... | |
Style (string text, Node element) | |
Creates a new style with the given css text string seperated by semicolons. More... | |
Style | Clone () |
Clone this style object. More... | |
string | getPropertyValue (string property) |
JS API for getting property values. In PowerUI you can just use this[property] instead. More... | |
void | CopyTo (Style otherStyle, StyleCopyMode mode) |
Copies this objects properties to the other given style, overwriting existing properties if told to do so. More... | |
void | LoadProperties (CssLexer lexer, OnReadProperty onPropertyRead) |
Reads the properties for this style block from the lexer. Essentially treats it like a set of properties only. Terminated by }, null or >. More... | |
Value | Get (string cssProperty) |
Gets the value of the given property, if any. More... | |
void | CallChange (CssProperty property, Value value) |
Lets the sheet know that a value changed. Non-alias values here only. More... | |
virtual ComputedStyle | GetComputed () |
Gets the computed form of this style. More... | |
Css.Value | Set (string cssProperty, string valueText) |
Sets the named property on this style to the given value. More... | |
void | SetComposite (string cssProperty, Css.Value newValue, Css.Value composite) |
Sets a property from a composite set. Any new values that are null are set to the initial value and inherit the specifity from the composite value. More... | |
virtual void | OnChanged (CssProperty property, Value newValue) |
called when the named property changes. More... | |
virtual string | GetString (string cssProperty) |
Gets the given property as a css string. May optionally read the given inner index of it as a css string. More... | |
override string | ToString () |
Static Public Member Functions | |
static Style | Create (string properties, Node element) |
Creates a style from the given property block with the given parent. More... | |
Public Attributes | |
Node | Element |
The element that this style belongs to, if any. More... | |
Dictionary< CssProperty, Value > | Properties =new Dictionary<CssProperty,Value>() |
The mapping of css property (e.g. display) to value ("none" as a Css.Value). Do not set values directly into this - use style[property]=value; instead to correctly handle aliases. More... | |
Package Functions | |
Css.Value | GetBaseValue (CssProperty property) |
Gets or creates the base value for the given property. The base value is essentially the value held directly in this style sheet. E.g. if the value you're setting is the R channel of color-overlay, this sets up the color-overlay value for you. More... | |
Properties | |
ReflowDocument | document [get] |
The document containing this style. More... | |
string | cssText [get, set] |
Sets the css text of this style as a css string seperated by semicolons (;). More... | |
Value | this[string cssProperty] [get, set] |
Gets or sets the parsed value of this style by property name. More... | |
virtual Value | this[CssProperty property] [get, set] |
Gets or sets the parsed value of this style by property name. More... | |
|
inline |
Creates a new style for the given element.
element | The element this style is for. |
|
inline |
Creates a new style with the given css text string seperated by semicolons.
text | A css text string to apply to this style. |
|
inline |
Lets the sheet know that a value changed. Non-alias values here only.
|
inline |
Clone this style object.
|
inline |
Copies this objects properties to the other given style, overwriting existing properties if told to do so.
otherStyle | The style to copy this objects properties into. |
overwrite | True if existing properties should be overwriten. |
Creates a style from the given property block with the given parent.
|
inline |
Gets the value of the given property, if any.
cssProperty | The property to get the value of, e.g. "display". |
|
inlinepackage |
Gets or creates the base value for the given property. The base value is essentially the value held directly in this style sheet. E.g. if the value you're setting is the R channel of color-overlay, this sets up the color-overlay value for you.
|
inlinevirtual |
|
inline |
JS API for getting property values. In PowerUI you can just use this[property] instead.
|
inlinevirtual |
Gets the given property as a css string. May optionally read the given inner index of it as a css string.
property | The property to get as a string. |
innerIndex | The inner value to get from the property. -1 for the whole property. |
Reimplemented in Css.ElementStyle.
|
inline |
Reads the properties for this style block from the lexer. Essentially treats it like a set of properties only. Terminated by }, null or >.
|
inlinevirtual |
called when the named property changes.
property | The property that changed. |
newValue | It's new fully parsed value. May be null. |
Reimplemented in Css.ElementStyle.
|
inline |
Sets the named property on this style to the given value.
cssProperty | The property to set or overwrite. e.g. "display". |
value | The value to set the property to, e.g. "none". |
Sets a property from a composite set. Any new values that are null are set to the initial value and inherit the specifity from the composite value.
|
inline |
Node Css.Style.Element |
The element that this style belongs to, if any.
Dictionary<CssProperty,Value> Css.Style.Properties =new Dictionary<CssProperty,Value>() |
The mapping of css property (e.g. display) to value ("none" as a Css.Value). Do not set values directly into this - use style[property]=value; instead to correctly handle aliases.
|
getset |
Sets the css text of this style as a css string seperated by semicolons (;).
|
get |
The document containing this style.
|
getset |
Gets or sets the parsed value of this style by property name.
property | The property to get the value for. |
|
getset |
Gets or sets the parsed value of this style by property name.
property | The property to get the value for. |