Home | History | Annotate | Download | only in view
      1 /*
      2  * Copyright (C) 2010 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of 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,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.view;
     18 
     19 /**
     20  * Handles input messages that arrive on an input channel.
     21  * @hide
     22  */
     23 public interface InputHandler {
     24     /**
     25      * Handle a key event.
     26      * It is the responsibility of the callee to ensure that the finished callback is
     27      * eventually invoked when the event processing is finished and the input system
     28      * can send the next event.
     29      * @param event The key event data.
     30      * @param finishedCallback The callback to invoke when event processing is finished.
     31      */
     32     public void handleKey(KeyEvent event, InputQueue.FinishedCallback finishedCallback);
     33 
     34     /**
     35      * Handle a motion event.
     36      * It is the responsibility of the callee to ensure that the finished callback is
     37      * eventually invoked when the event processing is finished and the input system
     38      * can send the next event.
     39      * @param event The motion event data.
     40      * @param finishedCallback The callback to invoke when event processing is finished.
     41      */
     42     public void handleMotion(MotionEvent event, InputQueue.FinishedCallback finishedCallback);
     43 }
     44