26 #ifndef __khtml_part_h__
27 #define __khtml_part_h__
34 #include <kdemacros.h>
39 #include <QtCore/QRegExp>
54 class HTMLDocumentImpl;
57 class XMLDocumentImpl;
58 class HTMLTitleElementImpl;
59 class HTMLFrameElementImpl;
60 class HTMLIFrameElementImpl;
61 class HTMLObjectElementImpl;
62 class HTMLFormElementImpl;
63 class HTMLAnchorElementImpl;
64 class HTMLMetaElementImpl;
68 class HTMLEventListener;
70 class HTMLPartContainerElementImpl;
71 class HTMLObjectBaseElementImpl;
80 class SVGDocumentExtensions;
94 class MousePressEvent;
95 class MouseDoubleClickEvent;
97 class MouseReleaseEvent;
98 class DrawContentsEvent;
102 class CSSStyleSelector;
105 struct EditorContext;
106 class EditCommandImpl;
107 class KHTMLPartAccessor;
114 class JSEventListener;
115 class JSLazyEventListener;
119 class ScheduledAction;
121 class DOMSelectionProtoFunc;
122 class KHTMLPartScriptable;
128 class ScriptableExtension;
210 friend class DOM::HTMLTitleElementImpl;
211 friend class DOM::HTMLFrameElementImpl;
212 friend class DOM::HTMLIFrameElementImpl;
213 friend class DOM::HTMLObjectBaseElementImpl;
214 friend class DOM::HTMLObjectElementImpl;
215 friend class DOM::HTMLAnchorElementImpl;
216 friend class DOM::HTMLMetaElementImpl;
217 friend class DOM::NodeImpl;
218 friend class DOM::ElementImpl;
220 friend class DOM::HTMLFormElementImpl;
221 friend class KJS::Window;
222 friend class KJS::ScheduledAction;
223 friend class KJS::JSNodeFilter;
224 friend class KJS::WindowFunc;
225 friend class KJS::ExternalFunc;
226 friend class KJS::JSEventListener;
227 friend class KJS::JSLazyEventListener;
228 friend class KJS::DOMDocument;
229 friend class KJS::HTMLElement;
230 friend class KJS::SourceFile;
231 friend class KJS::DOMSelection;
232 friend class KJS::DOMSelectionProtoFunc;
233 friend class KJS::KHTMLPartScriptable;
234 friend class KJSProxy;
236 friend class DOM::DocumentImpl;
237 friend class DOM::HTMLDocumentImpl;
238 friend class DOM::Selection;
241 friend class khtml::HTMLTokenizer;
242 friend class khtml::XMLTokenizer;
243 friend class khtml::RenderWidget;
244 friend class khtml::RenderBlock;
245 friend class khtml::CSSStyleSelector;
247 friend class khtml::KHTMLPartAccessor;
249 friend class KHTMLPartFunction;
253 friend class WebCore::SVGDocumentExtensions;
255 Q_PROPERTY(
bool javaScriptEnabled READ jScriptEnabled WRITE setJScriptEnabled )
256 Q_PROPERTY(
bool javaEnabled READ javaEnabled WRITE setJavaEnabled )
257 Q_PROPERTY(
bool dndEnabled READ dndEnabled WRITE setDNDEnabled )
258 Q_PROPERTY(
bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled )
259 Q_PROPERTY(
DNSPrefetch dnsPrefetch READ dnsPrefetch WRITE setDNSPrefetch )
266 Q_PROPERTY(
bool modified READ isModified )
267 Q_PROPERTY(
QString encoding READ encoding WRITE setEncoding )
268 Q_PROPERTY(
QString lastModified READ lastModified )
269 Q_PROPERTY(
bool metaRefreshEnabled READ metaRefreshEnabled WRITE setMetaRefreshEnabled )
282 DNSPrefetchDisabled=0,
284 DNSPrefetchOnlyWWWAndSLD
300 QObject *parent = 0, GUIProfile prof = DefaultGUI );
344 virtual void showError(
KJob* job );
359 QString documentSource()
const;
383 void setJScriptEnabled(
bool enable );
389 bool jScriptEnabled()
const;
408 KJS::Interpreter *jScriptInterpreter();
421 void setStatusMessagesEnabled(
bool enable );
426 bool statusMessagesEnabled()
const;
431 void setMetaRefreshEnabled(
bool enable );
436 bool metaRefreshEnabled()
const;
448 void setDNDEnabled(
bool b );
453 bool dndEnabled()
const;
461 void setJavaEnabled(
bool enable );
466 bool javaEnabled()
const;
471 void setPluginsEnabled(
bool enable );
476 bool pluginsEnabled()
const;
484 void setAutoloadImages(
bool enable );
491 bool autoloadImages()
const;
509 void setOnlyLocalReferences(
bool enable );
520 void setForcePermitLocalImages(
bool enable );
534 void setDNSPrefetch( DNSPrefetch pmode );
544 DNSPrefetch dnsPrefetch()
const;
550 bool onlyLocalReferences()
const;
558 bool forcePermitLocalImages()
const;
562 bool isCaretMode()
const;
567 bool isEditable()
const;
581 void setCaretPosition(
DOM::Node node,
long offset,
bool extendSelection =
false);
595 CaretDisplayPolicy caretDisplayPolicyNonFocused()
const;
606 void setCaretDisplayPolicyNonFocused(CaretDisplayPolicy policy);
608 #ifndef KDE_NO_COMPAT
609 KUrl baseURL()
const;
615 KUrl backgroundURL()
const;
620 void scheduleRedirection(
int delay,
const QString &url,
bool lockHistory =
true );
644 virtual void begin(
const KUrl &url =
KUrl(),
int xOffset = 0,
int yOffset = 0 );
666 virtual void write(
const char *str,
int len = -1 );
680 virtual void write(
const QString &str );
697 void paint( QPainter *,
const QRect &,
int = 0,
bool * = 0 );
705 bool setEncoding(
const QString &name,
bool override =
false );
723 void setUserStyleSheet(
const KUrl &url );
734 void setUserStyleSheet(
const QString &styleSheet );
743 void setStandardFont(
const QString &name );
751 void setFixedFont(
const QString &name );
760 bool gotoAnchor(
const QString &name );
777 void setURLCursor(
const QCursor &c );
807 void findText(
const QString &str,
long options,
QWidget *parent = 0,
813 void findTextBegin();
820 bool findTextNext(
bool reverse =
false );
831 void setZoomFactor(
int percent);
836 int zoomFactor()
const;
847 void setFontScaleFactor(
int percent);
852 int fontScaleFactor()
const;
857 virtual QString selectedText()
const;
865 QString selectedTextAsHTML()
const;
882 void selection(
DOM::Node &startNode,
long &startOffset,
883 DOM::Node &endNode,
long &endOffset)
const;
898 bool hasSelection()
const;
938 virtual void saveState( QDataStream &stream );
948 virtual void restoreState( QDataStream &stream );
965 DOM::Node nonSharedNodeUnderMouse()
const;
1017 bool frameExists(
const QString &frameName );
1033 void setJSStatusBarText(
const QString &text );
1040 void setJSDefaultStatusBarText(
const QString &text );
1047 QString jsStatusBarText()
const;
1054 QString jsDefaultStatusBarText()
const;
1074 void preloadStyleSheet(
const QString &url,
const QString &stylesheet );
1086 bool isPointInsideSelection(
int x,
int y);
1091 bool restored()
const;
1103 void setAlwaysHonourDoctype(
bool b =
true );
1112 void setFormNotification(FormNotification fn);
1119 FormNotification formNotification()
const;
1134 bool isModified()
const;
1139 void setSuppressedPopupIndicator(
bool enable,
KHTMLPart *originPart = 0 );
1144 bool inProgress()
const;
1150 void onURL(
const QString &url );
1162 void selectionChanged();
1171 void nodeActivated(
const DOM::Node & );
1187 void caretPositionChanged(
const DOM::Node &node,
long offset);
1195 void formSubmitNotification(
const char *action,
const QString& url,
1196 const QByteArray& formData,
const QString& target,
1202 void configurationChanged();
1219 void htmlError(
int errorCode,
const QString& text,
const KUrl& reqUrl );
1254 virtual bool urlSelected(
const QString &url,
int button,
int state,
1274 bool pluginPageQuestionAsked(
const QString& mimetype )
const;
1275 void setPluginPageQuestionAsked(
const QString& mimetype );
1278 void setPageSecurity( PageSecurity sec );
1283 virtual bool doOpenStream(
const QString& mimeType );
1288 virtual bool doWriteStream(
const QByteArray& data );
1293 virtual bool doCloseStream();
1298 virtual void timerEvent(QTimerEvent *);
1306 bool mayPrefetchHostname(
const QString& name );
1311 void updateZoomFactor();
1324 void setActiveNode(
const DOM::Node &node );
1329 void stopAnimations();
1349 void setCaretMode(
bool enable);
1361 void setEditable(
bool enable);
1378 void setCaretVisible(
bool show);
1383 void submitFormProxy(
const char *action,
const QString &url,
1384 const QByteArray &formData,
1396 virtual void slotFinished(
KJob* );
1411 void reparseConfiguration();
1416 void slotData(
KIO::Job*,
const QByteArray &data );
1420 void slotInfoMessage(
KJob*,
const QString& msg );
1424 void slotRestoreData(
const QByteArray &data );
1428 void slotFinishedParsing();
1432 void slotRedirect();
1440 void slotDebugScript();
1444 void slotDebugDOMTree();
1448 void slotDebugRenderTree();
1450 void slotDebugFrameTree();
1455 void slotStopAnimations();
1459 virtual void slotViewDocumentSource();
1463 virtual void slotViewFrameSource();
1467 void slotViewPageInfo();
1471 virtual void slotSaveBackground();
1475 virtual void slotSaveDocument();
1479 virtual void slotSaveFrame();
1483 virtual void slotSecurity();
1487 virtual void slotSetEncoding(
const QString &);
1492 virtual void slotUseStylesheet();
1494 virtual void slotFind();
1495 virtual void slotFindDone();
1496 virtual void slotFindDialogDestroyed();
1497 void slotFindNext();
1498 void slotFindPrev();
1499 void slotFindAheadText();
1500 void slotFindAheadLink();
1504 void slotIncZoomFast();
1505 void slotDecZoomFast();
1507 void slotIncFontSize();
1508 void slotDecFontSize();
1509 void slotIncFontSizeFast();
1510 void slotDecFontSizeFast();
1512 void slotLoadImages();
1513 void slotWalletClosed();
1514 void launchWalletManager();
1516 void delNonPasswordStorableSite();
1517 void removeStoredPasswordForm(
QAction* action);
1518 void addWalletFormKey(
const QString& walletFormKey);
1523 void submitFormAgain();
1528 void updateActions();
1540 void slotChildStarted(
KIO::Job *job );
1544 void slotChildCompleted();
1548 void slotChildCompleted(
bool );
1552 void slotParentCompleted();
1560 void slotChildDocCreated();
1565 void slotLoaderRequestStarted( khtml::DocLoader*, khtml::CachedObject* obj);
1566 void slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *obj );
1567 void checkCompleted();
1572 void slotAutoScroll();
1574 void slotPrintFrame();
1576 void slotSelectAll();
1581 void slotProgressUpdate();
1586 void slotJobPercent(
KJob*,
unsigned long );
1591 void slotJobDone(
KJob* );
1596 void slotUserSheetStatDone(
KJob* );
1601 void slotJobSpeed(
KJob*,
unsigned long );
1606 void slotClearSelection();
1611 void slotZoomView(
int );
1621 void slotToggleCaretMode();
1626 void suppressedPopupMenu();
1631 void togglePopupPassivePopup();
1636 void showSuppressedPopups();
1641 void launchJSConfigDialog();
1646 void launchJSErrorDialog();
1651 void removeJSErrorExtension();
1656 void disableJSErrorExtension();
1661 void jsErrorDialogContextMenu();
1668 void restoreScrollPosition();
1676 enum StatusBarPriority { BarDefaultText, BarHoverText, BarOverrideText };
1679 bool restoreURL(
const KUrl &url );
1680 void clearCaretRectIfNeeded();
1681 void setFocusNodeIfNeeded(
const DOM::Selection &);
1682 void selectionLayoutChanged();
1683 void notifySelectionChanged(
bool closeTyping=
true);
1684 void resetFromScript();
1685 void emitSelectionChanged();
1688 bool checkFrameAccess(
KHTMLPart *callingHtmlPart);
1690 void startAutoScroll();
1691 void stopAutoScroll();
1692 void overURL(
const QString &url,
const QString &target,
bool shiftPressed =
false );
1693 void resetHoverText();
1699 void openWallet(DOM::HTMLFormElementImpl*);
1701 void dequeueWallet(DOM::HTMLFormElementImpl*);
1704 void enableFindAheadActions(
bool);
1719 bool pFindTextNextInThisFrame(
bool reverse );
1731 void submitForm(
const char *action,
const QString &url,
const QByteArray &formData,
1735 void popupMenu(
const QString &url );
1754 void loadFrameElement( DOM::HTMLPartContainerElementImpl *frame,
const QString &url,
const QString &frameName,
1759 bool loadObjectElement( DOM::HTMLPartContainerElementImpl *frame,
const QString &url,
const QString &serviceType,
1798 DOM::HTMLDocumentImpl *docImpl()
const;
1799 DOM::DocumentImpl *xmlDocImpl()
const;
1804 bool callParent =
true );
1809 KJSProxy *jScript();
1812 long cacheId()
const;
1815 void setOpenedByJS(
bool _openedByJS );
1817 void checkEmitLoadEvent();
1818 void emitLoadEvent();
1820 bool initFindNode(
bool selection,
bool reverse,
bool fromCursor );
1831 void extendSelectionTo(
int x,
int y,
const DOM::Node &innerNode);
1835 bool isExtendingSelection()
const;
1837 QString defaultEncoding()
const;
1840 QString defaultExtension()
const;
1845 void zoomIn(
const int stepping[],
int count);
1849 void zoomOut(
const int stepping[],
int count);
1851 void incFontSize(
const int stepping[],
int count);
1853 void decFontSize(
const int stepping[],
int count);
1855 void emitCaretPositionChanged(
const DOM::Position &pos);
1857 void setDebugScript(
bool enable );
1872 const DOM::Selection &caret()
const;
1877 const DOM::Selection &dragCaret()
const;
1882 void setCaret(
const DOM::Selection &,
bool closeTyping=
true);
1887 void setDragCaret(
const DOM::Selection &);
1892 void clearSelection();
1897 void invalidateSelection();
1902 void setSelectionVisible(
bool flag=
true);
1907 void paintCaret(QPainter *p,
const QRect &rect)
const;
1912 void paintDragCaret(QPainter *p,
const QRect &rect)
const;
1921 QString simplifiedSelectedText()
const;
Settings for the HTML view.
Contextual information about the caret and the built-in editor.
D-BUS interface for KHTML.
The Node interface is the primary datatype for the entire Document Object Model.
This class resembles the editing API when the associated khtml document is editable (in design mode)...
An HTMLDocument is the root of the HTML hierarchy and holds the entire content.
KAction * zoomOut(const QObject *recvr, const char *slot, QObject *parent)
This class is khtml's main class.
BrowserExtension * browserExtension() const
Renders and displays HTML in a QScrollArea.
This class implements the find activity for the KHTMLPart.
virtual void customEvent(QEvent *event)
void setStatusBarText(const QString &text)
virtual void startingJob(KIO::Job *)
Hook for adding code before a job is started.
KAction * clear(const QObject *recvr, const char *slot, QObject *parent)
The Document interface represents the entire HTML or XML document.
FindOptions
Extra Find options that can be used when calling the extended findText().
Introduced in DOM Level 2.
KAction * zoomIn(const QObject *recvr, const char *slot, QObject *parent)
This is the BrowserExtension for a KHTMLPart document.
virtual bool openUrl(const KUrl &url)
KAction * selectAll(const QObject *recvr, const char *slot, QObject *parent)
KHTMLPartPrivate * impl()
CaretDisplayPolicy
Enumeration for displaying the caret.
virtual void guiActivateEvent(GUIActivateEvent *event)
const KShortcut & begin()
DNSPrefetch
DNS Prefetching Mode enumeration.