Add an environment variable for long press gesture
[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) 2019 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
26 namespace Dali
27 {
28
29 namespace Integration
30 {
31
32 /**
33  * @brief Called by adaptor to set the pan gesture prediction mode from
34  * an environment variable
35  *
36  * @pre Should be called after Core creation.
37  * @param mode The pan gesture prediction mode.
38  */
39 DALI_CORE_API void SetPanGesturePredictionMode( int mode );
40
41 /**
42  * @brief Called by adaptor to set the prediction amount of the pan gesture
43  * from an environment variable
44  *
45  * @param[in] amount The prediction amount in milliseconds
46  */
47 DALI_CORE_API void SetPanGesturePredictionAmount(unsigned int amount);
48
49 /**
50  * @brief Sets the upper bound of the prediction amount for clamping
51  * from an environment variable
52  *
53  * @param[in] amount The prediction amount in milliseconds
54  */
55 DALI_CORE_API void SetPanGestureMaximumPredictionAmount( unsigned int amount );
56
57 /**
58  * @brief Sets the lower bound of the prediction amount for clamping
59  * from an environment variable
60  *
61  * @param[in] amount The prediction amount in milliseconds
62  */
63 DALI_CORE_API void SetPanGestureMinimumPredictionAmount( unsigned int amount );
64
65 /**
66  * @brief Sets the prediction amount to adjust when the pan velocity is changed
67  * from an environment variable. If the pan velocity is accelerating, the prediction
68  * amount will be increased by the specified amount until it reaches the upper bound.
69  * If the pan velocity is decelerating, the prediction amount will be decreased by
70  * the specified amount until it reaches the lower bound.
71  *
72  * @param[in] amount The prediction amount in milliseconds
73  */
74 DALI_CORE_API void SetPanGesturePredictionAmountAdjustment( unsigned int amount );
75
76 /**
77  * @brief Called to set how pan gestures smooth input
78  *
79  * @param[in] mode The smoothing mode to use
80  */
81 DALI_CORE_API void SetPanGestureSmoothingMode( int mode );
82
83 /**
84  * @brief Sets the smoothing amount of the pan gesture
85  *
86  * @param[in] amount The smoothing amount [0.0f,1.0f] - 0.0f would be no smoothing, 1.0f maximum smoothing
87  */
88 DALI_CORE_API void SetPanGestureSmoothingAmount( float amount );
89
90 /**
91  * @brief Sets whether to use actual times of the real gesture and frames or not.
92  *
93  * @param[in] value True = use actual times, False = use perfect values
94  */
95 DALI_CORE_API void SetPanGestureUseActualTimes( bool value );
96
97 /**
98  * @brief Sets the interpolation time range (ms) of past points to use (with weights) when interpolating.
99  *
100  * @param[in] value Time range in ms
101  */
102 DALI_CORE_API void SetPanGestureInterpolationTimeRange( int value );
103
104 /**
105  * @brief Sets whether to use scalar only prediction, which when enabled, ignores acceleration.
106  *
107  * @param[in] value True = use scalar prediction only
108  */
109 DALI_CORE_API void SetPanGestureScalarOnlyPredictionEnabled( bool value );
110
111 /**
112  * @brief Sets whether to use two point prediction. This combines two interpolated points to get more steady acceleration and velocity values.
113  *
114  * @param[in] value True = use two point prediction
115  */
116 DALI_CORE_API void SetPanGestureTwoPointPredictionEnabled( bool value );
117
118 /**
119  * @brief Sets the time in the past to interpolate the second point when using two point interpolation.
120  *
121  * @param[in] value Time in past in ms
122  */
123 DALI_CORE_API void SetPanGestureTwoPointInterpolatePastTime( int value );
124
125 /**
126  * @brief Sets the two point velocity bias. This is the ratio of first and second points to use for velocity.
127  *
128  * @param[in] value 0.0f = 100% first point. 1.0f = 100% of second point.
129  */
130 DALI_CORE_API void SetPanGestureTwoPointVelocityBias( float value );
131
132 /**
133  * @brief Sets the two point acceleration bias. This is the ratio of first and second points to use for acceleration.
134  *
135  * @param[in] value 0.0f = 100% first point. 1.0f = 100% of second point.
136  */
137 DALI_CORE_API void SetPanGestureTwoPointAccelerationBias( float value );
138
139 /**
140  * @brief Sets the range of time (ms) of points in the history to perform multitap smoothing with (if enabled).
141  *
142  * @param[in] value Time in past in ms
143  */
144 DALI_CORE_API void SetPanGestureMultitapSmoothingRange( int value );
145
146 /**
147  * @brief Sets the minimum distance required to start a pan gesture
148  *
149  * @param[in] value Distance to move
150  */
151 DALI_CORE_API void SetPanGestureMinimumDistance( int value );
152
153 /**
154  * @brief Sets the minimum number of touch events to start a pan
155  *
156  * @param[in] value Number of pan events
157  */
158 DALI_CORE_API void SetPanGestureMinimumPanEvents( int value );
159
160 /**
161  * @brief Sets the minimum distance required to start a pinch gesture
162  *
163  * @param[in] value Distance to move in pixels
164  */
165 DALI_CORE_API void SetPinchGestureMinimumDistance( float value );
166
167 /**
168  * @brief Sets the minimum holding time required to be recognized as a long press gesture
169  *
170  * @param[in] value The time value in milliseconds
171  */
172 DALI_CORE_API void SetLongPressMinimumHoldingTime( unsigned int value );
173
174 } // namespace Integration
175
176 } // namespace Dali
177
178 #endif // DALI_INTEGRATION_INPUT_OPTIONS_H