gecko/mobile/android/base/gfx/PanZoomController.java
Kartikaya Gupta 88dcc6657a Bug 777468 - Move ownership of TouchEventHandler from LayerView to JavaPanZoomController. r=Cwiiis
This patch has a bunch of semi-independent changes that unfortunately
couldn't be split apart without introducing hacks to make stuff build
on the intermediate patches. The main changes are:
- Moving TouchEventHandler from LayerView to JavaPanZoomController
- Registering the touch interceptor on the LayerView rather than the
  TouchEventHandler
- Moving the Tab:HasTouchListener handler from GeckoApp to JPZC

The net effect of all of this is that the TouchEventHandler is hidden
behind the PanZoomController interface and not accessible to GeckoApp
or GeckoAppShell.

Additionally, some of the JPZC methods were renamed from onXXX to
handleXXX to maintain the convention that onXXX methods are "interface"
methods (i.e. exposed to arbitrary other code) whereas handleXXX
methods are private/package and should only be called in very specific
ways.
2013-02-08 09:13:09 -05:00

42 lines
1.5 KiB
Java

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