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