2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.ComponentModel;
19 using System.Diagnostics;
21 namespace ElmSharp.Wearable
25 /// The Circle ProgressBar is a widget for visually representing the progress status of a given job or task with the circular design.
27 /// <since_tizen> preview </since_tizen>
28 [Obsolete("This has been deprecated in API12")]
29 public class CircleProgressBar : Widget, ICircleWidget
31 CircleSurface _surface;
34 /// Creates and initializes a new instance of the Circle Progressbar class.
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()
42 Debug.Assert(parent == null || surface == null || parent.IsRealized);
48 /// Creates and initializes a new instance of the Circle Progressbar class.
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))
59 /// Gets the handle for the Circle widget.
61 /// <since_tizen> preview </since_tizen>
62 [Obsolete("This has been deprecated in API12")]
63 public virtual IntPtr CircleHandle => Handle;
66 /// Gets the handle for the circle surface used in this widget.
68 /// <since_tizen> preview </since_tizen>
69 [Obsolete("This has been deprecated in API12")]
70 public virtual CircleSurface CircleSurface => _surface;
73 /// Sets or gets the disabled state of this widget.
75 /// <since_tizen> preview </since_tizen>
76 [Obsolete("Use IsEnabled")]
77 [EditorBrowsable(EditorBrowsableState.Never)]
81 set => IsEnabled = !value;
85 /// Sets or gets the state of the widget, which might be enabled or disabled.
87 /// <since_tizen> preview </since_tizen>
88 [Obsolete("This has been deprecated in API12")]
89 public override bool IsEnabled
93 return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
97 Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
102 /// Sets or gets the value of the ProgressBar.
104 /// <since_tizen> preview </since_tizen>
105 [Obsolete("This has been deprecated in API12")]
110 return Interop.Eext.eext_circle_object_value_get(CircleHandle);
114 Interop.Eext.eext_circle_object_value_set(CircleHandle, value);
119 /// Sets or gets the maximum value of the ProgressBar.
121 /// <since_tizen> preview </since_tizen>
122 [Obsolete("This has been deprecated in API12")]
123 public double Maximum
129 Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
134 double min = Minimum;
135 Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, min, value);
140 /// Sets or gets the minimum value of the ProgressBar.
142 /// <since_tizen> preview </since_tizen>
143 [Obsolete("This has been deprecated in API12")]
144 public double Minimum
150 Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
155 double max = Maximum;
156 Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, value, max);
161 /// Sets or gets the angle value of the ProgressBar.
163 /// <since_tizen> preview </since_tizen>
164 [Obsolete("This has been deprecated in API12")]
165 public double BarAngle
169 return Interop.Eext.eext_circle_object_angle_get(CircleHandle);
173 Interop.Eext.eext_circle_object_angle_set(CircleHandle, value);
178 /// Sets or gets the angle value of the Background ProgressBar.
180 /// <since_tizen> preview </since_tizen>
181 [Obsolete("This has been deprecated in API12")]
182 public double BackgroundAngle
186 return Interop.Eext.eext_circle_object_item_angle_get(CircleHandle, "bg");
190 Interop.Eext.eext_circle_object_item_angle_set(CircleHandle, "bg", value);
195 /// Sets or gets the angle offset value of the ProgressBar.
197 /// <since_tizen> preview </since_tizen>
198 [Obsolete("This has been deprecated in API12")]
199 public double BarAngleOffset
203 return Interop.Eext.eext_circle_object_angle_offset_get(CircleHandle);
207 Interop.Eext.eext_circle_object_angle_offset_set(CircleHandle, value);
212 /// Sets or gets the angle offset value of the Background ProgressBar.
214 /// <since_tizen> preview </since_tizen>
215 [Obsolete("This has been deprecated in API12")]
216 public double BackgroundAngleOffset
220 return Interop.Eext.eext_circle_object_item_angle_offset_get(CircleHandle, "bg");
224 Interop.Eext.eext_circle_object_item_angle_offset_set(CircleHandle, "bg", value);
229 /// Sets or gets the maximum angle value of the ProgressBar.
231 /// <since_tizen> preview </since_tizen>
232 [Obsolete("This has been deprecated in API12")]
233 public double BarAngleMaximum
239 Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
244 double min = BarAngleMinimum;
245 Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, min, value);
250 /// Sets or gets the minimum angle value of the ProgressBar.
252 /// <since_tizen> preview </since_tizen>
253 [Obsolete("This has been deprecated in API12")]
254 public double BarAngleMinimum
260 Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
265 double max = BarAngleMaximum;
266 Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, value, max);
271 /// Sets or gets the color of the ProgressBar.
273 /// <since_tizen> preview </since_tizen>
274 [Obsolete("This has been deprecated in API12")]
275 public Color BarColor
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);
288 Interop.Eext.eext_circle_object_color_set(CircleHandle, value.R, value.G, value.B, value.A);
293 /// Sets or gets the color of the Background ProgressBar.
295 /// <since_tizen> preview </since_tizen>
296 [Obsolete("This has been deprecated in API12")]
297 public override Color BackgroundColor
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);
310 Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "bg", value.R, value.G, value.B, value.A);
315 /// Sets or gets the line width of the ProgressBar.
317 /// <since_tizen> preview </since_tizen>
318 [Obsolete("This has been deprecated in API12")]
319 public int BarLineWidth
323 return Interop.Eext.eext_circle_object_line_width_get(CircleHandle);
327 Interop.Eext.eext_circle_object_line_width_set(CircleHandle, value);
332 /// Sets or gets the line width of the Background ProgressBar.
334 /// <since_tizen> preview </since_tizen>
335 [Obsolete("This has been deprecated in API12")]
336 public int BackgroundLineWidth
340 return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "bg");
344 Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "bg", value);
349 /// Sets or gets the radius of the ProgressBar.
351 /// <since_tizen> preview </since_tizen>
352 [Obsolete("This has been deprecated in API12")]
353 public double BarRadius
357 return Interop.Eext.eext_circle_object_radius_get(CircleHandle);
361 Interop.Eext.eext_circle_object_radius_set(CircleHandle, value);
366 /// Sets or gets the radius of the Background ProgressBar.
368 /// <since_tizen> preview </since_tizen>
369 [Obsolete("This has been deprecated in API12")]
370 public double BackgroundRadius
374 return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "bg");
378 Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "bg", value);
383 /// Creates a widget handle.
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)
391 return Interop.Eext.eext_circle_object_progressbar_add(parent, CircleSurface.Handle);