20 #ifndef PLASMA_WEBVIEW_H
21 #define PLASMA_WEBVIEW_H
24 #include <QtGui/QGraphicsWidget>
31 class QGraphicsSceneDragDropEvent;
32 class QGraphicsSceneMouseEvent;
33 class QGraphicsSceneWheelEvent;
50 Q_PROPERTY(KUrl url READ url WRITE setUrl)
51 Q_PROPERTY(QString html READ html WRITE setHtml)
52 Q_PROPERTY(
bool dragToScroll READ dragToScroll WRITE setDragToScroll)
53 Q_PROPERTY(QPointF scrollPosition READ scrollPosition WRITE setScrollPosition)
54 Q_PROPERTY(QSizeF contentsSize READ contentsSize)
55 Q_PROPERTY(QRectF viewportGeometry READ viewportGeometry)
56 Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
59 explicit
WebView(QGraphicsItem *parent = 0);
67 void setUrl(const KUrl &url);
81 void setHtml(const QByteArray &html, const KUrl &baseUrl = KUrl());
95 void setHtml(const QString &html, const KUrl &baseUrl = KUrl());
100 QRectF geometry() const;
106 QSizeF contentsSize() const;
112 void setScrollPosition(const QPointF &position);
118 QPointF scrollPosition() const;
124 QRectF viewportGeometry() const;
131 qreal zoomFactor() const;
138 void setZoomFactor(const qreal zoom);
147 void setPage(QWebPage *page);
153 QWebPage *page() const;
158 QWebFrame *mainFrame() const;
164 void setDragToScroll(
bool drag);
175 void setGeometry(const QRectF &geometry);
209 void loadProgress(
int percent);
217 void loadFinished(
bool success);
223 void urlChanged(const QUrl &url);
230 void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
231 void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
232 void mousePressEvent(QGraphicsSceneMouseEvent *event);
233 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
234 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
235 void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
236 void wheelEvent(QGraphicsSceneWheelEvent *event);
237 void keyPressEvent(QKeyEvent * event);
238 void keyReleaseEvent(QKeyEvent * event);
239 void focusInEvent(QFocusEvent * event);
240 void focusOutEvent(QFocusEvent * event);
241 void dragEnterEvent(QGraphicsSceneDragDropEvent * event);
242 void dragLeaveEvent(QGraphicsSceneDragDropEvent * event);
243 void dragMoveEvent(QGraphicsSceneDragDropEvent * event);
244 void dropEvent(QGraphicsSceneDragDropEvent * event);
245 QVariant itemChange(GraphicsItemChange change, const QVariant &value);
246 QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
249 Q_PRIVATE_SLOT(d,
void loadingFinished(
bool success))
251 WebViewPrivate * const d;
252 friend class WebViewPrivate;
257 #endif // Multiple incluson guard
Provides a widget to display html content in Plasma.