1 /* 2 * Copyright 2011 Daniel Kurka 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 * use this file except in compliance with the License. You may obtain a copy of 6 * the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations under 14 * the License. 15 */ 16 package com.googlecode.mgwt.ui.client.widget.touch; 17 18 import com.google.gwt.event.shared.HandlerRegistration; 19 import com.google.gwt.user.client.ui.Widget; 20 import com.googlecode.mgwt.dom.client.event.touch.TouchCancelHandler; 21 import com.googlecode.mgwt.dom.client.event.touch.TouchEndHandler; 22 import com.googlecode.mgwt.dom.client.event.touch.TouchMoveHandler; 23 import com.googlecode.mgwt.dom.client.event.touch.TouchStartHandler; 24 25 /** 26 * The touch widget interface is used to abstract implementation details for 27 * adding touch handlers on touch devices / mouse devices 28 * 29 * @author Daniel Kurka 30 * @version $Id: $ 31 */ 32 public interface TouchWidgetImpl { 33 /** 34 * Add a touch start handler to a widget 35 * 36 * @param w the widget that the handler should be added to 37 * @param handler the handler to add 38 * @return the handlerregistration 39 */ 40 public HandlerRegistration addTouchStartHandler(Widget w, TouchStartHandler handler); 41 42 /** 43 * Add a touch move handler to a widget 44 * 45 * @param w the widget that the handler should be added to 46 * @param handler the handler to add 47 * @return the handlerregistration 48 */ 49 public HandlerRegistration addTouchMoveHandler(Widget w, TouchMoveHandler handler); 50 51 /** 52 * Add a touch cancel handler to a widget 53 * 54 * @param w the widget that the handler should be added to 55 * @param handler the handler to add 56 * @return the handlerregistration 57 */ 58 public HandlerRegistration addTouchCancelHandler(Widget w, TouchCancelHandler handler); 59 60 /** 61 * Add a touch end handler to a widget 62 * 63 * @param w the widget that the handler should be added to 64 * @param handler the handler to add 65 * @return the handlerregistration 66 */ 67 public HandlerRegistration addTouchEndHandler(Widget w, TouchEndHandler handler); 68 69 }