\section{DOM::HTMLDocument Class Reference}
\label{classDOM_1_1HTMLDocument}\index{DOM::HTMLDocument@{DOM::HTMLDocument}}
An {\tt  {\bf HTMLDocument}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument})} } is the root of the HTML hierarchy and holds the entire content.  


{\tt \#include $<$html\_\-document.h$>$}

Inheritance diagram for DOM::HTMLDocument:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=82pt]{classDOM_1_1HTMLDocument__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for DOM::HTMLDocument:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=82pt]{classDOM_1_1HTMLDocument__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf HTMLDocument} ({\bf KHTMLView} $\ast$parent)
\begin{CompactList}\small\item\em The parent is the widget the document should render itself in. \item\end{CompactList}\item 
{\bf HTMLDocument} (const  {\bf HTMLDocument} \&other)\label{classDOM_1_1HTMLDocument_a2}

\item 
{\bf HTMLDocument} (const  {\bf Node} \&other)\label{classDOM_1_1HTMLDocument_a3}

\item 
{\bf HTMLDocument} \& {\bf operator=} (const  {\bf HTMLDocument} \&other)\label{classDOM_1_1HTMLDocument_a4}

\item 
{\bf HTMLDocument} \& {\bf operator=} (const  {\bf Node} \&other)\label{classDOM_1_1HTMLDocument_a5}

\item 
{\bf DOMString} {\bf title} () const 
\begin{CompactList}\small\item\em The title of a document as specified by the {\tt  TITLE } element in the head of the document. \item\end{CompactList}\item 
void {\bf set\-Title} (const  {\bf DOMString} \&)
\begin{CompactList}\small\item\em see {\bf title}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a7})} \item\end{CompactList}\item 
{\bf DOMString} {\bf referrer} () const 
\begin{CompactList}\small\item\em Returns the URI of the page that linked to this page. \item\end{CompactList}\item 
{\bf DOMString} {\bf domain} () const 
\begin{CompactList}\small\item\em The domain name of the server that served the document, or a null string if the server cannot be identified by a domain name. \item\end{CompactList}\item 
{\bf DOMString} {\bf URL} () const 
\begin{CompactList}\small\item\em The absolute URI of the document. \item\end{CompactList}\item 
{\bf HTMLElement} {\bf body} () const 
\begin{CompactList}\small\item\em The element that contains the content for the document. \item\end{CompactList}\item 
void {\bf set\-Body} (const  {\bf HTMLElement} \&)
\begin{CompactList}\small\item\em see {\bf body}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a12})} \item\end{CompactList}\item 
{\bf HTMLCollection} {\bf images} () const 
\begin{CompactList}\small\item\em A collection of all the {\tt  IMG } elements in a document. \item\end{CompactList}\item 
{\bf HTMLCollection} {\bf applets} () const 
\begin{CompactList}\small\item\em A collection of all the {\tt  OBJECT } elements that include applets and {\tt  APPLET } ( deprecated ) elements in a document. \item\end{CompactList}\item 
{\bf HTMLCollection} {\bf links} () const 
\begin{CompactList}\small\item\em A collection of all {\tt  AREA } elements and anchor ( {\tt  A } ) elements in a document with a value for the {\tt  href } attribute. \item\end{CompactList}\item 
{\bf HTMLCollection} {\bf forms} () const 
\begin{CompactList}\small\item\em A collection of all the forms of a document. \item\end{CompactList}\item 
{\bf HTMLCollection} {\bf anchors} () const 
\begin{CompactList}\small\item\em A collection of all the anchor ( {\tt  A } ) elements in a document with a value for the {\tt  name } attribute. \item\end{CompactList}\item 
{\bf DOMString} {\bf cookie} () const 
\begin{CompactList}\small\item\em The cookies associated with this document. \item\end{CompactList}\item 
void {\bf set\-Cookie} (const  {\bf DOMString} \&)
\begin{CompactList}\small\item\em see {\bf cookie}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a19})} \item\end{CompactList}\item 
void {\bf open} ()
\begin{CompactList}\small\item\em Note. \item\end{CompactList}\item 
void {\bf close} ()
\begin{CompactList}\small\item\em Closes a document stream opened by {\tt  {\bf open()}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a21})} } and forces rendering. \item\end{CompactList}\item 
void {\bf write} (const  {\bf DOMString} \&text)
\begin{CompactList}\small\item\em Write a string of text to a document stream opened by {\tt  {\bf open()}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a21})} } . \item\end{CompactList}\item 
void {\bf writeln} (const  {\bf DOMString} \&text)
\begin{CompactList}\small\item\em Write a string of text followed by a newline character to a document stream opened by {\tt  {\bf open()}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a21})} } . \item\end{CompactList}\item 
{\bf Node\-List} {\bf get\-Elements\-By\-Name} (const  {\bf DOMString} \&element\-Name)
\begin{CompactList}\small\item\em Returns the (possibly empty) collection of elements whose {\tt  name } value is given by {\tt  element\-Name } . \item\end{CompactList}\item 
{\bf DOMString} {\bf complete\-URL} (const  {\bf DOMString} \&url) const 
\begin{CompactList}\small\item\em not part of the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} \item\end{CompactList}\item 
{\bf DOMString} {\bf last\-Modified} () const 
\begin{CompactList}\small\item\em Not part of the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})}. \item\end{CompactList}\item 
{\bf HTMLCollection} {\bf all} () const 
\begin{CompactList}\small\item\em Not part of the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf HTMLDocument} (HTMLDocument\-Impl $\ast$impl)\label{classDOM_1_1HTMLDocument_b0}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf ::KHTMLView}\label{classDOM_1_1HTMLDocument_n0}

