org.kde.koala

Class KHTMLPart

public class KHTMLPart extends ReadOnlyPart

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 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();
 
Java and JavaScript are enabled by default depending on the user's settings. If you do not need them, and especially if you display unfiltered data from untrusted sources, it is strongly recommended to turn them off. In that case, you should also turn off the automatic redirect and plugins:
 w.setJScriptEnabled(false);
 w.setJavaEnabled(false);
 w.setMetaRefreshEnabled(false);
 w.setPluginsEnabled(false);
 
You may also wish to disable external references. This will prevent KHTML from loading images, frames, etc, or redirecting to external sites.
 w.setOnlyLocalReferences(true);
 
Some apps want to write their HTML code directly into the widget instead of opening an url. You can do this in the following way:
 String myHTMLCode = ...;
 KHTMLPart w = new KHTMLPart();
 w.begin();
 w.write(myHTMLCode);
 ...
 w.end();
 
You can do as many calls to write() as you wish. There are two write() methods, one accepting a String and one accepting a char argument. You should use one or the other (but not both) since the method using the char argument does an additional decoding step to convert the written data to Unicode. It is also possible to write content to the HTML part using the standard streaming API from KParts.ReadOnlyPart. The usage of the API is similar to that of the begin(), write(), end() process described above as the following example shows:
 KHTMLPart doc = new KHTMLPart();
 doc.openStream( "text/html", KURL() );
 doc.writeStream( String( "

KHTML Rocks!

" ) ); doc.closeStream();
See KHTMLPartSignals for signals emitted by KHTMLPart

Author: Lars Knoll (knoll@kde.org)

UNKNOWN: HTML Browser Widget.

Field Summary
static intBefore
static intBrowserViewGUI
static intCaretBlink
static intCaretInvisible
static intCaretVisible
Enumeration for displaying the caret.
static intDefaultGUI
static intEncrypted
static intFindLinksOnly
Extra Find options that can be used when calling the extended findText().
static intFindNoPopups
static intMixed
static intNoNotification
static intNotCrypted
static intOnly
static intUnused
Constructor Summary
protected KHTMLPart(Class dummy)
KHTMLPart(QWidget parentWidget, String widgetname, QObject parent, String name, int prof)
Constructs a new KHTMLPart.
KHTMLPart(QWidget parentWidget, String widgetname, QObject parent, String name)
KHTMLPart(QWidget parentWidget, String widgetname, QObject parent)
KHTMLPart(QWidget parentWidget, String widgetname)
KHTMLPart(QWidget parentWidget)
KHTMLPart()
KHTMLPart(KHTMLView view, QObject parent, String name, int prof)
KHTMLPart(KHTMLView view, QObject parent, String name)
KHTMLPart(KHTMLView view, QObject parent)
KHTMLPart(KHTMLView view)
Method Summary
NodeactiveNode()
Returns the node that has the keyboard focus.
booleanautoloadImages()
Returns whether images contained in the document are loaded automatically or not.
voidautoloadImages(boolean e)
KURLbackgroundURL()
Returns the URL for the background Image (used by save background)
StringbaseTarget()
KURLbaseURL()
voidbegin(KURL url, int xOffset, int yOffset)
Clears the widget and prepares it for new content.
voidbegin(KURL url, int xOffset)
voidbegin(KURL url)
voidbegin()
BrowserExtensionbrowserExtension()
Returns a pointer to the KParts.BrowserExtension.
BrowserHostExtensionbrowserHostExtension()
intcaretDisplayPolicyNonFocused()
Returns the current caret policy when the view is not focused.
StringclassName()
booleancloseURL()
Stops loading the document and kills all data requests (for images, etc.)
protected KURLcompleteURL(String url)
returns a KURL object for the given url.
protected ReadOnlyPartcreatePart(QWidget parentWidget, String widgetName, QObject parent, String name, String mimetype, StringBuffer serviceName, String[] serviceTypes, String[] params)
This method is called when a new embedded object (include html frames) is to be created.
ReadOnlyPartcurrentFrame()
Return the current frame (the one that has focus) Not necessarily a direct child of ours, framesets can be nested.
protected voidcustomEvent(QCustomEvent event)
StringdcopObjectId()
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
booleandndEnabled()
Returns whether Dragn'n'Drop support is enabled or not.
Documentdocument()
Returns a reference to the DOM document.
StringdocumentSource()
Returns the content of the source document.
protected booleandoCloseStream()
Implements the streaming API of KParts.ReadOnlyPart.
protected booleandoOpenStream(String mimeType)
Implements the streaming API of KParts.ReadOnlyPart.
protected booleandoWriteStream(byte[] data)
Implements the streaming API of KParts.ReadOnlyPart.
voidenableJava(boolean e)
voidenableJScript(boolean e)
voidenableMetaRefresh(boolean e)
voidenablePlugins(boolean e)
Stringencoding()
Returns the encoding the page currently uses.
voidend()
Call this after your last call to write().
QVariantexecuteScript(Node n, String script)
Same as executeScript( String ) except with the Node parameter specifying the 'this' value.
protected voidfinalize()
Deletes the wrapped C++ instance
KHTMLPartfindFrame(String f)
Finds a frame by name.
KHTMLPartfindFrameParent(ReadOnlyPart callingPart, String f)
Recursively finds the part containing the frame with name f and checks if it is accessible by callingPart Returns null if no suitable frame can't be found.
ReadOnlyPartfindFramePart(String f)
Finds a frame by name.
voidfindText()
Starts a new search by popping up a dialog asking the user what he wants to search for.
voidfindText(String str, long options, QWidget parent, KFindDialog findDialog)
Starts a new search, but bypasses the user dialog.
voidfindText(String str, long options, QWidget parent)
voidfindText(String str, long options)
voidfindTextBegin()
Initiates a text search.
booleanfindTextNext()
Finds the next occurence of a string set by
booleanfindTextNext(boolean reverse)
Finds the next occurence of a string set by
intformNotification()
Determine if signal should be emitted before, instead or never when a submitForm() happens.
booleanframeExists(String frameName)
Returns whether a frame with the specified name is exists or not.
ArrayListframeNames()
Returns a list of names of all frame (including iframe) objects of the current document.
booleangotoAnchor(String name)
Finds the anchor named name. If the anchor is found, the widget scrolls to the closest position.
protected voidguiActivateEvent(GUIActivateEvent event)
Internal reimplementation of KParts.Part.guiActivateEvent .
booleanhasSelection()
Has the user selected anything?
voidhide()
Convenience method to hide the document's view.
HTMLDocumenthtmlDocument()
Returns a reference to the DOM HTML document (for non-HTML documents, returns null)
protected voidhtmlError(int errorCode, String text, KURL reqUrl)
presents a detailed error message to the user.
booleaninProgress()
booleanisCaretMode()
Returns whether caret mode is on/off.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
booleanisEditable()
Returns true if the document is editable, false otherwise.
booleanisModified()
Checks whether the page contains unsubmitted form changes.
booleanjavaEnabled()
Return true if Java applet support is enabled, false if disabled
StringjsDefaultStatusBarText()
Called by KJS.
StringjsStatusBarText()
Called by KJS.
booleanjScriptEnabled()
Returns true if Javascript support is enabled or false otherwise.
StringlastModified()
Last-modified date (in raw string format), if received in the [HTTP] headers.
QMetaObjectmetaObject()
booleanmetaRefreshEnabled()
Returns true if automatic forwarding is enabled.
booleannextAnchor()
Go to the next anchor This is useful to navigate from outside the navigator
NodenodeUnderMouse()
Returns the Node currently under the mouse.
NodenonSharedNodeUnderMouse()
Returns the Node currently under the mouse that is not shared.
booleanonlyLocalReferences()
Returns whether only file:/ or data:/ references are allowed to be loaded ( default false ).
protected booleanopenFile()
Internal empty reimplementation of KParts.ReadOnlyPart.openFile .
booleanopenURL(KURL url)
Opens the specified URL url. Reimplemented from KParts.ReadOnlyPart.openURL .
StringpageReferrer()
Referrer used to obtain this page.
voidpaint(QPainter arg1, QRect arg2, int arg3, boolean[] arg4)
Paints the HTML page to a QPainter.
voidpaint(QPainter arg1, QRect arg2, int arg3)
voidpaint(QPainter arg1, QRect arg2)
KHTMLPartparentPart()
Returns a pointer to the parent KHTMLPart if the part is a frame in an HTML frameset.
PartManagerpartManager()
Returns a reference to the partmanager instance which manages html frame objects.
protected booleanpluginPageQuestionAsked(String mimetype)
booleanpluginsEnabled()
Returns true if plugins are enabled/disabled.
voidpreloadScript(String url, String script)
Loads a script into the script cache.
voidpreloadStyleSheet(String url, String stylesheet)
Loads a style sheet into the stylesheet cache.
booleanprevAnchor()
Go to previous anchor
Stringreferrer()
Referrer used for links in this page.
booleanrestored()
voidrestoreState(QDataStream stream)
Restores the KHTMLPart's previously saved state (including child frame objects) from the provided QDataStream.
voidsaveState(QDataStream stream)
Saves the KHTMLPart's complete state (including child frame objects) to the provided QDataStream.
voidscheduleRedirection(int delay, String url, boolean lockHistory)
Schedules a redirection after delay seconds.
voidscheduleRedirection(int delay, String url)
voidselectAll()
Marks all text in the document as selected.
StringselectedText()
Returns the text the user has marked.
StringselectedTextAsHTML()
Return the text the user has marked.
Rangeselection()
Returns the selected part of the HTML.
voidselection(Node startNode, long startOffset, Node endNode, long endOffset)
Returns the selected part of the HTML by returning the starting and end position.
voidsetActiveNode(Node node)
Sets the focused node of the document to the specified node.
voidsetAutoloadImages(boolean enable)
Specifies whether images contained in the document should be loaded automatically or not.
voidsetCaretDisplayPolicyNonFocused(int policy)
Sets the caret display policy when the view is not focused.
voidsetCaretMode(boolean enable)
Enables/disables caret mode.
voidsetCaretPosition(Node node, long offset, boolean extendSelection)
Sets the caret to the given position.
voidsetCaretPosition(Node node, long offset)
voidsetCaretVisible(boolean show)
Sets the visibility of the caret.
booleansetCharset(String arg1, boolean arg2)
voidsetDNDEnabled(boolean b)
Enables or disables Drag'n'Drop support.
voidsetEditable(boolean enable)
Makes the document editable.
booleansetEncoding(String name, boolean override)
Sets the encoding the page uses.
booleansetEncoding(String name)
voidsetFixedFont(String name)
Sets the fixed font style.
voidsetFormNotification(int fn)
Determine if signal should be emitted before, instead or never when a submitForm() happens.
voidsetJavaEnabled(boolean enable)
Enables/disables Java applet support.
voidsetJScriptEnabled(boolean enable)
Enable/disable Javascript support.
voidsetJSDefaultStatusBarText(String text)
Called by KJS.
voidsetJSStatusBarText(String text)
Called by KJS.
voidsetMetaRefreshEnabled(boolean enable)
Enable/disable automatic forwarding by <meta http-equiv="refresh" ....>
voidsetOnlyLocalReferences(boolean enable)
Security option.
protected voidsetPluginPageQuestionAsked(String mimetype)
voidsetPluginsEnabled(boolean enable)
Enables or disables plugins, default is enabled
voidsetSelection(Range arg1)
Sets the current selection.
voidsetStandardFont(String name)
Sets the standard font style.
voidsetStatusMessagesEnabled(boolean enable)
Enable/disable statusbar messages.
voidsetSuppressedPopupIndicator(boolean enable, KHTMLPart originPart)
Shows or hides the suppressed popup indicator
KHTMLSettingssettings()
voidsetURLCursor(QCursor c)
Sets the cursor to use when the cursor is on a link.
voidsetUserStyleSheet(KURL url)
Sets a user defined style sheet to be used on top of the HTML 4 default style sheet.
voidsetUserStyleSheet(String styleSheet)
Sets a user defined style sheet to be used on top of the HTML 4 default style sheet.
voidsetZoomFactor(int percent)
Sets the Zoom factor.
voidshow()
Convenience method to show the document's view.
voidshowError(Job job)
Called when a certain error situation (i.e. connection timed out) occurred.
booleanstatusMessagesEnabled()
Returns true if status messages are enabled.
voidstopAnimations()
Stops all animated images on the current and child pages
voidsubmitFormProxy(String action, String url, byte[] formData, String target, String contentType, String boundary)
voidsubmitFormProxy(String action, String url, byte[] formData, String target, String contentType)
voidsubmitFormProxy(String action, String url, byte[] formData, String target)
KURLtoplevelURL()
Returns the toplevel (origin) URL of this document, even if this part is a frame or an iframe.
QCursorurlCursor()
Returns the cursor which is used when the cursor is on a link.
protected voidurlSelected(String url, int button, int state, String _target, URLArgs args)
protected voidurlSelected(String url, int button, int state, String _target)
KHTMLViewview()
Returns a pointer to the HTML document's view.
voidwrite(String str, int len)
Writes another part of the HTML code to the widget.
voidwrite(String str)
intzoomFactor()
Returns the current zoom factor.

Field Detail

Before

public static final int Before

BrowserViewGUI

public static final int BrowserViewGUI

CaretBlink

public static final int CaretBlink

CaretInvisible

public static final int CaretInvisible

CaretVisible

public static final int CaretVisible
Enumeration for displaying the caret.

Parameters: Visible caret is displayed Invisible caret is not displayed Blink caret toggles between visible and invisible

UNKNOWN: Enumeration for displaying the caret.

DefaultGUI

public static final int DefaultGUI

Encrypted

public static final int Encrypted

FindLinksOnly

public static final int FindLinksOnly
Extra Find options that can be used when calling the extended findText().

UNKNOWN: Extra Find options that can be used when calling the extended findText().

FindNoPopups

public static final int FindNoPopups

Mixed

public static final int Mixed

NoNotification

public static final int NoNotification

NotCrypted

public static final int NotCrypted

Only

public static final int Only

Unused

public static final int Unused

Constructor Detail

KHTMLPart

protected KHTMLPart(Class dummy)

KHTMLPart

public KHTMLPart(QWidget parentWidget, String widgetname, QObject parent, String name, int prof)
Constructs a new KHTMLPart. KHTML basically consists of two objects: The KHTMLPart itself, holding the document data (DOM document), and the KHTMLView, derived from QScrollView, in which the document content is rendered in. You can specify two different parent objects for a KHTMLPart, one parent for the KHTMLPart document and on parent for the KHTMLView. If the second parent argument is null, then parentWidget is used as parent for both objects, the part and the view.

UNKNOWN: Constructs a new KHTMLPart.

KHTMLPart

public KHTMLPart(QWidget parentWidget, String widgetname, QObject parent, String name)

KHTMLPart

public KHTMLPart(QWidget parentWidget, String widgetname, QObject parent)

KHTMLPart

public KHTMLPart(QWidget parentWidget, String widgetname)

KHTMLPart

public KHTMLPart(QWidget parentWidget)

KHTMLPart

public KHTMLPart()

KHTMLPart

public KHTMLPart(KHTMLView view, QObject parent, String name, int prof)

KHTMLPart

public KHTMLPart(KHTMLView view, QObject parent, String name)

KHTMLPart

public KHTMLPart(KHTMLView view, QObject parent)

KHTMLPart

public KHTMLPart(KHTMLView view)

Method Detail

activeNode

public Node activeNode()
Returns the node that has the keyboard focus.

UNKNOWN: Returns the node that has the keyboard focus.

autoloadImages

public boolean autoloadImages()
Returns whether images contained in the document are loaded automatically or not.

UNKNOWN: that the returned information is unrelieable as long as no begin() was called. Returns whether images contained in the document are loaded automatically or not.

autoloadImages

public void autoloadImages(boolean e)

backgroundURL

public KURL backgroundURL()
Returns the URL for the background Image (used by save background)

UNKNOWN: Returns the URL for the background Image (used by save background)

baseTarget

public String baseTarget()

baseURL

public KURL baseURL()

begin

public void begin(KURL url, int xOffset, int yOffset)
Clears the widget and prepares it for new content. If you want url() to return for example "file:/tmp/test.html", you can use the following code:
		 view.begin( KURL("file:/tmp/test.html" ) );
		 

Parameters: url is the url of the document to be displayed. Even if you are generating the HTML on the fly, it may be useful to specify a directory so that any pixmaps are found. xOffset is the initial horizontal scrollbar value. Usually you don't want to use this. yOffset is the initial vertical scrollbar value. Usually you don't want to use this. All child frames and the old document are removed if you call this method.

UNKNOWN: Clears the widget and prepares it for new content.

begin

public void begin(KURL url, int xOffset)

begin

public void begin(KURL url)

begin

public void begin()

browserExtension

public BrowserExtension browserExtension()
Returns a pointer to the KParts.BrowserExtension.

UNKNOWN: Returns a pointer to the KParts.BrowserExtension.

browserHostExtension

public BrowserHostExtension browserHostExtension()

caretDisplayPolicyNonFocused

public int caretDisplayPolicyNonFocused()
Returns the current caret policy when the view is not focused.

UNKNOWN: Returns the current caret policy when the view is not focused.

className

public String className()

closeURL

public boolean closeURL()
Stops loading the document and kills all data requests (for images, etc.)

UNKNOWN: Stops loading the document and kills all data requests (for images, etc.

completeURL

protected KURL completeURL(String url)
returns a KURL object for the given url. Use when you know what you're doing.

UNKNOWN: returns a KURL object for the given url.

createPart

protected ReadOnlyPart createPart(QWidget parentWidget, String widgetName, QObject parent, String name, String mimetype, StringBuffer serviceName, String[] serviceTypes, String[] params)
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' .

UNKNOWN: This method is called when a new embedded object (include html frames) is to be created.

currentFrame

public ReadOnlyPart currentFrame()
Return the current frame (the one that has focus) Not necessarily a direct child of ours, framesets can be nested. Returns "this" if this part isn't a frameset.

UNKNOWN: Return the current frame (the one that has focus) Not necessarily a direct child of ours, framesets can be nested.

customEvent

protected void customEvent(QCustomEvent event)

dcopObjectId

public String dcopObjectId()

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

dndEnabled

public boolean dndEnabled()
Returns whether Dragn'n'Drop support is enabled or not.

UNKNOWN: Returns whether Dragn'n'Drop support is enabled or not.

document

public Document document()
Returns a reference to the DOM document.

UNKNOWN: Returns a reference to the DOM document.

documentSource

public String documentSource()
Returns the content of the source document.

UNKNOWN: Returns the content of the source document.

doCloseStream

protected boolean doCloseStream()
Implements the streaming API of KParts.ReadOnlyPart.

UNKNOWN: Implements the streaming API of KParts.ReadOnlyPart.

doOpenStream

protected boolean doOpenStream(String mimeType)
Implements the streaming API of KParts.ReadOnlyPart.

UNKNOWN: Implements the streaming API of KParts.ReadOnlyPart.

doWriteStream

protected boolean doWriteStream(byte[] data)
Implements the streaming API of KParts.ReadOnlyPart.

UNKNOWN: Implements the streaming API of KParts.ReadOnlyPart.

enableJava

public void enableJava(boolean e)

enableJScript

public void enableJScript(boolean e)

enableMetaRefresh

public void enableMetaRefresh(boolean e)

enablePlugins

public void enablePlugins(boolean e)

encoding

public String encoding()
Returns the encoding the page currently uses. Note that the encoding might be different from the charset.

UNKNOWN: Returns the encoding the page currently uses.

end

public void end()
Call this after your last call to write().

UNKNOWN: Call this after your last call to write().

executeScript

public QVariant executeScript(Node n, String script)
Same as executeScript( String ) except with the Node parameter specifying the 'this' value.

UNKNOWN: Same as executeScript( String ) except with the Node parameter specifying the 'this' value.

finalize

protected void finalize()
Deletes the wrapped C++ instance

findFrame

public KHTMLPart findFrame(String f)
Finds a frame by name. Returns null if frame can't be found.

UNKNOWN: Finds a frame by name.

findFrameParent

public KHTMLPart findFrameParent(ReadOnlyPart callingPart, String f)
Recursively finds the part containing the frame with name f and checks if it is accessible by callingPart Returns null if no suitable frame can't be found. Returns parent part if a suitable frame was found and frame info in childFrame

UNKNOWN: Recursively finds the part containing the frame with name f and checks if it is accessible by callingPart Returns 0L if no suitable frame can't be found.

findFramePart

public ReadOnlyPart findFramePart(String f)
Finds a frame by name. Returns null if frame can't be found.

UNKNOWN: Finds a frame by name.

findText

public void findText()
Starts a new search by popping up a dialog asking the user what he wants to search for.

UNKNOWN: Starts a new search by popping up a dialog asking the user what he wants to search for.

findText

public void findText(String str, long options, QWidget parent, KFindDialog findDialog)
Starts a new search, but bypasses the user dialog.

Parameters: str The string to search for. options Find options. parent Parent used for centering popups like "string not found". findDialog Optionally, you can supply your own dialog.

UNKNOWN: Starts a new search, but bypasses the user dialog.

findText

public void findText(String str, long options, QWidget parent)

findText

public void findText(String str, long options)

findTextBegin

public void findTextBegin()
Initiates a text search.

UNKNOWN: Initiates a text search.

findTextNext

public boolean findTextNext()
Finds the next occurence of a string set by KHTMLPart

Returns: true if a new match was found.

UNKNOWN: Finds the next occurence of a string set by @ref findText()

findTextNext

public boolean findTextNext(boolean reverse)
Finds the next occurence of a string set by KHTMLPart

Parameters: reverse if true, revert seach direction (only if no find dialog is used)

Returns: true if a new match was found.

UNKNOWN: Finds the next occurence of a string set by @ref findText()

formNotification

public int formNotification()
Determine if signal should be emitted before, instead or never when a submitForm() happens. ### KDE4 remove me

UNKNOWN: Determine if signal should be emitted before, instead or never when a submitForm() happens.

frameExists

public boolean frameExists(String frameName)
Returns whether a frame with the specified name is exists or not. In contrary to the findFrame method this one also returns true if the frame is defined but no displaying component has been found/loaded, yet.

UNKNOWN: Returns whether a frame with the specified name is exists or not.

frameNames

public ArrayList frameNames()
Returns a list of names of all frame (including iframe) objects of the current document. Note that this method is not working recursively for sub-frames.

UNKNOWN: Returns a list of names of all frame (including iframe) objects of the current document.

gotoAnchor

public boolean gotoAnchor(String name)
Finds the anchor named name. If the anchor is found, the widget scrolls to the closest position. Returns if the anchor has been found.

UNKNOWN: Finds the anchor named name.

guiActivateEvent

protected void guiActivateEvent(GUIActivateEvent event)
Internal reimplementation of KParts.Part.guiActivateEvent .

UNKNOWN: Internal reimplementation of KParts.Part.guiActivateEvent .

hasSelection

public boolean hasSelection()
Has the user selected anything? Call selectedText() to retrieve the selected text.

Returns: true if there is text selected.

UNKNOWN: Has the user selected anything?

hide

public void hide()
Convenience method to hide the document's view. Equivalent to widget().hide() or view().hide().

UNKNOWN: Convenience method to hide the document's view.

htmlDocument

public HTMLDocument htmlDocument()
Returns a reference to the DOM HTML document (for non-HTML documents, returns null)

UNKNOWN: Returns a reference to the DOM HTML document (for non-HTML documents, returns null)

htmlError

protected void htmlError(int errorCode, String text, KURL reqUrl)
presents a detailed error message to the user. errorCode kio error code, eg KIO.ERR_SERVER_TIMEOUT. text kio additional information text. url the url that triggered the error.

UNKNOWN: presents a detailed error message to the user.

inProgress

public boolean inProgress()

UNKNOWN:

isCaretMode

public boolean isCaretMode()
Returns whether caret mode is on/off.

UNKNOWN: Returns whether caret mode is on/off.

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

isEditable

public boolean isEditable()
Returns true if the document is editable, false otherwise.

UNKNOWN: Returns true if the document is editable, false otherwise.

isModified

public boolean isModified()
Checks whether the page contains unsubmitted form changes.

Returns: true if form changes exist

UNKNOWN: Checks whether the page contains unsubmitted form changes.

javaEnabled

public boolean javaEnabled()
Return true if Java applet support is enabled, false if disabled

UNKNOWN: Return true if Java applet support is enabled, false if disabled

jsDefaultStatusBarText

public String jsDefaultStatusBarText()
Called by KJS. Returns the DefaultStatusBarText assigned via window.defaultStatus

UNKNOWN: Called by KJS.

jsStatusBarText

public String jsStatusBarText()
Called by KJS. Returns the StatusBarText assigned via window.status

UNKNOWN: Called by KJS.

jScriptEnabled

public boolean jScriptEnabled()
Returns true if Javascript support is enabled or false otherwise.

UNKNOWN: Returns true if Javascript support is enabled or false otherwise.

lastModified

public String lastModified()
Last-modified date (in raw string format), if received in the [HTTP] headers.

UNKNOWN: Last-modified date (in raw string format), if received in the [HTTP] headers.

metaObject

public QMetaObject metaObject()

metaRefreshEnabled

public boolean metaRefreshEnabled()
Returns true if automatic forwarding is enabled.

UNKNOWN: Returns true if automatic forwarding is enabled.

nextAnchor

public boolean nextAnchor()
Go to the next anchor This is useful to navigate from outside the navigator

UNKNOWN: Go to the next anchor

nodeUnderMouse

public Node nodeUnderMouse()
Returns the Node currently under the mouse. The returned node may be a shared node (e. g. an \ node if the mouse is hovering over an image map).

UNKNOWN: Returns the Node currently under the mouse.

nonSharedNodeUnderMouse

public Node nonSharedNodeUnderMouse()
Returns the Node currently under the mouse that is not shared. The returned node is always the node that is physically under the mouse pointer (irrespective of logically overlying elements like, e. g., \ on image maps).

UNKNOWN: Returns the Node currently under the mouse that is not shared.

onlyLocalReferences

public boolean onlyLocalReferences()
Returns whether only file:/ or data:/ references are allowed to be loaded ( default false ). See setOnlyLocalReferences.

UNKNOWN: Returns whether only file:/ or data:/ references are allowed to be loaded ( default false ).

openFile

protected boolean openFile()
Internal empty reimplementation of KParts.ReadOnlyPart.openFile .

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

openURL

public boolean openURL(KURL url)
Opens the specified URL url. Reimplemented from KParts.ReadOnlyPart.openURL .

UNKNOWN: Opens the specified URL url.

pageReferrer

public String pageReferrer()
Referrer used to obtain this page.

UNKNOWN: Referrer used to obtain this page.

paint

public void paint(QPainter arg1, QRect arg2, int arg3, boolean[] arg4)
Paints the HTML page to a QPainter. See KHTMLView.paint for details

UNKNOWN: Paints the HTML page to a QPainter.

paint

public void paint(QPainter arg1, QRect arg2, int arg3)

paint

public void paint(QPainter arg1, QRect arg2)

parentPart

public KHTMLPart parentPart()
Returns a pointer to the parent KHTMLPart if the part is a frame in an HTML frameset. Returns null otherwise.

UNKNOWN: Returns a pointer to the parent KHTMLPart if the part is a frame in an HTML frameset.

partManager

public PartManager partManager()
Returns a reference to the partmanager instance which manages html frame objects.

UNKNOWN: Returns a reference to the partmanager instance which manages html frame objects.

pluginPageQuestionAsked

protected boolean pluginPageQuestionAsked(String mimetype)

pluginsEnabled

public boolean pluginsEnabled()
Returns true if plugins are enabled/disabled.

UNKNOWN: Returns true if plugins are enabled/disabled.

preloadScript

public void preloadScript(String url, String script)
Loads a script into the script cache.

UNKNOWN: Loads a script into the script cache.

preloadStyleSheet

public void preloadStyleSheet(String url, String stylesheet)
Loads a style sheet into the stylesheet cache.

UNKNOWN: Loads a style sheet into the stylesheet cache.

prevAnchor

public boolean prevAnchor()
Go to previous anchor

UNKNOWN: Go to previous anchor

referrer

public String referrer()
Referrer used for links in this page.

UNKNOWN: Referrer used for links in this page.

restored

public boolean restored()

UNKNOWN:

restoreState

public void restoreState(QDataStream stream)
Restores the KHTMLPart's previously saved state (including child frame objects) from the provided QDataStream. This is called from the restoreState() method of the browserExtension() .

See Also: KHTMLPart

UNKNOWN: Restores the KHTMLPart's previously saved state (including child frame objects) from the provided QDataStream.

saveState

public void saveState(QDataStream stream)
Saves the KHTMLPart's complete state (including child frame objects) to the provided QDataStream. This is called from the saveState() method of the browserExtension().

UNKNOWN: Saves the KHTMLPart's complete state (including child frame objects) to the provided QDataStream.

scheduleRedirection

public void scheduleRedirection(int delay, String url, boolean lockHistory)
Schedules a redirection after delay seconds.

UNKNOWN: Schedules a redirection after delay seconds.

scheduleRedirection

public void scheduleRedirection(int delay, String url)

selectAll

public void selectAll()
Marks all text in the document as selected.

UNKNOWN: Marks all text in the document as selected.

selectedText

public String selectedText()
Returns the text the user has marked.

UNKNOWN: Returns the text the user has marked.

selectedTextAsHTML

public String selectedTextAsHTML()
Return the text the user has marked. This is guaranteed to be valid xml, and to contain the \ and \ tags. FIXME probably should make for 4.0 ?

UNKNOWN: Return the text the user has marked.

selection

public Range selection()
Returns the selected part of the HTML.

UNKNOWN: Returns the selected part of the HTML.

selection

public void selection(Node startNode, long startOffset, Node endNode, long endOffset)
Returns the selected part of the HTML by returning the starting and end position. If there is no selection, both nodes and offsets are equal.

Parameters: startNode returns node selection starts in startOffset returns offset within starting node endNode returns node selection ends in endOffset returns offset within end node.

UNKNOWN: Returns the selected part of the HTML by returning the starting and end position.

setActiveNode

public void setActiveNode(Node node)
Sets the focused node of the document to the specified node. If the node is a form control, the control will receive focus in the same way that it would if the user had clicked on it or tabbed to it with the keyboard. For most other types of elements, there is no visual indication of whether or not they are focused. See activeNode

Parameters: node The node to focus

UNKNOWN: Sets the focused node of the document to the specified node.

setAutoloadImages

public void setAutoloadImages(boolean enable)
Specifies whether images contained in the document should be loaded automatically or not.

UNKNOWN: Request will be ignored if called before begin(). Specifies whether images contained in the document should be loaded automatically or not.

setCaretDisplayPolicyNonFocused

public void setCaretDisplayPolicyNonFocused(int policy)
Sets the caret display policy when the view is not focused. Whenever the caret is in use, this property determines how the caret should be displayed when the document view is not focused. The default policy is CaretInvisible.

Parameters: policy new display policy

UNKNOWN: Sets the caret display policy when the view is not focused.

setCaretMode

public void setCaretMode(boolean enable)
Enables/disables caret mode. Enabling caret mode displays a caret which can be used to navigate the document using the keyboard only. Caret mode is switched off by default.

Parameters: enable true to enable, false to disable caret mode.

UNKNOWN: Enables/disables caret mode.

setCaretPosition

public void setCaretPosition(Node node, long offset, boolean extendSelection)
Sets the caret to the given position. If the given location is invalid, it will snap to the nearest valid location. Immediately afterwards a caretPositionChanged signal containing the effective position is emitted

Parameters: node node to set to offset zero-based offset within the node extendSelection If true, a selection will be spanned from the last caret position to the given one. Otherwise, any existing selection will be deselected.

UNKNOWN: Sets the caret to the given position.

setCaretPosition

public void setCaretPosition(Node node, long offset)

setCaretVisible

public void setCaretVisible(boolean show)
Sets the visibility of the caret. This methods displays or hides the caret regardless of the current caret display policy (see setCaretDisplayNonFocused), and regardless of focus. The caret will be shown/hidden only under at least one of the following conditions:
  • the document is editable
  • the document is in caret mode
  • the document's currently focused element is editable
  • Parameters: show true to make visible, false to hide.

    UNKNOWN: Sets the visibility of the caret.

    setCharset

    public boolean setCharset(String arg1, boolean arg2)

    setDNDEnabled

    public void setDNDEnabled(boolean b)
    Enables or disables Drag'n'Drop support. A drag operation is started if the users drags a link.

    UNKNOWN: Enables or disables Drag'n'Drop support.

    setEditable

    public void setEditable(boolean enable)
    Makes the document editable. Setting this property to true makes the document, and its subdocuments (such as frames, iframes, objects) editable as a whole. FIXME: insert more information about navigation, features etc. as seen fit

    Parameters: enable true to set document editable, false to set it read-only.

    UNKNOWN: Makes the document editable.

    setEncoding

    public boolean setEncoding(String name, boolean override)
    Sets the encoding the page uses. This can be different from the charset. The widget will try to reload the current page in the new encoding, if url() is not empty.

    UNKNOWN: Sets the encoding the page uses.

    setEncoding

    public boolean setEncoding(String name)

    setFixedFont

    public void setFixedFont(String name)
    Sets the fixed font style.

    Parameters: name The font name to use for fixed text, e.g. the <pre> tag.

    UNKNOWN: Sets the fixed font style.

    setFormNotification

    public void setFormNotification(int fn)
    Determine if signal should be emitted before, instead or never when a submitForm() happens.

    UNKNOWN: Determine if signal should be emitted before, instead or never when a submitForm() happens.

    setJavaEnabled

    public void setJavaEnabled(boolean enable)
    Enables/disables Java applet support. Note that calling this function will permanently override the User settings about Java applet support. Not calling this function is the only way to let the default settings apply.

    UNKNOWN: Enables/disables Java applet support.

    setJScriptEnabled

    public void setJScriptEnabled(boolean enable)
    Enable/disable Javascript support. Note that this will in either case permanently override the default usersetting. If you want to have the default UserSettings, don't call this method.

    UNKNOWN: Enable/disable Javascript support.

    setJSDefaultStatusBarText

    public void setJSDefaultStatusBarText(String text)
    Called by KJS. Sets the DefaultStatusBarText assigned via window.defaultStatus

    UNKNOWN: Called by KJS.

    setJSStatusBarText

    public void setJSStatusBarText(String text)
    Called by KJS. Sets the StatusBarText assigned via window.status

    UNKNOWN: Called by KJS.

    setMetaRefreshEnabled

    public void setMetaRefreshEnabled(boolean enable)
    Enable/disable automatic forwarding by <meta http-equiv="refresh" ....>

    UNKNOWN: Enable/disable automatic forwarding by <meta http-equiv="refresh" .

    setOnlyLocalReferences

    public void setOnlyLocalReferences(boolean enable)
    Security option. Specify whether only file:/ or data:/ urls are allowed to be loaded without user confirmation by KHTML. ( for example referenced by stylesheets, images, scripts, subdocuments, embedded elements ). This option is mainly intended for enabling the "mail reader mode", where you load untrusted content with a file:/ url. Please note that enabling this option currently automatically disables Javascript, Java and Plugins support. This might change in the future if the security model is becoming more sophisticated, so don't rely on this behaviour. ( default false - everything is loaded unless forbidden by KApplication.authorizeURLAction).

    UNKNOWN: Security option.

    setPluginPageQuestionAsked

    protected void setPluginPageQuestionAsked(String mimetype)

    setPluginsEnabled

    public void setPluginsEnabled(boolean enable)
    Enables or disables plugins, default is enabled

    UNKNOWN: Enables or disables plugins, default is enabled

    setSelection

    public void setSelection(Range arg1)
    Sets the current selection.

    UNKNOWN: Sets the current selection.

    setStandardFont

    public void setStandardFont(String name)
    Sets the standard font style.

    Parameters: name The font name to use for standard text.

    UNKNOWN: Sets the standard font style.

    setStatusMessagesEnabled

    public void setStatusMessagesEnabled(boolean enable)
    Enable/disable statusbar messages. When this class wants to set the statusbar text, it emits setStatusBarText(String text) If you want to catch this for your own statusbar, note that it returns back a rich text string, starting with "". This you need to either pass this into your own QLabel or to strip out the tags before passing it to QStatusBar.message(String message)

    See Also: ( KHTMLPart KHTMLPart

    UNKNOWN: Enable/disable statusbar messages.

    setSuppressedPopupIndicator

    public void setSuppressedPopupIndicator(boolean enable, KHTMLPart originPart)
    Shows or hides the suppressed popup indicator

    UNKNOWN: Shows or hides the suppressed popup indicator

    settings

    public KHTMLSettings settings()

    UNKNOWN:

    setURLCursor

    public void setURLCursor(QCursor c)
    Sets the cursor to use when the cursor is on a link.

    UNKNOWN: Sets the cursor to use when the cursor is on a link.

    setUserStyleSheet

    public void setUserStyleSheet(KURL url)
    Sets a user defined style sheet to be used on top of the HTML 4 default style sheet. This gives a wide range of possibilities to change the layout of the page. To have an effect this function has to be called after calling begin().

    UNKNOWN: Sets a user defined style sheet to be used on top of the HTML 4 default style sheet.

    setUserStyleSheet

    public void setUserStyleSheet(String styleSheet)
    Sets a user defined style sheet to be used on top of the HTML 4 default style sheet. This gives a wide range of possibilities to change the layout of the page. To have an effect this function has to be called after calling begin().

    UNKNOWN: Sets a user defined style sheet to be used on top of the HTML 4 default style sheet.

    setZoomFactor

    public void setZoomFactor(int percent)
    Sets the Zoom factor. The value is given in percent, larger values mean a generally larger font and larger page contents. It is not guaranteed that all parts of the page are scaled with the same factor though. The given value should be in the range of 20..300, values outside that range are not guaranteed to work. A value of 100 will disable all zooming and show the page with the sizes determined via the given lengths in the stylesheets.

    UNKNOWN: Sets the Zoom factor.

    show

    public void show()
    Convenience method to show the document's view. Equivalent to widget().show() or view().show() .

    UNKNOWN: Convenience method to show the document's view.

    showError

    public void showError(Job job)
    Called when a certain error situation (i.e. connection timed out) occurred. The default implementation either shows a KIO error dialog or loads a more verbose error description a as page, depending on the users configuration. job is the job that signaled the error situation

    UNKNOWN: Called when a certain error situation (i.

    statusMessagesEnabled

    public boolean statusMessagesEnabled()
    Returns true if status messages are enabled.

    UNKNOWN: Returns true if status messages are enabled.

    stopAnimations

    public void stopAnimations()
    Stops all animated images on the current and child pages

    UNKNOWN: Stops all animated images on the current and child pages

    submitFormProxy

    public void submitFormProxy(String action, String url, byte[] formData, String target, String contentType, String boundary)

    submitFormProxy

    public void submitFormProxy(String action, String url, byte[] formData, String target, String contentType)

    submitFormProxy

    public void submitFormProxy(String action, String url, byte[] formData, String target)

    toplevelURL

    public KURL toplevelURL()
    Returns the toplevel (origin) URL of this document, even if this part is a frame or an iframe.

    Returns: the actual original url.

    UNKNOWN: Returns the toplevel (origin) URL of this document, even if this part is a frame or an iframe.

    urlCursor

    public QCursor urlCursor()
    Returns the cursor which is used when the cursor is on a link.

    UNKNOWN: Returns the cursor which is used when the cursor is on a link.

    urlSelected

    protected void urlSelected(String url, int button, int state, String _target, URLArgs args)

    urlSelected

    protected void urlSelected(String url, int button, int state, String _target)

    view

    public KHTMLView view()
    Returns a pointer to the HTML document's view.

    UNKNOWN: Returns a pointer to the HTML document's view.

    write

    public void write(String str, int len)
    Writes another part of the HTML code to the widget. You may call this function many times in sequence. But remember: The fewer calls you make, the faster the widget will be. The HTML code is send through a decoder which decodes the stream to Unicode. The len parameter is needed for streams encoded in utf-16, since these can have \\0 chars in them. In case the encoding you're using isn't utf-16, you can safely leave out the length parameter. Attention: Don't mix calls to write( String ) with calls to write( String ). The result might not be what you want.

    UNKNOWN: Writes another part of the HTML code to the widget.

    write

    public void write(String str)

    zoomFactor

    public int zoomFactor()
    Returns the current zoom factor.

    UNKNOWN: Returns the current zoom factor.