• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • khtml
khtml_part.h
Go to the documentation of this file.
1// -*- c-basic-offset: 2 -*-
2/* This file is part of the KDE project
3 *
4 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
5 * 1999-2001 Lars Knoll <knoll@kde.org>
6 * 1999-2001 Antti Koivisto <koivisto@kde.org>
7 * 2000-2001 Simon Hausmann <hausmann@kde.org>
8 * 2000-2001 Dirk Mueller <mueller@kde.org>
9 * 2000 Stefan Schimanski <1Stein@gmx.de>
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
20 *
21 * You should have received a copy of the GNU Library General Public License
22 * along with this library; see the file COPYING.LIB. If not, write to
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
25 */
26#ifndef __khtml_part_h__
27#define __khtml_part_h__
28
29#include "dom/dom_doc.h"
30#include "dom/dom2_range.h"
31
32#include <kparts/part.h>
33#include <kparts/browserextension.h>
34#include <kdemacros.h>
35#include <kfind.h>
36#include <kfinddialog.h>
37#include <klocalizedstring.h>
38#include <kencodingdetector.h>
39#include <QtCore/QRegExp>
40
41class KHTMLPartPrivate;
42class KHTMLPartBrowserExtension;
43class KJSProxy;
44class KHTMLView;
45class KHTMLViewBar;
46class KHTMLFindBar;
47class KHTMLSettings;
48class KJavaAppletContext;
49class KJSErrorDlg;
50
51namespace DOM
52{
53 class HTMLDocument;
54 class HTMLDocumentImpl;
55 class DocumentImpl;
56 class Document;
57 class XMLDocumentImpl;
58 class HTMLTitleElementImpl;
59 class HTMLFrameElementImpl;
60 class HTMLIFrameElementImpl;
61 class HTMLObjectElementImpl;
62 class HTMLFormElementImpl;
63 class HTMLAnchorElementImpl;
64 class HTMLMetaElementImpl;
65 class NodeImpl;
66 class ElementImpl;
67 class Node;
68 class HTMLEventListener;
69 class EventListener;
70 class HTMLPartContainerElementImpl;
71 class HTMLObjectBaseElementImpl;
72 class Position;
73 class Selection;
74 class Range;
75 class Editor;
76}
77
78namespace WebCore
79{
80 class SVGDocumentExtensions;
81}
82
83namespace KJS
84{
85 class Interpreter;
86 class HTMLElement;
87}
88
89namespace khtml
90{
91 class DocLoader;
92 class RenderPart;
93 class ChildFrame;
94 class MousePressEvent;
95 class MouseDoubleClickEvent;
96 class MouseMoveEvent;
97 class MouseReleaseEvent;
98 class DrawContentsEvent;
99 class CachedObject;
100 class RenderWidget;
101 class RenderBlock;
102 class CSSStyleSelector;
103 class HTMLTokenizer;
104 class XMLTokenizer;
105 struct EditorContext;
106 class EditCommandImpl;
107 class KHTMLPartAccessor;
108}
109
110namespace KJS {
111 class Window;
112 class WindowFunc;
113 class ExternalFunc;
114 class JSEventListener;
115 class JSLazyEventListener;
116 class JSNodeFilter;
117 class DOMDocument;
118 class SourceFile;
119 class ScheduledAction;
120 class DOMSelection;
121 class DOMSelectionProtoFunc;
122 class KHTMLPartScriptable;
123}
124
125namespace KParts
126{
127 class PartManager;
128 class ScriptableExtension;
129}
130
131namespace KWallet
132{
133 class Wallet;
134}
135
206class KHTML_EXPORT KHTMLPart : public KParts::ReadOnlyPart
207{
208 Q_OBJECT
209 friend class KHTMLView;
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;
219 friend class KHTMLRun;
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;
235 friend class KHTMLPartBrowserExtension;
236 friend class DOM::DocumentImpl;
237 friend class DOM::HTMLDocumentImpl;
238 friend class DOM::Selection;
239 friend class DOM::Editor;
240 friend class KHTMLPartBrowserHostExtension;
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;
246 friend class khtml::EditCommandImpl;
247 friend class khtml::KHTMLPartAccessor;
248 friend class KHTMLPartIface;
249 friend class KHTMLPartFunction;
250 friend class KHTMLPopupGUIClient;
251 friend class KHTMLFind;
252 friend class StorePass;
253 friend class WebCore::SVGDocumentExtensions;
254
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 )
260
261 /*
262 *
263 * Don't add setOnlyLocalReferences here. It shouldn't be accessible via DBus.
264 *
265 **/
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 )
270
271public:
272 enum GUIProfile { DefaultGUI, BrowserViewGUI /* ... */ };
273
281 enum DNSPrefetch {
282 DNSPrefetchDisabled=0,
283 DNSPrefetchEnabled,
284 DNSPrefetchOnlyWWWAndSLD
285 };
286
299 KHTMLPart( QWidget *parentWidget = 0,
300 QObject *parent = 0, GUIProfile prof = DefaultGUI );
319 KHTMLPart( KHTMLView *view, QObject *parent = 0, GUIProfile prof = DefaultGUI );
320
324 virtual ~KHTMLPart();
325
331 virtual bool openUrl( const KUrl &url );
332
336 virtual bool closeUrl();
337
344 virtual void showError( KJob* job );
345
349 DOM::HTMLDocument htmlDocument() const;
350
354 DOM::Document document() const;
355
359 QString documentSource() const;
360
364 DOM::Node activeNode() const;
365
369 KParts::BrowserExtension *browserExtension() const;
370 KParts::BrowserHostExtension *browserHostExtension() const;
371
375 KHTMLView *view() const;
376
383 void setJScriptEnabled( bool enable );
384
389 bool jScriptEnabled() const;
390
408 KJS::Interpreter *jScriptInterpreter();
409
421 void setStatusMessagesEnabled( bool enable );
422
426 bool statusMessagesEnabled() const;
427
431 void setMetaRefreshEnabled( bool enable );
432
436 bool metaRefreshEnabled() const;
437
442 QVariant executeScript( const DOM::Node &n, const QString &script );
443
448 void setDNDEnabled( bool b );
449
453 bool dndEnabled() const;
454
461 void setJavaEnabled( bool enable );
462
466 bool javaEnabled() const;
467
471 void setPluginsEnabled( bool enable );
472
476 bool pluginsEnabled() const;
477
484 void setAutoloadImages( bool enable );
491 bool autoloadImages() const;
492
509 void setOnlyLocalReferences( bool enable );
510
520 void setForcePermitLocalImages( bool enable );
521
534 void setDNSPrefetch( DNSPrefetch pmode );
535
544 DNSPrefetch dnsPrefetch() const;
545
550 bool onlyLocalReferences() const;
551
558 bool forcePermitLocalImages() const;
559
562 bool isCaretMode() const;
563
567 bool isEditable() const;
568
581 void setCaretPosition(DOM::Node node, long offset, bool extendSelection = false);
582
586 enum CaretDisplayPolicy {
587 CaretVisible,
588 CaretInvisible,
589 CaretBlink
590 };
591
595 CaretDisplayPolicy caretDisplayPolicyNonFocused() const;
596
606 void setCaretDisplayPolicyNonFocused(CaretDisplayPolicy policy);
607
608#ifndef KDE_NO_COMPAT
609 KUrl baseURL() const;
610#endif
611
615 KUrl backgroundURL() const;
616
620 void scheduleRedirection( int delay, const QString &url, bool lockHistory = true );
621
644 virtual void begin( const KUrl &url = KUrl(), int xOffset = 0, int yOffset = 0 );
645
666 virtual void write( const char *str, int len = -1 );
667
679 // FIXME KDE5: always honour doctype, remove setAlwaysHonourDoctype()
680 virtual void write( const QString &str );
681
685 virtual void end();
686
687 /*
688 * Prints the current HTML page laid out for the printer.
689 *
690 * (not implemented at the moment)
691 */
692 // void print(QPainter *, int pageHeight, int pageWidth);
693
697 void paint( QPainter *, const QRect &, int = 0, bool * = 0 );
698
705 bool setEncoding( const QString &name, bool override = false );
706
712 QString encoding() const;
713
723 void setUserStyleSheet( const KUrl &url );
724
734 void setUserStyleSheet( const QString &styleSheet );
735
736public:
737
743 void setStandardFont( const QString &name );
744
751 void setFixedFont( const QString &name );
752
760 bool gotoAnchor( const QString &name );
761
767 bool nextAnchor();
768
772 bool prevAnchor();
773
777 void setURLCursor( const QCursor &c );
778
782 QCursor urlCursor() const;
783
787 enum FindOptions
788 {
789 FindLinksOnly = 1 * KFind::MinimumUserOption,
790 FindNoPopups = 2 * KFind::MinimumUserOption
791 //FindIncremental = 4 * KFind::MinimumUserOption
792 };
793
798 void findText();
799
807 void findText( const QString &str, long options, QWidget *parent = 0,
808 KFindDialog *findDialog = 0 );
809
813 void findTextBegin();
814
820 bool findTextNext( bool reverse = false );
821
831 void setZoomFactor(int percent);
832
836 int zoomFactor() const;
837
847 void setFontScaleFactor(int percent);
848
852 int fontScaleFactor() const;
853
857 virtual QString selectedText() const;
858
865 QString selectedTextAsHTML() const;
866
870 DOM::Range selection() const;
871
882 void selection(DOM::Node &startNode, long &startOffset,
883 DOM::Node &endNode, long &endOffset) const;
884
888 void setSelection( const DOM::Range & );
889
898 bool hasSelection() const;
899
904 DOM::Editor *editor() const;
905
909 void selectAll();
910
916 void show();
917
923 void hide();
924
929 KParts::PartManager *partManager();
930
938 virtual void saveState( QDataStream &stream );
948 virtual void restoreState( QDataStream &stream );
949
956 DOM::Node nodeUnderMouse() const;
957
965 DOM::Node nonSharedNodeUnderMouse() const;
966
970 const KHTMLSettings *settings() const;
971
978 // ### KDE5 make const
979 KHTMLPart *parentPart();
980
986 QStringList frameNames() const;
987
988 QList<KParts::ReadOnlyPart*> frames() const;
989
993 KHTMLPart *findFrame( const QString &f );
994
1002 KHTMLPart *findFrameParent( KParts::ReadOnlyPart *callingPart, const QString &f, khtml::ChildFrame **childFrame=0 );
1003
1009 KParts::ReadOnlyPart *currentFrame() const;
1010
1017 bool frameExists( const QString &frameName );
1018
1022 KJSProxy *framejScript(KParts::ReadOnlyPart *framePart);
1023
1027 KParts::ReadOnlyPart *findFramePart( const QString &f );
1033 void setJSStatusBarText( const QString &text );
1034
1040 void setJSDefaultStatusBarText( const QString &text );
1041
1047 QString jsStatusBarText() const;
1048
1054 QString jsDefaultStatusBarText() const;
1055
1059 QString referrer() const;
1060
1064 QString pageReferrer() const;
1065
1069 QString lastModified() const;
1070
1074 void preloadStyleSheet( const QString &url, const QString &stylesheet );
1075
1079 void preloadScript( const QString &url, const QString &script );
1080
1086 bool isPointInsideSelection(int x, int y);
1087
1091 bool restored() const;
1092
1102 // ### KDE5 remove - fix write( const QString &str ) instead
1103 void setAlwaysHonourDoctype( bool b = true );
1104
1105 // ### KDE5 remove me
1106 enum FormNotification { NoNotification = 0, Before, Only, Unused=255 };
1112 void setFormNotification(FormNotification fn);
1113
1119 FormNotification formNotification() const;
1120
1127 KUrl toplevelURL();
1128
1134 bool isModified() const;
1135
1139 void setSuppressedPopupIndicator( bool enable, KHTMLPart *originPart = 0 );
1140
1144 bool inProgress() const;
1145
1146Q_SIGNALS:
1150 void onURL( const QString &url );
1151
1157 void popupMenu( const QString &url, const QPoint &point );
1158
1162 void selectionChanged();
1163
1171 void nodeActivated( const DOM::Node & );
1172
1175 void docCreated();
1176
1187 void caretPositionChanged(const DOM::Node &node, long offset);
1188
1189
1195 void formSubmitNotification(const char *action, const QString& url,
1196 const QByteArray& formData, const QString& target,
1197 const QString& contentType, const QString& boundary);
1198
1202 void configurationChanged();
1203
1204
1205protected:
1206
1211 KUrl completeURL( const QString &url );
1212
1219 void htmlError( int errorCode, const QString& text, const KUrl& reqUrl );
1220
1221 virtual void customEvent( QEvent *event );
1222
1226 virtual void khtmlMousePressEvent( khtml::MousePressEvent *event );
1230 virtual void khtmlMouseDoubleClickEvent( khtml::MouseDoubleClickEvent * );
1234 virtual void khtmlMouseMoveEvent( khtml::MouseMoveEvent *event );
1238 virtual void khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event );
1242 virtual void khtmlDrawContentsEvent( khtml::DrawContentsEvent * );
1243
1247 virtual void guiActivateEvent( KParts::GUIActivateEvent *event );
1248
1252 virtual bool openFile();
1253
1254 virtual bool urlSelected( const QString &url, int button, int state,
1255 const QString &_target,
1256 const KParts::OpenUrlArguments& args = KParts::OpenUrlArguments(),
1257 const KParts::BrowserArguments& browserArgs = KParts::BrowserArguments() );
1258
1267 virtual KParts::ReadOnlyPart *createPart( QWidget *parentWidget,
1268 QObject *parent,
1269 const QString &mimetype, QString &serviceName,
1270 QStringList &serviceTypes, const QStringList &params);
1271
1272 // This is for RenderPartObject. We want to ask the 'download plugin?'
1273 // question only once per mimetype
1274 bool pluginPageQuestionAsked( const QString& mimetype ) const;
1275 void setPluginPageQuestionAsked( const QString& mimetype );
1276
1277 enum PageSecurity { NotCrypted, Encrypted, Mixed };
1278 void setPageSecurity( PageSecurity sec );
1279
1283 virtual bool doOpenStream( const QString& mimeType );
1284
1288 virtual bool doWriteStream( const QByteArray& data );
1289
1293 virtual bool doCloseStream();
1294
1298 virtual void timerEvent(QTimerEvent *);
1299
1306 bool mayPrefetchHostname( const QString& name );
1307
1311 void updateZoomFactor();
1312
1313public Q_SLOTS:
1314
1324 void setActiveNode( const DOM::Node &node );
1325
1329 void stopAnimations();
1330
1338 QVariant executeScript( const QString &script );
1339
1349 void setCaretMode(bool enable);
1350
1361 void setEditable(bool enable);
1362
1378 void setCaretVisible(bool show);
1379
1380 // ### KDE4 FIXME:
1381 // Remove this and make the one below protected+virtual slot.
1382 // Warning: this is effectively "internal". Be careful.
1383 void submitFormProxy( const char *action, const QString &url,
1384 const QByteArray &formData,
1385 const QString &target,
1386 const QString& contentType = QString(),
1387 const QString& boundary = QString() );
1388
1389protected Q_SLOTS:
1390
1396 virtual void slotFinished( KJob* );
1397
1398protected:
1404 virtual void startingJob( KIO::Job * ) {}
1405
1406private Q_SLOTS:
1407
1411 void reparseConfiguration();
1412
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();
1436 void slotRedirection( KIO::Job*, const KUrl& );
1440 void slotDebugScript();
1444 void slotDebugDOMTree();
1448 void slotDebugRenderTree();
1449
1450 void slotDebugFrameTree();
1451
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 &);
1488
1492 virtual void slotUseStylesheet();
1493
1494 virtual void slotFind();
1495 virtual void slotFindDone(); // ### remove me
1496 virtual void slotFindDialogDestroyed(); // ### remove me
1497 void slotFindNext();
1498 void slotFindPrev();
1499 void slotFindAheadText();
1500 void slotFindAheadLink();
1501
1502 void slotIncZoom();
1503 void slotDecZoom();
1504 void slotIncZoomFast();
1505 void slotDecZoomFast();
1506
1507 void slotIncFontSize();
1508 void slotDecFontSize();
1509 void slotIncFontSizeFast();
1510 void slotDecFontSizeFast();
1511
1512 void slotLoadImages();
1513 void slotWalletClosed();
1514 void launchWalletManager();
1515 void walletMenu();
1516 void delNonPasswordStorableSite();
1517 void removeStoredPasswordForm(QAction* action);
1518 void addWalletFormKey(const QString& walletFormKey);
1519
1523 void submitFormAgain();
1524
1528 void updateActions();
1532 void slotPartRemoved( KParts::Part *part );
1536 void slotActiveFrameChanged( KParts::Part *part );
1540 void slotChildStarted( KIO::Job *job );
1544 void slotChildCompleted();
1548 void slotChildCompleted( bool );
1552 void slotParentCompleted();
1556 void slotChildURLRequest( const KUrl &url, const KParts::OpenUrlArguments&, const KParts::BrowserArguments &args );
1560 void slotChildDocCreated();
1564 void slotRequestFocus( KParts::ReadOnlyPart * );
1565 void slotLoaderRequestStarted( khtml::DocLoader*, khtml::CachedObject* obj);
1566 void slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *obj );
1567 void checkCompleted();
1568
1572 void slotAutoScroll();
1573
1574 void slotPrintFrame();
1575
1576 void slotSelectAll();
1577
1581 void slotProgressUpdate();
1582
1583 /*
1584 * @internal
1585 */
1586 void slotJobPercent( KJob*, unsigned long );
1587
1588 /*
1589 * @internal
1590 */
1591 void slotJobDone( KJob* );
1592
1593 /*
1594 * @internal
1595 */
1596 void slotUserSheetStatDone( KJob* );
1597
1598 /*
1599 * @internal
1600 */
1601 void slotJobSpeed( KJob*, unsigned long );
1602
1606 void slotClearSelection();
1607
1611 void slotZoomView( int );
1612
1616 void slotAutomaticDetectionLanguage(KEncodingDetector::AutoDetectScript scri);
1617
1621 void slotToggleCaretMode();
1622
1626 void suppressedPopupMenu();
1627
1631 void togglePopupPassivePopup();
1632
1636 void showSuppressedPopups();
1637
1641 void launchJSConfigDialog();
1642
1646 void launchJSErrorDialog();
1647
1651 void removeJSErrorExtension();
1652
1656 void disableJSErrorExtension();
1657
1661 void jsErrorDialogContextMenu();
1662
1668 void restoreScrollPosition();
1669
1670 void walletOpened(KWallet::Wallet*);
1671
1672private:
1673
1674 KJSErrorDlg *jsErrorExtension();
1675
1676 enum StatusBarPriority { BarDefaultText, BarHoverText, BarOverrideText };
1677 void setStatusBarText( const QString& text, StatusBarPriority p);
1678
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();
1686 void onFirstData();
1687 // Returns whether callingHtmlPart may access this part
1688 bool checkFrameAccess(KHTMLPart *callingHtmlPart);
1689 bool openUrlInFrame(const KUrl &url, const KParts::OpenUrlArguments& arguments, const KParts::BrowserArguments &browserArguments);
1690 void startAutoScroll();
1691 void stopAutoScroll();
1692 void overURL( const QString &url, const QString &target, bool shiftPressed = false );
1693 void resetHoverText(); // Undo overURL and reset HoverText
1694
1695 KParts::ScriptableExtension *scriptableExtension( const DOM::NodeImpl *);
1696
1697 KWallet::Wallet* wallet();
1698
1699 void openWallet(DOM::HTMLFormElementImpl*);
1700 void saveToWallet(const QString& key, const QMap<QString,QString>& data);
1701 void dequeueWallet(DOM::HTMLFormElementImpl*);
1702 void saveLoginInformation(const QString& host, const QString& key, const QMap<QString, QString>& walletMap);
1703
1704 void enableFindAheadActions(bool);
1705
1709 KHTMLViewBar *pTopViewBar() const;
1710
1714 KHTMLViewBar *pBottomViewBar() const;
1715
1719 bool pFindTextNextInThisFrame( bool reverse );
1720
1724 // ### KDE4 FIXME:
1725 // It is desirable to be able to filter form submissions as well.
1726 // For instance, forms can have a target and an inheriting class
1727 // might want to filter based on the target. Make this protected
1728 // and virtual, or provide a better solution.
1729 // See the web_module for the sidebar for an example where this is
1730 // necessary.
1731 void submitForm( const char *action, const QString &url, const QByteArray &formData,
1732 const QString &target, const QString& contentType = QString(),
1733 const QString& boundary = QString() );
1734
1735 void popupMenu( const QString &url );
1736
1737 void init( KHTMLView *view, GUIProfile prof );
1738
1739
1740 void clear();
1741
1742 QVariant crossFrameExecuteScript(const QString& target, const QString& script);
1743
1751 QString requestFrameName();
1752
1753 // Requests loading of a frame or iframe element
1754 void loadFrameElement( DOM::HTMLPartContainerElementImpl *frame, const QString &url, const QString &frameName,
1755 const QStringList &args = QStringList(), bool isIFrame = false );
1756
1757 // Requests loading of an object or embed element. Returns true if
1758 // loading succeeded.
1759 bool loadObjectElement( DOM::HTMLPartContainerElementImpl *frame, const QString &url, const QString &serviceType,
1760 const QStringList &args = QStringList() );
1761
1762 // Tries an open a URL in given ChildFrame with all known navigation information
1763 // like mimetype and the like in the KParts arguments.
1764 //
1765 // Returns true if it's done -- which excludes the case when it's still resolving
1766 // the mimetype.
1767 // ### refine comment wrt to error case
1768 bool requestObject( khtml::ChildFrame *child, const KUrl &url,
1769 const KParts::OpenUrlArguments &args = KParts::OpenUrlArguments(),
1770 const KParts::BrowserArguments& browserArgs = KParts::BrowserArguments() );
1771
1772 // This method does the loading inside a ChildFrame once we know what mimetype to
1773 // load it as
1774 bool processObjectRequest( khtml::ChildFrame *child, const KUrl &url, const QString &mimetype );
1775
1776 // helper for reporting ChildFrame load failure
1777 void childLoadFailure( khtml::ChildFrame *child );
1778
1779 // Updates the ChildFrame to use the particular part, hooking up the various
1780 // signals, connections, etc.
1781 void connectToChildPart( khtml::ChildFrame *child, KParts::ReadOnlyPart *part,
1782 const QString &mimetype );
1783
1784 // Low-level navigation of the part itself --- this doesn't ask the user
1785 // to save things or such, and assumes that all the ChildFrame info is already
1786 // filed in with things like the mimetype and so on
1787 //
1788 // Returns if successful or not
1789 bool navigateChild( khtml::ChildFrame *child, const KUrl& url );
1790
1791 // Helper for executing javascript: or about: protocols
1792 bool navigateLocalProtocol( khtml::ChildFrame *child, KParts::ReadOnlyPart *part,
1793 const KUrl& url );
1794
1795
1796 DOM::EventListener *createHTMLEventListener( QString code, QString name, DOM::NodeImpl *node, bool svg = false );
1797
1798 DOM::HTMLDocumentImpl *docImpl() const;
1799 DOM::DocumentImpl *xmlDocImpl() const;
1800 khtml::ChildFrame *frame( const QObject *obj );
1801
1802 khtml::ChildFrame *recursiveFrameRequest( KHTMLPart *callingHtmlPart, const KUrl &url,
1803 const KParts::OpenUrlArguments& args, const KParts::BrowserArguments &browserArgs,
1804 bool callParent = true );
1805
1806 bool checkLinkSecurity( const KUrl &linkURL,const KLocalizedString &message = KLocalizedString(), const QString &button = QString() );
1807 QVariant executeScript( const QString& filename, int baseLine, const DOM::Node &n, const QString& script );
1808
1809 KJSProxy *jScript();
1810
1811 KHTMLPart *opener();
1812 long cacheId() const;
1813 void setOpener( KHTMLPart *_opener );
1814 bool openedByJS();
1815 void setOpenedByJS( bool _openedByJS );
1816
1817 void checkEmitLoadEvent();
1818 void emitLoadEvent();
1819
1820 bool initFindNode( bool selection, bool reverse, bool fromCursor );
1821
1831 void extendSelectionTo(int x, int y, const DOM::Node &innerNode);
1835 bool isExtendingSelection() const;
1836 KEncodingDetector *createDecoder();
1837 QString defaultEncoding() const;
1838
1840 QString defaultExtension() const;
1841
1845 void zoomIn(const int stepping[], int count);
1849 void zoomOut(const int stepping[], int count);
1850
1851 void incFontSize(const int stepping[], int count);
1852
1853 void decFontSize(const int stepping[], int count);
1854
1855 void emitCaretPositionChanged(const DOM::Position &pos);
1856
1857 void setDebugScript( bool enable );
1858
1859 void runAdFilter();
1860
1861 khtml::EditorContext *editorContext() const;
1862
1867 void initCaret();
1868
1872 const DOM::Selection &caret() const;
1873
1877 const DOM::Selection &dragCaret() const;
1878
1882 void setCaret(const DOM::Selection &, bool closeTyping=true);
1883
1887 void setDragCaret(const DOM::Selection &);
1888
1892 void clearSelection();
1893
1897 void invalidateSelection();
1898
1902 void setSelectionVisible(bool flag=true);
1903
1907 void paintCaret(QPainter *p, const QRect &rect) const;
1908
1912 void paintDragCaret(QPainter *p, const QRect &rect) const;
1913
1921 QString simplifiedSelectedText() const;
1922
1923 bool handleMouseMoveEventDrag(khtml::MouseMoveEvent *event);
1924 bool handleMouseMoveEventOver(khtml::MouseMoveEvent *event);
1925 void handleMouseMoveEventSelection(khtml::MouseMoveEvent *event);
1926
1927 void handleMousePressEventSingleClick(khtml::MousePressEvent *event);
1928 void handleMousePressEventDoubleClick(khtml::MouseDoubleClickEvent *event);
1929 void handleMousePressEventTripleClick(khtml::MouseDoubleClickEvent *event);
1930
1931 KHTMLPartPrivate *d;
1932 friend class KHTMLPartPrivate;
1933
1934public: // So we don't end up having to add 50 more friends
1935
1937 KHTMLPartPrivate* impl() { return d; }
1938};
1939
1940
1941#endif
browserextension.h
DOM::Document
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:246
DOM::Editor
This class resembles the editing API when the associated khtml document is editable (in design mode),...
Definition: editor.h:61
DOM::EventListener
Introduced in DOM Level 2.
Definition: dom2_events.h:70
DOM::HTMLDocument
An HTMLDocument is the root of the HTML hierarchy and holds the entire content.
Definition: html_document.h:74
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:271
DOM::Range
Definition: dom2_range.h:80
KEncodingDetector
KEncodingDetector::AutoDetectScript
AutoDetectScript
KFindDialog
KFind::MinimumUserOption
MinimumUserOption
KHTMLFindBar
Definition: khtmlfindbar.h:30
KHTMLFind
This class implements the find activity for the KHTMLPart.
Definition: khtmlfind_p.h:47
KHTMLPartBrowserExtension
This is the BrowserExtension for a KHTMLPart document.
Definition: khtml_ext.h:44
KHTMLPartBrowserHostExtension
Definition: khtml_ext.h:95
KHTMLPartIface
D-BUS interface for KHTML.
Definition: khtml_iface.h:33
KHTMLPartPrivate
Definition: khtmlpart_p.h:94
KHTMLPart
This class is khtml's main class.
Definition: khtml_part.h:207
KHTMLPart::popupMenu
void popupMenu(const QString &url, const QPoint &point)
Emitted when the user clicks the right mouse button on the document.
KHTMLPart::CaretDisplayPolicy
CaretDisplayPolicy
Enumeration for displaying the caret.
Definition: khtml_part.h:586
KHTMLPart::CaretVisible
@ CaretVisible
caret is displayed
Definition: khtml_part.h:587
KHTMLPart::CaretInvisible
@ CaretInvisible
caret is not displayed
Definition: khtml_part.h:588
KHTMLPart::formSubmitNotification
void formSubmitNotification(const char *action, const QString &url, const QByteArray &formData, const QString &target, const QString &contentType, const QString &boundary)
If form notification is on, this will be emitted either for a form submit or before the form submit a...
KHTMLPart::FormNotification
FormNotification
Definition: khtml_part.h:1106
KHTMLPart::Before
@ Before
Definition: khtml_part.h:1106
KHTMLPart::nodeActivated
void nodeActivated(const DOM::Node &)
This signal is emitted when an element retrieves the keyboard focus.
KHTMLPart::onURL
void onURL(const QString &url)
Emitted if the cursor is moved over an URL.
KHTMLPart::DNSPrefetch
DNSPrefetch
DNS Prefetching Mode enumeration.
Definition: khtml_part.h:281
KHTMLPart::DNSPrefetchEnabled
@ DNSPrefetchEnabled
Definition: khtml_part.h:283
KHTMLPart::startingJob
virtual void startingJob(KIO::Job *)
Hook for adding code before a job is started.
Definition: khtml_part.h:1404
KHTMLPart::impl
KHTMLPartPrivate * impl()
Definition: khtml_part.h:1937
KHTMLPart::docCreated
void docCreated()
KHTMLPart::FindOptions
FindOptions
Extra Find options that can be used when calling the extended findText().
Definition: khtml_part.h:788
KHTMLPart::GUIProfile
GUIProfile
Definition: khtml_part.h:272
KHTMLPart::caretPositionChanged
void caretPositionChanged(const DOM::Node &node, long offset)
This signal is emitted whenever the caret position has been changed.
KHTMLPart::configurationChanged
void configurationChanged()
Emitted whenever the configuration has changed.
KHTMLPart::PageSecurity
PageSecurity
Definition: khtml_part.h:1277
KHTMLPart::Encrypted
@ Encrypted
Definition: khtml_part.h:1277
KHTMLPart::selectionChanged
void selectionChanged()
This signal is emitted when the selection changes.
KHTMLPopupGUIClient
Definition: khtml_ext.h:117
KHTMLRun
Definition: khtml_run.h:39
KHTMLSettings
Settings for the HTML view.
Definition: khtml_settings.h:42
KHTMLViewBar
Definition: khtmlviewbar.h:29
KHTMLView
Renders and displays HTML in a QScrollArea.
Definition: khtmlview.h:93
KIO::Job
KJSErrorDlg
Definition: kjserrordlg.h:9
KJavaAppletContext
Definition: kjavaappletcontext.h:46
KJob
KLocalizedString
KParts::BrowserExtension
KParts::BrowserHostExtension
KParts::GUIActivateEvent
KParts::OpenUrlArguments
KParts::PartManager
KParts::Part
KParts::Part::setStatusBarText
void setStatusBarText(const QString &text)
KParts::Part::customEvent
virtual void customEvent(QEvent *event)
KParts::ReadOnlyPart
KParts::ReadOnlyPart::browserExtension
BrowserExtension * browserExtension() const
KParts::ReadOnlyPart::guiActivateEvent
virtual void guiActivateEvent(GUIActivateEvent *event)
KParts::ReadOnlyPart::openFile
virtual bool openFile()
KParts::ReadOnlyPart::closeUrl
virtual bool closeUrl()
KParts::ReadOnlyPart::openUrl
virtual bool openUrl(const KUrl &url)
KUrl
KWallet::Wallet
QAction
QCursor
QEvent
QList
QMap
QObject
QWidget
StorePass
Definition: storepassbar.h:46
khtml::ChildFrame
Definition: khtml_childframe_p.h:41
khtml::DrawContentsEvent
Definition: khtml_events.h:131
khtml::EditCommandImpl
Definition: htmlediting_impl.h:92
khtml::MouseDoubleClickEvent
Definition: khtml_events.h:80
khtml::MouseMoveEvent
Definition: khtml_events.h:101
khtml::MousePressEvent
Definition: khtml_events.h:64
khtml::MouseReleaseEvent
Definition: khtml_events.h:116
dom2_range.h
dom_doc.h
KParts::ScriptableExtension::ScriptableExtension
ScriptableExtension(QObject *parent)
kencodingdetector.h
kfind.h
kfinddialog.h
d
#define d
Definition: khtmlfind.cpp:42
klocalizedstring.h
DOM
This library provides a full-featured HTML parser and widget.
Definition: design.h:55
KJS
Definition: dom_node.h:37
KParts
zoomOut
KAction * zoomOut(const QObject *recvr, const char *slot, QObject *parent)
selectAll
KAction * selectAll(const QObject *recvr, const char *slot, QObject *parent)
zoomIn
KAction * zoomIn(const QObject *recvr, const char *slot, QObject *parent)
clear
KAction * clear(const QObject *recvr, const char *slot, QObject *parent)
begin
const KShortcut & begin()
end
const KShortcut & end()
KWallet
Window
Window
WebCore::SVGNames::init
void init()
Definition: SVGNames.cpp:350
WebCore
Definition: CSSHelper.h:7
khtml
part.h
KParts::BrowserArguments
KParts::ScriptableExtension
khtml::EditorContext
Contextual information about the caret and the built-in editor.
Definition: editing_p.h:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal