Home | History | Annotate | Download | only in input
      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 MotionEventAndroid;
     15 
     16 class WebMouseEventBuilder {
     17  public:
     18   static blink::WebMouseEvent Build(blink::WebInputEvent::Type type,
     19                                     blink::WebMouseEvent::Button button,
     20                                     double time_sec,
     21                                     int window_x,
     22                                     int window_y,
     23                                     int modifiers,
     24                                     int click_count);
     25 };
     26 
     27 class WebMouseWheelEventBuilder {
     28  public:
     29   enum Direction {
     30     DIRECTION_UP,
     31     DIRECTION_DOWN,
     32     DIRECTION_LEFT,
     33     DIRECTION_RIGHT,
     34   };
     35 
     36   static blink::WebMouseWheelEvent Build(Direction direction,
     37                                          double time_sec,
     38                                          int window_x,
     39                                          int window_y);
     40 };
     41 
     42 class WebKeyboardEventBuilder {
     43  public:
     44   static blink::WebKeyboardEvent Build(blink::WebInputEvent::Type type,
     45                                        int modifiers,
     46                                        double time_sec,
     47                                        int keycode,
     48                                        int unicode_character,
     49                                        bool is_system_key);
     50 };
     51 
     52 class WebGestureEventBuilder {
     53  public:
     54   static blink::WebGestureEvent Build(blink::WebInputEvent::Type type,
     55                                       double time_sec,
     56                                       int x,
     57                                       int y);
     58 };
     59 
     60 }  // namespace content
     61 
     62 #endif  // CONTENT_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_BUILDERS_ANDROID_H_
     63