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.
19 namespace ElmSharp.Wearable
22 /// The Circle DateTime Selector is a widget to display and handle datetime value by rotary event
23 /// Inherits <see cref="DateTimeSelector"/>
25 public class CircleDateTimeSelector : DateTimeSelector
30 /// Creates and initializes a new instance of the Circle DateTime class
32 /// <param name="parent">The parent of new Circle DateTime instance</param>
33 public CircleDateTimeSelector(EvasObject parent) : base(parent) { }
36 /// Sets or gets the disabled state of the Circle DateTime Selector
42 return Interop.Eext.eext_circle_object_disabled_get(circleHandle);
46 Interop.Eext.eext_circle_object_disabled_set(circleHandle, value);
51 /// Sets or gets the color of the marker
53 public Color MarkerColor
58 Interop.Eext.eext_circle_object_item_color_get(circleHandle, "default", out r, out g, out b, out a);
59 return new Color(r, g, b, a);
63 Interop.Eext.eext_circle_object_item_color_set(circleHandle, "default", value.R, value.G, value.B, value.A);
68 /// Sets or gets the line width of the marker
70 public int MarkerLineWidth
74 return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "default");
78 Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "default", value);
83 /// Sets or gets the radius at which the center of the marker lies
85 public double MarkerRadius
89 return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "default");
93 Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "default", value);
98 /// Creates a widget handle.
100 /// <param name="parent">Parent EvasObject</param>
101 /// <returns>Handle IntPtr</returns>
102 protected override IntPtr CreateHandle(EvasObject parent)
104 var handle = base.CreateHandle(parent);
106 IntPtr surface = IntPtr.Zero;
108 if (parent is Conformant)
110 surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
112 else if (parent is Naviframe)
114 surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
116 else if (parent is Layout)
118 surface = Interop.Eext.eext_circle_surface_layout_add(parent);
121 circleHandle = Interop.Eext.eext_circle_object_datetime_add(RealHandle, surface);
122 if (surface == IntPtr.Zero)
124 EvasObject p = parent;
125 while (!(p is Window))
129 var w = (p as Window).ScreenSize.Width;
130 var h = (p as Window).ScreenSize.Height;
131 Interop.Evas.evas_object_resize(circleHandle, w, h);
134 Interop.Eext.eext_rotary_object_event_activated_set(circleHandle, true);