libaurum: refactor a flick command and implementation
[platform/core/uifw/aurum.git] / libaurum / inc / DeviceImpl / TizenImpl.h
1 #ifndef DEVICE_GENERAL_H
2 #define DEVICE_GENERAL_H
3 #include "config.h"
4
5 #include "IDevice.h"
6
7 #ifdef GBS_BUILD
8 #include <efl_util.h>
9 #endif
10
11 class TizenImpl : public IDevice {
12 public:
13     TizenImpl();
14     ~TizenImpl();
15
16     bool click(const int x, const int y) override;
17     bool click(const int x, const int y, const unsigned int intv) override;
18
19     bool drag(const int sx, const int sy, const int ex, const int ey,
20               const int steps, const int durationMs) override;
21
22     bool touchDown(const int x, const int y) override;
23     bool touchMove(const int x, const int y) override;
24     bool touchUp(const int x, const int y) override;
25
26     bool wheelUp(int amount, const int durationMs) override;
27     bool wheelDown(int amount, const int durationMs) override;
28
29     bool pressBack() override;
30     bool pressHome() override;
31     bool pressMenu() override;
32     bool pressVolUp() override;
33     bool pressVolDown() override;
34     bool pressPower() override;
35     bool pressKeyCode(std::string keycode) override;
36     bool takeScreenshot(std::string path, float scale, int quality) override;
37     long long getSystemTime(TypeRequestType type) override;
38
39 protected:
40     bool pressKeyCode(std::string keycode, unsigned int intv);
41
42 private:
43     void startTimer(void);
44     int stopTimer(void);
45
46 private:
47     efl_util_inputgen_h mFakeTouchHandle;
48     efl_util_inputgen_h mFakeKeyboardHandle;
49     efl_util_inputgen_h mFakeWheelHandle;
50     static const unsigned int INTV_CLICK = 5;
51     static const unsigned int INTV_KEYPRESS = 10;
52     static const unsigned int INTV_MINIMUM_DRAG_MS = 25;
53     static const unsigned int INTV_MINIMUM_USLEEP = 1000;
54     static const unsigned int MINIMUM_DURATION_DRAG = 100;
55     static const unsigned int MSEC_PER_SEC = 1000;
56
57     struct timespec tStart;
58     bool isTimerStarted;
59 };
60
61 #endif