Separate C# classes into Internal and Public
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / internal / Slider.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
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
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
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.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.10
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Dali {
28
29 using System;
30 using System.Runtime.InteropServices;
31
32
33 internal class Slider : View {
34   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35
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);
38   }
39
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;
42   }
43
44   ~Slider() {
45     DisposeQueue.Instance.Add(this);
46   }
47
48   public override void Dispose() {
49     if (!Window.IsInstalled()) {
50       DisposeQueue.Instance.Add(this);
51       return;
52     }
53
54     lock(this) {
55       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
56         if (swigCMemOwn) {
57           swigCMemOwn = false;
58           NDalicPINVOKE.delete_Slider(swigCPtr);
59         }
60         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61       }
62       global::System.GC.SuppressFinalize(this);
63       base.Dispose();
64     }
65   }
66
67
68
69 public class ValueChangedEventArgs : EventArgs
70 {
71    private Slider _slider;
72    private float _slideValue;
73
74    public Slider Slider
75    {
76       get
77       {
78          return _slider;
79       }
80       set
81       {
82          _slider = value;
83       }
84    }
85
86    public float SlideValue
87    {
88       get
89       {
90          return _slideValue;
91       }
92       set
93       {
94          _slideValue = value;
95       }
96    }
97 }
98
99 public class SlidingFinishedEventArgs : EventArgs
100 {
101    private Slider _slider;
102    private float _slideValue;
103
104    public Slider Slider
105    {
106       get
107       {
108          return _slider;
109       }
110       set
111       {
112          _slider = value;
113       }
114    }
115
116    public float SlideValue
117    {
118       get
119       {
120          return _slideValue;
121       }
122       set
123       {
124          _slideValue = value;
125       }
126    }
127 }
128
129 public class MarkReachedEventArgs : EventArgs
130 {
131    private Slider _slider;
132    private int _slideValue;
133
134    public Slider Slider
135    {
136       get
137       {
138          return _slider;
139       }
140       set
141       {
142          _slider = value;
143       }
144    }
145
146    public int SlideValue
147    {
148       get
149       {
150          return _slideValue;
151       }
152       set
153       {
154          _slideValue = value;
155       }
156    }
157 }
158
159
160   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
161   private delegate bool ValueChangedCallbackDelegate(IntPtr slider, float slideValue);
162   private DaliEventHandlerWithReturnType<object,ValueChangedEventArgs,bool> _sliderValueChangedEventHandler;
163   private ValueChangedCallbackDelegate _sliderValueChangedCallbackDelegate;
164
165   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
166   private delegate bool SlidingFinishedCallbackDelegate(IntPtr slider, float slideValue);
167   private DaliEventHandlerWithReturnType<object,SlidingFinishedEventArgs,bool> _sliderSlidingFinishedEventHandler;
168   private SlidingFinishedCallbackDelegate _sliderSlidingFinishedCallbackDelegate;
169
170   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
171   private delegate bool MarkReachedCallbackDelegate(IntPtr slider, int slideValue);
172   private DaliEventHandlerWithReturnType<object,MarkReachedEventArgs,bool> _sliderMarkReachedEventHandler;
173   private MarkReachedCallbackDelegate _sliderMarkReachedCallbackDelegate;
174
175   public event DaliEventHandlerWithReturnType<object,ValueChangedEventArgs,bool> ValueChanged
176   {
177      add
178      {
179         lock(this)
180         {
181            // Restricted to only one listener
182            if (_sliderValueChangedEventHandler == null)
183            {
184               _sliderValueChangedEventHandler += value;
185
186               _sliderValueChangedCallbackDelegate = new ValueChangedCallbackDelegate(OnValueChanged);
187               this.ValueChangedSignal().Connect(_sliderValueChangedCallbackDelegate);
188            }
189         }
190      }
191
192      remove
193      {
194         lock(this)
195         {
196            if (_sliderValueChangedEventHandler != null)
197            {
198               this.ValueChangedSignal().Disconnect(_sliderValueChangedCallbackDelegate);
199            }
200
201            _sliderValueChangedEventHandler -= value;
202         }
203      }
204   }
205
206   // Callback for Slider ValueChanged signal
207   private bool OnValueChanged(IntPtr slider, float slideValue)
208   {
209      ValueChangedEventArgs e = new ValueChangedEventArgs();
210
211      // Populate all members of "e" (ValueChangedEventArgs) with real page
212      e.Slider = Slider.GetSliderFromPtr( slider );
213      e.SlideValue = slideValue;
214
215      if (_sliderValueChangedEventHandler != null)
216      {
217         //here we send all page to user event handlers
218       return _sliderValueChangedEventHandler(this, e);
219      }
220      return false;
221   }
222
223   public event DaliEventHandlerWithReturnType<object,SlidingFinishedEventArgs,bool> SlidingFinished
224   {
225      add
226      {
227         lock(this)
228         {
229            // Restricted to only one listener
230            if (_sliderSlidingFinishedEventHandler == null)
231            {
232               _sliderSlidingFinishedEventHandler += value;
233
234               _sliderSlidingFinishedCallbackDelegate = new SlidingFinishedCallbackDelegate(OnSlidingFinished);
235               this.SlidingFinishedSignal().Connect(_sliderSlidingFinishedCallbackDelegate);
236            }
237         }
238      }
239
240      remove
241      {
242         lock(this)
243         {
244            if (_sliderSlidingFinishedEventHandler != null)
245            {
246               this.SlidingFinishedSignal().Disconnect(_sliderSlidingFinishedCallbackDelegate);
247            }
248
249            _sliderSlidingFinishedEventHandler -= value;
250         }
251      }
252   }
253
254   // Callback for Slider SlidingFinished signal
255   private bool OnSlidingFinished(IntPtr slider, float slideValue)
256   {
257      SlidingFinishedEventArgs e = new SlidingFinishedEventArgs();
258
259      // Populate all members of "e" (SlidingFinishedEventArgs) with real page
260      e.Slider = Slider.GetSliderFromPtr( slider );
261      e.SlideValue = slideValue;
262
263      if (_sliderSlidingFinishedEventHandler != null)
264      {
265         //here we send all page to user event handlers
266       return _sliderSlidingFinishedEventHandler(this, e);
267      }
268      return false;
269   }
270
271   public event DaliEventHandlerWithReturnType<object,MarkReachedEventArgs,bool> MarkReached
272   {
273      add
274      {
275         lock(this)
276         {
277            // Restricted to only one listener
278            if (_sliderMarkReachedEventHandler == null)
279            {
280               _sliderMarkReachedEventHandler += value;
281
282               _sliderMarkReachedCallbackDelegate = new MarkReachedCallbackDelegate(OnMarkReached);
283               this.MarkReachedSignal().Connect(_sliderMarkReachedCallbackDelegate);
284            }
285         }
286      }
287
288      remove
289      {
290         lock(this)
291         {
292            if (_sliderMarkReachedEventHandler != null)
293            {
294               this.MarkReachedSignal().Disconnect(_sliderMarkReachedCallbackDelegate);
295            }
296
297            _sliderMarkReachedEventHandler -= value;
298         }
299      }
300   }
301
302   // Callback for Slider MarkReached signal
303   private bool OnMarkReached(IntPtr slider, int slideValue)
304   {
305      MarkReachedEventArgs e = new MarkReachedEventArgs();
306
307      // Populate all members of "e" (MarkReachedEventArgs) with real page
308      e.Slider = Slider.GetSliderFromPtr( slider );
309      e.SlideValue = slideValue;
310
311      if (_sliderMarkReachedEventHandler != null)
312      {
313         //here we send all page to user event handlers
314       return _sliderMarkReachedEventHandler(this, e);
315      }
316      return false;
317   }
318
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();
322     return ret;
323   }
324
325
326   public class Property : global::System.IDisposable {
327     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
328     protected bool swigCMemOwn;
329   
330     internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
331       swigCMemOwn = cMemoryOwn;
332       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
333     }
334   
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;
337     }
338   
339     ~Property() {
340       Dispose();
341     }
342   
343     public virtual void Dispose() {
344       lock(this) {
345         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
346           if (swigCMemOwn) {
347             swigCMemOwn = false;
348             NDalicPINVOKE.delete_Slider_Property(swigCPtr);
349           }
350           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
351         }
352         global::System.GC.SuppressFinalize(this);
353       }
354     }
355   
356     public Property() : this(NDalicPINVOKE.new_Slider_Property(), true) {
357       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
358     }
359   
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();
375   
376   }
377
378   public Slider () : this (NDalicPINVOKE.Slider_New(), true) {
379       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380
381   }
382   public Slider(Slider handle) : this(NDalicPINVOKE.new_Slider__SWIG_1(Slider.getCPtr(handle)), true) {
383     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
384   }
385
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();
389     return ret;
390   }
391
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();
395     return ret;
396   }
397
398   public SliderValueChangedSignal ValueChangedSignal() {
399     SliderValueChangedSignal ret = new SliderValueChangedSignal(NDalicPINVOKE.Slider_ValueChangedSignal(swigCPtr), false);
400     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401     return ret;
402   }
403
404   public SliderValueChangedSignal SlidingFinishedSignal() {
405     SliderValueChangedSignal ret = new SliderValueChangedSignal(NDalicPINVOKE.Slider_SlidingFinishedSignal(swigCPtr), false);
406     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
407     return ret;
408   }
409
410   public SliderMarkReachedSignal MarkReachedSignal() {
411     SliderMarkReachedSignal ret = new SliderMarkReachedSignal(NDalicPINVOKE.Slider_MarkReachedSignal(swigCPtr), false);
412     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
413     return ret;
414   }
415
416   public float LowerBound
417   {
418     get
419     {
420       float temp = 0.0f;
421       GetProperty( Slider.Property.LOWER_BOUND).Get( out temp );
422       return temp;
423     }
424     set
425     {
426       SetProperty( Slider.Property.LOWER_BOUND, new Dali.Property.Value( value ) );
427     }
428   }
429   public float UpperBound
430   {
431     get
432     {
433       float temp = 0.0f;
434       GetProperty( Slider.Property.UPPER_BOUND).Get( out temp );
435       return temp;
436     }
437     set
438     {
439       SetProperty( Slider.Property.UPPER_BOUND, new Dali.Property.Value( value ) );
440     }
441   }
442   public float Value
443   {
444     get
445     {
446       float temp = 0.0f;
447       GetProperty( Slider.Property.VALUE).Get( out temp );
448       return temp;
449     }
450     set
451     {
452       SetProperty( Slider.Property.VALUE, new Dali.Property.Value( value ) );
453     }
454   }
455   public Dali.Property.Map TrackVisual
456   {
457     get
458     {
459       Dali.Property.Map temp = new Dali.Property.Map();
460       GetProperty( Slider.Property.TRACK_VISUAL).Get(  temp );
461       return temp;
462     }
463     set
464     {
465       SetProperty( Slider.Property.TRACK_VISUAL, new Dali.Property.Value( value ) );
466     }
467   }
468   public Dali.Property.Map HandleVisual
469   {
470     get
471     {
472       Dali.Property.Map temp = new Dali.Property.Map();
473       GetProperty( Slider.Property.HANDLE_VISUAL).Get(  temp );
474       return temp;
475     }
476     set
477     {
478       SetProperty( Slider.Property.HANDLE_VISUAL, new Dali.Property.Value( value ) );
479     }
480   }
481   public Dali.Property.Map ProgressVisual
482   {
483     get
484     {
485       Dali.Property.Map temp = new Dali.Property.Map();
486       GetProperty( Slider.Property.PROGRESS_VISUAL).Get(  temp );
487       return temp;
488     }
489     set
490     {
491       SetProperty( Slider.Property.PROGRESS_VISUAL, new Dali.Property.Value( value ) );
492     }
493   }
494   public Dali.Property.Map PopupVisual
495   {
496     get
497     {
498       Dali.Property.Map temp = new Dali.Property.Map();
499       GetProperty( Slider.Property.POPUP_VISUAL).Get(  temp );
500       return temp;
501     }
502     set
503     {
504       SetProperty( Slider.Property.POPUP_VISUAL, new Dali.Property.Value( value ) );
505     }
506   }
507   public Dali.Property.Map PopupArrowVisual
508   {
509     get
510     {
511       Dali.Property.Map temp = new Dali.Property.Map();
512       GetProperty( Slider.Property.POPUP_ARROW_VISUAL).Get(  temp );
513       return temp;
514     }
515     set
516     {
517       SetProperty( Slider.Property.POPUP_ARROW_VISUAL, new Dali.Property.Value( value ) );
518     }
519   }
520   public Vector4 DisabledColor
521   {
522     get
523     {
524       Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
525       GetProperty( Slider.Property.DISABLED_COLOR).Get(  temp );
526       return temp;
527     }
528     set
529     {
530       SetProperty( Slider.Property.DISABLED_COLOR, new Dali.Property.Value( value ) );
531     }
532   }
533   public int ValuePrecision
534   {
535     get
536     {
537       int temp = 0;
538       GetProperty( Slider.Property.VALUE_PRECISION).Get( out temp );
539       return temp;
540     }
541     set
542     {
543       SetProperty( Slider.Property.VALUE_PRECISION, new Dali.Property.Value( value ) );
544     }
545   }
546   public bool ShowPopup
547   {
548     get
549     {
550       bool temp = false;
551       GetProperty( Slider.Property.SHOW_POPUP).Get( out temp );
552       return temp;
553     }
554     set
555     {
556       SetProperty( Slider.Property.SHOW_POPUP, new Dali.Property.Value( value ) );
557     }
558   }
559   public bool ShowValue
560   {
561     get
562     {
563       bool temp = false;
564       GetProperty( Slider.Property.SHOW_VALUE).Get( out temp );
565       return temp;
566     }
567     set
568     {
569       SetProperty( Slider.Property.SHOW_VALUE, new Dali.Property.Value( value ) );
570     }
571   }
572   public Dali.Property.Array Marks
573   {
574     get
575     {
576       Dali.Property.Array temp = new Dali.Property.Array();
577       GetProperty( Slider.Property.MARKS).Get(  temp );
578       return temp;
579     }
580     set
581     {
582       SetProperty( Slider.Property.MARKS, new Dali.Property.Value( value ) );
583     }
584   }
585   public bool SnapToMarks
586   {
587     get
588     {
589       bool temp = false;
590       GetProperty( Slider.Property.SNAP_TO_MARKS).Get( out temp );
591       return temp;
592     }
593     set
594     {
595       SetProperty( Slider.Property.SNAP_TO_MARKS, new Dali.Property.Value( value ) );
596     }
597   }
598   public float MarkTolerance
599   {
600     get
601     {
602       float temp = 0.0f;
603       GetProperty( Slider.Property.MARK_TOLERANCE).Get( out temp );
604       return temp;
605     }
606     set
607     {
608       SetProperty( Slider.Property.MARK_TOLERANCE, new Dali.Property.Value( value ) );
609     }
610   }
611
612 }
613
614 }