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

KHTML

Public Types | Public Slots | Signals | Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Properties | List of all members
KHTMLPart Class Reference

#include <khtml_part.h>

Inheritance diagram for KHTMLPart:
Inheritance graph
[legend]

Public Types

enum  CaretDisplayPolicy { CaretVisible, CaretInvisible, CaretBlink }
 
enum  DNSPrefetch { DNSPrefetchDisabled =0, DNSPrefetchEnabled, DNSPrefetchOnlyWWWAndSLD }
 
enum  FindOptions { FindLinksOnly = 1 * KFind::MinimumUserOption, FindNoPopups = 2 * KFind::MinimumUserOption }
 
enum  FormNotification { NoNotification = 0, Before, Only, Unused =255 }
 
enum  GUIProfile { DefaultGUI, BrowserViewGUI }
 
- Public Types inherited from KXMLGUIClient
enum  ReverseStateChange
 

Public Slots

QVariant executeScript (const QString &script)
 
void setActiveNode (const DOM::Node &node)
 
void setCaretMode (bool enable)
 
void setCaretVisible (bool show)
 
void setEditable (bool enable)
 
void stopAnimations ()
 
void submitFormProxy (const char *action, const QString &url, const QByteArray &formData, const QString &target, const QString &contentType=QString(), const QString &boundary=QString())
 
- Public Slots inherited from KParts::ReadOnlyPart

Signals

void caretPositionChanged (const DOM::Node &node, long offset)
 
void configurationChanged ()
 
void docCreated ()
 
void formSubmitNotification (const char *action, const QString &url, const QByteArray &formData, const QString &target, const QString &contentType, const QString &boundary)
 
void nodeActivated (const DOM::Node &)
 
void onURL (const QString &url)
 
void popupMenu (const QString &url, const QPoint &point)
 
void selectionChanged ()
 
- Signals inherited from KParts::ReadOnlyPart
void canceled (const QString &errMsg)
 
void completed ()
 
void completed (bool pendingAction)
 
void started (KIO::Job *)
 
void urlChanged (const KUrl &url)
 
- Signals inherited from KParts::Part
void setStatusBarText (const QString &text)
 
void setWindowCaption (const QString &caption)
 

Public Member Functions

 KHTMLPart (QWidget *parentWidget=0, QObject *parent=0, GUIProfile prof=DefaultGUI)
 
 KHTMLPart (KHTMLView *view, QObject *parent=0, GUIProfile prof=DefaultGUI)
 
virtual ~KHTMLPart ()
 
DOM::Node activeNode () const
 
bool autoloadImages () const
 
KUrl backgroundURL () const
 
KUrl baseURL () const
 
virtual void begin (const KUrl &url=KUrl(), int xOffset=0, int yOffset=0)
 
KParts::BrowserExtension * browserExtension () const
 
KParts::BrowserHostExtension * browserHostExtension () const
 
CaretDisplayPolicy caretDisplayPolicyNonFocused () const
 
virtual bool closeUrl ()
 
KParts::ReadOnlyPart * currentFrame () const
 
bool dndEnabled () const
 
DNSPrefetch dnsPrefetch () const
 
DOM::Document document () const
 
QString documentSource () const
 
DOM::Editor * editor () const
 
QString encoding () const
 
virtual void end ()
 
QVariant executeScript (const DOM::Node &n, const QString &script)
 
KHTMLPart * findFrame (const QString &f)
 
KHTMLPart * findFrameParent (KParts::ReadOnlyPart *callingPart, const QString &f, khtml::ChildFrame **childFrame=0)
 
KParts::ReadOnlyPart * findFramePart (const QString &f)
 
void findText ()
 
void findText (const QString &str, long options, QWidget *parent=0, KFindDialog *findDialog=0)
 
void findTextBegin ()
 
bool findTextNext (bool reverse=false)
 
int fontScaleFactor () const
 
bool forcePermitLocalImages () const
 
FormNotification formNotification () const
 
bool frameExists (const QString &frameName)
 
KJSProxy * framejScript (KParts::ReadOnlyPart *framePart)
 
QStringList frameNames () const
 
QList< KParts::ReadOnlyPart * > frames () const
 
bool gotoAnchor (const QString &name)
 
bool hasSelection () const
 
void hide ()
 
DOM::HTMLDocument htmlDocument () const
 
KHTMLPartPrivate * impl ()
 
bool inProgress () const
 
bool isCaretMode () const
 
bool isEditable () const
 
bool isModified () const
 
bool isPointInsideSelection (int x, int y)
 
bool javaEnabled () const
 
bool jScriptEnabled () const
 
KJS::Interpreter * jScriptInterpreter ()
 
QString jsDefaultStatusBarText () const
 
QString jsStatusBarText () const
 
QString lastModified () const
 
bool metaRefreshEnabled () const
 
bool nextAnchor ()
 
DOM::Node nodeUnderMouse () const
 
DOM::Node nonSharedNodeUnderMouse () const
 
bool onlyLocalReferences () const
 
virtual bool openUrl (const KUrl &url)
 
QString pageReferrer () const
 
void paint (QPainter *, const QRect &, int=0, bool *=0)
 
KHTMLPart * parentPart ()
 
KParts::PartManager * partManager ()
 
bool pluginsEnabled () const
 
void preloadScript (const QString &url, const QString &script)
 
void preloadStyleSheet (const QString &url, const QString &stylesheet)
 
bool prevAnchor ()
 
QString referrer () const
 
bool restored () const
 
