# class KHTMLPart

###

Module | khtml
Namespace |
Class | KHTMLPart
Inherits | KParts::ReadOnlyPart

### enums

- CaretDisplayPolicy { CaretVisible, CaretInvisible, CaretBlink }
- FindOptions { FindLinksOnly, FindNoPopups }
- FormNotification { NoNotification, Before, Only, Unused }
- GUIProfile { DefaultGUI, BrowserViewGUI }
- PageSecurity { NotCrypted, Encrypted, Mixed }

enum details

### methods

- KHTMLPart (parentWidget, parent, prof)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  parentWidget | QWidget | 0
  parent | QObject | 0
  prof | KHTMLPart.GUIProfile | KHTMLPart.DefaultGUI

  Constructs a new KHTMLPart.

  KHTML basically consists of two objects: The KHTMLPart itself, holding the document data (DOM document), and the KHTMLView, derived from QScrollArea, 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 one parent for the KHTMLView. If the second parent argument is 0, then parentWidget is used as parent for both objects, the part and the view.

- KHTMLPart (view, parent, prof)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  view | KHTMLView |
  parent | QObject | 0
  prof | KHTMLPart.GUIProfile | KHTMLPart.DefaultGUI

  Constructs a new KHTMLPart.

  This constructor is useful if you wish to subclass KHTMLView. If the view passed as first argument to the constructor was built with a null KHTMLPart pointer, then the newly created KHTMLPart will be assigned as the view's part.

  Therefore, you might either initialize the view as part of the initialization list of your derived KHTMLPart class constructor:

      MyKHTMLPart() : KHTMLPart( new MyKHTMLView( this ), ...

  Or separately build the KHTMLView beforehand:

      KHTMLView * v = KHTMLView( 0, parentWidget());
      KHTMLPart * p = KHTMLPart( v ); // p will be assigned to v, so that v->part() == p

- activeNode ( )

  returns DOM.Node

  Returns the node that has the keyboard focus.

- autoloadImages ( )

  returns bool

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

- backgroundURL ( )

  returns KUrl

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

- baseURL ( )

  returns KUrl

- begin (url, xOffset, yOffset)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  url | KUrl | KUrl()
  xOffset | int | 0
  yOffset | int | 0

  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" ) );

  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.

- browserExtension ( )

  returns KParts.BrowserExtension

  Returns a pointer to the KParts.BrowserExtension.

- browserHostExtension ( )

  returns KParts.BrowserHostExtension

- caretDisplayPolicyNonFocused ( )

  returns KHTMLPart.CaretDisplayPolicy

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

- caretPositionChanged (node, offset)

  returns Nothing
  SIGNAL ("caretPositionChanged (const Node&, long)")

  Argument | Type | Default
  --- | --- | ---
  node | DOM.Node |
  offset | long |

  This signal is emitted whenever the caret position has been changed.

  The signal transmits the position the DOM.Range way, the node and the zero-based offset within this node.

  node - node which the caret is in. This can be null if the caret has been deactivated.

  offset - offset within the node. If the node is null, the offset is meaningless.

- closeUrl ( )

  returns bool

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

- completeURL (url)

  returns KUrl

  Argument | Type | Default
  --- | --- | ---
  url | QString |

  returns a KUrl object for the given url. Use when you know what you're doing.

- configurationChanged ( )

  returns Nothing
  SIGNAL ("configurationChanged ()")

  Emitted whenever the configuration has changed

- createPart (parentWidget, parent, mimetype, serviceName, serviceTypes, params)

  returns KParts.ReadOnlyPart

  Argument | Type | Default
  --- | --- | ---
  parentWidget | QWidget |
  parent | QObject |
  mimetype | QString |
  serviceName | QString |
  serviceTypes | QStringList |
  params | QStringList |

  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' .

- currentFrame ( )

  returns KParts.ReadOnlyPart

  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.

- customEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | QEvent |

- dndEnabled ( )

  returns bool

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

- doCloseStream ( )

  returns bool

  Implements the streaming API of KParts.ReadOnlyPart.

- doOpenStream (mimeType)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  mimeType | QString |

  Implements the streaming API of KParts.ReadOnlyPart.

- doWriteStream (data)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  data | QByteArray |

  Implements the streaming API of KParts.ReadOnlyPart.

- docCreated ( )

  returns Nothing
  SIGNAL ("docCreated ()")

  Internal

- document ( )

  returns DOM.Document

  Returns a reference to the DOM document.

- documentSource ( )

  returns QString

  Returns the content of the source document.

- editor ( )

  returns DOM.Editor
  KDE 4.1.0 and later only

  Returns the instance of the attached html editor interface.

- encoding ( )

  returns QString

  Returns the encoding the page currently uses.

  Note that the encoding might be different from the charset.

- end ( )

  returns Nothing

  Call this after your last call to write().

- executeScript (n, script)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  n | DOM.Node |
  script | QString |

  Same as executeScript( const QString & ) except with the Node parameter specifying the 'this' value.

- executeScript (script)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  script | QString |

  Execute the specified snippet of JavaScript code.

  Returns true if JavaScript was enabled, no error occurred and the code returned true itself or false otherwise. @deprecated, use executeString( DOM.Node(), script)

- findFrame (f)

  returns KHTMLPart

  Argument | Type | Default
  --- | --- | ---
  f | QString |

  Finds a frame by name. Returns 0 if frame can't be found.

- findFrameParent (callingPart, f, childFrame)

  returns KHTMLPart
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  callingPart | KParts.ReadOnlyPart |
  f | QString |
  childFrame | khtml.ChildFrame | 0

  Recursively finds the part containing the frame with name f and checks if it is accessible by callingPart Returns 0 if no suitable frame can't be found. Returns parent part if a suitable frame was found and frame info in *childFrame

- findFramePart (f)

  returns KParts.ReadOnlyPart

  Argument | Type | Default
  --- | --- | ---
  f | QString |

  Finds a frame by name. Returns 0 if frame can't be found.

- findText ( )

  returns Nothing

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

- findText (str, options, parent, findDialog)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  str | QString |
  options | long |
  parent | QWidget | 0
  findDialog | KFindDialog | 0

  Starts a new search, but bypasses the user dialog.

  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.

- findTextBegin ( )

  returns Nothing

  Initiates a text search.

- findTextNext (reverse)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  reverse | bool | 0

  Finds the next occurrence of a string set by findText()

  reverse - if true, revert seach direction (only if no find dialog is used) Returns true if a new match was found.

- fontScaleFactor ( )

  returns int

  Returns the current font scale factor.

- formNotification ( )

  returns KHTMLPart.FormNotification

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

- formSubmitNotification (action, url, formData, target, contentType, boundary)

  returns Nothing
  SIGNAL ("formSubmitNotification (const char*, const QString&, const QByteArray&, const QString&, const QString&, const QString&)")

  Argument | Type | Default
  --- | --- | ---
  action | char |
  url | QString |
  formData | QByteArray |
  target | QString |
  contentType | QString |
  boundary | QString |

  If form notification is on, this will be emitted either for a form submit or before the form submit according to the setting. ### KDE4 remove me

- frameExists (frameName)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  frameName | QString |

  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.

- frameNames ( )

  returns QStringList

  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.

- framejScript (framePart)

  returns KJSProxy
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  framePart | KParts.ReadOnlyPart |

  Returns child frame framePart its script interpreter

- frames ( )

  returns QList<KParts::ReadOnlyPart

- gotoAnchor (name)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  name | QString |

  Finds the anchor named name.

  If the anchor is found, the widget scrolls to the closest position. Returns if the anchor has been found.

- guiActivateEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | KParts.GUIActivateEvent |

  Internal reimplementation of KParts.Part.guiActivateEvent .

- hasSelection ( )

  returns bool

  Has the user selected anything?

  Call selectedText() to retrieve the selected text.

  Returns true if there is text selected.

- hide ( )

  returns Nothing

  Convenience method to hide the document's view.

  Equivalent to widget()->hide() or view()->hide().

- htmlDocument ( )

  returns DOM.HTMLDocument

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

- htmlError (errorCode, text, reqUrl)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  errorCode | int |
  text | QString |
  reqUrl | KUrl |

  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.

- inProgress ( )

  returns bool

  Internal

- isCaretMode ( )

  returns bool

  Returns whether caret mode is on/off.

- isEditable ( )

  returns bool

  Returns true if the document is editable, false otherwise.

- isModified ( )

  returns bool

  Checks whether the page contains unsubmitted form changes.

  Returns true if form changes exist

- isPointInsideSelection (x, y)

  returns bool
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  x | int |
  y | int |

  Returns whether the given point is inside the current selection.

  The coordinates are content-coordinates.

- jScriptEnabled ( )

  returns bool

  Returns true if Javascript support is enabled or false otherwise.

- jScriptInterpreter ( )

  returns KJS.Interpreter
  Not implemented

  Returns the JavaScript interpreter the part is using. This method is mainly intended for applications which embed and extend the part and provides a mechanism for adding additional native objects to the interpreter (or removing the built-ins).

  One thing people using this method to add things to the interpreter must consider, is that when you start writing new content to the part, the interpreter is cleared. This includes both use of the begin( const KUrl &, int, int ) method, and the openUrl( const KUrl & ) method. If you want your objects to have a longer lifespan, then you must retain a KJS.Object yourself to ensure that the reference count of your custom objects never reaches 0. You will also need to re-add your bindings every time this happens - one way to detect the need for this is to connect to the docCreated() signal, another is to reimplement the begin() method.

- javaEnabled ( )

  returns bool

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

- jsDefaultStatusBarText ( )

  returns QString

  Called by KJS. Returns the DefaultStatusBarText assigned via window.defaultStatus

- jsStatusBarText ( )

  returns QString

  Called by KJS. Returns the StatusBarText assigned via window.status

- khtmlDrawContentsEvent (a0)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | khtml.DrawContentsEvent |

  Eventhandler for the khtml.DrawContentsEvent.

- khtmlMouseDoubleClickEvent (a0)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | khtml.MouseDoubleClickEvent |

  Eventhandler for the khtml.MouseDoubleClickEvent.

- khtmlMouseMoveEvent (event)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  event | khtml.MouseMoveEvent |

  Eventhandler for the khtml.MouseMouseMoveEvent.

- khtmlMousePressEvent (event)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  event | khtml.MousePressEvent |

  Eventhandler of the khtml.MousePressEvent.

- khtmlMouseReleaseEvent (event)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  event | khtml.MouseReleaseEvent |

  Eventhandler for the khtml.MouseMouseReleaseEvent.

- lastModified ( )

  returns QString

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

- metaRefreshEnabled ( )

  returns bool

  Returns true if automatic forwarding is enabled.

- nextAnchor ( )

  returns bool

  Go to the next anchor

  This is useful to navigate from outside the navigator

- nodeActivated (a0)

  returns Nothing
  SIGNAL ("nodeActivated (const Node&)")

  Argument | Type | Default
  --- | --- | ---
  a0 | DOM.Node |

  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.

- nodeUnderMouse ( )

  returns DOM.Node

  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).

