1 /** Copyright (c) 2016 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;
48 public override void Dispose() {
50 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
53 NDalicPINVOKE.delete_Slider(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57 global::System.GC.SuppressFinalize(this);
63 public class ValueChangedEventArgs : EventArgs
65 private Slider _slider;
66 private float _slideValue;
80 public float SlideValue
93 public class SlidingFinishedEventArgs : EventArgs
95 private Slider _slider;
96 private float _slideValue;
110 public float SlideValue
123 public class MarkReachedEventArgs : EventArgs
125 private Slider _slider;
126 private int _slideValue;
140 public int SlideValue
154 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
155 private delegate bool ValueChangedCallbackDelegate(IntPtr slider, float slideValue);
156 private DaliEventHandlerWithReturnType<object,ValueChangedEventArgs,bool> _sliderValueChangedEventHandler;
157 private ValueChangedCallbackDelegate _sliderValueChangedCallbackDelegate;
159 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
160 private delegate bool SlidingFinishedCallbackDelegate(IntPtr slider, float slideValue);
161 private DaliEventHandlerWithReturnType<object,SlidingFinishedEventArgs,bool> _sliderSlidingFinishedEventHandler;
162 private SlidingFinishedCallbackDelegate _sliderSlidingFinishedCallbackDelegate;
164 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
165 private delegate bool MarkReachedCallbackDelegate(IntPtr slider, int slideValue);
166 private DaliEventHandlerWithReturnType<object,MarkReachedEventArgs,bool> _sliderMarkReachedEventHandler;
167 private MarkReachedCallbackDelegate _sliderMarkReachedCallbackDelegate;
169 public event DaliEventHandlerWithReturnType<object,ValueChangedEventArgs,bool> ValueChanged
175 // Restricted to only one listener
176 if (_sliderValueChangedEventHandler == null)
178 _sliderValueChangedEventHandler += value;
180 _sliderValueChangedCallbackDelegate = new ValueChangedCallbackDelegate(OnValueChanged);
181 this.ValueChangedSignal().Connect(_sliderValueChangedCallbackDelegate);
190 if (_sliderValueChangedEventHandler != null)
192 this.ValueChangedSignal().Disconnect(_sliderValueChangedCallbackDelegate);
195 _sliderValueChangedEventHandler -= value;
200 // Callback for Slider ValueChanged signal
201 private bool OnValueChanged(IntPtr slider, float slideValue)
203 ValueChangedEventArgs e = new ValueChangedEventArgs();
205 // Populate all members of "e" (ValueChangedEventArgs) with real page
206 e.Slider = Slider.GetSliderFromPtr( slider );
207 e.SlideValue = slideValue;
209 if (_sliderValueChangedEventHandler != null)
211 //here we send all page to user event handlers
212 return _sliderValueChangedEventHandler(this, e, true);
217 public event DaliEventHandlerWithReturnType<object,SlidingFinishedEventArgs,bool> SlidingFinished
223 // Restricted to only one listener
224 if (_sliderSlidingFinishedEventHandler == null)
226 _sliderSlidingFinishedEventHandler += value;
228 _sliderSlidingFinishedCallbackDelegate = new SlidingFinishedCallbackDelegate(OnSlidingFinished);
229 this.SlidingFinishedSignal().Connect(_sliderSlidingFinishedCallbackDelegate);
238 if (_sliderSlidingFinishedEventHandler != null)
240 this.SlidingFinishedSignal().Disconnect(_sliderSlidingFinishedCallbackDelegate);
243 _sliderSlidingFinishedEventHandler -= value;
248 // Callback for Slider SlidingFinished signal
249 private bool OnSlidingFinished(IntPtr slider, float slideValue)
251 SlidingFinishedEventArgs e = new SlidingFinishedEventArgs();
253 // Populate all members of "e" (SlidingFinishedEventArgs) with real page
254 e.Slider = Slider.GetSliderFromPtr( slider );
255 e.SlideValue = slideValue;
257 if (_sliderSlidingFinishedEventHandler != null)
259 //here we send all page to user event handlers
260 return _sliderSlidingFinishedEventHandler(this, e, true);
265 public event DaliEventHandlerWithReturnType<object,MarkReachedEventArgs,bool> MarkReached
271 // Restricted to only one listener
272 if (_sliderMarkReachedEventHandler == null)
274 _sliderMarkReachedEventHandler += value;
276 _sliderMarkReachedCallbackDelegate = new MarkReachedCallbackDelegate(OnMarkReached);
277 this.MarkReachedSignal().Connect(_sliderMarkReachedCallbackDelegate);
286 if (_sliderMarkReachedEventHandler != null)
288 this.MarkReachedSignal().Disconnect(_sliderMarkReachedCallbackDelegate);
291 _sliderMarkReachedEventHandler -= value;
296 // Callback for Slider MarkReached signal
297 private bool OnMarkReached(IntPtr slider, int slideValue)
299 MarkReachedEventArgs e = new MarkReachedEventArgs();
301 // Populate all members of "e" (MarkReachedEventArgs) with real page
302 e.Slider = Slider.GetSliderFromPtr( slider );
303 e.SlideValue = slideValue;
305 if (_sliderMarkReachedEventHandler != null)
307 //here we send all page to user event handlers
308 return _sliderMarkReachedEventHandler(this, e, true);
313 public static Slider GetSliderFromPtr(global::System.IntPtr cPtr) {
314 Slider ret = new Slider(cPtr, false);
315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320 public class Property : global::System.IDisposable {
321 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
322 protected bool swigCMemOwn;
324 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
325 swigCMemOwn = cMemoryOwn;
326 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
329 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
330 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
337 public virtual void Dispose() {
339 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
342 NDalicPINVOKE.delete_Slider_Property(swigCPtr);
344 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
346 global::System.GC.SuppressFinalize(this);
350 public Property() : this(NDalicPINVOKE.new_Slider_Property(), true) {
351 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354 public static readonly int LOWER_BOUND = NDalicPINVOKE.Slider_Property_LOWER_BOUND_get();
355 public static readonly int UPPER_BOUND = NDalicPINVOKE.Slider_Property_UPPER_BOUND_get();
356 public static readonly int VALUE = NDalicPINVOKE.Slider_Property_VALUE_get();
357 public static readonly int TRACK_VISUAL = NDalicPINVOKE.Slider_Property_TRACK_VISUAL_get();
358 public static readonly int HANDLE_VISUAL = NDalicPINVOKE.Slider_Property_HANDLE_VISUAL_get();
359 public static readonly int PROGRESS_VISUAL = NDalicPINVOKE.Slider_Property_PROGRESS_VISUAL_get();
360 public static readonly int POPUP_VISUAL = NDalicPINVOKE.Slider_Property_POPUP_VISUAL_get();
361 public static readonly int POPUP_ARROW_VISUAL = NDalicPINVOKE.Slider_Property_POPUP_ARROW_VISUAL_get();
362 public static readonly int DISABLED_COLOR = NDalicPINVOKE.Slider_Property_DISABLED_COLOR_get();
363 public static readonly int VALUE_PRECISION = NDalicPINVOKE.Slider_Property_VALUE_PRECISION_get();
364 public static readonly int SHOW_POPUP = NDalicPINVOKE.Slider_Property_SHOW_POPUP_get();
365 public static readonly int SHOW_VALUE = NDalicPINVOKE.Slider_Property_SHOW_VALUE_get();
366 public static readonly int MARKS = NDalicPINVOKE.Slider_Property_MARKS_get();
367 public static readonly int SNAP_TO_MARKS = NDalicPINVOKE.Slider_Property_SNAP_TO_MARKS_get();
368 public static readonly int MARK_TOLERANCE = NDalicPINVOKE.Slider_Property_MARK_TOLERANCE_get();
372 public Slider () : this (NDalicPINVOKE.Slider_New(), true) {
373 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
376 public Slider(Slider handle) : this(NDalicPINVOKE.new_Slider__SWIG_1(Slider.getCPtr(handle)), true) {
377 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380 public Slider Assign(Slider handle) {
381 Slider ret = new Slider(NDalicPINVOKE.Slider_Assign(swigCPtr, Slider.getCPtr(handle)), false);
382 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386 public new static Slider DownCast(BaseHandle handle) {
387 Slider ret = new Slider(NDalicPINVOKE.Slider_DownCast(BaseHandle.getCPtr(handle)), true);
388 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392 public SliderValueChangedSignal ValueChangedSignal() {
393 SliderValueChangedSignal ret = new SliderValueChangedSignal(NDalicPINVOKE.Slider_ValueChangedSignal(swigCPtr), false);
394 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
398 public SliderValueChangedSignal SlidingFinishedSignal() {
399 SliderValueChangedSignal ret = new SliderValueChangedSignal(NDalicPINVOKE.Slider_SlidingFinishedSignal(swigCPtr), false);
400 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404 public SliderMarkReachedSignal MarkReachedSignal() {
405 SliderMarkReachedSignal ret = new SliderMarkReachedSignal(NDalicPINVOKE.Slider_MarkReachedSignal(swigCPtr), false);
406 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
410 public enum PropertyRange {
411 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
412 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX+1000
415 public float LowerBound
420 GetProperty( Slider.Property.LOWER_BOUND).Get( ref temp );
425 SetProperty( Slider.Property.LOWER_BOUND, new Dali.Property.Value( value ) );
428 public float UpperBound
433 GetProperty( Slider.Property.UPPER_BOUND).Get( ref temp );
438 SetProperty( Slider.Property.UPPER_BOUND, new Dali.Property.Value( value ) );
446 GetProperty( Slider.Property.VALUE).Get( ref temp );
451 SetProperty( Slider.Property.VALUE, new Dali.Property.Value( value ) );
454 public Dali.Property.Map TrackVisual
458 Dali.Property.Map temp = new Dali.Property.Map();
459 GetProperty( Slider.Property.TRACK_VISUAL).Get( temp );
464 SetProperty( Slider.Property.TRACK_VISUAL, new Dali.Property.Value( value ) );
467 public Dali.Property.Map HandleVisual
471 Dali.Property.Map temp = new Dali.Property.Map();
472 GetProperty( Slider.Property.HANDLE_VISUAL).Get( temp );
477 SetProperty( Slider.Property.HANDLE_VISUAL, new Dali.Property.Value( value ) );
480 public Dali.Property.Map ProgressVisual
484 Dali.Property.Map temp = new Dali.Property.Map();
485 GetProperty( Slider.Property.PROGRESS_VISUAL).Get( temp );
490 SetProperty( Slider.Property.PROGRESS_VISUAL, new Dali.Property.Value( value ) );
493 public Dali.Property.Map PopupVisual
497 Dali.Property.Map temp = new Dali.Property.Map();
498 GetProperty( Slider.Property.POPUP_VISUAL).Get( temp );
503 SetProperty( Slider.Property.POPUP_VISUAL, new Dali.Property.Value( value ) );
506 public Dali.Property.Map PopupArrowVisual
510 Dali.Property.Map temp = new Dali.Property.Map();
511 GetProperty( Slider.Property.POPUP_ARROW_VISUAL).Get( temp );
516 SetProperty( Slider.Property.POPUP_ARROW_VISUAL, new Dali.Property.Value( value ) );
519 public Vector4 DisabledColor
523 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
524 GetProperty( Slider.Property.DISABLED_COLOR).Get( temp );
529 SetProperty( Slider.Property.DISABLED_COLOR, new Dali.Property.Value( value ) );
532 public int ValuePrecision
537 GetProperty( Slider.Property.VALUE_PRECISION).Get( ref temp );
542 SetProperty( Slider.Property.VALUE_PRECISION, new Dali.Property.Value( value ) );
545 public bool ShowPopup
550 GetProperty( Slider.Property.SHOW_POPUP).Get( ref temp );
555 SetProperty( Slider.Property.SHOW_POPUP, new Dali.Property.Value( value ) );
558 public bool ShowValue
563 GetProperty( Slider.Property.SHOW_VALUE).Get( ref temp );
568 SetProperty( Slider.Property.SHOW_VALUE, new Dali.Property.Value( value ) );
571 public Dali.Property.Array Marks
575 Dali.Property.Array temp = new Dali.Property.Array();
576 GetProperty( Slider.Property.MARKS).Get( temp );
581 SetProperty( Slider.Property.MARKS, new Dali.Property.Value( value ) );
584 public bool SnapToMarks
589 GetProperty( Slider.Property.SNAP_TO_MARKS).Get( ref temp );
594 SetProperty( Slider.Property.SNAP_TO_MARKS, new Dali.Property.Value( value ) );
597 public float MarkTolerance
602 GetProperty( Slider.Property.MARK_TOLERANCE).Get( ref temp );
607 SetProperty( Slider.Property.MARK_TOLERANCE, new Dali.Property.Value( value ) );