/* Copyright (C) 2015 The Qt Company Ltd. Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // The documentation in this file was imported from QtWebKit and is thus constrained // by its LGPL license. Documentation written from scratch for new methods should be // placed inline in the code as usual. /*! \fn static QWebEngineSettings *QWebEngineSettings::globalSettings() Returns the global settings object. Any setting changed on the default object is automatically applied to all QWebEnginePage instances where the particular setting is not overridden already. \sa defaultSettings() */ /*! \class QWebEngineSettings \since 5.4 \brief The QWebEngineSettings class provides an object to store the settings used by QWebEnginePage. \inmodule QtWebEngineWidgets Each QWebEnginePage object has its own QWebEngineSettings object, which configures the settings for that page. If a setting is not configured, then it is looked up in the global settings object, which can be accessed using globalSettings(). QWebEngineSettings allows configuration of browser properties, such as font sizes and families, the location of a custom style sheet, and generic attributes, such as JavaScript support. Individual attributes are set using the setAttribute() function. The \l{QWebEngineSettings::WebAttribute}{WebAttribute} enum further describes each attribute. \sa QWebEnginePage::settings(), QWebEngineView::settings() */ /*! \enum QWebEngineSettings::FontFamily This enum describes the generic font families defined by CSS 2. For more information see the \l{http://www.w3.org/TR/REC-CSS2/fonts.html#generic-font-families}{CSS standard}. \value StandardFont \value FixedFont \value SerifFont \value SansSerifFont \value CursiveFont \value FantasyFont \value PictographFont (added in Qt 5.7) */ /*! \enum QWebEngineSettings::FontSize This enum describes the font sizes configurable through QWebEngineSettings: \value MinimumFontSize The hard minimum font size. \value MinimumLogicalFontSize The minimum logical font size that is applied when zooming out. \value DefaultFontSize The default font size for regular text. \value DefaultFixedFontSize The default font size for fixed-pitch text. */ /*! \enum QWebEngineSettings::WebAttribute This enum type specifies settings for web pages: \value AutoLoadImages Automatically loads images on web pages. Enabled by default. \value JavascriptEnabled Enables the running of JavaScript programs. Enabled by default. \value JavascriptCanOpenWindows Allows JavaScript programs to open new windows. Enabled by default. \value JavascriptCanAccessClipboard Allows JavaScript programs to read from and write to the clipboard. Disabled by default. \value LinksIncludedInFocusChain Includes hyperlinks in the keyboard focus chain. Enabled by default. \value LocalStorageEnabled Enables support for the HTML 5 local storage feature. Enabled by default. \value LocalContentCanAccessRemoteUrls Allows locally loaded documents to ignore cross-origin rules so that they can access remote resources that would normally be blocked, because all remote resources are considered cross-origin for a local file. Remote access that would not be blocked by cross-origin rules is still possible when this setting is disabled (default). Note that disabling this setting does not stop XMLHttpRequests or media elements in local files from accessing remote content. Basically, it only stops some HTML subresources, such as scripts, and therefore disabling this setting is not a safety mechanism. \value XSSAuditingEnabled Monitors load requests for cross-site scripting attempts. Suspicious scripts are blocked and reported in the inspector's JavaScript console. Disabled by default, because it might negatively affect performance. \value SpatialNavigationEnabled Enables the Spatial Navigation feature, which means the ability to navigate between focusable elements, such as hyperlinks and form controls, on a web page by using the Left, Right, Up and Down arrow keys. For example, if a user presses the Right key, heuristics determine whether there is an element they might be trying to reach towards the right and which element they probably want. Disabled by default. \value LocalContentCanAccessFileUrls Allows locally loaded documents to access other local URLs. Enabled by default. \value HyperlinkAuditingEnabled Enables support for the \c ping attribute for hyperlinks. Disabled by default. \value ScrollAnimatorEnabled Enables animated scrolling. Disabled by default. \value ErrorPageEnabled Enables displaying the built-in error pages of Chromium. Enabled by default. \value PluginsEnabled Enables support for Pepper plugins, such as the Flash player. Disabled by default. See also \l{Pepper Plugin API Support}. (Added in Qt 5.6) \value FullScreenSupportEnabled Enables fullscreen support in an application. Disabled by default. (Added in Qt 5.6) \value ScreenCaptureEnabled Enables screen capture in an application. Disabled by default. (Added in Qt 5.7) \value WebGLEnabled Enables support for HTML 5 WebGL. Enabled by default if available. (Added in Qt 5.7) \value Accelerated2dCanvasEnabled Specifies whether the HTML5 2D canvas should be a OpenGL framebuffer. This makes many painting operations faster, but slows down pixel access. Enabled by default if available. (Added in Qt 5.7) \value AutoLoadIconsForPage Automatically downloads icons for web pages. Enabled by default. (Added in Qt 5.7) \value TouchIconsEnabled Enables support for touch icons and precomposed touch icons Disabled by default. (Added in Qt 5.7) */ /*! \fn void QWebEngineSettings::setFontSize(FontSize type, int size) Sets the font size for \a type to \a size. */ /*! \fn int QWebEngineSettings::fontSize(FontSize type) const Returns the default font size for \a type. */ /*! \fn void QWebEngineSettings::resetFontSize(FontSize type) Resets the font size for \a type to the size specified in the global settings object. This function has no effect on the global QWebEngineSettings instance. */ /*! \fn void QWebEngineSettings::setDefaultTextEncoding(const QString& encoding) Specifies the default text encoding system. The value of \a encoding must be a string describing an encoding such as "utf-8" or "iso-8859-1". If left empty, a default value will be used. For a more extensive list of encoding names see \l{QTextCodec}. \sa defaultTextEncoding() */ /*! \fn QString QWebEngineSettings::defaultTextEncoding() const Returns the default text encoding. \sa setDefaultTextEncoding() */ /*! \fn void QWebEngineSettings::setFontFamily(FontFamily which, const QString& family) Sets the actual font family to \a family for the specified generic family, \a which. */ /*! \fn QString QWebEngineSettings::fontFamily(FontFamily which) const Returns the actual font family for the specified generic font family, \a which. */ /*! \fn void QWebEngineSettings::resetFontFamily(FontFamily which) Resets the actual font family specified by \a which to the one set in the global QWebEngineSettings instance. This function has no effect on the global QWebEngineSettings instance. */ /*! \fn void QWebEngineSettings::setAttribute(WebAttribute attribute, bool on) Enables or disables the specified \a attribute feature depending on the value of \a on. */ /*! \fn bool QWebEngineSettings::testAttribute(WebAttribute attribute) const Returns \c true if \a attribute is enabled; otherwise returns \c false. */ /*! \fn void QWebEngineSettings::resetAttribute(WebAttribute attribute) Resets the setting of \a attribute to the value specified in the global QWebEngineSettings instance. This function has no effect on the global QWebEngineSettings instance. \sa globalSettings() */