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