be9d2a168e91ed356f41321571cf5fe418f8ecac
[platform/framework/web/crosswalk.git] / src / content / browser / renderer_host / input / web_input_event_builders_android.h
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_BUILDERS_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_BUILDERS_ANDROID_H_
7
8 #include <jni.h>
9
10 #include "third_party/WebKit/public/web/WebInputEvent.h"
11
12 namespace content {
13
14 class WebMouseEventBuilder {
15  public:
16   static blink::WebMouseEvent Build(blink::WebInputEvent::Type type,
17                                     blink::WebMouseEvent::Button button,
18                                     double time_sec,
19                                     int window_x,
20                                     int window_y,
21                                     int modifiers,
22                                     int click_count);
23 };
24
25 class WebMouseWheelEventBuilder {
26  public:
27   enum Direction {
28     DIRECTION_UP,
29     DIRECTION_DOWN,
30     DIRECTION_LEFT,
31     DIRECTION_RIGHT,
32   };
33
34   static blink::WebMouseWheelEvent Build(Direction direction,
35                                          double time_sec,
36                                          int window_x,
37                                          int window_y);
38 };
39
40 class WebKeyboardEventBuilder {
41  public:
42   static blink::WebKeyboardEvent Build(blink::WebInputEvent::Type type,
43                                        int modifiers,
44                                        double time_sec,
45                                        int keycode,
46                                        int unicode_character,
47                                        bool is_system_key);
48 };
49
50 class WebGestureEventBuilder {
51  public:
52   static blink::WebGestureEvent Build(blink::WebInputEvent::Type type,
53                                       double time_sec,
54                                       int x,
55                                       int y);
56 };
57
58 class WebTouchEventBuilder {
59  public:
60   static blink::WebTouchEvent Build(jobject motion_event, float dpi_scale);
61 };
62
63 }  // namespace content
64
65 #endif  // CONTENT_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_BUILDERS_ANDROID_H_