Aurum  0.1.1
 All Classes Functions Variables Pages
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 
14 class TizenImpl : public IDevice {
15 public:
16  TizenImpl();
17  ~TizenImpl();
18 
19  bool click(const int x, const int y) override;
20  bool click(const int x, const int y, const unsigned int intv) override;
21 
22  bool drag(const int sx, const int sy, const int ex, const int ey,
23  const int steps, const int durationMs) override;
24 
25  bool touchDown(const int x, const int y) override;
26  bool touchMove(const int x, const int y) override;
27  bool touchUp(const int x, const int y) override;
28 
29  bool wheelUp(int amount, const int durationMs) override;
30  bool wheelDown(int amount, const int durationMs) override;
31 
32  bool pressBack() override;
33  bool pressHome() override;
34  bool pressMenu() override;
35  bool pressVolUp() override;
36  bool pressVolDown() override;
37  bool pressPower() override;
38  bool pressKeyCode(std::string keycode) override;
39  bool takeScreenshot(std::string path, float scale, int quality) override;
40  long long getSystemTime(TypeRequestType type) override;
41 
42 protected:
43  bool pressKeyCode(std::string keycode, unsigned int intv);
44 
45 private:
46  void startTimer(void);
47  int stopTimer(void);
48 
49 private:
50  efl_util_inputgen_h mFakeTouchHandle;
51  efl_util_inputgen_h mFakeKeyboardHandle;
52  efl_util_inputgen_h mFakeWheelHandle;
53  static const unsigned int INTV_CLICK = 5;
54  static const unsigned int INTV_KEYPRESS = 10;
55  static const unsigned int INTV_MINIMUM_DRAG_MS = 25;
56  static const unsigned int INTV_MINIMUM_USLEEP = 1000;
57  static const unsigned int MINIMUM_DURATION_DRAG = 100;
58  static const unsigned int MSEC_PER_SEC = 1000;
59 
60  struct timespec tStart;
61  bool isTimerStarted;
62 };
63 
64 #endif