[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp.Wearable / ElmSharp.Wearable / CircleSpinner.cs
old mode 100644 (file)
new mode 100755 (executable)
index e66fa54..295b2d3
  */
 
 using System;
+using System.ComponentModel;
 using System.Diagnostics;
 
 namespace ElmSharp.Wearable
 {
 
     /// <summary>
-    /// The Circle Spinner is a widget to display and handle spinner value by rotary event
+    /// The Circle Spinner is a widget to display and handle the spinner value by the Rotary event.
     /// Inherits <see cref="Spinner"/>.
     /// </summary>
+    /// <since_tizen> preview </since_tizen>
+    [Obsolete("This has been deprecated in API12")]
     public class CircleSpinner : Spinner, IRotaryActionWidget
     {
         IntPtr _circleHandle;
-        double _angleRatio = 1.0;
+        double _angleRatio = -1.0;
         CircleSurface _surface;
 
         /// <summary>
         /// Creates and initializes a new instance of the Circle Spinner class.
         /// </summary>
-        /// <param name="parent">The parent of new Circle Spinner instance</param>
+        /// <param name="parent">The parent of the new Circle Spinner instance.</param>
         /// <param name="surface">The surface for drawing circle features for this widget.</param>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public CircleSpinner(EvasObject parent, CircleSurface surface) : base()
         {
             Debug.Assert(parent == null || surface == null || parent.IsRealized);
@@ -43,34 +48,85 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Gets the handle for Circle Widget.
+        /// Creates and initializes a new instance of the Circle Spinner class.
         /// </summary>
-        public virtual IntPtr CircleHandle => RealHandle;
+        /// <param name="parent">The parent of the new Circle Spinner instance.</param>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")]
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public CircleSpinner(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent))
+        {
+            ((IRotaryActionWidget)this).Activate();
+        }
 
         /// <summary>
-        /// Gets the handle for Circle Surface used in this widget
+        /// Gets the handle for Circle widget.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
+        public virtual IntPtr CircleHandle => _circleHandle;
+
+        /// <summary>
+        /// Gets the handle for the circle surface used in this widget.
+        /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public virtual CircleSurface CircleSurface => _surface;
 
         /// <summary>
         /// Sets or gets the circle spinner angle per each spinner value.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("Use Step")]
+        [EditorBrowsable(EditorBrowsableState.Never)]
         public double AngleRatio
         {
             get
             {
+                if (_angleRatio <= 0)
+                {
+                    if (Maximum == Minimum)
+                    {
+                        return 0.0;
+                    }
+                    else
+                    {
+                        return 360 / (Maximum - Minimum);
+                    }
+                }
+
                 return _angleRatio;
             }
             set
             {
-                _angleRatio = value;
-                Interop.Eext.eext_circle_object_spinner_angle_set(CircleHandle, _angleRatio);
+                if (value > 0)
+                {
+                    if (_angleRatio == value) return;
+
+                    _angleRatio = value;
+
+                    Interop.Eext.eext_circle_object_spinner_angle_set(CircleHandle, _angleRatio);
+                }
             }
         }
 
         /// <summary>
+        /// Sets or gets the disabled state of this widget.
+        /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("Use IsEnabled")]
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool Disabled
+        {
+            get => !IsEnabled;
+            set => IsEnabled = !value;
+        }
+
+        /// <summary>
         /// Sets or gets the state of the widget, which might be enabled or disabled.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         public override bool IsEnabled
         {
             get
@@ -84,8 +140,13 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets the line width of the marker
+        /// Sets or gets the line width of the marker.
         /// </summary>
+        /// <remarks>
+        /// MarkerLineWidth is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner.
+        /// </remarks>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("MarkerLineWidth is obsolete as of version 6.0.0 and is no longer supported")]
         public int MarkerLineWidth
         {
             get
@@ -99,8 +160,13 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets the color of the marker
+        /// Sets or gets the color of the marker.
         /// </summary>
+        /// <remarks>
+        /// MarkerColor is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner.
+        /// </remarks>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("MarkerColor is obsolete as of version 6.0.0 and is no longer supported")]
         public Color MarkerColor
         {
             get
@@ -116,8 +182,13 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets the radius at which the center of the marker lies
+        /// Sets or gets the radius at which the center of the marker lies.
         /// </summary>
+        /// <remarks>
+        /// MarkerRadius is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner.
+        /// </remarks>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("MarkerRadius is obsolete as of version 6.0.0 and is no longer supported")]
         public double MarkerRadius
         {
             get
@@ -133,12 +204,14 @@ namespace ElmSharp.Wearable
         /// <summary>
         /// Creates a widget handle.
         /// </summary>
-        /// <param name="parent">Parent EvasObject</param>
-        /// <returns>Handle IntPtr</returns>
+        /// <param name="parent">Parent EvasObject.</param>
+        /// <returns>Handle IntPtr.</returns>
+        /// <since_tizen> preview </since_tizen>
+        [Obsolete("This has been deprecated in API12")]
         protected override IntPtr CreateHandle(EvasObject parent)
         {
             IntPtr handle = base.CreateHandle(parent);
-            _circleHandle = Interop.Eext.eext_circle_object_spinner_add(RealHandle == IntPtr.Zero ? Handle : RealHandle, CircleSurface.Handle);
+            _circleHandle = Interop.Eext.eext_circle_object_spinner_add(RealHandle == IntPtr.Zero ? handle : RealHandle, CircleSurface.Handle);
             return handle;
         }
     }