/* * Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) * Copyright (c) 2012 Hewlett-Packard Development Company, L.P. * Copyright (C) 2013 Digia Plc 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 program 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 program; 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. /*! \page qtwebengine-index.html \title Qt WebEngine The Qt WebEngine module provides the WebEngineView API which allows QML applications to render regions of dynamic web content. A \e{WebEngineView} component may share the screen with other QML components or encompass the full screen as specified within the QML application. It allows an application to load pages into the WebEngineView, either by URL or with an HTML string, and navigate within session history. By default, links to different pages load within the same WebEngineView, but applications may intercept requests to delegate links to other functions. The following sample QML application loads a web page, responds to session history context, and intercepts requests for external links. It also makes use of \l ScrollView from \l {Qt Quick Controls} to add scroll bars for the content area. \code import QtQuick 2.0 import QtQuick.Controls 1.0 import QtWebEngine 1.0 ScrollView { width: 1280 height: 720 WebEngineView { id: webview url: "http://qt-project.org" anchors.fill: parent onNavigationRequested: { // detect URL scheme prefix, most likely an external link var schemaRE = /^\w+:/; if (schemaRE.test(request.url)) { request.action = WebEngineView.AcceptRequest; } else { request.action = WebEngineView.IgnoreRequest; // delegate request.url here } } } } \endcode \section1 Examples There are several Qt WebEngine examples located in the \l{Qt WebEngine Examples} page. */ /*! \qmltype WebEngineView \instantiates QQuickWebEngineView \inqmlmodule QtWebEngine 1.0 \brief A WebEngineView renders web content within a QML application */ /*! \qmlmethod void WebEngineView::goBack() Go backward within the browser's session history, if possible. (Equivalent to the \c{window.history.back()} DOM method.) \sa WebEngineView::canGoBack */ /*! \qmlmethod void WebEngineView::goForward() Go forward within the browser's session history, if possible. (Equivalent to the \c{window.history.forward()} DOM method.) */ /*! \qmlmethod void WebEngineView::stop() Stop loading the current page. */ /*! \qmlmethod void WebEngineView::reload() Reload the current page. (Equivalent to the \c{window.location.reload()} DOM method.) */ /*! \qmlproperty url WebEngineView::url The location of the currently displaying HTML page. This writable property offers the main interface to load a page into a web view. It functions the same as the \c{window.location} DOM property. \sa WebEngineView::loadHtml() */ /*! \qmlproperty url WebEngineView::icon The location of the currently displaying Web site icon, also known as favicon or shortcut icon. This read-only URL corresponds to the image used within a mobile browser application to represent a bookmarked page on the device's home screen. This example uses the \c{icon} property to build an \c{Image} element: \code Image { id: appIcon source: webView.icon != "" ? webView.icon : "fallbackFavIcon.png"; ... } \endcode */ /*! \qmlproperty int WebEngineView::loadProgress The amount of the page that has been loaded, expressed as an integer percentage in the range from \c{0} to \c{100}. */ /*! \qmlproperty bool WebEngineView::canGoBack Returns \c{true} if there are prior session history entries, \c{false} otherwise. */ /*! \qmlproperty bool WebEngineView::canGoForward Returns \c{true} if there are subsequent session history entries, \c{false} otherwise. */ /*! \qmlproperty bool WebEngineView::loading Returns \c{true} if the HTML page is currently loading, \c{false} otherwise. */ /*! \qmlproperty string WebEngineView::title The title of the currently displaying HTML page, a read-only value that reflects the contents of the \c{