[EflSharp] Separate efl and Circle cs files and Update cs files (#786)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / Circle / CircleTimePicker.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace Efl
6 {
7     namespace Ui
8     {
9         namespace Wearable
10         {
11             /// <summary>
12             /// CircleTimePickerMarker is a part used to set the color of the marker.
13             /// </summary>
14             /// <since_tizen> 6 </since_tizen>
15             public class CircleTimePickerMarker : ICircleColor
16             {
17                 IntPtr _handle;
18                 public CircleTimePickerMarker(IntPtr CircleHandle) { _handle = CircleHandle; }
19
20                 /// <summary>
21                 /// Sets the color of the marker on the circle time picker.
22                 /// </summary>
23                 /// <since_tizen> 6 </since_tizen>
24                 public void SetColor(int r, int g, int b, int a)
25                 {
26                     if (_handle != null)
27                         Interop.Eext.eext_circle_object_item_color_set(_handle, "default", r, g, b, a);
28                 }
29
30                 /// <summary>
31                 /// Gets the color of the marker on the circle time picker.
32                 /// </summary>
33                 /// <since_tizen> 6 </since_tizen>
34                 public void GetColor(out int r, out int g, out int b, out int a)
35                 {
36                     r = g = b = a = -1;
37                     if (_handle != null)
38                         Interop.Eext.eext_circle_object_item_color_get(_handle, "default", out r, out g, out b, out a);
39                 }
40             }
41
42             /// <summary>
43             /// CircleTimePicker is a circular designed widget to display and handle time picker value by the rotary event.
44             /// </summary>
45             /// <since_tizen> 6 </since_tizen>
46             public class CircleTimePicker : Efl.Ui.Timepicker, ICircleWidget
47             {
48                 IntPtr _handle;
49
50                 /// <summary>
51                 /// Get the handle for the circle widget.
52                 /// </summary>
53                 /// <since_tizen> 6 </since_tizen>
54                 public virtual IntPtr CircleHandle => _handle;
55
56                 /// <summary>
57                 /// Sets or gets the color of the marker.
58                 /// </summary>
59                 /// <since_tizen> 6 </since_tizen>
60                 public CircleTimePickerMarker Marker;
61
62                 /// <summary>
63                 /// Creates and initializes a new instance of the CircleTimePicker class.
64                 /// </summary>
65                 /// <param name="parent">The Efl.Ui.Widget to which the new CircleTimePicker will be attached as a child.</param>
66                 /// <since_tizen> 6 </since_tizen>
67                 public CircleTimePicker(Efl.Ui.Widget parent) : base(parent)
68                 {
69                     _handle = Interop.Eext.eext_circle_object_datetime_add(this.NativeHandle, IntPtr.Zero);
70                     Marker = new CircleTimePickerMarker(_handle);
71                     elm_layout_content_set(this.NativeHandle, "efl.swallow.vg", CircleHandle);
72                 }
73
74                 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)]
75                 internal static extern bool elm_layout_content_set(IntPtr obj, string swallow, IntPtr content);
76
77                 /// <summary>
78                 /// Sets or gets the disabled state of the circle time picker.
79                 /// </summary>
80                 /// <since_tizen> 6 </since_tizen>
81                 public bool Disable
82                 {
83                     get => !Enable;
84                     set => Enable = !value;
85                 }
86
87                 /// <summary>
88                 /// Sets or gets the enabled state of the circle time picker.
89                 /// </summary>
90                 /// <since_tizen> 6 </since_tizen>
91                 public bool Enable
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 line width of the marker.
105                 /// </summary>
106                 /// <since_tizen> 6 </since_tizen>
107                 public int MarkerLineWidth
108                 {
109                     get
110                     {
111                         return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
112                     }
113                     set
114                     {
115                         Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
116                     }
117                 }
118
119                 /// <summary>
120                 /// Sets or gets the radius of the marker.
121                 /// </summary>
122                 /// <since_tizen> 6 </since_tizen>
123                 public double MarkerRadius
124                 {
125                     get
126                     {
127                         return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
128                     }
129                     set
130                     {
131                         Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
132                     }
133                 }
134             }
135         }
136     }
137 }