[NUI] Setting since_tizen 3/4 on Tizen.NUI API
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / UIComponents / RadioButton.cs
1 /*
2  * Copyright(c) 2017 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 namespace Tizen.NUI.UIComponents
19 {
20
21     /// <summary>
22     /// A RadioButton provides a radio button with two states, \e selected or \e unselected.<br />
23     /// Radio buttons are designed to select one of the many options at the same time.<br />
24     /// A RadioButton can change its current state using the selected.<br />
25     /// <br />
26     /// RadioButtons can be grouped.<br />
27     /// Two or more RadioButtons are in one group when they have this same parent.<br />
28     /// In each groups only one RadioButton can be \e selected at a given time.<br />
29     /// So when a RadioButton is set to \e selected, other RadioButtons in its group are set to \e unselected.<br />
30     /// When \e selected RadioButton is set to \e unselected, no other RadioButtons in this group are set to \e selected.<br />
31     /// <br />
32     /// The StateChanged event is emitted when the RadioButton change its state to \e selected or \e unselected.<br />
33     /// </summary>
34     /// <since_tizen> 3 </since_tizen>
35     public class RadioButton : Button
36     {
37         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
38
39         internal RadioButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.RadioButton_SWIGUpcast(cPtr), cMemoryOwn)
40         {
41             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
42         }
43
44         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RadioButton obj)
45         {
46             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
47         }
48
49         /// <summary>
50         /// To dispose the RadioButton instance.
51         /// </summary>
52         /// <since_tizen> 3 </since_tizen>
53         protected override void Dispose(DisposeTypes type)
54         {
55             if (disposed)
56             {
57                 return;
58             }
59
60             if (type == DisposeTypes.Explicit)
61             {
62                 //Called by User
63                 //Release your own managed resources here.
64                 //You should release all of your own disposable objects here.
65
66             }
67
68             //Release your own unmanaged resources here.
69             //You should not access any managed member here except static instance.
70             //because the execution order of Finalizes is non-deterministic.
71
72             if (swigCPtr.Handle != global::System.IntPtr.Zero)
73             {
74                 if (swigCMemOwn)
75                 {
76                     swigCMemOwn = false;
77                     NDalicPINVOKE.delete_RadioButton(swigCPtr);
78                 }
79                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
80             }
81
82             base.Dispose(type);
83         }
84         /// <summary>
85         /// Creates an uninitialized RadioButton.
86         /// </summary>
87         /// <since_tizen> 3 </since_tizen>
88         public RadioButton() : this(NDalicPINVOKE.RadioButton_New__SWIG_0(), true)
89         {
90             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
91
92         }
93
94         /// <summary>
95         /// Creates an uninitialized RadioButton with the label.
96         /// </summary>
97         /// <param name="label">The label text.</param>
98         /// <since_tizen> 3 </since_tizen>
99         public RadioButton(string label) : this(NDalicPINVOKE.RadioButton_New__SWIG_1(label), true)
100         {
101             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102
103         }
104     }
105 }