|
|
This widget is good for use in your custom application which does not necessarily want to handle frames, or want custom control of scrollbars. To add content to the widget you should do the follwing:
view->begin( "file:/tmp/test.html" ); view->parse(); view->write( "<HTML><TITLE>...." ); ..... view->end(); view->show();
The widget will take care of resize events and paint events. Have a look at the set of signals emitted by this widget. You should connect to most of them.
Note: All HTML is parsed in the background using Qt timers, so you will not see any content displayed until the event loop is running.
|
Create a new HTML widget. The widget is empty by default. You must use begin, write, end and parse to fill the widget with content.
Note: pixdir should not be used - it is provided only for backward compatability and has no effect.
Parameters:
_name | is the name of the widget. Usually this name is only meaningful for Qt but in this case it is the name of the HTML window. This means you can reference this name in the < href=... target=... > tag. If this argument is 0L then a unique default name is chosen. |
~ |
[virtual]
void |
Clears the widget and prepares it for new content. If you display for example "file:/tmp/test.html", you can use the following code to get a value for '_url':
KURL u( "file:/tmp/test.html" ); view->begin( u.directoryURL() );
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. |
_dx | is the initial horizontal scrollbar value. Usually you don't want to use this. |
_dy | is the initial vertical scrollbar value. Usually you don't want to use this. |
void |
Writes another part of the HTML code to the widget. You may call this function many times in sequence. But remember: The less calls the faster the widget is.
void |
Call this after your last call to write.
void |
Begin parsing any HTML that has been written using the write method.
You may call this function immediately after calling begin. In this case the HTML will be passed and displayed whenever the event loop is active. This allows background parsing and display of the HTML as it arrives.
void |
Stop parsing the HTML immediately.
void |
Print current HTML page to the printer.
void |
Recalculate the size and position of objects in the page. This is mainly intended for internal use.
void |
[virtual]
Selects all objects which refer to _url. All selected ojects are redrawn if they changed their selection mode.
void |
[virtual]
Selects/Unselects all objects with an associated URL. This is usually used to disable a selection. All objects are redrawn afterwards if they changed their selection mode.
void |
[virtual]
Selects all objects with an associated URL in this rectangle and deselects all objects outside the rectangle.
Parameters:
_rect | is a rectangle in display coordinates. This means that the point (0,0) is the upper/left most point of the widget but must not be this one for the HTML page. This happens if the widget is being scrolled. |
void |
[virtual]
Select all objects with a URL matching the regular expression.
If _painter is null a new painter is created.
void |
[virtual]
Gets a list of all selected URLs. The list may be Null. You can test this using list.isNull().
void |
[virtual]
Selects all text between ( _x1, _y1 ) and ( _x2, y2 ). The selection area selects text line by line, NOT by bounding rectangle.
void |
[virtual]
Get the text the user has marked.
Parameters:
_str | is the QString which will contain the text the user selected. The selected text is appended to any text currently in _str. |
bool |
[const]
Has the user selected any text? Call getSelectedText to retrieve the selected text.
Returns: true if there is text selected.
void |
Initiate a text search.
bool |
Find the next occurrance of the expression.
void |
end a text search.
const char* |
Checks out whether there is a URL under the point and returns a pointer to this URL or 0L if there is none.
Parameters:
_point | the point to test for the presence of a URL. The point is relative to this widget. |
int |
[const]
Returns: the width of the parsed HTML code. Remember that the documents width depends on the width of the widget.
int |
[const]
Returns: the height of the parsed HTML code. Remember that the documents height depends on the width of the widget.
KURL & |
Returns: the url of this document
KURL & |
Returns: the base URL of this document
int |
[const]
Returns: the horizontal position the view has been scrolled to.
int |
[const]
Returns: the vertical position the view has been scrolled to.
bool |
Find the default anchor. If the anchor is found, the widget scrolls to the closest position. Returns TRUE if the anchor has been found.
bool |
Find the anchor named '_name'. If the anchor is found, the widget scrolls to the closest position. Returns TRUE if the anchor has been found. If the anchor could not be found it is retried when a new part of the document arrives.
bool |
Jumps to position _x_offset, _y_offset. Returns TRUE if the position was available
void |
Causes the widget contents to scroll automatically. Call stopAutoScrollY to stop. Stops automatically when the top or bottom of the document is reached.
Parameters:
_delay | Time in milliseconds to wait before scrolling the document again. |
_dy | The amount to scroll the document when _delay elapses. |
void |
Stops the document from autoScrollY ing.
bool |
Returns if the widget is currently auto scrolling.
void |
If this widget belongs to a HTMLView, then this function is used to tell the widget about its owner.
KHTMLView* |
Returns: the KHTMLView this widget belongs to.
bool |
Returns: TRUE if the currently displayed document is a frame set.
void |
Tells this widget that it displays a frameset. For internal use only.
KHTMLView* |
Returns: a pointer to the currently selected frame ( KHTMLView ) if we are displaying a frameset, otherwise 0L. If this widget is the selected one then htmlView is returned. Otherwise all HTMLFrameSet instances are asked.
bool |
Returns: TRUE if the currently displayed document is a frame.
void |
Tell the widget wether it is a frame or not. For internal use only.
void |
Sets the margin width in pixels. This function is used to implement the <tt><frame marginwidth=... ></tt> tag. It is called from KHTMLView and is for INTERNAL USE ONLY.
See also: leftBorder, rightBorder, setMarginWidth
void |
Sets the margin height in pixels. This function is used to implement the <tt><frame marginheight=... ></tt> tag. It is called from KHTMLView and is for INTERNAL USE ONLY.
See also: topBorder, bottomBorder, setMarginHeight
bool |
Returns: if the user selected this widget.
See also: bIsSelected, setSelected
void |
Switches the 'selected state' of this widget. This results in the drawing or deleting of the black border around the widget.
void |
Sets the base font size ( range: 2-5, default: 3 ).
Note that font sizes are not defined in points. Font sizes range from 1 (smallest) to 7 (biggest).
void |
void |
void |
void |
Sets the standard font style.
Parameters:
name | is the font name to use for standard text. |
void |
Sets the fixed font style.
Parameters:
name | is the font name to use for fixed text, e.g. the <tt><pre></tt> tag. |
void |
Sets the default background color to use when one isn't specified explicitly by <tt><body bgcolor=...></tt>
void |
Sets the default text colors.
void |
Set whether links are drawn in underlined text.
void |
Sets the cursor to use when the cursor is on a link.
void |
Force use of user defined colors
void |
Cryptic? This is used to set the number of tokens to parse in one timeslice during background processing.
You probably don't need to touch this.
void |
void |
void |
void |
void |
void |
void |
void |
void |
Internal use - calculates the absolute position of the objects.
HTMLMap * |
void |
[static]
JSEnvironment* |
Returns: a pointer to the JSEnvironment instance used by this widget. Every call to this function will result in the same pointer.
JSWindowObject* |
A convenience function to access the JSWindowObject of this html widget.
QList<KHTMLWidget>* |
Returns: a list of all frames.
bool |
Set document charset.
Any <META ...> setting charsets overrides this setting
Returns: TRUE if successfull
void |
set a charset, which will override the <meta ...> setting
bool |
bool |
bool |
bool |
bool |
bool |
void |
void |
void |
void |
void |
void |
SavedPage * |
void |
void |
void |
[protected]
void |
[protected]
int |
[protected]
int |
[protected]
void |
[signal]
This signal is emitted whenever the Widget wants to change the window's title. Usually this is the text enclosed in <tt><title>....</title></tt>.
void |
[signal]
The user pressed ALT + Up
void |
[signal]
The user pressed ALT + Left
void |
[signal]
The user pressed ALT + Right
void |
[signal]
The user double clicked on a URL.
Parameters:
_url | the URL that the user clicked on. |
_button | the mouse button that was used. |
void |
[signal]
Tells the parent, that the widget has scrolled. This may happen if the user selects an <tt><a href="#anchor"></tt>.
void |
[signal]
Tells the parent, that the widget has scrolled. This may happen if the user selects an <a href="#anchor">.
void |
[signal]
Signals that a URL has been selected using a single click.
Parameters:
_url | is the URL clicked on. |
_button | is the mouse button clicked. |
void |
[signal]
Signals that a URL has been selected using a single click.
Parameters:
_url | is the URL clicked on. |
_button | is the mouse button clicked. |
_target | is the target window or 0L if there is none. ( Used to implement frames ). |
void |
[signal]
Signals that the mouse cursor has moved on or off a URL.
Parameters:
_url | is the URL that the mouse cursor has moved onto. _url is null if the cursor moved off a URL. |
void |
[signal]
Signal that the user has selected text or the existing selection has become unselected. The text may be retrieved using getSelectedText. This is a good signal to connect to for enabling/disabling the Copy menu item or calling XSetSelectionOwner().
Parameters:
_selected | is true if the user has selected text or false if the current selection has been removed. |
void |
[signal]
Indicates the document has changed due to new URL loaded or progressive update. This signal may be emitted several times while the document is being parsed. It is an ideal opportunity to update any scrollbars.
void |
[signal]
This signal is emitted if the widget got a call to parse or begin. This indicates that the widget is working. In a Web Browser you can use this to start an animated logo like netscape does. The signal documentDone will tell you that the widget finished its job.
void |
[signal]
This signal is emitted when document is finished parsing and all required images arrived.
void |
[signal]
If the user pressed the right mouse button over a URL than _url points to this URL, otherwise _url will be null. The position is in global coordinates.
void |
[signal]
This signal is emitted if the user presses the mouse. If he clicks on a link you get the URL in '_url'.
Parameters:
_url | is the clicked URL or null is there was none. |
_target | is the target frame if one is mentioned otherwise 0L. |
_ev | the QMouseEvent. |
void |
[signal]
KHTMLWidget can only load files from your local disk. If it finds a object which requires a remote file, it will emit this signal. If the file is loaded at some time, call slotFileLoaded.
If the file is not needed any more, the signal cancelFileRequest is emitted.
Parameters:
_url | is the URL of the image that needs to be loaded. |
void |
[signal]
void |
[signal]
void |
[signal]
void |
[signal]
used for url redirection
void |
[slot]
Scrolls the document to _y.
This is usually connected to a scrollbar.
void |
[slot]
Scrolls the document to _x.
This is usually connected to a scrollbar.
void |
[slot]
Call when a file requested by fileRequest has been loaded.
Parameters:
_url | is the URL of the file that was requested. |
_filename | is the name of the file that has been stored on the local filesystem. |
void |
[protected slot]
void |
[protected slot]
void |
[protected slot]
void |
[protected slot]
void |
[protected slot]
void |
[protected slot]
enum |
enum |
void |
[protected virtual]
void |
[protected virtual]
Reimplemented from KDNDWidget.
void |
[protected]
void |
[protected]
void |
[protected virtual]
This function emits the 'doubleClick' signal when the user double clicks a <a href=...> tag.
void |
[protected virtual]
Overload this method if you dont want any drag actions.
Reimplemented from KDNDWidget.
void |
[protected virtual]
This function emits the 'URLSelected' signal when the user pressed a <a href=...> tag.
Reimplemented from KDNDWidget.
void |
[protected virtual]
Reimplemented from KDNDWidget.
bool |
[protected virtual]
Called when a URL is encountered. Overload this method to indicate which links have been visited previously.
Returns: true if the URL has been visited previously. If true is returned the URL will be rendered in the vlink color. If false is returned the URL will be rendered in the link color.
void |
[protected virtual]
void |
[protected virtual]
void |
[protected virtual]
void |
[protected virtual]
void |
[protected virtual]
void |
[protected virtual]
void |
[protected virtual]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
const char* |
[protected]
const char* |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
const char* |
[protected]
const char* |
[protected]
const char* |
[protected]
bool |
[protected]
void |
void |
[protected]
QString |
[protected]
QString |
[protected]
char * |
[protected]
char * |
[protected]
QString |
[protected]
QString |
[protected]
QString |
[protected]
QPainter * |
[protected]
HTMLClueV * |
[protected]
int |
[protected]
int |
[protected]
int |
[protected]
int |
[protected]
QTimer |
[protected]
QTimer |
[protected]
HTMLTokenizer * |
[protected]
QArray<char *> |
[protected]
int |
[protected]
StringTokenizer * |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
const HTMLFont * |
[protected]
void |
[protected]
QStack<HTMLFont> |
[protected]
int |
[protected]
bool |
[protected]
bool |
[protected]
bool |
[protected]
bool |
[protected]
int |
[protected]
int |
[protected]
QString |
[protected]
QString |
[protected]
If the user pressed the mouse button over an URL then this is the name of the target window for this hyper link. Used to implement frames.
QPixmap |
[protected]
QPoint |
[protected]
QPoint |
[protected]
bool |
[protected]
KURL |
[protected]
KURL |
[protected]
void |
[protected]
QString |
[protected]
QStack<QColor> |
[protected]
int |
[protected]
[protected]
typedef |
[protected]
HTMLStackElem * |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
void |
[protected]
int |
[protected]
bool |
[protected]
bool |
[protected]
bool |
[protected]
int |
[protected]
[protected]
QStack<HTMLList> |
[protected]
enum |
[protected]
QStack<GlossaryEntry> |
[protected]
HTMLClue::HAlign |
[protected]
int |
[protected]
int |
[protected]
bool |
[protected]
HTMLClue * |
[protected]
static parseFunc [26] |
[protected]
QStrList |
[protected]
QStrList |
[protected]
QStrList |
[protected]
QPixmap |
[protected]
QCursor |
[protected]
HTMLSettings * |
[protected]
HTMLSettings * |
[protected]
bool |
[protected]
QString |
[protected]
bool |
[protected]
QList<HTMLForm> |
[protected]
HTMLForm * |
[protected]
HTMLSelect * |
[protected]
bool |
[protected]
HTMLTextArea * |
[protected]
bool |
[protected]
bool |
[protected]
QString |
[protected]
QList<HTMLMap> |
[protected]
HTMLFrameSet * |
[protected]
QList<HTMLFrameSet> |
[protected]
QList<HTMLFrameSet> |
[protected]
QList<KHTMLWidget> |
[protected]
bool |
[protected]
bool |
[protected]
bool |
[protected]
bool |
[protected]
KHTMLView * |
[protected]
KHTMLView * |
[protected]
bool |
[protected]
int |
[protected]
int |
[protected]
int |
[protected]
int |
[protected]
JSEnvironment * |
[protected]
KCharsetConverter * |
[protected]
HTMLIterator * |
[protected]
QDict<HTMLPendingFile> |
[protected]
Keeps a list of all pending file.
QPixmap |
[protected]
QWidget * |
[protected]
QTimer * |
[protected]
enum ScrollType |
[protected]
Generated by: prospector@porky.devel.redhat.com on Tue Aug 15 09:55:46 2000, using kdoc 2.0a36. |