[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / integration-api / input-options.h
1 #ifndef DALI_INTEGRATION_INPUT_OPTIONS_H
2 #define DALI_INTEGRATION_INPUT_OPTIONS_H
3
4 /*
5  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24 #include <dali/public-api/common/dali-common.h>
25 #include <dali/public-api/object/type-info.h>
26
27 namespace Dali
28 {
29 namespace Integration
30 {
31 /**
32  * @brief Called by adaptor to set the pan gesture prediction mode from
33  * an environment variable
34  *
35  * @pre Should be called after Core creation.
36  * @param mode The pan gesture prediction mode.
37  */
38 DALI_CORE_API void SetPanGesturePredictionMode(int mode);
39
40 /**
41  * @brief Called by adaptor to set the prediction amount of the pan gesture
42  * from an environment variable
43  *
44  * @param[in] amount The prediction amount in milliseconds
45  */
46 DALI_CORE_API void SetPanGesturePredictionAmount(unsigned int amount);
47
48 /**
49  * @brief Sets the upper bound of the prediction amount for clamping
50  * from an environment variable
51  *
52  * @param[in] amount The prediction amount in milliseconds
53  */
54 DALI_CORE_API void SetPanGestureMaximumPredictionAmount(unsigned int amount);
55
56 /**
57  * @brief Sets the lower bound of the prediction amount for clamping
58  * from an environment variable
59  *
60  * @param[in] amount The prediction amount in milliseconds
61  */
62 DALI_CORE_API void SetPanGestureMinimumPredictionAmount(unsigned int amount);
63
64 /**
65  * @brief Sets the prediction amount to adjust when the pan velocity is changed
66  * from an environment variable. If the pan velocity is accelerating, the prediction
67  * amount will be increased by the specified amount until it reaches the upper bound.
68  * If the pan velocity is decelerating, the prediction amount will be decreased by
69  * the specified amount until it reaches the lower bound.
70  *
71  * @param[in] amount The prediction amount in milliseconds
72  */
73 DALI_CORE_API void SetPanGesturePredictionAmountAdjustment(unsigned int amount);
74
75 /**
76  * @brief Called to set how pan gestures smooth input
77  *
78  * @param[in] mode The smoothing mode to use
79  */
80 DALI_CORE_API void SetPanGestureSmoothingMode(int mode);
81
82 /**
83  * @brief Sets the smoothing amount of the pan gesture
84  *
85  * @param[in] amount The smoothing amount [0.0f,1.0f] - 0.0f would be no smoothing, 1.0f maximum smoothing
86  */
87 DALI_CORE_API void SetPanGestureSmoothingAmount(float amount);
88
89 /**
90  * @brief Sets whether to use actual times of the real gesture and frames or not.
91  *
92  * @param[in] value True = use actual times, False = use perfect values
93  */
94 DALI_CORE_API void SetPanGestureUseActualTimes(bool value);
95
96 /**
97  * @brief Sets the interpolation time range (ms) of past points to use (with weights) when interpolating.
98  *
99  * @param[in] value Time range in ms
100  */
101 DALI_CORE_API void SetPanGestureInterpolationTimeRange(int value);
102
103 /**
104  * @brief Sets whether to use scalar only prediction, which when enabled, ignores acceleration.
105  *
106  * @param[in] value True = use scalar prediction only
107  */
108 DALI_CORE_API void SetPanGestureScalarOnlyPredictionEnabled(bool value);
109
110 /**
111  * @brief Sets whether to use two point prediction. This combines two interpolated points to get more steady acceleration and velocity values.
112  *
113  * @param[in] value True = use two point prediction
114  */
115 DALI_CORE_API void SetPanGestureTwoPointPredictionEnabled(bool value);
116
117 /**
118  * @brief Sets the time in the past to interpolate the second point when using two point interpolation.
119  *
120  * @param[in] value Time in past in ms
121  */
122 DALI_CORE_API void SetPanGestureTwoPointInterpolatePastTime(int value);
123
124 /**
125  * @brief Sets the two point velocity bias. This is the ratio of first and second points to use for velocity.
126  *
127  * @param[in] value 0.0f = 100% first point. 1.0f = 100% of second point.
128  */
129 DALI_CORE_API void SetPanGestureTwoPointVelocityBias(float value);
130
131 /**
132  * @brief Sets the two point acceleration bias. This is the ratio of first and second points to use for acceleration.
133  *
134  * @param[in] value 0.0f = 100% first point. 1.0f = 100% of second point.
135  */
136 DALI_CORE_API void SetPanGestureTwoPointAccelerationBias(float value);
137
138 /**
139  * @brief Sets the range of time (ms) of points in the history to perform multitap smoothing with (if enabled).
140  *
141  * @param[in] value Time in past in ms
142  */
143 DALI_CORE_API void SetPanGestureMultitapSmoothingRange(int value);
144
145 /**
146  * @brief Sets the minimum distance required to start a pan gesture
147  *
148  * @param[in] value Distance to move
149  */
150 DALI_CORE_API void SetPanGestureMinimumDistance(int value);
151
152 /**
153  * @brief Sets the minimum number of touch events to start a pan
154  *
155  * @param[in] value Number of pan events
156  */
157 DALI_CORE_API void SetPanGestureMinimumPanEvents(int value);
158
159 /**
160  * @brief Sets the minimum distance required to start a pinch gesture
161  *
162  * @param[in] value Distance to move in pixels
163  */
164 DALI_CORE_API void SetPinchGestureMinimumDistance(float value);
165
166 /**
167  * @brief Sets the minimum touch events required before a pinch can be started
168  *
169  * @param[in] value The number of touch events
170  */
171 DALI_CORE_API void SetPinchGestureMinimumTouchEvents(uint32_t value);
172
173 /**
174  * @brief Sets the minimum touch events required after a pinch started
175  *
176  * @param[in] value The number of touch events
177  */
178 DALI_CORE_API void SetPinchGestureMinimumTouchEventsAfterStart(uint32_t value);
179
180 /**
181  * @brief Sets the minimum touch events required before a rotation can be started
182  *
183  * @param[in] value The number of touch events
184  */
185 DALI_CORE_API void SetRotationGestureMinimumTouchEvents(uint32_t value);
186
187 /**
188  * @brief Sets the minimum touch events required after a rotation started
189  *
190  * @param[in] value The number of touch events
191  */
192 DALI_CORE_API void SetRotationGestureMinimumTouchEventsAfterStart(uint32_t value);
193
194 /**
195  * @brief Sets the minimum holding time required to be recognized as a long press gesture
196  *
197  * @param[in] value The time value in milliseconds
198  */
199 DALI_CORE_API void SetLongPressMinimumHoldingTime(unsigned int value);
200
201 /**
202  * @brief Sets the maximum allowed time required to be recognized as a multi tap gesture (millisecond)
203  *
204  * This is the maximum allowable time interval to recognize as multi-tap.
205  * If taps come in within this time, they are recognized as multi-tap.
206   *
207  * @note If it's a double tap, it's like this:
208  * |(touch down <--recognizerTime--> touch up) <--  wihtin maximumAllowedTime --> (touch down <--recognizerTime--> touch up)|
209  *
210  * @see SetTapRecognizerTime()
211  *
212  * @param[in] time The time value in milliseconds
213  */
214 DALI_CORE_API void SetTapMaximumAllowedTime(uint32_t time);
215
216 /**
217  * @brief Sets the recognizer time required to be recognized as a tap gesture (millisecond)
218  *
219  * This time is from touch down to touch up to recognize the tap gesture.
220  *
221  * @note The tab is like below:
222  * touch down <--recognizerTime--> touch up
223  * If the time between touch down and touch up is longer than recognizer time, it is not recognized as a tap gesture.
224  *
225  * @see SetTapMaximumAllowedTime()
226  *
227  * @param[in] time The time value in milliseconds
228  */
229 DALI_CORE_API void SetTapRecognizerTime(uint32_t time);
230
231 /**
232  * @brief Sets the recognizer distance required to be recognized as a tap gesture
233  *
234  * This distance is from touch down to touch up to recognize the tap gesture.
235  *
236  * @note The tab is like below:
237  * touch down <--distance--> touch up
238  * If the distance between touch down and touch up is longer than distance, it is not recognized as a tap gesture.
239  * Default value is 20
240  *
241  * @see SetTapMaximumMotionAllowedDistance()
242  *
243  * @param[in] distance The distance
244  */
245 DALI_CORE_API void SetTapMaximumMotionAllowedDistance(float distance);
246
247 } // namespace Integration
248
249 } // namespace Dali
250
251 #endif // DALI_INTEGRATION_INPUT_OPTIONS_H