1 /*
   2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3  *
   4  * This code is free software; you can redistribute it and/or modify it
   5  * under the terms of the GNU General Public License version 2 only, as
   6  * published by the Free Software Foundation.  Oracle designates this
   7  * particular file as subject to the "Classpath" exception as provided
   8  * by Oracle in the LICENSE file that accompanied this code.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 
  25 /*
  26  * This file is available under and governed by the GNU General Public
  27  * License version 2 only, as published by the Free Software Foundation.
  28  * However, the following notice accompanied the original version of this
  29  * file and, per its terms, should not be removed:
  30  *
  31  * Copyright (c) 2000 World Wide Web Consortium,
  32  * (Massachusetts Institute of Technology, Institut National de
  33  * Recherche en Informatique et en Automatique, Keio University). All
  34  * Rights Reserved. This program is distributed under the W3C's Software
  35  * Intellectual Property License. This program is distributed in the
  36  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  37  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  38  * PURPOSE.
  39  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  40  */
  41 
  42 package org.w3c.dom.stylesheets;
  43 
  44 import org.w3c.dom.Node;
  45 
  46 /**
  47  *  The <code>StyleSheet</code> interface is the abstract base interface for
  48  * any type of style sheet. It represents a single style sheet associated
  49  * with a structured document. In HTML, the StyleSheet interface represents
  50  * either an external style sheet, included via the HTML  LINK element, or
  51  * an inline  STYLE element. In XML, this interface represents an external
  52  * style sheet, included via a style sheet processing instruction.
  53  * <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>.
  54  * @since DOM Level 2
  55  */
  56 public interface StyleSheet {
  57     /**
  58      *  This specifies the style sheet language for this style sheet. The
  59      * style sheet language is specified as a content type (e.g.
  60      * "text/css"). The content type is often specified in the
  61      * <code>ownerNode</code>. Also see the type attribute definition for
  62      * the <code>LINK</code> element in HTML 4.0, and the type
  63      * pseudo-attribute for the XML style sheet processing instruction.
  64      */
  65     public String getType();
  66 
  67     /**
  68      *  <code>false</code> if the style sheet is applied to the document.
  69      * <code>true</code> if it is not. Modifying this attribute may cause a
  70      * new resolution of style for the document. A stylesheet only applies
  71      * if both an appropriate medium definition is present and the disabled
  72      * attribute is false. So, if the media doesn't apply to the current
  73      * user agent, the <code>disabled</code> attribute is ignored.
  74      */
  75     public boolean getDisabled();
  76     /**
  77      *  <code>false</code> if the style sheet is applied to the document.
  78      * <code>true</code> if it is not. Modifying this attribute may cause a
  79      * new resolution of style for the document. A stylesheet only applies
  80      * if both an appropriate medium definition is present and the disabled
  81      * attribute is false. So, if the media doesn't apply to the current
  82      * user agent, the <code>disabled</code> attribute is ignored.
  83      */
  84     public void setDisabled(boolean disabled);
  85 
  86     /**
  87      *  The node that associates this style sheet with the document. For HTML,
  88      * this may be the corresponding <code>LINK</code> or <code>STYLE</code>
  89      * element. For XML, it may be the linking processing instruction. For
  90      * style sheets that are included by other style sheets, the value of
  91      * this attribute is <code>null</code>.
  92      */
  93     public Node getOwnerNode();
  94 
  95     /**
  96      *  For style sheet languages that support the concept of style sheet
  97      * inclusion, this attribute represents the including style sheet, if
  98      * one exists. If the style sheet is a top-level style sheet, or the
  99      * style sheet language does not support inclusion, the value of this
 100      * attribute is <code>null</code>.
 101      */
 102     public StyleSheet getParentStyleSheet();
 103 
 104     /**
 105      *  If the style sheet is a linked style sheet, the value of its attribute
 106      * is its location. For inline style sheets, the value of this attribute
 107      * is <code>null</code>. See the href attribute definition for the
 108      * <code>LINK</code> element in HTML 4.0, and the href pseudo-attribute
 109      * for the XML style sheet processing instruction.
 110      */
 111     public String getHref();
 112 
 113     /**
 114      *  The advisory title. The title is often specified in the
 115      * <code>ownerNode</code>. See the title attribute definition for the
 116      * <code>LINK</code> element in HTML 4.0, and the title pseudo-attribute
 117      * for the XML style sheet processing instruction.
 118      */
 119     public String getTitle();
 120 
 121     /**
 122      *  The intended destination media for style information. The media is
 123      * often specified in the <code>ownerNode</code>. If no media has been
 124      * specified, the <code>MediaList</code> will be empty. See the media
 125      * attribute definition for the <code>LINK</code> element in HTML 4.0,
 126      * and the media pseudo-attribute for the XML style sheet processing
 127      * instruction . Modifying the media list may cause a change to the
 128      * attribute <code>disabled</code>.
 129      */
 130     public MediaList getMedia();
 131 
 132 }