virtual void restoreState (QDataStream &stream)
 
virtual void saveState (QDataStream &stream)
 
void scheduleRedirection (int delay, const QString &url, bool lockHistory=true)
 
void selectAll ()
 
virtual QString selectedText () const
 
QString selectedTextAsHTML () const
 
DOM::Range selection () const
 
void selection (DOM::Node &startNode, long &startOffset, DOM::Node &endNode, long &endOffset) const
 
void setAlwaysHonourDoctype (bool b=true)
 
void setAutoloadImages (bool enable)
 
void setCaretDisplayPolicyNonFocused (CaretDisplayPolicy policy)
 
void setCaretPosition (DOM::Node node, long offset, bool extendSelection=false)
 
void setDNDEnabled (bool b)
 
void setDNSPrefetch (DNSPrefetch pmode)
 
bool setEncoding (const QString &name, bool override=false)
 
void setFixedFont (const QString &name)
 
void setFontScaleFactor (int percent)
 
void setForcePermitLocalImages (bool enable)
 
void setFormNotification (FormNotification fn)
 
void setJavaEnabled (bool enable)
 
void setJScriptEnabled (bool enable)
 
void setJSDefaultStatusBarText (const QString &text)
 
void setJSStatusBarText (const QString &text)
 
void setMetaRefreshEnabled (bool enable)
 
void setOnlyLocalReferences (bool enable)
 
void setPluginsEnabled (bool enable)
 
void setSelection (const DOM::Range &)
 
void setStandardFont (const QString &name)
 
void setStatusMessagesEnabled (bool enable)
 
void setSuppressedPopupIndicator (bool enable, KHTMLPart *originPart=0)
 
const KHTMLSettings * settings () const
 
void setURLCursor (const QCursor &c)
 
void setUserStyleSheet (const KUrl &url)
 
void setUserStyleSheet (const QString &styleSheet)
 
void setZoomFactor (int percent)
 
void show ()
 
virtual void showError (KJob *job)
 
bool statusMessagesEnabled () const
 
KUrl toplevelURL ()
 
QCursor urlCursor () const
 
KHTMLView * view () const
 
virtual void write (const char *str, int len=-1)
 
virtual void write (const QString &str)
 
int zoomFactor () const
 
- Public Member Functions inherited from KParts::ReadOnlyPart
 ReadOnlyPart (QObject *parent=0)
 
virtual ~ReadOnlyPart ()
 
OpenUrlArguments arguments () const
 
BrowserExtension * browserExtension () const
 
bool closeStream ()
 
bool isProgressInfoEnabled () const
 
bool openStream (const QString &mimeType, const KUrl &url)
 
void setArguments (const OpenUrlArguments &arguments)
 
void setProgressInfoEnabled (bool show)
 
void showProgressInfo (bool show)
 
KUrl url () const
 
bool writeStream (const QByteArray &data)
 
- Public Member Functions inherited from KParts::Part
 Part (QObject *parent=0)
 
virtual ~Part ()
 
virtual void embed (QWidget *parentWidget)
 
virtual Part * hitTest (QWidget *widget, const QPoint &globalPos)
 
KIconLoader * iconLoader ()
 
bool isSelectable () const
 
PartManager * manager () const
 
void setAutoDeletePart (bool autoDeletePart)
 
void setAutoDeleteWidget (bool autoDeleteWidget)
 
virtual void setManager (PartManager *manager)
 
virtual void setSelectable (bool selectable)
 
virtual QWidget * widget ()
 
- Public Member Functions inherited from KXMLGUIClient
 KXMLGUIClient ()
 
 KXMLGUIClient (KXMLGUIClient *parent)
 
virtual ~KXMLGUIClient ()
 
QAction * action (const char *name) const
 
virtual QAction * action (const QDomElement &element) const
 
virtual KActionCollection * actionCollection () const
 
void addStateActionDisabled (const QString &state, const QString &action)
 
void addStateActionEnabled (const QString &state, const QString &action)
 
void beginXMLPlug (QWidget *)
 
QList< KXMLGUIClient * > childClients ()
 
KXMLGUIBuilder * clientBuilder () const
 
virtual KComponentData componentData () const
 
virtual QDomDocument domDocument () const
 
void endXMLPlug ()
 
KXMLGUIFactory * factory () const
 
StateChange getActionsToChangeForState (const QString &state)
 
void insertChildClient (KXMLGUIClient *child)
 
virtual QString localXMLFile () const
 
KXMLGUIClient * parentClient () const
 
void plugActionList (const QString &name, const QList< QAction * > &actionList)
 
void prepareXMLUnplug (QWidget *)
 
void reloadXML ()
 
void removeChildClient (KXMLGUIClient *child)
 
void replaceXMLFile (const QString &xmlfile, const QString &localxmlfile, bool merge=false)
 
void setClientBuilder (KXMLGUIBuilder *builder)
 
void setFactory (KXMLGUIFactory *factory)
 
void setXMLGUIBuildDocument (const QDomDocument &doc)
 
void unplugActionList (const QString &name)
 
virtual QString xmlFile () const
 
QDomDocument xmlguiBuildDocument () const
 

Protected Types

enum  PageSecurity { NotCrypted, Encrypted, Mixed }
 

Protected Slots

virtual void slotFinished (KJob *)
 
- Protected Slots inherited from KParts::Part
void slotWidgetDestroyed ()
 

Protected Member Functions

KUrl completeURL (const QString &url)
 
