KDE 4.9 PyKDE API Reference

- KDE's Python API

# HtmlSettingsInterface Class Reference

`from PyKDE4.kparts import *`

Namespace: KParts

## Detailed Description

An interface for modifying the settings of browser engines.

This interface provides a generic means for querying or changing the settings of browser engines that implement it.

To use this class simply cast an instance of the HTMLExtension object using qobject_cast<KParts.HtmlSettingsInterface>.

Example:

    KParts.HTMLExtension* extension = KParts.HTMLExtension.childObject(part);
    KParts.HtmlSettingsInterface* settings = qobject_cast&lt;KParts.HtmlSettingsInterface&gt;(extension);
    const bool autoLoadImages = settings->attribute(KParts.AutoLoadImages);

Since:
  4.8.1

## Enumerations

HtmlSettingsType | { AutoLoadImages, DnsPrefetchEnabled, JavaEnabled, JavascriptEnabled, MetaRefreshEnabled, PluginsEnabled, PrivateBrowsingEnabled, OfflineStorageDatabaseEnabled, OfflineWebApplicationCacheEnabled, LocalStorageEnabled, UserDefinedStyleSheetURL }
JSWindowFocusPolicy | { JSWindowFocusAllow, JSWindowFocusIgnore }
JSWindowMovePolicy | { JSWindowMoveAllow, JSWindowMoveIgnore }
JSWindowOpenPolicy | { JSWindowOpenAllow, JSWindowOpenAsk, JSWindowOpenDeny, JSWindowOpenSmart }
JSWindowResizePolicy | { JSWindowResizeAllow, JSWindowResizeIgnore }
JSWindowStatusPolicy | { JSWindowStatusAllow, JSWindowStatusIgnore }
JavaScriptAdvice | { JavaScriptDunno, JavaScriptAccept, JavaScriptReject }

## Methods

QVariant | htmlSettingsProperty (self, KParts.HtmlSettingsInterface.HtmlSettingsType type)
bool | setHtmlSettingsProperty (self, KParts.HtmlSettingsInterface.HtmlSettingsType type, QVariant value)

## Static Methods

QString | javascriptAdviceToText (KParts.HtmlSettingsInterface.JavaScriptAdvice advice)
| splitDomainAdvice (QString text, QString domain, KParts.HtmlSettingsInterface.JavaScriptAdvice javaAdvice, KParts.HtmlSettingsInterface.JavaScriptAdvice javaScriptAdvice)
KParts.HtmlSettingsInterface.JavaScriptAdvice | textToJavascriptAdvice (QString text)

## Method Documentation

QVariant htmlSettingsProperty | ( | self, |
|  | KParts.HtmlSettingsInterface.HtmlSettingsType | type
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Returns the value of the browser engine's attribute type.

bool setHtmlSettingsProperty | ( | self, |
|  | KParts.HtmlSettingsInterface.HtmlSettingsType | type,
|  | QVariant | value
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Sets the value of the browser engine's attribute type to value.

## Static Method Documentation

QString javascriptAdviceToText | ( | KParts.HtmlSettingsInterface.JavaScriptAdvice | advice
| ) |  |  |

A convenience function Returns the text for the given JavascriptAdvice advice.

If advice is not either JavaScriptAccept or JavaScriptReject, this function returns a NULL string.

Since:
  4.8.2

splitDomainAdvice | ( | QString | text,
|  | QString | domain,
|  | KParts.HtmlSettingsInterface.JavaScriptAdvice | javaAdvice,
|  | KParts.HtmlSettingsInterface.JavaScriptAdvice | javaScriptAdvice
| ) |  |  |

A convenience function that splits text into domain, javaAdvice and jScriptAdvice.

If text is empty or does not contain the proper delimiter (':'), this function will set domain to text and the other two parameters to JavaScriptDunno.

Since:
  4.8.2

KParts.HtmlSettingsInterface.JavaScriptAdvice textToJavascriptAdvice | ( | QString | text
| ) |  |  |

A convenience function that returns the javascript advice for text.

If text is not either "accept" or "reject", this function returns JavaScriptDunno.

Since:
  4.8.2

## Enumeration Documentation

HtmlSettingsType

Settings attribute types.

Enumerator:

  AutoLoadImages |
  DnsPrefetchEnabled |
  JavaEnabled |
  JavascriptEnabled |
  MetaRefreshEnabled |
  PluginsEnabled |
  PrivateBrowsingEnabled |
  OfflineStorageDatabaseEnabled |
  OfflineWebApplicationCacheEnabled |
  LocalStorageEnabled |
  UserDefinedStyleSheetURL |

JSWindowFocusPolicy

This enum specifies the policy for window.focus

Since:
  4.8.2

Enumerator:

  JSWindowFocusAllow = 0 |
  JSWindowFocusIgnore |

JSWindowMovePolicy

This enum specifies the policy for window.moveBy and .moveTo

Since:
  4.8.2

Enumerator:

  JSWindowMoveAllow = 0 |
  JSWindowMoveIgnore |

JSWindowOpenPolicy

This enum specifies the policy for window.open

Since:
  4.8.2

Enumerator:

  JSWindowOpenAllow = 0 |
  JSWindowOpenAsk |
  JSWindowOpenDeny |
  JSWindowOpenSmart |

JSWindowResizePolicy

This enum specifies the policy for window.resizeBy and .resizeTo

Since:
  4.8.2

Enumerator:

  JSWindowResizeAllow = 0 |
  JSWindowResizeIgnore |

JSWindowStatusPolicy

This enum specifies the policy for window.status and .defaultStatus

Since:
  4.8.2

Enumerator:

  JSWindowStatusAllow = 0 |
  JSWindowStatusIgnore |

JavaScriptAdvice

This enum specifies whether Java/JavaScript execution is allowed.

Since:
  4.8.2

Enumerator:

  JavaScriptDunno = 0 |
  JavaScriptAccept |
  JavaScriptReject |