2 * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef _TIZEN_DEVICE_IMPL_H_
19 #define _TIZEN_DEVICE_IMPL_H_
27 using namespace Aurum;
29 namespace AurumInternal {
31 class TizenDeviceImpl : public IDevice {
38 * @copydoc IDevice::click()
40 bool click(const int x, const int y) override;
43 * @copydoc IDevice::click()
45 bool click(const int x, const int y, const unsigned int durationMs) override;
48 * @copydoc IDevice::drag()
50 bool drag(const int sx, const int sy, const int ex, const int ey,
51 const int steps, const int durationMs) override;
54 * @copydoc IDevice::touchDown()
56 int touchDown(const int x, const int y) override;
59 * @copydoc IDevice::touchMove()
61 bool touchMove(const int x, const int y, const int seq) override;
64 * @copydoc IDevice::touchUp()
66 bool touchUp(const int x, const int y, const int seq) override;
69 * @copydoc IDevice::wheelUp()
71 bool wheelUp(int amount, const int durationMs) override;
74 * @copydoc IDevice::wheelDown()
76 bool wheelDown(int amount, const int durationMs) override;
79 * @copydoc IDevice::pressBack()
81 bool pressBack(KeyRequestType type) override;
84 * @copydoc IDevice::pressHome()
86 bool pressHome(KeyRequestType type) override;
89 * @copydoc IDevice::pressMenu()
91 bool pressMenu(KeyRequestType type) override;
94 * @copydoc IDevice::pressVolUp()
96 bool pressVolUp(KeyRequestType type) override;
99 * @copydoc IDevice::pressVolDown()
101 bool pressVolDown(KeyRequestType type) override;
104 * @copydoc IDevice::pressPower()
106 bool pressPower(KeyRequestType type) override;
109 * @copydoc IDevice::pressKeyCode()
111 bool pressKeyCode(std::string keycode, KeyRequestType type) override;
114 * @copydoc IDevice::takeScreenshot()
116 bool takeScreenshot(std::string path, float scale, int quality) override;
119 * @copydoc IDevice::getSystemTime()
121 long long getSystemTime(TimeRequestType type) override;
124 * @brief Gets device screen size.
130 const Size2D<int> getScreenSize() override;
134 * @brief Press and release given key during duration time.
138 bool strokeKeyCode(std::string keycode, unsigned int durationMs);
141 * @brief Press given key.
145 bool pressKeyCode(std::string keycode);
148 * @brief Release given key.
152 bool releaseKeyCode(std::string keycode);
155 * @brief Increase touch count and return the number to manage touch count.
159 int grabTouchSeqNumber();
162 * @brief Delete given touch number.
166 bool releaseTouchSeqNumber(int seq);
170 * @brief Timer utility.
174 void startTimer(void);
177 * @brief Timer utility.
184 efl_util_inputgen_h mFakeTouchHandle;
185 efl_util_inputgen_h mFakeKeyboardHandle;
186 efl_util_inputgen_h mFakeWheelHandle;
187 static const int INTV_CLICK = 5;
188 static const int INTV_SHORTSTROKE = 10;
189 static const int INTV_LONGSTROKE = 2000;
190 static const int INTV_MINIMUM_DRAG_MS = 25;
191 static const int INTV_MINIMUM_USLEEP = 1000;
192 static const int MINIMUM_DURATION_DRAG = 100;
193 static const unsigned int MSEC_PER_SEC = 1000;
194 static const unsigned int MAX_FINGER_NUMBER = 2;
195 struct timespec tStart;
197 std::set<int> mTouchSeq;
202 Size2D<int> mScreenSize;