00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __khtml_part_h__
00027 #define __khtml_part_h__
00028
00029 #include "dom/dom_doc.h"
00030 #include "dom/dom2_range.h"
00031
00032 #include <kparts/part.h>
00033 #include <kparts/browserextension.h>
00034 #include <kdemacros.h>
00035 #include <kfind.h>
00036 #include <kfinddialog.h>
00037 #include <klocalizedstring.h>
00038 #include <kencodingdetector.h>
00039 #include <QtCore/QRegExp>
00040
00041 class KHTMLPartPrivate;
00042 class KHTMLPartBrowserExtension;
00043 class KJSProxy;
00044 class KHTMLView;
00045 class KHTMLViewBar;
00046 class KHTMLFindBar;
00047 class KHTMLSettings;
00048 class KJavaAppletContext;
00049 class KJSErrorDlg;
00050
00051 namespace DOM
00052 {
00053 class HTMLDocument;
00054 class HTMLDocumentImpl;
00055 class DocumentImpl;
00056 class Document;
00057 class XMLDocumentImpl;
00058 class HTMLTitleElementImpl;
00059 class HTMLFrameElementImpl;
00060 class HTMLIFrameElementImpl;
00061 class HTMLObjectElementImpl;
00062 class HTMLFormElementImpl;
00063 class HTMLAnchorElementImpl;
00064 class HTMLMetaElementImpl;
00065 class NodeImpl;
00066 class ElementImpl;
00067 class Node;
00068 class HTMLEventListener;
00069 class EventListener;
00070 class HTMLPartContainerElementImpl;
00071 class HTMLObjectBaseElementImpl;
00072 class Position;
00073 class Selection;
00074 class Range;
00075 class Editor;
00076 }
00077
00078 namespace WebCore
00079 {
00080 class SVGDocumentExtensions;
00081 }
00082
00083 namespace KJS
00084 {
00085 class Interpreter;
00086 class HTMLElement;
00087 }
00088
00089 namespace khtml
00090 {
00091 class DocLoader;
00092 class RenderPart;
00093 class ChildFrame;
00094 class MousePressEvent;
00095 class MouseDoubleClickEvent;
00096 class MouseMoveEvent;
00097 class MouseReleaseEvent;
00098 class DrawContentsEvent;
00099 class CachedObject;
00100 class RenderWidget;
00101 class RenderBlock;
00102 class CSSStyleSelector;
00103 class HTMLTokenizer;
00104 class XMLTokenizer;
00105 struct EditorContext;
00106 class EditCommandImpl;
00107 class KHTMLPartAccessor;
00108 }
00109
00110 namespace KJS {
00111 class Window;
00112 class WindowFunc;
00113 class ExternalFunc;
00114 class JSEventListener;
00115 class JSLazyEventListener;
00116 class JSNodeFilter;
00117 class DOMDocument;
00118 class SourceFile;
00119 class ScheduledAction;
00120 class DOMSelection;
00121 class DOMSelectionProtoFunc;
00122 }
00123
00124 namespace KParts
00125 {
00126 class PartManager;
00127 class LiveConnectExtension;
00128 }
00129
00130 namespace KWallet
00131 {
00132 class Wallet;
00133 }
00134
00205 class KHTML_EXPORT KHTMLPart : public KParts::ReadOnlyPart
00206 {
00207 Q_OBJECT
00208 friend class KHTMLView;
00209 friend class DOM::HTMLTitleElementImpl;
00210 friend class DOM::HTMLFrameElementImpl;
00211 friend class DOM::HTMLIFrameElementImpl;
00212 friend class DOM::HTMLObjectBaseElementImpl;
00213 friend class DOM::HTMLObjectElementImpl;
00214 friend class DOM::HTMLAnchorElementImpl;
00215 friend class DOM::HTMLMetaElementImpl;
00216 friend class DOM::NodeImpl;
00217 friend class DOM::ElementImpl;
00218 friend class KHTMLRun;
00219 friend class DOM::HTMLFormElementImpl;
00220 friend class KJS::Window;
00221 friend class KJS::ScheduledAction;
00222 friend class KJS::JSNodeFilter;
00223 friend class KJS::WindowFunc;
00224 friend class KJS::ExternalFunc;
00225 friend class KJS::JSEventListener;
00226 friend class KJS::JSLazyEventListener;
00227 friend class KJS::DOMDocument;
00228 friend class KJS::HTMLElement;
00229 friend class KJS::SourceFile;
00230 friend class KJS::DOMSelection;
00231 friend class KJS::DOMSelectionProtoFunc;
00232 friend class KJSProxy;
00233 friend class KHTMLPartBrowserExtension;
00234 friend class DOM::DocumentImpl;
00235 friend class DOM::HTMLDocumentImpl;
00236 friend class DOM::Selection;
00237 friend class DOM::Editor;
00238 friend class KHTMLPartBrowserHostExtension;
00239 friend class khtml::HTMLTokenizer;
00240 friend class khtml::XMLTokenizer;
00241 friend class khtml::RenderWidget;
00242 friend class khtml::RenderBlock;
00243 friend class khtml::CSSStyleSelector;
00244 friend class khtml::EditCommandImpl;
00245 friend class khtml::KHTMLPartAccessor;
00246 friend class KHTMLPartIface;
00247 friend class KHTMLPartFunction;
00248 friend class KHTMLPopupGUIClient;
00249 friend class KHTMLFind;
00250 friend class StorePass;
00251 friend class WebCore::SVGDocumentExtensions;
00252
00253 Q_PROPERTY( bool javaScriptEnabled READ jScriptEnabled WRITE setJScriptEnabled )
00254 Q_PROPERTY( bool javaEnabled READ javaEnabled WRITE setJavaEnabled )
00255 Q_PROPERTY( bool dndEnabled READ dndEnabled WRITE setDNDEnabled )
00256 Q_PROPERTY( bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled )
00257 Q_PROPERTY( DNSPrefetch dnsPrefetch READ dnsPrefetch WRITE setDNSPrefetch )
00258
00259
00260
00261
00262
00263
00264 Q_PROPERTY( bool modified READ isModified )
00265 Q_PROPERTY( QString encoding READ encoding WRITE setEncoding )
00266 Q_PROPERTY( QString lastModified READ lastModified )
00267 Q_PROPERTY( bool metaRefreshEnabled READ metaRefreshEnabled WRITE setMetaRefreshEnabled )
00268
00269 public:
00270 enum GUIProfile { DefaultGUI, BrowserViewGUI };
00271
00279 enum DNSPrefetch {
00280 DNSPrefetchDisabled=0,
00281 DNSPrefetchEnabled,
00282 DNSPrefetchOnlyWWWAndSLD
00283 };
00284
00297 KHTMLPart( QWidget *parentWidget = 0,
00298 QObject *parent = 0, GUIProfile prof = DefaultGUI );
00317 KHTMLPart( KHTMLView *view, QObject *parent = 0, GUIProfile prof = DefaultGUI );
00318
00322 virtual ~KHTMLPart();
00323
00329 virtual bool openUrl( const KUrl &url );
00330
00334 virtual bool closeUrl();
00335
00342 virtual void showError( KJob* job );
00343
00347 DOM::HTMLDocument htmlDocument() const;
00348
00352 DOM::Document document() const;
00353
00357 QString documentSource() const;
00358
00362 DOM::Node activeNode() const;
00363
00367 KParts::BrowserExtension *browserExtension() const;
00368 KParts::BrowserHostExtension *browserHostExtension() const;
00369
00373 KHTMLView *view() const;
00374
00381 void setJScriptEnabled( bool enable );
00382
00387 bool jScriptEnabled() const;
00388
00406 KJS::Interpreter *jScriptInterpreter();
00407
00419 void setStatusMessagesEnabled( bool enable );
00420
00424 bool statusMessagesEnabled() const;
00425
00429 void setMetaRefreshEnabled( bool enable );
00430
00434 bool metaRefreshEnabled() const;
00435
00440 QVariant executeScript( const DOM::Node &n, const QString &script );
00441
00446 void setDNDEnabled( bool b );
00447
00451 bool dndEnabled() const;
00452
00459 void setJavaEnabled( bool enable );
00460
00464 bool javaEnabled() const;
00465
00469 void setPluginsEnabled( bool enable );
00470
00474 bool pluginsEnabled() const;
00475
00482 void setAutoloadImages( bool enable );
00489 bool autoloadImages() const;
00490
00507 void setOnlyLocalReferences( bool enable );
00508
00521 void setDNSPrefetch( DNSPrefetch pmode );
00522
00531 DNSPrefetch dnsPrefetch() const;
00532
00537 bool onlyLocalReferences() const;
00538
00541 bool isCaretMode() const;
00542
00546 bool isEditable() const;
00547
00560 void setCaretPosition(DOM::Node node, long offset, bool extendSelection = false);
00561
00565 enum CaretDisplayPolicy {
00566 CaretVisible,
00567 CaretInvisible,
00568 CaretBlink
00569 };
00570
00574 CaretDisplayPolicy caretDisplayPolicyNonFocused() const;
00575
00585 void setCaretDisplayPolicyNonFocused(CaretDisplayPolicy policy);
00586
00587 #ifndef KDE_NO_COMPAT
00588 KUrl baseURL() const;
00589 #endif
00590
00594 KUrl backgroundURL() const;
00595
00599 void scheduleRedirection( int delay, const QString &url, bool lockHistory = true );
00600
00623 virtual void begin( const KUrl &url = KUrl(), int xOffset = 0, int yOffset = 0 );
00624
00645 virtual void write( const char *str, int len = -1 );
00646
00658
00659 virtual void write( const QString &str );
00660
00664 virtual void end();
00665
00666
00667
00668
00669
00670
00671
00672
00676 void paint( QPainter *, const QRect &, int = 0, bool * = 0 );
00677
00684 bool setEncoding( const QString &name, bool override = false );
00685
00691 QString encoding() const;
00692
00702 void setUserStyleSheet( const KUrl &url );
00703
00713 void setUserStyleSheet( const QString &styleSheet );
00714
00715 public:
00716
00722 void setStandardFont( const QString &name );
00723
00730 void setFixedFont( const QString &name );
00731
00739 bool gotoAnchor( const QString &name );
00740
00746 bool nextAnchor();
00747
00751 bool prevAnchor();
00752
00756 void setURLCursor( const QCursor &c );
00757
00761 QCursor urlCursor() const;
00762
00766 enum FindOptions
00767 {
00768 FindLinksOnly = 1 * KFind::MinimumUserOption,
00769 FindNoPopups = 2 * KFind::MinimumUserOption
00770
00771 };
00772
00777 void findText();
00778
00786 void findText( const QString &str, long options, QWidget *parent = 0,
00787 KFindDialog *findDialog = 0 );
00788
00792 void findTextBegin();
00793
00799 bool findTextNext( bool reverse = false );
00800
00810 void setZoomFactor(int percent);
00811
00815 int zoomFactor() const;
00816
00826 void setFontScaleFactor(int percent);
00827
00831 int fontScaleFactor() const;
00832
00836 virtual QString selectedText() const;
00837
00844 QString selectedTextAsHTML() const;
00845
00849 DOM::Range selection() const;
00850
00861 void selection(DOM::Node &startNode, long &startOffset,
00862 DOM::Node &endNode, long &endOffset) const;
00863
00867 void setSelection( const DOM::Range & );
00868
00877 bool hasSelection() const;
00878
00883 DOM::Editor *editor() const;
00884
00888 void selectAll();
00889
00895 void show();
00896
00902 void hide();
00903
00908 KParts::PartManager *partManager();
00909
00917 virtual void saveState( QDataStream &stream );
00927 virtual void restoreState( QDataStream &stream );
00928
00935 DOM::Node nodeUnderMouse() const;
00936
00944 DOM::Node nonSharedNodeUnderMouse() const;
00945
00949 const KHTMLSettings *settings() const;
00950
00957
00958 KHTMLPart *parentPart();
00959
00965 QStringList frameNames() const;
00966
00967 QList<KParts::ReadOnlyPart*> frames() const;
00968
00972 KHTMLPart *findFrame( const QString &f );
00973
00981 KHTMLPart *findFrameParent( KParts::ReadOnlyPart *callingPart, const QString &f, khtml::ChildFrame **childFrame=0 );
00982
00988 KParts::ReadOnlyPart *currentFrame() const;
00989
00996 bool frameExists( const QString &frameName );
00997
01001 KJSProxy *framejScript(KParts::ReadOnlyPart *framePart);
01002
01006 KParts::ReadOnlyPart *findFramePart( const QString &f );
01012 void setJSStatusBarText( const QString &text );
01013
01019 void setJSDefaultStatusBarText( const QString &text );
01020
01026 QString jsStatusBarText() const;
01027
01033 QString jsDefaultStatusBarText() const;
01034
01038 QString referrer() const;
01039
01043 QString pageReferrer() const;
01044
01048 QString lastModified() const;
01049
01053 void preloadStyleSheet( const QString &url, const QString &stylesheet );
01054
01058 void preloadScript( const QString &url, const QString &script );
01059
01065 bool isPointInsideSelection(int x, int y);
01066
01070 bool restored() const;
01071
01081
01082 void setAlwaysHonourDoctype( bool b = true );
01083
01084
01085 enum FormNotification { NoNotification = 0, Before, Only, Unused=255 };
01091 void setFormNotification(FormNotification fn);
01092
01098 FormNotification formNotification() const;
01099
01106 KUrl toplevelURL();
01107
01113 bool isModified() const;
01114
01118 void setSuppressedPopupIndicator( bool enable, KHTMLPart *originPart = 0 );
01119
01123 bool inProgress() const;
01124
01125 Q_SIGNALS:
01129 void onURL( const QString &url );
01130
01136 void popupMenu( const QString &url, const QPoint &point );
01137
01141 void selectionChanged();
01142
01150 void nodeActivated( const DOM::Node & );
01151
01154 void docCreated();
01155
01166 void caretPositionChanged(const DOM::Node &node, long offset);
01167
01168
01174 void formSubmitNotification(const char *action, const QString& url,
01175 const QByteArray& formData, const QString& target,
01176 const QString& contentType, const QString& boundary);
01177
01181 void configurationChanged();
01182
01183
01184 protected:
01185
01190 KUrl completeURL( const QString &url );
01191
01198 void htmlError( int errorCode, const QString& text, const KUrl& reqUrl );
01199
01200 virtual void customEvent( QEvent *event );
01201
01205 virtual void khtmlMousePressEvent( khtml::MousePressEvent *event );
01209 virtual void khtmlMouseDoubleClickEvent( khtml::MouseDoubleClickEvent * );
01213 virtual void khtmlMouseMoveEvent( khtml::MouseMoveEvent *event );
01217 virtual void khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event );
01221 virtual void khtmlDrawContentsEvent( khtml::DrawContentsEvent * );
01222
01226 virtual void guiActivateEvent( KParts::GUIActivateEvent *event );
01227
01231 virtual bool openFile();
01232
01233 virtual bool urlSelected( const QString &url, int button, int state,
01234 const QString &_target,
01235 const KParts::OpenUrlArguments& args = KParts::OpenUrlArguments(),
01236 const KParts::BrowserArguments& browserArgs = KParts::BrowserArguments() );
01237
01246 virtual KParts::ReadOnlyPart *createPart( QWidget *parentWidget,
01247 QObject *parent,
01248 const QString &mimetype, QString &serviceName,
01249 QStringList &serviceTypes, const QStringList ¶ms);
01250
01251
01252
01253 bool pluginPageQuestionAsked( const QString& mimetype ) const;
01254 void setPluginPageQuestionAsked( const QString& mimetype );
01255
01256 enum PageSecurity { NotCrypted, Encrypted, Mixed };
01257 void setPageSecurity( PageSecurity sec );
01258
01262 virtual bool doOpenStream( const QString& mimeType );
01263
01267 virtual bool doWriteStream( const QByteArray& data );
01268
01272 virtual bool doCloseStream();
01273
01277 virtual void timerEvent(QTimerEvent *);
01278
01285 bool mayPrefetchHostname( const QString& name );
01286
01287 public Q_SLOTS:
01288
01298 void setActiveNode( const DOM::Node &node );
01299
01303 void stopAnimations();
01304
01312 QVariant executeScript( const QString &script );
01313
01323 void setCaretMode(bool enable);
01324
01335 void setEditable(bool enable);
01336
01352 void setCaretVisible(bool show);
01353
01354
01355
01356
01357 void submitFormProxy( const char *action, const QString &url,
01358 const QByteArray &formData,
01359 const QString &target,
01360 const QString& contentType = QString(),
01361 const QString& boundary = QString() );
01362
01363 protected Q_SLOTS:
01364
01370 virtual void slotFinished( KJob* );
01371
01372 protected:
01378 virtual void startingJob( KIO::Job * ) {}
01379
01380 private Q_SLOTS:
01381
01385 void reparseConfiguration();
01386
01390 void slotData( KIO::Job*, const QByteArray &data );
01394 void slotInfoMessage( KJob*, const QString& msg );
01398 void slotRestoreData( const QByteArray &data );
01402 void slotFinishedParsing();
01406 void slotRedirect();
01410 void slotRedirection( KIO::Job*, const KUrl& );
01414 void slotDebugScript();
01418 void slotDebugDOMTree();
01422 void slotDebugRenderTree();
01426 void slotStopAnimations();
01430 virtual void slotViewDocumentSource();
01434 virtual void slotViewFrameSource();
01438 void slotViewPageInfo();
01442 virtual void slotSaveBackground();
01446 virtual void slotSaveDocument();
01450 virtual void slotSaveFrame();
01454 virtual void slotSecurity();
01458 virtual void slotSetEncoding(const QString &);
01459
01463 virtual void slotUseStylesheet();
01464
01465 virtual void slotFind();
01466 virtual void slotFindDone();
01467 virtual void slotFindDialogDestroyed();
01468 void slotFindNext();
01469 void slotFindPrev();
01470 void slotFindAheadText();
01471 void slotFindAheadLink();
01472
01473 void slotIncZoom();
01474 void slotDecZoom();
01475 void slotIncZoomFast();
01476 void slotDecZoomFast();
01477
01478 void slotIncFontSize();
01479 void slotDecFontSize();
01480 void slotIncFontSizeFast();
01481 void slotDecFontSizeFast();
01482
01483 void slotLoadImages();
01484 void slotWalletClosed();
01485 void launchWalletManager();
01486 void walletMenu();
01487 void delNonPasswordStorableSite();
01488 void removeStoredPasswordForm(QAction* action);
01489 void addWalletFormKey(const QString& walletFormKey);
01490
01494 void submitFormAgain();
01495
01499 void updateActions();
01503 void slotPartRemoved( KParts::Part *part );
01507 void slotActiveFrameChanged( KParts::Part *part );
01511 void slotChildStarted( KIO::Job *job );
01515 void slotChildCompleted();
01519 void slotChildCompleted( bool );
01523 void slotParentCompleted();
01527 void slotChildURLRequest( const KUrl &url, const KParts::OpenUrlArguments&, const KParts::BrowserArguments &args );
01531 void slotChildDocCreated();
01535 void slotRequestFocus( KParts::ReadOnlyPart * );
01536 void slotLoaderRequestStarted( khtml::DocLoader*, khtml::CachedObject* obj);
01537 void slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *obj );
01538 void checkCompleted();
01539
01543 void slotAutoScroll();
01544
01545 void slotPrintFrame();
01546
01547 void slotSelectAll();
01548
01552 void slotProgressUpdate();
01553
01554
01555
01556
01557 void slotJobPercent( KJob*, unsigned long );
01558
01559
01560
01561
01562 void slotJobDone( KJob* );
01563
01564
01565
01566
01567 void slotUserSheetStatDone( KJob* );
01568
01569
01570
01571
01572 void slotJobSpeed( KJob*, unsigned long );
01573
01577 void slotClearSelection();
01578
01582 void slotZoomView( int );
01583
01587 void slotAutomaticDetectionLanguage(KEncodingDetector::AutoDetectScript scri);
01588
01592 void slotToggleCaretMode();
01593
01597 void suppressedPopupMenu();
01598
01602 void togglePopupPassivePopup();
01603
01607 void showSuppressedPopups();
01608
01612 void launchJSConfigDialog();
01613
01617 void launchJSErrorDialog();
01618
01622 void removeJSErrorExtension();
01623
01627 void disableJSErrorExtension();
01628
01632 void jsErrorDialogContextMenu();
01633
01639 void restoreScrollPosition();
01640
01641 void walletOpened(KWallet::Wallet*);
01642
01643 private:
01644
01645 KJSErrorDlg *jsErrorExtension();
01646
01647 enum StatusBarPriority { BarDefaultText, BarHoverText, BarOverrideText };
01648 void setStatusBarText( const QString& text, StatusBarPriority p);
01649
01650 bool restoreURL( const KUrl &url );
01651 void clearCaretRectIfNeeded();
01652 void setFocusNodeIfNeeded(const DOM::Selection &);
01653 void selectionLayoutChanged();
01654 void notifySelectionChanged(bool closeTyping=true);
01655 void resetFromScript();
01656 void emitSelectionChanged();
01657 void onFirstData();
01658
01659 bool checkFrameAccess(KHTMLPart *callingHtmlPart);
01660 bool openUrlInFrame(const KUrl &url, const KParts::OpenUrlArguments& arguments, const KParts::BrowserArguments &browserArguments);
01661 void startAutoScroll();
01662 void stopAutoScroll();
01663 void overURL( const QString &url, const QString &target, bool shiftPressed = false );
01664 void resetHoverText();
01665
01666 bool processObjectRequest( khtml::ChildFrame *child, const KUrl &url, const QString &mimetype );
01667 KParts::LiveConnectExtension *liveConnectExtension( const DOM::NodeImpl *);
01668
01669 KWallet::Wallet* wallet();
01670
01671 void openWallet(DOM::HTMLFormElementImpl*);
01672 void saveToWallet(const QString& key, const QMap<QString,QString>& data);
01673 void dequeueWallet(DOM::HTMLFormElementImpl*);
01674 void saveLoginInformation(const QString& host, const QString& key, const QMap<QString, QString>& walletMap);
01675
01676 void enableFindAheadActions(bool);
01677
01681 KHTMLViewBar *pTopViewBar() const;
01682
01686 KHTMLViewBar *pBottomViewBar() const;
01687
01691 bool pFindTextNextInThisFrame( bool reverse );
01692
01696
01697
01698
01699
01700
01701
01702
01703 void submitForm( const char *action, const QString &url, const QByteArray &formData,
01704 const QString &target, const QString& contentType = QString(),
01705 const QString& boundary = QString() );
01706
01707 void popupMenu( const QString &url );
01708
01709 void init( KHTMLView *view, GUIProfile prof );
01710
01711
01712 void clear();
01713
01714 QVariant crossFrameExecuteScript(const QString& target, const QString& script);
01715
01716 bool requestFrame( DOM::HTMLPartContainerElementImpl *frame, const QString &url, const QString &frameName,
01717 const QStringList &args = QStringList(), bool isIFrame = false );
01718
01726 QString requestFrameName();
01727
01728 bool requestObject( DOM::HTMLPartContainerElementImpl *frame, const QString &url, const QString &serviceType,
01729 const QStringList &args = QStringList() );
01730
01731 bool requestObject( khtml::ChildFrame *child, const KUrl &url,
01732 const KParts::OpenUrlArguments &args = KParts::OpenUrlArguments(),
01733 const KParts::BrowserArguments& browserArgs = KParts::BrowserArguments() );
01734
01735
01736 void childLoadFailure( khtml::ChildFrame *child );
01737
01738 DOM::EventListener *createHTMLEventListener( QString code, QString name, DOM::NodeImpl *node, bool svg = false );
01739
01740 DOM::HTMLDocumentImpl *docImpl() const;
01741 DOM::DocumentImpl *xmlDocImpl() const;
01742 khtml::ChildFrame *frame( const QObject *obj );
01743
01744 khtml::ChildFrame *recursiveFrameRequest( KHTMLPart *callingHtmlPart, const KUrl &url,
01745 const KParts::OpenUrlArguments& args, const KParts::BrowserArguments &browserArgs,
01746 bool callParent = true );
01747
01748 bool checkLinkSecurity( const KUrl &linkURL,const KLocalizedString &message = KLocalizedString(), const QString &button = QString() );
01749 QVariant executeScript( const QString& filename, int baseLine, const DOM::Node &n, const QString& script );
01750
01751 KJSProxy *jScript();
01752
01753 KHTMLPart *opener();
01754 long cacheId() const;
01755 void setOpener( KHTMLPart *_opener );
01756 bool openedByJS();
01757 void setOpenedByJS( bool _openedByJS );
01758
01759 void checkEmitLoadEvent();
01760 void emitLoadEvent();
01761
01762 bool initFindNode( bool selection, bool reverse, bool fromCursor );
01763
01773 void extendSelectionTo(int x, int y, const DOM::Node &innerNode);
01777 bool isExtendingSelection() const;
01778 KEncodingDetector *createDecoder();
01779 QString defaultEncoding() const;
01780
01782 QString defaultExtension() const;
01783
01787 void zoomIn(const int stepping[], int count);
01791 void zoomOut(const int stepping[], int count);
01792
01793 void incFontSize(const int stepping[], int count);
01794
01795 void decFontSize(const int stepping[], int count);
01796
01797 void emitCaretPositionChanged(const DOM::Position &pos);
01798
01799 void setDebugScript( bool enable );
01800
01801 void runAdFilter();
01802
01803 khtml::EditorContext *editorContext() const;
01804
01809 void initCaret();
01810
01814 const DOM::Selection &caret() const;
01815
01819 const DOM::Selection &dragCaret() const;
01820
01824 void setCaret(const DOM::Selection &, bool closeTyping=true);
01825
01829 void setDragCaret(const DOM::Selection &);
01830
01834 void clearSelection();
01835
01839 void invalidateSelection();
01840
01844 void setSelectionVisible(bool flag=true);
01845
01849 void paintCaret(QPainter *p, const QRect &rect) const;
01850
01854 void paintDragCaret(QPainter *p, const QRect &rect) const;
01855
01863 QString simplifiedSelectedText() const;
01864
01865 bool handleMouseMoveEventDrag(khtml::MouseMoveEvent *event);
01866 bool handleMouseMoveEventOver(khtml::MouseMoveEvent *event);
01867 void handleMouseMoveEventSelection(khtml::MouseMoveEvent *event);
01868
01869 void handleMousePressEventSingleClick(khtml::MousePressEvent *event);
01870 void handleMousePressEventDoubleClick(khtml::MouseDoubleClickEvent *event);
01871 void handleMousePressEventTripleClick(khtml::MouseDoubleClickEvent *event);
01872
01873 KHTMLPartPrivate *d;
01874 friend class KHTMLPartPrivate;
01875 };
01876
01877
01878 #endif