Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/SharpVectorCore/Css/ICssPrimitiveValue.cs @ 12762

Last change on this file since 12762 was 12762, checked in by aballeit, 9 years ago

#2283 GUI updates, Tree-chart, MCTS Version 2 (prune leaves)

File size: 5.4 KB
Line 
1// <developer>niklas@protocol7.com</developer>
2// <completed>50</completed> 
3
4using System;
5
6namespace SharpVectors.Dom.Css
7{
8  /// <summary>
9  /// The CSSPrimitiveValue interface represents a single CSS value.
10  /// This interface may be used to determine the value of a specific
11  /// style property currently set in a block or to set a specific
12  /// style property explicitly within the block. An instance of this
13  /// interface might be obtained from the getPropertyCSSValue method
14  /// of the CSSStyleDeclaration interface. A CSSPrimitiveValue object
15  /// only occurs in a context of a CSS property.
16  /// </summary>
17  public interface ICssPrimitiveValue
18  {
19    /// <summary>
20    /// The type of the value as defined by the constants specified above.
21    /// </summary>
22    CssPrimitiveType PrimitiveType{get;}
23
24    /// <summary>
25    /// 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
26    /// </summary>
27    /// <param name="unitType">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).</param>
28    /// <param name="floatValue">The new float value.</param>
29    /// <exception cref="DomException">INVALID_ACCESS_ERR: Raised if the attached property doesn't support the float value or the unit type.</exception>
30    /// <exception cref="DomException">NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.</exception>
31    void SetFloatValue(CssPrimitiveType unitType, double floatValue);
32
33    /// <summary>
34    /// 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.
35    /// </summary>
36    /// <param name="unitType">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).</param>
37    /// <returns>The float value in the specified unit.</returns>
38    /// <exception cref="DomException">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.</exception>
39    double GetFloatValue(CssPrimitiveType unitType);
40
41    /// <summary>
42    /// 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.
43    /// </summary>
44    /// <param name="stringType">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).</param>
45    /// <param name="stringValue">The new string value.</param>
46    /// <exception cref="DomException">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.</exception>
47    /// <exception cref="DomException">NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.</exception>
48    void SetStringValue(CssPrimitiveType stringType,  string stringValue);
49 
50    /// <summary>
51    /// This method is used to get the string value. If the CSS value doesn't contain a string value, a DOMException is raised.
52    /// Note: Some properties (like 'font-family' or 'voice-family') convert a whitespace separated list of idents to a string.
53    /// </summary>
54    /// <returns>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).</returns>
55    /// <exception cref="DomException">INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string value.</exception>
56    string GetStringValue();
57
58    /// <summary>
59    /// 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
60    /// </summary>
61    /// <returns>The Counter value</returns>
62    /// <exception cref="DomException">INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Counter value (e.g. this is not CSS_COUNTER).</exception>
63    ICssCounter GetCounterValue();
64
65    /// <summary>
66    /// 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.
67    /// </summary>
68    /// <returns>The Rect value</returns>
69    /// <exception cref="DomException">INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Rect value. (e.g. this is not CSS_RECT).</exception>
70    ICssRect GetRectValue();
71
72    /// <summary>
73    /// 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.
74    /// </summary>
75    /// <returns>the RGB color value.</returns>
76    /// <exception cref="DomException">INVALID_ACCESS_ERR: Raised if the attached property can't return a RGB color value (e.g. this is not CSS_RGBCOLOR).</exception>
77    ICssColor GetRgbColorValue();
78
79  }
80}
Note: See TracBrowser for help on using the repository browser.