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.stylesheets;
  13. import org.w3c.dom.Node;
  14. /**
  15. * The <code>StyleSheet</code> interface is the abstract base interface for
  16. * any type of style sheet. It represents a single style sheet associated
  17. * with a structured document. In HTML, the StyleSheet interface represents
  18. * either an external style sheet, included via the HTML LINK element, or
  19. * an inline STYLE element. In XML, this interface represents an external
  20. * style sheet, included via a style sheet processing instruction.
  21. * <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>.
  22. * @since DOM Level 2
  23. */
  24. public interface StyleSheet {
  25. /**
  26. * This specifies the style sheet language for this style sheet. The
  27. * style sheet language is specified as a content type (e.g.
  28. * "text/css"). The content type is often specified in the
  29. * <code>ownerNode</code>. Also see the type attribute definition for
  30. * the <code>LINK</code> element in HTML 4.0, and the type
  31. * pseudo-attribute for the XML style sheet processing instruction.
  32. */
  33. public String getType();
  34. /**
  35. * <code>false</code> if the style sheet is applied to the document.
  36. * <code>true</code> if it is not. Modifying this attribute may cause a
  37. * new resolution of style for the document. A stylesheet only applies
  38. * if both an appropriate medium definition is present and the disabled
  39. * attribute is false. So, if the media doesn't apply to the current
  40. * user agent, the <code>disabled</code> attribute is ignored.
  41. */
  42. public boolean getDisabled();
  43. public void setDisabled(boolean disabled);
  44. /**
  45. * The node that associates this style sheet with the document. For HTML,
  46. * this may be the corresponding <code>LINK</code> or <code>STYLE</code>
  47. * element. For XML, it may be the linking processing instruction. For
  48. * style sheets that are included by other style sheets, the value of
  49. * this attribute is <code>null</code>.
  50. */
  51. public Node getOwnerNode();
  52. /**
  53. * For style sheet languages that support the concept of style sheet
  54. * inclusion, this attribute represents the including style sheet, if
  55. * one exists. If the style sheet is a top-level style sheet, or the
  56. * style sheet language does not support inclusion, the value of this
  57. * attribute is <code>null</code>.
  58. */
  59. public StyleSheet getParentStyleSheet();
  60. /**
  61. * If the style sheet is a linked style sheet, the value of its attribute
  62. * is its location. For inline style sheets, the value of this attribute
  63. * is <code>null</code>. See the href attribute definition for the
  64. * <code>LINK</code> element in HTML 4.0, and the href pseudo-attribute
  65. * for the XML style sheet processing instruction.
  66. */
  67. public String getHref();
  68. /**
  69. * The advisory title. The title is often specified in the
  70. * <code>ownerNode</code>. See the title attribute definition for the
  71. * <code>LINK</code> element in HTML 4.0, and the title pseudo-attribute
  72. * for the XML style sheet processing instruction.
  73. */
  74. public String getTitle();
  75. /**
  76. * The intended destination media for style information. The media is
  77. * often specified in the <code>ownerNode</code>. If no media has been
  78. * specified, the <code>MediaList</code> will be empty. See the media
  79. * attribute definition for the <code>LINK</code> element in HTML 4.0,
  80. * and the media pseudo-attribute for the XML style sheet processing
  81. * instruction . Modifying the media list may cause a change to the
  82. * attribute <code>disabled</code>.
  83. */
  84. public MediaList getMedia();
  85. }