1 /*************************************************************************** 2 3 ---------------------------------------------------- 4 date : 19.5.2015 5 copyright : (C) 2015 by Matthias Kuhn 6 email : matthias (at) opengis.ch 7 *************************************************************************** 8 * * 9 * This program is free software; you can redistribute it and/or modify * 10 * it under the terms of the GNU General Public License as published by * 11 * the Free Software Foundation; either version 2 of the License, or * 12 * (at your option) any later version. * 13 * * 14 ***************************************************************************/ 15 16 #ifndef QGSWEBFRAME_H 17 #define QGSWEBFRAME_H 18 19 #define SIP_NO_FILE 20 21 #include "qgis_core.h" 22 23 #ifdef WITH_QTWEBKIT 24 #include <QWebFrame> 25 #else 26 27 #include <QObject> 28 #include <QPainter> 29 #include <QUrl> 30 #include <QVariant> 31 32 /** 33 * \ingroup core 34 * \brief The QWebFrame class is a collection of stubs to mimic the API of a QWebFrame on systems 35 * where QtWebkit is not available. 36 */ 37 class CORE_EXPORT QWebFrame : public QObject 38 { 39 /// @cond NOT_STABLE_API 40 Q_OBJECT 41 42 public: 43 QWebFrame( QObject *parent = nullptr ) QObject(parent)44 : QObject( parent ) 45 { 46 47 } 48 setZoomFactor(qreal factor)49 void setZoomFactor( qreal factor ) 50 { 51 Q_UNUSED( factor ) 52 } 53 setScrollBarPolicy(Qt::Orientation orientation,Qt::ScrollBarPolicy scrollbarpolicy)54 void setScrollBarPolicy( Qt::Orientation orientation, Qt::ScrollBarPolicy scrollbarpolicy ) 55 { 56 Q_UNUSED( orientation ) 57 Q_UNUSED( scrollbarpolicy ) 58 } 59 60 void setHtml( const QString &html, const QUrl &url = QUrl() ) 61 { 62 Q_UNUSED( html ) 63 Q_UNUSED( url ) 64 emit loadFinished( true ); 65 } 66 contentsSize()67 QSize contentsSize() const 68 { 69 return QSize(); 70 } 71 72 void render( QPainter *, const QRegion = QRegion() ) 73 { 74 75 } 76 addToJavaScriptWindowObject(const QString &,QObject *)77 void addToJavaScriptWindowObject( const QString &, QObject * ) 78 { 79 80 } 81 evaluateJavaScript(const QString &)82 QVariant evaluateJavaScript( const QString & ) 83 { 84 return QVariant(); 85 } 86 87 signals: 88 void loadFinished( bool ok ); 89 90 void javaScriptWindowObjectCleared(); 91 /// @endcond 92 }; 93 #endif 94 #endif // QGSWEBFRAME_H 95