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
24 /// The Circle DateTime Selector is a widget to display and handle datetime value by the Rotary event.
25 /// Inherits <see cref="DateTimeSelector"/>.
27 /// <since_tizen> preview </since_tizen>
28 [Obsolete("This has been deprecated in API12")]
29 public class CircleDateTimeSelector : DateTimeSelector, IRotaryActionWidget
32 CircleSurface _surface;
35 /// Creates and initializes a new instance of the Circle DateTime class.
37 /// <param name="parent">The parent of the new Circle DateTime instance.</param>
38 /// <param name="surface">The surface for drawing circle features for this widget.</param>
39 /// <since_tizen> preview </since_tizen>
40 [Obsolete("This has been deprecated in API12")]
41 public CircleDateTimeSelector(EvasObject parent, CircleSurface surface) : base()
43 Debug.Assert(parent == null || surface == null || parent.IsRealized);
49 /// Creates and initializes a new instance of the Circle DateTimeSelector class.
51 /// <param name="parent">The parent of the new Circle DateTimeSelector instance.</param>
52 /// <since_tizen> preview </since_tizen>
53 [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")]
54 [EditorBrowsable(EditorBrowsableState.Never)]
55 public CircleDateTimeSelector(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent))
57 ((IRotaryActionWidget)this).Activate();
61 /// Gets the handle for the Circle widget.
63 /// <since_tizen> preview </since_tizen>
64 [Obsolete("This has been deprecated in API12")]
65 public virtual IntPtr CircleHandle => _circleHandle;
68 /// Gets the handle for the circle surface used in this widget.
70 /// <since_tizen> preview </since_tizen>
71 [Obsolete("This has been deprecated in API12")]
72 public virtual CircleSurface CircleSurface => _surface;
75 /// Sets or gets the disabled state of this widget.
77 /// <since_tizen> preview </since_tizen>
78 [Obsolete("Use IsEnabled")]
79 [EditorBrowsable(EditorBrowsableState.Never)]
83 set => IsEnabled = !value;
87 /// Sets or gets the state of the widget, which might be enabled or disabled.
89 /// <since_tizen> preview </since_tizen>
90 [Obsolete("This has been deprecated in API12")]
91 public override bool IsEnabled
95 return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
99 Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
104 /// Sets or gets the color of the marker.
107 /// MarkerColor is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner.
109 /// <since_tizen> preview </since_tizen>
110 [Obsolete("MarkerColor is obsolete as of version 6.0.0 and is no longer supported")]
111 public Color MarkerColor
116 Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "default", out r, out g, out b, out a);
117 return new Color(r, g, b, a);
121 Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "default", value.R, value.G, value.B, value.A);
126 /// Sets or gets the line width of the marker.
129 /// MarkerLineWidth is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner.
131 /// <since_tizen> preview </since_tizen>
132 [Obsolete("MarkerLineWidth is obsolete as of version 6.0.0 and is no longer supported")]
133 public int MarkerLineWidth
137 return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
141 Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
146 /// Sets or gets the radius at which the center of the marker lies.
149 /// MarkerRadius is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner.
151 /// <since_tizen> preview </since_tizen>
152 [Obsolete("MarkerRadius is obsolete as of version 6.0.0 and is no longer supported")]
153 public double MarkerRadius
157 return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
161 Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
166 /// Creates a widget handle.
168 /// <param name="parent">Parent EvasObject.</param>
169 /// <returns>Handle IntPtr.</returns>
170 /// <since_tizen> preview </since_tizen>
171 [Obsolete("This has been deprecated in API12")]
172 protected override IntPtr CreateHandle(EvasObject parent)
174 var handle = base.CreateHandle(parent);
176 _circleHandle = Interop.Eext.eext_circle_object_datetime_add(RealHandle == IntPtr.Zero ? handle : RealHandle, CircleSurface.Handle);