summaryrefslogtreecommitdiffstats
path: root/src/imports/webkit/qdeclarativewebview_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-05-10 10:45:27 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-05-13 15:57:22 (GMT)
commit3c1cb52aae6f7a5bd94c28a0b183e2375526724b (patch)
tree444168fc9292afe8a2d288ee9659745347ae6c21 /src/imports/webkit/qdeclarativewebview_p.h
parentb3cf8db56491642443f4eea86a12e3d0eb869217 (diff)
downloadQt-3c1cb52aae6f7a5bd94c28a0b183e2375526724b.zip
Qt-3c1cb52aae6f7a5bd94c28a0b183e2375526724b.tar.gz
Qt-3c1cb52aae6f7a5bd94c28a0b183e2375526724b.tar.bz2
Removed dependency of QDeclarativeWebView to private Qt (Declarative) API
Exchanged the use of QDeclarativePaintedItem with the use of QGraphicsWebView and its tiled backing store.
Diffstat (limited to 'src/imports/webkit/qdeclarativewebview_p.h')
-rw-r--r--src/imports/webkit/qdeclarativewebview_p.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/imports/webkit/qdeclarativewebview_p.h b/src/imports/webkit/qdeclarativewebview_p.h
index 81581d8..87bd938 100644
--- a/src/imports/webkit/qdeclarativewebview_p.h
+++ b/src/imports/webkit/qdeclarativewebview_p.h
@@ -42,12 +42,13 @@
#ifndef QDECLARATIVEWEBVIEW_H
#define QDECLARATIVEWEBVIEW_H
-#include <private/qdeclarativepainteditem_p.h>
+#include <qdeclarativeitem.h>
#include <QtGui/QAction>
#include <QtCore/QUrl>
#include <QtNetwork/qnetworkaccessmanager.h>
#include <QtWebKit/QWebPage>
+#include <QtWebKit/QGraphicsWebView>
QT_BEGIN_HEADER
@@ -61,6 +62,7 @@ class QDeclarativeWebSettings;
class QDeclarativeWebViewPrivate;
class QNetworkRequest;
class QDeclarativeWebView;
+class QDeclarativeWebViewPrivate;
class QDeclarativeWebPage : public QWebPage
{
@@ -85,7 +87,7 @@ class QDeclarativeWebViewAttached;
//### TODO: browser plugins
-class QDeclarativeWebView : public QDeclarativePaintedItem
+class QDeclarativeWebView : public QDeclarativeItem
{
Q_OBJECT
@@ -120,6 +122,9 @@ class QDeclarativeWebView : public QDeclarativePaintedItem
Q_PROPERTY(bool renderingEnabled READ renderingEnabled WRITE setRenderingEnabled NOTIFY renderingEnabledChanged)
+ Q_PROPERTY(QSize contentsSize READ contentsSize NOTIFY contentsSizeChanged)
+ Q_PROPERTY(qreal contentsScale READ contentsScale WRITE setContentsScale NOTIFY contentsScaleChanged)
+
public:
QDeclarativeWebView(QDeclarativeItem *parent=0);
~QDeclarativeWebView();
@@ -182,6 +187,13 @@ public:
QDeclarativeItem *newWindowParent() const;
void setNewWindowParent(QDeclarativeItem *newWindow);
+ bool isComponentCompletePublic() const { return isComponentComplete(); }
+
+ QSize contentsSize() const;
+
+ void setContentsScale(qreal scale);
+ qreal contentsScale() const;
+
Q_SIGNALS:
void preferredWidthChanged();
void preferredHeightChanged();
@@ -197,6 +209,8 @@ Q_SIGNALS:
void newWindowComponentChanged();
void newWindowParentChanged();
void renderingEnabledChanged();
+ void contentsSizeChanged(const QSize&);
+ void contentsScaleChanged();
void loadStarted();
void loadFinished();
@@ -212,38 +226,36 @@ public Q_SLOTS:
QVariant evaluateJavaScript(const QString&);
private Q_SLOTS:
- void expandToWebPage();
- void paintPage(const QRect&);
void doLoadStarted();
void doLoadProgress(int p);
void doLoadFinished(bool ok);
void setStatusText(const QString&);
void windowObjectCleared();
void pageUrlChanged();
- void noteContentsSizeChanged(const QSize&);
void initialLayout();
-protected:
- void drawContents(QPainter *, const QRect &);
+ void propagateFocusToWebPage(bool);
+ void updateDeclarativeWebViewSize();
+
+protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
void timerEvent(QTimerEvent *event);
void hoverMoveEvent (QGraphicsSceneHoverEvent * event);
- void keyPressEvent(QKeyEvent* event);
- void keyReleaseEvent(QKeyEvent* event);
virtual void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry);
virtual bool sceneEvent(QEvent *event);
QDeclarativeWebView *createWindow(QWebPage::WebWindowType type);
private:
+ void updateContentsSize();
void init();
virtual void componentComplete();
Q_DISABLE_COPY(QDeclarativeWebView)
- Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeWebView)
+ QDeclarativeWebViewPrivate* d;
QMouseEvent *sceneMouseEventToMouseEvent(QGraphicsSceneMouseEvent *);
QMouseEvent *sceneHoverMoveEventToMouseEvent(QGraphicsSceneHoverEvent *);
friend class QDeclarativeWebPage;