1<?php
2
3namespace Facebook\WebDriver\Interactions\Touch;
4
5use Facebook\WebDriver\WebDriverElement;
6
7/**
8 * Interface representing touch screen operations.
9 */
10interface WebDriverTouchScreen
11{
12    /**
13     * Single tap on the touch enabled device.
14     *
15     * @param WebDriverElement $element
16     * @return $this
17     */
18    public function tap(WebDriverElement $element);
19
20    /**
21     * Double tap on the touch screen using finger motion events.
22     *
23     * @param WebDriverElement $element
24     * @return $this
25     */
26    public function doubleTap(WebDriverElement $element);
27
28    /**
29     * Finger down on the screen.
30     *
31     * @param int $x
32     * @param int $y
33     * @return $this
34     */
35    public function down($x, $y);
36
37    /**
38     * Flick on the touch screen using finger motion events. Use this flick
39     * command if you don't care where the flick starts on the screen.
40     *
41     * @param int $xspeed
42     * @param int $yspeed
43     * @return $this
44     */
45    public function flick($xspeed, $yspeed);
46
47    /**
48     * Flick on the touch screen using finger motion events.
49     * This flickcommand starts at a particular screen location.
50     *
51     * @param WebDriverElement $element
52     * @param int $xoffset
53     * @param int $yoffset
54     * @param int $speed
55     * @return $this
56     */
57    public function flickFromElement(
58        WebDriverElement $element,
59        $xoffset,
60        $yoffset,
61        $speed
62    );
63
64    /**
65     * Long press on the touch screen using finger motion events.
66     *
67     * @param WebDriverElement $element
68     * @return $this
69     */
70    public function longPress(WebDriverElement $element);
71
72    /**
73     * Finger move on the screen.
74     *
75     * @param int $x
76     * @param int $y
77     * @return $this
78     */
79    public function move($x, $y);
80
81    /**
82     * Scroll on the touch screen using finger based motion events. Use this
83     * command if you don't care where the scroll starts on the screen.
84     *
85     * @param int $xoffset
86     * @param int $yoffset
87     * @return $this
88     */
89    public function scroll($xoffset, $yoffset);
90
91    /**
92     * Scroll on the touch screen using finger based motion events. Use this
93     * command to start scrolling at a particular screen location.
94     *
95     * @param WebDriverElement $element
96     * @param int $xoffset
97     * @param int $yoffset
98     * @return $this
99     */
100    public function scrollFromElement(
101        WebDriverElement $element,
102        $xoffset,
103        $yoffset
104    );
105
106    /**
107     * Finger up on the screen.
108     *
109     * @param int $x
110     * @param int $y
111     * @return $this
112     */
113    public function up($x, $y);
114}
115