using System;
using System.Collections.Generic;
using System.Text;
namespace Efl
{
namespace Ui
{
namespace Wearable
{
///
/// CircleTimePickerMarker is a part used to set the color of the marker.
///
/// 6
public class CircleTimePickerMarker : ICircleColor
{
IntPtr _handle;
public CircleTimePickerMarker(IntPtr CircleHandle) { _handle = CircleHandle; }
///
/// Sets the color of the marker on the circle time picker.
///
/// 6
public void SetColor(int r, int g, int b, int a)
{
if (_handle != null)
Interop.Eext.eext_circle_object_item_color_set(_handle, "default", r, g, b, a);
}
///
/// Gets the color of the marker on the circle time picker.
///
/// 6
public void GetColor(out int r, out int g, out int b, out int a)
{
r = g = b = a = -1;
if (_handle != null)
Interop.Eext.eext_circle_object_item_color_get(_handle, "default", out r, out g, out b, out a);
}
}
///
/// CircleTimePicker is a circular designed widget to display and handle time picker value by the rotary event.
///
/// 6
public class CircleTimePicker : Efl.Ui.Timepicker, ICircleWidget
{
IntPtr _handle;
///
/// Get the handle for the circle widget.
///
/// 6
public virtual IntPtr CircleHandle => _handle;
///
/// Sets or gets the color of the marker.
///
/// 6
public CircleTimePickerMarker Marker;
///
/// Creates and initializes a new instance of the CircleTimePicker class.
///
/// The Efl.Ui.Widget to which the new CircleTimePicker will be attached as a child.
/// 6
public CircleTimePicker(Efl.Ui.Widget parent) : base(parent)
{
_handle = Interop.Eext.eext_circle_object_datetime_add(this.NativeHandle, IntPtr.Zero);
Marker = new CircleTimePickerMarker(_handle);
elm_layout_content_set(this.NativeHandle, "efl.swallow.vg", CircleHandle);
}
[System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)]
internal static extern bool elm_layout_content_set(IntPtr obj, string swallow, IntPtr content);
///
/// Sets or gets the disabled state of the circle time picker.
///
/// 6
public bool Disable
{
get => !Enable;
set => Enable = !value;
}
///
/// Sets or gets the enabled state of the circle time picker.
///
/// 6
public bool Enable
{
get
{
return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
}
set
{
Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
}
}
///
/// Sets or gets the line width of the marker.
///
/// 6
public int MarkerLineWidth
{
get
{
return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
}
set
{
Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
}
}
///
/// Sets or gets the radius of the marker.
///
/// 6
public double MarkerRadius
{
get
{
return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
}
set
{
Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
}
}
}
}
}
}