[NUI] Add public types to replace nested types (CA1034 of StyleCop) (#1692)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / RadioButton.cs
1 /*
2  * Copyright(c) 2019 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 using System.ComponentModel;
18
19 namespace Tizen.NUI.Components
20 {
21     /// <summary>
22     /// RadioButton is the Class that describe the control which can be checked, but not cleared by a user.
23     /// </summary>
24     /// <code>
25     /// RadioButton radio = new RadioButton("C_RadioButton_WhiteText");
26     /// radio.Size = new Size(200, 64, 0);
27     /// radio.Position = new Position(500, posY, 0);
28     /// radio.Text = "RadioButton";
29     /// radio.Focusable = true;
30     /// </code>
31     /// <since_tizen> 6 </since_tizen>
32     /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
33     [EditorBrowsable(EditorBrowsableState.Never)]
34     public class RadioButton : SelectButton
35     {
36         static RadioButton() { }
37
38         /// <summary>
39         /// Creates a new instance of a RadioButton.
40         /// </summary>
41         /// <since_tizen> 6 </since_tizen>
42         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
43         [EditorBrowsable(EditorBrowsableState.Never)]
44         public RadioButton() : base() { }
45         /// <summary>
46         /// Creates a new instance of a RadioButton with style.
47         /// </summary>
48         /// <param name="style"></param>
49         /// <since_tizen> 6 </since_tizen>
50         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
51         [EditorBrowsable(EditorBrowsableState.Never)]
52         public RadioButton(string style) : base(style) { }
53         /// <summary>
54         /// Creates a new instance of a RadioButton with style.
55         /// </summary>
56         /// <param name="buttonStyle"></param>
57         /// <since_tizen> 6 </since_tizen>
58         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
59         [EditorBrowsable(EditorBrowsableState.Never)]
60         public RadioButton(ButtonStyle buttonStyle) : base(buttonStyle) { }
61
62         /// <summary>
63         /// Get RadioButtonGroup to which this selections belong.
64         /// </summary>
65         /// <since_tizen> 6 </since_tizen>
66         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
67         [EditorBrowsable(EditorBrowsableState.Never)]
68         public RadioButtonGroup ItemGroup
69         {
70             get
71             {
72                 return base.ItemGroup as RadioButtonGroup;
73             }
74             internal set
75             {
76                 base.ItemGroup = value;
77             }
78         }
79
80         /// <summary>
81         /// Set CheckState to true after selecting RadioButton.
82         /// </summary>
83         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
84         [EditorBrowsable(EditorBrowsableState.Never)]
85         protected override void OnSelectedChanged()
86         {
87             if (!IsSelected)
88             {
89                 IsSelected = true;
90             }
91         }
92     }
93 }