[NUI] Add more comments
authordongsug.song <dongsug.song@samsung.com>
Mon, 2 Sep 2024 12:29:20 +0000 (21:29 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Wed, 11 Sep 2024 11:20:30 +0000 (20:20 +0900)
src/Tizen.NUI/src/public/Accessibility/Accessibility.cs
src/Tizen.NUI/src/public/Animation/AlphaFunction.cs
src/Tizen.NUI/src/public/Animation/Animatable.cs
src/Tizen.NUI/src/public/Animation/Animation.cs
src/Tizen.NUI/src/public/Animation/KeyFrames.cs

index d86a9d27262f7d7cfd42f58b7408b4c1c632fbcf..2fe5a1e341b82d445786d1b23509d32af1efc390 100755 (executable)
@@ -25,11 +25,11 @@ using Tizen.NUI.BaseComponents;
 namespace Tizen.NUI.Accessibility
 {
     /// <summary>
-    /// Accessibility provides Dali-ATSPI interface which has functionality of Screen-Reader and general accessibility
+    /// Accessibility provides Dali-ATSPI interface which has functionality of Screen-Reader and general accessibility.
     /// </summary>
     // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
     [SuppressMessage("Microsoft.Design", "CA1724: Type names should not match namespaces")]
-    [SuppressMessage("Microsoft.Design", "CA1001:Types that own disposable fields should be disposable", Justification = "This is a singleton class and is not disposed")]
+    [SuppressMessage("Microsoft.Design", "CA1001: Types that own disposable fields should be disposable", Justification = "This is a singleton class and is not disposed")]
     [EditorBrowsable(EditorBrowsableState.Never)]
     public static class Accessibility
     {
@@ -99,10 +99,10 @@ namespace Tizen.NUI.Accessibility
 
         #region Method
         /// <summary>
-        /// Start to speak
+        /// Start to speak.
         /// </summary>
-        /// <param name="sentence">Content to be spoken</param>
-        /// <param name="discardable">true to be stopped and discarded when other Say is triggered</param>
+        /// <param name="sentence">Content to be spoken.</param>
+        /// <param name="discardable">true to be stopped and discarded when other Say is triggered.</param>
         /// <returns></returns>
         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -113,9 +113,9 @@ namespace Tizen.NUI.Accessibility
         }
 
         /// <summary>
-        /// To make Say be paused or resumed
+        /// To make Say be paused or resumed.
         /// </summary>
-        /// <param name="pause">true to be paused, false to be resumed</param>
+        /// <param name="pause">true to be paused, false to be resumed.</param>
         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static void PauseResume(bool pause)
@@ -125,9 +125,9 @@ namespace Tizen.NUI.Accessibility
         }
 
         /// <summary>
-        /// Cancels anything screen-reader is reading / has queued to read
+        /// Cancels anything screen-reader is reading / has queued to read.
         /// </summary>
-        /// <param name="alsoNonDiscardable">whether to cancel non-discardable readings as well</param>
+        /// <param name="alsoNonDiscardable">whether to cancel non-discardable readings as well.</param>
         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static void StopReading(bool alsoNonDiscardable)
@@ -137,9 +137,9 @@ namespace Tizen.NUI.Accessibility
         }
 
         /// <summary>
-        /// Suppress reading of screen-reader
+        /// Suppress reading of screen-reader.
         /// </summary>
-        /// <param name="suppress">whether to suppress reading of screen-reader</param>
+        /// <param name="suppress">whether to suppress reading of screen-reader.</param>
         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static bool SuppressScreenReader(bool suppress)
@@ -150,7 +150,7 @@ namespace Tizen.NUI.Accessibility
         }
 
         /// <summary>
-        /// Re-enables auto-initialization of AT-SPI bridge
+        /// Re-enables auto-initialization of AT-SPI bridge.
         /// </summary>
         /// <remarks>
         /// Normal applications do not have to call this function. The AT-SPI bridge is initialized on demand.
@@ -163,7 +163,7 @@ namespace Tizen.NUI.Accessibility
         }
 
         /// <summary>
-        /// Blocks auto-initialization of AT-SPI bridge
+        /// Blocks auto-initialization of AT-SPI bridge.
         /// </summary>
         /// <remarks>
         /// Use this only if your application starts before DBus does, and call it early in Main().
@@ -204,6 +204,7 @@ namespace Tizen.NUI.Accessibility
         /// <summary>
         ///  Get highligted View.
         /// </summary>
+        /// <returns>The currently highlighted view.</returns>
         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static View GetCurrentlyHighlightedView()
@@ -218,6 +219,7 @@ namespace Tizen.NUI.Accessibility
         /// <summary>
         ///  Clear highlight.
         /// </summary>
+        /// <returns>true if the highlight was cleared successfully, otherwise false.</returns>
         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static bool ClearCurrentlyHighlightedView()
