Skip to content

Commit c2f363f

Browse files
committedSep 9, 2016
debian packaging update: add internal QtWebKit bindings
(cherry picked from commit c2f0fff and d6b485)
1 parent 7854fe2 commit c2f363f

21 files changed

+2001
-6
lines changed
 

‎cmake/SIPMacros.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ MACRO(BUILD_SIP_PYTHON_MODULE MODULE_NAME SIP_FILES EXTRA_OBJECTS)
141141

142142
IF (WIN32)
143143
SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES SUFFIX ".pyd")
144-
ENDIF (WIN32)
145-
146-
IF(WIN32)
147144
GET_TARGET_PROPERTY(_runtime_output ${_logical_name} RUNTIME_OUTPUT_DIRECTORY)
148145
ADD_CUSTOM_COMMAND(TARGET ${_logical_name} POST_BUILD
149146
COMMAND ${CMAKE_COMMAND} -E echo "Copying extension ${_child_module_name}"

‎debian/control.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Build-Depends:
2626
libqt4-opengl-dev,
2727
libqca2-dev,
2828
libqca2-plugin-ossl,
29-
#jessie precise trusty xenial# libqtwebkit-dev,
29+
libqtwebkit-dev,
3030
#stretch jessie# libqwt-dev,
3131
#precise trusty xenial sid# libqwt5-qt4-dev,
3232
#sid stretch jessie trusty xenial# libqjson-dev,

‎debian/python-qgis.install.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ usr/lib/python*/*-packages/qgis/server/*
99
usr/lib/python*/*-packages/qgis/testing/*
1010
#precise#usr/lib/python*/*-packages/pyspatialite/*.py
1111
#precise#usr/lib/python*/*-packages/pyspatialite/*.so
12+
#sid stretch#usr/lib/python*/*-packages/PyQt4/*.so

‎debian/rules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ ifneq (,$(findstring $(DISTRIBUTION),"sid stretch"))
125125
CMAKE_OPTS += -DPOSTGRES_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libpq.so
126126
endif
127127

128-
ifneq (,$(findstring $(DISTRIBUTION),"sid stretch xenial"))
129-
CMAKE_OPTS += -DWITH_QTWEBKIT=FALSE
128+
ifneq (,$(findstring $(DISTRIBUTION),"sid stretch"))
129+
CMAKE_OPTS += -DWITH_INTERNAL_WEBKIT_BINDINGS=TRUE
130130
endif
131131

132132
ifneq (,$(findstring $(DISTRIBUTION),"sid"))

‎python/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,3 +338,17 @@ FOREACH(module ${PY_MODULES})
338338
ENDFOREACH(pyfile)
339339
PY_COMPILE(py${module} "${QGIS_PYTHON_OUTPUT_DIRECTORY}/${module}")
340340
ENDFOREACH(module)
341+
342+
SET (WITH_INTERNAL_WEBKIT_BINDINGS FALSE CACHE BOOL "Build internal QtWebKit bindings")
343+
IF(WITH_INTERNAL_WEBKIT_BINDINGS)
344+
INCLUDE_DIRECTORIES(${QT_QTWEBKIT_INCLUDE_DIR})
345+
FILE(GLOB_RECURSE sip_files_qtwebkit QtWebKit/*.sip)
346+
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_qtwebkit})
347+
SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/PyQt4.QtWebKit.api)
348+
349+
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/PyQt4)
350+
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/PyQt4)
351+
GENERATE_SIP_PYTHON_MODULE_CODE(PyQt4.QtWebKit QtWebKit/QtWebKitmod.sip cpp_files)
352+
BUILD_SIP_PYTHON_MODULE(PyQt4.QtWebKit QtWebKitmod.sip ${cpp_files} "" QtWebKit QtCore QtGui QtNetwork)
353+
SET(SIP_QTWEBKIT_CPP_FILES ${cpp_files})
354+
ENDIF(WITH_INTERNAL_WEBKIT_BINDINGS)

‎python/QtWebKit/QtWebKitmod.sip

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// QtWebKitmod.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%Module(name=PyQt4.QtWebKit, keyword_arguments="Optional")
24+
25+
%Import QtCore/QtCoremod.sip
26+
%Import QtGui/QtGuimod.sip
27+
%Import QtNetwork/QtNetworkmod.sip
28+
29+
%Copying
30+
Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
31+
32+
This file is part of PyQt4.
33+
34+
This file may be used under the terms of the GNU General Public License
35+
version 3.0 as published by the Free Software Foundation and appearing in
36+
the file LICENSE included in the packaging of this file. Please review the
37+
following information to ensure the GNU General Public License version 3.0
38+
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
39+
40+
If you do not wish to use this file under the terms of the GPL version 3.0
41+
then you may purchase a commercial license. For more information contact
42+
info@riverbankcomputing.com.
43+
44+
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
45+
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
46+
%End
47+
48+
%DefaultSupertype sip.simplewrapper
49+
50+
%Include qgraphicswebview.sip
51+
%Include qwebdatabase.sip
52+
%Include qwebelement.sip
53+
%Include qwebframe.sip
54+
%Include qwebkitglobal.sip
55+
%Include qwebhistory.sip
56+
%Include qwebhistoryinterface.sip
57+
%Include qwebinspector.sip
58+
%Include qwebkitversion.sip
59+
%Include qwebpage.sip
60+
%Include qwebpluginfactory.sip
61+
%Include qwebsecurityorigin.sip
62+
%Include qwebsettings.sip
63+
%Include qwebview.sip

‎python/QtWebKit/__init__.py

Whitespace-only changes.

‎python/QtWebKit/qgraphicswebview.sip

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
// qgraphicswebview.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_6_0 -)
24+
25+
class QGraphicsWebView : QGraphicsWidget
26+
{
27+
%TypeHeaderCode
28+
#include <qgraphicswebview.h>
29+
%End
30+
31+
%ConvertToSubClassCode
32+
sipType = 0;
33+
34+
// For some reason Qt doesn't allocate a new type for this so we have to test
35+
// the numeric and QObject types.
36+
if (sipCpp->type() == 11)
37+
{
38+
QGraphicsWidget *gw = static_cast<QGraphicsWidget *>(sipCpp);
39+
40+
if (gw->inherits("QGraphicsWebView"))
41+
{
42+
*sipCppRet = static_cast<QGraphicsWebView *>(gw);
43+
sipType = sipType_QGraphicsWebView;
44+
}
45+
}
46+
%End
47+
48+
public:
49+
explicit QGraphicsWebView(QGraphicsItem *parent /TransferThis/ = 0);
50+
virtual ~QGraphicsWebView();
51+
QWebPage *page() const;
52+
void setPage(QWebPage * /KeepReference/);
53+
QUrl url() const;
54+
void setUrl(const QUrl &);
55+
QString title() const;
56+
QIcon icon() const;
57+
qreal zoomFactor() const;
58+
void setZoomFactor(qreal);
59+
bool isModified() const;
60+
void load(const QUrl &url) /ReleaseGIL/;
61+
void load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray &body = QByteArray()) /ReleaseGIL/;
62+
void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
63+
void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
64+
QWebHistory *history() const;
65+
QWebSettings *settings() const;
66+
QAction *pageAction(QWebPage::WebAction action) const;
67+
void triggerPageAction(QWebPage::WebAction action, bool checked = false);
68+
bool findText(const QString &subString, QFlags<QWebPage::FindFlag> options = 0);
69+
virtual void setGeometry(const QRectF &rect);
70+
virtual void updateGeometry();
71+
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
72+
virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
73+
virtual bool event(QEvent *);
74+
virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
75+
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
76+
77+
public slots:
78+
void stop();
79+
void back();
80+
void forward();
81+
void reload();
82+
83+
signals:
84+
void loadStarted();
85+
void loadFinished(bool);
86+
void loadProgress(int progress);
87+
void urlChanged(const QUrl &);
88+
void titleChanged(const QString &);
89+
void iconChanged();
90+
void statusBarMessage(const QString &message);
91+
void linkClicked(const QUrl &);
92+
93+
protected:
94+
virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
95+
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *);
96+
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *);
97+
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *);
98+
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *);
99+
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *);
100+
virtual void wheelEvent(QGraphicsSceneWheelEvent *);
101+
virtual void keyPressEvent(QKeyEvent *);
102+
virtual void keyReleaseEvent(QKeyEvent *);
103+
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *);
104+
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *);
105+
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *);
106+
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *);
107+
virtual void dropEvent(QGraphicsSceneDragDropEvent *);
108+
virtual void focusInEvent(QFocusEvent *);
109+
virtual void focusOutEvent(QFocusEvent *);
110+
virtual void inputMethodEvent(QInputMethodEvent *);
111+
virtual bool focusNextPrevChild(bool next);
112+
virtual bool sceneEvent(QEvent *);
113+
114+
public:
115+
%If (Qt_4_7_0 -)
116+
bool resizesToContents() const;
117+
%End
118+
%If (Qt_4_7_0 -)
119+
void setResizesToContents(bool enabled);
120+
%End
121+
%If (Qt_4_7_0 -)
122+
bool isTiledBackingStoreFrozen() const;
123+
%End
124+
%If (Qt_4_7_0 -)
125+
void setTiledBackingStoreFrozen(bool frozen);
126+
%End
127+
%If (Qt_4_8_0 -)
128+
QFlags<QPainter::RenderHint> renderHints() const;
129+
%End
130+
%If (Qt_4_8_0 -)
131+
void setRenderHints(QFlags<QPainter::RenderHint> hints);
132+
%End
133+
%If (Qt_4_8_0 -)
134+
void setRenderHint(QPainter::RenderHint hint, bool enabled = true);
135+
%End
136+
};
137+
138+
%End
139+
140+
%ModuleHeaderCode
141+
#if QT_VERSION >= 0x040600
142+
// This is needed by the %ConvertSubClassCode.
143+
#include <QGraphicsWebView>
144+
#endif
145+
146+
// This is needed for Qt v5.0.0.
147+
#if defined(B0)
148+
#undef B0
149+
#endif
150+
%End

‎python/QtWebKit/qwebdatabase.sip

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// qwebdatabase.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_5_0 -)
24+
25+
class QWebDatabase
26+
{
27+
%TypeHeaderCode
28+
#include <qwebdatabase.h>
29+
%End
30+
31+
public:
32+
QWebDatabase(const QWebDatabase &other);
33+
~QWebDatabase();
34+
QString name() const;
35+
QString displayName() const;
36+
qint64 expectedSize() const;
37+
qint64 size() const;
38+
QString fileName() const;
39+
QWebSecurityOrigin origin() const;
40+
static void removeDatabase(const QWebDatabase &db);
41+
%If (Qt_4_6_0 -)
42+
static void removeAllDatabases();
43+
%End
44+
};
45+
46+
%End

‎python/QtWebKit/qwebelement.sip

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
// qwebelement.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_6_0 -)
24+
25+
class QWebElement
26+
{
27+
%TypeHeaderCode
28+
#include <qwebelement.h>
29+
%End
30+
31+
public:
32+
QWebElement();
33+
QWebElement(const QWebElement &);
34+
~QWebElement();
35+
bool operator==(const QWebElement &o) const;
36+
bool operator!=(const QWebElement &o) const;
37+
bool isNull() const;
38+
QWebElementCollection findAll(const QString &selectorQuery) const;
39+
QWebElement findFirst(const QString &selectorQuery) const;
40+
void setPlainText(const QString &text);
41+
QString toPlainText() const;
42+
void setOuterXml(const QString &markup);
43+
QString toOuterXml() const;
44+
void setInnerXml(const QString &markup);
45+
QString toInnerXml() const;
46+
void setAttribute(const QString &name, const QString &value);
47+
void setAttributeNS(const QString &namespaceUri, const QString &name, const QString &value);
48+
QString attribute(const QString &name, const QString &defaultValue = QString()) const;
49+
QString attributeNS(const QString &namespaceUri, const QString &name, const QString &defaultValue = QString()) const;
50+
bool hasAttribute(const QString &name) const;
51+
bool hasAttributeNS(const QString &namespaceUri, const QString &name) const;
52+
void removeAttribute(const QString &name);
53+
void removeAttributeNS(const QString &namespaceUri, const QString &name);
54+
bool hasAttributes() const;
55+
QStringList attributeNames(const QString &namespaceUri = QString()) const;
56+
QStringList classes() const;
57+
bool hasClass(const QString &name) const;
58+
void addClass(const QString &name);
59+
void removeClass(const QString &name);
60+
void toggleClass(const QString &name);
61+
bool hasFocus() const;
62+
void setFocus();
63+
QRect geometry() const;
64+
QString tagName() const;
65+
QString prefix() const;
66+
QString localName() const;
67+
QString namespaceUri() const;
68+
QWebElement parent() const;
69+
QWebElement firstChild() const;
70+
QWebElement lastChild() const;
71+
QWebElement nextSibling() const;
72+
QWebElement previousSibling() const;
73+
QWebElement document() const;
74+
QWebFrame *webFrame() const;
75+
void appendInside(const QString &markup);
76+
void appendInside(const QWebElement &element);
77+
void prependInside(const QString &markup);
78+
void prependInside(const QWebElement &element);
79+
void appendOutside(const QString &markup);
80+
void appendOutside(const QWebElement &element);
81+
void prependOutside(const QString &markup);
82+
void prependOutside(const QWebElement &element);
83+
void encloseContentsWith(const QWebElement &element);
84+
void encloseContentsWith(const QString &markup);
85+
void encloseWith(const QString &markup);
86+
void encloseWith(const QWebElement &element);
87+
void replace(const QString &markup);
88+
void replace(const QWebElement &element);
89+
QWebElement clone() const;
90+
QWebElement &takeFromDocument();
91+
void removeFromDocument();
92+
void removeAllChildren();
93+
QVariant evaluateJavaScript(const QString &scriptSource);
94+
95+
enum StyleResolveStrategy
96+
{
97+
InlineStyle,
98+
CascadedStyle,
99+
ComputedStyle,
100+
};
101+
102+
QString styleProperty(const QString &name, QWebElement::StyleResolveStrategy strategy) const;
103+
void setStyleProperty(const QString &name, const QString &value);
104+
void render(QPainter *painter);
105+
%If (Qt_4_8_0 -)
106+
void render(QPainter *painter, const QRect &clip);
107+
%End
108+
};
109+
110+
%End
111+
%If (Qt_4_6_0 -)
112+
113+
class QWebElementCollection
114+
{
115+
%TypeHeaderCode
116+
#include <qwebelement.h>
117+
%End
118+
119+
public:
120+
QWebElementCollection();
121+
QWebElementCollection(const QWebElement &contextElement, const QString &query);
122+
QWebElementCollection(const QWebElementCollection &);
123+
~QWebElementCollection();
124+
QWebElementCollection operator+(const QWebElementCollection &other) const;
125+
QWebElementCollection &operator+=(const QWebElementCollection &other);
126+
void append(const QWebElementCollection &collection);
127+
int count() const /__len__/;
128+
QWebElement at(int i) const;
129+
QWebElement operator[](int i) const;
130+
%MethodCode
131+
SIP_SSIZE_T idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
132+
133+
if (idx < 0)
134+
sipIsErr = 1;
135+
else
136+
sipRes = new QWebElement(sipCpp->operator[]((int)idx));
137+
%End
138+
139+
QWebElement first() const;
140+
QWebElement last() const;
141+
QList<QWebElement> toList() const;
142+
};
143+
144+
%End

‎python/QtWebKit/qwebframe.sip

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
// qwebframe.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_4_0 -)
24+
%ModuleCode
25+
#include <qwebframe.h>
26+
%End
27+
%End
28+
29+
%If (Qt_4_4_0 -)
30+
31+
class QWebHitTestResult
32+
{
33+
%TypeHeaderCode
34+
#include <qwebframe.h>
35+
%End
36+
37+
public:
38+
QWebHitTestResult();
39+
QWebHitTestResult(const QWebHitTestResult &other);
40+
~QWebHitTestResult();
41+
bool isNull() const;
42+
QPoint pos() const;
43+
QString title() const;
44+
QString linkText() const;
45+
QUrl linkUrl() const;
46+
QUrl linkTitle() const;
47+
QWebFrame *linkTargetFrame() const;
48+
QString alternateText() const;
49+
QUrl imageUrl() const;
50+
QPixmap pixmap() const;
51+
bool isContentEditable() const;
52+
bool isContentSelected() const;
53+
QWebFrame *frame() const;
54+
%If (Qt_4_5_0 -)
55+
QRect boundingRect() const;
56+
%End
57+
%If (Qt_4_6_0 -)
58+
QWebElement enclosingBlockElement() const;
59+
%End
60+
%If (Qt_4_6_0 -)
61+
QWebElement linkElement() const;
62+
%End
63+
%If (Qt_4_6_0 -)
64+
QWebElement element() const;
65+
%End
66+
};
67+
68+
%End
69+
%If (Qt_4_4_0 -)
70+
71+
class QWebFrame : QObject /NoDefaultCtors/
72+
{
73+
%TypeHeaderCode
74+
#include <qwebframe.h>
75+
%End
76+
77+
virtual ~QWebFrame();
78+
79+
public:
80+
QWebPage *page() const;
81+
void load(const QUrl &url);
82+
void load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray &body = QByteArray());
83+
void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
84+
void setContent(const QByteArray &data, const QString &mimeType /DocValue="Py_v3:''"/ = QString(), const QUrl &baseUrl = QUrl());
85+
%If (Qt_5_0_0 -)
86+
87+
enum ValueOwnership
88+
{
89+
QtOwnership,
90+
ScriptOwnership,
91+
AutoOwnership,
92+
};
93+
94+
%End
95+
%If (Qt_5_0_0 -)
96+
void addToJavaScriptWindowObject(const QString &name, QObject *object, QWebFrame::ValueOwnership ownership = QWebFrame::QtOwnership);
97+
%End
98+
%If (- Qt_5_0_0)
99+
void addToJavaScriptWindowObject(const QString &name, QObject *object);
100+
%End
101+
QString toHtml() const;
102+
QString toPlainText() const;
103+
%If (- Qt_5_0_0)
104+
QString renderTreeDump() const;
105+
%End
106+
QString title() const;
107+
void setUrl(const QUrl &url);
108+
QUrl url() const;
109+
QIcon icon() const;
110+
QString frameName() const;
111+
QWebFrame *parentFrame() const;
112+
QList<QWebFrame*> childFrames() const;
113+
Qt::ScrollBarPolicy scrollBarPolicy(Qt::Orientation orientation) const;
114+
void setScrollBarPolicy(Qt::Orientation orientation, Qt::ScrollBarPolicy policy);
115+
void setScrollBarValue(Qt::Orientation orientation, int value);
116+
int scrollBarValue(Qt::Orientation orientation) const;
117+
int scrollBarMinimum(Qt::Orientation orientation) const;
118+
int scrollBarMaximum(Qt::Orientation orientation) const;
119+
%If (- Qt_5_0_0)
120+
void render(QPainter *painter, const QRegion &clip);
121+
%End
122+
%If (- Qt_5_0_0)
123+
void render(QPainter *painter);
124+
%End
125+
void setTextSizeMultiplier(qreal factor);
126+
qreal textSizeMultiplier() const;
127+
QPoint pos() const;
128+
QRect geometry() const;
129+
QSize contentsSize() const;
130+
QWebHitTestResult hitTestContent(const QPoint &pos) const;
131+
virtual bool event(QEvent *);
132+
133+
public slots:
134+
QVariant evaluateJavaScript(const QString &scriptSource);
135+
%If (PyQt_Printer)
136+
void print(QPrinter *printer) const /PyName=print_/;
137+
%End
138+
%If (Py_v3)
139+
%If (PyQt_Printer)
140+
void print(QPrinter *printer) const;
141+
%End
142+
%End
143+
144+
signals:
145+
void javaScriptWindowObjectCleared();
146+
void titleChanged(const QString &title);
147+
void urlChanged(const QUrl &url);
148+
void initialLayoutCompleted();
149+
void iconChanged();
150+
151+
public:
152+
%If (Qt_4_5_0 -)
153+
QMultiMap<QString, QString> metaData() const;
154+
%End
155+
%If (Qt_4_5_0 -)
156+
void scroll(int, int);
157+
%End
158+
%If (Qt_4_5_0 -)
159+
QPoint scrollPosition() const;
160+
%End
161+
%If (Qt_4_5_0 -)
162+
void setScrollPosition(const QPoint &pos);
163+
%End
164+
%If (Qt_4_5_0 -)
165+
qreal zoomFactor() const;
166+
%End
167+
%If (Qt_4_5_0 -)
168+
void setZoomFactor(qreal factor);
169+
%End
170+
%If (Qt_4_5_0 -)
171+
QWebSecurityOrigin securityOrigin() const;
172+
%End
173+
%If (Qt_4_6_0 -)
174+
QUrl requestedUrl() const;
175+
%End
176+
%If (Qt_4_6_0 -)
177+
QUrl baseUrl() const;
178+
%End
179+
%If (Qt_4_6_0 -)
180+
QRect scrollBarGeometry(Qt::Orientation orientation) const;
181+
%End
182+
%If (Qt_4_6_0 -)
183+
184+
enum RenderLayer
185+
{
186+
ContentsLayer,
187+
ScrollBarLayer,
188+
PanIconLayer,
189+
AllLayers,
190+
};
191+
192+
%End
193+
%If (Qt_5_0_0 -)
194+
typedef QFlags<QWebFrame::RenderLayer> RenderLayers;
195+
%End
196+
%If (Qt_4_6_0 - Qt_5_0_0)
197+
void render(QPainter *, QWebFrame::RenderLayer layer, const QRegion &clip = QRegion());
198+
%End
199+
%If (Qt_5_0_0 -)
200+
void render(QPainter *, const QRegion &clip = QRegion());
201+
%End
202+
%If (Qt_5_0_0 -)
203+
void render(QPainter *, QFlags<QWebFrame::RenderLayer> layer, const QRegion &clip = QRegion());
204+
%End
205+
%If (Qt_4_6_0 -)
206+
bool hasFocus() const;
207+
%End
208+
%If (Qt_4_6_0 -)
209+
void setFocus();
210+
%End
211+
%If (Qt_4_6_0 -)
212+
QWebElement documentElement() const;
213+
%End
214+
%If (Qt_4_6_0 -)
215+
QWebElementCollection findAllElements(const QString &selectorQuery) const;
216+
%End
217+
%If (Qt_4_6_0 -)
218+
QWebElement findFirstElement(const QString &selectorQuery) const;
219+
%End
220+
221+
signals:
222+
%If (Qt_4_6_0 -)
223+
void contentsSizeChanged(const QSize &size);
224+
%End
225+
%If (Qt_4_6_0 -)
226+
void loadStarted();
227+
%End
228+
%If (Qt_4_6_0 -)
229+
void loadFinished(bool ok);
230+
%End
231+
%If (Qt_4_7_0 -)
232+
void pageChanged();
233+
%End
234+
235+
public:
236+
%If (Qt_4_7_0 -)
237+
void scrollToAnchor(const QString &anchor);
238+
%End
239+
};
240+
241+
%End
242+
%If (Qt_5_0_0 -)
243+
QFlags<QWebFrame::RenderLayer> operator|(QWebFrame::RenderLayer f1, QFlags<QWebFrame::RenderLayer> f2);
244+
%End

‎python/QtWebKit/qwebhistory.sip

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
// qwebhistory.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_4_0 -)
24+
%ModuleCode
25+
#include <qwebhistory.h>
26+
%End
27+
%End
28+
29+
%If (Qt_4_4_0 -)
30+
31+
class QWebHistoryItem
32+
{
33+
%TypeHeaderCode
34+
#include <qwebhistory.h>
35+
%End
36+
37+
public:
38+
QWebHistoryItem(const QWebHistoryItem &other);
39+
~QWebHistoryItem();
40+
QUrl originalUrl() const;
41+
QUrl url() const;
42+
QString title() const;
43+
QDateTime lastVisited() const;
44+
QIcon icon() const;
45+
%If (Qt_4_5_0 -)
46+
QVariant userData() const;
47+
%End
48+
%If (Qt_4_5_0 -)
49+
void setUserData(const QVariant &userData);
50+
%End
51+
%If (Qt_4_5_0 -)
52+
bool isValid() const;
53+
%End
54+
};
55+
56+
%End
57+
%If (Qt_4_4_0 -)
58+
59+
class QWebHistory
60+
{
61+
%TypeHeaderCode
62+
#include <qwebhistory.h>
63+
%End
64+
65+
public:
66+
void clear();
67+
QList<QWebHistoryItem> items() const;
68+
QList<QWebHistoryItem> backItems(int maxItems) const;
69+
QList<QWebHistoryItem> forwardItems(int maxItems) const;
70+
bool canGoBack() const;
71+
bool canGoForward() const;
72+
void back();
73+
void forward();
74+
void goToItem(const QWebHistoryItem &item);
75+
QWebHistoryItem backItem() const;
76+
QWebHistoryItem currentItem() const;
77+
QWebHistoryItem forwardItem() const;
78+
QWebHistoryItem itemAt(int i) const;
79+
int count() const /__len__/;
80+
81+
private:
82+
QWebHistory();
83+
QWebHistory(const QWebHistory &);
84+
~QWebHistory();
85+
86+
public:
87+
%If (Qt_4_5_0 -)
88+
int currentItemIndex() const;
89+
%End
90+
%If (Qt_4_5_0 -)
91+
int maximumItemCount() const;
92+
%End
93+
%If (Qt_4_5_0 -)
94+
void setMaximumItemCount(int count);
95+
%End
96+
};
97+
98+
%End
99+
%If (Qt_4_6_0 -)
100+
QDataStream &operator<<(QDataStream &, const QWebHistory & /Constrained/);
101+
%End
102+
%If (Qt_4_6_0 -)
103+
QDataStream &operator>>(QDataStream &, QWebHistory & /Constrained/);
104+
%End
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// qwebhistoryinterface.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_4_0 -)
24+
25+
class QWebHistoryInterface : QObject
26+
{
27+
%TypeHeaderCode
28+
#include <qwebhistoryinterface.h>
29+
%End
30+
31+
public:
32+
QWebHistoryInterface(QObject *parent /TransferThis/ = 0);
33+
virtual ~QWebHistoryInterface();
34+
static void setDefaultInterface(QWebHistoryInterface *defaultInterface /KeepReference/);
35+
static QWebHistoryInterface *defaultInterface();
36+
virtual bool historyContains(const QString &url) const = 0;
37+
virtual void addHistoryEntry(const QString &url) = 0;
38+
};
39+
40+
%End

‎python/QtWebKit/qwebinspector.sip

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// qwebinspector.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_6_0 -)
24+
25+
class QWebInspector : QWidget
26+
{
27+
%TypeHeaderCode
28+
#include <qwebinspector.h>
29+
%End
30+
31+
public:
32+
QWebInspector(QWidget *parent /TransferThis/ = 0);
33+
virtual ~QWebInspector();
34+
void setPage(QWebPage *page /KeepReference/);
35+
QWebPage *page() const;
36+
virtual QSize sizeHint() const;
37+
virtual bool event(QEvent *);
38+
39+
protected:
40+
virtual void resizeEvent(QResizeEvent *event);
41+
virtual void showEvent(QShowEvent *event);
42+
virtual void hideEvent(QHideEvent *event);
43+
%If (Qt_4_7_0 -)
44+
virtual void closeEvent(QCloseEvent *event);
45+
%End
46+
};
47+
48+
%End

‎python/QtWebKit/qwebkitglobal.sip

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// qwebkitglobal.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_5_0_0 -)
24+
%ModuleCode
25+
#include <qwebkitglobal.h>
26+
%End
27+
%End
28+
29+
%If (Qt_5_0_0 -)
30+
QString qWebKitVersion();
31+
%End
32+
%If (Qt_5_0_0 -)
33+
int qWebKitMajorVersion();
34+
%End
35+
%If (Qt_5_0_0 -)
36+
int qWebKitMinorVersion();
37+
%End

‎python/QtWebKit/qwebkitversion.sip

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// qwebkitversion.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_6_0 - Qt_5_0_0)
24+
%ModuleCode
25+
#include <qwebkitversion.h>
26+
%End
27+
%End
28+
29+
%If (Qt_4_6_0 - Qt_5_0_0)
30+
QString qWebKitVersion();
31+
%End
32+
%If (Qt_4_6_0 - Qt_5_0_0)
33+
int qWebKitMajorVersion();
34+
%End
35+
%If (Qt_4_6_0 - Qt_5_0_0)
36+
int qWebKitMinorVersion();
37+
%End

‎python/QtWebKit/qwebpage.sip

Lines changed: 522 additions & 0 deletions
Large diffs are not rendered by default.

‎python/QtWebKit/qwebpluginfactory.sip

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// qwebpluginfactory.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_4_0 -)
24+
25+
class QWebPluginFactory : QObject
26+
{
27+
%TypeHeaderCode
28+
#include <qwebpluginfactory.h>
29+
%End
30+
31+
public:
32+
struct MimeType
33+
{
34+
%TypeHeaderCode
35+
#include <qwebpluginfactory.h>
36+
%End
37+
38+
QString name;
39+
QString description;
40+
QStringList fileExtensions;
41+
%If (Qt_4_6_0 -)
42+
bool operator==(const QWebPluginFactory::MimeType &other) const;
43+
%End
44+
%If (Qt_4_6_0 -)
45+
bool operator!=(const QWebPluginFactory::MimeType &other) const;
46+
%End
47+
};
48+
49+
struct Plugin
50+
{
51+
%TypeHeaderCode
52+
#include <qwebpluginfactory.h>
53+
%End
54+
55+
QString name;
56+
QString description;
57+
QList<QWebPluginFactory::MimeType> mimeTypes;
58+
};
59+
60+
explicit QWebPluginFactory(QObject *parent /TransferThis/ = 0);
61+
virtual ~QWebPluginFactory();
62+
virtual QList<QWebPluginFactory::Plugin> plugins() const = 0;
63+
virtual void refreshPlugins();
64+
virtual QObject *create(const QString &mimeType, const QUrl &url, const QStringList &argumentNames, const QStringList &argumentValues) const = 0 /Factory/;
65+
66+
enum Extension
67+
{
68+
};
69+
70+
class ExtensionOption
71+
{
72+
%TypeHeaderCode
73+
#include <qwebpluginfactory.h>
74+
%End
75+
};
76+
77+
class ExtensionReturn
78+
{
79+
%TypeHeaderCode
80+
#include <qwebpluginfactory.h>
81+
%End
82+
};
83+
84+
virtual bool extension(QWebPluginFactory::Extension extension, const QWebPluginFactory::ExtensionOption *option = 0, QWebPluginFactory::ExtensionReturn *output = 0);
85+
virtual bool supportsExtension(QWebPluginFactory::Extension extension) const;
86+
};
87+
88+
%End
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// qwebsecurityorigin.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_5_0 -)
24+
25+
class QWebSecurityOrigin
26+
{
27+
%TypeHeaderCode
28+
#include <qwebsecurityorigin.h>
29+
%End
30+
31+
public:
32+
QWebSecurityOrigin(const QWebSecurityOrigin &other);
33+
~QWebSecurityOrigin();
34+
static QList<QWebSecurityOrigin> allOrigins();
35+
QString scheme() const;
36+
QString host() const;
37+
int port() const;
38+
qint64 databaseUsage() const;
39+
qint64 databaseQuota() const;
40+
void setDatabaseQuota(qint64 quota);
41+
QList<QWebDatabase> databases() const;
42+
%If (Qt_4_6_0 -)
43+
static void addLocalScheme(const QString &scheme);
44+
%End
45+
%If (Qt_4_6_0 -)
46+
static void removeLocalScheme(const QString &scheme);
47+
%End
48+
%If (Qt_4_6_0 -)
49+
static QStringList localSchemes();
50+
%End
51+
%If (Qt_4_8_0 -)
52+
void setApplicationCacheQuota(qint64 quota);
53+
%End
54+
};
55+
56+
%End

‎python/QtWebKit/qwebsettings.sip

Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
// qwebsettings.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_4_0 -)
24+
25+
class QWebSettings
26+
{
27+
%TypeHeaderCode
28+
#include <qwebsettings.h>
29+
%End
30+
31+
public:
32+
enum FontFamily
33+
{
34+
StandardFont,
35+
FixedFont,
36+
SerifFont,
37+
SansSerifFont,
38+
CursiveFont,
39+
FantasyFont,
40+
};
41+
42+
enum WebAttribute
43+
{
44+
AutoLoadImages,
45+
JavascriptEnabled,
46+
JavaEnabled,
47+
PluginsEnabled,
48+
PrivateBrowsingEnabled,
49+
JavascriptCanOpenWindows,
50+
%If (Qt_4_8_0 -)
51+
JavascriptCanCloseWindows,
52+
%End
53+
JavascriptCanAccessClipboard,
54+
DeveloperExtrasEnabled,
55+
LinksIncludedInFocusChain,
56+
%If (Qt_4_5_0 -)
57+
ZoomTextOnly,
58+
%End
59+
%If (Qt_4_5_0 -)
60+
PrintElementBackgrounds,
61+
%End
62+
%If (Qt_4_5_0 -)
63+
OfflineStorageDatabaseEnabled,
64+
%End
65+
%If (Qt_4_5_0 -)
66+
OfflineWebApplicationCacheEnabled,
67+
%End
68+
%If (Qt_4_5_0 -)
69+
LocalStorageDatabaseEnabled,
70+
%End
71+
%If (Qt_4_6_0 -)
72+
LocalStorageEnabled,
73+
%End
74+
%If (Qt_4_6_0 -)
75+
LocalContentCanAccessRemoteUrls,
76+
%End
77+
%If (Qt_4_6_0 -)
78+
DnsPrefetchEnabled,
79+
%End
80+
%If (Qt_4_7_0 -)
81+
XSSAuditingEnabled,
82+
%End
83+
%If (Qt_4_7_0 -)
84+
AcceleratedCompositingEnabled,
85+
%End
86+
%If (Qt_4_7_0 -)
87+
SpatialNavigationEnabled,
88+
%End
89+
%If (Qt_4_7_0 -)
90+
LocalContentCanAccessFileUrls,
91+
%End
92+
%If (Qt_4_7_0 -)
93+
TiledBackingStoreEnabled,
94+
%End
95+
%If (Qt_4_7_0 -)
96+
FrameFlatteningEnabled,
97+
%End
98+
%If (Qt_4_7_0 -)
99+
SiteSpecificQuirksEnabled,
100+
%End
101+
%If (Qt_4_8_0 -)
102+
WebGLEnabled,
103+
%End
104+
%If (Qt_4_8_0 -)
105+
HyperlinkAuditingEnabled,
106+
%End
107+
%If (Qt_5_0_0 -)
108+
CSSRegionsEnabled,
109+
%End
110+
%If (Qt_5_0_0 -)
111+
CSSGridLayoutEnabled,
112+
%End
113+
%If (Qt_5_0_0 -)
114+
ScrollAnimatorEnabled,
115+
%End
116+
%If (Qt_5_0_0 -)
117+
CaretBrowsingEnabled,
118+
%End
119+
%If (Qt_5_0_0 -)
120+
NotificationsEnabled,
121+
%End
122+
};
123+
124+
enum WebGraphic
125+
{
126+
MissingImageGraphic,
127+
MissingPluginGraphic,
128+
DefaultFrameIconGraphic,
129+
TextAreaSizeGripCornerGraphic,
130+
%If (Qt_4_8_0 -)
131+
InputSpeechButtonGraphic,
132+
%End
133+
%If (Qt_4_8_0 -)
134+
SearchCancelButtonGraphic,
135+
%End
136+
%If (Qt_4_8_0 -)
137+
SearchCancelButtonPressedGraphic,
138+
%End
139+
};
140+
141+
enum FontSize
142+
{
143+
MinimumFontSize,
144+
MinimumLogicalFontSize,
145+
DefaultFontSize,
146+
DefaultFixedFontSize,
147+
};
148+
149+
static QWebSettings *globalSettings();
150+
void setFontFamily(QWebSettings::FontFamily which, const QString &family);
151+
QString fontFamily(QWebSettings::FontFamily which) const;
152+
void resetFontFamily(QWebSettings::FontFamily which);
153+
void setFontSize(QWebSettings::FontSize type, int size);
154+
int fontSize(QWebSettings::FontSize type) const;
155+
void resetFontSize(QWebSettings::FontSize type);
156+
void setAttribute(QWebSettings::WebAttribute attr, bool on);
157+
bool testAttribute(QWebSettings::WebAttribute attr) const;
158+
void resetAttribute(QWebSettings::WebAttribute attr);
159+
void setUserStyleSheetUrl(const QUrl &location);
160+
QUrl userStyleSheetUrl() const;
161+
static void setIconDatabasePath(const QString &location);
162+
static QString iconDatabasePath();
163+
static void clearIconDatabase();
164+
static QIcon iconForUrl(const QUrl &url);
165+
static void setWebGraphic(QWebSettings::WebGraphic type, const QPixmap &graphic);
166+
static QPixmap webGraphic(QWebSettings::WebGraphic type);
167+
static void setMaximumPagesInCache(int pages);
168+
static int maximumPagesInCache();
169+
static void setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity);
170+
171+
private:
172+
QWebSettings();
173+
QWebSettings(const QWebSettings &);
174+
~QWebSettings();
175+
176+
public:
177+
%If (Qt_4_5_0 -)
178+
static void setOfflineStoragePath(const QString &path);
179+
%End
180+
%If (Qt_4_5_0 -)
181+
static QString offlineStoragePath();
182+
%End
183+
%If (Qt_4_5_0 -)
184+
static void setOfflineStorageDefaultQuota(qint64 maximumSize);
185+
%End
186+
%If (Qt_4_5_0 -)
187+
static qint64 offlineStorageDefaultQuota();
188+
%End
189+
%If (Qt_4_6_0 -)
190+
void setDefaultTextEncoding(const QString &encoding);
191+
%End
192+
%If (Qt_4_6_0 -)
193+
QString defaultTextEncoding() const;
194+
%End
195+
%If (Qt_4_6_0 -)
196+
static void setOfflineWebApplicationCachePath(const QString &path);
197+
%End
198+
%If (Qt_4_6_0 -)
199+
static QString offlineWebApplicationCachePath();
200+
%End
201+
%If (Qt_4_6_0 -)
202+
static void setOfflineWebApplicationCacheQuota(qint64 maximumSize);
203+
%End
204+
%If (Qt_4_6_0 -)
205+
static qint64 offlineWebApplicationCacheQuota();
206+
%End
207+
%If (Qt_4_6_0 -)
208+
void setLocalStoragePath(const QString &path);
209+
%End
210+
%If (Qt_4_6_0 -)
211+
QString localStoragePath() const;
212+
%End
213+
%If (Qt_4_6_0 -)
214+
static void clearMemoryCaches();
215+
%End
216+
%If (Qt_4_6_0 -)
217+
static void enablePersistentStorage(const QString &path = QString());
218+
%End
219+
%If (Qt_5_0_0 -)
220+
221+
enum ThirdPartyCookiePolicy
222+
{
223+
AlwaysAllowThirdPartyCookies,
224+
AlwaysBlockThirdPartyCookies,
225+
AllowThirdPartyWithExistingCookies,
226+
};
227+
228+
%End
229+
%If (Qt_5_0_0 -)
230+
void setThirdPartyCookiePolicy(QWebSettings::ThirdPartyCookiePolicy);
231+
%End
232+
%If (Qt_5_0_0 -)
233+
QWebSettings::ThirdPartyCookiePolicy thirdPartyCookiePolicy() const;
234+
%End
235+
};
236+
237+
%End

‎python/QtWebKit/qwebview.sip

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
// qwebview.sip generated by MetaSIP
2+
//
3+
// This file is part of the QtWebKit Python extension module.
4+
//
5+
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
6+
//
7+
// This file is part of PyQt4.
8+
//
9+
// This file may be used under the terms of the GNU General Public License
10+
// version 3.0 as published by the Free Software Foundation and appearing in
11+
// the file LICENSE included in the packaging of this file. Please review the
12+
// following information to ensure the GNU General Public License version 3.0
13+
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14+
//
15+
// If you do not wish to use this file under the terms of the GPL version 3.0
16+
// then you may purchase a commercial license. For more information contact
17+
// info@riverbankcomputing.com.
18+
//
19+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20+
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21+
22+
23+
%If (Qt_4_4_0 -)
24+
25+
class QWebView : QWidget
26+
{
27+
%TypeHeaderCode
28+
#include <qwebview.h>
29+
%End
30+
31+
%ConvertToSubClassCode
32+
static struct class_graph {
33+
const char *name;
34+
sipTypeDef **type;
35+
int yes, no;
36+
} graph[] = {
37+
{sipName_QWebPluginFactory, &sipType_QWebPluginFactory, -1, 1},
38+
{sipName_QWebFrame, &sipType_QWebFrame, -1, 2},
39+
{sipName_QWebPage, &sipType_QWebPage, -1, 3},
40+
{sipName_QWebHistoryInterface, &sipType_QWebHistoryInterface, -1, 4},
41+
{sipName_QWebView, &sipType_QWebView, -1, 5},
42+
#if QT_VERSION >= 0x040600
43+
{sipName_QWebInspector, &sipType_QWebInspector, -1, 6},
44+
{sipName_QGraphicsWebView, &sipType_QGraphicsWebView, -1, -1},
45+
#else
46+
{0, 0, -1, 6},
47+
{0, 0, -1, -1},
48+
#endif
49+
};
50+
51+
int i = 0;
52+
53+
sipType = 0;
54+
55+
do
56+
{
57+
struct class_graph *cg = &graph[i];
58+
59+
if (cg->name != NULL && sipCpp->inherits(cg->name))
60+
{
61+
sipType = *cg->type;
62+
i = cg->yes;
63+
}
64+
else
65+
i = cg->no;
66+
}
67+
while (i >= 0);
68+
%End
69+
70+
public:
71+
explicit QWebView(QWidget *parent /TransferThis/ = 0);
72+
virtual ~QWebView();
73+
QWebPage *page() const;
74+
void setPage(QWebPage *page /KeepReference/);
75+
void load(const QUrl &url) /ReleaseGIL/;
76+
void load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray &body = QByteArray()) /ReleaseGIL/;
77+
void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
78+
void setContent(const QByteArray &data, const QString &mimeType /DocValue="Py_v3:''"/ = QString(), const QUrl &baseUrl = QUrl());
79+
QWebHistory *history() const;
80+
QWebSettings *settings() const;
81+
QString title() const;
82+
void setUrl(const QUrl &url);
83+
QUrl url() const;
84+
QIcon icon() const;
85+
QString selectedText() const;
86+
QAction *pageAction(QWebPage::WebAction action) const;
87+
void triggerPageAction(QWebPage::WebAction action, bool checked = false);
88+
bool isModified() const;
89+
virtual QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
90+
virtual QSize sizeHint() const;
91+
void setTextSizeMultiplier(qreal factor);
92+
qreal textSizeMultiplier() const;
93+
bool findText(const QString &subString, QFlags<QWebPage::FindFlag> options = 0);
94+
virtual bool event(QEvent *);
95+
96+
public slots:
97+
void stop();
98+
void back();
99+
void forward();
100+
void reload();
101+
%If (PyQt_Printer)
102+
void print(QPrinter *printer) const /PyName=print_/;
103+
%End
104+
%If (Py_v3)
105+
%If (PyQt_Printer)
106+
void print(QPrinter *printer) const;
107+
%End
108+
%End
109+
110+
signals:
111+
void loadStarted();
112+
void loadProgress(int progress);
113+
void loadFinished(bool);
114+
void titleChanged(const QString &title);
115+
void statusBarMessage(const QString &text);
116+
void linkClicked(const QUrl &url);
117+
void selectionChanged();
118+
void iconChanged();
119+
void urlChanged(const QUrl &url);
120+
121+
protected:
122+
virtual QWebView *createWindow(QWebPage::WebWindowType type);
123+
virtual void resizeEvent(QResizeEvent *e);
124+
virtual void paintEvent(QPaintEvent *ev);
125+
virtual void changeEvent(QEvent *);
126+
virtual void mouseMoveEvent(QMouseEvent *);
127+
virtual void mousePressEvent(QMouseEvent *);
128+
virtual void mouseDoubleClickEvent(QMouseEvent *);
129+
virtual void mouseReleaseEvent(QMouseEvent *);
130+
virtual void contextMenuEvent(QContextMenuEvent *);
131+
virtual void wheelEvent(QWheelEvent *);
132+
virtual void keyPressEvent(QKeyEvent *);
133+
virtual void keyReleaseEvent(QKeyEvent *);
134+
virtual void dragEnterEvent(QDragEnterEvent *);
135+
virtual void dragLeaveEvent(QDragLeaveEvent *);
136+
virtual void dragMoveEvent(QDragMoveEvent *);
137+
virtual void dropEvent(QDropEvent *);
138+
virtual void focusInEvent(QFocusEvent *);
139+
virtual void focusOutEvent(QFocusEvent *);
140+
virtual void inputMethodEvent(QInputMethodEvent *);
141+
virtual bool focusNextPrevChild(bool next);
142+
143+
public:
144+
%If (Qt_4_5_0 -)
145+
qreal zoomFactor() const;
146+
%End
147+
%If (Qt_4_5_0 -)
148+
void setZoomFactor(qreal factor);
149+
%End
150+
%If (Qt_4_6_0 -)
151+
QFlags<QPainter::RenderHint> renderHints() const;
152+
%End
153+
%If (Qt_4_6_0 -)
154+
void setRenderHints(QFlags<QPainter::RenderHint> hints);
155+
%End
156+
%If (Qt_4_6_0 -)
157+
void setRenderHint(QPainter::RenderHint hint, bool enabled = true);
158+
%End
159+
%If (Qt_4_8_0 -)
160+
bool hasSelection() const;
161+
%End
162+
%If (Qt_4_8_0 -)
163+
QString selectedHtml() const;
164+
%End
165+
};
166+
167+
%End

0 commit comments

Comments
 (0)
Please sign in to comment.