[NUI] Make some API to public and fill missing comments. (#1565)
authorJiyun Yang <ji.yang@samsung.com>
Fri, 24 Apr 2020 07:34:04 +0000 (16:34 +0900)
committerGitHub <noreply@github.com>
Fri, 24 Apr 2020 07:34:04 +0000 (16:34 +0900)
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI.Components/Controls/Button.cs
src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs
src/Tizen.NUI/src/public/Layer.cs
src/Tizen.NUI/src/public/ViewProperty/Shadow.cs

index 9b14e73..7f004f8 100755 (executable)
@@ -910,7 +910,7 @@ namespace Tizen.NUI.Components
                 targetState |= (IsSelected ? ControlStates.Selected : (IsFocused ? ControlStates.Focused : 0));
             }
 
-            if (SetControlState(targetState, touchInfo))
+            if (SetControlState(targetState, ControlStateChangedInfo.InputMethodType.Touch, touchInfo))
             {
                 OnUpdate();
 
index 3c1e00e..dce2d47 100755 (executable)
@@ -904,12 +904,24 @@ namespace Tizen.NUI.BaseComponents
             return new LottieFrameInfo(stillImageFrame, stillImageFrame);
         }
 
-        internal bool IsStillImage()
+        /// <summary>
+        /// Inhouse API.
+        /// Whether this LottieFrameInfo represents one frame or more.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsStillImage()
         {
             return StartFrame == EndFrame;
         }
 
-        internal void Show(LottieAnimationView lottieView, bool noPlay = false)
+        /// <summary>
+        /// Inhouse API.
+        /// Play specified LottieAnimationView with this frame information.
+        /// </summary>
+        /// <param name="lottieView">The target LottieAnimationView to play.</param>
+        /// <param name="noPlay">Whether go direct to the EndFrame. It is false by default.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Show(LottieAnimationView lottieView, bool noPlay = false)
         {
             if (!BeReadyToShow(lottieView))
             {
index fac5d60..668902c 100755 (executable)
@@ -193,46 +193,10 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                SetControlState(value, null);
+                SetControlState(value, ControlStateChangedInfo.InputMethodType.None, null);
             }
         }
 
-        /// <summary>
-        /// Set ControlState with specified change environment
-        /// </summary>
-        /// <param name="state">New state value</param>
-        /// <param name="touchInfo">The touch information in case the state has changed by touching.</param>
-        /// <return>True, if the state changed successfully.</return>
-        internal bool SetControlState(ControlStates state, Touch touchInfo)
-        {
-            if (controlStates == state)
-            {
-                return false;
-            }
-
-            var prevState = controlStates;
-
-            controlStates = state;
-
-            var changeInfo = new ControlStateChangedInfo(prevState, state, ControlStateChangedInfo.InputMethodType.Touch, touchInfo);
-
-            ControlStateChangeEventInternal?.Invoke(this, changeInfo);
-
-            OnControlStateChanged(changeInfo);
-
-            if (controlStatePropagation)
-            {
-                foreach (View child in Children)
-                {
-                    child.SetControlState(state, touchInfo);
-                }
-            }
-
-            ControlStateChangeEvent?.Invoke(this, changeInfo);
-
-            return true;
-        }
-
         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public bool IsResourcesCreated
@@ -2345,6 +2309,44 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// Set ControlState with specified inpu environment
+        /// </summary>
+        /// <param name="state">New state value</param>
+        /// <param name="inputMethod">Indicates the input method that triggered this change.</param>
+        /// <param name="inputData">The input method data that depends on the inputMethod.</param>
+        /// <return>True, if the state changed successfully.</return>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected bool SetControlState(ControlStates state, ControlStateChangedInfo.InputMethodType inputMethod, object inputData)
+        {
+            if (controlStates == state)
+            {
+                return false;
+            }
+
+            var prevState = controlStates;
+
+            controlStates = state;
+
+            var changeInfo = new ControlStateChangedInfo(prevState, state, inputMethod, inputData);
+
+            ControlStateChangeEventInternal?.Invoke(this, changeInfo);
+
+            OnControlStateChanged(changeInfo);
+
+            if (controlStatePropagation)
+            {
+                foreach (View child in Children)
+                {
+                    child.SetControlState(state, inputMethod, inputData);
+                }
+            }
+
+            ControlStateChangeEvent?.Invoke(this, changeInfo);
+
+            return true;
+        }
+
+        /// <summary>
         /// Called after the View's ControlStates changed.
         /// </summary>
         /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
index 6653d85..c33ae89 100755 (executable)
@@ -1057,13 +1057,18 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// The class represents the information of the situation where the View's control state changes.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public class ControlStateChangedInfo
         {
             /// <summary>
-            /// The previous control state.
+            /// Create an instance with mandatory fields.
             /// </summary>
+            /// <param name="previousState">The previous control state.</param>
+            /// <param name="currentState">The current control state.</param>
+            /// <param name="inputMethod">Indicates the input method that triggered this change.</param>
+            /// <param name="inputData">The input method data that depends on the inputMethod.</param>
             [EditorBrowsable(EditorBrowsableState.Never)]
             public ControlStateChangedInfo(ControlStates previousState, ControlStates currentState, InputMethodType inputMethod, object inputData)
             {
index e788546..34cefd1 100755 (executable)
@@ -528,6 +528,32 @@ namespace Tizen.NUI
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// Inhouse API.
+        /// This allows the user to specify whether this layer should consume touch (including gestures).
+        /// If set, any layers behind this layer will not be hit-test.
+        /// </summary>
+        /// <param name="consume">Whether the layer should consume touch (including gestures).</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetTouchConsumed(bool consume)
+        {
+            Interop.Layer.Layer_SetTouchConsumed(swigCPtr, consume);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Inhouse API.
+        /// This allows the user to specify whether this layer should consume hover.
+        /// If set, any layers behind this layer will not be hit-test.
+        /// </summary>
+        /// <param name="consume">Whether the layer should consume hover</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetHoverConsumed(bool consume)
+        {
+            Interop.Layer.Layer_SetHoverConsumed(swigCPtr, consume);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
         internal uint GetDepth()
         {
             var parentChildren = window?.LayersChildren;
@@ -603,25 +629,12 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal void SetTouchConsumed(bool consume)
-        {
-            Interop.Layer.Layer_SetTouchConsumed(swigCPtr, consume);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
         internal bool IsTouchConsumed()
         {
             bool ret = Interop.Layer.Layer_IsTouchConsumed(swigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
-
-        internal void SetHoverConsumed(bool consume)
-        {
-            Interop.Layer.Layer_SetHoverConsumed(swigCPtr, consume);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
         internal bool IsHoverConsumed()
         {
             bool ret = Interop.Layer.Layer_IsHoverConsumed(swigCPtr);
index 72dfe8a..a0951d5 100644 (file)
@@ -21,7 +21,7 @@ namespace Tizen.NUI
 {
 
     /// <summary>
-    /// The platform provided shadow drawing for View
+    /// Represents a shadow with color and blur radius for a View.
     /// </summary>
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class Shadow : ShadowBase
@@ -30,7 +30,9 @@ namespace Tizen.NUI
 
         private static readonly Color defaultColor = new Color(0, 0, 0, 0.5f);
 
-        /// <summary></summary>
+        /// <summary>
+        /// Create a Shadow with default values.
+        /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Shadow() : base()
         {
@@ -38,7 +40,9 @@ namespace Tizen.NUI
             Color = defaultColor;
         }
 
-        /// <summary></summary>
+        /// <summary>
+        /// Create a Shadow with custom values.
+        /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Shadow(float blurRadius, Vector2 offset, Color color, Vector2 extents) : base(offset, extents)
         {
@@ -46,13 +50,17 @@ namespace Tizen.NUI
             Color = color;
         }
 
-        /// <summary></summary>
+        /// <summary>
+        /// Copy constructor.
+        /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Shadow(Shadow other) : this(other.BlurRadius, other.Offset, other.Color, other.Extents)
         {
         }
 
-        /// <summary></summary>
+        /// <summary>
+        /// Create a Shadow from a propertyMap.
+        /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
         internal Shadow(PropertyMap propertyMap) : base(propertyMap)
         {
@@ -70,6 +78,7 @@ namespace Tizen.NUI
         /// <remark>
         /// Negative value is ignored. (no blur)
         /// </remark>
+        [EditorBrowsable(EditorBrowsableState.Never)]
         public float BlurRadius { get; set; }
 
         /// <inheritdoc/>