|
| 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 |
0 commit comments