[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp.Wearable / ElmSharp.Wearable / CircleProgressBar.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
24     /// <summary>
25     /// The Circle ProgressBar is a widget for visually representing the progress status of a given job or task with the circular design.
26     /// </summary>
27     /// <since_tizen> preview </since_tizen>
28     [Obsolete("This has been deprecated in API12")]
29     public class CircleProgressBar : Widget, ICircleWidget
30     {
31         CircleSurface _surface;
32
33         /// <summary>
34         /// Creates and initializes a new instance of the Circle Progressbar class.
35         /// </summary>
36         /// <param name="parent">The parent of the new Circle Progressbar instance.</param>
37         /// <param name="surface">The surface for drawing circle features for this widget.</param>
38         /// <since_tizen> preview </since_tizen>
39         [Obsolete("This has been deprecated in API12")]
40         public CircleProgressBar(EvasObject parent, CircleSurface surface) : base()
41         {
42             Debug.Assert(parent == null || surface == null || parent.IsRealized);
43             _surface = surface;
44             Realize(parent);
45         }
46
47         /// <summary>
48         /// Creates and initializes a new instance of the Circle Progressbar class.
49         /// </summary>
50         /// <param name="parent">The parent of the new Circle Progressbar instance.</param>
51         /// <since_tizen> preview </since_tizen>
52         [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")]
53         [EditorBrowsable(EditorBrowsableState.Never)]
54         public CircleProgressBar(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent))
55         {
56         }
57
58         /// <summary>
59         /// Gets the handle for the Circle widget.
60         /// </summary>
61         /// <since_tizen> preview </since_tizen>
62         [Obsolete("This has been deprecated in API12")]
63         public virtual IntPtr CircleHandle => Handle;
64
65         /// <summary>
66         /// Gets the handle for the circle surface used in this widget.
67         /// </summary>
68         /// <since_tizen> preview </since_tizen>
69         [Obsolete("This has been deprecated in API12")]
70         public virtual CircleSurface CircleSurface => _surface;
71
72         /// <summary>
73         /// Sets or gets the disabled state of this widget.
74         /// </summary>
75         /// <since_tizen> preview </since_tizen>
76         [Obsolete("Use IsEnabled")]
77         [EditorBrowsable(EditorBrowsableState.Never)]
78         public bool Disabled
79         {
80             get => !IsEnabled;
81             set => IsEnabled = !value;
82         }
83
84         /// <summary>
85         /// Sets or gets the state of the widget, which might be enabled or disabled.
86         /// </summary>
87         /// <since_tizen> preview </since_tizen>
88         [Obsolete("This has been deprecated in API12")]
89         public override bool IsEnabled
90         {
91             get
92             {
93                 return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
94             }
95             set
96             {
97                 Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
98             }
99         }
100
101         /// <summary>
102         /// Sets or gets the value of the ProgressBar.
103         /// </summary>
104         /// <since_tizen> preview </since_tizen>
105         [Obsolete("This has been deprecated in API12")]
106         public double Value
107         {
108             get
109             {
110                 return Interop.Eext.eext_circle_object_value_get(CircleHandle);
111             }
112             set
113             {
114                 Interop.Eext.eext_circle_object_value_set(CircleHandle, value);
115             }
116         }
117
118         /// <summary>
119         /// Sets or gets the maximum value of the ProgressBar.
120         /// </summary>
121         /// <since_tizen> preview </since_tizen>
122         [Obsolete("This has been deprecated in API12")]
123         public double Maximum
124         {
125             get
126             {
127                 double max = 0;
128                 double min = 0;
129                 Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
130                 return max;
131             }
132             set
133             {
134                 double min = Minimum;
135                 Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, min, value);
136             }
137         }
138
139         /// <summary>
140         /// Sets or gets the minimum value of the ProgressBar.
141         /// </summary>
142         /// <since_tizen> preview </since_tizen>
143         [Obsolete("This has been deprecated in API12")]
144         public double Minimum
145         {
146             get
147             {
148                 double max = 0;
149                 double min = 0;
150                 Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
151                 return min;
152             }
153             set
154             {
155                 double max = Maximum;
156                 Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, value, max);
157             }
158         }
159
160         /// <summary>
161         /// Sets or gets the angle value of the ProgressBar.
162         /// </summary>
163         /// <since_tizen> preview </since_tizen>
164         [Obsolete("This has been deprecated in API12")]
165         public double BarAngle
166         {
167             get
168             {
169                 return Interop.Eext.eext_circle_object_angle_get(CircleHandle);
170             }
171             set
172             {
173                 Interop.Eext.eext_circle_object_angle_set(CircleHandle, value);
174             }
175         }
176
177         /// <summary>
178         /// Sets or gets the angle value of the Background ProgressBar.
179         /// </summary>
180         /// <since_tizen> preview </since_tizen>
181         [Obsolete("This has been deprecated in API12")]
182         public double BackgroundAngle
183         {
184             get
185             {
186                 return Interop.Eext.eext_circle_object_item_angle_get(CircleHandle, "bg");
187             }
188             set
189             {
190                 Interop.Eext.eext_circle_object_item_angle_set(CircleHandle, "bg", value);
191             }
192         }
193
194         /// <summary>
195         /// Sets or gets the angle offset value of the ProgressBar.
196         /// </summary>
197         /// <since_tizen> preview </since_tizen>
198         [Obsolete("This has been deprecated in API12")]
199         public double BarAngleOffset
200         {
201             get
202             {
203                 return Interop.Eext.eext_circle_object_angle_offset_get(CircleHandle);
204             }
205             set
206             {
207                 Interop.Eext.eext_circle_object_angle_offset_set(CircleHandle, value);
208             }
209         }
210
211         /// <summary>
212         /// Sets or gets the angle offset value of the Background ProgressBar.
213         /// </summary>
214         /// <since_tizen> preview </since_tizen>
215         [Obsolete("This has been deprecated in API12")]
216         public double BackgroundAngleOffset
217         {
218             get
219             {
220                 return Interop.Eext.eext_circle_object_item_angle_offset_get(CircleHandle, "bg");
221             }
222             set
223             {
224                 Interop.Eext.eext_circle_object_item_angle_offset_set(CircleHandle, "bg", value);
225             }
226         }
227
228         /// <summary>
229         /// Sets or gets the maximum angle value of the ProgressBar.
230         /// </summary>
231         /// <since_tizen> preview </since_tizen>
232         [Obsolete("This has been deprecated in API12")]
233         public double BarAngleMaximum
234         {
235             get
236             {
237                 double max = 0;
238                 double min = 0;
239                 Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
240                 return max;
241             }
242             set
243             {
244                 double min = BarAngleMinimum;
245                 Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, min, value);
246             }
247         }
248
249         /// <summary>
250         /// Sets or gets the minimum angle value of the ProgressBar.
251         /// </summary>
252         /// <since_tizen> preview </since_tizen>
253         [Obsolete("This has been deprecated in API12")]
254         public double BarAngleMinimum
255         {
256             get
257             {
258                 double max = 0;
259                 double min = 0;
260                 Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
261                 return min;
262             }
263             set
264             {
265                 double max = BarAngleMaximum;
266                 Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, value, max);
267             }
268         }
269
270         /// <summary>
271         /// Sets or gets the color of the ProgressBar.
272         /// </summary>
273         /// <since_tizen> preview </since_tizen>
274         [Obsolete("This has been deprecated in API12")]
275         public Color BarColor
276         {
277             get
278             {
279                 int r = 0;
280                 int g = 0;
281                 int b = 0;
282                 int a = 0;
283                 Interop.Eext.eext_circle_object_color_get(CircleHandle, out r, out g, out b, out a);
284                 return Color.FromRgba(r, g, b, a);
285             }
286             set
287             {
288                 Interop.Eext.eext_circle_object_color_set(CircleHandle, value.R, value.G, value.B, value.A);
289             }
290         }
291
292         /// <summary>
293         /// Sets or gets the color of the Background ProgressBar.
294         /// </summary>
295         /// <since_tizen> preview </since_tizen>
296         [Obsolete("This has been deprecated in API12")]
297         public override Color BackgroundColor
298         {
299             get
300             {
301                 int r = 0;
302                 int g = 0;
303                 int b = 0;
304                 int a = 0;
305                 Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "bg", out r, out g, out b, out a);
306                 return Color.FromRgba(r, g, b, a);
307             }
308             set
309             {
310                 Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "bg", value.R, value.G, value.B, value.A);
311             }
312         }
313
314         /// <summary>
315         /// Sets or gets the line width of the ProgressBar.
316         /// </summary>
317         /// <since_tizen> preview </since_tizen>
318         [Obsolete("This has been deprecated in API12")]
319         public int BarLineWidth
320         {
321             get
322             {
323                 return Interop.Eext.eext_circle_object_line_width_get(CircleHandle);
324             }
325             set
326             {
327                 Interop.Eext.eext_circle_object_line_width_set(CircleHandle, value);
328             }
329         }
330
331         /// <summary>
332         /// Sets or gets the line width of the Background ProgressBar.
333         /// </summary>
334         /// <since_tizen> preview </since_tizen>
335         [Obsolete("This has been deprecated in API12")]
336         public int BackgroundLineWidth
337         {
338             get
339             {
340                 return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "bg");
341             }
342             set
343             {
344                 Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "bg", value);
345             }
346         }
347
348         /// <summary>
349         /// Sets or gets the radius of the ProgressBar.
350         /// </summary>
351         /// <since_tizen> preview </since_tizen>
352         [Obsolete("This has been deprecated in API12")]
353         public double BarRadius
354         {
355             get
356             {
357                 return Interop.Eext.eext_circle_object_radius_get(CircleHandle);
358             }
359             set
360             {
361                 Interop.Eext.eext_circle_object_radius_set(CircleHandle, value);
362             }
363         }
364
365         /// <summary>
366         /// Sets or gets the radius of the Background ProgressBar.
367         /// </summary>
368         /// <since_tizen> preview </since_tizen>
369         [Obsolete("This has been deprecated in API12")]
370         public double BackgroundRadius
371         {
372             get
373             {
374                 return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "bg");
375             }
376             set
377             {
378                 Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "bg", value);
379             }
380         }
381
382         /// <summary>
383         /// Creates a widget handle.
384         /// </summary>
385         /// <param name="parent">Parent EvasObject.</param>
386         /// <returns>Handle IntPtr.</returns>
387         /// <since_tizen> preview </since_tizen>
388         [Obsolete("This has been deprecated in API12")]
389         protected override IntPtr CreateHandle(EvasObject parent)
390         {
391             return Interop.Eext.eext_circle_object_progressbar_add(parent, CircleSurface.Handle);
392         }
393     }
394 }