2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
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.
17 using Tizen.NUI.BaseComponents;
18 using System.ComponentModel;
23 /// This is a calss that sets the configuration options of Gestures
25 [EditorBrowsable(EditorBrowsableState.Never)]
26 public sealed class GestureOptions
28 private static readonly GestureOptions instance = new GestureOptions();
33 private GestureOptions()
38 /// Gets the singleton of the GestureOptions object.
40 [EditorBrowsable(EditorBrowsableState.Never)]
41 public static GestureOptions Instance
50 /// Sets the prediction mode for pan gestures <br />
51 /// * 0 - No prediction <br />
52 /// * 1 - Prediction using average acceleration <br />
54 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
55 /// <param name="mode">The prediction mode</param>
56 [EditorBrowsable(EditorBrowsableState.Never)]
57 public void SetPanGesturePredictionMode(int mode)
59 Interop.GestureOptions.SetPanGesturePredictionMode(mode);
60 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
64 /// Sets the prediction amount of the pan gesture
66 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
67 /// <param name="amount">The prediction amount in milliseconds</param>
68 [EditorBrowsable(EditorBrowsableState.Never)]
69 public void SetPanGesturePredictionAmount(uint amount)
71 Interop.GestureOptions.SetPanGesturePredictionAmount(amount);
72 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76 /// Sets the upper bound of the prediction amount for clamping
78 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
79 /// <param name="amount">The prediction amount in milliseconds</param>
80 [EditorBrowsable(EditorBrowsableState.Never)]
81 public void SetPanGestureMaximumPredictionAmount(uint amount)
83 Interop.GestureOptions.SetPanGestureMaximumPredictionAmount(amount);
84 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
88 /// Sets the lower bound of the prediction amount for clamping
90 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
91 /// <param name="amount">The prediction amount in milliseconds</param>
92 [EditorBrowsable(EditorBrowsableState.Never)]
93 public void SetPanGestureMinimumPredictionAmount(uint amount)
95 Interop.GestureOptions.SetPanGestureMinimumPredictionAmount(amount);
96 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
100 /// Sets the amount of prediction interpolation to adjust when the pan velocity is changed
102 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
103 /// <param name="amount">The prediction amount in milliseconds</param>
104 [EditorBrowsable(EditorBrowsableState.Never)]
105 public void SetPanGesturePredictionAmountAdjustment(uint amount)
107 Interop.GestureOptions.SetPanGesturePredictionAmountAdjustment(amount);
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112 /// Called to set the prediction mode for pan gestures <br />
113 /// * Valid modes: <br />
114 /// * 0 - No smoothing <br />
115 /// * 1 - average between last 2 values <br />
117 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
118 /// <param name="mode">The prediction mode</param>
119 [EditorBrowsable(EditorBrowsableState.Never)]
120 public void SetPanGestureSmoothingMode(int mode)
122 Interop.GestureOptions.SetPanGestureSmoothingMode(mode);
123 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127 /// Sets the smoothing amount of the pan gesture
129 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
130 /// <param name="amount">The smotthing amount from 0.0f (none) to 1.0f (full)</param>
131 [EditorBrowsable(EditorBrowsableState.Never)]
132 public void SetPanGestureSmoothingAmount(float amount)
134 Interop.GestureOptions.SetPanGestureSmoothingAmount(amount);
135 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 /// Sets whether to use actual times of the real gesture and frames or not.
141 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
142 /// <param name="enable">True = use actual times, False = use perfect values</param>
143 [EditorBrowsable(EditorBrowsableState.Never)]
144 public void SetPanGestureUseActualTimes(bool enable)
146 Interop.GestureOptions.SetPanGestureUseActualTimes(enable);
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 /// Sets the interpolation time range (ms) of past points to use (with weights) when interpolating.
153 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
154 /// <param name="range">Time range in ms</param>
155 [EditorBrowsable(EditorBrowsableState.Never)]
156 public void SetPanGestureInterpolationTimeRange(int range)
158 Interop.GestureOptions.SetPanGestureInterpolationTimeRange(range);
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 /// Sets whether to use scalar only prediction, which when enabled, ignores acceleration.
165 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
166 /// <param name="enable">True = use scalar prediction only</param>
167 [EditorBrowsable(EditorBrowsableState.Never)]
168 public void SetPanGestureScalarOnlyPredictionEnabled(bool enable)
170 Interop.GestureOptions.SetPanGestureScalarOnlyPredictionEnabled(enable);
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 /// Sets whether to use two point prediction. This combines two interpolated points to get more steady acceleration and velocity values.
177 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
178 /// <param name="enable">True = use two point prediction</param>
179 [EditorBrowsable(EditorBrowsableState.Never)]
180 public void SetPanGestureTwoPointPredictionEnabled(bool enable)
182 Interop.GestureOptions.SetPanGestureTwoPointPredictionEnabled(enable);
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187 /// Sets the time in the past to interpolate the second point when using two point interpolation.
189 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
190 /// <param name="time">Time in past in ms</param>
191 [EditorBrowsable(EditorBrowsableState.Never)]
192 public void SetPanGestureTwoPointInterpolatePastTime(int time)
194 Interop.GestureOptions.SetPanGestureTwoPointInterpolatePastTime(time);
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 /// Sets the two point velocity bias. This is the ratio of first and second points to use for velocity.
201 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
202 /// <param name="velocity">0.0f = 100% first point. 1.0f = 100% of second point.</param>
203 [EditorBrowsable(EditorBrowsableState.Never)]
204 public void SetPanGestureTwoPointVelocityBias(float velocity)
206 Interop.GestureOptions.SetPanGestureTwoPointVelocityBias(velocity);
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 /// Sets the two point acceleration bias. This is the ratio of first and second points to use for acceleration.
213 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
214 /// <param name="acceleration">0.0f = 100% first point. 1.0f = 100% of second point.</param>
215 [EditorBrowsable(EditorBrowsableState.Never)]
216 public void SetPanGestureTwoPointAccelerationBias(float acceleration)
218 Interop.GestureOptions.SetPanGestureTwoPointAccelerationBias(acceleration);
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 /// Sets the range of time (ms) of points in the history to perform multitap smoothing with (if enabled).
225 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
226 /// <param name="range">Time in past in ms</param>
227 [EditorBrowsable(EditorBrowsableState.Never)]
228 public void SetPanGestureMultitapSmoothingRange(int range)
230 Interop.GestureOptions.SetPanGestureMultitapSmoothingRange(range);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 /// Sets the minimum distance required to start a pan event
237 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
238 /// <param name="distance">Distance in pixels</param>
239 [EditorBrowsable(EditorBrowsableState.Never)]
240 public void SetPanGestureMinimumDistance(int distance)
242 Interop.GestureOptions.SetPanGestureMinimumDistance(distance);
243 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247 /// Sets the minimum number of touch events required to start a pan
249 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
250 /// <param name="number">Number of touch events</param>
251 [EditorBrowsable(EditorBrowsableState.Never)]
252 public void SetPanGestureMinimumPanEvents(int number)
254 Interop.GestureOptions.SetPanGestureMinimumPanEvents(number);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259 /// Sets the minimum distance required to start a pinch event
261 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
262 /// <param name="distance">Distance in pixels</param>
263 [EditorBrowsable(EditorBrowsableState.Never)]
264 public void SetPinchGestureMinimumDistance(int distance)
266 Interop.GestureOptions.SetPinchGestureMinimumDistance(distance);
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 /// Sets the minimum touch events required before a pinch can be started
273 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
274 /// <param name="number">The number of touch events</param>
275 [EditorBrowsable(EditorBrowsableState.Never)]
276 public void SetPinchGestureMinimumTouchEvents(uint number)
278 Interop.GestureOptions.SetPinchGestureMinimumTouchEvents(number);
279 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283 /// Sets the minimum touch events required after a pinch started
285 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
286 /// <param name="number">The number of touch events</param>
287 public void SetPinchGestureMinimumTouchEventsAfterStart(uint number)
289 Interop.GestureOptions.SetPinchGestureMinimumTouchEventsAfterStart(number);
290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
294 /// Sets the minimum touch events required before a rotation can be started
296 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
297 /// <param name="number">The number of touch events</param>
298 [EditorBrowsable(EditorBrowsableState.Never)]
299 public void SetRotationGestureMinimumTouchEvents(uint number)
301 Interop.GestureOptions.SetRotationGestureMinimumTouchEvents(number);
302 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306 /// Sets the minimum touch events required after a rotation started
308 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
309 /// <param name="number">The number of touch events</param>
310 [EditorBrowsable(EditorBrowsableState.Never)]
311 public void SetRotationGestureMinimumTouchEventsAfterStart(uint number)
313 Interop.GestureOptions.SetRotationGestureMinimumTouchEventsAfterStart(number);
314 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
318 /// Sets the minimum holding time required to be recognized as a long press gesture
320 /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
321 /// <param name="time">The time value in milliseconds</param>
322 [EditorBrowsable(EditorBrowsableState.Never)]
323 public void SetLongPressMinimumHoldingTime(uint time)
325 Interop.GestureOptions.SetLongPressMinimumHoldingTime(time);
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();