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
17package com.google.android.droiddriver.actions;
18
19import com.google.android.droiddriver.UiElement;
20import com.google.android.droiddriver.scroll.Direction.PhysicalDirection;
21
22/**
23 * Interface for performing actions on a {@link UiElement}.
24 */
25public interface UiElementActor {
26  /**
27   * Sets the text of this element.
28   *
29   * @param text The text to enter.
30   */
31  void setText(UiElement uiElement, String text);
32
33  /**
34   * Clicks this element. The click will be at the center of the visible
35   * element.
36   */
37  void click(UiElement uiElement);
38
39  /**
40   * Long-clicks this element. The click will be at the center of the visible
41   * element.
42   */
43  void longClick(UiElement uiElement);
44
45  /**
46   * Double-clicks this element. The click will be at the center of the visible
47   * element.
48   */
49  void doubleClick(UiElement uiElement);
50
51  /**
52   * Scrolls in the given direction.
53   *
54   * @param direction specifies where the view port will move, instead of the
55   *        finger.
56   */
57  void scroll(UiElement uiElement, PhysicalDirection direction);
58}
59