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("ScrollDirection", typeof(Direction), typeof(ScrollBar), Direction.Vertical, propertyChanged: (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(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_DIRECTION, new Tizen.NUI.PropertyValue(valueToString));
53 defaultValueCreator: (bindable) =>
55 var scrollBar = (ScrollBar)bindable;
57 if (Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_DIRECTION).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("IndicatorHeightPolicy", typeof(IndicatorHeightPolicyType), typeof(ScrollBar), IndicatorHeightPolicyType.Variable, propertyChanged: (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(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HEIGHT_POLICY, new Tizen.NUI.PropertyValue(valueToString));
87 defaultValueCreator: (bindable) =>
89 var scrollBar = (ScrollBar)bindable;
91 if (Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HEIGHT_POLICY).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("IndicatorFixedHeight", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
108 var scrollBar = (ScrollBar)bindable;
109 if (newValue != null)
111 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_FIXED_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue));
114 defaultValueCreator: (bindable) =>
116 var scrollBar = (ScrollBar)bindable;
118 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_FIXED_HEIGHT).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("IndicatorShowDuration", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
126 var scrollBar = (ScrollBar)bindable;
127 if (newValue != null)
129 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_SHOW_DURATION, new Tizen.NUI.PropertyValue((float)newValue));
132 defaultValueCreator: (bindable) =>
134 var scrollBar = (ScrollBar)bindable;
136 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_SHOW_DURATION).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("IndicatorHideDuration", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
144 var scrollBar = (ScrollBar)bindable;
145 if (newValue != null)
147 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HIDE_DURATION, new Tizen.NUI.PropertyValue((float)newValue));
150 defaultValueCreator: (bindable) =>
152 var scrollBar = (ScrollBar)bindable;
154 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HIDE_DURATION).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("ScrollPositionIntervals", typeof(PropertyArray), typeof(ScrollBar), new PropertyArray(), propertyChanged: (bindable, oldValue, newValue) =>
162 var scrollBar = (ScrollBar)bindable;
163 if (newValue != null)
165 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_POSITION_INTERVALS, new Tizen.NUI.PropertyValue((PropertyArray)newValue));
168 defaultValueCreator: (bindable) =>
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);
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) =>
180 var scrollBar = (ScrollBar)bindable;
181 if (newValue != null)
183 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue));
186 defaultValueCreator: (bindable) =>
188 var scrollBar = (ScrollBar)bindable;
190 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT).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("IndicatorStartPadding", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
198 var scrollBar = (ScrollBar)bindable;
199 if (newValue != null)
201 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_START_PADDING, new Tizen.NUI.PropertyValue((float)newValue));
204 defaultValueCreator: (bindable) =>
206 var scrollBar = (ScrollBar)bindable;
208 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_START_PADDING).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("IndicatorEndPadding", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
216 var scrollBar = (ScrollBar)bindable;
217 if (newValue != null)
219 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_END_PADDING, new Tizen.NUI.PropertyValue((float)newValue));
222 defaultValueCreator: (bindable) =>
224 var scrollBar = (ScrollBar)bindable;
226 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_END_PADDING).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.ScrollBar_New__SWIG_0((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.ScrollBar_New__SWIG_1(), true)
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262 internal ScrollBar(ScrollBar scrollBar) : this(Interop.ScrollBar.new_ScrollBar__SWIG_1(ScrollBar.getCPtr(scrollBar)), true)
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267 internal ScrollBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.ScrollBar.ScrollBar_SWIGUpcast(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 PanFinishedSignal().Connect(_scrollBarPanFinishedEventCallbackDelegate);
294 _scrollBarPanFinishedEventHandler += value;
298 _scrollBarPanFinishedEventHandler -= value;
299 if (_scrollBarPanFinishedEventHandler == null && PanFinishedSignal().Empty() == false)
301 PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
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.
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
318 if (_scrollBarScrollPositionIntervalReachedEventHandler == null)
320 _scrollBarScrollPositionIntervalReachedEventCallbackDelegate = (OnScrollBarScrollPositionIntervalReached);
321 ScrollPositionIntervalReachedSignal().Connect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
323 _scrollBarScrollPositionIntervalReachedEventHandler += value;
327 _scrollBarScrollPositionIntervalReachedEventHandler -= value;
328 if (_scrollBarScrollPositionIntervalReachedEventHandler == null && ScrollPositionIntervalReachedSignal().Empty() == false)
330 ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
336 /// The direction of the scrollbar.
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
345 /// Scroll in the vertical direction
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)]
353 /// Scroll in the horizontal 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)]
363 /// The indicator height policy.
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
372 /// Variable height changed dynamically according to the length of scroll content
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)]
380 /// Fixed height regardless of 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)]
390 /// The direction of the scrollbar.
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
401 return (Direction)GetValue(ScrollDirectionProperty);
405 SetValue(ScrollDirectionProperty, value);
410 /// The indicator height policy.
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
420 return (IndicatorHeightPolicyType)GetValue(IndicatorHeightPolicyProperty);
424 SetValue(IndicatorHeightPolicyProperty, value);
429 /// The fixed height of the scroll indicator.
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
439 return (float)GetValue(IndicatorFixedHeightProperty);
443 SetValue(IndicatorFixedHeightProperty, value);
448 /// The duration in seconds for the scroll indicator to become fully visible.
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
458 return (float)GetValue(IndicatorShowDurationProperty);
462 SetValue(IndicatorShowDurationProperty, value);
467 /// The duration in seconds for the scroll indicator to become fully invisible.
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
477 return (float)GetValue(IndicatorHideDurationProperty);
481 SetValue(IndicatorHideDurationProperty, value);
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.
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
496 return (PropertyArray)GetValue(ScrollPositionIntervalsProperty);
500 SetValue(ScrollPositionIntervalsProperty, value);
505 /// The minimum height for a variable size indicator.
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
515 return (float)GetValue(IndicatorMinimumHeightProperty);
519 SetValue(IndicatorMinimumHeightProperty, value);
524 /// The padding at the start of the indicator. For example, the top if the scrollDirection is vertical.
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
534 return (float)GetValue(IndicatorStartPaddingProperty);
538 SetValue(IndicatorStartPaddingProperty, value);
543 /// The padding at the end of the indicator. For example, the bottom if the scrollDirection is vertical.
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
553 return (float)GetValue(IndicatorEndPaddingProperty);
557 SetValue(IndicatorEndPaddingProperty, value);
562 /// Sets the source of the scroll position properties.
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)
574 Interop.ScrollBar.ScrollBar_SetScrollPropertySource(swigCPtr, Animatable.getCPtr(handle), propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
575 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
578 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollBar obj)
580 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
583 internal void SetScrollIndicator(View indicator)
585 Interop.ScrollBar.ScrollBar_SetScrollIndicator(swigCPtr, View.getCPtr(indicator));
586 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
589 internal View GetScrollIndicator()
591 View ret = new View(Interop.ScrollBar.ScrollBar_GetScrollIndicator(swigCPtr), true);
592 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596 internal void SetScrollDirection(ScrollBar.Direction direction)
598 Interop.ScrollBar.ScrollBar_SetScrollDirection(swigCPtr, (int)direction);
599 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
602 internal ScrollBar.Direction GetScrollDirection()
604 ScrollBar.Direction ret = (ScrollBar.Direction)Interop.ScrollBar.ScrollBar_GetScrollDirection(swigCPtr);
605 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
609 internal void SetIndicatorHeightPolicy(ScrollBar.IndicatorHeightPolicyType policy)
611 Interop.ScrollBar.ScrollBar_SetIndicatorHeightPolicy(swigCPtr, (int)policy);
612 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
615 internal ScrollBar.IndicatorHeightPolicyType GetIndicatorHeightPolicy()
617 ScrollBar.IndicatorHeightPolicyType ret = (ScrollBar.IndicatorHeightPolicyType)Interop.ScrollBar.ScrollBar_GetIndicatorHeightPolicy(swigCPtr);
618 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
622 internal void SetIndicatorFixedHeight(float height)
624 Interop.ScrollBar.ScrollBar_SetIndicatorFixedHeight(swigCPtr, height);
625 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
628 internal float GetIndicatorFixedHeight()
630 float ret = Interop.ScrollBar.ScrollBar_GetIndicatorFixedHeight(swigCPtr);
631 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
635 internal void SetIndicatorShowDuration(float durationSeconds)
637 Interop.ScrollBar.ScrollBar_SetIndicatorShowDuration(swigCPtr, durationSeconds);
638 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
641 internal float GetIndicatorShowDuration()
643 float ret = Interop.ScrollBar.ScrollBar_GetIndicatorShowDuration(swigCPtr);
644 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
648 internal void SetIndicatorHideDuration(float durationSeconds)
650 Interop.ScrollBar.ScrollBar_SetIndicatorHideDuration(swigCPtr, durationSeconds);
651 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
654 internal float GetIndicatorHideDuration()
656 float ret = Interop.ScrollBar.ScrollBar_GetIndicatorHideDuration(swigCPtr);
657 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
661 internal void ShowIndicator()
663 Interop.ScrollBar.ScrollBar_ShowIndicator(swigCPtr);
664 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
667 internal void HideIndicator()
669 Interop.ScrollBar.ScrollBar_HideIndicator(swigCPtr);
670 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
673 internal VoidSignal PanFinishedSignal()
675 VoidSignal ret = new VoidSignal(Interop.ScrollBar.ScrollBar_PanFinishedSignal(swigCPtr), false);
676 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680 internal FloatSignal ScrollPositionIntervalReachedSignal()
682 FloatSignal ret = new FloatSignal(Interop.ScrollBar.ScrollBar_ScrollPositionIntervalReachedSignal(swigCPtr), false);
683 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
688 /// To dispose the ScrollBar instance.
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)
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.
706 if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null)
708 ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
711 if (_scrollBarPanFinishedEventCallbackDelegate != null)
713 PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
720 /// This will not be public opened.
721 [EditorBrowsable(EditorBrowsableState.Never)]
722 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
724 Interop.ScrollBar.delete_ScrollBar(swigCPtr);
727 // Callback for ScrollBar PanFinishedSignal
728 private void OnScrollBarPanFinished()
730 PanFinishedEventArgs e = new PanFinishedEventArgs();
732 if (_scrollBarPanFinishedEventHandler != null)
734 //here we send all data to user event handlers
735 _scrollBarPanFinishedEventHandler(this, e);
740 // Callback for ScrollBar ScrollPositionIntervalReachedSignal
741 private void OnScrollBarScrollPositionIntervalReached(float position)
743 ScrollIntervalEventArgs e = new ScrollIntervalEventArgs();
744 e.CurrentScrollPosition = position;
746 if (_scrollBarScrollPositionIntervalReachedEventHandler != null)
748 //here we send all data to user event handlers
749 _scrollBarScrollPositionIntervalReachedEventHandler(this, e);
756 /// Event arguments that passed via the PanFinished event.
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
767 /// Event arguments that passed via the ScrollPositionIntervalReached event.
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
775 private float _currentScrollPosition;
778 /// The current scroll position of the scrollable content.
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
788 return _currentScrollPosition;
792 _currentScrollPosition = value;
797 internal new class Property
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();