#ifndef PageWidgetDelegate_h
#define PageWidgetDelegate_h
#include "WebWidget.h"
#include "core/page/Page.h"
#include "public/platform/WebCanvas.h"
#include "wtf/OwnPtr.h"
namespace WebCore {
class LocalFrame;
class Page;
}
namespace blink {
class PageOverlayList;
class WebGestureEvent;
class WebInputEvent;
class WebKeyboardEvent;
class WebMouseEvent;
class WebMouseWheelEvent;
class WebTouchEvent;
class PageWidgetEventHandler {
public:
virtual void handleMouseMove(WebCore::LocalFrame& mainFrame, const WebMouseEvent&);
virtual void handleMouseLeave(WebCore::LocalFrame& mainFrame, const WebMouseEvent&);
virtual void handleMouseDown(WebCore::LocalFrame& mainFrame, const WebMouseEvent&);
virtual void handleMouseUp(WebCore::LocalFrame& mainFrame, const WebMouseEvent&);
virtual bool handleMouseWheel(WebCore::LocalFrame& mainFrame, const WebMouseWheelEvent&);
virtual bool handleKeyEvent(const WebKeyboardEvent&) = 0;
virtual bool handleCharEvent(const WebKeyboardEvent&) = 0;
virtual bool handleGestureEvent(const WebGestureEvent&) = 0;
virtual bool handleTouchEvent(WebCore::LocalFrame& mainFrame, const WebTouchEvent&);
virtual ~PageWidgetEventHandler() { }
};
class PageWidgetDelegate {
public:
enum CanvasBackground {
Opaque,
Translucent,
};
static void animate(WebCore::Page*, double monotonicFrameBeginTime);
static void layout(WebCore::Page*);
static void paint(WebCore::Page*, PageOverlayList*, WebCanvas*, const WebRect&, CanvasBackground);
static bool handleInputEvent(WebCore::Page*, PageWidgetEventHandler&, const WebInputEvent&);
private:
PageWidgetDelegate() { }
};
}
#endif