michael@0: /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko.gfx; michael@0: michael@0: import org.mozilla.gecko.GeckoAppShell; michael@0: import org.mozilla.gecko.EventDispatcher; michael@0: michael@0: import android.graphics.PointF; michael@0: import android.view.KeyEvent; michael@0: import android.view.MotionEvent; michael@0: import android.view.View; michael@0: michael@0: public interface PanZoomController { michael@0: // The distance the user has to pan before we recognize it as such (e.g. to avoid 1-pixel pans michael@0: // between the touch-down and touch-up of a click). In units of density-independent pixels. michael@0: public static final float PAN_THRESHOLD = 1/16f * GeckoAppShell.getDpi(); michael@0: michael@0: // Threshold for sending touch move events to content michael@0: public static final float CLICK_THRESHOLD = 1/50f * GeckoAppShell.getDpi(); michael@0: michael@0: static class Factory { michael@0: static PanZoomController create(PanZoomTarget target, View view, EventDispatcher dispatcher) { michael@0: return new JavaPanZoomController(target, view, dispatcher); michael@0: } michael@0: } michael@0: michael@0: public void destroy(); michael@0: michael@0: public boolean onTouchEvent(MotionEvent event); michael@0: public boolean onMotionEvent(MotionEvent event); michael@0: public boolean onKeyEvent(KeyEvent event); michael@0: public void notifyDefaultActionPrevented(boolean prevented); michael@0: michael@0: public boolean getRedrawHint(); michael@0: public PointF getVelocityVector(); michael@0: michael@0: public void pageRectUpdated(); michael@0: public void abortPanning(); michael@0: public void abortAnimation(); michael@0: michael@0: public void setOverScrollMode(int overscrollMode); michael@0: public int getOverScrollMode(); michael@0: michael@0: public void setOverscrollHandler(final Overscroll controller); michael@0: }