|
|
This widget makes displaying HTML text very easy. It handles scrollbars and stuff. It is able to handle most HTML 3.x including tables and frames. To fill the widget with content you should do the follwing:
view->begin( "file:/tmp/test.html" ); view->parse(); view->write( "<HTML><TITLE>...." ); ..... view->end(); view->show();
The widget will care for resize events and paint events and for scrolling. Have a look at the set of signals emitted by this widget. You should connect to most of them.
|
Created a new HTML View. The widget is empty by default. You must use begin, write, end and parse to fill the widget with content.
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]
Destroys the widget and all of its child widgets.
void |
[virtual]
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:
_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 |
[virtual]
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 |
[virtual]
Call this after your last call to write.
void |
[virtual]
This function will parse the code that has been previously written using the write function. Call this one after calling end.
void |
[virtual]
Shows '_url' in this view. Usually a documentRequest signal is emitted to load the url.
void |
[virtual]
Prints this view to the printer.
KHTMLView* |
[virtual]
Creates a new view. This function is not intended to be called by the application that uses this widget. It is intended to be overloaded by some class. If for example you have done this:
class MyView : public KHTMLView { ... virtual KHTMLView* newView( QWidget *_parent, const char *_name, int _flags ); };
You may now want to reimplement like this
KHTMLView* myView::newView( QWidget *_parent, const char *_name, int _flags ); { return new MyView( ... ); }
This will cause that all frames ( if you have some ) will be an instance of MyView, too.<br> FOR INTERNAL USE ONLY.
void |
[virtual]
Changes the name of the widget. This name is used in the <a href=.. target=... > tag.
See also: findView, name
const char* |
[virtual]
Returns: the name of this window.
See also: findView, name, findView
void |
Tells the widget that it is a frameset This is for internal use only. FOR INTERNAL USE ONLY.
bool |
FOR INTERNAL USE ONLY.
Returns: TRUE if the view displays a frameset right now.
void |
Tells the widget that it is a frame of some frameset. This is for internal use only. FOR INTERNAL USE ONLY.
bool |
FOR INTERNAL USE ONLY.
Returns: TRUE if the view displays a frame right now.
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.
bool |
Scrolls to the position (_x, _y). Returns TRUE if succeeded.
void |
Sets the width of the border. This is used to implement the tag <frame frameborder=... > tag. FOR INTERNAL USE ONLY.
int |
Returns: the width of the border in pixels.
void |
Tells the widget to show/hide the scrollbars. This function will have effect only when called before begin. It is used to implement the <tt><frame scrolling=... ></tt> tag.<br> FOR INTERNAL USE ONLY.
Parameters:
_scroll | is 1 for yes, 0 for no and -1 for auto. |
int |
Returns: 1 for yes, 0 for no and -1 for auto.
void |
Tells the widget wether it should be resizeable or not. The widget may still resize. Its only intention is to provide information for HTMLFrameSet. HTMLFrameSet looks at this flag to determine wether the separator between this frame and another one may be moved by the user. It is used to impement the <tt><frame noresize ></tt> tag.<br> FOR INTERNAL USE ONLY.
bool |
This function is used in HTMLFrameSet. It is for INTERNAL USE ONLY.
Returns: TRUE if the widget may be resized by the user.
void |
Sets the width of the margin. This function is used to implement the <tt><frame marginwidth=... ></tt> tag.<br> FOR INTERNAL USE ONLY.
void |
Sets the width of the margin. This function is used to implement the <tt><frame marginheight=... ></tt> tag.<br> FOR INTERNAL USE ONLY.
void |
Tells the widget that it has been selected. This will result in a black border around the widget. This happens only if this widget represents a frame. FOR INTERNAL USE ONLY.
bool |
FOR INTERNAL USE ONLY.
Returns: TRUE if this widget represents a frame and if it has been selected by the user. The selected frame has a black inner border.
int |
FOR INTERNAL USE ONLY.
Returns: the x offset of the widget. You may use this function to remeber which part of the document the user is currently looking at.
int |
Returns: the y offset of the widget. You may use this function to remeber which part of the document the user is currently looking at.
const char* |
Checks out wether there is a URL under the point p and returns a pointer to this URL or 0L if there is none.
KHTMLView* |
Seaerches for a KHTMLView with a specific name as mentioned in the constructor.
See also: setName, name
KHTMLView* |
[virtual]
Returns: the view that represents the currently selected frame or 0L if we dont have frames or a selected one right now.
void |
[virtual]
Select all objects matching the regular expression.
Parameters:
_select | if TRUE then all matching objects are marked, otherwise they become unmarked. |
void |
[virtual]
Gets a list of all selected URLs. The list may be Null. You can test this using list.isNull().
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.
bool |
[virtual]
This function allows you to customize the behavior of the KHTMLWidget.
Returns: TRUE if the function handled the event, FALSE otherwise.
See also: mousePressedHook, mouseReleaseHook
bool |
[virtual]
This function allows you to customize the behavior of the KHTMLWidget.
Returns: TRUE if the function handled the event, FALSE otherwise.
See also: mousePressedHook, mouseMoveHook
bool |
[virtual]
This function is called 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 0L is there was none. |
_target | is the target frame if one is mentioned otherwise 0L. |
_ev | the QMouseEvent. The coordinates of the mouse contained in this event are relational to the upper left corner of the KHTMLWidget, not to this widget! |
_isselected | is TRUE of the URL '_url' is already selected. |
Returns: TRUE if the function handled the event, FALSE otherwise.
See also: mouseMoveHook, mouseReleaseHook
bool |
[virtual]
This function is called if the user wants to start a DND action. Overload this function and return TRUE to indicate that you processed the event. By default the function returns FALSE. This causes the KHTMLWidget to process the event. Usually this function calls KHTMLWidget::startDrag like this: <TT>view->startDrag(....)</TT>. Dont call the startDrag function of any other window. KDND would not like it :-)
Parameters:
_url | is the URL the user wants to drag around. |
_p | is the mouse position in global coordinates. |
void |
[virtual]
Selects all objects 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. |
_painter | is a QPainter or 0L. If it is 0L a new painter is created. |
void |
[virtual]
Selects or deselects all objects.
Parameters:
_painter | is a QPainter or 0L. If it is 0L a new painter is created. |
void |
Selects all objects which refer to '_url'. All selected objects are redrawn if they changed their selection mode.
Parameters:
_painter | may be 0L. In this case a new QPainter is created and destroyed afterwards if no painter already exists. |
KHTMLWidget* |
Returns: a pointer to the low-level KHTMLWidget. You may use this to set default colours, etc. supported by the widget.
KHTMLView* |
Returns: the parent KHTMLView of this one or 0L is this is the top level view.
KHTMLView* |
Never returns 0L.
bool |
[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 |
Sets charset for the View
void |
set a charset, which will override the <meta ...> setting
const char* |
For internal use only.
void |
For internal use only.
void |
void |
SavedPage * |
tell the widget to save himself. Returns a struct, that can be used to restore it's contents
void |
restores the contents of the widget to the state gotten by a call to saveYourself()
void |
void |
[signal]
This signal is emitted if we deal with frames ( or one of the child widgets! ). It tells the owner of the widget to provide a certain URL for a widget. The owner has to call <PRE> _widget->begin( .. ); _widget->parse(); _widget->write( .. ); .... _widget->end(); This may happen before returning ( directly after receiving this signal ), or some time later on. You may be notified that the URL is no longer wanted. This is done with the signal cancelDocumentRequest.
Parameters:
_widget | is the widget that requests the document. |
_url | is the URL where the document can be found. |
See also: cancelDocumentRequest, slotDocumentRequest
void |
[signal]
This signal is emitted if the widget does not need the document any more.
Parameters:
_url | is the URL of the document that we dont need any more. |
void |
[signal]
This signal is emitted whenever the widget wants to change the windows title. Usually this is the text enclosed in the title tag.
Parameters:
_title | is a string of ASCII characters. |
void |
[signal]
Signals that the URL '_url' has been selected. The user used the mouse button '_button' for this.
Parameters:
_url | is a full qualified URL. |
_button | is <tt>LeftButton, MiddleButton or RightButton</tt> |
_target | is the target window or 0L if none is specified. |
void |
[signal]
Signals that the mouse cursor is over URL '_url'. If '_url' is null then cursor moved off a URL
Parameters:
_url | is a full qualified 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]
This signal is Emitted if the user pressed the right mouse button over an URL. '_url' may be 0L to indicate the the user pressed the right mouse button over an area that does not have an anchor tag.
Parameters:
_url | is a full qualified URL or 0L. |
_point | is the position where the user pressed the mouse button. This point is already in global cooredinates. |
void |
[signal]
This signal is emitted if the widget requests to load an image. KHTMLWidget can only load image from your local disk. If it finds an image with another protocol in its URL, it will emit this signal. If the image is loaded at some time, call slotImageLoaded. If the image is not needed any more, the signal cancelImageRequest is emitted. It may happen that not the widget itself but one of its children requests the image. To distibuish that you get '_view'.
void |
[signal]
This signal is only emitted if this widget and not one of its children requests an image.
void |
[signal]
Cancels an image that has been requested before.
void |
[signal]
This signal is only emitted if this widget and not one of its children cancels a requested image.
void |
[signal]
The user pressed a forms submit button.
Parameters:
_url | is the <form action=...> value |
_method | is the <form method=...> value |
_data | is the encoded data to send |
void |
[signal]
Emitted if the user presses the mouse button over this widget and if the widget is a frame. In this case this frame became the selected one and this signal is used to tell our parent about this.
void |
[signal]
The widget started working. You may use this signal to implement an animated logo like netscape has one.
void |
[signal]
This signal is emitted if the widget has parsed and if all images arrived. Mention that this is only true or '_view'. The parent widget or any child widget may still parse or wait for an image. This signal is the complement to documentStarted
void |
[signal]
The user pressed ALT + Up
void |
[signal]
void |
[signal]
The user pressed ALT + Right
void |
[signal]
void |
[signal]
The user pressed ALT + Left
void |
[signal]
void |
[slot]
void |
[slot]
void |
[slot]
Call this slot if an requested image is available. The rquested image is named '_url' and is stored on the local disk in the file named '_filename'.
Parameters:
_url | is the full qualified URL that was passedd to you by the ref #imageRequest signal. |
_filename | is a usual UNIX filename like "/tmp/tmpimage". |
void |
[slot]
This slot is connected to all children. It emits the signal documentRequest if called. <b>This slot is for internal use only</b>.
void |
[slot]
This slot is connected to all children. It emits the signal cancelDocumentRequest if called. <b>This slot is for internal use only</b>.
void |
[slot]
This slot is connected to all children. It emits the signal URLSelected if called. <b>This slot is for internal use only</b>.
void |
[slot]
This slot is connected to all children. It emits the signal setTitle if called. <b>This slot is for internal use only</b>.
void |
[slot]
This slot is connected to all children. It emits the signal onURL if called. <b>This slot is for internal use only</b>.
void |
[slot]
This slot is connected to all children. It emits the signal popupMenu if called. <b>This slot is for internal use only</b>.
void |
[slot]
This slot is connected to all children. It emits the signal imageRequest if called. <b>This slot is for internal use only</b>.
void |
[slot]
This slot is connected to all children. It emits the signal cancelImageRequest if called. <b>This slot is for internal use only</b>.
void |
[slot]
This slot is connected to all children. It emits the signal cancelImageRequest if called. <b>This slot is for internal use only</b>.
Parameters:
_method | is the <form method=...> value |
_url | is the <form action=...> value |
_data | is the encoded from data submitted |
void |
[slot]
This slot is connected to all children. It emits the signal documentStarted if called. <b>This slot is for internal use only</b>.
void |
[slot]
This slot is connected to all children. It emits the signal documentDone if called. <b>This slot is for internal use only</b>.
void |
[slot]
You can move the vertical scrollbar by calling this slot.
void |
[slot]
You can move the vertical scrollbar by calling this slot.
void |
[slot]
You can move the vertical scrollbar by calling this slot.
void |
[slot]
You can move the vertical scrollbar by calling this slot.
void |
[protected virtual slot]
This slot is connected to KHTMLWidget. It emits the signal URLSelected if called. <b>This slot is for internal use only</b>.
void |
[protected virtual slot]
This slot is connected to KHTMLWidget. It emits the signal onURL if called. <b>This slot is for internal use only</b>.
void |
[protected virtual slot]
void |
[protected virtual slot]
This slot is connected to KHTMLWidget. It emits the signal popupMenu if called. <b>This slot is for internal use only</b>.
void |
[protected virtual slot]
This slot is connected to KHTMLWidget. It emits the signal imageRequest if called. <b>This slot is for internal use only</b>.
void |
[protected virtual slot]
This slot is connected to KHTMLWidget. It emits the signal cancelImageRequest if called. <b>This slot is for internal use only</b>.
void |
[protected virtual slot]
This slot is connected to KHTMLWidget. It emits the signal if the form is submitted
Parameters:
_url | is the <form action=...> value |
_method | is the <form method=...> value |
_data | is the encoded form data submitted |
void |
[protected virtual slot]
This slot is connected to KHTMLWidget. It emits the signal if the document in the HTML Widget changes.<br> <b>For Internal use only</b>.
void |
[protected virtual slot]
This slot is connected to KHTMLWidget. It emits the signal documentStarted if called. <b>This slot is for internal use only</b>.
void |
[protected virtual slot]
This slot is connected to KHTMLWidget. It emits the signal documentDone if called. <b>This slot is for internal use only</b>.
void |
[protected slot]
Connected to the HTML widget.
void |
[protected slot]
Connected to the HTML widget
void |
[protected slot]
The user pressed ALT + Up
void |
[protected slot]
The user pressed ALT + Right
void |
[protected slot]
The user pressed ALT + Left
void |
[protected virtual]
void |
[protected virtual]
void |
[protected virtual]
void |
[protected virtual]
QScrollBar * |
[protected]
QScrollBar * |
[protected]
KHTMLWidget * |
[protected]
QString |
[protected]
The currently displayed URL. This is usually the same URL as the one passed to the Constructor of KIDWIindow::KIDWindow.
bool |
[protected]
bool |
[protected]
static QList<KHTMLView> * |
[protected]
QString |
[protected]
bool |
[protected]
int |
[protected]
int |
[protected]
KHTMLView * |
[protected]
QString |
[protected]
int |
[protected]
int |
[protected]
Generated by: prospector@porky.devel.redhat.com on Tue Aug 15 09:55:46 2000, using kdoc 2.0a36. |