@@ -243,30 +245,35 @@ namespace Tizen.NUI.Accessibility
             // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
             [EditorBrowsable(EditorBrowsableState.Never)]
             Invalid = -1,
+
             /// <summary>
             /// Cancelled
             /// </summary>
             // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
             [EditorBrowsable(EditorBrowsableState.Never)]
             Cancelled = 1,
+
             /// <summary>
             /// Stopped
             /// </summary>
             // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
             [EditorBrowsable(EditorBrowsableState.Never)]
             Stopped = 2,
+
             /// <summary>
             /// Skipped
             /// </summary>
             // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
             [EditorBrowsable(EditorBrowsableState.Never)]
             Skipped = 3,
+
             /// <summary>
             /// Paused
             /// </summary>
             // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
             [EditorBrowsable(EditorBrowsableState.Never)]
             Paused = 4,
+
             /// <summary>
             /// Resumed
             /// </summary>
index a37e21692f78711929a4dc2136c1b160099e1a46..227f105d7c1d1f2cfe1d6e842d1c681925341aea 100755 (executable)
@@ -25,6 +25,21 @@ namespace Tizen.NUI
     /// Understanding an animation as a parametric function over time, the alpha function is applied to the parameter of
     /// the animation before computing the final animation value.
     /// </summary>
