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