Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- |
michael@0 | 2 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | package org.mozilla.gecko.gfx; |
michael@0 | 7 | |
michael@0 | 8 | import org.mozilla.gecko.GeckoAppShell; |
michael@0 | 9 | import org.mozilla.gecko.EventDispatcher; |
michael@0 | 10 | |
michael@0 | 11 | import android.graphics.PointF; |
michael@0 | 12 | import android.view.KeyEvent; |
michael@0 | 13 | import android.view.MotionEvent; |
michael@0 | 14 | import android.view.View; |
michael@0 | 15 | |
michael@0 | 16 | public interface PanZoomController { |
michael@0 | 17 | // The distance the user has to pan before we recognize it as such (e.g. to avoid 1-pixel pans |
michael@0 | 18 | // between the touch-down and touch-up of a click). In units of density-independent pixels. |
michael@0 | 19 | public static final float PAN_THRESHOLD = 1/16f * GeckoAppShell.getDpi(); |
michael@0 | 20 | |
michael@0 | 21 | // Threshold for sending touch move events to content |
michael@0 | 22 | public static final float CLICK_THRESHOLD = 1/50f * GeckoAppShell.getDpi(); |
michael@0 | 23 | |
michael@0 | 24 | static class Factory { |
michael@0 | 25 | static PanZoomController create(PanZoomTarget target, View view, EventDispatcher dispatcher) { |
michael@0 | 26 | return new JavaPanZoomController(target, view, dispatcher); |
michael@0 | 27 | } |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | public void destroy(); |
michael@0 | 31 | |
michael@0 | 32 | public boolean onTouchEvent(MotionEvent event); |
michael@0 | 33 | public boolean onMotionEvent(MotionEvent event); |
michael@0 | 34 | public boolean onKeyEvent(KeyEvent event); |
michael@0 | 35 | public void notifyDefaultActionPrevented(boolean prevented); |
michael@0 | 36 | |
michael@0 | 37 | public boolean getRedrawHint(); |
michael@0 | 38 | public PointF getVelocityVector(); |
michael@0 | 39 | |
michael@0 | 40 | public void pageRectUpdated(); |
michael@0 | 41 | public void abortPanning(); |
michael@0 | 42 | public void abortAnimation(); |
michael@0 | 43 | |
michael@0 | 44 | public void setOverScrollMode(int overscrollMode); |
michael@0 | 45 | public int getOverScrollMode(); |
michael@0 | 46 | |
michael@0 | 47 | public void setOverscrollHandler(final Overscroll controller); |
michael@0 | 48 | } |