KHTML
KHTMLPart Class Reference
This class is khtml's main class. More...
#include <khtml_part.h>
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
Definition at line 184 of file khtml_part.h.
Member Enumeration Documentation
Enumeration for displaying the caret.
- Parameters:
-
Visible caret is displayed Invisible caret is not displayed Blink caret toggles between visible and invisible
- Since:
- 3.2
Definition at line 496 of file khtml_part.h.
Extra Find options that can be used when calling the extended findText().
- Since:
- 3.3
Definition at line 703 of file khtml_part.h.
enum KHTMLPart::PageSecurity [protected] |
Constructor & Destructor Documentation
KHTMLPart::KHTMLPart | ( | QWidget * | parentWidget = 0 , |
|
const char * | widgetname = 0 , |
|||
QObject * | parent = 0 , |
|||
const char * | name = 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 QScrollView, 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 on 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 206 of file khtml_part.cpp.
KHTMLPart::KHTMLPart | ( | KHTMLView * | view, | |
QObject * | parent = 0 , |
|||
const char * | name = 0 , |
|||
GUIProfile | prof = DefaultGUI | |||
) |
Definition at line 217 of file khtml_part.cpp.
KHTMLPart::~KHTMLPart | ( | ) | [virtual] |
Member Function Documentation
DOM::Node KHTMLPart::activeNode | ( | ) | const |
void KHTMLPart::autoloadImages | ( | bool | e | ) | [inline] |
Definition at line 522 of file khtml_part.h.
bool KHTMLPart::autoloadImages | ( | ) | const |
KURL KHTMLPart::backgroundURL | ( | ) | const |
Returns the URL for the background Image (used by save background).
Definition at line 4114 of file khtml_part.cpp.
QString KHTMLPart::baseTarget | ( | ) | const |
Definition at line 2360 of file khtml_part.cpp.
KURL KHTMLPart::baseURL | ( | ) | const |
Definition at line 2353 of file khtml_part.cpp.
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:
- Parameters:
-
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.
Definition at line 1872 of file khtml_part.cpp.
KParts::BrowserExtension * KHTMLPart::browserExtension | ( | ) | const |
KParts::BrowserHostExtension * KHTMLPart::browserHostExtension | ( | ) | const |
Definition at line 902 of file khtml_part.cpp.
KHTMLPart::CaretDisplayPolicy KHTMLPart::caretDisplayPolicyNonFocused | ( | ) | const |
Returns the current caret policy when the view is not focused.
- Since:
- 3.2
Definition at line 2699 of file khtml_part.cpp.
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:
-
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.
- Since:
- 3.2
bool KHTMLPart::closeURL | ( | ) | [virtual] |
Stops loading the document and kills all data requests (for images, etc.
)
Reimplemented from KParts::ReadOnlyPart.
Definition at line 770 of file khtml_part.cpp.
returns a KURL object for the given url.
Use when you know what you're doing.
Definition at line 2368 of file khtml_part.cpp.
KJavaAppletContext * KHTMLPart::createJavaContext | ( | ) |
Returns the java context of the applets.
If no context exists yet, a new one is created.
Definition at line 1269 of file khtml_part.cpp.
KParts::ReadOnlyPart * KHTMLPart::createPart | ( | QWidget * | parentWidget, | |
const char * | widgetName, | |||
QObject * | parent, | |||
const char * | name, | |||
const QString & | mimetype, | |||
QString & | serviceName, | |||
QStringList & | serviceTypes, | |||
const QStringList & | params | |||
) | [protected, virtual] |
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 4646 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 5273 of file khtml_part.cpp.
void KHTMLPart::customEvent | ( | QCustomEvent * | event | ) | [protected, virtual] |
QCString KHTMLPart::dcopObjectId | ( | ) | const [slot] |
bool KHTMLPart::dndEnabled | ( | ) | const |
Returns whether Dragn'n'Drop support is enabled or not.
void KHTMLPart::docCreated | ( | ) | [signal] |
For internal use only.
bool KHTMLPart::doCloseStream | ( | ) | [protected, virtual] |
Implements the streaming API of KParts::ReadOnlyPart.
Definition at line 2039 of file khtml_part.cpp.
DOM::Document KHTMLPart::document | ( | ) | const |
QString KHTMLPart::documentSource | ( | ) | const |
Returns the content of the source document.
- Since:
- 3.4
Definition at line 865 of file khtml_part.cpp.
Implements the streaming API of KParts::ReadOnlyPart.
Definition at line 2022 of file khtml_part.cpp.
bool KHTMLPart::doWriteStream | ( | const QByteArray & | data | ) | [protected, virtual] |
Implements the streaming API of KParts::ReadOnlyPart.
Definition at line 2033 of file khtml_part.cpp.
void KHTMLPart::enableJava | ( | bool | e | ) | [inline] |
Definition at line 520 of file khtml_part.h.
void KHTMLPart::enableJScript | ( | bool | e | ) | [inline] |
Definition at line 519 of file khtml_part.h.
void KHTMLPart::enableMetaRefresh | ( | bool | e | ) | [inline] |
Definition at line 523 of file khtml_part.h.
void KHTMLPart::enablePlugins | ( | bool | e | ) | [inline] |
Definition at line 521 of file khtml_part.h.
QString KHTMLPart::encoding | ( | ) | const |
Returns the encoding the page currently uses.
Note that the encoding might be different from the charset.
Definition at line 2482 of file khtml_part.cpp.
void KHTMLPart::end | ( | ) | [virtual] |
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 1182 of file khtml_part.cpp.
Same as executeScript( const QString & ) except with the Node parameter specifying the 'this' value.
Definition at line 1187 of file khtml_part.cpp.
Finds a frame by name.
Returns 0L if frame can't be found.
Definition at line 5254 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
- Since:
- 3.3
Definition at line 5212 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 5267 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:
-
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.
- Since:
- 3.3
Definition at line 3032 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.
- Since:
- 3.3
Definition at line 2993 of file khtml_part.cpp.
void KHTMLPart::findTextBegin | ( | ) |
Finds the next occurence of a string set by findText().
- Parameters:
-
reverse if true, revert seach direction (only if no find dialog is used)
- Returns:
- true if a new match was found.
- Since:
- 3.5
Definition at line 3066 of file khtml_part.cpp.
bool KHTMLPart::findTextNext | ( | ) |
Finds the next occurence of a string set by findText().
- Returns:
- true if a new match was found.
- Since:
- 3.3
Definition at line 3060 of file khtml_part.cpp.
bool KHTMLPart::findTextNext | ( | const QString & | str, | |
bool | forward, | |||
bool | caseSensitive, | |||
bool | isRegExp | |||
) |
Finds the next occurrence of the string or expression.
If isRegExp is true then str is converted to a QRegExp, and caseSensitive is ignored.
- Deprecated:
- , use findText( str, options, parent, findDialog )
Definition at line 2820 of file khtml_part.cpp.
KHTMLPart::FormNotification KHTMLPart::formNotification | ( | ) | const |
Determine if signal should be emitted before, instead or never when a submitForm() happens.
### KDE4 remove me
- Since:
- 3.2
Definition at line 7329 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.
- Since:
- 3.2 ### KDE4 remove me
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.
Definition at line 5288 of file khtml_part.cpp.
KJSProxy * KHTMLPart::framejScript | ( | KParts::ReadOnlyPart * | framePart | ) |
Returns child frame framePart its script interpreter.
Definition at line 5300 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 5886 of file khtml_part.cpp.
QPtrList< KParts::ReadOnlyPart > KHTMLPart::frames | ( | ) | const |
Definition at line 5899 of file khtml_part.cpp.
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 2518 of file khtml_part.cpp.
void KHTMLPart::guiActivateEvent | ( | KParts::GUIActivateEvent * | event | ) | [protected, virtual] |
Internal reimplementation of KParts::Part::guiActivateEvent .
Reimplemented from KParts::ReadOnlyPart.
Definition at line 6631 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 3593 of file khtml_part.cpp.
void KHTMLPart::hide | ( | ) |
DOM::HTMLDocument KHTMLPart::htmlDocument | ( | ) | const |
Returns a reference to the DOM HTML document (for non-HTML documents, returns null).
Definition at line 852 of file khtml_part.cpp.
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 1716 of file khtml_part.cpp.
bool KHTMLPart::inProgress | ( | ) | const |
bool KHTMLPart::isCaretMode | ( | ) | const |
bool KHTMLPart::isEditable | ( | ) | const |
Returns true
if the document is editable, false
otherwise.
- Since:
- 3.2
Definition at line 2680 of file khtml_part.cpp.
bool KHTMLPart::isModified | ( | ) | const |
Checks whether the page contains unsubmitted form changes.
- Returns:
- true if form changes exist
- Since:
- 3.3
Definition at line 7345 of file khtml_part.cpp.
KJavaAppletContext * KHTMLPart::javaContext | ( | ) |
Returns the java context of the applets.
If no applet exists, 0 is returned.
Definition at line 1264 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 940 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 everytime 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 917 of file khtml_part.cpp.
QString KHTMLPart::jsDefaultStatusBarText | ( | ) | const |
Called by KJS.
Returns the DefaultStatusBarText assigned via window.defaultStatus
Definition at line 5799 of file khtml_part.cpp.
QString KHTMLPart::jsStatusBarText | ( | ) | const |
Called by KJS.
Returns the StatusBarText assigned via window.status
Definition at line 5794 of file khtml_part.cpp.
void KHTMLPart::khtmlDrawContentsEvent | ( | khtml::DrawContentsEvent * | ) | [protected, virtual] |
void KHTMLPart::khtmlMouseDoubleClickEvent | ( | khtml::MouseDoubleClickEvent * | event | ) | [protected, virtual] |
void KHTMLPart::khtmlMouseMoveEvent | ( | khtml::MouseMoveEvent * | event | ) | [protected, virtual] |
void KHTMLPart::khtmlMousePressEvent | ( | khtml::MousePressEvent * | event | ) | [protected, virtual] |
void KHTMLPart::khtmlMouseReleaseEvent | ( | khtml::MouseReleaseEvent * | event | ) | [protected, virtual] |
QString KHTMLPart::lastModified | ( | ) | const |
Last-modified date (in raw string format), if received in the [HTTP] headers.
Definition at line 5830 of file khtml_part.cpp.
KParts::LiveConnectExtension * KHTMLPart::liveConnectExtension | ( | const khtml::RenderPart * | frame | ) | const |
Definition at line 4296 of file khtml_part.cpp.
bool KHTMLPart::metaRefreshEnabled | ( | ) | const |
bool KHTMLPart::nextAnchor | ( | ) |
Go to the next anchor.
This is useful to navigate from outside the navigator
- Since:
- 3.2
Definition at line 2566 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 5639 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).
- Since:
- 3.3
Definition at line 5644 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 2604 of file khtml_part.cpp.
void KHTMLPart::onURL | ( | const QString & | url | ) | [signal] |
Emitted if the cursor is moved over an URL.
bool KHTMLPart::openFile | ( | ) | [protected, virtual] |
Internal empty reimplementation of KParts::ReadOnlyPart::openFile .
Implements KParts::ReadOnlyPart.
Definition at line 1495 of file khtml_part.cpp.
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 566 of file khtml_part.cpp.
QString KHTMLPart::pageReferrer | ( | ) | const |
Paints the HTML page to a QPainter.
See KHTMLView::paint for details
Definition at line 2046 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 5318 of file khtml_part.cpp.
KParts::PartManager * KHTMLPart::partManager | ( | ) |
Returns a reference to the partmanager instance which manages html frame objects.
Definition at line 4700 of file khtml_part.cpp.
Definition at line 6995 of file khtml_part.cpp.
bool KHTMLPart::pluginsEnabled | ( | ) | const |
Returns true if plugins are enabled/disabled.
Emitted when the user clicks the right mouse button on the document.
bool KHTMLPart::prevAnchor | ( | ) |
QString KHTMLPart::referrer | ( | ) | const |
bool KHTMLPart::restored | ( | ) | const |
void KHTMLPart::restoreState | ( | QDataStream & | stream | ) | [virtual] |
Restores the KHTMLPart's previously saved state (including child frame objects) from the provided QDataStream.
- See also:
- saveState()
Definition at line 5441 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 5355 of file khtml_part.cpp.
void KHTMLPart::selectAll | ( | ) |
QString KHTMLPart::selectedText | ( | ) | const [virtual] |
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 ?
- Since:
- 3.4
Definition at line 3434 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:
-
startNode returns node selection starts in startOffset returns offset within starting node endNode returns node selection ends in endOffset returns offset within end node.
- Since:
- 3.2
Definition at line 3657 of file khtml_part.cpp.
DOM::Range KHTMLPart::selection | ( | ) | const |
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:
-
node The node to focus
Definition at line 6919 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 1336 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:
-
policy new display policy
- Since:
- 3.2
Definition at line 2708 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:
-
enable true
to enable,false
to disable caret mode.
- Since:
- 3.2
Definition at line 2642 of file khtml_part.cpp.
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:
-
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.
- Since:
- 3.2
Definition at line 2685 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:
-
show true
to make visible,false
to hide.
- Since:
- 3.2
Definition at line 2715 of file khtml_part.cpp.
Definition at line 524 of file khtml_part.h.
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 5929 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:
-
enable true
to set document editable,false
to set it read-only.
- Since:
- 3.2 (pending, do not use)
Definition at line 2664 of file khtml_part.cpp.
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 2464 of file khtml_part.cpp.
void KHTMLPart::setFixedFont | ( | const QString & | name | ) |
Sets the fixed font style.
- Parameters:
-
name The font name to use for fixed text, e.g. the <pre>
tag.
Definition at line 2589 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.
- Since:
- 3.2 ### KDE4 remove me
Definition at line 7325 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 1245 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 931 of file khtml_part.cpp.
void KHTMLPart::setJSDefaultStatusBarText | ( | const QString & | text | ) |
Called by KJS.
Sets the DefaultStatusBarText assigned via window.defaultStatus
Definition at line 5789 of file khtml_part.cpp.
void KHTMLPart::setJSStatusBarText | ( | const QString & | text | ) |
Called by KJS.
Sets the StatusBarText assigned via window.status
Definition at line 5784 of file khtml_part.cpp.
void KHTMLPart::setMetaRefreshEnabled | ( | bool | enable | ) |
Enable/disable automatic forwarding by <meta http-equiv="refresh" .
...>
Definition at line 949 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 2609 of file khtml_part.cpp.
void KHTMLPart::setPageSecurity | ( | PageSecurity | sec | ) | [protected] |
Definition at line 1522 of file khtml_part.cpp.
void KHTMLPart::setPluginPageQuestionAsked | ( | const QString & | mimetype | ) | [protected] |
Definition at line 7005 of file khtml_part.cpp.
void KHTMLPart::setPluginsEnabled | ( | bool | enable | ) |
void KHTMLPart::setSelection | ( | const DOM::Range & | r | ) |
void KHTMLPart::setStandardFont | ( | const QString & | name | ) |
Sets the standard font style.
- Parameters:
-
name The font name to use for standard text.
Definition at line 2584 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)
Definition at line 912 of file khtml_part.cpp.
Shows or hides the suppressed popup indicator.
- Since:
- 3.5
Definition at line 7373 of file khtml_part.cpp.
void KHTMLPart::setSuppressedPopupIndicator | ( | bool | enable | ) |
Shows or hides the suppressed popup indicator.
- Since:
- 3.4
Definition at line 7368 of file khtml_part.cpp.
const KHTMLSettings * KHTMLPart::settings | ( | ) | const |
void KHTMLPart::setURLCursor | ( | const QCursor & | c | ) |
Sets the cursor to use when the cursor is on a link.
Definition at line 2594 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 2512 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 2506 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. It is not guaranteed that all parts of the page are scaled with the same factor though.
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 5723 of file khtml_part.cpp.
void KHTMLPart::show | ( | void | ) |
void KHTMLPart::showError | ( | KIO::Job * | 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 1699 of file khtml_part.cpp.
bool KHTMLPart::statusMessagesEnabled | ( | ) | const |
void KHTMLPart::stopAnimations | ( | ) | [slot] |
Stops all animated images on the current and child pages.
Definition at line 2052 of file khtml_part.cpp.
void KHTMLPart::submitFormProxy | ( | const char * | action, | |
const QString & | url, | |||
const QByteArray & | formData, | |||
const QString & | target, | |||
const QString & | contentType = QString::null , |
|||
const QString & | boundary = QString::null | |||
) | [slot] |
Definition at line 4725 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.
- Since:
- 3.2
Definition at line 7333 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 2599 of file khtml_part.cpp.
void KHTMLPart::urlSelected | ( | const QString & | url, | |
int | button, | |||
int | state, | |||
const QString & | _target, | |||
KParts::URLArgs | args = KParts::URLArgs() | |||
) | [protected, virtual] |
Definition at line 3890 of file khtml_part.cpp.
KHTMLView * KHTMLPart::view | ( | ) | const |
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.
Definition at line 1992 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 1960 of file khtml_part.cpp.
int KHTMLPart::zoomFactor | ( | ) | const |
Property Documentation
bool KHTMLPart::autoloadImages [read, write] |
Definition at line 222 of file khtml_part.h.
QCString KHTMLPart::dcopObjectId [read] |
Definition at line 231 of file khtml_part.h.
bool KHTMLPart::dndEnabled [read, write] |
Definition at line 223 of file khtml_part.h.
bool KHTMLPart::javaEnabled [read, write] |
Definition at line 221 of file khtml_part.h.
bool KHTMLPart::javaScriptEnabled [read, write] |
Definition at line 220 of file khtml_part.h.
bool KHTMLPart::modified [read] |
Definition at line 232 of file khtml_part.h.
bool KHTMLPart::pluginsEnabled [read, write] |
Definition at line 224 of file khtml_part.h.
The documentation for this class was generated from the following files: