Merge "Fix some bugs: (1)Change the return type of Window.IsVisible() form void to...
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / UIComponents / Button.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 // Some have been manually changed
18
19 namespace Tizen.NUI.UIComponents
20 {
21
22     using System;
23     using System.Runtime.InteropServices;
24
25     /// <summary>
26     /// Button is a base class for different kinds of buttons.<br>
27     /// This class provides the disabled property and the clicked signal.<br>
28     /// A Clicked event handler is emitted when the button is touched and the touch point doesn't leave the boundary of the button.<br>
29     /// When the disabled property is set to true, no signal is emitted.<br>
30     /// 'Visual' describes not just traditional images like png, bmp but refers to whatever is used to show the button, it could be a color, gradient or some other kind of renderer.<br>
31     /// The button's appearance can be modified by setting properties for the various visuals/images.<br>
32     /// It is not mandatory to set all visuals. A button could be defined only by setting its background visual or by setting its background and selected visuals.<br>
33     /// The button visual is shown over the background visual.<br>
34     /// When pressed the unselected visuals are replaced by the selected visual.<br>
35     /// The text label is always placed on the top of all images.<br>
36     /// When the button is disabled, background, button and selected visuals are replaced by their disabled visuals.<br>
37     /// </summary>
38     public class Button : View
39     {
40         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
41
42         internal Button(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Button_SWIGUpcast(cPtr), cMemoryOwn)
43         {
44             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
45         }
46
47         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Button obj)
48         {
49             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
50         }
51
52         ~Button()
53         {
54             DisposeQueue.Instance.Add(this);
55         }
56
57         /// <summary>
58         /// To make Button instance be disposed.
59         /// </summary>
60         public override void Dispose()
61         {
62             if (!Stage.IsInstalled())
63             {
64                 DisposeQueue.Instance.Add(this);
65                 return;
66             }
67
68             lock (this)
69             {
70                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
71                 {
72                     if (swigCMemOwn)
73                     {
74                         swigCMemOwn = false;
75                         NDalicPINVOKE.delete_Button(swigCPtr);
76                     }
77                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
78                 }
79                 global::System.GC.SuppressFinalize(this);
80                 base.Dispose();
81             }
82         }
83
84
85         private EventHandlerWithReturnType<object, EventArgs, bool> _clickedEventHandler;
86         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
87         private delegate bool ClickedCallbackType(global::System.IntPtr data);
88         private ClickedCallbackType _clickedCallback;
89
90         /// <summary>
91         /// Clicked will be triggered when the button is touched and the touch point doesn't leave the boundary of the button.
92         /// </summary>
93         public event EventHandlerWithReturnType<object, EventArgs, bool> Clicked
94         {
95             add
96             {
97                 if (_clickedEventHandler == null)
98                 {
99                     _clickedCallback = OnClicked;
100                     ClickedSignal().Connect(_clickedCallback);
101                 }
102
103                 _clickedEventHandler += value;
104             }
105
106             remove
107             {
108                 _clickedEventHandler -= value;
109
110                 if (_clickedEventHandler == null && ClickedSignal().Empty() == false)
111                 {
112                     ClickedSignal().Disconnect(_clickedCallback);
113                 }
114             }
115         }
116
117
118         private bool OnClicked(IntPtr data)
119         {
120             if (_clickedEventHandler != null)
121             {
122                 return _clickedEventHandler(this, null);
123             }
124             return false;
125         }
126
127
128
129         private EventHandlerWithReturnType<object, EventArgs, bool> _pressedEventHandler;
130         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
131         private delegate bool PressedCallbackType(global::System.IntPtr data);
132         private PressedCallbackType _pressedCallback;
133
134         /// <summary>
135         /// Pressed will be triggered when the button is touched.
136         /// </summary>
137         public event EventHandlerWithReturnType<object, EventArgs, bool> Pressed
138         {
139             add
140             {
141                 if (_pressedEventHandler == null)
142                 {
143                     _pressedCallback = OnPressed;
144                     PressedSignal().Connect(_pressedCallback);
145                 }
146
147                 _pressedEventHandler += value;
148             }
149
150             remove
151             {
152                 _pressedEventHandler -= value;
153
154                 if (_pressedEventHandler == null && PressedSignal().Empty() == false)
155                 {
156                     this.PressedSignal().Disconnect(_pressedCallback);
157                 }
158             }
159         }
160
161         private bool OnPressed(IntPtr data)
162         {
163             if (_pressedEventHandler != null)
164             {
165                 return _pressedEventHandler(this, null);
166             }
167             return false;
168         }
169
170
171
172         private EventHandlerWithReturnType<object, EventArgs, bool> _releasedEventHandler;
173         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
174         private delegate bool ReleasedCallbackType(global::System.IntPtr data);
175         private ReleasedCallbackType _releasedCallback;
176
177         /// <summary>
178         /// Released will be triggered when the button is touched and the touch point leaves the boundary of the button.
179         /// </summary>
180         public event EventHandlerWithReturnType<object, EventArgs, bool> Released
181         {
182             add
183             {
184                 if (_releasedEventHandler == null)
185                 {
186                     _releasedCallback = OnReleased;
187                     ReleasedSignal().Connect(_releasedCallback);
188                 }
189                 _releasedEventHandler += value;
190             }
191
192             remove
193             {
194                 _releasedEventHandler -= value;
195
196                 if (_releasedEventHandler == null && ReleasedSignal().Empty() == false)
197                 {
198                     ReleasedSignal().Disconnect(_releasedCallback);
199                 }
200
201             }
202         }
203
204         private bool OnReleased(IntPtr data)
205         {
206             if (_releasedEventHandler != null)
207             {
208                 return _releasedEventHandler(this, null);
209             }
210             return false;
211         }
212
213
214         private EventHandlerWithReturnType<object, EventArgs, bool> _stateChangedEventHandler;
215         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
216         private delegate bool StateChangedCallback(global::System.IntPtr data);
217         private StateChangedCallback _stateChangedCallback;
218
219         /// <summary>
220         /// StateChanged will be triggered when the button's state is changed.
221         /// </summary>
222         public event EventHandlerWithReturnType<object, EventArgs, bool> StateChanged
223         {
224             add
225             {
226                 if (_stateChangedEventHandler == null)
227                 {
228                     _stateChangedCallback = OnStateChanged;
229                     StateChangedSignal().Connect(_stateChangedCallback);
230                 }
231
232                 _stateChangedEventHandler += value;
233             }
234
235             remove
236             {
237                 _stateChangedEventHandler -= value;
238
239                 if (_stateChangedEventHandler == null && StateChangedSignal().Empty() == false)
240                 {
241                     StateChangedSignal().Disconnect(_stateChangedCallback);
242                 }
243             }
244         }
245
246         private bool OnStateChanged(IntPtr data)
247         {
248             if (_stateChangedEventHandler != null)
249             {
250                 return _stateChangedEventHandler(this, null);
251             }
252             return false;
253         }
254
255
256
257         internal static Button GetButtonFromPtr(global::System.IntPtr cPtr)
258         {
259             Button ret = new Button(cPtr, false);
260             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261             return ret;
262         }
263
264         /// <summary>
265         /// Gets/Sets the unselected button foreground/icon visual
266         /// </summary>
267         public Tizen.NUI.PropertyMap UnselectedVisual
268         {
269             get
270             {
271                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
272                 GetProperty(Button.Property.UNSELECTED_VISUAL).Get(temp);
273                 return temp;
274             }
275             set
276             {
277                 SetProperty(Button.Property.UNSELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
278             }
279         }
280
281         /// <summary>
282         /// Gets/Sets the selected button foreground/icon visual
283         /// </summary>
284         public Tizen.NUI.PropertyMap SelectedVisual
285         {
286             get
287             {
288                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
289                 GetProperty(Button.Property.SELECTED_VISUAL).Get(temp);
290                 return temp;
291             }
292             set
293             {
294                 SetProperty(Button.Property.SELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
295             }
296         }
297
298         /// <summary>
299         /// Gets/Sets the disabled selected state foreground/icon button visual
300         /// </summary>
301         public Tizen.NUI.PropertyMap DisabledSelectedVisual
302         {
303             get
304             {
305                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
306                 GetProperty(Button.Property.DISABLED_SELECTED_VISUAL).Get(temp);
307                 return temp;
308             }
309             set
310             {
311                 SetProperty(Button.Property.DISABLED_SELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
312             }
313         }
314
315         /// <summary>
316         /// Gets/Sets the disabled unselected state foreground/icon visual
317         /// </summary>
318         public Tizen.NUI.PropertyMap DisabledUnselectedVisual
319         {
320             get
321             {
322                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
323                 GetProperty(Button.Property.DISABLED_UNSELECTED_VISUAL).Get(temp);
324                 return temp;
325             }
326             set
327             {
328                 SetProperty(Button.Property.DISABLED_UNSELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
329             }
330         }
331
332         /// <summary>
333         /// Gets/Sets the disabled in the unselected state background, button visual
334         /// </summary>
335         public Tizen.NUI.PropertyMap UnselectedBackgroundVisual
336         {
337             get
338             {
339                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
340                 GetProperty(Button.Property.UNSELECTED_BACKGROUND_VISUAL).Get(temp);
341                 return temp;
342             }
343             set
344             {
345                 SetProperty(Button.Property.UNSELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
346             }
347         }
348
349         /// <summary>
350         /// Gets/Sets the selected background button visual
351         /// </summary>
352         public Tizen.NUI.PropertyMap SelectedBackgroundVisual
353         {
354             get
355             {
356                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
357                 GetProperty(Button.Property.SELECTED_BACKGROUND_VISUAL).Get(temp);
358                 return temp;
359             }
360             set
361             {
362                 SetProperty(Button.Property.SELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
363             }
364         }
365
366         /// <summary>
367         /// Gets/Sets the disabled while unselected background button visual
368         /// </summary>
369         public Tizen.NUI.PropertyMap DisabledUnselectedBackgroundVisual
370         {
371             get
372             {
373                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
374                 GetProperty(Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL).Get(temp);
375                 return temp;
376             }
377             set
378             {
379                 SetProperty(Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
380             }
381         }
382
383         /// <summary>
384         /// Gets/Sets the disabled while selected background button visual
385         /// </summary>
386         public Tizen.NUI.PropertyMap DisabledSelectedBackgroundVisual
387         {
388             get
389             {
390                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
391                 GetProperty(Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL).Get(temp);
392                 return temp;
393             }
394             set
395             {
396                 SetProperty(Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
397             }
398         }
399
400         /// <summary>
401         /// Gets/Sets the position of the the label in relation to the foreground/icon if both present
402         /// </summary>
403         public Align LabelRelativeAlignment
404         {
405             get
406             {
407                 string temp;
408                 if (GetProperty(Button.Property.LABEL_RELATIVE_ALIGNMENT).Get(out temp) == false)
409                 {
410                     //Tizen.Log.Error("NUI", "LabelRelativeAlignment get error!");
411                 }
412                 switch (temp)
413                 {
414                     case "BEGIN":
415                         return Align.Begin;
416                     case "END":
417                         return Align.End;
418                     case "TOP":
419                         return Align.Top;
420                     case "BOTTOM":
421                         return Align.Bottom;
422                     default:
423                         return Align.End;
424                 }
425             }
426             set
427             {
428                 string valueToString = "";
429                 switch (value)
430                 {
431                     case Align.Begin:
432                     {
433                         valueToString = "BEGIN";
434                         break;
435                     }
436                     case Align.End:
437                     {
438                         valueToString = "END";
439                         break;
440                     }
441                     case Align.Top:
442                     {
443                         valueToString = "TOP";
444                         break;
445                     }
446                     case Align.Bottom:
447                     {
448                         valueToString = "BOTTOM";
449                         break;
450                     }
451                     default:
452                     {
453                         valueToString = "END";
454                         break;
455                     }
456                 }
457                 SetProperty(Button.Property.LABEL_RELATIVE_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
458             }
459         }
460
461         /// <summary>
462         /// Gets/Sets the padding around the text
463         /// </summary>
464         public Vector4 LabelPadding
465         {
466             get
467             {
468                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
469                 GetProperty(Button.Property.LABEL_PADDING).Get(temp);
470                 return temp;
471             }
472             set
473             {
474                 SetProperty(Button.Property.LABEL_PADDING, new Tizen.NUI.PropertyValue(value));
475             }
476         }
477
478         /// <summary>
479         /// Gets/Sets the padding around the foreground visual
480         /// </summary>
481         public Vector4 VisualPadding
482         {
483             get
484             {
485                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
486                 GetProperty(Button.Property.VISUAL_PADDING).Get(temp);
487                 return temp;
488             }
489             set
490             {
491                 SetProperty(Button.Property.VISUAL_PADDING, new Tizen.NUI.PropertyValue(value));
492             }
493         }
494
495         internal class Property : global::System.IDisposable
496         {
497             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
498             protected bool swigCMemOwn;
499
500             internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
501             {
502                 swigCMemOwn = cMemoryOwn;
503                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
504             }
505
506             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
507             {
508                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
509             }
510
511             ~Property()
512             {
513                 Dispose();
514             }
515
516             public virtual void Dispose()
517             {
518                 lock (this)
519                 {
520                     if (swigCPtr.Handle != global::System.IntPtr.Zero)
521                     {
522                         if (swigCMemOwn)
523                         {
524                             swigCMemOwn = false;
525                             NDalicPINVOKE.delete_Button_Property(swigCPtr);
526                         }
527                         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
528                     }
529                     global::System.GC.SuppressFinalize(this);
530                 }
531             }
532
533             internal static readonly int UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_VISUAL_get();
534             internal static readonly int SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_VISUAL_get();
535             internal static readonly int DISABLED_SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_VISUAL_get();
536             internal static readonly int DISABLED_UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_VISUAL_get();
537             internal static readonly int UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_BACKGROUND_VISUAL_get();
538             internal static readonly int SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_BACKGROUND_VISUAL_get();
539             internal static readonly int DISABLED_UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get();
540             internal static readonly int DISABLED_SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get();
541             internal static readonly int LABEL_RELATIVE_ALIGNMENT = NDalicManualPINVOKE.Button_Property_LABEL_RELATIVE_ALIGNMENT_get();
542             internal static readonly int LABEL_PADDING = NDalicManualPINVOKE.Button_Property_LABEL_PADDING_get();
543             internal static readonly int VISUAL_PADDING = NDalicManualPINVOKE.Button_Property_VISUAL_PADDING_get();
544             //changed
545             internal Property() : this(NDalicPINVOKE.new_Button_Property(), true)
546             {
547                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
548             }
549
550             internal static readonly int DISABLED = NDalicPINVOKE.Button_Property_DISABLED_get();
551             internal static readonly int AUTO_REPEATING = NDalicPINVOKE.Button_Property_AUTO_REPEATING_get();
552             internal static readonly int INITIAL_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_INITIAL_AUTO_REPEATING_DELAY_get();
553             internal static readonly int NEXT_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_NEXT_AUTO_REPEATING_DELAY_get();
554             internal static readonly int TOGGLABLE = NDalicPINVOKE.Button_Property_TOGGLABLE_get();
555             internal static readonly int SELECTED = NDalicPINVOKE.Button_Property_SELECTED_get();
556             internal static readonly int UNSELECTED_STATE_IMAGE = NDalicPINVOKE.Button_Property_UNSELECTED_STATE_IMAGE_get();
557             internal static readonly int SELECTED_STATE_IMAGE = NDalicPINVOKE.Button_Property_SELECTED_STATE_IMAGE_get();
558             internal static readonly int DISABLED_STATE_IMAGE = NDalicPINVOKE.Button_Property_DISABLED_STATE_IMAGE_get();
559             internal static readonly int UNSELECTED_COLOR = NDalicPINVOKE.Button_Property_UNSELECTED_COLOR_get();
560             internal static readonly int SELECTED_COLOR = NDalicPINVOKE.Button_Property_SELECTED_COLOR_get();
561             internal static readonly int LABEL = NDalicPINVOKE.Button_Property_LABEL_get();
562             internal static readonly int LABEL_TEXT = NDalicPINVOKE.Button_Property_LABEL_TEXT_get();
563
564         }
565
566         /// <summary>
567         /// Creates an uninitialized Button.<br>
568         /// Only derived versions can be instantiated.<br>
569         /// </summary>
570         public Button() : this(NDalicPINVOKE.new_Button__SWIG_0(), true)
571         {
572             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
573         }
574
575         internal Button(Button button) : this(NDalicPINVOKE.new_Button__SWIG_1(Button.getCPtr(button)), true)
576         {
577             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
578         }
579
580         internal Button Assign(Button button)
581         {
582             Button ret = new Button(NDalicPINVOKE.Button_Assign(swigCPtr, Button.getCPtr(button)), false);
583             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
584             return ret;
585         }
586
587         /// <summary>
588         /// Downcasts a handle to Button handle.<br>
589         /// If handle points to a Button, the downcast produces valid handle.<br>
590         /// If not the returned handle is left uninitialized.<br>
591         /// </summary>
592         /// <param name="handle">Handle to an object</param>
593         /// <returns>A handle to a Button or an uninitialized handle</returns>
594         public new static Button DownCast(BaseHandle handle)
595         {
596             Button ret = new Button(NDalicPINVOKE.Button_DownCast(BaseHandle.getCPtr(handle)), true);
597             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
598             return ret;
599         }
600
601         internal bool IsDisabled()
602         {
603             bool ret = NDalicPINVOKE.Button_IsDisabled(swigCPtr);
604             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
605             return ret;
606         }
607
608         internal bool IsAutoRepeating()
609         {
610             bool ret = NDalicPINVOKE.Button_IsAutoRepeating(swigCPtr);
611             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
612             return ret;
613         }
614
615         internal float GetInitialAutoRepeatingDelay()
616         {
617             float ret = NDalicPINVOKE.Button_GetInitialAutoRepeatingDelay(swigCPtr);
618             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619             return ret;
620         }
621
622         internal float GetNextAutoRepeatingDelay()
623         {
624             float ret = NDalicPINVOKE.Button_GetNextAutoRepeatingDelay(swigCPtr);
625             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
626             return ret;
627         }
628
629         internal bool IsTogglableButton()
630         {
631             bool ret = NDalicPINVOKE.Button_IsTogglableButton(swigCPtr);
632             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
633             return ret;
634         }
635
636         internal bool IsSelected()
637         {
638             bool ret = NDalicPINVOKE.Button_IsSelected(swigCPtr);
639             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640             return ret;
641         }
642
643         /// <summary>
644         /// Retrieves button's animation time.
645         /// </summary>
646         /// <returns></returns>
647         public float GetAnimationTime()
648         {
649             float ret = NDalicPINVOKE.Button_GetAnimationTime(swigCPtr);
650             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
651             return ret;
652         }
653
654         internal string GetLabelText()
655         {
656             string ret = NDalicPINVOKE.Button_GetLabelText(swigCPtr);
657             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658             return ret;
659         }
660
661         internal void SetLabel(Actor label)
662         {
663             NDalicPINVOKE.Button_SetLabel(swigCPtr, Actor.getCPtr(label));
664             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
665         }
666
667         internal void SetButtonImage(Image image)
668         {
669             NDalicPINVOKE.Button_SetButtonImage(swigCPtr, Image.getCPtr(image));
670             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
671         }
672
673         internal void SetSelectedImage(Image image)
674         {
675             NDalicPINVOKE.Button_SetSelectedImage(swigCPtr, Image.getCPtr(image));
676             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
677         }
678
679         internal Actor GetButtonImage()
680         {
681             Actor ret = new Actor(NDalicPINVOKE.Button_GetButtonImage(swigCPtr), true);
682             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
683             return ret;
684         }
685
686         internal Actor GetSelectedImage()
687         {
688             Actor ret = new Actor(NDalicPINVOKE.Button_GetSelectedImage(swigCPtr), true);
689             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
690             return ret;
691         }
692
693         internal ButtonSignal PressedSignal()
694         {
695             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_PressedSignal(swigCPtr), false);
696             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
697             return ret;
698         }
699
700         internal ButtonSignal ReleasedSignal()
701         {
702             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ReleasedSignal(swigCPtr), false);
703             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
704             return ret;
705         }
706
707         internal ButtonSignal ClickedSignal()
708         {
709             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ClickedSignal(swigCPtr), false);
710             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
711             return ret;
712         }
713
714         internal ButtonSignal StateChangedSignal()
715         {
716             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_StateChangedSignal(swigCPtr), false);
717             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
718             return ret;
719         }
720
721         internal enum PropertyRange
722         {
723             PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
724             PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
725         }
726
727         /// <summary>
728         /// Gets/Sets the button as disabled.
729         /// </summary>
730         public bool Disabled
731         {
732             get
733             {
734                 bool temp = false;
735                 GetProperty(Button.Property.DISABLED).Get(ref temp);
736                 return temp;
737             }
738             set
739             {
740                 SetProperty(Button.Property.DISABLED, new Tizen.NUI.PropertyValue(value));
741             }
742         }
743
744         /// <summary>
745         /// If the autorepeating property is set to true then the togglable property is set to false.
746         /// </summary>
747         public bool AutoRepeating
748         {
749             get
750             {
751                 bool temp = false;
752                 GetProperty(Button.Property.AUTO_REPEATING).Get(ref temp);
753                 return temp;
754             }
755             set
756             {
757                 SetProperty(Button.Property.AUTO_REPEATING, new Tizen.NUI.PropertyValue(value));
758             }
759         }
760
761         /// <summary>
762         /// By default this value is set to 0.15 seconds.
763         /// </summary>
764         public float InitialAutoRepeatingDelay
765         {
766             get
767             {
768                 float temp = 0.0f;
769                 GetProperty(Button.Property.INITIAL_AUTO_REPEATING_DELAY).Get(ref temp);
770                 return temp;
771             }
772             set
773             {
774                 SetProperty(Button.Property.INITIAL_AUTO_REPEATING_DELAY, new Tizen.NUI.PropertyValue(value));
775             }
776         }
777
778         /// <summary>
779         /// default this value is set to 0.05 seconds.
780         /// </summary>
781         public float NextAutoRepeatingDelay
782         {
783             get
784             {
785                 float temp = 0.0f;
786                 GetProperty(Button.Property.NEXT_AUTO_REPEATING_DELAY).Get(ref temp);
787                 return temp;
788             }
789             set
790             {
791                 SetProperty(Button.Property.NEXT_AUTO_REPEATING_DELAY, new Tizen.NUI.PropertyValue(value));
792             }
793         }
794
795         /// <summary>
796         /// If the togglable property is set to true, then the autorepeating property is set to false.
797         /// </summary>
798         public bool Togglable
799         {
800             get
801             {
802                 bool temp = false;
803                 GetProperty(Button.Property.TOGGLABLE).Get(ref temp);
804                 return temp;
805             }
806             set
807             {
808                 SetProperty(Button.Property.TOGGLABLE, new Tizen.NUI.PropertyValue(value));
809             }
810         }
811
812         /// <summary>
813         /// /Gets/Sets the togglable button as either selected or unselected, togglable property must be set to true.
814         /// </summary>
815         public bool Selected
816         {
817             get
818             {
819                 bool temp = false;
820                 GetProperty(Button.Property.SELECTED).Get(ref temp);
821                 return temp;
822             }
823             set
824             {
825                 SetProperty(Button.Property.SELECTED, new Tizen.NUI.PropertyValue(value));
826             }
827         }
828
829         /// <summary>
830         /// Gets/Sets the unselected button foreground image.
831         /// </summary>
832         public Tizen.NUI.PropertyMap UnselectedStateImage
833         {
834             get
835             {
836                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
837                 GetProperty(Button.Property.UNSELECTED_STATE_IMAGE).Get(temp);
838                 return temp;
839             }
840             set
841             {
842                 SetProperty(Button.Property.UNSELECTED_STATE_IMAGE, new Tizen.NUI.PropertyValue(value));
843             }
844         }
845
846         /// <summary>
847         /// Gets/Sets the selected button foreground image.
848         /// </summary>
849         public Tizen.NUI.PropertyMap SelectedStateImage
850         {
851             get
852             {
853                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
854                 GetProperty(Button.Property.SELECTED_STATE_IMAGE).Get(temp);
855                 return temp;
856             }
857             set
858             {
859                 SetProperty(Button.Property.SELECTED_STATE_IMAGE, new Tizen.NUI.PropertyValue(value));
860             }
861         }
862
863         /// <summary>
864         /// Gets/Sets the disabled whilst unselected foreground button visual.
865         /// </summary>
866         public Tizen.NUI.PropertyMap DisabledStateImage
867         {
868             get
869             {
870                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
871                 GetProperty(Button.Property.DISABLED_STATE_IMAGE).Get(temp);
872                 return temp;
873             }
874             set
875             {
876                 SetProperty(Button.Property.DISABLED_STATE_IMAGE, new Tizen.NUI.PropertyValue(value));
877             }
878         }
879
880         /// <summary>
881         /// Gets/Sets unselected color.
882         /// </summary>
883         public Color UnselectedColor
884         {
885             get
886             {
887                 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
888                 GetProperty(Button.Property.UNSELECTED_COLOR).Get(temp);
889                 return temp;
890             }
891             set
892             {
893                 SetProperty(Button.Property.UNSELECTED_COLOR, new Tizen.NUI.PropertyValue(value));
894             }
895         }
896
897         /// <summary>
898         /// Gets/Sets selected color.
899         /// </summary>
900         public Color SelectedColor
901         {
902             get
903             {
904                 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
905                 GetProperty(Button.Property.SELECTED_COLOR).Get(temp);
906                 return temp;
907             }
908             set
909             {
910                 SetProperty(Button.Property.SELECTED_COLOR, new Tizen.NUI.PropertyValue(value));
911             }
912         }
913
914         /// <summary>
915         /// Gets/Sets label.
916         /// </summary>
917         public Tizen.NUI.PropertyMap Label
918         {
919             get
920             {
921                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
922                 GetProperty(Button.Property.LABEL).Get(temp);
923                 return temp;
924             }
925             set
926             {
927                 SetProperty(Button.Property.LABEL, new Tizen.NUI.PropertyValue(value));
928             }
929         }
930
931         /// <summary>
932         /// Gets/Sets text of label.
933         /// </summary>
934         public string LabelText
935         {
936             get
937             {
938                 string temp;
939                 GetProperty(Button.Property.LABEL_TEXT).Get(out temp);
940                 return temp;
941             }
942             set
943             {
944                 SetProperty(Button.Property.LABEL_TEXT, new Tizen.NUI.PropertyValue(value));
945             }
946         }
947
948         /// <summary>
949         /// Enumeration for describing the position the text label can be in relation to the control(and foreground/icon).
950         /// </summary>
951         public enum Align
952         {
953             /// <summary>
954             /// At the start of the control before the foreground/icon
955             /// </summary>
956             Begin,
957             /// <summary>
958             /// At the end of the control after the foreground/icon
959             /// </summary>
960             End,
961             /// <summary>
962             /// At the top of the control above the foreground/icon
963             /// </summary>
964             Top,
965             /// <summary>
966             /// At the bottom of the control below the foreground/icon
967             /// </summary>
968             Bottom
969         }
970
971     }
972
973 }