+    /// <example><code>
+    /// View view = new View()
+    /// {
+    ///     Size2D = new Size2D(100, 100),
+    ///     Position2D = new Position2D(100, 100),
+    ///     BackgroundColor = Color.Red,
+    /// };
+    /// Window.Default.Add(view);
+    /// Animation animation = new Animation();
+    /// const float destinationValue = 300.0f;
+    /// const int startTime = 0; // animation starts at 0 second point. no delay.
+    /// const int endTime = 5000; // animation ends at 5 second point.
+    /// animation.AnimateTo(view, "PositionX", destinationValue, startTime, endTime, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseIn));
+    /// animation.Play();
+    /// </code></example>
     /// <since_tizen> 3 </since_tizen>
     public class AlphaFunction : Disposable
     {
@@ -85,24 +100,24 @@ namespace Tizen.NUI
         // }
 
         /// <summary>
-        /// This specifies the various types of BuiltinFunctions.
+        /// This specifies the various types of built-in alpha functions available for animations.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names")]
         public enum BuiltinFunctions
         {
             /// <summary>
-            /// Linear.
+            /// Default alpha function. Linear alpha function.
             /// </summary>
             [Description("DEFAULT")]
             Default,
             /// <summary>
-            /// No transformation.
+            /// Linear alpha function. (No transformation)
             /// </summary>
             [Description("LINEAR")]
             Linear,
             /// <summary>
-            /// Reverse linear.
+            /// Reverse linear alpha function.
             /// </summary>
             [Description("REVERSE")]
             Reverse,
index 31441e057e098bd2e1bcbefb012687b220264ef1..fc2a77cce480d04c452aa7acda1945af4980dff1 100755 (executable)
@@ -21,8 +21,46 @@ namespace Tizen.NUI
 {
 
     /// <summary>
-    /// Animatable.
+    /// The class that represents an object capable of animation is the parent class of the minimum unit of visual, View. 
+    /// When a property is an animatable property, it means that its value can change continuously as the target of an animation. 
+    /// In this case, if a property notification callback is set, you can receive the callback according to the changing values. 
+    /// Additionally, users can also add their own properties.
     /// </summary>
+    /// <example><code>
+    /// View view = new View()
+    /// {
+    ///     Size2D = new Size2D(100, 100),
+    ///     Position2D = new Position2D(100, 100),
+    ///     BackgroundColor = Color.Red,
+    /// };
+    ///
+    /// Window.Default.Add(view);
+    /// Animation animation = new Animation();
+    /// const float destinationValue = 300.0f;
+    /// const int startTime = 0; // animation starts at 0 second point. no delay.
+    /// const int endTime = 5000; // animation ends at 5 second point.
+    /// animation.AnimateTo(view, "PositionX", destinationValue, startTime, endTime, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInSine));
+    /// animation.Play();
+    ///
+    /// PropertyNotification propertyNotification = view.AddPropertyNotification("position", PropertyCondition.Step(10.0f));
+    /// propertyNotification.Notified += (object source, PropertyNotification.NotifyEventArgs args) =>
+    /// {
+    ///     Animatable target = args.PropertyNotification.GetTarget();
+    ///     if (target is View viewTarget)
+    ///     {
+    ///         Tizen.Log.Debug("NUI", $"postion changed! ({viewTarget.CurrentPosition.X},{viewTarget.CurrentPosition.Y})");
+    ///     }
+    /// };
+    ///
+    /// Animatable animatable = new Animatable();
+    /// int myPropertyIndex = animatable.RegisterProperty("myProperty", new PropertyValue(100), PropertyAccessMode.ReadWrite);
+    /// animatable.GetProperty(myPropertyIndex).Get(out int aValue);
+    /// Tizen.Log.Debug("NUI", $"myProperty value : {aValue} (should be 100)");
+    ///
+    /// animatable.SetProperty(myPropertyIndex, new PropertyValue(200));
+    /// animatable.GetProperty(myPropertyIndex).Get(out aValue);
+    /// Tizen.Log.Debug("NUI", $"myProperty value : {aValue} (should be 200)");
+    /// </code></example>
     /// <since_tizen> 3 </since_tizen>
     public class Animatable : BaseHandle
     {
index b8e4d321c9dcd818cd7937fed9d60eb61cc4545c..308560b121e1215eb0b0857a3140c760b2ebb68c 100755 (executable)
@@ -35,6 +35,23 @@ namespace Tizen.NUI
     /// The overall animation time is superseded by the values given in the animation time used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.<br />
     /// If any of the individual calls to those functions exceeds the overall animation time (Duration), then the overall animation time is automatically extended.<br />
     /// </summary>
+    /// <example><code>
+    /// View view = new View()
+    /// {
+    ///     Size2D = new Size2D(100, 100),
+    ///     Position2D = new Position2D(100, 100),
+    ///     BackgroundColor = Color.Red,
+    /// };
+    ///
+    /// Window.Default.Add(view);
+    /// Animation animation = new Animation();
+    /// const float destinationValue = 300.0f;
+    /// const int startTime = 0; // animation starts at 0 second point. no delay.
+    /// const int endTime = 5000; // animation ends at 5 second point.
+    /// animation.AnimateTo(view, "PositionX", destinationValue, startTime, endTime); // position x animation.
+    /// animation.AnimateTo(view, "SizeHeight", destinationValue + 100, startTime + 1000, endTime + 2000); // size height animation.
+    /// animation.Play();
+    /// </code></example>
     /// <since_tizen> 3 </since_tizen>
     public class Animation : BaseHandle
     {
@@ -1252,6 +1269,10 @@ namespace Tizen.NUI
         /// <summary>
         /// Plays the animation.
         /// </summary>
+        /// <example><code>
+        /// var animation = new Animation();
+        /// animation.Play();
+        /// </code></example>
         /// <since_tizen> 3 </since_tizen>
         public void Play()
         {
@@ -1291,6 +1312,11 @@ namespace Tizen.NUI
         /// <summary>
         /// Pauses the animation.
         /// </summary>
+        /// <example><code>
+        /// var animation = new Animation();
+        /// animation.Play();
+        /// animation.Pause();
+        /// </code></example>
         /// <since_tizen> 3 </since_tizen>
         public void Pause()
         {
@@ -1301,6 +1327,11 @@ namespace Tizen.NUI
         /// <summary>
         /// Stops the animation.
         /// </summary>
+        /// <example><code>
+        /// var animation = new Animation();
+        /// animation.Play();
+        /// animation.Stop();
+        /// </code></example>
         /// <since_tizen> 3 </since_tizen>
         public void Stop()
         {
index 818e1913ca4e3587655ac54024a1062dcd1fb1ad..1fd29ec80038c5f600aca6167349dd3fdda4a9af 100755 (executable)
@@ -23,6 +23,24 @@ namespace Tizen.NUI
     /// A set of key frames for a property that can be animated using DALi animation.<br />
     /// This allows the generation of key frame objects from individual Property::Values.<br />
     /// </summary>
+    /// <example><code>
+    /// View view = new View()
+    /// {
+    ///     Size2D = new Size2D(100, 100),
+    ///     Position2D = new Position2D(100, 100),
+    ///     BackgroundColor = Color.Red,
+    /// };
+    ///
+    /// Window.Default.Add(view);
+    /// Animation animation = new Animation(5000); // 5s duration.
+    /// KeyFrames keyFrames = new KeyFrames();
+    /// keyFrames.Add(0.0f, new Rotation(new Radian(new Degree(-32.0f)), Vector3.ZAxis));
+    /// keyFrames.Add(0.3f, new Rotation(new Radian(new Degree(133.0f)), Vector3.ZAxis));
+    /// keyFrames.Add(0.75f, new Rotation(new Radian(new Degree(-12.0f)), Vector3.ZAxis));
+    /// keyFrames.Add(1.0f, new Rotation(new Radian(new Degree(135.0f)), Vector3.ZAxis));
+    /// animation.AnimateBetween(view, "Orientation", keyFrames);
+    /// animation.Play();
+    /// </code></example>
     /// <since_tizen> 3 </since_tizen>
     public class KeyFrames : BaseHandle
     {
@@ -108,6 +126,7 @@ namespace Tizen.NUI
         /// <summary>
         /// Get the number of added key frame.
         /// </summary>
+        /// <returns>The number of key frames currently added to the KeyFrames object.</returns>
         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public uint GetKeyFrameCount()