6 #include "UiSelector.h"
9 #include "ISearchable.h"
11 #include "AccessibleNode.h"
18 * @brief UiDevice class
21 class UiDevice : public IDevice, public ISearchable {
27 bool click(const int x, const int y) override;
33 bool click(const int x, const int y, const unsigned int intv) override;
39 bool drag(const int sx, const int sy, const int ex, const int ey,
40 const int steps, const int durationMs) override;
46 int touchDown(const int x, const int y) override;
52 bool touchMove(const int x, const int y, const int seq) override;
58 bool touchUp(const int x, const int y, const int seq) override;
64 bool wheelUp(int amount, const int durationMs) override;
70 bool wheelDown(int amount, const int durationMs) override;
76 bool pressBack(KeyRequestType type) override;
82 bool pressHome(KeyRequestType type) override;
88 bool pressMenu(KeyRequestType type) override;
94 bool pressVolUp(KeyRequestType type) override;
100 bool pressVolDown(KeyRequestType type) override;
106 bool pressPower(KeyRequestType type) override;
112 bool pressKeyCode(std::string keycode, KeyRequestType type) override;
118 bool takeScreenshot(std::string path, float scale, int quality) override;
124 long long getSystemTime(TimeRequestType type) override;
132 bool hasObject(const std::shared_ptr<UiSelector> selector) const override;
138 std::shared_ptr<UiObject> findObject(
139 const std::shared_ptr<UiSelector> selector) const override;
145 std::vector<std::shared_ptr<UiObject>> findObjects(
146 const std::shared_ptr<UiSelector> selector) const override;
153 const std::function<bool(const ISearchable *)> condition) const;
159 std::shared_ptr<UiObject> waitFor(
160 const std::function<std::shared_ptr<UiObject>(const ISearchable *)>
167 static std::shared_ptr<UiDevice> getInstance(IDevice *deviceImpl = nullptr);
173 std::vector<std::shared_ptr<AccessibleNode>> getWindowRoot() const;
179 bool waitForIdle() const;
192 UiDevice(IDevice *impl);
205 IDevice * mDeviceImpl;
209 const Waiter *mWaiter;