virtual KParts::ReadOnlyPart * createPart (QWidget *parentWidget, QObject *parent, const QString &mimetype, QString &serviceName, QStringList &serviceTypes, const QStringList &params)
 
virtual void customEvent (QEvent *event)
 
virtual bool doCloseStream ()
 
virtual bool doOpenStream (const QString &mimeType)
 
virtual bool doWriteStream (const QByteArray &data)
 
virtual void guiActivateEvent (KParts::GUIActivateEvent *event)
 
void htmlError (int errorCode, const QString &text, const KUrl &reqUrl)
 
virtual void khtmlDrawContentsEvent (khtml::DrawContentsEvent *)
 
virtual void khtmlMouseDoubleClickEvent (khtml::MouseDoubleClickEvent *)
 
virtual void khtmlMouseMoveEvent (khtml::MouseMoveEvent *event)
 
virtual void khtmlMousePressEvent (khtml::MousePressEvent *event)
 
virtual void khtmlMouseReleaseEvent (khtml::MouseReleaseEvent *event)
 
bool mayPrefetchHostname (const QString &name)
 
virtual bool openFile ()
 
bool pluginPageQuestionAsked (const QString &mimetype) const
 
void setPageSecurity (PageSecurity sec)
 
void setPluginPageQuestionAsked (const QString &mimetype)
 
virtual void startingJob (KIO::Job *)
 
virtual void timerEvent (QTimerEvent *)
 
void updateZoomFactor ()
 
virtual bool urlSelected (const QString &url, int button, int state, const QString &_target, const KParts::OpenUrlArguments &args=KParts::OpenUrlArguments(), const KParts::BrowserArguments &browserArgs=KParts::BrowserArguments())
 
- Protected Member Functions inherited from KParts::ReadOnlyPart
 ReadOnlyPart (ReadOnlyPartPrivate &dd, QObject *parent)
 
void abortLoad ()
 
bool isLocalFileTemporary () const
 
QString localFilePath () const
 
void setLocalFilePath (const QString &localFilePath)
 
void setLocalFileTemporary (bool temp)
 
void setUrl (const KUrl &url)
 
- Protected Member Functions inherited from KParts::Part
 Part (PartPrivate &dd, QObject *parent)
 
QWidget * hostContainer (const QString &containerName)
 
void loadPlugins ()
 
virtual void partActivateEvent (PartActivateEvent *event)
 
virtual void partSelectEvent (PartSelectEvent *event)
 
virtual void setWidget (QWidget *widget)
 
- Protected Member Functions inherited from KXMLGUIClient
void loadStandardsXmlFile ()
 
virtual void setComponentData (const KComponentData &componentData)
 
virtual void setDOMDocument (const QDomDocument &document, bool merge=false)
 
virtual void setLocalXMLFile (const QString &file)
 
virtual void setXML (const QString &document, bool merge=false)
 
virtual void setXMLFile (const QString &file, bool merge=false, bool setXMLDoc=true)
 
virtual void stateChanged (const QString &newstate, ReverseStateChange reverse=StateNoReverse)
 
virtual void virtual_hook (int id, void *data)
 

Properties

bool dndEnabled
 
DNSPrefetch dnsPrefetch
 
QString encoding
 
bool javaEnabled
 
bool javaScriptEnabled
 
QString lastModified
 
bool metaRefreshEnabled
 
bool modified
 
bool pluginsEnabled
 
- Properties inherited from KParts::ReadOnlyPart
KUrl url
 

Additional Inherited Members

- Static Public Member Functions inherited from KXMLGUIClient
static QString findMostRecentXMLFile (const QStringList &files, QString &doc)
 

Detailed Description

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:

QString 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 QString 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( QCString( "<html><body><p>KHTML Rocks!</p></body></html>" ) );
doc->closeStream();

HTML Browser Widget

Author
Lars Knoll (knoll.nosp@m.@kde.nosp@m..org)

Definition at line 206 of file khtml_part.h.

Member Enumeration Documentation

enum KHTMLPart::CaretDisplayPolicy

Enumeration for displaying the caret.

Enumerator
CaretVisible 

caret is displayed

CaretInvisible 

caret is not displayed

CaretBlink 

caret toggles between visible and invisible

Definition at line 586 of file khtml_part.h.

enum KHTMLPart::DNSPrefetch

DNS Prefetching Mode enumeration.

  • DNSPrefetchDisabled do not prefetch hostnames
  • DNSPrefetchEnabled always prefetch hostnames
  • DNSPrefetchOnlyWWWAndSLD only do DNS prefetching for bare SLD and www sub-domain
Enumerator
DNSPrefetchDisabled 
DNSPrefetchEnabled 
DNSPrefetchOnlyWWWAndSLD 

Definition at line 281 of file khtml_part.h.

enum KHTMLPart::FindOptions

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

Enumerator
FindLinksOnly 
FindNoPopups 

Definition at line 787 of file khtml_part.h.

enum KHTMLPart::FormNotification
Enumerator
NoNotification 
Before 
Only 
Unused 

Definition at line 1106 of file khtml_part.h.

enum KHTMLPart::GUIProfile
Enumerator
DefaultGUI 
BrowserViewGUI 

Definition at line 272 of file khtml_part.h.

enum KHTMLPart::PageSecurity
protected
Enumerator
NotCrypted 
Encrypted 
Mixed 

Definition at line 1277 of file khtml_part.h.

Constructor & Destructor Documentation

