KParts::HtmlSettingsInterface

Search for usage in LXR

KParts::HtmlSettingsInterface Class Referenceabstract

#include <KParts/HtmlSettingsInterface>

Inheritance diagram for KParts::HtmlSettingsInterface:

Public Types

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

Public Member Functions

virtual ~HtmlSettingsInterface ()
 
virtual QVariant htmlSettingsProperty (HtmlSettingsType type) const =0
 
virtual bool setHtmlSettingsProperty (HtmlSettingsType type, const QVariant &value)=0
 

Static Public Member Functions

static const char * javascriptAdviceToText (JavaScriptAdvice advice)
 
static void splitDomainAdvice (const QString &text, QString &domain, JavaScriptAdvice &javaAdvice, JavaScriptAdvice &javaScriptAdvice)
 
static JavaScriptAdvice textToJavascriptAdvice (const QString &text)
 

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

Definition at line 39 of file htmlsettingsinterface.h.

Member Enumeration Documentation

Settings attribute types.

Definition at line 45 of file htmlsettingsinterface.h.

This enum specifies whether Java/JavaScript execution is allowed.

Since
4.8.2

Definition at line 64 of file htmlsettingsinterface.h.

This enum specifies the policy for window.focus.

Since
4.8.2

Definition at line 117 of file htmlsettingsinterface.h.

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

Since
4.8.2

Definition at line 97 of file htmlsettingsinterface.h.

This enum specifies the policy for window.open.

Since
4.8.2

Definition at line 75 of file htmlsettingsinterface.h.

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

Since
4.8.2

Definition at line 107 of file htmlsettingsinterface.h.

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

Since
4.8.2

Definition at line 87 of file htmlsettingsinterface.h.

Constructor & Destructor Documentation

virtual KParts::HtmlSettingsInterface::~HtmlSettingsInterface ( )
inlinevirtual

Destructor.

Definition at line 125 of file htmlsettingsinterface.h.

Member Function Documentation

virtual QVariant KParts::HtmlSettingsInterface::htmlSettingsProperty ( HtmlSettingsType  type) const
pure virtual

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

const char * HtmlSettingsInterface::javascriptAdviceToText ( HtmlSettingsInterface::JavaScriptAdvice  advice)
static

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

Definition at line 14 of file htmlsettingsinterface.cpp.

virtual bool KParts::HtmlSettingsInterface::setHtmlSettingsProperty ( HtmlSettingsType  type,
const QVariant value 
)
pure virtual

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

void HtmlSettingsInterface::splitDomainAdvice ( const QString text,
QString domain,
HtmlSettingsInterface::JavaScriptAdvice javaAdvice,
HtmlSettingsInterface::JavaScriptAdvice javaScriptAdvice 
)
static

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

Definition at line 46 of file htmlsettingsinterface.cpp.

HtmlSettingsInterface::JavaScriptAdvice HtmlSettingsInterface::textToJavascriptAdvice ( const QString text)
static

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

Definition at line 31 of file htmlsettingsinterface.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Oct 24 2021 22:56:38 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.