Release 4.0.0-preview1-00235
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / UIComponents / RadioButton.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
17 namespace Tizen.NUI.UIComponents
18 {
19
20     /// <summary>
21     /// A RadioButton provides a radio button with two states, \e selected or \e unselected.<br>
22     /// Radio buttons are designed to select one of the many options at the same time.<br>
23     /// A RadioButton can change its current state using the selected.<br>
24     /// <br>
25     /// RadioButtons can be grouped.<br>
26     /// Two or more RadioButtons are in one group when they have this same parent.<br>
27     /// In each groups only one RadioButton can be \e selected at a given time.<br>
28     /// So when a RadioButton is set to \e selected, other RadioButtons in its group are set to \e unselected.<br>
29     /// When \e selected RadioButton is set to \e unselected, no other RadioButtons in this group are set to \e selected.<br>
30     /// <br>
31     /// The StateChanged event is emitted when the RadioButton change its state to \e selected or \e unselected.<br>
32     /// </summary>
33     public class RadioButton : Button
34     {
35         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36
37         internal RadioButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.RadioButton_SWIGUpcast(cPtr), cMemoryOwn)
38         {
39             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40         }
41
42         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RadioButton obj)
43         {
44             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
45         }
46
47         /// <summary>
48         /// To dispose the RadioButton instance.
49         /// </summary>
50         protected override void Dispose(DisposeTypes type)
51         {
52             if (disposed)
53             {
54                 return;
55             }
56
57             if (type == DisposeTypes.Explicit)
58             {
59                 //Called by User
60                 //Release your own managed resources here.
61                 //You should release all of your own disposable objects here.
62
63             }
64
65             //Release your own unmanaged resources here.
66             //You should not access any managed member here except static instance.
67             //because the execution order of Finalizes is non-deterministic.
68
69             if (swigCPtr.Handle != global::System.IntPtr.Zero)
70             {
71                 if (swigCMemOwn)
72                 {
73                     swigCMemOwn = false;
74                     NDalicPINVOKE.delete_RadioButton(swigCPtr);
75                 }
76                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
77             }
78
79             base.Dispose(type);
80         }
81         /// <summary>
82         /// Creates an uninitialized RadioButton.
83         /// </summary>
84         public RadioButton() : this(NDalicPINVOKE.RadioButton_New__SWIG_0(), true)
85         {
86             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87
88         }
89
90         /// <summary>
91         /// Creates an uninitialized RadioButton with the label.
92         /// </summary>
93         /// <param name="label">The label text.</param>
94         public RadioButton(string label) : this(NDalicPINVOKE.RadioButton_New__SWIG_1(label), true)
95         {
96             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97
98         }
99     }
100 }