KHTMLPart::KHTMLPart ( QWidget *  parentWidget = 0,
QObject *  parent = 0,
GUIProfile  prof = 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 0L, then parentWidget is used as parent for both objects, the part and the view.

Definition at line 182 of file khtml_part.cpp.

KHTMLPart::KHTMLPart ( KHTMLView *  view,
QObject *  parent = 0,
GUIProfile  prof = 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( 0L, parentWidget());
KHTMLPart * p = KHTMLPart( v ); // p will be assigned to v, so that v->part() == p

Definition at line 191 of file khtml_part.cpp.

KHTMLPart::~KHTMLPart ( )
virtual

Destructor.

Definition at line 533 of file khtml_part.cpp.

Member Function Documentation

DOM::Node KHTMLPart::activeNode ( ) const

Returns the node that has the keyboard focus.

Definition at line 6937 of file khtml_part.cpp.

bool KHTMLPart::autoloadImages ( ) const

Returns whether images contained in the document are loaded automatically or not.

Note
that the returned information is unrelieable as long as no begin() was called.

Definition at line 1480 of file khtml_part.cpp.

KUrl KHTMLPart::backgroundURL ( ) const

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

Definition at line 3934 of file khtml_part.cpp.

KUrl KHTMLPart::baseURL ( ) const

Definition at line 2516 of file khtml_part.cpp.

void KHTMLPart::begin ( const KUrl &  url = KUrl(),
int  xOffset = 0,
int  yOffset = 0 
)
virtual

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
urlis 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.
xOffsetis the initial horizontal scrollbar value. Usually you don't want to use this.
yOffsetis 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.

Definition at line 1995 of file khtml_part.cpp.

KParts::BrowserExtension * KHTMLPart::browserExtension ( ) const

Returns a pointer to the KParts::BrowserExtension.

Definition at line 1046 of file khtml_part.cpp.

KParts::BrowserHostExtension * KHTMLPart::browserHostExtension ( ) const

Definition at line 1051 of file khtml_part.cpp.

KHTMLPart::CaretDisplayPolicy KHTMLPart::caretDisplayPolicyNonFocused ( ) const

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

Definition at line 2933 of file khtml_part.cpp.

void KHTMLPart::caretPositionChanged ( const DOM::Node &  node,
long  offset 
)
signal

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.

Parameters
nodenode which the caret is in. This can be null if the caret has been deactivated.
offsetoffset within the node. If the node is null, the offset is meaningless.
bool KHTMLPart::closeUrl ( )
virtual

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

Reimplemented from KParts::ReadOnlyPart.

Definition at line 919 of file khtml_part.cpp.

KUrl KHTMLPart::completeURL ( const QString &  url)
protected

returns a KUrl object for the given url.

Use when you know what you're doing.

Definition at line 2524 of file khtml_part.cpp.

void KHTMLPart::configurationChanged ( )
signal

Emitted whenever the configuration has changed.

KParts::ReadOnlyPart * KHTMLPart::createPart ( QWidget *  parentWidget,
QObject *  parent,
const QString &  mimetype,
QString &  serviceName,
QStringList &  serviceTypes,
const QStringList &  params 
)
protectedvirtual

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

Definition at line 4611 of file khtml_part.cpp.

KParts::ReadOnlyPart * KHTMLPart::currentFrame ( ) const

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.

Definition at line 5302 of file khtml_part.cpp.

void KHTMLPart::customEvent ( QEvent *  event)
protectedvirtual

Reimplemented from KParts::Part.

Definition at line 6090 of file khtml_part.cpp.

bool KHTMLPart::dndEnabled ( ) const

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

DNSPrefetch KHTMLPart::dnsPrefetch ( ) const

Returns currently set DNS prefetching mode.

See DNSPrefetch enum for explanation of values.

Note
Always returns DNSPrefetchDisabled if setOnlyLocalReferences() mode is enabled.
Since
4.2
void KHTMLPart::docCreated ( )
signal
bool KHTMLPart::doCloseStream ( )
protectedvirtual

Implements the streaming API of KParts::ReadOnlyPart.

Definition at line 2189 of file khtml_part.cpp.

DOM::Document KHTMLPart::document ( ) const

Returns a reference to the DOM document.

Definition at line 1009 of file khtml_part.cpp.

QString KHTMLPart::documentSource ( ) const

Returns the content of the source document.

Definition at line 1014 of file khtml_part.cpp.

bool KHTMLPart::doOpenStream ( const QString &  mimeType)
protectedvirtual

Implements the streaming API of KParts::ReadOnlyPart.

Definition at line 2172 of file khtml_part.cpp.

bool KHTMLPart::doWriteStream ( const QByteArray &  data)
protectedvirtual

Implements the streaming API of KParts::ReadOnlyPart.

Definition at line 2183 of file khtml_part.cpp.

DOM::Editor * KHTMLPart::editor ( ) const

Returns the instance of the attached html editor interface.

Definition at line 3503 of file khtml_part.cpp.

QString KHTMLPart::encoding ( ) const

Returns the encoding the page currently uses.

Note that the encoding might be different from the charset.

void KHTMLPart::end ( )
virtual

Call this after your last call to write().

Definition at line 2140 of file khtml_part.cpp.

QVariant KHTMLPart::executeScript ( const DOM::Node &  n,
const QString &  script 
)

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

Definition at line 1327 of file khtml_part.cpp.

QVariant KHTMLPart::executeScript ( const QString &  script)
slot

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)

Definition at line 1322 of file khtml_part.cpp.

KHTMLPart * KHTMLPart::findFrame ( const QString &  f)

Finds a frame by name.

Returns 0L if frame can't be found.

Definition at line 5286 of file khtml_part.cpp.

KHTMLPart * KHTMLPart::findFrameParent ( KParts::ReadOnlyPart *  callingPart,
const QString &  f,
khtml::ChildFrame **  childFrame = 0 
)

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.

Returns parent part if a suitable frame was found and frame info in *childFrame

Definition at line 5193 of file khtml_part.cpp.

KParts::ReadOnlyPart * KHTMLPart::findFramePart ( const QString &  f)

Finds a frame by name.

Returns 0L if frame can't be found.

Definition at line 5296 of file khtml_part.cpp.

void KHTMLPart::findText ( )

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

Definition at line 3056 of file khtml_part.cpp.

void KHTMLPart::findText ( const QString &  str,
long  options,
QWidget *  parent = 0,
KFindDialog *  findDialog = 0 
)

Starts a new search, but bypasses the user dialog.

Parameters
strThe string to search for.
optionsFind options.
parentParent used for centering popups like "string not found".
findDialogOptionally, you can supply your own dialog.

Definition at line 3063 of file khtml_part.cpp.

void KHTMLPart::findTextBegin ( )

Initiates a text search.

Definition at line 2972 of file khtml_part.cpp.

bool KHTMLPart::findTextNext ( bool  reverse = false)

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

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

Definition at line 3071 of file khtml_part.cpp.

int KHTMLPart::fontScaleFactor ( ) const

Returns the current font scale factor.

Definition at line 5889 of file khtml_part.cpp.

bool KHTMLPart::forcePermitLocalImages ( ) const

If true, local image files will be loaded even when forbidden by the Kiosk/KAuthorized policies ( default false ).

See setForcePermitLocalImages.

Since
4.6

Definition at line 2806 of file khtml_part.cpp.

KHTMLPart::FormNotification KHTMLPart::formNotification ( ) const

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

KDE5 remove me

Definition at line 7332 of file khtml_part.cpp.

void KHTMLPart::formSubmitNotification ( const char *  action,
const QString &  url,
const QByteArray &  formData,
const QString &  target,
const QString &  contentType,
const QString &  boundary 
)
signal

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

bool KHTMLPart::frameExists ( const QString &  frameName)

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

In contrast to the findFrame method this one also returns true if the frame is defined but no displaying component has been found/loaded, yet.

Definition at line 5317 of file khtml_part.cpp.

KJSProxy * KHTMLPart::framejScript ( KParts::ReadOnlyPart *  framePart)

Returns child frame framePart its script interpreter.

Definition at line 5339 of file khtml_part.cpp.

QStringList KHTMLPart::frameNames ( ) const

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.

Definition at line 6036 of file khtml_part.cpp.

QList< KParts::ReadOnlyPart * > KHTMLPart::frames ( ) const

Definition at line 6049 of file khtml_part.cpp.

bool KHTMLPart::gotoAnchor ( const QString &  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.

Definition at line 2710 of file khtml_part.cpp.

void KHTMLPart::guiActivateEvent ( KParts::GUIActivateEvent *  event)
protectedvirtual

Internal reimplementation of KParts::Part::guiActivateEvent .

Reimplemented from KParts::ReadOnlyPart.

Definition at line 6630 of file khtml_part.cpp.

bool KHTMLPart::hasSelection ( ) const

Has the user selected anything?

Call selectedText() to retrieve the selected text.

Returns
true if there is text selected.

Definition at line 3259 of file khtml_part.cpp.

void KHTMLPart::hide ( )

Convenience method to hide the document's view.

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

Definition at line 5689 of file khtml_part.cpp.

DOM::HTMLDocument KHTMLPart::htmlDocument ( ) const

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

Definition at line 1001 of file khtml_part.cpp.

void KHTMLPart::htmlError ( int  errorCode,
const QString &  text,
const KUrl &  reqUrl 
)
protected

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.

Definition at line 1809 of file khtml_part.cpp.

KHTMLPartPrivate* KHTMLPart::impl ( )
inline

Access to internal APIs. Don't use outside

Definition at line 1937 of file khtml_part.h.

bool KHTMLPart::inProgress ( ) const

Definition at line 7451 of file khtml_part.cpp.

bool KHTMLPart::isCaretMode ( ) const

Returns whether caret mode is on/off.

Definition at line 2887 of file khtml_part.cpp.

bool KHTMLPart::isEditable ( ) const

Returns true if the document is editable, false otherwise.

Definition at line 2907 of file khtml_part.cpp.

bool KHTMLPart::isModified ( ) const

Checks whether the page contains unsubmitted form changes.

Returns
true if form changes exist

Definition at line 7348 of file khtml_part.cpp.

bool KHTMLPart::isPointInsideSelection ( int  x,
int  y 
)

Returns whether the given point is inside the current selection.

The coordinates are content-coordinates.

Definition at line 6125 of file khtml_part.cpp.

bool KHTMLPart::javaEnabled ( ) const

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

bool KHTMLPart::jScriptEnabled ( ) const

Returns true if Javascript support is enabled or false otherwise.

Definition at line 1103 of file khtml_part.cpp.

KJS::Interpreter * KHTMLPart::jScriptInterpreter ( )

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.

Definition at line 1080 of file khtml_part.cpp.

QString KHTMLPart::jsDefaultStatusBarText ( ) const

Called by KJS.

Returns the DefaultStatusBarText assigned via window.defaultStatus

Definition at line 5941 of file khtml_part.cpp.

QString KHTMLPart::jsStatusBarText ( ) const

Called by KJS.

Returns the StatusBarText assigned via window.status

Definition at line 5936 of file khtml_part.cpp.

void KHTMLPart::khtmlDrawContentsEvent ( khtml::DrawContentsEvent *  )
protectedvirtual

Eventhandler for the khtml::DrawContentsEvent.

Definition at line 6626 of file khtml_part.cpp.

void KHTMLPart::khtmlMouseDoubleClickEvent ( khtml::MouseDoubleClickEvent *  event)
protectedvirtual

Eventhandler for the khtml::MouseDoubleClickEvent.

Definition at line 6344 of file khtml_part.cpp.

void KHTMLPart::khtmlMouseMoveEvent ( khtml::MouseMoveEvent *  event)
protectedvirtual

Eventhandler for the khtml::MouseMouseMoveEvent.

Definition at line 6554 of file khtml_part.cpp.

void KHTMLPart::khtmlMousePressEvent ( khtml::MousePressEvent *  event)
protectedvirtual

Eventhandler of the khtml::MousePressEvent.

Definition at line 6298 of file khtml_part.cpp.

void KHTMLPart::khtmlMouseReleaseEvent ( khtml::MouseReleaseEvent *  event)
protectedvirtual

Eventhandler for the khtml::MouseMouseReleaseEvent.

Definition at line 6565 of file khtml_part.cpp.

QString KHTMLPart::lastModified ( ) const

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

bool KHTMLPart::mayPrefetchHostname ( const QString &  name)
protected

Will pre-resolve name according to dnsPrefetch current settings Returns true if the name will be pre-resolved.

Otherwise returns false.

Definition at line 3463 of file khtml_part.cpp.

bool KHTMLPart::metaRefreshEnabled ( ) const

Returns true if automatic forwarding is enabled.

bool KHTMLPart::nextAnchor ( )

Go to the next anchor.

This is useful to navigate from outside the navigator

Definition at line 2758 of file khtml_part.cpp.

void KHTMLPart::nodeActivated ( const DOM::Node &  )
signal

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.

DOM::Node KHTMLPart::nodeUnderMouse ( ) const

Returns the Node currently under the mouse.

The returned node may be a shared node (e. g. an <area> node if the mouse is hovering over an image map).

Definition at line 5695 of file khtml_part.cpp.

DOM::Node KHTMLPart::nonSharedNodeUnderMouse ( ) const

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., <area> on image maps).

Definition at line 5700 of file khtml_part.cpp.

bool KHTMLPart::onlyLocalReferences ( ) const

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

See setOnlyLocalReferences.

Definition at line 2796 of file khtml_part.cpp.

void KHTMLPart::onURL ( const QString &  url)
signal

Emitted if the cursor is moved over an URL.

bool KHTMLPart::openFile ( )
protectedvirtual

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

Reimplemented from KParts::ReadOnlyPart.

Definition at line 1630 of file khtml_part.cpp.

bool KHTMLPart::openUrl ( const KUrl &  url)
virtual

Opens the specified URL url.

Reimplemented from KParts::ReadOnlyPart::openUrl .

The format of the error url is that two variables are passed in the query: error = int kio error code, errText = QString error text from kio and the URL where the error happened is passed as a sub URL.

Reimplemented from KParts::ReadOnlyPart.

Definition at line 662 of file khtml_part.cpp.

QString KHTMLPart::pageReferrer ( ) const

Referrer used to obtain this page.

Definition at line 5951 of file khtml_part.cpp.

void KHTMLPart::paint ( QPainter *  p,
const QRect &  rc,
int  yOff = 0,
bool *  more = 0 
)

Paints the HTML page to a QPainter.

See KHTMLView::paint for details

Definition at line 2196 of file khtml_part.cpp.

KHTMLPart * KHTMLPart::parentPart ( )

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

Returns 0L otherwise.

Definition at line 5359 of file khtml_part.cpp.

KParts::PartManager * KHTMLPart::partManager ( )

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

Definition at line 4664 of file khtml_part.cpp.

bool KHTMLPart::pluginPageQuestionAsked ( const QString &  mimetype) const
protected

Definition at line 6992 of file khtml_part.cpp.

bool KHTMLPart::pluginsEnabled ( ) const

Returns true if plugins are enabled, false if disabled.

void KHTMLPart::popupMenu ( const QString &  url,
const QPoint &  point 
)
signal

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.

void KHTMLPart::preloadScript ( const QString &  url,
const QString &  script 
)

Loads a script into the script cache.

Definition at line 6977 of file khtml_part.cpp.

void KHTMLPart::preloadStyleSheet ( const QString &  url,
const QString &  stylesheet 
)

Loads a style sheet into the stylesheet cache.

Definition at line 6972 of file khtml_part.cpp.

bool KHTMLPart::prevAnchor ( )

Go to previous anchor.

Definition at line 2767 of file khtml_part.cpp.

QString KHTMLPart::referrer ( ) const

Referrer used for links in this page.

Definition at line 5946 of file khtml_part.cpp.

bool KHTMLPart::restored ( ) const

Definition at line 6987 of file khtml_part.cpp.

void KHTMLPart::restoreState ( QDataStream &  stream)
virtual

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

Definition at line 5485 of file khtml_part.cpp.

void KHTMLPart::saveState ( QDataStream &  stream)
virtual

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

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

Definition at line 5397 of file khtml_part.cpp.

void KHTMLPart::scheduleRedirection ( int  delay,
const QString &  url,
bool  lockHistory = true 
)

Schedules a redirection after delay seconds.

Definition at line 2562 of file khtml_part.cpp.

void KHTMLPart::selectAll ( )

Marks all text in the document as selected.

Definition at line 6750 of file khtml_part.cpp.

QString KHTMLPart::selectedText ( ) const
virtual

Returns the text the user has marked.

Definition at line 3101 of file khtml_part.cpp.

QString KHTMLPart::selectedTextAsHTML ( ) const

Return the text the user has marked.

This is guaranteed to be valid xml, and to contain the <html> and <body> tags.

FIXME probably should make virtual for 4.0 ?

Definition at line 3083 of file khtml_part.cpp.

DOM::Range KHTMLPart::selection ( ) const

Returns the selected part of the HTML.

Definition at line 3264 of file khtml_part.cpp.

void KHTMLPart::selection ( DOM::Node &  startNode,
long &  startOffset,
DOM::Node &  endNode,
long &  endOffset 
) const

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
startNodereturns node selection starts in
startOffsetreturns offset within starting node
endNodereturns node selection ends in
endOffsetreturns offset within end node.

Definition at line 3269 of file khtml_part.cpp.

void KHTMLPart::selectionChanged ( )
signal

This signal is emitted when the selection changes.

void KHTMLPart::setActiveNode ( const DOM::Node &  node)
slot

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
nodeThe node to focus

Definition at line 6923 of file khtml_part.cpp.

void KHTMLPart::setAlwaysHonourDoctype ( bool  b = true)

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.

Definition at line 2116 of file khtml_part.cpp.

void KHTMLPart::setAutoloadImages ( bool  enable)

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

Note
Request will be ignored if called before begin().

Definition at line 1452 of file khtml_part.cpp.

void KHTMLPart::setCaretDisplayPolicyNonFocused ( CaretDisplayPolicy  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
policynew display policy

Definition at line 2945 of file khtml_part.cpp.

void KHTMLPart::setCaretMode ( bool  enable)
slot

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
enabletrue to enable, false to disable caret mode.

Definition at line 2870 of file khtml_part.cpp.

void KHTMLPart::setCaretPosition ( DOM::Node  node,
long  offset,
bool  extendSelection = false 
)

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
nodenode to set to
offsetzero-based offset within the node
extendSelectionIf true, a selection will be spanned from the last caret position to the given one. Otherwise, any existing selection will be deselected.

Definition at line 2916 of file khtml_part.cpp.

void KHTMLPart::setCaretVisible ( bool  show)
slot

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
showtrue to make visible, false to hide.

Definition at line 2955 of file khtml_part.cpp.

void KHTMLPart::setDNDEnabled ( bool  b)

Enables or disables Drag'n'Drop support.

A drag operation is started if the users drags a link.

Definition at line 6080 of file khtml_part.cpp.

void KHTMLPart::setDNSPrefetch ( DNSPrefetch  pmode)

Sets whether DNS Names found in loaded documents'anchors should be pre-fetched (pre-resolved).

Note that calling this function will permanently override the User settings about DNS prefetch support. Not calling this function is the only way to let the default settings apply.

Note
This setting has no effect if setOnlyLocalReferences() mode is enabled.
Parameters
pmodethe mode to set. See DNSPrefetch enum for explanation of values.
Since
4.2

Definition at line 1112 of file khtml_part.cpp.

void KHTMLPart::setEditable ( bool  enable)
slot

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
enabletrue to set document editable, false to set it read-only.

Definition at line 2892 of file khtml_part.cpp.

bool KHTMLPart::setEncoding ( const QString &  name,
bool  override = false 
)

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.

Definition at line 2656 of file khtml_part.cpp.

void KHTMLPart::setFixedFont ( const QString &  name)

Sets the fixed font style.

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

Definition at line 2781 of file khtml_part.cpp.

void KHTMLPart::setFontScaleFactor ( int  percent)

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.

Definition at line 5866 of file khtml_part.cpp.

void KHTMLPart::setForcePermitLocalImages ( bool  enable)

Security option.

If this is set to true, content loaded from external URLs will be permitted to access images on disk regardless of of the Kiosk policy. You should be careful in enabling this, as it may make it easier to fake any HTML-based chrome or to perform other such user-confusion attack. false by default.

Since
4.6

Definition at line 2811 of file khtml_part.cpp.

void KHTMLPart::setFormNotification ( KHTMLPart::FormNotification  fn)

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

KDE5 remove me

Definition at line 7328 of file khtml_part.cpp.

void KHTMLPart::setJavaEnabled ( bool  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.

Definition at line 1365 of file khtml_part.cpp.

void KHTMLPart::setJScriptEnabled ( bool  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.

Definition at line 1094 of file khtml_part.cpp.

void KHTMLPart::setJSDefaultStatusBarText ( const QString &  text)

Called by KJS.

Sets the DefaultStatusBarText assigned via window.defaultStatus

Definition at line 5931 of file khtml_part.cpp.

void KHTMLPart::setJSStatusBarText ( const QString &  text)

Called by KJS.

Sets the StatusBarText assigned via window.status

Definition at line 5926 of file khtml_part.cpp.

void KHTMLPart::setMetaRefreshEnabled ( bool  enable)

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

>

Definition at line 1125 of file khtml_part.cpp.

void KHTMLPart::setOnlyLocalReferences ( bool  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).

Definition at line 2801 of file khtml_part.cpp.

void KHTMLPart::setPageSecurity ( PageSecurity  sec)
protected

Definition at line 1659 of file khtml_part.cpp.

void KHTMLPart::setPluginPageQuestionAsked ( const QString &  mimetype)
protected

Definition at line 7002 of file khtml_part.cpp.

void KHTMLPart::setPluginsEnabled ( bool  enable)

Enables or disables plugins, default is enabled.

Definition at line 1384 of file khtml_part.cpp.

void KHTMLPart::setSelection ( const DOM::Range &  r)

Sets the current selection.

Definition at line 3278 of file khtml_part.cpp.

void KHTMLPart::setStandardFont ( const QString &  name)

Sets the standard font style.

Parameters
nameThe font name to use for standard text.

Definition at line 2776 of file khtml_part.cpp.

void KHTMLPart::setStatusMessagesEnabled ( bool  enable)

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 )

Definition at line 1075 of file khtml_part.cpp.

void KHTMLPart::setSuppressedPopupIndicator ( bool  enable,
KHTMLPart *  originPart = 0 
)

Shows or hides the suppressed popup indicator.

Definition at line 7373 of file khtml_part.cpp.

const KHTMLSettings * KHTMLPart::settings ( ) const

Definition at line 2510 of file khtml_part.cpp.

void KHTMLPart::setURLCursor ( const QCursor &  c)

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

Definition at line 2786 of file khtml_part.cpp.

void KHTMLPart::setUserStyleSheet ( const 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().

Definition at line 2698 of file khtml_part.cpp.

void KHTMLPart::setUserStyleSheet ( const QString &  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().

Definition at line 2704 of file khtml_part.cpp.

void KHTMLPart::setZoomFactor ( int  percent)

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.

Definition at line 5781 of file khtml_part.cpp.

void KHTMLPart::show ( )

Convenience method to show the document's view.

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

Definition at line 5683 of file khtml_part.cpp.

void KHTMLPart::showError ( KJob *  job)
virtual

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

Definition at line 1792 of file khtml_part.cpp.

void KHTMLPart::slotFinished ( KJob *  job)
protectedvirtualslot

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.

Definition at line 1909 of file khtml_part.cpp.

virtual void KHTMLPart::startingJob ( KIO::Job *  )
inlineprotectedvirtual

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.

Definition at line 1404 of file khtml_part.h.

bool KHTMLPart::statusMessagesEnabled ( ) const

Returns true if status messages are enabled.

Definition at line 1089 of file khtml_part.cpp.

void KHTMLPart::stopAnimations ( )
slot

Stops all animated images on the current and child pages.

Definition at line 2202 of file khtml_part.cpp.

void KHTMLPart::submitFormProxy ( const char *  action,
const QString &  url,
const QByteArray &  formData,
const QString &  target,
const QString &  contentType = QString(),
const QString &  boundary = QString() 
)
slot

Definition at line 4690 of file khtml_part.cpp.

void KHTMLPart::timerEvent ( QTimerEvent *  e)
protectedvirtual

Definition at line 3440 of file khtml_part.cpp.

KUrl KHTMLPart::toplevelURL ( )

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

Returns
the actual original url.

Definition at line 7336 of file khtml_part.cpp.

void KHTMLPart::updateZoomFactor ( )
protected

Definition at line 5796 of file khtml_part.cpp.

QCursor KHTMLPart::urlCursor ( ) const

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

Definition at line 2791 of file khtml_part.cpp.

bool KHTMLPart::urlSelected ( const QString &  url,
int  button,
int  state,
const QString &  _target,
const KParts::OpenUrlArguments &  args = KParts::OpenUrlArguments(),
const KParts::BrowserArguments &  browserArgs = KParts::BrowserArguments() 
)
protectedvirtual

Definition at line 3693 of file khtml_part.cpp.

KHTMLView * KHTMLPart::view ( ) const

Returns a pointer to the HTML document's view.

Definition at line 1056 of file khtml_part.cpp.

void KHTMLPart::write ( const char *  str,
int  len = -1 
)
virtual

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.

Definition at line 2091 of file khtml_part.cpp.

void KHTMLPart::write ( const QString &  str)
virtual

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.

Definition at line 2121 of file khtml_part.cpp.

int KHTMLPart::zoomFactor ( ) const

Returns the current zoom factor.

Definition at line 5717 of file khtml_part.cpp.

Property Documentation

bool KHTMLPart::dndEnabled
readwrite

Definition at line 257 of file khtml_part.h.

KHTMLPart::DNSPrefetch KHTMLPart::dnsPrefetch
readwrite

Definition at line 259 of file khtml_part.h.

QString KHTMLPart::encoding
readwrite

Definition at line 267 of file khtml_part.h.

bool KHTMLPart::javaEnabled
readwrite

Definition at line 256 of file khtml_part.h.

bool KHTMLPart::javaScriptEnabled
readwrite

Definition at line 255 of file khtml_part.h.

QString KHTMLPart::lastModified
read

Definition at line 268 of file khtml_part.h.

bool KHTMLPart::metaRefreshEnabled
readwrite

Definition at line 269 of file khtml_part.h.

bool KHTMLPart::modified
read

Definition at line 266 of file khtml_part.h.

bool KHTMLPart::pluginsEnabled
readwrite

Definition at line 258 of file khtml_part.h.


The documentation for this class was generated from the following files:
  • khtml_part.h
  • khtml_part.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • 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