[NUI] Refactor dispose pattern to reduce duplication (#1112)
[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("ScrollDirection", typeof(Direction), typeof(ScrollBar), Direction.Vertical, propertyChanged: (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(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_DIRECTION, new Tizen.NUI.PropertyValue(valueToString));
51             }
52         },
53         defaultValueCreator: (bindable) =>
54         {
55             var scrollBar = (ScrollBar)bindable;
56             string temp;
57             if (Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_DIRECTION).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("IndicatorHeightPolicy", typeof(IndicatorHeightPolicyType), typeof(ScrollBar), IndicatorHeightPolicyType.Variable, propertyChanged: (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(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HEIGHT_POLICY, new Tizen.NUI.PropertyValue(valueToString));
85             }
86         },
87         defaultValueCreator: (bindable) =>
88         {
89             var scrollBar = (ScrollBar)bindable;
90             string temp;
91             if (Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HEIGHT_POLICY).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("IndicatorFixedHeight", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
107         {
108             var scrollBar = (ScrollBar)bindable;
109             if (newValue != null)
110             {
111                 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_FIXED_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue));
112             }
113         },
114         defaultValueCreator: (bindable) =>
115         {
116             var scrollBar = (ScrollBar)bindable;
117             float temp = 0.0f;
118             Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_FIXED_HEIGHT).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("IndicatorShowDuration", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
125         {
126             var scrollBar = (ScrollBar)bindable;
127             if (newValue != null)
128             {
129                 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_SHOW_DURATION, new Tizen.NUI.PropertyValue((float)newValue));
130             }
131         },
132         defaultValueCreator: (bindable) =>
133         {
134             var scrollBar = (ScrollBar)bindable;
135             float temp = 0.0f;
136             Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_SHOW_DURATION).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("IndicatorHideDuration", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
143         {
144             var scrollBar = (ScrollBar)bindable;
145             if (newValue != null)
146             {
147                 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HIDE_DURATION, new Tizen.NUI.PropertyValue((float)newValue));
148             }
149         },
150         defaultValueCreator: (bindable) =>
151         {
152             var scrollBar = (ScrollBar)bindable;
153             float temp = 0.0f;
154             Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HIDE_DURATION).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("ScrollPositionIntervals", typeof(PropertyArray), typeof(ScrollBar), new PropertyArray(), propertyChanged: (bindable, oldValue, newValue) =>
161         {
162             var scrollBar = (ScrollBar)bindable;
163             if (newValue != null)
164             {
165                 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_POSITION_INTERVALS, new Tizen.NUI.PropertyValue((PropertyArray)newValue));
166             }
167         },
168         defaultValueCreator: (bindable) =>
169         {
170             var scrollBar = (ScrollBar)bindable;
171             Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
172             Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_POSITION_INTERVALS).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("IndicatorMinimumHeight", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
179         {
180             var scrollBar = (ScrollBar)bindable;
181             if (newValue != null)
182             {
183                 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue));
184             }
185         },
186         defaultValueCreator: (bindable) =>
187         {
188             var scrollBar = (ScrollBar)bindable;
189             float temp = 0.0f;
190             Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT).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("IndicatorStartPadding", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
197         {
198             var scrollBar = (ScrollBar)bindable;
199             if (newValue != null)
200             {
201                 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_START_PADDING, new Tizen.NUI.PropertyValue((float)newValue));
202             }
203         },
204         defaultValueCreator: (bindable) =>
205         {
206             var scrollBar = (ScrollBar)bindable;
207             float temp = 0.0f;
208             Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_START_PADDING).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("IndicatorEndPadding", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
215         {
216             var scrollBar = (ScrollBar)bindable;
217             if (newValue != null)
218             {
219                 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_END_PADDING, new Tizen.NUI.PropertyValue((float)newValue));
220             }
221         },
222         defaultValueCreator: (bindable) =>
223         {
224             var scrollBar = (ScrollBar)bindable;
225             float temp = 0.0f;
226             Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_END_PADDING).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.ScrollBar_New__SWIG_0((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.ScrollBar_New__SWIG_1(), true)
258         {
259             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260         }
261
262         internal ScrollBar(ScrollBar scrollBar) : this(Interop.ScrollBar.new_ScrollBar__SWIG_1(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(Interop.ScrollBar.ScrollBar_SWIGUpcast(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                     PanFinishedSignal().Connect(_scrollBarPanFinishedEventCallbackDelegate);
293                 }
294                 _scrollBarPanFinishedEventHandler += value;
295             }
296             remove
297             {
298                 _scrollBarPanFinishedEventHandler -= value;
299                 if (_scrollBarPanFinishedEventHandler == null && PanFinishedSignal().Empty() == false)
300                 {
301                     PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
302                 }
303             }
304         }
305
306         /// <summary>
307         /// This is the event emitted when the current scroll position of the scrollable content goes above or below the values specified by ScrollPositionIntervals property.
308         /// </summary>
309         /// <remarks>Event only emitted when the source of the scroll position properties are set.</remarks>
310         /// <since_tizen> 3 </since_tizen>
311         /// This will be deprecated
312         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
313         [EditorBrowsable(EditorBrowsableState.Never)]
314         public event EventHandler<ScrollIntervalEventArgs> ScrollInterval
315         {
316             add
317             {
318                 if (_scrollBarScrollPositionIntervalReachedEventHandler == null)
319                 {
320                     _scrollBarScrollPositionIntervalReachedEventCallbackDelegate = (OnScrollBarScrollPositionIntervalReached);
321                     ScrollPositionIntervalReachedSignal().Connect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
322                 }
323                 _scrollBarScrollPositionIntervalReachedEventHandler += value;
324             }
325             remove
326             {
327                 _scrollBarScrollPositionIntervalReachedEventHandler -= value;
328                 if (_scrollBarScrollPositionIntervalReachedEventHandler == null && ScrollPositionIntervalReachedSignal().Empty() == false)
329                 {
330                     ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
331                 }
332             }
333         }
334
335         /// <summary>
336         /// The direction of the scrollbar.
337         /// </summary>
338         /// <since_tizen> 3 </since_tizen>
339         /// This will be deprecated
340         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
341         [EditorBrowsable(EditorBrowsableState.Never)]
342         public enum Direction
343         {
344             /// <summary>
345             /// Scroll in the vertical direction
346             /// </summary>
347             /// <since_tizen> 3 </since_tizen>
348             /// This will be deprecated
349             [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
350             [EditorBrowsable(EditorBrowsableState.Never)]
351             Vertical = 0,
352             /// <summary>
353             /// Scroll in the horizontal 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             Horizontal
360         }
361
362         /// <summary>
363         /// The indicator height policy.
364         /// </summary>
365         /// <since_tizen> 3 </since_tizen>
366         /// This will be deprecated
367         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
368         [EditorBrowsable(EditorBrowsableState.Never)]
369         public enum IndicatorHeightPolicyType
370         {
371             /// <summary>
372             /// Variable height changed dynamically according to the length of scroll content
373             /// </summary>
374             /// <since_tizen> 3 </since_tizen>
375                         /// This will be deprecated
376             [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
377             [EditorBrowsable(EditorBrowsableState.Never)]
378             Variable = 0,
379             /// <summary>
380             /// Fixed height regardless of 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             Fixed
387         }
388
389         /// <summary>
390         /// The direction of the scrollbar.
391         /// </summary>
392         /// <since_tizen> 3 </since_tizen>
393         /// This will be deprecated
394         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
395         [EditorBrowsable(EditorBrowsableState.Never)]
396         public Direction ScrollDirection
397         {
398             get
399             {
400
401                 return (Direction)GetValue(ScrollDirectionProperty);
402             }
403             set
404             {
405                 SetValue(ScrollDirectionProperty, value);
406             }
407         }
408
409         /// <summary>
410         /// The indicator height policy.
411         /// </summary>
412         /// <since_tizen> 3 </since_tizen>
413         /// This will be deprecated
414         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
415         [EditorBrowsable(EditorBrowsableState.Never)]
416         public IndicatorHeightPolicyType IndicatorHeightPolicy
417         {
418             get
419             {
420                 return (IndicatorHeightPolicyType)GetValue(IndicatorHeightPolicyProperty);
421             }
422             set
423             {
424                 SetValue(IndicatorHeightPolicyProperty, value);
425             }
426         }
427
428         /// <summary>
429         /// The fixed height of the scroll indicator.
430         /// </summary>
431         /// <since_tizen> 3 </since_tizen>
432         /// This will be deprecated
433         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
434         [EditorBrowsable(EditorBrowsableState.Never)]
435         public float IndicatorFixedHeight
436         {
437             get
438             {
439                 return (float)GetValue(IndicatorFixedHeightProperty);
440             }
441             set
442             {
443                 SetValue(IndicatorFixedHeightProperty, value);
444             }
445         }
446
447         /// <summary>
448         /// The duration in seconds for the scroll indicator to become fully visible.
449         /// </summary>
450         /// <since_tizen> 3 </since_tizen>
451         /// This will be deprecated
452         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
453         [EditorBrowsable(EditorBrowsableState.Never)]
454         public float IndicatorShowDuration
455         {
456             get
457             {
458                 return (float)GetValue(IndicatorShowDurationProperty);
459             }
460             set
461             {
462                 SetValue(IndicatorShowDurationProperty, value);
463             }
464         }
465
466         /// <summary>
467         /// The duration in seconds for the scroll indicator to become fully invisible.
468         /// </summary>
469         /// <since_tizen> 3 </since_tizen>
470         /// This will be deprecated
471         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
472         [EditorBrowsable(EditorBrowsableState.Never)]
473         public float IndicatorHideDuration
474         {
475             get
476             {
477                 return (float)GetValue(IndicatorHideDurationProperty);
478             }
479             set
480             {
481                 SetValue(IndicatorHideDurationProperty, value);
482             }
483         }
484
485         /// <summary>
486         /// 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.
487         /// </summary>
488         /// <since_tizen> 3 </since_tizen>
489         /// This will be deprecated
490         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
491         [EditorBrowsable(EditorBrowsableState.Never)]
492         public Tizen.NUI.PropertyArray ScrollPositionIntervals
493         {
494             get
495             {
496                 return (PropertyArray)GetValue(ScrollPositionIntervalsProperty);
497             }
498             set
499             {
500                 SetValue(ScrollPositionIntervalsProperty, value);
501             }
502         }
503
504         /// <summary>
505         /// The minimum height for a variable size indicator.
506         /// </summary>
507         /// <since_tizen> 3 </since_tizen>
508         /// This will be deprecated
509         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
510         [EditorBrowsable(EditorBrowsableState.Never)]
511         public float IndicatorMinimumHeight
512         {
513             get
514             {
515                 return (float)GetValue(IndicatorMinimumHeightProperty);
516             }
517             set
518             {
519                 SetValue(IndicatorMinimumHeightProperty, value);
520             }
521         }
522
523         /// <summary>
524         /// The padding at the start of the indicator. For example, the top if the scrollDirection is vertical.
525         /// </summary>
526         /// <since_tizen> 3 </since_tizen>
527         /// This will be deprecated
528         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
529         [EditorBrowsable(EditorBrowsableState.Never)]
530         public float IndicatorStartPadding
531         {
532             get
533             {
534                 return (float)GetValue(IndicatorStartPaddingProperty);
535             }
536             set
537             {
538                 SetValue(IndicatorStartPaddingProperty, value);
539             }
540         }
541
542         /// <summary>
543         /// The padding at the end of the indicator. For example, the bottom if the scrollDirection is vertical.
544         /// </summary>
545         /// <since_tizen> 3 </since_tizen>
546         /// This will be deprecated
547         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
548         [EditorBrowsable(EditorBrowsableState.Never)]
549         public float IndicatorEndPadding
550         {
551             get
552             {
553                 return (float)GetValue(IndicatorEndPaddingProperty);
554             }
555             set
556             {
557                 SetValue(IndicatorEndPaddingProperty, value);
558             }
559         }
560
561         /// <summary>
562         /// Sets the source of the scroll position properties.
563         /// </summary>
564         /// <param name="handle">The handle of the object owing the scroll properties.</param>
565         /// <param name="propertyScrollPosition">The index of the scroll position property(The scroll position, type float).</param>
566         /// <param name="propertyMinScrollPosition">The index of the minimum scroll position property(The minimum scroll position, type float).</param>
567         /// <param name="propertyMaxScrollPosition">The index of the maximum scroll position property(The maximum scroll position, type float).</param>
568         /// <param name="propertyScrollContentSize">The index of the scroll content size property(The size of the scrollable content in actor coordinates, type float).</param>
569         /// <remarks>The handle to the object owing the scroll properties has been initialised and the property index must be valid.</remarks>
570         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
571         [EditorBrowsable(EditorBrowsableState.Never)]
572         public void SetScrollPropertySource(Animatable handle, int propertyScrollPosition, int propertyMinScrollPosition, int propertyMaxScrollPosition, int propertyScrollContentSize)
573         {
574             Interop.ScrollBar.ScrollBar_SetScrollPropertySource(swigCPtr, Animatable.getCPtr(handle), propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
575             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
576         }
577
578         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollBar obj)
579         {
580             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
581         }
582
583         internal void SetScrollIndicator(View indicator)
584         {
585             Interop.ScrollBar.ScrollBar_SetScrollIndicator(swigCPtr, View.getCPtr(indicator));
586             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
587         }
588
589         internal View GetScrollIndicator()
590         {
591             View ret = new View(Interop.ScrollBar.ScrollBar_GetScrollIndicator(swigCPtr), true);
592             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
593             return ret;
594         }
595
596         internal void SetScrollDirection(ScrollBar.Direction direction)
597         {
598             Interop.ScrollBar.ScrollBar_SetScrollDirection(swigCPtr, (int)direction);
599             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
600         }
601
602         internal ScrollBar.Direction GetScrollDirection()
603         {
604             ScrollBar.Direction ret = (ScrollBar.Direction)Interop.ScrollBar.ScrollBar_GetScrollDirection(swigCPtr);
605             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
606             return ret;
607         }
608
609         internal void SetIndicatorHeightPolicy(ScrollBar.IndicatorHeightPolicyType policy)
610         {
611             Interop.ScrollBar.ScrollBar_SetIndicatorHeightPolicy(swigCPtr, (int)policy);
612             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613         }
614
615         internal ScrollBar.IndicatorHeightPolicyType GetIndicatorHeightPolicy()
616         {
617             ScrollBar.IndicatorHeightPolicyType ret = (ScrollBar.IndicatorHeightPolicyType)Interop.ScrollBar.ScrollBar_GetIndicatorHeightPolicy(swigCPtr);
618             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619             return ret;
620         }
621
622         internal void SetIndicatorFixedHeight(float height)
623         {
624             Interop.ScrollBar.ScrollBar_SetIndicatorFixedHeight(swigCPtr, height);
625             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
626         }
627
628         internal float GetIndicatorFixedHeight()
629         {
630             float ret = Interop.ScrollBar.ScrollBar_GetIndicatorFixedHeight(swigCPtr);
631             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
632             return ret;
633         }
634
635         internal void SetIndicatorShowDuration(float durationSeconds)
636         {
637             Interop.ScrollBar.ScrollBar_SetIndicatorShowDuration(swigCPtr, durationSeconds);
638             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
639         }
640
641         internal float GetIndicatorShowDuration()
642         {
643             float ret = Interop.ScrollBar.ScrollBar_GetIndicatorShowDuration(swigCPtr);
644             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
645             return ret;
646         }
647
648         internal void SetIndicatorHideDuration(float durationSeconds)
649         {
650             Interop.ScrollBar.ScrollBar_SetIndicatorHideDuration(swigCPtr, durationSeconds);
651             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652         }
653
654         internal float GetIndicatorHideDuration()
655         {
656             float ret = Interop.ScrollBar.ScrollBar_GetIndicatorHideDuration(swigCPtr);
657             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658             return ret;
659         }
660
661         internal void ShowIndicator()
662         {
663             Interop.ScrollBar.ScrollBar_ShowIndicator(swigCPtr);
664             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
665         }
666
667         internal void HideIndicator()
668         {
669             Interop.ScrollBar.ScrollBar_HideIndicator(swigCPtr);
670             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
671         }
672
673         internal VoidSignal PanFinishedSignal()
674         {
675             VoidSignal ret = new VoidSignal(Interop.ScrollBar.ScrollBar_PanFinishedSignal(swigCPtr), false);
676             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
677             return ret;
678         }
679
680         internal FloatSignal ScrollPositionIntervalReachedSignal()
681         {
682             FloatSignal ret = new FloatSignal(Interop.ScrollBar.ScrollBar_ScrollPositionIntervalReachedSignal(swigCPtr), false);
683             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
684             return ret;
685         }
686
687         /// <summary>
688         /// To dispose the ScrollBar instance.
689         /// </summary>
690         /// <since_tizen> 3 </since_tizen>
691         /// This will be deprecated
692         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
693         [EditorBrowsable(EditorBrowsableState.Never)]
694         protected override void Dispose(DisposeTypes type)
695         {
696             if (disposed)
697             {
698                 return;
699             }
700
701             //Release your own unmanaged resources here.
702             //You should not access any managed member here except static instance.
703             //because the execution order of Finalizes is non-deterministic.
704             if (this != null)
705             {
706                 if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null)
707                 {
708                     ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
709                 }
710
711                 if (_scrollBarPanFinishedEventCallbackDelegate != null)
712                 {
713                     PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
714                 }
715             }
716
717             base.Dispose(type);
718         }
719
720         /// This will not be public opened.
721         [EditorBrowsable(EditorBrowsableState.Never)]
722         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
723         {
724             Interop.ScrollBar.delete_ScrollBar(swigCPtr);
725         }
726
727         // Callback for ScrollBar PanFinishedSignal
728         private void OnScrollBarPanFinished()
729         {
730             PanFinishedEventArgs e = new PanFinishedEventArgs();
731
732             if (_scrollBarPanFinishedEventHandler != null)
733             {
734                 //here we send all data to user event handlers
735                 _scrollBarPanFinishedEventHandler(this, e);
736             }
737         }
738
739
740         // Callback for ScrollBar ScrollPositionIntervalReachedSignal
741         private void OnScrollBarScrollPositionIntervalReached(float position)
742         {
743             ScrollIntervalEventArgs e = new ScrollIntervalEventArgs();
744             e.CurrentScrollPosition = position;
745
746             if (_scrollBarScrollPositionIntervalReachedEventHandler != null)
747             {
748                 //here we send all data to user event handlers
749                 _scrollBarScrollPositionIntervalReachedEventHandler(this, e);
750             }
751         }
752
753
754
755         /// <summary>
756         /// Event arguments that passed via the PanFinished event.
757         /// </summary>
758         /// <since_tizen> 3 </since_tizen>
759         /// This will be deprecated
760         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
761         [EditorBrowsable(EditorBrowsableState.Never)]
762         public class PanFinishedEventArgs : EventArgs
763         {
764         }
765
766         /// <summary>
767         /// Event arguments that passed via the ScrollPositionIntervalReached event.
768         /// </summary>
769         /// <since_tizen> 3 </since_tizen>
770         /// This will be deprecated
771         [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
772         [EditorBrowsable(EditorBrowsableState.Never)]
773         public class ScrollIntervalEventArgs : EventArgs
774         {
775             private float _currentScrollPosition;
776
777             /// <summary>
778             /// The current scroll position of the scrollable content.
779             /// </summary>
780             /// <since_tizen> 3 </since_tizen>
781             /// This will be deprecated
782             [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
783             [EditorBrowsable(EditorBrowsableState.Never)]
784             public float CurrentScrollPosition
785             {
786                 get
787                 {
788                     return _currentScrollPosition;
789                 }
790                 set
791                 {
792                     _currentScrollPosition = value;
793                 }
794             }
795         }
796
797         internal new class Property
798         {
799             internal static readonly int SCROLL_DIRECTION = Interop.ScrollBar.ScrollBar_Property_SCROLL_DIRECTION_get();
800             internal static readonly int INDICATOR_HEIGHT_POLICY = Interop.ScrollBar.ScrollBar_Property_INDICATOR_HEIGHT_POLICY_get();
801             internal static readonly int INDICATOR_FIXED_HEIGHT = Interop.ScrollBar.ScrollBar_Property_INDICATOR_FIXED_HEIGHT_get();
802             internal static readonly int INDICATOR_SHOW_DURATION = Interop.ScrollBar.ScrollBar_Property_INDICATOR_SHOW_DURATION_get();
803             internal static readonly int INDICATOR_HIDE_DURATION = Interop.ScrollBar.ScrollBar_Property_INDICATOR_HIDE_DURATION_get();
804             internal static readonly int SCROLL_POSITION_INTERVALS = Interop.ScrollBar.ScrollBar_Property_SCROLL_POSITION_INTERVALS_get();
805             internal static readonly int INDICATOR_MINIMUM_HEIGHT = Interop.ScrollBar.ScrollBar_Property_INDICATOR_MINIMUM_HEIGHT_get();
806             internal static readonly int INDICATOR_START_PADDING = Interop.ScrollBar.ScrollBar_Property_INDICATOR_START_PADDING_get();
807             internal static readonly int INDICATOR_END_PADDING = Interop.ScrollBar.ScrollBar_Property_INDICATOR_END_PADDING_get();
808         }
809     }
810 }