📄 khtml_part.h
字号:
/** * Saves the KHTMLPart's complete state (including child frame * objects) to the provided QDataStream. * * This is called from the saveState() method of the * browserExtension(). */ virtual void saveState( QDataStream &stream ); /** * Restores the KHTMLPart's previously saved state (including * child frame objects) from the provided QDataStream. * * @see saveState() * * This is called from the restoreState() method of the * browserExtension() . **/ virtual void restoreState( QDataStream &stream ); /** * Returns the @p 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). */ DOM::Node nodeUnderMouse() const; /** * Returns the @p 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 */ DOM::Node nonSharedNodeUnderMouse() const; /** * @internal */ const KHTMLSettings *settings() const; /** * Returns a pointer to the parent KHTMLPart if the part is a frame * in an HTML frameset. * * Returns 0L otherwise. */ KHTMLPart *parentPart(); /** * 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. */ QStringList frameNames() const; QPtrList<KParts::ReadOnlyPart> frames() const; /** * Finds a frame by name. Returns 0L if frame can't be found. */ KHTMLPart *findFrame( const QString &f ); /** * Recursively finds the part containing the frame with name @p f * and checks if it is accessible by @p callingPart * Returns 0L if no suitable frame can't be found. * Returns parent part if a suitable frame was found and * frame info in @p *childFrame * @since 3.3 */ KHTMLPart *findFrameParent( KParts::ReadOnlyPart *callingPart, const QString &f, khtml::ChildFrame **childFrame=0 ); /** * 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. */ KParts::ReadOnlyPart *currentFrame() const; /** * 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. */ bool frameExists( const QString &frameName ); /** * Returns child frame framePart its script interpreter */ KJSProxy *framejScript(KParts::ReadOnlyPart *framePart); /** * Finds a frame by name. Returns 0L if frame can't be found. */ KParts::ReadOnlyPart *findFramePart( const QString &f ); /** * Called by KJS. * Sets the StatusBarText assigned * via window.status */ void setJSStatusBarText( const QString &text ); /** * Called by KJS. * Sets the DefaultStatusBarText assigned * via window.defaultStatus */ void setJSDefaultStatusBarText( const QString &text ); /** * Called by KJS. * Returns the StatusBarText assigned * via window.status */ QString jsStatusBarText() const; /** * Called by KJS. * Returns the DefaultStatusBarText assigned * via window.defaultStatus */ QString jsDefaultStatusBarText() const; /** * Referrer used for links in this page. */ QString referrer() const; /** * Referrer used to obtain this page. */ QString pageReferrer() const; /** * Last-modified date (in raw string format), if received in the [HTTP] headers. */ QString lastModified() const; /** * Loads a style sheet into the stylesheet cache. */ void preloadStyleSheet( const QString &url, const QString &stylesheet ); /** * Loads a script into the script cache. */ void preloadScript( const QString &url, const QString &script ); /** * @internal */ bool restored() const; // ### KDE4 remove me enum FormNotification { NoNotification = 0, Before, Only, Unused=255 }; /** * Determine if signal should be emitted before, instead or never when a * submitForm() happens. * @since 3.2 * ### KDE4 remove me */ void setFormNotification(FormNotification fn); /** * Determine if signal should be emitted before, instead or never when a * submitForm() happens. * ### KDE4 remove me * @since 3.2 */ FormNotification formNotification() const; /** * Returns the toplevel (origin) URL of this document, even if this * part is a frame or an iframe. * * @return the actual original url. * @since 3.2 */ KURL toplevelURL(); /** * Checks whether the page contains unsubmitted form changes. * * @return true if form changes exist * @since 3.3 */ bool isModified() const; /** * Shows or hides the suppressed popup indicator * @deprecated * @since 3.4 */ void setSuppressedPopupIndicator( bool enable ); /** * Shows or hides the suppressed popup indicator * @since 3.5 */ void setSuppressedPopupIndicator( bool enable, KHTMLPart *originPart ); /** * @internal * @since 3.5 */ bool inProgress() const;signals: /** * Emitted if the cursor is moved over an URL. */ void onURL( const QString &url ); /** * Emitted when the user clicks the right mouse button on the document. */ void popupMenu( const QString &url, const QPoint &point ); /** * This signal is emitted when the selection changes. */ void selectionChanged(); /** * 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. */ void nodeActivated( const DOM::Node & ); /** * @internal */ void docCreated(); /** * 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. * @param node node which the caret is in. This can be null if the caret * has been deactivated. * @param offset offset within the node. If the node is null, the offset * is meaningless. * @since 3.2 */ void caretPositionChanged(const DOM::Node &node, long offset); /** * 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 */ void formSubmitNotification(const char *action, const QString& url, const QByteArray& formData, const QString& target, const QString& contentType, const QString& boundary);protected: /** * returns a KURL object for the given url. Use when * you know what you're doing. */ KURL completeURL( const QString &url ); /** * presents a detailed error message to the user. * @p errorCode kio error code, eg KIO::ERR_SERVER_TIMEOUT. * @p text kio additional information text. * @p url the url that triggered the error. */ void htmlError( int errorCode, const QString& text, const KURL& reqUrl ); virtual void customEvent( QCustomEvent *event ); /** * Eventhandler of the khtml::MousePressEvent. */ virtual void khtmlMousePressEvent( khtml::MousePressEvent *event ); /** * Eventhandler for the khtml::MouseDoubleClickEvent. */ virtual void khtmlMouseDoubleClickEvent( khtml::MouseDoubleClickEvent * ); /** * Eventhandler for the khtml::MouseMouseMoveEvent. */ virtual void khtmlMouseMoveEvent( khtml::MouseMoveEvent *event ); /** * Eventhandler for the khtml::MouseMouseReleaseEvent. */ virtual void khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event ); /** * Eventhandler for the khtml::DrawContentsEvent. */ virtual void khtmlDrawContentsEvent( khtml::DrawContentsEvent * ); /** * Internal reimplementation of KParts::Part::guiActivateEvent . */ virtual void guiActivateEvent( KParts::GUIActivateEvent *event ); /** * Internal empty reimplementation of KParts::ReadOnlyPart::openFile . */ virtual bool openFile(); virtual void urlSelected( const QString &url, int button, int state, const QString &_target, KParts::URLArgs args = KParts::URLArgs()); /** * 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' . */ virtual KParts::ReadOnlyPart *createPart( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, const QString &mimetype, QString &serviceName, QStringList &serviceTypes, const QStringList ¶ms); // This is for RenderPartObject. We want to ask the 'download plugin?' // question only once per mimetype bool pluginPageQuestionAsked( const QString& mimetype ) const; void setPluginPageQuestionAsked( const QString& mimetype ); enum PageSecurity { NotCrypted, Encrypted, Mixed }; void setPageSecurity( PageSecurity sec ); /** * Implements the streaming API of KParts::ReadOnlyPart. */ virtual bool doOpenStream( const QString& mimeType ); /** * Implements the streaming API of KParts::ReadOnlyPart. */ virtual bool doWriteStream( const QByteArray& data ); /** * Implements the streaming API of KParts::ReadOnlyPart. */ virtual bool doCloseStream();public slots: /** * 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 * * @param node The node to focus */ void setActiveNode( const DOM::Node &node ); /** * Stops all animated images on the current and child pages */ void stopAnimations(); QCString dcopObjectId() const; /** * Execute the specified snippet of JavaScript code. * * Returns @p true if JavaScript was enabled, no error occurred * and the code returned true itself or @p false otherwise. * @deprecated, use executeString( DOM::Node(), script) */ QVariant executeScript( const QString &script ); /** * 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. * * @param enable @p true to enable, @p false to disable caret mode. * @since 3.2 */ void setCaretMode(bool enable); /** * Makes the document editable. * * Setting this property to @p 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 * * @param enable @p true to set document editable, @p false to set it * read-only. * @since 3.2 (pending, do not use) */ void setEditable(bool enable); /** * 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: * @li the document is editable * @li the document is in caret mode * @li the document's currently focused element is editable *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -