Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / android_webview / java / src / org / chromium / android_webview / AwViewMethods.java
1 // Copyright 2014 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 package org.chromium.android_webview;
6
7 import android.content.res.Configuration;
8 import android.graphics.Canvas;
9 import android.graphics.Paint;
10 import android.graphics.Rect;
11 import android.view.KeyEvent;
12 import android.view.MotionEvent;
13 import android.view.View;
14 import android.view.inputmethod.EditorInfo;
15 import android.view.inputmethod.InputConnection;
16
17 /**
18  * An interface that defines a subset of the {@link View} functionality.
19  *
20  * <p>This interface allows us to hook up drawing and input related methods to the
21  * {@link AwContents}'s consumer in embedded mode, and to the {@link FullScreenView}
22  * in fullscreen mode.
23  */
24 interface AwViewMethods {
25
26     /**
27      * @see android.view.View#onDraw
28      */
29     void onDraw(Canvas canvas);
30
31     /**
32      * @see android.view.View#onMeasure
33      */
34     void onMeasure(int widthMeasureSpec, int heightMeasureSpec);
35
36     /**
37      * @see android.view.View#requestFocus
38      */
39     void requestFocus();
40
41     /**
42      * @see android.view.View#setLayerType
43      */
44     void setLayerType(int layerType, Paint paint);
45
46     /**
47      * @see android.view.View#onCreateInputConnection
48      */
49     InputConnection onCreateInputConnection(EditorInfo outAttrs);
50
51     /**
52      * @see android.view.View#onKeyUp
53      */
54     boolean onKeyUp(int keyCode, KeyEvent event);
55
56     /**
57      * @see android.view.View#dispatchKeyEvent
58      */
59     boolean dispatchKeyEvent(KeyEvent event);
60
61     /**
62      * @see android.view.View#onTouchEvent
63      */
64     boolean onTouchEvent(MotionEvent event);
65
66     /**
67      * @see android.view.View#onHoverEvent
68      */
69     boolean onHoverEvent(MotionEvent event);
70
71     /**
72      * @see android.view.View#onGenericMotionEvent
73      */
74     boolean onGenericMotionEvent(MotionEvent event);
75
76     /**
77      * @see android.view.View#onConfigurationChanged
78      */
79     void onConfigurationChanged(Configuration newConfig);
80
81     /**
82      * @see android.view.View#onAttachedToWindow
83      */
84     void onAttachedToWindow();
85
86     /**
87      * @see android.view.View#onDetachedFromWindow
88      */
89     void onDetachedFromWindow();
90
91     /**
92      * @see android.view.View#onWindowFocusChanged
93      */
94     void onWindowFocusChanged(boolean hasWindowFocus);
95
96     /**
97      * @see android.view.View#onFocusChanged
98      */
99     void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect);
100
101     /**
102      * @see android.view.View#onSizeChanged
103      */
104     void onSizeChanged(int w, int h, int ow, int oh);
105
106     /**
107      * @see android.view.View#onVisibilityChanged
108      */
109     void onVisibilityChanged(View changedView, int visibility);
110
111     /**
112      * @see android.view.View#onWindowVisibilityChanged
113      */
114     void onWindowVisibilityChanged(int visibility);
115
116     /**
117      * @see android.view.View#onScrollChanged
118      */
119     void onContainerViewScrollChanged(int l, int t, int oldl, int oldt);
120
121     /**
122      * @see android.view.View#onOverScrolled
123      */
124     void onContainerViewOverScrolled(
125             int scrollX, int scrollY, boolean clampedX, boolean clampedY);
126
127     /**
128      * @see android.view.View#computeHorizontalScrollRange
129      */
130     int computeHorizontalScrollRange();
131
132     /**
133      * @see android.view.View#computeHorizontalScrollOffset
134      */
135     int computeHorizontalScrollOffset();
136
137     /**
138      * @see android.view.View#computeVerticalScrollRange
139      */
140     int computeVerticalScrollRange();
141
142     /**
143      * @see android.view.View#computeVerticalScrollOffset
144      */
145     int computeVerticalScrollOffset();
146
147     /**
148      * @see android.view.View#computeVerticalScrollExtent
149      */
150     int computeVerticalScrollExtent();
151
152     /**
153      * @see android.view.View#computeScroll
154      */
155     void computeScroll();
156 }