class KHTMLPart

HTML Browser Widget. More...

Definition#include <khtml_part.h>
InheritsKParts::ReadOnlyPart (kparts)
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Slots

Signals

Protected Methods

Protected Slots


Detailed Description

This class is khtml's main class. It features an almost complete web browser, and html renderer.

The easiest way to use this class (if you just want to display a an HTML page at some URL) is the following:


 KURL url = "http://www.kde.org";
 KHTMLPart *w = new KHTMLPart();
 w->openURL(url);
 w->view()->resize(500, 400);
 w->show();

By default Java and JavaScript support are disabled. You can enable them by using the enableJava() and enableJScript() methods.

Some apps want to write their HTML code directly into the widget instead of it opening an url. You can also do that in the following way:


 QString myHTMLCode = ...;
 KHTMLPart *w = new KHTMLPart();
 w->begin();
 w->write(myHTMLCode);
 ...
 w->end();

You can do as many calls to write as you want. But there are two write() methods, one accepting a QString one accepting a char @p * argument. You should use one or the other (but not both) since the method using the char @p * argument does an additional decoding step to convert the written data to Unicode.

void  onURL ( const QString &url )

[signal]

Emitted if the cursor is moved over an URL.

void  popupMenu (const QString &url, const QPoint &point)

[signal]

Emitted when the user clicks the right mouse button on the document.

void  selectionChanged ()

[signal]

This signal is emitted when the selection changes.

void  nodeActivated (const DOM::Node &)

[signal]

This signal is emitted when an element retrieves the keyboard focus. Note that the signal argument can be a null node if no element is active, meaning a node has explicitly been deactivated without a new one becoming active.

bool  event ( QEvent *event )

[protected virtual]

Reimplementation of KParts::ReadOnlyPart::event .

bool  eventFilter ( QObject *o, QEvent *event )

[protected virtual]

Reimplementation of QObject::eventFilter .

void  khtmlMousePressEvent ( khtml::MousePressEvent *event )

[protected virtual]

Eventhandler of the khtml::MousePressEvent.

void  khtmlMouseDoubleClickEvent ( khtml::MouseDoubleClickEvent * )

[protected virtual]

Eventhandler for the khtml::MouseDoubleClickEvent.

void  khtmlMouseMoveEvent ( khtml::MouseMoveEvent *event )

[protected virtual]

Eventhandler for the khtml::MouseDoubleClickEvent.

void  khtmlMouseReleaseEvent ( khtml::MouseReleaseEvent *event )

[protected virtual]

Eventhandler for the khtml::MouseMoveEvent.

void  khtmlDrawContentsEvent ( khtml::DrawContentsEvent * )

[protected virtual]

Eventhandler for the khtml::DrawContentsEvent.

void  guiActivateEvent ( KParts::GUIActivateEvent *event )

[protected virtual]

Internal reimplementation of KParts::Part::guiActivateEvent .

Reimplemented from ReadOnlyPart

bool  openFile ()

[protected virtual]

Internal empty reimplementation of KParts::ReadOnlyPart::openFile .

Reimplemented from ReadOnlyPart

void  overURL ( const QString &url, const QString &target )

[protected virtual]

void  urlSelected ( const QString &url, int button = 0, int state = 0, const QString &_target = QString::null )

[protected virtual]

bool  processObjectRequest ( khtml::ChildFrame *child, const KURL &url, const QString &mimetype )

[protected]

void  submitForm ( const char *action, const QString &url, const QByteArray &formData, const QString &target, const QString& contentType = QString::null, const QString& boundary = QString::null )

[protected virtual]

void  popupMenu ( const QString &url )

[protected virtual]

KParts::ReadOnlyPartcreatePart ( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, const QString &mimetype, QString &serviceName, QStringList &serviceTypes, const QStringList &params)

[protected virtual]

This method is called when a new embedded object (include html frames) is to be created. Reimplement it if you want to add support for certain embeddable objects without registering them in the KDE wide registry system (KSyCoCa) . Another reason for re-implementing this method could be if you want to derive from KTHMLPart and also want all html frame objects to be a object of your derived type, in which case you should return a new instance for the mimetype 'text/html' .

void  updateFontSize ( int add )

[protected]

void  setFontBaseInternal ( int base, bool absolute )

[protected]

void  setActiveNode (const DOM::Node &)

[slot]

Call this method to explicitly pass the focus to a certain element of the current document.

void  stopAnimations ()

[slot]

Stops all animated images on the current and child pages

void  reparseConfiguration ()

[protected slot]

Internal. Called by the BrowserExtension .