Merge "Add SetProperty and GetProperty to Visuals." into devel/master
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / automatic / csharp / Button.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 namespace Dali {
12
13 using System;
14 using System.Runtime.InteropServices;
15
16
17 public class Button : View {
18   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19
20   internal Button(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Button_SWIGUpcast(cPtr), cMemoryOwn) {
21     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
22   }
23
24   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Button obj) {
25     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
26   }
27
28   ~Button() {
29     Dispose();
30   }
31
32   public override void Dispose() {
33     lock(this) {
34       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
35         if (swigCMemOwn) {
36           swigCMemOwn = false;
37           NDalicPINVOKE.delete_Button(swigCPtr);
38         }
39         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
40       }
41       global::System.GC.SuppressFinalize(this);
42       base.Dispose();
43     }
44   }
45
46
47 public class ClickedEventArgs : EventArgs
48 {
49    private Button _button;
50
51    public Button Button
52    {
53       get
54       {
55          return _button;
56       }
57       set
58       {
59          _button = value;
60       }
61    }
62 }
63
64 public class PressedEventArgs : EventArgs
65 {
66    private Button _button;
67
68    public Button Button
69    {
70       get
71       {
72          return _button;
73       }
74       set
75       {
76          _button = value;
77       }
78    }
79 }
80
81 public class ReleasedEventArgs : EventArgs
82 {
83    private Button _button;
84
85    public Button Button
86    {
87       get
88       {
89          return _button;
90       }
91       set
92       {
93          _button = value;
94       }
95    }
96 }
97
98 public class StateChangedEventArgs : EventArgs
99 {
100    private Button _button;
101
102    public Button Button
103    {
104       get
105       {
106          return _button;
107       }
108       set
109       {
110          _button = value;
111       }
112    }
113 }
114
115
116   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
117   private delegate bool ClickedCallbackDelegate(global::System.IntPtr data);
118   private DaliEventHandlerWithReturnType<object,ClickedEventArgs,bool> _buttonClickedEventHandler;
119   private ClickedCallbackDelegate _buttonClickedCallbackDelegate;
120
121   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
122   private delegate bool PressedCallbackDelegate(global::System.IntPtr data);
123   private DaliEventHandlerWithReturnType<object,PressedEventArgs,bool> _buttonPressedEventHandler;
124   private PressedCallbackDelegate _buttonPressedCallbackDelegate;
125
126   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
127   private delegate bool ReleasedCallbackDelegate(global::System.IntPtr data);
128   private DaliEventHandlerWithReturnType<object,ReleasedEventArgs,bool>  _buttonReleasedEventHandler;
129   private ReleasedCallbackDelegate _buttonReleasedCallbackDelegate;
130
131   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
132   private delegate bool StateChangedCallbackDelegate(global::System.IntPtr data);
133   private DaliEventHandlerWithReturnType<object,StateChangedEventArgs,bool> _buttonStateChangedEventHandler;
134   private StateChangedCallbackDelegate _buttonStateChangedCallbackDelegate;
135
136
137   public event DaliEventHandlerWithReturnType<object,ClickedEventArgs,bool> Clicked
138   {
139      add
140      {
141         lock(this)
142         {
143            // Restricted to only one listener
144            if (_buttonClickedEventHandler == null)
145            {
146               _buttonClickedEventHandler += value;
147
148               _buttonClickedCallbackDelegate = new ClickedCallbackDelegate(OnClicked);
149               this.ClickedSignal().Connect(_buttonClickedCallbackDelegate);
150            }
151         }
152      }
153
154      remove
155      {
156         lock(this)
157         {
158            if (_buttonClickedEventHandler != null)
159            {
160                this.ClickedSignal().Disconnect(_buttonClickedCallbackDelegate);
161            }
162
163            _buttonClickedEventHandler -= value;
164         }
165      }
166   }
167
168   // Callback for button click signal
169   private bool OnClicked (IntPtr data)
170   {
171      ClickedEventArgs e = new ClickedEventArgs();
172
173      e.Button = Button.GetButtonFromPtr(data);
174
175      if (_buttonClickedEventHandler != null)
176      {
177         //here we send all data to user event handlers
178         return _buttonClickedEventHandler(this, e,true);
179      }
180      return false;
181   }
182
183
184   public event DaliEventHandlerWithReturnType<object,PressedEventArgs,bool> Pressed
185   {
186      add
187      {
188         lock(this)
189         {
190            // Restricted to only one listener
191            if (_buttonPressedEventHandler == null)
192            {
193               _buttonPressedEventHandler += value;
194
195               _buttonPressedCallbackDelegate = new PressedCallbackDelegate(OnPressed);
196               this.PressedSignal().Connect(_buttonPressedCallbackDelegate);
197            }
198         }
199      }
200
201      remove
202      {
203         lock(this)
204         {
205            if (_buttonPressedEventHandler != null)
206            {
207                this.PressedSignal().Disconnect(_buttonPressedCallbackDelegate);
208            }
209
210            _buttonPressedEventHandler -= value;
211         }
212      }
213   }
214
215   // Callback for button click signal
216   private bool OnPressed (IntPtr data)
217   {
218      PressedEventArgs e = new PressedEventArgs();
219
220      e.Button = Button.GetButtonFromPtr(data);
221
222      if (_buttonPressedEventHandler != null)
223      {
224         //here we send all data to user event handlers
225        return _buttonPressedEventHandler(this, e,true);
226      }
227      return false;
228   }
229
230
231   public event DaliEventHandlerWithReturnType<object,ReleasedEventArgs,bool> Released
232   {
233      add
234      {
235         lock(this)
236         {
237            // Restricted to only one listener
238            if (_buttonReleasedEventHandler == null)
239            {
240               _buttonReleasedEventHandler += value;
241
242               _buttonReleasedCallbackDelegate = new ReleasedCallbackDelegate(OnReleased);
243               this.ReleasedSignal().Connect(_buttonReleasedCallbackDelegate);
244            }
245         }
246      }
247
248      remove
249      {
250         lock(this)
251         {
252            if (_buttonReleasedEventHandler != null)
253            {
254                this.ReleasedSignal().Disconnect(_buttonReleasedCallbackDelegate);
255            }
256
257            _buttonReleasedEventHandler -= value;
258         }
259      }
260   }
261
262   // Callback for button click signal
263   private bool OnReleased (IntPtr data)
264   {
265      ReleasedEventArgs e = new ReleasedEventArgs();
266
267      e.Button = Button.GetButtonFromPtr(data);
268
269      if (_buttonReleasedEventHandler != null)
270      {
271         //here we send all data to user event handlers
272        return _buttonReleasedEventHandler(this, e, true);
273      }
274      return false;
275   }
276
277
278   public event DaliEventHandlerWithReturnType<object,StateChangedEventArgs,bool> StateChanged
279   {
280      add
281      {
282         lock(this)
283         {
284            // Restricted to only one listener
285            if (_buttonStateChangedEventHandler == null)
286            {
287               _buttonStateChangedEventHandler += value;
288
289               _buttonStateChangedCallbackDelegate = new StateChangedCallbackDelegate(OnStateChanged);
290               this.StateChangedSignal().Connect(_buttonStateChangedCallbackDelegate);
291            }
292         }
293      }
294
295      remove
296      {
297         lock(this)
298         {
299            if (_buttonStateChangedEventHandler != null)
300            {
301                this.StateChangedSignal().Disconnect(_buttonStateChangedCallbackDelegate);
302            }
303
304            _buttonStateChangedEventHandler -= value;
305         }
306      }
307   }
308
309   // Callback for button click signal
310   private bool OnStateChanged (IntPtr data)
311   {
312      StateChangedEventArgs e = new StateChangedEventArgs();
313
314      e.Button = Button.GetButtonFromPtr(data);
315
316      if (_buttonStateChangedEventHandler != null)
317      {
318         //here we send all data to user event handlers
319        return _buttonStateChangedEventHandler(this, e, true);
320      }
321      return false;
322   }
323
324  public static Button GetButtonFromPtr(global::System.IntPtr cPtr) {
325     Button ret = new Button(cPtr, false);
326    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327     return ret;
328   }
329
330
331   public class Property : global::System.IDisposable {
332     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
333     protected bool swigCMemOwn;
334   
335     internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
336       swigCMemOwn = cMemoryOwn;
337       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
338     }
339   
340     internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
341       return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
342     }
343   
344     ~Property() {
345       Dispose();
346     }
347   
348     public virtual void Dispose() {
349       lock(this) {
350         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
351           if (swigCMemOwn) {
352             swigCMemOwn = false;
353             NDalicPINVOKE.delete_Button_Property(swigCPtr);
354           }
355           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
356         }
357         global::System.GC.SuppressFinalize(this);
358       }
359     }
360   
361     public Property() : this(NDalicPINVOKE.new_Button_Property(), true) {
362       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
363     }
364   
365     public static readonly int DISABLED = NDalicPINVOKE.Button_Property_DISABLED_get();
366     public static readonly int AUTO_REPEATING = NDalicPINVOKE.Button_Property_AUTO_REPEATING_get();
367     public static readonly int INITIAL_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_INITIAL_AUTO_REPEATING_DELAY_get();
368     public static readonly int NEXT_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_NEXT_AUTO_REPEATING_DELAY_get();
369     public static readonly int TOGGLABLE = NDalicPINVOKE.Button_Property_TOGGLABLE_get();
370     public static readonly int SELECTED = NDalicPINVOKE.Button_Property_SELECTED_get();
371     public static readonly int UNSELECTED_STATE_IMAGE = NDalicPINVOKE.Button_Property_UNSELECTED_STATE_IMAGE_get();
372     public static readonly int SELECTED_STATE_IMAGE = NDalicPINVOKE.Button_Property_SELECTED_STATE_IMAGE_get();
373     public static readonly int DISABLED_STATE_IMAGE = NDalicPINVOKE.Button_Property_DISABLED_STATE_IMAGE_get();
374     public static readonly int UNSELECTED_COLOR = NDalicPINVOKE.Button_Property_UNSELECTED_COLOR_get();
375     public static readonly int SELECTED_COLOR = NDalicPINVOKE.Button_Property_SELECTED_COLOR_get();
376     public static readonly int LABEL = NDalicPINVOKE.Button_Property_LABEL_get();
377     public static readonly int LABEL_TEXT = NDalicPINVOKE.Button_Property_LABEL_TEXT_get();
378   
379   }
380
381   public Button() : this(NDalicPINVOKE.new_Button__SWIG_0(), true) {
382     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
383   }
384
385   public Button(Button button) : this(NDalicPINVOKE.new_Button__SWIG_1(Button.getCPtr(button)), true) {
386     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
387   }
388
389   public Button Assign(Button button) {
390     Button ret = new Button(NDalicPINVOKE.Button_Assign(swigCPtr, Button.getCPtr(button)), false);
391     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392     return ret;
393   }
394
395   public new static Button DownCast(BaseHandle handle) {
396     Button ret = new Button(NDalicPINVOKE.Button_DownCast(BaseHandle.getCPtr(handle)), true);
397     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
398     return ret;
399   }
400
401   public bool IsDisabled() {
402     bool ret = NDalicPINVOKE.Button_IsDisabled(swigCPtr);
403     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404     return ret;
405   }
406
407   public bool IsAutoRepeating() {
408     bool ret = NDalicPINVOKE.Button_IsAutoRepeating(swigCPtr);
409     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
410     return ret;
411   }
412
413   public float GetInitialAutoRepeatingDelay() {
414     float ret = NDalicPINVOKE.Button_GetInitialAutoRepeatingDelay(swigCPtr);
415     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
416     return ret;
417   }
418
419   public float GetNextAutoRepeatingDelay() {
420     float ret = NDalicPINVOKE.Button_GetNextAutoRepeatingDelay(swigCPtr);
421     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422     return ret;
423   }
424
425   public bool IsTogglableButton() {
426     bool ret = NDalicPINVOKE.Button_IsTogglableButton(swigCPtr);
427     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
428     return ret;
429   }
430
431   public bool IsSelected() {
432     bool ret = NDalicPINVOKE.Button_IsSelected(swigCPtr);
433     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434     return ret;
435   }
436
437   public float GetAnimationTime() {
438     float ret = NDalicPINVOKE.Button_GetAnimationTime(swigCPtr);
439     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
440     return ret;
441   }
442
443   public string GetLabelText() {
444     string ret = NDalicPINVOKE.Button_GetLabelText(swigCPtr);
445     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
446     return ret;
447   }
448
449   public void SetLabel(Actor label) {
450     NDalicPINVOKE.Button_SetLabel(swigCPtr, Actor.getCPtr(label));
451     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
452   }
453
454   public void SetButtonImage(Image image) {
455     NDalicPINVOKE.Button_SetButtonImage(swigCPtr, Image.getCPtr(image));
456     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
457   }
458
459   public void SetSelectedImage(Image image) {
460     NDalicPINVOKE.Button_SetSelectedImage(swigCPtr, Image.getCPtr(image));
461     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
462   }
463
464   public Actor GetButtonImage() {
465     Actor ret = new Actor(NDalicPINVOKE.Button_GetButtonImage(swigCPtr), true);
466     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
467     return ret;
468   }
469
470   public Actor GetSelectedImage() {
471     Actor ret = new Actor(NDalicPINVOKE.Button_GetSelectedImage(swigCPtr), true);
472     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
473     return ret;
474   }
475
476   public ButtonSignal PressedSignal() {
477     ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_PressedSignal(swigCPtr), false);
478     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
479     return ret;
480   }
481
482   public ButtonSignal ReleasedSignal() {
483     ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ReleasedSignal(swigCPtr), false);
484     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
485     return ret;
486   }
487
488   public ButtonSignal ClickedSignal() {
489     ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ClickedSignal(swigCPtr), false);
490     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
491     return ret;
492   }
493
494   public ButtonSignal StateChangedSignal() {
495     ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_StateChangedSignal(swigCPtr), false);
496     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
497     return ret;
498   }
499
500   public enum PropertyRange {
501     PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
502     PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX+1000
503   }
504
505   public bool Disabled 
506   { 
507     get 
508     {
509       bool temp = false;
510       GetProperty( Button.Property.DISABLED).Get( ref temp );
511       return temp;
512     }
513     set 
514     { 
515       SetProperty( Button.Property.DISABLED, new Dali.Property.Value( value ) );
516     }
517   }
518   public bool AutoRepeating 
519   { 
520     get 
521     {
522       bool temp = false;
523       GetProperty( Button.Property.AUTO_REPEATING).Get( ref temp );
524       return temp;
525     }
526     set 
527     { 
528       SetProperty( Button.Property.AUTO_REPEATING, new Dali.Property.Value( value ) );
529     }
530   }
531   public float InitialAutoRepeatingDelay 
532   { 
533     get 
534     {
535       float temp = 0.0f;
536       GetProperty( Button.Property.INITIAL_AUTO_REPEATING_DELAY).Get( ref temp );
537       return temp;
538     }
539     set 
540     { 
541       SetProperty( Button.Property.INITIAL_AUTO_REPEATING_DELAY, new Dali.Property.Value( value ) );
542     }
543   }
544   public float NextAutoRepeatingDelay 
545   { 
546     get 
547     {
548       float temp = 0.0f;
549       GetProperty( Button.Property.NEXT_AUTO_REPEATING_DELAY).Get( ref temp );
550       return temp;
551     }
552     set 
553     { 
554       SetProperty( Button.Property.NEXT_AUTO_REPEATING_DELAY, new Dali.Property.Value( value ) );
555     }
556   }
557   public bool Togglable 
558   { 
559     get 
560     {
561       bool temp = false;
562       GetProperty( Button.Property.TOGGLABLE).Get( ref temp );
563       return temp;
564     }
565     set 
566     { 
567       SetProperty( Button.Property.TOGGLABLE, new Dali.Property.Value( value ) );
568     }
569   }
570   public bool Selected 
571   { 
572     get 
573     {
574       bool temp = false;
575       GetProperty( Button.Property.SELECTED).Get( ref temp );
576       return temp;
577     }
578     set 
579     { 
580       SetProperty( Button.Property.SELECTED, new Dali.Property.Value( value ) );
581     }
582   }
583   public string UnselectedStateImage 
584   { 
585     get 
586     {
587       string temp;
588       GetProperty( Button.Property.UNSELECTED_STATE_IMAGE).Get( out temp );
589       return temp;
590     }
591     set 
592     { 
593       SetProperty( Button.Property.UNSELECTED_STATE_IMAGE, new Dali.Property.Value( value ) );
594     }
595   }
596   public string SelectedStateImage 
597   { 
598     get 
599     {
600       string temp;
601       GetProperty( Button.Property.SELECTED_STATE_IMAGE).Get( out temp );
602       return temp;
603     }
604     set 
605     { 
606       SetProperty( Button.Property.SELECTED_STATE_IMAGE, new Dali.Property.Value( value ) );
607     }
608   }
609   public string DisabledStateImage 
610   { 
611     get 
612     {
613       string temp;
614       GetProperty( Button.Property.DISABLED_STATE_IMAGE).Get( out temp );
615       return temp;
616     }
617     set 
618     { 
619       SetProperty( Button.Property.DISABLED_STATE_IMAGE, new Dali.Property.Value( value ) );
620     }
621   }
622   public Vector4 UnselectedColor 
623   { 
624     get 
625     {
626       Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
627       GetProperty( Button.Property.UNSELECTED_COLOR).Get(  temp );
628       return temp;
629     }
630     set 
631     { 
632       SetProperty( Button.Property.UNSELECTED_COLOR, new Dali.Property.Value( value ) );
633     }
634   }
635   public Vector4 SelectedColor 
636   { 
637     get 
638     {
639       Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
640       GetProperty( Button.Property.SELECTED_COLOR).Get(  temp );
641       return temp;
642     }
643     set 
644     { 
645       SetProperty( Button.Property.SELECTED_COLOR, new Dali.Property.Value( value ) );
646     }
647   }
648   public Dali.Property.Map Label 
649   { 
650     get 
651     {
652       Dali.Property.Map temp = new Dali.Property.Map();
653       GetProperty( Button.Property.LABEL).Get(  temp );
654       return temp;
655     }
656     set 
657     { 
658       SetProperty( Button.Property.LABEL, new Dali.Property.Value( value ) );
659     }
660   }
661   public string LabelText 
662   { 
663     get 
664     {
665       string temp;
666       GetProperty( Button.Property.LABEL_TEXT).Get( out temp );
667       return temp;
668     }
669     set 
670     { 
671       SetProperty( Button.Property.LABEL_TEXT, new Dali.Property.Value( value ) );
672     }
673   }
674
675 }
676
677 }