• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEWebKit

Public Types | Public Slots | Public Member Functions | Protected Member Functions | List of all members
KWebPage Class Reference

#include <kwebpage.h>

Inheritance diagram for KWebPage:
Inheritance graph
[legend]

Public Types

enum  IntegrationFlags { NoIntegration = 0x01, KIOIntegration = 0x02, KPartsIntegration = 0x04, KWalletIntegration = 0x08 }
 

Public Slots

virtual void downloadRequest (const QNetworkRequest &request)
 
void downloadResponse (QNetworkReply *reply)
 
virtual void downloadUrl (const KUrl &url)
 

Public Member Functions

 KWebPage (QObject *parent=0, Integration flags=Integration())
 
 ~KWebPage ()
 
bool isExternalContentAllowed () const
 
void setAllowExternalContent (bool allow)
 
void setWallet (KWebWallet *wallet)
 
KWebWallet * wallet () const
 
- Public Member Functions inherited from QWebPage
 QWebPage (QObject *parent)
 
 ~QWebPage ()
 
QAction * action (WebAction action) const
 
void applicationCacheQuotaExceeded (QWebSecurityOrigin *origin, quint64 defaultOriginQuota)
 
quint64 bytesReceived () const
 
void contentsChanged ()
 
QMenu * createStandardContextMenu ()
 
QWebFrame * currentFrame () const
 
void databaseQuotaExceeded (QWebFrame *frame, QString databaseName)
 
void downloadRequested (const QNetworkRequest &request)
 
virtual bool event (QEvent *ev)
 
virtual bool extension (Extension extension, const ExtensionOption *option, ExtensionReturn *output)
 
void featurePermissionRequestCanceled (QWebFrame *frame, QWebPage::Feature feature)
 
void featurePermissionRequested (QWebFrame *frame, QWebPage::Feature feature)
 
bool findText (const QString &subString, QFlags< QWebPage::FindFlag > options)
 
bool focusNextPrevChild (bool next)
 
bool forwardUnsupportedContent () const
 
QWebFrame * frameAt (const QPoint &pos) const
 
void frameCreated (QWebFrame *frame)
 
void geometryChangeRequested (const QRect &geom)
 
bool hasSelection () const
 
QWebHistory * history () const
 
QVariant inputMethodQuery (Qt::InputMethodQuery property) const
 
bool isContentEditable () const
 
bool isModified () const
 
void linkClicked (const QUrl &url)
 
LinkDelegationPolicy linkDelegationPolicy () const
 
void linkHovered (const QString &link, const QString &title, const QString &textContent)
 
void loadFinished (bool ok)
 
void loadProgress (int progress)
 
void loadStarted ()
 
QWebFrame * mainFrame () const
 
void menuBarVisibilityChangeRequested (bool visible)
 
void microFocusChanged ()
 
QNetworkAccessManager * networkAccessManager () const
 
QPalette palette () const
 
QWebPluginFactory * pluginFactory () const
 
QSize preferredContentsSize () const
 
void printRequested (QWebFrame *frame)
 
void repaintRequested (const QRect &dirtyRect)
 
void restoreFrameStateRequested (QWebFrame *frame)
 
void saveFrameStateRequested (QWebFrame *frame, QWebHistoryItem *item)
 
void scrollRequested (int dx, int dy, const QRect &rectToScroll)
 
QString selectedHtml () const
 
QString selectedText () const
 
void selectionChanged ()
 
void setActualVisibleContentRect (const QRect &rect) const
 
void setContentEditable (bool editable)
 
void setFeaturePermission (QWebFrame *frame, Feature feature, PermissionPolicy policy)
 
void setForwardUnsupportedContent (bool forward)
 
void setLinkDelegationPolicy (LinkDelegationPolicy policy)
 
void setNetworkAccessManager (QNetworkAccessManager *manager)
 
void setPalette (const QPalette &palette)
 
void setPluginFactory (QWebPluginFactory *factory)
 
void setPreferredContentsSize (const QSize &size) const
 
QWebSettings * settings () const
 
void setView (QWidget *view)
 
