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 //------------------------------------------------------------------------------
30 using System.Runtime.InteropServices;
33 public class ScrollBar : View {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal ScrollBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ScrollBar_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollBar obj) {
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
45 DisposeQueue.Instance.Add(this);
48 public override void Dispose() {
49 if (!Window.IsInstalled()) {
50 DisposeQueue.Instance.Add(this);
55 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
58 NDalicPINVOKE.delete_ScrollBar(swigCPtr);
60 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
62 global::System.GC.SuppressFinalize(this);
70 public class PanFinishedEventArgs : EventArgs
74 public class ScrollPositionIntervalReachedEventArgs : EventArgs
76 private float _currentScrollPosition;
78 public float CurrentScrollPosition
82 return _currentScrollPosition;
86 _currentScrollPosition = value;
91 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
92 private delegate void PanFinishedEventCallbackDelegate();
93 private DaliEventHandler<object,PanFinishedEventArgs> _scrollBarPanFinishedEventHandler;
94 private PanFinishedEventCallbackDelegate _scrollBarPanFinishedEventCallbackDelegate;
96 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
97 private delegate void ScrollPositionIntervalReachedEventCallbackDelegate();
98 private DaliEventHandler<object,ScrollPositionIntervalReachedEventArgs> _scrollBarScrollPositionIntervalReachedEventHandler;
99 private ScrollPositionIntervalReachedEventCallbackDelegate _scrollBarScrollPositionIntervalReachedEventCallbackDelegate;
101 public event DaliEventHandler<object,PanFinishedEventArgs> PanFinished
107 // Restricted to only one listener
108 if (_scrollBarPanFinishedEventHandler == null)
110 _scrollBarPanFinishedEventHandler += value;
112 _scrollBarPanFinishedEventCallbackDelegate = new PanFinishedEventCallbackDelegate(OnScrollBarPanFinished);
113 this.PanFinishedSignal().Connect(_scrollBarPanFinishedEventCallbackDelegate);
122 if (_scrollBarPanFinishedEventHandler != null)
124 this.PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
127 _scrollBarPanFinishedEventHandler -= value;
132 // Callback for ScrollBar PanFinishedSignal
133 private void OnScrollBarPanFinished()
135 PanFinishedEventArgs e = new PanFinishedEventArgs();
137 if (_scrollBarPanFinishedEventHandler != null)
139 //here we send all data to user event handlers
140 _scrollBarPanFinishedEventHandler(this, e);
145 public event DaliEventHandler<object,ScrollPositionIntervalReachedEventArgs> ScrollPositionIntervalReached
151 // Restricted to only one listener
152 if (_scrollBarScrollPositionIntervalReachedEventHandler == null)
154 _scrollBarScrollPositionIntervalReachedEventHandler += value;
156 _scrollBarScrollPositionIntervalReachedEventCallbackDelegate = new ScrollPositionIntervalReachedEventCallbackDelegate(OnScrollBarScrollPositionIntervalReached);
157 this.ScrollPositionIntervalReachedSignal().Connect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
166 if (_scrollBarScrollPositionIntervalReachedEventHandler != null)
168 this.ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
171 _scrollBarScrollPositionIntervalReachedEventHandler -= value;
176 // Callback for ScrollBar ScrollPositionIntervalReachedSignal
177 private void OnScrollBarScrollPositionIntervalReached()
179 ScrollPositionIntervalReachedEventArgs e = new ScrollPositionIntervalReachedEventArgs();
181 if (_scrollBarScrollPositionIntervalReachedEventHandler != null)
183 //here we send all data to user event handlers
184 _scrollBarScrollPositionIntervalReachedEventHandler(this, e);
189 public class Property
191 public static readonly int SCROLL_DIRECTION = NDalicPINVOKE.ScrollBar_Property_SCROLL_DIRECTION_get();
192 public static readonly int INDICATOR_HEIGHT_POLICY = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HEIGHT_POLICY_get();
193 public static readonly int INDICATOR_FIXED_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_FIXED_HEIGHT_get();
194 public static readonly int INDICATOR_SHOW_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_SHOW_DURATION_get();
195 public static readonly int INDICATOR_HIDE_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HIDE_DURATION_get();
196 public static readonly int SCROLL_POSITION_INTERVALS = NDalicPINVOKE.ScrollBar_Property_SCROLL_POSITION_INTERVALS_get();
197 public static readonly int INDICATOR_MINIMUM_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_MINIMUM_HEIGHT_get();
198 public static readonly int INDICATOR_START_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_START_PADDING_get();
199 public static readonly int INDICATOR_END_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_END_PADDING_get();
202 public ScrollBar (ScrollBar.Direction direction) : this (NDalicPINVOKE.ScrollBar_New__SWIG_0((int)direction), true) {
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206 public ScrollBar () : this (NDalicPINVOKE.ScrollBar_New__SWIG_1(), true) {
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 public ScrollBar(ScrollBar scrollBar) : this(NDalicPINVOKE.new_ScrollBar__SWIG_1(ScrollBar.getCPtr(scrollBar)), true) {
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 internal new static ScrollBar DownCast(BaseHandle handle) {
215 ScrollBar ret = new ScrollBar(NDalicPINVOKE.ScrollBar_DownCast(BaseHandle.getCPtr(handle)), true);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220 public void SetScrollPropertySource(Animatable handle, int propertyScrollPosition, int propertyMinScrollPosition, int propertyMaxScrollPosition, int propertyScrollContentSize) {
221 NDalicPINVOKE.ScrollBar_SetScrollPropertySource(swigCPtr, Animatable.getCPtr(handle), propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 public void SetScrollIndicator(View indicator) {
226 NDalicPINVOKE.ScrollBar_SetScrollIndicator(swigCPtr, View.getCPtr(indicator));
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230 public View GetScrollIndicator() {
231 View ret = new View(NDalicPINVOKE.ScrollBar_GetScrollIndicator(swigCPtr), true);
232 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 public void SetScrollDirection(ScrollBar.Direction direction) {
237 NDalicPINVOKE.ScrollBar_SetScrollDirection(swigCPtr, (int)direction);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 public ScrollBar.Direction GetScrollDirection() {
242 ScrollBar.Direction ret = (ScrollBar.Direction)NDalicPINVOKE.ScrollBar_GetScrollDirection(swigCPtr);
243 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247 private void SetIndicatorHeightPolicy(ScrollBar.IndicatorHeightPolicyType policy) {
248 NDalicPINVOKE.ScrollBar_SetIndicatorHeightPolicy(swigCPtr, (int)policy);
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 private ScrollBar.IndicatorHeightPolicyType GetIndicatorHeightPolicy() {
253 ScrollBar.IndicatorHeightPolicyType ret = (ScrollBar.IndicatorHeightPolicyType)NDalicPINVOKE.ScrollBar_GetIndicatorHeightPolicy(swigCPtr);
254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 private void SetIndicatorFixedHeight(float height) {
259 NDalicPINVOKE.ScrollBar_SetIndicatorFixedHeight(swigCPtr, height);
260 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 private float GetIndicatorFixedHeight() {
264 float ret = NDalicPINVOKE.ScrollBar_GetIndicatorFixedHeight(swigCPtr);
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
269 private void SetIndicatorShowDuration(float durationSeconds) {
270 NDalicPINVOKE.ScrollBar_SetIndicatorShowDuration(swigCPtr, durationSeconds);
271 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274 private float GetIndicatorShowDuration() {
275 float ret = NDalicPINVOKE.ScrollBar_GetIndicatorShowDuration(swigCPtr);
276 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 private void SetIndicatorHideDuration(float durationSeconds) {
281 NDalicPINVOKE.ScrollBar_SetIndicatorHideDuration(swigCPtr, durationSeconds);
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
285 private float GetIndicatorHideDuration() {
286 float ret = NDalicPINVOKE.ScrollBar_GetIndicatorHideDuration(swigCPtr);
287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291 public void ShowIndicator() {
292 NDalicPINVOKE.ScrollBar_ShowIndicator(swigCPtr);
293 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
296 public void HideIndicator() {
297 NDalicPINVOKE.ScrollBar_HideIndicator(swigCPtr);
298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301 internal VoidSignal PanFinishedSignal() {
302 VoidSignal ret = new VoidSignal(NDalicPINVOKE.ScrollBar_PanFinishedSignal(swigCPtr), false);
303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
307 internal FloatSignal ScrollPositionIntervalReachedSignal() {
308 FloatSignal ret = new FloatSignal(NDalicPINVOKE.ScrollBar_ScrollPositionIntervalReachedSignal(swigCPtr), false);
309 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313 public enum Direction {
318 public enum IndicatorHeightPolicyType {
323 public string ScrollDirection
328 GetProperty( ScrollBar.Property.SCROLL_DIRECTION).Get( out temp );
333 SetProperty( ScrollBar.Property.SCROLL_DIRECTION, new Dali.Property.Value( value ) );
336 public string IndicatorHeightPolicy
341 GetProperty( ScrollBar.Property.INDICATOR_HEIGHT_POLICY).Get( out temp );
346 SetProperty( ScrollBar.Property.INDICATOR_HEIGHT_POLICY, new Dali.Property.Value( value ) );
349 public float IndicatorFixedHeight
354 GetProperty( ScrollBar.Property.INDICATOR_FIXED_HEIGHT).Get( out temp );
359 SetProperty( ScrollBar.Property.INDICATOR_FIXED_HEIGHT, new Dali.Property.Value( value ) );
362 public float IndicatorShowDuration
367 GetProperty( ScrollBar.Property.INDICATOR_SHOW_DURATION).Get( out temp );
372 SetProperty( ScrollBar.Property.INDICATOR_SHOW_DURATION, new Dali.Property.Value( value ) );
375 public float IndicatorHideDuration
380 GetProperty( ScrollBar.Property.INDICATOR_HIDE_DURATION).Get( out temp );
385 SetProperty( ScrollBar.Property.INDICATOR_HIDE_DURATION, new Dali.Property.Value( value ) );
388 public Dali.Property.Array ScrollPositionIntervals
392 Dali.Property.Array temp = new Dali.Property.Array();
393 GetProperty( ScrollBar.Property.SCROLL_POSITION_INTERVALS).Get( temp );
398 SetProperty( ScrollBar.Property.SCROLL_POSITION_INTERVALS, new Dali.Property.Value( value ) );
401 public float IndicatorMinimumHeight
406 GetProperty( ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT).Get( out temp );
411 SetProperty( ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT, new Dali.Property.Value( value ) );
414 public float IndicatorStartPadding
419 GetProperty( ScrollBar.Property.INDICATOR_START_PADDING).Get( out temp );
424 SetProperty( ScrollBar.Property.INDICATOR_START_PADDING, new Dali.Property.Value( value ) );
427 public float IndicatorEndPadding
432 GetProperty( ScrollBar.Property.INDICATOR_END_PADDING).Get( out temp );
437 SetProperty( ScrollBar.Property.INDICATOR_END_PADDING, new Dali.Property.Value( value ) );