[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp.Wearable / ElmSharp.Wearable / CircleDatetimeSelector.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18 using System.ComponentModel;
19 using System.Diagnostics;
20
21 namespace ElmSharp.Wearable
22 {
23     /// <summary>
24     /// The Circle DateTime Selector is a widget to display and handle datetime value by the Rotary event.
25     /// Inherits <see cref="DateTimeSelector"/>.
26     /// </summary>
27     /// <since_tizen> preview </since_tizen>
28     [Obsolete("This has been deprecated in API12")]
29     public class CircleDateTimeSelector : DateTimeSelector, IRotaryActionWidget
30     {
31         IntPtr _circleHandle;
32         CircleSurface _surface;
33
34         /// <summary>
35         /// Creates and initializes a new instance of the Circle DateTime class.
36         /// </summary>
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()
42         {
43             Debug.Assert(parent == null || surface == null || parent.IsRealized);
44             _surface = surface;
45             Realize(parent);
46         }
47
48         /// <summary>
49         /// Creates and initializes a new instance of the Circle DateTimeSelector class.
50         /// </summary>
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))
56         {
57             ((IRotaryActionWidget)this).Activate();
58         }
59
60         /// <summary>
61         /// Gets the handle for the Circle widget.
62         /// </summary>
63         /// <since_tizen> preview </since_tizen>
64         [Obsolete("This has been deprecated in API12")]
65         public virtual IntPtr CircleHandle => _circleHandle;
66
67         /// <summary>
68         /// Gets the handle for the circle surface used in this widget.
69         /// </summary>
70         /// <since_tizen> preview </since_tizen>
71         [Obsolete("This has been deprecated in API12")]
72         public virtual CircleSurface CircleSurface => _surface;
73
74         /// <summary>
75         /// Sets or gets the disabled state of this widget.
76         /// </summary>
77         /// <since_tizen> preview </since_tizen>
78         [Obsolete("Use IsEnabled")]
79         [EditorBrowsable(EditorBrowsableState.Never)]
80         public bool Disabled
81         {
82             get => !IsEnabled;
83             set => IsEnabled = !value;
84         }
85
86         /// <summary>
87         /// Sets or gets the state of the widget, which might be enabled or disabled.
88         /// </summary>
89         /// <since_tizen> preview </since_tizen>
90         [Obsolete("This has been deprecated in API12")]
91         public override bool IsEnabled
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 color of the marker.
105         /// </summary>
106         /// <remarks>
107         /// MarkerColor is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner.
108         /// </remarks>
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
112         {
113             get
114             {
115                 int r, g, b, a;
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);
118             }
119             set
120             {
121                 Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "default", value.R, value.G, value.B, value.A);
122             }
123         }
124
125         /// <summary>
126         /// Sets or gets the line width of the marker.
127         /// </summary>
128         /// <remarks>
129         /// MarkerLineWidth is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner.
130         /// </remarks>
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
134         {
135             get
136             {
137                 return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
138             }
139             set
140             {
141                 Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
142             }
143         }
144
145         /// <summary>
146         /// Sets or gets the radius at which the center of the marker lies.
147         /// </summary>
148         /// <remarks>
149         /// MarkerRadius is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner.
150         /// </remarks>
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
154         {
155             get
156             {
157                 return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
158             }
159             set
160             {
161                 Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
162             }
163         }
164
165         /// <summary>
166         /// Creates a widget handle.
167         /// </summary>
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)
173         {
174             var handle = base.CreateHandle(parent);
175
176             _circleHandle = Interop.Eext.eext_circle_object_datetime_add(RealHandle == IntPtr.Zero ? handle : RealHandle, CircleSurface.Handle);
177
178             return handle;
179         }
180     }
181 }