- nonSharedNodeUnderMouse ( )

  returns DOM.Node

  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).

- onURL (url)

  returns Nothing
  SIGNAL ("onURL (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  url | QString |

  Emitted if the cursor is moved over an URL.

- onlyLocalReferences ( )

  returns bool

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

- openFile ( )

  returns bool

  Internal empty reimplementation of KParts.ReadOnlyPart.openFile .

- openUrl (url)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

  Opens the specified URL url.

  Reimplemented from KParts.ReadOnlyPart.openUrl .

- pageReferrer ( )

  returns QString

  Referrer used to obtain this page.

- paint (a0, a1, a2)

  returns Nothing, bool

  Argument | Type | Default
  --- | --- | ---
  a0 | QPainter |
  a1 | QRect |
  a2 | int | 0

  Paints the HTML page to a QPainter. See KHTMLView.paint for details

- parentPart ( )

  returns KHTMLPart

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

  Returns 0 otherwise.

- partManager ( )

  returns KParts.PartManager

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

- pluginPageQuestionAsked (mimetype)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  mimetype | QString |

- pluginsEnabled ( )

  returns bool

  Returns true if plugins are enabled, false if disabled.

- popupMenu (url, point)

  returns Nothing
  SIGNAL ("popupMenu (const QString&, const QPoint&)")

  Argument | Type | Default
  --- | --- | ---
  url | QString |
  point | QPoint |

  Emitted when the user clicks the right mouse button on the document. See KParts.BrowserExtension for two more popupMenu signals emitted by khtml, with much more information in the signal.

- preloadScript (url, script)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  url | QString |
  script | QString |

  Loads a script into the script cache.

- preloadStyleSheet (url, stylesheet)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  url | QString |
  stylesheet | QString |

  Loads a style sheet into the stylesheet cache.

- prevAnchor ( )

  returns bool

  Go to previous anchor

- referrer ( )

  returns QString

  Referrer used for links in this page.

- restoreState (stream)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  stream | QDataStream |

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

  See also saveState()

  This is called from the restoreState() method of the browserExtension() .

- restored ( )

  returns bool

  Internal

- saveState (stream)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  stream | QDataStream |

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

  This is called from the saveState() method of the browserExtension().

- scheduleRedirection (delay, url, lockHistory)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  delay | int |
  url | QString |
  lockHistory | bool | 1

  Schedules a redirection after delay seconds.

- selectAll ( )

  returns Nothing

  Marks all text in the document as selected.

- selectedText ( )

  returns QString

  Returns the text the user has marked.

- selectedTextAsHTML ( )

  returns QString

  Return the text the user has marked. This is guaranteed to be valid xml, and to contain the \
  and \
  tags.

  FIXME probably should make virtual for 4.0 ?

- selection ( )

  returns DOM.Range

  Returns the selected part of the HTML.

- selection (startNode, endNode)

  returns Nothing, long (startOffset), long (endOffset)

  Argument | Type | Default
  --- | --- | ---
  startNode | DOM.Node |
  endNode | DOM.Node |

  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.

  startNode - returns node selection starts in

  startOffset - returns offset within starting node

  endNode - returns node selection ends in

  endOffset - returns offset within end node.

- selectionChanged ( )

  returns Nothing
  SIGNAL ("selectionChanged ()")

  This signal is emitted when the selection changes.

- setActiveNode (node)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  node | DOM.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

  node - The node to focus

- setAlwaysHonourDoctype (b)

  returns Nothing
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  b | bool | 1

  Sets whether the document's Doctype should always be used to determine the parsing mode for the document.

  Without this, parsing will be forced to strict mode when using the write( const QString &str ) method for backward compatibility reasons.

- setAutoloadImages (enable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |

  Specifies whether images contained in the document should be loaded automatically or not.

  Request will be ignored if called before begin().

- setCaretDisplayPolicyNonFocused (policy)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  policy | KHTMLPart.CaretDisplayPolicy |

  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.

  policy - new display policy

- setCaretMode (enable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |

  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.

  enable - true to enable, false to disable caret mode.

- setCaretPosition (node, offset, extendSelection)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  node | DOM.Node |
  offset | long |
  extendSelection | bool | 0

  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

  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.

- setCaretVisible (show)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  show | bool |

  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

show - true to make visible, false to hide.

- setDNDEnabled (b)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  b | bool |

  Enables or disables Drag'n'Drop support. A drag operation is started if the users drags a link.

- setEditable (enable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |

  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

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

- setEncoding (name, override)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  name | QString |
  override | bool | 0

  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.

- setFixedFont (name)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  name | QString |

  Sets the fixed font style.

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

- setFontScaleFactor (percent)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  percent | int |

  Sets the scale factor to be applied to fonts. The value is given in percent, larger values mean generally larger fonts.

  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 scaling of font sizes and show the page with the sizes determined via the given lengths in the stylesheets.

- setFormNotification (fn)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  fn | KHTMLPart.FormNotification |

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

- setJSDefaultStatusBarText (text)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |

  Called by KJS. Sets the DefaultStatusBarText assigned via window.defaultStatus

- setJSStatusBarText (text)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |

  Called by KJS. Sets the StatusBarText assigned via window.status

- setJScriptEnabled (enable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |

  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.

- setJavaEnabled (enable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |

  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.

- setMetaRefreshEnabled (enable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |

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

- setOnlyLocalReferences (enable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |

  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).

- setPageSecurity (sec)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  sec | KHTMLPart.PageSecurity |

- setPluginPageQuestionAsked (mimetype)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  mimetype | QString |

- setPluginsEnabled (enable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |

  Enables or disables plugins, default is enabled

- setSelection (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | DOM.Range |

  Sets the current selection.

- setStandardFont (name)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  name | QString |

  Sets the standard font style.

  name - The font name to use for standard text.

- setStatusBarText (a0, a1)

  returns Nothing
  Not implemented
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QString |
  a1 | int |

- setStatusMessagesEnabled (enable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |

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

  See also KParts.Part.setStatusBarText( const QString & text )

- setSuppressedPopupIndicator (enable, originPart)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |
  originPart | KHTMLPart | 0

  Shows or hides the suppressed popup indicator

- setURLCursor (c)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  c | QCursor |

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

- setUserStyleSheet (url)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

  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().

- setUserStyleSheet (styleSheet)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  styleSheet | QString |

  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().

- setZoomFactor (percent)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  percent | int |

  Sets the Zoom factor. The value is given in percent, larger values mean a generally larger font and larger page contents.

  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.

- settings ( )

  returns KHTMLSettings

  Internal

- show ( )

  returns Nothing

  Convenience method to show the document's view.

  Equivalent to widget()->show() or view()->show() .

- showError (job)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  job | KJob |

  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

- slotFinished (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | KJob |

  Called when the job downloading the page is finished. Can be reimplemented, for instance to get metadata out of the job, but make sure to call KHTMLPart.slotFinished() too.

- startingJob (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | KIO.Job |

  Hook for adding code before a job is started. This can be used to add metadata, like job->addMetaData("PropagateHttpHeader", "true") to get the HTTP headers.

- statusMessagesEnabled ( )

  returns bool

  Returns true if status messages are enabled.

- stopAnimations ( )

  returns Nothing

  Stops all animated images on the current and child pages

- submitFormProxy (action, url, formData, target, contentType, boundary)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  action | char |
  url | QString |
  formData | QByteArray |
  target | QString |
  contentType | QString | QString()
  boundary | QString | QString()

- timerEvent (a0)

  returns Nothing
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  a0 | QTimerEvent |

  Internal

- toplevelURL ( )

  returns KUrl

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

  Returns the actual original url.

- urlCursor ( )

  returns QCursor

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

- urlSelected (url, button, state, _target, args, browserArgs)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  url | QString |
  button | int |
  state | int |
  _target | QString |
  args | KParts.OpenUrlArguments | KParts.OpenUrlArguments()
  browserArgs | KParts.BrowserArguments | KParts.BrowserArguments()

- view ( )

  returns KHTMLView

  Returns a pointer to the HTML document's view.

- write (str, len)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  str | char |
  len | int | -1

  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( const char *) with calls to write( const QString & ).

  The result might not be what you want.

- write (str)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  str | QString |

  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.

  For historic and backward compatibility reasons, this method will force the use of strict mode for the document, unless setAlwaysHonourDoctype() has been called previously.

- zoomFactor ( )

  returns int

  Returns the current zoom factor.

### enums - detail

- CaretDisplayPolicy { CaretVisible, CaretInvisible, CaretBlink }

  Enumeration for displaying the caret.

  | CaretVisible | - | - |
  | CaretInvisible | - | - |
  | CaretBlink | - | - |

- FindOptions { FindLinksOnly, FindNoPopups }

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

  | FindLinksOnly | - 1*KFind::MinimumUserOption | - |
  | FindNoPopups | - 2*KFind::MinimumUserOption | - |

- FormNotification { NoNotification, Before, Only, Unused }

  | NoNotification | - 0 | - |
  | Before | - | - |
  | Only | - | - |
  | Unused | - 255 | - |

- GUIProfile { DefaultGUI, BrowserViewGUI }

  | DefaultGUI | - | - |
  | BrowserViewGUI | - | - |

- PageSecurity { NotCrypted, Encrypted, Mixed }

  | NotCrypted | - | - |
  | Encrypted | - | - |
  | Mixed | - | - |