void setViewportSize (const QSize &size) const
 
bool shouldInterruptJavaScript ()
 
void statusBarMessage (const QString &text)
 
void statusBarVisibilityChangeRequested (bool visible)
 
QStringList supportedContentTypes () const
 
bool supportsContentType (const QString &mimeType) const
 
virtual bool supportsExtension (Extension extension) const
 
bool swallowContextMenuEvent (QContextMenuEvent *event)
 
void toolBarVisibilityChangeRequested (bool visible)
 
quint64 totalBytes () const
 
virtual void triggerAction (WebAction action, bool checked)
 
QUndoStack * undoStack () const
 
void unsupportedContent (QNetworkReply *reply)
 
void updatePositionDependentActions (const QPoint &pos)
 
QWidget * view () const
 
ViewportAttributes viewportAttributesForSize (const QSize &availableSize) const
 
void viewportChangeRequested ()
 
QSize viewportSize () const
 
void windowCloseRequested ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Protected Member Functions

virtual bool acceptNavigationRequest (QWebFrame *frame, const QNetworkRequest &request, NavigationType type)
 
bool handleReply (QNetworkReply *reply, QString *contentType=0, KIO::MetaData *metaData=0)
 
void removeRequestMetaData (const QString &key)
 
void removeSessionMetaData (const QString &key)
 
QString requestMetaData (const QString &key) const
 
QString sessionMetaData (const QString &key) const
 
void setRequestMetaData (const QString &key, const QString &value)
 
void setSessionMetaData (const QString &key, const QString &value)
 
virtual QString userAgentForUrl (const QUrl &url) const
 
- Protected Member Functions inherited from QWebPage
virtual QString chooseFile (QWebFrame *parentFrame, const QString &suggestedFile)
 
virtual QObject * createPlugin (const QString &classid, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues)
 
virtual QWebPage * createWindow (WebWindowType type)
 
virtual void javaScriptAlert (QWebFrame *frame, const QString &msg)
 
virtual bool javaScriptConfirm (QWebFrame *frame, const QString &msg)
 
virtual void javaScriptConsoleMessage (const QString &message, int lineNumber, const QString &sourceID)
 
virtual bool javaScriptPrompt (QWebFrame *frame, const QString &msg, const QString &defaultValue, QString *result)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QWebPage
typedef FindFlags
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QWebPage
 contentEditable
 
 forwardUnsupportedContent
 
 hasSelection
 
 linkDelegationPolicy
 
 modified
 
 palette
 
 preferredContentsSize
 
 selectedHtml
 
 selectedText
 
 viewportSize
 
- Properties inherited from QObject
 objectName
 

Detailed Description

An enhanced QWebPage that provides integration into the KDE environment.

This is a convenience class that provides full integration with KDE technologies such as KIO for network request handling, KCookiejar for cookie handling, KParts for embedding non-html content and KWallet for storing form data. It also sets standard icons for many of the actions provided by QWebPage.

Most of this integration happens behind the scenes. If you want KWallet integration, however, you will have to provide a mechanism for deciding whether to allow form data to be stored. To do this, you will need to connect to the KWebWallet::saveFormDataRequested signal and call either KWebWallet::acceptSaveFormDataRequest or KWebWallet::rejectSaveFormDataRequest, typically after asking the user whether they want to save the form data. If you do not do this, no form data will be saved.

KWebPage will also not automatically load form data for you. You should connect to QWebPage::loadFinished and, if the page was loaded successfully, call

page->wallet()->fillFormData(page->mainFrame());
See also
KIO::Integration
KWebWallet
Author
Urs Wolfer <uwolfer @ kde.org>
Dawit Alemayehu <adawit @ kde.org>
Since
4.4

Definition at line 75 of file kwebpage.h.

Member Enumeration Documentation

enum KWebPage::IntegrationFlags

Flags for setting the desired level of integration.

Enumerator
NoIntegration 

Provide only very basic integration such as using KDE icons for the actions provided by QWebPage.

KIOIntegration 

Use KIO to handle network requests.

See also
KIO::Integration::AccessManager
KPartsIntegration 

