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 Slider : View {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal Slider(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Slider_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Slider 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_Slider(swigCPtr);
60 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
62 global::System.GC.SuppressFinalize(this);
69 public class ValueChangedEventArgs : EventArgs
71 private Slider _slider;
72 private float _slideValue;
86 public float SlideValue
99 public class SlidingFinishedEventArgs : EventArgs
101 private Slider _slider;
102 private float _slideValue;
116 public float SlideValue
129 public class MarkReachedEventArgs : EventArgs
131 private Slider _slider;
132 private int _slideValue;
146 public int SlideValue
160 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
161 private delegate bool ValueChangedCallbackDelegate(IntPtr slider, float slideValue);
162 private DaliEventHandlerWithReturnType<object,ValueChangedEventArgs,bool> _sliderValueChangedEventHandler;
163 private ValueChangedCallbackDelegate _sliderValueChangedCallbackDelegate;
165 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
166 private delegate bool SlidingFinishedCallbackDelegate(IntPtr slider, float slideValue);
167 private DaliEventHandlerWithReturnType<object,SlidingFinishedEventArgs,bool> _sliderSlidingFinishedEventHandler;
168 private SlidingFinishedCallbackDelegate _sliderSlidingFinishedCallbackDelegate;
170 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
171 private delegate bool MarkReachedCallbackDelegate(IntPtr slider, int slideValue);
172 private DaliEventHandlerWithReturnType<object,MarkReachedEventArgs,bool> _sliderMarkReachedEventHandler;
173 private MarkReachedCallbackDelegate _sliderMarkReachedCallbackDelegate;
175 public event DaliEventHandlerWithReturnType<object,ValueChangedEventArgs,bool> ValueChanged
181 // Restricted to only one listener
182 if (_sliderValueChangedEventHandler == null)
184 _sliderValueChangedEventHandler += value;
186 _sliderValueChangedCallbackDelegate = new ValueChangedCallbackDelegate(OnValueChanged);
187 this.ValueChangedSignal().Connect(_sliderValueChangedCallbackDelegate);
196 if (_sliderValueChangedEventHandler != null)
198 this.ValueChangedSignal().Disconnect(_sliderValueChangedCallbackDelegate);
201 _sliderValueChangedEventHandler -= value;
206 // Callback for Slider ValueChanged signal
207 private bool OnValueChanged(IntPtr slider, float slideValue)
209 ValueChangedEventArgs e = new ValueChangedEventArgs();
211 // Populate all members of "e" (ValueChangedEventArgs) with real page
212 e.Slider = Slider.GetSliderFromPtr( slider );
213 e.SlideValue = slideValue;
215 if (_sliderValueChangedEventHandler != null)
217 //here we send all page to user event handlers
218 return _sliderValueChangedEventHandler(this, e);
223 public event DaliEventHandlerWithReturnType<object,SlidingFinishedEventArgs,bool> SlidingFinished
229 // Restricted to only one listener
230 if (_sliderSlidingFinishedEventHandler == null)
232 _sliderSlidingFinishedEventHandler += value;
234 _sliderSlidingFinishedCallbackDelegate = new SlidingFinishedCallbackDelegate(OnSlidingFinished);
235 this.SlidingFinishedSignal().Connect(_sliderSlidingFinishedCallbackDelegate);
244 if (_sliderSlidingFinishedEventHandler != null)
246 this.SlidingFinishedSignal().Disconnect(_sliderSlidingFinishedCallbackDelegate);
249 _sliderSlidingFinishedEventHandler -= value;
254 // Callback for Slider SlidingFinished signal
255 private bool OnSlidingFinished(IntPtr slider, float slideValue)
257 SlidingFinishedEventArgs e = new SlidingFinishedEventArgs();
259 // Populate all members of "e" (SlidingFinishedEventArgs) with real page
260 e.Slider = Slider.GetSliderFromPtr( slider );
261 e.SlideValue = slideValue;
263 if (_sliderSlidingFinishedEventHandler != null)
265 //here we send all page to user event handlers
266 return _sliderSlidingFinishedEventHandler(this, e);
271 public event DaliEventHandlerWithReturnType<object,MarkReachedEventArgs,bool> MarkReached
277 // Restricted to only one listener
278 if (_sliderMarkReachedEventHandler == null)
280 _sliderMarkReachedEventHandler += value;
282 _sliderMarkReachedCallbackDelegate = new MarkReachedCallbackDelegate(OnMarkReached);
283 this.MarkReachedSignal().Connect(_sliderMarkReachedCallbackDelegate);
292 if (_sliderMarkReachedEventHandler != null)
294 this.MarkReachedSignal().Disconnect(_sliderMarkReachedCallbackDelegate);
297 _sliderMarkReachedEventHandler -= value;
302 // Callback for Slider MarkReached signal
303 private bool OnMarkReached(IntPtr slider, int slideValue)
305 MarkReachedEventArgs e = new MarkReachedEventArgs();
307 // Populate all members of "e" (MarkReachedEventArgs) with real page
308 e.Slider = Slider.GetSliderFromPtr( slider );
309 e.SlideValue = slideValue;
311 if (_sliderMarkReachedEventHandler != null)
313 //here we send all page to user event handlers
314 return _sliderMarkReachedEventHandler(this, e);
319 public static Slider GetSliderFromPtr(global::System.IntPtr cPtr) {
320 Slider ret = new Slider(cPtr, false);
321 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326 public class Property : global::System.IDisposable {
327 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
328 protected bool swigCMemOwn;
330 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
331 swigCMemOwn = cMemoryOwn;
332 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
335 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
336 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
343 public virtual void Dispose() {
345 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
348 NDalicPINVOKE.delete_Slider_Property(swigCPtr);
350 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
352 global::System.GC.SuppressFinalize(this);
356 public Property() : this(NDalicPINVOKE.new_Slider_Property(), true) {
357 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360 public static readonly int LOWER_BOUND = NDalicPINVOKE.Slider_Property_LOWER_BOUND_get();
361 public static readonly int UPPER_BOUND = NDalicPINVOKE.Slider_Property_UPPER_BOUND_get();
362 public static readonly int VALUE = NDalicPINVOKE.Slider_Property_VALUE_get();
363 public static readonly int TRACK_VISUAL = NDalicPINVOKE.Slider_Property_TRACK_VISUAL_get();
364 public static readonly int HANDLE_VISUAL = NDalicPINVOKE.Slider_Property_HANDLE_VISUAL_get();
365 public static readonly int PROGRESS_VISUAL = NDalicPINVOKE.Slider_Property_PROGRESS_VISUAL_get();
366 public static readonly int POPUP_VISUAL = NDalicPINVOKE.Slider_Property_POPUP_VISUAL_get();
367 public static readonly int POPUP_ARROW_VISUAL = NDalicPINVOKE.Slider_Property_POPUP_ARROW_VISUAL_get();
368 public static readonly int DISABLED_COLOR = NDalicPINVOKE.Slider_Property_DISABLED_COLOR_get();
369 public static readonly int VALUE_PRECISION = NDalicPINVOKE.Slider_Property_VALUE_PRECISION_get();
370 public static readonly int SHOW_POPUP = NDalicPINVOKE.Slider_Property_SHOW_POPUP_get();
371 public static readonly int SHOW_VALUE = NDalicPINVOKE.Slider_Property_SHOW_VALUE_get();
372 public static readonly int MARKS = NDalicPINVOKE.Slider_Property_MARKS_get();
373 public static readonly int SNAP_TO_MARKS = NDalicPINVOKE.Slider_Property_SNAP_TO_MARKS_get();
374 public static readonly int MARK_TOLERANCE = NDalicPINVOKE.Slider_Property_MARK_TOLERANCE_get();
378 public Slider () : this (NDalicPINVOKE.Slider_New(), true) {
379 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
382 public Slider(Slider handle) : this(NDalicPINVOKE.new_Slider__SWIG_1(Slider.getCPtr(handle)), true) {
383 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386 public Slider Assign(Slider handle) {
387 Slider ret = new Slider(NDalicPINVOKE.Slider_Assign(swigCPtr, Slider.getCPtr(handle)), false);
388 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392 public new static Slider DownCast(BaseHandle handle) {
393 Slider ret = new Slider(NDalicPINVOKE.Slider_DownCast(BaseHandle.getCPtr(handle)), true);
394 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
398 public SliderValueChangedSignal ValueChangedSignal() {
399 SliderValueChangedSignal ret = new SliderValueChangedSignal(NDalicPINVOKE.Slider_ValueChangedSignal(swigCPtr), false);
400 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404 public SliderValueChangedSignal SlidingFinishedSignal() {
405 SliderValueChangedSignal ret = new SliderValueChangedSignal(NDalicPINVOKE.Slider_SlidingFinishedSignal(swigCPtr), false);
406 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
410 public SliderMarkReachedSignal MarkReachedSignal() {
411 SliderMarkReachedSignal ret = new SliderMarkReachedSignal(NDalicPINVOKE.Slider_MarkReachedSignal(swigCPtr), false);
412 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
416 public enum PropertyRange {
417 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
418 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX+1000
421 public float LowerBound
426 GetProperty( Slider.Property.LOWER_BOUND).Get( ref temp );
431 SetProperty( Slider.Property.LOWER_BOUND, new Dali.Property.Value( value ) );
434 public float UpperBound
439 GetProperty( Slider.Property.UPPER_BOUND).Get( ref temp );
444 SetProperty( Slider.Property.UPPER_BOUND, new Dali.Property.Value( value ) );
452 GetProperty( Slider.Property.VALUE).Get( ref temp );
457 SetProperty( Slider.Property.VALUE, new Dali.Property.Value( value ) );
460 public Dali.Property.Map TrackVisual
464 Dali.Property.Map temp = new Dali.Property.Map();
465 GetProperty( Slider.Property.TRACK_VISUAL).Get( temp );
470 SetProperty( Slider.Property.TRACK_VISUAL, new Dali.Property.Value( value ) );
473 public Dali.Property.Map HandleVisual
477 Dali.Property.Map temp = new Dali.Property.Map();
478 GetProperty( Slider.Property.HANDLE_VISUAL).Get( temp );
483 SetProperty( Slider.Property.HANDLE_VISUAL, new Dali.Property.Value( value ) );
486 public Dali.Property.Map ProgressVisual
490 Dali.Property.Map temp = new Dali.Property.Map();
491 GetProperty( Slider.Property.PROGRESS_VISUAL).Get( temp );
496 SetProperty( Slider.Property.PROGRESS_VISUAL, new Dali.Property.Value( value ) );
499 public Dali.Property.Map PopupVisual
503 Dali.Property.Map temp = new Dali.Property.Map();
504 GetProperty( Slider.Property.POPUP_VISUAL).Get( temp );
509 SetProperty( Slider.Property.POPUP_VISUAL, new Dali.Property.Value( value ) );
512 public Dali.Property.Map PopupArrowVisual
516 Dali.Property.Map temp = new Dali.Property.Map();
517 GetProperty( Slider.Property.POPUP_ARROW_VISUAL).Get( temp );
522 SetProperty( Slider.Property.POPUP_ARROW_VISUAL, new Dali.Property.Value( value ) );
525 public Vector4 DisabledColor
529 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
530 GetProperty( Slider.Property.DISABLED_COLOR).Get( temp );
535 SetProperty( Slider.Property.DISABLED_COLOR, new Dali.Property.Value( value ) );
538 public int ValuePrecision
543 GetProperty( Slider.Property.VALUE_PRECISION).Get( ref temp );
548 SetProperty( Slider.Property.VALUE_PRECISION, new Dali.Property.Value( value ) );
551 public bool ShowPopup
556 GetProperty( Slider.Property.SHOW_POPUP).Get( ref temp );
561 SetProperty( Slider.Property.SHOW_POPUP, new Dali.Property.Value( value ) );
564 public bool ShowValue
569 GetProperty( Slider.Property.SHOW_VALUE).Get( ref temp );
574 SetProperty( Slider.Property.SHOW_VALUE, new Dali.Property.Value( value ) );
577 public Dali.Property.Array Marks
581 Dali.Property.Array temp = new Dali.Property.Array();
582 GetProperty( Slider.Property.MARKS).Get( temp );
587 SetProperty( Slider.Property.MARKS, new Dali.Property.Value( value ) );
590 public bool SnapToMarks
595 GetProperty( Slider.Property.SNAP_TO_MARKS).Get( ref temp );
600 SetProperty( Slider.Property.SNAP_TO_MARKS, new Dali.Property.Value( value ) );
603 public float MarkTolerance
608 GetProperty( Slider.Property.MARK_TOLERANCE).Get( ref temp );
613 SetProperty( Slider.Property.MARK_TOLERANCE, new Dali.Property.Value( value ) );