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 (!Stage.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 : global::System.IDisposable {
190 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
191 protected bool swigCMemOwn;
193 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
194 swigCMemOwn = cMemoryOwn;
195 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
198 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
199 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
206 public virtual void Dispose() {
208 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
211 NDalicPINVOKE.delete_ScrollBar_Property(swigCPtr);
213 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
215 global::System.GC.SuppressFinalize(this);
219 public Property() : this(NDalicPINVOKE.new_ScrollBar_Property(), true) {
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 public static readonly int SCROLL_DIRECTION = NDalicPINVOKE.ScrollBar_Property_SCROLL_DIRECTION_get();
224 public static readonly int INDICATOR_HEIGHT_POLICY = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HEIGHT_POLICY_get();
225 public static readonly int INDICATOR_FIXED_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_FIXED_HEIGHT_get();
226 public static readonly int INDICATOR_SHOW_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_SHOW_DURATION_get();
227 public static readonly int INDICATOR_HIDE_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HIDE_DURATION_get();
228 public static readonly int SCROLL_POSITION_INTERVALS = NDalicPINVOKE.ScrollBar_Property_SCROLL_POSITION_INTERVALS_get();
229 public static readonly int INDICATOR_MINIMUM_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_MINIMUM_HEIGHT_get();
230 public static readonly int INDICATOR_START_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_START_PADDING_get();
231 public static readonly int INDICATOR_END_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_END_PADDING_get();
235 public ScrollBar (ScrollBar.Direction direction) : this (NDalicPINVOKE.ScrollBar_New__SWIG_0((int)direction), true) {
236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239 public ScrollBar () : this (NDalicPINVOKE.ScrollBar_New__SWIG_1(), true) {
240 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 public ScrollBar(ScrollBar scrollBar) : this(NDalicPINVOKE.new_ScrollBar__SWIG_1(ScrollBar.getCPtr(scrollBar)), true) {
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247 public ScrollBar Assign(ScrollBar scrollBar) {
248 ScrollBar ret = new ScrollBar(NDalicPINVOKE.ScrollBar_Assign(swigCPtr, ScrollBar.getCPtr(scrollBar)), false);
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 public new static ScrollBar DownCast(BaseHandle handle) {
254 ScrollBar ret = new ScrollBar(NDalicPINVOKE.ScrollBar_DownCast(BaseHandle.getCPtr(handle)), true);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259 public void SetScrollPropertySource(Handle handle, int propertyScrollPosition, int propertyMinScrollPosition, int propertyMaxScrollPosition, int propertyScrollContentSize) {
260 NDalicPINVOKE.ScrollBar_SetScrollPropertySource(swigCPtr, Handle.getCPtr(handle), propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264 public void SetScrollIndicator(Actor indicator) {
265 NDalicPINVOKE.ScrollBar_SetScrollIndicator(swigCPtr, Actor.getCPtr(indicator));
266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
269 public Actor GetScrollIndicator() {
270 Actor ret = new Actor(NDalicPINVOKE.ScrollBar_GetScrollIndicator(swigCPtr), true);
271 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275 public void SetScrollPositionIntervals(VectorFloat positions) {
276 NDalicPINVOKE.ScrollBar_SetScrollPositionIntervals(swigCPtr, VectorFloat.getCPtr(positions));
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 public VectorFloat GetScrollPositionIntervals() {
281 VectorFloat ret = new VectorFloat(NDalicPINVOKE.ScrollBar_GetScrollPositionIntervals(swigCPtr), true);
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286 public void SetScrollDirection(ScrollBar.Direction direction) {
287 NDalicPINVOKE.ScrollBar_SetScrollDirection(swigCPtr, (int)direction);
288 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291 public ScrollBar.Direction GetScrollDirection() {
292 ScrollBar.Direction ret = (ScrollBar.Direction)NDalicPINVOKE.ScrollBar_GetScrollDirection(swigCPtr);
293 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
297 public void SetIndicatorHeightPolicy(ScrollBar.IndicatorHeightPolicyType policy) {
298 NDalicPINVOKE.ScrollBar_SetIndicatorHeightPolicy(swigCPtr, (int)policy);
299 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302 public ScrollBar.IndicatorHeightPolicyType GetIndicatorHeightPolicy() {
303 ScrollBar.IndicatorHeightPolicyType ret = (ScrollBar.IndicatorHeightPolicyType)NDalicPINVOKE.ScrollBar_GetIndicatorHeightPolicy(swigCPtr);
304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308 public void SetIndicatorFixedHeight(float height) {
309 NDalicPINVOKE.ScrollBar_SetIndicatorFixedHeight(swigCPtr, height);
310 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313 public float GetIndicatorFixedHeight() {
314 float ret = NDalicPINVOKE.ScrollBar_GetIndicatorFixedHeight(swigCPtr);
315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
319 public void SetIndicatorShowDuration(float durationSeconds) {
320 NDalicPINVOKE.ScrollBar_SetIndicatorShowDuration(swigCPtr, durationSeconds);
321 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324 public float GetIndicatorShowDuration() {
325 float ret = NDalicPINVOKE.ScrollBar_GetIndicatorShowDuration(swigCPtr);
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
330 public void SetIndicatorHideDuration(float durationSeconds) {
331 NDalicPINVOKE.ScrollBar_SetIndicatorHideDuration(swigCPtr, durationSeconds);
332 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
335 public float GetIndicatorHideDuration() {
336 float ret = NDalicPINVOKE.ScrollBar_GetIndicatorHideDuration(swigCPtr);
337 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
341 public void ShowIndicator() {
342 NDalicPINVOKE.ScrollBar_ShowIndicator(swigCPtr);
343 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346 public void HideIndicator() {
347 NDalicPINVOKE.ScrollBar_HideIndicator(swigCPtr);
348 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
351 public VoidSignal PanFinishedSignal() {
352 VoidSignal ret = new VoidSignal(NDalicPINVOKE.ScrollBar_PanFinishedSignal(swigCPtr), false);
353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357 public FloatSignal ScrollPositionIntervalReachedSignal() {
358 FloatSignal ret = new FloatSignal(NDalicPINVOKE.ScrollBar_ScrollPositionIntervalReachedSignal(swigCPtr), false);
359 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
363 public enum PropertyRange {
364 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
365 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX+1000
368 public enum Direction {
373 public enum IndicatorHeightPolicyType {
378 public string ScrollDirection
383 GetProperty( ScrollBar.Property.SCROLL_DIRECTION).Get( out temp );
388 SetProperty( ScrollBar.Property.SCROLL_DIRECTION, new Dali.Property.Value( value ) );
391 public string IndicatorHeightPolicy
396 GetProperty( ScrollBar.Property.INDICATOR_HEIGHT_POLICY).Get( out temp );
401 SetProperty( ScrollBar.Property.INDICATOR_HEIGHT_POLICY, new Dali.Property.Value( value ) );
404 public float IndicatorFixedHeight
409 GetProperty( ScrollBar.Property.INDICATOR_FIXED_HEIGHT).Get( ref temp );
414 SetProperty( ScrollBar.Property.INDICATOR_FIXED_HEIGHT, new Dali.Property.Value( value ) );
417 public float IndicatorShowDuration
422 GetProperty( ScrollBar.Property.INDICATOR_SHOW_DURATION).Get( ref temp );
427 SetProperty( ScrollBar.Property.INDICATOR_SHOW_DURATION, new Dali.Property.Value( value ) );
430 public float IndicatorHideDuration
435 GetProperty( ScrollBar.Property.INDICATOR_HIDE_DURATION).Get( ref temp );
440 SetProperty( ScrollBar.Property.INDICATOR_HIDE_DURATION, new Dali.Property.Value( value ) );
443 public Dali.Property.Array ScrollPositionIntervals
447 Dali.Property.Array temp = new Dali.Property.Array();
448 GetProperty( ScrollBar.Property.SCROLL_POSITION_INTERVALS).Get( temp );
453 SetProperty( ScrollBar.Property.SCROLL_POSITION_INTERVALS, new Dali.Property.Value( value ) );
456 public float IndicatorMinimumHeight
461 GetProperty( ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT).Get( ref temp );
466 SetProperty( ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT, new Dali.Property.Value( value ) );
469 public float IndicatorStartPadding
474 GetProperty( ScrollBar.Property.INDICATOR_START_PADDING).Get( ref temp );
479 SetProperty( ScrollBar.Property.INDICATOR_START_PADDING, new Dali.Property.Value( value ) );
482 public float IndicatorEndPadding
487 GetProperty( ScrollBar.Property.INDICATOR_END_PADDING).Get( ref temp );
492 SetProperty( ScrollBar.Property.INDICATOR_END_PADDING, new Dali.Property.Value( value ) );