01: /*
02: * Copyright (c) 2000 World Wide Web Consortium,
03: * (Massachusetts Institute of Technology, Institut National de
04: * Recherche en Informatique et en Automatique, Keio University). All
05: * Rights Reserved. This program is distributed under the W3C's Software
06: * Intellectual Property License. This program is distributed in the
07: * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
08: * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
09: * PURPOSE.
10: * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
11: */
12:
13: package org.w3c.dom.css;
14:
15: import org.w3c.dom.DOMException;
16:
17: /**
18: * The <code>CSSCharsetRule</code> interface represents a @charset rule in a
19: * CSS style sheet. The value of the <code>encoding</code> attribute does
20: * not affect the encoding of text data in the DOM objects; this encoding is
21: * always UTF-16. After a stylesheet is loaded, the value of the
22: * <code>encoding</code> attribute is the value found in the
23: * <code>@charset</code> rule. If there was no <code>@charset</code> in the
24: * original document, then no <code>CSSCharsetRule</code> is created. The
25: * value of the <code>encoding</code> attribute may also be used as a hint
26: * for the encoding used on serialization of the style sheet.
27: * <p> The value of the @charset rule (and therefore of the
28: * <code>CSSCharsetRule</code>) may not correspond to the encoding the
29: * document actually came in; character encoding information e.g. in an HTTP
30: * header, has priority (see CSS document representation) but this is not
31: * reflected in the <code>CSSCharsetRule</code>.
32: * <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>.
33: * @since DOM Level 2
34: */
35: public interface CSSCharsetRule extends CSSRule {
36: /**
37: * The encoding information used in this <code>@charset</code> rule.
38: * @exception DOMException
39: * SYNTAX_ERR: Raised if the specified encoding value has a syntax error
40: * and is unparsable.
41: * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this encoding rule is
42: * readonly.
43: */
44: public String getEncoding();
45:
46: /**
47: * The encoding information used in this <code>@charset</code> rule.
48: * @exception DOMException
49: * SYNTAX_ERR: Raised if the specified encoding value has a syntax error
50: * and is unparsable.
51: * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this encoding rule is
52: * readonly.
53: */
54: public void setEncoding(String encoding) throws DOMException;
55:
56: }
|