|
| 1 | +#ifndef TOUCH_COMMANDS_H |
| 2 | +#define TOUCH_COMMANDS_H |
| 3 | + |
| 4 | +#include <string> |
| 5 | +#include <vector> |
| 6 | + |
| 7 | +#include "commands/element_commands.h" |
| 8 | +#include "webdriver_element_id.h" |
| 9 | + |
| 10 | +namespace base { |
| 11 | +class DictionaryValue; |
| 12 | +} |
| 13 | + |
| 14 | +namespace webdriver { |
| 15 | + |
| 16 | +class Response; |
| 17 | + |
| 18 | +class TouchCommand : public ElementCommand { |
| 19 | + public: |
| 20 | + TouchCommand(const std::vector<std::string>& path_segments, |
| 21 | + const base::DictionaryValue* const parameters); |
| 22 | + virtual ~TouchCommand(); |
| 23 | + |
| 24 | + virtual bool DoesPost() const OVERRIDE; |
| 25 | + |
| 26 | + private: |
| 27 | + DISALLOW_COPY_AND_ASSIGN(TouchCommand); |
| 28 | +}; |
| 29 | + |
| 30 | +/// Single tap on the touch enabled device. |
| 31 | +/// https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/touch/click |
| 32 | +class TouchClickCommand : public TouchCommand { |
| 33 | + public: |
| 34 | + TouchClickCommand(const std::vector<std::string>& path_segments, |
| 35 | + const base::DictionaryValue* const parameters); |
| 36 | + virtual ~TouchClickCommand(); |
| 37 | + |
| 38 | + virtual void ExecutePost(Response* const response) OVERRIDE; |
| 39 | + |
| 40 | + DISALLOW_COPY_AND_ASSIGN(TouchClickCommand); |
| 41 | +}; |
| 42 | + |
| 43 | +/// Finger down on the screen. |
| 44 | +/// https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/touch/down |
| 45 | +class TouchDownCommand : public TouchCommand { |
| 46 | + public: |
| 47 | + TouchDownCommand(const std::vector<std::string>& path_segments, |
| 48 | + const base::DictionaryValue* const parameters); |
| 49 | + virtual ~TouchDownCommand(); |
| 50 | + |
| 51 | + virtual void ExecutePost(Response* const response) OVERRIDE; |
| 52 | + |
| 53 | + private: |
| 54 | + DISALLOW_COPY_AND_ASSIGN(TouchDownCommand); |
| 55 | +}; |
| 56 | + |
| 57 | + |
| 58 | +/// Finger up on the screen. |
| 59 | +/// https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/touch/up |
| 60 | +class TouchUpCommand : public TouchCommand { |
| 61 | + public: |
| 62 | + TouchUpCommand(const std::vector<std::string>& path_segments, |
| 63 | + const base::DictionaryValue* const parameters); |
| 64 | + virtual ~TouchUpCommand(); |
| 65 | + |
| 66 | + virtual void ExecutePost(Response* const response) OVERRIDE; |
| 67 | + |
| 68 | + private: |
| 69 | + DISALLOW_COPY_AND_ASSIGN(TouchUpCommand); |
| 70 | +}; |
| 71 | + |
| 72 | +/// Double tap on the touch screen using finger motion events. |
| 73 | +/// https://code.google.com/p/selenium/wiki/JsonWireProtocol#session/:sessionId/touch/doubleclick |
| 74 | +class TouchDoubleClickCommand : public TouchCommand { |
| 75 | + public: |
| 76 | + TouchDoubleClickCommand(const std::vector<std::string>& ps, |
| 77 | + const base::DictionaryValue* const parameters); |
| 78 | + virtual ~TouchDoubleClickCommand(); |
| 79 | + |
| 80 | + virtual void ExecutePost(Response* const response) OVERRIDE; |
| 81 | + |
| 82 | + DISALLOW_COPY_AND_ASSIGN(TouchDoubleClickCommand); |
| 83 | +}; |
| 84 | + |
| 85 | +/// Finger move on the screen. |
| 86 | +/// https://code.google.com/p/selenium/wiki/JsonWireProtocol#session/:sessionId/touch/move |
| 87 | +class TouchMoveCommand : public TouchCommand { |
| 88 | + public: |
| 89 | + TouchMoveCommand(const std::vector<std::string>& path_segments, |
| 90 | + const base::DictionaryValue* const parameters); |
| 91 | + virtual ~TouchMoveCommand(); |
| 92 | + |
| 93 | + virtual void ExecutePost(Response* const response) OVERRIDE; |
| 94 | + |
| 95 | + private: |
| 96 | + DISALLOW_COPY_AND_ASSIGN(TouchMoveCommand); |
| 97 | +}; |
| 98 | + |
| 99 | +/// Scroll on the touch screen using finger based motion events. |
| 100 | +/// https://code.google.com/p/selenium/wiki/JsonWireProtocol#session/:sessionId/touch/scroll |
| 101 | +class TouchScrollCommand : public TouchCommand { |
| 102 | + public: |
| 103 | + TouchScrollCommand(const std::vector<std::string>& path_segments, |
| 104 | + const base::DictionaryValue* const parameters); |
| 105 | + virtual ~TouchScrollCommand(); |
| 106 | + |
| 107 | + virtual void ExecutePost(Response* const response) OVERRIDE; |
| 108 | + |
| 109 | + private: |
| 110 | + DISALLOW_COPY_AND_ASSIGN(TouchScrollCommand); |
| 111 | +}; |
| 112 | + |
| 113 | +/// Long press on the touch screen using finger motion events. |
| 114 | +/// https://code.google.com/p/selenium/wiki/JsonWireProtocol#session/:sessionId/touch/longclick |
| 115 | +class TouchLongClickCommand : public TouchCommand { |
| 116 | + public: |
| 117 | + TouchLongClickCommand(const std::vector<std::string>& path_segments, |
| 118 | + const base::DictionaryValue* const parameters); |
| 119 | + virtual ~TouchLongClickCommand(); |
| 120 | + virtual void ExecutePost(Response* const response) OVERRIDE; |
| 121 | + |
| 122 | + DISALLOW_COPY_AND_ASSIGN(TouchLongClickCommand); |
| 123 | +}; |
| 124 | + |
| 125 | +/// Flick on the touch screen using finger motion events. |
| 126 | +/// https://code.google.com/p/selenium/wiki/JsonWireProtocol#session/:sessionId/touch/flick |
| 127 | +class TouchFlickCommand : public TouchCommand { |
| 128 | + public: |
| 129 | + TouchFlickCommand(const std::vector<std::string>& path_segments, |
| 130 | + const base::DictionaryValue* const parameters); |
| 131 | + virtual ~TouchFlickCommand(); |
| 132 | + |
| 133 | + virtual void ExecutePost(Response* const response) OVERRIDE; |
| 134 | + |
| 135 | + private: |
| 136 | + DISALLOW_COPY_AND_ASSIGN(TouchFlickCommand); |
| 137 | +}; |
| 138 | + |
| 139 | +} // namespace webdriver |
| 140 | + |
| 141 | +#endif // TOUCH_COMMANDS_H |
0 commit comments