<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://techbase.kde.org/skins/common/feed.css?0.2"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://techbase.kde.org/index.php?title=Development/Architecture/KDE3/KHTML/en&amp;feed=atom&amp;action=history</id>
		<title>Development/Architecture/KDE3/KHTML/en - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://techbase.kde.org/index.php?title=Development/Architecture/KDE3/KHTML/en&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/index.php?title=Development/Architecture/KDE3/KHTML/en&amp;action=history"/>
		<updated>2013-05-21T19:36:30Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.2</generator>

	<entry>
		<id>http://techbase.kde.org/index.php?title=Development/Architecture/KDE3/KHTML/en&amp;diff=74036&amp;oldid=prev</id>
		<title>FuzzyBot: Updating to match new version of source page</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/index.php?title=Development/Architecture/KDE3/KHTML/en&amp;diff=74036&amp;oldid=prev"/>
				<updated>2012-07-26T19:18:38Z</updated>
		
		<summary type="html">&lt;p&gt;Updating to match new version of source page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KHTML - KDE's HTML library ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;KHTML&amp;lt;/tt&amp;gt; is an [http://www.w3.org/TR/REC-xml/ XML]/[http://www.w3.org/TR/html401/ HTML4] compliant HTML library, with support for [http://www.w3.org/TR/REC-DOM-Level-1/ DOM],&lt;br /&gt;
[http://java.sun.com/docs/books/tutorial/deployment/applet/index.html Java], [http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf JavaScript] and Cascading Style Sheets ([http://www.w3.org/TR/CSS2/ CSS]). &lt;br /&gt;
&lt;br /&gt;
You can get an overview of &amp;lt;tt&amp;gt;KHTML&amp;lt;/tt&amp;gt;'s current capabilities [http://www.konqueror.org/konq-browser.html here.]&lt;br /&gt;
&lt;br /&gt;
== Small example ==&lt;br /&gt;
&lt;br /&gt;
Using &amp;lt;tt&amp;gt;KHTML&amp;lt;/tt&amp;gt; in your program is quite easy. The following example shows&lt;br /&gt;
you a complete application with which you can already browse the web:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;khtml.h&amp;gt;&lt;br /&gt;
#include &amp;lt;kapp.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    KApplication a(argc, argv, &amp;quot;testkhtml&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    KHTMLWidget *html = new KHTMLWidget;&lt;br /&gt;
    html-&amp;gt;resize(800,500);&lt;br /&gt;
    //html-&amp;gt;setJScriptEnabled(true);&lt;br /&gt;
    html-&amp;gt;setJavaEnabled(true);&lt;br /&gt;
    //html-&amp;gt;setFollowsLinks(false);&lt;br /&gt;
&lt;br /&gt;
    a.setTopWidget(html);&lt;br /&gt;
    html-&amp;gt;setURLCursor(QCursor(PointingHandCursor));&lt;br /&gt;
    html-&amp;gt;openURL(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    QWidget::connect(html, SIGNAL(setTitle(const QString &amp;amp;)),&lt;br /&gt;
                     html, SLOT(setCaption(const QString &amp;amp;)));&lt;br /&gt;
    html-&amp;gt;show();&lt;br /&gt;
    a.exec();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This small example already gives you a functional browser, that lets you browse&lt;br /&gt;
the web (you'll need the &amp;lt;tt&amp;gt;kio_http&amp;lt;/tt&amp;gt; executable from KDE though to access&lt;br /&gt;
non local files). Just try &amp;lt;tt&amp;gt;testkhtml http://www.kde.org&amp;lt;/tt&amp;gt; and you will&lt;br /&gt;
get a widget showing KDE's home page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;KHTML&amp;lt;/tt&amp;gt; has a lot of functionality. Almost everything you'll ever need&lt;br /&gt;
can be accessed through the member functions of the class KHTMLWidget.&lt;br /&gt;
&lt;br /&gt;
== Document Object Model (DOM) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;KHTML&amp;lt;/tt&amp;gt; provides a mostly complete implementation of&lt;br /&gt;
[http://www.w3.org/DOM/ Dom Level 1 and 2].&lt;br /&gt;
&lt;br /&gt;
The DOM is an implementation using internal classes to hold the document's data.&lt;br /&gt;
The classes accessing the DOM are using a refcounting scheme to hold the data.&lt;br /&gt;
Thus the DOM does the memory management for you. You can just use the classes&lt;br /&gt;
defined in the DOM header files to access parts of the document. As long as you&lt;br /&gt;
don't use pointers, you will not get memory leaks.&lt;br /&gt;
&lt;br /&gt;
You can easily access the document being shown by the&lt;br /&gt;
&amp;lt;tt&amp;gt;KHTMLWidget::document()&amp;lt;/tt&amp;gt; method, from where you can&lt;br /&gt;
get access to every part of the document.&lt;br /&gt;
&lt;br /&gt;
== Java ==&lt;br /&gt;
&lt;br /&gt;
Thanks to the work of Richard Moore, &amp;lt;tt&amp;gt;KHTML&amp;lt;/tt&amp;gt; can display Java applets.&lt;br /&gt;
Java is not enabled by default, but you can do so by using&lt;br /&gt;
&amp;lt;tt&amp;gt;KHTMLWidget::setEnableJava(true);&amp;lt;/tt&amp;gt;, and setting the environment variable&lt;br /&gt;
&amp;lt;tt&amp;gt;CLASSPATH&amp;lt;/tt&amp;gt; to:&lt;br /&gt;
&lt;br /&gt;
 CLASSPATH=$KDEDIR/share/apps/kjava/kjava-classes.zip:$JDK_DIR/lib&lt;br /&gt;
&lt;br /&gt;
You will need to have the java developers kit installed though. I tested it&lt;br /&gt;
with JDK-1.1.7, and don't know if it'll run with other versions of JDK or with&lt;br /&gt;
Kaffe.&lt;br /&gt;
&lt;br /&gt;
== JavaScript (ECMA-Script) ==&lt;br /&gt;
&lt;br /&gt;
The JavaScript support aims at compliance with the ECMAScript Language&lt;br /&gt;
specification [http://www.ecma.ch/ecma1/STAND/ECMA-262.HTM ECMA-262] 3rd edition.&lt;br /&gt;
This roughly equals JavaScript 1.5.&lt;br /&gt;
&lt;br /&gt;
== Cascading Style Sheets (CSS) ==&lt;br /&gt;
&lt;br /&gt;
Cascading style sheets 2.1 are mostly supported now.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initial Author:'' [mailto:knoll@kde.org Lars Knoll]&lt;br /&gt;
&lt;br /&gt;
[[Category:KDE3]]&lt;br /&gt;
[[Category:Architecture]]&lt;/div&gt;</summary>
		<author><name>FuzzyBot</name></author>	</entry>

	</feed>