|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.qt.Qt
org.kde.qt.QObject
org.kde.koala.Part
org.kde.koala.ReadOnlyPart
org.kde.koala.KHTMLPart
public class KHTMLPart
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:
String 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 String 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( String( "SeeKHTML Rocks!
" ) ); doc.closeStream();
KHTMLPartSignals
for signals emitted by KHTMLPart
Field Summary | |
---|---|
static int |
Before
|
static int |
BrowserViewGUI
|
static int |
CaretBlink
|
static int |
CaretInvisible
|
static int |
CaretVisible
Enumeration for displaying the caret. |
static int |
DefaultGUI
|
static int |
Encrypted
|
static int |
FindLinksOnly
Extra Find options that can be used when calling the extended findText(). |
static int |
FindNoPopups
|
static int |
Mixed
|
static int |
NoNotification
|
static int |
NotCrypted
|
static int |
Only
|
static int |
Unused
|
Fields inherited from class org.kde.qt.Qt |
---|
AlignAuto, AlignBottom, AlignCenter, AlignHCenter, AlignHorizontal_Mask, AlignJustify, AlignLeft, AlignRight, AlignTop, AlignVCenter, AlignVertical_Mask, AlphaDither_Mask, ALT, AltButton, AnchorHref, AnchorName, AndNotROP, AndROP, ArrowCursor, Ascending, ASCII_ACCEL, AutoColor, AutoDither, AutoText, AvoidDither, BDiagPattern, BeginsWith, BevelJoin, BitmapCursor, BlankCursor, Bottom, BottomLeft, BottomRight, BreakAnywhere, BusyCursor, CaseSensitive, ClearROP, ColorMode_Mask, ColorOnly, Contains, ControlButton, CopyROP, CrossCursor, CrossPattern, CTRL, CustomPattern, DashDotDotLine, DashDotLine, DashLine, Dense1Pattern, Dense2Pattern, Dense3Pattern, Dense4Pattern, Dense5Pattern, Dense6Pattern, Dense7Pattern, Descending, DiagCrossPattern, DiffuseAlphaDither, DiffuseDither, Dither_Mask, DitherMode_Mask, DockBottom, DockLeft, DockMinimized, DockRight, DockTop, DockTornOff, DockUnmanaged, DontClip, DontPrint, DotLine, DownArrow, EndsWith, EraseROP, ExactMatch, ExpandTabs, FDiagPattern, FixedColor, FixedPixmap, FlatCap, ForbiddenCursor, HiEnglishUnit, HiMetricUnit, Horizontal, HorPattern, IbeamCursor, Identical, IncludeTrailingSpaces, ISODate, Key_0, Key_1, Key_2, Key_3, Key_4, Key_5, Key_6, Key_7, Key_8, Key_9, Key_A, Key_aacute, Key_Aacute, Key_acircumflex, Key_Acircumflex, Key_acute, Key_adiaeresis, Key_Adiaeresis, Key_ae, Key_AE, Key_agrave, Key_Agrave, Key_Alt, Key_Ampersand, Key_Any, Key_Apostrophe, Key_aring, Key_Aring, Key_AsciiCircum, Key_AsciiTilde, Key_Asterisk, Key_At, Key_atilde, Key_Atilde, Key_B, Key_Back, Key_Backslash, Key_Backspace, Key_BackSpace, Key_Backtab, Key_BackTab, Key_Bar, Key_BassBoost, Key_BassDown, Key_BassUp, Key_BraceLeft, Key_BraceRight, Key_BracketLeft, Key_BracketRight, Key_brokenbar, Key_C, Key_CapsLock, Key_ccedilla, Key_Ccedilla, Key_cedilla, Key_cent, Key_Clear, Key_Colon, Key_Comma, Key_Control, Key_copyright, Key_currency, Key_D, Key_degree, Key_Delete, Key_diaeresis, Key_Direction_L, Key_Direction_R, Key_division, Key_Dollar, Key_Down, Key_E, Key_eacute, Key_Eacute, Key_ecircumflex, Key_Ecircumflex, Key_ediaeresis, Key_Ediaeresis, Key_egrave, Key_Egrave, Key_End, Key_Enter, Key_Equal, Key_Escape, Key_eth, Key_ETH, Key_Exclam, Key_exclamdown, Key_F, Key_F1, Key_F10, Key_F11, Key_F12, Key_F13, Key_F14, Key_F15, Key_F16, Key_F17, Key_F18, Key_F19, Key_F2, Key_F20, Key_F21, Key_F22, Key_F23, Key_F24, Key_F25, Key_F26, Key_F27, Key_F28, Key_F29, Key_F3, Key_F30, Key_F31, Key_F32, Key_F33, Key_F34, Key_F35, Key_F4, Key_F5, Key_F6, Key_F7, Key_F8, Key_F9, Key_Favorites, Key_Forward, Key_G, Key_Greater, Key_guillemotleft, Key_guillemotright, Key_H, Key_Help, Key_Home, Key_HomePage, Key_Hyper_L, Key_Hyper_R, Key_hyphen, Key_I, Key_iacute, Key_Iacute, Key_icircumflex, Key_Icircumflex, Key_idiaeresis, Key_Idiaeresis, Key_igrave, Key_Igrave, Key_Insert, Key_J, Key_K, Key_L, Key_Launch0, Key_Launch1, Key_Launch2, Key_Launch3, Key_Launch4, Key_Launch5, Key_Launch6, Key_Launch7, Key_Launch8, Key_Launch9, Key_LaunchA, Key_LaunchB, Key_LaunchC, Key_LaunchD, Key_LaunchE, Key_LaunchF, Key_LaunchMail, Key_LaunchMedia, Key_Left, Key_Less, Key_M, Key_macron, Key_masculine, Key_MediaLast, Key_MediaNext, Key_MediaPlay, Key_MediaPrev, Key_MediaRecord, Key_MediaStop, Key_Menu, Key_Meta, Key_Minus, Key_mu, Key_multiply, Key_N, Key_Next, Key_nobreakspace, Key_notsign, Key_ntilde, Key_Ntilde, Key_NumberSign, Key_NumLock, Key_O, Key_oacute, Key_Oacute, Key_ocircumflex, Key_Ocircumflex, Key_odiaeresis, Key_Odiaeresis, Key_ograve, Key_Ograve, Key_onehalf, Key_onequarter, Key_onesuperior, Key_Ooblique, Key_OpenUrl, Key_ordfeminine, Key_oslash, Key_otilde, Key_Otilde, Key_P, Key_PageDown, Key_PageUp, Key_paragraph, Key_ParenLeft, Key_ParenRight, Key_Pause, Key_Percent, Key_Period, Key_periodcentered, Key_Plus, Key_plusminus, Key_Print, Key_Prior, Key_Q, Key_Question, Key_questiondown, Key_QuoteDbl, Key_QuoteLeft, Key_R, Key_Refresh, Key_registered, Key_Return, Key_Right, Key_S, Key_ScrollLock, Key_Search, Key_section, Key_Semicolon, Key_Shift, Key_Slash, Key_Space, Key_ssharp, Key_Standby, Key_sterling, Key_Stop, Key_Super_L, Key_Super_R, Key_SysReq, Key_T, Key_Tab, Key_thorn, Key_THORN, Key_threequarters, Key_threesuperior, Key_TrebleDown, Key_TrebleUp, Key_twosuperior, Key_U, Key_uacute, Key_Uacute, Key_ucircumflex, Key_Ucircumflex, Key_udiaeresis, Key_Udiaeresis, Key_ugrave, Key_Ugrave, Key_Underscore, Key_unknown, Key_Up, Key_V, Key_VolumeDown, Key_VolumeMute, Key_VolumeUp, Key_W, Key_X, Key_Y, Key_yacute, Key_Yacute, Key_ydiaeresis, Key_yen, Key_Z, KeyButtonMask, Keypad, LastCursor, LastROP, Left, LeftArrow, LeftButton, LocalDate, LocalTime, LoEnglishUnit, LogText, LoMetricUnit, MacStyle, META, MetaButton, MidButton, Minimized, MiterJoin, MODIFIER_MASK, MonoOnly, MotifStyle, MouseButtonMask, MPenCapStyle, MPenJoinStyle, MPenStyle, MV_10_DOT_0, MV_10_DOT_1, MV_10_DOT_2, MV_10_DOT_3, MV_10_DOT_4, MV_9, MV_CHEETAH, MV_JAGUAR, MV_PANTHER, MV_PUMA, MV_TIGER, MV_Unknown, NandROP, NoAccel, NoAlpha, NoBackground, NoBrush, NoButton, NoMatch, NoPen, NopROP, NorROP, NotAndROP, NotCopyROP, NotEraseROP, NotOrROP, NotROP, NotXorROP, OpaqueMode, OrderedAlphaDither, OrderedDither, OrNotROP, OrROP, Overline, PaletteBackground, PaletteBase, PaletteBrightText, PaletteButton, PaletteButtonText, PaletteDark, PaletteForeground, PaletteHighlight, PaletteHighlightedText, PaletteLight, PaletteLink, PaletteLinkVisited, PaletteMid, PaletteMidlight, PaletteShadow, PaletteText, PartialMatch, PixelUnit, PlainText, PMStyle, PointingHandCursor, PreferDither, RichText, Right, RightArrow, RightButton, RoundCap, RoundJoin, SetROP, SHIFT, ShiftButton, ShowPrefix, SingleLine, SizeAllCursor, SizeBDiagCursor, SizeFDiagCursor, SizeHorCursor, SizeVerCursor, SolidLine, SolidPattern, SplitHCursor, SplitVCursor, SquareCap, StrikeOut, TextDate, ThresholdAlphaDither, ThresholdDither, Top, TopLeft, TopRight, TornOff, TransparentMode, TwipsUnit, UI_AnimateCombo, UI_AnimateMenu, UI_AnimateToolBox, UI_AnimateTooltip, UI_FadeMenu, UI_FadeTooltip, UI_General, Underline, UNICODE_ACCEL, Unmanaged, UpArrow, UpArrowCursor, UTC, VerPattern, Vertical, WaitCursor, WDestructiveClose, WGroupLeader, WhatsThisCursor, Win3Style, WindowActive, WindowFullScreen, WindowMaximized, WindowMinimized, WindowNoState, WindowsStyle, WMacDrawer, WMacNoSheet, WMouseNoMask, WNoAutoErase, WNoMousePropagation, WNorthWestGravity, WordBreak, WPaintClever, WPaintDesktop, WPaintUnclipped, WRepaintNoErase, WResizeNoErase, WShowModal, WState_AutoMask, WState_BlockUpdates, WState_CompressKeys, WState_ConfigPending, WState_Created, WState_CreatedHidden, WState_Disabled, WState_DND, WState_Exposed, WState_ForceDisabled, WState_ForceHide, WState_FullScreen, WState_HasMouse, WState_InPaintEvent, WState_Maximized, WState_Minimized, WState_MouseTracking, WState_OwnCursor, WState_OwnSizePolicy, WState_Polished, WState_Reparented, WState_Reserved0, WState_Resized, WState_Visible, WStaticContents, WStyle_ContextHelp, WStyle_Customize, WStyle_Dialog, WStyle_DialogBorder, WStyle_Mask, WStyle_Maximize, WStyle_Minimize, WStyle_MinMax, WStyle_NoBorder, WStyle_NoBorderEx, WStyle_NormalBorder, WStyle_Reserved, WStyle_Splash, WStyle_StaysOnTop, WStyle_SysMenu, WStyle_Title, WStyle_Tool, WSubWindow, WType_Desktop, WType_Dialog, WType_Mask, WType_Modal, WType_Popup, WType_TopLevel, WV_2000, WV_2003, WV_32s, WV_95, WV_98, WV_CE, WV_CE_based, WV_CENET, WV_DOS_based, WV_Me, WV_NT, WV_NT_based, WV_XP, WWinOwnDC, WX11BypassWM, X11ParentRelative, XorROP |
Constructor Summary | |
---|---|
|
KHTMLPart()
|
protected |
KHTMLPart(java.lang.Class dummy)
|
|
KHTMLPart(KHTMLView view)
|
|
KHTMLPart(KHTMLView view,
org.kde.qt.QObject parent)
|
|
KHTMLPart(KHTMLView view,
org.kde.qt.QObject parent,
java.lang.String name)
|
|
KHTMLPart(KHTMLView view,
org.kde.qt.QObject parent,
java.lang.String name,
int prof)
|
|
KHTMLPart(org.kde.qt.QWidget parentWidget)
|
|
KHTMLPart(org.kde.qt.QWidget parentWidget,
java.lang.String widgetname)
|
|
KHTMLPart(org.kde.qt.QWidget parentWidget,
java.lang.String widgetname,
org.kde.qt.QObject parent)
|
|
KHTMLPart(org.kde.qt.QWidget parentWidget,
java.lang.String widgetname,
org.kde.qt.QObject parent,
java.lang.String name)
|
|
KHTMLPart(org.kde.qt.QWidget parentWidget,
java.lang.String widgetname,
org.kde.qt.QObject parent,
java.lang.String name,
int prof)
Constructs a new KHTMLPart. |
Method Summary | |
---|---|
Node |
activeNode()
Returns the node that has the keyboard focus. |
boolean |
autoloadImages()
Returns whether images contained in the document are loaded automatically or not. |
void |
autoloadImages(boolean e)
|
KURL |
backgroundURL()
Returns the URL for the background Image (used by save background) |
java.lang.String |
baseTarget()
|
KURL |
baseURL()
|
void |
begin()
|
void |
begin(KURL url)
|
void |
begin(KURL url,
int xOffset)
|
void |
begin(KURL url,
int xOffset,
int yOffset)
Clears the widget and prepares it for new content. |
BrowserExtension |
browserExtension()
Returns a pointer to the KParts.BrowserExtension. |
BrowserHostExtension |
browserHostExtension()
|
int |
caretDisplayPolicyNonFocused()
Returns the current caret policy when the view is not focused. |
java.lang.String |
className()
|
boolean |
closeURL()
Stops loading the document and kills all data requests (for images, etc.) |
protected KURL |
completeURL(java.lang.String url)
returns a KURL object for the given url. |
protected ReadOnlyPart |
createPart(org.kde.qt.QWidget parentWidget,
java.lang.String widgetName,
org.kde.qt.QObject parent,
java.lang.String name,
java.lang.String mimetype,
java.lang.StringBuffer serviceName,
java.lang.String[] serviceTypes,
java.lang.String[] params)
This method is called when a new embedded object (include html frames) is to be created. |
ReadOnlyPart |
currentFrame()
Return the current frame (the one that has focus) Not necessarily a direct child of ours, framesets can be nested. |
protected void |
customEvent(org.kde.qt.QCustomEvent event)
|
java.lang.String |
dcopObjectId()
|
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
boolean |
dndEnabled()
Returns whether Dragn'n'Drop support is enabled or not. |
protected boolean |
doCloseStream()
Implements the streaming API of KParts.ReadOnlyPart. |
Document |
document()
Returns a reference to the DOM document. |
java.lang.String |
documentSource()
Returns the content of the source document. |
protected boolean |
doOpenStream(java.lang.String mimeType)
Implements the streaming API of KParts.ReadOnlyPart. |
protected boolean |
doWriteStream(byte[] data)
Implements the streaming API of KParts.ReadOnlyPart. |
void |
enableJava(boolean e)
|
void |
enableJScript(boolean e)
|
void |
enableMetaRefresh(boolean e)
|
void |
enablePlugins(boolean e)
|
java.lang.String |
encoding()
Returns the encoding the page currently uses. |
void |
end()
Call this after your last call to write(). |
org.kde.qt.QVariant |
executeScript(Node n,
java.lang.String script)
Same as executeScript( String ) except with the Node parameter specifying the 'this' value. |
protected void |
finalize()
Deletes the wrapped C++ instance |
KHTMLPart |
findFrame(java.lang.String f)
Finds a frame by name. |
KHTMLPart |
findFrameParent(ReadOnlyPart callingPart,
java.lang.String f)
Recursively finds the part containing the frame with name f
and checks if it is accessible by callingPart
Returns null if no suitable frame can't be found. |
ReadOnlyPart |
findFramePart(java.lang.String f)
Finds a frame by name. |
void |
findText()
Starts a new search by popping up a dialog asking the user what he wants to search for. |
void |
findText(java.lang.String str,
long options)
|
void |
findText(java.lang.String str,
long options,
org.kde.qt.QWidget parent)
|
void |
findText(java.lang.String str,
long options,
org.kde.qt.QWidget parent,
KFindDialog findDialog)
Starts a new search, but bypasses the user dialog. |
void |
findTextBegin()
Initiates a text search. |
boolean |
findTextNext()
Finds the next occurence of a string set by findText() |
boolean |
findTextNext(boolean reverse)
Finds the next occurence of a string set by findText() |
int |
formNotification()
Determine if signal should be emitted before, instead or never when a submitForm() happens. |
boolean |
frameExists(java.lang.String frameName)
Returns whether a frame with the specified name is exists or not. |
java.util.ArrayList |
frameNames()
Returns a list of names of all frame (including iframe) objects of the current document. |
boolean |
gotoAnchor(java.lang.String name)
Finds the anchor named name.
If the anchor is found, the widget
scrolls to the closest position. |
protected void |
guiActivateEvent(GUIActivateEvent event)
Internal reimplementation of KParts.Part.guiActivateEvent . |
boolean |
hasSelection()
Has the user selected anything? Call selectedText() to retrieve the selected text. |
void |
hide()
Convenience method to hide the document's view. |
HTMLDocument |
htmlDocument()
Returns a reference to the DOM HTML document (for non-HTML documents, returns null) |
protected void |
htmlError(int errorCode,
java.lang.String text,
KURL reqUrl)
presents a detailed error message to the user. |
boolean |
inProgress()
|
boolean |
isCaretMode()
Returns whether caret mode is on/off. |
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
boolean |
isEditable()
Returns true if the document is editable, false otherwise. |
boolean |
isModified()
Checks whether the page contains unsubmitted form changes. |
boolean |
javaEnabled()
Return true if Java applet support is enabled, false if disabled |
boolean |
jScriptEnabled()
Returns true if Javascript support is enabled or false
otherwise. |
java.lang.String |
jsDefaultStatusBarText()
Called by KJS. |
java.lang.String |
jsStatusBarText()
Called by KJS. |
java.lang.String |
lastModified()
Last-modified date (in raw string format), if received in the [HTTP] headers. |
org.kde.qt.QMetaObject |
metaObject()
|
boolean |
metaRefreshEnabled()
Returns true if automatic forwarding is enabled. |
boolean |
nextAnchor()
Go to the next anchor This is useful to navigate from outside the navigator |
Node |
nodeUnderMouse()
Returns the Node currently under the mouse. |
Node |
nonSharedNodeUnderMouse()
Returns the Node currently under the mouse that is not shared. |
boolean |
onlyLocalReferences()
Returns whether only file:/ or data:/ references are allowed to be loaded ( default false ). |
protected boolean |
openFile()
Internal empty reimplementation of KParts.ReadOnlyPart.openFile . |
boolean |
openURL(KURL url)
Opens the specified URL url.
Reimplemented from KParts.ReadOnlyPart.openURL . |
java.lang.String |
pageReferrer()
Referrer used to obtain this page. |
void |
paint(org.kde.qt.QPainter arg1,
org.kde.qt.QRect arg2)
|
void |
paint(org.kde.qt.QPainter arg1,
org.kde.qt.QRect arg2,
int arg3)
|
void |
paint(org.kde.qt.QPainter arg1,
org.kde.qt.QRect arg2,
int arg3,
boolean[] arg4)
Paints the HTML page to a QPainter. |
KHTMLPart |
parentPart()
Returns a pointer to the parent KHTMLPart if the part is a frame in an HTML frameset. |
PartManager |
partManager()
Returns a reference to the partmanager instance which manages html frame objects. |
protected boolean |
pluginPageQuestionAsked(java.lang.String mimetype)
|
boolean |
pluginsEnabled()
Returns true if plugins are enabled/disabled. |
void |
preloadScript(java.lang.String url,
java.lang.String script)
Loads a script into the script cache. |
void |
preloadStyleSheet(java.lang.String url,
java.lang.String stylesheet)
Loads a style sheet into the stylesheet cache. |
boolean |
prevAnchor()
Go to previous anchor |
java.lang.String |
referrer()
Referrer used for links in this page. |
boolean |
restored()
|
void |
restoreState(org.kde.qt.QDataStream stream)
Restores the KHTMLPart's previously saved state (including child frame objects) from the provided QDataStream. |
void |
saveState(org.kde.qt.QDataStream stream)
Saves the KHTMLPart's complete state (including child frame objects) to the provided QDataStream. |
void |
scheduleRedirection(int delay,
java.lang.String url)
|
void |
scheduleRedirection(int delay,
java.lang.String url,
boolean lockHistory)
Schedules a redirection after delay seconds. |
void |
selectAll()
Marks all text in the document as selected. |
java.lang.String |
selectedText()
Returns the text the user has marked. |
java.lang.String |
selectedTextAsHTML()
Return the text the user has marked. |
Range |
selection()
Returns the selected part of the HTML. |
void |
selection(Node startNode,
long startOffset,
Node endNode,
long endOffset)
Returns the selected part of the HTML by returning the starting and end position. |
void |
setActiveNode(Node node)
Sets the focused node of the document to the specified node. |
void |
setAutoloadImages(boolean enable)
Specifies whether images contained in the document should be loaded automatically or not. |
void |
setCaretDisplayPolicyNonFocused(int policy)
Sets the caret display policy when the view is not focused. |
void |
setCaretMode(boolean enable)
Enables/disables caret mode. |
void |
setCaretPosition(Node node,
long offset)
|
void |
setCaretPosition(Node node,
long offset,
boolean extendSelection)
Sets the caret to the given position. |
void |
setCaretVisible(boolean show)
Sets the visibility of the caret. |
boolean |
setCharset(java.lang.String arg1,
boolean arg2)
|
void |
setDNDEnabled(boolean b)
Enables or disables Drag'n'Drop support. |
void |
setEditable(boolean enable)
Makes the document editable. |
boolean |
setEncoding(java.lang.String name)
|
boolean |
setEncoding(java.lang.String name,
boolean override)
Sets the encoding the page uses. |
void |
setFixedFont(java.lang.String name)
Sets the fixed font style. |
void |
setFormNotification(int fn)
Determine if signal should be emitted before, instead or never when a submitForm() happens. |
void |
setJavaEnabled(boolean enable)
Enables/disables Java applet support. |
void |
setJScriptEnabled(boolean enable)
Enable/disable Javascript support. |
void |
setJSDefaultStatusBarText(java.lang.String text)
Called by KJS. |
void |
setJSStatusBarText(java.lang.String text)
Called by KJS. |
void |
setMetaRefreshEnabled(boolean enable)
Enable/disable automatic forwarding by <meta http-equiv="refresh" ....> |
void |
setOnlyLocalReferences(boolean enable)
Security option. |
protected void |
setPluginPageQuestionAsked(java.lang.String mimetype)
|
void |
setPluginsEnabled(boolean enable)
Enables or disables plugins, default is enabled |
void |
setSelection(Range arg1)
Sets the current selection. |
void |
setStandardFont(java.lang.String name)
Sets the standard font style. |
void |
setStatusMessagesEnabled(boolean enable)
Enable/disable statusbar messages. |
void |
setSuppressedPopupIndicator(boolean enable,
KHTMLPart originPart)
Shows or hides the suppressed popup indicator |
KHTMLSettings |
settings()
|
void |
setURLCursor(org.kde.qt.QCursor c)
Sets the cursor to use when the cursor is on a link. |
void |
setUserStyleSheet(KURL url)
Sets a user defined style sheet to be used on top of the HTML 4 default style sheet. |
void |
setUserStyleSheet(java.lang.String styleSheet)
Sets a user defined style sheet to be used on top of the HTML 4 default style sheet. |
void |
setZoomFactor(int percent)
Sets the Zoom factor. |
void |
show()
Convenience method to show the document's view. |
void |
showError(Job job)
Called when a certain error situation (i.e. |
boolean |
statusMessagesEnabled()
Returns true if status messages are enabled. |
void |
stopAnimations()
Stops all animated images on the current and child pages |
void |
submitFormProxy(java.lang.String action,
java.lang.String url,
byte[] formData,
java.lang.String target)
|
void |
submitFormProxy(java.lang.String action,
java.lang.String url,
byte[] formData,
java.lang.String target,
java.lang.String contentType)
|
void |
submitFormProxy(java.lang.String action,
java.lang.String url,
byte[] formData,
java.lang.String target,
java.lang.String contentType,
java.lang.String boundary)
|
KURL |
toplevelURL()
Returns the toplevel (origin) URL of this document, even if this part is a frame or an iframe. |
org.kde.qt.QCursor |
urlCursor()
Returns the cursor which is used when the cursor is on a link. |
protected void |
urlSelected(java.lang.String url,
int button,
int state,
java.lang.String _target)
|
protected void |
urlSelected(java.lang.String url,
int button,
int state,
java.lang.String _target,
URLArgs args)
|
KHTMLView |
view()
Returns a pointer to the HTML document's view. |
void |
write(java.lang.String str)
|
void |
write(java.lang.String str,
int len)
Writes another part of the HTML code to the widget. |
int |
zoomFactor()
Returns the current zoom factor. |
Methods inherited from class org.kde.koala.ReadOnlyPart |
---|
closeStream, isProgressInfoEnabled, openStream, setProgressInfoEnabled, showProgressInfo, url, writeStream |
Methods inherited from class org.kde.koala.Part |
---|
embed, hitTest, hostContainer, isSelectable, loadPlugins, manager, partActivateEvent, partObject, partSelectEvent, setInstance, setInstance, setManager, setPartObject, setSelectable, setWidget, widget |
Methods inherited from class org.kde.qt.QObject |
---|
activate_filters, activate_signal_bool, activate_signal, activate_signal, activate_signal, activate_signal, blockSignals, checkConnectArgs, child, child, child, childEvent, children, connect, connect, connectInternal, connectNotify, deleteLater, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnectInternal, disconnectNotify, dumpObjectInfo, dumpObjectTree, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, event, eventFilter, highPriority, i18n, inherits, insertChild, installEventFilter, isA, isWidgetType, killTimer, killTimers, name, name, normalizeSignalSlot, objectTrees, parent, property, queryList, queryList, queryList, queryList, queryList, registerUserData, removeChild, removeEventFilter, sender, setName, setProperty, signalsBlocked, startTimer, timerEvent, tr, tr |
Methods inherited from class org.kde.qt.Qt |
---|
arrowCursor, bin, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, black, blankCursor, blue, color0, color1, copyBlt, copyBlt, copyBlt, copyBlt, copyBlt, crossCursor, cyan, darkBlue, darkCyan, darkGray, darkGreen, darkMagenta, darkRed, darkYellow, dec, dynamicCast, endl, flush, forbiddenCursor, fromUtf8, gray, green, hex, ibeamCursor, lightGray, magenta, oct, op_div, op_div, op_div, op_div, op_equals, op_equals, op_equals, op_equals, op_minus, op_minus, op_minus, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_not_equals, op_not_equals, op_not_equals, op_not_equals, op_plus, op_plus, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, pointingHandCursor, qAlpha, qApp, qAppName, qBlue, qCompress, qCompress, qDebug, qDebug, qDrawArrow, qDrawItem, qDrawItem, qDrawItem, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qFatal, qFatal, qGLVersion, qGray, qGray, qGreen, qInitNetworkProtocols, qInstallPath, qInstallPathBins, qInstallPathData, qInstallPathDocs, qInstallPathHeaders, qInstallPathLibs, qInstallPathPlugins, qInstallPathSysconf, qInstallPathTranslations, qItemRect, qItemRect, qObsolete, qObsolete, qObsolete, qRed, qRgb, qRgba, qRound, qSharedBuild, qSuppressObsoleteWarnings, qSuppressObsoleteWarnings, qSysInfo, qSystemWarning, qSystemWarning, qUncompress, qUncompress, qVersion, qWarning, qWarning, red, reset, SIGNAL, sizeAllCursor, sizeBDiagCursor, sizeFDiagCursor, sizeHorCursor, sizeVerCursor, SLOT, splitHCursor, splitVCursor, upArrowCursor, waitCursor, whatsThisCursor, white, ws, yellow |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DefaultGUI
public static final int BrowserViewGUI
public static final int CaretVisible
public static final int CaretInvisible
public static final int CaretBlink
public static final int FindLinksOnly
public static final int FindNoPopups
public static final int NoNotification
public static final int Before
public static final int Only
public static final int Unused
public static final int NotCrypted
public static final int Encrypted
public static final int Mixed
Constructor Detail |
---|
protected KHTMLPart(java.lang.Class dummy)
public KHTMLPart(org.kde.qt.QWidget parentWidget, java.lang.String widgetname, org.kde.qt.QObject parent, java.lang.String name, int prof)
parent
argument is null, then
parentWidget
is used as parent for both objects, the part and
the view.
public KHTMLPart(org.kde.qt.QWidget parentWidget, java.lang.String widgetname, org.kde.qt.QObject parent, java.lang.String name)
public KHTMLPart(org.kde.qt.QWidget parentWidget, java.lang.String widgetname, org.kde.qt.QObject parent)
public KHTMLPart(org.kde.qt.QWidget parentWidget, java.lang.String widgetname)
public KHTMLPart(org.kde.qt.QWidget parentWidget)
public KHTMLPart()
public KHTMLPart(KHTMLView view, org.kde.qt.QObject parent, java.lang.String name, int prof)
public KHTMLPart(KHTMLView view, org.kde.qt.QObject parent, java.lang.String name)
public KHTMLPart(KHTMLView view, org.kde.qt.QObject parent)
public KHTMLPart(KHTMLView view)
Method Detail |
---|
public org.kde.qt.QMetaObject metaObject()
metaObject
in class ReadOnlyPart
public java.lang.String className()
className
in class ReadOnlyPart
public boolean openURL(KURL url)
url.
Reimplemented from KParts.ReadOnlyPart.openURL .
openURL
in class ReadOnlyPart
public boolean closeURL()
closeURL
in class ReadOnlyPart
public void showError(Job job)
job
is the job that signaled the error situation
public HTMLDocument htmlDocument()
public Document document()
public java.lang.String documentSource()
public Node activeNode()
public BrowserExtension browserExtension()
public BrowserHostExtension browserHostExtension()
public KHTMLView view()
public void setJScriptEnabled(boolean enable)
public boolean jScriptEnabled()
true
if Javascript support is enabled or false
otherwise.
public void setStatusMessagesEnabled(boolean enable)
Part#setStatusBarText(
,
#const
,
#text
public boolean statusMessagesEnabled()
true
if status messages are enabled.
public void setMetaRefreshEnabled(boolean enable)
public boolean metaRefreshEnabled()
true
if automatic forwarding is enabled.
public org.kde.qt.QVariant executeScript(Node n, java.lang.String script)
public void setDNDEnabled(boolean b)
public boolean dndEnabled()
public void setJavaEnabled(boolean enable)
public boolean javaEnabled()
public void setPluginsEnabled(boolean enable)
public boolean pluginsEnabled()
public void setAutoloadImages(boolean enable)
public boolean autoloadImages()
public void setOnlyLocalReferences(boolean enable)
public boolean onlyLocalReferences()
public boolean isCaretMode()
public boolean isEditable()
true
if the document is editable, false
otherwise.
public void setCaretPosition(Node node, long offset, boolean extendSelection)
caretPositionChanged
signal
containing the effective position is emitted
node
- node to set tooffset
- zero-based offset within the nodeextendSelection
- If true
, a selection will be spanned from the
last caret position to the given one. Otherwise, any existing selection
will be deselected.public void setCaretPosition(Node node, long offset)
public int caretDisplayPolicyNonFocused()
public void setCaretDisplayPolicyNonFocused(int policy)
policy
- new display policypublic void enableJScript(boolean e)
public void enableJava(boolean e)
public void enablePlugins(boolean e)
public void autoloadImages(boolean e)
public void enableMetaRefresh(boolean e)
public boolean setCharset(java.lang.String arg1, boolean arg2)
public KURL baseURL()
public java.lang.String baseTarget()
public KURL backgroundURL()
public void scheduleRedirection(int delay, java.lang.String url, boolean lockHistory)
delay
seconds.
public void scheduleRedirection(int delay, java.lang.String url)
public void begin(KURL url, int xOffset, int yOffset)
view.begin( KURL("file:/tmp/test.html" ) );
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.
All child frames and the old document are removed if you call
this method.public void begin(KURL url, int xOffset)
public void begin(KURL url)
public void begin()
public void write(java.lang.String str, int len)
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( String ) with calls
to write( String ).
The result might not be what you want.
public void write(java.lang.String str)
public void end()
public void paint(org.kde.qt.QPainter arg1, org.kde.qt.QRect arg2, int arg3, boolean[] arg4)
public void paint(org.kde.qt.QPainter arg1, org.kde.qt.QRect arg2, int arg3)
public void paint(org.kde.qt.QPainter arg1, org.kde.qt.QRect arg2)
public boolean setEncoding(java.lang.String name, boolean override)
public boolean setEncoding(java.lang.String name)
public java.lang.String encoding()
public void setUserStyleSheet(KURL url)
public void setUserStyleSheet(java.lang.String styleSheet)
public void setStandardFont(java.lang.String name)
name
- The font name to use for standard text.public void setFixedFont(java.lang.String name)
name
- The font name to use for fixed text, e.g.
the <pre> tag.public boolean gotoAnchor(java.lang.String name)
name.
If the anchor is found, the widget
scrolls to the closest position. Returns if
the anchor has
been found.
public boolean nextAnchor()
public boolean prevAnchor()
public void setURLCursor(org.kde.qt.QCursor c)
public org.kde.qt.QCursor urlCursor()
public void findText()
public void findText(java.lang.String str, long options, org.kde.qt.QWidget parent, KFindDialog findDialog)
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.public void findText(java.lang.String str, long options, org.kde.qt.QWidget parent)
public void findText(java.lang.String str, long options)
public void findTextBegin()
public boolean findTextNext()
findText()
public boolean findTextNext(boolean reverse)
findText()
reverse
- if true, revert seach direction (only if no find dialog is used)
public void setZoomFactor(int percent)
public int zoomFactor()
public java.lang.String selectedText()
public java.lang.String selectedTextAsHTML()
public Range selection()
public void selection(Node startNode, long startOffset, Node endNode, long endOffset)
startNode
- returns node selection starts instartOffset
- returns offset within starting nodeendNode
- returns node selection ends inendOffset
- returns offset within end node.public void setSelection(Range arg1)
public boolean hasSelection()
true
if there is text selected.public void selectAll()
public void show()
public void hide()
public PartManager partManager()
public void saveState(org.kde.qt.QDataStream stream)
public void restoreState(org.kde.qt.QDataStream stream)
saveState(org.kde.qt.QDataStream)
public Node nodeUnderMouse()
Node
currently under the mouse.
The returned node may be a shared node (e. g. an \ node if the
mouse is hovering over an image map).
public Node nonSharedNodeUnderMouse()
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.,
\ on image maps).
public KHTMLSettings settings()
public KHTMLPart parentPart()
public java.util.ArrayList frameNames()
public KHTMLPart findFrame(java.lang.String f)
public KHTMLPart findFrameParent(ReadOnlyPart callingPart, java.lang.String f)
f
and checks if it is accessible by callingPart
Returns null if no suitable frame can't be found.
Returns parent part if a suitable frame was found and
frame info in childFrame
public ReadOnlyPart currentFrame()
public boolean frameExists(java.lang.String frameName)
public ReadOnlyPart findFramePart(java.lang.String f)
public void setJSStatusBarText(java.lang.String text)
public void setJSDefaultStatusBarText(java.lang.String text)
public java.lang.String jsStatusBarText()
public java.lang.String jsDefaultStatusBarText()
public java.lang.String referrer()
public java.lang.String pageReferrer()
public java.lang.String lastModified()
public void preloadStyleSheet(java.lang.String url, java.lang.String stylesheet)
public void preloadScript(java.lang.String url, java.lang.String script)
public boolean restored()
public void setFormNotification(int fn)
public int formNotification()
public KURL toplevelURL()
public boolean isModified()
public void setSuppressedPopupIndicator(boolean enable, KHTMLPart originPart)
public boolean inProgress()
public void setActiveNode(Node node)
node
- The node to focuspublic void stopAnimations()
public java.lang.String dcopObjectId()
public void setCaretMode(boolean enable)
enable
- true
to enable, false
to disable caret mode.public void setEditable(boolean enable)
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
enable
- true
to set document editable, false
to set it
read-only.public void setCaretVisible(boolean show)
show
- true
to make visible, false
to hide.public void submitFormProxy(java.lang.String action, java.lang.String url, byte[] formData, java.lang.String target, java.lang.String contentType, java.lang.String boundary)
public void submitFormProxy(java.lang.String action, java.lang.String url, byte[] formData, java.lang.String target, java.lang.String contentType)
public void submitFormProxy(java.lang.String action, java.lang.String url, byte[] formData, java.lang.String target)
protected KURL completeURL(java.lang.String url)
protected void htmlError(int errorCode, java.lang.String text, KURL reqUrl)
errorCode
kio error code, eg KIO.ERR_SERVER_TIMEOUT.
text
kio additional information text.
url
the url that triggered the error.
protected void customEvent(org.kde.qt.QCustomEvent event)
customEvent
in class Part
protected void guiActivateEvent(GUIActivateEvent event)
guiActivateEvent
in class Part
protected boolean openFile()
protected void urlSelected(java.lang.String url, int button, int state, java.lang.String _target, URLArgs args)
protected void urlSelected(java.lang.String url, int button, int state, java.lang.String _target)
protected ReadOnlyPart createPart(org.kde.qt.QWidget parentWidget, java.lang.String widgetName, org.kde.qt.QObject parent, java.lang.String name, java.lang.String mimetype, java.lang.StringBuffer serviceName, java.lang.String[] serviceTypes, java.lang.String[] params)
protected boolean pluginPageQuestionAsked(java.lang.String mimetype)
protected void setPluginPageQuestionAsked(java.lang.String mimetype)
protected boolean doOpenStream(java.lang.String mimeType)
protected boolean doWriteStream(byte[] data)
protected boolean doCloseStream()
protected void finalize() throws java.lang.InternalError
finalize
in class org.kde.qt.QObject
java.lang.InternalError
public void dispose()
dispose
in class org.kde.qt.QObject
public boolean isDisposed()
isDisposed
in class org.kde.qt.QObject
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |