[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp.Wearable / ElmSharp.Wearable / CircleGenList.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 using System.ComponentModel;
19 using System.Diagnostics;
20
21 namespace ElmSharp.Wearable
22 {
23     /// <summary>
24     /// The Circle GenList Selector is a widget to display and handle the genlist items by the Rotary event.
25     /// Inherits <see cref="GenList"/>.
26     /// </summary>
27     /// <since_tizen> preview </since_tizen>
28     [Obsolete("This has been deprecated in API12")]
29     public class CircleGenList : GenList, IRotaryActionWidget
30     {
31         IntPtr _circleHandle;
32         CircleSurface _surface;
33
34         /// <summary>
35         /// Creates and initializes a new instance of the Circle GenList class.
36         /// </summary>
37         /// <param name="parent">The parent of the new Circle GenList instance.</param>
38         /// <param name="surface">The surface for drawing the circle features for this widget.</param>
39         /// <since_tizen> preview </since_tizen>
40         [Obsolete("This has been deprecated in API12")]
41         public CircleGenList(EvasObject parent, CircleSurface surface) : base()
42         {
43             Debug.Assert(parent == null || surface == null || parent.IsRealized);
44             _surface = surface;
45             Realize(parent);
46         }
47
48         /// <summary>
49         /// Creates and initializes a new instance of the Circle GenList class.
50         /// </summary>
51         /// <param name="parent">The parent of the new Circle CircleGenList instance.</param>
52         /// <since_tizen> preview </since_tizen>
53         [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")]
54         [EditorBrowsable(EditorBrowsableState.Never)]
55         public CircleGenList(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent))
56         {
57             ((IRotaryActionWidget)this).Activate();
58         }
59
60         /// <summary>
61         /// Gets the handle for the Circle widget.
62         /// </summary>
63         /// <since_tizen> preview </since_tizen>
64         [Obsolete("This has been deprecated in API12")]
65         public virtual IntPtr CircleHandle => _circleHandle;
66
67         /// <summary>
68         /// Gets the handle for the circle surface used in this widget.
69         /// </summary>
70         /// <since_tizen> preview </since_tizen>
71         [Obsolete("This has been deprecated in API12")]
72         public virtual CircleSurface CircleSurface => _surface;
73
74         /// <summary>
75         /// Sets or gets the disabled state of this widget.
76         /// </summary>
77         /// <since_tizen> preview </since_tizen>
78         [Obsolete("Use IsEnabled")]
79         [EditorBrowsable(EditorBrowsableState.Never)]
80         public bool Disabled
81         {
82             get => !IsEnabled;
83             set => IsEnabled = !value;
84         }
85
86         /// <summary>
87         /// Sets or gets the state of the widget, which might be enabled or disabled.
88         /// </summary>
89         /// <since_tizen> preview </since_tizen>
90         [Obsolete("This has been deprecated in API12")]
91         public override bool IsEnabled
92         {
93             get
94             {
95                 return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
96             }
97             set
98             {
99                 Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
100             }
101         }
102
103         /// <summary>
104         /// Sets or gets the color of the scroll background.
105         /// </summary>
106         /// <since_tizen> preview </since_tizen>
107         [Obsolete("This has been deprecated in API12")]
108         public Color VerticalScrollBackgroundColor
109         {
110             get
111             {
112                 int r, g, b, a;
113                 Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
114                 return new Color(r, g, b, a);
115             }
116             set
117             {
118                 Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
119             }
120         }
121
122         /// <summary>
123         /// Sets or gets the line width of the scroll background.
124         /// </summary>
125         /// <since_tizen> preview </since_tizen>
126         [Obsolete("This has been deprecated in API12")]
127         public int VerticalScrollBackgroundLineWidth
128         {
129             get
130             {
131                 return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "vertical,scroll,bg");
132             }
133             set
134             {
135                 Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "vertical,scroll,bg", value);
136             }
137         }
138
139         /// <summary>
140         /// Sets or gets the radius of the scroll background.
141         /// </summary>
142         /// <since_tizen> preview </since_tizen>
143         [Obsolete("This has been deprecated in API12")]
144         public double VerticalScrollBackgroundRadius
145         {
146             get
147             {
148                 return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "vertical,scroll,bg");
149             }
150             set
151             {
152                 Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "vertical,scroll,bg", value);
153             }
154         }
155
156         /// <summary>
157         /// Sets or gets the color of the scrollbar.
158         /// </summary>
159         /// <since_tizen> preview </since_tizen>
160         [Obsolete("This has been deprecated in API12")]
161         public Color VerticalScrollBarColor
162         {
163             get
164             {
165                 int r, g, b, a;
166                 Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "default", out r, out g, out b, out a);
167                 return new Color(r, g, b, a);
168             }
169             set
170             {
171                 Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "default", value.R, value.G, value.B, value.A);
172             }
173         }
174
175         /// <summary>
176         /// Sets or gets the line width of the scrollbar.
177         /// </summary>
178         /// <since_tizen> preview </since_tizen>
179         [Obsolete("This has been deprecated in API12")]
180         public int VerticalScrollBarLineWidth
181         {
182             get
183             {
184                 return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
185             }
186             set
187             {
188                 Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
189             }
190         }
191
192         /// <summary>
193         /// Sets or gets the radius of the scrollbar.
194         /// </summary>
195         /// <since_tizen> preview </since_tizen>
196         [Obsolete("This has been deprecated in API12")]
197         public double VerticalScrollBarRadius
198         {
199             get
200             {
201                 return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
202             }
203             set
204             {
205                 Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
206             }
207         }
208
209         /// <summary>
210         /// Sets or gets the policy if the scrollbar is visible.
211         /// </summary>
212         /// <remarks>
213         /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, or otherwise kept hidden.
214         /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
215         /// </remarks>
216         /// <since_tizen> preview </since_tizen>
217         [Obsolete("This has been deprecated in API12")]
218         public new ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy
219         {
220             get
221             {
222                 int policy;
223                 Interop.Eext.eext_circle_object_genlist_scroller_policy_get(CircleHandle, IntPtr.Zero, out policy);
224                 return (ScrollBarVisiblePolicy)policy;
225             }
226             set
227             {
228                 int h;
229                 Interop.Eext.eext_circle_object_genlist_scroller_policy_get(CircleHandle, out h, IntPtr.Zero);
230                 Interop.Eext.eext_circle_object_genlist_scroller_policy_set(CircleHandle, (int)h, (int)value);
231             }
232         }
233
234         /// <summary>
235         /// Creates a widget handle.
236         /// </summary>
237         /// <param name="parent">Parent EvasObject.</param>
238         /// <returns>Handle IntPtr.</returns>
239         /// <since_tizen> preview </since_tizen>
240         [Obsolete("This has been deprecated in API12")]
241         protected override IntPtr CreateHandle(EvasObject parent)
242         {
243             var handle = base.CreateHandle(parent);
244             _circleHandle = Interop.Eext.eext_circle_object_genlist_add(RealHandle == IntPtr.Zero ? handle : RealHandle, CircleSurface.Handle);
245
246             return handle;
247         }
248     }
249 }