21 #include "qgis_core.h"
32 #include <QNetworkAccessManager>
34 #include <QTextBrowser>
55 PrivateBrowsingEnabled,
56 JavascriptCanOpenWindows,
57 JavascriptCanAccessClipboard,
58 DeveloperExtrasEnabled,
59 LinksIncludedInFocusChain,
61 PrintElementBackgrounds,
62 OfflineStorageDatabaseEnabled,
63 OfflineWebApplicationCacheEnabled,
65 LocalContentCanAccessRemoteUrls,
68 AcceleratedCompositingEnabled,
69 SpatialNavigationEnabled,
70 LocalContentCanAccessFileUrls,
71 TiledBackingStoreEnabled,
72 FrameFlatteningEnabled,
73 SiteSpecificQuirksEnabled,
74 JavascriptCanCloseWindows,
77 HyperlinkAuditingEnabled,
79 ScrollAnimatorEnabled,
88 void setUserStyleSheetUrl(
const QUrl & )
92 void setAttribute( WebAttribute,
bool )
110 enum LinkDelegationPolicy
113 DelegateExternalLinks,
123 explicit QWebPage( QObject *parent =
nullptr )
128 connect( mFrame, &QWebFrame::loadFinished,
this, &QWebPage::loadFinished );
137 QPalette palette()
const
142 void setPalette(
const QPalette &palette )
147 void setViewportSize(
const QSize &size )
const
152 void setLinkDelegationPolicy( LinkDelegationPolicy linkDelegationPolicy )
157 QTextBrowser *tb = qobject_cast<QTextBrowser *>( parent() );
161 tb->setOpenExternalLinks( linkDelegationPolicy != DontDelegateLinks );
164 void setNetworkAccessManager( QNetworkAccessManager *networkAccessManager )
166 Q_UNUSED( networkAccessManager )
179 QSize viewportSize()
const
184 QMenu *createStandardContextMenu()
191 void loadFinished(
bool ok );
193 void downloadRequested(
const QNetworkRequest &request );
195 void unsupportedContent( QNetworkReply *reply );
201 virtual void javaScriptConsoleMessage(
const QString &,
int,
const QString & ) {}
238 void setIdentifier(
const QString &identifier ) { mIdentifier = identifier; }
251 if ( mIdentifier.isEmpty() )
254 QgsMessageLog::logMessage( tr(
"%1 (line %2): %3" ).arg( mIdentifier ).arg( lineNumber ).arg( message ), tr(
"JavaScript" ) );
263 #endif // QGSWEBPAGE_H