Use KPart componenets, if available, to display content in <embed> and <object> tags.

KWalletIntegration 

Use KWallet to store login credentials and other form data from web sites.

See also
wallet() and setWallet()

Definition at line 84 of file kwebpage.h.

Constructor & Destructor Documentation

KWebPage::KWebPage ( QObject *  parent = 0,
Integration  flags = Integration() 
)
explicit

Constructs a KWebPage with parent parent.

Note that if no integration flags are set (the default), all integration options are activated. If you inherit from this class you can use the flags in IntegrationFlags to control how much integration should be used.

See also
KIO::Integration::CookieJar
KIO::Integration::AccessManager
wallet() and setWallet()

Definition at line 222 of file kwebpage.cpp.

KWebPage::~KWebPage ( )

Destroys the KWebPage.

Definition at line 285 of file kwebpage.cpp.

Member Function Documentation

bool KWebPage::acceptNavigationRequest ( QWebFrame *  frame,
const QNetworkRequest &  request,
NavigationType  type 
)
protectedvirtual
Reimplemented from superclass.

This performs various integration-related actions when navigation is requested. If you override this method, make sure you call the parent's implementation unless you want to block the request outright.

If you do override acceptNavigationRequest and call this method, however, be aware of the effect of the page's linkDelegationPolicy on how * QWebPage::acceptNavigationRequest behaves.

See also
QWebPage::acceptNavigationRequest

Reimplemented from QWebPage.

Definition at line 445 of file kwebpage.cpp.

void KWebPage::downloadRequest ( const QNetworkRequest &  request)
virtualslot

Download request using KIO.

This slot first prompts the user where to save the requested resource and then downloads it using KIO.

Definition at line 323 of file kwebpage.cpp.

void KWebPage::downloadResponse ( QNetworkReply *  reply)
slot

Download the resource specified by reply using KIO.

This slot first prompts the user where to save the requested resource and then downloads it using KIO.

In KDE 4.8 and higher, if reply contains a QObject property called "DownloadManagerExe", then an attempt will be made to the command specified by that property to download the specified resource.

If the "DownloadManagerExe" property is not defined or the command specified by it could not be successfully executed, then the user will be prompted for the action to take.

Since
4.5
See also
handleReply

Definition at line 340 of file kwebpage.cpp.

void KWebPage::downloadUrl ( const KUrl &  url)
virtualslot

Download url using KIO.

This slot first prompts the user where to save the requested resource and then downloads it using KIO.

Definition at line 335 of file kwebpage.cpp.

bool KWebPage::handleReply ( QNetworkReply *  reply,
QString *  contentType = 0,
KIO::MetaData *  metaData = 0 
)
protected

Attempts to handle reply and returns true on success, false otherwise.

In KDE 4.8 and higher, if reply contains a QObject property called "DownloadManagerExe", then an attempt will be made to let the command specified by that property to download the requested resource.

If the "DownloadManagerExe" property is not defined or the command specified by it could not be successfully executed, then the user will be prompted for the action to take.

Parameters
replythe QNetworkReply object to be handled.
contentTypeif not null, it will be set to the content-type specified in reply, if any.
metaDataif not null, it will be set to the KIO meta-data specified in reply, if any.
Since
4.6.3

Definition at line 477 of file kwebpage.cpp.

bool KWebPage::isExternalContentAllowed ( ) const

Whether access to remote content is permitted.

If this is false, only resources on the local system can be accessed through this web page. By default access to remote content is allowed.

If KIO integration is disabled, this will always return true.

See also
setAllowExternalContent()
KIO::Integration::AccessManager::isExternalContentAllowed()
Returns
true if access to remote content is permitted, false otherwise

Definition at line 290 of file kwebpage.cpp.

void KWebPage::removeRequestMetaData ( const QString &  key)
protected

Remove an item of request metadata.

Removes the temporary (per-request) metadata associated with key.

See also
KIO::Integration::AccessManager::requestMetaData
setRequestMetaData
Parameters
keythe key for the metadata to remove

Definition at line 416 of file kwebpage.cpp.

void KWebPage::removeSessionMetaData ( const QString &  key)
protected

Remove an item of session metadata.

Removes the permanent (per-session) metadata associated with key.

See also
KIO::Integration::AccessManager::sessionMetaData
setSessionMetaData
Parameters
keythe key for the metadata to remove

Definition at line 409 of file kwebpage.cpp.

QString KWebPage::requestMetaData ( const QString &  key) const
protected

Get an item of request metadata.

Retrieves the value of the temporary (per-request) metadata for key.

If KIO integration is disabled, this will always return an empty string.

See also
KIO::Integration::AccessManager::requestMetaData
setRequestMetaData
Parameters
keythe key of the metadata to retrieve
Returns
the value of the metadata associated with key, or an empty string if there is no such metadata

Definition at line 384 of file kwebpage.cpp.

QString KWebPage::sessionMetaData ( const QString &  key) const
protected

Get an item of session metadata.

Retrieves the value of the permanent (per-session) metadata for key.

If KIO integration is disabled, this will always return an empty string.

See also
KIO::Integration::AccessManager::sessionMetaData
setSessionMetaData
Parameters
keythe key of the metadata to retrieve
Returns
the value of the metadata associated with key, or an empty string if there is no such metadata

Definition at line 373 of file kwebpage.cpp.

void KWebPage::setAllowExternalContent ( bool  allow)

Set whether to allow remote content.

If KIO integration is not enabled, this method will have no effect.

See also
isExternalContentAllowed()
KIO::Integration::AccessManager::setAllowExternalContent(bool)
Parameters
allowtrue if access to remote content should be allowed, false if only local content should be accessible

Definition at line 303 of file kwebpage.cpp.

void KWebPage::setRequestMetaData ( const QString &  key,
const QString &  value 
)
protected

Set an item of metadata to be sent to the KIO slave with the next request.

If KIO integration is disabled, this method will have no effect.

Metadata set using this method will be deleted after it has been sent once.

See also
KIO::Integration::AccessManager::requestMetaData
Parameters
keythe key for the metadata; any existing metadata associated with this key will be overwritten
valuethe value to associate with key

Definition at line 402 of file kwebpage.cpp.

void KWebPage::setSessionMetaData ( const QString &  key,
const QString &  value 
)
protected

Set an item of metadata to be sent to the KIO slave with every request.

If KIO integration is disabled, this method will have no effect.

Metadata set using this method will be sent with every request.

See also
KIO::Integration::AccessManager::sessionMetaData
Parameters
keythe key for the metadata; any existing metadata associated with this key will be overwritten
valuethe value to associate with key

Definition at line 395 of file kwebpage.cpp.

void KWebPage::setWallet ( KWebWallet *  wallet)

Set the KWebWallet that is used to store form data.

This KWebPage will take ownership of wallet, so that the wallet is deleted when the KWebPage is deleted. If you do not want that to happen, you should call setParent() on wallet after calling this function.

See also
KWebWallet
Parameters
walletthe KWebWallet to be used for storing form data, or 0 to disable KWallet integration

Definition at line 310 of file kwebpage.cpp.

QString KWebPage::userAgentForUrl ( const QUrl &  url) const
protectedvirtual
Reimplemented from superclass.

This function is re-implemented to provide KDE user-agent management integration through KProtocolManager.

If a special user-agent has been configured for the host indicated by url, that user-agent will be returned. Otherwise, QWebPage's default user agent is returned.

See also
KProtocolManager::userAgentForHost.
QWebPage::userAgentForUrl.

Reimplemented from QWebPage.

Definition at line 423 of file kwebpage.cpp.

KWebWallet * KWebPage::wallet ( ) const

The wallet integration manager.

If you wish to use KDE wallet integration, you will have to connect to signals emitted by this object and react accordingly. See KWebWallet for more information.

Returns
the wallet integration manager, or 0 if KDE wallet integration is disabled

Definition at line 298 of file kwebpage.cpp.


The documentation for this class was generated from the following files:
  • kwebpage.h
  • kwebpage.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEWebKit

Skip menu "KDEWebKit"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal