1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
31 using System.Runtime.InteropServices;
34 /// ScrollBar is a UI component that can be linked to the scrollable objects
35 /// indicating the current scroll position of the scrollable object.
37 public class ScrollBar : View
39 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
41 internal ScrollBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ScrollBar_SWIGUpcast(cPtr), cMemoryOwn)
43 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
46 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollBar obj)
48 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
53 DisposeQueue.Instance.Add(this);
56 public override void Dispose()
58 if (!Stage.IsInstalled())
60 DisposeQueue.Instance.Add(this);
66 if (swigCPtr.Handle != global::System.IntPtr.Zero)
71 NDalicPINVOKE.delete_ScrollBar(swigCPtr);
73 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
75 global::System.GC.SuppressFinalize(this);
81 /// Event arguments that passed via PanFinished event
83 public class PanFinishedEventArgs : EventArgs
88 /// Event arguments that passed via ScrollPositionIntervalReached event
90 public class ScrollPositionIntervalReachedEventArgs : EventArgs
92 private float _currentScrollPosition;
95 /// current scroll position of the scrollable content
97 public float CurrentScrollPosition
101 return _currentScrollPosition;
105 _currentScrollPosition = value;
110 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
111 private delegate void PanFinishedEventCallbackDelegate();
112 private EventHandler<PanFinishedEventArgs> _scrollBarPanFinishedEventHandler;
113 private PanFinishedEventCallbackDelegate _scrollBarPanFinishedEventCallbackDelegate;
115 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
116 private delegate void ScrollPositionIntervalReachedEventCallbackDelegate();
117 private EventHandler<ScrollPositionIntervalReachedEventArgs> _scrollBarScrollPositionIntervalReachedEventHandler;
118 private ScrollPositionIntervalReachedEventCallbackDelegate _scrollBarScrollPositionIntervalReachedEventCallbackDelegate;
121 /// Event emitted when panning is finished on the scroll indicator.
123 public event EventHandler<PanFinishedEventArgs> PanFinished
127 if (_scrollBarPanFinishedEventHandler == null)
129 _scrollBarPanFinishedEventCallbackDelegate = (OnScrollBarPanFinished);
130 PanFinishedSignal().Connect(_scrollBarPanFinishedEventCallbackDelegate);
132 _scrollBarPanFinishedEventHandler += value;
136 _scrollBarPanFinishedEventHandler -= value;
137 if (_scrollBarPanFinishedEventHandler == null && _scrollBarPanFinishedEventCallbackDelegate != null)
139 PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
144 // Callback for ScrollBar PanFinishedSignal
145 private void OnScrollBarPanFinished()
147 PanFinishedEventArgs e = new PanFinishedEventArgs();
149 if (_scrollBarPanFinishedEventHandler != null)
151 //here we send all data to user event handlers
152 _scrollBarPanFinishedEventHandler(this, e);
158 /// Event emitted when the current scroll position of the scrollable content
160 public event EventHandler<ScrollPositionIntervalReachedEventArgs> ScrollPositionIntervalReached
164 if (_scrollBarScrollPositionIntervalReachedEventHandler == null)
166 _scrollBarScrollPositionIntervalReachedEventCallbackDelegate = (OnScrollBarScrollPositionIntervalReached);
167 ScrollPositionIntervalReachedSignal().Connect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
169 _scrollBarScrollPositionIntervalReachedEventHandler += value;
173 _scrollBarScrollPositionIntervalReachedEventHandler -= value;
174 if (_scrollBarScrollPositionIntervalReachedEventHandler == null && _scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null)
176 ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
181 // Callback for ScrollBar ScrollPositionIntervalReachedSignal
182 private void OnScrollBarScrollPositionIntervalReached()
184 ScrollPositionIntervalReachedEventArgs e = new ScrollPositionIntervalReachedEventArgs();
186 if (_scrollBarScrollPositionIntervalReachedEventHandler != null)
188 //here we send all data to user event handlers
189 _scrollBarScrollPositionIntervalReachedEventHandler(this, e);
194 internal class Property : global::System.IDisposable
196 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
197 protected bool swigCMemOwn;
199 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
201 swigCMemOwn = cMemoryOwn;
202 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
205 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
207 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
215 public virtual void Dispose()
219 if (swigCPtr.Handle != global::System.IntPtr.Zero)
224 NDalicPINVOKE.delete_ScrollBar_Property(swigCPtr);
226 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
228 global::System.GC.SuppressFinalize(this);
232 internal Property() : this(NDalicPINVOKE.new_ScrollBar_Property(), true)
234 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
237 internal static readonly int SCROLL_DIRECTION = NDalicPINVOKE.ScrollBar_Property_SCROLL_DIRECTION_get();
238 internal static readonly int INDICATOR_HEIGHT_POLICY = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HEIGHT_POLICY_get();
239 internal static readonly int INDICATOR_FIXED_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_FIXED_HEIGHT_get();
240 internal static readonly int INDICATOR_SHOW_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_SHOW_DURATION_get();
241 internal static readonly int INDICATOR_HIDE_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HIDE_DURATION_get();
242 internal static readonly int SCROLL_POSITION_INTERVALS = NDalicPINVOKE.ScrollBar_Property_SCROLL_POSITION_INTERVALS_get();
243 internal static readonly int INDICATOR_MINIMUM_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_MINIMUM_HEIGHT_get();
244 internal static readonly int INDICATOR_START_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_START_PADDING_get();
245 internal static readonly int INDICATOR_END_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_END_PADDING_get();
250 /// Creates an initialized ScrollBar.
252 /// <param name="direction">The direction of scroll bar (either vertically or horizontally)</param>
253 public ScrollBar(ScrollBar.Direction direction) : this(NDalicPINVOKE.ScrollBar_New__SWIG_0((int)direction), true)
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259 /// Creates an uninitialized ScrollBar
261 public ScrollBar() : this(NDalicPINVOKE.ScrollBar_New__SWIG_1(), true)
263 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266 internal ScrollBar(ScrollBar scrollBar) : this(NDalicPINVOKE.new_ScrollBar__SWIG_1(ScrollBar.getCPtr(scrollBar)), true)
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 internal ScrollBar Assign(ScrollBar scrollBar)
273 ScrollBar ret = new ScrollBar(NDalicPINVOKE.ScrollBar_Assign(swigCPtr, ScrollBar.getCPtr(scrollBar)), false);
274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279 /// Downcasts a handle to ScrollBar handle.
280 /// If handle points to a ScrollBar, the downcast produces valid handle.
281 /// If not, the returned handle is left uninitialized.
283 /// <param name="handle">Handle to an object</param>
284 /// <returns>Handle to a ScrollBar or an uninitialized handle</returns>
285 public new static ScrollBar DownCast(BaseHandle handle)
287 ScrollBar ret = new ScrollBar(NDalicPINVOKE.ScrollBar_DownCast(BaseHandle.getCPtr(handle)), true);
288 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292 internal void SetScrollPropertySource(Handle handle, int propertyScrollPosition, int propertyMinScrollPosition, int propertyMaxScrollPosition, int propertyScrollContentSize)
294 NDalicPINVOKE.ScrollBar_SetScrollPropertySource(swigCPtr, Handle.getCPtr(handle), propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
298 internal void SetScrollIndicator(Actor indicator)
300 NDalicPINVOKE.ScrollBar_SetScrollIndicator(swigCPtr, Actor.getCPtr(indicator));
301 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304 internal Actor GetScrollIndicator()
306 Actor ret = new Actor(NDalicPINVOKE.ScrollBar_GetScrollIndicator(swigCPtr), true);
307 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
311 internal void SetScrollPositionIntervals(VectorFloat positions)
313 NDalicPINVOKE.ScrollBar_SetScrollPositionIntervals(swigCPtr, VectorFloat.getCPtr(positions));
314 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
317 internal VectorFloat GetScrollPositionIntervals()
319 VectorFloat ret = new VectorFloat(NDalicPINVOKE.ScrollBar_GetScrollPositionIntervals(swigCPtr), true);
320 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324 internal void SetScrollDirection(ScrollBar.Direction direction)
326 NDalicPINVOKE.ScrollBar_SetScrollDirection(swigCPtr, (int)direction);
327 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
330 internal ScrollBar.Direction GetScrollDirection()
332 ScrollBar.Direction ret = (ScrollBar.Direction)NDalicPINVOKE.ScrollBar_GetScrollDirection(swigCPtr);
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
337 internal void SetIndicatorHeightPolicy(ScrollBar.IndicatorHeightPolicyType policy)
339 NDalicPINVOKE.ScrollBar_SetIndicatorHeightPolicy(swigCPtr, (int)policy);
340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
343 internal ScrollBar.IndicatorHeightPolicyType GetIndicatorHeightPolicy()
345 ScrollBar.IndicatorHeightPolicyType ret = (ScrollBar.IndicatorHeightPolicyType)NDalicPINVOKE.ScrollBar_GetIndicatorHeightPolicy(swigCPtr);
346 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
350 internal void SetIndicatorFixedHeight(float height)
352 NDalicPINVOKE.ScrollBar_SetIndicatorFixedHeight(swigCPtr, height);
353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356 internal float GetIndicatorFixedHeight()
358 float ret = NDalicPINVOKE.ScrollBar_GetIndicatorFixedHeight(swigCPtr);
359 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
363 internal void SetIndicatorShowDuration(float durationSeconds)
365 NDalicPINVOKE.ScrollBar_SetIndicatorShowDuration(swigCPtr, durationSeconds);
366 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
369 internal float GetIndicatorShowDuration()
371 float ret = NDalicPINVOKE.ScrollBar_GetIndicatorShowDuration(swigCPtr);
372 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
376 internal void SetIndicatorHideDuration(float durationSeconds)
378 NDalicPINVOKE.ScrollBar_SetIndicatorHideDuration(swigCPtr, durationSeconds);
379 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
382 internal float GetIndicatorHideDuration()
384 float ret = NDalicPINVOKE.ScrollBar_GetIndicatorHideDuration(swigCPtr);
385 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
389 internal void ShowIndicator()
391 NDalicPINVOKE.ScrollBar_ShowIndicator(swigCPtr);
392 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
395 internal void HideIndicator()
397 NDalicPINVOKE.ScrollBar_HideIndicator(swigCPtr);
398 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401 internal VoidSignal PanFinishedSignal()
403 VoidSignal ret = new VoidSignal(NDalicPINVOKE.ScrollBar_PanFinishedSignal(swigCPtr), false);
404 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408 internal FloatSignal ScrollPositionIntervalReachedSignal()
410 FloatSignal ret = new FloatSignal(NDalicPINVOKE.ScrollBar_ScrollPositionIntervalReachedSignal(swigCPtr), false);
411 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
415 internal enum PropertyRange
417 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
418 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
422 /// Direction of scroll bar
424 public enum Direction
431 /// Indicator height policy.
433 public enum IndicatorHeightPolicyType
440 /// Direction of scroll bar
442 public string ScrollDirection
447 GetProperty(ScrollBar.Property.SCROLL_DIRECTION).Get(out temp);
452 SetProperty(ScrollBar.Property.SCROLL_DIRECTION, new Tizen.NUI.PropertyValue(value));
457 /// Indicator height policy.
459 public string IndicatorHeightPolicy
464 GetProperty(ScrollBar.Property.INDICATOR_HEIGHT_POLICY).Get(out temp);
469 SetProperty(ScrollBar.Property.INDICATOR_HEIGHT_POLICY, new Tizen.NUI.PropertyValue(value));
474 /// the fixed height of scroll indicator.
476 public float IndicatorFixedHeight
481 GetProperty(ScrollBar.Property.INDICATOR_FIXED_HEIGHT).Get(ref temp);
486 SetProperty(ScrollBar.Property.INDICATOR_FIXED_HEIGHT, new Tizen.NUI.PropertyValue(value));
491 /// the duration in seconds for the scroll indicator to become fully visible.
493 public float IndicatorShowDuration
498 GetProperty(ScrollBar.Property.INDICATOR_SHOW_DURATION).Get(ref temp);
503 SetProperty(ScrollBar.Property.INDICATOR_SHOW_DURATION, new Tizen.NUI.PropertyValue(value));
508 /// the duration in seconds for the scroll indicator to become fully invisible.
510 public float IndicatorHideDuration
515 GetProperty(ScrollBar.Property.INDICATOR_HIDE_DURATION).Get(ref temp);
520 SetProperty(ScrollBar.Property.INDICATOR_HIDE_DURATION, new Tizen.NUI.PropertyValue(value));
525 /// the list of values to get notification when the current scroll position of the scrollable object goes above or below any of these values.
527 public Tizen.NUI.PropertyArray ScrollPositionIntervals
531 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
532 GetProperty(ScrollBar.Property.SCROLL_POSITION_INTERVALS).Get(temp);
537 SetProperty(ScrollBar.Property.SCROLL_POSITION_INTERVALS, new Tizen.NUI.PropertyValue(value));
542 /// The minimum height for a variable size indicator.
544 public float IndicatorMinimumHeight
549 GetProperty(ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT).Get(ref temp);
554 SetProperty(ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT, new Tizen.NUI.PropertyValue(value));
559 /// The padding at the start of the indicator. For example, the top if scrollDirection is Vertical.
561 public float IndicatorStartPadding
566 GetProperty(ScrollBar.Property.INDICATOR_START_PADDING).Get(ref temp);
571 SetProperty(ScrollBar.Property.INDICATOR_START_PADDING, new Tizen.NUI.PropertyValue(value));
576 /// The padding at the end of the indicator. For example, the bottom if scrollDirection is Vertical.
578 public float IndicatorEndPadding
583 GetProperty(ScrollBar.Property.INDICATOR_END_PADDING).Get(ref temp);
588 SetProperty(ScrollBar.Property.INDICATOR_END_PADDING, new Tizen.NUI.PropertyValue(value));