1 /* 2 * Copyright (C) 2013 DroidDriver committers 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 io.appium.droiddriver.actions; 18 19 import io.appium.droiddriver.UiElement; 20 import io.appium.droiddriver.scroll.Direction.PhysicalDirection; 21 22 /** 23 * Interface for performing actions on a {@link UiElement}. 24 */ 25 public interface UiElementActor { 26 /** 27 * Clicks this element. The click will be at the center of the visible 28 * element. 29 */ click(UiElement uiElement)30 void click(UiElement uiElement); 31 32 /** 33 * Long-clicks this element. The click will be at the center of the visible 34 * element. 35 */ longClick(UiElement uiElement)36 void longClick(UiElement uiElement); 37 38 /** 39 * Double-clicks this element. The click will be at the center of the visible 40 * element. 41 */ doubleClick(UiElement uiElement)42 void doubleClick(UiElement uiElement); 43 44 /** 45 * Scrolls in the given direction. 46 * 47 * @param direction specifies where the view port will move, instead of the 48 * finger. 49 */ scroll(UiElement uiElement, PhysicalDirection direction)50 void scroll(UiElement uiElement, PhysicalDirection direction); 51 } 52