[NUI] Deprecate swigCMemOwn which is not used
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / UIComponents / ScrollBar.cs
1 /*
2  * Copyright(c) 2018 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 System;
18 using System.ComponentModel;
19 using System.Runtime.InteropServices;
20 using Tizen.NUI.BaseComponents;
21 using Tizen.NUI.Binding;
22
23 namespace Tizen.NUI.UIComponents
24 {
25     /// <summary>
26     /// The ScrollBar is a UI component that can be linked to the scrollable objects
27     /// indicating the current scroll position of the scrollable object.<br />
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     /// This will be deprecated
31     [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
32     [EditorBrowsable(EditorBrowsableState.Never)]
33     public class ScrollBar : View
34     {
35         /// This will be deprecated
36         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
37         [EditorBrowsable(EditorBrowsableState.Never)]
38         public static readonly BindableProperty ScrollDirectionProperty = BindableProperty.Create(nameof(ScrollDirection), typeof(Direction), typeof(ScrollBar), Direction.Vertical, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
39         {
40             var scrollBar = (ScrollBar)bindable;
41             string valueToString = "";
42             if (newValue != null)
43             {
44                 switch ((Direction)newValue)
45                 {
46                     case Direction.Vertical: { valueToString = "Vertical"; break; }
47                     case Direction.Horizontal: { valueToString = "Horizontal"; break; }
48                     default: { valueToString = "Vertical"; break; }
49                 }
50                 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.ScrollDirection, new Tizen.NUI.PropertyValue(valueToString));
51             }
52         }),
53         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
54         {
55             var scrollBar = (ScrollBar)bindable;
56             string temp;
57             if (Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.ScrollDirection).Get(out temp) == false)
58             {
59                 NUILog.Error("ScrollDirection get error!");
60             }
61
62             switch (temp)
63             {
64                 case "Vertical": return Direction.Vertical;
65                 case "Horizontal": return Direction.Horizontal;
66                 default: return Direction.Vertical;
67             }
68         }));
69         /// This will be deprecated
70         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
71         [EditorBrowsable(EditorBrowsableState.Never)]
72         public static readonly BindableProperty IndicatorHeightPolicyProperty = BindableProperty.Create(nameof(IndicatorHeightPolicy), typeof(IndicatorHeightPolicyType), typeof(ScrollBar), IndicatorHeightPolicyType.Variable, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
73         {
74             var scrollBar = (ScrollBar)bindable;
75             string valueToString = "";
76             if (newValue != null)
77             {
78                 switch ((IndicatorHeightPolicyType)newValue)
79                 {
80                     case IndicatorHeightPolicyType.Variable: { valueToString = "Variable"; break; }
81                     case IndicatorHeightPolicyType.Fixed: { valueToString = "Fixed"; break; }
82                     default: { valueToString = "Variable"; break; }
83                 }
84                 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHeightPolicy, new Tizen.NUI.PropertyValue(valueToString));
85             }
86         }),
87         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
88         {
89             var scrollBar = (ScrollBar)bindable;
90             string temp;
91             if (Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHeightPolicy).Get(out temp) == false)
92             {
93                 NUILog.Error("IndicatorHeightPolicy get error!");
94             }
95
96             switch (temp)
97             {
98                 case "Variable": return IndicatorHeightPolicyType.Variable;
99                 case "Fixed": return IndicatorHeightPolicyType.Fixed;
100                 default: return IndicatorHeightPolicyType.Variable;
101             }
102         }));
103         /// This will be deprecated
104         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
105         [EditorBrowsable(EditorBrowsableState.Never)]
106         public static readonly BindableProperty IndicatorFixedHeightProperty = BindableProperty.Create(nameof(IndicatorFixedHeight), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
107         {
108             var scrollBar = (ScrollBar)bindable;
109             if (newValue != null)
110             {
111                 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorFixedHeight, new Tizen.NUI.PropertyValue((float)newValue));
112             }
113         }),
114         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
115         {
116             var scrollBar = (ScrollBar)bindable;
117             float temp = 0.0f;
118             Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorFixedHeight).Get(out temp);
119             return temp;
120         }));
121         /// This will be deprecated
122         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
123         [EditorBrowsable(EditorBrowsableState.Never)]
124         public static readonly BindableProperty IndicatorShowDurationProperty = BindableProperty.Create(nameof(IndicatorShowDuration), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
125         {
126             var scrollBar = (ScrollBar)bindable;
127             if (newValue != null)
128             {
129                 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorShowDuration, new Tizen.NUI.PropertyValue((float)newValue));
130             }
131         }),
132         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
133         {
134             var scrollBar = (ScrollBar)bindable;
135             float temp = 0.0f;
136             Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorShowDuration).Get(out temp);
137             return temp;
138         }));
139         /// This will be deprecated
140         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
141         [EditorBrowsable(EditorBrowsableState.Never)]
142         public static readonly BindableProperty IndicatorHideDurationProperty = BindableProperty.Create(nameof(IndicatorHideDuration), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
143         {
144             var scrollBar = (ScrollBar)bindable;
145             if (newValue != null)
146             {
147                 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHideDuration, new Tizen.NUI.PropertyValue((float)newValue));
148             }
149         }),
150         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
151         {
152             var scrollBar = (ScrollBar)bindable;
153             float temp = 0.0f;
154             Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHideDuration).Get(out temp);
155             return temp;
156         }));
157         /// This will be deprecated
158         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
159         [EditorBrowsable(EditorBrowsableState.Never)]
160         public static readonly BindableProperty ScrollPositionIntervalsProperty = BindableProperty.Create(nameof(ScrollPositionIntervals), typeof(PropertyArray), typeof(ScrollBar), new PropertyArray(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
161         {
162             var scrollBar = (ScrollBar)bindable;
163             if (newValue != null)
164             {
165                 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.ScrollPositionIntervals, new Tizen.NUI.PropertyValue((PropertyArray)newValue));
166             }
167         }),
168         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
169         {
170             var scrollBar = (ScrollBar)bindable;
171             Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
172             Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.ScrollPositionIntervals).Get(temp);
173             return temp;
174         }));
175         /// This will be deprecated
176         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
177         [EditorBrowsable(EditorBrowsableState.Never)]
178         public static readonly BindableProperty IndicatorMinimumHeightProperty = BindableProperty.Create(nameof(IndicatorMinimumHeight), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
179         {
180             var scrollBar = (ScrollBar)bindable;
181             if (newValue != null)
182             {
183                 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorMinimumHeight, new Tizen.NUI.PropertyValue((float)newValue));
184             }
185         }),
186         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
187         {
188             var scrollBar = (ScrollBar)bindable;
189             float temp = 0.0f;
190             Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorMinimumHeight).Get(out temp);
191             return temp;
192         }));
193         /// This will be deprecated
194         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
195         [EditorBrowsable(EditorBrowsableState.Never)]
196         public static readonly BindableProperty IndicatorStartPaddingProperty = BindableProperty.Create(nameof(IndicatorStartPadding), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
197         {
198             var scrollBar = (ScrollBar)bindable;
199             if (newValue != null)
200             {
201                 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorStartPadding, new Tizen.NUI.PropertyValue((float)newValue));
202             }
203         }),
204         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
205         {
206             var scrollBar = (ScrollBar)bindable;
207             float temp = 0.0f;
208             Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorStartPadding).Get(out temp);
209             return temp;
210         }));
211         /// This will be deprecated
212         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
213         [EditorBrowsable(EditorBrowsableState.Never)]
214         public static readonly BindableProperty IndicatorEndPaddingProperty = BindableProperty.Create(nameof(IndicatorEndPadding), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
215         {
216             var scrollBar = (ScrollBar)bindable;
217             if (newValue != null)
218             {
219                 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorEndPadding, new Tizen.NUI.PropertyValue((float)newValue));
220             }
221         }),
222         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
223         {
224             var scrollBar = (ScrollBar)bindable;
225             float temp = 0.0f;
226             Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorEndPadding).Get(out temp);
227             return temp;
228         }));
229
230
231         private EventHandler<PanFinishedEventArgs> _scrollBarPanFinishedEventHandler;
232         private PanFinishedEventCallbackDelegate _scrollBarPanFinishedEventCallbackDelegate;
233
234         private EventHandler<ScrollIntervalEventArgs> _scrollBarScrollPositionIntervalReachedEventHandler;
235         private ScrollPositionIntervalReachedEventCallbackDelegate _scrollBarScrollPositionIntervalReachedEventCallbackDelegate;
236
237         /// <summary>
238         /// Creates an initialized scrollbar.
239         /// </summary>
240         /// <param name="direction">The direction of the scrollbar (either vertically or horizontally).</param>
241         /// <since_tizen> 3 </since_tizen>
242         /// This will be deprecated
243         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
244         [EditorBrowsable(EditorBrowsableState.Never)]
245         public ScrollBar(ScrollBar.Direction direction) : this(Interop.ScrollBar.New((int)direction), true)
246         {
247             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248         }
249
250         /// <summary>
251         /// Creates an uninitialized scrollbar.
252         /// </summary>
253         /// <since_tizen> 3 </since_tizen>
254         /// This will be deprecated
255         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
256         [EditorBrowsable(EditorBrowsableState.Never)]
257         public ScrollBar() : this(Interop.ScrollBar.New(), true)
258         {
259             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260         }
261
262         internal ScrollBar(ScrollBar scrollBar) : this(Interop.ScrollBar.NewScrollBar(ScrollBar.getCPtr(scrollBar)), true)
263         {
264             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265         }
266
267         internal ScrollBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
268         {
269         }
270
271         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
272         private delegate void PanFinishedEventCallbackDelegate();
273
274         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
275         private delegate void ScrollPositionIntervalReachedEventCallbackDelegate(float position);
276
277         /// <summary>
278         /// The event emitted when panning is finished on the scroll indicator.
279         /// </summary>
280         /// <remarks>Event only emitted when the source of the scroll position properties are set.</remarks>
281         /// <since_tizen> 3 </since_tizen>
282         /// This will be deprecated
283         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
284         [EditorBrowsable(EditorBrowsableState.Never)]
285         public event EventHandler<PanFinishedEventArgs> PanFinished
286         {
287             add
288             {
289                 if (_scrollBarPanFinishedEventHandler == null)
290                 {
291                     _scrollBarPanFinishedEventCallbackDelegate = (OnScrollBarPanFinished);
292                     VoidSignal panFinished = PanFinishedSignal();
293                     panFinished?.Connect(_scrollBarPanFinishedEventCallbackDelegate);
294                     panFinished?.Dispose();
295                 }
296                 _scrollBarPanFinishedEventHandler += value;
297             }
298             remove
299             {
300                 _scrollBarPanFinishedEventHandler -= value;
301                 VoidSignal panFinished = PanFinishedSignal();
302                 if (_scrollBarPanFinishedEventHandler == null && panFinished.Empty() == false)
303                 {
304                     panFinished?.Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
305                 }
306                 panFinished?.Dispose();
307             }
308         }
309
310         /// <summary>
311         /// This is the event emitted when the current scroll position of the scrollable content goes above or below the values specified by ScrollPositionIntervals property.
312         /// </summary>
313         /// <remarks>Event only emitted when the source of the scroll position properties are set.</remarks>
314         /// <since_tizen> 3 </since_tizen>
315         /// This will be deprecated
316         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
317         [EditorBrowsable(EditorBrowsableState.Never)]
318         public event EventHandler<ScrollIntervalEventArgs> ScrollInterval
319         {
320             add
321             {
322                 if (_scrollBarScrollPositionIntervalReachedEventHandler == null)
323                 {
324                     _scrollBarScrollPositionIntervalReachedEventCallbackDelegate = (OnScrollBarScrollPositionIntervalReached);
325                     FloatSignal scrollPositionIntervalReached = ScrollPositionIntervalReachedSignal();
326                     scrollPositionIntervalReached?.Connect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
327                     scrollPositionIntervalReached?.Dispose();
328                 }
329                 _scrollBarScrollPositionIntervalReachedEventHandler += value;
330             }
331             remove
332             {
333                 _scrollBarScrollPositionIntervalReachedEventHandler -= value;
334                 FloatSignal scrollPositionIntervalReached = ScrollPositionIntervalReachedSignal();
335                 if (_scrollBarScrollPositionIntervalReachedEventHandler == null && scrollPositionIntervalReached.Empty() == false)
336                 {
337                     scrollPositionIntervalReached?.Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
338                 }
339                 scrollPositionIntervalReached?.Dispose();
340             }
341         }
342
343         /// <summary>
344         /// The direction of the scrollbar.
345         /// </summary>
346         /// <since_tizen> 3 </since_tizen>
347         /// This will be deprecated
348         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
349         [EditorBrowsable(EditorBrowsableState.Never)]
350         public enum Direction
351         {
352             /// <summary>
353             /// Scroll in the vertical direction
354             /// </summary>
355             /// <since_tizen> 3 </since_tizen>
356             /// This will be deprecated
357             [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
358             [EditorBrowsable(EditorBrowsableState.Never)]
359             Vertical = 0,
360             /// <summary>
361             /// Scroll in the horizontal direction
362             /// </summary>
363             /// <since_tizen> 3 </since_tizen>
364             /// This will be deprecated
365             [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
366             [EditorBrowsable(EditorBrowsableState.Never)]
367             Horizontal
368         }
369
370         /// <summary>
371         /// The indicator height policy.
372         /// </summary>
373         /// <since_tizen> 3 </since_tizen>
374         /// This will be deprecated
375         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
376         [EditorBrowsable(EditorBrowsableState.Never)]
377         public enum IndicatorHeightPolicyType
378         {
379             /// <summary>
380             /// Variable height changed dynamically according to the length of scroll content
381             /// </summary>
382             /// <since_tizen> 3 </since_tizen>
383                         /// This will be deprecated
384             [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
385             [EditorBrowsable(EditorBrowsableState.Never)]
386             Variable = 0,
387             /// <summary>
388             /// Fixed height regardless of the length of scroll content
389             /// </summary>
390             /// <since_tizen> 3 </since_tizen>
391                         /// This will be deprecated
392             [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
393             [EditorBrowsable(EditorBrowsableState.Never)]
394             Fixed
395         }
396
397         /// <summary>
398         /// The direction of the scrollbar.
399         /// </summary>
400         /// <since_tizen> 3 </since_tizen>
401         /// This will be deprecated
402         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
403         [EditorBrowsable(EditorBrowsableState.Never)]
404         public Direction ScrollDirection
405         {
406             get
407             {
408
409                 return (Direction)GetValue(ScrollDirectionProperty);
410             }
411             set
412             {
413                 SetValue(ScrollDirectionProperty, value);
414             }
415         }
416
417         /// <summary>
418         /// The indicator height policy.
419         /// </summary>
420         /// <since_tizen> 3 </since_tizen>
421         /// This will be deprecated
422         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
423         [EditorBrowsable(EditorBrowsableState.Never)]
424         public IndicatorHeightPolicyType IndicatorHeightPolicy
425         {
426             get
427             {
428                 return (IndicatorHeightPolicyType)GetValue(IndicatorHeightPolicyProperty);
429             }
430             set
431             {
432                 SetValue(IndicatorHeightPolicyProperty, value);
433             }
434         }
435
436         /// <summary>
437         /// The fixed height of the scroll indicator.
438         /// </summary>
439         /// <since_tizen> 3 </since_tizen>
440         /// This will be deprecated
441         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
442         [EditorBrowsable(EditorBrowsableState.Never)]
443         public float IndicatorFixedHeight
444         {
445             get
446             {
447                 return (float)GetValue(IndicatorFixedHeightProperty);
448             }
449             set
450             {
451                 SetValue(IndicatorFixedHeightProperty, value);
452             }
453         }
454
455         /// <summary>
456         /// The duration in seconds for the scroll indicator to become fully visible.
457         /// </summary>
458         /// <since_tizen> 3 </since_tizen>
459         /// This will be deprecated
460         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
461         [EditorBrowsable(EditorBrowsableState.Never)]
462         public float IndicatorShowDuration
463         {
464             get
465             {
466                 return (float)GetValue(IndicatorShowDurationProperty);
467             }
468             set
469             {
470                 SetValue(IndicatorShowDurationProperty, value);
471             }
472         }
473
474         /// <summary>
475         /// The duration in seconds for the scroll indicator to become fully invisible.
476         /// </summary>
477         /// <since_tizen> 3 </since_tizen>
478         /// This will be deprecated
479         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
480         [EditorBrowsable(EditorBrowsableState.Never)]
481         public float IndicatorHideDuration
482         {
483             get
484             {
485                 return (float)GetValue(IndicatorHideDurationProperty);
486             }
487             set
488             {
489                 SetValue(IndicatorHideDurationProperty, value);
490             }
491         }
492
493         /// <summary>
494         /// The list of values to get the notification when the current scroll position of the scrollable object goes above or below any of these values.
495         /// </summary>
496         /// <since_tizen> 3 </since_tizen>
497         /// This will be deprecated
498         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
499         [EditorBrowsable(EditorBrowsableState.Never)]
500         public Tizen.NUI.PropertyArray ScrollPositionIntervals
501         {
502             get
503             {
504                 return (PropertyArray)GetValue(ScrollPositionIntervalsProperty);
505             }
506             set
507             {
508                 SetValue(ScrollPositionIntervalsProperty, value);
509             }
510         }
511
512         /// <summary>
513         /// The minimum height for a variable size indicator.
514         /// </summary>
515         /// <since_tizen> 3 </since_tizen>
516         /// This will be deprecated
517         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
518         [EditorBrowsable(EditorBrowsableState.Never)]
519         public float IndicatorMinimumHeight
520         {
521             get
522             {
523                 return (float)GetValue(IndicatorMinimumHeightProperty);
524             }
525             set
526             {
527                 SetValue(IndicatorMinimumHeightProperty, value);
528             }
529         }
530
531         /// <summary>
532         /// The padding at the start of the indicator. For example, the top if the scrollDirection is vertical.
533         /// </summary>
534         /// <since_tizen> 3 </since_tizen>
535         /// This will be deprecated
536         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
537         [EditorBrowsable(EditorBrowsableState.Never)]
538         public float IndicatorStartPadding
539         {
540             get
541             {
542                 return (float)GetValue(IndicatorStartPaddingProperty);
543             }
544             set
545             {
546                 SetValue(IndicatorStartPaddingProperty, value);
547             }
548         }
549
550         /// <summary>
551         /// The padding at the end of the indicator. For example, the bottom if the scrollDirection is vertical.
552         /// </summary>
553         /// <since_tizen> 3 </since_tizen>
554         /// This will be deprecated
555         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
556         [EditorBrowsable(EditorBrowsableState.Never)]
557         public float IndicatorEndPadding
558         {
559             get
560             {
561                 return (float)GetValue(IndicatorEndPaddingProperty);
562             }
563             set
564             {
565                 SetValue(IndicatorEndPaddingProperty, value);
566             }
567         }
568
569         /// <summary>
570         /// Sets the source of the scroll position properties.
571         /// </summary>
572         /// <param name="handle">The handle of the object owing the scroll properties.</param>
573         /// <param name="propertyScrollPosition">The index of the scroll position property(The scroll position, type float).</param>
574         /// <param name="propertyMinScrollPosition">The index of the minimum scroll position property(The minimum scroll position, type float).</param>
575         /// <param name="propertyMaxScrollPosition">The index of the maximum scroll position property(The maximum scroll position, type float).</param>
576         /// <param name="propertyScrollContentSize">The index of the scroll content size property(The size of the scrollable content in actor coordinates, type float).</param>
577         /// <remarks>The handle to the object owing the scroll properties has been initialised and the property index must be valid.</remarks>
578         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
579         [EditorBrowsable(EditorBrowsableState.Never)]
580         public void SetScrollPropertySource(Animatable handle, int propertyScrollPosition, int propertyMinScrollPosition, int propertyMaxScrollPosition, int propertyScrollContentSize)
581         {
582             Interop.ScrollBar.SetScrollPropertySource(SwigCPtr, Animatable.getCPtr(handle), propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
583             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
584         }
585
586         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollBar obj)
587         {
588             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
589         }
590
591         internal void SetScrollIndicator(View indicator)
592         {
593             Interop.ScrollBar.SetScrollIndicator(SwigCPtr, View.getCPtr(indicator));
594             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
595         }
596
597         internal View GetScrollIndicator()
598         {
599             View ret = new View(Interop.ScrollBar.GetScrollIndicator(SwigCPtr), true);
600             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
601             return ret;
602         }
603
604         internal void SetScrollDirection(ScrollBar.Direction direction)
605         {
606             Interop.ScrollBar.SetScrollDirection(SwigCPtr, (int)direction);
607             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
608         }
609
610         internal ScrollBar.Direction GetScrollDirection()
611         {
612             ScrollBar.Direction ret = (ScrollBar.Direction)Interop.ScrollBar.GetScrollDirection(SwigCPtr);
613             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614             return ret;
615         }
616
617         internal void SetIndicatorHeightPolicy(ScrollBar.IndicatorHeightPolicyType policy)
618         {
619             Interop.ScrollBar.SetIndicatorHeightPolicy(SwigCPtr, (int)policy);
620             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
621         }
622
623         internal ScrollBar.IndicatorHeightPolicyType GetIndicatorHeightPolicy()
624         {
625             ScrollBar.IndicatorHeightPolicyType ret = (ScrollBar.IndicatorHeightPolicyType)Interop.ScrollBar.GetIndicatorHeightPolicy(SwigCPtr);
626             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
627             return ret;
628         }
629
630         internal void SetIndicatorFixedHeight(float height)
631         {
632             Interop.ScrollBar.SetIndicatorFixedHeight(SwigCPtr, height);
633             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
634         }
635
636         internal float GetIndicatorFixedHeight()
637         {
638             float ret = Interop.ScrollBar.GetIndicatorFixedHeight(SwigCPtr);
639             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640             return ret;
641         }
642
643         internal void SetIndicatorShowDuration(float durationSeconds)
644         {
645             Interop.ScrollBar.SetIndicatorShowDuration(SwigCPtr, durationSeconds);
646             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
647         }
648
649         internal float GetIndicatorShowDuration()
650         {
651             float ret = Interop.ScrollBar.GetIndicatorShowDuration(SwigCPtr);
652             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
653             return ret;
654         }
655
656         internal void SetIndicatorHideDuration(float durationSeconds)
657         {
658             Interop.ScrollBar.SetIndicatorHideDuration(SwigCPtr, durationSeconds);
659             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
660         }
661
662         internal float GetIndicatorHideDuration()
663         {
664             float ret = Interop.ScrollBar.GetIndicatorHideDuration(SwigCPtr);
665             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
666             return ret;
667         }
668
669         internal void ShowIndicator()
670         {
671             Interop.ScrollBar.ShowIndicator(SwigCPtr);
672             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
673         }
674
675         internal void HideIndicator()
676         {
677             Interop.ScrollBar.HideIndicator(SwigCPtr);
678             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
679         }
680
681         internal VoidSignal PanFinishedSignal()
682         {
683             VoidSignal ret = new VoidSignal(Interop.ScrollBar.PanFinishedSignal(SwigCPtr), false);
684             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
685             return ret;
686         }
687
688         internal FloatSignal ScrollPositionIntervalReachedSignal()
689         {
690             FloatSignal ret = new FloatSignal(Interop.ScrollBar.ScrollPositionIntervalReachedSignal(SwigCPtr), false);
691             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692             return ret;
693         }
694
695         /// <summary>
696         /// To dispose the ScrollBar instance.
697         /// </summary>
698         /// <since_tizen> 3 </since_tizen>
699         /// This will be deprecated
700         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
701         [EditorBrowsable(EditorBrowsableState.Never)]
702         protected override void Dispose(DisposeTypes type)
703         {
704             if (disposed)
705             {
706                 return;
707             }
708
709             //Release your own unmanaged resources here.
710             //You should not access any managed member here except static instance.
711             //because the execution order of Finalizes is non-deterministic.
712             if (this != null)
713             {
714                 if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null)
715                 {
716                     FloatSignal scrollPositionIntervalReached = ScrollPositionIntervalReachedSignal();
717                     scrollPositionIntervalReached?.Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
718                     scrollPositionIntervalReached?.Dispose();
719                 }
720
721                 if (_scrollBarPanFinishedEventCallbackDelegate != null)
722                 {
723                     VoidSignal panFinished = PanFinishedSignal();
724                     panFinished?.Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
725                     panFinished?.Dispose();
726                 }
727             }
728
729             base.Dispose(type);
730         }
731
732         /// This will not be public opened.
733         [EditorBrowsable(EditorBrowsableState.Never)]
734         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
735         {
736             Interop.ScrollBar.DeleteScrollBar(swigCPtr);
737         }
738
739         // Callback for ScrollBar PanFinishedSignal
740         private void OnScrollBarPanFinished()
741         {
742             PanFinishedEventArgs e = new PanFinishedEventArgs();
743
744             if (_scrollBarPanFinishedEventHandler != null)
745             {
746                 //here we send all data to user event handlers
747                 _scrollBarPanFinishedEventHandler(this, e);
748             }
749         }
750
751
752         // Callback for ScrollBar ScrollPositionIntervalReachedSignal
753         private void OnScrollBarScrollPositionIntervalReached(float position)
754         {
755             ScrollIntervalEventArgs e = new ScrollIntervalEventArgs();
756             e.CurrentScrollPosition = position;
757
758             if (_scrollBarScrollPositionIntervalReachedEventHandler != null)
759             {
760                 //here we send all data to user event handlers
761                 _scrollBarScrollPositionIntervalReachedEventHandler(this, e);
762             }
763         }
764
765
766
767         /// <summary>
768         /// Event arguments that passed via the PanFinished event.
769         /// </summary>
770         /// <since_tizen> 3 </since_tizen>
771         /// This will be deprecated
772         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
773         [EditorBrowsable(EditorBrowsableState.Never)]
774         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
775         public class PanFinishedEventArgs : EventArgs
776         {
777         }
778
779         /// <summary>
780         /// Event arguments that passed via the ScrollPositionIntervalReached event.
781         /// </summary>
782         /// <since_tizen> 3 </since_tizen>
783         /// This will be deprecated
784         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
785         [EditorBrowsable(EditorBrowsableState.Never)]
786         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
787         public class ScrollIntervalEventArgs : EventArgs
788         {
789             private float _currentScrollPosition;
790
791             /// <summary>
792             /// The current scroll position of the scrollable content.
793             /// </summary>
794             /// <since_tizen> 3 </since_tizen>
795             /// This will be deprecated
796             [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
797             [EditorBrowsable(EditorBrowsableState.Never)]
798             public float CurrentScrollPosition
799             {
800                 get
801                 {
802                     return _currentScrollPosition;
803                 }
804                 set
805                 {
806                     _currentScrollPosition = value;
807                 }
808             }
809         }
810
811         internal new class Property
812         {
813             internal static readonly int ScrollDirection = Interop.ScrollBar.ScrollDirectionGet();
814             internal static readonly int IndicatorHeightPolicy = Interop.ScrollBar.IndicatorHeightPolicyGet();
815             internal static readonly int IndicatorFixedHeight = Interop.ScrollBar.IndicatorFixedHeightGet();
816             internal static readonly int IndicatorShowDuration = Interop.ScrollBar.IndicatorShowDurationGet();
817             internal static readonly int IndicatorHideDuration = Interop.ScrollBar.IndicatorHideDurationGet();
818             internal static readonly int ScrollPositionIntervals = Interop.ScrollBar.ScrollPositionIntervalsGet();
819             internal static readonly int IndicatorMinimumHeight = Interop.ScrollBar.IndicatorMinimumHeightGet();
820             internal static readonly int IndicatorStartPadding = Interop.ScrollBar.IndicatorStartPaddingGet();
821             internal static readonly int IndicatorEndPadding = Interop.ScrollBar.IndicatorEndPaddingGet();
822         }
823     }
824 }