[NUI] Remove duplicate getCPtr from BaseHandle subclasses (#3545)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Events / GestureOptions.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 using Tizen.NUI.BaseComponents;
18 using System.ComponentModel;
19
20 namespace Tizen.NUI
21 {
22     /// <summary>
23     /// This is a calss that sets the configuration options of Gestures
24     /// </summary>
25     [EditorBrowsable(EditorBrowsableState.Never)]
26     public sealed class GestureOptions
27     {
28         private static readonly GestureOptions instance = new GestureOptions();
29
30         /// <summary>
31         /// Constructor.
32         /// </summary>
33         private GestureOptions()
34         {
35         }
36
37         /// <summary>
38         /// Gets the singleton of the GestureOptions object.
39         /// </summary>
40         [EditorBrowsable(EditorBrowsableState.Never)]
41         public static GestureOptions Instance
42         {
43             get
44             {
45                 return instance;
46             }
47         }
48
49         /// <summary>
50         /// Sets the prediction mode for pan gestures <br />
51         ///    * 0 - No prediction <br />
52         ///    * 1 - Prediction using average acceleration <br />
53         /// </summary>
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)
58         {
59             Interop.GestureOptions.SetPanGesturePredictionMode(mode);
60             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
61         }
62
63         /// <summary>
64         /// Sets the prediction amount of the pan gesture
65         /// </summary>
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)
70         {
71             Interop.GestureOptions.SetPanGesturePredictionAmount(amount);
72             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73         }
74
75         /// <summary>
76         /// Sets the upper bound of the prediction amount for clamping
77         /// </summary>
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)
82         {
83             Interop.GestureOptions.SetPanGestureMaximumPredictionAmount(amount);
84             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85         }
86
87         /// <summary>
88         ///  Sets the lower bound of the prediction amount for clamping
89         /// </summary>
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)
94         {
95             Interop.GestureOptions.SetPanGestureMinimumPredictionAmount(amount);
96             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97         }
98
99         /// <summary>
100         /// Sets the amount of prediction interpolation to adjust when the pan velocity is changed
101         /// </summary>
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)
106         {
107             Interop.GestureOptions.SetPanGesturePredictionAmountAdjustment(amount);
108             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109         }
110
111         /// <summary>
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 />
116         /// </summary>
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)
121         {
122             Interop.GestureOptions.SetPanGestureSmoothingMode(mode);
123             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124         }
125
126         /// <summary>
127         /// Sets the smoothing amount of the pan gesture
128         /// </summary>
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)
133         {
134             Interop.GestureOptions.SetPanGestureSmoothingAmount(amount);
135             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136         }
137
138         /// <summary>
139         /// Sets whether to use actual times of the real gesture and frames or not.
140         /// </summary>
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)
145         {
146             Interop.GestureOptions.SetPanGestureUseActualTimes(enable);
147             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148         }
149
150         /// <summary>
151         /// Sets the interpolation time range (ms) of past points to use (with weights) when interpolating.
152         /// </summary>
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)
157         {
158             Interop.GestureOptions.SetPanGestureInterpolationTimeRange(range);
159             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160         }
161
162         /// <summary>
163         /// Sets whether to use scalar only prediction, which when enabled, ignores acceleration.
164         /// </summary>
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)
169         {
170             Interop.GestureOptions.SetPanGestureScalarOnlyPredictionEnabled(enable);
171             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172         }
173
174         /// <summary>
175         /// Sets whether to use two point prediction. This combines two interpolated points to get more steady acceleration and velocity values.
176         /// </summary>
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)
181         {
182             Interop.GestureOptions.SetPanGestureTwoPointPredictionEnabled(enable);
183             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184         }
185
186         /// <summary>
187         /// Sets the time in the past to interpolate the second point when using two point interpolation.
188         /// </summary>
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)
193         {
194             Interop.GestureOptions.SetPanGestureTwoPointInterpolatePastTime(time);
195             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196         }
197
198         /// <summary>
199         /// Sets the two point velocity bias. This is the ratio of first and second points to use for velocity.
200         /// </summary>
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)
205         {
206             Interop.GestureOptions.SetPanGestureTwoPointVelocityBias(velocity);
207             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208         }
209
210         /// <summary>
211         /// Sets the two point acceleration bias. This is the ratio of first and second points to use for acceleration.
212         /// </summary>
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)
217         {
218             Interop.GestureOptions.SetPanGestureTwoPointAccelerationBias(acceleration);
219             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220         }
221
222         /// <summary>
223         /// Sets the range of time (ms) of points in the history to perform multitap smoothing with (if enabled).
224         /// </summary>
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)
229         {
230             Interop.GestureOptions.SetPanGestureMultitapSmoothingRange(range);
231             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232         }
233
234         /// <summary>
235         /// Sets the minimum distance required to start a pan event
236         /// </summary>
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)
241         {
242             Interop.GestureOptions.SetPanGestureMinimumDistance(distance);
243             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244         }
245
246         /// <summary>
247         /// Sets the minimum number of touch events required to start a pan
248         /// </summary>
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)
253         {
254             Interop.GestureOptions.SetPanGestureMinimumPanEvents(number);
255             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256         }
257
258         /// <summary>
259         /// Sets the minimum distance required to start a pinch event
260         /// </summary>
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)
265         {
266             Interop.GestureOptions.SetPinchGestureMinimumDistance(distance);
267             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268         }
269
270         /// <summary>
271         /// Sets the minimum touch events required before a pinch can be started
272         /// </summary>
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)
277         {
278             Interop.GestureOptions.SetPinchGestureMinimumTouchEvents(number);
279             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280         }
281
282         /// <summary>
283         /// Sets the minimum touch events required after a pinch started
284         /// </summary>
285         /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
286         /// <param name="number">The number of touch events</param>
287         [EditorBrowsable(EditorBrowsableState.Never)]
288         public void SetPinchGestureMinimumTouchEventsAfterStart(uint number)
289         {
290             Interop.GestureOptions.SetPinchGestureMinimumTouchEventsAfterStart(number);
291             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292         }
293
294         /// <summary>
295         /// Sets the minimum touch events required before a rotation can be started
296         /// </summary>
297         /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
298         /// <param name="number">The number of touch events</param>
299         [EditorBrowsable(EditorBrowsableState.Never)]
300         public void SetRotationGestureMinimumTouchEvents(uint number)
301         {
302             Interop.GestureOptions.SetRotationGestureMinimumTouchEvents(number);
303             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304         }
305
306         /// <summary>
307         /// Sets the minimum touch events required after a rotation started
308         /// </summary>
309         /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
310         /// <param name="number">The number of touch events</param>
311         [EditorBrowsable(EditorBrowsableState.Never)]
312         public void SetRotationGestureMinimumTouchEventsAfterStart(uint number)
313         {
314             Interop.GestureOptions.SetRotationGestureMinimumTouchEventsAfterStart(number);
315             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316         }
317
318         /// <summary>
319         /// Sets the minimum holding time required to be recognized as a long press gesture
320         /// </summary>
321         /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
322         /// <param name="time">The time value in milliseconds</param>
323         [EditorBrowsable(EditorBrowsableState.Never)]
324         public void SetLongPressMinimumHoldingTime(uint time)
325         {
326             Interop.GestureOptions.SetLongPressMinimumHoldingTime(time);
327             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
328         }
329
330         /// <summary>
331         /// Sets the duration in milliseconds between the first tap's up event and the second tap's down event to be recognized as a duoble-tap gesture.
332         /// </summary>
333         /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
334         /// <param name="ms">The time value in milliseconds</param>
335         [EditorBrowsable(EditorBrowsableState.Never)]
336         public void SetDoubleTapTimeout(uint ms)
337         {
338             Interop.GestureOptions.SetDoubleTapTimeout(ms);
339             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340         }
341     }
342 }