1. /*
  2. * Copyright (c) 2000 World Wide Web Consortium,
  3. * (Massachusetts Institute of Technology, Institut National de
  4. * Recherche en Informatique et en Automatique, Keio University). All
  5. * Rights Reserved. This program is distributed under the W3C's Software
  6. * Intellectual Property License. This program is distributed in the
  7. * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  8. * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  9. * PURPOSE.
  10. * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  11. */
  12. package org.w3c.dom.css;
  13. import org.w3c.dom.DOMException;
  14. /**
  15. * The <code>CSSValue</code> interface represents a simple or a complex
  16. * value. A <code>CSSValue</code> object only occurs in a context of a CSS
  17. * property.
  18. * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
  19. * @since DOM Level 2
  20. */
  21. public interface CSSValue {
  22. // UnitTypes
  23. /**
  24. * The value is inherited and the <code>cssText</code> contains "inherit".
  25. */
  26. public static final short CSS_INHERIT = 0;
  27. /**
  28. * The value is a primitive value and an instance of the
  29. * <code>CSSPrimitiveValue</code> interface can be obtained by using
  30. * binding-specific casting methods on this instance of the
  31. * <code>CSSValue</code> interface.
  32. */
  33. public static final short CSS_PRIMITIVE_VALUE = 1;
  34. /**
  35. * The value is a <code>CSSValue</code> list and an instance of the
  36. * <code>CSSValueList</code> interface can be obtained by using
  37. * binding-specific casting methods on this instance of the
  38. * <code>CSSValue</code> interface.
  39. */
  40. public static final short CSS_VALUE_LIST = 2;
  41. /**
  42. * The value is a custom value.
  43. */
  44. public static final short CSS_CUSTOM = 3;
  45. /**
  46. * A string representation of the current value.
  47. * @exception DOMException
  48. * SYNTAX_ERR: Raised if the specified CSS string value has a syntax
  49. * error (according to the attached property) or is unparsable.
  50. * <br>INVALID_MODIFICATION_ERR: Raised if the specified CSS string
  51. * value represents a different type of values than the values allowed
  52. * by the CSS property.
  53. * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this value is readonly.
  54. */
  55. public String getCssText();
  56. public void setCssText(String cssText)
  57. throws DOMException;
  58. /**
  59. * A code defining the type of the value as defined above.
  60. */
  61. public short getCssValueType();
  62. }