\item 
class {\bf ::KHTMLPart}\label{classDOM_1_1HTMLDocument_n1}

\item 
class {\bf DOMImplementation}\label{classDOM_1_1HTMLDocument_n2}

\end{CompactItemize}


\subsection{Detailed Description}
An {\tt  {\bf HTMLDocument}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument})} } is the root of the HTML hierarchy and holds the entire content. 

Beside providing access to the hierarchy, it also provides some convenience methods for accessing certain sets of information from the document.

The following properties have been deprecated in favor of the corresponding ones for the BODY element:

alink\-Color

background

bg\-Color

fg\-Color

link\-Color

vlink\-Color



Definition at line 73 of file html\_\-document.h.

\subsection{Constructor \& Destructor Documentation}
\index{DOM::HTMLDocument@{DOM::HTMLDocument}!HTMLDocument@{HTMLDocument}}
\index{HTMLDocument@{HTMLDocument}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}HTMLDocument::HTMLDocument ({\bf KHTMLView} $\ast$ {\em parent})}\label{classDOM_1_1HTMLDocument_a1}


The parent is the widget the document should render itself in. 

Rendering information (like sizes, etc...) is only created if parent != 0 

Definition at line 42 of file html\_\-document.cpp.

\subsection{Member Function Documentation}
\index{DOM::HTMLDocument@{DOM::HTMLDocument}!title@{title}}
\index{title@{title}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} HTMLDocument::title () const}\label{classDOM_1_1HTMLDocument_a7}


The title of a document as specified by the {\tt  TITLE } element in the head of the document. 



Definition at line 84 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!setTitle@{setTitle}}
\index{setTitle@{setTitle}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void HTMLDocument::set\-Title (const {\bf DOMString} \&)}\label{classDOM_1_1HTMLDocument_a8}


see {\bf title}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a7})} 



Definition at line 90 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!referrer@{referrer}}
\index{referrer@{referrer}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} HTMLDocument::referrer () const}\label{classDOM_1_1HTMLDocument_a9}


Returns the URI of the page that linked to this page. 

The value is an empty string if the user navigated to the page directly (not through a link, but, for example, via a bookmark). 

Definition at line 96 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!domain@{domain}}
\index{domain@{domain}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} HTMLDocument::domain () const}\label{classDOM_1_1HTMLDocument_a10}


The domain name of the server that served the document, or a null string if the server cannot be identified by a domain name. 



Definition at line 109 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!URL@{URL}}
\index{URL@{URL}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} HTMLDocument::URL () const}\label{classDOM_1_1HTMLDocument_a11}


The absolute URI of the document. 



Definition at line 121 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!body@{body}}
\index{body@{body}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf HTMLElement} HTMLDocument::body () const}\label{classDOM_1_1HTMLDocument_a12}


The element that contains the content for the document. 

In documents with {\tt  BODY } contents, returns the {\tt  BODY } element, and in frameset documents, this returns the outermost {\tt  FRAMESET } element. 

Definition at line 127 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!setBody@{setBody}}
\index{setBody@{setBody}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void HTMLDocument::set\-Body (const {\bf HTMLElement} \&)}\label{classDOM_1_1HTMLDocument_a13}


see {\bf body}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a12})} 



Definition at line 133 of file html\_\-document.cpp.

References DOM::Node::handle().\index{DOM::HTMLDocument@{DOM::HTMLDocument}!images@{images}}
\index{images@{images}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf HTMLCollection} HTMLDocument::images () const}\label{classDOM_1_1HTMLDocument_a14}


A collection of all the {\tt  IMG } elements in a document. 

The behavior is limited to {\tt  IMG } elements for backwards compatibility. 

Definition at line 140 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!applets@{applets}}
\index{applets@{applets}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf HTMLCollection} HTMLDocument::applets () const}\label{classDOM_1_1HTMLDocument_a15}


A collection of all the {\tt  OBJECT } elements that include applets and {\tt  APPLET } ( deprecated ) elements in a document. 



Definition at line 146 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!links@{links}}
\index{links@{links}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf HTMLCollection} HTMLDocument::links () const}\label{classDOM_1_1HTMLDocument_a16}


A collection of all {\tt  AREA } elements and anchor ( {\tt  A } ) elements in a document with a value for the {\tt  href } attribute. 



