~ubuntu-branches/ubuntu/gutsy/libjaxp1.3-java/gutsy

« back to all changes in this revision

Viewing changes to org/w3c/dom/html/HTMLDocument.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2006-08-03 10:30:58 UTC
  • Revision ID: james.westby@ubuntu.com-20060803103058-7jwwiqv9g8w9094d
Tags: upstream-1.3.03
ImportĀ upstreamĀ versionĀ 1.3.03

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 1998 World Wide Web Consortium, (Massachusetts Institute of
 
3
 * Technology, Institut National de Recherche en Informatique et en
 
4
 * Automatique, Keio University).
 
5
 * All Rights Reserved. http://www.w3.org/Consortium/Legal/
 
6
 */
 
7
 
 
8
package org.w3c.dom.html;
 
9
 
 
10
import org.w3c.dom.*;
 
11
 
 
12
/**
 
13
 * An <code>HTMLDocument</code> is the root of the HTML hierarchy andholds the 
 
14
 * entire content. Beside providing access to the hierarchy, italso provides 
 
15
 * some convenience methods for accessing certain sets ofinformation from the 
 
16
 * document.
 
17
 * <p>The following properties have been deprecated in favor of the
 
18
 * corresponding ones for the BODY element:alinkColorbackgroundbgColorfgColor
 
19
 * linkColorvlinkColor
 
20
 *  
 
21
 */
 
22
public interface HTMLDocument extends Document {
 
23
  /**
 
24
   * The title of a document as specified by the <code>TITLE</code>element in 
 
25
   * the head of the document. 
 
26
   */
 
27
  public String             getTitle();
 
28
  public void               setTitle(String title);
 
29
  /**
 
30
   * Returns the URI of the page that linked to this page. The value isan 
 
31
   * empty string if the user navigated to the page directly (notthrough a 
 
32
   * link, but, for example, via a bookmark). 
 
33
   */
 
34
  public String             getReferrer();
 
35
  /**
 
36
   * The domain name of the server that served the document, or a nullstring 
 
37
   * if the server cannot be identified by a domain name. 
 
38
   */
 
39
  public String             getDomain();
 
40
  /**
 
41
   * The complete URI of the document. 
 
42
   */
 
43
  public String             getURL();
 
44
  /**
 
45
   * The element that contains the content for the document. In documentswith 
 
46
   * <code>BODY</code> contents, returns the <code>BODY</code>element, and in 
 
47
   * frameset documents, this returns the outermost<code>FRAMESET</code> 
 
48
   * element. 
 
49
   */
 
50
  public HTMLElement        getBody();
 
51
  public void               setBody(HTMLElement body);
 
52
  /**
 
53
   * A collection of all the <code>IMG</code> elements in a document.The 
 
54
   * behavior is limited to <code>IMG</code> elements forbackwards 
 
55
   * compatibility. 
 
56
   */
 
57
  public HTMLCollection     getImages();
 
58
  /**
 
59
   * A collection of all the <code>OBJECT</code> elements that includeapplets 
 
60
   * and <code>APPLET</code> (deprecated) elements ina document. 
 
61
   */
 
62
  public HTMLCollection     getApplets();
 
63
  /**
 
64
   * A collection of all <code>AREA</code> elements andanchor (<code>A</code>) 
 
65
   * elements in a documentwith a value for the <code>href</code> attribute. 
 
66
   */
 
67
  public HTMLCollection     getLinks();
 
68
  /**
 
69
   * A collection of all the forms of a document. 
 
70
   */
 
71
  public HTMLCollection     getForms();
 
72
  /**
 
73
   * A collection of all the anchor (<code>A</code>) elements in a document
 
74
   * with a value for the <code>name</code> attribute.Note. For reasons of 
 
75
   * backwardscompatibility, the returned set of anchors only contains those 
 
76
   * anchors created with the <code>name</code> attribute, not those created 
 
77
   * with the <code>id</code> attribute. 
 
78
   */
 
79
  public HTMLCollection     getAnchors();
 
80
  /**
 
81
   * The cookies associated with this document. If there are none, thevalue is 
 
82
   * an empty string. Otherwise, the value is a string: asemicolon-delimited 
 
83
   * list of "name, value" pairs for all the cookiesassociated with the page. 
 
84
   * For example, <code>name=value;expires=date</code>. 
 
85
   */
 
86
  public String             getCookie();
 
87
  public void               setCookie(String cookie);
 
88
  /**
 
89
   * Note.This method and the ones following allow a user to add to or replace 
 
90
   * the structuremodel of a document using strings of unparsed HTML. At the 
 
91
   * time of writing alternate methods for providing similar functionality 
 
92
   * for both HTML and XML documents were being considered. The following 
 
93
   * methodsmay be deprecated at some point in the future in favor of a more
 
94
   * general-purpose mechanism.
 
95
   * <br>Open a document stream for writing. If a document exists in the
 
96
   * target, this method clears it.
 
97
   */
 
98
  public void               open();
 
99
  /**
 
100
   * Closes a document stream opened by <code>open()</code>and forces 
 
101
   * rendering.
 
102
   */
 
103
  public void               close();
 
104
  /**
 
105
   * Write a string of text to a document stream opened by<code>open()</code>. 
 
106
   * The text is parsed into the document's structuremodel.
 
107
   * @param text The string to be parsed into some structure in the document 
 
108
   *   structuremodel.
 
109
   */
 
110
  public void               write(String text);
 
111
  /**
 
112
   * Write a string of text followed by a newline character to a document
 
113
   * stream opened by <code>open()</code>. The text is parsed into the
 
114
   * document's structure model.
 
115
   * @param text The string to be parsed into some structure in the document 
 
116
   *   structuremodel.
 
117
   */
 
118
  public void               writeln(String text);
 
119
  /**
 
120
   * Returns the Element whose <code>id</code> is given by elementId. If no 
 
121
   * such element exists, returns <code>null</code>. Behavior is not defined 
 
122
   * if more than one element has this <code>id</code>. 
 
123
   * @param elementId The unique <code>id</code> value for an element.
 
124
   * @return The matching element.
 
125
   */
 
126
  public Element            getElementById(String elementId);
 
127
  /**
 
128
   * Returns the (possibly empty) collection of elements whose<code>name</code>
 
129
   *  value is given by <code>elementName</code>.
 
130
   * @param elementName The <code>name</code> attribute value for an element.
 
131
   * @return The matching elements.
 
132
   */
 
133
  public NodeList           getElementsByName(String elementName);
 
134
}
 
135