diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-05-06 14:40:23 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-05-06 15:21:18 +0000 |
commit | eed2622ebc3298ec533d298fc7798a3690d2440c (patch) | |
tree | 1761f4a5b573f1d83cd9b18c7f59e49045e9844f /src/webenginewidgets/api/qwebengineurlschemehandler.cpp | |
parent | 7a5f9b62cca4f65b2194c6b842be323ad4c312ff (diff) | |
download | qtwebengine-eed2622ebc3298ec533d298fc7798a3690d2440c.tar.gz |
Add documentation of Custom URL requests
Adds basic documentation to the API. Though the API is still private
we would like people to experiment with it, which is easy if it is
documented.
Change-Id: I63985dfc16dc91270d95edf6fc306f9c71a10f29
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org>
Diffstat (limited to 'src/webenginewidgets/api/qwebengineurlschemehandler.cpp')
-rw-r--r-- | src/webenginewidgets/api/qwebengineurlschemehandler.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebengineurlschemehandler.cpp b/src/webenginewidgets/api/qwebengineurlschemehandler.cpp index 16ad220b2..65dd8f000 100644 --- a/src/webenginewidgets/api/qwebengineurlschemehandler.cpp +++ b/src/webenginewidgets/api/qwebengineurlschemehandler.cpp @@ -43,6 +43,23 @@ QT_BEGIN_NAMESPACE +/*! + \class QWebEngineUrlSchemeHandler + \brief The QWebEngineUrlSchemeHandler Base class for handling custom URL schemes. + \since 5.5 + \internal + + To implement a custom URL scheme for QtWebEngine you must write a class derived from this class, + and reimplement requestStarted(). + + To install a custom URL scheme handler into a QtWebProfile, you only need to call the constructor + with the correct profile. Each instance of a QWebEngineUrlSchemeHandler can only handle requests + from a single profile. + + \inmodule QtWebEngineWidgets + +*/ + QWebEngineUrlSchemeHandlerPrivate::QWebEngineUrlSchemeHandlerPrivate(const QByteArray &scheme, QWebEngineUrlSchemeHandler *q, QWebEngineProfile *profile) : CustomUrlSchemeHandler(scheme) , q_ptr(q) @@ -61,6 +78,12 @@ bool QWebEngineUrlSchemeHandlerPrivate::handleJob(QtWebEngineCore::URLRequestCus return true; } +/*! + Constructs a new URL scheme handler. + + The handler is created for \a scheme and for the \a profile. + + */ QWebEngineUrlSchemeHandler::QWebEngineUrlSchemeHandler(const QByteArray &scheme, QWebEngineProfile *profile, QObject *parent) : QObject(parent) , d_ptr(new QWebEngineUrlSchemeHandlerPrivate(scheme, this, profile)) @@ -74,9 +97,23 @@ QWebEngineUrlSchemeHandler::~QWebEngineUrlSchemeHandler() d_ptr->m_profile->d_func()->removeUrlSchemeHandler(this); } +/*! + Returns the custom URL scheme handled. +*/ QByteArray QWebEngineUrlSchemeHandler::scheme() const { return d_ptr->scheme(); } +/*! + \fn void QWebEngineUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *request) + + This method is called whenever a request for the registered scheme is started. + + This method must be reimplemented by all custom URL scheme handlers. + The request is asynchronous and does not need to be handled right away. + + \sa QWebEngineUrlRequestJob +*/ + QT_END_NAMESPACE |