#ifndef qrawwebview_p_h
#define qrawwebview_p_h
#include "qwebkitglobal.h"
#include <WebKit2/WKContext.h>
#include <WebKit2/WKPage.h>
#include <WebKit2/WKPageGroup.h>
QT_BEGIN_NAMESPACE
class QRect;
class QRectF;
class QPoint;
class QSize;
class QKeyEvent;
class QMouseEvent;
class QWheelEvent;
class QTouchEvent;
class QUrl;
class QMatrix4x4;
class QCursor;
QT_END_NAMESPACE
class QRawWebViewPrivate;
namespace WebCore {
class CoordinatedGraphicsScene;
}
class QRawWebViewClient {
public:
virtual ~QRawWebViewClient() { }
virtual void viewNeedsDisplay(const QRect&) = 0;
virtual void viewRequestedScroll(const QPoint&) = 0;
virtual void viewProcessCrashed() = 0;
virtual void viewProcessRelaunched() = 0;
virtual void viewContentSizeChanged(const QSize&) = 0;
virtual void viewRequestedCursorOverride(const QCursor&) = 0;
virtual void doneWithKeyEvent(const QKeyEvent*, bool wasHandled) = 0;
virtual void doneWithTouchEvent(const QTouchEvent*, bool wasHandled) = 0;
};
class QWEBKIT_EXPORT QRawWebView {
public:
QRawWebView(WKContextRef, WKPageGroupRef, QRawWebViewClient*);
~QRawWebView();
void create();
void setSize(const QSize&);
QSize size() const;
void setFocused(bool);
bool isFocused() const;
void setVisible(bool);
bool isVisible() const;
void setActive(bool);
bool isActive() const;
void setTransparentBackground(bool);
bool transparentBackground() const;
void setDrawBackground(bool);
bool drawBackground() const;
void paint(const QMatrix4x4& transform, float opacity, unsigned paintFlags);
WKPageRef pageRef();
void sendKeyEvent(QKeyEvent*);
void sendMouseEvent(QMouseEvent*, int clickCount = 0);
void sendWheelEvent(QWheelEvent*);
void sendTouchEvent(QTouchEvent*);
private:
WebCore::CoordinatedGraphicsScene* coordinatedGraphicsScene() const;
QRawWebViewPrivate* d;
};
#endif // qrawwebview_p_h