[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Radio.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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;
18
19 namespace ElmSharp
20 {
21     /// <summary>
22     /// The Radio is a widget that allows for 1 or more options to be displayed, and have the user choose only 1 of them.
23     /// </summary>
24     /// <since_tizen> preview </since_tizen>
25     [Obsolete("This has been deprecated in API12")]
26     public class Radio : Layout
27     {
28         SmartEvent _changed;
29
30         /// <summary>
31         /// Creates and initializes a new instance of the Radio class.
32         /// </summary>
33         /// <param name="parent">The EvasObject to which the new Radio will be attached as a child.</param>
34         /// <since_tizen> preview </since_tizen>
35         [Obsolete("This has been deprecated in API12")]
36         public Radio(EvasObject parent) : base(parent)
37         {
38             _changed = new SmartEvent(this, this.RealHandle, "changed");
39             _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty);
40         }
41
42         /// <summary>
43         /// ValueChanged will be triggered when value of the radio changes.
44         /// </summary>
45         /// <since_tizen> preview </since_tizen>
46         [Obsolete("This has been deprecated in API12")]
47         public event EventHandler ValueChanged;
48
49         /// <summary>
50         /// Sets or gets a unique value to each radio button.
51         /// </summary>
52         /// <since_tizen> preview </since_tizen>
53         [Obsolete("This has been deprecated in API12")]
54         public int StateValue
55         {
56             get
57             {
58                 return Interop.Elementary.elm_radio_state_value_get(RealHandle);
59             }
60             set
61             {
62                 Interop.Elementary.elm_radio_state_value_set(RealHandle, value);
63             }
64         }
65
66         /// <summary>
67         /// Sets or gets the value of the radio group.
68         /// </summary>
69         /// <since_tizen> preview </since_tizen>
70         [Obsolete("This has been deprecated in API12")]
71         public int GroupValue
72         {
73             get
74             {
75                 return Interop.Elementary.elm_radio_value_get(RealHandle);
76             }
77             set
78             {
79                 Interop.Elementary.elm_radio_value_set(RealHandle, value);
80             }
81         }
82
83         /// <summary>
84         /// Adds this radio to a group of other radio objects.
85         /// </summary>
86         /// <param name="group">Group which add radio in.</param>
87         /// <since_tizen> preview </since_tizen>
88         [Obsolete("This has been deprecated in API12")]
89         public void SetGroup(Radio group)
90         {
91             if (group == null)
92             {
93                 throw new ArgumentNullException("group");
94             }
95             Interop.Elementary.elm_radio_group_add(RealHandle, group.RealHandle);
96         }
97
98         /// <summary>
99         /// Creates a widget handle.
100         /// </summary>
101         /// <param name="parent">Parent EvasObject.</param>
102         /// <returns>Handle IntPtr.</returns>
103         /// <since_tizen> preview </since_tizen>
104         [Obsolete("This has been deprecated in API12")]
105         protected override IntPtr CreateHandle(EvasObject parent)
106         {
107             IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
108             Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
109
110             RealHandle = Interop.Elementary.elm_radio_add(handle);
111             Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
112
113             return handle;
114         }
115     }
116 }