1 /* 2 * Copyright (C) 2011 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 com.android.inputmethod.keyboard; 18 19 import android.view.View; 20 import android.widget.PopupWindow; 21 22 public interface MoreKeysPanel extends PointerTracker.KeyEventHandler { 23 public interface Controller { 24 public boolean dismissMoreKeysPanel(); 25 } 26 27 public void setShifted(boolean shifted); 28 29 /** 30 * Show more keys panel. 31 * 32 * @param parentView the parent view of this more keys panel 33 * @param controller the controller that can dismiss this more keys panel 34 * @param pointX x coordinate of this more keys panel 35 * @param pointY y coordinate of this more keys panel 36 * @param window PopupWindow to be used to show this more keys panel 37 * @param listener the listener that will receive keyboard action from this more keys panel. 38 */ 39 public void showMoreKeysPanel(View parentView, Controller controller, int pointX, int pointY, 40 PopupWindow window, KeyboardActionListener listener); 41 42 /** 43 * Translate X-coordinate of touch event to the local X-coordinate of this 44 * {@link MoreKeysPanel}. 45 * 46 * @param x the global X-coordinate 47 * @return the local X-coordinate to this {@link MoreKeysPanel} 48 */ 49 public int translateX(int x); 50 51 /** 52 * Translate Y-coordinate of touch event to the local Y-coordinate of this 53 * {@link MoreKeysPanel}. 54 * 55 * @param y the global Y-coordinate 56 * @return the local Y-coordinate to this {@link MoreKeysPanel} 57 */ 58 public int translateY(int y); 59 } 60