2 * Copyright(c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.ComponentModel;
19 using System.Runtime.InteropServices;
20 using Tizen.NUI.BaseComponents;
21 using Tizen.NUI.Binding;
23 namespace Tizen.NUI.UIComponents
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 />
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
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) =>
40 var scrollBar = (ScrollBar)bindable;
41 string valueToString = "";
44 switch ((Direction)newValue)
46 case Direction.Vertical: { valueToString = "Vertical"; break; }
47 case Direction.Horizontal: { valueToString = "Horizontal"; break; }
48 default: { valueToString = "Vertical"; break; }
50 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.ScrollDirection, new Tizen.NUI.PropertyValue(valueToString));
53 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
55 var scrollBar = (ScrollBar)bindable;
57 if (Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.ScrollDirection).Get(out temp) == false)
59 NUILog.Error("ScrollDirection get error!");
64 case "Vertical": return Direction.Vertical;
65 case "Horizontal": return Direction.Horizontal;
66 default: return Direction.Vertical;
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) =>
74 var scrollBar = (ScrollBar)bindable;
75 string valueToString = "";
78 switch ((IndicatorHeightPolicyType)newValue)
80 case IndicatorHeightPolicyType.Variable: { valueToString = "Variable"; break; }
81 case IndicatorHeightPolicyType.Fixed: { valueToString = "Fixed"; break; }
82 default: { valueToString = "Variable"; break; }
84 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHeightPolicy, new Tizen.NUI.PropertyValue(valueToString));
87 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
89 var scrollBar = (ScrollBar)bindable;
91 if (Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHeightPolicy).Get(out temp) == false)
93 NUILog.Error("IndicatorHeightPolicy get error!");
98 case "Variable": return IndicatorHeightPolicyType.Variable;
99 case "Fixed": return IndicatorHeightPolicyType.Fixed;
100 default: return IndicatorHeightPolicyType.Variable;
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) =>
108 var scrollBar = (ScrollBar)bindable;
109 if (newValue != null)
111 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorFixedHeight, new Tizen.NUI.PropertyValue((float)newValue));
114 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
116 var scrollBar = (ScrollBar)bindable;
118 Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorFixedHeight).Get(out temp);
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) =>
126 var scrollBar = (ScrollBar)bindable;
127 if (newValue != null)
129 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorShowDuration, new Tizen.NUI.PropertyValue((float)newValue));
132 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
134 var scrollBar = (ScrollBar)bindable;
136 Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorShowDuration).Get(out temp);
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) =>
144 var scrollBar = (ScrollBar)bindable;
145 if (newValue != null)
147 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHideDuration, new Tizen.NUI.PropertyValue((float)newValue));
150 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
152 var scrollBar = (ScrollBar)bindable;
154 Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHideDuration).Get(out temp);
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) =>
162 var scrollBar = (ScrollBar)bindable;
163 if (newValue != null)
165 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.ScrollPositionIntervals, new Tizen.NUI.PropertyValue((PropertyArray)newValue));
168 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
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);
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) =>
180 var scrollBar = (ScrollBar)bindable;
181 if (newValue != null)
183 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorMinimumHeight, new Tizen.NUI.PropertyValue((float)newValue));
186 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
188 var scrollBar = (ScrollBar)bindable;
190 Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorMinimumHeight).Get(out temp);
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) =>
198 var scrollBar = (ScrollBar)bindable;
199 if (newValue != null)
201 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorStartPadding, new Tizen.NUI.PropertyValue((float)newValue));
204 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
206 var scrollBar = (ScrollBar)bindable;
208 Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorStartPadding).Get(out temp);
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) =>
216 var scrollBar = (ScrollBar)bindable;
217 if (newValue != null)
219 Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorEndPadding, new Tizen.NUI.PropertyValue((float)newValue));
222 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
224 var scrollBar = (ScrollBar)bindable;
226 Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorEndPadding).Get(out temp);
231 private EventHandler<PanFinishedEventArgs> _scrollBarPanFinishedEventHandler;
232 private PanFinishedEventCallbackDelegate _scrollBarPanFinishedEventCallbackDelegate;
234 private EventHandler<ScrollIntervalEventArgs> _scrollBarScrollPositionIntervalReachedEventHandler;
235 private ScrollPositionIntervalReachedEventCallbackDelegate _scrollBarScrollPositionIntervalReachedEventCallbackDelegate;
238 /// Creates an initialized scrollbar.
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)
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251 /// Creates an uninitialized scrollbar.
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)
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262 internal ScrollBar(ScrollBar scrollBar) : this(Interop.ScrollBar.NewScrollBar(ScrollBar.getCPtr(scrollBar)), true)
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267 internal ScrollBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
271 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
272 private delegate void PanFinishedEventCallbackDelegate();
274 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
275 private delegate void ScrollPositionIntervalReachedEventCallbackDelegate(float position);
278 /// The event emitted when panning is finished on the scroll indicator.
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
289 if (_scrollBarPanFinishedEventHandler == null)
291 _scrollBarPanFinishedEventCallbackDelegate = (OnScrollBarPanFinished);
292 VoidSignal panFinished = PanFinishedSignal();
293 panFinished?.Connect(_scrollBarPanFinishedEventCallbackDelegate);
294 panFinished?.Dispose();
296 _scrollBarPanFinishedEventHandler += value;
300 _scrollBarPanFinishedEventHandler -= value;
301 VoidSignal panFinished = PanFinishedSignal();
302 if (_scrollBarPanFinishedEventHandler == null && panFinished.Empty() == false)
304 panFinished?.Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
306 panFinished?.Dispose();
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.
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
322 if (_scrollBarScrollPositionIntervalReachedEventHandler == null)
324 _scrollBarScrollPositionIntervalReachedEventCallbackDelegate = (OnScrollBarScrollPositionIntervalReached);
325 FloatSignal scrollPositionIntervalReached = ScrollPositionIntervalReachedSignal();
326 scrollPositionIntervalReached?.Connect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
327 scrollPositionIntervalReached?.Dispose();
329 _scrollBarScrollPositionIntervalReachedEventHandler += value;
333 _scrollBarScrollPositionIntervalReachedEventHandler -= value;
334 FloatSignal scrollPositionIntervalReached = ScrollPositionIntervalReachedSignal();
335 if (_scrollBarScrollPositionIntervalReachedEventHandler == null && scrollPositionIntervalReached.Empty() == false)
337 scrollPositionIntervalReached?.Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
339 scrollPositionIntervalReached?.Dispose();
344 /// The direction of the scrollbar.
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
353 /// Scroll in the vertical direction
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)]
361 /// Scroll in the horizontal direction
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)]
371 /// The indicator height policy.
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
380 /// Variable height changed dynamically according to the length of scroll content
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)]
388 /// Fixed height regardless of the length of scroll content
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)]
398 /// The direction of the scrollbar.
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
409 return (Direction)GetValue(ScrollDirectionProperty);
413 SetValue(ScrollDirectionProperty, value);
418 /// The indicator height policy.
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
428 return (IndicatorHeightPolicyType)GetValue(IndicatorHeightPolicyProperty);
432 SetValue(IndicatorHeightPolicyProperty, value);
437 /// The fixed height of the scroll indicator.
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
447 return (float)GetValue(IndicatorFixedHeightProperty);
451 SetValue(IndicatorFixedHeightProperty, value);
456 /// The duration in seconds for the scroll indicator to become fully visible.
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
466 return (float)GetValue(IndicatorShowDurationProperty);
470 SetValue(IndicatorShowDurationProperty, value);
475 /// The duration in seconds for the scroll indicator to become fully invisible.
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
485 return (float)GetValue(IndicatorHideDurationProperty);
489 SetValue(IndicatorHideDurationProperty, value);
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.
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
504 return (PropertyArray)GetValue(ScrollPositionIntervalsProperty);
508 SetValue(ScrollPositionIntervalsProperty, value);
513 /// The minimum height for a variable size indicator.
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
523 return (float)GetValue(IndicatorMinimumHeightProperty);
527 SetValue(IndicatorMinimumHeightProperty, value);
532 /// The padding at the start of the indicator. For example, the top if the scrollDirection is vertical.
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
542 return (float)GetValue(IndicatorStartPaddingProperty);
546 SetValue(IndicatorStartPaddingProperty, value);
551 /// The padding at the end of the indicator. For example, the bottom if the scrollDirection is vertical.
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
561 return (float)GetValue(IndicatorEndPaddingProperty);
565 SetValue(IndicatorEndPaddingProperty, value);
570 /// Sets the source of the scroll position properties.
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)
582 Interop.ScrollBar.SetScrollPropertySource(SwigCPtr, Animatable.getCPtr(handle), propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
583 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollBar obj)
588 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
591 internal void SetScrollIndicator(View indicator)
593 Interop.ScrollBar.SetScrollIndicator(SwigCPtr, View.getCPtr(indicator));
594 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
597 internal View GetScrollIndicator()
599 View ret = new View(Interop.ScrollBar.GetScrollIndicator(SwigCPtr), true);
600 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
604 internal void SetScrollDirection(ScrollBar.Direction direction)
606 Interop.ScrollBar.SetScrollDirection(SwigCPtr, (int)direction);
607 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
610 internal ScrollBar.Direction GetScrollDirection()
612 ScrollBar.Direction ret = (ScrollBar.Direction)Interop.ScrollBar.GetScrollDirection(SwigCPtr);
613 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
617 internal void SetIndicatorHeightPolicy(ScrollBar.IndicatorHeightPolicyType policy)
619 Interop.ScrollBar.SetIndicatorHeightPolicy(SwigCPtr, (int)policy);
620 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
623 internal ScrollBar.IndicatorHeightPolicyType GetIndicatorHeightPolicy()
625 ScrollBar.IndicatorHeightPolicyType ret = (ScrollBar.IndicatorHeightPolicyType)Interop.ScrollBar.GetIndicatorHeightPolicy(SwigCPtr);
626 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
630 internal void SetIndicatorFixedHeight(float height)
632 Interop.ScrollBar.SetIndicatorFixedHeight(SwigCPtr, height);
633 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
636 internal float GetIndicatorFixedHeight()
638 float ret = Interop.ScrollBar.GetIndicatorFixedHeight(SwigCPtr);
639 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
643 internal void SetIndicatorShowDuration(float durationSeconds)
645 Interop.ScrollBar.SetIndicatorShowDuration(SwigCPtr, durationSeconds);
646 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
649 internal float GetIndicatorShowDuration()
651 float ret = Interop.ScrollBar.GetIndicatorShowDuration(SwigCPtr);
652 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
656 internal void SetIndicatorHideDuration(float durationSeconds)
658 Interop.ScrollBar.SetIndicatorHideDuration(SwigCPtr, durationSeconds);
659 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
662 internal float GetIndicatorHideDuration()
664 float ret = Interop.ScrollBar.GetIndicatorHideDuration(SwigCPtr);
665 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
669 internal void ShowIndicator()
671 Interop.ScrollBar.ShowIndicator(SwigCPtr);
672 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
675 internal void HideIndicator()
677 Interop.ScrollBar.HideIndicator(SwigCPtr);
678 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
681 internal VoidSignal PanFinishedSignal()
683 VoidSignal ret = new VoidSignal(Interop.ScrollBar.PanFinishedSignal(SwigCPtr), false);
684 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
688 internal FloatSignal ScrollPositionIntervalReachedSignal()
690 FloatSignal ret = new FloatSignal(Interop.ScrollBar.ScrollPositionIntervalReachedSignal(SwigCPtr), false);
691 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
696 /// To dispose the ScrollBar instance.
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)
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.
714 if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null)
716 FloatSignal scrollPositionIntervalReached = ScrollPositionIntervalReachedSignal();
717 scrollPositionIntervalReached?.Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
718 scrollPositionIntervalReached?.Dispose();
721 if (_scrollBarPanFinishedEventCallbackDelegate != null)
723 VoidSignal panFinished = PanFinishedSignal();
724 panFinished?.Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
725 panFinished?.Dispose();
732 /// This will not be public opened.
733 [EditorBrowsable(EditorBrowsableState.Never)]
734 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
736 Interop.ScrollBar.DeleteScrollBar(swigCPtr);
739 // Callback for ScrollBar PanFinishedSignal
740 private void OnScrollBarPanFinished()
742 PanFinishedEventArgs e = new PanFinishedEventArgs();
744 if (_scrollBarPanFinishedEventHandler != null)
746 //here we send all data to user event handlers
747 _scrollBarPanFinishedEventHandler(this, e);
752 // Callback for ScrollBar ScrollPositionIntervalReachedSignal
753 private void OnScrollBarScrollPositionIntervalReached(float position)
755 ScrollIntervalEventArgs e = new ScrollIntervalEventArgs();
756 e.CurrentScrollPosition = position;
758 if (_scrollBarScrollPositionIntervalReachedEventHandler != null)
760 //here we send all data to user event handlers
761 _scrollBarScrollPositionIntervalReachedEventHandler(this, e);
768 /// Event arguments that passed via the PanFinished event.
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
780 /// Event arguments that passed via the ScrollPositionIntervalReached event.
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
789 private float _currentScrollPosition;
792 /// The current scroll position of the scrollable content.
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
802 return _currentScrollPosition;
806 _currentScrollPosition = value;
811 internal new class Property
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();