Definition at line 152 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!forms@{forms}}
\index{forms@{forms}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf HTMLCollection} HTMLDocument::forms () const}\label{classDOM_1_1HTMLDocument_a17}


A collection of all the forms of a document. 



Definition at line 158 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!anchors@{anchors}}
\index{anchors@{anchors}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf HTMLCollection} HTMLDocument::anchors () const}\label{classDOM_1_1HTMLDocument_a18}


A collection of all the anchor ( {\tt  A } ) elements in a document with a value for the {\tt  name } attribute. 

Note. For reasons of backwards compatibility, the returned set of anchors only contains those anchors created with the {\tt  name } attribute, not those created with the {\tt  id } attribute. 

Definition at line 164 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!cookie@{cookie}}
\index{cookie@{cookie}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} HTMLDocument::cookie () const}\label{classDOM_1_1HTMLDocument_a19}


The cookies associated with this document. 

If there are none, the value is an empty string. Otherwise, the value is a string: a semicolon-delimited list of \char`\"{}name, value\char`\"{} pairs for all the cookies associated with the page. For example, {\tt  name=value;expires=date } . 

Definition at line 176 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!setCookie@{setCookie}}
\index{setCookie@{setCookie}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void HTMLDocument::set\-Cookie (const {\bf DOMString} \&)}\label{classDOM_1_1HTMLDocument_a20}


see {\bf cookie}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a19})} 



Definition at line 182 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!open@{open}}
\index{open@{open}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void HTMLDocument::open ()}\label{classDOM_1_1HTMLDocument_a21}


Note. 

This method and the ones following allow a user to add to or replace the structure model of a document using strings of unparsed HTML. At the time of writing alternate methods for providing similar functionality for both HTML and XML documents were being considered. The following methods may be deprecated at some point in the future in favor of a more general-purpose mechanism.

Open a document stream for writing. If a document exists in the target, this method clears it.

\begin{Desc}
\item[Returns:]\end{Desc}


Definition at line 189 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!close@{close}}
\index{close@{close}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void HTMLDocument::close ()}\label{classDOM_1_1HTMLDocument_a22}


Closes a document stream opened by {\tt  {\bf open()}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a21})} } and forces rendering. 

\begin{Desc}
\item[Returns:]\end{Desc}


Definition at line 195 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!write@{write}}
\index{write@{write}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void HTMLDocument::write (const {\bf DOMString} \& {\em text})}\label{classDOM_1_1HTMLDocument_a23}


Write a string of text to a document stream opened by {\tt  {\bf open()}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a21})} } . 

The text is parsed into the document's structure model.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The string to be parsed into some structure in the document structure model.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]\end{Desc}


Definition at line 201 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!writeln@{writeln}}
\index{writeln@{writeln}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void HTMLDocument::writeln (const {\bf DOMString} \& {\em text})}\label{classDOM_1_1HTMLDocument_a24}


Write a string of text followed by a newline character to a document stream opened by {\tt  {\bf open()}{\rm (p.\,\pageref{classDOM_1_1HTMLDocument_a21})} } . 

The text is parsed into the document's structure model.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The string to be parsed into some structure in the document structure model.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]\end{Desc}


Definition at line 207 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!getElementsByName@{getElementsByName}}
\index{getElementsByName@{getElementsByName}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Node\-List} HTMLDocument::get\-Elements\-By\-Name (const {\bf DOMString} \& {\em element\-Name})}\label{classDOM_1_1HTMLDocument_a25}


Returns the (possibly empty) collection of elements whose {\tt  name } value is given by {\tt  element\-Name } . 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em element\-Name}]The {\tt  name } attribute value for an element.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The matching elements. \end{Desc}


Definition at line 213 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!completeURL@{completeURL}}
\index{completeURL@{completeURL}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} HTMLDocument::complete\-URL (const {\bf DOMString} \& {\em url}) const}\label{classDOM_1_1HTMLDocument_a26}


not part of the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})} 

converts the given (potentially relative) URL in a full-qualified one, using the base\-URL / document URL for the missing parts. 

Definition at line 102 of file html\_\-document.cpp.

References DOM::DOMString::string().\index{DOM::HTMLDocument@{DOM::HTMLDocument}!lastModified@{lastModified}}
\index{lastModified@{lastModified}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} HTMLDocument::last\-Modified () const}\label{classDOM_1_1HTMLDocument_a27}


Not part of the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})}. 

The date the document was last modified. 

Definition at line 115 of file html\_\-document.cpp.\index{DOM::HTMLDocument@{DOM::HTMLDocument}!all@{all}}
\index{all@{all}!DOM::HTMLDocument@{DOM::HTMLDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf HTMLCollection} HTMLDocument::all () const}\label{classDOM_1_1HTMLDocument_a28}


Not part of the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})}. 

A collection of all the {\tt IMG}, {\tt OBJECT}, {\tt AREA}, {\tt A}, forms and anchor elements of a document. 

Definition at line 170 of file html\_\-document.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
html\_\-document.h\item 
html\_\-document.cpp\end{CompactItemize}
