9d57bed8c64c222b877524462f962cbbe0ee233a
[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         /// <since_tizen> 3 </since_tizen>
133         public event EventHandlerWithReturnType<object, EventArgs, bool> Clicked
134         {
135             add
136             {
137                 if (_clickedEventHandler == null)
138                 {
139                     _clickedCallback = OnClicked;
140                     ClickedSignal().Connect(_clickedCallback);
141                 }
142
143                 _clickedEventHandler += value;
144             }
145
146             remove
147             {
148                 _clickedEventHandler -= value;
149
150                 if (_clickedEventHandler == null && ClickedSignal().Empty() == false)
151                 {
152                     ClickedSignal().Disconnect(_clickedCallback);
153                 }
154             }
155         }
156
157
158         private bool OnClicked(IntPtr data)
159         {
160             if (_clickedEventHandler != null)
161             {
162                 return _clickedEventHandler(this, null);
163             }
164             return false;
165         }
166
167
168
169         private EventHandlerWithReturnType<object, EventArgs, bool> _pressedEventHandler;
170         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
171         private delegate bool PressedCallbackType(global::System.IntPtr data);
172         private PressedCallbackType _pressedCallback;
173
174         /// <summary>
175         /// The Pressed event will be triggered when the button is touched.
176         /// </summary>
177         /// <since_tizen> 3 </since_tizen>
178         public event EventHandlerWithReturnType<object, EventArgs, bool> Pressed
179         {
180             add
181             {
182                 if (_pressedEventHandler == null)
183                 {
184                     _pressedCallback = OnPressed;
185                     PressedSignal().Connect(_pressedCallback);
186                 }
187
188                 _pressedEventHandler += value;
189             }
190
191             remove
192             {
193                 _pressedEventHandler -= value;
194
195                 if (_pressedEventHandler == null && PressedSignal().Empty() == false)
196                 {
197                     this.PressedSignal().Disconnect(_pressedCallback);
198                 }
199             }
200         }
201
202         private bool OnPressed(IntPtr data)
203         {
204             if (_pressedEventHandler != null)
205             {
206                 return _pressedEventHandler(this, null);
207             }
208             return false;
209         }
210
211
212
213         private EventHandlerWithReturnType<object, EventArgs, bool> _releasedEventHandler;
214         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
215         private delegate bool ReleasedCallbackType(global::System.IntPtr data);
216         private ReleasedCallbackType _releasedCallback;
217
218         /// <summary>
219         /// The Released event will be triggered when the button is touched and the touch point leaves the boundary of the button.
220         /// </summary>
221         /// <since_tizen> 3 </since_tizen>
222         public event EventHandlerWithReturnType<object, EventArgs, bool> Released
223         {
224             add
225             {
226                 if (_releasedEventHandler == null)
227                 {
228                     _releasedCallback = OnReleased;
229                     ReleasedSignal().Connect(_releasedCallback);
230                 }
231                 _releasedEventHandler += value;
232             }
233
234             remove
235             {
236                 _releasedEventHandler -= value;
237
238                 if (_releasedEventHandler == null && ReleasedSignal().Empty() == false)
239                 {
240                     ReleasedSignal().Disconnect(_releasedCallback);
241                 }
242
243             }
244         }
245
246         private bool OnReleased(IntPtr data)
247         {
248             if (_releasedEventHandler != null)
249             {
250                 return _releasedEventHandler(this, null);
251             }
252             return false;
253         }
254
255
256         private EventHandlerWithReturnType<object, EventArgs, bool> _stateChangedEventHandler;
257         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
258         private delegate bool StateChangedCallback(global::System.IntPtr data);
259         private StateChangedCallback _stateChangedCallback;
260
261         /// <summary>
262         /// The StateChanged event will be triggered when the button's state is changed.
263         /// </summary>
264         /// <since_tizen> 3 </since_tizen>
265         public event EventHandlerWithReturnType<object, EventArgs, bool> StateChanged
266         {
267             add
268             {
269                 if (_stateChangedEventHandler == null)
270                 {
271                     _stateChangedCallback = OnStateChanged;
272                     StateChangedSignal().Connect(_stateChangedCallback);
273                 }
274
275                 _stateChangedEventHandler += value;
276             }
277
278             remove
279             {
280                 _stateChangedEventHandler -= value;
281
282                 if (_stateChangedEventHandler == null && StateChangedSignal().Empty() == false)
283                 {
284                     StateChangedSignal().Disconnect(_stateChangedCallback);
285                 }
286             }
287         }
288
289         private bool OnStateChanged(IntPtr data)
290         {
291             if (_stateChangedEventHandler != null)
292             {
293                 return _stateChangedEventHandler(this, null);
294             }
295             return false;
296         }
297
298
299         /// <summary>
300         /// Gets or sets the unselected button foreground or icon visual.
301         /// </summary>
302         /// <since_tizen> 3 </since_tizen>
303         public Tizen.NUI.PropertyMap UnselectedVisual
304         {
305             get
306             {
307                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
308                 GetProperty(Button.Property.UNSELECTED_VISUAL).Get(temp);
309                 return temp;
310             }
311             set
312             {
313                 SetProperty(Button.Property.UNSELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
314             }
315         }
316
317         /// <summary>
318         /// Gets or sets the selected button foreground or icon visual.
319         /// </summary>
320         /// <since_tizen> 3 </since_tizen>
321         public Tizen.NUI.PropertyMap SelectedVisual
322         {
323             get
324             {
325                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
326                 GetProperty(Button.Property.SELECTED_VISUAL).Get(temp);
327                 return temp;
328             }
329             set
330             {
331                 SetProperty(Button.Property.SELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
332             }
333         }
334
335         /// <summary>
336         /// Gets or sets the disabled selected state foreground or icon button visual.
337         /// </summary>
338         /// <since_tizen> 3 </since_tizen>
339         public Tizen.NUI.PropertyMap DisabledSelectedVisual
340         {
341             get
342             {
343                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
344                 GetProperty(Button.Property.DISABLED_SELECTED_VISUAL).Get(temp);
345                 return temp;
346             }
347             set
348             {
349                 SetProperty(Button.Property.DISABLED_SELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
350             }
351         }
352
353         /// <summary>
354         /// Gets or sets the disabled unselected state foreground or icon visual.
355         /// </summary>
356         /// <since_tizen> 3 </since_tizen>
357         public Tizen.NUI.PropertyMap DisabledUnselectedVisual
358         {
359             get
360             {
361                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
362                 GetProperty(Button.Property.DISABLED_UNSELECTED_VISUAL).Get(temp);
363                 return temp;
364             }
365             set
366             {
367                 SetProperty(Button.Property.DISABLED_UNSELECTED_VISUAL, new Tizen.NUI.PropertyValue(value));
368             }
369         }
370
371         /// <summary>
372         /// Gets or sets the disabled unselected state background button visual.
373         /// </summary>
374         /// <since_tizen> 3 </since_tizen>
375         public Tizen.NUI.PropertyMap UnselectedBackgroundVisual
376         {
377             get
378             {
379                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
380                 GetProperty(Button.Property.UNSELECTED_BACKGROUND_VISUAL).Get(temp);
381                 return temp;
382             }
383             set
384             {
385                 SetProperty(Button.Property.UNSELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
386             }
387         }
388
389         /// <summary>
390         /// Gets or sets the selected background button visual.
391         /// </summary>
392         /// <since_tizen> 3 </since_tizen>
393         public Tizen.NUI.PropertyMap SelectedBackgroundVisual
394         {
395             get
396             {
397                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
398                 GetProperty(Button.Property.SELECTED_BACKGROUND_VISUAL).Get(temp);
399                 return temp;
400             }
401             set
402             {
403                 SetProperty(Button.Property.SELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
404             }
405         }
406
407         /// <summary>
408         /// Gets or sets the disabled while unselected background button visual.
409         /// </summary>
410         /// <since_tizen> 3 </since_tizen>
411         public Tizen.NUI.PropertyMap DisabledUnselectedBackgroundVisual
412         {
413             get
414             {
415                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
416                 GetProperty(Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL).Get(temp);
417                 return temp;
418             }
419             set
420             {
421                 SetProperty(Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
422             }
423         }
424
425         /// <summary>
426         /// Gets or sets the disabled while selected background button visual.
427         /// </summary>
428         /// <since_tizen> 3 </since_tizen>
429         public Tizen.NUI.PropertyMap DisabledSelectedBackgroundVisual
430         {
431             get
432             {
433                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
434                 GetProperty(Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL).Get(temp);
435                 return temp;
436             }
437             set
438             {
439                 SetProperty(Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(value));
440             }
441         }
442
443         /// <summary>
444         /// Gets or sets the position of the the label in relation to the foreground or icon, if both present.
445         /// </summary>
446         /// <since_tizen> 3 </since_tizen>
447         public Align LabelRelativeAlignment
448         {
449             get
450             {
451                 string temp;
452                 if (GetProperty(Button.Property.LABEL_RELATIVE_ALIGNMENT).Get(out temp) == false)
453                 {
454                     NUILog.Error("LabelRelativeAlignment get error!");
455                 }
456                 switch (temp)
457                 {
458                     case "BEGIN":
459                         return Align.Begin;
460                     case "END":
461                         return Align.End;
462                     case "TOP":
463                         return Align.Top;
464                     case "BOTTOM":
465                         return Align.Bottom;
466                     default:
467                         return Align.End;
468                 }
469             }
470             set
471             {
472                 string valueToString = "";
473                 switch (value)
474                 {
475                     case Align.Begin:
476                     {
477                         valueToString = "BEGIN";
478                         break;
479                     }
480                     case Align.End:
481                     {
482                         valueToString = "END";
483                         break;
484                     }
485                     case Align.Top:
486                     {
487                         valueToString = "TOP";
488                         break;
489                     }
490                     case Align.Bottom:
491                     {
492                         valueToString = "BOTTOM";
493                         break;
494                     }
495                     default:
496                     {
497                         valueToString = "END";
498                         break;
499                     }
500                 }
501                 SetProperty(Button.Property.LABEL_RELATIVE_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
502             }
503         }
504
505         /// <summary>
506         /// Gets or sets the padding around the text.
507         /// </summary>
508         /// <since_tizen> 3 </since_tizen>
509         public Vector4 LabelPadding
510         {
511             get
512             {
513                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
514                 GetProperty(Button.Property.LABEL_PADDING).Get(temp);
515                 return temp;
516             }
517             set
518             {
519                 SetProperty(Button.Property.LABEL_PADDING, new Tizen.NUI.PropertyValue(value));
520             }
521         }
522
523         /// <summary>
524         /// Gets or sets the padding around the foreground visual.
525         /// </summary>
526         /// <since_tizen> 3 </since_tizen>
527         public Vector4 ForegroundVisualPadding
528         {
529             get
530             {
531                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
532                 GetProperty(Button.Property.FOREGROUND_VISUAL_PADDING).Get(temp);
533                 return temp;
534             }
535             set
536             {
537                 SetProperty(Button.Property.FOREGROUND_VISUAL_PADDING, new Tizen.NUI.PropertyValue(value));
538             }
539         }
540
541         internal new class Property
542         {
543             internal static readonly int UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_VISUAL_get();
544             internal static readonly int SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_VISUAL_get();
545             internal static readonly int DISABLED_SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_VISUAL_get();
546             internal static readonly int DISABLED_UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_VISUAL_get();
547             internal static readonly int UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_BACKGROUND_VISUAL_get();
548             internal static readonly int SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_BACKGROUND_VISUAL_get();
549             internal static readonly int DISABLED_UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get();
550             internal static readonly int DISABLED_SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get();
551             internal static readonly int LABEL_RELATIVE_ALIGNMENT = NDalicManualPINVOKE.Button_Property_LABEL_RELATIVE_ALIGNMENT_get();
552             internal static readonly int LABEL_PADDING = NDalicManualPINVOKE.Button_Property_LABEL_PADDING_get();
553             internal static readonly int FOREGROUND_VISUAL_PADDING = NDalicManualPINVOKE.Button_Property_VISUAL_PADDING_get();
554             internal static readonly int AUTO_REPEATING = NDalicPINVOKE.Button_Property_AUTO_REPEATING_get();
555             internal static readonly int INITIAL_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_INITIAL_AUTO_REPEATING_DELAY_get();
556             internal static readonly int NEXT_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_NEXT_AUTO_REPEATING_DELAY_get();
557             internal static readonly int TOGGLABLE = NDalicPINVOKE.Button_Property_TOGGLABLE_get();
558             internal static readonly int SELECTED = NDalicPINVOKE.Button_Property_SELECTED_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         }
563
564         /// <summary>
565         /// Creates an uninitialized button.<br>
566         /// Only the derived versions can be instantiated.<br>
567         /// </summary>
568         /// <since_tizen> 3 </since_tizen>
569         public Button() : this(NDalicPINVOKE.new_Button__SWIG_0(), true)
570         {
571             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572         }
573
574         internal ButtonSignal PressedSignal()
575         {
576             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_PressedSignal(swigCPtr), false);
577             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
578             return ret;
579         }
580
581         internal ButtonSignal ReleasedSignal()
582         {
583             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ReleasedSignal(swigCPtr), false);
584             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
585             return ret;
586         }
587
588         internal ButtonSignal ClickedSignal()
589         {
590             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ClickedSignal(swigCPtr), false);
591             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
592             return ret;
593         }
594
595         internal ButtonSignal StateChangedSignal()
596         {
597             ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_StateChangedSignal(swigCPtr), false);
598             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
599             return ret;
600         }
601
602         /// <summary>
603         /// If the autorepeating property is set to true, then the togglable property is set to false.
604         /// </summary>
605         /// <since_tizen> 3 </since_tizen>
606         public bool AutoRepeating
607         {
608             get
609             {
610                 bool temp = false;
611                 GetProperty(Button.Property.AUTO_REPEATING).Get(out temp);
612                 return temp;
613             }
614             set
615             {
616                 SetProperty(Button.Property.AUTO_REPEATING, new Tizen.NUI.PropertyValue(value));
617             }
618         }
619
620         /// <summary>
621         /// By default, this value is set to 0.15 seconds.
622         /// </summary>
623         /// <since_tizen> 3 </since_tizen>
624         public float InitialAutoRepeatingDelay
625         {
626             get
627             {
628                 float temp = 0.0f;
629                 GetProperty(Button.Property.INITIAL_AUTO_REPEATING_DELAY).Get(out temp);
630                 return temp;
631             }
632             set
633             {
634                 SetProperty(Button.Property.INITIAL_AUTO_REPEATING_DELAY, new Tizen.NUI.PropertyValue(value));
635             }
636         }
637
638         /// <summary>
639         /// By default, this value is set to 0.05 seconds.
640         /// </summary>
641         /// <since_tizen> 3 </since_tizen>
642         public float NextAutoRepeatingDelay
643         {
644             get
645             {
646                 float temp = 0.0f;
647                 GetProperty(Button.Property.NEXT_AUTO_REPEATING_DELAY).Get(out temp);
648                 return temp;
649             }
650             set
651             {
652                 SetProperty(Button.Property.NEXT_AUTO_REPEATING_DELAY, new Tizen.NUI.PropertyValue(value));
653             }
654         }
655
656         /// <summary>
657         /// If the togglable property is set to true, then the autorepeating property is set to false.
658         /// </summary>
659         /// <since_tizen> 3 </since_tizen>
660         public bool Togglable
661         {
662             get
663             {
664                 bool temp = false;
665                 GetProperty(Button.Property.TOGGLABLE).Get(out temp);
666                 return temp;
667             }
668             set
669             {
670                 SetProperty(Button.Property.TOGGLABLE, new Tizen.NUI.PropertyValue(value));
671             }
672         }
673
674         /// <summary>
675         /// Gets or sets the togglable button as either selected or unselected, togglable property must be set to true.
676         /// </summary>
677         /// <since_tizen> 3 </since_tizen>
678         public bool Selected
679         {
680             get
681             {
682                 bool temp = false;
683                 GetProperty(Button.Property.SELECTED).Get(out temp);
684                 return temp;
685             }
686             set
687             {
688                 SetProperty(Button.Property.SELECTED, new Tizen.NUI.PropertyValue(value));
689             }
690         }
691
692         /// <summary>
693         /// Gets or sets the unselected color.
694         /// </summary>
695         /// <since_tizen> 3 </since_tizen>
696         public Color UnselectedColor
697         {
698             get
699             {
700                 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
701                 GetProperty(Button.Property.UNSELECTED_COLOR).Get(temp);
702                 return temp;
703             }
704             set
705             {
706                 SetProperty(Button.Property.UNSELECTED_COLOR, new Tizen.NUI.PropertyValue(value));
707             }
708         }
709
710         /// <summary>
711         /// Gets or sets the selected color.
712         /// </summary>
713         /// <since_tizen> 3 </since_tizen>
714         public Color SelectedColor
715         {
716             get
717             {
718                 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
719                 GetProperty(Button.Property.SELECTED_COLOR).Get(temp);
720                 return temp;
721             }
722             set
723             {
724                 SetProperty(Button.Property.SELECTED_COLOR, new Tizen.NUI.PropertyValue(value));
725             }
726         }
727
728         /// <summary>
729         /// Gets or sets the label.
730         /// </summary>
731         /// <since_tizen> 3 </since_tizen>
732         public Tizen.NUI.PropertyMap Label
733         {
734             get
735             {
736                 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
737                 GetProperty(Button.Property.LABEL).Get(temp);
738                 return temp;
739             }
740             set
741             {
742                 SetProperty(Button.Property.LABEL, new Tizen.NUI.PropertyValue(value));
743             }
744         }
745
746         /// <summary>
747         /// Gets or sets the text of the label.
748         /// </summary>
749         /// <since_tizen> 3 </since_tizen>
750         public string LabelText
751         {
752             get
753             {
754                 Tizen.NUI.PropertyMap map = new Tizen.NUI.PropertyMap();
755                 GetProperty( Button.Property.LABEL).Get(map);
756                 Tizen.NUI.PropertyValue value = map.Find( TextVisualProperty.Text, "Text");
757                 string str;
758                 value.Get(out str);
759                 return str;
760             }
761             set
762             {
763                 SetProperty( Button.Property.LABEL, new Tizen.NUI.PropertyValue( value ) );
764             }
765         }
766
767         /// <summary>
768         /// Enumeration for describing the position, the text label can be, in relation to the control (and foreground/icon).
769         /// </summary>
770         /// <since_tizen> 3 </since_tizen>
771         public enum Align
772         {
773             /// <summary>
774             /// At the start of the control before the foreground or icon.
775             /// </summary>
776             Begin,
777             /// <summary>
778             /// At the end of the control after the foreground or icon.
779             /// </summary>
780             End,
781             /// <summary>
782             /// At the top of the control above the foreground or icon.
783             /// </summary>
784             Top,
785             /// <summary>
786             /// At the bottom of the control below the foreground or icon.
787             /// </summary>
788             Bottom
789         }
790
791     }
792
793 }