GestureStateListener.java revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
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
5package org.chromium.content_public.browser;
6
7/**
8 * A class that is notified of events and state changes related to gesture processing from
9 * the ContentViewCore.
10 */
11public class GestureStateListener {
12    /**
13     * Called when the pinch gesture starts.
14     */
15    public void onPinchStarted() {}
16
17    /**
18     * Called when the pinch gesture ends.
19     */
20    public void onPinchEnded() {}
21
22    /**
23     * Called when a fling starts.
24     */
25    public void onFlingStartGesture(int vx, int vy, int scrollOffsetY, int scrollExtentY) {}
26
27    /**
28     * Called when a fling is cancelled.
29     */
30    public void onFlingCancelGesture() {}
31
32    /**
33     * Called when a fling has ended.
34     */
35    public void onFlingEndGesture(int scrollOffsetY, int scrollExtentY) {}
36
37    /**
38     * Called when a fling event was not handled by the renderer.
39     */
40    public void onUnhandledFlingStartEvent(int vx, int vy) {}
41
42    /**
43     * Called to indicate that a scroll update gesture had been consumed by the page.
44     * This callback is called whenever any layer is scrolled (like a frame or div). It is
45     * not called when a JS touch handler consumes the event (preventDefault), it is not called
46     * for JS-initiated scrolling.
47     */
48    public void onScrollUpdateGestureConsumed() {}
49
50    /*
51     * Called when a scroll gesture has started.
52     */
53    public void onScrollStarted(int scrollOffsetY, int scrollExtentY) {}
54
55    /*
56     * Called when a scroll gesture has stopped.
57     */
58    public void onScrollEnded(int scrollOffsetY, int scrollExtentY) {}
59
60    /*
61     * Called when the scroll offsets or extents may have changed.
62     */
63    public void onScrollOffsetOrExtentChanged(int scrollOffsetY, int scrollExtentY) {}
64}
65