Release 4.0.0-preview1-00235
[platform/core/csapi/tizenfx.git] / src / 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     using Tizen.NUI.BaseComponents;
25
26     /// <summary>
27     /// The Button class is a base class for different kinds of buttons.<br>
28     /// This class provides the disabled property and the clicked signal.<br>
29     /// The clicked event handler is emitted when the button is touched, and the touch point doesn't leave the boundary of the button.<br>
30     /// When the disabled property is set to true, no signal is emitted.<br>
31     /// The 'Visual' describes not just traditional images like PNG and BMP, but also refers to whatever is used to show the button. It could be a color, gradient, or some other kind of renderer.<br>
32     /// The button's appearance can be modified by setting properties for the various visuals or images.<br>
33     /// It is not mandatory to set all the visuals. A button could be defined only by setting its background visual, or by setting its background and selected visuals.<br>
34     /// The button visual is shown over the background visual.<br>
35     /// When pressed, the unselected visuals are replaced by the selected visuals.<br>
36     /// The text label is always placed on the top of all images.<br>
37     /// When the button is disabled, the background button and the selected visuals are replaced by their disabled visuals.<br>
38     /// </summary>
39     public class Button : View
40     {
41         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
42
43         internal Button(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Button_SWIGUpcast(cPtr), cMemoryOwn)
44         {
45             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
46         }
47
48         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Button obj)
49         {
50             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
51         }
52
53         /// <summary>
54         /// To dispose the button instance.
55         /// </summary>
56         protected override void Dispose(DisposeTypes type)
57         {
58             if (disposed)
59             {
60                 return;
61             }
62
63             if (type == DisposeTypes.Explicit)
64             {
65                 //Called by User
66                 //Release your own managed resources here.
67                 //You should release all of your own disposable objects here.
68
69             }
70
71             //Release your own unmanaged resources here.
72             //You should not access any managed member here except static instance.
73             //because the execution order of Finalizes is non-deterministic.
74
75             DisConnectFromSignals();
76
77             if (swigCPtr.Handle != global::System.IntPtr.Zero)
78             {
79                 if (swigCMemOwn)
80                 {
81                     swigCMemOwn = false;
82                     NDalicPINVOKE.delete_Button(swigCPtr);
83                 }
84                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
85             }
86
87             base.Dispose(type);
88         }
89
90         private void DisConnectFromSignals()
91         {
92             // Save current CPtr.
93             global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr;
94
95             // Use BaseHandle CPtr as current might have been deleted already in derived classes.
96             swigCPtr = GetBaseHandleCPtrHandleRef;
97
98             if (_stateChangedCallback != null)
99             {
100                 StateChangedSignal().Disconnect(_stateChangedCallback);
101             }
102
103             if (_releasedCallback != null)
104             {
105                 ReleasedSignal().Disconnect(_releasedCallback);
106             }
107
108             if (_pressedCallback != null)
109             {
110                 this.PressedSignal().Disconnect(_pressedCallback);
111             }
112
113             if (_clickedCallback != null)
114             {
115                 ClickedSignal().Disconnect(_clickedCallback);
116             }
117
118             // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.
119             // Restore current CPtr.
120             swigCPtr = currentCPtr;
121         }
122
123
124         private EventHandlerWithReturnType<object, EventArgs, bool> _clickedEventHandler;
125         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
126         private delegate bool ClickedCallbackType(global::System.IntPtr data);
127         private ClickedCallbackType _clickedCallback;
128
129         /// <summary>
130         /// The Clicked event will be triggered when the button is touched and the touch point doesn't leave the boundary of the button.
131         /// </summary>
132         public event EventHandlerWithReturnType<object, EventArgs, bool> Clicked
133         {
134             add
135             {
136                 if (_clickedEventHandler == null)
137                 {
138                     _clickedCallback = OnClicked;
139                     ClickedSignal().Connect(_clickedCallback);
140                 }
141
142                 _clickedEventHandler += value;
143             }
144
145             remove
146             {
147                 _clickedEventHandler -= value;
148
149                 if (_clickedEventHandler == null && ClickedSignal().Empty() == false)
150                 {
151                     ClickedSignal().Disconnect(_clickedCallback);
152                 }
153             }
154         }
155
156
157         private bool OnClicked(IntPtr data)
158         {
159             if (_clickedEventHandler != null)
160             {
161                 return _clickedEventHandler(this, null);
162             }
163             return false;
164         }
165
166
167
168         private EventHandlerWithReturnType<object, EventArgs, bool> _pressedEventHandler;
169         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
170         private delegate bool PressedCallbackType(global::System.IntPtr data);
171         private PressedCallbackType _pressedCallback;
172
173         /// <summary>
174         /// The Pressed event will be triggered when the button is touched.
175         /// </summary>
176         public event EventHandlerWithReturnType<object, EventArgs, bool> Pressed
177         {
178             add
179             {
180                 if (_pressedEventHandler == null)
181                 {
182                     _pressedCallback = OnPressed;
183                     PressedSignal().Connect(_pressedCallback);
184                 }
185
186                 _pressedEventHandler += value;
187             }
188
189             remove
190             {
191                 _pressedEventHandler -= value;
192
193                 if (_pressedEventHandler == null && PressedSignal().Empty() == false)
194                 {
195                     this.PressedSignal().Disconnect(_pressedCallback);
196                 }
197             }
198         }
199
200         private bool OnPressed(IntPtr data)
201         {
202             if (_pressedEventHandler != null)
203             {
204                 return _pressedEventHandler(this, null);
205             }
206             return false;
207         }
208
209
210
211         private EventHandlerWithReturnType<object, EventArgs, bool> _releasedEventHandler;
212         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
213         private delegate bool ReleasedCallbackType(global::System.IntPtr data);
214         private ReleasedCallbackType _releasedCallback;
215
216         /// <summary>
217         /// The Released event will be triggered when the button is touched and the touch point leaves the boundary of the button.
218         /// </summary>
219         public event EventHandlerWithReturnType<object, EventArgs, bool> Released
220         {
221             add
222             {
223                 if (_releasedEventHandler == null)
224                 {
225                     _releasedCallback = OnReleased;
226                     ReleasedSignal().Connect(_releasedCallback);
227                 }
228                 _releasedEventHandler += value;
229             }
230
231             remove
232             {
233                 _releasedEventHandler -= value;
234
235                 if (_releasedEventHandler == null && ReleasedSignal().Empty() == false)
236                 {
237                     ReleasedSignal().Disconnect(_releasedCallback);
238                 }
239
240             }
241         }
242
243         private bool OnReleased(IntPtr data)
244         {
245             if (_releasedEventHandler != null)
246             {
247                 return _releasedEventHandler(this, null);
248             }
249             return false;
250         }
251
252
253         private EventHandlerWithReturnType<object, EventArgs, bool> _stateChangedEventHandler;
254         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
255         private delegate bool StateChangedCallback(global::System.IntPtr data);
256         private StateChangedCallback _stateChangedCallback;
257
258         /// <summary>
259         /// The StateChanged event will be triggered when the button's state is changed.
260         /// </summary>
261         public event EventHandlerWithReturnType<object, EventArgs, bool> StateChanged
262         {
263             add
264             {
265                 if (_stateChangedEventHandler == null)
266                 {
267                     _stateChangedCallback = OnStateChanged;
268                     StateChangedSignal().Connect(_stateChangedCallback);
269                 }
270
271                 _stateChangedEventHandler += value;
272             }
273
274             remove
275             {
276                 _stateChangedEventHandler -= value;
277
278                 if (_stateChangedEventHandler == null && StateChangedSignal().Empty() == false)
279                 {
280                     StateChangedSignal().Disconnect(_stateChangedCallback);
281                 }
282             }
283         }
284
285         private bool OnStateChanged(IntPtr data)
286         {
287             if (_stateChangedEventHandler != null)
288             {
289                 return _stateChangedEventHandler(this, null);
290             }
291             return false;
292         }
293
294
295         /// <summary>
296         /// Gets or sets the unselected button foreground or icon visual.
297         /// </summary>
298         public Tizen.NUI.PropertyMap UnselectedVisual
299         {
300             get
301             {
302                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
303                 GetProperty(Button.Property.UNSELECTED_VISUAL).Get(temp);
304                 return temp;
305             }
306             set
307             {
308                 SetProperty(Button.Property.UNSELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
309             }
310         }
311
312         /// <summary>
313         /// Gets or sets the selected button foreground or icon visual.
314         /// </summary>
315         public Tizen.NUI.PropertyMap SelectedVisual
316         {
317             get
318             {
319                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
320                 GetProperty(Button.Property.SELECTED_VISUAL).Get(temp);
321                 return temp;
322             }
323             set
324             {
325                 SetProperty(Button.Property.SELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
326             }
327         }
328
329         /// <summary>
330         /// Gets or sets the disabled selected state foreground or icon button visual.
331         /// </summary>
332         public Tizen.NUI.PropertyMap DisabledSelectedVisual
333         {
334             get
335             {
336                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
337                 GetProperty(Button.Property.DISABLED_SELECTED_VISUAL).Get(temp);
338                 return temp;
339             }
340             set
341             {
342                 SetProperty(Button.Property.DISABLED_SELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
343             }
344         }
345
346         /// <summary>
347         /// Gets or sets the disabled unselected state foreground or icon visual.
348         /// </summary>
349         public Tizen.NUI.PropertyMap DisabledUnselectedVisual
350         {
351             get
352             {
353                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
354                 GetProperty(Button.Property.DISABLED_UNSELECTED_VISUAL).Get(temp);
355                 return temp;
356             }
357             set
358             {
359                 SetProperty(Button.Property.DISABLED_UNSELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
360             }
361         }
362
363         /// <summary>
364         /// Gets or sets the disabled unselected state background button visual.
365         /// </summary>
366         public Tizen.NUI.PropertyMap UnselectedBackgroundVisual
367         {
368             get
369             {
370                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
371                 GetProperty(Button.Property.UNSELECTED_BACKGROUND_VISUAL).Get(temp);
372                 return temp;
373             }
374             set
375             {
376                 SetProperty(Button.Property.UNSELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
377             }
378         }
379
380         /// <summary>
381         /// Gets or sets the selected background button visual.
382         /// </summary>
383         public Tizen.NUI.PropertyMap SelectedBackgroundVisual
384         {
385             get
386             {
387                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
388                 GetProperty(Button.Property.SELECTED_BACKGROUND_VISUAL).Get(temp);
389                 return temp;
390             }
391             set
392             {
393                 SetProperty(Button.Property.SELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
394             }
395         }
396
397         /// <summary>
398         /// Gets or sets the disabled while unselected background button visual.
399         /// </summary>
400         public Tizen.NUI.PropertyMap DisabledUnselectedBackgroundVisual
401         {
402             get
403             {
404                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
405                 GetProperty(Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL).Get(temp);
406                 return temp;
407             }
408             set
409             {
410                 SetProperty(Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
411             }
412         }
413
414         /// <summary>
415         /// Gets or sets the disabled while selected background button visual.
416         /// </summary>
417         public Tizen.NUI.PropertyMap DisabledSelectedBackgroundVisual
418         {
419             get
420             {
421                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
422                 GetProperty(Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL).Get(temp);
423                 return temp;
424             }
425             set
426             {
427                 SetProperty(Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
428             }
429         }
430
431         /// <summary>
432         /// Gets or sets the position of the the label in relation to the foreground or icon, if both present.
433         /// </summary>
434         public Align LabelRelativeAlignment
435         {
436             get
437             {
438                 string temp;
439                 if (GetProperty(Button.Property.LABEL_RELATIVE_ALIGNMENT).Get(out temp) == false)
440                 {
441                     NUILog.Error("LabelRelativeAlignment get error!");
442                 }
443                 switch (temp)
444                 {
445                     case "BEGIN":
446                         return Align.Begin;
447                     case "END":
448                         return Align.End;
449                     case "TOP":
450                         return Align.Top;
451                     case "BOTTOM":
452                         return Align.Bottom;
453                     default:
454                         return Align.End;
455                 }
456             }
457             set
458             {
459                 string valueToString = "";
460                 switch (value)
461                 {
462                     case Align.Begin:
463                     {
464                         valueToString = "BEGIN";
465                         break;
466                     }
467                     case Align.End:
468                     {
469                         valueToString = "END";
470                         break;
471                     }
472                     case Align.Top:
473                     {
474                         valueToString = "TOP";
475                         break;
476                     }
477                     case Align.Bottom:
478                     {
479                         valueToString = "BOTTOM";
480                         break;
481                     }
482                     default:
483                     {
484                         valueToString = "END";
485                         break;
486                     }
487                 }
488                 SetProperty(Button.Property.LABEL_RELATIVE_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
489             }
490         }
491
492         /// <summary>
493         /// Gets or sets the padding around the text.
494         /// </summary>
495         public Vector4 LabelPadding
496         {
497             get
498             {
499                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
500                 GetProperty(Button.Property.LABEL_PADDING).Get(temp);
501                 return temp;
502             }
503             set
504             {
505                 SetProperty(Button.Property.LABEL_PADDING, new Tizen.NUI.PropertyValue(value));
506             }
507         }
508
509         /// <summary>
510         /// Gets or sets the padding around the foreground visual.
511         /// </summary>
512         public Vector4 ForegroundVisualPadding
513         {
514             get
515             {
516                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
517                 GetProperty(Button.Property.FOREGROUND_VISUAL_PADDING).Get(temp);
518                 return temp;
519             }
520             set
521             {
522                 SetProperty(Button.Property.FOREGROUND_VISUAL_PADDING, new Tizen.NUI.PropertyValue(value));
523             }
524         }
525
526         internal new class Property
527         {
528             internal static readonly int UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_VISUAL_get();
529             internal static readonly int SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_VISUAL_get();
530             internal static readonly int DISABLED_SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_VISUAL_get();
531             internal static readonly int DISABLED_UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_VISUAL_get();
532             internal static readonly int UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_BACKGROUND_VISUAL_get();
533             internal static readonly int SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_BACKGROUND_VISUAL_get();
534             internal static readonly int DISABLED_UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get();
535             internal static readonly int DISABLED_SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get();
536             internal static readonly int LABEL_RELATIVE_ALIGNMENT = NDalicManualPINVOKE.Button_Property_LABEL_RELATIVE_ALIGNMENT_get();
537             internal static readonly int LABEL_PADDING = NDalicManualPINVOKE.Button_Property_LABEL_PADDING_get();
538             internal static readonly int FOREGROUND_VISUAL_PADDING = NDalicManualPINVOKE.Button_Property_VISUAL_PADDING_get();
539             internal static readonly int AUTO_REPEATING = NDalicPINVOKE.Button_Property_AUTO_REPEATING_get();
540             internal static readonly int INITIAL_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_INITIAL_AUTO_REPEATING_DELAY_get();
541             internal static readonly int NEXT_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_NEXT_AUTO_REPEATING_DELAY_get();
542             internal static readonly int TOGGLABLE = NDalicPINVOKE.Button_Property_TOGGLABLE_get();
543             internal static readonly int SELECTED = NDalicPINVOKE.Button_Property_SELECTED_get();
544             internal static readonly int UNSELECTED_COLOR = NDalicPINVOKE.Button_Property_UNSELECTED_COLOR_get();
545             internal static readonly int SELECTED_COLOR = NDalicPINVOKE.Button_Property_SELECTED_COLOR_get();
546             internal static readonly int LABEL = NDalicPINVOKE.Button_Property_LABEL_get();
547         }
548
549         /// <summary>
550         /// Creates an uninitialized button.<br>
551         /// Only the derived versions can be instantiated.<br>
552         /// </summary>
553         public Button() : this(NDalicPINVOKE.new_Button__SWIG_0(), true)
554         {
555             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
556         }
557
558         internal ButtonSignal PressedSignal()
559         {
560             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_PressedSignal(swigCPtr), false);
561             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
562             return ret;
563         }
564
565         internal ButtonSignal ReleasedSignal()
566         {
567             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ReleasedSignal(swigCPtr), false);
568             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
569             return ret;
570         }
571
572         internal ButtonSignal ClickedSignal()
573         {
574             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ClickedSignal(swigCPtr), false);
575             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
576             return ret;
577         }
578
579         internal ButtonSignal StateChangedSignal()
580         {
581             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_StateChangedSignal(swigCPtr), false);
582             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
583             return ret;
584         }
585
586         /// <summary>
587         /// If the autorepeating property is set to true, then the togglable property is set to false.
588         /// </summary>
589         public bool AutoRepeating
590         {
591             get
592             {
593                 bool temp = false;
594                 GetProperty(Button.Property.AUTO_REPEATING).Get(out temp);
595                 return temp;
596             }
597             set
598             {
599                 SetProperty(Button.Property.AUTO_REPEATING, new Tizen.NUI.PropertyValue(value));
600             }
601         }
602
603         /// <summary>
604         /// By default, this value is set to 0.15 seconds.
605         /// </summary>
606         public float InitialAutoRepeatingDelay
607         {
608             get
609             {
610                 float temp = 0.0f;
611                 GetProperty(Button.Property.INITIAL_AUTO_REPEATING_DELAY).Get(out temp);
612                 return temp;
613             }
614             set
615             {
616                 SetProperty(Button.Property.INITIAL_AUTO_REPEATING_DELAY, new Tizen.NUI.PropertyValue(value));
617             }
618         }
619
620         /// <summary>
621         /// By default, this value is set to 0.05 seconds.
622         /// </summary>
623         public float NextAutoRepeatingDelay
624         {
625             get
626             {
627                 float temp = 0.0f;
628                 GetProperty(Button.Property.NEXT_AUTO_REPEATING_DELAY).Get(out temp);
629                 return temp;
630             }
631             set
632             {
633                 SetProperty(Button.Property.NEXT_AUTO_REPEATING_DELAY, new Tizen.NUI.PropertyValue(value));
634             }
635         }
636
637         /// <summary>
638         /// If the togglable property is set to true, then the autorepeating property is set to false.
639         /// </summary>
640         public bool Togglable
641         {
642             get
643             {
644                 bool temp = false;
645                 GetProperty(Button.Property.TOGGLABLE).Get(out temp);
646                 return temp;
647             }
648             set
649             {
650                 SetProperty(Button.Property.TOGGLABLE, new Tizen.NUI.PropertyValue(value));
651             }
652         }
653
654         /// <summary>
655         /// Gets or sets the togglable button as either selected or unselected, togglable property must be set to true.
656         /// </summary>
657         public bool Selected
658         {
659             get
660             {
661                 bool temp = false;
662                 GetProperty(Button.Property.SELECTED).Get(out temp);
663                 return temp;
664             }
665             set
666             {
667                 SetProperty(Button.Property.SELECTED, new Tizen.NUI.PropertyValue(value));
668             }
669         }
670
671         /// <summary>
672         /// Gets or sets the unselected color.
673         /// </summary>
674         public Color UnselectedColor
675         {
676             get
677             {
678                 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
679                 GetProperty(Button.Property.UNSELECTED_COLOR).Get(temp);
680                 return temp;
681             }
682             set
683             {
684                 SetProperty(Button.Property.UNSELECTED_COLOR, new Tizen.NUI.PropertyValue(value));
685             }
686         }
687
688         /// <summary>
689         /// Gets or sets the selected color.
690         /// </summary>
691         public Color SelectedColor
692         {
693             get
694             {
695                 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
696                 GetProperty(Button.Property.SELECTED_COLOR).Get(temp);
697                 return temp;
698             }
699             set
700             {
701                 SetProperty(Button.Property.SELECTED_COLOR, new Tizen.NUI.PropertyValue(value));
702             }
703         }
704
705         /// <summary>
706         /// Gets or sets the label.
707         /// </summary>
708         public Tizen.NUI.PropertyMap Label
709         {
710             get
711             {
712                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
713                 GetProperty(Button.Property.LABEL).Get(temp);
714                 return temp;
715             }
716             set
717             {
718                 SetProperty(Button.Property.LABEL, new Tizen.NUI.PropertyValue(value));
719             }
720         }
721
722         /// <summary>
723         /// Gets or sets the text of the label.
724         /// </summary>
725         public string LabelText
726         {
727             get
728             {
729                 Tizen.NUI.PropertyMap map = new Tizen.NUI.PropertyMap();
730                 GetProperty( Button.Property.LABEL).Get(map);
731                 Tizen.NUI.PropertyValue value = map.Find( TextVisualProperty.Text, "Text");
732                 string str;
733                 value.Get(out str);
734                 return str;
735             }
736             set
737             {
738                 SetProperty( Button.Property.LABEL, new Tizen.NUI.PropertyValue( value ) );
739             }
740         }
741
742         /// <summary>
743         /// Enumeration for describing the position, the text label can be, in relation to the control (and foreground/icon).
744         /// </summary>
745         public enum Align
746         {
747             /// <summary>
748             /// At the start of the control before the foreground or icon.
749             /// </summary>
750             Begin,
751             /// <summary>
752             /// At the end of the control after the foreground or icon.
753             /// </summary>
754             End,
755             /// <summary>
756             /// At the top of the control above the foreground or icon.
757             /// </summary>
758             Top,
759             /// <summary>
760             /// At the bottom of the control below the foreground or icon.
761             /// </summary>
762             Bottom
763         }
764
765     }
766
767 }