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.
5 package org.chromium.android_webview;
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;
18 * An interface that defines a subset of the {@link View} functionality.
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}
24 interface AwViewMethods {
27 * @see android.view.View#onDraw
29 void onDraw(Canvas canvas);
32 * @see android.view.View#onMeasure
34 void onMeasure(int widthMeasureSpec, int heightMeasureSpec);
37 * @see android.view.View#requestFocus
42 * @see android.view.View#setLayerType
44 void setLayerType(int layerType, Paint paint);
47 * @see android.view.View#onCreateInputConnection
49 InputConnection onCreateInputConnection(EditorInfo outAttrs);
52 * @see android.view.View#onKeyUp
54 boolean onKeyUp(int keyCode, KeyEvent event);
57 * @see android.view.View#dispatchKeyEvent
59 boolean dispatchKeyEvent(KeyEvent event);
62 * @see android.view.View#onTouchEvent
64 boolean onTouchEvent(MotionEvent event);
67 * @see android.view.View#onHoverEvent
69 boolean onHoverEvent(MotionEvent event);
72 * @see android.view.View#onGenericMotionEvent
74 boolean onGenericMotionEvent(MotionEvent event);
77 * @see android.view.View#onConfigurationChanged
79 void onConfigurationChanged(Configuration newConfig);
82 * @see android.view.View#onAttachedToWindow
84 void onAttachedToWindow();
87 * @see android.view.View#onDetachedFromWindow
89 void onDetachedFromWindow();
92 * @see android.view.View#onWindowFocusChanged
94 void onWindowFocusChanged(boolean hasWindowFocus);
97 * @see android.view.View#onFocusChanged
99 void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect);
102 * @see android.view.View#onSizeChanged
104 void onSizeChanged(int w, int h, int ow, int oh);
107 * @see android.view.View#onVisibilityChanged
109 void onVisibilityChanged(View changedView, int visibility);
112 * @see android.view.View#onWindowVisibilityChanged
114 void onWindowVisibilityChanged(int visibility);
117 * @see android.view.View#onScrollChanged
119 void onContainerViewScrollChanged(int l, int t, int oldl, int oldt);
122 * @see android.view.View#onOverScrolled
124 void onContainerViewOverScrolled(
125 int scrollX, int scrollY, boolean clampedX, boolean clampedY);
128 * @see android.view.View#computeHorizontalScrollRange
130 int computeHorizontalScrollRange();
133 * @see android.view.View#computeHorizontalScrollOffset
135 int computeHorizontalScrollOffset();
138 * @see android.view.View#computeVerticalScrollRange
140 int computeVerticalScrollRange();
143 * @see android.view.View#computeVerticalScrollOffset
145 int computeVerticalScrollOffset();
148 * @see android.view.View#computeVerticalScrollExtent
150 int computeVerticalScrollExtent();
153 * @see android.view.View#computeScroll
155 void computeScroll();