Falkon Develop
Cross-platform Qt-based web browser
qmlextensionscheme.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2018 Anmol Gautam <tarptaeya@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#pragma once
19
22#include <QQmlParserStatus>
23#include <QJSValue>
24
26
30class QmlExtensionScheme : public QObject, public QQmlParserStatus
31{
32 Q_OBJECT
33 Q_INTERFACES(QQmlParserStatus)
37 Q_PROPERTY(QString name READ name WRITE setName)
38public:
39 explicit QmlExtensionScheme(QObject *parent = nullptr);
40 ~QmlExtensionScheme() override;
41 void classBegin() override {}
42 void componentComplete() override;
43Q_SIGNALS:
48 void requestStarted(const QJSValue &request);
49private:
50 QString m_name;
51 QmlExtensionSchemeHandler *m_schemeHandler = nullptr;
52
53 QString name() const;
54 void setName(const QString &name);
55};
56
58{
59 Q_OBJECT
60public:
61 void requestStarted(QWebEngineUrlRequestJob *job) override;
62Q_SIGNALS:
63 void _requestStarted(QWebEngineUrlRequestJob *job);
64};
void _requestStarted(QWebEngineUrlRequestJob *job)
void requestStarted(QWebEngineUrlRequestJob *job) override
The QmlExtensionScheme class, exposed to QML as ExtensionScheme.
QString name
extension scheme handle name
void componentComplete() override
QmlExtensionScheme(QObject *parent=nullptr)
void classBegin() override
void requestStarted(const QJSValue &request)
The signal emitted when the request to the scheme handle is started.