2 using System.ComponentModel;
3 using System.Diagnostics;
12 /// CircleSliderBar is a part used to set the color of the bar.
14 /// <since_tizen> 6 </since_tizen>
15 public class CircleSliderBar : ICircleColor
18 public CircleSliderBar(IntPtr CircleHandle) { _handle = CircleHandle; }
21 /// Sets the color of the bar on the circle slider.
23 /// <since_tizen> 6 </since_tizen>
24 public void SetColor(int r, int g, int b, int a)
27 Interop.Eext.eext_circle_object_color_set(_handle, r, g, b, a);
31 /// Gets the color of the bar on the circle slider.
33 /// <since_tizen> 6 </since_tizen>
34 public void GetColor(out int r, out int g, out int b, out int a)
38 Interop.Eext.eext_circle_object_color_get(_handle, out r, out g, out b, out a);
43 /// CircleSliderBarBackground is a part used to set the background color of the bar.
45 /// <since_tizen> 6 </since_tizen>
46 public class CircleSliderBarBackground : ICircleColor
49 public CircleSliderBarBackground(IntPtr CircleHandle) { _handle = CircleHandle; }
52 /// Sets the background color of the bar on the circle slider.
54 /// <since_tizen> 6 </since_tizen>
55 public void SetColor(int r, int g, int b, int a)
58 Interop.Eext.eext_circle_object_item_color_set(_handle, "bg", r, g, b, a);
62 /// Gets the background color of the bar on the circle slider.
64 /// <since_tizen> 6 </since_tizen>
65 public void GetColor(out int r, out int g, out int b, out int a)
69 Interop.Eext.eext_circle_object_item_color_get(_handle, "bg", out r, out g, out b, out a);
74 /// CircleSlider is a circular designed widget used to select a value in a range by the rotary event.
76 /// <since_tizen> 6 </since_tizen>
77 public class CircleSlider : Efl.Ui.Layout, ICircleWidget
81 /// Get the handle for the circle widget.
83 /// <since_tizen> 6 </since_tizen>
84 public virtual IntPtr CircleHandle => _handle;
87 /// Changed will be triggered when the circle slider value changes.
89 /// <since_tizen> 6 </since_tizen>
90 public event EventHandler Changed;
91 const string ChangedEventName = "value,changed";
92 private Interop.Evas.SmartCallback smartChanged;
95 /// Sets or gets the color of the bar.
97 /// <since_tizen> 6 </since_tizen>
98 public CircleSliderBar Bar;
101 /// Sets or gets the background color of the bar.
103 /// <since_tizen> 6 </since_tizen>
104 public CircleSliderBarBackground BarBackground;
107 /// Creates and initializes a new instance of the CircleSlider class.
109 /// <param name="parent">The Efl.Ui.Widget to which the new CircleSlider will be attached as a child.</param>
110 /// <since_tizen> 6 </since_tizen>
111 public CircleSlider(Efl.Ui.Widget parent) : base(parent)
113 _handle = Interop.Eext.eext_circle_object_slider_add(parent.NativeHandle, IntPtr.Zero);
115 Bar = new Efl.Ui.Wearable.CircleSliderBar(_handle);
116 BarBackground = new Efl.Ui.Wearable.CircleSliderBarBackground(_handle);
118 smartChanged = new Interop.Evas.SmartCallback((d, o, e) =>
120 Changed?.Invoke(this, EventArgs.Empty);
123 Interop.Evas.evas_object_smart_callback_add(_handle, ChangedEventName, smartChanged, IntPtr.Zero);
125 elm_layout_content_set(this.NativeHandle, "efl.swallow.vg", CircleHandle);
128 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)]
129 internal static extern bool elm_layout_content_set(IntPtr obj, string swallow, IntPtr content);
131 public override Efl.Object FinalizeAdd()
133 this.SetTheme("circle_slider", null, null);
138 /// Sets or gets the step by which the circle slider bar moves.
140 /// <since_tizen> 6 </since_tizen>
145 return Interop.Eext.eext_circle_object_slider_step_get(CircleHandle);
149 Interop.Eext.eext_circle_object_slider_step_set(CircleHandle, (double)value);
155 /// Sets or gets the disabled state of the circle slider.
157 /// <since_tizen> 6 </since_tizen>
161 set => Enable = !value;
165 /// Sets or gets the enabled state of the circle slider.
167 /// <since_tizen> 6 </since_tizen>
172 return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
176 Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
181 /// Sets or gets the line width of the circle slider bar.
183 public int BarLineWidth
187 return Interop.Eext.eext_circle_object_line_width_get(CircleHandle);
191 Interop.Eext.eext_circle_object_line_width_set(CircleHandle, value);
196 /// Sets or gets the line width of the circle slider background.
198 /// <since_tizen> 6 </since_tizen>
199 public int BackgroundLineWidth
203 return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "bg");
207 Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "bg", value);
212 /// Sets or gets the angle in degree of the circle slider bar.
214 /// <since_tizen> 6 </since_tizen>
215 public double BarAngle
219 return Interop.Eext.eext_circle_object_angle_get(CircleHandle);
223 Interop.Eext.eext_circle_object_angle_set(CircleHandle, value);
228 /// Sets or gets the angle in degree of the circle slider background.
230 /// <since_tizen> 6 </since_tizen>
231 public double BackgroundAngle
235 return Interop.Eext.eext_circle_object_item_angle_get(CircleHandle, "bg");
239 Interop.Eext.eext_circle_object_item_angle_set(CircleHandle, "bg", value);
244 /// Sets or gets the angle offset for the slider bar.
245 /// Offset value means start position of the slider bar.
247 /// <since_tizen> 6 </since_tizen>
248 public double BarAngleOffset
252 return Interop.Eext.eext_circle_object_angle_offset_get(CircleHandle);
256 Interop.Eext.eext_circle_object_angle_offset_set(CircleHandle, value);
261 /// Sets or gets the angle offset for the circle slider background.
262 /// Offset value means start position of the circle slider background.
264 /// <since_tizen> 6 </since_tizen>
265 public double BackgroundAngleOffset
269 return Interop.Eext.eext_circle_object_item_angle_offset_get(CircleHandle, "bg");
273 Interop.Eext.eext_circle_object_item_angle_offset_set(CircleHandle, "bg", value);
278 /// Sets or gets the minimum angle of the circle slider bar.
280 /// <since_tizen> 6 </since_tizen>
281 public double BarAngleMinimum
287 Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
292 double max = BarAngleMaximum;
293 Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, (double)value, max);
298 /// Sets or gets the maximum angle of the circle slider bar.
300 /// <since_tizen> 6 </since_tizen>
301 public double BarAngleMaximum
307 Interop.Eext.eext_circle_object_angle_min_max_get(CircleHandle, out min, out max);
312 double min = BarAngleMinimum;
313 Interop.Eext.eext_circle_object_angle_min_max_set(CircleHandle, min, (double)value);
318 /// Sets or gets the minimum values for the circle slider.
320 /// <since_tizen> 6 </since_tizen>
321 public double Minimum
327 Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
332 double max = Maximum;
333 Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, (double)value, max);
338 /// Sets or gets the maximum values for the circle slider.
340 /// <since_tizen> 6 </since_tizen>
341 public double Maximum
347 Interop.Eext.eext_circle_object_value_min_max_get(CircleHandle, out min, out max);
352 double min = Minimum;
353 Interop.Eext.eext_circle_object_value_min_max_set(CircleHandle, min, (double)value);
358 /// Gets or sets the value displayed by the circle slider.
360 /// <since_tizen> 6 </since_tizen>
365 return Interop.Eext.eext_circle_object_value_get(CircleHandle);
369 Interop.Eext.eext_circle_object_value_set(CircleHandle, (double)value);
374 /// Gets or sets the radius value for the circle slider bar.
376 /// <since_tizen> 6 </since_tizen>
377 public double BarRadius
381 return Interop.Eext.eext_circle_object_radius_get(CircleHandle);
385 Interop.Eext.eext_circle_object_radius_set(CircleHandle, (double)value);
390 /// Gets or sets the radius value for the circle slider background.
392 /// <since_tizen> 6 </since_tizen>
393 public double BackgroundRadius
397 return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "bg");
401 Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "bg", value);