Review ElmSharp.Wearable API cs files
[platform/core/csapi/tizenfx.git] / src / ElmSharp.Wearable / ElmSharp.Wearable / CircleScroller.cs
index e60f31e..fe1c44f 100644 (file)
  */
 
 using System;
+using System.ComponentModel;
 using System.Diagnostics;
 
 namespace ElmSharp.Wearable
 {
     /// <summary>
-    /// Circle scroller provides scrollbar with circular movement and is scrolled by rotary event.
+    /// Circle scroller provides the scrollbar with a circular movement, and is scrolled by the Rotary event.
     /// </summary>
+    /// <since_tizen> preview </since_tizen>
     public class CircleScroller : Scroller, IRotaryActionWidget
     {
         IntPtr _circleHandle;
@@ -32,6 +34,7 @@ namespace ElmSharp.Wearable
         /// </summary>
         /// <param name="parent">The <see cref="EvasObject"/> to which the new CircleScroller will be attached as a child.</param>
         /// <param name="surface">The surface for drawing circle features for this widget.</param>
+        /// <since_tizen> preview </since_tizen>
         public CircleScroller(EvasObject parent, CircleSurface surface) : base()
         {
             Debug.Assert(parent == null || surface == null || parent.IsRealized);
@@ -40,37 +43,65 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Gets the handle for Circle Widget.
+        /// Creates and initializes a new instance of the Circle Scroller class.
         /// </summary>
+        /// <param name="parent">The parent of the new Circle CircleScroller 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 CircleScroller(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent))
+        {
+            ((IRotaryActionWidget)this).Activate();
+        }
+
+        /// <summary>
+        /// Gets the handle for the Circle widget.
+        /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public virtual IntPtr CircleHandle => _circleHandle;
 
         /// <summary>
-        /// Gets the handle for Circle Surface used in this widget
+        /// Gets the handle for the circle surface used in this widget.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public virtual CircleSurface CircleSurface => _surface;
 
         /// <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>
         public override bool IsEnabled
         {
             get
             {
-                return !Interop.Eext.eext_circle_object_disabled_get(Handle);
+                return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
             }
             set
             {
-                Interop.Eext.eext_circle_object_disabled_set(Handle, !value);
+                Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
             }
         }
 
         /// <summary>
-        /// Sets or gets the value of HorizontalScrollBarVisiblePolicy
+        /// Sets or gets the value of HorizontalScrollBarVisiblePolicy.
         /// </summary>
         /// <remarks>
-        /// ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden.
+        /// ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, otherwise kept hidden.
         /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
         /// </remarks>
+        /// <since_tizen> preview </since_tizen>
         public override ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy
         {
             get
@@ -87,12 +118,13 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets the value of VerticalScrollBarVisiblePolicy
+        /// Sets or gets the value of VerticalScrollBarVisiblePolicy.
         /// </summary>
         /// <remarks>
-        /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden.
+        /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, otherwise kept hidden.
         /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
         /// </remarks>
+        /// <since_tizen> preview </since_tizen>
         public override ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy
         {
             get
@@ -109,8 +141,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets color of the vertical scroll bar.
+        /// Sets or gets the color of the vertical scroll bar.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public Color VerticalScrollBarColor
         {
             get
@@ -129,8 +162,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets color of the horizontal scroll bar.
+        /// Sets or gets the color of the horizontal scroll bar.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public Color HorizontalScrollBarColor
         {
             get
@@ -149,8 +183,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets color of the vertical scroll background.
+        /// Sets or gets the color of the vertical scroll background.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public Color VerticalScrollBackgroundColor
         {
             get
@@ -169,8 +204,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets color of the horizontal scroll background.
+        /// Sets or gets the color of the horizontal scroll background.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public Color HorizontalScrollBackgroundColor
         {
             get
@@ -189,8 +225,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets line width of the vertical scroll bar.
+        /// Sets or gets the line width of the vertical scroll bar.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public int VerticalScrollBarLineWidth
         {
             get
@@ -204,8 +241,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets line width of the horizontal scroll bar.
+        /// Sets or gets the line width of the horizontal scroll bar.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public int HorizontalScrollBarLineWidth
         {
             get
@@ -219,8 +257,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets line width of the vertical scroll background.
+        /// Sets or gets the line width of the vertical scroll background.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public int VerticalScrollBackgroundLineWidth
         {
             get
@@ -234,8 +273,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets line width of the horizontal scroll background.
+        /// Sets or gets the line width of the horizontal scroll background.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public int HorizontalScrollBackgroundLineWidth
         {
             get
@@ -249,8 +289,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets radius of the vertical scroll bar.
+        /// Sets or gets the radius of the vertical scroll bar.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public double VerticalScrollBarRadius
         {
             get
@@ -264,8 +305,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets radius of the horizontal scroll bar.
+        /// Sets or gets the radius of the horizontal scroll bar.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public double HorizontalScrollBarRadius
         {
             get
@@ -279,8 +321,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets radius of the vertical scroll background.
+        /// Sets or gets the radius of the vertical scroll background.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public double VerticalScrollBackgroundRadius
         {
             get
@@ -294,8 +337,9 @@ namespace ElmSharp.Wearable
         }
 
         /// <summary>
-        /// Sets or gets radius of the horizontal scroll background.
+        /// Sets or gets the radius of the horizontal scroll background.
         /// </summary>
+        /// <since_tizen> preview </since_tizen>
         public double HorizontalScrollBackgroundRadius
         {
             get
@@ -311,12 +355,13 @@ 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>
         protected override IntPtr CreateHandle(EvasObject parent)
         {
             IntPtr handle = base.CreateHandle(parent);
-            _circleHandle = Interop.Eext.eext_circle_object_scroller_add(RealHandle == IntPtr.Zero ? Handle : RealHandle, CircleSurface.Handle);
+            _circleHandle = Interop.Eext.eext_circle_object_scroller_add(RealHandle == IntPtr.Zero ? handle : RealHandle, CircleSurface.Handle);
             return handle;
         }
     }